From d92a54078602161ec5348f3900a5bb99108e5e0f Mon Sep 17 00:00:00 2001 From: taoge1020 Date: Tue, 9 Sep 2025 17:03:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=87=91=E9=A2=9D=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/plugins/index.ts | 3 +- src/utils/ruoyi.ts | 16 + src/views/contract/bidCost/index.vue | 6 +- src/views/contract/division/index.vue | 35 +- src/views/contract/limitPrice/index.vue | 10 +- src/views/contract/limitPrice/indexEdit.vue | 18 +- src/views/ctr/update/index.vue | 355 +++++++++--------- src/views/design/designChange/indexEdit.vue | 8 +- src/views/out/constructionValue/index.vue | 12 +- src/views/out/designCompletion/index.vue | 18 +- src/views/out/monthPlan/index.vue | 20 +- src/views/out/monthPlanAudit/index.vue | 26 +- src/views/out/outDesignTable/index.vue | 34 +- src/views/out/outDesignTableVS/index.vue | 74 +++- src/views/out/outTable/index.vue | 79 +++- src/views/out/purchase/comm/purchPage.vue | 6 +- .../out/settlementValueSubcontract/index.vue | 6 +- src/views/out/valueAllocation/index.vue | 48 ++- src/views/progress/progressCategory/index.vue | 10 +- src/views/project/constructionUser/index.vue | 4 +- .../landTransferLedger/index.vue | 40 +- .../landTransferLedgerFangzhen/index.vue | 20 +- src/views/project/projectUser/index.vue | 4 +- src/views/project/salaryExcel/index.vue | 6 +- src/views/project/subManagementUser/index.vue | 4 +- src/views/project/subcontract/index.vue | 8 +- src/views/project/workWage/index.vue | 8 +- src/views/tender/bidd/index.vue | 8 +- src/views/tender/bidd/indexEdit.vue | 8 +- src/views/tender/bidd/indexEdit2.vue | 8 +- src/views/tender/plan/index.vue | 47 ++- 32 files changed, 633 insertions(+), 318 deletions(-) diff --git a/.env.development b/.env.development index 4a874b9..6359576 100644 --- a/.env.development +++ b/.env.development @@ -14,7 +14,7 @@ VITE_APP_BASE_API = 'http://192.168.110.149:8899' # 罗成 # VITE_APP_BASE_API = 'http://192.168.110.188:8899' # 朱银 -VITE_APP_BASE_API = 'http://192.168.110.149:8899' +# VITE_APP_BASE_API = 'http://192.168.110.149:8899' #曾涛 # VITE_APP_BASE_API = 'http://192.168.110.171:8899' diff --git a/src/plugins/index.ts b/src/plugins/index.ts index 7449bde..1b5d412 100644 --- a/src/plugins/index.ts +++ b/src/plugins/index.ts @@ -9,7 +9,7 @@ import animate from '@/animate'; import { download as dl } from '@/utils/request'; import { useDict } from '@/utils/dict'; import { getConfigKey, updateConfigByKey } from '@/api/system/config'; -import { parseTime, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'; +import { parseTime, addDateRange, handleTree, selectDictLabel, selectDictLabels,formatPrice } from '@/utils/ruoyi'; import { downloadFile } from '@/utils/useFileDownload'; import { App } from 'vue'; @@ -42,4 +42,5 @@ export default function installPlugin(app: App) { app.config.globalProperties.selectDictLabels = selectDictLabels; app.config.globalProperties.animate = animate; app.config.globalProperties.downloadFile = downloadFile; + app.config.globalProperties.formatPrice = formatPrice; } diff --git a/src/utils/ruoyi.ts b/src/utils/ruoyi.ts index 8efd12c..c92994d 100644 --- a/src/utils/ruoyi.ts +++ b/src/utils/ruoyi.ts @@ -62,7 +62,23 @@ export const addDateRange = (params: any, dateRange: any[], propName?: string) = } return search; }; +// 价格格式化函数 +export const formatPrice = (price, show = true) => { + if ((!show && price == 0) || price == '' || price == undefined || price == null) return ''; + if (!price && price !== 0) return '0.0000'; + // 转换为数字并保留四位小数 + const num = Number(price); + if (isNaN(num)) return '0.0000'; + + const fixedNum = num.toFixed(4); + const [integer, decimal] = fixedNum.split('.'); + + // 千分位处理 + const formattedInteger = integer.replace(/\B(?=(\d{3})+(?!\d))/g, ','); + + return `${formattedInteger}.${decimal}`; +}; // 回显数据字典 export const selectDictLabel = (datas: any, value: number | string) => { if (value === undefined) { diff --git a/src/views/contract/bidCost/index.vue b/src/views/contract/bidCost/index.vue index a69eb4c..8df9d45 100644 --- a/src/views/contract/bidCost/index.vue +++ b/src/views/contract/bidCost/index.vue @@ -77,8 +77,8 @@ changePrice(scope.row); } " - :precision="2" - :step="0.1" + :min="0" + :precision="4" :controls="false" v-if="scope.row.quantity && scope.row.quantity != 0" /> @@ -86,7 +86,7 @@ diff --git a/src/views/contract/division/index.vue b/src/views/contract/division/index.vue index 1f085b2..23c50f5 100644 --- a/src/views/contract/division/index.vue +++ b/src/views/contract/division/index.vue @@ -25,7 +25,11 @@ - + + + - + + + + @@ -207,6 +217,7 @@ import { useUserStoreHook } from '@/store/modules/user'; import { getDicts } from '@/api/system/dict/data'; import { Plus } from '@element-plus/icons-vue'; import { FormInstance } from 'element-plus'; +const { proxy } = getCurrentInstance(); import { treeList, sheetList, diff --git a/src/views/contract/limitPrice/index.vue b/src/views/contract/limitPrice/index.vue index 505add3..dce5f23 100644 --- a/src/views/contract/limitPrice/index.vue +++ b/src/views/contract/limitPrice/index.vue @@ -79,18 +79,16 @@ changePrice(scope.row); } " - :precision="2" - :step="0.1" + :min="0" + :precision="4" :controls="false" v-if="scope.row.quantity && scope.row.quantity != 0" /> - + diff --git a/src/views/contract/limitPrice/indexEdit.vue b/src/views/contract/limitPrice/indexEdit.vue index facd683..4665f32 100644 --- a/src/views/contract/limitPrice/indexEdit.vue +++ b/src/views/contract/limitPrice/indexEdit.vue @@ -41,10 +41,14 @@ - - + + + + @@ -70,8 +74,12 @@ diff --git a/src/views/ctr/update/index.vue b/src/views/ctr/update/index.vue index 4908951..d813daf 100644 --- a/src/views/ctr/update/index.vue +++ b/src/views/ctr/update/index.vue @@ -1,79 +1,80 @@ diff --git a/src/views/design/designChange/indexEdit.vue b/src/views/design/designChange/indexEdit.vue index 9e6e857..7e0c7e5 100644 --- a/src/views/design/designChange/indexEdit.vue +++ b/src/views/design/designChange/indexEdit.vue @@ -145,7 +145,13 @@ > - diff --git a/src/views/out/constructionValue/index.vue b/src/views/out/constructionValue/index.vue index b6d49e0..50d0699 100644 --- a/src/views/out/constructionValue/index.vue +++ b/src/views/out/constructionValue/index.vue @@ -39,8 +39,16 @@ - - + + + + + +