Browse Source

测试bug修复

master
ljlong_2630 9 months ago
parent
commit
60a782750f
  1. 1
      src/api/eam/device/deviceInspectionDetail/index.ts
  2. 8
      src/api/eam/device/deviceInspectionMain/index.ts
  3. 8
      src/api/eam/device/deviceMaintenanceMain/index.ts
  4. 6
      src/api/eam/mold/moldMaintenanceMain/index.ts
  5. 27
      src/components/Detail/src/Detail.vue
  6. 4
      src/utils/disposition/defaultButtons.ts
  7. 1
      src/views/eam/device/deviceAccounts/index.vue
  8. 11
      src/views/eam/device/deviceRepair/index.vue
  9. 15
      src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts
  10. 98
      src/views/eam/device/deviceinspectionjob/index.vue
  11. 29
      src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts
  12. 76
      src/views/eam/device/devicemaintenancejob/index.vue
  13. 19
      src/views/eam/mold/moldinspectionjob/index.vue
  14. 34
      src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts
  15. 2
      src/views/eam/mold/moldmaintainjob/index.vue
  16. 28
      src/views/eam/mold/moldmaintenancejob/index.vue
  17. 35
      src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts

1
src/api/eam/device/deviceInspectionDetail/index.ts

@ -14,6 +14,7 @@ export interface DeviceInspectionDetailVO {
completionTime: Date completionTime: Date
engineer: string engineer: string
uncompleted: string uncompleted: string
status: string
} }
// 查询检修工单子列表 // 查询检修工单子列表

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

@ -54,5 +54,11 @@ export const exportDeviceInspectionMain = async (params) => {
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/eam/device-inspection-job-main/get-import-template' }) return request.download({ url: `/eam/device-inspection-job-main/get-import-template` })
}
// 检修完成
export const finishInspection = (id: number) => {
return request.get({ url: `/eam/device-inspection-job-main/onClick?id=` + id })
} }

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

