@using DTO;
|
@{
|
ViewBag.Title = "CooperOrder";
|
Layout = "~/Views/Shared/_Layout_Search.cshtml";
|
|
List<PageEntity> ActionInfo2 = ViewData["ActionInfo2"] as List<PageEntity>;
|
|
string Creater = ViewData["Creater"] as string;
|
}
|
@section headerStyle{
|
<script type="text/javascript">
|
var OrderType = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.OrderType))';
|
|
var users = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.users))';
|
var Khlx = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.Khlx))';
|
var HuifangStatus = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.HuifangStatus))';
|
var PingjiaStatus = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.PingjiaStatus))';
|
var ShouliStatus = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.ShouliStatus))';
|
|
|
var pageEntities = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.pageEntities))';
|
var pageEntitiesJson = JSON.parse(pageEntities);
|
|
var shoulibool = true;
|
var chedanbool = true;
|
var wangongbool = true;
|
var songhuobool = true;
|
var huifangbool = true;
|
var pingjiabool = true;
|
var youhuibool = true;
|
|
for (var i = 0, l = pageEntitiesJson.length; i < l; i++) {
|
|
if (pageEntitiesJson[i].PageName == "受理") {
|
shoulibool = false;
|
} else if (pageEntitiesJson[i].PageName == "撤单") {
|
chedanbool = false;
|
} else if (pageEntitiesJson[i].PageName == "确认订单") {
|
wangongbool = false;
|
} else if (pageEntitiesJson[i].PageName == "送货") {
|
songhuobool = false;
|
} else if (pageEntitiesJson[i].PageName == "回访") {
|
huifangbool = false;
|
} else if (pageEntitiesJson[i].PageName == "评价") {
|
pingjiabool = false;
|
} else if (pageEntitiesJson[i].PageName == "优惠") {
|
youhuibool = false;
|
}
|
}
|
//gridConfig = { multiselect: true, selectcol: "Id" };
|
loseherght = 60;
|
dataCol = [
|
{ label: 'id', name: 'Id', labtype: 'txt', hidden: true },
|
{ label: '下单时间', name: 'XdTimeName', labtype: 'txt', hidden: false, width: 100 },
|
{
|
label: '订单号', name: 'OrderNo', labtype: 'txt', hidden: false, width: 100,
|
formatter: function (cellvalue, options, rowObject) {
|
var color = "";
|
if (rowObject.OrderType == '08') {
|
color = "red";
|
}
|
|
if (rowObject.ShouliStatus == "A") {
|
return "<a onclick=\"OpenWindow('" + cellvalue.replace(/'/g, '') + "','98%','100%', '/CooperOrder/Edit?id=" + rowObject.Id + "&ShouliStatus=" + rowObject.ShouliStatus + "')\" ><span style='color:" + color + ";'>" + cellvalue + "</span></a>";
|
} else {
|
return "<a onclick=\"OpenWindow('" + cellvalue.replace(/'/g, '') + "','98%','100%', '/CooperOrder/Edit?id=" + rowObject.Id + "&ShouliStatus=" + rowObject.ShouliStatus + "')\" ><span style='color:" + color + ";'>" + cellvalue + "</span></a>";
|
}
|
|
}
|
},
|
|
{
|
label: '订单类别', name: 'OrderTypeName', labtype: 'txt', hidden: false, width: 100,
|
formatter: function (cellvalue, options, rowObject) {
|
var OrderTypea = rowObject.OrderTypeName;
|
if (rowObject.OrderType1Name != null && rowObject.OrderType1Name != '') {
|
OrderTypea += '-' + rowObject.OrderType1Name;
|
}
|
if (rowObject.OrderType2 != null && rowObject.OrderType2 != '') {
|
OrderTypea += '-' + rowObject.OrderType2;
|
}
|
return OrderTypea;
|
} },
|
{ label: '客户名称', name: 'KhdwName', labtype: 'txt', hidden: false, width: 200 },
|
|
{ label: '数量', name: 'OrderNum', labtype: 'txt', hidden: false, width: 60 },
|
{ label: '单价', name: 'Price', labtype: 'txt', hidden: false, width: 60 },
|
|
{ label: '金额', name: 'Money', labtype: 'txt', hidden: false, width: 60 },
|
{ label: '订单状态', name: 'ShouliStatusName', labtype: 'txt', hidden: false, width: 60 },
|
{ label: '制单人', name: 'CreaterName', labtype: 'txt', hidden: false, width: 60 },
|
{
|
label: '受理', name: 'ShouliStatus', labtype: 'txt', hidden: shoulibool, width: 60,
|
formatter: function (cellvalue, options, rowObject) {
|
if (rowObject.ShouliStatus == '1') {
|
return "<a onclick=\"shouli('" + rowObject.Id + "')\" >受理</a>";
|
} else {
|
return "√";
|
}
|
|
}
|
},
|
{
|
label: '撤单', name: 'ChedanStatusName', labtype: 'txt', hidden: chedanbool, width: 60,
|
formatter: function (cellvalue, options, rowObject) {
|
if (rowObject.ChedanStatus == 'D') {
|
if (rowObject.ShouliStatus == '1' || rowObject.ShouliStatus == '4' || rowObject.ShouliStatus == '5' ) {
|
return "";
|
} else {
|
return "<a onclick=\"chedan('" + rowObject.Id + "')\" >撤单</a>";
|
}
|
|
} else {
|
return "√";
|
}
|
}
|
},
|
{
|
label: '确认订单', name: 'WangongStatusName', labtype: 'txt', hidden: false, width: 60,
|
formatter: function (cellvalue, options, rowObject) {
|
if (rowObject.WangongStatus == 'A' ) {
|
return "√";
|
} else {
|
if (rowObject.ShouliStatus == '1' || rowObject.ChedanStatus == 'A' || rowObject.OrderType != '08' ) {
|
return "";
|
} else {
|
return "<a onclick=\"wangong('" + rowObject.Id + "')\" >确认订单</a>";
|
}
|
|
}
|
}
|
},
|
{
|
label: '送货', name: 'SonghuoStatusName', labtype: 'txt', hidden: songhuobool, width: 60,
|
formatter: function (cellvalue, options, rowObject) {
|
if (rowObject.ShouliStatus == '5') {
|
return "<a onclick=\"songhuo('" + rowObject.Id + "')\" >√</a>";
|
} else {
|
if (rowObject.ShouliStatus == '1' || rowObject.ChedanStatus == 'A') {
|
return "";
|
} else {
|
return "<a onclick=\"songhuo('" + rowObject.Id + "')\" >送货</a>";
|
}
|
|
}
|
}
|
},
|
{
|
label: '回访', name: 'HuifangStatusName', labtype: 'txt', hidden: huifangbool, width: 60,
|
formatter: function (cellvalue, options, rowObject) {
|
if (rowObject.HuifangStatus == 'D') {
|
if (rowObject.ShouliStatus == '1') {
|
return "";
|
} else {
|
return "<a onclick=\"huifang('" + rowObject.Id + "')\" >回访</a>";
|
}
|
|
} else {
|
return "<a onclick=\"huifang('" + rowObject.Id + "')\" >√</a>";
|
}
|
}
|
},
|
{
|
label: '评价', name: 'PingjiaStatusName', labtype: 'txt', hidden: true, width: 60,
|
formatter: function (cellvalue, options, rowObject) {
|
if (rowObject.PingjiaStatus == 'D') {
|
if (rowObject.ShouliStatus == '1') {
|
return "";
|
} else {
|
return "<a onclick=\"pingjia('" + rowObject.Id + "')\" >评价</a>";
|
}
|
|
} else {
|
return "√";
|
}
|
}
|
},
|
{
|
label: '优惠/元', name: 'Youhui', labtype: 'txt', hidden: youhuibool, width: 60,
|
//formatter: function (cellvalue, options, rowObject) {
|
// if (rowObject.YouhuiStatus == null || rowObject.YouhuiStatus == 'null' || rowObject.YouhuiStatus == '') {
|
// if (rowObject.ShouliStatus == '1' || rowObject.ChedanStatus == 'A' ) {
|
// if (rowObject.ChedanStatus == 'A') {
|
// return cellvalue;
|
// } else {
|
// return "";
|
// }
|
|
// } else {
|
// return "<a onclick=\"youhui('" + rowObject.Id + "')\" >优惠</a>";
|
// }
|
|
// } else {
|
// return cellvalue;
|
// }
|
//}
|
},
|
{
|
label: '打印', name: 'OrderType', labtype: 'txt', hidden: false, width: 60,
|
formatter: function (cellvalue, options, rowObject) {
|
return "<a class='Dayin' style='display: none;' onclick=\"OpenWindow('" + rowObject.OrderNo.replace(/'/g, '') + "','98%','100%', '/CooperOrder/Print?id=" + rowObject.Id + "')\" >打印</a>";
|
|
|
}
|
},
|
{
|
label: '打印合同', name: 'OrderType', labtype: 'txt', hidden: false, width: 60,
|
formatter: function (cellvalue, options, rowObject) {
|
if (rowObject.OrderType == '03') {
|
return "<a class='Dayinhetong' style='display: none;' onclick=\"OpenWindow('" + rowObject.OrderNo.replace(/'/g, '') + "','100%','100%', '/CooperOrder/Printbiaoshuhetong?id=" + rowObject.Id + "')\" >打印合同</a>";
|
}
|
else if (rowObject.OrderType == '02' && (rowObject.OrderType1 == '代拟质疑函' || rowObject.OrderType1 == '代拟投诉书')) {
|
return "<a class='Dayinhetong' style='display: none;' onclick=\"OpenWindow('" + rowObject.OrderNo.replace(/'/g, '') + "','100%','100%', '/CooperOrder/Printzhiyitousuhetong?id=" + rowObject.Id + "')\" >打印合同</a>";
|
}
|
else if (rowObject.OrderType == '05') {
|
return "<a class='Dayinhetong' style='display: none;' onclick=\"OpenWindow('" + rowObject.OrderNo.replace(/'/g, '') + "','100%','100%', '/CooperOrder/Printhuiyuanhetong?id=" + rowObject.Id + "')\" >打印合同</a>";
|
}
|
else if (rowObject.OrderType == '08') {
|
return "<a class='Dayinhetong' style='display: none;' onclick=\"OpenWindow('" + rowObject.OrderNo.replace(/'/g, '') + "','100%','100%', '/CooperOrder/Printfengxianhetong?id=" + rowObject.Id + "')\" >打印合同</a>";
|
}
|
|
else {
|
return "";
|
}
|
|
|
|
|
}
|
},
|
|
{
|
label: '新增订单', name: 'dingdantype', labtype: 'txt', hidden: false, width: 60,
|
formatter: function (cellvalue, options, rowObject) {
|
if (rowObject.OrderType == '02' && rowObject.OrderType1 == '代拟质疑函' ) {
|
return "<a class='Xinzeng' style='display: none;' onclick=\"OpenWindow('代拟投诉书','100%','100%', '/CooperOrder/Edit?id=" + rowObject.Id + "&dingdantype=1')\" >代拟投诉书</a>";
|
}
|
else if (rowObject.OrderType == '02' && rowObject.OrderType1 == '代拟投诉书') {
|
return "<a class='Xinzeng' style='display: none;' onclick=\"OpenWindow('复议诉讼','100%','100%', '/CooperOrder/Edit?id=" + rowObject.Id + "&dingdantype=2')\" >复议诉讼</a>";
|
}
|
else if (rowObject.OrderType == '08' && rowObject.OrderType1 == '复议诉讼') {
|
return "<a class='Xinzeng' style='display: none;' onclick=\"OpenWindow('复议诉讼','100%','100%', '/CooperOrder/Edit?id=" + rowObject.Id + "&dingdantype=3')\" >复议诉讼</a>";
|
}
|
else {
|
return "";
|
}
|
|
|
|
|
}
|
},
|
];
|
|
|
|
|
|
dataUrl = "/CooperOrder/GetList"+"@(string.IsNullOrEmpty(Creater)?"": "?Ywjl=" + Creater)";
|
searchCol = [
|
{ label: '下单时间', name: 'XdTime', labtype: 'datearea', hidden: false },
|
{ label: '订单编号', name: 'OrderNo', labtype: 'txt', hidden: false },
|
{ label: '订单类型', name: 'OrderType', labtype: 'combox', hidden: false, data: JSON.parse(OrderType), cwidth: '5%', cccwidth: '8%' },
|
{ label: '业务经理', name: 'Ywjl', labtype: 'combox', hidden: false, data: JSON.parse(users), cwidth: '5%', cccwidth: '8%' },
|
{ label: '客户名称', name: 'KhdwName', labtype: 'txt', hidden: false },
|
{ label: '客户类型', name: 'Khlx', labtype: 'combox', hidden: false, data: JSON.parse(Khlx), cwidth: '5%', cccwidth: '8%' },
|
{ label: '回访', name: 'HuifangStatus', labtype: 'combox', hidden: false, data: JSON.parse(HuifangStatus), cwidth: '5%', cccwidth: '8%' },
|
{ label: '评价', name: 'PingjiaStatus', labtype: 'combox', hidden: false, data: JSON.parse(PingjiaStatus), cwidth: '5%', cccwidth: '8%' },
|
|
{ label: '订单状态', name: 'ShouliStatus', labtype: 'combox', hidden: false, data: JSON.parse(ShouliStatus), cwidth: '5%', cccwidth: '8%' },
|
|
|
|
|
|
];
|
var _pageAdd = function () {
|
OpenWindow("新增订单", "98%", "90%", "/CooperOrder/Edit/");
|
}
|
|
function shouli (id) {
|
|
// 1、打开弹出层
|
var index = layer.open({
|
type: 1, //基本层类型
|
icon: 0, //图标
|
content: '确认受理?', //内容
|
shade: 0.3, //遮罩,如果想定义别的颜色,可以shade:[0.5,'#fff']
|
shadeClose: 1, //是否点击遮罩关闭
|
skin: 'demoClass', //样式类名
|
moveType: 1, //拖拽风格,默认为0(会有个过度的透明框)
|
btn: ['确定', '取消'], //按钮
|
btn1: function () { //按钮一的回调
|
|
layer.close(index);
|
|
$.ajax({
|
type: "GET",
|
url: "/CooperOrder/Shouli?id=" + id,
|
dataType: "json",
|
global: false,
|
data: "",
|
success: function (data) {
|
|
if (data.Result) {
|
toastr.success("受理成功");
|
window._reloadPageData();
|
} else {
|
toastr.error("受理失败" + data.Message);
|
}
|
},
|
error: function () {
|
|
|
toastr.error("受理失败");
|
}
|
});
|
},
|
// btn2:function(){ //按钮二的回调
|
//
|
// }
|
});
|
}
|
|
function youhui(id) {
|
|
toastr.success("开发中");
|
}
|
|
function chedan(id) {
|
OpenWindow("撤单", "50%", "60%", "/CooperOrder/Chedan?id=" + id);
|
}
|
|
function huifang(id) {
|
OpenWindow("回访", "50%", "60%", "/CooperOrder/Huifang?id=" + id);
|
}
|
|
function pingjia(id) {
|
OpenWindow("评价", "20%", "30%", "/CooperOrder/Pingjia?id=" + id);
|
}
|
|
|
function songhuo(id) {
|
OpenWindow("送货", "50%", "60%", "/CooperOrder/Songhuo?id=" + id);
|
//// 1、打开弹出层
|
//var index = layer.open({
|
// type: 1, //基本层类型
|
// icon: 0, //图标
|
// content: '确认送货?', //内容
|
// shade: 0.3, //遮罩,如果想定义别的颜色,可以shade:[0.5,'#fff']
|
// shadeClose: 1, //是否点击遮罩关闭
|
// skin: 'demoClass', //样式类名
|
// moveType: 1, //拖拽风格,默认为0(会有个过度的透明框)
|
// btn: ['确定', '取消'], //按钮
|
// btn1: function () { //按钮一的回调
|
|
// layer.close(index);
|
|
// $.ajax({
|
// type: "GET",
|
// url: "/CooperOrder/Songhuo?id=" + id,
|
// dataType: "json",
|
// global: false,
|
// data: "",
|
// success: function (data) {
|
|
// if (data.Result) {
|
// toastr.success("送货成功");
|
// window._reloadPageData();
|
// } else {
|
// toastr.error("送货失败" + data.Message);
|
// }
|
// },
|
// error: function () {
|
|
|
// toastr.error("送货失败");
|
// }
|
// });
|
// },
|
// // btn2:function(){ //按钮二的回调
|
// //
|
// // }
|
//});
|
}
|
|
function wangong(id) {
|
|
// 1、打开弹出层
|
var index = layer.open({
|
type: 1, //基本层类型
|
icon: 0, //图标
|
content: '确认订单?', //内容
|
shade: 0.3, //遮罩,如果想定义别的颜色,可以shade:[0.5,'#fff']
|
shadeClose: 1, //是否点击遮罩关闭
|
skin: 'demoClass', //样式类名
|
moveType: 1, //拖拽风格,默认为0(会有个过度的透明框)
|
btn: ['确定', '取消'], //按钮
|
btn1: function () { //按钮一的回调
|
|
layer.close(index);
|
|
$.ajax({
|
type: "GET",
|
url: "/CooperOrder/Wangong?id=" + id,
|
dataType: "json",
|
global: false,
|
data: "",
|
success: function (data) {
|
|
if (data.Result) {
|
toastr.success("确认订单");
|
window._reloadPageData();
|
} else {
|
toastr.error("确认订单失败" + data.Message);
|
}
|
},
|
error: function () {
|
|
|
toastr.error("确认订单失败");
|
}
|
});
|
},
|
// btn2:function(){ //按钮二的回调
|
//
|
// }
|
});
|
}
|
|
var _pagePrint = function () {
|
|
var XdTime = $("#PBSXdTime").val();
|
var OrderNo = $("#PBSOrderNo").val();
|
var OrderType = $("#PBSOrderType").val();
|
var Ywjl = $("#PBSYwjl").val();
|
var KhdwName = $("#PBSKhdwName").val();
|
|
|
var Khlx = $("#PBSKhlx").val();
|
var HuifangStatus = $("#PBSHuifangStatus").val();
|
var PingjiaStatus = $("#PBSPingjiaStatus").val();
|
|
|
|
var url = "/CooperOrder/printList?XdTime=" + XdTime + "&OrderNo=" + OrderNo + "&OrderType=" + OrderType + "&Ywjl=" + Ywjl + "&KhdwName=" + KhdwName + "&Khlx=" + Khlx + "&HuifangStatus=" + HuifangStatus + "&PingjiaStatus=" + PingjiaStatus;
|
var me = window.open(url, "打印"); //打开新窗口
|
|
|
}
|
|
|
|
var _afterSave = function (result) {
|
if (result) {
|
toastr.success("保存成功");
|
} else {
|
toastr.error("保存失败");
|
}
|
}
|
|
var _afterDel = function (result) {
|
if (result) {
|
toastr.success("删除成功");
|
} else {
|
/**/
|
toastr.error("删除成功");
|
/**/
|
}
|
}
|
var ActionInfo22 = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ActionInfo2))';
|
|
var _afterLoadDataload = function (xhr) {
|
var data = JSON.parse(ActionInfo22);
|
for (var o in data) {
|
//alert(o);
|
//alert(data[o]);
|
/* alert("PageShortcut:" + data[o].PageShortcut + " PageName:" + data[o].PageName);*/
|
$("." + data[o].PageShortcut).show();
|
|
}
|
|
jQuery("#jqGrid").jqGrid("footerData", "set", { KhdwName: "<font color='darkgoldenrod'>--当页合计--</font> </br> <font color='darkgoldenrod'>--合计--</font>", OrderNum: "<font color='darkgoldenrod'>" + xhr.DangyeHeji1 + "</font></br><font color='darkgoldenrod'>" + xhr.Heji1 + "</font>", Price: "<font color='darkgoldenrod'>" + xhr.DangyeHeji2 + "</font></br><font color='darkgoldenrod'>" + xhr.Heji2 + "</font>", Money: "<font color='darkgoldenrod'>" + xhr.DangyeHeji3 + "</font></br><font color='darkgoldenrod'>" + xhr.Heji3 + "</font>", Youhui: "<font color='darkgoldenrod'>" + xhr.DangyeHeji4 + "</font></br><font color='darkgoldenrod'>" + xhr.Heji4 + "</font>"});
|
|
};
|
</script>
|
}
|
|
@section footerScripts{
|
<script type="text/javascript">
|
|
|
|
|
|
</script>
|
}
|