From 94cd3f867d273b712e52810fe9bf46fb5d0329dd Mon Sep 17 00:00:00 2001 From: re-JZzzz Date: Tue, 30 Sep 2025 17:40:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=89=A9=E8=B5=84=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=A4=87=E4=BB=B6=E5=87=BA=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E6=80=BB=E8=A7=88=E5=8A=9F=E8=83=BD=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A1=E5=88=92=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加备件出入库总览API接口及前端展示 在采购计划单中增加设备类型字段及相关展示逻辑 优化文件上传组件处理逻辑 修复采购计划单表单验证及数据统计问题 移除备件管理页面多余操作按钮 --- src/api/wuziguanli/beijian/index.ts | 13 + src/api/wuziguanli/caigouPlan/types.ts | 12 + src/api/wuziguanli/churuku/index.ts | 2 + src/components/FileUpload/index.vue | 54 +--- .../components/detailInfo.vue | 7 +- .../materialManagement/components/upload.vue | 278 ++++++++++++++++ .../materialManagement/procurementPlan.vue | 296 ++++++++++++------ src/views/materialManagement/spareParts.vue | 24 +- 8 files changed, 534 insertions(+), 152 deletions(-) create mode 100644 src/views/materialManagement/components/upload.vue diff --git a/src/api/wuziguanli/beijian/index.ts b/src/api/wuziguanli/beijian/index.ts index a066032..f913945 100644 --- a/src/api/wuziguanli/beijian/index.ts +++ b/src/api/wuziguanli/beijian/index.ts @@ -61,3 +61,16 @@ export const delBeipinBeijian = (id: string | number | Array) = method: 'delete' }); }; + +/** + * 运维-物资-备件-查询总览 + * @param query + * @returns {*} + */ +export const chuRuKuTotal = (data:any): AxiosPromise => { + return request({ + url: '/ops/beipinBeijian/getCount', + method: 'get', + params: data + }); +}; \ No newline at end of file diff --git a/src/api/wuziguanli/caigouPlan/types.ts b/src/api/wuziguanli/caigouPlan/types.ts index 47f53b7..ea67c67 100644 --- a/src/api/wuziguanli/caigouPlan/types.ts +++ b/src/api/wuziguanli/caigouPlan/types.ts @@ -186,6 +186,10 @@ export interface CaigouPlanVO { * 供应商名称 */ gonyingshangName?: string; + /** + * 设备类型 + */ + shebeiType?: string; } @@ -376,6 +380,10 @@ export interface CaigouPlanForm extends BaseEntity { * 供应商名称 */ gonyingshangName?: string; + /** + * 设备类型 + */ + shebeiType?: string; } export interface CaigouPlanQuery extends PageQuery { @@ -567,6 +575,10 @@ export interface CaigouPlanQuery extends PageQuery { * 供应商名称 */ gonyingshangName?: string; + /** + * 设备类型 + */ + shebeiType?: string; } diff --git a/src/api/wuziguanli/churuku/index.ts b/src/api/wuziguanli/churuku/index.ts index 6037076..4a8b4d1 100644 --- a/src/api/wuziguanli/churuku/index.ts +++ b/src/api/wuziguanli/churuku/index.ts @@ -100,3 +100,5 @@ export const getChanpinLists = (data:any): AxiosPromise => { params: data }); }; + + diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue index e480c89..2347861 100644 --- a/src/components/FileUpload/index.vue +++ b/src/components/FileUpload/index.vue @@ -89,17 +89,6 @@ const showTip = computed(() => props.isShowTip && (props.fileType || props.fileS const fileUploadRef = ref(); -// 暴露方法给父组件 -defineExpose({ - // 清空所有文件 - clearAllFiles: () => { - fileList.value = []; - emit('update:modelValue', ''); - emit('update:fileList', []); - } -}); - - // 监听 fileType 变化,更新 fileAccept const fileAccept = computed(() => props.fileType.map((type) => `.${type}`).join(',')); @@ -110,28 +99,18 @@ watch( let temp = 1; // 首先将值转为数组 let list: any[] = []; - if (Array.isArray(val)) { - // 如果是数组,检查第一个元素的格式 - if (val.length > 0 && val[0].fileName && val[0].fileId && val[0].fileUrl) { - // 处理后端返回的格式 [{fileName,fileId,fileUrl}] - list = val.map(item => ({ - name: item.fileName, - url: item.fileUrl, - ossId: item.fileId - })); - } else { - // 处理组件内部格式 [{name,url,ossId}] - list = val; - } + list = val; } else { - // 处理字符串格式(逗号分隔的ossId) const res = await listByIds(val); list = res.data.map((oss) => { - return { name: oss.originalName, url: oss.url, ossId: oss.ossId }; + return { + name: oss.originalName, + url: oss.url, + ossId: oss.ossId + }; }); } - // 然后将数组转为对象数组 fileList.value = list.map((item) => { item = { name: item.name, url: item.url, ossId: item.ossId }; @@ -210,15 +189,7 @@ const handleDelete = (index: number) => { const ossId = fileList.value[index].ossId; delOss(ossId); fileList.value.splice(index, 1); - - // 转换为后端需要的格式 [{fileName,fileId,fileUrl}] - const formattedList = fileList.value.map(file => ({ - fileName: file.name, - fileId: file.ossId, - fileUrl: file.url - })); - - emit('update:modelValue', formattedList); + emit('update:modelValue', listToString(fileList.value)); }; // 上传结束处理 @@ -227,16 +198,7 @@ const uploadedSuccessfully = () => { fileList.value = fileList.value.filter((f) => f.url !== undefined).concat(uploadList.value); uploadList.value = []; number.value = 0; - - // 转换为后端需要的格式 [{fileName,fileId,fileUrl}] - const formattedList = fileList.value.map(file => ({ - fileName: file.name, - fileId: file.ossId, - fileUrl: file.url - })); - - emit('update:modelValue', formattedList); - emit('update:fileList', fileList.value); + emit('update:modelValue', listToString(fileList.value)); proxy?.$modal.closeLoading(); } }; diff --git a/src/views/materialManagement/components/detailInfo.vue b/src/views/materialManagement/components/detailInfo.vue index 45d996e..b0fa765 100644 --- a/src/views/materialManagement/components/detailInfo.vue +++ b/src/views/materialManagement/components/detailInfo.vue @@ -25,6 +25,11 @@ + + + @@ -80,7 +85,7 @@ const props = defineProps<{ }>(); const { proxy } = getCurrentInstance() as ComponentInternalInstance; -const { wz_invoicing_way, wz_payment_terms, wz_purchase_type, wz_contract_type } = toRefs(proxy?.useDict('wz_invoicing_way', 'wz_payment_terms', 'wz_purchase_type', 'wz_contract_type', 'wz_caigou_examine')); +const { wz_invoicing_way, wz_payment_terms, wz_purchase_type, wz_contract_type, wz_device_type } = toRefs(proxy?.useDict('wz_device_type','wz_invoicing_way', 'wz_payment_terms', 'wz_purchase_type', 'wz_contract_type', 'wz_caigou_examine', 'wz_device_type')); diff --git a/src/views/materialManagement/components/upload.vue b/src/views/materialManagement/components/upload.vue new file mode 100644 index 0000000..48b9fc8 --- /dev/null +++ b/src/views/materialManagement/components/upload.vue @@ -0,0 +1,278 @@ + + + + + diff --git a/src/views/materialManagement/procurementPlan.vue b/src/views/materialManagement/procurementPlan.vue index 97984d0..e9455f9 100644 --- a/src/views/materialManagement/procurementPlan.vue +++ b/src/views/materialManagement/procurementPlan.vue @@ -136,6 +136,7 @@ +
@@ -221,6 +222,14 @@ + + + -