456 lines
21 KiB
Plaintext
456 lines
21 KiB
Plaintext
@using WX.CRM.WebHelper;
|
||
@using WX.CRM.Model.Entity;
|
||
@{
|
||
ViewBag.Title = "订单列表";
|
||
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
|
||
}
|
||
<div class="mvctool">
|
||
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
|
||
@Html.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
|
||
</div>
|
||
<style>
|
||
.grid_table .layui-table[lay-size=sm] th {
|
||
padding: 1px 1px !important;
|
||
}
|
||
</style>
|
||
<div class="bas_datagrid">
|
||
<div id="tb" style="padding:5px;height:auto" class="grid_toolbar">
|
||
<ul class="toolBar_ul">
|
||
<li>客户ID:<input type="text" name="txt_resID" style="width:150px" value="@Request.QueryString["resid"]" /> </li>
|
||
<li>订单ID:<input type="text" name="txt_szzyOrderId" style="width:100px" /></li>
|
||
@*<li>@Html.Action("UserComBoxByRole", "Control", new { onLoadSucced = "onLoadSucced()", controlName = "nb1", roleCodes = ViewBag.roleCodes, saledeptid = ViewBag.saleDeptId, salegroupid = ViewBag.userGroupId, iseid = "0", inneruserid = "", currentRight = WX.CRM.WebHelper.InitRights.CONST_订单列表 })</li>*@
|
||
<li>@Html.Action("UserSSOComBox", "Control", new { currentRight = WX.CRM.WebHelper.InitRights.CONST_订单列表 })</li>
|
||
<li>
|
||
归属部门:
|
||
@if (ViewBag.DeptList != null)
|
||
{
|
||
<select id="deptcode" name="slt_deptcode">
|
||
<option value="">请选择</option>
|
||
@foreach (var item in ViewBag.DeptList as List<SelectListItem>)
|
||
{
|
||
<option value="@item.Value">@item.Text</option>
|
||
}
|
||
</select>
|
||
}
|
||
</li>
|
||
<li>
|
||
是否离职:<select id="slt_isdismiss" name="slt_isdismiss">
|
||
<option>全部</option>
|
||
<option value="0">否</option>
|
||
<option value="1">是</option>
|
||
</select>
|
||
</li>
|
||
<li>
|
||
工号:<input type="text" name="txt_eid" style="width:150px" value="@Request.QueryString["eid"]" />
|
||
</li>
|
||
<li>
|
||
系列:<select name="slt_productId"><option value="0">全部</option><option value="1008">智赢系列</option><option value="1007">爱赢系列</option></select>
|
||
</li>
|
||
<li>
|
||
|
||
产品大类:<select id="slt_midproductId" name="slt_midproductId" style="width:150px;" onChange="changeMidProduct(this.value)">
|
||
<option value="">--请选中产品大类--</option>
|
||
@foreach (var item in ViewBag.midproductList as List<SelectListItem>)
|
||
{
|
||
<option value="@item.Value">@item.Text</option>
|
||
}
|
||
</select>
|
||
</li>
|
||
<li>
|
||
产品小类:<select id="slt_subProductId" name="slt_subProductId" style="width:180px;">
|
||
<option value="0">--请选中产品小类--</option>
|
||
</select>
|
||
</li>
|
||
<li>
|
||
订单类型:<select id="slt_orderType" name="slt_orderType">
|
||
<option value="0">全部订单</option>
|
||
<option value="1">普通订单</option>
|
||
<option value="2">续费订单</option>
|
||
<option value="3">升级订单</option>
|
||
@if (ViewBag.DeptCode == "SHZZ")
|
||
{
|
||
<option value="4">换课订单</option>
|
||
}
|
||
</select>
|
||
</li>
|
||
<li>
|
||
合同状态:
|
||
<select name="txt_riskctrlstatus">
|
||
<option value="">请选择</option>
|
||
<option value="-9">未签订</option>
|
||
<option value="0">未审核</option>
|
||
<option value="2">已通过</option>
|
||
<option value="-1">合规驳回</option>
|
||
</select>
|
||
</li>
|
||
<li>订单分成:<input type="text" name="txt_fcText" style="width:80px" /></li>
|
||
@*<li>合同状态:<input type="text" name="txt_contractCode" style="width:150px" /></li>*@
|
||
<li>
|
||
订单状态:<select id="slt_orderStatus" name="slt_orderStatus">
|
||
<option value="" selected>全部</option>
|
||
<option value="180">新订单</option>
|
||
<option value="190">已提交支付</option>
|
||
<option value="195">支付驳回</option>
|
||
<option value="200">已支付</option>
|
||
<option value="201">待开通</option>
|
||
<option value="220">已开通</option>
|
||
<option value="205">已升级</option>
|
||
<option value="90">已退款</option>
|
||
<option value="80">已到期</option>
|
||
<option value="70">已取消</option>
|
||
<option value="60">已关闭</option>
|
||
<option value="220,205">已开通+已升级</option>
|
||
<option value="220,205,90">已开通+已升级+已退款</option>
|
||
<option value="220,205,90,80">已开通+已升级+已退款+已到期</option>
|
||
</select>
|
||
</li>
|
||
<li>订单分成:<input type="text" name="txt_fcText" style="width:80px" /></li>
|
||
<li>合同编号:<input type="text" name="txt_contractCode" style="width:150px" /></li>
|
||
<li>到账时间:@Html.WdatePickerText("txt_stime", "")-@Html.WdatePickerText("txt_etime", "")</li>
|
||
<li>开通时间:@Html.WdatePickerText("txt_ostime", "")-@Html.WdatePickerText("txt_oetime", "")</li>
|
||
<li>客户姓名:<input type="text" name="txt_cname" /></li>
|
||
<li>下单时间:@Html.WdatePickerText("txt_xstime", "")-@Html.WdatePickerText("txt_xetime", "")</li>
|
||
<li>结算时间:@Html.WdatePickerText("txt_fstime", "")-@Html.WdatePickerText("txt_fetime", "")</li>
|
||
</ul>
|
||
</div>
|
||
@Html.Raw(ViewBag.gridTable)
|
||
</div>
|
||
<script type="text/javascript">
|
||
|
||
$(function () {
|
||
loadtablegrid();
|
||
|
||
$(window).resize(function () {//自动适应大小
|
||
$('#tablist').tablegrid('resize', {
|
||
height: $(window).height() - 110
|
||
});
|
||
});
|
||
|
||
$("#btnQuery").click(function () {
|
||
$('#tablist').tablegrid("Search");
|
||
});
|
||
|
||
//$("#tablist th:eq(8)").hide();
|
||
});
|
||
function frameReturnByClose() {
|
||
$("#modalwindow").window('close');
|
||
}
|
||
function frameReturnByReload(flag) {
|
||
$("#tablist").tablegrid("Load");
|
||
}
|
||
function frameReturnByMes(mes) {
|
||
$.messageBox5s('提示', mes);
|
||
}
|
||
|
||
function loadtablegrid() {
|
||
$('#tablist').tablegrid({
|
||
url: '/WeiXin/JZOrder/GetOrderList',
|
||
height: $(window).height() - 110,
|
||
loadNow: false,
|
||
data: GetControlValue,
|
||
isCheckMore: true,
|
||
onLoadSuccess: function () {
|
||
|
||
//$("#tablist td:eq(8)").hide();
|
||
$("#tablist [field='FINALPAY']").hide();
|
||
},
|
||
onLoadError: function () {
|
||
$.messager.alert("警告", "信息加载失败!", "error");
|
||
}
|
||
});
|
||
}
|
||
|
||
function GetControlValue() {
|
||
return { saleDeptId: $("#nb1_uc_org_depts").val(), groupId: $("#nb1_uc_org_groups").val(), userId: $("#nb1_uc_org_ids").val(), dayType: $("#txt_Daytype").val() };
|
||
}
|
||
|
||
function onLoadSucced() {
|
||
$('#tablist').tablegrid("Search");
|
||
}
|
||
|
||
function changeMidProduct(productId) {
|
||
if (productId == 0) {
|
||
//$("#slt_subProductId").unbind();
|
||
$("#slt_subProductId").html("<option value='0'>--请选中产品小类--</option>");
|
||
return;
|
||
}
|
||
$.r_post("/JzOrder/GetAllSubProductList?productId=0&midproductId=" + productId, function (data) {
|
||
//$("#slt_subProductId").unbind();
|
||
|
||
$("#slt_subProductId").html("<option value='0'>--请选中产品小类--</option>");
|
||
|
||
$(data).each(function (n, m) {
|
||
$("#slt_subProductId").append("<option value='" + m.Value + "'>" + m.Text + "</option>");
|
||
});
|
||
|
||
}, "json");
|
||
}
|
||
</script>
|
||
@*ToolBar事件处理*@
|
||
<script type="text/javascript">
|
||
function GetIframeHtml(src) {
|
||
return "<iframe width='100%' height='98%' scrolling='yes' frameborder='0'' src='" + src + "'></iframe>";
|
||
}
|
||
function SupplementOrder_Click() {
|
||
$("#modalwindow").html(GetIframeHtml("/WeiXin/JZOrder/SupplementOrder"));
|
||
$("#modalwindow").window({ title: '补单', width: 700, height: 600, iconCls: 'icon-add' }).window('open');
|
||
}
|
||
|
||
function Details_Click() {
|
||
var row = $('#tablist').tablegrid('getSelected');
|
||
if (row != null) {
|
||
$("#modalwindow").html(GetIframeHtml("/WeiXin/JZOrder/Detail?orderId=" + row.ORDERID + "&Ieguid=" + GetGuid()));
|
||
$("#modalwindow").window({ title: '订单详情', width: 700, height: 650, iconCls: 'icon-edit' }).window('open');
|
||
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
||
}
|
||
//取消订单
|
||
function cancel_Click() {
|
||
var row = $('#tablist').tablegrid('getSelections');
|
||
if (row != null && row != '') {
|
||
var orderArr = [];
|
||
$(row).each(function (i, n) {
|
||
var orderid = $(n.ORDERID).text();
|
||
orderArr.push(orderid);
|
||
});
|
||
var orderids = orderArr.join(",");
|
||
$.r_post("/JzOrder/CancelOrder?orderids=" + orderids, function (data) {
|
||
debugger
|
||
if (data.type == 1) {
|
||
frameReturnByReload(true);
|
||
$.messageBox5s('提示', data.message);
|
||
|
||
}
|
||
else {
|
||
$.messager.alert("警告", data.message, "error");
|
||
}
|
||
}, "json");
|
||
} else {
|
||
$.messager.alert("警告", "至少选择一条数据进行操作!", "error");
|
||
}
|
||
}
|
||
|
||
function Edit_Click() {
|
||
var row = $('#tablist').tablegrid('getSelected');
|
||
if (row != null) {
|
||
$("#modalwindow").html(GetIframeHtml("/WeiXin/JZOrder/Edit?orderId=" + row.ORDERID + "&Ieguid=" + GetGuid()));
|
||
$("#modalwindow").window({ title: '编辑', width: 700, height: 600, iconCls: 'icon-edit' }).window('open');
|
||
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
||
}
|
||
//获取datagrid头部及字段
|
||
function getDataGridHeader() {
|
||
var newcolumns = [];
|
||
var columns = $('#tablist').tablegrid("getHead");
|
||
for (var i = 0; i < columns.length; i++) {
|
||
if (columns[i].field != "AiStatus") {
|
||
newcolumns.push(columns[i])
|
||
};
|
||
}
|
||
return newcolumns;
|
||
}
|
||
|
||
function UpdateCommission_Click() {
|
||
var row = $('#tablist').tablegrid('getSelected');
|
||
if (row != null) {
|
||
$("#modalwindow").html(GetIframeHtml("/WeiXin/CommissionRule/Edit?orderid=" + row.ORDERID + "&Ieguid=" + GetGuid()));
|
||
$("#modalwindow").window({ title: '编辑', width: 700, height: 600, iconCls: 'icon-edit' }).window('open');
|
||
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
||
}
|
||
function export_Click() {
|
||
$("#modalwindow").html(GetIframeHtml("/Control/ExcelExport?Query=" + encodeURIComponent("/WeiXin/JZOrder/Export?" + GetQueryStr())));
|
||
$("#modalwindow").window({ title: '导出', width: 480, height: 300, iconCls: 'icon-export' }).window('open');
|
||
}
|
||
|
||
function orderPay_Click() {
|
||
//var row = $('#tablist').tablegrid('getSelected');
|
||
var row = $('#tablist').tablegrid('getSelections');
|
||
//var errorMsg = '';
|
||
if (row != null && row != '') {
|
||
//$.get('/WeiXin/JZOrder/CheckOrderPay?orderId=' + row.ORDERID, function (res) {
|
||
// var resObj = JSON.parse(res);
|
||
// if (resObj.type == 1) {
|
||
// $("#modalwindow").html(GetIframeHtml("/WeiXin/JZOrder/AddOrderPay?orderId=" + row.ORDERID));
|
||
// $("#modalwindow").window({ title: '添加支付记录', width: 600, height: 600, iconCls: 'icon-export' }).window('open');
|
||
// }
|
||
// else {
|
||
// if (resObj.message == "70") {
|
||
// $.messager.alert("警告", "该订单已经退款了,请确认!", "error");
|
||
// }
|
||
// else if (resObj.message == "220") {
|
||
// $.messager.alert("警告", "该订单已经开通了,请确认!", "error");
|
||
// }
|
||
// else if (resObj.message == "60") {
|
||
// $.messager.alert("警告", "该订单已经关闭了,请重新下单!", "error");
|
||
// }
|
||
// else if (resObj.message == "exists") {
|
||
// $.messager.confirm("操作提示", "该订单已经提交过支付记录了,确定继续提交?", function (res) {
|
||
// if (res) {
|
||
// $("#modalwindow").html(GetIframeHtml("/WeiXin/JZOrder/AddOrderPay?orderId=" + row.ORDERID));
|
||
// $("#modalwindow").window({ title: '添加支付记录', width: 600, height: 600, iconCls: 'icon-export' }).window('open');
|
||
// }
|
||
// });
|
||
// }
|
||
// else {
|
||
// $.messager.alert("警告", resObj.message, "error");
|
||
// }
|
||
// }
|
||
//});
|
||
var resArr = [];
|
||
var orderArr = [];
|
||
var isshow = true;
|
||
$(row).each(function (i, n) {
|
||
var orderid = $(n.ORDERID).text();
|
||
var status = n.ORDERSTATUS;
|
||
resArr.push($(n.RESID).text());
|
||
orderArr.push(orderid);
|
||
//console.log(status);
|
||
if (!(status == 180 || status == 190 || status == 195)) {
|
||
//console.log(1);
|
||
$.messager.alert("警告", orderid + "不需要进行支付操作了!", "error");
|
||
isshow = false;
|
||
return false;
|
||
}
|
||
//console.log($(n.RESID).text());
|
||
});
|
||
if (!isshow) {
|
||
return false;
|
||
}
|
||
if (isAllEqual(resArr)) {
|
||
//console.log(2);
|
||
var orderids = orderArr.join(",");
|
||
console.log(orderids);
|
||
$("#modalwindow").html(GetIframeHtml("/WeiXin/OrderDeposit/Pay?orderId=" + orderids + "&resid=" + resArr[0]));
|
||
$("#modalwindow").window({ title: '添加支付记录', width: 1000, height: 600, iconCls: 'icon-export' }).window('open');
|
||
}
|
||
else {
|
||
$.messager.alert("警告", "只能选择同一个客户进行操作!", "error");
|
||
}
|
||
|
||
} else { $.messager.alert("警告", "请选择要操作的记录!", "error"); }
|
||
}
|
||
|
||
function isAllEqual(array) {
|
||
if (array.length > 0) {
|
||
return !array.some(function (value, index) {
|
||
return value !== array[0];
|
||
});
|
||
} else {
|
||
return true;
|
||
}
|
||
}
|
||
|
||
function ContractActionLog(orderId) {
|
||
$("#modalwindow").window('close');
|
||
if (!orderId) {
|
||
alert("参数错误!");
|
||
return;
|
||
}
|
||
$("#modalwindow").html(GetIframeHtml("/WeiXin/JZOrder/ContractActionLog?orderId=" + orderId + "&Ieguid=" + GetGuid()));
|
||
$("#modalwindow").window({ title: '客户签订情况', width: 530, height: 550, iconCls: 'icon-edit' }).window('open');
|
||
}
|
||
|
||
function ContractView(orderId) {
|
||
$("#modalwindow").window('close');
|
||
if (!orderId) {
|
||
alert("参数错误!");
|
||
return;
|
||
}
|
||
$("#modalwindow").html(GetIframeHtml("/WeiXin/JZOrder/ViewContract?orderId=" + orderId + "&Ieguid=" + GetGuid()));
|
||
$("#modalwindow").window({ title: '合同信息', width: 830, height: 550, iconCls: 'icon-edit' }).window('open');
|
||
}
|
||
|
||
function ContractView3(orderId) {
|
||
$("#modalwindow").window('close');
|
||
if (!orderId) {
|
||
alert("参数错误!");
|
||
return;
|
||
}
|
||
$("#modalwindow").html(GetIframeHtml("/WeiXin/JZOrder/ViewContract3?orderId=" + orderId + "&Ieguid=" + GetGuid()));
|
||
$("#modalwindow").window({ title: '三要素合同信息', width: 830, height: 550, iconCls: 'icon-edit' }).window('open');
|
||
}
|
||
function RefreshView3(orderId) {
|
||
$.get('/WeiXin/JZOrder/RefreshView?orderId=' + orderId, function (res) {
|
||
debugger
|
||
if (res) {
|
||
|
||
}
|
||
|
||
});
|
||
}
|
||
function orderRefund_Click() {
|
||
var row2 = $('#tablist').tablegrid('getSelections');
|
||
if (row2.length > 1) {
|
||
$.messager.alert("警告", "只能选择单笔订单退款!", "error");
|
||
return;
|
||
}
|
||
var row = $('#tablist').tablegrid('getSelected');
|
||
var errorMsg = '';
|
||
|
||
if (!row.ARRIVALPAY || row.ARRIVALPAY == "0") {
|
||
$.messager.alert("警告", "此订单无可退金额!", "error");
|
||
return;
|
||
}
|
||
|
||
if (row != null) {
|
||
$.get('/WeiXin/JZOrder/CheckOrderRefund?orderId=' + row.ORDERID, function (res) {
|
||
var resObj = JSON.parse(res);
|
||
//console.log(resObj.type);
|
||
if (resObj.type == 1) {
|
||
$("#modalwindow").html(GetIframeHtml("/WeiXin/JZOrder/ApplyOrderRefund?orderId=" + row.ORDERID));
|
||
$("#modalwindow").window({ title: '退款申请', width: 600, height: 720, iconCls: 'icon-export' }).window('open');
|
||
}
|
||
else {
|
||
if (resObj.message == "70") {
|
||
$.messager.alert("警告", "该订单已经退款了,请确认!", "error");
|
||
}
|
||
else if (resObj.message == "exists") {
|
||
$.messager.confirm("操作提示", "该订单已经提交过退款申请了,确定继续提交?", function (res) {
|
||
if (res) {
|
||
$("#modalwindow").html(GetIframeHtml("/WeiXin/JZOrder/ApplyOrderRefund?orderId=" + row.ORDERID));
|
||
$("#modalwindow").window({ title: '退款申请', width: 600, height: 720, iconCls: 'icon-export' }).window('open');
|
||
}
|
||
});
|
||
}
|
||
else {
|
||
$.messager.alert("警告", resObj.message, "error");
|
||
}
|
||
}
|
||
});
|
||
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
||
}
|
||
|
||
function hg_Click() {
|
||
var row = $('#tablist').tablegrid('getSelected');
|
||
if (row != null) {
|
||
$("#modalwindow").html(GetIframeHtml("HgRecord?orderid=" + row.ORDERID + "&resid=" + row.RESID + "&Ieguid=" + GetGuid()));
|
||
$("#modalwindow").window({ title: '订单合规回访', width: 700, height: 650, iconCls: 'icon-edit' }).window('open');
|
||
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
||
}
|
||
function SetTime(orderId,starttime,endTime) {
|
||
if (orderId != undefined && orderId.length != 0 && orderId != 0) {
|
||
$("#modalwindow").html(GetIframeHtml("/WeiXin/JZOrder/SetTime?orderId=" + orderId + "&stime=" + starttime + "&etime=" + endTime));
|
||
//$("#modalwindow").html(GetIframeHtml("/WeiXin/JZOrder/PayInfo?orderId=" + orderId + "&Ieguid=" + GetGuid()));
|
||
$("#modalwindow").window({ title: '设置时间', width: 850, height: 700, iconCls: 'icon-edit' }).window('open');
|
||
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
||
}
|
||
//新增
|
||
function Create_Click() {
|
||
$("#modalwindow").html(GetIframeHtml("/WeiXin/JZOrder/AddInList"));
|
||
//$("#modalwindow").html(GetIframeHtml("/WeiXin/CommissionRule/Edit?orderid=1205219754"));
|
||
$("#modalwindow").window({ title: '新增', width: 700, height: 600, iconCls: 'icon-add' }).window('open');
|
||
}
|
||
function fp_Click() {
|
||
var row = $('#tablist').tablegrid('getSelected');
|
||
if (row != null) {
|
||
$("#modalwindow").html(GetIframeHtml("Fp?orderid=" + row.ORDERID + "&Ieguid=" + GetGuid()));
|
||
$("#modalwindow").window({ title: '设置工号', width: 400, height: 300, iconCls: 'icon-edit' }).window('open');
|
||
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
||
}
|
||
|
||
function upload_Click() {
|
||
var row = $('#tablist').tablegrid('getSelected');
|
||
if (row != null) {
|
||
$("#modalwindow").html(GetIframeHtml("SetFinacePayDate?orderid=" + row.ORDERID + "&Ieguid=" + GetGuid()));
|
||
$("#modalwindow").window({ title: '设置结算时间', width: 500, height: 500, iconCls: 'icon-edit' }).window('open');
|
||
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
||
}
|
||
</script> |