TG.WXCRM.V4/WEB/Views/WeiXin/JZOrder/HandleGif.cshtml

432 lines
17 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@using WX.CRM.WebHelper
@{
/**/
/**/
ViewBag.Title = "";
Layout = "~/Views/Shared/_content.cshtml";
}
<script src="/Scripts/jquery.easyui.min.js" type="text/javascript"></script>
<link href="/Content/themes/blue/easyui.css" rel="stylesheet" />
<link href="/Content/Site.css" rel="stylesheet" />
<script src="/Scripts/common.js"></script>
<link href="/Content/data_grid_list.css" rel="stylesheet" />
<script src="/Scripts/op/jquery.rewrite.js"></script>
<script src="~/Scripts/clipboard.min.js"></script>
<div class="layui-fluid" style="padding-left:0px;padding-top:10px;">
<style>
.self-table-click td {
background-color: #f3ebbc;
}
</style>
<div class="layui-card" id="topcard" style="width:100%;padding-top:10px;">
<div class="layui-card-header layui-self-header">
<div style="float:left;position:relative;">
赠送订单列表
</div>
<a style="padding-left:50px;font-size:12px;cursor:pointer;" onclick="ShowGiftCount()">赠送次数查看</a>
<div style="float:right;position:relative;">
@Html.Action("ToolBarNew", "Control", new
{
tool = ViewBag.ToolBar as ToolBar,
otherToolBars = new ToolBarNew[] {
new ToolBarNew(){ btnColor="", btnName="审核" },
new ToolBarNew(){ btnColor="layui-btn-upload1", btnName="导入" },
new ToolBarNew(){ btnColor="", btnName="导出" },
}
})
@*<input class="layui-btn layui-btn-sm layui-btn-normal" data-method="other4" type="button" value="选择客户" />*@
@*<input class="layui-btn layui-btn-sm layui-btn-ok" data-method="add" type="button" value="+新增" />
<input class="layui-btn layui-btn-sm layui-btn-normal" data-method="update" type="reset" value="修改" />
<input class="layui-btn layui-btn-sm layui-btn-reset" data-method="delete" type="reset" value="删除" />*@
</div>
<div class="hrclass" style="position:relative;float: left;"></div>
</div>
<div class="layui-card-body " id="contentBody">
<form class="layui-form selftopwhere" id="myform">
<div class="layui-form-item">
<div class="layui-inline" style="width:465px;">@Html.Action("UserSSOComBox", "Control", new { currentRight = WX.CRM.WebHelper.InitRights.CONST_赠送订单列表 })</div>
订单状态:
<div class="layui-inline">
<select name="ORDERSTATUS" style="height:35px;">
<option value="">全部</option>
<option value="0">待审</option>
<option value="1">审核通过</option>
<option value="2">审核不通</option>
</select>
</div>
赠送订单ID
<div class="layui-inline">
<input type="text" name="ORDERID" style="width:120px" />
</div>
订单ID
<div class="layui-inline">
<input type="text" name="MAINORDERID" style="width:120px" />
</div>
客户ID
<div class="layui-inline">
<input type="text" name="RESID" style="width:120px" />
</div>
用户名:
<div class="layui-inline">
<input type="text" name="SOFTUSERNAME" style="width:120px" />
</div>
下单日期:
<div class="layui-inline">
<input class="layui-input" placeholder="开始日" name="STIME" id="stime" style="width:120px;">
</div>
<div class="layui-inline">
<input class="layui-input" placeholder="结束日" name="ETIME" id="etime" style="width:120px;">
</div>
签约状态:
<div class="layui-inline">
<select name="CONTRACTSTATUS" id="CONTRACTSTATUS">
<option value="">全部</option>
<option value="1">已签</option>
<option value="0">未签</option>
</select>
</div>
<div class="layui-inline">
<input class="layui-btn layui-btn-sm layui-btn-ok" data-method="search" type="button" value="查询" /><input class="layui-btn layui-btn-sm layui-btn-reset" type="reset" value="清空" />
</div>
</div>
</form>
<table class="layui-hide" id="tabl1" lay-filter="tabl1"></table>
</div>
</div>
<input id="hidUrl" value="" style="position: absolute; left:-100000px; top:-100000px;" />
</div>
<script>
layui.use('laydate', function () {
var laydate = layui.laydate;
//执行一个laydate实例
laydate.render({
elem: '#stime' //指定元素
});
//执行一个laydate实例
laydate.render({
elem: '#etime' //指定元素
});
//执行一个laydate实例
laydate.render({
elem: '#statustime' //指定元素
});
//执行一个laydate实例
laydate.render({
elem: '#statusEndtime' //指定元素
});
});
var selectRow = {};
var winindex;
var layer;
var rowid;
var upload;
var importData = [];
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
layui.use(['laypage', 'layer', 'upload', 'table', 'laydate', 'form'], function () {
var form = layui.form;
var laydate = layui.laydate;
layer = layui.layer;
upload = layui.upload;
table = layui.table;
tableCols = [[
{ field: 'MAINORDERID', title: '关联订单号', width: 100 }
, { field: 'DEPTCODE', title: '部门归属' }
, { field: 'RequestDeptName', title: '请求方部门归属' }
, { field: 'EidAndName', title: '创建人', width: 120 }
, { field: 'MAINPRODUCTNAME', title: '正价产品' }
, { field: 'MAINPDAYS', title: '正价天数', width: 100 }
, { field: 'MAINPGIF', title: '正价赠送天数', width: 110 }
, { field: 'ORDERID', title: '赠送订单ID', width: 120 }
, { field: 'SZZYORDERID', title: '权限订单号', width: 120 }
, { field: 'GIFTDAYS', title: '赠送天数', width: 100 }
, { field: 'SUBPRODUCTNAME', title: '赠送产品', width: 100 }
, { field: 'SOFTUSERNAME', title: '用户名' }
, { field: 'CTIME', title: '下单时间' }
, {
field: 'ORDERSTATUS', title: '状态', align: "center", width: 120, templet: function (d) {
if (d.ORDERSTATUS == 1) {
return "<font color='#5FB878'>审核通过</font>";
} else if (d.ORDERSTATUS == 2)
return "<font color='#d6941c'>审核不通过</font>";
else if (d.ORDERSTATUS == 0)
return "<font color='#c2c2c2'>待审核</font>";
else if (d.ORDERSTATUS == 3)
return "<font color='red'>已关闭</font>";
}
}, {
field: 'threeUrl', title: '合同地址', align: "center", width: 120, templet: function (d) {
if (d.threeUrl != "" || d.threeUrl != null) {
var html = "<a style='color: green;' href='javascript:void(0);' onclick=\"ShowThreeHeTongUrl('" + d.ORDERID + "')\">获取地址</a>";
return html;
} else {
return "";
}
}
}, {
field: 'CONTRACTSTATUS', title: '合同状态', align: "center", width: 120, templet: function (d) {
if (d.CONTRACTSTATUS == 1) {
return "<a href=\"javascript:void(0);\" onclick=\"ContractFreeOrderView(" + d.ORDERID + ")\" style='color:red'>已签订</a>";
}
else
return "<font color='#c2c2c2'>未签订</font>";
}
}
, { field: 'OPTIME', title: '开通时间' }
, { field: 'MEMO', title: '申请理由', width: 150 }
, { field: 'CHECKMEMO', title: '审核备注', width: 150 }
, { field: 'CLOSEMEMO', title: '关闭说明', width: 150 }
]];
table.render({
id: 'listReload'//列表别名ID
, elem: '#tabl1'
, url: 'HandleGifList'
, method: 'POST'
, cellMinWidth: 80 //全局定义常规单元格的最小宽度layui 2.2.1 新增
, page: true
, limit: 30
, height: "full-160"
, size: "sm"
, cols: tableCols, where: $("#myform").serializeFormJSON()
});
//监听行单击事件
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;
});
var active = {
add: function () {
winindex = layer.open({
type: 2,
content: 'HandleGifAdd',
title: "新增赠送订单",
area: ['600px', '500px']
});
},
other1: function () {
var allData = table.cache["listReload"];
var currentItem = allData.filter(a => a.ORDERID == selectRow.ORDERID)[0];
if (!currentItem) {
layer.alert("请至少选中一条数据!", { title: '提示' });
}
if (currentItem.ORDERSTATUS != 0) {
layer.alert("订单已做过审核或驳回,不能再审核。", { title: '提示' });
return;
}
winindex = layer.open({
title: '审核',
type: 2,
content: '/JZOrder/HandleGifCheck?orderid=' + selectRow.ORDERID,
area: ['650px', '600px']
});
},
other3: function () {
debugger
var param = $("#myform").serializeFormJSON();
var queryString = "";
for (var key in param) {
if (queryString != "") queryString += "&";
queryString += key + "=" + encodeURIComponent(param[key]);
}
layer.open({
title: '<i class="layui-icon layui-icon-export" style="font-size: 20px; color: #1E9FFF;"></i>&nbsp;导出',
type: 2,
content: "/Control/ExcelExport_cookie?Query=" + encodeURIComponent("/JZOrder/HandleGiftExport?param=" + JSON.stringify(param)),
area: ['850px', '400px']
});
},
search: function () {
var param = $("#myform").serializeFormJSON();
table.reload('listReload', {
where: param,
page: {
curr: 1
}
});
}
};
$('.layui-btn').on('click', function () {
var othis = $(this), method = othis.data('method');
console.log(method);
active[method] ? active[method].call(this, othis) : '';
});
upload.render({ //允许上传的文件后缀
elem: '.layui-btn-upload1'
, url: '/JZOrder/ImportBasicsGift'
, accept: 'file' //普通文件
, exts: 'xls|xlsx' //只允许上传压缩文件
, size: 100000 //限制文件大小,单位 KB
, auto: true
, done: function (res) {
layer.closeAll('loading');
debugger
if (res.code == 0) {
importData = res.data;
layer.open({
title: '编辑',
type: 2,
content: '/JZOrder/ImportBasicsGiftView',
area: ['1150px', '600px']
});
}
else {
if (res.msg != "") {
layer.msg(res.msg, { icon: 2, time: 6666 });
}
else {
layer.msg("操作失败了!", { icon: 2, time: 0 });
}
}
}
, error: function () {
layer.closeAll('loading');
layer.msg("操作失败了,请重新上传!", { icon: 2, time: 5000 });
}
});
});
//获取datagrid头部及字段
function getDataGridHeader() {
var newcolumns = [];
var columns = tableCols[0];
for (var i = 0; i < columns.length; i++) {
if (columns[i].field != "checkbox" && columns[i].type != "numbers" && columns[i].field != "operation" && columns[i].field != "saleline") {
newcolumns.push(columns[i])
};
}
return newcolumns;
}
function onLoadSucced() {
}
function GetImportData() {
return importData;
}
function GetImportData2() {
return JSON.stringify(importData);
}
function UserSetImportData(newDataList) {
debugger
importData = newDataList;
}
function ShowThreeHeTongUrl(orderid) {
$.get('@ViewBag.Core_ZxdCoreUrl' + '/Api/Contract/GetContractByFreeOrder?orderId=' + orderid, function (res) {
if (res.code == 0) {
var murl = res.data;
$("#hidUrl").val(murl);
var html = "<div style='width:360px;white-space:normal;word-break:break-all;word-wrap:break-word;padding:10px;' id='wamsmx'>" + murl + "</div><div>&nbsp;&nbsp;&nbsp;<a class='layui-btn' style='color:white' href='" + murl + "' target=\"_blank\">打开</a><button class=\"btn htbtn layui-btn\" data-clipboard-target=\"#hidUrl\">复制</button ></div>";
layer.open({
type: 1,
shade: 0.3,
area: ['400px', '300px'],
title: "三要素合同地址",
content: html, // 捕获的元素
});
}
});
}
function ShowLog(id) {
var width = $(window).width() * 0.8;
var height = $(window).height() * 0.8;
layer.open({
type: 2,
content: '/Cms/CmsUp/Log?Id=' + id,
title: "明细",
area: [width + 'px', height + 'px']
});
}
function Closed() {
layer.close(winindex);
}
function TableReload() {
table.reload('listReload', {
});
}
function ShowGiftCount() {
layer.open({
type: 2,
content: '/JZOrder/HandleGiftNumber',
title: "赠送次数查看",
area: ['830px', '310px']
});
}
function ContractFreeOrderView(orderId) {
layer.open({
type: 2,
content: '/JZOrder/ContractFreeOrderView?orderId=' + orderId,
title: "合同查看",
area: ['830px', '550px']
});
}
$(function () {
var clipboard = new ClipboardJS('.htbtn');
clipboard.on('success', function (e) {
//alert("复制成功!");
layer.alert("复制成功");
// $.messager.alert('提示', '复制成功', "info");
e.clearSelection();
});
clipboard.on('error', function (e) {
console.error('Action:', e.action);
console.error('Trigger:', e.trigger);
});
});
</script>
<script type="text/html" id="agentTpl">
{{# if(d.ISOUTERAGENT == '1'){ }}
{{# } else if(d.ISOUTERAGENT == '0') { }}
{{# } }}
</script>
<script type="text/html" id="typeTpl">
{{# if(d.NEWSTYPE == "activity"){ }}
活动
{{# } else if(d.NEWSTYPE == "plan"){ }}
策划
{{# } else if(d.NEWSTYPE == "ad"){ }}
推广
{{# } else if(d.NEWSTYPE == "service"){ }}
客户服务内容
{{# } }}
</script>
<script type="text/html" id="statusTpl">
{{# if(d.STATUS == 1){ }}
<img src="/Content/Images/checked.png" style="height:20px;width:20px;" />
@*<i class="layui-icon layui-icon-ok layui-bg-green"></i>*@
{{# } else if(d.STATUS == -1) { }}
@*<i class="layui-icon layui-icon-close layui-bg-red"></i>*@
<img src="/Content/Images/unchecked.png" style="height:18px;width:18px;" />
{{# } else { }}
@*<i class="layui-icon layui-icon-more layui-bg-blue"></i>*@
<img src="/Content/Images/checking.png" style="height:16px;width:16px;" />
{{# } }}
</script>
<script type="text/html" id="attTpl">
{{# if(d.ATT != null){ }}
<a href="{{d.ATT}}" target="_blank" class="layui-table-link">下载</a>
{{# } }}
</script>