From ef3aab90e71b07ff22ecc40a0a49236b371c04cd Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期三, 29 四月 2026 13:43:22 +0800
Subject: [PATCH] 优化营销客户相关

---
 src/views/salesManagement/salesLedger/index.vue |   77 +++++---------------------------------
 1 files changed, 10 insertions(+), 67 deletions(-)

diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index 1f6f315..0aa0c23 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -593,49 +593,7 @@
 					</el-col>
 				</el-row>
 
-        <!-- 瀹℃壒浜洪�夋嫨锛堜豢鍗忓悓瀹℃壒閲岀殑瀹℃壒浜鸿妭鐐归�夋嫨锛� -->
-        <el-row>
-          <el-col :span="24">
-            <el-form-item>
-              <template #label>
-                <span>瀹℃壒浜洪�夋嫨锛�</span>
-                <el-button type="primary" @click="addApproverNode" style="margin-left: 8px;">鏂板鑺傜偣</el-button>
-              </template>
-              <div style="display: flex; align-items: flex-end; flex-wrap: wrap;">
-                <div
-                  v-for="(node, index) in approverNodes"
-                  :key="node.id"
-                  style="margin-right: 20px; text-align: center; margin-bottom: 10px;"
-                >
-                  <div>
-                    <span>瀹℃壒浜�</span>
-                    鈫�
-                  </div>
-                  <el-select
-                    v-model="node.userId"
-                    placeholder="閫夋嫨浜哄憳"
-                    filterable
-                    style="width: 140px; margin-bottom: 8px;"
-                  >
-                    <el-option
-                      v-for="user in userList"
-                      :key="user.userId"
-                      :label="user.nickName"
-                      :value="user.userId"
-                    />
-                  </el-select>
-                  <div>
-                    <el-button
-                      type="danger"
-                      @click="removeApproverNode(index)"
-                      v-if="approverNodes.length > 1"
-                    >鍒犻櫎</el-button>
-                  </div>
-                </div>
-              </div>
-            </el-form-item>
-          </el-col>
-        </el-row>
+
 			</el-form>
 			<template #footer>
 				<div class="dialog-footer">
@@ -674,7 +632,7 @@
 import useFormData from "@/hooks/useFormData.js";
 import dayjs from "dayjs";
 import { getCurrentDate } from "@/utils/index.js";
-import {listCustomerPrivatePool} from "@/api/basicData/customerFile.js";
+import {listCustomer} from "@/api/basicData/customer.js";
 
 const userStore = useUserStore();
 const { proxy } = getCurrentInstance();
@@ -808,16 +766,6 @@
   },
 });
 const { deliveryForm, deliveryRules } = toRefs(deliveryFormData);
-
-// 鍙戣揣瀹℃壒浜鸿妭鐐癸紙浠垮崗鍚屽鎵� infoFormDia.vue锛�
-const approverNodes = ref([{ id: 1, userId: null }]);
-let nextApproverId = 2;
-const addApproverNode = () => {
-  approverNodes.value.push({ id: nextApproverId++, userId: null });
-};
-const removeApproverNode = (index) => {
-  approverNodes.value.splice(index, 1);
-};
 
 // 瀵煎叆鐩稿叧
 const importUploadRef = ref(null);
@@ -961,6 +909,7 @@
 	return true;
 };
 const canEditLedger = (row) => isCurrentUserMaintainer(row);
+const canDeleteLedger = (row) => isCurrentUserMaintainer(row);
 const sensitiveAmountFormatter = (row, column, cellValue) => {
 	if (!isCurrentUserMaintainer(row)) {
 		return "*****";
@@ -1111,7 +1060,7 @@
 	selectedQuotation.value = null;
 	let userLists = await userListNoPage();
 	userList.value = userLists.data;
-	listCustomerPrivatePool({current: -1,size:-1}).then((res) => {
+  listCustomer({current: -1,size:-1, type: 0}).then((res) => {
 		customerOption.value = res.data.records;
 	});
 	form.value.entryPerson = userStore.id;
@@ -1148,7 +1097,7 @@
 	// 鍏堢‘淇濆鎴峰垪琛ㄥ凡鍔犺浇锛屼究浜庡悗缁洖濉� customerId
 	if (!customerOption.value || customerOption.value.length === 0) {
 		try {
-			listCustomerPrivatePool({current: -1,size:-1}).then((res) => {
+			listCustomer({current: -1,size:-1, type: 0}).then((res) => {
 				customerOption.value = res.data.records;
 			});
 		} catch (e) {
@@ -1487,6 +1436,11 @@
 const handleDelete = async () => {
 	if (selectedRows.value.length === 0) {
 		proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+		return;
+	}
+	const unauthorizedRows = selectedRows.value.filter((row) => !canDeleteLedger(row));
+	if (unauthorizedRows.length > 0) {
+		proxy.$modal.msgWarning("褰撳墠鐧诲綍鐢ㄦ埛涓嶆槸褰曞叆浜猴紝涓嶈兘鍒犻櫎璇ユ暟鎹�");
 		return;
 	}
 	const ids = selectedRows.value.map((item) => item.id);
@@ -2172,9 +2126,6 @@
   deliveryForm.value = {
     type: "璐ц溅",
   };
-  // 閲嶇疆瀹℃壒浜鸿妭鐐癸紙榛樿涓�涓┖鑺傜偣锛�
-  approverNodes.value = [{ id: 1, userId: null }];
-  nextApproverId = 2;
 	deliveryFormVisible.value = true;
 };
 
@@ -2182,13 +2133,6 @@
 const submitDelivery = () => {
   proxy.$refs["deliveryFormRef"].validate((valid) => {
     if (valid) {
-      // 瀹℃壒浜哄繀濉牎楠岋紙鎵�鏈夎妭鐐归兘瑕侀�変汉锛�
-      const hasEmptyApprover = approverNodes.value.some(node => !node.userId);
-      if (hasEmptyApprover) {
-        proxy.$modal.msgError("璇蜂负鎵�鏈夊鎵硅妭鐐归�夋嫨瀹℃壒浜猴紒");
-        return;
-      }
-      const approveUserIds = approverNodes.value.map(node => node.userId).join(",");
       // 淇濆瓨褰撳墠灞曞紑鐨勮ID锛屼互渚垮彂璐у悗閲嶆柊鍔犺浇瀛愯〃鏍兼暟鎹�
       const currentExpandedKeys = [...expandedRowKeys.value];
       const salesLedgerId = currentDeliveryRow.value.salesLedgerId;
@@ -2196,7 +2140,6 @@
         salesLedgerId: salesLedgerId,
         salesLedgerProductId: currentDeliveryRow.value.id,
         type: deliveryForm.value.type,
-				approveUserIds,
       })
         .then(() => {
           proxy.$modal.msgSuccess("鍙戣揣鎴愬姛");

--
Gitblit v1.9.3