From 2e4be039ee4f48b141bddafefe4f99509596dca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=BA=A2=E5=85=B5?= <374362909@qq.com> Date: Fri, 27 Feb 2026 13:31:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E7=94=B3=E8=AF=B7=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/purchase/purchasingPurchaseManager.ts | 41 +++ src/flow/designer/views/json-view.vue | 3 +- .../finance/purchasingrequisition/add.vue | 71 +++++ .../purchasingPurchaseManager/form.vue | 228 ++++++++++++++++ .../purchasingPurchaseManager/index.vue | 254 ++++++++++++++++++ 5 files changed, 596 insertions(+), 1 deletion(-) create mode 100644 src/api/purchase/purchasingPurchaseManager.ts create mode 100644 src/views/purchase/purchasingPurchaseManager/form.vue create mode 100644 src/views/purchase/purchasingPurchaseManager/index.vue diff --git a/src/api/purchase/purchasingPurchaseManager.ts b/src/api/purchase/purchasingPurchaseManager.ts new file mode 100644 index 0000000..c4520d6 --- /dev/null +++ b/src/api/purchase/purchasingPurchaseManager.ts @@ -0,0 +1,41 @@ +import request from '/@/utils/request' + +export function fetchList(query?: any) { + return request({ + url: '/purchase/purchasingPurchaseManager/page', + method: 'get', + params: query + }) +} + +export function getObj(id: any) { + return request({ + url: '/purchase/purchasingPurchaseManager/details', + method: 'get', + params: { id } + }) +} + +export function addObj(obj: any) { + return request({ + url: '/purchase/purchasingPurchaseManager', + method: 'post', + data: obj + }) +} + +export function delObjs(ids: any) { + return request({ + url: '/purchase/purchasingPurchaseManager', + method: 'delete', + data: ids + }) +} + +export function putObj(obj: any) { + return request({ + url: '/purchase/purchasingPurchaseManager', + method: 'put', + data: obj + }) +} \ No newline at end of file diff --git a/src/flow/designer/views/json-view.vue b/src/flow/designer/views/json-view.vue index 1c8c4c9..a4f3343 100644 --- a/src/flow/designer/views/json-view.vue +++ b/src/flow/designer/views/json-view.vue @@ -46,7 +46,8 @@ const methods = { open(flowData) { flowData = stringifyRemoveNullKey(flowData); - data.flowData = !window.isWebTest ? {contact: "演示环境不能操作,如需了解联系我们"}: JSON.parse(flowData); + // data.flowData = !window.isWebTest ? {contact: "演示环境不能操作,如需了解联系我们"}: JSON.parse(flowData); + data.flowData = JSON.parse(flowData); data.viewJsonVisible = true; }, onClose() { diff --git a/src/views/finance/purchasingrequisition/add.vue b/src/views/finance/purchasingrequisition/add.vue index f9d2332..cc68a2c 100644 --- a/src/views/finance/purchasingrequisition/add.vue +++ b/src/views/finance/purchasingrequisition/add.vue @@ -235,6 +235,13 @@ + + + + + + + @@ -482,6 +489,7 @@ import other from '/@/utils/other'; import { Document, Download, QuestionFilled } from '@element-plus/icons-vue'; import { fetchList as getBusinessDeptList } from '/@/api/purchase/purchasingBusinessDept'; import { getPage as getSchoolLeaderPage } from '/@/api/finance/purchasingschoolleader'; +import { fetchList as getPurchasingManagerList} from '/@/api/purchase/purchasingPurchaseManager'; import { Session } from '/@/utils/storage'; import * as orderVue from '/@/api/order/order-key-vue'; @@ -598,6 +606,9 @@ const dataForm = reactive({ deptClassifyName: '', schoolLeaderUserId: '', schoolLeaderName: '', + // 采购分管 + purchaseManagerUserId: '', + purchaseManagerName: '', // 其他材料(zip压缩包) otherMaterials: '', // 实施采购信息(查看时展示) @@ -619,6 +630,7 @@ const purchaseModeSchoolList = ref([]); const purchaseTypeUnionList = ref([]); const businessDeptList = ref([]); const schoolLeaderList = ref([]); +const purchasingManagerList = ref([]); const loading = ref(false); const helpDialogVisible = ref(false); @@ -1121,6 +1133,20 @@ const dataRules = reactive({ trigger: 'change' } ], + purchaseManagerUserId: [ + { + validator: (_rule: any, value: string, callback: (e?: Error) => void) => { + if (!isDeptPurchase.value) { + if (!value || String(value).trim() === '') { + callback(new Error('请选择采购分管')); + return; + } + } + callback(); + }, + trigger: 'change' + } + ], }); // 取消 @@ -1190,6 +1216,8 @@ async function loadDetail(applyId: string | number) { deptClassifyName: detail.deptClassifyName ?? '', schoolLeaderUserId: detail.schoolLeaderUserId ?? '', schoolLeaderName: detail.schoolLeaderName ?? '', + purchaseManagerUserId: detail.purchaseManagerUserId ?? '', + purchaseManagerName: detail.purchaseManagerName ?? '', otherMaterials: detail.otherMaterials ?? '', implementType: detail.implementType ?? '', fileFlowInstId: detail.fileFlowInstId ?? '', @@ -1468,6 +1496,15 @@ const getBusinessDeptListData = async () => { name: item.name, username: item.username })); + + businessDeptList.value.push({ + id: '0', + deptId: '0', + deptName: '无', + userId: '0', + name: '无', + username: '无' + }); } } catch (err) { console.error('获取业务分管处室列表失败:', err); @@ -1493,6 +1530,25 @@ const getSchoolLeaderListData = async () => { } }; +// 获取采购分管列表 +const getPurchasingManagerListData = async () => { + try { + const res = await getPurchasingManagerList({ records: 1000 }); // 获取所有数据 + if (res.data && res.data.records) { + purchasingManagerList.value = res.data.records.map((item: any) => ({ + id: item.id, + userId: item.userId, + name: item.name, + username: item.username, + deptName: item.deptName + })); + } + } catch (err) { + console.error('获取采购分管列表失败:', err); + purchasingManagerList.value = []; + } +}; + // 处理业务分管处室选择变化 const handleBusinessDeptChange = (value: string) => { if (value) { @@ -1521,6 +1577,20 @@ const handleSchoolLeaderChange = (value: string) => { } }; +// 处理采购分管选择变化 +const handlePurchaseManagerChange = (value: string) => { + if (value) { + const selected = purchasingManagerList.value.find(item => item.userId === value); + if (selected) { + dataForm.purchaseManagerUserId = selected.userId; + dataForm.purchaseManagerName = selected.name || ''; + } + } else { + dataForm.purchaseManagerUserId = ''; + dataForm.purchaseManagerName = ''; + } +}; + // 处理文件ID字符串或对象数组转ID数组 // 支持:逗号分隔的字符串、字符串数组、{ id, name? }[](编辑回填时的格式) const getFileIdsArray = (fileIds: string | string[] | { id?: string; name?: string }[]): string[] => { @@ -1801,6 +1871,7 @@ onMounted(async () => { getPurchaseTypeUnionDict(), getBusinessDeptListData(), getSchoolLeaderListData(), + getPurchasingManagerListData(), ]); // 编辑/查看:从 URL 或流程 currJob.orderId 加载详情 diff --git a/src/views/purchase/purchasingPurchaseManager/form.vue b/src/views/purchase/purchasingPurchaseManager/form.vue new file mode 100644 index 0000000..4eea09b --- /dev/null +++ b/src/views/purchase/purchasingPurchaseManager/form.vue @@ -0,0 +1,228 @@ + + + + + \ No newline at end of file diff --git a/src/views/purchase/purchasingPurchaseManager/index.vue b/src/views/purchase/purchasingPurchaseManager/index.vue new file mode 100644 index 0000000..688dd9c --- /dev/null +++ b/src/views/purchase/purchasingPurchaseManager/index.vue @@ -0,0 +1,254 @@ + + + + + \ No newline at end of file