diff --git a/src/views/qms/inspectionQ3/index.vue b/src/views/qms/inspectionQ3/index.vue index 2682c5d0c..f84c2ead1 100644 --- a/src/views/qms/inspectionQ3/index.vue +++ b/src/views/qms/inspectionQ3/index.vue @@ -71,7 +71,6 @@ @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" @inputNumberChange="inputNumberChange" - @clearSearchInput="onChange" :sumFormDataByTableCustom=" (formRef, formModel, tableData) => { tableData.forEach((item) => { @@ -360,26 +359,15 @@ const handleFinish = async (id: number) => { /** 添加/修改操作 */ const formRef = ref() const openForm = async (type: string, row?: any) => { - tableData.value = [] // 重置明细数据 - // 编辑时 车间代码不可修改 - if (type == 'update') { - // 修改 tableform 属性 - InspectionQ3Main.allSchemas.formSchema.map((itemColumns) => { - if (itemColumns.field == 'workshopCode') { - itemColumns.componentProps.isSearchList = false - itemColumns.componentProps.disabled = true - } - }) - } else { - // 修改 tableform 属性 - InspectionQ3Main.allSchemas.formSchema.map((itemColumns) => { - if (itemColumns.field == 'workshopCode') { - itemColumns.componentProps.isSearchList = true - itemColumns.componentProps.disabled = false - } + formRef.value.open(type, row) + if (type == 'create') { + nextTick(() => { + formRef.value.formRef.setValues({ + handleTime: new Date().getTime(), + priority: '3' + }) }) } - formRef.value.open(type, row) } // 获取部门 用于详情 部门回显 @@ -391,7 +379,7 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { .get(CACHE_KEY.DEPT) .find((account) => account.id == row.departmentCode)?.name if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) - detailRef.value.openDetail(row, titleName, titleValue, 'requestIssueMain') + detailRef.value.openDetail(row, titleName, titleValue, 'inspectionQ3Main') } /** 删除按钮操作 */ diff --git a/src/views/qms/inspectionQ3/inspectionQ3.data.ts b/src/views/qms/inspectionQ3/inspectionQ3.data.ts index 27045abd9..c1c8003f6 100644 --- a/src/views/qms/inspectionQ3/inspectionQ3.data.ts +++ b/src/views/qms/inspectionQ3/inspectionQ3.data.ts @@ -10,7 +10,6 @@ import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/item import * as ProductionlineitemApi from '@/api/wms/productionlineitem' import { Productionlineitem } from '@/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data' - import * as QadCostcentreApi from '@/api/wms/qadCostcentre' import { QadCostcentre } from '@/views/wms/basicDataManage/subject/qadCostcentre/qadCostcentre.data' @@ -115,7 +114,7 @@ export const InspectionQ3Main = useCrudSchemas( dictType: DICT_TYPE.QUALITY_NOTIFICATION_PRIORITY, dictClass: 'string', isSearch: false, - isTable: false, + isTable: true, tableForm: { type: 'Select' } @@ -153,7 +152,8 @@ export const InspectionQ3Main = useCrudSchemas( component: 'InputNumber', componentProps: { min: 0, - precision: 6 + precision: 6, + disabled: true } } }, @@ -208,7 +208,7 @@ export const InspectionQ3Main = useCrudSchemas( field: 'costCode', sort: 'custom', isSearch: false, - isTable: false, + isTable: true, isForm: false, form: { // labelMessage: '信息提示说明!!!', @@ -245,8 +245,17 @@ export const InspectionQ3Main = useCrudSchemas( label: '缺陷编码', field: 'defectCode', sort: 'custom', + dictType: DICT_TYPE.QMS_Q3_CODE, + dictClass: 'string', isSearch: false, - isForm: false + isForm: false, + isTable: true, + table: { + width: 180 + }, + tableForm: { + type: 'Select' + } }, { label: '缺陷位置', @@ -360,15 +369,9 @@ export const InspectionQ3Main = useCrudSchemas( ) export const InspectionQ3MainRules = reactive({ - workshopCode: [{ required: true, message: '请选择车间代码', trigger: 'change' }], - productionLineCode: [{ required: true, message: '请选择生产线代码', trigger: 'change' }], - // fromWarehouseCode: [ - // { required: true, message: '请选择从仓库代码', trigger: 'change' } - // ], - // dueTime: [ - // { required: true, message: '请选择截止时间', trigger: 'change' } - // ], - remark: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }] + priority: [{ required: true, message: '请选择优先级', trigger: 'change' }], + handleTime: [{ required: true, message: '请选择处理时间', trigger: 'change' }], + desc: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }] }) /** @@ -389,13 +392,14 @@ export const InspectionQ3Detail = useCrudSchemas( field: 'itemCode', sort: 'custom', isTable: false, + isDetail: true, isSearch: false, table: { width: 150 }, tableForm: { isInpuFocusShow: false, - disabled:true, + disabled: true, searchListPlaceholder: '请选择物料代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '物料信息', // 查询弹窗标题 @@ -409,7 +413,7 @@ export const InspectionQ3Detail = useCrudSchemas( } ], isShowTableFormSearch: true, //tableForm下方是否出现输入框 - isRepeat: true,//tableForm下方输入框是否可以重复添加该条数据 + isRepeat: true, //tableForm下方输入框是否可以重复添加该条数据 verificationParams: [ { key: 'code', @@ -457,7 +461,7 @@ export const InspectionQ3Detail = useCrudSchemas( sort: 'custom', isSearch: false, isTable: false, - + tableForm: { type: 'InputNumber', min: 0, @@ -553,7 +557,7 @@ export const InspectionQ3Detail = useCrudSchemas( dictType: DICT_TYPE.QMS_Q3_CODE, dictClass: 'string', isSearch: true, - isTable: true, + isTable: false, tableForm: { type: 'Select' } @@ -580,7 +584,6 @@ export const InspectionQ3Detail = useCrudSchemas( type: 'Select', valueField: 'productionLineName', labelField: 'productionLineCode' - } }, { @@ -596,6 +599,7 @@ export const InspectionQ3Detail = useCrudSchemas( { label: '问题原因', field: 'problemReason', + hiddenInMain: true, sort: 'custom', isSearch: false, isTable: false,