| | |
| | | {field: 'matnr', title: '商品编码'}, |
| | | {field: 'maktx', title: '商品名称', width: 160}, |
| | | {field: 'batch', title: '批号'}, |
| | | {field: 'count', title: '数量'}, |
| | | {field: 'anfme', title: '数量'}, |
| | | {field: 'unit', title: '单位'}, |
| | | // { |
| | | // field: 'createTime$', title: '创建时间', sort: true, templet: function (d) { |
| | |
| | | layer.tips('请添加单据明细', '#matAddBtnComment', {tips: [1, '#ff4c4c']}); |
| | | return false; |
| | | } |
| | | var param = []; |
| | | var nList = admin.util.deepClone(xxDataList); |
| | | for (var xi = 0; xi < nList.length; xi++) { |
| | | // console.log('已入库:'+nList[xi].inQty) |
| | | // console.log('旧数量:'+inQtys[xi]) |
| | | // console.log('数量:'+nList[xi].qty) |
| | | if (nList[xi].inQty > 0 && inQtys[xi]!=nList[xi].qty) { |
| | | let param = []; |
| | | let nList = admin.util.deepClone(xxDataList); |
| | | for (let xi = 0; xi < nList.length; xi++) { |
| | | if (nList[xi].inQty > 0 && inQtys[xi] !== nList[xi].qty) { |
| | | layer.msg("已入库无法修改", {icon: 2}) |
| | | return false; |
| | | } else if (nList[xi].qty > 0) { |
| | |
| | | qty: nList[xi].qty, |
| | | inQty: nList[xi].inQty, |
| | | }) |
| | | }else if (nList[xi].qty == 0){ |
| | | }else if (nList[xi].anfme === 0){ |
| | | layer.msg('明细修改数量不合法', {icon: 2}); |
| | | return false; |
| | | } |
| | |
| | | {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: 'anfme', 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}, |
| | |
| | | break; |
| | | } |
| | | } |
| | | } else if (obj.field==='count'){ |
| | | } else if (obj.field==='anfme'){ |
| | | let vle = Number(obj.value); |
| | | if (isNaN(vle)) { |
| | | layer.msg("请输入数字", {icon: 2}); |
| | |
| | | if (vle > 0) { |
| | | 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; |
| | | xxDataList[i]["anfme"] = vle; |
| | | break; |
| | | } |
| | | } |
| | |
| | | if (existMats.indexOf(item.value) === -1) { |
| | | // 查询物料详情 |
| | | $.ajax({ |
| | | url: baseUrl+"/matCode/"+item.value+"/auth", |
| | | url: baseUrl+"/matCode/covert/"+item.value+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var mat = res.data; |
| | | xxDataList.push({ |
| | | matNo: mat.matNo, |
| | | matName: mat.matName, |
| | | color:mat.color, |
| | | size:mat.size, |
| | | specs:mat.specs, |
| | | memo: mat.memo, |
| | | unit: mat.unit, |
| | | qty: 0.0 |
| | | }); |
| | | xxDataList.push(res.data); |
| | | insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |