From 09d2176e17822678424beb179a01eda33137e78a Mon Sep 17 00:00:00 2001 From: qb <1191961160@qq.com> Date: Mon, 9 Oct 2023 20:52:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=87=AA=E6=8F=90=E9=9B=B6?= =?UTF-8?q?=E6=8B=85=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../distribution/distrilbutionBillLading.js | 12 +- .../inventory/distrilbutionBillLading.vue | 177 ++++++++++++------ vite.config.js | 4 +- 3 files changed, 129 insertions(+), 64 deletions(-) diff --git a/src/api/distribution/distrilbutionBillLading.js b/src/api/distribution/distrilbutionBillLading.js index 669983b0..01acb50b 100644 --- a/src/api/distribution/distrilbutionBillLading.js +++ b/src/api/distribution/distrilbutionBillLading.js @@ -171,4 +171,14 @@ export const update = (row) => { data: row }) } - +/** + * 获取零担订单详情数据 + * @param {*} params + */ +export const zeroMaterial = params => { + return request({ + url: '/api/logpm-distribution/distributionParcelList/zeroMaterial', + method: 'get', + params, + }); +}; diff --git a/src/views/distribution/inventory/distrilbutionBillLading.vue b/src/views/distribution/inventory/distrilbutionBillLading.vue index 8de5bf30..f583e184 100644 --- a/src/views/distribution/inventory/distrilbutionBillLading.vue +++ b/src/views/distribution/inventory/distrilbutionBillLading.vue @@ -181,7 +181,7 @@ 新增 + >新增 - + + + +
+ 确定 + 取消 +
@@ -477,6 +497,7 @@ import { add, update, remove, + zeroMaterial, } from '@/api/distribution/distrilbutionBillLading'; import { getListOwn } from '@/api/distribution/distributionParcelList'; import option from '@/option/distribution/distrilbutionBillLading'; @@ -504,6 +525,7 @@ export default { head: false, }, ], + zeroOrderFormList: [], dialogFormVisible: false, dialogFormOrderVisible: false, //订单详细 dialogFormZeroOrderVisible: false, // 零担订单弹出层 @@ -546,6 +568,7 @@ export default { selectionList: [], stockupDate: [], // 时间 selectionListStock: [], // 库存品选择 + // 表单配置 option: option, // 表单列表 @@ -1028,6 +1051,15 @@ export default { // 更多列的配置... ], columnListedit: [ + { + prop: '', + label: '序号', + type: 0, + values: '', + width: 55, + checkarr: [], + fixed: true, + }, { prop: 'serviceNumber', label: '服务号', @@ -1606,7 +1638,6 @@ export default { watch: { '$route.query.id': { handler(newVal, oldVal) { - // console.log(newVal, oldVal); if (this.$route.query.type == '2') { //查询提货编辑数据 this.getDetailOen(); @@ -1655,7 +1686,6 @@ export default { * 固定搭配,只需要更换 columnList */ setnewcolum(newarr, headarr, type) { - // console.log(newarr,'+++++++++++') if (type == 1) { this.columnList = newarr; this.$functions.setStorage(window.location.pathname + 'checkList', headarr); @@ -1682,7 +1712,6 @@ export default { console.log(index, row); }, selectsc(index, row) { - console.log(index, row); if (row.prop === 'freezeStatusName') { this.queryOrder['freezeStatus'] = index; } else if (row.prop === 'completeSetName') { @@ -1705,7 +1734,6 @@ export default { this.onLoadOrder(this.pageOrder); }, timesc(index, row) { - console.log(index, row); if (!!index) { index = dayjs(index).format('YYYY-MM-DD'); } @@ -1716,7 +1744,6 @@ export default { this.onLoadOrder(this.pageOrder); }, inputsc(index, row) { - console.log(index, row); this.query[row.prop] = index; this.onLoadOrder(this.pageOrder); }, @@ -1724,7 +1751,6 @@ export default { getDetailOen() { this.orderAdd = true; getDetail(this.$route.query.id).then(res => { - // console.log("详情信息》》》》",res.data.data); let s = res.data.data; this.form = s; let f = []; @@ -1770,9 +1796,6 @@ export default { this.fileListLibrary = genreMapping['3']; this.fileListSell = genreMapping['1']; this.fileListClerk = genreMapping['2']; - // console.log("le1",le1); - // console.log("le2",le2); - // console.log("le3",le3); } this.loading = false; @@ -1780,7 +1803,6 @@ export default { }, //移除数据 rowStock(row) { - console.log('>>?>?> { if (i.id === row.id) { this.data; @@ -1795,7 +1817,6 @@ export default { }, //移除数据 rowOrder(row) { - console.log('>>?>?> { if (i.id === row.id) { this.dataList; @@ -1853,7 +1874,6 @@ export default { let isa = false; this.selectionList.some(i => { let a = this.dataList.filter(ele => ele.id == i.id).length >= 1; - // console.log("asdgfasdv",a); if (!a) { this.dataList.push(i); } @@ -1869,22 +1889,17 @@ export default { return; } let isa = false; - // console.log('执行了'); this.selectionListStock.some(i => { - // console.log('提交的值《》《》', i); if (parseInt(i.inventoryQuantity) > parseInt(i.quantityStock)) { // this.$message.warning("添加数量大于可以数量"); isa = true; return; } let a = this.data.filter(ele => ele.id == i.id).length >= 1; - // console.log("相同的值",a); if (!a) { - // console.log("相同了"); this.data.push(i); } else if (a) { this.data.forEach(ii => { - // console.log("里面的值",ii); if ( ii.id == i.id && parseInt(ii.inventoryQuantity) + parseInt(i.inventoryQuantity) < ii.quantityStock @@ -1901,7 +1916,6 @@ export default { }, //数量校验 handleNumberRange(e, row) { - // console.log('执行了2222', e, e.target.value, row); if (e.target.value) { e.target.value = e.target.value.replace(/[^\.\d]/g, ''); //替换掉与数字无关的字符(中英文与符号都会被替换掉,只留下数字,此时值类型为字符串) if (e.target.value) { @@ -1915,10 +1929,6 @@ export default { } }, uploadSuccess(fileList) { - console.log('123123123', fileList); - // console.log('123123123==fileListSell', this.fileListSell); - // console.log('123123123==fileListClerk', this.fileListClerk); - // console.log('123123123==fileListLibrary', this.fileListLibrary); // this.form.fileName = // this.$set(row, 'imageCos', fileList); }, @@ -1929,11 +1939,8 @@ export default { console.log(file); }, textbox(e, index) { - console.log('e',e); let nu = index + 1; let a = this.costListName[index]; - // console.log("<><><><>",e,nu); - // console.log("aaaa",a); this.costList[nu] = e; if (!!a) { //计算合计费用 @@ -1945,21 +1952,15 @@ export default { } }, handleCheckedCitiesChange(value) { - // console.log(">>>>>>>",value ); - if (value.length < 1) { this.costListName = []; } this.clientType.forEach(i => { if (value.includes(i.dictKey)) { - console.log(i); i.pitch = true; this.costListName = value; } }); - // console.log("字典",this.clientType); - console.log('选择的', this.costListName); - console.log('价格', this.costList); let n = 0; value.forEach(s => { let a = this.costList[s]; @@ -2039,7 +2040,6 @@ export default { this.onLoad(this.page); }, bianLier(costListName, clientType, costList, fei) { - // console.log(">>>>>>>>>",costListName,clientType,costList,fei); this.pan = false; for (let i = 0; i < costListName.length; i++) { if (!costList) { @@ -2047,9 +2047,7 @@ export default { return; } for (let a = 0; a < clientType.length; a++) { - // console.log("进来了",clientType[a].dictKey , costListName[i]); if (clientType[a].dictKey == costListName[i]) { - // console.log("进来了",clientType[a].dictKey , costListName[i]); let zhi = costList[costListName[i]]; if (!zhi) { this.pan = true; @@ -2063,6 +2061,26 @@ export default { } }, async handleSubmit() { + const zeroOrderList = this.dataList.filter(val => val.isZero === '1'); + // 当有零担订单物料数量没操作时 + const wrongZeroOrder = zeroOrderList.find(val => !val.ParcelLisList); + console.log('wrongZeroOrder :>> ', wrongZeroOrder); + if (wrongZeroOrder) + return this.$message({ + type: 'error', + message: `订单自编号为${wrongZeroOrder.orderCode}的物料数量为编辑`, + }); + if (zeroOrderList) { + // 双层循环查看每一个物料数量是否被填写 + const isSubmit = zeroOrderList.every(item => { + return item.ParcelLisList.every(val => val.quantity); + }); + if (!isSubmit) + return this.$message({ + type: 'error', + message: '有零担物料未填写', + }); + } this.$refs.form.validate(async valid => { if (valid) { if (!this.form.id) { @@ -2078,7 +2096,6 @@ export default { let o = []; if (this.fileListClerk.length > 0) { this.fileListClerk.forEach(i => { - // console.log("iiii文员",i); let num = {}; num.state = '2'; num.name = i.name; @@ -2088,7 +2105,6 @@ export default { } if (this.fileListLibrary.length > 0) { this.fileListLibrary.forEach(i => { - // console.log("库管》》》",i); let num = {}; num.state = '3'; num.name = i.name; @@ -2098,7 +2114,6 @@ export default { } if (this.fileListSell.length > 0) { this.fileListSell.forEach(i => { - // console.log(",.,.,.,.提货",i); let num = {}; num.state = '1'; num.name = i.name; @@ -2112,14 +2127,26 @@ export default { } if (this.orderAdd && this.dataList.length > 0) { let a = this.dataList.map(i => i.id); - console.log('aaaaa', a); this.form.stockArticleId = this.form.stockArticleId != null ? this.form.stockArticleId + a.join(',') : a.join(','); } - console.log('this.form', this.form); + const data = this.form; + // 当有零担数据时 + if (zeroOrderList){ + data.parcelLisList = [] + data.zeroType = '2' + zeroOrderList.forEach(val => { + val.ParcelLisList.forEach(item => { + data.parcelLisList.push(item) + }) + }) + }else{ + data.zeroType = '1' + } + add(this.form).then(() => { this.box = false; this.onLoad(this.page); @@ -2146,7 +2173,6 @@ export default { Object.entries(fileListMapping).forEach(([fileList, state]) => { if (this[fileList].length > 0) { this[fileList].forEach(i => { - console.log('i>>>>', i); let num = { state, }; @@ -2163,7 +2189,6 @@ export default { } }); this.form.printList = o.length > 0 ? o : []; - // console.log("修改》》》",this.form); let up = {}; up.printList = o.length > 0 ? o : []; up.fei = this.form.fei; @@ -2248,7 +2273,6 @@ export default { getListOne(page.currentPage, page.pageSize, Object.assign(params, this.queryOrder)).then( res => { const data = res.data.data; - console.log('>>>>>>>', data.records); this.pageOrder.total = data.total; this.dataOrder = data.records; this.dataOrder = this.dataOrder.map(i => { @@ -2273,7 +2297,6 @@ export default { this.dataOrder.forEach(i => { let asas = this.dataList.find(l => l.id == i.id); if (!!asas) { - console.log('存在的数据》》》', asas); this.selectionList.push(i.id); } }); @@ -2287,7 +2310,6 @@ export default { }, //库存品 handleAddView(row) { - console.log('row :>> ', row); this.selectionList = []; this.dialogFormVisible = true; this.onLoadList(this.pageStock); @@ -2345,7 +2367,6 @@ export default { } }, selectionChangeStock(list) { - // console.log('执行了啦啦啦', list); this.selectionListStock = list; }, selectionClear() { @@ -2375,7 +2396,6 @@ export default { this.orderAdd = false; getListOne(page.currentPage, page.pageSize, params).then(res => { const data = res.data.data; - console.log('订单详细>>>>>>>>>===', data); this.dataList = data.records; this.loading = false; this.selectionClear(); @@ -2401,7 +2421,6 @@ export default { a = this.dataOrder[0]; } // let a = this.dataList[0]; - console.log('aaa', a); if (!!a.mallId) { params.marketId = a.mallId; params.warehouseId = a.warehouseId; @@ -2425,7 +2444,6 @@ export default { this.loading = true; this.query.stockArticleIds = this.$route.query.id; getListOwn(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { - console.log('包件信息>>>>', res.data.data); const dataList = res.data.data; this.page.total = dataList.total; this.dataList = dataList.records; @@ -2433,16 +2451,49 @@ export default { this.selectionClear(); }); }, - // 修改零担订单 - handleZeroOrder(row){ - console.log('row :>> ', row); - console.log('row.isZero', row.isZero) - this.dialogFormZeroOrderVisible = true - } - }, - watch: { - clientType(newVal, oldVal) { - console.log('newVal', newVal); + // 开启修改零担弹框 + async handleZeroOrder(row) { + const handleParcelLisList = this.dataList.find(val => val.id === row.id).ParcelLisList; + // 当此次为二次修改时, 不进行请求 + if (handleParcelLisList) { + this.zeroOrderFormList = handleParcelLisList; + this.dialogFormZeroOrderVisible = true; + return; + } + + // 请求零担数据详情 + const res = await zeroMaterial({ stockArticleId: row.id }); + console.log('res :>> ', res); + const { code, data } = res.data; + if (code === 200) { + this.zeroOrderFormList = data.map(val => { + const zeroOrder = { + // 记录传入行的id + stockArticleId: val.stockArticleId, + // 物料id + id: val.id, + // 物料最大限数 + maxNum: val.quantity, + // 物料件数 + quantity: val.quantity, + // 物料名称 + firsts: val.firsts, + }; + if (row.completeSetName !== '是') zeroOrder.quantity = null; + return zeroOrder; + }); + console.log('this.zeroOrderFormList :>> ', this.zeroOrderFormList); + } + // 开启零担蒙层弹窗 + this.dialogFormZeroOrderVisible = true; + }, + // 修改零担零担信息 + handleRowZeroOrder() { + // 将修改的零担信息存入dataList中 + this.dataList.find(val => val.id === this.zeroOrderFormList[0].stockArticleId).ParcelLisList = + this.zeroOrderFormList; + // 关闭零担蒙层弹框 + this.dialogFormZeroOrderVisible = false; }, }, }; @@ -2486,4 +2537,8 @@ export default { .el-checkbox { margin-left: 0; } + +.el-input-number { + width: 100%; +} diff --git a/vite.config.js b/vite.config.js index c93848db..478e191f 100644 --- a/vite.config.js +++ b/vite.config.js @@ -14,9 +14,9 @@ export default ({ mode, command }) => { '/api': { // target: 'http://192.168.10.126:8889', // target: 'http://192.168.10.48:8888', - target: 'http://192.168.10.123:8889', - // target: 'http://192.168.10.101:8888', + // target: 'http://192.168.10.123:8889', // target: 'http://192.168.10.101:8888', + target: 'http://192.168.10.75:8777', // target: 'http://192.168.10.29:13000', // target: 'http://test.api.huitongys.com', changeOrigin: true,