Browse Source

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

master
zhaoyiran 1 week ago
parent
commit
176eb8136d
  1. 12
      src/api/eam/basic/moldMaintenanceConfig/index.ts
  2. 23
      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

@ -44,3 +44,15 @@ export const exportMoldMaintenanceConfig = async (params) => {
export const importTemplate = () => {
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 })
}
}

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

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

Loading…
Cancel
Save