443 lines
21 KiB
Plaintext
443 lines
21 KiB
Plaintext
@using WX.CRM.WebHelper;
|
||
@using WX.CRM.Model.Entity;
|
||
@{
|
||
ViewBag.Title = "我的订单";
|
||
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
|
||
}
|
||
<script src="~/Scripts/clipboard.min.js"></script>
|
||
<div class="mvctool">
|
||
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
|
||
@Html.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
|
||
</div>
|
||
<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" /> </li>
|
||
<li>订单ID:<input type="text" name="txt_szzyOrderId" style="width:150px" /></li>
|
||
<li>@Html.Action("UserSSOComBox", "Control")</li>
|
||
@*<li>@Html.Action("UserComBoxByRole", "Control", new { onLoadSucced = "onLoadSucced()", controlName = "nb1", roleCodes = ViewBag.roleCodes, saledeptid = "", salegroupid = ViewBag.userGroupId, iseid = "0", inneruserid = "", 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 style="display:none;">
|
||
系列:<select name="slt_productId"><option value="0">全部</option></select>
|
||
</li>
|
||
<li>
|
||
|
||
产品大类:<select id="slt_midproductId" name="slt_midproductId" style="width:150px;height:22px" 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:220px;height:22px">
|
||
<option value="0">--请选中产品小类--</option>
|
||
</select>
|
||
</li>
|
||
<li>
|
||
订单类型:<select id="slt_orderType" name="slt_orderType" style="height:22px;">
|
||
<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 id="slt_orderStatus" name="slt_orderStatus">
|
||
<option value="" selected>全部</option>
|
||
<option value="">请选择</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>
|
||
合同状态:
|
||
<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_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_fstime", "")-@Html.WdatePickerText("txt_fetime", "")</li>
|
||
</ul>
|
||
</div>
|
||
@Html.Raw(ViewBag.gridTable)
|
||
</div>
|
||
<input id="hidUrl" value="" style="position: absolute; left:-100000px; top:-100000px;" />
|
||
<script type="text/javascript">
|
||
$(function () {
|
||
loadtablegrid();
|
||
|
||
$(window).resize(function () {//自动适应大小
|
||
$('#tablist').tablegrid('resize', {
|
||
height: $(window).height() - 110
|
||
});
|
||
});
|
||
|
||
$("#btnQuery").click(function () {
|
||
$('#tablist').tablegrid("Search");
|
||
});
|
||
$("#Other1").removeAttr("onclick").attr("onclick", "orderPay_Click()");
|
||
$("#Other1 .csicontitle").text("提交支付记录");
|
||
});
|
||
function frameReturnByClose() {
|
||
$("#modalwindow").window('close');
|
||
}
|
||
function frameReturnByReload(flag) {
|
||
$("#tablist").tablegrid("Load");
|
||
}
|
||
function frameReturnByMes(mes) {
|
||
$.messageBox5s('提示', mes);
|
||
}
|
||
|
||
function loadtablegrid() {
|
||
$('#tablist').tablegrid({
|
||
url: '/WeiXin/JZOrder/GetHtmlList',
|
||
height: $(window).height() - 110,
|
||
loadNow: false,
|
||
isCheckMore: true,
|
||
data: GetControlValue,
|
||
onLoadError: function () {
|
||
$.messager.alert("警告", "信息加载失败!", "error");
|
||
}
|
||
});
|
||
}
|
||
|
||
function onLoadSucced() {
|
||
console.log(1);
|
||
$('#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");
|
||
}
|
||
function HetongHebing_Click() {
|
||
var row1 = $('#tablist').tablegrid('getSelections');
|
||
if (row1.length < 2) {
|
||
$.messageBox5s('提示', '请选择要合并的订单!!');
|
||
return;
|
||
}
|
||
var ids = "";
|
||
console.log(row1);
|
||
$(row1).each(function (a, b) {
|
||
console.log(b);
|
||
ids += b.ORDERID + ",";
|
||
});
|
||
console.log(ids);
|
||
$.r_post("/JzOrder/HebingHT?orderIds=" + ids + "&Ieguid=" + GetGuid(), function (data) {
|
||
//$("#slt_subProductId").unbind();
|
||
if (data.type) {
|
||
$("#hidUrl").val(data.url);
|
||
$("#modalwindow").html("<div style='width:360px;white-space:normal;word-break:break-all;word-wrap:break-word;padding:10px;' id='wamsmx'>" + data.url + "</div><div style='padding:10px;'><a class='layui-btn' style='color:white' href='" + data.url + "' target=\"_blank\">打开</a><button class=\"btn htbtn layui-btn\" data-clipboard-target=\"#hidUrl\">复制</button ></div>");
|
||
$("#modalwindow").window({ title: '合并合同地址', width: 400, height: 300, iconCls: 'icon-edit' }).window('open');
|
||
} else {
|
||
$.messager.alert("错误", data.message, "error");
|
||
return;
|
||
}
|
||
|
||
}, "json");
|
||
}
|
||
|
||
</script>
|
||
@*ToolBar事件处理*@
|
||
<script type="text/javascript">
|
||
function GetIframeHtml(src) {
|
||
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
|
||
}
|
||
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 Edit_Click() {
|
||
var row1 = $('#tablist').tablegrid('getSelections');
|
||
if (row1.length == 0) {
|
||
$.messageBox5s('提示', '请选择要操作的记录!!');
|
||
return;
|
||
} else if (row1.length > 1) {
|
||
$.messageBox5s('提示', '一次性只能操作一条记录!');
|
||
return;
|
||
}
|
||
var row = $('#tablist').tablegrid('getSelected');
|
||
if (row != null) {
|
||
//$("#modalwindow").html(GetIframeHtml("/WeiXin/SzzyOrder/Edit?orderId=" + row.ORDERID + "&Ieguid=" + GetGuid()));
|
||
$("#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'); }
|
||
}
|
||
function Details_Click() {
|
||
var row1 = $('#tablist').tablegrid('getSelections');
|
||
if (row1.length == 0) {
|
||
$.messageBox5s('提示', '请选择要操作的记录!!');
|
||
return;
|
||
} else if (row1.length > 1) {
|
||
$.messageBox5s('提示', '一次性只能操作一条记录!');
|
||
return;
|
||
}
|
||
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: 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 UpdateOrder_Click() {
|
||
var row1 = $('#tablist').tablegrid('getSelections');
|
||
if (row1.length == 0) {
|
||
$.messageBox5s('提示', '请选择要操作的记录!!');
|
||
return;
|
||
} else if (row1.length > 1) {
|
||
$.messageBox5s('提示', '一次性只能操作一条记录!');
|
||
return;
|
||
}
|
||
var row = $('#tablist').tablegrid('getSelected');
|
||
if (row != null) {
|
||
$.messager.alert("警告", "执行错误,请联系管理员!", "error");
|
||
//$.messager.confirm('提示', '你确定更新订单信息吗?', function (r) {
|
||
// if (r) {
|
||
// $.r_post("/WeiXin/JZOrder/UpdateSzzyOrder?orderId="+row.ORDERID, function (data) {
|
||
// if (data.type == 1) {
|
||
// $("#tablist").tablegrid('Load');
|
||
// $.messageBox5s('提示', '更新订单信息成功');
|
||
// } else {
|
||
// $.messageBox5s('错误', data.message);
|
||
// }
|
||
|
||
// }, "json");
|
||
|
||
// }
|
||
//});
|
||
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
||
}
|
||
function ContractView(orderId) {
|
||
//根据需求https://www.tapd.cn/46772428/prong/stories/view/1146772428001001974 2.2
|
||
//合同状态暂时不能点击
|
||
//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 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 GetWxPayInfo(orderId) {
|
||
if (orderId != undefined && orderId.length != 0 && orderId != 0) {
|
||
$("#modalwindow").html(GetIframeHtml("/WeiXin/OrderPay/List?orderId=" + orderId + "&Ieguid=" + GetGuid()));
|
||
//$("#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 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 GetDZHF(orderId) {
|
||
if (orderId != undefined && orderId.length != 0 && orderId !=0) {
|
||
$("#modalwindow").html(GetIframeHtml("http://qm.dn8188.com:8099//Compliance/Index?orderId=" + orderId));
|
||
$("#modalwindow").window({ title: '电子回访链接', width: 830, height: 550, iconCls: 'icon-edit' }).window('open');
|
||
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
||
}
|
||
|
||
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 MyOrderExport_Click() {
|
||
$("#modalwindow").html(GetIframeHtml("/Control/ExcelExport?Query=" + encodeURIComponent("/WeiXin/JZOrder/MyOrderExport?saleDeptId=" + $("#currentDeptId").val() + '&groupId=' + $("#currentGroupId").val() + '&userId=' + $("#txt_userId").val() + '&dayType=' + $("#txt_Daytype").val() + '&' + GetQueryStr())));
|
||
$("#modalwindow").window({ title: '导出', width: 480, height: 300, iconCls: 'icon-export' }).window('open');
|
||
}
|
||
|
||
function ShowHeTongUrl(orderid) {
|
||
var murl = $("#" + orderid).val();
|
||
$("#hidUrl").val(murl);
|
||
$("#modalwindow").html("<div style='width:360px;white-space:normal;word-break:break-all;word-wrap:break-word;padding:10px;' id='wamsmx'>" + murl + "</div><div style='padding:10px;'><a class='layui-btn' style='color:white' href='" + murl + "' target=\"_blank\">打开</a><button class=\"btn htbtn layui-btn\" data-clipboard-target=\"#hidUrl\">复制</button ></div>");
|
||
$("#modalwindow").window({ title: '合同地址', width: 400, height: 300, iconCls: 'icon-edit' }).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 orderPay_Click() {
|
||
@*var row1 = $('#tablist').tablegrid('getSelections');
|
||
if (row1.length == 0) {
|
||
$.messageBox5s('提示', '请选择要操作的记录!!');
|
||
return;
|
||
} else if (row1.length > 1) {
|
||
$.messageBox5s('提示', '一次性只能操作一条记录!');
|
||
return;
|
||
}
|
||
var row = $('#tablist').tablegrid('getSelected');
|
||
var errorMsg = '';
|
||
if (row != null) {
|
||
$.get('/WeiXin/JZOrder/CheckOrderPay?orderId=' + row.ORDERID, function (res) {
|
||
var resObj = JSON.parse(res);
|
||
if (resObj.type == 1) {
|
||
$("#modalwindow").html(GetIframeHtml("/WeiXin/JZOrder/AddOrderPay2?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/AddOrderPay2?orderId=" + row.ORDERID));
|
||
$("#modalwindow").window({ title: '添加支付记录', width: 600, height: 600, iconCls: 'icon-export' }).window('open');
|
||
}
|
||
});
|
||
}
|
||
else {
|
||
$.messager.alert("警告", resObj.message, "error");
|
||
}
|
||
}
|
||
});
|
||
|
||
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }*@
|
||
|
||
var row = $('#tablist').tablegrid('getSelections');
|
||
if (row != null && row != '') {
|
||
var resArr = [];
|
||
var orderArr = [];
|
||
var isshow = true;
|
||
$(row).each(function (i, n) {
|
||
var orderid = n.ORDERID;
|
||
var status = n.ORDERSTATUS;
|
||
resArr.push($(n.RESID).text());
|
||
orderArr.push(orderid);
|
||
//console.log(status);
|
||
if (!(status == 180 || status == 190 || status == 195)) {
|
||
$.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: 600, 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 () {
|
||
|
||
var clipboard = new ClipboardJS('.htbtn');
|
||
|
||
clipboard.on('success', function (e) {
|
||
//alert("复制成功!");
|
||
$.messager.alert('提示', '复制成功', "info");
|
||
e.clearSelection();
|
||
});
|
||
|
||
clipboard.on('error', function (e) {
|
||
console.error('Action:', e.action);
|
||
console.error('Trigger:', e.trigger);
|
||
});
|
||
});
|
||
</script>
|