Browse Source

维修工单转办改成待接单

master
ljlong_2630 7 months ago
parent
commit
437342da91
  1. 4
      src/api/eam/device/deviceMaintainOrderMain/index.ts
  2. 5
      src/api/eam/device/deviceMaintenanceMain/index.ts
  3. 8
      src/api/eam/device/deviceRepair/index.ts
  4. 7
      src/api/eam/mold/moldMaintainOrderMain/index.ts
  5. 6
      src/api/eam/mold/moldMaintenanceMain/index.ts
  6. 28
      src/utils/disposition/defaultButtons.ts
  7. 6
      src/views/eam/basic/deviceMaintenance/index.vue
  8. 19
      src/views/eam/basic/moldMaintenance/index.vue
  9. 34
      src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts
  10. 86
      src/views/eam/device/devicemaintainjob/index.vue
  11. 123
      src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts
  12. 218
      src/views/eam/device/devicemaintenancejob/index.vue
  13. 96
      src/views/eam/mold/moldmaintainjob/index.vue
  14. 50
      src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts
  15. 240
      src/views/eam/mold/moldmaintenancejob/index.vue
  16. 125
      src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts

4
src/api/eam/device/deviceMaintainOrderMain/index.ts

@ -70,3 +70,7 @@ export const orderClickFinish = (id: number) => {
return request.get({ url: '/eam/device-maintain-job-main/orderClickFinish?id=' + id }) return request.get({ url: '/eam/device-maintain-job-main/orderClickFinish?id=' + id })
} }
// 验证
export const orderClickApprove = (id: number,status: string,verifyContent: string) => {
return request.get({ url: '/eam/device-maintain-job-main/orderClickVerify?id=' + id + '&status=' + status + '&verifyContent=' + verifyContent })
}

5
src/api/eam/device/deviceMaintenanceMain/index.ts

@ -87,5 +87,8 @@ export const verifyOrder = async (params) => {
} }
// 确认维修工单
export const confirmOrder = async (params) => {
return await request.get({ url: `/eam/device-maintenance-job-main/orderClick`, params})
}

8
src/api/eam/device/deviceRepair/index.ts

@ -59,4 +59,10 @@ export const importTemplate = () => {
// 撤销申请 // 撤销申请
export const rejected = (id: Number) => { export const rejected = (id: Number) => {
return request.delete({ url: '/eam/device-repair-request/rejected?id=' + id }) return request.delete({ url: '/eam/device-repair-request/rejected?id=' + id })
} }
// 根据单号查询申请工单信息
export const getOrderByNumber = (number: Number) => {
return request.get({ url: '/eam/device-repair-request/getOrderByNumber?number=' + number })
}

7
src/api/eam/mold/moldMaintainOrderMain/index.ts

@ -71,3 +71,10 @@ export const orderClickFinish = (id: number) => {
return request.get({ url: '/eam/device-maintain-job-main/orderClickFinish?id=' + id }) return request.get({ url: '/eam/device-maintain-job-main/orderClickFinish?id=' + id })
} }
// 验证
export const orderClickApprove = (id: number,status: string,verifyContent: string) => {
return request.get({ url: '/eam/device-maintain-job-main/orderClickApprove?id=' + id + '&status=' + status + '&approveOpinion=' + verifyContent })
}

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

@ -80,6 +80,12 @@ export const finishOrder = async (params) => {
} }
// 申请人确认工单
export const confirmOrder = async (params) => {
return await request.get({ url: `/eam/device-maintenance-job-main/orderClick`, params})
}
// 校验维修工单 // 校验维修工单
export const verifyOrder = async (params) => { export const verifyOrder = async (params) => {
return await request.get({ url: `/eam/device-maintenance-job-main/orderClick`, params}) return await request.get({ url: `/eam/device-maintenance-job-main/orderClick`, params})

28
src/utils/disposition/defaultButtons.ts

@ -1039,6 +1039,34 @@ export function selectQrCodeBatchBtn(option:any) {
}) })
} }
// 保养
export function maintainBtn(option:any) {
return __defaultBtnOption(option,{
label: '保养',
name: 'maintain',
hide: false,
type: 'warning',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 确认
export function confirmOrderBtn(option:any) {
return __defaultBtnOption(option,{
label: '确认',
name: 'confirmOrder',
hide: false,
type: 'success',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 默认按钮规则 // 默认按钮规则
function __defaultBtnOption(option:any,specific:any){ function __defaultBtnOption(option:any,specific:any){
return { return {

6
src/views/eam/basic/deviceMaintenance/index.vue

@ -88,9 +88,9 @@ import download from '@/utils/download'
import { DeviceMaintenance,DeviceMaintenanceRules } from './deviceMaintenance.data' import { DeviceMaintenance,DeviceMaintenanceRules } from './deviceMaintenance.data'
import * as DeviceMaintenanceApi from '@/api/eam/basic/deviceMaintenance' import * as DeviceMaintenanceApi from '@/api/eam/basic/deviceMaintenance'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import { useUserStore } from '@/store/modules/user'
import Detail from '@/components/Detail/src/Detail.vue'
import { updateForm } from '@/api/bpm/form' import { updateForm } from '@/api/bpm/form'
const userStore = useUserStore() //
defineOptions({ name: 'DeviceMaintenance' }) defineOptions({ name: 'DeviceMaintenance' })
@ -309,6 +309,8 @@ const judgeSame = () => {
return isSame; return isSame;
}; };
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

19
src/views/eam/basic/moldMaintenance/index.vue

@ -87,8 +87,8 @@ import download from '@/utils/download'
import { MoldMaintenance,MoldMaintenanceRules } from './moldMaintenance.data' import { MoldMaintenance,MoldMaintenanceRules } from './moldMaintenance.data'
import * as MoldMaintenanceApi from '@/api/eam/basic/moldMaintenance' import * as MoldMaintenanceApi from '@/api/eam/basic/moldMaintenance'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import { useUserStore } from '@/store/modules/user'
import Detail from '@/components/Detail/src/Detail.vue' const userStore = useUserStore() //
defineOptions({ name: 'MoldMaintenance' }) defineOptions({ name: 'MoldMaintenance' })
@ -303,6 +303,21 @@ const judgeSame = () => {
}; };
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()

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

@ -215,6 +215,37 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
dateFormat:'YYYY-MM-DD HH:mm:ss' dateFormat:'YYYY-MM-DD HH:mm:ss'
} }
}, },
{
label: '审批人',
field: 'verifyer',
sort: 'custom',
isSearch: false,
isTableForm: false,
isForm: false,
isDetail: false,
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
},
{
label: '审批人',
field: 'verifyerDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
{
label: '审批意见',
field: 'verifyContent',
sort: 'custom',
isSearch: false,
isTableForm: false,
isForm: false,
},
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
@ -250,7 +281,6 @@ export const DeviceMaintainOrderDetailRules = reactive({
], ],
chargePeoples: [required], chargePeoples: [required],
completionTime: [required], completionTime: [required],
engineer: [required],
uncompleted: [required], uncompleted: [required],
contents: [required], contents: [required],
}) })
@ -489,7 +519,7 @@ export const DeviceMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
component: 'Input', component: 'Input',
componentProps: { componentProps: {
type:'TextArea' type:'textarea'
} }
} }
}, },

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

