Browse Source

SBBJ-812保养项配置逻辑修改

master
zhaoyiran 1 week ago
parent
commit
176eb8136d
  1. 12
      src/api/eam/basic/moldMaintenanceConfig/index.ts
  2. 25
      src/views/eam/basic/moldMaintenanceConfig/index.vue
  3. 1
      src/views/eam/basic/moldMaintenanceConfig/moldMaintenanceConfig.data.ts

12
src/api/eam/basic/moldMaintenanceConfig/index.ts

@ -43,4 +43,16 @@ export const exportMoldMaintenanceConfig = async (params) => {
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/eam/device-mold-maintenance-config/get-import-template' }) return request.download({ url: '/eam/device-mold-maintenance-config/get-import-template' })
}
export const getDeviceMoldItemsPage = async (params) => {
params.type="DEVICE"
params.status = "MAINTAIN"
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-mold-maintenance-config/senior', data })
} else {
return await request.get({ url: `/eam/device-mold-maintenance-config/pageDetail`, params })
}
} }

25
src/views/eam/basic/moldMaintenanceConfig/index.vue

@ -27,9 +27,9 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #code="{row}"> <template #deviceNumber="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> <el-button type="primary" link @click="openDetail(row, '代码', row.deviceNumber)">
<span>{{ row.code }}</span> <span>{{ row.deviceNumber }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
@ -65,10 +65,10 @@
ref="detailRef" ref="detailRef"
:isBasic="false" :isBasic="false"
:allSchemas="MoldMaintenanceConfig.allSchemas" :allSchemas="MoldMaintenanceConfig.allSchemas"
:detailAllSchemas="DeviceMaintenance.allSchemas" :detailAllSchemas="DeviceMaintenanceTwo.allSchemas"
:apiCreate="DeviceMaintenanceApi.createDeviceMoldItems" :apiCreate="DeviceMaintenanceApi.createDeviceMoldItems"
:apiUpdate="DeviceMaintenanceApi.updateDeviceMoldItems" :apiUpdate="DeviceMaintenanceApi.updateDeviceMoldItems"
:apiPage="DeviceMaintenanceApi.getDeviceMoldItemsPage" :apiPage="MoldMaintenanceConfigApi.getDeviceMoldItemsPage"
:apiDelete="DeviceMaintenanceApi.deleteDeviceMoldItems" :apiDelete="DeviceMaintenanceApi.deleteDeviceMoldItems"
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
/> />
@ -145,7 +145,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
} else { } else {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
if (formField == 'deviceName') { if (formField == 'deviceNumber') {
setV['deviceName'] = val[0].name setV['deviceName'] = val[0].name
} }
formRef.setValues(setV) formRef.setValues(setV)
@ -157,18 +157,21 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
const submitForm = async (formType, submitData) => { const submitForm = async (formType, submitData) => {
let data = {...submitData} let data = {...submitData}
if(data.masterId){ if(data.masterId){
data.id = data.masterId data.id = data.masterId
} }
data.type = 'DEVICE'
data.subList = tableData.value //
data.maintenanceItemId = data.subList.map(item=>item.id).join(',')
formRef.value.formLoading = true formRef.value.formLoading = true
try { try {
if (formType === 'create') { if (formType === 'create') {
console.log(data) console.log(data)
await InventorychangeRequestMainApi.createInventorychangeRequestMain(data) await MoldMaintenanceConfigApi.createMoldMaintenanceConfig(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
console.log('data',data); console.log('data',data);
data.id = data.masterId data.id = data.masterId
await InventorychangeRequestMainApi.updateInventorychangeRequestMain(data) await MoldMaintenanceConfigApi.updateMoldMaintenanceConfig(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
formRef.value.dialogVisible = false formRef.value.dialogVisible = false
@ -251,8 +254,8 @@ const buttonBaseClick = (val, item) => {
// - // -
const butttondata = [ const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:moldMaintenanceConfig:update'}), // defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:moldMaintenanceConfig:delete'}), // defaultButtons.mainListDeleteBtn(null), //
] ]
// - // -

1
src/views/eam/basic/moldMaintenanceConfig/moldMaintenanceConfig.data.ts

@ -5,6 +5,7 @@ import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance'
// 表单校验 // 表单校验
export const MoldMaintenanceConfigRules = reactive({ export const MoldMaintenanceConfigRules = reactive({
deviceNumber: [required], deviceNumber: [required],
executionCycle: [required],
}) })
export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([ export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([

Loading…
Cancel
Save