From e0cf2c715d53336be770ce4be724690069cc3190 Mon Sep 17 00:00:00 2001 From: xzg <4727863@qq.com> Date: Wed, 9 Oct 2024 14:15:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=85=8D=E9=80=81=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E6=B5=81=E7=A8=8B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/option/storagecost/Warehousedaily.js | 2 +- .../storagecost/Warehouserentalmanagement.js | 2 +- .../Basicconfiguration.vue | 17 ++- .../Categorypricingunit.vue | 65 ++++++++-- .../DeliveryCostPricingTemplate.vue | 117 +++++++++++++----- .../Deliverymaintenancecosts.vue | 60 +++++++-- .../WarehouseTemplateHome.vue | 35 +++++- .../storagecost/Warehouserentalmanagement.vue | 34 +++-- .../distributionDeliveryListdis.vue | 2 +- .../distributionDeliveryListedt.vue | 18 ++- 10 files changed, 269 insertions(+), 83 deletions(-) diff --git a/src/option/storagecost/Warehousedaily.js b/src/option/storagecost/Warehousedaily.js index 58d576a3..aa28efab 100644 --- a/src/option/storagecost/Warehousedaily.js +++ b/src/option/storagecost/Warehousedaily.js @@ -26,7 +26,7 @@ export const columnList = [ head: false, }, { - prop: 'costSettlementTime', + prop: 'costSettlement', label: '成本结算时间', type: 1, values: '', diff --git a/src/option/storagecost/Warehouserentalmanagement.js b/src/option/storagecost/Warehouserentalmanagement.js index b7f70169..380bcf14 100644 --- a/src/option/storagecost/Warehouserentalmanagement.js +++ b/src/option/storagecost/Warehouserentalmanagement.js @@ -57,7 +57,7 @@ export const columnList = [ head: false, }, { - prop: 'type', + prop: 'typeName', label: '租用类型', type: 1, values: '', diff --git a/src/views/cost/Deliverycostmanagement/Basicconfiguration.vue b/src/views/cost/Deliverycostmanagement/Basicconfiguration.vue index 9d5dded9..8186b3b3 100644 --- a/src/views/cost/Deliverycostmanagement/Basicconfiguration.vue +++ b/src/views/cost/Deliverycostmanagement/Basicconfiguration.vue @@ -20,7 +20,7 @@ -
+
@@ -142,9 +141,9 @@ 保存 - + >
@@ -173,9 +172,13 @@ const props = defineProps({ }); console.log(props, '来自父页面参数'); const $route = useRoute(); //获取地址栏参数 +const tabactive = ref({ + label1: false, + label2: false, +}); const copyform = ref({}); const State = ref(false); //是否有数据 -const loading=ref(false) +const loading = ref(false); const form = ref({ ynSurcharge: 0, //是否有附加费 ynChargedKilometer: 0, //是否公里数计费 @@ -202,7 +205,20 @@ const handleClick = () => { clearTimeout(time); }, 50); }; -const preservation = () => { +const preservation = async () => { + if (!$route.query.id && !props.templateData.id) { + ElMessage({ + message: '请先新增模板', + type: 'error', + }); + console.log(emit); + let data = { + active: 1, + }; + emit('request-data', data); + return; + } + let data = { type: activeName.value, ...form.value, @@ -211,10 +227,10 @@ const preservation = () => { if (!State.value) { // 没有保存过走新增接口 // 新增 - $_expenseDispatchPriceRulesave(data).then(res => { + await $_expenseDispatchPriceRulesave(data).then(async res => { console.log(res, '新增成'); if (res.data.code == 200) { - State.value = true;//表示已经新增成功 + State.value = true; //表示已经新增成功 ElMessage({ message: res.data.msg, type: 'success', @@ -224,7 +240,7 @@ const preservation = () => { } else { // 修改编辑 if ($route.query.id || props.templateData.id) { - $_expenseDispatchPriceRuleupdate(data).then(res => { + await $_expenseDispatchPriceRuleupdate(data).then(async res => { if (res.data.code == 200) { ElMessage({ message: res.data.msg, @@ -234,38 +250,62 @@ const preservation = () => { }); } } + await onLoad(); }; const Reset = () => { copyform.value = deepClone(form.value); }; -const onLoad = () => { +const onLoad = async () => { + let _pageData = { + id: props.templateData.id || $route.query.id, + TabPageState: false, + }; + emit('request-data', _pageData); + if ($route.query.id || props.templateData.id) { let data = { type: activeName.value, templateId: $route.query.id || props.templateData.id, }; - // if ($route.query.id) { - // data.id = $route.query.id; - // } else { - // data.templateId = '1821740515451240449'; - // } - loading.value=true; - $_expenseDispatchPriceRuledetail(data).then(res => { - console.log(res, '详情'); - if (res.data.code == 200) { - if (res.data.data) { - form.value = res.data.data; - State.value = true; - } else { - State.value = false; + loading.value = true; + await $_expenseDispatchPriceRuledetail(data) + .then(res => { + console.log(res, '详情'); + if (res.data.code == 200) { + if (res.data.data) { + form.value = res.data.data; + activeName.value = res.data.data.type; + + // 判断是否有数据 + if (res.data.data) { + if (activeName.value == 1) { + tabactive.value.label1 = true; + } else { + tabactive.value.label2 = true; + } + if (tabactive.value.label1 && tabactive.value.label2) { + let _pageData = { + id: props.templateData.id, + TabPageState: true, + }; + emit('request-data', _pageData); + } + + console.log(tabactive.value, 'tabactive.value'); + } + State.value = true; + } else { + State.value = false; + } + console.log(State.value, '状态'); } - console.log(State.value,'状态'); - } - }).catch((error)=>{ - console.log(error); - }).finally(()=>{ - loading.value=false; - }); + }) + .catch(error => { + console.log(error); + }) + .finally(() => { + loading.value = false; + }); } }; const onLoadPage = async () => { @@ -273,6 +313,15 @@ const onLoadPage = async () => { onLoad(); }; onLoadPage(); +// 下一步 +const nextstep = () => { + let _pageData = { + id: props.templateData.id, + TabPageState: true, + active: 4, + }; + emit('request-data', _pageData); +};