@ -96,6 +96,33 @@
@success="importSuccess" @success="importSuccess"
/> />
<Dialog
ref="updateDialog"
title="验证意见"
v-model="dialogVisible"
:width="600"
:maxHeight="700"
:style="{height:'450px'}"
:before-close="handleBeforeClose"
>
<el-form :model="updateFormValue" class="demo-form-inline">
<el-form-item label="验证意见">
<el-input
type="textarea"
v-model="updateFormValue.verifyContent"
placeholder="请填写验证意见"
clearable
:rows="12"
/>
</el-form-item>
</el-form>
<template #footer>
<div style="text-align: center;">
<el-button type="primary" @click="onCancel">取消</el-button>
<el-button type="primary" @click="onSubmit">提交</el-button>
</div>
</template>
</Dialog>
</template> </template>
@ -114,6 +141,7 @@ import { useUserStore } from '@/store/modules/user'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
defineOptions({ name: 'DeviceMaintainOrderMain' }) defineOptions({ name: 'DeviceMaintainOrderMain' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
@ -124,6 +152,11 @@ const formRef = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(DeviceMaintainOrderMain.allSchemas.tableColumns) const tableColumns = ref(DeviceMaintainOrderMain.allSchemas.tableColumns)
const tableData = ref([]) const tableData = ref([])
const dialogVisible = ref(false)
const dialogRowData = ref()
const updateFormValue = ref({
verifyContent:''
})
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
@ -229,20 +262,16 @@ const butttondata = (row) => {
row.status == 'PENDING' && judgeIsTheClass(row) row.status == 'PENDING' && judgeIsTheClass(row)
) )
}), // }), //
// defaultButtons.turnOrderBtn({ defaultButtons.maintainBtn({
// hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
// }), // }),//
// defaultButtons.repairBtn({
// hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
// }), //
// defaultButtons.verifyOrderBtn({
// hide: !(
// row.status == 'COMPLETED'
// )
// }), //
defaultButtons.finishOrderBtn({ defaultButtons.finishOrderBtn({
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
}) // }), //
defaultButtons.verifyOrderBtn({
hide: !(row.status == 'COMPLETED' && judgeIsTheClassEngineer(row))
}), //
] ]
} }
const onChange = (field, cur, item) => { const onChange = (field, cur, item) => {
@ -266,6 +295,10 @@ const buttonTableClick = async (val, row) => {
acceptOrder(row) acceptOrder(row)
} else if (val == 'turnOrder') { } else if (val == 'turnOrder') {
openForm('turnOrder', row) openForm('turnOrder', row)
} else if (val == 'maintain') {
openDetail(row, '代码', row.number)
} else if (val == 'verifyOrder') {
openDialog(row)
} else if (val == 'finishOrder') { } else if (val == 'finishOrder') {
finishOrder(row) finishOrder(row)
} }
@ -283,6 +316,7 @@ const detailRef = ref()
const openDetail =async (row: any, titleName: any, titleValue: any) => { const openDetail =async (row: any, titleName: any, titleValue: any) => {
const userListAll = await UserApi.getSimpleUserList() const userListAll = await UserApi.getSimpleUserList()
row.maintenanceName = userListAll.find((account) => account.id == row.maintenance)?.nickname row.maintenanceName = userListAll.find((account) => account.id == row.maintenance)?.nickname
row.verifyerDetail = userListAll.find((account) => account.id == row.verifyer)?.nickname
detailRef.value.openDetail(row, titleName, titleValue,'DeviceMaintainOrderMain') detailRef.value.openDetail(row, titleName, titleValue,'DeviceMaintainOrderMain')
} }
@ -576,4 +610,32 @@ const openFormCallBack = (type, row, masterParmas, callback) => {
callback() callback()
} }
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
}
}
const openDialog = (row) => {
dialogRowData.value = row
dialogVisible.value = true
}
const onCancel = () => {
dialogVisible.value = false
}
const onSubmit = () => {
DeviceMaintainOrderMainApi.orderClickApprove(dialogRowData.value.id,'VERIFIED',updateFormValue.value.verifyContent)
dialogVisible.value = false
getList()
}
</script> </script>

