From b14930d7ac2ce362403ea28d0bae724161bc1f3c Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期二, 21 四月 2026 10:36:41 +0800
Subject: [PATCH] fix(采购台账): 修正金额显示小数位数及界面文本错误
---
src/pages/procurementManagement/procurementLedger/index.vue | 58 +++++++++++++++++++++++++++++++++-------------------------
1 files changed, 33 insertions(+), 25 deletions(-)
diff --git a/src/pages/procurementManagement/procurementLedger/index.vue b/src/pages/procurementManagement/procurementLedger/index.vue
index 5d44a09..9092d4e 100644
--- a/src/pages/procurementManagement/procurementLedger/index.vue
+++ b/src/pages/procurementManagement/procurementLedger/index.vue
@@ -3,7 +3,7 @@
<!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 -->
<PageHeader title="閲囪喘鍙拌处"
@back="goBack" />
- <!-- 鎼滅储鍜岀瓫閫夊尯鍩� -->
+ <!-- 鎼滅储鍜岀瓫閫夊尯 -->
<view class="search-section">
<view class="search-bar">
<view class="search-input">
@@ -45,10 +45,10 @@
</view>
<up-divider></up-divider>
<view class="item-details">
- <view class="detail-row">
+ <!-- <view class="detail-row">
<text class="detail-label">閿�鍞悎鍚屽彿</text>
<text class="detail-value">{{ item.salesContractNo }}</text>
- </view>
+ </view> -->
<view class="detail-row">
<text class="detail-label">渚涘簲鍟嗗悕绉�</text>
<text class="detail-value">{{ item.supplierName }}</text>
@@ -63,7 +63,7 @@
</view>
<view class="detail-row">
<text class="detail-label">鍚堝悓閲戦(鍏�)</text>
- <text class="detail-value highlight">{{ item.contractAmount }}</text>
+ <text class="detail-value highlight">{{ formatNumber(item.contractAmount) }}</text>
</view>
<up-divider></up-divider>
<view class="detail-info">
@@ -77,20 +77,16 @@
</view>
</view>
<!-- 浠呴潪鈥滃鎵归�氳繃鈥濈殑鍙拌处灞曠ず鍒犻櫎鎸夐挳 -->
- <view
- class="detail-row"
- v-if="item.approvalStatus !== 3"
- style="justify-content: flex-end; margin-top: 8px;"
- >
- <up-button
- type="error"
- size="small"
- plain
- @click.stop="handleDelete(item)"
- >
+ <!-- <view class="detail-row"
+ v-if="item.approvalStatus !== 3"
+ style="justify-content: flex-end; margin-top: 8px;">
+ <up-button type="error"
+ size="small"
+ plain
+ @click.stop="handleDelete(item)">
鍒犻櫎
</up-button>
- </view>
+ </view> -->
</view>
</view>
</view>
@@ -100,12 +96,12 @@
<text>鏆傛棤閲囪喘鍙拌处鏁版嵁</text>
</view>
<!-- 娴姩鎿嶄綔鎸夐挳 -->
- <view class="fab-button"
+ <!-- <view class="fab-button"
@click="handleInfo('add')">
<up-icon name="plus"
size="24"
color="#ffffff"></up-icon>
- </view>
+ </view> -->
</view>
</template>
@@ -114,18 +110,21 @@
import { onShow } from "@dcloudio/uni-app";
import useUserStore from "@/store/modules/user";
import PageHeader from "@/components/PageHeader.vue";
- import { purchaseListPage, delPurchase } from "@/api/procurementManagement/procurementLedger";
+ import {
+ purchaseListPage,
+ delPurchase,
+ } from "@/api/procurementManagement/procurementLedger";
const userStore = useUserStore();
const approvalStatusText = {
- 1: "寰呭鏍�",
+ 1: "寰呭鎵�",
2: "瀹℃壒涓�",
3: "瀹℃壒閫氳繃",
4: "瀹℃壒澶辫触",
};
- // 鑾峰彇瀹℃壒鐘舵�佹爣绛剧被鍨�
+ // 鑾峰彇瀹℃壒鐘舵�佹爣绛剧被锟�?
const getApprovalStatusType = status => {
const typeMap = {
- 1: "info", // 寰呭鏍� - 鐏拌壊
+ 1: "info", // 寰呭鎵� - 鐏拌壊
2: "warning", // 瀹℃壒涓� - 姗欒壊
3: "success", // 瀹℃壒閫氳繃 - 缁胯壊
4: "error", // 瀹℃壒澶辫触 - 绾㈣壊
@@ -137,6 +136,11 @@
// 閲囪喘鍙拌处鏁版嵁
const ledgerList = ref([]);
+
+ // 鏍煎紡鍖栭噾棰�
+ const formatNumber = value => {
+ return parseFloat(value || 0).toFixed(3);
+ };
// 杩斿洖涓婁竴椤�
const goBack = () => {
@@ -180,6 +184,7 @@
try {
// 璁剧疆鎿嶄綔绫诲瀷
uni.setStorageSync("operationType", type);
+ uni.removeStorageSync("editData");
// 濡傛灉鏄煡鐪嬫垨缂栬緫鎿嶄綔
if (type !== "add") {
@@ -258,14 +263,17 @@
});
})
.catch(error => {
- // 瀵逛簬 request 灏佽杩斿洖鐨� '500' 鎴栧叾浠� code锛岄敊璇彁绀哄凡缁忓湪 request 閲� toast 杩囦簡锛岃繖閲屼笉鍐嶉噸澶嶈鐩�
+ // 瀵逛簬 request 灏佽杩斿洖鐨� '500' 鎴栧叾code锛岄敊璇彁绀哄凡缁忓湪 request 涓鐞嗕簡锛岃繖閲屼笉鍐嶉噸澶嶈鐩�
if (error === "500" || typeof error === "number") {
return;
}
// 鍙湁鍦ㄧ湡姝e紓甯告椂锛屾墠鍦ㄨ繖閲屽厹搴曟彁绀�
const msg =
(error && error.msg) ||
- (error && error.response && error.response.data && error.response.data.msg) ||
+ (error &&
+ error.response &&
+ error.response.data &&
+ error.response.data.msg) ||
(error && error.message) ||
"鍒犻櫎澶辫触";
uni.showToast({
@@ -287,5 +295,5 @@
<style scoped lang="scss">
@import "@/styles/procurement-common.scss";
- // 閲囪喘鍙拌处鐗规湁鏍峰紡锛堝鏈夐渶瑕佸彲鍦ㄦ娣诲姞锛�
+ // 閲囪喘鍙拌处鐗规湁鏍峰紡锛堝 闇�瑕佸彲鍦ㄦ娣诲姞锛�
</style>
--
Gitblit v1.9.3