diff --git a/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts b/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts index 2ed2310..3b8ae88 100644 --- a/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts +++ b/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts @@ -10,6 +10,7 @@ const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: const dutyUserList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null }) import * as UserApi from '@/api/system/user' +const userListAll = await UserApi.getSimpleUserList() // 表单校验 export const DeviceMaintainOrderMainRules = reactive({ @@ -155,7 +156,11 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive([ table: { width: '150', }, - isDetail:false + isDetail:false, + api: () => userListAll, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userListAll.find((account) => account.id == cellValue)?.nickname + }, }, { label: '接单人员', diff --git a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts index 3dd6b73..96d3c4d 100644 --- a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts +++ b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts @@ -55,7 +55,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([ isTable: true, }, { - label: '设备模具', + label: '设备', field: 'deviceNumber', sort: 'custom', table: { @@ -73,7 +73,8 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([ optionsAlias: { labelField: 'name', valueField: 'number' - } + }, + filterable: true, } }, form: { @@ -84,6 +85,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([ labelField: 'name', valueField: 'number' }, + filterable: true, }, } }, @@ -220,6 +222,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([ labelField: 'label', valueField: 'value' }, + disabled: true, filterable: true, placeholder: "请选择设备" } diff --git a/src/views/eam/device/devicemaintenancejob/index.vue b/src/views/eam/device/devicemaintenancejob/index.vue index afb6452..c9f1181 100644 --- a/src/views/eam/device/devicemaintenancejob/index.vue +++ b/src/views/eam/device/devicemaintenancejob/index.vue @@ -390,6 +390,12 @@ const onChange = (field, cur, item) => { // console.log(item) // console.log(item.componentProps.options) formRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id) + if (judgeIfDeviceRole()) { + formRef.value.formRef.formModel.type = 'DEVICE' + } else { + formRef.value.formRef.formModel.type = 'TECH' + } + } } @@ -889,15 +895,15 @@ 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 tag = false; + // if(data.qty <= 0){ + // message.warning('数量必须大于0') + // tag = false; + // return tag; + // }else { + // tag = true; + // return tag; + // } } // 子表提交 const detailSubmitForm = async (formType, data, formRef, tableList) => { @@ -1013,6 +1019,22 @@ const cancel = () => { showTempIdeaRefView.value = false; }; +const getActorClass = () => { + +} + +const judgeIfDeviceRole = () => { + const rolesOk = userStore.roles.find(item => { + return item == 'device_class_worker_role' || item == 'device_class_Engineer_role' + }) + if (rolesOk != undefined && rolesOk != null) { + return true + } else { + return false + } +} + + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/eam/mold/moldRepair/moldRepair.data.ts b/src/views/eam/mold/moldRepair/moldRepair.data.ts index fde3092..f4a1692 100644 --- a/src/views/eam/mold/moldRepair/moldRepair.data.ts +++ b/src/views/eam/mold/moldRepair/moldRepair.data.ts @@ -106,6 +106,7 @@ export const MoldRepair = useCrudSchemas(reactive([ labelField: 'name', valueField: 'number' }, + filterable: true, }, }, search: { @@ -116,6 +117,7 @@ export const MoldRepair = useCrudSchemas(reactive([ labelField: 'name', valueField: 'number' }, + filterable: true, }, } }, diff --git a/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts b/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts index 3c7e30a..295f647 100644 --- a/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts +++ b/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts @@ -70,7 +70,8 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ optionsAlias: { labelField: 'number', valueField: 'number' - } + }, + filterable: true, } }, form: { @@ -81,6 +82,7 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ labelField: 'number', valueField: 'number' }, + filterable: true, }, } }, @@ -104,7 +106,8 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ optionsAlias: { labelField: 'name', valueField: 'number' - } + }, + filterable: true, } }, form: { @@ -115,6 +118,7 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ labelField: 'name', valueField: 'number' }, + filterable: true, }, } }, @@ -138,7 +142,8 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ optionsAlias: { labelField: 'name', valueField: 'id' - } + }, + filterable: true, } }, form: { @@ -150,6 +155,7 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ labelField: 'name', valueField: 'id' }, + filterable: true, placeholder: "请选择设备" }, } @@ -184,7 +190,8 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ optionsAlias: { labelField: 'name', valueField: 'id' - } + }, + filterable: true, } }, form: { @@ -196,6 +203,7 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ labelField: 'name', valueField: 'id' }, + filterable: true, placeholder: "请选择维修人" }, } @@ -356,7 +364,8 @@ export const MoldInspectionDetail = useCrudSchemas(reactive([ optionsAlias: { labelField: 'name', valueField: 'id' - } + }, + filterable: true, }, formatter: (_: Recordable, __: TableColumn, cellValue: number) => { const cellValueList = cellValue ? cellValue.split(',') : []; @@ -374,6 +383,7 @@ export const MoldInspectionDetail = useCrudSchemas(reactive([ labelField: 'name', valueField: 'id' }, + filterable: true, placeholder: "请选择责任人", multiple: true, }, diff --git a/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts b/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts index e959597..28fd13b 100644 --- a/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts +++ b/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts @@ -70,7 +70,8 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive([ optionsAlias: { labelField: 'name', valueField: 'id' - } + }, + filterable: true, } }, form: { @@ -82,6 +83,7 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive([ labelField: 'name', valueField: 'id' }, + filterable: true, placeholder: "请先选择设备" }, }, @@ -350,7 +352,8 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive([ optionsAlias: { labelField: 'name', valueField: 'id' - } + }, + filterable: true, }, api: () => dutyUserList, formatter: (_: Recordable, __: TableColumn, cellValue: number) => { @@ -366,6 +369,7 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive([ labelField: 'name', valueField: 'id' }, + filterable: true, placeholder: "请选择责任人", multiple: true, }, diff --git a/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts b/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts index 6c64ffa..1c7801c 100644 --- a/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts +++ b/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts @@ -73,7 +73,8 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive([ optionsAlias: { labelField: 'name', valueField: 'id' - } + }, + filterable: true, } }, form: { @@ -85,6 +86,7 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive([ labelField: 'name', valueField: 'id' }, + filterable: true, placeholder: "请先选择设备" }, } @@ -120,22 +122,25 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive([ labelField: 'label', valueField: 'value' }, + filterable: true, }, }, form: { component: 'Select', + api:()=>deviceTypeList, componentProps: { - options: deviceTypeList, + disabled: true, optionsAlias: { labelField: 'label', valueField: 'value' }, - placeholder: "请选择设备" + filterable: true, + placeholder: "请选择类型" } }, }, { - label: '设备模具', + label: '模具', field: 'deviceNumber', sort: 'custom', table: { @@ -153,7 +158,8 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive([ optionsAlias: { labelField: 'name', valueField: 'number' - } + }, + filterable: true, } }, form: { @@ -164,6 +170,7 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive([ labelField: 'name', valueField: 'number' }, + filterable: true, }, } }, @@ -187,7 +194,8 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive([ labelField: 'nickname', valueField: 'id' }, - placeholder: "请先选择模具" + filterable: true, + placeholder: "请先选择维修人" }, }, isSearch:true, @@ -200,7 +208,8 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive([ optionsAlias: { labelField: 'nickname', valueField: 'id' - } + }, + filterable: true, } } }, @@ -350,7 +359,8 @@ export const MoldMaintenanceDetail = useCrudSchemas(reactive([ optionsAlias: { labelField: 'nickname', valueField: 'id' - } + }, + filterable: true, }, form: { component: 'Select', @@ -362,7 +372,8 @@ export const MoldMaintenanceDetail = useCrudSchemas(reactive([ optionsAlias: { labelField: 'name', valueField: 'id' - } + }, + filterable: true, } } }, @@ -559,7 +570,8 @@ export const MoldMaintenanceMainSec = useCrudSchemas(reactive([ optionsAlias: { labelField: 'name', valueField: 'id' - } + }, + filterable: true, } }, form: { @@ -571,6 +583,7 @@ export const MoldMaintenanceMainSec = useCrudSchemas(reactive([ labelField: 'name', valueField: 'id' }, + filterable: true, placeholder: "请先选择设备" }, } @@ -642,6 +655,7 @@ export const MoldMaintenanceMainSec = useCrudSchemas(reactive([ labelField: 'name', valueField: 'id' }, + filterable: true, placeholder: "请先选择模具" }, }