@ -71,3 +71,11 @@ export const orderTurnTo = async (data: DeviceMaintenanceMainVO) => {
export const getDeviceMainTempList = async (type: String) => { export const getDeviceMainTempList = async (type: String) => {
return await request.get({ url: `/eam/device-maintenance-job-main/getList?type=` + type }) return await request.get({ url: `/eam/device-maintenance-job-main/getList?type=` + type })
} }
// 完成维修工单
export const finishOrder = async (params) => {
return await request.get({ url: `/eam/device-maintenance-job-main/orderClick`, params})
}

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

@ -72,3 +72,9 @@ export const orderTurnTo = async (data: MoldMaintenanceMainVO) => {
export const getMoldMainTempList = async (type: String) => { export const getMoldMainTempList = async (type: String) => {
return await request.get({ url: `/eam/device-maintenance-job-main/getList?type=` + type }) return await request.get({ url: `/eam/device-maintenance-job-main/getList?type=` + type })
} }
// 完成维修工单
export const finishOrder = async (params) => {
return await request.get({ url: `/eam/device-maintenance-job-main/orderClick`, params})
}

27
src/components/Detail/src/Detail.vue

@ -283,6 +283,11 @@ const props = defineProps({
required: false, required: false,
default: undefined default: undefined
}, },
openFormCallBack: {
type: Function,
required: false,
default: undefined
},
}) })
const isShowDrawer = ref(false) const isShowDrawer = ref(false)
const detailLoading = ref(false) const detailLoading = ref(false)
@ -491,22 +496,21 @@ const openForm = async (type: string, row?: number) => {
} }
} }
} }
// if (await props.openFormCallBack) {
let callbackTriggered = false; props.openFormCallBack(type, row, masterParmas.value, () => {
// openFormCallBacklist formRef.value.open(type, row, masterParmas.value)
emit('openFormCallBack', type, row, masterParmas.value, () => { })
callbackTriggered = true; // } else {
}); formRef.value.open(type, row, masterParmas.value);
nextTick(() => { // 使nextTick }
if (!callbackTriggered) { // openFormCallBack
formRef.value.open(type, row, masterParmas.value);
}
});
} }
// form // form
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
data.masterId = masterParmas.value.masterId
try { try {
const rs = (await props.detailValidate) ? props.detailValidate(data) : true
if (!rs) return
emit('detailSubmitForm', formType, data, getList, formRef.value) emit('detailSubmitForm', formType, data, getList, formRef.value)
} finally { } finally {
// formRef.value.formLoading = false // formRef.value.formLoading = false
@ -527,7 +531,6 @@ const emit = defineEmits([
'openImage', 'openImage',
'detailSubmitForm', 'detailSubmitForm',
'detailOnChange', 'detailOnChange',
'openFormCallBack',
]) ])
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {

4
src/utils/disposition/defaultButtons.ts

@ -961,10 +961,10 @@ export function verifyOrderBtn(option:any) {
} }
// 主列表-检修 // 主列表-检修
export function maintenanceOrderBtn(option:any) { export function mainInspectionOrderBtn(option:any) {
return __defaultBtnOption(option,{ return __defaultBtnOption(option,{
label: '检修', label: '检修',
name: 'maintenanceOrder', name: 'mainInspectionOrder',
hide: false, hide: false,
type: 'primary', type: 'primary',
color: '', color: '',

1
src/views/eam/device/deviceAccounts/index.vue

@ -228,7 +228,6 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'selectItem') { } else if (val == 'selectItem') {
openItem(row.number) openItem(row.number)
} else if (val == 'qrCode') { } else if (val == 'qrCode') {
debugger
window.open(src.value + "&number='" + row.number + "'") window.open(src.value + "&number='" + row.number + "'")
} else { } else {
// //

11
src/views/eam/device/deviceRepair/index.vue

@ -295,11 +295,12 @@ function handleBackout(row) {
} }
const onChange = (field, cur, item) => { const onChange = (field, cur, item) => {
// if (field == 'factoryAreaNumber') { if (field == 'factoryAreaNumber') {
//
// // DeviceRepair.allSchemas.formSchema.find(item => {
// DeviceRepair.allSchemas.formSchema return item.field == 'deviceNumber'
// } }).value = null
}
} }

15
src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts

@ -318,7 +318,9 @@ export const DeviceInspectionDetailRules = reactive({
{ validator:validateNum, message: '请输入数字格式', trigger: 'blur'} { validator:validateNum, message: '请输入数字格式', trigger: 'blur'}
], ],
number: [required], number: [required],
estimatedMinutes: [required], actualMinutes: [
{ validator:validateNum, message: '请输入数字格式', trigger: 'blur'}
],
maintenance: [required], maintenance: [required],
}) })
@ -477,12 +479,15 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '未完成原因', label: '未完成原因',
field: 'uncompleted', field: 'uncompleted',
sort: 'custom', sort: 'custom',
table: {
width: '150',
},
isSearch: false, isSearch: false,
isForm: true,
isTable: true, isTable: true,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
disabled: true,
}
}
}, },
{ {
label: '备件', label: '备件',

98
src/views/eam/device/deviceinspectionjob/index.vue

@ -70,7 +70,8 @@
:detailValidate="detailValidate" :detailValidate="detailValidate"
@detailSubmitForm="detailSubmitForm" @detailSubmitForm="detailSubmitForm"
:isSearchTableItem="true" :isSearchTableItem="true"
@openFormCallBack="openFormCallBack" :openFormCallBack="openFormCallBack"
@detailOnChange="detailOnChange"
/> />
<!-- 导入 --> <!-- 导入 -->
@ -188,7 +189,7 @@ const butttondata = (row) => {
// defaultButtons.mainListEditBtn({hasPermi:'eam:deviceInspectionMain:update'}), // // defaultButtons.mainListEditBtn({hasPermi:'eam:deviceInspectionMain:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceInspectionMain:delete'}), // // defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceInspectionMain:delete'}), //
defaultButtons.mainListEditBtn(null), // defaultButtons.mainListEditBtn(null), //
defaultButtons.maintenanceOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), // defaultButtons.mainInspectionOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //
defaultButtons.finishOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), // defaultButtons.finishOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //
] ]
} }
@ -197,8 +198,8 @@ const butttondata = (row) => {
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') { //
openForm('update', row) openForm('update', row)
} else if (val == 'maintenanceOrder') { // } else if (val == 'mainInspectionOrder') { //
handleMaintenanceOrder(row) openDetail(row, '代码', row.number)
} else if (val == 'finishOrder') { // } else if (val == 'finishOrder') { //
handleFinishOrder(row) handleFinishOrder(row)
} }
@ -312,6 +313,32 @@ function handleMaintenanceOrder(row) {
} }
function handleFinishOrder(row) { function handleFinishOrder(row) {
let param = {
masterId : row.id
}
DeviceInspectionDetailApi.getDeviceInspectionDetailPage(param
).then(response => {
if (response != null) {
if (response.list.length == 0) {
message.error(t('请先填写并完成检修明细内容!'))
} else {
let unFinishedList = response.list.filters(item => {
return item.status == 0
})
if (unFinishedList != null && unFinishedList.length > 0) {
message.error(t('请先完成各检修明细内容!'))
return
} else {
DeviceInspectionMainApi.finishInspection(row.id).then(res => {
message.success(t('common.finishSuccess'))
getList()
})
}
}
} else {
message.error(t('common.finishFail'))
}
})
} }
@ -360,16 +387,26 @@ const detailOpenForm = (type, row) => {
// / // /
const detailValidate = (data) => { const detailValidate = (data) => {
return true; // return true;
let tag = false; let tag = false;
if (data.qty <= 0) { // if (data.qty <= 0) {
message.warning('数量必须大于0') // message.warning('0')
tag = false; // tag = false;
return tag; // return tag;
// } else {
// tag = true;
// return tag;
// }
let req = DeviceInspectionDetailRules.uncompleted?.find(item => {
return item.required == true
})
if (req !== undefined) {
tag = false
message.warning('需填入未完成原因')
} else { } else {
tag = true; tag = true
return tag;
} }
return tag
} }
// //
const detailSubmitForm = async (formType, data, getList, formRef, tableList) => { const detailSubmitForm = async (formType, data, getList, formRef, tableList) => {
@ -377,12 +414,14 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) =>
try { try {
let data1 = { let data1 = {
id: data.id, id: data.id,
number: data.maintenanceNumber, number: data.number,
masterId: data.masterId,
siteId: data.siteId, siteId: data.siteId,
available: data.available, available: data.available,
concurrencyStamp: data.concurrencyStamp, concurrencyStamp: data.concurrencyStamp,
name: data.name, name: data.name,
peoples: data.peoples, peoples: data.peoples,
status: data.status,
estimatedMinutes: data.estimatedMinutes, estimatedMinutes: data.estimatedMinutes,
actualMinutes: data.actualMinutes, actualMinutes: data.actualMinutes,
chargePeoples: data.chargePeoples.join(','), chargePeoples: data.chargePeoples.join(','),
@ -458,6 +497,41 @@ const submitForm = async (formType, data) => {
} }
} }
function detailOnChange(field, cur, item) {
if (field == 'status') {
if (cur == '1') {
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
DeviceInspectionDetailRules.uncompleted = [required]
} else {
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
delete DeviceInspectionDetailRules.uncompleted;
}
}
}
const openFormCallBack = (type, row, masterParmas, callback) => {
if (row == undefined || row == null) {
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
delete DeviceInspectionDetailRules.uncompleted;
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0'
} else {
if (row.status == '1') {
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
DeviceInspectionDetailRules.uncompleted = [required]
} else {
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
delete DeviceInspectionDetailRules.uncompleted;
}
}
callback()
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

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

@ -219,6 +219,30 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
}, },
{
label: '是否完成',
field: 'status',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isTable: true,
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
dictClass: 'string',
form: {
component: 'Select',
componentProps: {
disabled: false,
}
},
tableForm: {
type: 'Select',
componentProps: {
disabled: false,
}
},
},
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
@ -296,7 +320,7 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
isDetail: false, isDetail: false,
api: () => userListAll, api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue) => { formatter: (_: Recordable, __: TableColumn, cellValue) => {
return userListAll.filter(item=>cellValue?.includes(item.id)).map(cur=>cur.name).join(',') return userListAll.filter(item=>cellValue?.includes(item.id)).map(cur=>cur.nickname)?.join(',')
}, },
tableForm: { tableForm: {
type: 'Select', type: 'Select',
@ -328,6 +352,9 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'maintenances1', field: 'maintenances1',
sort: 'custom', sort: 'custom',
isDetail: true, isDetail: true,
isSearch: false,
isForm: false,
isTable: false,
table: { table: {
width: 150 width: 150
} }

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

@ -83,7 +83,7 @@
:detailValidate="detailValidate" :detailValidate="detailValidate"
@detailSubmitForm="detailSubmitForm" @detailSubmitForm="detailSubmitForm"
:isSearchTableItem="true" :isSearchTableItem="true"
@openFormCallBack="openFormCallBack" :openFormCallBack="openFormCallBack"
/> />
<!-- 导入 --> <!-- 导入 -->
@ -291,8 +291,12 @@ const buttonTableClick = async (val, row) => {
handleDelete(row.id) handleDelete(row.id)
} else if (val == 'acceptOrder') { } else if (val == 'acceptOrder') {
acceptOrder(row) acceptOrder(row)
} else if (val == 'repair') {
openDetail(row, '代码', row.number)
} else if (val == 'turnOrder') { } else if (val == 'turnOrder') {
openForm('turnOrder', row) openForm('turnOrder', row)
} else if (val == 'finish') {
finishOrder(row)
} else if (val == 'picture') { } else if (val == 'picture') {
showView.value = true showView.value = true
urls.value = row.filePathList urls.value = row.filePathList
@ -375,7 +379,19 @@ function acceptOrder(row) {
// //
function turnOrder() {} function turnOrder() {}
// //
function finishOrder() {} function finishOrder(row) {
let param = {
id: row.id,
number: row.number,
status: row.status,
result: 'COMPLETED',
requestNumber: row.requestNumber,
}
DeviceMaintenanceMainApi.finishOrder(param).then(res => {
getList()
message.success('操作成功')
})
}
// //
function verifyOrder() {} function verifyOrder() {}
// //
@ -504,35 +520,33 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
} }
const openFormCallBack = (type, row, masterParmas,callback) => { const openFormCallBack = (type, row, masterParmas,callback) => {
if (type === 'create') { if (operatRecord.value.type == 'TECH') {
if (operatRecord.value.type == 'TECH') { DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => {
DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => { if (item.field == 'maintenances') {
if (item.field == 'maintenances') { selecUserByType({ classType: 'TECH', factoryAreaNumber: '', flag: 1 }).then(response => {
selecUserByType({ classType: 'TECH', factoryAreaNumber: '', flag: 1 }).then(response => { item.componentProps.options = response
item.componentProps.options = response callback();
callback(); });
}); }
} })
}) } else if (operatRecord.value.type == 'DEVICE') {
} else if (operatRecord.value.type == 'DEVICE') { DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => {
DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => { if (item.field == 'maintenances') {
if (item.field == 'maintenances') { selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }).then(response => {
selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }).then(response => { item.componentProps.options = response
item.componentProps.options = response callback();
callback(); });
}); }
} })
}) } else if (operatRecord.value.type == 'MOLD') {
} else if (operatRecord.value.type == 'MOLD') { DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => {
DeviceMaintenanceDetail.allSchemas.formSchema.forEach((item) => { if (item.field == 'maintenances') {
if (item.field == 'maintenances') { selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 }).then(response => {
selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 }).then(response => { item.componentProps.options = response
item.componentProps.options = response callback();
callback(); });
}); }
} })
})
}
} }
} }

