Browse Source

修复测试bug

master
ljlong_2630 8 months ago
parent
commit
f83f1ed35a
  1. 2
      src/views/eam/device/deviceSpotInspectionRecordMain/index.vue
  2. 10
      src/views/eam/device/deviceinspectionjob/index.vue
  3. 11
      src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts
  4. 39
      src/views/eam/device/devicemaintainjob/index.vue
  5. 40
      src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts
  6. 2
      src/views/eam/device/devicemaintenancejob/index.vue
  7. 14
      src/views/eam/mold/moldinspectionjob/index.vue
  8. 20
      src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts
  9. 51
      src/views/eam/mold/moldmaintainjob/index.vue
  10. 21
      src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts
  11. 2
      src/views/eam/mold/moldmaintenancejob/index.vue

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

@ -453,7 +453,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
describes:data.describes,
describes1:data.describes1,
itemNumbers:data.itemNumbers,
maintenances:data.maintenances.join(','),
maintenances:data.maintenances?.join(','),
workOut:data.workOut,
}
console.log(data1)

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

@ -504,11 +504,11 @@ 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]
DeviceInspectionDetailRules.uncompleted = [{ required: true }]
} 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;
DeviceInspectionDetailRules.uncompleted = [{ required: false }]
}
}
}
@ -517,16 +517,16 @@ 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;
DeviceInspectionDetailRules.uncompleted = [{ required: false }]
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]
DeviceInspectionDetailRules.uncompleted = [{ required: true }]
} 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;
DeviceInspectionDetailRules.uncompleted = [{ required: false }]
}
}

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

@ -60,6 +60,7 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '厂区编号',
field: 'factoryAreaNumber',
sort: 'custom',
isDetail: false,
table: {
width: '150',
},
@ -93,6 +94,15 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
detail: {
}
},
{
label: '厂区',
field: 'factoryAreaNumber1',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail: true
},
{
label: '状态',
field: 'status',
@ -220,6 +230,7 @@ export const DeviceMaintainOrderDetailRules = reactive({
chargePeoples: [required],
completionTime: [required],
engineer: [required],
uncompleted: [required],
})
export const DeviceMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([

39
src/views/eam/device/devicemaintainjob/index.vue

@ -452,16 +452,22 @@ const detailValidate = (data) => {
}
}
//
const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
const detailSubmitForm= async (formType,data,getList1,formRef,tableList) => {
try {
let data1 = {
id:data.id,
maintenanceNumber:data.maintenanceNumber,
number:data.number,
describes:data.describes,
describes1: data.describes1,
peoples: data.peoples,
status: data.status,
itemNumbers: data.itemNumbers,
maintenances:data.maintenances.join(','),
estimatedMinutes: data.estimatedMinutes,
actualMinutes: data.actualMinutes,
chargePeoples:data.chargePeoples?.join(','),
workOut:data.workOut,
engineer: data.engineer,
completionTime: data.completionTime,
}
console.log(data1)
if (formType === 'create') {
@ -473,7 +479,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
}
formRef.dialogVisible = false
//
await getList()
await formRef.getList1
detailRef.value.tableObject.tableList.forEach(item=>{
if (item.itemNumbers?.length>0) {
let str = ''
@ -485,7 +491,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
})
} finally {
formRef.formLoading = false
detailRef.formLoading = false
}
}
@ -513,13 +519,32 @@ function detailOnChange(field, cur, item) {
if (field == 'status') {
if (cur == '1') {
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
DeviceMaintainOrderDetailRules.uncompleted = [required]
DeviceMaintainOrderDetailRules.uncompleted = [{ required: true }]
} else {
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
DeviceMaintainOrderDetailRules.uncompleted= [{ required: false }]
}
}
}
const openFormCallBack = (type, row, masterParmas, callback) => {
if (row == undefined || row == null) {
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
DeviceMaintainOrderDetailRules.uncompleted = [{ required: false }]
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0'
} else {
if (row.status == '1') {
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
DeviceMaintainOrderDetailRules.uncompleted = [{ required: true }]
} else {
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
delete DeviceMaintainOrderDetailRules.uncompleted;
DeviceMaintainOrderDetailRules.uncompleted = [{ required: false }]
}
}
callback()
}
</script>

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

@ -88,6 +88,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '厂区编号',
field: 'factoryAreaNumber',
sort: 'custom',
isDetail: false,
table: {
width: '150',
},
@ -119,10 +120,23 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
},
}
},
{
label: '厂区编号',
field: 'factoryAreaNumber1',
sort: 'custom',
isDetail: true,
isSearch: false,
isForm: false,
isTable: false,
table: {
width: 150
}
},
{
label: '维修人',
field: 'maintenance',
sort: 'custom',
isDetail: false,
table: {
width: '150',
},
@ -143,6 +157,18 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
},
}
},
{
label: '维修人',
field: 'maintenance1',
sort: 'custom',
isDetail: true,
isSearch: false,
isForm: false,
isTable: false,
table: {
width: 150
}
},
{
label: '类型',
field: 'type',
@ -315,7 +341,7 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '维修人',
field: 'maintenances',
field: 'maintenance',
sort: 'custom',
isDetail: false,
api: () => userListAll,
@ -347,18 +373,6 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '维修人',
field: 'maintenances1',
sort: 'custom',
isDetail: true,
isSearch: false,
isForm: false,
isTable: false,
table: {
width: 150
}
},
{
label: '备件',
field: 'itemNumbers1',

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

@ -517,7 +517,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
describes:data.describes,
describes1:data.describes1,
itemNumbers:data.itemNumbers,
maintenances:data.maintenances.join(','),
maintenances:data.maintenances?.join(','),
workOut:data.workOut,
}
console.log(data1)

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

