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. 41
      src/views/eam/device/deviceinspectionjob/index.vue
  4. 44
      src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts
  5. 23
      src/views/eam/device/devicemaintainjob/index.vue
  6. 43
      src/views/eam/mold/moldinspectionjob/index.vue
  7. 50
      src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts
  8. 24
      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) {
props.openFormCallBack(type, row, masterParmas.value, () => {
formRef.value.open(type, row, masterParmas.value)
@ -603,8 +604,8 @@ watch(
}
)
function onChange(field, cur, item) {
emit('detailOnChange', field, cur, item)
function onChange(field, cur, item,formRef) {
emit('detailOnChange', field, cur, item,formRef)
}
</script>

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

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

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

@ -389,24 +389,7 @@ const detailOpenForm = (type, row) => {
// /
const detailValidate = (data) => {
// return true;
let tag = false;
// 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
}
let tag = true;
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 (cur == '1') {
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 {
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 }]
formRef.setValues({uncompleted:''})
DeviceInspectionDetailRules.completionTime = [{ required: true , message: '该项为必填项'}]
}
}
}
@ -517,17 +505,22 @@ function detailOnChange(field, cur, item) {
const openFormCallBack = (type, row, masterParmas, callback) => {
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.value = ''
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = false
DeviceInspectionDetailRules.uncompleted = [{ required: false }]
DeviceInspectionDetailRules.completionTime = [{ required: true ,message: '该项为必填项'}]
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0'
} else {
if (row.status == '1') {
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 {
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.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: '未完成原因',
field: 'uncompleted',
@ -430,28 +452,6 @@ export const DeviceMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: 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: '工程师确认',

23
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 (cur == '1') {
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 {
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
DeviceMaintainOrderDetailRules.uncompleted= [{ required: false }]
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = 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) => {
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.value = ''
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = false
DeviceMaintainOrderDetailRules.uncompleted = [{ required: false }]
DeviceMaintainOrderDetailRules.completionTime = [{ required: true ,message: '该项为必填项'}]
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0'
} else {
if (row.status == '1') {
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 {
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.completionTime = [{ required: true ,message: '该项为必填项'}]
}
}
callback()

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

@ -375,25 +375,7 @@ const detailOpenForm = (type, row) => {
// /
const detailValidate = (data) => {
// return 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
}
let tag = true;
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 (cur == '1') {
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 {
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 }]
formRef.setValues({uncompleted:''})
MoldInspectionDetailRules.completionTime = [{ required: true , message: '该项为必填项'}]
}
}
}
@ -508,17 +495,21 @@ function detailOnChange(field, cur, item) {
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 = ''
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = false
MoldInspectionDetailRules.uncompleted = [{ required: false }]
MoldInspectionDetailRules.completionTime = [{ required: true ,message: '该项为必填项'}]
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0'
} else {
if (row.status == '1') {
if (cur == '1') {
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 {
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.completionTime = [{ required: true ,message: '该项为必填项'}]
}
}
callback()

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

@ -311,12 +311,12 @@ export const MoldInspectionDetailRules = reactive({
],
estimatedMinutes:[
required,
{ validator:validateNum, message: '请输入数字格式', trigger: 'blur'}
{ validator:validateNum, message: '请输入正整数', trigger: 'blur'}
],
number: [required],
actualMinutes: [
required,
{ validator:validateNum, message: '请输入数字格式', trigger: 'blur'}
{ validator:validateNum, message: '请输入正整数', trigger: 'blur'}
],
maintenance: [required],
})
@ -374,7 +374,6 @@ export const MoldInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '预计分钟',
field: 'estimatedMinutes',
sort: 'custom',
formatter: dateFormatter,
table: {
width: '150',
},
@ -414,29 +413,6 @@ export const MoldInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
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: '工程师确认',
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: '未完成原因',
field: 'uncompleted',

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

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

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

@ -395,6 +395,27 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
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: '未完成原因',
@ -479,28 +500,7 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: 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: '工程师确认',

Loading…
Cancel
Save