TG.WXCRM.V4/WEB/Views/Csvr/CustomerUC/CustomerJZOrder.cshtml

286 lines
12 KiB
Plaintext

@using WX.CRM.Common
@using WX.CRM.Model.Entity
@using WX.CRM.Model.QueryMap
@using WX.CRM.WebHelper
@{
Layout = null;
}
<style type="text/css">
.DisTable {
display: block;
}
.NoneTable {
display: none;
}
.td {
border: 1px solid #ff0000;
}
.curshow {
padding: 0 20px 5px;
background-color: #F7FAFE;
}
.curshow2 {
padding: 0 20px 5px;
background-color: #F7FAFE;
}
.curhide {
padding: 0 20px 5px;
}
#threeBtn {
display:none;
cursor: pointer;
color: white;
margin-left: 200px;
}
</style>
<script src="~/Scripts/clipboard.min.js"></script>
<div class="group content_title_width">
<span class="csicon OrderIcon"></span>
<span>客户订单</span>
</div>
<div class="content_div" style="margin-top:5px;margin-bottom:50px;">
<table class="layui-table content_width">
<thead>
<tr>
<td>
<input class="layui-btn layui-btn-sm layui-btn-normal " value="+添加订单" type="button" onclick="ShowWindowBoxZxOrder('添加订单', '/WeiXin/JZOrder/AddByRes?CustomerId=@ViewBag.CustomerId')">
&nbsp;&nbsp;&nbsp;&nbsp;
<input class="layui-btn layui-btn-sm layui-bg-cyan " value="订单详情" onclick="Details_Click()" type="button">
&nbsp;&nbsp;&nbsp;&nbsp;
@*<input class="layui-btn layui-btn-sm layui-btn-normal " value="添加订金" type="button" onclick="ShowWindowBoxZxOrder('添加订金', '/WeiXin/OrderDeposit/Add?CustomerId=@ViewBag.CustomerId')">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*@
@*<input class="layui-btn layui-btn-sm layui-bg-cyan " value="订金信息" type="button" onclick="ShowOrderDeposit('订金信息', '/WeiXin/OrderDeposit/Info?CustomerId=@ViewBag.CustomerId')">*@
<input class="layui-btn layui-btn-sm layui-bg-cyan " value="订金信息" type="button" onclick="ShowOrderDeposit('订金信息', '/WeiXin/OrderDeposit/List?CustomerId=@ViewBag.CustomerId')">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="javascript:parent.ChildAddTab('我的订单', '/WeiXin/JZOrder/Index?urlTitle=我的订单', '')">我的订单</a>
</td>
<td style="text-align:right;"><input class="layui-btn layui-btn-sm layui-btn-primary " value="刷新订单数据" onclick="javascript: GetOrderList();" type="button"></td>
</tr>
</thead>
</table>
<div style="margin-top: 5px;">
<div>
@*@for (int i = 0; i < List.Count; i++)
{
<a href="javascript:void(0);" class='curhide @(i == 0 ? "curshow2" : "")' onclick="tabshow2(this, @i, '@List[i].RESID')">
@(string.IsNullOrEmpty(List[i].RESID) ? "无resID" : List[i].RESID)
</a>
}*@
</div>
@*<table class="layui-table content_width" style="@(i == 0 ? "" : " display:none;")" id="tab2@(i)">*@
<table class="layui-table content_width" id="orderList">
<thead>
<tr>
<td></td>
<td>订单号</td>
<td>软件订单号</td>
<td>产品名称</td>
<td>订单类型</td>
<td>用户名</td>
<td>订单状态</td>
<td>下单时间</td>
<td>开通时间</td>
<td>下单金额</td>
@*<td>实付金额</td>*@
<td>到账金额</td>
<td>开通天数</td>
<td>赠送天数</td>
<td>赠送天数2</td>
<td>合同地址</td>
<td>付款方式</td>
<td>风险评测</td>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<input id="hidUrl" value="" style="position: absolute; left:-100000px; top:-100000px;" />
<script type="text/javascript">
function ShowWindowBoxZxOrder(comName, linkUrl) {
$("#modalwindow").html(GetIframeHtml(linkUrl));
$("#modalwindow").window({ title: comName, width: 680, height: 640, iconCls: 'icon-add' }).window('open');
}
function ShowOrderDeposit(comName, linkUrl) {
$("#modalwindow").html(GetIframeHtml(linkUrl));
$("#modalwindow").window({ title: comName, width: 1110, height: 600, iconCls: 'icon-add' }).window('open');
}
function GetWxPayInfo(orderId) {
if (orderId != undefined && orderId.length != 0 && orderId != 0) {
$("#modalwindow").html(GetIframeHtml("/WeiXin/SzzyOrder/PayInfo?orderId=" + orderId + "&Ieguid=" + GetGuid()));
$("#modalwindow").window({ title: '支付信息', width: 830, height: 550, iconCls: 'icon-edit' }).window('open');
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
var curRow; //全局行号
var curColor;
function selectRow(tr) {
//alert(tr.rowIndex);
if (curRow) {
curRow.bgColor = curColor;
curColor = tr.bgColor;
tr.bgColor = "#FFE9B3";
} else {
curColor = tr.bgColor;
tr.bgColor = "FFE9B3";
}
curRow = tr;
}
function getSelectRowOrderId() {
if (curRow) {
if (window.navigator.userAgent.toLowerCase().indexOf("firefox") != -1) {
return curRow.cells[1].innerContent;
}
else {
return curRow.cells[1].innerText;
}
} else {
$.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords');
}
}
function UpdateOrder_Click() {
//var row = $('#tablist').tablegrid('getSelected');
if (curRow) {
var orderId = getSelectRowOrderId();
$.messager.confirm('提示', '你确定要更新订单信息吗?', function (r) {
if (r) {
$.r_post("/WeiXin/SzzyOrder/UpdateSzzyOrder?orderId=" + orderId, function (data) {
if (data.type == 1) {
GetOrderList();
$.messageBox5s('提示', '更新订单信息成功');
} else {
$.messageBox5s('错误', data.message);
}
}, "json");
}
});
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function UpdateCommission_Click() {
//var row = $('#tablist').tablegrid('getSelected');
if (curRow) {
var orderId = getSelectRowOrderId();
$("#modalwindow").html(GetIframeHtml("/WeiXin/CommissionRule/Edit?orderid=" + orderId + "&Ieguid=" + GetGuid()));
$("#modalwindow").window({ title: '编辑', width: 700, height: 600, iconCls: 'icon-edit' }).window('open');
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function Edit_Click() {
//var row = $('#tablist').tablegrid('getSelected');
if (curRow) {
var orderId = getSelectRowOrderId();
$("#modalwindow").html(GetIframeHtml("/WeiXin/SzzyOrder/Edit?orderId=" + orderId + "&Ieguid=" + GetGuid()));
$("#modalwindow").window({ title: '编辑', width: 700, height: 600, iconCls: 'icon-edit' }).window('open');
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function Details_Click() {
//var row = $('#tablist').tablegrid('getSelected');
if (curRow) {
var orderId = getSelectRowOrderId();
var iframe = "<iframe width='100%' height='98%' scrolling='auto' frameborder='0' src='/WeiXin/JZOrder/Detail?orderId=" + orderId + "&Ieguid=" + GetGuid() + "'></iframe>";
$("#modalwindow").html(iframe);
$("#modalwindow").window({ title: '订单详情', width: 700, height: 600, iconCls: 'icon-edit' }).window('open');
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function ShowHeTongUrl(orderid) {
var murl = $("#" + orderid).val();
var ids = orderid.replace("h", "t");
$("#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>&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 ><a id=\"threeBtn\" onclick=\"ShowThreeHeTongUrl('" + ids + "')\">三要素测试</a ></div>");
$("#modalwindow").window({ title: '合同地址', width: 400, height: 350, iconCls: 'icon-edit' }).window('open');
}
function ShowThreeHeTongUrl(orderid) {
var murl = $("#" + orderid).val();
var ids = orderid.replace("t", "h");
$("#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>&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 ><a id=\"threeBtn\" onclick=\"ShowHeTongUrl('" + ids + "')\">切回二要素</a ></div>");
$("#modalwindow").window({ title: '三要素合同地址', width: 400, height: 350, iconCls: 'icon-edit' }).window('open');
}
function GetOrderList() {
$.r_ajax({
url: "/Csvr/CustomerUC/GetJZOrderListHtml",
type: "Post",
data: {resId: "@Model.CustomerId" },
dataType: "json",
loading: true,
success: function (data) {
$("#orderList").attr("AlreadyLoad", "true");
$("#orderList tbody").html(data.rowsList);
/*var rownum = 0;
$("#orderList tbody tr").each(function () {
rownum++;
$(this).find("td").eq(0).html(rownum);
});*/
/*$("#orderList tbody tr").each(function () {
//$(this).cells[0].innerText;
onclick = function () {
selectRow(this);
}
});*/
//alert($("#orderList tbody").html());
}, error: function () {
$.messager.alert('警告', '数据加载失败!', "error");
}
});
}
function GetWxPayInfo(orderId) {
if (orderId != undefined && orderId.length != 0 && orderId !=0) {
$("#modalwindow").html(GetIframeHtml("/WeiXin/JZOrder/PayInfo?orderId=" + orderId + "&Ieguid=" + GetGuid()));
$("#modalwindow").window({ title: '支付信息', width: 830, height: 550, iconCls: 'icon-edit' }).window('open');
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function ShowRiskInfo(userName, szzyOrderId) {
$.r_ajax({
url: "/Csvr/CustomerUC/GetRiskInfo?userName=" + userName + "&szzyOrderId="+szzyOrderId,
type: "Get",
success: function (data) {
if (data.result == true) {
window.open(data.url, '_blank');
}
else {
$.messager.alert('警告', '数据加载失败!', "error");
}
}, error: function () {
$.messager.alert('警告', '数据加载失败!', "error");
}
});
}
$(function () {
GetOrderList();
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>