| | |
| | | {field: 'maktx', title: '商品名称', width: 160}, |
| | | {field: 'batch', title: '批号'}, |
| | | {field: 'count', title: '数量'}, |
| | | {field: 'unit', title: '单位'}, |
| | | // { |
| | | // field: 'createTime$', title: '创建时间', sort: true, templet: function (d) { |
| | | // return util.toDateString(d.createTime); |
| | |
| | | success: function (layero, dIndex) { |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | var isExpAdd = !expTpe; |
| | | console.log(expTpe) |
| | | // 回显数据 |
| | | form.val('editForm', expTpe); |
| | | if (expTpe) { |
| | | $('#billNo').attr("disabled", "disabled"); |
| | | $('#orderNo').attr("disabled", "disabled"); |
| | | } |
| | | // 表单提交事件 |
| | | form.on('submit(waitMatinEditSubmit)', function (data) { |
| | | form.on('submit(orderEditSubmit)', function (data) { |
| | | // 组装数据 |
| | | if (xxDataList.length <= 0) { |
| | | layer.tips('请添加单据明细', '#matAddBtnComment', {tips: [1, '#ff4c4c']}); |
| | |
| | | height: '350px;', |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | | {field: 'matNo', title: '物料编码'}, |
| | | {field: 'matName', title: '物料名称', width: 160}, |
| | | {field: 'specs', title: '规格', width: 160}, |
| | | {field: 'color', title: '颜色', width: 160}, |
| | | {field: 'size', title: '尺寸', width: 160}, |
| | | {field: 'qty', title: '修改数量', style: 'color: blue;font-weight: bold', edit: true, minWidth: 100, width: 100}, |
| | | {field: 'inQty', title: '已入库量', minWidth: 100, width: 100}, |
| | | {field: 'unit', title: '单位', width: 160}, |
| | | {field: 'memo', title: '备注' , edit: true, width: 160}, |
| | | {type: 'numbers', title: '#'}, |
| | | {field: 'matnr', title: '商品编码', width: 160}, |
| | | {field: 'maktx', title: '商品名称', width: 200}, |
| | | {field: 'batch', title: '批号'}, |
| | | {field: 'specs', title: '规格'}, |
| | | {field: 'count', title: '数量(修改)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110}, |
| | | // {field: 'inQty', title: '已入库量', minWidth: 100, width: 100}, |
| | | {field: 'unit', title: '单位', width: 80}, |
| | | {field: 'memo', title: '备注' , edit: true}, |
| | | {align: 'center', title: '操作', toolbar: '#formSSXMTableBar', minWidth: 80, width: 80, fixed: 'right'} |
| | | ]], |
| | | done: function (res) { |
| | |
| | | }; |
| | | if (!isExpAdd) { |
| | | $.ajax({ |
| | | url: baseUrl+"/waitMatin/detl/list/auth?billNo=" + expTpe.billNo, |
| | | url: baseUrl+"/order/detl/all/auth?orderId=" + expTpe.id, |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | async: false, |
| | |
| | | }, function (i) { |
| | | layer.close(i); |
| | | for (var j = 0; j < xxDataList.length; j++) { |
| | | if (xxDataList[j].matNo === data.matNo) { |
| | | if (xxDataList[j].matnr === data.matnr && xxDataList[j].batch === data.batch) { |
| | | xxDataList.splice(j, 1); |
| | | break; |
| | | } |
| | |
| | | }); |
| | | } |
| | | }); |
| | | // 数量修改 |
| | | // 明细数据修改 |
| | | table.on('edit(formSSXMTable)', function (obj) { |
| | | if (obj.field=='memo'){ |
| | | let vle = obj.value; |
| | | for (var i=0;i<xxDataList.length;i++) { |
| | | if (xxDataList[i]["matNo"] === obj.data.matNo) { |
| | | xxDataList[i]["memo"] = vle; |
| | | if (obj.field === 'memo'){ |
| | | for (let i=0;i<xxDataList.length;i++) { |
| | | if (xxDataList[i]["matnr"] === obj.data.matnr && xxDataList[i]["batch"] === obj.data.batch) { |
| | | xxDataList[i]["memo"] = obj.value; |
| | | break; |
| | | } |
| | | } |
| | | }else if (obj.field=='qty'){ |
| | | } else if (obj.field==='count'){ |
| | | let vle = Number(obj.value); |
| | | if (isNaN(vle)) { |
| | | layer.msg("请输入数字"); |
| | | layer.msg("请输入数字", {icon: 2}); |
| | | return false; |
| | | } else { |
| | | if (vle > 0) { |
| | | for (var i=0;i<xxDataList.length;i++) { |
| | | if (xxDataList[i]["matNo"] === obj.data.matNo) { |
| | | xxDataList[i]["qty"] = vle; |
| | | for (let i=0;i<xxDataList.length;i++) { |
| | | if (xxDataList[i]["matnr"] === obj.data.matnr && xxDataList[i]["batch"] === obj.data.batch) { |
| | | xxDataList[i]["count"] = vle; |
| | | break; |
| | | } |
| | | } |
| | | } else { |
| | | layer.msg("数量必须大于零"); |
| | | layer.msg("数量必须大于零", {icon: 2}); |
| | | return false; |
| | | } |
| | | } |
| | | } |