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() // 刷新当前列 +}