diff --git a/src/views/eam/basic/item/item.data.ts b/src/views/eam/basic/item/item.data.ts index de8f673..b0dc092 100644 --- a/src/views/eam/basic/item/item.data.ts +++ b/src/views/eam/basic/item/item.data.ts @@ -219,31 +219,31 @@ export const Item = useCrudSchemas(reactive([ } } }, - { - label: '是否可用', - field: 'available', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', - isSearch: false, - isTable: true, - sort: 'custom', - table: { - width: 150 - }, - tableForm: { - type: 'Select', - inactiveValue: 'FALSE', - disabled: true - }, - form: { - component: 'Switch', - value: 'TRUE', - componentProps: { - inactiveValue: 'FALSE', - activeValue: 'TRUE' - } - } - }, + // { + // label: '是否可用', + // field: 'available', + // dictType: DICT_TYPE.TRUE_FALSE, + // dictClass: 'string', + // isSearch: false, + // isTable: true, + // sort: 'custom', + // table: { + // width: 150 + // }, + // tableForm: { + // type: 'Select', + // inactiveValue: 'FALSE', + // disabled: true + // }, + // form: { + // component: 'Switch', + // value: 'TRUE', + // componentProps: { + // inactiveValue: 'FALSE', + // activeValue: 'TRUE' + // } + // } + // }, { label: '创建时间', field: 'createTime', diff --git a/src/views/eam/device/deviceinspectionjob/index.vue b/src/views/eam/device/deviceinspectionjob/index.vue index 44685e7..d719ef2 100644 --- a/src/views/eam/device/deviceinspectionjob/index.vue +++ b/src/views/eam/device/deviceinspectionjob/index.vue @@ -142,12 +142,20 @@ const { tableObject, tableMethods } = useTable({ // 获得表格的各种操作 const { getList, setSearchParams } = tableMethods +const judgeHasAddFunc = () => { + const rolesOk = userStore.roles.find(item => { + return item == 'device_class_worker_role' || item == 'device_class_Engineer_role' || item == 'tech_class_worker_role' || item == 'tech_class_Engineer_role' + }) + if (rolesOk != undefined && rolesOk != null && rolesOk.length > 0) { + return true + } else { + return false + } +} + // 列表头部按钮 const HeadButttondata = [ - // defaultButtons.defaultAddBtn({hasPermi:'eam:deviceInspectionMain:create'}), // 新增 - // defaultButtons.defaultImportBtn({hasPermi:'eam:deviceInspectionMain:import'}), // 导入 - // defaultButtons.defaultExportBtn({ hasPermi: 'eam:deviceInspectionMain:export' }), // 导出 - defaultButtons.defaultAddBtn({ hide: !(userStore?.userSelfInfo?.posts?.some((item) => item.code == 'worker') || userStore?.userSelfInfo?.posts?.some((item) => item.code == 'engineer')) }), // 新增 + defaultButtons.defaultAddBtn({ hide: !(judgeHasAddFunc()) }), // 新增 defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 defaultButtons.defaultSetBtn(null), // 设置 @@ -189,7 +197,7 @@ const butttondata = (row) => { return [ // defaultButtons.mainListEditBtn({hasPermi:'eam:deviceInspectionMain:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceInspectionMain:delete'}), // 删除 - defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED')}), // 编辑 + 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.finishOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //完成 ] @@ -530,19 +538,19 @@ const openFormCallBack = (type, row, masterParmas, callback) => { function buttonControllFunction(row, val) { if (val == 'delete') { - if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance)) { return false } else { return true } } else if (val == 'edit') { - if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance)) { return false } else { return true } } else if(val == 'add') { - if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance)) { return false } else { return true @@ -552,6 +560,14 @@ function buttonControllFunction(row, val) { } } +function isReceiver(orderPerson) { + if (orderPerson == userStore?.getUser?.id) { + return true + } else { + return false + } +} + /** 初始化 **/ onMounted(async () => { diff --git a/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts b/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts index 6160d1d..a4311f6 100644 --- a/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts +++ b/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts @@ -142,6 +142,15 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive([ dictType: DICT_TYPE.DEVICE_MOLD_TYPE, dictClass: 'string', }, + { + label: '接单人员', + field: 'maintenance', + sort: 'custom', + isSearch: false, + table: { + width: '150', + }, + }, { label: '接单时间', field: 'receiveTime', @@ -159,19 +168,6 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive([ } }, }, - { - label: '接单人员', - field: 'maintenance', - sort: 'custom', - isSearch: false, - table: { - width: '150', - }, - form: { - component: 'InputNumber', - value: 0 - }, - }, { label: '完成时间', field: 'finishedTime', diff --git a/src/views/eam/device/devicemaintainjob/index.vue b/src/views/eam/device/devicemaintainjob/index.vue index 764c78e..ec353f4 100644 --- a/src/views/eam/device/devicemaintainjob/index.vue +++ b/src/views/eam/device/devicemaintainjob/index.vue @@ -501,13 +501,13 @@ function buttonControllFunction(row, val) { if (val == 'delete') { return false } else if (val == 'edit') { - if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance)) { return false } else { return true } } else if(val == 'add') { - if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance)) { return false } else { return true @@ -517,6 +517,14 @@ function buttonControllFunction(row, val) { } } +function isReceiver(orderPerson) { + if (orderPerson == userStore?.getUser?.id) { + return true + } else { + return false + } +} + function detailOnChange(field, cur, item,formRef) { if (field == 'status') { if (cur == '1') { diff --git a/src/views/eam/device/devicemaintenancejob/index.vue b/src/views/eam/device/devicemaintenancejob/index.vue index bca63e5..b391c8f 100644 --- a/src/views/eam/device/devicemaintenancejob/index.vue +++ b/src/views/eam/device/devicemaintenancejob/index.vue @@ -227,9 +227,22 @@ const { tableObject, tableMethods } = useTable({ // 获得表格的各种操作 const { getList, setSearchParams } = tableMethods + +const judgeHasAddFunc = () => { + const rolesOk = userStore.roles.find(item => { + return item == 'device_class_worker_role' || item == 'device_class_Engineer_role' || item == 'tech_class_worker_role' || item == 'tech_class_Engineer_role' + }) + if (rolesOk != undefined && rolesOk != null && rolesOk.length > 0) { + return true + } else { + return false + } +} + + // 列表头部按钮 const HeadButttondata = [ - defaultButtons.defaultAddBtn(null), // 新增 + defaultButtons.defaultAddBtn({ hide: !(judgeHasAddFunc()) }), // 新增 defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 defaultButtons.defaultSetBtn(null) // 设置 @@ -272,7 +285,7 @@ const isShowMainButton = (row, val) => { // 列表-操作按钮 const butttondata = (row) => { return [ - defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED')}), // 编辑 + defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance) )}), // 编辑 defaultButtons.acceptOrderBtn({ hide: !( row.status == 'PENDING' @@ -754,19 +767,19 @@ const openFormCallBack = (type, row, masterParmas, callback) => { function buttonControllFunction(row, val) { if (val == 'delete') { - if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance) ) { return false } else { return true } } else if (val == 'edit') { - if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance) ) { return false } else { return true } } else if(val == 'add') { - if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance) ) { return false } else { return true @@ -777,6 +790,15 @@ function buttonControllFunction(row, val) { } + +function isReceiver(orderPerson) { + if (orderPerson == userStore?.getUser?.id) { + return true + } else { + return false + } +} + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/eam/mold/moldinspectionjob/index.vue b/src/views/eam/mold/moldinspectionjob/index.vue index 0ef774b..2098968 100644 --- a/src/views/eam/mold/moldinspectionjob/index.vue +++ b/src/views/eam/mold/moldinspectionjob/index.vue @@ -143,12 +143,22 @@ const { tableObject, tableMethods } = useTable({ // 获得表格的各种操作 const { getList, setSearchParams } = tableMethods + +const judgeHasAddFunc = () => { + const rolesOk = userStore.roles.find(item => { + return item == 'mold_class_worker_role' || item == 'mold_class_worker_role' + }) + if (rolesOk != undefined && rolesOk != null && rolesOk.length > 0) { + return true + } else { + return false + } +} + + // 列表头部按钮 const HeadButttondata = [ - // defaultButtons.defaultAddBtn({hasPermi:'eam:moldInspectionMain:create'}), // 新增 - // defaultButtons.defaultImportBtn({hasPermi:'eam:moldInspectionMain:import'}), // 导入 - // defaultButtons.defaultExportBtn({ hasPermi: 'eam:moldInspectionMain:export' }), // 导出 - defaultButtons.defaultAddBtn(null), // 新增 + defaultButtons.defaultAddBtn({ hide: !(judgeHasAddFunc())}), // 新增 defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 defaultButtons.defaultSetBtn(null), // 设置 @@ -187,7 +197,7 @@ const butttondata = (row) => { return [ // defaultButtons.mainListEditBtn({hasPermi:'eam:moldInspectionMain:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hasPermi:'eam:moldInspectionMain:delete'}), // 删除 - defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED')}), // 编辑 + 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.finishOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //完成 ] @@ -517,19 +527,19 @@ const openFormCallBack = (type, row, masterParmas, callback) => { function buttonControllFunction(row, val) { if (val == 'delete') { - if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance)) { return false } else { return true } } else if (val == 'edit') { - if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance)) { return false } else { return true } } else if(val == 'add') { - if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance)) { return false } else { return true @@ -539,6 +549,14 @@ function buttonControllFunction(row, val) { } } +function isReceiver(orderPerson) { + if (orderPerson == userStore?.getUser?.id) { + return true + } else { + return false + } +} + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/eam/mold/moldmaintainjob/index.vue b/src/views/eam/mold/moldmaintainjob/index.vue index a223a85..22dccfb 100644 --- a/src/views/eam/mold/moldmaintainjob/index.vue +++ b/src/views/eam/mold/moldmaintainjob/index.vue @@ -496,13 +496,13 @@ function buttonControllFunction(row, val) { if (val == 'delete') { return false } else if (val == 'edit') { - if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance) ) { return false } else { return true } } else if(val == 'add') { - if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance)) { return false } else { return true @@ -552,6 +552,18 @@ const openFormCallBack = (type, row, masterParmas, callback) => { } callback() } + + +function isReceiver(orderPerson) { + if (orderPerson == userStore?.getUser?.id) { + return true + } else { + return false + } +} + + + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts b/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts index 22acc3a..1e250ac 100644 --- a/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts +++ b/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts @@ -134,6 +134,15 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive([ dictType: DICT_TYPE.DEVICE_MOLD_TYPE, dictClass: 'string', }, + { + label: '接单人员', + field: 'maintenance', + sort: 'custom', + isSearch: false, + table: { + width: '150', + }, + }, { label: '接单时间', field: 'receiveTime', diff --git a/src/views/eam/mold/moldmaintenancejob/index.vue b/src/views/eam/mold/moldmaintenancejob/index.vue index e62cf95..11c9eff 100644 --- a/src/views/eam/mold/moldmaintenancejob/index.vue +++ b/src/views/eam/mold/moldmaintenancejob/index.vue @@ -230,14 +230,31 @@ const { tableObject, tableMethods } = useTable({ // 获得表格的各种操作 const { getList, setSearchParams } = tableMethods + + +const judgeHasAddFunc = () => { + const rolesOk = userStore.roles.find(item => { + return item == 'mold_class_worker_role' || item == 'mold_class_worker_role' + }) + if (rolesOk != undefined && rolesOk != null && rolesOk.length > 0) { + return true + } else { + return false + } +} + + + // 列表头部按钮 const HeadButttondata = [ - defaultButtons.defaultAddBtn(null), // 新增 + defaultButtons.defaultAddBtn({ hide: !(judgeHasAddFunc())}), // 新增 defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 defaultButtons.defaultSetBtn(null) // 设置 ] + + // 头部按钮事件 const buttonBaseClick = (val, item) => { if (val == 'add') { @@ -282,7 +299,7 @@ const isShowMainButton = (row, val) => { // 列表-操作按钮 const butttondata = (row) => { return [ - defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED')}), // 编辑 + defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED') && isReceiver(row.maintenance)}), // 编辑 defaultButtons.acceptOrderBtn({ hide: !( row.status == 'PENDING' && @@ -720,7 +737,7 @@ const onChangeSec = (field, cur, item,formRefSec) => { } if (field == 'factoryAreaNumber') { - selecUserByType({ classType: 'DEVICE', factoryAreaNumber: cur, flag: null }).then(res => { + selecUserByType({ classType: 'MOLD', factoryAreaNumber: cur, flag: null }).then(res => { repairUser.value = res const setV = {} setV['maintenance'] = '' @@ -765,19 +782,19 @@ const submitFormSec = async (formType, data) => { function buttonControllFunction(row, val) { if (val == 'delete') { - if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance)) { return false } else { return true } } else if (val == 'edit') { - if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance) ) { return false } else { return true } } else if(val == 'add') { - if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance)) { return false } else { return true @@ -788,6 +805,13 @@ function buttonControllFunction(row, val) { } +function isReceiver(orderPerson) { + if (orderPerson == userStore?.getUser?.id) { + return true + } else { + return false + } +} /** 初始化 **/ onMounted(async () => {