工程领退台账数据穿透
This commit is contained in:
parent
ae2b6ffa0c
commit
160861d3e3
|
|
@ -0,0 +1,311 @@
|
|||
let objParam;
|
||||
let form, table, tableIns, layer, element;
|
||||
let pageNum = 1;
|
||||
|
||||
function setParams(params) {
|
||||
objParam = JSON.parse(params);
|
||||
console.error(objParam);
|
||||
$('#proName').html(objParam.proName);
|
||||
layui.use(["form", "table", 'layer', 'element'], function () {
|
||||
form = layui.form;
|
||||
table = layui.table;
|
||||
element = layui.element;
|
||||
layer = layui.layer;
|
||||
// getProDetails();
|
||||
initTable();
|
||||
});
|
||||
}
|
||||
|
||||
// 数据概览
|
||||
function getProDetails() {
|
||||
let params = {
|
||||
encryptedData: JSON.stringify({
|
||||
'proId': objParam.proId
|
||||
})
|
||||
};
|
||||
let url = dataUrl + 'backstage/purchase/getProDetails';
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
setNum(result.data);
|
||||
}
|
||||
}, function (xhr, status, error) {
|
||||
errorFn(xhr, status, error)
|
||||
}, null);
|
||||
|
||||
// 数据概览赋值
|
||||
function setNum(obj) {
|
||||
$('#planNum').html(obj.planNum);
|
||||
$('#lkNum').html(obj.lkNum);
|
||||
$('#cgNum').html(obj.cgNum);
|
||||
$('#money').html(' ¥ ' + (obj.money ? obj.money : 0));
|
||||
$('#bmname').html(obj.bmname);
|
||||
$('.layui-progress').remove();
|
||||
console.log(obj)
|
||||
var color = "layui-bg-orange";
|
||||
if (obj.process < 100) {
|
||||
color = "layui-bg-orange";
|
||||
} else if (obj.process == 100) {
|
||||
color = "layui-bg-primary";
|
||||
} else if (obj.process > 100) {
|
||||
color = "layui-bg-red";
|
||||
}
|
||||
$("#progress").after(`
|
||||
<div class="layui-progress" lay-showpercent="true" lay-filter="demo-filter-progress">
|
||||
<div class="layui-progress-bar ${color}" lay-percent="${obj.process}%"></div>
|
||||
</div>
|
||||
`);
|
||||
element.render();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 查询/重置
|
||||
function queryTable(type) {
|
||||
if (type === 1) {
|
||||
let planCode = $('#planCode').val();
|
||||
let flag = checkValue(planCode);
|
||||
if (flag) {
|
||||
$('#planCode').val('');
|
||||
return layer.msg('需求计划编号查询包含特殊字符,请重新输入', {icon: 2});
|
||||
}
|
||||
reloadTable(1);
|
||||
} else if (type === 2) {
|
||||
$('#planCode').val('');
|
||||
$('#status').val('');
|
||||
layui.form.render();
|
||||
reloadTable(1);
|
||||
}
|
||||
}
|
||||
|
||||
// 刷新页面数据
|
||||
function reloadData() {
|
||||
reloadTable(pageNum);
|
||||
}
|
||||
|
||||
// 重载表格
|
||||
function reloadTable(pageNum) {
|
||||
table.reload("currentTableId", {
|
||||
page: {
|
||||
curr: pageNum ? pageNum : 1,
|
||||
},
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'planCode': $('#planCode').val(),
|
||||
'modelId': objParam.modelId,
|
||||
'proId': objParam.proId,
|
||||
'queryType': 2
|
||||
}),
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
tableIns = table.render({
|
||||
elem: "#currentTableId",
|
||||
id: 'currentTableId',
|
||||
headers: {
|
||||
authorization: sessionStorage.getItem("gz-token"),
|
||||
},
|
||||
height: "full-150",
|
||||
url: dataUrl + "backstage/inventoryCount/getLkDetailsByProAndModel",
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'planCode': $('#planCode').val(),
|
||||
'modelId': objParam.modelId,
|
||||
'proId': objParam.proId,
|
||||
'queryType': 2
|
||||
}),
|
||||
},
|
||||
request: {
|
||||
pageName: 'pageNum',
|
||||
limitName: 'pageSize'
|
||||
},
|
||||
parseData: function (res) { // res 即为原始返回的数据
|
||||
if (res.code === 401) {
|
||||
closeWindowOpen();
|
||||
}
|
||||
return {
|
||||
"code": 0, // 解析接口状态
|
||||
"msg": '获取成功', // 解析提示文本
|
||||
"count": res.total, // 解析数据长度
|
||||
"data": res.list // 解析数据列表
|
||||
};
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
width: '6%',
|
||||
title: "序号",
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return d.LAY_NUM;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "planCode",
|
||||
width: '9%',
|
||||
title: "需求计划编号",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return "<a style='color:#409eff;' onclick='viewPlanDetail(" + JSON.stringify(d) + ")'>" + d.planCode + "</a>";
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "proName",
|
||||
width: '20%',
|
||||
title: "工程名称",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "type",
|
||||
title: "物资类型",
|
||||
width: '11%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "物资名称",
|
||||
width: '12%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "model",
|
||||
title: "规格型号",
|
||||
width: '12%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "unit",
|
||||
title: "单位",
|
||||
width: '5%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "totalCg",
|
||||
title: "采购数量",
|
||||
width: '8%',
|
||||
align: "center",
|
||||
unresize: true,
|
||||
templet: function (d) {
|
||||
return d.totalCg;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "totalLk",
|
||||
title: "利库数量",
|
||||
width: '8%',
|
||||
align: "center",
|
||||
unresize: true,
|
||||
templet: function (d) {
|
||||
return d.totalLk;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "totalCk",
|
||||
title: "出库数量",
|
||||
width: '8%',
|
||||
align: "center",
|
||||
unresize: true,
|
||||
templet: function (d) {
|
||||
return d.totalCk;
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
limits: [10, 15, 20, 25, 50, 100],
|
||||
limit: 20,
|
||||
page: true,
|
||||
done: function (res, curr, count) {
|
||||
pageNum = tableIns.config.page.curr;
|
||||
table.resize("currentTableId");
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function deleteDetail(id){
|
||||
console.log(id)
|
||||
layer.confirm('是否撤销此数据?', {
|
||||
btn: ['确定', '关闭'] //按钮
|
||||
}, function(){
|
||||
let url = dataUrl + `backstage/purchase/deleteDetail/${id}`;
|
||||
ajaxRequest(url, "POST","", true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
layer.msg(result.msg, {icon: 1})
|
||||
tableIns.reload("currentTableId");
|
||||
}
|
||||
}, function (xhr, status, error) {
|
||||
errorFn(xhr, status, error)
|
||||
}, null);
|
||||
}, function(){
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// 导出
|
||||
function exportExcel() {
|
||||
let params = {
|
||||
'planCode': $('#planCode').val(),
|
||||
'status': $('#status').val(),
|
||||
'proId': objParam.proId
|
||||
}
|
||||
let url = dataUrl + "backstage/purchase/exportDetails";
|
||||
exportExcelUtil(url, '需求计划详情', JSON.stringify(params));
|
||||
}
|
||||
|
||||
// 发货
|
||||
function sendOutForm(obj, type) {
|
||||
obj.proName = objParam.proName;
|
||||
obj.companyName=objParam.companyName;
|
||||
let content = '../aq_demand_plan/child/send_out_form.html';
|
||||
if (type === 2) {
|
||||
content = '../aq_demand_plan/child/send_out_edit_form.html';
|
||||
} else if (type === 3) {
|
||||
content = '../aq_demand_plan/child/send_out_supplemen.html';
|
||||
}
|
||||
openIframeByParamObj2("sendOutForm", "采购发货", content, "92%", "95%", obj);
|
||||
}
|
||||
|
||||
function sendOutDeviceForm(obj) {
|
||||
obj.proName = objParam.proName;
|
||||
let content = '../aq_demand_plan/child/send_out_form_device.html';
|
||||
openIframeByParamObj2("sendOutForm", "设备发货", content, "92%", "95%", obj);
|
||||
}
|
||||
|
||||
|
||||
// 采购发货成功
|
||||
function sendOutSuccess(data) {
|
||||
let obj = JSON.parse(data);
|
||||
openIframeByParamObj2("sendOutSuccess", "采购发货成功", "../aq_demand_plan/child/send_out_success.html", "92%", "95%", obj);
|
||||
}
|
||||
|
||||
// 详情
|
||||
function sendOutDetail(obj) {
|
||||
obj.proName = objParam.proName;
|
||||
openIframeByParamObj2("sendOutDetail", "详情", "../aq_demand_plan/child/send_out_detail.html", "92%", "95%", obj);
|
||||
}
|
||||
|
||||
// 下载二维码
|
||||
function downLoadQrCode(obj) {
|
||||
openIframeByParamObj2("downLoadQrCode", "二维码", "../aq_demand_plan/child/send_out_qrcode.html", "92%", "95%", obj);
|
||||
}
|
||||
|
||||
// 需求计划详情
|
||||
function viewPlanDetail(obj) {
|
||||
openIframeByParamObj2("viewPlanDetail", "需求计划详情", "../aq_demand_plan/child/apply_plan_detail.html", "92%", "95%", obj);
|
||||
}
|
||||
|
||||
// 刷新页面数据
|
||||
function refreshAllData() {
|
||||
getProDetails();
|
||||
reloadData();
|
||||
}
|
||||
|
|
@ -0,0 +1,291 @@
|
|||
let objParam;
|
||||
let form, table, tableIns, layer, element;
|
||||
let pageNum = 1;
|
||||
|
||||
function setParams(params) {
|
||||
objParam = JSON.parse(params);
|
||||
console.error(objParam);
|
||||
$('#proName').html(objParam.proName);
|
||||
layui.use(["form", "table", 'layer', 'element'], function () {
|
||||
form = layui.form;
|
||||
table = layui.table;
|
||||
element = layui.element;
|
||||
layer = layui.layer;
|
||||
// getProDetails();
|
||||
initTable();
|
||||
});
|
||||
}
|
||||
|
||||
// 数据概览
|
||||
function getProDetails() {
|
||||
let params = {
|
||||
encryptedData: JSON.stringify({
|
||||
'proId': objParam.proId
|
||||
})
|
||||
};
|
||||
let url = dataUrl + 'backstage/purchase/getProDetails';
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
setNum(result.data);
|
||||
}
|
||||
}, function (xhr, status, error) {
|
||||
errorFn(xhr, status, error)
|
||||
}, null);
|
||||
|
||||
// 数据概览赋值
|
||||
function setNum(obj) {
|
||||
$('#planNum').html(obj.planNum);
|
||||
$('#lkNum').html(obj.lkNum);
|
||||
$('#cgNum').html(obj.cgNum);
|
||||
$('#money').html(' ¥ ' + (obj.money ? obj.money : 0));
|
||||
$('#bmname').html(obj.bmname);
|
||||
$('.layui-progress').remove();
|
||||
console.log(obj)
|
||||
var color = "layui-bg-orange";
|
||||
if (obj.process < 100) {
|
||||
color = "layui-bg-orange";
|
||||
} else if (obj.process == 100) {
|
||||
color = "layui-bg-primary";
|
||||
} else if (obj.process > 100) {
|
||||
color = "layui-bg-red";
|
||||
}
|
||||
$("#progress").after(`
|
||||
<div class="layui-progress" lay-showpercent="true" lay-filter="demo-filter-progress">
|
||||
<div class="layui-progress-bar ${color}" lay-percent="${obj.process}%"></div>
|
||||
</div>
|
||||
`);
|
||||
element.render();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 查询/重置
|
||||
function queryTable(type) {
|
||||
if (type === 1) {
|
||||
let planCode = $('#planCode').val();
|
||||
let flag = checkValue(planCode);
|
||||
if (flag) {
|
||||
$('#planCode').val('');
|
||||
return layer.msg('需求计划编号查询包含特殊字符,请重新输入', {icon: 2});
|
||||
}
|
||||
reloadTable(1);
|
||||
} else if (type === 2) {
|
||||
$('#planCode').val('');
|
||||
$('#status').val('');
|
||||
layui.form.render();
|
||||
reloadTable(1);
|
||||
}
|
||||
}
|
||||
|
||||
// 刷新页面数据
|
||||
function reloadData() {
|
||||
reloadTable(pageNum);
|
||||
}
|
||||
|
||||
// 重载表格
|
||||
function reloadTable(pageNum) {
|
||||
table.reload("currentTableId", {
|
||||
page: {
|
||||
curr: pageNum ? pageNum : 1,
|
||||
},
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'planCode': $('#planCode').val(),
|
||||
'modelId': objParam.modelId,
|
||||
'proId': objParam.proId,
|
||||
'queryType': 1
|
||||
}),
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
tableIns = table.render({
|
||||
elem: "#currentTableId",
|
||||
id: 'currentTableId',
|
||||
headers: {
|
||||
authorization: sessionStorage.getItem("gz-token"),
|
||||
},
|
||||
height: "full-150",
|
||||
url: dataUrl + "backstage/inventoryCount/getLkDetailsByProAndModel",
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'planCode': $('#planCode').val(),
|
||||
'modelId': objParam.modelId,
|
||||
'proId': objParam.proId,
|
||||
'queryType': 1
|
||||
}),
|
||||
},
|
||||
request: {
|
||||
pageName: 'pageNum',
|
||||
limitName: 'pageSize'
|
||||
},
|
||||
parseData: function (res) { // res 即为原始返回的数据
|
||||
if (res.code === 401) {
|
||||
closeWindowOpen();
|
||||
}
|
||||
return {
|
||||
"code": 0, // 解析接口状态
|
||||
"msg": '获取成功', // 解析提示文本
|
||||
"count": res.total, // 解析数据长度
|
||||
"data": res.list // 解析数据列表
|
||||
};
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
width: '6%',
|
||||
title: "序号",
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return d.LAY_NUM;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "planCode",
|
||||
width: '13%',
|
||||
title: "需求计划编号",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return "<a style='color:#409eff;' onclick='viewPlanDetail(" + JSON.stringify(d) + ")'>" + d.planCode + "</a>";
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "proName",
|
||||
width: '20%',
|
||||
title: "工程名称",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "type",
|
||||
title: "物资类型",
|
||||
width: '14%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "物资名称",
|
||||
width: '15%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "model",
|
||||
title: "规格型号",
|
||||
width: '15%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "unit",
|
||||
title: "单位",
|
||||
width: '8%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "totalLk",
|
||||
title: "利库数量",
|
||||
width: '8%',
|
||||
align: "center",
|
||||
unresize: true,
|
||||
templet: function (d) {
|
||||
return d.totalLk;
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
limits: [10, 15, 20, 25, 50, 100],
|
||||
limit: 20,
|
||||
page: true,
|
||||
done: function (res, curr, count) {
|
||||
pageNum = tableIns.config.page.curr;
|
||||
table.resize("currentTableId");
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function deleteDetail(id){
|
||||
console.log(id)
|
||||
layer.confirm('是否撤销此数据?', {
|
||||
btn: ['确定', '关闭'] //按钮
|
||||
}, function(){
|
||||
let url = dataUrl + `backstage/purchase/deleteDetail/${id}`;
|
||||
ajaxRequest(url, "POST","", true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
layer.msg(result.msg, {icon: 1})
|
||||
tableIns.reload("currentTableId");
|
||||
}
|
||||
}, function (xhr, status, error) {
|
||||
errorFn(xhr, status, error)
|
||||
}, null);
|
||||
}, function(){
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// 导出
|
||||
function exportExcel() {
|
||||
let params = {
|
||||
'planCode': $('#planCode').val(),
|
||||
'status': $('#status').val(),
|
||||
'proId': objParam.proId
|
||||
}
|
||||
let url = dataUrl + "backstage/purchase/exportDetails";
|
||||
exportExcelUtil(url, '需求计划详情', JSON.stringify(params));
|
||||
}
|
||||
|
||||
// 发货
|
||||
function sendOutForm(obj, type) {
|
||||
obj.proName = objParam.proName;
|
||||
obj.companyName=objParam.companyName;
|
||||
let content = '../aq_demand_plan/child/send_out_form.html';
|
||||
if (type === 2) {
|
||||
content = '../aq_demand_plan/child/send_out_edit_form.html';
|
||||
} else if (type === 3) {
|
||||
content = '../aq_demand_plan/child/send_out_supplemen.html';
|
||||
}
|
||||
openIframeByParamObj2("sendOutForm", "采购发货", content, "92%", "95%", obj);
|
||||
}
|
||||
|
||||
function sendOutDeviceForm(obj) {
|
||||
obj.proName = objParam.proName;
|
||||
let content = '../aq_demand_plan/child/send_out_form_device.html';
|
||||
openIframeByParamObj2("sendOutForm", "设备发货", content, "92%", "95%", obj);
|
||||
}
|
||||
|
||||
|
||||
// 采购发货成功
|
||||
function sendOutSuccess(data) {
|
||||
let obj = JSON.parse(data);
|
||||
openIframeByParamObj2("sendOutSuccess", "采购发货成功", "../aq_demand_plan/child/send_out_success.html", "92%", "95%", obj);
|
||||
}
|
||||
|
||||
// 详情
|
||||
function sendOutDetail(obj) {
|
||||
obj.proName = objParam.proName;
|
||||
openIframeByParamObj2("sendOutDetail", "详情", "../aq_demand_plan/child/send_out_detail.html", "92%", "95%", obj);
|
||||
}
|
||||
|
||||
// 下载二维码
|
||||
function downLoadQrCode(obj) {
|
||||
openIframeByParamObj2("downLoadQrCode", "二维码", "../aq_demand_plan/child/send_out_qrcode.html", "92%", "95%", obj);
|
||||
}
|
||||
|
||||
// 需求计划详情
|
||||
function viewPlanDetail(obj) {
|
||||
openIframeByParamObj2("viewPlanDetail", "需求计划详情", "../aq_demand_plan/child/apply_plan_detail.html", "92%", "95%", obj);
|
||||
}
|
||||
|
||||
// 刷新页面数据
|
||||
function refreshAllData() {
|
||||
getProDetails();
|
||||
reloadData();
|
||||
}
|
||||
|
|
@ -0,0 +1,298 @@
|
|||
let objParam;
|
||||
let form, table, tableIns, layer, element;
|
||||
let pageNum = 1;
|
||||
|
||||
function setParams(params) {
|
||||
objParam = JSON.parse(params);
|
||||
console.error(objParam);
|
||||
$('#proName').html(objParam.proName);
|
||||
layui.use(["form", "table", 'layer', 'element'], function () {
|
||||
form = layui.form;
|
||||
table = layui.table;
|
||||
element = layui.element;
|
||||
layer = layui.layer;
|
||||
// getProDetails();
|
||||
initTable();
|
||||
});
|
||||
}
|
||||
|
||||
// 数据概览
|
||||
function getProDetails() {
|
||||
let params = {
|
||||
encryptedData: JSON.stringify({
|
||||
'proId': objParam.proId
|
||||
})
|
||||
};
|
||||
let url = dataUrl + 'backstage/purchase/getProDetails';
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
setNum(result.data);
|
||||
}
|
||||
}, function (xhr, status, error) {
|
||||
errorFn(xhr, status, error)
|
||||
}, null);
|
||||
|
||||
// 数据概览赋值
|
||||
function setNum(obj) {
|
||||
$('#planNum').html(obj.planNum);
|
||||
$('#lkNum').html(obj.lkNum);
|
||||
$('#cgNum').html(obj.cgNum);
|
||||
$('#money').html(' ¥ ' + (obj.money ? obj.money : 0));
|
||||
$('#bmname').html(obj.bmname);
|
||||
$('.layui-progress').remove();
|
||||
console.log(obj)
|
||||
var color = "layui-bg-orange";
|
||||
if (obj.process < 100) {
|
||||
color = "layui-bg-orange";
|
||||
} else if (obj.process == 100) {
|
||||
color = "layui-bg-primary";
|
||||
} else if (obj.process > 100) {
|
||||
color = "layui-bg-red";
|
||||
}
|
||||
$("#progress").after(`
|
||||
<div class="layui-progress" lay-showpercent="true" lay-filter="demo-filter-progress">
|
||||
<div class="layui-progress-bar ${color}" lay-percent="${obj.process}%"></div>
|
||||
</div>
|
||||
`);
|
||||
element.render();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 查询/重置
|
||||
function queryTable(type) {
|
||||
if (type === 1) {
|
||||
let planCode = $('#planCode').val();
|
||||
let flag = checkValue(planCode);
|
||||
if (flag) {
|
||||
$('#planCode').val('');
|
||||
return layer.msg('需求计划编号查询包含特殊字符,请重新输入', {icon: 2});
|
||||
}
|
||||
reloadTable(1);
|
||||
} else if (type === 2) {
|
||||
$('#planCode').val('');
|
||||
$('#status').val('');
|
||||
layui.form.render();
|
||||
reloadTable(1);
|
||||
}
|
||||
}
|
||||
|
||||
// 刷新页面数据
|
||||
function reloadData() {
|
||||
reloadTable(pageNum);
|
||||
}
|
||||
|
||||
// 重载表格
|
||||
function reloadTable(pageNum) {
|
||||
table.reload("currentTableId", {
|
||||
page: {
|
||||
curr: pageNum ? pageNum : 1,
|
||||
},
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'planCode': $('#planCode').val(),
|
||||
'modelId': objParam.modelId,
|
||||
'proId': objParam.proId,
|
||||
'queryType': 1
|
||||
}),
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
tableIns = table.render({
|
||||
elem: "#currentTableId",
|
||||
id: 'currentTableId',
|
||||
headers: {
|
||||
authorization: sessionStorage.getItem("gz-token"),
|
||||
},
|
||||
height: "full-150",
|
||||
url: dataUrl + "backstage/inventoryCount/getBackDetailsByProAndModel",
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'planCode': $('#planCode').val(),
|
||||
'modelId': objParam.modelId,
|
||||
'proId': objParam.proId,
|
||||
'queryType': 1
|
||||
}),
|
||||
},
|
||||
request: {
|
||||
pageName: 'pageNum',
|
||||
limitName: 'pageSize'
|
||||
},
|
||||
parseData: function (res) { // res 即为原始返回的数据
|
||||
if (res.code === 401) {
|
||||
closeWindowOpen();
|
||||
}
|
||||
return {
|
||||
"code": 0, // 解析接口状态
|
||||
"msg": '获取成功', // 解析提示文本
|
||||
"count": res.total, // 解析数据长度
|
||||
"data": res.list // 解析数据列表
|
||||
};
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
width: '6%',
|
||||
title: "序号",
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return d.LAY_NUM;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "planCode",
|
||||
width: '10%',
|
||||
title: "退料单号",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return d.planCode;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "proName",
|
||||
width: '20%',
|
||||
title: "工程名称",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "type",
|
||||
title: "物资类型",
|
||||
width: '11%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "物资名称",
|
||||
width: '13%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "model",
|
||||
title: "规格型号",
|
||||
width: '13%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "unit",
|
||||
title: "单位",
|
||||
width: '8%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "backTime",
|
||||
title: "退还时间",
|
||||
width: '10%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
field: "totalBack",
|
||||
title: "退还数量",
|
||||
width: '8%',
|
||||
align: "center",
|
||||
unresize: true,
|
||||
templet: function (d) {
|
||||
return d.totalBack;
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
limits: [10, 15, 20, 25, 50, 100],
|
||||
limit: 20,
|
||||
page: true,
|
||||
done: function (res, curr, count) {
|
||||
pageNum = tableIns.config.page.curr;
|
||||
table.resize("currentTableId");
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function deleteDetail(id){
|
||||
console.log(id)
|
||||
layer.confirm('是否撤销此数据?', {
|
||||
btn: ['确定', '关闭'] //按钮
|
||||
}, function(){
|
||||
let url = dataUrl + `backstage/purchase/deleteDetail/${id}`;
|
||||
ajaxRequest(url, "POST","", true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
layer.msg(result.msg, {icon: 1})
|
||||
tableIns.reload("currentTableId");
|
||||
}
|
||||
}, function (xhr, status, error) {
|
||||
errorFn(xhr, status, error)
|
||||
}, null);
|
||||
}, function(){
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// 导出
|
||||
function exportExcel() {
|
||||
let params = {
|
||||
'planCode': $('#planCode').val(),
|
||||
'status': $('#status').val(),
|
||||
'proId': objParam.proId
|
||||
}
|
||||
let url = dataUrl + "backstage/purchase/exportDetails";
|
||||
exportExcelUtil(url, '需求计划详情', JSON.stringify(params));
|
||||
}
|
||||
|
||||
// 发货
|
||||
function sendOutForm(obj, type) {
|
||||
obj.proName = objParam.proName;
|
||||
obj.companyName=objParam.companyName;
|
||||
let content = '../aq_demand_plan/child/send_out_form.html';
|
||||
if (type === 2) {
|
||||
content = '../aq_demand_plan/child/send_out_edit_form.html';
|
||||
} else if (type === 3) {
|
||||
content = '../aq_demand_plan/child/send_out_supplemen.html';
|
||||
}
|
||||
openIframeByParamObj2("sendOutForm", "采购发货", content, "92%", "95%", obj);
|
||||
}
|
||||
|
||||
function sendOutDeviceForm(obj) {
|
||||
obj.proName = objParam.proName;
|
||||
let content = '../aq_demand_plan/child/send_out_form_device.html';
|
||||
openIframeByParamObj2("sendOutForm", "设备发货", content, "92%", "95%", obj);
|
||||
}
|
||||
|
||||
|
||||
// 采购发货成功
|
||||
function sendOutSuccess(data) {
|
||||
let obj = JSON.parse(data);
|
||||
openIframeByParamObj2("sendOutSuccess", "采购发货成功", "../aq_demand_plan/child/send_out_success.html", "92%", "95%", obj);
|
||||
}
|
||||
|
||||
// 详情
|
||||
function sendOutDetail(obj) {
|
||||
obj.proName = objParam.proName;
|
||||
openIframeByParamObj2("sendOutDetail", "详情", "../aq_demand_plan/child/send_out_detail.html", "92%", "95%", obj);
|
||||
}
|
||||
|
||||
// 下载二维码
|
||||
function downLoadQrCode(obj) {
|
||||
openIframeByParamObj2("downLoadQrCode", "二维码", "../aq_demand_plan/child/send_out_qrcode.html", "92%", "95%", obj);
|
||||
}
|
||||
|
||||
// 需求计划详情
|
||||
function viewPlanDetail(obj) {
|
||||
openIframeByParamObj2("viewPlanDetail", "需求计划详情", "../aq_demand_plan/child/apply_plan_detail.html", "92%", "95%", obj);
|
||||
}
|
||||
|
||||
// 刷新页面数据
|
||||
function refreshAllData() {
|
||||
getProDetails();
|
||||
reloadData();
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ layui.use(["form", "table"], function () {
|
|||
form = layui.form;
|
||||
table = layui.table;
|
||||
initTable();
|
||||
getStatistics();
|
||||
// getStatistics();
|
||||
});
|
||||
|
||||
|
||||
|
|
@ -187,7 +187,9 @@ function initTable() {
|
|||
align: "center",
|
||||
sort: true,
|
||||
templet: function (d) {
|
||||
return d.totalLk || 0;
|
||||
const totalLk = d.totalLk || 0;
|
||||
const rowData = JSON.stringify(d).replace(/"/g, '"');
|
||||
return `<a style='color: #1E9FFF' onclick='viewDetail(${rowData},1)'>${totalLk}</a>`;
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -198,7 +200,9 @@ function initTable() {
|
|||
align: "center",
|
||||
sort: true,
|
||||
templet: function (d) {
|
||||
return d.totalCk || 0;
|
||||
const totalCk = d.totalCk || 0;
|
||||
const rowData = JSON.stringify(d).replace(/"/g, '"');
|
||||
return `<a style='color: #1E9FFF' onclick='viewDetail(${rowData},2)'>${totalCk}</a>`;
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -209,7 +213,9 @@ function initTable() {
|
|||
align: "center",
|
||||
sort: true,
|
||||
templet: function (d) {
|
||||
return d.totalBack || 0;
|
||||
const totalBack = d.totalBack || 0;
|
||||
const rowData = JSON.stringify(d).replace(/"/g, '"');
|
||||
return `<a style='color: #1E9FFF' onclick='viewDetail(${rowData},3)'>${totalBack}</a>`;
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -240,31 +246,37 @@ function initTable() {
|
|||
}
|
||||
|
||||
// 查看详情
|
||||
function viewDetail(id) {
|
||||
layer.msg('查看工程物料详情功能待开发', { icon: 1 });
|
||||
// 这里可以添加查看详情的逻辑,比如打开新窗口或弹窗显示详细信息
|
||||
// openIframe('工程物料详情', 'page/aq_inventory/project_material_detail.html?id=' + id);
|
||||
function viewDetail(obj, type) {
|
||||
console.log('查看详情', type, obj);
|
||||
if (type === 1) {
|
||||
openIframeByParamObj("projectLkDetails", "利库详情", "./child/project_lk_details.html", "92%", "95%", obj, 0);
|
||||
} else if (type===2){
|
||||
openIframeByParamObj("projectCkDetails", "出库详情", "./child/project_ck_details.html", "92%", "95%", obj, 0);
|
||||
} else {
|
||||
openIframeByParamObj("projectTkDetails", "退库详情", "./child/project_tk_details.html", "92%", "95%", obj, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 导出Excel
|
||||
function exportExcel() {
|
||||
let keyWord = $('#keyWord').val();
|
||||
let isShortage = $('#isShortage').val();
|
||||
|
||||
|
||||
let params = {
|
||||
'keyWord': keyWord,
|
||||
'isShortage': isShortage
|
||||
};
|
||||
|
||||
|
||||
let encryptedData = JSON.stringify(params);
|
||||
let url = dataUrl + 'backstage/inventoryCount/exportLedgerListByProjectAndModel?encryptedData=' + encodeURIComponent(encryptedData);
|
||||
|
||||
|
||||
// 创建隐藏的下载链接
|
||||
let link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = '工程物料统计_' + new Date().getTime() + '.xlsx';
|
||||
link.style.display = 'none';
|
||||
|
||||
|
||||
// 添加授权头并下载
|
||||
fetch(url, {
|
||||
method: 'GET',
|
||||
|
|
@ -287,4 +299,4 @@ function exportExcel() {
|
|||
}).catch(error => {
|
||||
layer.msg('导出失败:' + error.message, { icon: 2 });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>工程详情</title>
|
||||
<link rel="stylesheet" href="../../../lib/layui-v2.9.18/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="../../../css/font.css" media="all">
|
||||
<link rel="stylesheet" href="../../../css/public.css" media="all">
|
||||
<link rel="stylesheet" href="../../../css/aq_demand_plan/send_out_pro_detail.css" media="all">
|
||||
</head>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<body id="body">
|
||||
<div id="main-box">
|
||||
<div class="layuimini-container">
|
||||
<div class="layuimini-main">
|
||||
<fieldset class="table-search-fieldset">
|
||||
<legend>搜索信息</legend>
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="#" onsubmit="return false;">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="width: 300px;">
|
||||
<input type="text" name="planCode" id="planCode" autocomplete="off" class="layui-input"
|
||||
lay-affix="clear" placeholder="输入需求计划编号" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-bg-blue" onclick="queryTable(1)"><i
|
||||
class="layui-icon"></i> 搜 索</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="queryTable(2)"><i
|
||||
class="layui-icon layui-icon-refresh"></i> 重 置</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="table-box" table-responsive style="z-index: 1;" id="table-box">
|
||||
<table class="layui-hide" id="currentTableId" lay-filter="currentTableId2"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="../../../lib/jquery-3.4.1/jquery-3.7.1.min.js" charset="utf-8"></script>
|
||||
<script src="../../../js/aes.js" charset="utf-8"></script>
|
||||
<script src="../../../js/public.js" charset="utf-8"></script>
|
||||
<script src="../../../js/Print.js" charset="utf-8"></script>
|
||||
<script src="../../../lib/layui-v2.9.18/layui/layui.js" charset="utf-8"></script>
|
||||
<script src="../../../js/openIframe.js" charset="utf-8"></script>
|
||||
<script src="../../../js/aq_inventory/child/project_ck_details.js" charset="utf-8"></script>
|
||||
|
||||
</html>
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>工程详情</title>
|
||||
<link rel="stylesheet" href="../../../lib/layui-v2.9.18/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="../../../css/font.css" media="all">
|
||||
<link rel="stylesheet" href="../../../css/public.css" media="all">
|
||||
<link rel="stylesheet" href="../../../css/aq_demand_plan/send_out_pro_detail.css" media="all">
|
||||
</head>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<body id="body">
|
||||
<div id="main-box">
|
||||
<div class="layuimini-container">
|
||||
<div class="layuimini-main">
|
||||
<fieldset class="table-search-fieldset">
|
||||
<legend>搜索信息</legend>
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="#" onsubmit="return false;">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="width: 300px;">
|
||||
<input type="text" name="planCode" id="planCode" autocomplete="off" class="layui-input"
|
||||
lay-affix="clear" placeholder="输入需求计划编号" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-bg-blue" onclick="queryTable(1)"><i
|
||||
class="layui-icon"></i> 搜 索</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="queryTable(2)"><i
|
||||
class="layui-icon layui-icon-refresh"></i> 重 置</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="table-box" table-responsive style="z-index: 1;" id="table-box">
|
||||
<table class="layui-hide" id="currentTableId" lay-filter="currentTableId2"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="../../../lib/jquery-3.4.1/jquery-3.7.1.min.js" charset="utf-8"></script>
|
||||
<script src="../../../js/aes.js" charset="utf-8"></script>
|
||||
<script src="../../../js/public.js" charset="utf-8"></script>
|
||||
<script src="../../../js/Print.js" charset="utf-8"></script>
|
||||
<script src="../../../lib/layui-v2.9.18/layui/layui.js" charset="utf-8"></script>
|
||||
<script src="../../../js/openIframe.js" charset="utf-8"></script>
|
||||
<script src="../../../js/aq_inventory/child/project_lk_details.js" charset="utf-8"></script>
|
||||
|
||||
</html>
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>工程详情</title>
|
||||
<link rel="stylesheet" href="../../../lib/layui-v2.9.18/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="../../../css/font.css" media="all">
|
||||
<link rel="stylesheet" href="../../../css/public.css" media="all">
|
||||
<link rel="stylesheet" href="../../../css/aq_demand_plan/send_out_pro_detail.css" media="all">
|
||||
</head>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<body id="body">
|
||||
<div id="main-box">
|
||||
<div class="layuimini-container">
|
||||
<div class="layuimini-main">
|
||||
<fieldset class="table-search-fieldset">
|
||||
<legend>搜索信息</legend>
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="#" onsubmit="return false;">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="width: 300px;">
|
||||
<input type="text" name="planCode" id="planCode" autocomplete="off" class="layui-input"
|
||||
lay-affix="clear" placeholder="输入需求计划编号" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-bg-blue" onclick="queryTable(1)"><i
|
||||
class="layui-icon"></i> 搜 索</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="queryTable(2)"><i
|
||||
class="layui-icon layui-icon-refresh"></i> 重 置</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="table-box" table-responsive style="z-index: 1;" id="table-box">
|
||||
<table class="layui-hide" id="currentTableId" lay-filter="currentTableId2"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="../../../lib/jquery-3.4.1/jquery-3.7.1.min.js" charset="utf-8"></script>
|
||||
<script src="../../../js/aes.js" charset="utf-8"></script>
|
||||
<script src="../../../js/public.js" charset="utf-8"></script>
|
||||
<script src="../../../js/Print.js" charset="utf-8"></script>
|
||||
<script src="../../../lib/layui-v2.9.18/layui/layui.js" charset="utf-8"></script>
|
||||
<script src="../../../js/openIframe.js" charset="utf-8"></script>
|
||||
<script src="../../../js/aq_inventory/child/project_tk_details.js" charset="utf-8"></script>
|
||||
|
||||
</html>
|
||||
Loading…
Reference in New Issue