421 lines
18 KiB
Plaintext
421 lines
18 KiB
Plaintext
@using CRM.Core.Model.Entity
|
||
@using Core.Web.WebHelper
|
||
@{
|
||
/**/
|
||
|
||
ViewBag.Title = "Index";
|
||
Layout = "~/Views/Shared/_Layout.cshtml";
|
||
}
|
||
<style>
|
||
.self-table-click td {
|
||
background-color: #f3ebbc;
|
||
}
|
||
|
||
.layui-layer-btn-c .layui-layer-btn0 {
|
||
background-color: #fff;
|
||
color: #333;
|
||
border-color: #dedede;
|
||
}
|
||
|
||
.layui-layer-btn-c .layui-layer-btn1 {
|
||
border-color: #1e9fff;
|
||
background-color: #1e9fff;
|
||
color: #fff;
|
||
}
|
||
</style>
|
||
<div class="x-body">
|
||
<div class="layui-btn-group" style="padding-bottom:10px;">
|
||
@Html.Action("ToolBar", "Home",
|
||
new
|
||
{
|
||
area = "",
|
||
rightcode = (ViewBag.rightCode as string),
|
||
otherToolBars = new ToolBar[]
|
||
{
|
||
new Core.Web.WebHelper.ToolBar(ToolBarConfig.CONST_Other1, "关闭", "layui-btn-danger" ,"",true),
|
||
}
|
||
}
|
||
)
|
||
</div>
|
||
<form class="selftopwhere">
|
||
<div id="mytoolbar">
|
||
关联订单ID:
|
||
<div class="layui-inline">
|
||
<input type="text" name="txt_mainorderid" placeholder="请输入" autocomplete="off" class="layui-input" style="width:120px;">
|
||
</div>
|
||
赠送订单ID:
|
||
<div class="layui-inline">
|
||
<input type="text" name="txt_orderid" placeholder="请输入" autocomplete="off" class="layui-input" style="width:120px;">
|
||
</div>
|
||
客户编号:
|
||
<div class="layui-inline">
|
||
<input type="text" name="txt_resid" placeholder="请输入" autocomplete="off" class="layui-input" style="width:120px;" value="@ViewBag.resid">
|
||
</div>
|
||
用户名:
|
||
<div class="layui-inline">
|
||
<input type="text" name="txt_softusername" placeholder="请输入" autocomplete="off" class="layui-input" style="width:120px;">
|
||
</div>
|
||
订单状态:
|
||
<div class="layui-inline">
|
||
<select name="slt_orderStatus" style="height:35px;">
|
||
<option value="">请选择</option>
|
||
<option value="0">待审核</option>
|
||
<option value="1">已开通</option>
|
||
<option value="2">审核不通过</option>
|
||
</select>
|
||
</div>
|
||
事业部:
|
||
<div class="layui-inline">
|
||
<div id="selectChannel" style="width: 400px"></div>
|
||
@*<select name="txt_channel" style="height:35px;">
|
||
<option value="">请选择</option>
|
||
@foreach (var item in ViewBag.companyList as List<Bas_CompanyVirtual>)
|
||
{
|
||
<option value="@item.Channel">@item.CompanyName</option>
|
||
}
|
||
</select>*@
|
||
</div>
|
||
权限单号:
|
||
<div class="layui-inline">
|
||
<input type="text" name="txt_szzyOrderId" placeholder="请输入" autocomplete="off" class="layui-input" style="width:120px;">
|
||
</div>
|
||
下单日期:
|
||
<div class="layui-inline">
|
||
<input class="layui-input" placeholder="开始日" name="txt_stime" id="xstart" style="width:120px;">
|
||
</div>
|
||
<div class="layui-inline">
|
||
<input class="layui-input" placeholder="截止日" name="txt_etime" id="xend" style="width:120px;">
|
||
</div>
|
||
<input class="layui-btn layui-btn-sm" type="button" id="search" data-type="reload" value="搜索" />
|
||
<input class="layui-btn layui-btn-sm layui-btn-reset" type="reset" value="清空" />
|
||
</div>
|
||
</form>
|
||
<table class="layui-hide" id="tabl1" lay-filter="tabl1"></table>
|
||
</div>
|
||
<script src="~/Scripts/layui_ext/xm-select/xm-select.js"></script>
|
||
<script>
|
||
var selectRow = {};
|
||
var checkArray = [];
|
||
var currentArray;
|
||
layui.use('laydate', function () {
|
||
var laydate = layui.laydate;
|
||
//执行一个laydate实例
|
||
laydate.render({ elem: '#xstart' });
|
||
laydate.render({ elem: '#xend' });
|
||
});
|
||
var table;
|
||
layui.use(['table'], function () {
|
||
table = layui.table;
|
||
var form = layui.form;
|
||
var param2 = GetParams("mytoolbar");
|
||
console.log("param2:" + param2);
|
||
table.render({
|
||
id: 'testReload',//列表别名ID
|
||
elem: '#tabl1',//表ID
|
||
url: 'GetListHtml',
|
||
method: 'POST',
|
||
size: "sm",
|
||
even: true, //开启隔行背景
|
||
cols: [[
|
||
{ type: "checkbox", fixed: "left", width: 50 },
|
||
{ field: 'mainorderid', title: '关联订单ID', fixed: 'left', width: 100 }
|
||
, { field: 'mainproductname', title: '正价产品', fixed: 'left', width: 160 }
|
||
, { field: 'mainpdays', title: '正价天数', fixed: 'left', width: 80 }
|
||
, { field: 'mainpgif', title: '正价赠送', fixed: 'left', width: 80 }
|
||
, { field: 'orderid', title: '赠送订单ID', fixed: 'left', width: 100 }
|
||
, { field: 'giftdays', title: '赠送天数', fixed: 'left', width: 100 }
|
||
, { field: 'memo', title: '申请说明', width: 150 }
|
||
, { field: 'otime', title: '开通时间', width: 120 }
|
||
, { field: 'subproductname', title: '赠送产品名称', width: 150 }
|
||
, { field: 'subproductcode', title: '赠送产品编码', width: 200 }
|
||
, { field: 'resid', title: '客户编号', width: 180 }
|
||
, { field: 'companyname', title: '事业部', width: 140 }
|
||
, { field: 'optime', title: '审核时间', width: 120 }
|
||
, { field: 'checkmemo', title: '审核意见', width: 150 }
|
||
|
||
, { field: 'ctime', title: '下单时间', width: 120 }
|
||
, { field: 'closetime', title: '关闭时间', width: 120 }
|
||
, { field: 'closememo', title: '关闭说明', width: 120 }
|
||
, {
|
||
field: 'contractstatus', title: '合同状态', width: 120, fixed: 'right', templet: function (d) {
|
||
if (d.contractstatus == 1) {
|
||
return "<a href=\"javascript:void(0);\" onclick=\"ContractFreeOrderView(" + d.orderid + ")\" style='color:red'>已签订</a>";
|
||
} else {
|
||
return "<font>未签订</font>";
|
||
}
|
||
}
|
||
}
|
||
, {
|
||
field: 'orderstatus', title: '状态', width: 120, fixed: 'right', templet: function (d) {
|
||
if (d.orderstatus == 0) {
|
||
return "<font color='#c2c2c2'>待审核</font>";
|
||
} else if (d.orderstatus == 1) {
|
||
return "<font color='#5FB878'>已开通</font>";
|
||
} else if (d.orderstatus == 2) {
|
||
return "<font color='#d6941c'>审核不通过</font>";
|
||
} else if (d.orderstatus == 3) {
|
||
return "<font color='red'>已关闭</font>";
|
||
}
|
||
}
|
||
}
|
||
|
||
, { field: 'softusername', title: '软件用户名', width: 120, fixed: 'right' }
|
||
, { field: 'szzyorderid', title: '权限单号', width: 160, fixed: 'right' }
|
||
|
||
]]
|
||
, done: function (res) {
|
||
currentArray = res.data;
|
||
checkArray = [];
|
||
var table = $('#tabl1').next('.layui-table-view');
|
||
let isCheck;
|
||
$.each(currentArray, function (key, val) {
|
||
isCheck = $.inArray(val.orderid, checkArray);
|
||
if (isCheck > -1) {
|
||
table.find('table>tbody>tr').eq(key).find('td').eq(0).find('input[type=checkbox]').prop('checked', true);
|
||
}
|
||
})
|
||
form.render('checkbox');
|
||
}, page: { //支持传入 laypage 组件的所有参数(某些参数除外,如:jump/elem) - 详见文档
|
||
layout: ['limit', 'count', 'prev', 'page', 'next', 'skip', 'refresh'] //自定义分页布局
|
||
//,curr: 5 //设定初始在第 5 页
|
||
, groups: 5 //只显示 1 个连续页码
|
||
|
||
}
|
||
, where: param2
|
||
});
|
||
|
||
$('#mytoolbar #search').on('click', function (data) {
|
||
var param = GetParams("mytoolbar");
|
||
table.reload('testReload', {
|
||
page: {
|
||
curr: 1 //重新从第 1 页开始
|
||
},
|
||
where: param
|
||
});
|
||
checkArray = [];
|
||
});
|
||
|
||
//监听行单击事件
|
||
table.on('row(tabl1)', function (obj) {
|
||
var data = obj.data;
|
||
//console.log(data);
|
||
//标注选中样式
|
||
obj.tr.addClass('self-table-click').siblings().removeClass('self-table-click');
|
||
selectRow = data
|
||
});
|
||
|
||
table.on('checkbox(tabl1)', function (obj) {
|
||
let checkData = obj.data;
|
||
// 全选中
|
||
if (obj.type == 'all' && obj.checked) {
|
||
let checkStatus = table.checkStatus('testReload');
|
||
data = checkStatus.data;
|
||
$.each(data, function (index, item) {
|
||
if (checkArray.indexOf(data[index].orderid) == -1) {
|
||
checkArray.push(data[index].orderid);
|
||
}
|
||
})
|
||
}
|
||
// 全不选中
|
||
else if (obj.type == 'all' && !obj.checked) {
|
||
let currentIndex;
|
||
$.each(currentArray, function (index, item) {
|
||
currentIndex = $.inArray(item.orderid, checkArray);
|
||
if (currentIndex > -1) {
|
||
checkArray.splice(currentIndex, 1);
|
||
}
|
||
})
|
||
}
|
||
//单选
|
||
else {
|
||
let orderid = checkData.orderid;
|
||
let checkIndex = $.inArray(orderid, checkArray);
|
||
if (checkIndex > -1) {
|
||
checkArray.splice(checkIndex, 1);
|
||
} else {
|
||
checkArray.push(orderid);
|
||
}
|
||
}
|
||
});
|
||
});
|
||
|
||
layui.use('layer', function () {
|
||
var layer = layui.layer;
|
||
var active = {
|
||
detail: function () {
|
||
if (selectRow.ORDERID === "undefined" || selectRow.ORDERID == null) {
|
||
layer.alert("请先选中一条记录!", { title: '提示' });
|
||
return;
|
||
}
|
||
layer.open({
|
||
title: '详细',
|
||
type: 2,
|
||
content: '/OrderPay/Add?orderid=' + selectRow.ORDERID,
|
||
area: ['850px', '600px']
|
||
});
|
||
},
|
||
check: function () {
|
||
console.log(checkArray);
|
||
if (checkArray == null || checkArray.length == 0) {
|
||
layer.alert("请最少先选中一条记录!", { title: '提示' });
|
||
return;
|
||
} else {
|
||
for (index in checkArray) {
|
||
var item = checkArray[index]
|
||
var currentItem = currentArray.filter(a => a.orderid == item)[0];
|
||
if (currentItem.orderstatus != 0) {
|
||
layer.alert("订单已做过审核,不能在审核。", { title: '提示' });
|
||
return;
|
||
}
|
||
}
|
||
if (checkArray.length == 1) {
|
||
layer.open({
|
||
title: '审核',
|
||
type: 2,
|
||
content: 'Check?orderid=' + checkArray[0],
|
||
area: ['650px', '600px']
|
||
});
|
||
} else {
|
||
|
||
layer.open({
|
||
id: "plshBtn",
|
||
title: "批量审核",
|
||
content: '<div style="width:100%; text-align: center;">批量处理【' + checkArray.length + '】个订单</div>'
|
||
, btn: ['审核不通过', '审核通过']
|
||
, btnAlign: 'c'
|
||
, yes: function (index, layero) {
|
||
//按钮【按钮一】的回调
|
||
//点击确定后执行的方法体
|
||
$.r_post('UnCheckSaveBatch', { orderids: checkArray.join(',') }, function (result) {
|
||
if (result.result) {
|
||
layer.alert("操作成功!", {
|
||
yes: function () { TableReload(); }
|
||
})
|
||
} else {
|
||
layer.open({ title: '错误提示', content: result.retmsg });
|
||
}
|
||
});
|
||
layer.close(index); //执行完后关闭
|
||
}
|
||
, btn2: function (index, layero) {
|
||
//点击确定后执行的方法体
|
||
$.r_post('CheckSaveBatch', { orderids: checkArray.join(',') }, function (result) {
|
||
if (result.result) {
|
||
layer.alert("操作成功!", {
|
||
yes: function () { TableReload(); }
|
||
})
|
||
} else {
|
||
layer.open({ title: '错误提示', content: result.retmsg });
|
||
}
|
||
});
|
||
layer.close(index); //执行完后关闭
|
||
}
|
||
});
|
||
|
||
//layer.confirm('批量处理【' + checkArray.length + '】个订单',
|
||
// {
|
||
// time: 0,
|
||
// icon: 3,
|
||
// shade: 0.2,
|
||
// closeBtn: 1,
|
||
// btnAlign: 'c',
|
||
// title: false,
|
||
// btn: ['审核不通过', '审核通过'],
|
||
// success: function () {
|
||
// this.enterEsc = function (event) {
|
||
// if (event.keyCode === 13) {
|
||
// TableReload();
|
||
// return false; //阻止系统默认回车事件
|
||
// }
|
||
// };
|
||
// $(document).on('keydown', this.enterEsc); //监听键盘事件,关闭层
|
||
// },
|
||
// end: function () {
|
||
// $(document).off('keydown', this.enterEsc); //解除键盘关闭事件
|
||
// }
|
||
// },
|
||
// function (index) {
|
||
// //点击确定后执行的方法体
|
||
// $.r_post('CheckSaveBatch', { orderids: checkArray.join(',') }, function (result) {
|
||
// if (result.result) {
|
||
// layer.alert("操作成功!", {
|
||
// yes: function () { TableReload(); }
|
||
// })
|
||
// } else {
|
||
// layer.open({ title: '错误提示', content: result.retmsg });
|
||
// }
|
||
// });
|
||
// layer.close(index); //执行完后关闭
|
||
// }
|
||
//);
|
||
}
|
||
}
|
||
}, other1: function () {
|
||
if (selectRow.orderid === "undefined" || selectRow.orderid == null) {
|
||
layer.alert("请先选中一条记录!", { title: '提示' });
|
||
return;
|
||
}
|
||
if (selectRow.orderstatus == 3) {
|
||
layer.alert("此订单已经关闭!", { title: '提示' });
|
||
return;
|
||
}
|
||
if (selectRow.orderstatus != 1) {
|
||
layer.alert("已开通的订单才能关闭!", { title: '提示' });
|
||
return;
|
||
}
|
||
layer.open({
|
||
type: 2,
|
||
content: 'Close?orderid=' + selectRow.orderid,
|
||
area: ['850px', '600px']
|
||
});
|
||
}
|
||
|
||
};
|
||
|
||
$('.layui-btn-group .layui-btn').on('click', function () {
|
||
var othis = $(this), method = othis.data('method');
|
||
active[method] ? active[method].call(this, othis) : '';
|
||
});
|
||
});
|
||
function ContractFreeOrderView(orderId) {
|
||
layer.open({
|
||
type: 2,
|
||
content: '/ComplianceOrder/ContractFreeOrderView?orderId=' + orderId,
|
||
title: "合同查看",
|
||
area: ['830px', '550px']
|
||
});
|
||
}
|
||
function show(umid, code) {
|
||
parent.gotoCallRecord(umid, code)
|
||
}
|
||
|
||
// 验证手机号
|
||
function isPhoneNo(phone) {
|
||
var pattern = /^1\d{10}$/;
|
||
return pattern.test(phone);
|
||
}
|
||
|
||
function TableReload() {
|
||
selectRow = {};
|
||
table.reload('testReload', {
|
||
});
|
||
layer.closeAll();
|
||
}
|
||
|
||
var optionsChannel = {
|
||
el: '#selectChannel',
|
||
name: 'txt_channel',//表单的name属性
|
||
layVerify: '',
|
||
tips: '请选择事业部',
|
||
toolbar: {//工具条,全选,清空,反选,自定义
|
||
show: true,
|
||
list: [
|
||
'CLEAR'
|
||
]
|
||
},
|
||
data: []
|
||
};
|
||
var selectChannel = xmSelect.render(optionsChannel);
|
||
var allChannel = @Html.Raw(ViewBag.AllChannel);
|
||
selectChannel.update({ data: allChannel });
|
||
</script> |