From 8e83c350a8be28a5375501d6a71074f39870a107 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Thu, 1 Feb 2024 16:18:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=B4=E4=BF=AE=E5=B7=A5=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 1 + src/api/eam/basic/item/index.ts | 5 + .../device/deviceMaintenanceDetail/index.ts | 51 +++ src/components/BasicForm/src/BasicForm.vue | 7 + src/components/Detail/src/Detail.vue | 74 +--- .../SearchTable/src/SearchTable.vue | 89 ++-- src/components/TableForm/src/TableForm.vue | 11 +- src/utils/dict.ts | 1 + src/utils/disposition/tabsList.ts | 37 +- src/views/eam/basic/item/item.data.ts | 26 ++ .../deviceAccounts/deviceAccounts.data.ts | 3 + src/views/eam/device/deviceAccounts/index.vue | 20 +- .../deviceMaintenanceMain.data.ts | 194 ++++++--- .../device/deviceMaintenanceMain/index.vue | 392 ++++++++++++------ 14 files changed, 563 insertions(+), 348 deletions(-) create mode 100644 src/api/eam/device/deviceMaintenanceDetail/index.ts diff --git a/.env.development b/.env.development index 78976cd..5c1f646 100644 --- a/.env.development +++ b/.env.development @@ -5,6 +5,7 @@ VITE_DEV=false # 请求路径 VITE_BASE_URL='http://localhost:12080' +# VITE_BASE_URL='http://192.168.0.165:12080' # 上传路径 VITE_UPLOAD_URL='http://localhost:12080/admin-api/infra/file/upload' diff --git a/src/api/eam/basic/item/index.ts b/src/api/eam/basic/item/index.ts index f56e625..f3fb728 100644 --- a/src/api/eam/basic/item/index.ts +++ b/src/api/eam/basic/item/index.ts @@ -61,4 +61,9 @@ export const deleteItem = async (id : number) => { // 导出备件 Excel export const exportItem = async (params) => { return await request.download({ url: `/eam/item/export-excel`, params }) +} + +// 修改备件 +export const getItemList = async (params) => { + return await request.get({ url: `/eam/item/getListByNumber`, params }) } \ No newline at end of file diff --git a/src/api/eam/device/deviceMaintenanceDetail/index.ts b/src/api/eam/device/deviceMaintenanceDetail/index.ts new file mode 100644 index 0000000..4e7a8b1 --- /dev/null +++ b/src/api/eam/device/deviceMaintenanceDetail/index.ts @@ -0,0 +1,51 @@ +import request from '@/config/axios' + +export interface DeviceMaintenanceDetailVO { + describes: string + describes1: string + workOut: string + maintenances: string +} + +// 查询维修工单子列表 +export const getDeviceMaintenanceDetailPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/purchasereceipt-request-detail/senior', data }) + } else { + return await request.get({ url: `/admin-api/eam/device-maintenance-detail/page`, params }) + } +} + +// 查询维修工单子详情 +export const getPurchasereceiptRequestDetail = async (id: number) => { + return await request.get({ url: `/eam/device-maintenance-detail/get?id=` + id }) +} + +// 新增维修工单子 +export const createDeviceMaintenanceDetail = async (data: DeviceMaintenanceDetailVO) => { + return await request.post({ url: `/eam/device-maintenance-detail/create`, data }) +} + +// 修改维修工单子 +export const updateDeviceMaintenanceDetail = async (data: DeviceMaintenanceDetailVO) => { + return await request.put({ url: `/eam/device-maintenance-detail/update`, data }) +} + +// 删除维修工单子 +export const deleteDeviceMaintenanceDetail = async (id: number) => { + return await request.delete({ url: `/eam/device-maintenance-detail/delete?id=` + id }) +} + + + +// 导出维修工单子 Excel +export const exportPurchasereceiptRequestDetail = async (params) => { + return await request.download({ url: `/wms/purchasereceipt-request-detail/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/wms/purchasereceipt-request-detail/get-import-template' }) +} \ No newline at end of file diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index f57da27..b957c36 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -281,6 +281,7 @@ const opensearchTable = ( ) => { const _searchCondition = {} // 判断查询条件中,是否存在指向主表的数据 + console.log('searchCondition',searchCondition) if (searchCondition && searchCondition.length > 0) { // 转换筛选条件所需 let filters: any[] = [] @@ -288,6 +289,7 @@ const opensearchTable = ( // searchCondition.forEach((item) => { // 查询条件为主表某字段,需要赋值主表数据,数据来源是详情的,赋值需要从row中获取 if (searchCondition[i].isMainValue) { + _searchCondition[searchCondition[i].key] = formRef.value.formModel[searchCondition[i].value] ? formRef.value.formModel[searchCondition[i].value] : props.detailData @@ -296,6 +298,10 @@ const opensearchTable = ( ? row[searchCondition[i].value] : '' // 是否含有空参数情况 + console.log(11) + console.log(_searchCondition) + console.log(formRef.value.formModel) + console.log(11) let isNull = false if (_searchCondition[searchCondition[i].key] == '' || _searchCondition[searchCondition[i].key] == undefined) { isNull = true @@ -510,6 +516,7 @@ const handleAddTable = () => { } // 输入框聚焦 const inpuFocus = (headerItem, row, index) => { + console.log('headerItem',headerItem) opensearchTable( headerItem.field, headerItem.tableForm.searchField, diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index 899c6c9..5a22384 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -28,7 +28,7 @@
- + -
@@ -301,41 +287,7 @@ if (props.isBasic == true) { if (tabsList.value) { } -// 附件默认数据 -const annexData = reactive({ - annexList: [] -}) -// 备注数据 -const remarksData = reactive({ - remarksList: [], - data: {} -}) - -// 变更记录默认数据 -const changeRecordData = reactive({ - changeRecordList: [] -}) -const detailData = ref({}) //详情数据 -// 获取附件列表篇 -const getFileList = async () => { - detailLoading.value = true - try { - annexData.annexList = await FileApi.getFileList(remarksData.data) - } finally { - detailLoading.value = false - } -} -/** 添加附件 */ -const handleAnnexSuccess = () => { - getFileList() - getChangeRecordList() -} -// 删除附件成功之后所走的方法 -const deleteAnnexSuccess = async () => { - getFileList() - getChangeRecordList() -} // Tabs当前选择 const current = ref(0) @@ -357,15 +309,12 @@ const HeadButttondata = ref() const buttondata = ref() /** 打开弹窗 */ +const detailData = ref() const titleNameRef = ref() const titleValueRef = ref() const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => { titleNameRef.value = titleName titleValueRef.value = titleValue - remarksData.data = { - tableId: row.id, - tableName: tableName - } // 加载明细列表 if (!props.isBasic) { // 设置主表id @@ -452,25 +401,6 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: } defineExpose({ openDetail }) // 提供 open 方法,用于打开弹窗 -// 获取备注列表 -const getRemarkList = async () => { - detailLoading.value = true - try { - remarksData.remarksList = await RemarkApi.getRemarkPage(remarksData.data) - } finally { - detailLoading.value = false - } -} -// 备注提交成功之后 -const remarksSubmitScuess = async (remark) => { - detailLoading.value = false - getRemarkList() - getChangeRecordList() -} -// 获取变更记录 -const getChangeRecordList = async () => { - changeRecordData.changeRecordList = await RemarkApi.getChangeRecordPage(remarksData.data) -} const tableObjectRef = ref() const tableMethodsRef = ref() diff --git a/src/components/SearchTable/src/SearchTable.vue b/src/components/SearchTable/src/SearchTable.vue index 299c107..21b96b7 100644 --- a/src/components/SearchTable/src/SearchTable.vue +++ b/src/components/SearchTable/src/SearchTable.vue @@ -1,31 +1,20 @@