@ -86,6 +86,8 @@ import * as MoldInspectionMainApi from '@/api/eam/mold/moldInspectionMain'
import * as MoldInspectionDetailApi from '@/api/eam/mold/moldInspectionDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { useUserStore } from '@/store/modules/user'
import { selectAllFactoryArea } from '@/api/system/dept'
import * as UserApi from '@/api/system/user'
// import TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
@ -232,7 +234,11 @@ const formsSuccess = async (formType, data) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
const openDetail = async (row: any, titleName: any, titleValue: any) => {
const factoryList = await selectAllFactoryArea()
const userListAll = await UserApi.getSimpleUserList()
row.factoryAreaNumber1 = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name
row.maintenance1 = userListAll.find((account) => account.id == row.maintenance)?.nickname
detailRef.value.openDetail(row, titleName, titleValue, 'basicMoldInspectionMain')
}
@ -461,7 +467,7 @@ 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]
MoldInspectionDetailRules.uncompleted = [{ required: true }]
} else {
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
@ -474,12 +480,12 @@ 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;
MoldInspectionDetailRules.uncompleted = [{ required: false }]
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]
MoldInspectionDetailRules.uncompleted = [{ required: true }]
} else {
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''

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

@ -119,6 +119,7 @@ export const MoldInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '厂区',
field: 'factoryAreaNumber',
sort: 'custom',
isDetail: false,
isSearch: false,
table: {
width: '150',
@ -151,10 +152,20 @@ export const MoldInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
},
}
},
{
label: '厂区',
field: 'factoryAreaNumber1',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail: true
},
{
label: '维修人',
field: 'maintenance',
sort: 'custom',
isDetail: false,
isSearch: false,
table: {
width: '150',
@ -187,6 +198,15 @@ export const MoldInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
},
}
},
{
label: '维修人',
field: 'maintenance1',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail: true
},
// {
// label: '维修人联系电话',
// field: 'maintenancePhone',

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

