diff --git a/.env.development b/.env.development index 4c056ae..ee7d06f 100644 --- a/.env.development +++ b/.env.development @@ -6,7 +6,7 @@ VITE_APP_ENV = 'development' # 开发环境 # 李陈杰 209 -# VITE_APP_BASE_API = 'http://192.168.110.209:8899' +VITE_APP_BASE_API = 'http://192.168.110.149:8899' # 曾涛 VITE_APP_BASE_API = 'http://192.168.110.180:8899' # 罗成 diff --git a/public/catalog.xlsx b/public/catalog.xlsx new file mode 100644 index 0000000..1cca466 Binary files /dev/null and b/public/catalog.xlsx differ diff --git a/public/enterRoad.xlsx b/public/enterRoad.xlsx new file mode 100644 index 0000000..b7f00ac Binary files /dev/null and b/public/enterRoad.xlsx differ diff --git a/public/landBlock.xlsx b/public/landBlock.xlsx new file mode 100644 index 0000000..25d39e0 Binary files /dev/null and b/public/landBlock.xlsx differ diff --git a/src/api/formalities/formalitiesAreConsolidated/index.ts b/src/api/formalities/formalitiesAreConsolidated/index.ts index 218187c..f6db0c1 100644 --- a/src/api/formalities/formalitiesAreConsolidated/index.ts +++ b/src/api/formalities/formalitiesAreConsolidated/index.ts @@ -5,6 +5,7 @@ import { FormalitiesAreConsolidatedForm, FormalitiesAreConsolidatedQuery } from '@/api/formalities/formalitiesAreConsolidated/types'; +import { ListOfFormalitiesQuery, ListOfFormalitiesVO } from '../listOfFormalities/types'; /** * 查询合规性手续合账列表 @@ -101,3 +102,17 @@ export const delFormalitiesAnnex = (id: string | number | Array method: 'delete' }); }; + +/** + * 查询手续办理清单模板属性列表 + * @param query + * @returns {*} + */ + +export const getTemplateTreeList = (query?: any): AxiosPromise => { + return request({ + url: '/formalities/formalitiesAreConsolidated/getTree', + method: 'get', + params: query + }); +}; diff --git a/src/api/progress/progressCategoryTemplate/index.ts b/src/api/progress/progressCategoryTemplate/index.ts index 3e80694..5743b83 100644 --- a/src/api/progress/progressCategoryTemplate/index.ts +++ b/src/api/progress/progressCategoryTemplate/index.ts @@ -1,6 +1,10 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; -import { ProgressCategoryTemplateVO, ProgressCategoryTemplateForm, ProgressCategoryTemplateQuery } from '@/api/progress/progressCategoryTemplate/types'; +import { + ProgressCategoryTemplateVO, + ProgressCategoryTemplateForm, + ProgressCategoryTemplateQuery +} from '@/api/progress/progressCategoryTemplate/types'; /** * 查询进度类别模版列表 @@ -61,3 +65,10 @@ export const delProgressCategoryTemplate = (id: string | number | Array { + return request({ + url: '/progress/progressCategoryTemplate/listSystemTop', + method: 'get' + }); +}; diff --git a/src/api/system/landTransfer/enterRoad/index.ts b/src/api/system/landTransfer/enterRoad/index.ts index c3e093c..a575127 100644 --- a/src/api/system/landTransfer/enterRoad/index.ts +++ b/src/api/system/landTransfer/enterRoad/index.ts @@ -61,3 +61,12 @@ export const delEnterRoad = (id: string | number | Array) => { method: 'delete' }); }; + +// 道路信息导入 +export const importEnterRoad = (projectId: any, data: any) => { + return request({ + url: '/land/enterRoad/upload/' + projectId, + method: 'post', + data: data + }); +}; \ No newline at end of file diff --git a/src/api/system/landTransfer/landBlock/index.ts b/src/api/system/landTransfer/landBlock/index.ts index d543334..06e3aad 100644 --- a/src/api/system/landTransfer/landBlock/index.ts +++ b/src/api/system/landTransfer/landBlock/index.ts @@ -76,3 +76,12 @@ export const delLandBlock = (id: string | number | Array) => { method: 'delete' }); }; + +// 地块信息导入 +export const importLandBlock = (projectId:any,data: any) => { + return request({ + url: '/land/landBlock/upload/'+projectId, + method: 'post', + data: data + }); +}; diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue index 5011b9d..b2580ea 100644 --- a/src/components/FileUpload/index.vue +++ b/src/components/FileUpload/index.vue @@ -48,7 +48,13 @@ tag="ul" @click.stop > -
  • +
  • {{ getFileName(file.name) }} @@ -213,31 +219,27 @@ watch( ); // 上传前校检格式和大小 const handleBeforeUpload = (file: any) => { - // 校检文件类型 - if (props.fileType.length) { - const fileName = file.name.split('.'); - const fileExt = fileName[fileName.length - 1]; - const isTypeOk = props.fileType.indexOf(fileExt) >= 0; - if (!isTypeOk) { - proxy?.$modal.msgError(`文件格式不正确, 请上传${props.fileType.join('/')}格式文件!`); - return false; - } + if (!validateFile(file)) return false; + proxy?.$modal.loading('正在上传文件,请稍候...'); + number.value++; + return true; +}; + +//校检格式和大小 +const validateFile = (file: File) => { + const ext = file.name.split('.').pop()?.toLowerCase(); + if (props.fileType.length && !props.fileType.includes(ext!)) { + proxy?.$modal.msgError(`文件格式不正确,请上传 ${props.fileType.join('/')} 格式文件!`); + return false; } - // 校检文件名是否包含特殊字符 if (file.name.includes(',')) { proxy?.$modal.msgError('文件名不正确,不能包含英文逗号!'); return false; } - // 校检文件大小 - if (props.fileSize) { - const isLt = file.size / 1024 / 1024 < props.fileSize; - if (!isLt) { - proxy?.$modal.msgError(`上传文件大小不能超过 ${props.fileSize} MB!`); - return false; - } + if (props.fileSize && file.size / 1024 / 1024 > props.fileSize) { + proxy?.$modal.msgError(`上传文件大小不能超过 ${props.fileSize} MB!`); + return false; } - proxy?.$modal.loading('正在上传文件,请稍候...'); - number.value++; return true; }; @@ -278,13 +280,25 @@ const handleUploadSuccess = (res: any, file: UploadFileWithOssId) => { uploadedSuccessfully(res); }; -const handleChange = (file: any, fileList: any) => { +const handleChange = (file: any, filelist: any) => { + if (!props.autoUpload) { + // 手动上传模式:在选中文件时拦截非法文件 + const isValid = validateFile(file.raw || file); + if (!isValid) { + fileUploadRef.value?.handleRemove(file); // 直接移除非法文件 + console.log(file, filelist, fileList.value); + fileList.value = [...fileList.value]; // 触发列表更新 + return; + } + } // 记录 status = 'ready' 的文件 if (file.status === 'ready') { pendingFiles.value.push(file); + fileList.value = pendingFiles.value; } + console.log(fileList.value); - emit('handleChange', file, fileList); + emit('handleChange', file, filelist); }; // 删除文件 @@ -332,11 +346,6 @@ const uploadedSuccessfully = (res: any) => { emit('update:modelValue', listToString(fileList.value)); proxy?.$modal.closeLoading(); } - // if (props.autoUpload && props.limit === fileList.value.length) { - // fileUploadRef.value?.clearFiles(); - // fileList.value = []; - // emit('update:modelValue', ''); // 同步到外部 v-model - // } props.onUploadSuccess?.(fileList.value, res); }; @@ -400,6 +409,11 @@ const submitUpload = async () => { if (!pendingFiles.value.length) { return 'noFile'; } + const validFiles = pendingFiles.value.filter((f: any) => validateFile(f.raw || f)); + if (!validFiles.length) { + proxy?.$modal.msgError('没有符合条件的文件可上传'); + return; + } try { proxy?.$modal.loading('正在上传文件,请稍候...'); const formData = new FormData(); diff --git a/src/views/contract/limitPrice/indexEdit.vue b/src/views/contract/limitPrice/indexEdit.vue index 0fa89b0..facd683 100644 --- a/src/views/contract/limitPrice/indexEdit.vue +++ b/src/views/contract/limitPrice/indexEdit.vue @@ -70,12 +70,8 @@ diff --git a/src/views/design/Professional/index.vue b/src/views/design/Professional/index.vue index bb795fe..6726936 100644 --- a/src/views/design/Professional/index.vue +++ b/src/views/design/Professional/index.vue @@ -187,7 +187,7 @@ const handleDownload = (row) => { { id: row.id }, - `互提资料.zip` + `互提资料.docx` ); }; const handleViewFile = (row) => { diff --git a/src/views/design/condition/comm/filePage.vue b/src/views/design/condition/comm/filePage.vue index df3d89d..1a69993 100644 --- a/src/views/design/condition/comm/filePage.vue +++ b/src/views/design/condition/comm/filePage.vue @@ -17,7 +17,13 @@ - + + + @@ -607,6 +610,24 @@ const getVolumeFileList = async (type) => { fileList.value = res.rows; } }; +const exportFile = () => { + // 导出模版文件 + try { + // 创建a标签 + const link = document.createElement('a'); + // 设置PDF文件路径 - 相对于public目录 + link.href = '/catalog.xlsx'; + // 设置下载后的文件名 + link.download = '设计出图计划导入模版.xlsx'; + // 触发点击 + document.body.appendChild(link); + link.click(); + // 清理 + document.body.removeChild(link); + } catch (error) { + alert('下载失败,请重试'); + } +}; // 切换 const handleClick = (val) => { getVolumeFileList(val.props.name); diff --git a/src/views/formalities/formalitiesAreConsolidated/index.vue b/src/views/formalities/formalitiesAreConsolidated/index.vue index ebeda55..f4918d9 100644 --- a/src/views/formalities/formalitiesAreConsolidated/index.vue +++ b/src/views/formalities/formalitiesAreConsolidated/index.vue @@ -46,6 +46,9 @@ + + + + + + @@ -225,7 +250,8 @@ import { updateFormalitiesAreConsolidated, listFormalitiesAnnex, delFormalitiesAnnex, - editStatus + editStatus, + getTemplateTreeList } from '@/api/formalities/formalitiesAreConsolidated'; import { FormalitiesAreConsolidatedVO, @@ -272,6 +298,8 @@ const statusForm = ref({ projectId: currentProject.value?.id, processingStatus: undefined }); +const templateVisbile = ref(false); +const tempTreeList = ref([]); const initFormData: FormalitiesAreConsolidatedForm = { id: undefined, @@ -307,6 +335,8 @@ const data = reactive { loading.value = true; @@ -367,6 +397,39 @@ const handleUpdate = async (row?: FormalitiesAreConsolidatedVO) => { dialog.title = '修改合规性手续合账'; }; +//新增 +const handleAdd = async () => { + tempValue.value = null; + const res = await getTemplateTreeList({ projectId: currentProject.value.id }); + tempTreeList.value = res.data; + templateVisbile.value = true; +}; + +// 选择模板 +const setTemp = async () => { + // form.value.formalitiesPid = tempValue.value[tempValue.value.length - 1]; + if (!tempValue.value || !tempValue.value.length) { + proxy?.$modal.msgWarning('请选择模板'); + return; + } + let addBusFormalitiesAreConsolidatedBos = tempValue.value.map((item) => { + return { + formalitiesId: item[1], + formalitiesPid: item[0] + }; + }); + const data = { + addBusFormalitiesAreConsolidatedBos, + projectId: currentProject.value.id + }; + const res = await addFormalitiesAreConsolidated(data); + if (res.code == 200) { + proxy?.$modal.msgSuccess('操作成功'); + templateVisbile.value = false; + getList(); + } +}; + /** 上传按钮操作 */ const handleUpload = (row) => { form.value.id = row.id; diff --git a/src/views/materials/batchPlan/index.vue b/src/views/materials/batchPlan/index.vue index bac3df0..8d8bdb1 100644 --- a/src/views/materials/batchPlan/index.vue +++ b/src/views/materials/batchPlan/index.vue @@ -6,20 +6,44 @@ - - + + - + @@ -36,12 +66,14 @@ + + + @@ -165,8 +203,10 @@ import { listBatch, getBatch, delBatch, - listSelectCailiaoshebei, obtainTheVersion, - getDictList, coryEngineeringList + listSelectCailiaoshebei, + obtainTheVersion, + getDictList, + coryEngineeringList } from '@/api/materials/batchPlan'; import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/batchPlan/types'; import { useUserStoreHook } from '@/store/modules/user'; @@ -392,11 +432,11 @@ const handleUpdata = () => { /** 提交数据 */ const submitTransferForm = async () => { const result = validateAndClean(form.value.planList); - console.log('🚀 ~ submitTransferForm ~ form.value.planList:', form.value.planList); if (!result.valid) { - proxy?.$modal.msgError('验证失败,主要信息存在部分字段缺失的数据项'); + proxy?.$modal.msgError(result.message); return; } + cailiaoshebeiFormRef.value?.validate(async (valid: boolean) => { if (valid) { buttonLoading.value = true; @@ -408,7 +448,6 @@ const submitTransferForm = async () => { } }); }; - /** 删除批次 */ const handleDeleteBatch = async () => { const _ids = batchTreeRef.value.getCurrentNode()?.id; @@ -419,29 +458,49 @@ const handleDeleteBatch = async () => { await getList(); }; -//检测主要信息填写状况 -function validateAndClean(arr) { +interface ValidateResult { + valid: boolean; + data: any[]; + errors: { index: number; field: string; message: string }[]; +} + +function validateAndClean(arr: any[]) { // 过滤掉全空的数据项 const cleanedArr = arr.filter((item) => !Object.values(item).every((v) => v === '' || v == null)); - let hasFullItem = false; // 是否有一条全填数据 - for (const item of cleanedArr) { + let hasFullItem = false; // 是否有至少一条全填数据 + + for (let idx = 0; idx < cleanedArr.length; idx++) { + const item = cleanedArr[idx]; const keys = Object.keys(item).filter((k) => k !== 'remark' && k !== 'id'); + const allFilled = keys.every((k) => item[k] !== '' && item[k] != null); - if (allFilled) { - hasFullItem = true; // 有一条全填 - } const allEmpty = Object.values(item).every((v) => v === '' || v == null); - // 如果不是全填,也不是全空(部分填) → 直接返回失败 + + // 单独检查 qs 和 arrivalTime + if (!item.qs) { + return { valid: false, message: `第${idx + 1}行:质量标准不能为空`, data: cleanedArr }; + } + if (!item.arrivalTime) { + return { valid: false, message: `第${idx + 1}行:需求到货时间不能为空`, data: cleanedArr }; + } + + // 检查其他字段是否部分填 if (!allFilled && !allEmpty) { - return { valid: false, data: cleanedArr }; + return { valid: false, message: `第${idx + 1}行:主要信息存在部分字段缺失的数据项`, data: cleanedArr }; + } + + if (allFilled) { + hasFullItem = true; } } - // 如果没有至少一条全填,返回失败 + + // 检查是否至少有一条完整的数据 if (!hasFullItem) { - return { valid: false, data: cleanedArr }; + return { valid: false, message: '至少需要一条完整的数据', data: cleanedArr }; } - return { valid: true, data: cleanedArr }; + + return { valid: true, message: '', data: cleanedArr }; } /** 审核按钮操作 */ diff --git a/src/views/materials/materialsEquipment/materialReceive/index.vue b/src/views/materials/materialsEquipment/materialReceive/index.vue index ab997cf..d7c1b27 100644 --- a/src/views/materials/materialsEquipment/materialReceive/index.vue +++ b/src/views/materials/materialsEquipment/materialReceive/index.vue @@ -1,7 +1,6 @@