Browse Source

修复测试问题

master
ljlong_2630 9 months ago
parent
commit
208c53a214
  1. 1
      src/api/eam/device/deviceMaintainPlan/index.ts
  2. 2
      src/api/eam/mold/moldInspectionDetail/index.ts
  3. 1
      src/components/UploadFile/src/UploadImgs.vue
  4. 3
      src/views/eam/device/deviceMaintainPlan/deviceMaintainPlan.data.ts
  5. 2
      src/views/eam/device/deviceRepair/index.vue
  6. 13
      src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts
  7. 12
      src/views/eam/device/deviceinspectionjob/index.vue
  8. 27
      src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts
  9. 20
      src/views/eam/device/devicemaintenancejob/index.vue
  10. 3
      src/views/eam/mold/moldMaintainPlan/moldMaintainPlan.data.ts
  11. 16
      src/views/eam/mold/moldRepair/index.vue
  12. 68
      src/views/eam/mold/moldinspectionjob/index.vue
  13. 20
      src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts
  14. 14
      src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts
  15. 37
      src/views/eam/mold/moldmaintenancejob/index.vue
  16. 44
      src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts

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

@ -14,6 +14,7 @@ export interface DeviceMaintainPlanVO {
// 查询保养计划列表
export const getDeviceMaintainPlanPage = async (params) => {
params.type = 'DEVICE'
if (params.isSearch) {
delete params.isSearch
const data = {...params}

2
src/api/eam/mold/moldInspectionDetail/index.ts

@ -3,6 +3,7 @@ import request from '@/config/axios'
export interface MoldInspectionDetailVO {
id: number
number: string
masterId: number
siteId: string
available: string
concurrencyStamp: number
@ -14,6 +15,7 @@ export interface MoldInspectionDetailVO {
completionTime: Date
engineer: string
uncompleted: string
status: string
}
// 查询检修工单子列表

1
src/components/UploadFile/src/UploadImgs.vue

@ -170,6 +170,7 @@ const handleExceed = () => {
const viewImageUrl = ref('')
const imgViewVisible = ref(false)
const handlePictureCardPreview: UploadProps['onPreview'] = (uploadFile) => {
console.log('uploadFile', uploadFile)
viewImageUrl.value = uploadFile.url!
imgViewVisible.value = true
}

3
src/views/eam/device/deviceMaintainPlan/deviceMaintainPlan.data.ts

@ -50,7 +50,8 @@ export const DeviceMaintainPlan = useCrudSchemas(reactive<CrudSchema[]>([
label: '类型',
field: 'type',
sort: 'custom',
isSearch: true,
isSearch: false,
isTable: false,
form: {
component: 'Select'
},

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

@ -295,8 +295,6 @@ function handleBackout(row) {
}
const onChange = (field, cur, item,formRef) => {
console.log(cur)
console.log(item)
if (field == 'factoryAreaNumber') {
nextTick(() => {
const setV = {}

13
src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts

@ -49,6 +49,16 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceListNoPage.find((account) => account.number == cellValue)?.name
},
search:{
component: 'Select',
componentProps: {
options: deviceListNoPage,
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
},
},
form: {
component: 'Select',
componentProps: {
@ -114,7 +124,8 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceDeviceTypeList.find((account) => account.value == cellValue)?.label
},
isSearch: true,
isSearch: false,
isTable: false,
search: {
component: 'Select',
componentProps: {

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

@ -431,7 +431,9 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) =>
}
console.log('data1',data1)
if (formType === 'create') {
await DeviceInspectionDetailApi.createDeviceInspectionDetail(data1)
message.success(t('common.createSuccess'))
} else {
await DeviceInspectionDetailApi.updateDeviceInspectionDetail(data1)
@ -439,7 +441,6 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) =>
}
formRef.dialogVisible = false
//
await getList()
detailRef.value.tableObject.tableList.forEach(item => {
if (item.itemNumbers?.length > 0) {
let str = ''
@ -448,10 +449,11 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) =>
})
item.itemNumbers1 = str.substring(0, str.length - 1)
}
})
await formRef.getList()
} finally {
formRef.formLoading = false
formRef.value.formLoading = false
}
}
@ -489,11 +491,11 @@ const submitForm = async (formType, data) => {
await DeviceInspectionMainApi.updateDeviceInspectionMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
basicFormRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = false
basicFormRef.value.formLoading = false
}
}

27
src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts

@ -5,8 +5,8 @@ import { dateFormatter } from '@/utils/formatTime'
import { ItemSearchTable } from '../../basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
const factoryList = await selectAllFactoryArea()
const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: undefined, flag: 1 })
const dutyUserList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: undefined, flag: undefined })
const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 })
const dutyUserList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null })
// 表单校验
export const DeviceMaintainOrderMainRules = reactive({
@ -24,7 +24,7 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '保养单号',
field: 'number',
sort: 'custom',
isSearch: true,
isSearch: false,
table: {
width: '150',
},
@ -33,7 +33,7 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '保养计划单号',
field: 'planNumber',
sort: 'custom',
isSearch: true,
isSearch: false,
table: {
width: '150',
},
@ -47,15 +47,6 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
width: '150',
},
},
{
label: '描述',
field: 'describes',
sort: 'custom',
isSearch: true,
table: {
width: '150',
},
},
{
label: '工单所属周期',
field: 'executePeriod',
@ -116,11 +107,21 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
dictClass: 'string',
},
{
label: '描述',
field: 'describes',
sort: 'custom',
isSearch: false,
table: {
width: '150',
},
},
{
label: '类型',
field: 'type',
sort: 'custom',
isSearch: false,
isTable: false,
table: {
width: '150',
},

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

@ -120,7 +120,9 @@ import * as DeviceMaintenanceDetailApi from '@/api/eam/device/deviceMaintenanceD
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { useUserStore } from '@/store/modules/user'
import { selecUserByType } from '@/api/system/dept'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD')
defineOptions({ name: 'DeviceMaintenanceMain' })
const message = useMessage() //
const { t } = useI18n() //
@ -212,6 +214,9 @@ const buttonBaseClick = (val, item) => {
//
DeviceMaintenanceMain.allSchemas.formSchema[3].value = 'DEVICE'
DeviceMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = false
DeviceMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.options = deviceTypeList
openForm('create')
} else if (val == 'import') {
//
@ -284,6 +289,9 @@ const buttonTableClick = async (val, row) => {
DeviceMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = false
if (val == 'edit') {
//
DeviceMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.options = deviceTypeList
openForm('update', row)
DeviceMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = true
} else if (val == 'delete') {
@ -294,6 +302,9 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'repair') {
openDetail(row, '代码', row.number)
} else if (val == 'turnOrder') {
DeviceMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.options = deviceMoldTypeList
openForm('turnOrder', row)
} else if (val == 'finish') {
finishOrder(row)
@ -375,7 +386,10 @@ const searchFormClick = (searchData) => {
//
function acceptOrder(row) {
DeviceMaintenanceMainApi.orderStepChange(row)
DeviceMaintenanceMainApi.orderStepChange(row).then(item => {
message.success('接单成功')
getList()
})
getList()
}
//
@ -528,7 +542,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
})
} finally {
formRef.formLoading = false
formRef.value.formLoading = false
}
}

3
src/views/eam/mold/moldMaintainPlan/moldMaintainPlan.data.ts

@ -51,7 +51,8 @@ export const MoldMaintainPlan = useCrudSchemas(reactive<CrudSchema[]>([
label: '类型',
field: 'type',
sort: 'custom',
isSearch: true,
isSearch: false,
isTable: false,
form: {
component: 'Select'
},

16
src/views/eam/mold/moldRepair/index.vue

@ -292,15 +292,13 @@ onMounted(async () => {
importTemplateData.templateUrl = await MoldRepairApi.importTemplate()
})
const onChange = (field, cur, item) => {
if (field == 'declarerPhone') {
if (cur != null && cur != '') {
if(validatePhoneNumber(cur)) {
console.log("手机号码格式正确");
} else {
message.error('手机号码格式不正确!')
}
}
const onChange = (field, cur, item, formRef) => {
if (field == 'factoryAreaNumber') {
nextTick(() => {
const setV = {}
setV['deviceNumber'] = ''
formRef.setValues(setV)
})
}
}

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

@ -70,6 +70,8 @@
:detailValidate="detailValidate"
@detailSubmitForm="detailSubmitForm"
:isSearchTableItem="true"
:openFormCallBack="openFormCallBack"
@detailOnChange="detailOnChange"
/>
<!-- 导入 -->
@ -161,7 +163,7 @@ const buttonBaseClick = (val, item) => {
if (val == 'add') { //
// MoldInspectionMain.allSchemas.formSchema[4].value = 'PROCCED';
MoldInspectionMain.allSchemas.formSchema.find((item) => item.field == 'status').value = 'PROCCED';
MoldInspectionMain.allSchemas.formSchema[5].value = 'DEVICE';
MoldInspectionMain.allSchemas.formSchema.find((item) => item.field == 'type').value = 'MOLD';
openForm('create')
} else if (val == 'import') { //
handleImport()
@ -349,19 +351,31 @@ const detailValidate = (data) => {
// tag = true;
// return tag;
// }
let req = MoldInspectionDetailRules.uncompleted?.find(item => {
return item.required == true
})
if (req !== undefined) {
tag = false
message.warning('需填入未完成原因')
} else {
tag = true
}
return tag
}
//
const detailSubmitForm = async (formType, data, getList, formRef, tableList) => {
console.log('data',data)
const detailSubmitForm = async (formType, data, getList1, formRef, tableList) => {
console.log('data', data)
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(','),
@ -371,15 +385,19 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) =>
}
console.log('data1',data1)
if (formType === 'create') {
console.log('create', data1)
await MoldInspectionDetailApi.createMoldInspectionDetail(data1)
console.log('finish', data1)
message.success(t('common.createSuccess'))
} else {
await MoldInspectionDetailApi.updateMoldInspectionDetail(data1)
message.success(t('common.updateSuccess'))
}
formRef.dialogVisible = false
console.log('before', data1)
//
await getList()
await formRef.getList1
console.log('after', data1)
detailRef.value.tableObject.tableList.forEach(item => {
if (item.itemNumbers?.length > 0) {
let str = ''
@ -391,7 +409,7 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) =>
})
} finally {
formRef.formLoading = false
detailRef.value.formLoading = false
}
}
@ -429,12 +447,46 @@ const submitForm = async (formType, data) => {
await MoldInspectionMainApi.updateMoldInspectionMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
basicFormRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = false
basicFormRef.value.formLoading = false
}
}
function detailOnChange(field, cur, item) {
if (field == 'status') {
if (cur == '1') {
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
MoldInspectionDetailRules.uncompleted = [required]
} else {
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
MoldInspectionDetailRules.uncompleted = [{ required: false }]
}
}
}
const openFormCallBack = (type, row, masterParmas, callback) => {
if (row == undefined || row == null) {
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
delete MoldInspectionDetailRules.uncompleted;
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0'
} else {
if (row.status == '1') {
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
MoldInspectionDetailRules.uncompleted = [required]
} else {
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
MoldInspectionDetailRules.uncompleted = [{ required: false }]
}
}
callback()
}
/** 初始化 **/

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

@ -294,6 +294,7 @@ export const MoldInspectionDetailRules = reactive({
],
number: [required],
actualMinutes: [
required,
{ validator:validateNum, message: '请输入数字格式', trigger: 'blur'}
],
maintenance: [required],
@ -455,12 +456,15 @@ export const MoldInspectionDetail = 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: '备件',
@ -481,8 +485,8 @@ export const MoldInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
// tableData.value.itemNumbers1 = value.map(item => item.itemNumber)
},
searchCondition: [{
key: 'moldNumber',
value: 'moldNumber',
key: 'deviceNumber',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true
}]
@ -498,8 +502,8 @@ export const MoldInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法
searchCondition: [{
key: 'moldNumber',
value: 'moldNumber',
key: 'deviceNumber',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true
}]

14
src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts

@ -5,8 +5,8 @@ import { dateFormatter } from '@/utils/formatTime'
import { ItemSearchTable } from '../../basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
const factoryList = await selectAllFactoryArea()
const userList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: undefined, flag: 1 })
const dutyUserList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: undefined, flag: undefined })
const userList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 })
const dutyUserList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: undefined })
// 表单校验
export const MoldMaintainOrderMainRules = reactive({
@ -99,11 +99,21 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
dictClass: 'string',
},
{
label: '描述',
field: 'describes',
sort: 'custom',
isSearch: false,
table: {
width: '150',
},
},
{
label: '类型',
field: 'type',
sort: 'custom',
isSearch: false,
isTable: false,
table: {
width: '150',
},

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

@ -118,6 +118,9 @@ import * as MoldMaintenanceMainApi from '@/api/eam/mold/moldMaintenanceMain'
import * as MoldMaintenanceDetailApi from '@/api/eam/mold/moldMaintenanceDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { useUserStore } from '@/store/modules/user'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
const moldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'MOLD')
defineOptions({ name: 'MoldMaintenanceMain' })
const message = useMessage() //
@ -208,8 +211,18 @@ const HeadButttondata = [
const buttonBaseClick = (val, item) => {
if (val == 'add') {
//
MoldMaintenanceMain.allSchemas.formSchema[3].value = 'MOLD'
MoldMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = false
MoldMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).value = 'MOLD'
MoldMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.disabled = false
MoldMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.disabled = false
MoldMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.options = moldTypeList
openForm('create')
} else if (val == 'import') {
//
@ -282,13 +295,24 @@ const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
MoldMaintenanceMain.allSchemas.formSchema[0].componentProps.disabled = true
MoldMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.disabled = true
MoldMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.disabled = true
} else if (val == 'delete') {
//
handleDelete(row.id)
} else if (val == 'acceptOrder') {
acceptOrder(row)
} else if (val == 'turnOrder') {
MoldMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.options = deviceMoldTypeList
MoldMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.disabled = false
openForm('turnOrder', row)
} else if (val == 'finishOrder') {
finishOrder(row)
@ -371,7 +395,10 @@ const searchFormClick = (searchData) => {
//
function acceptOrder(row) {
MoldMaintenanceMainApi.orderStepChange(row)
MoldMaintenanceMainApi.orderStepChange(row).then(item => {
message.success('接单成功')
getList()
})
}
//
function turnOrder() {}
@ -524,7 +551,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
})
} finally {
formRef.formLoading = false
formRef.value.formLoading = false
}
}

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

@ -44,7 +44,27 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false,
isTable: true,
},
{
label: '类型',
field: 'type',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isForm: true,
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
form: {
component: 'Select',
componentProps: {
disabled: true,
}
},
search: {
value: 'MOLD'
}
},
{
label: '设备模具编号',
field: 'deviceNumber',
@ -134,27 +154,7 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
},
}
},
{
label: '类型',
field: 'type',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isForm: true,
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
form: {
component: 'Select',
componentProps: {
disabled: true,
}
},
search: {
value: 'MOLD'
}
},
{
label: '班次',
field: 'classes',

Loading…
Cancel
Save