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

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

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

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

@ -295,11 +295,12 @@ function handleBackout(row) {
}
const onChange = (field, cur, item) => {
// if (field == 'factoryAreaNumber') {
// //
// DeviceRepair.allSchemas.formSchema
// }
if (field == 'factoryAreaNumber') {
//
DeviceRepair.allSchemas.formSchema.find(item => {
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'}
],
number: [required],
estimatedMinutes: [required],
actualMinutes: [
{ validator:validateNum, message: '请输入数字格式', trigger: 'blur'}
],
maintenance: [required],
})
@ -477,12 +479,15 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '未完成原因',
field: 'uncompleted',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isForm: true,
isTable: true,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
disabled: true,
}
}
},
{
label: '备件',

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

@ -70,7 +70,8 @@
:detailValidate="detailValidate"
@detailSubmitForm="detailSubmitForm"
:isSearchTableItem="true"
@openFormCallBack="openFormCallBack"
:openFormCallBack="openFormCallBack"
@detailOnChange="detailOnChange"
/>
<!-- 导入 -->
@ -188,7 +189,7 @@ const butttondata = (row) => {
// defaultButtons.mainListEditBtn({hasPermi:'eam:deviceInspectionMain:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceInspectionMain:delete'}), //
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)) }), //
]
}
@ -197,8 +198,8 @@ const butttondata = (row) => {
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'maintenanceOrder') { //
handleMaintenanceOrder(row)
} else if (val == 'mainInspectionOrder') { //
openDetail(row, '代码', row.number)
} else if (val == 'finishOrder') { //
handleFinishOrder(row)
}
@ -312,6 +313,32 @@ function handleMaintenanceOrder(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) => {
return true;
// return true;
let tag = false;
if (data.qty <= 0) {
message.warning('数量必须大于0')
tag = false;
return tag;
// if (data.qty <= 0) {
// message.warning('0')
// tag = false;
// 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 {
tag = true;
return tag;
tag = true
}
return tag
}
//
const detailSubmitForm = async (formType, data, getList, formRef, tableList) => {
@ -377,12 +414,14 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) =>
try {
let data1 = {
id: data.id,
number: data.maintenanceNumber,
number: data.number,
masterId: data.masterId,
siteId: data.siteId,
available: data.available,
concurrencyStamp: data.concurrencyStamp,
name: data.name,
peoples: data.peoples,
status: data.status,
estimatedMinutes: data.estimatedMinutes,
actualMinutes: data.actualMinutes,
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 () => {
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: '操作',
field: 'action',
@ -296,7 +320,7 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
isDetail: false,
api: () => userListAll,
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: {
type: 'Select',
@ -328,6 +352,9 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'maintenances1',
sort: 'custom',
isDetail: true,
isSearch: false,
isForm: false,
isTable: false,
table: {
width: 150
}

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

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

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

@ -159,7 +159,6 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
debugger
// MoldInspectionMain.allSchemas.formSchema[4].value = 'PROCCED';
MoldInspectionMain.allSchemas.formSchema.find((item) => item.field == 'status').value = 'PROCCED';
MoldInspectionMain.allSchemas.formSchema[5].value = 'DEVICE';
@ -340,16 +339,16 @@ const detailOpenForm = (type, row) => {
// /
const detailValidate = (data) => {
return true;
// return true;
let tag = false;
if (data.qty <= 0) {
message.warning('数量必须大于0')
tag = false;
return tag;
} else {
tag = true;
return tag;
}
// if (data.qty <= 0) {
// message.warning('0')
// tag = false;
// return tag;
// } else {
// tag = true;
// return tag;
// }
}
//
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 { ItemSearchTable } from '../../basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
import { validateHanset, validateNumDot, validateNum, validateEmail } from '@/utils/validator'
const userStore = useUserStore()
const factoryList = await selectAllFactoryArea()
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 dutyUserList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: undefined })
const engineerList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 2})
@ -17,12 +20,20 @@ const repairList = await MoldMaintenanceMainApi.getMoldMainTempList('MOLD')
// 表单校验
export const MoldInspectionMainRules = reactive({
number: [required],
// maintenanceNumber: [required],
moldNumber: [required],
factoryAreaNumber: [required],
deviceNumber: [
required,
],
factoryAreaNumber: [
required,
],
describes: [
{ max: 200, message: '不得超过200个字符', trigger: 'blur' },
],
maintenancePhone: [
{ validator:validateHanset, message: '输入电话格式不正确', trigger: 'blur'}
],
status: [required],
type: [required],
concurrencyStamp: [required],
faultType: [required],
})
@ -80,7 +91,7 @@ export const MoldInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
},
api: () => moldList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return moldList.find((account) => account.number == cellValue)?.name
return moldListAll.find((account) => account.number == cellValue)?.name
},
search: {
show: true,
@ -271,13 +282,24 @@ export const MoldInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
]))
// 表单校验
export const MoldInspectionDetailRules = reactive({
chargePeoples:[
required,
],
estimatedMinutes:[
required,
{ validator:validateNum, message: '请输入数字格式', trigger: 'blur'}
],
number: [required],
estimatedMinutes: [required],
actualMinutes: [
{ validator:validateNum, message: '请输入数字格式', trigger: 'blur'}
],
maintenance: [required],
})
export const MoldInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '检修编号',

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

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

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

@ -55,13 +55,14 @@
:tableData="tableData"
:apiUpdate="MoldMaintenanceMainApi.updateMoldMaintenanceMain"
:apiCreate="MoldMaintenanceMainApi.createMoldMaintenanceMain"
:isBusiness="true"
:isBusiness="false"
@onChange="onChange"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
:isSearchTableItem="true"
@success="submitForm"
:isSearchTableItem="true"
/>
<!-- 详情 -->
@ -289,7 +290,11 @@ const buttonTableClick = async (val, row) => {
acceptOrder(row)
} else if (val == 'turnOrder') {
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
urls.value = row.filePathList
viewKey.value += 1
@ -369,7 +374,19 @@ function acceptOrder(row) {
//
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() {}
//
@ -464,7 +481,8 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
try {
let data1 = {
id:data.id,
maintenanceNumber:data.maintenanceNumber,
number: data.number,
masterId: data.id,
describes:data.describes,
describes1:data.describes1,
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 factoryList = await selectAllFactoryArea()
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({
number: [required],
@ -86,6 +86,9 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
width: '150',
},
api: () => factoryList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryList.find((account) => account.id == cellValue)?.name
},
search: {
show: true,
component: 'Select',
@ -106,7 +109,7 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
labelField: 'name',
valueField: 'id'
},
placeholder: "请先选择模具"
placeholder: "请先选择设备"
},
}
},
@ -189,7 +192,33 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
},
form: {
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