| | |
| | | style="width: 175px" |
| | | autocomplete="off"> |
| | | </div> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <label class="layui-form-label">开工日期</label>--> |
| | | <!-- <input class="layui-input" id="fplancommitdate" placeholder="选择或输入日期"--> |
| | | <!-- style="width: 175px"--> |
| | | <!-- autocomplete="off"--> |
| | | <!-- onkeyup="findCode(this, 'fplancommitdate')"--> |
| | | <!-- onchange="findCode(this, 'fplancommitdate')">--> |
| | | <!-- </div>--> |
| | | </header> |
| | | |
| | | <main> |
| | |
| | | } |
| | | |
| | | var tableIns; |
| | | layui.use(['table', 'form'], function () { |
| | | layui.use(['table', 'form', 'laydate'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | var laydate = layui.laydate; |
| | | |
| | | // 初始化日期选择器(支持选择日期和手动输入) |
| | | laydate.render({ |
| | | elem: '#fplancommitdate', |
| | | type: 'date', |
| | | format: 'yyyy-MM-dd', |
| | | done: function(value, date, endDate) { |
| | | // 日期选择后触发查询 |
| | | findCode(null, 'fplancommitdate'); |
| | | } |
| | | }); |
| | | |
| | | tableIns = table.render({ |
| | | id: 'materialReceiveOut', |
| | |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {field: 'invCode', align: 'center', title: '编码', event: 'detail', width: 80}, |
| | | {field: 'soCode', align: 'center', title: '生成单号', event: 'detail', width: 100}, |
| | | {field: 'fbillno', align: 'center', title: '任务单号', event: 'detail', width: 100}, |
| | | {field: 'invName', align: 'center', title: '名称', event: 'detail'}, |
| | | {field: 'invCode', align: 'center', title: '物料编码', event: 'detail', width: 80}, |
| | | {field: 'whName', align: 'center', title: '库区', event: 'detail', width: 50}, |
| | | { |
| | | field: 'remainQty', |
| | | align: 'center', |
| | | title: '数量', |
| | | event: 'detail', |
| | | style: 'color: blue', |
| | | event: 'modify', |
| | | style: 'cursor: pointer;color: blue', |
| | | width: 50, |
| | |
| | | return d.remainQty || 0; |
| | | } |
| | | }, |
| | | // { |
| | | // field: 'fplancommitdate', |
| | | // align: 'center', |
| | | // title: '开工日期', |
| | | // event: 'detail', |
| | | // width: 100, |
| | | // templet: function(d) { |
| | | // if (d.fplancommitdate) { |
| | | // // 格式化日期显示(如果后端返回的是完整日期时间,只显示日期部分) |
| | | // var dateStr = d.fplancommitdate; |
| | | // if (dateStr.indexOf(' ') > 0) { |
| | | // return dateStr.split(' ')[0]; |
| | | // } |
| | | // return dateStr; |
| | | // } |
| | | // return ''; |
| | | // } |
| | | // }, |
| | | {type: 'checkbox', fixed: 'right', width: 30}, |
| | | ]], |
| | | done: function (res, curr, count) { |
| | |
| | | var soCodeBar; |
| | | var fbillnoBar; |
| | | var invCodeBar; |
| | | var fplancommitdateBar; |
| | | |
| | | /* 扫码、输入生产单号、任务单号和物料编码 */ |
| | | /* 扫码、输入生产单号、任务单号、物料编码和开工日期 */ |
| | | function findCode(el, type) { |
| | | soCodeBar = $('#soCode').val(); |
| | | fbillnoBar = $("#fbillno").val(); |
| | | invCodeBar = $("#invCode").val(); |
| | | fplancommitdateBar = $("#fplancommitdate").val(); |
| | | |
| | | // 去除空格 |
| | | if (soCodeBar) { |
| | |
| | | if (invCodeBar) { |
| | | invCodeBar = invCodeBar.trim(); |
| | | } |
| | | if (fplancommitdateBar) { |
| | | fplancommitdateBar = fplancommitdateBar.trim(); |
| | | } |
| | | |
| | | switch (type) { |
| | | case 'soCode': |
| | |
| | | break; |
| | | case 'invCode': |
| | | break; |
| | | case 'fplancommitdate': |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | // 如果生产单号和任务单号都为空,不执行查询 |
| | | if (!soCodeBar && !fbillnoBar) { |
| | | // 清空表格数据 |
| | | tableIns.reload({ |
| | | data: [], |
| | | }); |
| | | materialReceiveList = []; |
| | | return; |
| | | } |
| | | |
| | | // 构建查询参数 |
| | |
| | | if (invCodeBar) { |
| | | params.invCode = invCodeBar; |
| | | } |
| | | |
| | | // 如果所有查询条件都为空,不执行查询 |
| | | if (!soCodeBar && !fbillnoBar && !invCodeBar) { |
| | | // 清空表格数据 |
| | | tableIns.reload({ |
| | | data: [], |
| | | }); |
| | | materialReceiveList = []; |
| | | return; |
| | | if (fplancommitdateBar) { |
| | | params.fplancommitdate = fplancommitdateBar; |
| | | } |
| | | |
| | | // PDA出库查询,添加pdaQuery参数,后端会过滤掉已全部出库的物料 |
| | |
| | | $("#soCode").val(""); |
| | | $("#fbillno").val(""); |
| | | $("#invCode").val(""); |
| | | $("#fplancommitdate").val(""); |
| | | materialReceiveList = []; |
| | | tableIns.reload({data: materialReceiveList}); |
| | | document.getElementById("soCode").focus(); |
| | |
| | | $("#soCode").val(null); |
| | | $("#fbillno").val(null); |
| | | $("#invCode").val(null); |
| | | $("#fplancommitdate").val(null); |
| | | materialReceiveList = []; |
| | | tableIns.reload({data: materialReceiveList}); |
| | | layer.closeAll(); |