From 9a0c23c52c3599bdf308e2414d17907e4679621d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=96=87=E5=8F=AF?= <1041367524@qq.com> Date: Thu, 28 Apr 2022 21:34:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9C=8D=E5=8A=A1=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/sales/orderShip.js | 12 ++++++++---- src/views/sales/order/ship.vue | 15 ++++++++++----- src/views/sales/service/detail.vue | 28 ++++++++++++++++++++++++---- 3 files changed, 42 insertions(+), 13 deletions(-) diff --git a/src/store/modules/sales/orderShip.js b/src/store/modules/sales/orderShip.js index 5be8908..72b4282 100644 --- a/src/store/modules/sales/orderShip.js +++ b/src/store/modules/sales/orderShip.js @@ -37,21 +37,25 @@ const actions = { company: await api.searchShip(), }); }, - save: async ({ rootState }, data) => { + save: async ({ dispatch, state }, data) => { let res = null; - if (data.every((item) => item.companyCode && item.trackingNo)) { + if (data.every((item) => item.logistics.companyCode && item.logistics.trackingNo)) { res = await api.sendAll( data.map((item) => { return { companyCode: item.logistics.companyCode, - companyName: dict(rootState.order.opts.company, item.logistics.companyCode), + companyName: dict(state.opts.company, item.logistics.companyCode, { + label: 'companyName', + value: 'companyCode', + }), orderId: item.orderId, - trackingNo: item.trackingNo, + trackingNo: item.logistics.trackingNo, }; }) ); if (res) { ElMessage.success('批量发货成功'); + dispatch('search'); } else { ElMessage.error('批量发货失败'); } diff --git a/src/views/sales/order/ship.vue b/src/views/sales/order/ship.vue index e1cc272..250d578 100644 --- a/src/views/sales/order/ship.vue +++ b/src/views/sales/order/ship.vue @@ -1,5 +1,5 @@ @@ -39,17 +39,22 @@ const handleCancel = () => { router.push({ name: 'OrderManagement' }); }; - const handleSave = () => { + const handleSave = async () => { loading.value = true; - store.dispatch('orderShip/save', unref(list)); + let res = await store.dispatch('orderShip/save', unref(list)); + if (res) { + handleClose(); + } loading.value = false; }; const handleShow = () => { visible.value = true; handleSearch(); }; + const emits = defineEmits(['save']); const handleClose = () => { visible.value = false; + emits('save'); }; defineExpose({ show: handleShow, @@ -84,7 +89,7 @@ }, { label: '配送方式', - width: 120, + width: 140, slots: { default: ({ row }) => ( - + @@ -221,10 +226,10 @@ {{ state.detail.refundLogistics?.companyName }} - + {{ state.detail.refundLogistics?.trackingNo }} - 查看 + 查看 {{ state.detail.handleReturnLog?.problemDescribe }} @@ -250,10 +255,12 @@ +