From cee3aa81a1f6c78bd8568ba24ee1c433fd7897cd Mon Sep 17 00:00:00 2001 From: "1378012178@qq.com" <1378012178@qq.com> Date: Thu, 26 Mar 2026 15:15:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=96=99=E5=88=86=E7=B1=BB=E3=80=81?= =?UTF-8?q?=E7=89=A9=E6=96=99=E4=BF=A1=E6=81=AF=E5=AF=BC=E5=85=A5=E5=8F=8A?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E6=A8=A1=E6=9D=BF=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../elderinfo/components/ElderInfoForm.vue | 110 ++++++++++-------- .../ConfigMaterial/ConfigMaterialInfo.api.ts | 53 +++++---- .../ConfigMaterial/ConfigMaterialInfoList.vue | 61 ++++++---- .../components/ConfigMaterialInfoForm.vue | 6 +- 4 files changed, 140 insertions(+), 90 deletions(-) diff --git a/src/views/elder/elderinfo/components/ElderInfoForm.vue b/src/views/elder/elderinfo/components/ElderInfoForm.vue index 64c7d01..2973c5a 100644 --- a/src/views/elder/elderinfo/components/ElderInfoForm.vue +++ b/src/views/elder/elderinfo/components/ElderInfoForm.vue @@ -25,46 +25,68 @@ - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -115,13 +137,8 @@ - - - - - - + + @@ -129,7 +146,8 @@ + id="ElderInfoForm-guardianIdCardPositive" name="guardianIdCardPositive" :labelCol="labelCol2" + :wrapperCol="wrapperCol2"> diff --git a/src/views/invoicing/ConfigMaterial/ConfigMaterialInfo.api.ts b/src/views/invoicing/ConfigMaterial/ConfigMaterialInfo.api.ts index b410897..09badc1 100644 --- a/src/views/invoicing/ConfigMaterial/ConfigMaterialInfo.api.ts +++ b/src/views/invoicing/ConfigMaterial/ConfigMaterialInfo.api.ts @@ -1,30 +1,43 @@ import { defHttp } from '/@/utils/http/axios'; -import { useMessage } from "/@/hooks/web/useMessage"; +import { useMessage } from '/@/hooks/web/useMessage'; const { createConfirm } = useMessage(); enum Api { list = '/invoicing/configMaterialInfo/list', - save='/invoicing/configMaterialInfo/add', - edit='/invoicing/configMaterialInfo/edit', - editInfo='/invoicing/configMaterialInfo/editInfo', - wlqianyi='/invoicing/configMaterialInfo/wlqianyi', + save = '/invoicing/configMaterialInfo/add', + edit = '/invoicing/configMaterialInfo/edit', + editInfo = '/invoicing/configMaterialInfo/editInfo', + wlqianyi = '/invoicing/configMaterialInfo/wlqianyi', deleteOne = '/invoicing/configMaterialInfo/delete', deleteBatch = '/invoicing/configMaterialInfo/deleteBatch', - importExcel = '/invoicing/configMaterialInfo/importExcel', - exportXls = '/invoicing/configMaterialInfo/exportXls', + importMateriallInfo = '/invoicing/configMaterialInfo/importMateriallInfo', + importType = '/invoicing/configMaterialInfo/importType', + exportTypeExcel = '/invoicing/configMaterialInfo/exportTypeExcel', + exportMateriallInfoExcel = '/invoicing/configMaterialInfo/exportMateriallInfoExcel', } /** - * 导出api + * 物料分类导入模板下载 * @param params */ -export const getExportUrl = Api.exportXls; +export const exportTypeExcel = Api.exportTypeExcel; /** - * 导入api + * 物料信息导入模板下载 + * @param params */ -export const getImportUrl = Api.importExcel; +export const exportMateriallInfoExcel = Api.exportMateriallInfoExcel; + +/** + * 导入物料信息 + */ +export const importMateriallInfo = Api.importMateriallInfo; + +/** + * 导入物料类别 + */ +export const importType = Api.importType; /** * 列表接口 @@ -37,11 +50,11 @@ export const list = (params) => defHttp.get({ url: Api.list, params }); * @param params * @param handleSuccess */ -export const deleteOne = (params,handleSuccess) => { - return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { +export const deleteOne = (params, handleSuccess) => { + return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => { handleSuccess(); }); -} +}; /** * 批量删除 @@ -56,12 +69,12 @@ export const batchDelete = (params, handleSuccess) => { okText: '确认', cancelText: '取消', onOk: () => { - return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => { handleSuccess(); }); - } + }, }); -} +}; /** * 保存或者更新 @@ -71,8 +84,8 @@ export const batchDelete = (params, handleSuccess) => { export const saveOrUpdate = (params, isUpdate) => { let url = isUpdate ? Api.editInfo : Api.save; return defHttp.post({ url: url, params }, { isTransformResponse: false }); -} +}; export const wlqianyi = (params, isUpdate) => { - let url = Api.wlqianyi; + let url = Api.wlqianyi; return defHttp.post({ url: url, params }, { isTransformResponse: false }); -} +}; diff --git a/src/views/invoicing/ConfigMaterial/ConfigMaterialInfoList.vue b/src/views/invoicing/ConfigMaterial/ConfigMaterialInfoList.vue index aa82c91..5b40d77 100644 --- a/src/views/invoicing/ConfigMaterial/ConfigMaterialInfoList.vue +++ b/src/views/invoicing/ConfigMaterial/ConfigMaterialInfoList.vue @@ -50,13 +50,19 @@ dictCode="iz_enabled" allow-clear /> - + - +
查询 - 重置 - + 重置 + 下载类别模板 + 导入类别 + 下载物料模板 + 导入物料 +
@@ -253,7 +259,7 @@ import { ref, reactive, onMounted, computed } from 'vue'; import { BasicTable, useTable, TableAction } from '/@/components/Table'; import { useListPage } from '/@/hooks/system/useListPage'; import { columns, superQuerySchema } from './ConfigMaterialInfo.data'; -import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ConfigMaterialInfo.api'; +import { list, deleteOne, batchDelete, importMateriallInfo, importType, exportTypeExcel, exportMateriallInfoExcel } from './ConfigMaterialInfo.api'; import { downloadFile } from '/@/utils/common/renderUtils'; import ConfigMaterialInfoModal from './components/ConfigMaterialInfoModal.vue' import { useUserStore } from '/@/store/modules/user'; @@ -274,9 +280,11 @@ import WlqianyiModal from '/@/views/invoicing/ConfigMaterial/components/Wlqianyi import ConfigMaterialInfoListMenu from './ConfigMaterialInfoListMenu.vue'; import { useResponsive } from '/@/hooks/web/useResponsive'; import { useMessage } from "/@/hooks/web/useMessage"; +import { useMethods } from '/@/hooks/system/useMethods'; +const { handleExportXls, handleImportXls } = useMethods(); const { screenEnum, screenWidth } = useResponsive(); -const { createMessage} = useMessage(); +const { createMessage } = useMessage(); // 计算动态高度 const scrollY = computed(() => { // 大屏幕(≥1600px)使用 71vh,否则使用 66.5vh @@ -304,10 +312,8 @@ const registerMedicationDrawer = ref(); const qianyiDrawer = ref(); const wlqianyiDrawer = ref(); -function handleHeaderSearch(item){ - console.log("🚀 ~ handleHeaderSearch ~ 11111item:", item) - queryParam[item.key] = "*"+item.value+"*"; - console.log("🚀 ~ handleHeaderSearch ~ queryParam:", queryParam) +function handleHeaderSearch(item) { + queryParam[item.key] = "*" + item.value + "*"; reload(); } /** @@ -356,15 +362,28 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ }, }, exportConfig: { - name: "物料信息", - url: getExportUrl, + name: "物料分类导入模板", + url: exportTypeExcel, params: queryParam, }, importConfig: { - url: getImportUrl, + url: importMateriallInfo, success: handleSuccess }, }); + +async function exportMAteriallInfoExcel() { + return handleExportXls('物料信息导入模板', exportMateriallInfoExcel, {}); +} + +/** + * 导入物料类别 + * @param file + */ +function importMateriallType(file) { + return handleImportXls(file, importType, handleSuccess || reload); +} + const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext; const labelCol = reactive({ xs: 24, @@ -447,7 +466,7 @@ async function handleEdit(record: Recordable) { // }); // } - if(sfjx == '1'){ + if (sfjx == '1') { return; } registerModal.value.disableSubmit = false; @@ -534,17 +553,17 @@ async function handleWlQyty(record) { console.log("🚀 ~ handleWlQyty ~ record:", record) const izEnabled = record.izEnabled == 'Y' ? 'N' : "Y" var sfjx = "0"; - if("N"==izEnabled){ - await defHttp.get({ url: '/invoicing/blWarehouseMaterialInfo/queryWlsfzy', params: { wlId: record.id,nuId:null } }).then(res => { + if ("N" == izEnabled) { + await defHttp.get({ url: '/invoicing/blWarehouseMaterialInfo/queryWlsfzy', params: { wlId: record.id, nuId: null } }).then(res => { console.log("🚀 ~ handleQyty ~ res:", res) - if(!res.success){ + if (!res.success) { createMessage.error(res.message); sfjx = "1"; } }); } - if(sfjx == '1'){ + if (sfjx == '1') { return; } @@ -596,7 +615,7 @@ function handleAddxj(data) { //编辑 function handleFenleiEdit(data) { console.log("🚀 ~ handleEdit ~ data:", data) - const params = { id: data.key, categoryId: data.categoryId, typeId: data.typeId,appCheckIconPath: data.appCheckIconPath,appIconPath: data.appIconPath } + const params = { id: data.key, categoryId: data.categoryId, typeId: data.typeId, appCheckIconPath: data.appCheckIconPath, appIconPath: data.appIconPath } if (data.levle == 1) { params.categoryName = data.title registerDrawer.value.disableSubmit = false; @@ -653,7 +672,7 @@ function searchQuery() { function searchReset() { formRef.value.resetFields(); selectedRowKeys.value = []; - Object.keys(queryParam).forEach(key => { + Object.keys(queryParam).forEach(key => { queryParam[key] = null; // 或者 undefined、'' 根据你的需求 }); // queryParam.treeId = null; diff --git a/src/views/invoicing/ConfigMaterial/components/ConfigMaterialInfoForm.vue b/src/views/invoicing/ConfigMaterial/components/ConfigMaterialInfoForm.vue index cec757d..b87c6be 100644 --- a/src/views/invoicing/ConfigMaterial/components/ConfigMaterialInfoForm.vue +++ b/src/views/invoicing/ConfigMaterial/components/ConfigMaterialInfoForm.vue @@ -5,17 +5,17 @@