diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index 4977efef5..17ebdb7ae 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -271,6 +271,16 @@ const props = defineProps({ type: Number, required: false, default: 0 + }, + //表单中展示的数据,需要用searchTable中字段计算 + /***[{ + formField:form中对应的field, + valueField:searchtable中对应的field, + }]*/ + sumFormData:{ + type: Array, + required: false, + default: null } }) @@ -383,6 +393,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/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, }, 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 acb32621b..cca552ebc 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: {