Browse Source

维修工单

master
ljlong_2630 1 year ago
parent
commit
82bfff3874
  1. 52
      src/utils/disposition/defaultButtons.ts
  2. 6
      src/views/eam/device/deviceAccounts/deviceAccounts.data.ts
  3. 121
      src/views/eam/device/deviceMaintenanceMain/deviceMaintenanceMain.data.ts
  4. 27
      src/views/eam/device/deviceMaintenanceMain/index.vue
  5. 1
      src/views/eam/device/deviceRepair/deviceRepair.data.ts

52
src/utils/disposition/defaultButtons.ts

@ -788,6 +788,58 @@ export function backoutBtn(option:any) {
}) })
} }
// 主列表-接单
export function acceptOrderBtn(option:any) {
return __defaultBtnOption(option,{
label: '接单',
name: 'acceptorder',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-转办
export function turnOrderBtn(option:any) {
return __defaultBtnOption(option,{
label: '转办',
name: 'turnorder',
hide: false,
type: 'warning',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-完成
export function finishOrderBtn(option:any) {
return __defaultBtnOption(option,{
label: '完成',
name: 'finishorder',
hide: false,
type: 'success',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-验证
export function verifyOrderBtn(option:any) {
return __defaultBtnOption(option,{
label: '验证',
name: 'verifyorder',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 默认按钮规则 // 默认按钮规则
function __defaultBtnOption(option:any,specific:any){ function __defaultBtnOption(option:any,specific:any){
return { return {

6
src/views/eam/device/deviceAccounts/deviceAccounts.data.ts

@ -61,8 +61,11 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([
}, },
{ {
label: '采购部门', label: '采购部门',
field: 'deptId', field: 'purchaseDept',
sort: 'custom', sort: 'custom',
isSearch: false,
isForm: true,
isTable: true,
form: { form: {
component: 'Input', component: 'Input',
} }
@ -121,6 +124,7 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.BASIC_STATUS, dictType: DICT_TYPE.BASIC_STATUS,
dictClass: 'string', dictClass: 'string',
isSearch: true, isSearch: true,
isForm: false,
}, },
{ {

121
src/views/eam/device/deviceMaintenanceMain/deviceMaintenanceMain.data.ts

@ -1,5 +1,11 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { selectAllFactoryArea } from '@/api/system/dept'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
const factoryList = await selectAllFactoryArea()
const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({})
const showFactory = ref(false);
const factoryValue = ref<number | null>(null);
// 表单校验 // 表单校验
export const DeviceMaintenanceMainRules = reactive({ export const DeviceMaintenanceMainRules = reactive({
@ -20,34 +26,91 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm: false,
}, },
{ {
label: '报修工单申请号', label: '报修工单申请号',
field: 'requestNumber', field: 'requestNumber',
sort: 'custom', sort: 'custom',
isForm: false,
isSearch: true,
isTable: true,
}, },
{
label: '描述',
field: 'describe',
sort: 'custom',
},
{ {
label: '设备模具编号', label: '设备模具编号',
field: 'deviceNumber', field: 'deviceNumber',
sort: 'custom', sort: 'custom',
api: () => deviceList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryList.find((account) => account.number == cellValue)?.name
},
search: {
show: true,
component: 'Select',
api: () => deviceList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'number'
}
}
},
form: {
component: 'Select',
api: () => deviceList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
onChange: (val) => {
factoryValue.value = Number(deviceList.find((account) => account.number == val)?.factoryAreaNumber)
showFactory.value = true
console.log('factoryValue.value',factoryValue.value)
console.log('showFactory.value',showFactory.value)
}
},
}
}, },
{ {
label: '厂区编号', label: '厂区编号',
field: 'factoryAreaNumber', field: 'factoryAreaNumber',
sort: 'custom', sort: 'custom',
api: () => factoryList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryList.find((account) => account.id == cellValue)?.name
},
search: {
show: true,
component: 'Select',
api: () => factoryList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
}
}
},
form: {
component: 'Select',
show: showFactory.value,
value: factoryValue.value,
api: () => factoryList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
},
}
}, },
{ {
label: '维修人', label: '维修人',
field: 'maintenance', field: 'maintenance',
sort: 'custom', sort: 'custom',
form: { form: {
component: 'InputNumber', component: 'Input',
value: 0
}, },
}, },
{ {
@ -60,8 +123,11 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'status', field: 'status',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm: false,
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
dictClass: 'string',
form: { form: {
component: 'Radio' component: 'Select'
}, },
}, },
{ {
@ -69,34 +135,41 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'type', field: 'type',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
form: { form: {
component: 'Select' component: 'Select'
}, },
}, },
{ {
label: '创建时间', label: '描述',
field: 'createTime', field: 'describe',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, form: {
isForm: false, component: 'Input',
componentProps: {
type: 'textarea',
}
}, },
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
}, },
// {
// label: '地点ID',
// field: 'siteId',
// sort: 'custom',
// },
{ {
label: '是否可用', label: '是否可用',
field: 'available', field: 'available',
sort: 'custom', sort: 'custom',
}, dictType: DICT_TYPE.TRUE_FALSE,
{ dictClass: 'string',
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: { form: {
component: 'InputNumber', component: 'Switch',
value: 0 value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}, },
}, },
{ {
@ -104,7 +177,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'action', field: 'action',
isForm: false, isForm: false,
table: { table: {
width: 150, width: 300,
fixed: 'right' fixed: 'right'
} }
} }

27
src/views/eam/device/deviceMaintenanceMain/index.vue

@ -33,7 +33,7 @@
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -62,12 +62,13 @@ import download from '@/utils/download'
import { DeviceMaintenanceMain,DeviceMaintenanceMainRules } from './deviceMaintenanceMain.data' import { DeviceMaintenanceMain,DeviceMaintenanceMainRules } from './deviceMaintenanceMain.data'
import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain' import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { useUserStore } from '@/store/modules/user'
// import TableHead from '@/components/TableHead/src/TableHead.vue' // import TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue' // import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
// import Detail from '@/components/Detail/src/Detail.vue' // import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'DeviceMaintenanceMain' }) defineOptions({ name: 'DeviceMaintenanceMain' })
const userStore = useUserStore()
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
@ -99,9 +100,10 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:deviceMaintenanceMain:create'}), // // defaultButtons.defaultAddBtn({hasPermi:'eam:deviceMaintenanceMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:deviceMaintenanceMain:import'}), // // defaultButtons.defaultImportBtn({hasPermi:'eam:deviceMaintenanceMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:deviceMaintenanceMain:export'}), // // defaultButtons.defaultExportBtn({ hasPermi: 'eam:deviceMaintenanceMain:export' }), //
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -132,10 +134,19 @@ const buttonBaseClick = (val, item) => {
} }
// - // -
const butttondata = [ const butttondata = (row) => {
defaultButtons.mainListEditBtn({hasPermi:'eam:deviceMaintenanceMain:update'}), // return [
defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceMaintenanceMain:delete'}), // // defaultButtons.mainListEditBtn({hasPermi:'eam:deviceMaintenanceMain:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceMaintenanceMain:delete'}), //
defaultButtons.mainListEditBtn(null), //
// defaultButtons.mainListDeleteBtn(null), //
// defaultButtons.backoutBtn(null), //
defaultButtons.acceptOrderBtn({ hide: !(row.status == 'PENDING') }), //
defaultButtons.turnOrderBtn({ hide: !(row.status == 'PECEIVED') }), //
defaultButtons.finishOrderBtn({ hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)}), //
defaultButtons.verifyOrderBtn({ hide: !(row.status == 'COMPLETED')}), //
] ]
}
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {

1
src/views/eam/device/deviceRepair/deviceRepair.data.ts

@ -39,7 +39,6 @@ export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
label: '厂区', label: '厂区',
field: 'factoryAreaNumber', field: 'factoryAreaNumber',
sort: 'custom', sort: 'custom',
api: () => factoryList, api: () => factoryList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryList.find((account) => account.id == cellValue)?.name return factoryList.find((account) => account.id == cellValue)?.name

Loading…
Cancel
Save