From c56e5d01939c67e3e7abdc0ff9d369719cd26f25 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 17 四月 2026 15:38:23 +0800
Subject: [PATCH] 进销存升级 1.客户档案分为公海和私海 2.销售所有模块查询客户数据接口更改
---
src/views/basicData/customerFile/index.vue | 102 +++++------
src/api/basicData/customerFile.js | 104 +++++++++--
src/views/basicData/customerFileOpenSea/index.vue | 198 +++++++++++++++++----
src/views/salesManagement/salesLedger/index.vue | 79 +++++++-
src/views/salesManagement/salesQuotation/index.vue | 5
5 files changed, 359 insertions(+), 129 deletions(-)
diff --git a/src/api/basicData/customerFile.js b/src/api/basicData/customerFile.js
index 6a5f049..7b6d7c6 100644
--- a/src/api/basicData/customerFile.js
+++ b/src/api/basicData/customerFile.js
@@ -1,7 +1,5 @@
-// 瀹㈡埛妗f椤甸潰鎺ュ彛
import request from '@/utils/request'
-// 鍒嗛〉鏌ヨ
export function listCustomer(query) {
return request({
url: '/basic/customer/list',
@@ -9,14 +7,76 @@
params: query
})
}
-// 鏌ヨ瀹㈡埛妗f璇︾粏
+
+// 瀹㈡埛妗f绉佹捣鏌ヨ
+export function listCustomerPrivatePool(query) {
+ return request({
+ url: '/customerPrivatePool/listPage',
+ method: 'get',
+ params: query
+ })
+}
+
+export function addCustomerPrivatePool(data) {
+ return request({
+ url: '/customerPrivatePool/add',
+ method: 'post',
+ data: data
+ })
+}
+
+export function addCustomerPrivate(data) {
+ return request({
+ url: '/customerPrivate/add',
+ method: 'post',
+ data: data
+ })
+}
+
+export function delCustomerPrivate(ids) {
+ return request({
+ url: '/customerPrivate/delete',
+ method: 'delete',
+ data: ids
+ })
+}
+
+export function delCustomerPrivatePool(id) {
+ return request({
+ url: '/customerPrivatePool/delete/' + id,
+ method: 'delete',
+ })
+}
+
+export function shareCustomer(data) {
+ return request({
+ url: '/customerPrivatePool/together',
+ method: 'post',
+ data: data
+ })
+}
+
export function getCustomer(id) {
return request({
url: '/basic/customer/' + id,
method: 'get'
})
}
-// 鏂板瀹㈡埛妗f
+
+export function getCustomerPrivatePoolById(id) {
+ return request({
+ url: '/customerPrivatePool/getbyId/' + id,
+ method: 'get'
+ })
+}
+
+export function getCustomerPrivatePoolInfo(id) {
+ return request({
+ url: '/customerPrivatePool/info/' + id,
+ method: 'get'
+ })
+}
+
export function addCustomer(data) {
return request({
url: '/basic/customer/addCustomer',
@@ -24,7 +84,7 @@
data: data
})
}
-// 淇敼瀹㈡埛妗f
+
export function updateCustomer(data) {
return request({
url: '/basic/customer/updateCustomer',
@@ -32,7 +92,15 @@
data: data
})
}
-// 瀵煎嚭瀹㈡埛妗f
+
+export function updateCustomerPrivatePool(data) {
+ return request({
+ url: '/customerPrivatePool/update',
+ method: 'put',
+ data: data
+ })
+}
+
export function exportCustomer(query) {
return request({
url: '/basic/customer/export',
@@ -41,7 +109,7 @@
responseType: 'blob'
})
}
-// 鍒犻櫎瀹㈡埛妗f
+
export function delCustomer(ids) {
return request({
url: '/basic/customer/delCustomer',
@@ -50,8 +118,6 @@
})
}
-
-// 鏂板瀹㈡埛璺熻繘
export function addCustomerFollow(data) {
return request({
url: '/basic/customer-follow/add',
@@ -60,23 +126,21 @@
})
}
-// 淇敼瀹㈡埛璺熻繘
export function updateCustomerFollow(data) {
- return request({
- url: '/basic/customer-follow/edit',
- method: 'put',
- data: data,
- })
+ return request({
+ url: '/basic/customer-follow/edit',
+ method: 'put',
+ data: data,
+ })
}
-// 鍒犻櫎瀹㈡埛璺熻繘
+
export function delCustomerFollow(id) {
return request({
- url: '/basic/customer-follow/'+id,
+ url: '/basic/customer-follow/' + id,
method: 'delete',
})
}
-// 鍥炶鎻愰啋-鏂板/鏇存柊
export function addReturnVisit(data) {
return request({
url: '/basic/customer-follow/return-visit',
@@ -84,10 +148,10 @@
data: data
})
}
-// 鑾峰彇鍥炶鎻愰啋璇︽儏
+
export function getReturnVisit(id) {
return request({
url: '/basic/customer-follow/return-visit/' + id,
method: 'get'
})
-}
\ No newline at end of file
+}
diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index 79b1616..d0f829c 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -612,11 +612,13 @@
import { onMounted, ref, reactive, getCurrentInstance, toRefs } from "vue";
import { Search, Paperclip, Upload } from "@element-plus/icons-vue";
import {
- addCustomer,
- delCustomer,
+ addCustomerPrivate,
+ delCustomerPrivate,
getCustomer,
- listCustomer,
- updateCustomer,
+ getCustomerPrivatePoolById,
+ getCustomerPrivatePoolInfo,
+ listCustomerPrivatePool,
+ updateCustomerPrivatePool,
addCustomerFollow,
updateCustomerFollow,
delCustomerFollow,
@@ -654,7 +656,7 @@
const negotiationFormRef = ref();
const negotiationForm = reactive({
customerName: "",
- customerId: "",
+ customerPrivatePoolId: "",
followUpMethod: "",
followUpLevel: "",
followUpTime: "",
@@ -726,7 +728,7 @@
},
{
label: "鍦板潃鍙婅仈绯绘柟寮�",
- prop: "addressPhone",
+ prop: "companyAddress",
width: 250,
},
{
@@ -766,6 +768,24 @@
{
label: "缁存姢浜�",
prop: "maintainer",
+ },
+ {
+ label: "瀹㈡埛鏉ユ簮",
+ prop: "type",
+ dataType: "tag",
+ width: 100,
+ formatData: value => {
+ if (value === 1 || value === "1") {
+ return "鍏捣";
+ }
+ return "绉佹捣";
+ },
+ formatType: value => {
+ if (value === 1 || value === "1") {
+ return "warning";
+ }
+ return "success";
+ },
},
{
label: "缁存姢鏃堕棿",
@@ -881,7 +901,7 @@
// 璁剧疆涓婁紶鐨勮姹傚ご閮�
headers: { Authorization: "Bearer " + getToken() },
// 涓婁紶鐨勫湴鍧�
- url: import.meta.env.VITE_APP_BASE_API + "/basic/customer/importData",
+ url: import.meta.env.VITE_APP_BASE_API + "/customerPrivate/importData",
// 鏂囦欢涓婁紶鍓嶇殑鍥炶皟
beforeUpload: file => {
console.log("鏂囦欢鍗冲皢涓婁紶", file);
@@ -952,10 +972,10 @@
};
const getList = () => {
tableLoading.value = true;
- listCustomer({ ...searchForm.value, ...page }).then(res => {
+ listCustomerPrivatePool({ ...searchForm.value, ...page }).then(res => {
tableLoading.value = false;
- tableData.value = res.records;
- page.total = res.total;
+ tableData.value = res.data.records;
+ page.total = res.data.total;
});
};
// 琛ㄦ牸閫夋嫨鏁版嵁
@@ -974,7 +994,7 @@
}
/** 涓嬭浇妯℃澘 */
function importTemplate() {
- proxy.download("/basic/customer/downloadTemplate", {}, "瀹㈡埛瀵煎叆妯℃澘.xlsx");
+ proxy.download("/customerPrivate/downloadTemplate", {}, "瀹㈡埛瀵煎叆妯℃澘.xlsx");
}
// 鎵撳紑寮规
const openForm = (type, row) => {
@@ -992,7 +1012,7 @@
userList.value = res.data;
});
if (type === "edit") {
- getCustomer(row.id).then(res => {
+ getCustomerPrivatePoolById(row.id).then(res => {
form.value = { ...res.data };
formYYs.value.contactList = res.data.contactPerson
.split(",")
@@ -1029,7 +1049,7 @@
form.value.contactPhone = formYYs.value.contactList
.map(item => item.contactPhone)
.join(",");
- addCustomer(form.value).then(res => {
+ addCustomerPrivate(form.value).then(res => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeDia();
getList();
@@ -1043,7 +1063,7 @@
form.value.contactPhone = formYYs.value.contactList
.map(item => item.contactPhone)
.join(",");
- updateCustomer(form.value).then(res => {
+ updateCustomerPrivatePool(form.value).then(res => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeDia();
getList();
@@ -1062,7 +1082,7 @@
type: "warning",
})
.then(() => {
- proxy.download("/basic/customer/export", {}, "瀹㈡埛妗f.xlsx");
+ proxy.download("/customerPrivate/export", {}, "瀹㈡埛妗f.xlsx");
})
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
@@ -1072,12 +1092,11 @@
const handleDelete = () => {
let ids = [];
if (selectedRows.value.length > 0) {
- // 妫�鏌ユ槸鍚︽湁浠栦汉缁存姢鐨勬暟鎹�
const unauthorizedData = selectedRows.value.filter(
- item => item.maintainer !== userStore.nickName
+ item => item.type === 1 || item.type === "1"
);
if (unauthorizedData.length > 0) {
- proxy.$modal.msgWarning("涓嶅彲鍒犻櫎浠栦汉缁存姢鐨勬暟鎹�");
+ proxy.$modal.msgWarning("鍏捣鍒嗛厤鐨勫鎴蜂笉鑳藉垹闄�");
return;
}
ids = selectedRows.value.map(item => item.id);
@@ -1092,8 +1111,8 @@
})
.then(() => {
tableLoading.value = true;
- delCustomer(ids)
- .then(res => {
+ delCustomerPrivate(ids)
+ .then(() => {
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
getList();
})
@@ -1146,7 +1165,8 @@
if (reminderForm.id) {
submitvalue.value = {
id: reminderForm.id,
- customerId: currentCustomerId.value,
+ customerPrivatePoolId: reminderForm.id,
+ customerPrivatePoolId: currentCustomerId.value,
isEnabled: reminderForm.reminderSwitch ? 1 : 0,
content: reminderForm.reminderContent,
reminderTime: reminderForm.reminderTime,
@@ -1154,15 +1174,13 @@
};
} else {
submitvalue.value = {
- customerId: currentCustomerId.value,
+ customerPrivatePoolId: currentCustomerId.value,
isEnabled: reminderForm.reminderSwitch ? 1 : 0,
content: reminderForm.reminderContent,
reminderTime: reminderForm.reminderTime,
remindUserId: userStore.id,
};
}
-
- console.log("鎻愪氦鍥炶鎻愰啋鏁版嵁:", submitvalue.value);
// 璋冪敤鎺ュ彛
addReturnVisit(submitvalue.value)
@@ -1185,20 +1203,12 @@
// 鎵撳紑娲借皥杩涘害寮圭獥
const openNegotiationDialog = row => {
negotiationForm.customerName = row.customerName;
- negotiationForm.customerId = row.id;
+ negotiationForm.customerPrivatePoolId = row.id;
negotiationForm.followUpMethod = "";
negotiationForm.followUpLevel = "";
negotiationForm.followUpTime = "";
negotiationForm.followerUserName = userStore.nickName; // 榛樿褰撳墠鐧诲綍浜�
negotiationForm.content = "";
- // {
- // "customerId": 152,
- // "followUpMethod": "鐢佃瘽娌熼��",
- // "followUpLevel": "娌℃湁鎰忓悜",
- // "followUpTime": "2026-03-04T15:30:00",
- // "followerUserName": "绠$悊鍛樿处鍙�",
- // "content": "111"
- // }
negotiationDialogVisible.value = true;
};
@@ -1220,26 +1230,9 @@
if (isEdit) {
// 淇敼鎿嶄綔
- console.log("淇敼娲借皥杩涘害鏁版嵁:", negotiationForm);
- // 杩欓噷鍙互璋冪敤鏇存柊鎺ュ彛
- // 瀹為檯椤圭洰涓渶瑕佹牴鎹悗绔帴鍙h繘琛岃皟鏁�
- // 绀轰緥锛歶pdateCustomerFollow(negotiationForm).then(res => {
- // // 鏇存柊鏈湴鏁版嵁
- // const index = negotiationForm.editIndex;
- // negotiationRecords.value[index] = {
- // followUpTime: negotiationForm.followUpTime,
- // followUpMethod: negotiationForm.followUpMethod,
- // followUpLevel: negotiationForm.followUpLevel,
- // followerUserName: negotiationForm.followerUserName,
- // content: negotiationForm.content,
- // id: negotiationForm.id,
- // };
- // proxy.$modal.msgSuccess("淇敼鎴愬姛");
- // closeNegotiationDialog();
- // });
updateCustomerFollow(negotiationForm).then(res => {
// 鏇存柊鏈湴鏁版嵁
- getCustomer(negotiationForm.customerId).then(res => {
+ getCustomer(negotiationForm.customerPrivatePoolId).then(res => {
// 鏇存柊鏈湴鏁版嵁
negotiationRecords.value = res.data.followUpList || [];
});
@@ -1271,8 +1264,7 @@
// 鎵撳紑璇︽儏寮圭獥
const openDetailDialog = row => {
- // 璋冪敤getCustomer鎺ュ彛鑾峰彇瀹㈡埛璇︽儏
- getCustomer(row.id).then(res => {
+ getCustomerPrivatePoolInfo(row.id).then(res => {
// 濉厖瀹㈡埛鍩烘湰淇℃伅
Object.assign(detailForm, res.data);
@@ -1293,7 +1285,7 @@
// 灏嗗綋鍓嶈褰曟暟鎹~鍏呭埌琛ㄥ崟
Object.assign(negotiationForm, {
customerName: row.customerName,
- customerId: row.customerId,
+ customerPrivatePoolId: row.customerPrivatePoolId,
followUpMethod: row.followUpMethod,
followUpLevel: row.followUpLevel,
followUpTime: row.followUpTime,
@@ -1321,7 +1313,7 @@
// });
delCustomerFollow(row.id).then(() => {
// 鍒犻櫎鎴愬姛鍚庢洿鏂版湰鍦版暟鎹�
- getCustomer(row.customerId).then(res => {
+ getCustomer(row.customerPrivatePoolId).then(res => {
// 鏇存柊鏈湴鏁版嵁
negotiationRecords.value = res.data.followUpList || [];
});
diff --git a/src/views/basicData/customerFileOpenSea/index.vue b/src/views/basicData/customerFileOpenSea/index.vue
index b2d4709..71cc051 100644
--- a/src/views/basicData/customerFileOpenSea/index.vue
+++ b/src/views/basicData/customerFileOpenSea/index.vue
@@ -215,15 +215,15 @@
disabled />
</el-form-item>
<el-form-item label="鍒嗛厤浜哄憳"
- prop="maintainer">
- <el-select v-model="assignForm.maintainer"
+ prop="boundId">
+ <el-select v-model="assignForm.boundId"
placeholder="璇烽�夋嫨鍒嗛厤浜哄憳"
style="width: 100%"
filterable>
<el-option v-for="item in userList"
:key="item.userId || item.nickName"
:label="item.nickName"
- :value="item.nickName" />
+ :value="item.userId" />
</el-select>
</el-form-item>
</el-form>
@@ -232,6 +232,42 @@
<el-button type="primary"
@click="submitAssignForm">纭</el-button>
<el-button @click="closeAssignDialog">鍙栨秷</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ <el-dialog v-model="shareDialogVisible"
+ title="鍏变韩瀹㈡埛"
+ width="500px"
+ @close="closeShareDialog">
+ <el-form :model="shareForm"
+ :rules="shareRules"
+ ref="shareFormRef"
+ label-width="100px">
+ <el-form-item label="瀹㈡埛鍚嶇О">
+ <el-input v-model="shareForm.customerName"
+ disabled />
+ </el-form-item>
+ <el-form-item label="鍏变韩浜哄憳"
+ prop="boundIds">
+ <el-select v-model="shareForm.boundIds"
+ placeholder="璇烽�夋嫨鍏变韩浜哄憳"
+ style="width: 100%"
+ filterable
+ multiple
+ collapse-tags
+ collapse-tags-tooltip>
+ <el-option v-for="item in userList"
+ :key="item.userId || item.nickName"
+ :label="item.nickName"
+ :value="item.userId" />
+ </el-select>
+ </el-form-item>
+ </el-form>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary"
+ @click="submitShareForm">纭</el-button>
+ <el-button @click="closeShareDialog">鍙栨秷</el-button>
</div>
</template>
</el-dialog>
@@ -646,8 +682,11 @@
import { Search, Paperclip, Upload } from "@element-plus/icons-vue";
import {
addCustomer,
+ addCustomerPrivatePool,
+ delCustomerPrivatePool,
delCustomer,
getCustomer,
+ shareCustomer,
listCustomer,
updateCustomer,
addCustomerFollow,
@@ -667,10 +706,20 @@
const assignForm = reactive({
id: undefined,
customerName: "",
- maintainer: "",
+ boundId: undefined,
});
const assignRules = {
- maintainer: [{ required: true, message: "璇烽�夋嫨鍒嗛厤浜哄憳", trigger: "change" }],
+ boundId: [{ required: true, message: "璇烽�夋嫨鍒嗛厤浜哄憳", trigger: "change" }],
+ };
+ const shareDialogVisible = ref(false);
+ const shareFormRef = ref();
+ const shareForm = reactive({
+ id: undefined,
+ customerName: "",
+ boundIds: [],
+ });
+ const shareRules = {
+ boundIds: [{ required: true, message: "璇烽�夋嫨鍏变韩浜哄憳", trigger: "change" }],
};
// 鍥炶鎻愰啋鐩稿叧
@@ -781,16 +830,16 @@
prop: "contactPhone",
width: 150,
},
- {
- label: "璺熻繘杩涘害",
- prop: "followUpLevel",
- width: 120,
- },
- {
- label: "璺熻繘鏃堕棿",
- prop: "followUpTime",
- width: 120,
- },
+ // {
+ // label: "璺熻繘杩涘害",
+ // prop: "followUpLevel",
+ // width: 120,
+ // },
+ // {
+ // label: "璺熻繘鏃堕棿",
+ // prop: "followUpTime",
+ // width: 120,
+ // },
{
label: "閾惰鍩烘湰鎴�",
prop: "basicBankAccount",
@@ -810,22 +859,53 @@
label: "缁存姢浜�",
prop: "maintainer",
},
+ {
+ label: "缁存姢鏃堕棿",
+ prop: "maintenanceTime",
+ width: 100,
+ },
{
- label: "缁存姢鏃堕棿",
- prop: "maintenanceTime",
- width: 100,
+ label: "棰嗙敤浜�",
+ prop: "usageUserName",
+ width: 120,
+ fixed: "right",
},
+ {
+ label: "棰嗙敤鐘舵��",
+ prop: "usageStatus",
+ dataType: "tag",
+ width: 100,
+ fixed: "right",
+ formatData: value => {
+ if (value === 1 || value === "1") {
+ return "宸查鐢�";
+ }
+ return "鏈鐢�";
+ },
+ formatType: value => {
+ if (value === 1 || value === "1") {
+ return "success";
+ }
+ return "info";
+ },
+ },
+ {
+ label: "鍏变韩浜�",
+ prop: "togetherUserNames",
+ width: 120,
+ fixed: "right",
+ },
{
dataType: "action",
label: "鎿嶄綔",
align: "center",
fixed: "right",
- width: 320,
+ width: 200,
operation: [
{
name: "鍒嗛厤",
type: "text",
- showHide: row => !row.maintainer,
+ showHide: row => row.usageStatus != 1,
clickFun: row => {
openAssignDialog(row);
},
@@ -833,11 +913,19 @@
{
name: "鍥炴敹",
type: "text",
- showHide: row => !!row.maintainer,
+ showHide: row => row.usageStatus == 1,
clickFun: row => {
recycleCustomer(row);
},
},
+ {
+ name: "鍏变韩",
+ type: "text",
+ showHide: row => row.usageStatus == 1,
+ clickFun: row => {
+ openShareDialog(row);
+ },
+ },
{
name: "缂栬緫",
type: "text",
@@ -845,13 +933,13 @@
openForm("edit", row);
},
},
- {
- name: "璇︽儏",
- type: "text",
- clickFun: row => {
- openDetailDialog(row);
- },
- },
+ // {
+ // name: "璇︽儏",
+ // type: "text",
+ // clickFun: row => {
+ // openDetailDialog(row);
+ // },
+ // },
],
},
]);
@@ -997,10 +1085,11 @@
};
const getList = () => {
tableLoading.value = true;
- listCustomer({ ...searchForm.value, ...page }).then(res => {
+ const { total, ...queryPage } = page;
+ listCustomer({ ...searchForm.value, ...queryPage }).then(res => {
tableLoading.value = false;
- tableData.value = res.records;
- page.total = res.total;
+ tableData.value = res.data.records;
+ page.total = res.data.total;
});
};
// 琛ㄦ牸閫夋嫨鏁版嵁
@@ -1110,7 +1199,7 @@
const openAssignDialog = row => {
assignForm.id = row.id;
assignForm.customerName = row.customerName;
- assignForm.maintainer = row.maintainer || "";
+ assignForm.boundId = undefined;
ensureUserList().then(() => {
assignDialogVisible.value = true;
});
@@ -1119,21 +1208,50 @@
proxy.resetForm("assignFormRef");
assignForm.id = undefined;
assignForm.customerName = "";
- assignForm.maintainer = "";
+ assignForm.boundId = undefined;
assignDialogVisible.value = false;
+ };
+ const openShareDialog = row => {
+ shareForm.id = row.id;
+ shareForm.customerName = row.customerName;
+ shareForm.boundIds = [];
+ ensureUserList().then(() => {
+ shareDialogVisible.value = true;
+ });
+ };
+ const closeShareDialog = () => {
+ proxy.resetForm("shareFormRef");
+ shareForm.id = undefined;
+ shareForm.customerName = "";
+ shareForm.boundIds = [];
+ shareDialogVisible.value = false;
};
const submitAssignForm = () => {
proxy.$refs.assignFormRef.validate(valid => {
if (!valid) {
return;
}
- updateCustomer({
- id: assignForm.id,
- maintainer: assignForm.maintainer,
- maintenanceTime: getCurrentDate(),
+ addCustomerPrivatePool({
+ customerId: assignForm.id,
+ boundId: assignForm.boundId,
}).then(() => {
proxy.$modal.msgSuccess("鍒嗛厤鎴愬姛");
closeAssignDialog();
+ getList();
+ });
+ });
+ };
+ const submitShareForm = () => {
+ proxy.$refs.shareFormRef.validate(valid => {
+ if (!valid) {
+ return;
+ }
+ shareCustomer({
+ customerId: shareForm.id,
+ boundIds: shareForm.boundIds,
+ }).then(() => {
+ proxy.$modal.msgSuccess("鍏变韩鎴愬姛");
+ closeShareDialog();
getList();
});
});
@@ -1145,11 +1263,7 @@
type: "warning",
})
.then(() => {
- return updateCustomer({
- id: row.id,
- maintainer: "",
- maintenanceTime: "",
- });
+ return delCustomerPrivatePool(row.id);
})
.then(() => {
proxy.$modal.msgSuccess("鍥炴敹鎴愬姛");
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index 5a14505..1f6f315 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -42,7 +42,7 @@
<el-table-column align="center" type="selection" width="55" fixed="left"/>
<el-table-column type="expand" width="60" fixed="left">
<template #default="props">
- <el-table :data="props.row.children" border show-summary :summary-method="summarizeChildrenTable">
+ <el-table :data="props.row.children" border show-summary :summary-method="(param) => summarizeChildrenTable(param, props.row)">
<el-table-column align="center" label="搴忓彿" type="index"/>
<el-table-column label="浜у搧澶х被" prop="productCategory" />
<el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" />
@@ -89,9 +89,9 @@
</el-table-column>
<el-table-column label="鏁伴噺" prop="quantity" />
<el-table-column label="绋庣巼(%)" prop="taxRate" />
- <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" />
- <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" />
- <el-table-column label="涓嶅惈绋庢�讳环(鍏�)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" />
+ <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" :formatter="sensitiveAmountFormatter" />
+ <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" :formatter="sensitiveAmountFormatter" />
+ <el-table-column label="涓嶅惈绋庢�讳环(鍏�)" prop="taxExclusiveTotalPrice" :formatter="sensitiveAmountFormatter" />
<!--鎿嶄綔-->
<el-table-column Width="60px" label="鎿嶄綔" align="center">
<template #default="scope">
@@ -122,7 +122,7 @@
<el-table-column label="澶囨敞" prop="remarks" width="200" show-overflow-tooltip />
<el-table-column fixed="right" label="鎿嶄綔" width="130" align="center">
<template #default="scope">
- <el-button link type="primary" @click="openForm('edit', scope.row)" :disabled="!scope.row.isEdit || scope.row.hasProductionRecord">缂栬緫</el-button>
+ <el-button link type="primary" @click="openForm('edit', scope.row)" :disabled="!scope.row.isEdit || scope.row.hasProductionRecord || !canEditLedger(scope.row)">缂栬緫</el-button>
<el-button link type="primary" @click="downLoadFile(scope.row)">闄勪欢</el-button>
</template>
</el-table-column>
@@ -674,6 +674,7 @@
import useFormData from "@/hooks/useFormData.js";
import dayjs from "dayjs";
import { getCurrentDate } from "@/utils/index.js";
+import {listCustomerPrivatePool} from "@/api/basicData/customerFile.js";
const userStore = useUserStore();
const { proxy } = getCurrentInstance();
@@ -923,7 +924,48 @@
});
};
const formattedNumber = (row, column, cellValue) => {
+ if (cellValue === undefined || cellValue === null || cellValue === "") {
+ return "0.00";
+ }
return parseFloat(cellValue).toFixed(2);
+};
+const findLedgerRecordByRow = (row) => {
+ if (!row) return null;
+ if (
+ row.maintainer !== undefined ||
+ row.maintainerName !== undefined ||
+ row.entryPerson !== undefined ||
+ row.entryPersonName !== undefined
+ ) {
+ return row;
+ }
+ if (row.salesLedgerId !== undefined && row.salesLedgerId !== null) {
+ return tableData.value.find((item) => String(item.id) === String(row.salesLedgerId)) || null;
+ }
+ return null;
+};
+const isCurrentUserMaintainer = (row) => {
+ const ledgerRecord = findLedgerRecordByRow(row);
+ if (!ledgerRecord) return true;
+ const currentUserId = String(userStore.id ?? "");
+ const currentNickName = String(userStore.nickName ?? "").trim();
+ const maintainerId = ledgerRecord.maintainerId ?? ledgerRecord.entryPerson;
+ const maintainerName =
+ ledgerRecord.maintainerName ?? ledgerRecord.maintainer ?? ledgerRecord.entryPersonName;
+ if (maintainerId !== undefined && maintainerId !== null && String(maintainerId) !== "") {
+ return String(maintainerId) === currentUserId;
+ }
+ if (maintainerName !== undefined && maintainerName !== null && String(maintainerName).trim() !== "") {
+ return String(maintainerName).trim() === currentNickName;
+ }
+ return true;
+};
+const canEditLedger = (row) => isCurrentUserMaintainer(row);
+const sensitiveAmountFormatter = (row, column, cellValue) => {
+ if (!isCurrentUserMaintainer(row)) {
+ return "*****";
+ }
+ return formattedNumber(row, column, cellValue);
};
// 鑾峰彇tree瀛愭暟鎹�
const getModels = (value) => {
@@ -1038,7 +1080,19 @@
]);
};
// 瀛愯〃鍚堣鏂规硶
-const summarizeChildrenTable = (param) => {
+const summarizeChildrenTable = (param, parentRow) => {
+ if (!isCurrentUserMaintainer(parentRow)) {
+ const { columns } = param;
+ return columns.map((column, index) => {
+ if (index === 0) {
+ return "鍚堣";
+ }
+ if (["taxInclusiveUnitPrice", "taxInclusiveTotalPrice", "taxExclusiveTotalPrice"].includes(column.property)) {
+ return "*****";
+ }
+ return "";
+ });
+ }
return proxy.summarizeTable(param, [
"taxInclusiveUnitPrice",
"taxInclusiveTotalPrice",
@@ -1047,14 +1101,18 @@
};
// 鎵撳紑寮规
const openForm = async (type, row) => {
+ if (type === "edit" && row && !canEditLedger(row)) {
+ proxy.$modal.msgWarning("褰撳墠绯荤粺鐧诲綍浜轰笉鏄淮鎶や汉锛屼笉鑳界紪杈戞暟鎹�");
+ return;
+ }
operationType.value = type;
form.value = {};
productData.value = [];
selectedQuotation.value = null;
let userLists = await userListNoPage();
userList.value = userLists.data;
- customerList().then((res) => {
- customerOption.value = res;
+ listCustomerPrivatePool({current: -1,size:-1}).then((res) => {
+ customerOption.value = res.data.records;
});
form.value.entryPerson = userStore.id;
if (type === "add") {
@@ -1090,8 +1148,9 @@
// 鍏堢‘淇濆鎴峰垪琛ㄥ凡鍔犺浇锛屼究浜庡悗缁洖濉� customerId
if (!customerOption.value || customerOption.value.length === 0) {
try {
- const res = await customerList();
- customerOption.value = res;
+ listCustomerPrivatePool({current: -1,size:-1}).then((res) => {
+ customerOption.value = res.data.records;
+ });
} catch (e) {
// ignore锛屽厑璁哥敤鎴峰悗缁墜鍔ㄩ�夋嫨瀹㈡埛
}
diff --git a/src/views/salesManagement/salesQuotation/index.vue b/src/views/salesManagement/salesQuotation/index.vue
index f69412a..01174d7 100644
--- a/src/views/salesManagement/salesQuotation/index.vue
+++ b/src/views/salesManagement/salesQuotation/index.vue
@@ -360,6 +360,7 @@
import {userListNoPage} from "@/api/system/user.js";
import {customerList} from "@/api/salesManagement/salesLedger.js";
import {modelList, productTreeList} from "@/api/basicData/product.js";
+import {listCustomerPrivatePool} from "@/api/basicData/customerFile.js";
// 鍝嶅簲寮忔暟鎹�
const loading = ref(false)
@@ -489,8 +490,8 @@
userName: item.userName || ''
}));
getProductOptions();
- customerList().then((res) => {
- customerOption.value = res;
+ listCustomerPrivatePool({current: -1,size:-1}).then((res) => {
+ customerOption.value = res.data.records;
});
}
const getProductOptions = () => {
--
Gitblit v1.9.3