Browse Source

修复测试问题

master
ljlong_2630 9 months ago
parent
commit
208c53a214
  1. 1
      src/api/eam/device/deviceMaintainPlan/index.ts
  2. 2
      src/api/eam/mold/moldInspectionDetail/index.ts
  3. 1
      src/components/UploadFile/src/UploadImgs.vue
  4. 3
      src/views/eam/device/deviceMaintainPlan/deviceMaintainPlan.data.ts
  5. 2
      src/views/eam/device/deviceRepair/index.vue
  6. 13
      src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts
  7. 12
      src/views/eam/device/deviceinspectionjob/index.vue
  8. 27
      src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts
  9. 20
      src/views/eam/device/devicemaintenancejob/index.vue
  10. 3
      src/views/eam/mold/moldMaintainPlan/moldMaintainPlan.data.ts
  11. 16
      src/views/eam/mold/moldRepair/index.vue
  12. 66
      src/views/eam/mold/moldinspectionjob/index.vue
  13. 20
      src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts
  14. 14
      src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts
  15. 37
      src/views/eam/mold/moldmaintenancejob/index.vue
  16. 44
      src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts

1
src/api/eam/device/deviceMaintainPlan/index.ts

@ -14,6 +14,7 @@ export interface DeviceMaintainPlanVO {
// 查询保养计划列表 // 查询保养计划列表
export const getDeviceMaintainPlanPage = async (params) => { export const getDeviceMaintainPlanPage = async (params) => {
params.type = 'DEVICE'
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}

2
src/api/eam/mold/moldInspectionDetail/index.ts

@ -3,6 +3,7 @@ import request from '@/config/axios'
export interface MoldInspectionDetailVO { export interface MoldInspectionDetailVO {
id: number id: number
number: string number: string
masterId: number
siteId: string siteId: string
available: string available: string
concurrencyStamp: number concurrencyStamp: number
@ -14,6 +15,7 @@ export interface MoldInspectionDetailVO {
completionTime: Date completionTime: Date
engineer: string engineer: string
uncompleted: string uncompleted: string
status: string
} }
// 查询检修工单子列表 // 查询检修工单子列表

1
src/components/UploadFile/src/UploadImgs.vue

@ -170,6 +170,7 @@ const handleExceed = () => {
const viewImageUrl = ref('') const viewImageUrl = ref('')
const imgViewVisible = ref(false) const imgViewVisible = ref(false)
const handlePictureCardPreview: UploadProps['onPreview'] = (uploadFile) => { const handlePictureCardPreview: UploadProps['onPreview'] = (uploadFile) => {
console.log('uploadFile', uploadFile)
viewImageUrl.value = uploadFile.url! viewImageUrl.value = uploadFile.url!
imgViewVisible.value = true imgViewVisible.value = true
} }

3
src/views/eam/device/deviceMaintainPlan/deviceMaintainPlan.data.ts

@ -50,7 +50,8 @@ export const DeviceMaintainPlan = useCrudSchemas(reactive<CrudSchema[]>([
label: '类型', label: '类型',
field: 'type', field: 'type',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
isTable: false,
form: { form: {
component: 'Select' component: 'Select'
}, },

2
src/views/eam/device/deviceRepair/index.vue

@ -295,8 +295,6 @@ function handleBackout(row) {
} }
const onChange = (field, cur, item,formRef) => { const onChange = (field, cur, item,formRef) => {
console.log(cur)
console.log(item)
if (field == 'factoryAreaNumber') { if (field == 'factoryAreaNumber') {
nextTick(() => { nextTick(() => {
const setV = {} const setV = {}

13
src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts

@ -49,6 +49,16 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceListNoPage.find((account) => account.number == cellValue)?.name return deviceListNoPage.find((account) => account.number == cellValue)?.name
}, },
search:{
component: 'Select',
componentProps: {
options: deviceListNoPage,
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
},
},
form: { form: {
component: 'Select', component: 'Select',
componentProps: { componentProps: {
@ -114,7 +124,8 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceDeviceTypeList.find((account) => account.value == cellValue)?.label return deviceDeviceTypeList.find((account) => account.value == cellValue)?.label
}, },
isSearch: true, isSearch: false,
isTable: false,
search: { search: {
component: 'Select', component: 'Select',
componentProps: { componentProps: {

12
src/views/eam/device/deviceinspectionjob/index.vue

@ -431,7 +431,9 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) =>
} }
console.log('data1',data1) console.log('data1',data1)
if (formType === 'create') { if (formType === 'create') {
await DeviceInspectionDetailApi.createDeviceInspectionDetail(data1) await DeviceInspectionDetailApi.createDeviceInspectionDetail(data1)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await DeviceInspectionDetailApi.updateDeviceInspectionDetail(data1) await DeviceInspectionDetailApi.updateDeviceInspectionDetail(data1)
@ -439,7 +441,6 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) =>
} }
formRef.dialogVisible = false formRef.dialogVisible = false
// //
await getList()
detailRef.value.tableObject.tableList.forEach(item => { detailRef.value.tableObject.tableList.forEach(item => {
if (item.itemNumbers?.length > 0) { if (item.itemNumbers?.length > 0) {
let str = '' let str = ''
@ -448,10 +449,11 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) =>
}) })
item.itemNumbers1 = str.substring(0, str.length - 1) item.itemNumbers1 = str.substring(0, str.length - 1)
} }
}) })
await formRef.getList()
} finally { } finally {
formRef.formLoading = false formRef.value.formLoading = false
} }
} }
@ -489,11 +491,11 @@ const submitForm = async (formType, data) => {
await DeviceInspectionMainApi.updateDeviceInspectionMain(data) await DeviceInspectionMainApi.updateDeviceInspectionMain(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
formRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
// //
getList() getList()
} finally { } finally {
formRef.value.formLoading = false basicFormRef.value.formLoading = false
} }
} }

27
src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts

@ -5,8 +5,8 @@ import { dateFormatter } from '@/utils/formatTime'
import { ItemSearchTable } from '../../basic/item/item.data' import { ItemSearchTable } from '../../basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item' import * as ItemApi from '@/api/eam/basic/item'
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: undefined, flag: 1 }) const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 })
const dutyUserList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: undefined, flag: undefined }) const dutyUserList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null })
// 表单校验 // 表单校验
export const DeviceMaintainOrderMainRules = reactive({ export const DeviceMaintainOrderMainRules = reactive({
@ -24,7 +24,7 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '保养单号', label: '保养单号',
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
table: { table: {
width: '150', width: '150',
}, },
@ -33,7 +33,7 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '保养计划单号', label: '保养计划单号',
field: 'planNumber', field: 'planNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
table: { table: {
width: '150', width: '150',
}, },
@ -47,15 +47,6 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
width: '150', width: '150',
}, },
}, },
{
label: '描述',
field: 'describes',
sort: 'custom',
isSearch: true,
table: {
width: '150',
},
},
{ {
label: '工单所属周期', label: '工单所属周期',
field: 'executePeriod', field: 'executePeriod',
@ -116,11 +107,21 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS, dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
dictClass: 'string', dictClass: 'string',
}, },
{
label: '描述',
field: 'describes',
sort: 'custom',
isSearch: false,
table: {
width: '150',
},
},
{ {
label: '类型', label: '类型',
field: 'type', field: 'type',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isTable: false,
table: { table: {
width: '150', width: '150',
}, },

20
src/views/eam/device/devicemaintenancejob/index.vue

@ -120,7 +120,9 @@ import * as DeviceMaintenanceDetailApi from '@/api/eam/device/deviceMaintenanceD
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { selecUserByType } from '@/api/system/dept' import { selecUserByType } from '@/api/system/dept'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD')
defineOptions({ name: 'DeviceMaintenanceMain' }) defineOptions({ name: 'DeviceMaintenanceMain' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
@ -212,6 +214,9 @@ const buttonBaseClick = (val, item) => {
// //
DeviceMaintenanceMain.allSchemas.formSchema[3].value = 'DEVICE' DeviceMaintenanceMain.allSchemas.formSchema[3].value = 'DEVICE'
DeviceMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = false DeviceMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = false
DeviceMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.options = deviceTypeList
openForm('create') openForm('create')
} else if (val == 'import') { } else if (val == 'import') {
// //
@ -284,6 +289,9 @@ const buttonTableClick = async (val, row) => {
DeviceMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = false DeviceMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = false
if (val == 'edit') { if (val == 'edit') {
// //
DeviceMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.options = deviceTypeList
openForm('update', row) openForm('update', row)
DeviceMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = true DeviceMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = true
} else if (val == 'delete') { } else if (val == 'delete') {
@ -294,6 +302,9 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'repair') { } else if (val == 'repair') {
openDetail(row, '代码', row.number) openDetail(row, '代码', row.number)
} else if (val == 'turnOrder') { } else if (val == 'turnOrder') {
DeviceMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.options = deviceMoldTypeList
openForm('turnOrder', row) openForm('turnOrder', row)
} else if (val == 'finish') { } else if (val == 'finish') {
finishOrder(row) finishOrder(row)
@ -375,7 +386,10 @@ const searchFormClick = (searchData) => {
// //
function acceptOrder(row) { function acceptOrder(row) {
DeviceMaintenanceMainApi.orderStepChange(row) DeviceMaintenanceMainApi.orderStepChange(row).then(item => {
message.success('接单成功')
getList()
})
getList() getList()
} }
// //
@ -528,7 +542,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
}) })
} finally { } finally {
formRef.formLoading = false formRef.value.formLoading = false
} }
} }

3
src/views/eam/mold/moldMaintainPlan/moldMaintainPlan.data.ts

@ -51,7 +51,8 @@ export const MoldMaintainPlan = useCrudSchemas(reactive<CrudSchema[]>([
label: '类型', label: '类型',
field: 'type', field: 'type',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
isTable: false,
form: { form: {
component: 'Select' component: 'Select'
}, },

16
src/views/eam/mold/moldRepair/index.vue

@ -292,15 +292,13 @@ onMounted(async () => {
importTemplateData.templateUrl = await MoldRepairApi.importTemplate() importTemplateData.templateUrl = await MoldRepairApi.importTemplate()
}) })
const onChange = (field, cur, item) => { const onChange = (field, cur, item, formRef) => {
if (field == 'declarerPhone') { if (field == 'factoryAreaNumber') {
if (cur != null && cur != '') { nextTick(() => {
if(validatePhoneNumber(cur)) { const setV = {}
console.log("手机号码格式正确"); setV['deviceNumber'] = ''
} else { formRef.setValues(setV)
message.error('手机号码格式不正确!') })
}
}
} }
} }

66
src/views/eam/mold/moldinspectionjob/index.vue

@ -70,6 +70,8 @@
:detailValidate="detailValidate" :detailValidate="detailValidate"
@detailSubmitForm="detailSubmitForm" @detailSubmitForm="detailSubmitForm"
:isSearchTableItem="true" :isSearchTableItem="true"
:openFormCallBack="openFormCallBack"
@detailOnChange="detailOnChange"
/> />
<!-- 导入 --> <!-- 导入 -->
@ -161,7 +163,7 @@ const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') { //
// MoldInspectionMain.allSchemas.formSchema[4].value = 'PROCCED'; // MoldInspectionMain.allSchemas.formSchema[4].value = 'PROCCED';
MoldInspectionMain.allSchemas.formSchema.find((item) => item.field == 'status').value = 'PROCCED'; MoldInspectionMain.allSchemas.formSchema.find((item) => item.field == 'status').value = 'PROCCED';
MoldInspectionMain.allSchemas.formSchema[5].value = 'DEVICE'; MoldInspectionMain.allSchemas.formSchema.find((item) => item.field == 'type').value = 'MOLD';
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') { //
handleImport() handleImport()
@ -349,19 +351,31 @@ const detailValidate = (data) => {
// tag = true; // tag = true;
// return tag; // return tag;
// } // }
let req = MoldInspectionDetailRules.uncompleted?.find(item => {
return item.required == true
})
if (req !== undefined) {
tag = false
message.warning('需填入未完成原因')
} else {
tag = true
}
return tag
} }
// //
const detailSubmitForm = async (formType, data, getList, formRef, tableList) => { const detailSubmitForm = async (formType, data, getList1, formRef, tableList) => {
console.log('data', data) console.log('data', data)
try { try {
let data1 = { let data1 = {
id: data.id, id: data.id,
number: data.maintenanceNumber, number: data.number,
masterId: data.masterId,
siteId: data.siteId, siteId: data.siteId,
available: data.available, available: data.available,
concurrencyStamp: data.concurrencyStamp, concurrencyStamp: data.concurrencyStamp,
name: data.name, name: data.name,
peoples: data.peoples, peoples: data.peoples,
status: data.status,
estimatedMinutes: data.estimatedMinutes, estimatedMinutes: data.estimatedMinutes,
actualMinutes: data.actualMinutes, actualMinutes: data.actualMinutes,
chargePeoples: data.chargePeoples.join(','), chargePeoples: data.chargePeoples.join(','),
@ -371,15 +385,19 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) =>
} }
console.log('data1',data1) console.log('data1',data1)
if (formType === 'create') { if (formType === 'create') {
console.log('create', data1)
await MoldInspectionDetailApi.createMoldInspectionDetail(data1) await MoldInspectionDetailApi.createMoldInspectionDetail(data1)
console.log('finish', data1)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await MoldInspectionDetailApi.updateMoldInspectionDetail(data1) await MoldInspectionDetailApi.updateMoldInspectionDetail(data1)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
formRef.dialogVisible = false formRef.dialogVisible = false
console.log('before', data1)
// //
await getList() await formRef.getList1
console.log('after', data1)
detailRef.value.tableObject.tableList.forEach(item => { detailRef.value.tableObject.tableList.forEach(item => {
if (item.itemNumbers?.length > 0) { if (item.itemNumbers?.length > 0) {
let str = '' let str = ''
@ -391,7 +409,7 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) =>
}) })
} finally { } finally {
formRef.formLoading = false detailRef.value.formLoading = false
} }
} }
@ -429,12 +447,46 @@ const submitForm = async (formType, data) => {
await MoldInspectionMainApi.updateMoldInspectionMain(data) await MoldInspectionMainApi.updateMoldInspectionMain(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
formRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
// //
getList() getList()
} finally { } finally {
formRef.value.formLoading = false basicFormRef.value.formLoading = false
}
}
function detailOnChange(field, cur, item) {
if (field == 'status') {
if (cur == '1') {
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
MoldInspectionDetailRules.uncompleted = [required]
} else {
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
MoldInspectionDetailRules.uncompleted = [{ required: false }]
}
}
}
const openFormCallBack = (type, row, masterParmas, callback) => {
if (row == undefined || row == null) {
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
delete MoldInspectionDetailRules.uncompleted;
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0'
} else {
if (row.status == '1') {
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
MoldInspectionDetailRules.uncompleted = [required]
} else {
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
MoldInspectionDetailRules.uncompleted = [{ required: false }]
}
} }
callback()
} }
/** 初始化 **/ /** 初始化 **/

20
src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts

@ -294,6 +294,7 @@ export const MoldInspectionDetailRules = reactive({
], ],
number: [required], number: [required],
actualMinutes: [ actualMinutes: [
required,
{ validator:validateNum, message: '请输入数字格式', trigger: 'blur'} { validator:validateNum, message: '请输入数字格式', trigger: 'blur'}
], ],
maintenance: [required], maintenance: [required],
@ -455,12 +456,15 @@ export const MoldInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '未完成原因', label: '未完成原因',
field: 'uncompleted', field: 'uncompleted',
sort: 'custom', sort: 'custom',
table: {
width: '150',
},
isSearch: false, isSearch: false,
isForm: true,
isTable: true, isTable: true,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
disabled: true,
}
}
}, },
{ {
label: '备件', label: '备件',
@ -481,8 +485,8 @@ export const MoldInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
// tableData.value.itemNumbers1 = value.map(item => item.itemNumber) // tableData.value.itemNumbers1 = value.map(item => item.itemNumber)
}, },
searchCondition: [{ searchCondition: [{
key: 'moldNumber', key: 'deviceNumber',
value: 'moldNumber', value: 'deviceNumber',
message: '请选择设备模具编号!', message: '请选择设备模具编号!',
isMainValue: true isMainValue: true
}] }]
@ -498,8 +502,8 @@ export const MoldInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类 searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法 searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [{
key: 'moldNumber', key: 'deviceNumber',
value: 'moldNumber', value: 'deviceNumber',
message: '请选择设备模具编号!', message: '请选择设备模具编号!',
isMainValue: true isMainValue: true
}] }]

