From 89cd3efd5dc533e6c8129d7d86dc74e1adf3d84c Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 20 八月 2025 14:00:25 +0800
Subject: [PATCH] 1.回款登记页面开发账联调

---
 src/pages/sales/salesAccount/detail.vue |   30 +++++++++++++++++++-----------
 1 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/src/pages/sales/salesAccount/detail.vue b/src/pages/sales/salesAccount/detail.vue
index 56c92a9..2c2530c 100644
--- a/src/pages/sales/salesAccount/detail.vue
+++ b/src/pages/sales/salesAccount/detail.vue
@@ -1,10 +1,14 @@
 <template>
   <view class="account-detail">
     <!-- 椤堕儴鏍囬鏍� -->
-    <view class="header">
-      <up-icon name="arrow-left" size="20" color="#333" @click="goBack" />
-      <text class="title">鍙拌处璇︽儏</text>
-    </view>
+		<van-nav-bar
+			title="鍙拌处璇︽儏"
+			left-text="杩斿洖"
+			left-arrow
+			@click-left="goBack"
+			fixed
+			placeholder
+		/>
 
          <!-- 琛ㄥ崟鍖哄煙 -->
 		<van-form @submit="onSubmit" label-width="110px" input-align="right" style="margin-top: 10px" error-message-align="right" scroll-to-error scroll-to-error-position="center">
@@ -58,9 +62,9 @@
 			</van-popup>
 			<van-field label="浠樻鏂瑰紡" name="paymentMethod" borderBottom="true" v-model="form.paymentMethod" placeholder="璇疯緭鍏ヤ粯娆炬柟寮�">
 			</van-field>
-			<van-field label="褰曞叆浜�" name="entryPersonName" borderBottom="true" v-model="form.entryPersonName" placeholder="璇疯緭鍏�" readonly>
+			<van-field label="褰曞叆浜�" name="entryPersonName" borderBottom="true" v-model="form.entryPersonName" placeholder="璇疯緭鍏�" disabled>
 			</van-field>
-			<van-field label="褰曞叆鏃ユ湡" name="entryDate" borderBottom="true" v-model="form.entryDate" placeholder="璇疯緭鍏�" readonly>
+			<van-field label="褰曞叆鏃ユ湡" name="entryDate" borderBottom="true" v-model="form.entryDate" placeholder="璇疯緭鍏�" disabled>
 			</van-field>
 			<van-popup v-model:show="showPicker" destroy-on-close position="bottom">
 				<van-picker
@@ -129,7 +133,7 @@
 			<view class="product-section">
 				<view class="section-header">
 					<text class="section-title">浜у搧淇℃伅</text>
-					<van-button type="primary" size="small" @click="addProduct" class="add-btn" icon="plus">鏂板</van-button>
+					<van-button type="primary" size="small" @click="addProduct" class="add-btn" icon="plus"  v-if="operationType !== 'view'">鏂板</van-button>
 				</view>
 				<view class="product-card" v-for="(product, idx) in productData" :key="idx">
 					<!-- 浜у搧绫� -->
@@ -139,7 +143,7 @@
 							<text class="product-productCategory">浜у搧 {{ idx + 1 }}</text>
 						</view>
 						<!-- 鎿嶄綔鎸夐挳 -->
-						<view class="product-actions">
+						<view class="product-actions"  v-if="operationType !== 'view'">
 							<van-button type="danger" size="mini" @click="removeProduct(idx)" class="del-btn" icon="delete">鍒犻櫎</van-button>
 						</view>
 					</view>
@@ -258,7 +262,7 @@
 					</view>
 				</view>
 			</view>
-			<view class="footer-btns">
+			<view class="footer-btns" v-if="operationType !== 'view'">
 				<van-button class="cancel-btn" @click="goBack">鍙栨秷</van-button>
 				<van-button class="save-btn" native-type="submit" form-type="submit">淇濆瓨</van-button>
 			</view>
@@ -343,6 +347,9 @@
 ]);
 
 const addProduct = () => {
+	if (productData.value === null) {
+		productData.value = []
+	}
 	productData.value.push({
     productCategory: '',
     specificationModel: '',
@@ -596,6 +603,7 @@
 			title: '璇锋坊鍔犱骇鍝佷俊鎭�',
 			icon: 'none'
 		});
+		return
 	}
 	form.value.type = 1;
 	addOrUpdateSalesLedger(form.value).then((res) => {
@@ -608,7 +616,7 @@
 };
 const setUserInfo = () => {
 	form.value.entryPerson = userStore.id;
-	form.value.entryPersonName = userStore.name;
+	form.value.entryPersonName = userStore.nickName;
 	// 璁剧疆褰撳ぉ鏃ユ湡
 	const today = new Date()
 	const year = today.getFullYear()
@@ -724,7 +732,7 @@
 		try {
 			editData.value = JSON.parse(editDataStr);
 			// 濡傛灉鏄紪杈戞ā寮忥紝绛夊緟鏁版嵁鍔犺浇瀹屾垚鍚庡~鍏呰〃鍗曟暟鎹�
-			if (operationType.value === 'edit' && editData.value) {
+			if (operationType.value !== 'add' && editData.value) {
 				// 浣跨敤 nextTick 纭繚鏁版嵁鍔犺浇瀹屾垚鍚庡啀濉厖
 				setTimeout(() => {
 					fillFormData();

--
Gitblit v1.9.3