Browse Source

检修工单

master
zhang_li 8 months ago
parent
commit
57419cc97c
  1. 5
      src/components/Detail/src/Detail.vue
  2. 52
      src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts
  3. 43
      src/views/eam/device/deviceinspectionjob/index.vue
  4. 44
      src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts
  5. 25
      src/views/eam/device/devicemaintainjob/index.vue
  6. 45
      src/views/eam/mold/moldinspectionjob/index.vue
  7. 50
      src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts
  8. 30
      src/views/eam/mold/moldmaintainjob/index.vue
  9. 44
      src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts

5
src/components/Detail/src/Detail.vue

@ -496,6 +496,7 @@ const openForm = async (type: string, row?: number) => {
} }
} }
} }
if (await props.openFormCallBack) { if (await props.openFormCallBack) {
props.openFormCallBack(type, row, masterParmas.value, () => { props.openFormCallBack(type, row, masterParmas.value, () => {
formRef.value.open(type, row, masterParmas.value) formRef.value.open(type, row, masterParmas.value)
@ -603,8 +604,8 @@ watch(
} }
) )
function onChange(field, cur, item) { function onChange(field, cur, item,formRef) {
emit('detailOnChange', field, cur, item) emit('detailOnChange', field, cur, item,formRef)
} }
</script> </script>

52
src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts

@ -35,6 +35,7 @@ export const DeviceInspectionMainRules = reactive({
maintenancePhone: [ maintenancePhone: [
{ validator:validateHanset, message: '输入电话格式不正确', trigger: 'blur'} { validator:validateHanset, message: '输入电话格式不正确', trigger: 'blur'}
], ],
status: [required], status: [required],
type: [required], type: [required],
faultType: [required], faultType: [required],
@ -323,6 +324,9 @@ export const DeviceInspectionDetailRules = reactive({
{ validator:validateNum, message: '请输入正整数', trigger: 'blur'}, { validator:validateNum, message: '请输入正整数', trigger: 'blur'},
], ],
maintenance: [required], maintenance: [required],
uncompleted :[
{ required:true, message: '该项为必填项', trigger: 'blur'}
],
}) })
export const DeviceInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const DeviceInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
@ -377,7 +381,6 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '预计分钟', label: '预计分钟',
field: 'estimatedMinutes', field: 'estimatedMinutes',
sort: 'custom', sort: 'custom',
formatter: dateFormatter,
table: { table: {
width: '150', width: '150',
}, },
@ -417,29 +420,6 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
component: 'Input', component: 'Input',
}, },
}, },
{
label: '完成时间',
field: 'completionTime',
sort: 'custom',
formatter: dateFormatter,
table: {
width: '150',
},
isSearch: false,
isTable: true,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
tableForm: {
type: 'FormDateTime',
valueFormat: 'x'
},
},
{ {
label: '工程师确认', label: '工程师确认',
field: 'engineer', field: 'engineer',
@ -476,6 +456,29 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
}, },
{
label: '完成时间',
field: 'completionTime',
sort: 'custom',
formatter: dateFormatter,
table: {
width: '150',
},
isSearch: false,
isTable: true,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
tableForm: {
type: 'FormDateTime',
valueFormat: 'x'
},
},
{ {
label: '未完成原因', label: '未完成原因',
field: 'uncompleted', field: 'uncompleted',
@ -483,7 +486,6 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false, isSearch: false,
isTable: true, isTable: true,
form: { form: {
component: 'Input',
componentProps: { componentProps: {
type: 'textarea', type: 'textarea',
disabled: true, disabled: true,

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

@ -389,24 +389,7 @@ const detailOpenForm = (type, row) => {
// / // /
const detailValidate = (data) => { const detailValidate = (data) => {
// return true; // return true;
let tag = false; let tag = true;
// if (data.qty <= 0) {
// message.warning('0')
// tag = false;
// return tag;
// } else {
// tag = true;
// return tag;
// }
let req = DeviceInspectionDetailRules.uncompleted?.find(item => {
return item.required == true
})
if (req !== undefined) {
tag = false
message.warning('需填入未完成原因')
} else {
tag = true
}
return tag return tag
} }
// //
@ -501,15 +484,20 @@ const submitForm = async (formType, data) => {
} }
function detailOnChange(field, cur, item) { function detailOnChange(field, cur, item,formRef) {
if (field == 'status') { if (field == 'status') {
if (cur == '1') { if (cur == '1') {
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
DeviceInspectionDetailRules.uncompleted = [{ required: true }] DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = true
formRef.setValues({completionTime:''})
DeviceInspectionDetailRules.uncompleted = [{ required: true, message: '该项为必填项' }]
DeviceInspectionDetailRules.completionTime = [{ required: false }]
} else { } else {
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = false
DeviceInspectionDetailRules.uncompleted = [{ required: false }] DeviceInspectionDetailRules.uncompleted = [{ required: false }]
formRef.setValues({uncompleted:''})
DeviceInspectionDetailRules.completionTime = [{ required: true , message: '该项为必填项'}]
} }
} }
} }
@ -517,17 +505,22 @@ function detailOnChange(field, cur, item) {
const openFormCallBack = (type, row, masterParmas, callback) => { const openFormCallBack = (type, row, masterParmas, callback) => {
if (row == undefined || row == null) { if (row == undefined || row == null) {
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = false
DeviceInspectionDetailRules.uncompleted = [{ required: false }] DeviceInspectionDetailRules.uncompleted = [{ required: false }]
DeviceInspectionDetailRules.completionTime = [{ required: true ,message: '该项为必填项'}]
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0' DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0'
} else { } else {
if (row.status == '1') { if (row.status == '1') {
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
DeviceInspectionDetailRules.uncompleted = [{ required: true }] DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = true
DeviceInspectionDetailRules.uncompleted = [{ required: true,message: '该项为必填项' }]
DeviceInspectionDetailRules.completionTime = [{ required: false }]
} else { } else {
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = false
DeviceInspectionDetailRules.uncompleted = [{ required: false }] DeviceInspectionDetailRules.uncompleted = [{ required: false }]
DeviceInspectionDetailRules.completionTime = [{ required: true ,message: '该项为必填项'}]
} }
} }

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

@ -348,6 +348,28 @@ export const DeviceMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
}, },
{
label: '完成时间',
field: 'completionTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{ {
label: '未完成原因', label: '未完成原因',
field: 'uncompleted', field: 'uncompleted',
@ -430,28 +452,6 @@ export const DeviceMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false, isSearch: false,
isTableForm: false, isTableForm: false,
}, },
{
label: '完成时间',
field: 'completionTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{ {
label: '工程师确认', label: '工程师确认',

25
src/views/eam/device/devicemaintainjob/index.vue

@ -517,15 +517,20 @@ function buttonControllFunction(row, val) {
} }
} }
function detailOnChange(field, cur, item) { function detailOnChange(field, cur, item,formRef) {
if (field == 'status') { if (field == 'status') {
if (cur == '1') { if (cur == '1') {
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
DeviceMaintainOrderDetailRules.uncompleted = [{ required: true }] DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = true
formRef.setValues({completionTime:''})
DeviceMaintainOrderDetailRules.uncompleted = [{ required: true, message: '该项为必填项' }]
DeviceMaintainOrderDetailRules.completionTime = [{ required: false }]
} else { } else {
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = false
DeviceMaintainOrderDetailRules.uncompleted= [{ required: false }] DeviceMaintainOrderDetailRules.uncompleted = [{ required: false }]
formRef.setValues({uncompleted:''})
DeviceMaintainOrderDetailRules.completionTime = [{ required: true , message: '该项为必填项'}]
} }
} }
} }
@ -533,17 +538,21 @@ function detailOnChange(field, cur, item) {
const openFormCallBack = (type, row, masterParmas, callback) => { const openFormCallBack = (type, row, masterParmas, callback) => {
if (row == undefined || row == null) { if (row == undefined || row == null) {
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = false
DeviceMaintainOrderDetailRules.uncompleted = [{ required: false }] DeviceMaintainOrderDetailRules.uncompleted = [{ required: false }]
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0' DeviceMaintainOrderDetailRules.completionTime = [{ required: true ,message: '该项为必填项'}]
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0'
} else { } else {
if (row.status == '1') { if (row.status == '1') {
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
DeviceMaintainOrderDetailRules.uncompleted = [{ required: true }] DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = true
DeviceMaintainOrderDetailRules.uncompleted = [{ required: true,message: '该项为必填项' }]
DeviceMaintainOrderDetailRules.completionTime = [{ required: false }]
} else { } else {
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = false
DeviceMaintainOrderDetailRules.uncompleted = [{ required: false }] DeviceMaintainOrderDetailRules.uncompleted = [{ required: false }]
DeviceMaintainOrderDetailRules.completionTime = [{ required: true ,message: '该项为必填项'}]
} }
} }
callback() callback()

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

@ -375,25 +375,7 @@ const detailOpenForm = (type, row) => {
// / // /
const detailValidate = (data) => { const detailValidate = (data) => {
// return true; let tag = true;
let tag = false;
// if (data.qty <= 0) {
// message.warning('0')
// tag = false;
// return tag;
// } else {
// tag = true;
// return tag;
// }
let req = MoldInspectionDetailRules.uncompleted?.find(item => {
return item.required == true
})
if (req !== undefined) {
tag = false
message.warning('需填入未完成原因')
} else {
tag = true
}
return tag return tag
} }
// //
@ -492,15 +474,20 @@ const submitForm = async (formType, data) => {
function detailOnChange(field, cur, item) { function detailOnChange(field, cur, item,formRef) {
if (field == 'status') { if (field == 'status') {
if (cur == '1') { if (cur == '1') {
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
MoldInspectionDetailRules.uncompleted = [{ required: true }] MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = true
formRef.setValues({completionTime:''})
MoldInspectionDetailRules.uncompleted = [{ required: true, message: '该项为必填项' }]
MoldInspectionDetailRules.completionTime = [{ required: false }]
} else { } else {
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = false
MoldInspectionDetailRules.uncompleted = [{ required: false }] MoldInspectionDetailRules.uncompleted = [{ required: false }]
formRef.setValues({uncompleted:''})
MoldInspectionDetailRules.completionTime = [{ required: true , message: '该项为必填项'}]
} }
} }
} }
@ -508,17 +495,21 @@ function detailOnChange(field, cur, item) {
const openFormCallBack = (type, row, masterParmas, callback) => { const openFormCallBack = (type, row, masterParmas, callback) => {
if (row == undefined || row == null) { 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.disabled = true
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = false
MoldInspectionDetailRules.uncompleted = [{ required: false }] MoldInspectionDetailRules.uncompleted = [{ required: false }]
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0' MoldInspectionDetailRules.completionTime = [{ required: true ,message: '该项为必填项'}]
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0'
} else { } else {
if (row.status == '1') { if (cur == '1') {
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
MoldInspectionDetailRules.uncompleted = [{ required: true }] MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = true
MoldInspectionDetailRules.uncompleted = [{ required: true,message: '该项为必填项' }]
MoldInspectionDetailRules.completionTime = [{ required: false }]
} else { } else {
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = false
MoldInspectionDetailRules.uncompleted = [{ required: false }] MoldInspectionDetailRules.uncompleted = [{ required: false }]
MoldInspectionDetailRules.completionTime = [{ required: true ,message: '该项为必填项'}]
} }
} }
callback() callback()

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

@ -311,12 +311,12 @@ export const MoldInspectionDetailRules = reactive({
], ],
estimatedMinutes:[ estimatedMinutes:[
required, required,
{ validator:validateNum, message: '请输入数字格式', trigger: 'blur'} { validator:validateNum, message: '请输入正整数', trigger: 'blur'}
], ],
number: [required], number: [required],
actualMinutes: [ actualMinutes: [
required, required,
{ validator:validateNum, message: '请输入数字格式', trigger: 'blur'} { validator:validateNum, message: '请输入正整数', trigger: 'blur'}
], ],
maintenance: [required], maintenance: [required],
}) })
@ -374,7 +374,6 @@ export const MoldInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '预计分钟', label: '预计分钟',
field: 'estimatedMinutes', field: 'estimatedMinutes',
sort: 'custom', sort: 'custom',
formatter: dateFormatter,
table: { table: {
width: '150', width: '150',
}, },
@ -414,29 +413,6 @@ export const MoldInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
component: 'Input', component: 'Input',
}, },
}, },
{
label: '完成时间',
field: 'completionTime',
sort: 'custom',
formatter: dateFormatter,
table: {
width: '150',
},
isSearch: false,
isTable: true,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
tableForm: {
type: 'FormDateTime',
valueFormat: 'x'
},
},
{ {
label: '工程师确认', label: '工程师确认',
field: 'engineer', field: 'engineer',
@ -473,6 +449,28 @@ export const MoldInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
}, },
{
label: '完成时间',
field: 'completionTime',
sort: 'custom',
formatter: dateFormatter,
table: {
width: '150',
},
isSearch: false,
isTable: true,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
tableForm: {
type: 'FormDateTime',
valueFormat: 'x'
},
},
{ {
label: '未完成原因', label: '未完成原因',
field: 'uncompleted', field: 'uncompleted',

30
src/views/eam/mold/moldmaintainjob/index.vue

@ -512,36 +512,44 @@ function buttonControllFunction(row, val) {
} }
} }
function detailOnChange(field, cur, item) { function detailOnChange(field, cur, item,formRef) {
if (field == 'status') { if (field == 'status') {
if (cur == '1') { if (cur == '1') {
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
MoldMaintainOrderDetailRules.uncompleted = [{ required: true }] MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = true
formRef.setValues({completionTime:''})
MoldMaintainOrderDetailRules.uncompleted = [{ required: true, message: '该项为必填项' }]
MoldMaintainOrderDetailRules.completionTime = [{ required: false }]
} else { } else {
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = false
MoldMaintainOrderDetailRules.uncompleted = [{ required: false }] MoldMaintainOrderDetailRules.uncompleted = [{ required: false }]
formRef.setValues({uncompleted:''})
MoldMaintainOrderDetailRules.completionTime = [{ required: true , message: '该项为必填项'}]
} }
} }
} }
const openFormCallBack = (type, row, masterParmas, callback) => { const openFormCallBack = (type, row, masterParmas, callback) => {
if (row == undefined || row == null) { if (row == undefined || row == null) {
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = false
MoldMaintainOrderDetailRules.uncompleted = [{ required: false }] MoldMaintainOrderDetailRules.uncompleted = [{ required: false }]
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0' MoldMaintainOrderDetailRules.completionTime = [{ required: true ,message: '该项为必填项'}]
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0'
} else { } else {
if (row.status == '1') { if (cur == '1') {
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
MoldMaintainOrderDetailRules.uncompleted = [{ required: true }] MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = true
MoldMaintainOrderDetailRules.uncompleted = [{ required: true,message: '该项为必填项' }]
MoldMaintainOrderDetailRules.completionTime = [{ required: false }]
} else { } else {
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = false
MoldMaintainOrderDetailRules.uncompleted = [{ required: false }] MoldMaintainOrderDetailRules.uncompleted = [{ required: false }]
MoldMaintainOrderDetailRules.completionTime = [{ required: true ,message: '该项为必填项'}]
} }
} }
callback() callback()
} }
/** 初始化 **/ /** 初始化 **/

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

@ -395,6 +395,27 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
disabled: false, disabled: false,
} }
}, },
},{
label: '完成时间',
field: 'completionTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
}, },
{ {
label: '未完成原因', label: '未完成原因',
@ -479,28 +500,7 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false, isSearch: false,
isTableForm: false, isTableForm: false,
}, },
{
label: '完成时间',
field: 'completionTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{ {
label: '工程师确认', label: '工程师确认',

Loading…
Cancel
Save