From 127d66bb0326e56273c786fc07b7224437cdddde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98huanghaiixia=E2=80=99?= <980486410@.com> Date: Wed, 11 Feb 2026 10:19:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=80=E7=AE=97=E7=BB=93=E7=AE=97=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/routes/basic.ts | 8 +++ .../ContractSales/components/createForm.vue | 11 ++- .../PngSettleHdr/components/createForm.vue | 69 +++++++++++++------ 3 files changed, 65 insertions(+), 23 deletions(-) diff --git a/src/router/routes/basic.ts b/src/router/routes/basic.ts index efcc604..eed9f3f 100644 --- a/src/router/routes/basic.ts +++ b/src/router/routes/basic.ts @@ -294,6 +294,14 @@ export const PAGE_CUSTOM_ROUTE: AppRouteRecordRaw[] = [{ title: (route) => route.query.formName } }, + { + path: '/contract/ContractSales/viewForm', + name: 'ContractSalesviewForm', + component: () => import('/@/views/contract/ContractSales/components/createForm.vue'), + meta: { + title: (route) => ('管道气销售合同详情') + } + }, ] diff --git a/src/views/contract/ContractSales/components/createForm.vue b/src/views/contract/ContractSales/components/createForm.vue index e62eba8..604d0b1 100644 --- a/src/views/contract/ContractSales/components/createForm.vue +++ b/src/views/contract/ContractSales/components/createForm.vue @@ -1,6 +1,6 @@ @@ -247,20 +250,20 @@ try { let data = await getLngPngSettleHdr(id) spinning.value = false - let a = DataFormat.format({...data}, [ - FormatOption.createQty('qtySettleGj'), - FormatOption.createQty('qtySettleM3'), - FormatOption.createAmt('amount'), - ]); - Object.assign(formState, a) + Object.assign(formState, {...data}) Object.assign(dataFile.value, formState.lngFileUploadList || []) Object.assign(dataFileAccount.value, formState.billList || []) Object.assign(dataList.value, formState.lngPngSettleSalesList || []) formState.settleMonth = formState.settleMonth ? dayjs(formState.settleMonth) : null formState.dateFrom = formState.dateFrom ? dayjs(formState.dateFrom) : null formState.dateTo = formState.dateTo ? dayjs(formState.dateTo) : null - - + numFormat() + } catch (error) { + console.log(error, 'error') + spinning.value = false + } + } + const numFormat = () => { dataList.value = DataFormat.format(dataList.value, [ FormatOption.createQty('qtySettleGj'), FormatOption.createQty('qtySettleM3'), @@ -270,11 +273,19 @@ FormatOption.createQty('priceGj',4), FormatOption.createQty('priceM3',4), ]); - - } catch (error) { - console.log(error, 'error') - spinning.value = false + let obj = { + qtySettleGj: formState.qtySettleGj, + qtySettleM3: formState.qtySettleM3, + amount: formState.amount } + let a = DataFormat.format({...obj}, [ + FormatOption.createQty('qtySettleGj'), + FormatOption.createQty('qtySettleM3'), + FormatOption.createAmt('amount'), + ]); + formState.qtySettleGj = a.qtySettleGj + formState.qtySettleM3 = a.qtySettleM3 + formState.amount = a.amount } const comIdChange = (val) => { if (!val)return @@ -335,7 +346,15 @@ }); setTimeout(() => { selectedKeys.value = [] - }, 8000); + numClear() + }, 1000); + } + } + const numClear = () => { + if (!dataList.value.length) { + formState.qtySettleGj = '' + formState.qtySettleM3 = '' + formState.amount = '' } } const handleSuccessMeasure = (val) => { @@ -344,19 +363,29 @@ return } val.forEach(v=> { - dataList.value.forEach(k=> { - if (v.salesId!==k.salesId) { - dataList.value.push(v) - } - }) + let idx = dataList.value.findIndex(k=>k.salesId==v.salesId) + console.log(idx, 5324, val, dataList.value) + idx<0&&dataList.value.push(v) }) } const btnCheck = (record, index, type) => { if (type == 'delete') { dataList.value.splice(index, 1) - } else { + numClear() + } + if (type == 'price'){ openModalPrice(true,{isUpdate: false, record,isDisable: isDisable.value}) } + if (type == 'ksName'){ + router.push({ + path: '/contract/ContractSales/viewForm', + query: { + formPath: 'dayPlan/PngSettleHdr', + id: record.ksId, + disabled: true + } + }); + } } const handleSuccessPrice = (arr, curRecord) => { let qtySettleGj = 0 @@ -400,6 +429,7 @@ formState.qtySettleGj = qtySettleGj.toFixed(3) formState.qtySettleM3 = qtySettleM3.toFixed(3) formState.amount = amount.toFixed(2) + numFormat() } const onSearchCustomer = () => { openModalCustomer(true,{isUpdate: false}) @@ -481,5 +511,4 @@ margin-bottom: 12px; border-bottom: 1px solid #eee; } -