From e6e56b1780340d3b53bfdd8197f09a6cada770ab Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Wed, 20 Mar 2024 13:16:03 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eam/basic/fixedAssets/fixedAssets.data.ts | 1 + .../eam/device/deviceMaintainPlan/index.vue | 4 +- .../device/deviceRepair/deviceRepair.data.ts | 26 +++++ src/views/eam/device/deviceRepair/index.vue | 7 +- .../deviceSpotInspectionRecordMain/index.vue | 24 +++- .../eam/device/deviceinspectionjob/index.vue | 11 +- .../eam/device/devicemaintainjob/index.vue | 8 +- .../eam/device/devicemaintenancejob/index.vue | 28 ++++- src/views/eam/mold/moldMaintainPlan/index.vue | 4 +- .../eam/mold/moldRepair/moldRepair.data.ts | 12 +- .../eam/mold/moldinspectionjob/index.vue | 11 +- src/views/eam/mold/moldmaintainjob/index.vue | 11 +- .../eam/mold/moldmaintenancejob/index.vue | 28 ++++- .../moldMaintenanceMain.data.ts | 110 ++++++++++-------- 14 files changed, 213 insertions(+), 72 deletions(-) diff --git a/src/views/eam/basic/fixedAssets/fixedAssets.data.ts b/src/views/eam/basic/fixedAssets/fixedAssets.data.ts index 67d230f..2717d2c 100644 --- a/src/views/eam/basic/fixedAssets/fixedAssets.data.ts +++ b/src/views/eam/basic/fixedAssets/fixedAssets.data.ts @@ -54,6 +54,7 @@ export const FixedAssets = useCrudSchemas(reactive([ sort: 'custom', table: { width: '150', + fixed: 'left', }, isSearch: true, isForm: false, diff --git a/src/views/eam/device/deviceMaintainPlan/index.vue b/src/views/eam/device/deviceMaintainPlan/index.vue index 6a979a6..a5b9edf 100644 --- a/src/views/eam/device/deviceMaintainPlan/index.vue +++ b/src/views/eam/device/deviceMaintainPlan/index.vue @@ -133,8 +133,8 @@ const buttonBaseClick = (val, item) => { // 列表-操作按钮 const butttondata = [ - defaultButtons.mainListEditBtn({hasPermi:'eam:deviceMaintainPlan:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceMaintainPlan:delete'}), // 删除 + // defaultButtons.mainListEditBtn({hasPermi:'eam:deviceMaintainPlan:update'}), // 编辑 + // defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceMaintainPlan:delete'}), // 删除 ] // 列表-操作按钮事件 diff --git a/src/views/eam/device/deviceRepair/deviceRepair.data.ts b/src/views/eam/device/deviceRepair/deviceRepair.data.ts index 6799e9c..c9aec40 100644 --- a/src/views/eam/device/deviceRepair/deviceRepair.data.ts +++ b/src/views/eam/device/deviceRepair/deviceRepair.data.ts @@ -4,6 +4,8 @@ import { selectAllFactoryArea } from '@/api/system/dept' import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' import { validateHanset,validateNumDot, validateEmail } from '@/utils/validator' +import * as UserApi from '@/api/system/user' +const userListAll = await UserApi.getSimpleUserList() // 邮箱账号的列表 const factoryList = await selectAllFactoryArea() const deviceList = ref([]); @@ -81,6 +83,29 @@ export const DeviceRepair = useCrudSchemas(reactive([ }, } }, + { + label: '报修人', + field: 'declarer', + sort: 'custom', + table: { + width: '150', + }, + isForm: false, + isDetail: false, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userListAll.find((account) => account.id == cellValue)?.nickname + }, + search: { + component: 'Select', + componentProps: { + options: userListAll, + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + }, + }, + }, + }, { label: '设备', field: 'deviceNumber', @@ -147,6 +172,7 @@ export const DeviceRepair = useCrudSchemas(reactive([ width: '150', }, }, + { label: '故障类型', field: 'faultType', diff --git a/src/views/eam/device/deviceRepair/index.vue b/src/views/eam/device/deviceRepair/index.vue index 839a6e5..f23218c 100644 --- a/src/views/eam/device/deviceRepair/index.vue +++ b/src/views/eam/device/deviceRepair/index.vue @@ -67,12 +67,16 @@ import * as DeviceRepairApi from '@/api/eam/device/deviceRepair' import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as DeviceAccountApi from '@/api/eam/device/deviceAccounts' import { DeviceAccounts } from '../deviceAccounts/deviceAccounts.data' +import { useUserStore } from '@/store/modules/user' // import TableHead from '@/components/TableHead/src/TableHead.vue' // import ImportForm from '@/components/ImportForm/src/ImportForm.vue' // import Detail from '@/components/Detail/src/Detail.vue' defineOptions({ name: 'DeviceRepair' }) + +const userStore = useUserStore() + const message = useMessage() // 消息弹窗 const { t } = useI18n() // 国际化 @@ -148,7 +152,8 @@ const butttondata = (row) => { return [ // defaultButtons.mainListEditBtn({hasPermi:'eam:deviceRepair:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({ hasPermi: 'eam:deviceRepair:delete' }), // 删除 - defaultButtons.backoutBtn({ hide: row.result != 'PENDING' }), // 撤销 + + defaultButtons.backoutBtn({ hide: !(row.result == 'PENDING' && row.declarer == userStore.getUser.id )}), // 撤销 ] } diff --git a/src/views/eam/device/deviceSpotInspectionRecordMain/index.vue b/src/views/eam/device/deviceSpotInspectionRecordMain/index.vue index a85a473..c6a3c43 100644 --- a/src/views/eam/device/deviceSpotInspectionRecordMain/index.vue +++ b/src/views/eam/device/deviceSpotInspectionRecordMain/index.vue @@ -223,7 +223,7 @@ const isShowMainButton = (row, val) => { // 列表-操作按钮 const butttondata = (row) => { return [ - defaultButtons.mainListEditBtn(null), // 编辑 + defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED')}), // 编辑 defaultButtons.acceptOrderBtn({ hide: !( row.status == 'PENDING' && @@ -480,9 +480,25 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { } } -const buttonControllFunction = (row, val) => { - if (val == 'add') { - return false +function buttonControllFunction(row, val) { + if (val == 'delete') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + return false + } else { + return true + } + } else if (val == 'edit') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + return false + } else { + return true + } + } else if(val == 'add') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED') { + return false + } else { + return true + } } else { return true } diff --git a/src/views/eam/device/deviceinspectionjob/index.vue b/src/views/eam/device/deviceinspectionjob/index.vue index 17a5c01..3bc7061 100644 --- a/src/views/eam/device/deviceinspectionjob/index.vue +++ b/src/views/eam/device/deviceinspectionjob/index.vue @@ -534,18 +534,21 @@ const openFormCallBack = (type, row, masterParmas, callback) => { callback() } - function buttonControllFunction(row, val) { if (val == 'delete') { - return false + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + return false + } else { + return true + } } else if (val == 'edit') { - if (row.status == 'COMPLETED') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { return false } else { return true } } else if(val == 'add') { - if (row.status == 'COMPLETED') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED') { return false } else { return true diff --git a/src/views/eam/device/devicemaintainjob/index.vue b/src/views/eam/device/devicemaintainjob/index.vue index 8c44f7f..3ce43d6 100644 --- a/src/views/eam/device/devicemaintainjob/index.vue +++ b/src/views/eam/device/devicemaintainjob/index.vue @@ -501,7 +501,13 @@ function buttonControllFunction(row, val) { if (val == 'delete') { return false } else if (val == 'edit') { - if (row.status == 'COMPLETED') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + return false + } else { + return true + } + } else if(val == 'add') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED') { return false } else { return true diff --git a/src/views/eam/device/devicemaintenancejob/index.vue b/src/views/eam/device/devicemaintenancejob/index.vue index 9a37de3..bca63e5 100644 --- a/src/views/eam/device/devicemaintenancejob/index.vue +++ b/src/views/eam/device/devicemaintenancejob/index.vue @@ -104,6 +104,7 @@ @detailSubmitForm="detailSubmitForm" :isSearchTableItem="true" :openFormCallBack="openFormCallBack" + :buttonControllFunction="buttonControllFunction" /> @@ -271,7 +272,7 @@ const isShowMainButton = (row, val) => { // 列表-操作按钮 const butttondata = (row) => { return [ - defaultButtons.mainListEditBtn(null), // 编辑 + defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED')}), // 编辑 defaultButtons.acceptOrderBtn({ hide: !( row.status == 'PENDING' @@ -751,6 +752,31 @@ const openFormCallBack = (type, row, masterParmas, callback) => { } } +function buttonControllFunction(row, val) { + if (val == 'delete') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + return false + } else { + return true + } + } else if (val == 'edit') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + return false + } else { + return true + } + } else if(val == 'add') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED') { + return false + } else { + return true + } + } else { + return true + } +} + + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/eam/mold/moldMaintainPlan/index.vue b/src/views/eam/mold/moldMaintainPlan/index.vue index 147997e..a716eb2 100644 --- a/src/views/eam/mold/moldMaintainPlan/index.vue +++ b/src/views/eam/mold/moldMaintainPlan/index.vue @@ -133,8 +133,8 @@ const buttonBaseClick = (val, item) => { // 列表-操作按钮 const butttondata = [ - defaultButtons.mainListEditBtn({hasPermi:'eam:moldMaintainPlan:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hasPermi:'eam:moldMaintainPlan:delete'}), // 删除 + // defaultButtons.mainListEditBtn({hasPermi:'eam:moldMaintainPlan:update'}), // 编辑 + // defaultButtons.mainListDeleteBtn({hasPermi:'eam:moldMaintainPlan:delete'}), // 删除 ] // 列表-操作按钮事件 diff --git a/src/views/eam/mold/moldRepair/moldRepair.data.ts b/src/views/eam/mold/moldRepair/moldRepair.data.ts index 251a797..d7d96c7 100644 --- a/src/views/eam/mold/moldRepair/moldRepair.data.ts +++ b/src/views/eam/mold/moldRepair/moldRepair.data.ts @@ -33,7 +33,7 @@ export const MoldRepair = useCrudSchemas(reactive([ width: '150', fixed: 'left', }, - isSearch: true, + isSearch: false, isForm: false }, { @@ -100,6 +100,16 @@ export const MoldRepair = useCrudSchemas(reactive([ valueField: 'number' }, }, + }, + search: { + component: 'Select', + componentProps: { + options: moldListNoPage, + optionsAlias: { + labelField: 'name', + valueField: 'number' + }, + }, } }, { diff --git a/src/views/eam/mold/moldinspectionjob/index.vue b/src/views/eam/mold/moldinspectionjob/index.vue index 14dbb0e..1536163 100644 --- a/src/views/eam/mold/moldinspectionjob/index.vue +++ b/src/views/eam/mold/moldinspectionjob/index.vue @@ -524,18 +524,21 @@ const openFormCallBack = (type, row, masterParmas, callback) => { callback() } - function buttonControllFunction(row, val) { if (val == 'delete') { - return false + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + return false + } else { + return true + } } else if (val == 'edit') { - if (row.status == 'COMPLETED') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { return false } else { return true } } else if(val == 'add') { - if (row.status == 'COMPLETED') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED') { return false } else { return true diff --git a/src/views/eam/mold/moldmaintainjob/index.vue b/src/views/eam/mold/moldmaintainjob/index.vue index 500331d..c99a066 100644 --- a/src/views/eam/mold/moldmaintainjob/index.vue +++ b/src/views/eam/mold/moldmaintainjob/index.vue @@ -492,12 +492,17 @@ const detailSubmitForm= async (formType,data,getList1,formRef,tableList) => { } } - function buttonControllFunction(row, val) { if (val == 'delete') { - return false + return false } else if (val == 'edit') { - if (row.status == 'COMPLETED') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + return false + } else { + return true + } + } else if(val == 'add') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED') { return false } else { return true diff --git a/src/views/eam/mold/moldmaintenancejob/index.vue b/src/views/eam/mold/moldmaintenancejob/index.vue index eb50ca3..e62cf95 100644 --- a/src/views/eam/mold/moldmaintenancejob/index.vue +++ b/src/views/eam/mold/moldmaintenancejob/index.vue @@ -104,6 +104,7 @@ @detailSubmitForm="detailSubmitForm" :isSearchTableItem="true" :openFormCallBack="openFormCallBack" + :buttonControllFunction="buttonControllFunction" /> @@ -281,7 +282,7 @@ const isShowMainButton = (row, val) => { // 列表-操作按钮 const butttondata = (row) => { return [ - defaultButtons.mainListEditBtn(null), // 编辑 + defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED')}), // 编辑 defaultButtons.acceptOrderBtn({ hide: !( row.status == 'PENDING' && @@ -762,6 +763,31 @@ const submitFormSec = async (formType, data) => { } +function buttonControllFunction(row, val) { + if (val == 'delete') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + return false + } else { + return true + } + } else if (val == 'edit') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { + return false + } else { + return true + } + } else if(val == 'add') { + if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED') { + return false + } else { + return true + } + } else { + return true + } +} + + /** 初始化 **/ onMounted(async () => { diff --git a/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts b/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts index 20db7e1..fcd1524 100644 --- a/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts +++ b/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts @@ -11,6 +11,7 @@ const userListAll = await UserApi.getSimpleUserList() const userStore = useUserStore() const factoryList = await selectAllFactoryArea() const moldList = await MoldAccountsApi.getMoldAccountsNoPage({}) +const moldAllList = await MoldAccountsApi.getMoldAccountsAllNoPage({}) const userList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 }) const dutyUserList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: null }) const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'MOLD') @@ -50,105 +51,118 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive([ isForm: false, isSearch: false, isTable: true, + isDetail: false, }, { - label: '类型', - field: 'type', + label: '厂区', + field: 'factoryAreaNumber', sort: 'custom', table: { width: '150', }, + api: () => factoryList, formatter: (_: Recordable, __: TableColumn, cellValue: number) => { - return deviceMoldTypeList.find((account) => account.value == cellValue)?.label + return factoryList.find((account) => account.id == cellValue)?.name }, - isSearch: true, search: { + show: true, component: 'Select', + api: () => factoryList, componentProps: { - options: deviceTypeList, optionsAlias: { - labelField: 'label', - valueField: 'value' - }, - }, + labelField: 'name', + valueField: 'id' + } + } }, form: { component: 'Select', + api: () => factoryList, componentProps: { - options: deviceTypeList, + disabled: true, optionsAlias: { - labelField: 'label', - valueField: 'value' + labelField: 'name', + valueField: 'id' }, - placeholder: "请选择设备" - } + placeholder: "请先选择设备" + }, + } + }, + { + label: '厂区', + field: 'factoryAreaNumberMO', + sort: 'custom', + table: { + width: '150', }, + isDetail: true, + isForm: false, + isTable: false, + isSearch: false, }, { - label: '设备模具编号', - field: 'deviceNumber', + label: '类型', + field: 'type', sort: 'custom', table: { width: '150', }, - api: () => moldList, formatter: (_: Recordable, __: TableColumn, cellValue: number) => { - return moldList.find((account) => account.number == cellValue)?.name + return deviceMoldTypeList.find((account) => account.value == cellValue)?.label }, + isSearch: false, search: { - show: true, - component: 'Input', - // api: () => moldList, - // componentProps: { - // optionsAlias: { - // labelField: 'name', - // valueField: 'number' - // } - // } + component: 'Select', + componentProps: { + options: deviceTypeList, + optionsAlias: { + labelField: 'label', + valueField: 'value' + }, + }, }, form: { component: 'Select', - api: () => moldList, componentProps: { + options: deviceTypeList, optionsAlias: { - labelField: 'name', - valueField: 'number' + labelField: 'label', + valueField: 'value' }, - }, - } + placeholder: "请选择设备" + } + }, }, { - label: '厂区编号', - field: 'factoryAreaNumber', + label: '设备模具', + field: 'deviceNumber', sort: 'custom', table: { width: '150', }, - api: () => factoryList, + isSearch: false, + api: () => moldAllList, formatter: (_: Recordable, __: TableColumn, cellValue: number) => { - return factoryList.find((account) => account.id == cellValue)?.name + return moldAllList.find((account) => account.number == cellValue)?.name }, search: { - show: true, component: 'Select', - api: () => factoryList, + api: () => moldAllList, componentProps: { optionsAlias: { labelField: 'name', - valueField: 'id' + valueField: 'number' } } }, form: { component: 'Select', - api: () => factoryList, + api: () => moldList, componentProps: { - disabled: true, optionsAlias: { labelField: 'name', - valueField: 'id' + valueField: 'number' }, - placeholder: "请先选择设备" }, } }, @@ -159,7 +173,7 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive([ table: { width: '150', }, - isSearch: true, + isSearch: false, api: () => userListAll, formatter: (_: Recordable, __: TableColumn, cellValue: number) => { return userListAll.find((account) => account.id == cellValue)?.nickname @@ -185,7 +199,7 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive([ table: { width: '150', }, - isSearch: false, + isSearch: true, dictType: DICT_TYPE.MAINTENANCE_SHIFT, dictClass: 'number', form: { @@ -199,7 +213,7 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive([ table: { width: '150', }, - isSearch: false, + isSearch: true, dictType: DICT_TYPE.FAULT_TYPE, dictClass: 'string', form: { @@ -332,7 +346,7 @@ export const MoldMaintenanceDetail = useCrudSchemas(reactive([ searchCondition: [{ key: 'number', value: 'deviceNumber', - message: '请选择设备模具编号!', + message: '请选择设备模具!', isMainValue: true }] }, @@ -349,7 +363,7 @@ export const MoldMaintenanceDetail = useCrudSchemas(reactive([ searchCondition: [{ key: 'number', value: 'deviceNumber', - message: '请选择设备模具编号!', + message: '请选择设备模具!', isMainValue: true }] }