From 060d2260c176aaa35c74631ae563b184084c1eae Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 23 Apr 2024 13:59:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=86=B3=E7=AD=96=EF=BC=8C?= =?UTF-8?q?=E6=8A=8A=E7=AC=AC=E4=B8=80=E4=B8=AA=E8=AE=BE=E4=B8=BA=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E9=80=89=E6=8B=A9=EF=BC=8C=E4=BD=BF=E7=94=A8=E5=86=B3?= =?UTF-8?q?=E7=AD=96=EF=BC=8C=E5=AE=BD=E5=BA=A6=E5=87=8F=E5=B0=8F=EF=BC=8C?= =?UTF-8?q?=E5=8F=AA=E8=BE=93=E5=85=A5=E4=B8=8D=E5=90=88=E6=A0=BC=E6=95=B0?= =?UTF-8?q?=E9=87=8F=EF=BC=8C=E8=87=AA=E5=8A=A8=E7=AE=97=E5=87=BA=E5=90=88?= =?UTF-8?q?=E6=A0=BC=E6=95=B0=E9=87=8F=EF=BC=8C=E6=A3=80=E9=AA=8C=E6=96=B9?= =?UTF-8?q?=E6=A1=88=EF=BC=8C=E6=96=B0=E5=A2=9E=EF=BC=8C=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E7=89=A9=E6=96=99=E7=BC=96=E7=A0=81=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TableForm/src/TableForm.vue | 2 +- .../inspectionScheme/addForm.vue | 3 +- .../qms/inspection/inspectionJob/addForm.vue | 8 ++--- .../inspection/inspectionRecord/addForm.vue | 34 ++++++++++++++----- .../inspectionRecordMain.data.ts | 30 ++++++++++------ .../inspectionRequest/inspectionMain.data.ts | 10 ++++++ 6 files changed, 63 insertions(+), 24 deletions(-) diff --git a/src/components/TableForm/src/TableForm.vue b/src/components/TableForm/src/TableForm.vue index 131269e58..07d517be8 100644 --- a/src/components/TableForm/src/TableForm.vue +++ b/src/components/TableForm/src/TableForm.vue @@ -65,7 +65,7 @@ :placeholder="headerItem?.tableForm?.placeholder || '请输入' + headerItem.label" :disabled="headerItem?.tableForm?.disabled ? true: headerItem?.tableForm?.isInpuFocusShow ? true : false" style="flex:1" - @blur="inputStringBlur(headerItem.field, $event, row)" + @blur="inputStringBlur(headerItem.field, row[headerItem.field], row)" /> diff --git a/src/views/qms/basicDataManage/inspectionScheme/addForm.vue b/src/views/qms/basicDataManage/inspectionScheme/addForm.vue index 135df48f1..7d4e8c830 100644 --- a/src/views/qms/basicDataManage/inspectionScheme/addForm.vue +++ b/src/views/qms/basicDataManage/inspectionScheme/addForm.vue @@ -18,7 +18,7 @@
- + { data.value.programmeTemplateName = val[0].description data.value['dynamicUpdateCode'] = val[0].dynamicUpdateCode data.value.dynamicUpdateName = val[0].dynamicUpdateName + console.log(val[0]) } if (formField == 'programmeTemplateCode') { diff --git a/src/views/qms/inspection/inspectionJob/addForm.vue b/src/views/qms/inspection/inspectionJob/addForm.vue index a93dc3535..983e249ad 100644 --- a/src/views/qms/inspection/inspectionJob/addForm.vue +++ b/src/views/qms/inspection/inspectionJob/addForm.vue @@ -62,9 +62,9 @@ - +
- +
@@ -318,7 +318,7 @@ const rules = ref({ { required: true, message: '请选择评估代码', trigger: 'blur' } ], 'inspectionJobCharacteristicsUpdateReqVO.inspectionQty': [ - { required: true, message: '请输入检验次数', trigger: 'blur' } + { required: true, message: '请输入样品份数', trigger: 'blur' } ], qualifiedQuantity: [{ required: true, message: '请输入选择结束时间', trigger: 'blur' }] }) @@ -620,7 +620,7 @@ const submitForm = async () => { return; } if(isEmptyNumberList){ - message.error('合格数量和不合格数量之和必须等于检验次数') + message.error('合格数量和不合格数量之和必须等于样品份数') return; } if (formType.value == 'create') { diff --git a/src/views/qms/inspection/inspectionRecord/addForm.vue b/src/views/qms/inspection/inspectionRecord/addForm.vue index f5bc407e4..2cf053675 100644 --- a/src/views/qms/inspection/inspectionRecord/addForm.vue +++ b/src/views/qms/inspection/inspectionRecord/addForm.vue @@ -26,6 +26,7 @@ :tableData="data.packageList" :isShowButton="false" :isShowReduceButton="false" + @inputStringBlur="tableFormBlur" />
@@ -126,10 +127,10 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any data.value = JSON.parse(JSON.stringify(row)) data.value.packageList = await InspectionRecordPackageApi.getInspectionRecordPackageList(row.id) data.value.packageList.forEach(item=>{ - item.qualifiedAmount =0 - item.noQualifiedAmount =0 - item.destroyAmount =0 - item.frozenAmount =0 + item.qualifiedAmount = item.qualifiedAmount?item.qualifiedAmount:0 + item.noQualifiedAmount = item.noQualifiedAmount?item.noQualifiedAmount:0 + item.destroyAmount = item.destroyAmount?item.destroyAmount:0 + item.frozenAmount = item.frozenAmount?item.frozenAmount:0 }) dialogVisible.value = true tableSchemas.value.tableFormColumns.map(item=>{ @@ -141,10 +142,10 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any item.qualifiedAmount = item.amount }) } - // 全不合格只能输入不合格数量 + // 让步接收和部分合格 else if(row.useDecision == 2 || row.useDecision == 6){ tableSchemas.value.tableFormColumns.map(item=>{ - if(item.field == 'qualifiedAmount' ||item.field == 'noQualifiedAmount'){ + if(item.field == 'noQualifiedAmount'){ item.tableForm.disabled = false }else{ item.tableForm.disabled = true @@ -162,8 +163,12 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any item.frozenAmount = item.amount }) } + // 评估代码值是1,接收时候,使用决策下拉列表是全部合格 + if(row.estimateCode == 1){ + data.value.useDecision = '1' + } nextTick(() => { - formMainRef.value.setValues(row) + formMainRef.value.setValues( data.value) }) } dialogVisible.value = true @@ -205,8 +210,11 @@ const onChange = (field, cur)=>{ } // 全不合格只能输入不合格数量 else if(cur == 2 || cur == 6){ + data.value.packageList.forEach(item=>{ + item.qualifiedAmount = item.amount + }) tableSchemas.value.tableFormColumns.map(item=>{ - if(item.field == 'qualifiedAmount' ||item.field == 'noQualifiedAmount'){ + if(item.field == 'noQualifiedAmount'){ item.tableForm.disabled = false }else{ item.tableForm.disabled = true @@ -226,6 +234,16 @@ const onChange = (field, cur)=>{ } } } +// 失去焦点 +const tableFormBlur = (field, val,row)=>{ + if( row.amount < val){ + row.noQualifiedAmount = row.amount + row.qualifiedAmount = 0 + }else{ + row.qualifiedAmount = row.amount - val + } + +} const buttonBaseClick = (val) => { // 保存 if (val == 'save') { diff --git a/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts b/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts index 9d3752b78..1d5eb9a1c 100644 --- a/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts +++ b/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts @@ -582,7 +582,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive([ sort: 'custom', isSearch: true, tableForm:{ - disabled:true + disabled:true, + width:200 }, table:{ width:150 @@ -594,7 +595,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive([ sort: 'custom', isSearch: true, tableForm:{ - disabled:true + disabled:true, + width:160 }, table:{ width:150 @@ -606,7 +608,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive([ sort: 'custom', isSearch: true, tableForm:{ - disabled:true + disabled:true, + width:150 }, table:{ width:150 @@ -622,7 +625,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive([ value: 0 }, tableForm:{ - disabled:true + disabled:true, + width:120 }, table:{ width:150 @@ -634,7 +638,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive([ sort: 'custom', isSearch: true, tableForm:{ - disabled:true + disabled:true, + width:120 }, table:{ width:150 @@ -646,7 +651,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive([ sort: 'custom', isSearch: true, tableForm:{ - disabled:true + disabled:true, + width:100 }, table:{ width:150 @@ -658,7 +664,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive([ sort: 'custom', isSearch: true, tableForm:{ - disabled:true + disabled:true, + width:100 }, table:{ width:150 @@ -670,7 +677,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive([ sort: 'custom', isSearch: true, tableForm:{ - disabled:true + disabled:true, + width:100 }, table:{ width:150 @@ -682,7 +690,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive([ sort: 'custom', isSearch: true, tableForm:{ - disabled:true + disabled:true, + width:100 }, table:{ width:150 @@ -694,7 +703,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive([ sort: 'custom', isSearch: true, tableForm:{ - disabled:true + disabled:true, + width:100 }, table:{ width:150 diff --git a/src/views/qms/inspection/inspectionRequest/inspectionMain.data.ts b/src/views/qms/inspection/inspectionRequest/inspectionMain.data.ts index 6a17ef32a..a127aa011 100644 --- a/src/views/qms/inspection/inspectionRequest/inspectionMain.data.ts +++ b/src/views/qms/inspection/inspectionRequest/inspectionMain.data.ts @@ -190,6 +190,11 @@ export const InspectionMain = useCrudSchemas(reactive([ searchField: 'code', // 查询弹窗赋值字段 searchPage: SupplierApi.getSupplierPage, // 查询弹窗所需分页方法 multiple:false, + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] } } }, @@ -223,6 +228,11 @@ export const InspectionMain = useCrudSchemas(reactive([ searchField: 'code', // 查询弹窗赋值字段 searchPage: ItemApi.getItembasicPage, // 查询弹窗所需分页方法 multiple:false, + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] } } },