From 615d0cc4bf66d00fd6870fd82f36c178e094e294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B7=BB=E7=A0=96-JAVA=5CAdministrator?= <591141169@qq.com> Date: Wed, 17 Apr 2024 11:59:16 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/dict.ts | 1 + src/views/qms/qualityNotice/addForm.vue | 5 +- .../qualityNotice/components/notaicType.vue | 24 +-- .../qualityNotice/components/qualityBatch.vue | 21 ++- .../components/qualityNotice.vue | 7 +- .../qualityNotice/qualityNoticeMain.data.ts | 166 +++++++++++++++--- 6 files changed, 176 insertions(+), 48 deletions(-) diff --git a/src/utils/dict.ts b/src/utils/dict.ts index d1afb1ad1..5498161d8 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -188,6 +188,7 @@ export enum DICT_TYPE { UOM = 'uom', // 计量单位 ABC_CLASS = 'abc_class', // ABC类 TRUE_FALSE = 'true_false', // 是否 + FALSE_OR_TRUE = 'false_or_true', // 是否2 ITEM_GROUP = 'item_group', // 物料分组 ITEM_CATEGORY = 'Item_category', // 物料种类 ITEM_COLOR = 'item_color', // 物料颜色 diff --git a/src/views/qms/qualityNotice/addForm.vue b/src/views/qms/qualityNotice/addForm.vue index c902d74d5..d72630f2e 100644 --- a/src/views/qms/qualityNotice/addForm.vue +++ b/src/views/qms/qualityNotice/addForm.vue @@ -374,10 +374,13 @@ const next = () => { return; } } + console.log(33, data.value) + console.log(66,qualityNoticeFrom.value.form) data.value = { ...data.value, ...qualityNoticeFrom.value.form } + console.log( data.value) active.value++ } else { console.log('error submit!') @@ -432,4 +435,4 @@ watch( .el-tabs--left.el-tabs--border-card .el-tabs__item.is-left { min-width: 120px !important; } - \ No newline at end of file + diff --git a/src/views/qms/qualityNotice/components/notaicType.vue b/src/views/qms/qualityNotice/components/notaicType.vue index f1085a90d..75ea8a76b 100644 --- a/src/views/qms/qualityNotice/components/notaicType.vue +++ b/src/views/qms/qualityNotice/components/notaicType.vue @@ -23,7 +23,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -107,7 +107,7 @@ - + @@ -169,12 +169,16 @@ const props = defineProps({ default: false } }) -type.vlaue = props.data?.type ? props.data.type : 1 -// 编辑赋值 -type.value = parseInt(props.data.type) -q1.value = props.data?.q1 ? props.data?.q1 :{} -q2.value = props.data?.q2 ? props.data?.q2 :{} -q3.value = props.data?.q3 ? props.data?.q3 :{} +nextTick(()=>{ + type.vlaue = props.data?.type ? props.data.type : 1 + // 编辑赋值 + type.value = parseInt(props.data.type) + q1.value = props.data?.q1 ? props.data?.q1 :{} + q2.value = props.data?.q2 ? props.data?.q2 :{} + q3.value = props.data?.q3 ? props.data?.q3 :{}, + console.log(998,props.data) +}) + // 质量通知校验 const rules1 =ref({ customerCode: [required], @@ -208,4 +212,4 @@ padding: 20px; .type{ padding: 0px 20px 20px;} } - \ No newline at end of file + diff --git a/src/views/qms/qualityNotice/components/qualityBatch.vue b/src/views/qms/qualityNotice/components/qualityBatch.vue index 76617e21e..f4d3c89a7 100644 --- a/src/views/qms/qualityNotice/components/qualityBatch.vue +++ b/src/views/qms/qualityNotice/components/qualityBatch.vue @@ -338,8 +338,8 @@ - - + + @@ -493,7 +493,7 @@ const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' | nameForm.value.name = '' source.value = '' dialogVisible.value = true - dialogTitle.value = '添加物料批次名称' + dialogTitle.value = '添加物料批次顺序号' } else if (action === 'remove') { const tabs =subList.value let activeName = editableTabsValue.value @@ -600,14 +600,23 @@ const buttonBaseClick1 = (val) => { if (!nameRef.value) return nameRef.value.validate((valid, fields) => { if (valid) { - console.log(subList.value) - console.log(nameForm.value.name) const isRepeat = subList.value.some(item=>item.sequenceCode == nameForm.value.name) if(isRepeat){ message.error('列表中已存在该顺序号') return; } const newTabName = `${++tabIndex}` + itemBatch.value = { + itemCode:'', + batch:'', + inspectionBatch:'', + itemDesc:'', + totalAmount:'', + uom:'', + packageList:[], + taskList:[], + defectList:[], + } subList.value.push({ sequenceCode: nameForm.value.name, name: newTabName, @@ -665,4 +674,4 @@ defineExpose({qualityBatchFormRef, subList}) } } - \ No newline at end of file + diff --git a/src/views/qms/qualityNotice/components/qualityNotice.vue b/src/views/qms/qualityNotice/components/qualityNotice.vue index 186d1dc76..ceffbcdff 100644 --- a/src/views/qms/qualityNotice/components/qualityNotice.vue +++ b/src/views/qms/qualityNotice/components/qualityNotice.vue @@ -159,10 +159,9 @@ const props = defineProps({ const statusList = ref() // 编辑赋值 nextTick(()=>{ - form.value = props.data ? props.data: {} - form.value.status = 1 - if(form.value.number){ + if(props.data.number){ statusList.value = getIntDictOptions(DICT_TYPE.QUALITY_NOTICE_STATUS) + form.value = props.data }else{ statusList.value =getIntDictOptions(DICT_TYPE.QUALITY_NOTICE_STATUS).filter(item=>item.value == 1) } @@ -195,4 +194,4 @@ padding: 20px; .type{ padding: 0px 20px 20px;} } - \ No newline at end of file + diff --git a/src/views/qms/qualityNotice/qualityNoticeMain.data.ts b/src/views/qms/qualityNotice/qualityNoticeMain.data.ts index efb281be4..8e914280b 100644 --- a/src/views/qms/qualityNotice/qualityNoticeMain.data.ts +++ b/src/views/qms/qualityNotice/qualityNoticeMain.data.ts @@ -2,7 +2,7 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter2 } from '@/utils/formatTime' import { validateHanset, validateEmail } from '@/utils/validator' import { dateFormatter } from '@/utils/formatTime' -import {validateTwoNum } from '@/utils/validator' +import { validateTwoNum } from '@/utils/validator' const { t } = useI18n() // 国际化 /** @@ -14,7 +14,7 @@ export const QualityNoticeMain = useCrudSchemas(reactive([ field: 'number', sort: 'custom', isSearch: true, - isForm:false, + isForm: false, table: { width: 150, fixed: 'left' @@ -23,9 +23,10 @@ export const QualityNoticeMain = useCrudSchemas(reactive([ { label: '类型', field: 'type', + dictType: DICT_TYPE.QUALITY_NOTIFICATION_TYPE, sort: 'custom', isSearch: true, - isForm:false, + isForm: false, table: { width: 150 } @@ -35,7 +36,7 @@ export const QualityNoticeMain = useCrudSchemas(reactive([ field: 'description', sort: 'custom', isSearch: false, - isForm:false, + isForm: false, table: { width: 150 } @@ -45,22 +46,22 @@ export const QualityNoticeMain = useCrudSchemas(reactive([ field: 'detail', sort: 'custom', isSearch: false, - isForm:false, + isForm: false, table: { width: 150 } - },{ + }, { label: '优先级', field: 'priority', sort: 'custom', isSearch: false, - isForm:false, + isForm: false, table: { width: 150 }, form: { - componentProps:{ - disabled:true + componentProps: { + disabled: true } }, }, @@ -69,13 +70,13 @@ export const QualityNoticeMain = useCrudSchemas(reactive([ field: 'status', sort: 'custom', isSearch: false, - isForm:false, + isForm: false, table: { width: 150 }, form: { - componentProps:{ - disabled:true + componentProps: { + disabled: true } }, }, @@ -84,13 +85,13 @@ export const QualityNoticeMain = useCrudSchemas(reactive([ field: 'reporter', sort: 'custom', isSearch: false, - isForm:false, + isForm: false, table: { width: 150 }, form: { - componentProps:{ - disabled:true + componentProps: { + disabled: true } }, }, @@ -98,8 +99,27 @@ export const QualityNoticeMain = useCrudSchemas(reactive([ label: '报告时间', field: 'reportTime', sort: 'custom', + formatter: dateFormatter, isSearch: false, - isForm:false, + isForm: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, table: { width: 150 } @@ -108,8 +128,27 @@ export const QualityNoticeMain = useCrudSchemas(reactive([ label: '要求开始时间', field: 'requestStartTime', sort: 'custom', + formatter: dateFormatter, isSearch: false, - isForm:false, + isForm: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, table: { width: 150 } @@ -118,8 +157,27 @@ export const QualityNoticeMain = useCrudSchemas(reactive([ label: '要求结束时间', field: 'requestEndTime', sort: 'custom', + formatter: dateFormatter, isSearch: false, - isForm:false, + isForm: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, table: { width: 150 } @@ -127,9 +185,10 @@ export const QualityNoticeMain = useCrudSchemas(reactive([ { label: '是否造成停机', field: 'whetherCausesMachineHalt', + dictType: DICT_TYPE.FALSE_OR_TRUE, sort: 'custom', isSearch: false, - isForm:false, + isForm: false, table: { width: 150 } @@ -138,8 +197,27 @@ export const QualityNoticeMain = useCrudSchemas(reactive([ label: '停机开始时间', field: 'machineHaltStartTime', sort: 'custom', + formatter: dateFormatter, isSearch: false, - isForm:false, + isForm: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, table: { width: 150 } @@ -147,12 +225,27 @@ export const QualityNoticeMain = useCrudSchemas(reactive([ { label: '停机结束时间', field: 'machineHaltEndTime', - dictType: DICT_TYPE.INSPECTION_TYPE, sort: 'custom', + formatter: dateFormatter, isSearch: false, - isForm:false, + isForm: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, form: { - component: 'Select' + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' }, table: { width: 150 @@ -163,7 +256,7 @@ export const QualityNoticeMain = useCrudSchemas(reactive([ field: 'coordinator', sort: 'custom', isSearch: false, - isForm:false, + isForm: false, table: { width: 150 } @@ -173,7 +266,7 @@ export const QualityNoticeMain = useCrudSchemas(reactive([ field: 'taskTemplateCode', sort: 'custom', isSearch: false, - isForm:false, + isForm: false, table: { width: 150 } @@ -182,8 +275,27 @@ export const QualityNoticeMain = useCrudSchemas(reactive([ label: '完成时间', field: 'finishTime', sort: 'custom', + formatter: dateFormatter, isSearch: false, - isForm:false, + isForm: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, table: { width: 150 } @@ -194,7 +306,7 @@ export const QualityNoticeMain = useCrudSchemas(reactive([ field: 'referenceNoticeCode', sort: 'custom', isSearch: false, - isForm:false, + isForm: false, form: { component: 'InputNumber', value: 0