Browse Source

添加检修工单指定检修人并添加工程师验证功能

master
ljlong_2630 7 months ago
parent
commit
392cc800c3
  1. 6
      src/api/eam/device/deviceInspectionMain/index.ts
  2. 6
      src/api/eam/mold/moldInspectionMain/index.ts
  3. 66
      src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts
  4. 80
      src/views/eam/device/deviceinspectionjob/index.vue
  5. 85
      src/views/eam/mold/moldinspectionjob/index.vue
  6. 63
      src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts

6
src/api/eam/device/deviceInspectionMain/index.ts

@ -67,4 +67,10 @@ export const finishInspection = (id: number) => {
// 查询检修工单主列表 // 查询检修工单主列表
export const getDeviceInspectionMainNoPage = async (params) => { export const getDeviceInspectionMainNoPage = async (params) => {
return await request.get({ url: `/eam/device-inspection-job-main/noPage`, params }) return await request.get({ url: `/eam/device-inspection-job-main/noPage`, params })
}
//验证
export const verifyOrder = async (id: number,verifyContent: string) => {
return await request.get({ url: `/eam/device-inspection-job-main/onVerify?id=`+id+`&verifyContent=` + verifyContent })
} }

6
src/api/eam/mold/moldInspectionMain/index.ts

@ -61,4 +61,10 @@ export const importTemplate = () => {
// 查询检修工单主列表 // 查询检修工单主列表
export const getMoldInspectionMainNoPage = async (params) => { export const getMoldInspectionMainNoPage = async (params) => {
return await request.get({ url: `/eam/device-inspection-job-main/noPage`, params }) return await request.get({ url: `/eam/device-inspection-job-main/noPage`, params })
}
//验证
export const verifyOrder = async (id: number,verifyContent: string) => {
return await request.get({ url: `/eam/device-inspection-job-main/onVerify?id=`+id+`&verifyContent=` + verifyContent })
} }

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

@ -35,7 +35,6 @@ 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],
@ -192,7 +191,7 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
component: 'Select', component: 'Select',
api: () => userListAll, api: () => userListAll,
componentProps: { componentProps: {
disabled: true, disabled: false,
optionsAlias: { optionsAlias: {
labelField: 'nickname', labelField: 'nickname',
valueField: 'id' valueField: 'id'
@ -236,7 +235,7 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
width: '150', width: '150',
}, },
isSearch: true, isSearch: true,
dictType: DICT_TYPE.JX_STATUS, dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
dictClass: 'string', dictClass: 'string',
form: { form: {
component: 'Select', component: 'Select',
@ -308,6 +307,65 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
}, },
{
label: '验证人',
field: 'verifyer',
sort: 'custom',
isDetail: false,
isSearch: false,
isForm: false,
table: {
width: '150',
},
api: () => userList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
search: {
show: true,
component: 'Select',
api: () => dutyUserList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
}
},
form: {
component: 'Select',
api: () => dutyUserList,
componentProps: {
// disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
placeholder: "请选择维修人"
},
}
},
{
label: '验证人',
field: 'verifyerDetail',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail: true
},
{
label: '验证意见',
field: 'verifyContent',
sort: 'custom',
isSearch: false,
isForm: false,
table: {
width: '230',
},
},
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
@ -336,7 +394,9 @@ export const DeviceInspectionDetailRules = reactive({
{ validator: validateNum, message: '请输入正整数', trigger: 'blur' }, { validator: validateNum, message: '请输入正整数', trigger: 'blur' },
], ],
number: [required], number: [required],
status: [required],
actualMinutes: [ actualMinutes: [
required,
{ validator: validateNum, message: '请输入正整数', trigger: 'blur' }, { validator: validateNum, message: '请输入正整数', trigger: 'blur' },
], ],
maintenance: [required], maintenance: [required],

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

@ -78,6 +78,36 @@
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/device-inspection-job-main/import" :importTemplateData="importTemplateData" <ImportForm ref="importFormRef" url="/eam/device-inspection-job-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" /> @success="importSuccess" />
<Dialog
ref="verifyDialog"
title="验证意见"
v-model="verifyDialogVisible"
:width="600"
:maxHeight="700"
:style="{height:'450px'}"
:before-close="handleBeforeVerifyClose"
>
<el-form :model="verifyFormValue" class="demo-form-inline">
<el-form-item label="验证意见">
<el-input
type="textarea"
v-model="verifyFormValue.verifyContent"
placeholder="请填写验证意见"
clearable
:rows="12"
/>
</el-form-item>
</el-form>
<template #footer>
<div style="text-align: center;">
<el-button type="primary" @click="verifyCancel">取消</el-button>
<el-button type="primary" @click="verifySubmit">提交</el-button>
</div>
</template>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -108,6 +138,11 @@ const tableColumns = ref(DeviceInspectionMain.allSchemas.tableColumns)
const Echo = [] const Echo = []
const tableData = ref([]) const tableData = ref([])
const formRef = ref() const formRef = ref()
const verifyDialogVisible = ref(false)
const verifyFormValue = ref({
verifyContent: '',
})
const openRowValue = ref()
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => { nextTick(() => {
@ -176,7 +211,7 @@ const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') { //
DeviceInspectionMain.allSchemas.formSchema.find(item => { DeviceInspectionMain.allSchemas.formSchema.find(item => {
return item.field == 'status' return item.field == 'status'
}).value = 'PROCCED' }).value = 'PECEIVED'
DeviceInspectionMain.allSchemas.formSchema.find(item => { DeviceInspectionMain.allSchemas.formSchema.find(item => {
return item.field == 'type' return item.field == 'type'
}).value = 'DEVICE' }).value = 'DEVICE'
@ -199,8 +234,11 @@ const butttondata = (row) => {
// defaultButtons.mainListEditBtn({hasPermi:'eam:deviceInspectionMain:update'}), // // defaultButtons.mainListEditBtn({hasPermi:'eam:deviceInspectionMain:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceInspectionMain:delete'}), // // defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceInspectionMain:delete'}), //
// defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance))}), // // defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance))}), //
defaultButtons.mainInspectionOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), // defaultButtons.mainInspectionOrderBtn({ hide: !(row.status == 'PECEIVED' && (userStore.getUser.id == row.maintenance)) }), //
defaultButtons.finishOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), // defaultButtons.finishOrderBtn({ hide: !(row.status == 'PECEIVED' && (userStore.getUser.id == row.maintenance)) }), //
defaultButtons.verifyOrderBtn({
hide: !(row.status == 'COMPLETED' && judgeIsTheClassEngineer(row))
}), //
] ]
} }
@ -212,6 +250,8 @@ const buttonTableClick = async (val, row) => {
openDetail(row, '代码', row.number) openDetail(row, '代码', row.number)
} else if (val == 'finishOrder') { // } else if (val == 'finishOrder') { //
handleFinishOrder(row) handleFinishOrder(row)
} else if (val == 'verifyOrder') { //
verifyOrder(row)
} }
} }
@ -284,6 +324,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any) => {
const userListAll = await UserApi.getSimpleUserList() const userListAll = await UserApi.getSimpleUserList()
row.factoryAreaNumber1 = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name row.factoryAreaNumber1 = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name
row.maintenance1 = userListAll.find((account) => account.id == row.maintenance)?.nickname row.maintenance1 = userListAll.find((account) => account.id == row.maintenance)?.nickname
row.verifyerDetail = userListAll.find((account) => account.id == row.verifyer)?.nickname
detailRef.value.openDetail(row, titleName, titleValue, 'basicDeviceInspectionMain') detailRef.value.openDetail(row, titleName, titleValue, 'basicDeviceInspectionMain')
} }
@ -592,6 +633,39 @@ function isReceiver(orderPerson) {
} }
//
function verifyOrder(row) {
openRowValue.value = row
verifyDialogVisible.value = true
}
//
function verifySubmit() {
const row = openRowValue.value
DeviceInspectionMainApi.verifyOrder(row.id,verifyFormValue.value.verifyContent).then(res => {
verifyDialogVisible.value = false
getList()
message.success('操作成功')
})
}
//
function verifyCancel(row) {
verifyDialogVisible.value = false
}
const judgeIsTheClassEngineer = (row) => {
const rolesOk = userStore.roles.find(item => {
return item == 'device_class_Engineer_role'
})
if (rolesOk != undefined && rolesOk != null) {
return true
} else {
return false
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

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

@ -78,6 +78,36 @@
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/mold-inspection-main/import" :importTemplateData="importTemplateData" <ImportForm ref="importFormRef" url="/eam/mold-inspection-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" /> @success="importSuccess" />
<Dialog
ref="verifyDialog"
title="验证意见"
v-model="verifyDialogVisible"
:width="600"
:maxHeight="700"
:style="{height:'450px'}"
:before-close="handleBeforeVerifyClose"
>
<el-form :model="verifyFormValue" class="demo-form-inline">
<el-form-item label="验证意见">
<el-input
type="textarea"
v-model="verifyFormValue.verifyContent"
placeholder="请填写验证意见"
clearable
:rows="12"
/>
</el-form-item>
</el-form>
<template #footer>
<div style="text-align: center;">
<el-button type="primary" @click="verifyCancel">取消</el-button>
<el-button type="primary" @click="verifySubmit">提交</el-button>
</div>
</template>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -118,6 +148,11 @@ const tableColumns = ref(MoldInspectionMain.allSchemas.tableColumns)
const Echo = [] const Echo = []
const tableData = ref([]) const tableData = ref([])
const formRef = ref() const formRef = ref()
const verifyDialogVisible = ref(false)
const verifyFormValue = ref({
verifyContent: '',
})
const openRowValue = ref()
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => { nextTick(() => {
@ -207,8 +242,11 @@ const butttondata = (row) => {
// defaultButtons.mainListEditBtn({hasPermi:'eam:moldInspectionMain:update'}), // // defaultButtons.mainListEditBtn({hasPermi:'eam:moldInspectionMain:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:moldInspectionMain:delete'}), // // defaultButtons.mainListDeleteBtn({hasPermi:'eam:moldInspectionMain:delete'}), //
// defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance))}), // // defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance))}), //
defaultButtons.mainInspectionOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), // defaultButtons.mainInspectionOrderBtn({ hide: !(row.status == 'PECEIVED' && (userStore.getUser.id == row.maintenance)) }), //
defaultButtons.finishOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), // defaultButtons.finishOrderBtn({ hide: !(row.status == 'PECEIVED' && (userStore.getUser.id == row.maintenance)) }), //
defaultButtons.verifyOrderBtn({
hide: !(row.status == 'COMPLETED' && judgeIsTheClassEngineer(row))
}), //
] ]
} }
@ -220,6 +258,8 @@ const buttonTableClick = async (val, row) => {
openDetail(row, '代码', row.number) openDetail(row, '代码', row.number)
} else if (val == 'finishOrder') { // } else if (val == 'finishOrder') { //
handleFinishOrder(row) handleFinishOrder(row)
} else if (val == 'verifyOrder') { //
verifyOrder(row)
} }
} }
@ -290,6 +330,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any) => {
const userListAll = await UserApi.getSimpleUserList() const userListAll = await UserApi.getSimpleUserList()
row.factoryAreaNumber1 = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name row.factoryAreaNumber1 = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name
row.maintenance1 = userListAll.find((account) => account.id == row.maintenance)?.nickname row.maintenance1 = userListAll.find((account) => account.id == row.maintenance)?.nickname
row.verifyerDetail = userListAll.find((account) => account.id == row.verifyer)?.nickname
detailRef.value.openDetail(row, titleName, titleValue, 'basicMoldInspectionMain') detailRef.value.openDetail(row, titleName, titleValue, 'basicMoldInspectionMain')
} }
@ -382,13 +423,13 @@ function handleFinishOrder(row) {
const onChange = (field, cur, item) => { const onChange = (field, cur, item) => {
// //
if (field == 'deviceNumber') { if (field == 'deviceNumber') {
basicFormRef.value.formRef.formModel.factoryAreaNumber = Number(item.componentProps.options.find(element => element.number == cur).factoryAreaNumber) basicFormRef.value.formRef.formModel.factoryAreaNumber = String(item.componentProps.options.find(element => element.number == cur).factoryAreaNumber)
basicFormRef.value.formRef.formModel.maintenance = String(userStore?.getUser?.id) basicFormRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id)
basicFormRef.value.formRef.formModel.maintenanceNumber = '' basicFormRef.value.formRef.formModel.maintenanceNumber = ''
} else if (field == 'maintenanceNumber') { } else if (field == 'maintenanceNumber') {
basicFormRef.value.formRef.formModel.deviceNumber = item.componentProps.options.find(element => element.number == cur).deviceNumber basicFormRef.value.formRef.formModel.deviceNumber = item.componentProps.options.find(element => element.number == cur).deviceNumber
basicFormRef.value.formRef.formModel.factoryAreaNumber = Number(item.componentProps.options.find(element => element.number == cur).factoryAreaNumber) basicFormRef.value.formRef.formModel.factoryAreaNumber = String(item.componentProps.options.find(element => element.number == cur).factoryAreaNumber)
basicFormRef.value.formRef.formModel.maintenance = String(userStore?.getUser?.id) basicFormRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id)
} }
} }
@ -595,6 +636,38 @@ function isReceiver(orderPerson) {
} }
} }
//
function verifyOrder(row) {
openRowValue.value = row
verifyDialogVisible.value = true
}
//
function verifySubmit() {
const row = openRowValue.value
MoldInspectionMainApi.verifyOrder(row.id,verifyFormValue.value.verifyContent).then(res => {
verifyDialogVisible.value = false
getList()
message.success('操作成功')
})
}
//
function verifyCancel(row) {
verifyDialogVisible.value = false
}
const judgeIsTheClassEngineer = (row) => {
const rolesOk = userStore.roles.find(item => {
return item == 'mold_class_Engineer_role'
})
if (rolesOk != undefined && rolesOk != null) {
return true
} else {
return false
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

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

@ -198,7 +198,7 @@ export const MoldInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
component: 'Select', component: 'Select',
api: () => dutyUserList, api: () => dutyUserList,
componentProps: { componentProps: {
disabled: true, // disabled: true,
optionsAlias: { optionsAlias: {
labelField: 'name', labelField: 'name',
valueField: 'id' valueField: 'id'
@ -230,7 +230,7 @@ export const MoldInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
width: '150', width: '150',
}, },
isSearch: true, isSearch: true,
dictType: DICT_TYPE.JX_STATUS, dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
dictClass: 'string', dictClass: 'string',
form: { form: {
component: 'Select', component: 'Select',
@ -299,6 +299,65 @@ export const MoldInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
}, },
{
label: '验证人',
field: 'verifyer',
sort: 'custom',
isDetail: false,
isSearch: false,
isForm: false,
table: {
width: '150',
},
api: () => userList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
search: {
show: true,
component: 'Select',
api: () => dutyUserList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
}
},
form: {
component: 'Select',
api: () => dutyUserList,
componentProps: {
// disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
placeholder: "请选择维修人"
},
}
},
{
label: '验证人',
field: 'verifyerDetail',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail: true
},
{
label: '验证意见',
field: 'verifyContent',
sort: 'custom',
isSearch: false,
isForm: false,
table: {
width: '230',
},
},
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',

Loading…
Cancel
Save