From 82d58894b60227e4605ec665be50833d74bd3479 Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Wed, 3 Apr 2024 16:11:15 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=94=B6=E8=B4=A7?= =?UTF-8?q?=E7=AE=A1=E7=90=86--=E4=BE=9B=E5=BA=94=E5=95=86=E5=8F=91?= =?UTF-8?q?=E7=A5=A8=E7=94=B3=E8=AF=B7--=E6=96=B0=E5=A2=9E--form=E9=87=91?= =?UTF-8?q?=E9=A2=9D=E8=AE=A1=E7=AE=97=EF=BC=9Asearchtable=E4=B8=AD?= =?UTF-8?q?=E5=8D=95=E4=BB=B7=E6=80=BB=E5=92=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BasicForm/src/BasicForm.vue | 24 +++++++++++++++++++ .../supplierinvoiceRequestMain/index.vue | 5 ++++ .../supplierinvoiceRequestMain.data.ts | 1 + 3 files changed, 30 insertions(+) diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index 4977efef5..bd9bdbf47 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -271,6 +271,11 @@ const props = defineProps({ type: Number, required: false, default: 0 + }, + sumFormData:{ + type: Array, + required: false, + default: null } }) @@ -383,6 +388,25 @@ const opensearchTable = ( _searchCondition ) } + + +const changeSumFormData = () => { + if(props.sumFormData){ + const sumObject = {} + props.sumFormData.forEach(sumItem=>{ + sumObject[sumItem?.formField]= props.tableData.reduce((prev, item) => prev + item[sumItem?.valueField],0) + }) + nextTick(()=>{ + formRef.value.setValues(sumObject) + }) + } +} +watch(()=>props.tableData,() => { + changeSumFormData() +},{ + deep:true +}) + // 弹层确定返回所选数据 // val : 弹层列表row 数据 const searchTableSuccess = (formField, searchField, val, type, row) => { diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue index 30e09f66a..5415a44be 100644 --- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue +++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue @@ -43,6 +43,10 @@ :tableAllSchemas="SupplierinvoiceRequestDetail.allSchemas" :tableFormRules="SupplierinvoiceRequestDetailRules" :tableData="tableData" + :sumFormData = "[{ + formField:'amount', + valueField:'singlePrice' + }]" :apiUpdate="SupplierinvoiceRequestMainApi.updateSupplierinvoiceRequestMain" :apiCreate="SupplierinvoiceRequestMainApi.createSupplierinvoiceRequestMain" :isBusiness="true" @@ -148,6 +152,7 @@ newRow['recvBillNum'] = item['recvBillNum'] newRow['asnBillNum'] = item['asnBillNum'] newRow['supplierCode'] = item['supplierCode'] + newRow['singlePrice'] = item['purchasePrice']//单价默认值 = 采购价格 newRow['purchasePrice'] = item['purchasePrice'] newRow['invoicableQuantity'] = item['invoicableQuantity'] newRow['itemCode'] = item['itemCode'] diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts index a6f9f7e6d..8ad864b0a 100644 --- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts +++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts @@ -148,6 +148,7 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive( componentProps: { min: 0, precision: 6, + disabled: true, } }, tableForm: { From 251a96cc58a1a1055dbd1606010ebc3f0056af8e Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Wed, 3 Apr 2024 16:29:46 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BasicForm/src/BasicForm.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index bd9bdbf47..17ebdb7ae 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -272,6 +272,11 @@ const props = defineProps({ required: false, default: 0 }, + //表单中展示的数据,需要用searchTable中字段计算 + /***[{ + formField:form中对应的field, + valueField:searchtable中对应的field, + }]*/ sumFormData:{ type: Array, required: false, From 055cc509d079c36510e01430f7a79d58e8262155 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Wed, 3 Apr 2024 17:12:07 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E6=96=B9=E6=A1=88?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=9B=9E=E6=98=BE=E6=98=BE=E7=A4=BA=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspectionPlan/addForm.vue | 256 +++++++++--------- .../inspectionTemplate/addForm.vue | 41 +-- .../inspectionTemplate.data.ts | 4 +- .../qms/inspection/inspectionJob/index.vue | 6 +- .../inspectionJob/inspectionJobMain.data.ts | 8 +- 5 files changed, 164 insertions(+), 151 deletions(-) diff --git a/src/views/qms/basicDataManage/inspectionPlan/addForm.vue b/src/views/qms/basicDataManage/inspectionPlan/addForm.vue index f8cf4ff51..591a4a6cb 100644 --- a/src/views/qms/basicDataManage/inspectionPlan/addForm.vue +++ b/src/views/qms/basicDataManage/inspectionPlan/addForm.vue @@ -18,7 +18,7 @@
- +
- +
@@ -93,7 +93,7 @@ InspectionTemplateApi.inspectionTemplatePage, null, false, - 'form', + 'main', null ) " @@ -238,122 +238,122 @@ - -
- - -
-
-
- - -
- - -
-
-
- - -
- - +
+ + -
- - + false, + 'features', + item + ) + " + >
+
+
+
+ + +
+ + +
+
+
+ + +
+ + +
+
+
{ - if (type == 'tableForm') { - // 明细查询页赋值 - row[formField] = val[0][searchField] - } else { - console.log(formField) - console.log(val[0].code) - console.log(type) + if(type == 'features'){ + row.inspectionCharacteristicsBaseVO[formField] = val[0].code + if(formField == 'inspectionMethodCode'){ + row.inspectionCharacteristicsBaseVO.inspectionMethodName = val[0].description + }else if(formField == 'dynamicUpdateCode'){ + row.inspectionCharacteristicsBaseVO.dynamicUpdateName = val[0].description + }else if(formField == 'inspectionMethod'){ + row.inspectionCharacteristicsBaseVO.inspectionName = val[0].description + } + } else if(type == 'main'){ data.value[formField] = val[0].code + if(formField == 'itemCode'){ + data.value.itemName = val[0].name + }else if(formField == 'testTypeCode'){ + data.value.testTypeName = val[0].description + }else if(formField == 'programmeTemplateCode'){ + data.value.programmeTemplateName = val[0].description + } if (formField == 'programmeTemplateCode') { let list = await InspectionProcessPageApi.getListByTempleteCode(val[0].code) list.forEach((item, index) => { diff --git a/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue b/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue index 686f41670..28d00ba06 100644 --- a/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue +++ b/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue @@ -106,14 +106,14 @@
@@ -160,7 +160,7 @@ style="width: 40px" @click=" opensearchTable( - 'dynamicUpdateCode', + 'inspectionMethod', null, '采样过程编码', SamplingProcess.allSchemas, @@ -173,7 +173,7 @@ } ], false, - null, + 'features', item ) " @@ -185,11 +185,11 @@
@@ -199,7 +199,7 @@ style="width: 40px" @click=" opensearchTable( - 'inspectionMethod', + 'dynamicUpdateCode', null, '动态修改规则编码', DynamicRule.allSchemas, @@ -212,7 +212,7 @@ } ], false, - null, + 'features', item ) " @@ -813,14 +813,17 @@ const opensearchTable = ( // val : 弹层列表row 数据 const searchTableSuccess = (formField, searchField, val, type, row) => { console.log(row) - data.value.process.forEach((item) => { - if (item.description == row.description) { - item.inspectionCharacteristicsBaseVO[formField] = val[0].code + if(type == 'features'){ + row.inspectionCharacteristicsBaseVO[formField] = val[0].code + if(formField == 'inspectionMethodCode'){ + row.inspectionCharacteristicsBaseVO.inspectionMethodName = val[0].description + }else if(formField == 'dynamicUpdateCode'){ + row.inspectionCharacteristicsBaseVO.dynamicUpdateName = val[0].description + }else if(formField == 'inspectionMethod'){ + row.inspectionCharacteristicsBaseVO.inspectionName = val[0].description } - }) - - // row.inspectionCharacteristicsBaseVO.inspectionMethodCode = val[0].code - // emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row) + } + } // 选择是否设定上限值 const changeIsCapping = (e) => { diff --git a/src/views/qms/basicDataManage/inspectionTemplate/inspectionTemplate.data.ts b/src/views/qms/basicDataManage/inspectionTemplate/inspectionTemplate.data.ts index 62e6c9f7c..769da9224 100644 --- a/src/views/qms/basicDataManage/inspectionTemplate/inspectionTemplate.data.ts +++ b/src/views/qms/basicDataManage/inspectionTemplate/inspectionTemplate.data.ts @@ -151,11 +151,11 @@ export const InspectionTemplateFeatures= useCrudSchemas(reactive([ sort: 'custom', },{ label: '采样过程编码', - field: 'dynamicUpdateCode', + field: 'inspectionMethod', sort: 'custom', },{ label: '动态修改规则编码', - field: 'inspectionMethod', + field: 'dynamicUpdateCode', sort: 'custom', },{ label: '是否允许修改特征值', diff --git a/src/views/qms/inspection/inspectionJob/index.vue b/src/views/qms/inspection/inspectionJob/index.vue index e893d4510..48b31afaa 100644 --- a/src/views/qms/inspection/inspectionJob/index.vue +++ b/src/views/qms/inspection/inspectionJob/index.vue @@ -117,8 +117,8 @@ // 列表头部按钮 const HeadButttondata = [ - defaultButtons.defaultAddBtn(null), // 新增 - // defaultButtons.defaultExportBtn(null), // 导出 + // defaultButtons.defaultAddBtn(null), // 新增 + defaultButtons.defaultExportBtn(null), // 导出 defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 defaultButtons.defaultSetBtn(null), // 设置 @@ -284,6 +284,6 @@ /** 初始化 **/ onMounted(async () => { getList() - importTemplateData.templateUrl = await InspectionJobMainApi.importTemplate() + // importTemplateData.templateUrl = await InspectionJobMainApi.importTemplate() }) diff --git a/src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts b/src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts index dc1afae72..42da7a50d 100644 --- a/src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts +++ b/src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts @@ -5,18 +5,18 @@ import { dateFormatter } from '@/utils/formatTime' const { t } = useI18n() // 国际化 /** - * @returns {Array} 备件申请主表 + * @returns {Array} 检验任务主表 */ export const InspectionJobMain = useCrudSchemas(reactive([ { - label: '工序编号', + label: '编码', field: 'number', sort: 'custom', isSearch: true, }, { - label: '申请编码', - field: 'inspectionCode', + label: '申请单号', + field: 'requestNumber', sort: 'custom', isSearch: true, },