@ -108,6 +108,8 @@ import * as MoldMaintainOrderMainApi from '@/api/eam/mold/moldMaintainOrderMain'
import * as MoldMaintainOrderDetailApi from '@/api/eam/mold/moldMaintainOrderDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { useUserStore } from '@/store/modules/user'
import { selectAllFactoryArea } from '@/api/system/dept'
import * as UserApi from '@/api/system/user'
defineOptions({ name: 'MoldMaintainOrderMain' })
const message = useMessage() //
@ -288,7 +290,9 @@ const openForm = (type: string, row?: any) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
const openDetail = async (row: any, titleName: any, titleValue: any) => {
const factoryList = await selectAllFactoryArea()
row.factoryAreaNumber1 = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name
detailRef.value.openDetail(row, titleName, titleValue,'MoldMaintainOrderMain')
}
@ -392,7 +396,7 @@ const submitForm = async (formType, data) => {
describes: item.describes,
describes1: item.describes1,
itemNumbers: item.itemNumbers1,
maintenances: item.maintenances.join(','),
maintenances: item.maintenances?.join(','),
workOut: item.workOut,
}
}) //
@ -451,16 +455,22 @@ const detailValidate = (data) => {
}
}
//
const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
const detailSubmitForm= async (formType,data,getList1,formRef,tableList) => {
try {
let data1 = {
id:data.id,
number:data.number,
describes:data.describes,
describes1: data.describes1,
peoples: data.peoples,
status: data.status,
itemNumbers: data.itemNumbers,
maintenances:data.maintenances.join(','),
estimatedMinutes: data.estimatedMinutes,
actualMinutes: data.actualMinutes,
chargePeoples:data.chargePeoples?.join(','),
workOut: data.workOut,
engineer: data.engineer,
completionTime: data.completionTime,
}
console.log(data1)
if (formType === 'create') {
@ -472,7 +482,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
}
formRef.dialogVisible = false
//
await getList()
await formRef.getList1
detailRef.value.tableObject.tableList.forEach(item=>{
if (item.itemNumbers?.length>0) {
let str = ''
@ -484,7 +494,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
})
} finally {
formRef.formLoading = false
detailRef.formLoading = false
}
}
@ -506,16 +516,35 @@ function buttonControllFunction(row, val) {
function detailOnChange(field, cur, item) {
if (field == 'status') {
if (cur == '1') {
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
DeviceMaintainOrderDetailRules.uncompleted = [required]
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
MoldMaintainOrderDetailRules.uncompleted = [{ required: true }]
} else {
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
delete DeviceMaintainOrderDetailRules.uncompleted;
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
MoldMaintainOrderDetailRules.uncompleted = [{ required: false }]
}
}
}
const openFormCallBack = (type, row, masterParmas, callback) => {
if (row == undefined || row == null) {
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
MoldMaintainOrderDetailRules.uncompleted = [{ required: false }]
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0'
} else {
if (row.status == '1') {
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
MoldMaintainOrderDetailRules.uncompleted = [{ required: true }]
} else {
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
MoldMaintainOrderDetailRules.uncompleted = [{ required: false }]
}
}
callback()
}
/** 初始化 **/
onMounted(async () => {
getList()

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

@ -52,6 +52,7 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '厂区编号',
field: 'factoryAreaNumber',
sort: 'custom',
isDetail: false,
table: {
width: '150',
},
@ -85,6 +86,15 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
detail: {
}
},
{
label: '厂区',
field: 'factoryAreaNumber1',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail: true
},
{
label: '状态',
field: 'status',
@ -267,7 +277,8 @@ export const MoldMaintainOrderDetailRules = reactive({
actualMinutes: [required],
chargePeoples: [required],
completionTime: [required],
engineer: [required]
engineer: [required],
uncompleted: [required]
})
export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
@ -429,8 +440,8 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
// tableData.value.itemNumbers1 = value.map(item => item.itemNumber)
},
searchCondition: [{
key: 'moldNumber',
value: 'moldNumber',
key: 'deviceNumber',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true
}]
@ -446,8 +457,8 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法
searchCondition: [{
key: 'moldNumber',
value: 'moldNumber',
key: 'deviceNumber',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true
}]

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

@ -526,7 +526,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
describes:data.describes,
describes1:data.describes1,
itemNumbers:data.itemNumbers,
maintenances:data.maintenances.join(','),
maintenances:data.maintenances?.join(','),
workOut:data.workOut,
}
console.log(data1)

Loading…
Cancel
Save