123
src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts

@ -334,6 +334,129 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.ORDER_COMPLETE_RESULT, dictType: DICT_TYPE.ORDER_COMPLETE_RESULT,
dictClass: 'string', dictClass: 'string',
}, },
{
label: '报修人',
field: 'declarer',
sort: 'custom',
isDetail: false,
table: {
width: '150',
},
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
form: {
component: 'Select',
api: () => userListAll,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
placeholder: "请先选择设备"
},
},
isSearch: true,
search: {
component: 'Select',
api: () => userListAll,
componentProps: {
collapseTags: true,
collapseTagsTooltip: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
}
}
},
{
label: '报修人',
field: 'declarerDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
table: {
width: 150
}
},
{
label: '报修人意见',
field: 'applyContent',
sort: 'custom',
table: {
width: 150
}
},
{
label: '验证人',
field: 'verifyer',
sort: 'custom',
isDetail: false,
table: {
width: '150',
},
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
form: {
component: 'Select',
api: () => userListAll,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
placeholder: "请先选择设备"
},
},
isSearch: true,
search: {
component: 'Select',
api: () => userListAll,
componentProps: {
collapseTags: true,
collapseTagsTooltip: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
}
}
},
{
label: '验证人',
field: 'verifyerDetail',
sort: 'custom',
table: {
width: 150
},
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
{
label: '验证人意见',
field: 'verifyContent',
sort: 'custom',
table: {
width: 150
}
},
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',

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

@ -143,6 +143,68 @@
</template> </template>
</Dialog> </Dialog>
<Dialog
ref="confirmDialog"
title="确认意见"
v-model="confirmDialogVisible"
:width="600"
:maxHeight="760"
:style="{height:'500px'}"
:before-close="handleBeforeConfirmClose"
>
<el-form class="demo-form-inline">
<el-form-item label="确认意见">
<!-- 确保@change事件绑定在el-radio-group上 -->
<el-radio-group v-model="confirmFormValue.confirmStatus">
<el-radio :label="'APPLYPASS'">通过</el-radio>
<el-radio :label="'APPLYREJECTED'">驳回</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="意见">
<el-input
type="textarea"
v-model="confirmFormValue.confirmContent"
placeholder="请填写意见"
clearable
:rows="12"
/>
</el-form-item>
</el-form>
<template #footer>
<div style="text-align: center;">
<el-button type="primary" @click="confirmCancel">取消</el-button>
<el-button type="primary" @click="confirmSubmit">提交</el-button>
</div>
</template>
</Dialog>
<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">
@ -168,6 +230,8 @@ import { selectAllFactoryArea } from '@/api/system/dept'
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'
import { emit } from 'process' import { emit } from 'process'
import { verify } from 'crypto'
import { watch } from 'vue';
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD') const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD')
defineOptions({ name: 'DeviceMaintenanceMain' }) defineOptions({ name: 'DeviceMaintenanceMain' })
@ -195,10 +259,20 @@ const tempIdeaRefViewKey = ref(0)
const tempIdeaRefViewTitle = ref('是否临时措施') const tempIdeaRefViewTitle = ref('是否临时措施')
const isTemporary = ref(false) const isTemporary = ref(false)
const tempIdeaRefViewData = ref() const tempIdeaRefViewData = ref()
const confirmDialogVisible = ref(false)
const verifyDialogVisible = ref(false)
const confirmFormValue = ref({
confirmStatus: 'APPLYPASS',
confirmContent: '',
})
const verifyFormValue = ref({
verifyContent: '',
})
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
const openRowValue = ref()
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => { nextTick(() => {
@ -296,6 +370,37 @@ const judgeIsTheClassEngineer = (row) => {
} }
} }
const judgeIsTheClassEngineerAndApply = (row,type) => {
//
const rolesOk = userStore.roles.some(item => {
if (row.type == 'DEVICE') {
return item === 'device_class_Engineer_role';
} else if (row.type == 'TECH') {
return item === 'tech_class_Engineer_role';
}
});
// false
if (!rolesOk) return false;
//
if (row.status === 'COMPLETED' && type == 'CONFIRM') {
// COMPLETEDrequestNumberdeclarer
if(row.requestNumber != null && row.requestNumber !== '' && row.declarer === userStore.getUser.id){
return true
}else{
return false
}
} else if (row.status === 'APPLYPASS' && type == 'VERIFY') {
// APPLYPASStrue
//
return true;
}
// COMPLETEDAPPLYPASSCOMPLETEDfalse
return false;
}
const judgeIsTheClassWorker = (row) => { const judgeIsTheClassWorker = (row) => {
const rolesOk = userStore.roles.find(item => { const rolesOk = userStore.roles.find(item => {
if (row.type == 'DEVICE') { if (row.type == 'DEVICE') {
@ -361,7 +466,7 @@ const isShowMainButton = (row, val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
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' && row.status != 'APPLYPASS' && isReceiver(row.maintenance) )}), //
defaultButtons.acceptOrderBtn({ defaultButtons.acceptOrderBtn({
hide: !( hide: !(
row.status == 'PENDING' && judgeIsTheClass(row) row.status == 'PENDING' && judgeIsTheClass(row)
@ -375,12 +480,17 @@ const butttondata = (row) => {
}), // }), //
defaultButtons.verifyOrderBtn({ defaultButtons.verifyOrderBtn({
hide: !( hide: !(
row.status == 'COMPLETED' && judgeIsTheClassEngineer(row) judgeIsTheClassEngineerAndApply(row,'VERIFY')
) )
}), // }), //
defaultButtons.finishOrderBtn({ defaultButtons.finishOrderBtn({
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && row.hasDetails) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && row.hasDetails)
}), // }), //
defaultButtons.confirmOrderBtn({
hide: !(
judgeIsTheClassEngineerAndApply(row,'CONFIRM')
)
}), //
defaultButtons.pictureBtn({ defaultButtons.pictureBtn({
hide: !(row.filePathList != null && row.filePathList.length > 0) hide: !(row.filePathList != null && row.filePathList.length > 0)
}) // }) //
@ -417,65 +527,50 @@ const onChangeSec = (field, cur, item,formRefSec) => {
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.options = moldList.value }).componentProps.options = moldList.value
selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: null }).then(res => {
repairUser.value = res
const setV = {}
setV['maintenance'] = ''
formRefSec.setValues(setV)
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance'
}).componentProps.options = res
})
MoldAccountsApi.getMoldAccountsNoPage({}).then(res => { MoldAccountsApi.getMoldAccountsNoPage({}).then(res => {
const setV = {} const setV = {}
setV['deviceNumber'] = '' setV['deviceNumber'] = ''
setV['maintenance'] = ''
formRefSec.setValues(setV) formRefSec.setValues(setV)
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'maintenance'
}).componentProps.options = res }).componentProps.disabled = true
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
}) })
} else if (cur == 'TECH') { } else if (cur == 'TECH') {
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.options = deviceList.value }).componentProps.options = deviceList.value
selecUserByType({ classType: 'TECH', factoryAreaNumber: '', flag: null }).then(res => { DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => {
repairUser.value = res
const setV = {} const setV = {}
setV['deviceNumber'] = ''
setV['maintenance'] = '' setV['maintenance'] = ''
formRefSec.setValues(setV) formRefSec.setValues(setV)
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance' return item.field == 'maintenance'
}).componentProps.disabled = true
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res }).componentProps.options = res
}) })
DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => {
const setV = {}
setV['deviceNumber'] = ''
formRefSec.setValues(setV)
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
} else if(cur == 'DEVICE'){ } else if(cur == 'DEVICE'){
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.options = deviceList.value }).componentProps.options = deviceList.value
selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null }).then(res => { DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => {
repairUser.value = res
const setV = {} const setV = {}
setV['deviceNumber'] = ''
setV['maintenance'] = '' setV['maintenance'] = ''
formRefSec.setValues(setV) formRefSec.setValues(setV)
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance' return item.field == 'maintenance'
}).componentProps.disabled = true
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res }).componentProps.options = res
}) })
DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => {
const setV = {}
setV['deviceNumber'] = ''
formRefSec.setValues(setV)
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
} }
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance' return item.field == 'maintenance'
@ -489,6 +584,7 @@ const onChangeSec = (field, cur, item,formRefSec) => {
setV['deviceNumber'] = newRow.value.deviceNumber setV['deviceNumber'] = newRow.value.deviceNumber
setV['type'] = newRow.value.type setV['type'] = newRow.value.type
formRefSec.setValues(setV) formRefSec.setValues(setV)
DeviceMaintenanceMainSecRules.maintenance = [{ required: false }]
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'type' return item.field == 'type'
}).componentProps.disabled = false }).componentProps.disabled = false
@ -536,6 +632,7 @@ const onChangeSec = (field, cur, item,formRefSec) => {
setV['factoryAreaNumber'] = newRow.value.factoryAreaNumber setV['factoryAreaNumber'] = newRow.value.factoryAreaNumber
setV['maintenance'] = newRow.value.maintenance setV['maintenance'] = newRow.value.maintenance
formRefSec.setValues(setV) formRefSec.setValues(setV)
DeviceMaintenanceMainSecRules.maintenance = [{ required: true }]
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'type' return item.field == 'type'
}).componentProps.disabled = true }).componentProps.disabled = true
@ -628,6 +725,8 @@ const buttonTableClick = async (val, row) => {
finishOrder(row) finishOrder(row)
} else if (val == 'verifyOrder') { } else if (val == 'verifyOrder') {
verifyOrder(row) verifyOrder(row)
} else if (val == 'confirmOrder') {
confirmOrder(row)
} else if (val == 'picture') { } else if (val == 'picture') {
showView.value = true showView.value = true
urls.value = row.filePathList urls.value = row.filePathList
@ -650,6 +749,10 @@ const openFormSec = async (type: string, row?: any) => {
tableData.value = [] // tableData.value = [] //
newRow.value = { ...row } newRow.value = { ...row }
newRow.value.turnType = '0' newRow.value.turnType = '0'
DeviceMaintenanceMainSecRules.classes = [{ required: false }]
DeviceMaintenanceMainSecRules.faultType = [{ required: false }]
DeviceMaintenanceMainSecRules.describes = [{ required: false }]
DeviceMaintenanceMainSecRules.maintenance = [{ required: false }]
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'type' return item.field == 'type'
}).componentProps.disabled = false }).componentProps.disabled = false
@ -703,6 +806,8 @@ const openDetail = async (row: any, titleName: any, titleValue: any) => {
row.deviceNumberDetail = moldAllList.find((account) => account.number == row.deviceNumber)?.name row.deviceNumberDetail = moldAllList.find((account) => account.number == row.deviceNumber)?.name
row.factoryAreaNumberDetail = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name row.factoryAreaNumberDetail = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name
row.maintenanceDetail = userListAll.find((account) => account.id == row.maintenance)?.nickname row.maintenanceDetail = userListAll.find((account) => account.id == row.maintenance)?.nickname
row.declarerDetail = userListAll.find((account) => account.id == row.declarer)?.nickname
row.verifyerDetail = userListAll.find((account) => account.id == row.verifyer)?.nickname
console.log(row) console.log(row)
operatRecord.value = row; operatRecord.value = row;
detailRef.value.openDetail(row, titleName, titleValue,'DeviceMaintenanceMain') detailRef.value.openDetail(row, titleName, titleValue,'DeviceMaintenanceMain')
@ -799,17 +904,61 @@ function confirmFinish(row) {
// //
function verifyOrder(row) { function verifyOrder(row) {
openRowValue.value = row
verifyDialogVisible.value = true
}
//
function verifySubmit() {
const row = openRowValue.value
let param = { let param = {
id: row.id, id: row.id,
number: row.number, number: row.number,
status: row.status, status: row.status,
requestNumber: row.requestNumber, requestNumber: row.requestNumber,
content: verifyFormValue.value.verifyContent
} }
DeviceMaintenanceMainApi.verifyOrder(param).then(res => { DeviceMaintenanceMainApi.verifyOrder(param).then(res => {
verifyDialogVisible.value = false
getList()
message.success('操作成功')
})
}
//
function verifyCancel(row) {
verifyDialogVisible.value = false
}
//
function confirmOrder(row) {
openRowValue.value = row
confirmDialogVisible.value = true
}
//
function confirmSubmit() {
const row = openRowValue.value
let param = {
id: row.id,
number: row.number,
status: row.status,
result: confirmFormValue.value.confirmStatus,
requestNumber: row.requestNumber,
content: confirmFormValue.value.confirmContent,
}
DeviceMaintenanceMainApi.confirmOrder(param).then(res => {
confirmDialogVisible.value = false
getList() getList()
message.success('操作成功') message.success('操作成功')
}) })
} }
//
function confirmCancel(row) {
confirmDialogVisible.value = false
}
// //
function repair() {} function repair() {}
@ -1077,6 +1226,7 @@ const validateRow = (row) => {
return true; return true;
}; };
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

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

@ -95,6 +95,36 @@
:importTemplateData="importTemplateData" :importTemplateData="importTemplateData"
@success="importSuccess" @success="importSuccess"
/> />
<Dialog
ref="updateDialog"
title="验证意见"
v-model="dialogVisible"
:width="600"
:maxHeight="700"
:style="{height:'450px'}"
:before-close="handleBeforeClose"
>
<el-form :model="updateFormValue" class="demo-form-inline">
<el-form-item label="验证意见">
<el-input
type="textarea"
v-model="updateFormValue.verifyContent"
placeholder="请填写验证意见"
clearable
:rows="12"
/>
</el-form-item>
</el-form>
<template #footer>
<div style="text-align: center;">
<el-button type="primary" @click="onCancel">取消</el-button>
<el-button type="primary" @click="onSubmit">提交</el-button>
</div>
</template>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -124,6 +154,11 @@ const tableColumns = ref(MoldMaintainOrderMain.allSchemas.tableColumns)
const apiPage = ref(MoldMaintainOrderDetailApi.getMoldMaintainOrderDetailPage) const apiPage = ref(MoldMaintainOrderDetailApi.getMoldMaintainOrderDetailPage)
const detailAllSchemas = ref(MoldMaintainOrderDetail.allSchemas) const detailAllSchemas = ref(MoldMaintainOrderDetail.allSchemas)
const tableData = ref([]) const tableData = ref([])
const updateFormValue = ref({
verifyContent:''
})
const dialogVisible = ref(false)
const dialogRowData = ref()
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
@ -228,20 +263,15 @@ const butttondata = (row) => {
row.status == 'PENDING' && judgeIsTheClass(row) row.status == 'PENDING' && judgeIsTheClass(row)
) )
}), // }), //
// defaultButtons.turnOrderBtn({ defaultButtons.maintainBtn({
// hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
// }), // }),//
// defaultButtons.repairBtn({
// hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
// }), //
// defaultButtons.verifyOrderBtn({
// hide: !(
// row.status == 'COMPLETED'
// )
// }), //
defaultButtons.finishOrderBtn({ defaultButtons.finishOrderBtn({
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
}) // }), //
defaultButtons.verifyOrderBtn({
hide: !(row.status == 'COMPLETED' && judgeIsTheClassEngineer(row))
}), //
] ]
} }
const onChange = (field, cur, item) => { const onChange = (field, cur, item) => {
@ -267,6 +297,10 @@ const buttonTableClick = async (val, row) => {
acceptOrder(row) acceptOrder(row)
} else if (val == 'turnOrder') { } else if (val == 'turnOrder') {
openForm('turnOrder', row) openForm('turnOrder', row)
} else if (val == 'maintain') {
openDetail(row, '代码', row.number)
} else if (val == 'verifyOrder') {
openDialog(row)
} else if (val == 'finishOrder') { } else if (val == 'finishOrder') {
finishOrder(row) finishOrder(row)
} }
@ -286,6 +320,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any) => {
row.maintenanceName = userListAll.find((account) => account.id == row.maintenance)?.nickname row.maintenanceName = userListAll.find((account) => account.id == row.maintenance)?.nickname
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
row.factoryAreaNumber1 = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name row.factoryAreaNumber1 = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name
row.verifyerDetail = userListAll.find((account) => account.id == row.verifyer)?.nickname
detailRef.value.openDetail(row, titleName, titleValue,'MoldMaintainOrderMain') detailRef.value.openDetail(row, titleName, titleValue,'MoldMaintainOrderMain')
} }
@ -353,6 +388,17 @@ function acceptOrder(row) {
function turnOrder() {} function turnOrder() {}
// //
function finishOrder(row) { function finishOrder(row) {
// MoldMaintainOrderDetailApi.getMoldMaintainOrderDetailPage({
// masterId: row.id,
// isSearch: false,
// status: 0,
// }).then(( res) => {
// if (res.data.length === 0) {
// message.warning('')
// return
// }
// })
MoldMaintainOrderMainApi.orderClickFinish(row.id).then(() => { MoldMaintainOrderMainApi.orderClickFinish(row.id).then(() => {
message.success('完成保养') message.success('完成保养')
getList(); getList();
@ -576,6 +622,32 @@ const judgeIsTheClass = (row) => {
} }
} }
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
}
}
const openDialog = (row) => {
dialogRowData.value = row
dialogVisible.value = true
}
const onCancel = () => {
dialogVisible.value = false
}
const onSubmit = (val) => {
MoldMaintainOrderMainApi.orderClickApprove(dialogRowData.value.id,'VERIFIED',updateFormValue.value.verifyContent)
dialogVisible.value = false
getList()
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {

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

@ -5,6 +5,9 @@ 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'
import { validateNum,validateNum100 } from '@/utils/validator' import { validateNum,validateNum100 } from '@/utils/validator'
import * as UserApi from '@/api/system/user'
const userListAll = await UserApi.getSimpleUserList()
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
const userList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 }) const userList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 })
const dutyUserList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: undefined }) const dutyUserList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: undefined })
@ -150,6 +153,10 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '接单人员', label: '接单人员',
field: 'maintenance', field: 'maintenance',
sort: 'custom', sort: 'custom',
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
isSearch: false, isSearch: false,
table: { table: {
width: '150', width: '150',
@ -209,7 +216,37 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
dateFormat:'YYYY-MM-DD HH:mm:ss' dateFormat:'YYYY-MM-DD HH:mm:ss'
} }
}, },
{
label: '审批人',
field: 'verifyer',
sort: 'custom',
isSearch: false,
isTableForm: false,
isForm: false,
isDetail: false,
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
},
{
label: '审批人',
field: 'verifyerDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
{
label: '审批意见',
field: 'verifyContent',
sort: 'custom',
isSearch: false,
isTableForm: false,
isForm: false,
},
// { // {
// label: '创建时间', // label: '创建时间',
// field: 'createTime', // field: 'createTime',
@ -266,6 +303,7 @@ export const MoldMaintainOrderDetailRules = reactive({
concurrencyStamp: [required], concurrencyStamp: [required],
name: [required], name: [required],
number: [required], number: [required],
status: [required],
peoples: [ peoples: [
required, required,
{ validator: validateNum, message: '请输入正整数', trigger: 'blur' }, { validator: validateNum, message: '请输入正整数', trigger: 'blur' },
@ -307,9 +345,9 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false, isSearch: false,
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps:{ componentProps:{
disabled:true disabled:true
} }
}, },
isTable: true, isTable: true,
tableForm: { tableForm: {
@ -515,8 +553,6 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false, isSearch: false,
isTableForm: false, isTableForm: false,
}, },
{ {
label: '工程师确认', label: '工程师确认',
field: 'engineer', field: 'engineer',
@ -525,7 +561,7 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
component: 'Input', component: 'Input',
componentProps: { componentProps: {
type: 'TextArea' type: 'textarea'
} }
} }
}, },

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

@ -142,7 +142,68 @@
</template> </template>
</Dialog> </Dialog>
<Dialog
ref="confirmDialog"
title="确认意见"
v-model="confirmDialogVisible"
:width="600"
:maxHeight="760"
:style="{height:'500px'}"
:before-close="handleBeforeConfirmClose"
>
<el-form class="demo-form-inline">
<el-form-item label="确认意见">
<!-- 确保@change事件绑定在el-radio-group上 -->
<el-radio-group v-model="confirmFormValue.confirmStatus">
<el-radio :label="'APPLYPASS'">通过</el-radio>
<el-radio :label="'APPLYREJECTED'">驳回</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="意见">
<el-input
type="textarea"
v-model="confirmFormValue.confirmContent"
placeholder="请填写意见"
clearable
:rows="12"
/>
</el-form-item>
</el-form>
<template #footer>
<div style="text-align: center;">
<el-button type="primary" @click="confirmCancel">取消</el-button>
<el-button type="primary" @click="confirmSubmit">提交</el-button>
</div>
</template>
</Dialog>
<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>
@ -190,6 +251,16 @@ const tempIdeaRefViewKey = ref(0)
const tempIdeaRefViewTitle = ref('是否临时措施') const tempIdeaRefViewTitle = ref('是否临时措施')
const isTemporary = ref(false) const isTemporary = ref(false)
const tempIdeaRefViewData = ref() const tempIdeaRefViewData = ref()
const confirmDialogVisible = ref(false)
const verifyDialogVisible = ref(false)
const confirmFormValue = ref({
confirmStatus: 'APPLYPASS',
confirmContent: '',
})
const verifyFormValue = ref({
verifyContent: '',
})
const openRowValue = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(MoldMaintenanceMain.allSchemas.tableColumns) const tableColumns = ref(MoldMaintenanceMain.allSchemas.tableColumns)
@ -362,7 +433,7 @@ const isShowMainButton = (row, val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
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' && row.status != 'APPLYPASS' && isReceiver(row.maintenance) )}), //
defaultButtons.acceptOrderBtn({ defaultButtons.acceptOrderBtn({
hide: !( hide: !(
row.status == 'PENDING' && judgeIsTheClass(row) row.status == 'PENDING' && judgeIsTheClass(row)
@ -376,12 +447,17 @@ const butttondata = (row) => {
}), // }), //
defaultButtons.verifyOrderBtn({ defaultButtons.verifyOrderBtn({
hide: !( hide: !(
row.status == 'COMPLETED' && judgeIsTheClassEngineer(row) judgeIsTheClassEngineerAndApply(row,'VERIFY')
) )
}), // }), //
defaultButtons.finishOrderBtn({ defaultButtons.finishOrderBtn({
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && row.hasDetails) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && row.hasDetails)
}), // }), //
defaultButtons.confirmOrderBtn({
hide: !(
judgeIsTheClassEngineerAndApply(row,'CONFIRM')
)
}), //
defaultButtons.pictureBtn({ defaultButtons.pictureBtn({
hide: !(row.filePathList != null && row.filePathList.length > 0) hide: !(row.filePathList != null && row.filePathList.length > 0)
}) // }) //
@ -419,8 +495,10 @@ const buttonTableClick = async (val, row) => {
openFormSec('turnOrder', row) openFormSec('turnOrder', row)
} else if (val == 'finishOrder') { } else if (val == 'finishOrder') {
finishOrder(row) finishOrder(row)
} else if (val == 'verifyOrder') { } else if (val == 'verifyOrder') {
verifyOrder(row) verifyOrder(row)
} else if (val == 'confirmOrder') {
confirmOrder(row)
} else if (val == 'repair') { } else if (val == 'repair') {
openDetail(row, '代码', row.code) openDetail(row, '代码', row.code)
} else if (val == 'picture') { } else if (val == 'picture') {
@ -453,6 +531,8 @@ const openDetail = async (row: any, titleName: any, titleValue: any) => {
row.deviceNumberDetail = moldListAll.find((account) => account.number == row.deviceNumber)?.name row.deviceNumberDetail = moldListAll.find((account) => account.number == row.deviceNumber)?.name
row.factoryAreaNumberDetail = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name row.factoryAreaNumberDetail = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name
row.maintenanceDetail = userListAll.find((account) => account.id == row.maintenance)?.nickname row.maintenanceDetail = userListAll.find((account) => account.id == row.maintenance)?.nickname
row.declarerDetail = userListAll.find((account) => account.id == row.declarer)?.nickname
row.verifyerDetail = userListAll.find((account) => account.id == row.verifyer)?.nickname
operatRecord.value = row; operatRecord.value = row;
detailRef.value.openDetail(row, titleName, titleValue,'MoldMaintenanceMain') detailRef.value.openDetail(row, titleName, titleValue,'MoldMaintenanceMain')
} }
@ -545,17 +625,61 @@ function confirmFinish(row) {
// //
function verifyOrder(row) { function verifyOrder(row) {
openRowValue.value = row
verifyDialogVisible.value = true
}
//
function verifySubmit() {
const row = openRowValue.value
let param = { let param = {
id: row.id, id: row.id,
number: row.number, number: row.number,
status: row.status, status: row.status,
requestNumber: row.requestNumber, requestNumber: row.requestNumber,
content: verifyFormValue.value.verifyContent
} }
MoldMaintenanceMainApi.verifyOrder(param).then(res => { MoldMaintenanceMainApi.verifyOrder(param).then(res => {
verifyDialogVisible.value = false
getList()
message.success('操作成功')
})
}
//
function verifyCancel(row) {
verifyDialogVisible.value = false
}
//
function confirmOrder(row) {
openRowValue.value = row
confirmDialogVisible.value = true
}
//
function confirmSubmit() {
const row = openRowValue.value
let param = {
id: row.id,
number: row.number,
status: row.status,
result: confirmFormValue.value.confirmStatus,
requestNumber: row.requestNumber,
content: confirmFormValue.value.confirmContent,
}
MoldMaintenanceMainApi.confirmOrder(param).then(res => {
confirmDialogVisible.value = false
getList() getList()
message.success('操作成功') message.success('操作成功')
}) })
} }
//
function confirmCancel(row) {
confirmDialogVisible.value = false
}
// //
function repair() {} function repair() {}
@ -718,6 +842,10 @@ const openFormSec = async (type: string, row?: any) => {
tableData.value = [] // tableData.value = [] //
newRow.value = { ...row } newRow.value = { ...row }
newRow.value.turnType = '0' newRow.value.turnType = '0'
MoldMaintenanceMainSecRules.classes = [{ required: false }]
MoldMaintenanceMainSecRules.faultType = [{ required: false }]
MoldMaintenanceMainSecRules.describes = [{ required: false }]
MoldMaintenanceMainSecRules.maintenance = [{ required: false }]
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'type' return item.field == 'type'
}).componentProps.disabled = false }).componentProps.disabled = false
@ -764,82 +892,50 @@ const openFormSec = async (type: string, row?: any) => {
const onChangeSec = (field, cur, item,formRefSec) => { const onChangeSec = (field, cur, item,formRefSec) => {
if (field == 'type') { if (field == 'type') {
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance'
}).componentProps.optionsAlias = {
labelField: 'name',
valueField: 'id'
}
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.disabled = false }).componentProps.disabled = false
if (cur == 'MOLD') { if (cur == 'MOLD') {
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = moldList.value
selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: null }).then(res => {
repairUser.value = res
const setV = {}
setV['maintenance'] = ''
formRefSec.setValues(setV)
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance'
}).componentProps.options = res
})
MoldAccountsApi.getMoldAccountsNoPage({}).then(res => { MoldAccountsApi.getMoldAccountsNoPage({}).then(res => {
const setV = {} const setV = {}
setV['deviceNumber'] = '' setV['deviceNumber'] = ''
formRefSec.setValues(setV)
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
} else if (cur == 'TECH') {
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = deviceList.value
selecUserByType({ classType: 'TECH', factoryAreaNumber: '', flag: null }).then(res => {
repairUser.value = res
const setV = {}
setV['maintenance'] = '' setV['maintenance'] = ''
formRefSec.setValues(setV) formRefSec.setValues(setV)
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance' return item.field == 'deviceNumber'
}).componentProps.options = moldList.value
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res }).componentProps.options = res
}) })
} else if (cur == 'TECH') {
DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => { DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => {
const setV = {} const setV = {}
setV['deviceNumber'] = '' setV['deviceNumber'] = ''
formRefSec.setValues(setV)
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
} else if(cur == 'DEVICE'){
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = deviceList.value
selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null }).then(res => {
repairUser.value = res
const setV = {}
setV['maintenance'] = '' setV['maintenance'] = ''
formRefSec.setValues(setV) formRefSec.setValues(setV)
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance' return item.field == 'deviceNumber'
}).componentProps.options = deviceList.value
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res }).componentProps.options = res
}) })
} else if(cur == 'DEVICE'){
DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => { DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => {
const setV = {} const setV = {}
setV['deviceNumber'] = '' setV['deviceNumber'] = ''
setV['maintenance'] = ''
formRefSec.setValues(setV) formRefSec.setValues(setV)
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.options = res }).componentProps.options = deviceList.value
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
}) })
} }
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance'
}).componentProps.disabled = false
} }
if (field == 'turnType') { if (field == 'turnType') {
if (cur == '0') { if (cur == '0') {
@ -849,6 +945,7 @@ const onChangeSec = (field, cur, item,formRefSec) => {
setV['deviceNumber'] = newRow.value.deviceNumber setV['deviceNumber'] = newRow.value.deviceNumber
setV['type'] = newRow.value.type setV['type'] = newRow.value.type
formRefSec.setValues(setV) formRefSec.setValues(setV)
MoldMaintenanceMainSecRules.maintenance = [{ required: false }]
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'type' return item.field == 'type'
}).componentProps.disabled = false }).componentProps.disabled = false
@ -897,6 +994,7 @@ const onChangeSec = (field, cur, item,formRefSec) => {
setV['deviceNumber'] = newRow.value.deviceNumber setV['deviceNumber'] = newRow.value.deviceNumber
setV['type'] = newRow.value.type setV['type'] = newRow.value.type
formRefSec.setValues(setV) formRefSec.setValues(setV)
MoldMaintenanceMainSecRules.maintenance = [{ required: true }]
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'type' return item.field == 'type'
}).componentProps.disabled = true }).componentProps.disabled = true
@ -938,6 +1036,7 @@ const onChangeSec = (field, cur, item,formRefSec) => {
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance' return item.field == 'maintenance'
}).componentProps.disabled = false }).componentProps.disabled = false
MoldMaintenanceMainSecRules.maintenance = [{ required: true }]
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance' return item.field == 'maintenance'
}).componentProps.options = res }).componentProps.options = res
@ -1037,6 +1136,39 @@ const validateRow = (row) => {
}; };
const judgeIsTheClassEngineerAndApply = (row,type) => {
//
const rolesOk = userStore.roles.some(item => {
if (row.type == 'MOLD') {
return item === 'mold_class_Engineer_role';
}
});
// false
if (!rolesOk) return false;
//
if (row.status === 'COMPLETED' && type == 'CONFIRM') {
// COMPLETEDrequestNumberdeclarer
if(row.requestNumber != null && row.requestNumber !== '' && row.declarer === userStore.getUser.id){
return true
}else{
return false
}
} else if (row.status === 'APPLYPASS' && type == 'VERIFY') {
// APPLYPASStrue
//
return true;
}
// COMPLETEDAPPLYPASSCOMPLETEDfalse
return false;
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

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

@ -329,6 +329,128 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.ORDER_COMPLETE_RESULT, dictType: DICT_TYPE.ORDER_COMPLETE_RESULT,
dictClass: 'string', dictClass: 'string',
}, },
{
label: '报修人',
field: 'declarer',
sort: 'custom',
isDetail: false,
table: {
width: '150',
},
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
form: {
component: 'Select',
api: () => userListAll,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
placeholder: "请先选择设备"
},
},
isSearch: true,
search: {
component: 'Select',
api: () => userListAll,
componentProps: {
collapseTags: true,
collapseTagsTooltip: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
}
}
},
{
label: '报修人',
field: 'declarerDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
table: {
width: 150
}
},
{
label: '报修人意见',
field: 'applyContent',
sort: 'custom',
table: {
width: 150
}
},
{
label: '验证人',
field: 'verifyer',
sort: 'custom',
isDetail: false,
table: {
width: '150',
},
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
form: {
component: 'Select',
api: () => userListAll,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
placeholder: "请先选择设备"
},
},
isSearch: true,
search: {
component: 'Select',
api: () => userListAll,
componentProps: {
collapseTags: true,
collapseTagsTooltip: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
}
}
},
{
label: '验证人',
field: 'verifyerDetail',
sort: 'custom',
table: {
width: 150
},
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
{
label: '验证人意见',
field: 'verifyContent',
sort: 'custom',
table: {
width: 150
}
},
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
@ -636,7 +758,7 @@ export const MoldMaintenanceMainSec = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
{ {
label: '设备模具', label: '模具',
field: 'deviceNumber', field: 'deviceNumber',
sort: 'custom', sort: 'custom',
table: { table: {
@ -691,7 +813,6 @@ export const MoldMaintenanceMainSec = useCrudSchemas(reactive<CrudSchema[]>([
valueField: 'id' valueField: 'id'
}, },
filterable: true, filterable: true,
placeholder: "请先选择模具"
}, },
} }
}, },

Loading…
Cancel
Save