| | |
| | | ,{field: 'threeCode', align: 'center',title: ''} |
| | | ,{field: 'standby1', align: 'center',title: 'po'} |
| | | ,{field: 'suppCode', align: 'center',title: ''} |
| | | ,{field: 'beBatch', align: 'center',title: ''} |
| | | // ,{field: 'beBatch', align: 'center',title: ''} |
| | | ,{field: 'deadTime', align: 'center',title: ''} |
| | | ,{field: 'deadWarn', align: 'center',title: ''} |
| | | ,{field: 'source', align: 'center',title: ''} |
| | |
| | | ,{field: 'threeCode', align: 'center',title: '三方编码'} |
| | | ,{field: 'standby1', align: 'center',title: 'po'} |
| | | ,{field: 'suppCode', align: 'center',title: '供应商编码'} |
| | | ,{field: 'beBatch$', align: 'center',title: '是否批次'} |
| | | // ,{field: 'beBatch$', align: 'center',title: '是否批次'} |
| | | ,{field: 'deadTime', align: 'center',title: '保质期'} |
| | | ,{field: 'deadWarn', align: 'center',title: '预警天数'} |
| | | ,{field: 'source$', align: 'center',title: '制购'} |
| | |
| | | ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: true} |
| | | ,{field: 'standby1', align: 'center',title: 'po', hide: true} |
| | | ,{field: 'suppCode', align: 'center',title: '供应商编码', hide: true} |
| | | ,{field: 'beBatch$', align: 'center',title: '是否批次', hide: true} |
| | | // ,{field: 'beBatch$', align: 'center',title: '是否批次', hide: true} |
| | | ,{field: 'deadTime', align: 'center',title: '保质期', hide: true} |
| | | ,{field: 'deadWarn', align: 'center',title: '预警天数', hide: true} |
| | | ,{field: 'source$', align: 'center',title: '制购', hide: true} |
| | |
| | | ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: true} |
| | | ,{field: 'supp', align: 'center',title: '供应商', hide: true} |
| | | ,{field: 'suppCode', align: 'center',title: '供应商编码', hide: true} |
| | | ,{field: 'beBatch$', align: 'center',title: '是否批次', hide: true} |
| | | // ,{field: 'beBatch$', align: 'center',title: '是否批次', hide: true} |
| | | ,{field: 'deadTime', align: 'center',title: '保质期', hide: true} |
| | | ,{field: 'deadWarn', align: 'center',title: '预警天数', hide: true} |
| | | ,{field: 'source$', align: 'center',title: '制购', hide: true} |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="anfme" label="erp下发数量" min-width="80" align="center"></el-table-column> |
| | | <el-table-column prop="sortingAnfme" label="待下发数量" min-width="80" align="center"></el-table-column> |
| | | <el-table-column prop="beBatch" label="已下发数量" min-width="80" align="center"></el-table-column> |
| | | <!-- <el-table-column prop="status" label="状态" min-width="100" align="center" :formatter="formatStatusB"></el-table-column>--> |
| | | <el-table-column prop="inspect" label="状态" min-width="100" align="center" :formatter="formatStatusC"></el-table-column> |
| | | <!-- 修改为删除列 --> |
| | |
| | | confirmReport(orderNo, done) { |
| | | this.reportLoading = true; |
| | | |
| | | // // 收集要上报的数据 |
| | | // const reportData = this.tableDataB.map(item => { |
| | | // const itemKey = this.getItemKey(item); |
| | | // return { |
| | | // orderNo: groupOrderNo, // 组货单号 |
| | | // matnr: item.matnr, // 商品编号 |
| | | // maktx: item.maktx, // 商品名称 |
| | | // standby1: item.standby1, // 客户PO |
| | | // standby2: item.standby2, // UPC |
| | | // standby3: item.standby3, // 客户SKU |
| | | // boxType3: item.boxType3, // 采购单号 |
| | | // anfme: this.modifiedQuantities[itemKey] || item.anfme, // 数量(使用修改后的数量) |
| | | // erpAnfme: item.erpAnfme, // ERP下架数量 |
| | | // status: item.status, // 状态 |
| | | // batch: item.batch, // 箱号 |
| | | // // 其他必要参数 |
| | | // modified: this.modifiedQuantities[itemKey] !== undefined // 标记是否修改 |
| | | // }; |
| | | // }); |
| | | // |
| | | // // 收集删除记录 |
| | | // const deleteData = this.deletedRecords.map(record => ({ |
| | | // orderNo: groupOrderNo, |
| | | // matnr: record.matnr, |
| | | // maktx: record.maktx, |
| | | // standby1: record.standby1, |
| | | // standby2: record.standby2, |
| | | // standby3: record.standby3, |
| | | // boxType3: record.boxType3, |
| | | // anfme: record.anfme, |
| | | // erpAnfme: record.erpAnfme, |
| | | // status: record.status, |
| | | // batch: record.batch, |
| | | // deleteTime: record.deleteTime |
| | | // })); |
| | | // |
| | | // // 构建提交数据 |
| | | // const submitData = { |
| | | // orderNo: groupOrderNo, |
| | | // details: reportData, |
| | | // deletedDetails: deleteData, |
| | | // totalCount: reportData.length, |
| | | // modifiedCount: Object.keys(this.modifiedQuantities).length, |
| | | // deletedCount: deleteData.length |
| | | // }; |
| | | |
| | | // 调用后台API上报数据 |
| | | // 先将每条明细的 待下发数量 写入 beBatch 字段 |
| | | const updates = (this.tableDataB || []).map(item => { |
| | | const beBatchVal = Math.floor(parseFloat(item.sortingAnfme || 0)); |
| | | return new Promise((resolve) => { |
| | | $.ajax({ |
| | | url: baseUrl + "/order/pakin/actual/shipment/order/report/auth", |
| | | url: baseUrl + "/order/pakin/orderDetl/update/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | orderNo: orderNo // 传递订单号 |
| | | id: item.id, |
| | | beBatch: beBatchVal |
| | | }, |
| | | method: 'POST', |
| | | success: (res) => { |
| | | this.reportLoading = false; |
| | | if (typeof done === 'function') { |
| | | done(); |
| | | if (res.code === 200 || res.success) { |
| | | this.$set(item, 'beBatch', beBatchVal); |
| | | resolve({ ok: true }); |
| | | } else { |
| | | resolve({ ok: false, msg: res.msg || '更新失败' }); |
| | | } |
| | | }, |
| | | error: () => resolve({ ok: false, msg: '网络异常' }) |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | Promise.all(updates).then(results => { |
| | | const failed = results.find(r => !r.ok); |
| | | if (failed) { |
| | | this.reportLoading = false; |
| | | if (typeof done === 'function') done(); |
| | | this.$message.error(failed.msg || '同步beBatch失败'); |
| | | return; |
| | | } |
| | | // 同步完成后调用后台API进行下发 |
| | | $.ajax({ |
| | | url: baseUrl + "/order/pakin/actual/shipment/order/report/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { orderNo: orderNo }, |
| | | method: 'POST', |
| | | success: (res) => { |
| | | this.reportLoading = false; |
| | | if (typeof done === 'function') done(); |
| | | if (res.code === 200 || res.success) { |
| | | this.$message({ |
| | | message: `订单号 ${orderNo} 下发成功`, |
| | |
| | | duration: 5000, |
| | | dangerouslyUseHTMLString: true |
| | | }); |
| | | // 下发成功后关闭弹窗并刷新数据 |
| | | setTimeout(() => { |
| | | this.closeDetailDialog(); |
| | | this.getTableDataA(); // 刷新主表数据 |
| | | this.getTableDataA(); |
| | | }, 1500); |
| | | } else { |
| | | this.$message.error(res.msg || '下发失败'); |
| | |
| | | }, |
| | | error: (error) => { |
| | | this.reportLoading = false; |
| | | if (typeof done === 'function') { |
| | | done(); |
| | | } |
| | | if (typeof done === 'function') done(); |
| | | console.error('下发失败:', error); |
| | | this.$message.error('下发失败,请检查网络连接'); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // 表格排序变化 |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="matnr" placeholder="SKU" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="standby3" placeholder="SKU" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |