From 97706722832c04cdb91675ecfe0675bd190c85af Mon Sep 17 00:00:00 2001 From: zhaoxuebing <1291173720@qq.com> Date: Mon, 8 Apr 2024 13:59:10 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supplierinvoiceRequestMain/index.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue index 9e24fd4bb..174c0ada1 100644 --- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue +++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue @@ -251,10 +251,10 @@ // 列表-操作按钮 const butttondata = (row) => { return [ - defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['1',, '2','4']) }), // 打开 + defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['1']) }), // 打开 defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']) }), // 提交审批 { - label: '采购审批通过', + label: '采购通过', name: 'purchase_mainPlanSub', hide: isShowMainButton(row, ['2','7']), type: 'primary', @@ -272,7 +272,7 @@ hasPermi: '' }, { - label: '发票寄出确认', + label: '供应商确认', name: 'invoice_sent_out', hide: isShowMainButton(row, ['8']), type: 'danger', @@ -281,7 +281,7 @@ hasPermi: '' }, { - label: '财务审批通过', + label: '财务通过', name: 'finance_mainPlanSub', hide: isShowMainButton(row, ['4']), type: 'primary', @@ -301,7 +301,7 @@ // defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['2']) }), // 审批通过 //defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['2']) }), // 驳回按钮 defaultButtons.mainListEditBtn({ hasPermi: 'wms:supplierinvoice-request-main:update' , hide: isShowMainButton(row, ['1','8'])}), // 编辑 - defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1', '2','4']) }), // 关闭 + defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1','8']) }), // 关闭 // 生成记录 // { // label: '处理', From f8bfda3315d751bf947ed9dd66c3d76576003449 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Mon, 8 Apr 2024 14:09:03 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=92=8C=E6=A3=80=E9=AA=8C=E8=AE=B0=E5=BD=95=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=8C=85=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspectionJobPackage/index.ts | 6 + src/components/listTable/index.ts | 3 + src/components/listTable/src/ListTable.vue | 40 ++ src/locales/en-US.ts | 1 + src/locales/zh-CN.ts | 1 + src/utils/disposition/defaultButtons.ts | 12 + .../qms/inspection/inspectionJob/addForm.vue | 393 +++++++++++------- .../qms/inspection/inspectionJob/index.vue | 61 +-- .../inspectionJob/inspectionJobMain.data.ts | 65 ++- .../qms/inspection/inspectionRecord/index.vue | 10 +- 10 files changed, 367 insertions(+), 225 deletions(-) create mode 100644 src/api/qms/inspectionJob/inspectionJobPackage/index.ts create mode 100644 src/components/listTable/index.ts create mode 100644 src/components/listTable/src/ListTable.vue diff --git a/src/api/qms/inspectionJob/inspectionJobPackage/index.ts b/src/api/qms/inspectionJob/inspectionJobPackage/index.ts new file mode 100644 index 000000000..e4b98fd47 --- /dev/null +++ b/src/api/qms/inspectionJob/inspectionJobPackage/index.ts @@ -0,0 +1,6 @@ +import request from '@/config/axios' + +//查询检验申请列表 +export const getInspectionJobPackageList = async (id: number) => { + return await request.get({ url: `/qms/inspection-job-package/list?masterId=` + id }) +} \ No newline at end of file diff --git a/src/components/listTable/index.ts b/src/components/listTable/index.ts new file mode 100644 index 000000000..e95f79c43 --- /dev/null +++ b/src/components/listTable/index.ts @@ -0,0 +1,3 @@ +import ListTable from './src/ListTable.vue' + +export { ListTable } diff --git a/src/components/listTable/src/ListTable.vue b/src/components/listTable/src/ListTable.vue new file mode 100644 index 000000000..b9985a8d0 --- /dev/null +++ b/src/components/listTable/src/ListTable.vue @@ -0,0 +1,40 @@ + + + + diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 22c41afaa..05d1cd48a 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -296,6 +296,7 @@ export default { delete: 'Delete', edit: 'Edit', update: 'Update', + execute: 'Execute', preview: 'Preview', more: 'More', sync: 'Sync', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 7ab623b0b..979826038 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -297,6 +297,7 @@ export default { edit: '编辑', update: '编辑', preview: '预览', + execute: '执行', more: '更多', sync: '同步', save: '保存', diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index 9095ca7e5..7f81426e2 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -691,6 +691,18 @@ export function mainListJobExeBtn(option:any) { hasPermi: '' }) } +// 主列表-包装按钮 +export function mainListPackageBtn(option:any) { + return __defaultBtnOption(option,{ + label: '包装', + name: 'mainPackage', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} // 主列表-打印 export function mainListPointBtn(option:any) { return __defaultBtnOption(option,{ diff --git a/src/views/qms/inspection/inspectionJob/addForm.vue b/src/views/qms/inspection/inspectionJob/addForm.vue index 3a469b564..10fa03b5c 100644 --- a/src/views/qms/inspection/inspectionJob/addForm.vue +++ b/src/views/qms/inspection/inspectionJob/addForm.vue @@ -27,7 +27,7 @@ :stretch="false" > - + @@ -51,12 +55,12 @@ - + - + @@ -83,39 +87,45 @@ - - + + - -
- -
-
-
- - -
- -
-
-
- - + - + - + - + @@ -219,43 +261,54 @@ - + + :value="dict.value" + /> - + - + - + - + + :value="dict.dictionaryValue" + /> - + - - + + :value="dict.value" + /> @@ -313,7 +366,6 @@ import { DynamicRule } from '@/views/qms/basicDataManage/dynamicRule/dynamicRule import * as SelectedSetApi from '@/api/qms/selectedSet' //选择集 import { SelectedSet } from '@/views/qms/basicDataManage/selectedSet/selectedSet.data' //选择集 - const { proxy } = getCurrentInstance() const message = useMessage() // 消息弹窗 @@ -354,12 +406,12 @@ const props = defineProps({ required: true, default: null }, - // 校验rules - rules: { + // 校验rules + rules: { type: Object, required: true, default: null - }, + } }) const { t } = useI18n() // 国际化 @@ -400,7 +452,7 @@ if (props.basicFormWidth) { } const rules = ref({ ...props.rules, - 'inspectionJobCharacteristicsUpdateReqVO.description': [ + 'inspectionJobCharacteristicsUpdateReqVO.description': [ { required: true, message: '请填写描述', trigger: ['blur', 'change'] } ], 'inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode': [ @@ -437,22 +489,17 @@ const rules = ref({ { required: true, message: '请输入选择集编码', trigger: 'change' } ], 'inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime': [ - { required: true, message: '请输入选择开始时间', trigger: 'change'} + { required: true, message: '请输入选择开始时间', trigger: 'change' } ], 'inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime': [ { required: true, message: '请输入选择结束时间', trigger: 'blur' } -], -qualifiedQuantity: [ - { required: true, message: '请输入选择结束时间', trigger: 'blur' } -], - - + ], + qualifiedQuantity: [{ required: true, message: '请输入选择结束时间', trigger: 'blur' }] }) /** 打开弹窗 */ let tabIndex = 1 const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => { - dialogVisible.value = true if (titleName) { dialogTitle.value = t('action.' + titleName) } else { @@ -468,30 +515,32 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any editableTabsValue.value = index + 1 item.name = index + 1 item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList=[] + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true - if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod==0) { - // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true - for(let i=0;i { + formMainRef.value.setValues(row) + }) } else { data.value = { code: '', @@ -528,7 +581,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any subList: [] } } - + dialogVisible.value = true tabIndex = data.value.subList.length + 1 } defineExpose({ open, dialogVisible, formLoading }) // 提供 open 方法,用于打开弹窗 @@ -633,51 +686,66 @@ const validateForm = (formRef) => { const submitForm = async () => { try { - console.log(data.value.subList) // const validateForm1 = await validateForm(formMainRef.value) const elForm = unref(formMainRef)?.getElFormRef() - // 校验表单 - if (!elForm) return - const valid = await elForm.validate() - if (!valid) return - // const bol1 = await validateForm(formProcessRef.value) - const bol2 = await validateForm(formFeaturesRef.value) - if (!bol2) { + // 校验表单 + if (!elForm) return + const valid = await elForm.validate() + if (!valid) return + // const bol1 = await validateForm(formProcessRef.value) + const bol2 = await validateForm(formFeaturesRef.value) + if (!bol2) { message.error(`模板中有检验工序和检验特性未填写完全`) return } - // 判断附加费用数组是否有未填的选项 - let arrBol = data.value.subList.map((item, index) => { - let arr1 = [] - if(item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1){ - arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{ - return !cur.qualifiedQuantity || !cur.unqualifiedQuantity - })) + // 判断附加费用数组是否有未填的选项 + let arrBol = data.value.subList.map((item, index) => { + let arr1 = [] + if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) { + arr1.push( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( + (cur, key) => { + return !cur.qualifiedQuantity || !cur.unqualifiedQuantity + } + ) + ) } - if(item.samplingProcessRespVO.evaluationMode == 1){ - arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{ - return !cur.estimateCode ||!cur.defectLevel - })) + if (item.samplingProcessRespVO.evaluationMode == 1) { + arr1.push( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( + (cur, key) => { + return !cur.estimateCode || !cur.defectLevel + } + ) + ) } - if(item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0){ - arr1.push( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{ - return !cur.inspectionValue - })) + if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) { + arr1.push( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( + (cur, key) => { + return !cur.inspectionValue + } + ) + ) } - if(item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1){ - arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{ - return !cur.qualitativeCode - })) + if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1) { + arr1.push( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( + (cur, key) => { + return !cur.qualitativeCode + } + ) + ) } return arr1 - }) -// console.log(arrBol) -// let isEmpty1 = arrBol.filter(item=>item == true) -// arrBol.forEach(item=>{ -// console.log('1q1q') -// console.log(typeof item) -// }) + }) + // console.log(arrBol) + // let isEmpty1 = arrBol.filter(item=>item == true) + // arrBol.forEach(item=>{ + // console.log('1q1q') + // console.log(typeof item) + // }) // setTimeout(()=>{ // console.log(arrBol.includes(true)) // },2000) @@ -789,22 +857,22 @@ const opensearchTable = ( // 弹层确定返回所选数据 // val : 弹层列表row 数据 const searchTableSuccess = async (formField, searchField, val, type, row) => { - if(type == 'features'){ + if (type == 'features') { row.inspectionJobCharacteristicsUpdateReqVO[formField] = val[0].code - if(formField == 'inspectionMethodCode'){ + if (formField == 'inspectionMethodCode') { row.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName = val[0].description - }else if(formField == 'dynamicUpdateCode'){ + } else if (formField == 'dynamicUpdateCode') { row.inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateName = val[0].description - }else if(formField == 'inspectionMethod'){ + } else if (formField == 'inspectionMethod') { row.inspectionJobCharacteristicsUpdateReqVO.inspectionName = val[0].description } - } else if(type == 'main'){ + } else if (type == 'main') { data.value[formField] = val[0].code - if(formField == 'itemCode'){ + if (formField == 'itemCode') { data.value.itemName = val[0].name - }else if(formField == 'testTypeCode'){ + } else if (formField == 'testTypeCode') { data.value.testTypeName = val[0].description - }else if(formField == 'programmeTemplateCode'){ + } else if (formField == 'programmeTemplateCode') { data.value.programmeTemplateName = val[0].description } if (formField == 'programmeTemplateCode') { @@ -821,7 +889,8 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => { if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) { rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true } else { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = false + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = + false } if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) { rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true @@ -836,36 +905,38 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => { // emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row) } // 请选择结果录入方式 -const resultEntryMethodChange = (e,item) => { - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList =[] - if (e==0) { +const resultEntryMethodChange = (e, item) => { + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] + if (e == 0) { // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true - for(let i=0;i{ - let obj = item.selectedProjectRespVOList.find(cur=>cur.dictionaryValue==e) +const changeQualitativeCode = (e, item, cur) => { + let obj = item.selectedProjectRespVOList.find((cur) => cur.dictionaryValue == e) console.log(obj) cur.defectLevel = obj.defectLevel } diff --git a/src/views/qms/inspection/inspectionJob/index.vue b/src/views/qms/inspection/inspectionJob/index.vue index b5e4ed1cb..6f95beb7e 100644 --- a/src/views/qms/inspection/inspectionJob/index.vue +++ b/src/views/qms/inspection/inspectionJob/index.vue @@ -27,12 +27,6 @@ - + - - - - - + + From aa9df7d4e059a85c6f266025f178626c69fb405d Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Mon, 8 Apr 2024 16:34:07 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=EF=BC=8C=E5=8F=91=E5=B8=83=E5=92=8C=E4=BD=BF=E7=94=A8=E5=86=B3?= =?UTF-8?q?=E7=AD=96=EF=BC=8C=E6=A3=80=E9=AA=8C=E4=BB=BB=E5=8A=A1=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspectionRecordMain/index.ts | 4 ++ src/locales/en-US.ts | 3 +- src/locales/zh-CN.ts | 3 +- src/utils/disposition/defaultButtons.ts | 13 +++- .../inspectionPlan/addForm.vue | 2 - .../qms/inspection/inspectionJob/addForm.vue | 61 ++++++++++--------- .../qms/inspection/inspectionRecord/index.vue | 41 +++++++++++-- .../inspectionRecordMain.data.ts | 35 +++++++++++ 8 files changed, 123 insertions(+), 39 deletions(-) diff --git a/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts b/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts index 02663e294..c04557bd6 100644 --- a/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts +++ b/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts @@ -63,3 +63,7 @@ export const exportInspectionRecordMain = async (params) => { export const importTemplate = () => { return request.download({ url: '/qms/inspection-record-main/get-import-template' }) } +// 发布 +export const publishInspectionRecordMain = async (data ) => { + return await request.put({ url: `/qms/inspection-record-main/publish`, data }) +} diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 05d1cd48a..4590ca435 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -313,7 +313,8 @@ export default { dataUpdate: 'Dict Data Eidt', fileUpload: 'File Upload', createLabel: 'create label', - viewDetail:'Detailed list' + viewDetail:'Detailed list', + updataRecode:'Updata recode' }, dialog: { dialog: 'Dialog', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 979826038..37dc11cb8 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -312,7 +312,8 @@ export default { dataCreate: '字典数据新增', dataUpdate: '字典数据编辑', createLabel: '创建标签', - viewDetail:'明细列表' + viewDetail:'明细列表', + updataRecode:'更新记录' }, dialog: { dialog: '弹窗', diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index 7f81426e2..998e0a9ac 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -811,7 +811,18 @@ export function mainThawRequesttBtn(option:any) { hasPermi: '' }) } - +// 主列表-更新检验记录 +export function mainUpdataRecodeBtn(option:any) { + return __defaultBtnOption(option,{ + label: '更新检验记录', + name: 'updataRecode', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} // 默认按钮规则 function __defaultBtnOption(option:any,specific:any){ return { diff --git a/src/views/qms/basicDataManage/inspectionPlan/addForm.vue b/src/views/qms/basicDataManage/inspectionPlan/addForm.vue index 8b584fb2c..967a5833b 100644 --- a/src/views/qms/basicDataManage/inspectionPlan/addForm.vue +++ b/src/views/qms/basicDataManage/inspectionPlan/addForm.vue @@ -886,8 +886,6 @@ const validateForm = (formRef) => { const submitForm = async () => { try { const validateForm1 = await validateForm(formProcessRef.value) - console.log(validateForm1) - console.log(data.value) await formMainRef.value.validate() if (!data.value.process || data.value.process.length == 0) { message.error(`请添加工序`) diff --git a/src/views/qms/inspection/inspectionJob/addForm.vue b/src/views/qms/inspection/inspectionJob/addForm.vue index 10fa03b5c..d562c7be1 100644 --- a/src/views/qms/inspection/inspectionJob/addForm.vue +++ b/src/views/qms/inspection/inspectionJob/addForm.vue @@ -515,11 +515,11 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any editableTabsValue.value = index + 1 item.name = index + 1 item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 0) { // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true - for (let i = 0; i < data.value.sampleTotalAmount; i++) { + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] + for (let i = 0; i < parseInt(data.value.sampleTotalAmount); i++) { item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ inspectionValue: '', //检验值 qualitativeCode: '', //定性字典项值 @@ -530,17 +530,17 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any }) } } else { + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [ - { - inspectionValue: '', //检验值 - qualitativeCode: '', //定性字典项值 - estimateCode: '', //评估代码 - defectLevel: '', //缺陷级别 - qualifiedQuantity: '', //合格数量 - unqualifiedQuantity: '' //不合格数量 - } - ] + // item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ + // inspectionValue: '', //检验值 + // qualitativeCode: '', //定性字典项值 + // estimateCode: '', //评估代码 + // defectLevel: '', //缺陷级别 + // qualifiedQuantity: '', //合格数量 + // unqualifiedQuantity: '' //不合格数量 + // } + // ) } // 编辑判断上限下限目标值是否必填 if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) { @@ -700,10 +700,11 @@ const submitForm = async () => { return } // 判断附加费用数组是否有未填的选项 - let arrBol = data.value.subList.map((item, index) => { - let arr1 = [] + let arrBol = [] + let isOutweigh = []//结束时间是否大于开始时间 + data.value.subList.forEach((item, index) => { if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) { - arr1.push( + arrBol.push( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( (cur, key) => { return !cur.qualifiedQuantity || !cur.unqualifiedQuantity @@ -712,7 +713,7 @@ const submitForm = async () => { ) } if (item.samplingProcessRespVO.evaluationMode == 1) { - arr1.push( + arrBol.push( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( (cur, key) => { return !cur.estimateCode || !cur.defectLevel @@ -721,7 +722,7 @@ const submitForm = async () => { ) } if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) { - arr1.push( + arrBol.push( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( (cur, key) => { return !cur.inspectionValue @@ -730,7 +731,7 @@ const submitForm = async () => { ) } if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1) { - arr1.push( + arrBol.push( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( (cur, key) => { return !cur.qualitativeCode @@ -738,17 +739,21 @@ const submitForm = async () => { ) ) } - return arr1 + // 开始时间大于结束时间放入数组中 + if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) { + isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime) + } }) - // console.log(arrBol) - // let isEmpty1 = arrBol.filter(item=>item == true) - // arrBol.forEach(item=>{ - // console.log('1q1q') - // console.log(typeof item) - // }) - // setTimeout(()=>{ - // console.log(arrBol.includes(true)) - // },2000) + let isEmpty1 = arrBol.some(item=>item == true) + if(isEmpty1){ + message.error('检验工序和检验特性有字段未填写完全') + return; + } + if(isOutweigh.length>0){ + message.error('检验特性中有开始时间大于结束时间') + return; + } + return; if (formType.value == 'create') { // 主子表——提交请求 emit('submitForm', formType.value, data.value) diff --git a/src/views/qms/inspection/inspectionRecord/index.vue b/src/views/qms/inspection/inspectionRecord/index.vue index 46d6b961c..ae0e3ab24 100644 --- a/src/views/qms/inspection/inspectionRecord/index.vue +++ b/src/views/qms/inspection/inspectionRecord/index.vue @@ -58,7 +58,7 @@ diff --git a/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts b/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts index 11ea76270..436752732 100644 --- a/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts +++ b/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts @@ -13,72 +13,84 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ field: 'number', sort: 'custom', isSearch: true, + isForm:false }, { label: '申请编码', field: 'applicationCode', sort: 'custom', isSearch: true, + isForm:false }, { label: '任务编码', field: 'taskCode', sort: 'custom', isSearch: false, + isForm:false }, { label: '供应商编码', field: 'supplierCode', sort: 'custom', isSearch: false, + isForm:false }, { label: '物料编码', field: 'materialCode', sort: 'custom', isSearch: false, + isForm:false }, { label: '批次', field: 'batch', sort: 'custom', isSearch: false, + isForm:false }, { label: '检验方案编码', field: 'inspectionSchemeCode', sort: 'custom', isSearch: false, + isForm:false }, { label: '检验方案Json', field: 'inspectionSchemeJson', sort: 'custom', isSearch: false, + isForm:false }, { label: '检验批次', field: 'inspectionBatch', sort: 'custom', isSearch: false, + isForm:false }, { label: '检验批数量', field: 'inspectionBatchAmount', sort: 'custom', isSearch: false, + isForm:false }, { label: '采样总数量', field: 'sampleTatalAmount', sort: 'custom', isSearch: false, + isForm:false }, { label: '检验类型', field: 'inspectionType', sort: 'custom', isSearch: false, + isForm:false, form: { component: 'Select' }, @@ -88,18 +100,21 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ field: 'inspectionBatchSource', sort: 'custom', isSearch: false, + isForm:false }, { label: '订单号', field: 'orderCode', sort: 'custom', isSearch: false, + isForm:false }, { label: '订单行', field: 'orderRow', sort: 'custom', isSearch: false, + isForm:false, form: { component: 'InputNumber', value: 0 @@ -110,12 +125,14 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ field: 'certificateCode', sort: 'custom', isSearch: false, + isForm:false }, { label: '凭证行', field: 'certificateRow', sort: 'custom', isSearch: false, + isForm:false, form: { component: 'InputNumber', value: 0 @@ -126,6 +143,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ field: 'inspectionStage', sort: 'custom', isSearch: false, + isForm:false, form: { component: 'InputNumber', value: 0 @@ -136,12 +154,14 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ field: 'inspectionStringency', sort: 'custom', isSearch: false, + isForm:false, }, { label: '使用决策', field: 'useDecision', sort: 'custom', isSearch: false, + isForm:false }, { label: '计划开始时间', @@ -149,6 +169,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ sort: 'custom', formatter: dateFormatter, isSearch: false, + isForm:false, search: { component: 'DatePicker', componentProps: { @@ -171,6 +192,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ sort: 'custom', formatter: dateFormatter, isSearch: false, + isForm:false, search: { component: 'DatePicker', componentProps: { @@ -193,6 +215,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ sort: 'custom', formatter: dateFormatter, isSearch: false, + isForm:false, search: { component: 'DatePicker', componentProps: { @@ -215,6 +238,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ sort: 'custom', formatter: dateFormatter, isSearch: false, + isForm:false, search: { component: 'DatePicker', componentProps: { @@ -236,18 +260,29 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ field: 'inspectionLevel', sort: 'custom', isSearch: false, + isForm:false, }, { label: 'AQL值', field: 'aqlValue', sort: 'custom', isSearch: false, + isForm:false, }, { label: '是否可用', field: 'available', sort: 'custom', isSearch: false, + isForm:false, + }, + { + label: '使用决策', + field: 'useDecision', + sort: 'custom', + isSearch: false, + dictType: DICT_TYPE.USAGE_DECISION, + }, { label: '创建时间', From d234c5fa1d68a631887c14dd4c9cb8b63335aa38 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Mon, 8 Apr 2024 16:59:48 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=9B=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/dict/dict.type.ts | 10 ++ src/components/Detail/src/DetailQmsCode.vue | 3 +- src/components/TableForm/src/TableForm.vue | 33 +++++++ src/utils/dict.ts | 1 - .../selectedProject/selectedProject.data.ts | 91 +++++++++++-------- .../qms/basicDataManage/selectedSet/index.vue | 59 +++++++++--- .../selectedSet/selectedSet.data.ts | 15 +-- src/views/system/dict/DictTypeForm.vue | 18 +++- src/views/system/dict/index.vue | 11 +++ 9 files changed, 175 insertions(+), 66 deletions(-) diff --git a/src/api/system/dict/dict.type.ts b/src/api/system/dict/dict.type.ts index ed2969f11..d88c889ed 100644 --- a/src/api/system/dict/dict.type.ts +++ b/src/api/system/dict/dict.type.ts @@ -42,3 +42,13 @@ export const deleteDictType = (id: number) => { export const exportDictType = (params) => { return request.get({ url: '/system/dict-type/export', params }) } + + +// 查询字典列表 +export const getDictTypeAndData = (classes: string | null) => { + let url = '/system/dict-type/list-all-data-all'; + if (classes !== null) { + url += `?classes=${classes}`; + } + return request.get({ url }); +} \ No newline at end of file diff --git a/src/components/Detail/src/DetailQmsCode.vue b/src/components/Detail/src/DetailQmsCode.vue index 3f393da07..3a54e68e0 100644 --- a/src/components/Detail/src/DetailQmsCode.vue +++ b/src/components/Detail/src/DetailQmsCode.vue @@ -699,6 +699,7 @@ const openForm = async (type: string, row?: number) => { } // form 提交 const submitForm = async (formType, data) => { + debugger try { // 子表新增编辑校验 如果业务需要子表提交校验 需在主页详情组件添加 detailValidate 参数及方法 const rs = (await props.detailValidate) ? await props.detailValidate(data) : true @@ -797,7 +798,7 @@ const openImage=(item)=>{ * @param cur 改变后值 */ const detailBasicFormOnChange = (field, cur) => { - emit('detailBasicFormOnChange', field, cur) + emit('detailBasicFormOnChange', field, cur,formRef.value.formRef) } /** diff --git a/src/components/TableForm/src/TableForm.vue b/src/components/TableForm/src/TableForm.vue index 38dd76825..5d25c1d81 100644 --- a/src/components/TableForm/src/TableForm.vue +++ b/src/components/TableForm/src/TableForm.vue @@ -126,6 +126,39 @@ :key="op.value" /> + + + + + + + + { - return { - label: item.name, - value: item.type - } + +const optionsList = await DictTypeApi.getDictTypeAndData('inspection') +optionsList.forEach(element => { + element.options = element.dictDataRespVOList.map(item => { + return { + value: element.type + "-%%%-" + item.value, + label: element.name + "-" + item.label + } + }) }) // 表单校验 export const SelectedProjectRules = reactive({ code: [required], - dictionaryCode: [required], - dictionaryValue: [required], - available: [required], - concurrencyStamp: [required] + dictionaryTypeAndCode: [required], + estimateCode: [required], + defectLevel: [required], }) export const SelectedProject = useCrudSchemas(reactive([ @@ -28,51 +30,64 @@ export const SelectedProject = useCrudSchemas(reactive([ isSearch: true }, { - label: '字典', - field: 'dictionaryCode', + label: '字典及字典项', + field: 'dictionaryTypeAndCode', sort: 'custom', - isSearch: true, + formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => { + return optionsList.find(item => item.options.some(option => option.value === cellValue))?.options.find(option => option.value === cellValue)?.label + }, + isSearch: false, + isDetail: false, + isTable: true, + isForm: true, tableForm: { - type: 'Select', - initOptions: dictTypeListData, + type: 'SelectGroup', + initOptions: optionsList }, form: { component: 'Select', - api: dictTypeListData, componentProps: { - options: dictTypeListData, - optionsAlias: { - labelField: 'label', - valueField: 'value' - } + options: optionsList } - } + }, + + }, + { + label: '字典', + field: 'dictionaryCode', + sort: 'custom', + isSearch: false, + isTableForm: false, + isDetail: false, + isTable: false, + isForm: false, }, { - label: '字典项值', + label: '字典项', field: 'dictionaryValue', sort: 'custom', - isSearch: true, - tableForm: { - type: 'Select', - }, - form: { - component: 'Select', - componentProps: { - options: dictTypeListData, - optionsAlias: { - labelField: 'label', - valueField: 'value' - } - } - } + isSearch: false, + isTableForm: false, + isDetail: false, + isTable: false, + isForm: false, + }, + { + label: '字典名称', + field: 'dictionaryLabel', + sort: 'custom', + isSearch: false, + isTableForm: false, + isDetail: false, + isTable: false, + isForm: false, }, { label: '评估代码', field: 'estimateCode', sort: 'custom', isSearch: true, - dictType: DICT_TYPE.DICTIONARY_CLASS, + dictType: DICT_TYPE.EVALUATION_CODE, dictClass: 'string', tableForm: { type: 'Select', diff --git a/src/views/qms/basicDataManage/selectedSet/index.vue b/src/views/qms/basicDataManage/selectedSet/index.vue index f4513d891..7e6bc2a31 100644 --- a/src/views/qms/basicDataManage/selectedSet/index.vue +++ b/src/views/qms/basicDataManage/selectedSet/index.vue @@ -50,7 +50,7 @@ :apiUpdate="SelectedSetApi.updateSelectedSet" :apiCreate="SelectedSetApi.createSelectedSet" @searchTableSuccess="searchTableSuccess" - :isBusiness="false" + :isBusiness="true" @onChange="onChange" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @@ -92,6 +92,7 @@ import { SelectedProject,SelectedProjectRules } from '../selectedProject/selecte import * as SelectedProjectApi from '@/api/qms/selectedProject' import * as DictDataApi from '@/api/system/dict/dict.data' import component from 'virtual:svg-icons-register' +import * as DictTypeApi from '@/api/system/dict/dict.type' // import TableHead from '@/components/TableHead/src/TableHead.vue' // import ImportForm from '@/components/ImportForm/src/ImportForm.vue' // import Detail from '@/components/Detail/src/Detail.vue' @@ -105,9 +106,11 @@ const route = useRoute() // 路由信息 const tableData = ref([]) const routeName = ref() const selectDictType = ref() +const optionsList = ref() routeName.value = route.name const tableColumns = ref(SelectedSet.allSchemas.tableColumns) + // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef) => { nextTick(() => { @@ -287,7 +290,21 @@ const handleDeleteTable = (item, index) => { // 主子数据 提交 const submitForm = async (formType, data) => { + data.selectedProjectDOList = tableData.value// 拼接子表数据参数 + data.selectedProjectDOList = data.selectedProjectDOList.map(item => { + // 按照 '-%%%-'' 拆分 dictionaryCode + const [dictionaryCode, dictionaryValue] = item.dictionaryTypeAndCode.split('-%%%-'); + const dictionary = optionsList.value.find(temp => temp.options.some(option => option.value === item.dictionaryTypeAndCode)) + const dictionaryLabel = dictionary?.options.find(option => option.value === item.dictionaryTypeAndCode)?.label + // 返回一个新对象,包含拆分后的 dictionaryCode 和 dictionaryValue,以及原始项中的其他属性 + return { + ...item, + dictionaryCode, + dictionaryValue, + dictionaryLabel + }; + }); console.log(data.subList) try { if (formType === 'create') { @@ -321,20 +338,21 @@ const detailOpenForm = (type, row, masterParmas) => { -const detailBasiFormOnChange = (field,val) => { +const detailBasiFormOnChange = (field,val,detailFormRef) => { console.log(field) - console.log(val) - if(field == 'dictionaryCode'){ - DictDataApi.queryByDictType(val).then(res => { - SelectedProject.allSchemas.formSchema.find(item => { - return item.field == 'dictionaryValue' - }).componentProps.options = res.map(item=>{ - return { - value: item.value, - label: item.label - } + console.log(33,detailFormRef) + if(field == 'dictionaryTypeAndCode'){ + // 按照 '-%%%-'' 拆分 dictionaryCode + const [dictionaryCode, dictionaryValue] = val.split('-%%%-'); + const dictionary = optionsList.value.find(temp => temp.options.some(option => option.value === val)) + const dictionaryLabel = dictionary?.options.find(option => option.value === val)?.label + const setV = {} + setV['dictionaryLabel'] = dictionaryLabel + setV['dictionaryCode'] = dictionaryCode + setV['dictionaryValue'] = dictionaryValue + nextTick(() => { + detailFormRef.setValues(setV) }) - }) } } @@ -342,9 +360,24 @@ const formSelectChange = (a,b,c,d) => { console.log(111) } +const getDicDetails = ()=>{ + DictTypeApi.getDictTypeAndData('inspection').then(res=>{ + res.forEach(element => { + element.options = element.dictDataRespVOList.map(item => { + return { + value: element.type + "-%%%-" + item.value, + label: element.name + "-" + item.label + } + }) + }) + optionsList.value = res + }) +} + /** 初始化 **/ onMounted(async () => { getList() + getDicDetails() importTemplateData.templateUrl = await SelectedSetApi.importTemplate() }) diff --git a/src/views/qms/basicDataManage/selectedSet/selectedSet.data.ts b/src/views/qms/basicDataManage/selectedSet/selectedSet.data.ts index e4e1d6f0d..a6db09237 100644 --- a/src/views/qms/basicDataManage/selectedSet/selectedSet.data.ts +++ b/src/views/qms/basicDataManage/selectedSet/selectedSet.data.ts @@ -25,17 +25,6 @@ export const SelectedSet = useCrudSchemas(reactive([ sort: 'custom', isSearch: true }, - { - label: '分类', - field: 'classification', - sort: 'custom', - isSearch: true, - dictType: DICT_TYPE.EVALUATION_CODE, - dictClass: 'string', - tableForm: { - type: 'Select', - } - }, { label: '操作', field: 'action', @@ -43,6 +32,8 @@ export const SelectedSet = useCrudSchemas(reactive([ table: { width: 150, fixed: 'right' - } + }, + isTableForm: false, + isDetail: false } ])) diff --git a/src/views/system/dict/DictTypeForm.vue b/src/views/system/dict/DictTypeForm.vue index 5e416d785..b8caa504f 100644 --- a/src/views/system/dict/DictTypeForm.vue +++ b/src/views/system/dict/DictTypeForm.vue @@ -17,6 +17,19 @@ placeholder="请输入参数名称" /> + + + + +