|
|
<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="utf-8">
|
<title>委外订单列表</title>
|
<meta name="renderer" content="webkit">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
<link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
|
</head>
|
<body>
|
|
<div class="layui-card layadmin-header">
|
<div class="layui-breadcrumb" lay-filter="breadcrumb">
|
<a lay-href="">主页</a>
|
<a><cite>委外订单</cite></a>
|
<a><cite>委外订单表格</cite></a>
|
<a><cite>委外订单表格的重载</cite></a>
|
</div>
|
</div>
|
|
<div class="layui-fluid">
|
<div class="layui-row layui-col-space15">
|
<div class="layui-col-md12">
|
<div class="layui-card">
|
<div class="layui-card-header">委外订单列表</div>
|
<div class="layui-card-body">
|
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
单据号:
|
<div class="layui-inline">
|
<input class="layui-input" name="HBillNo" id="HBillNo" autocomplete="off">
|
</div>
|
<button class="layui-btn" data-type="f_Query">查询</button>
|
<button class="layui-btn" data-type="f_Qrjq">接受</button>
|
<button class="layui-btn" data-type="f_Bhjq">拒绝</button>
|
</div>
|
<table class="layui-hide" id="test-table-reload" lay-filter="user"></table>
|
<blockquote class="layui-elem-quote">委外订单列表</blockquote>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<!--<script src="../../layuiadmin/layui/lay/modules/mobile/jquery-3.3.1.min.js"></script>-->
|
<script src="../../layuiadmin/layui/layui.js"></script>
|
<script>
|
layui.config({
|
base: '../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'table'], function () {
|
var $ = layui.$;
|
var table = layui.table;
|
var layer = layui.layer;
|
RoadHBillNo("and 1=1");
|
layer.load(3)
|
//方法级渲染
|
table.render({
|
elem: '#test-table-reload'
|
, dateType: 'json'
|
, colFilterRecord: true//是否开启字段筛选的记忆功能
|
, data: []
|
, toolbar: '#toolbarDemo'
|
, cols: [[
|
{ checkbox: true, fixed: true }
|
, { field: '确认状态', title: '确认状态', width: 100, sort: true, fixed: true }
|
, { field: '单据号', title: '单据号', width: 200, sort: true, fixed: true }
|
, { field: '计划跟踪单号', title: '计划跟踪单号', width: 100, hide: true }
|
, { field: '供应商', title: '供应商', width: 200 }
|
, { field: '物料代码', title: '物料代码', width: 200 }
|
, { field: '物料名称', title: '物料名称', width: 200 }
|
, { field: '规格型号', title: '规格型号', width: 200 }
|
, { field: '计量单位', title: '计量单位', width: 100 }
|
, { field: '数量', title: '数量', width: 100 }
|
, { field: '日期', title: '日期', width: 150 }
|
, { field: '交货日期', title: '交货日期', width: 150 }
|
, { field: '确认人', title: '确认人', width: 100 }
|
, { field: '确认日期', title: '确认日期', width: 150 }
|
, { field: '驳回人', title: '驳回人', width: 100 }
|
, { field: '驳回日期', title: '驳回日期', width: 150 }
|
, { field: '驳回理由', title: '驳回理由', width: 200, edit: 'text' }
|
]]
|
, page: true
|
, height: 500
|
,done:function(){
|
layer.closeAll("loading");
|
}
|
});
|
|
///加载显示数据
|
function RoadHBillNo (sqlWhere) {
|
where = sqlWhere;
|
$.ajax({
|
type: "get",
|
url: "http://localhost:8083/Web/GetICSubContractBill",
|
async: true,
|
data: { "HSupNo": sessionStorage["HUserName"], "sqlWhere": sqlWhere },
|
success: function (result) {
|
ajaxReturnData = JSON.parse(JSON.stringify(result)).data;
|
table.reload('test-table-reload', {
|
data: ajaxReturnData
|
, height: 'full-10'
|
, loading: false
|
, done: function (index, res) {
|
|
}
|
});
|
},
|
error: function (result) {
|
console.log(result);
|
//layer.msg('获取采购订单出现异常', { icon: 2, time: 2000 });
|
}
|
});
|
};
|
var $ = layui.$, active = {
|
//快速查询
|
f_Query: function () { //查询
|
var sqlWhere = " and 1=1 ";
|
if ($("#HBillNo").val() != "")
|
sqlWhere += " and 单据号 like ''%" + $("#HBillNo").val() + "%''";
|
RoadHBillNo(sqlWhere);
|
},
|
f_Qrjq: function () { //接受
|
var checkStatus = table.checkStatus('test-table-reload')
|
, data = checkStatus.data;
|
//for (var i = 0; i < data.length; i++) {
|
// rows += data[i].hmainid.toString() + ',' + data[i].hsubid.toString() + ';';
|
if (data[0]["确认状态"] == "未确认") {
|
$.ajax({
|
type: "get",
|
url: "http://localhost:8083/Web/WebAccept",
|
data: { "HInterID": data[0].hmainid.toString(), "HBillType": 1601 },
|
success: function (result) {
|
if (result.count == 1) { // 说明验证成功了,
|
layer.msg(result.Message, { icon: 1 });
|
RoadHBillNo("and 1=1");
|
}
|
else {
|
// $("#verifycode").click();
|
layer.msg(result.Message, { icon: 5 });
|
}
|
layer.closeAll("loading");
|
}
|
})
|
}
|
else {
|
layer.msg("必须是未确认单据才能进行确认操作!", { icon: 5 });
|
}
|
// }
|
},
|
f_Bhjq: function () { //拒绝
|
var checkStatus = table.checkStatus('test-table-reload')
|
, data = checkStatus.data;
|
// for (var i = 0; i < data.length; i++) {
|
// rows += data[i].hmainid.toString() + ',' + data[i].hsubid.toString() + ';';
|
if (data[0]["确认状态"] == "未确认") {
|
$.ajax({
|
type: "get",
|
url: "http://localhost:8083/Web/WebRefuse",
|
data: { "HInterID": data[0].hmainid.toString(), "HSubBackRemark": data[0]["驳回理由"], "HBillType": 1601 },
|
success: function (result) {
|
if (result.count == 1) { // 说明验证成功了,
|
layer.msg("拒绝成功!", { icon: 1 });
|
RoadHBillNo("and 1=1");
|
}
|
else {
|
// $("#verifycode").click();
|
layer.msg(result.Message, { icon: 5 });
|
}
|
layer.closeAll("loading");
|
}
|
})
|
}
|
else {
|
layer.msg("必须是未确认单据才能进行驳回操作!", { icon: 5 });
|
}
|
|
// }
|
table.reload("test-table-reload", {
|
page: { curr: 1 },
|
where: { HBillNo: $("#HBillNo").val() }
|
}, 'data');
|
},
|
//JSreload: function () {
|
// var demoReload = $('#test-table-demoReload');
|
// //执行重载
|
// table.JSreload('test-table-reload', {
|
// page: {
|
// curr: 1 //重新从第 1 页开始
|
// }
|
// , where: {
|
// key: {
|
// id: demoReload.val()
|
// }
|
// }
|
// });
|
//}
|
};
|
|
$('.test-table-reload-btn .layui-btn').on('click', function () {
|
var type = $(this).data('type');
|
active[type] ? active[type].call(this) : '';
|
});
|
});
|
</script>
|
</body>
|
</html>
|