diff --git a/src/views/distribution/inventory/delivery/distributionStockArticle.vue b/src/views/distribution/inventory/delivery/distributionStockArticle.vue index 61c60ea7..dde9b721 100644 --- a/src/views/distribution/inventory/delivery/distributionStockArticle.vue +++ b/src/views/distribution/inventory/delivery/distributionStockArticle.vue @@ -157,8 +157,17 @@ 查看 修改客户信息 日志 - 拆单 - 零担拆单 + + 拆单 + + 零担拆单 @@ -406,183 +415,176 @@ - - - - 运单号 - {{ rowobj.waybillNumber }} - - - 品牌 - {{ rowobj.brand }} - - - - - - - - - 发货单位 - {{ rowobj.shipper }} - - - 发货人 - {{ rowobj.shipperName }} - - - 发货方电话 - {{ rowobj.shipperMobile }} - - - - - 发货方地址 - {{ rowobj.shipperAddress }} - - - - - - - - - - - - - 收货单位 - {{ rowobj.consignee }} - - - 收货人 - {{ rowobj.consigneeName }} - - - 收货电话 - {{ rowobj.consigneeMobile }} - - - - - 收货地址 - {{ rowobj.consigneeAddress }} + v-model="zerodialogTableVisible" + width="65%" + title="运单信息" + :show-close="false" + :lock-scroll="false" + :align-center="true" + > + + + + 运单号 + {{ rowobj.waybillNumber }} + + + 品牌 + {{ rowobj.brand }} + + + + + - - - + + + 发货单位 + {{ rowobj.shipper }} + + + 发货人 + {{ rowobj.shipperName }} + + + 发货方电话 + {{ rowobj.shipperMobile }} + - - 运单总件数 - {{ rowobj.totalCount }} + + + 发货方地址 + {{ rowobj.shipperAddress }} + + + + + + + + + - - - - - - 货物类型 - {{ rowobj.goodsName }} + + + 收货单位 + {{ rowobj.consignee }} + + + 收货人 + {{ rowobj.consigneeName }} + + + 收货电话 + {{ rowobj.consigneeMobile }} + - - 订单总件数 - {{ rowobj.totalNumber }} + + + 收货地址 + {{ rowobj.consigneeAddress }} + + + + + + + 运单总件数 + {{ rowobj.totalCount }} + + + + 货物类型 + {{ rowobj.goodsName }} + + + 订单总件数 + {{ rowobj.totalNumber }} + - - 剩余件数 - {{ rowobj.handQuantity }} - - - - - - - 订单{{ index + 1 }} - - + 剩余件数 + {{ rowobj.handQuantity }} - - - 货物名称 - - 可用件数 - 分配数量 - - + + + + + 订单{{ index + 1 }} - {{ itemlimit.productName }} - - - - - - + + - - - - - 收货人: - - - + + + 货物名称 + + 可用件数 + 分配数量 - - 收货人电话: + - + {{ itemlimit.productName }} + + + + + + - - - 收货人地址: - - + + + + 收货人: + + + + + + 收货人电话: + + + - - 备注: - - + + + 收货人地址: + + + + + + 备注: + + + - - - 取消 - 确认 - - + + 取消 + 确认 + + 新增 @@ -689,7 +691,7 @@ import { getDictionaryBiz } from '@/api/system/dict'; import dayjs from 'dayjs'; import { exportBlob } from '@/api/common'; import { getToken } from '@/utils/auth'; -import { downloadXls, getObjType, handleClearTableQuery,isNumber } from '@/utils/util'; +import { downloadXls, getObjType, handleClearTableQuery, isNumber } from '@/utils/util'; import { columnList } from '@/option/distribution/distributionStockArticleSelf'; import { deepClone, setNodeHeight, hanleTextLineFeed } from '@/utils/util.js'; import { ElMessage, ElMessageBox } from 'element-plus'; @@ -701,9 +703,9 @@ export default { excelForm: {}, excelBox: false, tcloading: false, - rowobj:{}, - zeroload:false, - parcelList:[], + rowobj: {}, + zeroload: false, + parcelList: [], orderobj: { name: '', phone: '', @@ -730,7 +732,7 @@ export default { ], }, ], - zerodialogTableVisible:false, + zerodialogTableVisible: false, Totalnumbersplitorders: 0, dataRwo: {}, ruleForm: { @@ -896,13 +898,16 @@ export default { computed: { ...mapGetters(['permission']), permissionList() { - console.log(this.permission,'this.permission'); + console.log(this.permission, 'this.permission'); return { addBtn: this.validData(this.permission.basicdataBrandCategory_add, false), viewBtn: this.validData(this.permission.basicdataBrandCategory_view, false), delBtn: this.validData(this.permission.basicdataBrandCategory_delete, false), editBtn: this.validData(this.permission.basicdataBrandCategory_edit, false), - distributionStockList_unpack: this.validData(this.permission.distributionStockList_unpack, false), + distributionStockList_unpack: this.validData( + this.permission.distributionStockList_unpack, + false + ), }; }, ids() { @@ -1458,17 +1463,17 @@ export default { type: 'warning', }); } else { - this.Splittheform.PackageList=[ - { - stockArticleId: '', //被拆订单ID - orderCode: '', //被拆订单 - mallName: '', //商场名称 - taskNumber: '', //任务拆单数量 - customerName: '', //新的客户姓名 - customerTelephone: '', //新的客户联系方式 - customerAddress: '', //新的客户地址 - }, - ] + this.Splittheform.PackageList = [ + { + stockArticleId: '', //被拆订单ID + orderCode: '', //被拆订单 + mallName: '', //商场名称 + taskNumber: '', //任务拆单数量 + customerName: '', //新的客户姓名 + customerTelephone: '', //新的客户联系方式 + customerAddress: '', //新的客户地址 + }, + ]; this.dialogSplitthe = true; } } @@ -1481,40 +1486,40 @@ export default { }); }, // 零担拆单 - async zeroSplittheorder(row){ + async zeroSplittheorder(row) { console.log(row); - - this.zerodialogTableVisible=true - let _data={ - orderId:row.id - } - let res= await $_zeroetail(_data) - console.log(res,'res'); - const {code , data } = res.data - if(code !=200){ - return - } - let _obj ={ - ...data.orderInfo,...data.waybillEntity + + this.zerodialogTableVisible = true; + let _data = { + orderId: row.id, + }; + let res = await $_zeroetail(_data); + console.log(res, 'res'); + const { code, data } = res.data; + if (code != 200) { + return; } - console.log(data.orderInfo,'data.orderInfo'); - - console.log(data.waybillEntity,'data.waybillEntity'); - - console.log( _obj,' _obj'); - - let Name = data.parcelList.map(res=>res.firsts).join(',') - this.rowobj=_obj + let _obj = { + ...data.orderInfo, + ...data.waybillEntity, + }; + console.log(data.orderInfo, 'data.orderInfo'); + + console.log(data.waybillEntity, 'data.waybillEntity'); + + console.log(_obj, ' _obj'); + + let Name = data.parcelList.map(res => res.firsts).join(','); + this.rowobj = _obj; this.orderlist.splice(1); - this.parcelList=data.parcelList; - -// 使用数组来批量设置属性 -['addres', 'name', 'phone', 'rak'].forEach(prop => { - this.orderlist[0][prop] = ''; -}); - this.orderlist[0].goods = this.splitName(Name,data.parcelList); - console.log(this.orderlist[0],'this.orderlist[0]'); - + this.parcelList = data.parcelList; + + // 使用数组来批量设置属性 + ['addres', 'name', 'phone', 'rak'].forEach(prop => { + this.orderlist[0][prop] = ''; + }); + this.orderlist[0].goods = this.splitName(Name, data.parcelList); + console.log(this.orderlist[0], 'this.orderlist[0]'); }, addorder() { // 实现对对象内包含的元素进行copy @@ -1522,17 +1527,17 @@ export default { obsj.goods = this.splitName(this.rowobj.goodsName, this.parcelList); this.orderlist.push(obsj); }, - splitName(goodName,data) { - console.log(goodName,'goodName'); - + splitName(goodName, data) { + console.log(goodName, 'goodName'); + var t = goodName.split(','); var arr = []; for (let i = 0; i < t.length; i++) { var proN = t[i]; - var o = {}; + var o = {}; o.productName = proN; o.splitNum = 0; - o.quantity=data[i].quantity; + o.quantity = data[i].quantity; arr[i] = o; } return arr; @@ -1545,7 +1550,7 @@ export default { this.orderlist.splice(index, 1); }, async hidedial() { - this.zeroload=true + this.zeroload = true; try { let _arr = []; let totalNum = 0; @@ -1556,7 +1561,7 @@ export default { let _flag = false; for (let i = 0; i < value.goods.length; i++) { const item = value.goods[i]; - + console.log('item :>> ', item); if (isNumber(item.splitNum) && item.splitNum > 0) _flag = true; totalNum += item.splitNum; @@ -1572,15 +1577,15 @@ export default { }; _arr.push(obj); } - console.log(this.rowobj,'this.rowobj'); - + console.log(this.rowobj, 'this.rowobj'); + console.log('_arr :>> ', _arr); - + if (_arr.length === 0) return this.$message.error('请选择需要拆单的数据'); if (totalNum > this.rowobj.handQuantity) return this.$message.error('总数大于可用数量'); this.dialogTableVisible = false; console.log(_arr); - this.zeroload=true + this.zeroload = true; const res = await $_splitOrder(_arr); const { code, data } = res.data; @@ -1590,7 +1595,7 @@ export default { this.page.currentPage = 1; this.onLoad(this.page); - this.zerodialogTableVisible=false + this.zerodialogTableVisible = false; // splitOrder(row).then(res => { // const data = res.data.data; // this.page.total = data.total; @@ -1603,11 +1608,10 @@ export default { console.log('error :>> ', error); } finally { console.log('111 :>> ', 111); - this.zeroload=false + this.zeroload = false; } }, - // 拆单总数统计 changeTaskNumber() { this.Totalnumbersplitorders = this.Splittheform.PackageList.reduce( @@ -1647,12 +1651,11 @@ export default { let taskNumberState = this.Splittheform.PackageList.find(item => item.taskNumber == 0); if (taskNumberState) { this.$message({ - message: '存在拆单数量能为0的任务', + message: '存在拆单数量为0的任务', type: 'warning', }); return; } - console.log(this.Splittheform.PackageList); let sum = this.Splittheform.PackageList.reduce((accumulator, currentValue) => { if (!currentValue || currentValue.taskNumber == null) { return accumulator; @@ -1693,9 +1696,9 @@ export default { if (res.data.code == 200) { this.dialogSplitthe = false; ElMessage({ - message: res.data.msg, - type: 'success', - }) + message: res.data.msg, + type: 'success', + }); this.onLoad(this.page); } }) @@ -1707,6 +1710,11 @@ export default { }); }) .catch(() => {}); + } else { + ElMessage({ + message: '信息未填写完整或填写格式不正确!', + type: 'warning', + }); } }); }, @@ -1921,9 +1929,8 @@ export default { this.getAllOrderInfo(); const [res] = await Promise.all([ getList(page.currentPage, page.pageSize, Object.assign(params, this.query)), - ]); - + const data = res.data.data; this.page.total = data.total; this.data = data.records; @@ -2193,7 +2200,7 @@ export default { } } .numbinput { - .el-input-number{ + .el-input-number { width: 100%; } } @@ -2295,8 +2302,7 @@ export default { input { font-size: 12px !important; } - .el-input{ - + .el-input { width: 100%; } textarea {