From d7ba4e7564c4ff9bf9786801b676c7b9fe8da6af Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Mon, 19 Feb 2024 15:42:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=8F=B0=E8=B4=A6=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E8=AF=A6=E6=83=85=E5=88=97=E8=A1=A8=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/basic/fixedAssets/index.ts | 61 ---- src/api/eam/mold/moldAccounts/index.ts | 21 +- .../Detail/src/DetailDeviceLedger.vue | 111 +++++-- .../eam/basic/fixedAssets/fixedAssets.data.ts | 146 --------- src/views/eam/basic/fixedAssets/index.vue | 244 --------------- src/views/eam/device/deviceAccounts/index.vue | 56 +++- src/views/eam/mold/moldAccounts/index.vue | 285 +++++++++++++++--- .../mold/moldAccounts/moldAccounts.data.ts | 131 ++++---- 8 files changed, 455 insertions(+), 600 deletions(-) delete mode 100644 src/api/eam/basic/fixedAssets/index.ts delete mode 100644 src/views/eam/basic/fixedAssets/fixedAssets.data.ts delete mode 100644 src/views/eam/basic/fixedAssets/index.vue diff --git a/src/api/eam/basic/fixedAssets/index.ts b/src/api/eam/basic/fixedAssets/index.ts deleted file mode 100644 index aba3894..0000000 --- a/src/api/eam/basic/fixedAssets/index.ts +++ /dev/null @@ -1,61 +0,0 @@ -import request from '@/config/axios' - -export interface FixedAssetsVO { - number: string - name: string - accountingUnit: string - specifications: string - locationNumber: string - purchaseDate: Date - purchaseDept: string - supplierNumber: string - productionDate: Date - purchasePrice: number - manageDept: string - unit: string - qty: number - siteId: string - available: string - concurrencyStamp: number -} - -// 查询固定资产列表 -export const getFixedAssetsPage = async (params) => { - if (params.isSearch) { - delete params.isSearch - const data = {...params} - return await request.post({ url: '/eam/fixed-assets/senior', data }) - } else { - return await request.get({ url: `/eam/fixed-assets/page`, params }) - } -} - -// 查询固定资产详情 -export const getFixedAssets = async (id: number) => { - return await request.get({ url: `/eam/fixed-assets/get?id=` + id }) -} - -// 新增固定资产 -export const createFixedAssets = async (data: FixedAssetsVO) => { - return await request.post({ url: `/eam/fixed-assets/create`, data }) -} - -// 修改固定资产 -export const updateFixedAssets = async (data: FixedAssetsVO) => { - return await request.put({ url: `/eam/fixed-assets/update`, data }) -} - -// 删除固定资产 -export const deleteFixedAssets = async (id: number) => { - return await request.delete({ url: `/eam/fixed-assets/delete?id=` + id }) -} - -// 导出固定资产 Excel -export const exportFixedAssets = async (params) => { - return await request.download({ url: `/eam/fixed-assets/export-excel`, params }) -} - -// 下载用户导入模板 -export const importTemplate = () => { - return request.download({ url: '/eam/fixed-assets/get-import-template' }) -} \ No newline at end of file diff --git a/src/api/eam/mold/moldAccounts/index.ts b/src/api/eam/mold/moldAccounts/index.ts index 222e4ed..e186d00 100644 --- a/src/api/eam/mold/moldAccounts/index.ts +++ b/src/api/eam/mold/moldAccounts/index.ts @@ -12,15 +12,12 @@ export interface MoldAccountsVO { supplierNumber: string productionDate: Date purchasePrice: number - isClientAssets: string - frequency: number - beat: number siteId: string available: string concurrencyStamp: number } -// 查询模具台账列表 +// 查询设备台账列表 export const getMoldAccountsPage = async (params) => { if (params.isSearch) { delete params.isSearch @@ -31,27 +28,27 @@ export const getMoldAccountsPage = async (params) => { } } -// 查询模具台账详情 +// 查询设备台账详情 export const getMoldAccounts = async (id: number) => { return await request.get({ url: `/eam/mold-accounts/get?id=` + id }) } -// 新增模具台账 +// 新增设备台账 export const createMoldAccounts = async (data: MoldAccountsVO) => { return await request.post({ url: `/eam/mold-accounts/create`, data }) } -// 修改模具台账 +// 修改设备台账 export const updateMoldAccounts = async (data: MoldAccountsVO) => { return await request.put({ url: `/eam/mold-accounts/update`, data }) } -// 删除模具台账 +// 删除设备台账 export const deleteMoldAccounts = async (id: number) => { return await request.delete({ url: `/eam/mold-accounts/delete?id=` + id }) } -// 导出模具台账 Excel +// 导出设备台账 Excel export const exportMoldAccounts = async (params) => { return await request.download({ url: `/eam/mold-accounts/export-excel`, params }) } @@ -61,7 +58,9 @@ export const importTemplate = () => { return request.download({ url: '/eam/mold-accounts/get-import-template' }) } -// 查询模型台账列表 + +// 查询设备台账列表 export const getMoldAccountsNoPage = async (params) => { return await request.get({ url: `/eam/mold-accounts/selectData`, params }) -} \ No newline at end of file +} + diff --git a/src/components/Detail/src/DetailDeviceLedger.vue b/src/components/Detail/src/DetailDeviceLedger.vue index dc74c8e..feda423 100644 --- a/src/components/Detail/src/DetailDeviceLedger.vue +++ b/src/components/Detail/src/DetailDeviceLedger.vue @@ -66,20 +66,29 @@ - +
+ +
+ +
+ @@ -166,6 +186,11 @@ const routeName = ref() routeName.value = route.name routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail' const updateKey = ref(0) +const dialogVisible = ref(false) +const dialogTitle = ref() +const dialogAllSchemasRef = ref() +const dialogTableObjectRef = ref() +const dialogTableMethodsRef = ref() const props = defineProps({ // 标签参数 @@ -307,7 +332,25 @@ const props = defineProps({ type: Function, required: false, default: null - } + }, + // 默认参数 + defaultParams: { + type: Object, + required: false, + default: null + }, + //子表dialog的api + dialogApiPage: { + type: Function, + required: false, + default: null + }, + // 子表dialog相关信息 + dialogAllSchemas: { + type: Object, + required: true, + default: null + }, }) const imageFormData = ref({ filePathList: [] @@ -481,7 +524,7 @@ const tableMethodsRef = ref() const detailAllSchemasRef = ref() const { tableObject, tableMethods } = useTable({ - getListApi: props.apiPage // 分页接口 + getListApi: props.apiPage, // 分页接口 }) tableObjectRef.value = tableObject @@ -612,13 +655,13 @@ const searchFormClick = async (searchData) => { const { getList } = tableMethods await getList() updateKey.value += 1 - // tableObjectRef.value.params = { - // isSearch: true, - // filters: searchData.filters - // ? searchData.filters - // : [{ column: 'masterId', action: '==', value: masterParmas.value.masterId }] - // } - // getList() // 刷新当前列表 + tableObjectRef.value.params = { + isSearch: true, + filters: searchData.filters + ? searchData.filters + : [{ column: 'masterId', action: '==', value: masterParmas.value.masterId }] + } + getList() // 刷新当前列表 } // 选择盘点类型的时候针对限值的操作 const selectChangeDetail = (field, val) => { @@ -676,12 +719,13 @@ const uploadFile = async () => { } //监视属性 watch( - () => props.apiPage, + () => current.value, () => { const { tableObject, tableMethods } = useTable({ - getListApi: props.apiPage // 分页接口 + getListApi: props.apiPage, // 分页接口 + defaultParams: getDefaultParams() }) - tableObject.params.number = masterParmas.value.number + // tableObject.params.number = masterParmas.value.number detailAllSchemasRef.value = props.detailAllSchemas if (props.tableObjectExtend) { props.tableObjectExtend.forEach((item) => { @@ -694,6 +738,35 @@ watch( getList() } ) + +function getDefaultParams() { + if (props.defaultParams !== undefined && Object.keys(props.defaultParams).length !== 0) { + return props.defaultParams + } else { + return {} + } +} + +function getDialogParams(row: any) { + return { + number: row.number + } +} + +const openDialog = async(row: any, titleName: any, titleValue: any) => { + const { tableObject, tableMethods } = useTable({ + getListApi: props.dialogApiPage, // 分页接口 + defaultParams: getDialogParams(row) + }) + dialogAllSchemasRef.value = props.dialogAllSchemas + dialogTableObjectRef.value = tableObject + dialogTableMethodsRef.value = tableMethods + dialogTableObjectRef.value.tableList = [] + const { getList } = tableMethods + await getList() + updateKey.value += 1 + getList() // 刷新当前列 +}