This commit is contained in:
cwchen 2024-11-11 13:51:13 +08:00
parent 432235d9ea
commit 65060b0a35
8 changed files with 128 additions and 75 deletions

View File

@ -31,7 +31,7 @@ function getShipmentBatch(list) {
if (list && list.length > 0) { if (list && list.length > 0) {
dataList.push({ name: '全部', id: '' }) dataList.push({ name: '全部', id: '' })
$.each(list, function (index, item) { $.each(list, function (index, item) {
dataList.push({ name: '第' +numToChinese(index + 1)+ '批', id: item.id, tiem: item.createDay }) dataList.push({ name: '第' + numToChinese(index + 1) + '批', id: item.id, tiem: item.createDay })
}); });
dataList.push({ name: '待发货', id: '0' }) dataList.push({ name: '待发货', id: '0' })
} else { } else {
@ -44,7 +44,7 @@ function getShipmentBatch(list) {
} else if (item.name === '全部') { } else if (item.name === '全部') {
html += '<li value="' + this.id + '"><span class="li-span">' + this.name + '</span></li>'; html += '<li value="' + this.id + '"><span class="li-span">' + this.name + '</span></li>';
} else { } else {
html += '<li value="' + this.id + '"><span>' + item.name + '</span><span>'+item.tiem+'</span></li>'; html += '<li value="' + this.id + '"><span>' + item.name + '</span><span>' + item.tiem + '</span></li>';
} }
}) })
$('.layui-tab-title').empty().append(html); $('.layui-tab-title').empty().append(html);
@ -133,7 +133,7 @@ function numToChinese(num) {
return '二十四'; return '二十四';
} else if (num === 25) { } else if (num === 25) {
return '二十五'; return '二十五';
}else if (num === 26) { } else if (num === 26) {
return '二十六'; return '二十六';
} else if (num === 27) { } else if (num === 27) {
return '二十七'; return '二十七';
@ -156,4 +156,9 @@ function numToChinese(num) {
} else if (num === 36) { } else if (num === 36) {
return '三十六'; return '三十六';
} }
}
// 查看需求计划
function openDetail() {
openIframeByParamObj2("view_plan", "需求计划", "./child/demand_plan_detail_list.html", "92%", "95%", objParam);
} }

View File

