diff --git a/src/api/purchase/purchasingBusinessLeader.ts b/src/api/purchase/purchasingBusinessLeader.ts new file mode 100644 index 0000000..ad5f58b --- /dev/null +++ b/src/api/purchase/purchasingBusinessLeader.ts @@ -0,0 +1,61 @@ +import request from '/@/utils/request'; + +/** + * 分页查询 + * @param params 查询参数 + */ +export function fetchList(params?: any) { + return request({ + url: '/purchase/purchasingBusinessLeader/page', + method: 'get', + params + }); +} + +/** + * 通过id查询 + * @param id ID + */ +export function getObj(id: string | number) { + return request({ + url: '/purchase/purchasingBusinessLeader/details', + method: 'get', + params: { id } + }); +} + +/** + * 新增业务分管校领导 + * @param obj 对象数据 + */ +export function addObj(obj: any) { + return request({ + url: '/purchase/purchasingBusinessLeader', + method: 'post', + data: obj + }); +} + +/** + * 修改业务分管校领导 + * @param obj 对象数据 + */ +export function putObj(obj: any) { + return request({ + url: '/purchase/purchasingBusinessLeader', + method: 'put', + data: obj + }); +} + +/** + * 删除业务分管校领导 + * @param ids ID数组 + */ +export function delObjs(ids: string[] | number[]) { + return request({ + url: '/purchase/purchasingBusinessLeader', + method: 'delete', + data: ids + }); +} \ No newline at end of file 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..a305ae0 100644 --- a/src/views/finance/purchasingrequisition/add.vue +++ b/src/views/finance/purchasingrequisition/add.vue @@ -229,12 +229,28 @@ - - + + + + + + + + + + + + + + + + + + @@ -482,6 +498,8 @@ 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 { fetchList as getBusinessLeaderList} from '/@/api/purchase/purchasingBusinessLeader'; import { Session } from '/@/utils/storage'; import * as orderVue from '/@/api/order/order-key-vue'; @@ -598,6 +616,12 @@ const dataForm = reactive({ deptClassifyName: '', schoolLeaderUserId: '', schoolLeaderName: '', + // 业务分管校领导 + schoolBusinessLeaderUserId: '', + schoolBusinessLeaderName: '', + // 采购分管 + purchaseManagerUserId: '', + purchaseManagerName: '', // 其他材料(zip压缩包) otherMaterials: '', // 实施采购信息(查看时展示) @@ -619,6 +643,8 @@ const purchaseModeSchoolList = ref([]); const purchaseTypeUnionList = ref([]); const businessDeptList = ref([]); const schoolLeaderList = ref([]); +const purchasingManagerList = ref([]); +const businessLeaderList = ref([]); const loading = ref(false); const helpDialogVisible = ref(false); @@ -757,6 +783,11 @@ const schoolUnifiedPurchaseFormDisabled = computed(() => { // 特殊情况字典 value:0否 1紧急 2单一 3进口 const isUrgentSpecial = computed(() => dataForm.isSpecial === '1'); +// 是否为特殊情况(非0即为特殊情况:紧急、单一、进口) +const isSpecialCase = computed(() => { + return dataForm.isSpecial && dataForm.isSpecial !== '0'; +}); + // 第二步标题 const stepTwoTitle = computed(() => { return isDeptPurchase.value ? '部门自行采购' : '学校统一采购'; @@ -1112,7 +1143,37 @@ const dataRules = reactive({ validator: (_rule: any, value: string, callback: (e?: Error) => void) => { if (!isDeptPurchase.value) { if (!value || String(value).trim() === '') { - callback(new Error('请选择分管校领导')); + callback(new Error('请选择校党委')); + return; + } + } + callback(); + }, + trigger: 'change' + } + ], + schoolBusinessLeaderUserId: [ + { + validator: (_rule: any, value: string, callback: (e?: Error) => void) => { + // 仅非特殊情况时校验 + if (!isDeptPurchase.value && !isSpecialCase.value) { + if (!value || String(value).trim() === '') { + callback(new Error('请选择业务分管校领导')); + return; + } + } + callback(); + }, + trigger: 'change' + } + ], + purchaseManagerUserId: [ + { + validator: (_rule: any, value: string, callback: (e?: Error) => void) => { + // 仅特殊情况时校验 + if (!isDeptPurchase.value && isSpecialCase.value) { + if (!value || String(value).trim() === '') { + callback(new Error('请选择采购分管校领导')); return; } } @@ -1190,6 +1251,10 @@ async function loadDetail(applyId: string | number) { deptClassifyName: detail.deptClassifyName ?? '', schoolLeaderUserId: detail.schoolLeaderUserId ?? '', schoolLeaderName: detail.schoolLeaderName ?? '', + schoolBusinessLeaderUserId: detail.schoolBusinessLeaderUserId ?? '', + schoolBusinessLeaderName: detail.schoolBusinessLeaderName ?? '', + purchaseManagerUserId: detail.purchaseManagerUserId ?? '', + purchaseManagerName: detail.purchaseManagerName ?? '', otherMaterials: detail.otherMaterials ?? '', implementType: detail.implementType ?? '', fileFlowInstId: detail.fileFlowInstId ?? '', @@ -1468,6 +1533,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 +1567,43 @@ 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 getBusinessLeaderListData = async () => { + try { + const res = await getBusinessLeaderList({ size: 1000 }); // 获取所有数据 + if (res.data && res.data.records) { + businessLeaderList.value = res.data.records.map((item: any) => ({ + id: item.id, + userId: item.userId, + name: item.name, + username: item.username + })); + } + } catch (err) { + console.error('获取业务分管校领导列表失败:', err); + businessLeaderList.value = []; + } +}; + // 处理业务分管处室选择变化 const handleBusinessDeptChange = (value: string) => { if (value) { @@ -1521,6 +1632,34 @@ 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 = ''; + } +}; + +// 处理业务分管校领导选择变化 +const handleBusinessLeaderChange = (value: string) => { + if (value) { + const selected = businessLeaderList.value.find(item => item.userId === value); + if (selected) { + dataForm.schoolBusinessLeaderUserId = selected.userId; + dataForm.schoolBusinessLeaderName = selected.name || ''; + } + } else { + dataForm.schoolBusinessLeaderUserId = ''; + dataForm.schoolBusinessLeaderName = ''; + } +}; + // 处理文件ID字符串或对象数组转ID数组 // 支持:逗号分隔的字符串、字符串数组、{ id, name? }[](编辑回填时的格式) const getFileIdsArray = (fileIds: string | string[] | { id?: string; name?: string }[]): string[] => { @@ -1801,6 +1940,8 @@ onMounted(async () => { getPurchaseTypeUnionDict(), getBusinessDeptListData(), getSchoolLeaderListData(), + getPurchasingManagerListData(), + getBusinessLeaderListData(), ]); // 编辑/查看:从 URL 或流程 currJob.orderId 加载详情 diff --git a/src/views/purchase/purchasingBusinessLeader/form.vue b/src/views/purchase/purchasingBusinessLeader/form.vue new file mode 100644 index 0000000..d88a7b8 --- /dev/null +++ b/src/views/purchase/purchasingBusinessLeader/form.vue @@ -0,0 +1,182 @@ + + + + + \ No newline at end of file diff --git a/src/views/purchase/purchasingBusinessLeader/index.vue b/src/views/purchase/purchasingBusinessLeader/index.vue new file mode 100644 index 0000000..253c48d --- /dev/null +++ b/src/views/purchase/purchasingBusinessLeader/index.vue @@ -0,0 +1,240 @@ + + + + + \ No newline at end of file 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