19
src/views/eam/mold/moldinspectionjob/index.vue

@ -159,7 +159,6 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') { //
debugger
// MoldInspectionMain.allSchemas.formSchema[4].value = 'PROCCED'; // MoldInspectionMain.allSchemas.formSchema[4].value = 'PROCCED';
MoldInspectionMain.allSchemas.formSchema.find((item) => item.field == 'status').value = 'PROCCED'; MoldInspectionMain.allSchemas.formSchema.find((item) => item.field == 'status').value = 'PROCCED';
MoldInspectionMain.allSchemas.formSchema[5].value = 'DEVICE'; MoldInspectionMain.allSchemas.formSchema[5].value = 'DEVICE';
@ -340,16 +339,16 @@ const detailOpenForm = (type, row) => {
// / // /
const detailValidate = (data) => { const detailValidate = (data) => {
return true; // return true;
let tag = false; let tag = false;
if (data.qty <= 0) { // if (data.qty <= 0) {
message.warning('数量必须大于0') // message.warning('0')
tag = false; // tag = false;
return tag; // return tag;
} else { // } else {
tag = true; // tag = true;
return tag; // return tag;
} // }
} }
// //
const detailSubmitForm = async (formType, data, getList, formRef, tableList) => { const detailSubmitForm = async (formType, data, getList, formRef, tableList) => {

34
src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts

@ -7,9 +7,12 @@ import * as MoldMaintenanceMainApi from '@/api/eam/mold/moldMaintenanceMain'
import { dateFormatter } from '@/utils/formatTime' 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 { validateHanset, validateNumDot, validateNum, validateEmail } from '@/utils/validator'
const userStore = useUserStore() const userStore = useUserStore()
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
const moldList = await MoldAccountsApi.getMoldAccountsNoPage({}) const moldList = await MoldAccountsApi.getMoldAccountsNoPage({})
const moldListAll = await MoldAccountsApi.getMoldAccountsAllNoPage({})
const moldListByFactory = moldListAll.filter(item => item.factoryAreaNumber == userStore.userSelfInfo.dept.parentId)
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 })
const engineerList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 2}) const engineerList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 2})
@ -17,12 +20,20 @@ const repairList = await MoldMaintenanceMainApi.getMoldMainTempList('MOLD')
// 表单校验 // 表单校验
export const MoldInspectionMainRules = reactive({ export const MoldInspectionMainRules = reactive({
number: [required], number: [required],
// maintenanceNumber: [required], deviceNumber: [
moldNumber: [required], required,
factoryAreaNumber: [required], ],
factoryAreaNumber: [
required,
],
describes: [
{ max: 200, message: '不得超过200个字符', trigger: 'blur' },
],
maintenancePhone: [
{ validator:validateHanset, message: '输入电话格式不正确', trigger: 'blur'}
],
status: [required], status: [required],
type: [required], type: [required],
concurrencyStamp: [required],
faultType: [required], faultType: [required],
}) })
@ -80,7 +91,7 @@ export const MoldInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
api: () => moldList, api: () => moldList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return moldList.find((account) => account.number == cellValue)?.name return moldListAll.find((account) => account.number == cellValue)?.name
}, },
search: { search: {
show: true, show: true,
@ -271,13 +282,24 @@ export const MoldInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
])) ]))
// 表单校验 // 表单校验
export const MoldInspectionDetailRules = reactive({ export const MoldInspectionDetailRules = reactive({
chargePeoples:[
required,
],
estimatedMinutes:[
required,
{ validator:validateNum, message: '请输入数字格式', trigger: 'blur'}
],
number: [required], number: [required],
estimatedMinutes: [required], actualMinutes: [
{ validator:validateNum, message: '请输入数字格式', trigger: 'blur'}
],
maintenance: [required], maintenance: [required],
}) })
export const MoldInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const MoldInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '检修编号', label: '检修编号',

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