14
src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts

@ -5,8 +5,8 @@ import { dateFormatter } from '@/utils/formatTime'
import { ItemSearchTable } from '../../basic/item/item.data' import { ItemSearchTable } from '../../basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item' import * as ItemApi from '@/api/eam/basic/item'
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
const userList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: undefined, flag: 1 }) const userList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 })
const dutyUserList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: undefined, flag: undefined }) const dutyUserList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: undefined })
// 表单校验 // 表单校验
export const MoldMaintainOrderMainRules = reactive({ export const MoldMaintainOrderMainRules = reactive({
@ -99,11 +99,21 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS, dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
dictClass: 'string', dictClass: 'string',
}, },
{
label: '描述',
field: 'describes',
sort: 'custom',
isSearch: false,
table: {
width: '150',
},
},
{ {
label: '类型', label: '类型',
field: 'type', field: 'type',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isTable: false,
table: { table: {
width: '150', width: '150',
}, },

37
src/views/eam/mold/moldmaintenancejob/index.vue

@ -118,6 +118,9 @@ import * as MoldMaintenanceMainApi from '@/api/eam/mold/moldMaintenanceMain'
import * as MoldMaintenanceDetailApi from '@/api/eam/mold/moldMaintenanceDetail' import * as MoldMaintenanceDetailApi from '@/api/eam/mold/moldMaintenanceDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
const moldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'MOLD')
defineOptions({ name: 'MoldMaintenanceMain' }) defineOptions({ name: 'MoldMaintenanceMain' })
const message = useMessage() // const message = useMessage() //
@ -208,8 +211,18 @@ const HeadButttondata = [
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { if (val == 'add') {
// //
MoldMaintenanceMain.allSchemas.formSchema[3].value = 'MOLD' MoldMaintenanceMain.allSchemas.formSchema.find(item => {
MoldMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = false return item.field == 'type'
}).value = 'MOLD'
MoldMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.disabled = false
MoldMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.disabled = false
MoldMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.options = moldTypeList
openForm('create') openForm('create')
} else if (val == 'import') { } else if (val == 'import') {
// //
@ -282,13 +295,24 @@ const buttonTableClick = async (val, row) => {
if (val == 'edit') { if (val == 'edit') {
// //
openForm('update', row) openForm('update', row)
MoldMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = true MoldMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.disabled = true
MoldMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.disabled = true
} else if (val == 'delete') { } else if (val == 'delete') {
// //
handleDelete(row.id) handleDelete(row.id)
} else if (val == 'acceptOrder') { } else if (val == 'acceptOrder') {
acceptOrder(row) acceptOrder(row)
} else if (val == 'turnOrder') { } else if (val == 'turnOrder') {
MoldMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.options = deviceMoldTypeList
MoldMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.disabled = false
openForm('turnOrder', row) openForm('turnOrder', row)
} else if (val == 'finishOrder') { } else if (val == 'finishOrder') {
finishOrder(row) finishOrder(row)
@ -371,7 +395,10 @@ const searchFormClick = (searchData) => {
// //
function acceptOrder(row) { function acceptOrder(row) {
MoldMaintenanceMainApi.orderStepChange(row) MoldMaintenanceMainApi.orderStepChange(row).then(item => {
message.success('接单成功')
getList()
})
} }
// //
function turnOrder() {} function turnOrder() {}
@ -524,7 +551,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
}) })
} finally { } finally {
formRef.formLoading = false formRef.value.formLoading = false
} }
} }

44
src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts

@ -44,7 +44,27 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false, isSearch: false,
isTable: true, isTable: true,
}, },
{
label: '类型',
field: 'type',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isForm: true,
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
form: {
component: 'Select',
componentProps: {
disabled: true,
}
},
search: {
value: 'MOLD'
}
},
{ {
label: '设备模具编号', label: '设备模具编号',
field: 'deviceNumber', field: 'deviceNumber',
@ -134,27 +154,7 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
} }
}, },
{
label: '类型',
field: 'type',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isForm: true,
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
form: {
component: 'Select',
componentProps: {
disabled: true,
}
},
search: {
value: 'MOLD'
}
},
{ {
label: '班次', label: '班次',
field: 'classes', field: 'classes',

Loading…
Cancel
Save