From dfe413e25a9684a2d0efedbf26603bc0e48da9bb Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 13 八月 2025 13:20:24 +0800
Subject: [PATCH] 1.销售台账模块开发联调

---
 src/pages/sales/salesAccount/index.vue |   71 +++++++++++++++++++++++------------
 1 files changed, 47 insertions(+), 24 deletions(-)

diff --git a/src/pages/sales/salesAccount/index.vue b/src/pages/sales/salesAccount/index.vue
index 7f93241..336e593 100644
--- a/src/pages/sales/salesAccount/index.vue
+++ b/src/pages/sales/salesAccount/index.vue
@@ -102,6 +102,8 @@
 import { ref } from 'vue';
 import { onShow } from '@dcloudio/uni-app';
 import {ledgerListPage} from "@/api/salesManagement/salesLedger";
+import useUserStore from "@/store/modules/user";
+const userStore = useUserStore()
 
 // 鎼滅储鍏抽敭璇�
 const searchKeyword = ref('');
@@ -127,33 +129,54 @@
 			// tableLoading.value = false;
 	});
 };
-// 鏄剧ず绛涢�夐�夐」
-const showFilterOptions = () => {
-	uni.showActionSheet({
-		itemList: ['鎸夋棩鏈熺瓫閫�', '鎸夌姸鎬佺瓫閫�', '鎸夐噾棰濈瓫閫�'],
-		success: (res) => {
-			console.log('閫夋嫨浜嗙瓫閫夐�夐」:', res.tapIndex);
-		}
-	});
-};
 
-// 鐐瑰嚮鍒楄〃椤�
-const handleItemClick = (item) => {
-	uni.showToast({
-		title: `鏌ョ湅鍚堝悓: ${item.contractId}`,
-		icon: 'none'
-	});
-};
-
-// 娣诲姞鏂拌褰�
+// 澶勭悊鍙拌处淇℃伅鎿嶄綔锛堟煡鐪�/缂栬緫/鏂板锛�
 const handleInfo = (type, row) => {
-  uni.setStorageSync('operationType', type);
-  if (row) {
-    uni.setStorageSync('editData', JSON.stringify(row));
+  try {
+    // 璁剧疆鎿嶄綔绫诲瀷
+    uni.setStorageSync('operationType', type);
+    
+    // 濡傛灉鏄煡鐪嬫垨缂栬緫鎿嶄綔
+    if (type !== 'add') {
+      // 楠岃瘉琛屾暟鎹槸鍚﹀瓨鍦�
+      if (!row) {
+        uni.showToast({
+          title: '鏁版嵁涓嶅瓨鍦�',
+          icon: 'error'
+        });
+        return;
+      }
+      
+      // 妫�鏌ユ潈闄愶細鍙湁褰曞叆浜烘墠鑳界紪杈�
+      if (row.entryPerson !== userStore.id) {
+        // 闈炲綍鍏ヤ汉璺宠浆鍒板彧璇昏鎯呴〉闈�
+        uni.setStorageSync('editData', JSON.stringify(row));
+        uni.navigateTo({
+          url: '/pages/sales/salesAccount/view'
+        });
+        return;
+      }
+      
+      // 褰曞叆浜虹紪杈戯細瀛樺偍鏁版嵁骞惰烦杞埌缂栬緫椤甸潰
+      uni.setStorageSync('editData', JSON.stringify(row));
+      uni.navigateTo({
+        url: '/pages/sales/salesAccount/detail'
+      });
+      return;
+    }
+    
+    // 鏂板鎿嶄綔锛氱洿鎺ヨ烦杞埌缂栬緫椤甸潰
+    uni.navigateTo({
+      url: '/pages/sales/salesAccount/detail'
+    });
+    
+  } catch (error) {
+    console.error('澶勭悊鍙拌处淇℃伅鎿嶄綔澶辫触:', error);
+    uni.showToast({
+      title: '鎿嶄綔澶辫触锛岃閲嶈瘯',
+      icon: 'error'
+    });
   }
-  uni.navigateTo({
-    url: '/pages/sales/salesAccount/detail'
-  });
 };
 
 onShow(() => {

--
Gitblit v1.9.3