@ -38,7 +38,8 @@ function queryTable(type) {
}, },
where: { where: {
encryptedData: JSON.stringify({ encryptedData: JSON.stringify({
'keyWord': $('#keyWord').val() 'keyWord': $('#keyWord').val(),
'proId': objParam.proId
}), }),
}, },
}, },
@ -53,10 +54,11 @@ function initTable() {
authorization: sessionStorage.getItem("gz-token"), authorization: sessionStorage.getItem("gz-token"),
}, },
height: "full-180", height: "full-180",
url: dataUrl + "backstage/planOut/getDataPlanByPage", url: dataUrl + "backstage/planOut/getProPlanListByProId",
where: { where: {
encryptedData: JSON.stringify({ encryptedData: JSON.stringify({
'keyWord': $('#keyWord').val() 'keyWord': $('#keyWord').val(),
'proId': objParam.proId
}), }),
}, },
request: { request: {
@ -163,5 +165,5 @@ function setNumColor(value, type) {
// 需求计划编号 // 需求计划编号
function plan_detail(obj){ function plan_detail(obj){
openIframeByParamObj2("plan_detail", "机具需求计划", "./apply_plan_detail.html", "92%", "95%", obj); openIframeByParamObj2("plan_detail", "机具需求计划", "./child/apply_plan_detail.html", "92%", "95%", obj);
} }

View File

@ -2,7 +2,7 @@ let form, table, element,tableIns;
let typeParam; let typeParam;
let pageNum = 1; let pageNum = 1;
function setParams(type) { function setParams(type) {
typeParam = type; typeParam = type - 1;
layui.use(["form", "table", 'element'], function () { layui.use(["form", "table", 'element'], function () {
form = layui.form; form = layui.form;
table = layui.table; table = layui.table;
@ -13,7 +13,7 @@ function setParams(type) {
typeParam = value; typeParam = value;
reloadTable(1); reloadTable(1);
}); });
$('.layui-tab-title li').eq(typeParam - 1).addClass('layui-this'); $('.layui-tab-title li').eq(typeParam).addClass('layui-this');
initTable(); initTable();
}); });
} }
@ -45,7 +45,7 @@ function reloadTable(pageNum) {
encryptedData: JSON.stringify({ encryptedData: JSON.stringify({
'name': $('#name').val(), 'name': $('#name').val(),
'module': $('#module').val(), 'module': $('#module').val(),
'type': typeParam 'typeSource': typeParam
}), }),
}, },
}, },
@ -61,12 +61,12 @@ function initTable() {
authorization: sessionStorage.getItem("gz-token"), authorization: sessionStorage.getItem("gz-token"),
}, },
height: "full-220", height: "full-220",
url: dataUrl + "backstage/planOut/getProPlanPage", url: dataUrl + "backstage/planOut/getDataInfoByPage",
where: { where: {
encryptedData: JSON.stringify({ encryptedData: JSON.stringify({
'name': $('#name').val(), 'name': $('#name').val(),
'module': $('#module').val(), 'module': $('#module').val(),
'type': typeParam 'typeSource': typeParam
}), }),
}, },
request: { request: {
@ -130,23 +130,23 @@ function initTable() {
}, },
}, },
{ {
field: "status", field: "fhNum",
title: "已发货量", title: "已发货量",
width: '8%', width: '8%',
unresize: true, unresize: true,
align: "center", align: "center",
templet: function (d) { templet: function (d) {
return setNumColor(d.needNum,2); return setNumColor(d.fhNum,2);
}, },
}, },
{ {
field: "status", field: "wfhNum",
title: "待发货量", title: "待发货量",
width: '10%', width: '10%',
unresize: true, unresize: true,
align: "center", align: "center",
templet: function (d) { templet: function (d) {
return setNumColor(d.needNum,3); return setNumColor(d.wfhNum,3);
}, },
}, },
{ {
@ -156,7 +156,7 @@ function initTable() {
unresize: true, unresize: true,
align: "center", align: "center",
templet: function (d) { templet: function (d) {
return setFontBold(d.needNum); return setFontBold(d.proNum);
}, },
}, },
{ {
@ -234,5 +234,6 @@ function print() {
// 查看来源 // 查看来源
function viewSource(obj) { function viewSource(obj) {
obj.typeParam = typeParam;
openIframeByParamObj2("view_data_source_list", "数据来源", "./child/view_data_source_list.html", "92%", "95%", obj); openIframeByParamObj2("view_data_source_list", "数据来源", "./child/view_data_source_list.html", "92%", "95%", obj);
} }

View File

@ -31,17 +31,53 @@ function getDataInfoDetails() {
}, null); }, null);
function setData(obj) { function setData(obj) {
// $('#type').html(obj.type); $('#type').html(obj.type);
// $('#name').html(obj.name); $('#name').html(obj.name);
// $('#unit').html(obj.unit); $('#unit').html(obj.unit);
// $('#module').html(obj.module); $('#module').html(obj.module);
// $('#wfhNum').html(obj.wfhNum); $('#needNum').html(obj.needNum);
// $('#kuNum').html(obj.kuNum); $('#fhNum').html(obj.fhNum);
// $('#clNum').html(obj.clNum); $('#wfhNum').html(obj.wfhNum);
// $('#proNum').html(obj.proNum); $('#clNum').html(obj.clNum);
$('#proNum').html(obj.proNum);
$('#planNum').html(obj.planNum);
} }
} }
// 查询/重置
function queryTable(type) {
if (type === 1) {
reloadTable(1);
} else if (type === 2) {
$('#name').val('');
$('#module').val('');
layui.form.render();
reloadTable(1);
}
}
// 刷新页面数据
function reloadData() {
reloadData(pageNum);
}
// 重载表格
function reloadTable(pageNum) {
table.reload("currentTableId", {
page: {
curr: pageNum ? pageNum : 1,
},
where: {
encryptedData: JSON.stringify({
'name': $('#name').val(),
'module': $('#module').val(),
'moduleId': objParam.moduleId
}),
},
},
);
}
function initTable() { function initTable() {
tableIns = table.render({ tableIns = table.render({
elem: "#currentTableId", elem: "#currentTableId",
@ -49,10 +85,12 @@ function initTable() {
headers: { headers: {
authorization: sessionStorage.getItem("gz-token"), authorization: sessionStorage.getItem("gz-token"),
}, },
height: "full-180", height: "full-320",
url: dataUrl + "backstage/planOut/getDataPlanByPage", url: dataUrl + "backstage/planOut/getDataPlanByPage",
where: { where: {
encryptedData: JSON.stringify({ encryptedData: JSON.stringify({
'name': $('#name').val(),
'module': $('#module').val(),
'moduleId': objParam.moduleId 'moduleId': objParam.moduleId
}), }),
}, },
@ -78,26 +116,53 @@ function initTable() {
return d.LAY_NUM; return d.LAY_NUM;
}, },
}, },
{
field: "proName",
width: '35%',
title: "工程名称",
unresize: true,
align: "center",
},
{ {
field: "code", field: "code",
width: '25%', width: '15%',
title: "需求计划编号", title: "需求计划编号",
unresize: true, unresize: true,
align: "center", align: "center",
templet: function (d) { templet: function (d) {
let html = ""; let html = "";
html += "<a onclick='demand_plan(" + JSON.stringify(d) + ")'>"+d.code+"</a>"; html += "<a onclick='demand_plan(" + JSON.stringify(d) + ")'>" + d.code + "</a>";
return html; return html;
}, },
}, },
{
field: "proName",
width: '15%',
title: "工程名称",
unresize: true,
align: "center",
},
{
field: "projectPart",
width: '15%',
title: "项目部分",
unresize: true,
align: "center",
},
{
field: "projectContent",
width: '15%',
title: "工程内容 ",
unresize: true,
align: "center",
},
{
field: "proName",
width: '10%',
title: "需用日期",
unresize: true,
align: "center",
},
{
field: "remark",
width: '10%',
title: "计划说明 ",
unresize: true,
align: "center",
},
{ {
field: "needNum", field: "needNum",
width: '10%', width: '10%',
@ -107,26 +172,6 @@ function initTable() {
templet: function (d) { templet: function (d) {
return setNumColor(d.needNum, 1); return setNumColor(d.needNum, 1);
}, },
},
{
field: "needNum",
width: '10%',
title: "已发货量",
unresize: true,
align: "center",
templet: function (d) {
return setNumColor(d.needNum, 2);
},
},
{
field: "needNum",
width: '10%',
title: "待发货量",
unresize: true,
align: "center",
templet: function (d) {
return setNumColor(d.needNum, 3);
},
} }
] ]
], ],
@ -155,6 +200,6 @@ function setNumColor(value, type) {
} }
// 需求计划编号 // 需求计划编号
function demand_plan(obj){ function demand_plan(obj) {
openIframeByParamObj2("demand_plan", "机具需求计划", "./apply_plan_detail.html", "92%", "95%", obj); openIframeByParamObj2("demand_plan", "机具需求计划", "./child/apply_plan_detail.html", "92%", "95%", obj);
} }