@ -452,7 +452,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
try { try {
let data1 = { let data1 = {
id:data.id, id:data.id,
maintenanceNumber:data.maintenanceNumber, number:data.number,
describes:data.describes, describes:data.describes,
describes1:data.describes1, describes1:data.describes1,
itemNumbers:data.itemNumbers, itemNumbers:data.itemNumbers,

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

@ -55,13 +55,14 @@
:tableData="tableData" :tableData="tableData"
:apiUpdate="MoldMaintenanceMainApi.updateMoldMaintenanceMain" :apiUpdate="MoldMaintenanceMainApi.updateMoldMaintenanceMain"
:apiCreate="MoldMaintenanceMainApi.createMoldMaintenanceMain" :apiCreate="MoldMaintenanceMainApi.createMoldMaintenanceMain"
:isBusiness="true" :isBusiness="false"
@onChange="onChange" @onChange="onChange"
@handleAddTable="handleAddTable" @handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" @submitForm="submitForm"
:isSearchTableItem="true" @success="submitForm"
:isSearchTableItem="true"
/> />
<!-- 详情 --> <!-- 详情 -->
@ -289,7 +290,11 @@ 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 == 'picture') { } else if (val == 'finishOrder') {
finishOrder(row)
} else if (val == 'repair') {
openDetail(row, '代码', row.code)
} else if (val == 'picture') {
showView.value = true showView.value = true
urls.value = row.filePathList urls.value = row.filePathList
viewKey.value += 1 viewKey.value += 1
@ -369,7 +374,19 @@ function acceptOrder(row) {
// //
function turnOrder() {} function turnOrder() {}
// //
function finishOrder() {} function finishOrder(row) {
let param = {
id: row.id,
number: row.number,
status: row.status,
result: 'COMPLETED',
requestNumber: row.requestNumber,
}
MoldMaintenanceMainApi.finishOrder(param).then(res => {
getList()
message.success('操作成功')
})
}
// //
function verifyOrder() {} function verifyOrder() {}
// //
@ -464,7 +481,8 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
try { try {
let data1 = { let data1 = {
id:data.id, id:data.id,
maintenanceNumber:data.maintenanceNumber, number: data.number,
masterId: data.id,
describes:data.describes, describes:data.describes,
describes1:data.describes1, describes1:data.describes1,
itemNumbers:data.itemNumbers, itemNumbers:data.itemNumbers,

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

@ -8,7 +8,7 @@ import * as ItemApi from '@/api/eam/basic/item'
const userStore = useUserStore() const userStore = useUserStore()
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
const moldList = await MoldAccountsApi.getMoldAccountsNoPage({}) const moldList = await MoldAccountsApi.getMoldAccountsNoPage({})
const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }) const userList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 })
// 表单校验 // 表单校验
export const MoldMaintenanceMainRules = reactive({ export const MoldMaintenanceMainRules = reactive({
number: [required], number: [required],
@ -86,6 +86,9 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
width: '150', width: '150',
}, },
api: () => factoryList, api: () => factoryList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryList.find((account) => account.id == cellValue)?.name
},
search: { search: {
show: true, show: true,
component: 'Select', component: 'Select',
@ -106,7 +109,7 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
labelField: 'name', labelField: 'name',
valueField: 'id' valueField: 'id'
}, },
placeholder: "请先选择模具" placeholder: "请先选择设备"
}, },
} }
}, },
@ -189,7 +192,33 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
form: { form: {
component: 'Input', component: 'Input',
componentProps:{
type:'textarea'
}
},
},
{
label: '是否完成',
field: 'status',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isTable: true,
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
dictClass: 'string',
form: {
component: 'Select',
componentProps: {
disabled: false,
}
},
tableForm: {
type: 'Select',
componentProps: {
disabled: false,
}
}, },
}, },
{ {

Loading…
Cancel
Save