diff --git a/.env.development b/.env.development index faff5a9..eb8185a 100644 --- a/.env.development +++ b/.env.development @@ -6,7 +6,7 @@ VITE_APP_ENV = 'development' # 开发环境 # 李陈杰 209 -VITE_APP_BASE_API = 'http://192.168.110.210:8899' +VITE_APP_BASE_API = 'http://192.168.110.188:8899' # 曾涛 # VITE_APP_BASE_API = 'http://192.168.110.180:8899' # 罗成 diff --git a/src/api/design/volumeCatalog/index.ts b/src/api/design/volumeCatalog/index.ts index c7c3a01..be533ae 100644 --- a/src/api/design/volumeCatalog/index.ts +++ b/src/api/design/volumeCatalog/index.ts @@ -116,6 +116,17 @@ export const getileDetail = (id) => { method: 'get' }); }; +/** + * 获取专业列表 + * @param query + */ +export const majorList = (params) => { + return request({ + url: '/design/volumeCatalog/majorList', + method: 'get', + params: params + }); +}; /** * 获取二维码信息 * @param query diff --git a/src/components/Process/submitVerify.vue b/src/components/Process/submitVerify.vue index f678b11..3fefa25 100644 --- a/src/components/Process/submitVerify.vue +++ b/src/components/Process/submitVerify.vue @@ -546,7 +546,7 @@ const handleTerminationTask = async () => { if (isDrawing.value) { isShowTermination.value = true; nextTick(() => { - detailFormTeRef.value.getInfo(props.businessId); + detailFormTeRef.value.getInfo(props.businessId1); }); return; } diff --git a/src/views/biddingManagemen/appointment/index.vue b/src/views/biddingManagemen/appointment/index.vue index 835b495..a76ea00 100644 --- a/src/views/biddingManagemen/appointment/index.vue +++ b/src/views/biddingManagemen/appointment/index.vue @@ -21,7 +21,7 @@
diff --git a/src/views/cory/template/indexEdit.vue b/src/views/cory/template/indexEdit.vue index 91e3fe6..8c689fe 100644 --- a/src/views/cory/template/indexEdit.vue +++ b/src/views/cory/template/indexEdit.vue @@ -36,7 +36,7 @@ - + @@ -45,12 +45,42 @@ + + + + + + + + + + + + + + + + + - + @@ -62,27 +92,11 @@ - - - - - - - - - - - 上传附件 - - - - - - - - + + + 上传附件 + - @@ -177,6 +191,7 @@ import { useUserStoreHook } from '@/store/modules/user'; import { listByIds } from '@/api/system/oss'; import { addContactnotice, getContactnotice, updateContactnotice } from '@/api/cory/contactnotice'; const { des_user_major } = toRefs(proxy?.useDict('des_user_major')); +import { catalogList } from '@/api/design/designChange'; // 获取用户 store const userStore = useUserStoreHook(); @@ -221,7 +236,7 @@ const initFormData = { id: undefined, projectId: currentProject.value?.id, projectType: '', - projectName: '', + projectName: currentProject.value?.name, serialNumber: '', to: '', subject: '', @@ -275,13 +290,27 @@ const handleClose = () => { buttonLoading.value = false; }; const { form, rules } = toRefs(data); - +const volumeCatalogList = ref([]); +let volumeMap = new Map(); /** 表单重置 */ const reset = () => { form.value = { ...initFormData }; leaveFormRef.value?.resetFields(); }; - +// 获取卷册号列表 +const getJuance = async () => { + const res = await catalogList(currentProject.value?.id); + volumeCatalogList.value = res.data; + volumeCatalogList.value.forEach((e) => { + volumeMap.set(e.volumeNumber, e); + }); +}; +const handleSelect = (val) => { + let obj = volumeMap.get(val); + console.log(obj); + form.value.volumeName = obj.documentName; + form.value.specialty = obj.specialty; +}; /** 获取详情 */ const getInfo = () => { loading.value = true; @@ -402,6 +431,7 @@ onMounted(() => { routeParams.value = proxy.$route.query; thumbnailUrl.value = proxy.$route.query.thumbnailUrl; reset(); + getJuance(); loading.value = false; if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') { getInfo(); diff --git a/src/views/design/appointment/index.vue b/src/views/design/appointment/index.vue index 54d4f92..58cc90f 100644 --- a/src/views/design/appointment/index.vue +++ b/src/views/design/appointment/index.vue @@ -76,7 +76,7 @@ label-width="60px" label="专业" > - - - - - { if (valid) { buttonLoading.value = true; var res; + delete form.value.id; res = await addDesignChange({ ...form.value, changeReason, saveFile }).finally(() => (buttonLoading.value = false)); if (res.code == 200) { + routeParams.value.type = 'update'; + form.value = res.data; if (form.value.costEstimation == '0') { ElMessage.success('通知成功'); goBack(); diff --git a/src/views/design/volumeCatalog/index.vue b/src/views/design/volumeCatalog/index.vue index fa340e5..f7d77df 100644 --- a/src/views/design/volumeCatalog/index.vue +++ b/src/views/design/volumeCatalog/index.vue @@ -99,17 +99,22 @@ - + - - + + - + @@ -146,13 +151,7 @@ /> - + @@ -254,6 +253,7 @@ import { addVolumeCatalog, updateVolumeCatalog, uploadVolumeFile, + majorList, getVolumeCatafileList, volumeFileList } from '@/api/design/volumeCatalog'; @@ -264,9 +264,10 @@ import TableContent from './comm/tableContent.vue'; const fileList = ref([]); import { designUserList } from '@/api/design/appointment'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; -const { design_state, wf_business_status, des_user_major } = toRefs(proxy?.useDict('design_state', 'wf_business_status', 'des_user_major')); +const { design_state, wf_business_status } = toRefs(proxy?.useDict('design_state', 'wf_business_status')); import { drawingreviewReceiptsDetail, drawingreviewReceiptsList } from '@/api/design/drawingreview'; const volumeCatalogList = ref([]); +const des_user_major = ref([]); const buttonLoading = ref(false); const loading = ref(true); const showSearch = ref(true); @@ -356,13 +357,28 @@ const data = reactive({ rules: { design: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }], projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }], + designSubitem: [{ required: true, message: '子项不能为空', trigger: 'blur' }], volumeNumber: [{ required: true, message: '卷册号不能为空', trigger: 'blur' }], - documentName: [{ required: true, message: '资料名称不能为空', trigger: 'blur' }] + documentName: [{ required: true, message: '资料名称不能为空', trigger: 'blur' }], + plannedCompletion: [{ required: true, message: '计划出图事件不能为空', trigger: 'blur' }], + principal: [{ required: true, message: '设计人员不能为空', trigger: 'blur' }], + specialty: [{ required: true, message: '专业不能为空', trigger: 'blur' }] } }); const { queryParams, form, rules } = toRefs(data); - +const changeSpecialty = (val) => { + form.value.principal = ''; //清空 + getUserAppList(val); +}; +// 获取专业列表 +const getSpecialtyList = async () => { + const res = await majorList({ projectId: currentProject.value?.id, userType: 2 }); + console.log(res); + if (res.code === 200) { + des_user_major.value = res.data; + } +}; /** 查询卷册目录列表 */ const getList = async () => { loading.value = true; @@ -374,17 +390,10 @@ const getList = async () => { loading.value = false; } }; -const getUserAppList = async () => { - const res = await designUserList({ projectId: currentProject.value?.id }); +const getUserAppList = async (userMajor) => { + const res = await designUserList({ projectId: currentProject.value?.id, userType: 2, userMajor }); if (res.code === 200) { - console.log(res.rows); - - res.rows.forEach((item: any) => { - if (item.userType == 2) { - //设计人员 - userAppList.value.push(item); - } - }); + userAppList.value = res.rows; } }; const handleViewHistory = async (row) => { @@ -647,7 +656,7 @@ const handleAuditInfo = (row) => { // 审核图纸 }; onMounted(() => { - getUserAppList(); + getSpecialtyList(); getList(); }); @@ -657,7 +666,7 @@ const listeningProject = watch( (nid, oid) => { queryParams.value.projectId = nid; form.value.projectId = nid; - getUserAppList(); + getSpecialtyList(); getList(); } ); diff --git a/src/views/materials/batchPlan/index.vue b/src/views/materials/batchPlan/index.vue index f0efdf6..f73db21 100644 --- a/src/views/materials/batchPlan/index.vue +++ b/src/views/materials/batchPlan/index.vue @@ -125,7 +125,7 @@ - + @@ -144,24 +150,21 @@ - + @@ -231,7 +234,7 @@ import { } from '@/api/materials/batchPlan'; import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/batchPlan/types'; import { useUserStoreHook } from '@/store/modules/user'; -import { getCurrentInstance, ComponentInternalInstance, watch, onMounted, onUnmounted } from 'vue'; +import { getCurrentInstance, ComponentInternalInstance, watch, onMounted, onUnmounted, computed } from 'vue'; import type { ElFormInstance } from 'element-plus'; // 类型定义补充 @@ -294,7 +297,7 @@ const dialog = reactive({ title: '' }); -// 初始化表单数据(补充版本号、重复错误提示字段) +// 初始化表单数据 const initFormData: FormData = { mrpBaseBo: { id: undefined, @@ -315,10 +318,10 @@ const initFormData: FormData = { qs: undefined, arrivalTime: undefined, remark: undefined, - Remaining: 0, // 初始化剩余量 - quantityError: '', // 初始化数量错误提示 - batchNumber: undefined, // 初始化版本号 - duplicateError: '', // 初始化重复错误提示 + Remaining: 0, + quantityError: '', + batchNumber: undefined, + duplicateError: '', mrpBaseId: undefined } ] @@ -382,7 +385,7 @@ const validateDemandQuantity = (row: PlanListItem, index: number) => { // 1. 清除之前的错误信息 row.quantityError = ''; - // 2. 处理空值(若需必填可补充:row.quantityError = '数量不能为空') + // 2. 处理空值 if (row.demandQuantity === null || row.demandQuantity === undefined || row.demandQuantity === '') { return; } @@ -418,42 +421,20 @@ const getMrpBaseRemaining = async (suppliespriceId: number, row: PlanListItem) = } }; -/** 校验重复数据:版本号+物资名称不能重复 */ -const checkDuplicate = () => { - const planList = form.value.planList; - let hasDuplicate = false; +/** 获取可用物资列表(过滤已选选项) */ +const getAvailableNameList = (currentIndex: number) => { + // 收集除当前行外已选中的物资ID + const selectedIds = form.value.planList + .filter((_, index) => index !== currentIndex) + .map(item => item.suppliespriceId) + .filter(id => id !== undefined && id !== null); - // 1. 清除所有重复错误提示 - planList.forEach((item) => { - item.duplicateError = ''; - }); - - // 2. 遍历校验重复(只校验版本号和物资名称都存在的行) - for (let i = 0; i < planList.length; i++) { - const current = planList[i]; - // 跳过版本号或物资名称为空的行 - if (!current.batchNumber || !current.suppliespriceId) continue; - - for (let j = i + 1; j < planList.length; j++) { - const compare = planList[j]; - if (!compare.batchNumber || !compare.suppliespriceId) continue; - - // 版本号和物资ID都相同则判定为重复 - if (current.batchNumber === compare.batchNumber && current.suppliespriceId === compare.suppliespriceId) { - current.duplicateError = `与第${j + 1}行重复(同版本+同物资)`; - compare.duplicateError = `与第${i + 1}行重复(同版本+同物资)`; - hasDuplicate = true; - } - } - } - - return hasDuplicate; + // 过滤掉已选中的物资 + return nameList.value.filter(item => !selectedIds.includes(item.id)); }; -/** 选择物资名称触发(新增索引参数,用于触发重复校验) */ +/** 选择物资名称触发 */ const selectName = (val: number, row: PlanListItem, index: number) => { - console.log(row); - // 1. 获取剩余量并更新基础信息 getMrpBaseRemaining(val, row).then(() => { const selected = nameList.value.find((item: any) => item.id === val); @@ -465,9 +446,6 @@ const selectName = (val: number, row: PlanListItem, index: number) => { row.remark = selected.remark || ''; row.arrivalTime = selected.arrivalTime || ''; } - - // 2. 触发重复校验 - checkDuplicate(); }); }; @@ -506,8 +484,6 @@ const delRow = (index: number) => { return proxy?.$modal.msgWarning('请至少保留一项物资数据'); } form.value.planList.splice(index, 1); - // 删除后重新校验重复(避免删除重复行后错误提示残留) - checkDuplicate(); }; /** 新增表格行 */ @@ -569,15 +545,15 @@ const handleUpdata = () => { if (!queryParams.value.mainData.mrpBaseId) { return proxy?.$modal.msgError('请先选择批次'); } - // 1. 获取对应版本的物资列表 + // 获取对应版本的物资列表 reset(); loading.value = true; getCailiaoshebei(queryParams.value.mainData.mrpBaseId) .then((res: any) => { - // 1. 更新基础信息 + // 更新基础信息 form.value.mrpBaseBo = res.data.mrpBaseBo || initFormData.mrpBaseBo; - // 2. 更新表格数据(补充缺失字段) + // 更新表格数据(补充缺失字段) form.value.planList = (res.data.planList || []).map((item: any) => ({ id: item.id, name: item.name, @@ -589,13 +565,12 @@ const handleUpdata = () => { arrivalTime: item.arrivalTime, remark: item.remark, Remaining: Number(item.remaining) || 0, - // remaining: quantityError: '', batchNumber: item.batchNumber, duplicateError: '', mrpBaseId: item.mrpBaseId })); - // 3. 打开对话框 + // 打开对话框 dialog.visible = true; dialog.title = '修改物资-需求'; }) @@ -609,38 +584,32 @@ const handleUpdata = () => { /** 提交数据(整合所有校验) */ const submitTransferForm = async () => { - // 1. 先校验重复数据 - const hasDuplicate = checkDuplicate(); - if (hasDuplicate) { - return proxy?.$modal.msgError('存在重复的版本号+物资组合,请修正后提交'); - } - - // 2. 校验数量合法性(检查是否有数量错误) + // 1. 校验数量合法性(检查是否有数量错误) const hasQuantityError = form.value.planList.some((row) => row.quantityError); if (hasQuantityError) { return proxy?.$modal.msgError('存在非法数量,请修正后提交'); } - // 3. 执行表单基础验证 + // 2. 执行表单基础验证 const result = validateAndClean(form.value.planList); if (!result.valid) { return proxy?.$modal.msgError(result.message); } - // 4. 表单组件验证 + // 3. 表单组件验证 cailiaoshebeiFormRef.value?.validate(async (valid: boolean) => { if (!valid) return; buttonLoading.value = true; try { - // 5. 提交数据 + // 4. 提交数据 await updateCailiaoshebei({ ...form.value, planList: result.data // 使用清洗后的数据 }); proxy?.$modal.msgSuccess('操作成功'); dialog.visible = false; - // 6. 刷新列表 + // 5. 刷新列表 await getList(); } catch (error) { proxy?.$modal.msgError('操作失败,请重试'); @@ -765,7 +734,7 @@ const getVersion = () => { }); }; -/** 选择版本号触发(新增索引参数,用于触发重复校验) */ +/** 选择版本号触发 */ const selectNameVersion = (val: string, row: PlanListItem, index: number) => { row.batchNumber = val; row.suppliespriceId = undefined; // 切换版本号时清空物资选择 @@ -780,11 +749,8 @@ const selectNameVersion = (val: string, row: PlanListItem, index: number) => { row.duplicateError = ''; row.mrpBaseId = ''; - // 1. 获取对应版本的物资列表 + // 获取对应版本的物资列表 getNameList(val); - - // 2. 触发重复校验(清空物资后可能消除重复) - checkDuplicate(); }; /** 页面挂载时初始化 */ diff --git a/src/views/materials/materialsEquipment/materialIssue/index.vue b/src/views/materials/materialsEquipment/materialIssue/index.vue index 1a0e899..37efac6 100644 --- a/src/views/materials/materialsEquipment/materialIssue/index.vue +++ b/src/views/materials/materialsEquipment/materialIssue/index.vue @@ -7,9 +7,6 @@ - - - @@ -45,7 +42,6 @@ - @@ -82,7 +78,7 @@ - + @@ -295,7 +291,7 @@ const getInitFormData = () => { projectId: currentProject.value?.id, materialSource: '1', formCode: undefined, - projectName: undefined, + projectName: currentProject.value?.name, materialName: '', // 初始化为空字符串 orderingUnit: undefined, supplierUnit: undefined, diff --git a/src/views/materials/materialsEquipment/materialReceive/index.vue b/src/views/materials/materialsEquipment/materialReceive/index.vue index 78d9741..3f1d4c0 100644 --- a/src/views/materials/materialsEquipment/materialReceive/index.vue +++ b/src/views/materials/materialsEquipment/materialReceive/index.vue @@ -1,20 +1,23 @@