View File

@ -22,7 +22,7 @@
<p style="font-size: 18px;font-weight: bold;" id="proName"></p> <p style="font-size: 18px;font-weight: bold;" id="proName"></p>
<p id="status"></p> <p id="status"></p>
</div> </div>
<div class="layout detail" style="margin-left: 10%;"> <div class="layout detail" style="margin-left: 10%;cursor: pointer;" onclick="openDetail()">
<p>计划数量</p> <p>计划数量</p>
<p style="color: #409EFF;" id="planNum">0</p> <p style="color: #409EFF;" id="planNum">0</p>
</div> </div>
@ -41,5 +41,5 @@
<script src="../../../js/public.js" charset="utf-8"></script> <script src="../../../js/public.js" charset="utf-8"></script>
<script src="../../../lib/layui-v2.9.18/layui/layui.js" charset="utf-8"></script> <script src="../../../lib/layui-v2.9.18/layui/layui.js" charset="utf-8"></script>
<script src="../../../js/demandPlan/child/delivery_detail_list.js" charset="utf-8"></script> <script src="../../../js/demandPlan/child/delivery_detail_list.js" charset="utf-8"></script>
<script src="../../../js/openIframe.js" charset="utf-8"></script>
</html> </html>

View File

@ -82,5 +82,5 @@
<script src="../../../js/Print.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="../../../lib/layui-v2.9.18/layui/layui.js" charset="utf-8"></script>
<script src="../../../js/demandPlan/child/demand_plan_detail_list.js" charset="utf-8"></script> <script src="../../../js/demandPlan/child/demand_plan_detail_list.js" charset="utf-8"></script>
<script src="../../../js/openIframe.js" charset="utf-8"></script>
</html> </html>

View File

@ -16,9 +16,9 @@
<body> <body>
<div class="layui-tab layui-tab-brief" lay-filter="demo-filter-tab"> <div class="layui-tab layui-tab-brief" lay-filter="demo-filter-tab">
<ul class="layui-tab-title"> <ul class="layui-tab-title">
<li value="1">总需求计划量</li> <li value="0">总需求计划量</li>
<li value="2">只看待发货</li> <li value="1">只看待发货</li>
<li value="3">只看已发货</li> <li value="2">只看已发货</li>
</ul> </ul>
</div> </div>
<div class="layuimini-container"> <div class="layuimini-container">

View File

@ -39,15 +39,15 @@
</tr> </tr>
<tr> <tr>
<th>需求量</th> <th>需求量</th>
<td id="wfhNum"></td> <td id="needNum"></td>
<th>已发货量</th> <th>已发货量</th>
<td id="kuNum"></td> <td id="fhNum"></td>
<th>未发货量</th> <th>未发货量</th>
<td id="clNum"></td> <td id="wfhNum"></td>
<th>差量</th> <th>差量</th>
<td id="proNum"></td> <td id="clNum"></td>
<th>需求计划数量</th> <th>需求计划数量</th>
<td id="proNum"></td> <td id="planNum"></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -84,13 +84,13 @@
<button class="layui-btn layui-btn-primary" onclick="exportExcel()"><i <button class="layui-btn layui-btn-primary" onclick="exportExcel()"><i
class="layui-icon layui-icon-download-circle"></i> 下 载</button> class="layui-icon layui-icon-download-circle"></i> 下 载</button>
</div> </div>
<div class="layui-inline"> <!-- <div class="layui-inline">
<div class="layui-input-inline"> <div class="layui-input-inline" style="width: 350px;">
<input type="radio" name="sex" value="" title="全部"> <input type="radio" name="typeParam" value="1" title="全部">
<input type="radio" name="sex" value="1" title="待发货>0"> <input type="radio" name="typeParam" value="2" title="待发货>0">
<input type="radio" name="sex" value="2" title="待发货=0"> <input type="radio" name="typeParam" value="3" title="待发货=0">
</div> </div>
</div> </div> -->
</div> </div>
</form> </form>
</div> </div>