diff --git a/src/components/Template/BaseInfoFormPackage.vue b/src/components/Template/BaseInfoFormPackage.vue index a5e46de..b8f4d96 100644 --- a/src/components/Template/BaseInfoFormPackage.vue +++ b/src/components/Template/BaseInfoFormPackage.vue @@ -10,8 +10,7 @@
{{ $t(sItem.label) }}
@@ -33,7 +32,7 @@
-
{{ sItem.otherLabel ? $t(sItem.otherLabel) : +
{{ sItem.otherLabel ? $t(sItem.otherLabel) : $t("template.common.other") }}
{{ $t(sItem.label) }}
-
+
-
{{ sItem.otherLabel ? $t(sItem.otherLabel) : +
{{ sItem.otherLabel ? + $t(sItem.otherLabel) : $t("template.common.other") }}
-
+
+ :type="sItem.type" @copy="onCopy(sItem, key)" :error="errors[key]" + @update:error="errors[key] = false" :ref="key" :orange-bg="orangeBgFields[key]" /> {{ $t(sItem.subText) }} + @clickButton="(e, val, data) => handleClickButton(e, sItem, val, data, sItem.subKey)" /> +
@@ -124,8 +127,7 @@
+ :class="{ 'form-error-border': errors[key] }">
-
+
+ :type="sItem.type" :item="sItem" style="width: auto;flex:1" + :style="{ 'width': sItem.formWidth ? sItem.formWidth + 'px' : 'auto' }" + v-model="formFields[key]" @copy="onCopy(sItem, key)" + @change="(e, type) => onSelectChange(key, e, type)" :error="errors[key]" + @update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" />
{{ $t(sItem.label) }}
@@ -174,26 +178,31 @@ :style="{ 'width': sItem.labelWidth ? sItem.labelWidth + 'px' : '150px' }" v-if="sItem.label"> {{ $t(sItem.label) }}
+
+ {{ formFields[key] }} +
-
+
-
-
{{ sItem.otherLabel ? $t(sItem.otherLabel) : - $t("template.common.other") }}
+ @remoteMethod="(query) => remoteMethod(query, sItem, key)" :error="errors[key]" + @update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" /> +
+
+ {{ sItem.otherLabel ? $t(sItem.otherLabel) : + $t("template.common.other") }}
@@ -202,46 +211,57 @@
- - -
{{ - formFields[sItem.subKey] }}
- {{ $t(sItem.subText) }} - - - + :type="sItem.type" @blur="onBlur(key, $event)" class="flex1" :item="sItem" + v-model="formFields[key]" @copy="onCopy(sItem, key)" :error="errors[key]" :ref="key" + @update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" /> + +
+ +
-
{{ sItem.otherLabel ? $t(sItem.otherLabel) : +
{{ sItem.otherLabel ? + $t(sItem.otherLabel) : $t("template.common.other") }}
- +
- +
{{ $t(sItem.subText) }} - + :item="getFourthButtonItem(sItem)" :value="formFields[sItem.fourthKey]" + @clickButton="(e, val, data) => handleClickButton(e, sItem, val, data, sItem.fourthKey)" /> +
({ + label: item.bh, + value: item.bh, + })); + } + } + }, onRegentSubmit(e){ const {selectInfo, key, col, rowIndex, colIndex, rowData} = e; const {row} = selectInfo; @@ -130,8 +149,17 @@ export default { this.$refs.ryTableRef.updateDataSourceByRowIndex(rowIndex, params); } }, - onYqSubmit(data, col, rowIndex, colIndex, row){ - console.log(data, col, rowIndex, colIndex, row,"onRegentSubmit") + onYqSubmit(data){ + const {selectInfo,rowIndex,key} = data; + const {row} = selectInfo; + if(key === "bh"){//一起编号 + const params = { + mc: row.mc, + xh: row.xh, + jzrq: row.jzrq, + } + this.$refs.yqInfoTableRef.updateDataSourceByRowIndex(rowIndex, params); + } }, //获取已填写的表单数据 getFilledFormData() { diff --git a/src/views/business/comps/template/comps/sp/SP0021.vue b/src/views/business/comps/template/comps/sp/SP0021.vue index e1f475b..5d6cd2c 100644 --- a/src/views/business/comps/template/comps/sp/SP0021.vue +++ b/src/views/business/comps/template/comps/sp/SP0021.vue @@ -19,30 +19,26 @@
- {{ - $t('template.common.deleteBtn') - }} + {{ + $t('template.common.deleteBtn') + }}
- - 导入动物 - + + 导入动物 + - +
@@ -50,7 +46,8 @@
- +
@@ -65,8 +62,8 @@ import Step from "@/components/Template/Step"; import templateMixin from "../../mixins/templateMixin"; import CustomTable from '@/components/Template/CustomTable.vue'; import { uniqeResource } from "@/utils/calUnitTools"; -import {getuuid,justUpdateFilledFormData} from "@/utils/index"; -import { getBaseInfoFormConfig, getStorageFormConfig, getRemarkFormConfig, getYbsmFormConfig,getTableColumns } from "../../formConfig/sp/SP0021"; +import { getuuid, justUpdateFilledFormData } from "@/utils/index"; +import { getBaseInfoFormConfig, getStorageFormConfig, getRemarkFormConfig, getYbsmFormConfig, getTableColumns } from "../../formConfig/sp/SP0021"; const refConfig = { baseInfoRef: "baseInfoRef", remarkRef: "remarkRef", @@ -78,7 +75,7 @@ const refConfig = { const compRefs = Object.values(refConfig); export default { name: "SP0021", - components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete,ImportExcelDialog }, + components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaionDelete, ImportExcelDialog }, mixins: [templateMixin], props: { fillType: { @@ -113,23 +110,24 @@ export default { }, }, data() { - return { - refConfig, - }; - }, + return { + refConfig, + currentIndex: -1, + }; + }, mounted() { - if(this.fillType === 'preFill' &&!this.formData.ybsmDataList){//预填的时候默认新增一个。 + if (this.fillType === 'preFill' && !this.formData.ybsmDataList) {//预填的时候默认新增一个。 this.onAdd() } }, methods: { //删除样本说明 - deleteConfig(item){ + deleteConfig(item) { // 确保 ybsmDataList 存在 if (this.formData.ybsmDataList.length > 1) { const configIndex = this.formData.ybsmDataList.findIndex(config => config.id === item.id); - console.log(configIndex,"configIndex") - if(configIndex>-1){ + console.log(configIndex, "configIndex") + if (configIndex > -1) { const newList = [...this.formData.ybsmDataList] newList.splice(configIndex, 1); this.$set(this.formData, 'ybsmDataList', newList); @@ -141,41 +139,50 @@ export default { } else { this.$message.warning('至少保留一个样本说明项'); } - + }, //新增样本说明 - onAdd(){ + onAdd() { if (!this.formData.ybsmDataList) { this.$set(this.formData, 'ybsmDataList', []); } - let defaultInfo = { + let defaultInfo = { id: getuuid(), stepData: [], } - if(this.fillType === "actFill"){ - const {ybsmDataList} = this.formData + if (this.fillType === "actFill") { + const { ybsmDataList } = this.formData defaultInfo.stepData = ybsmDataList[0]?.stepData || [] } + this.formData = { ...this.formData, ...this.getFilledFormData() }; // 添加新的平行配制配置 this.formData.ybsmDataList.push(defaultInfo); }, onLoadExcelData(excelData) { const data = excelData.splice(1); + const transData = data.map((item)=>{ + return{ + dwbh: item[0], + id: getuuid(), + } + }) + this.$refs[`ybsmTableRef${this.currentIndex}`][0].pushDataSource(transData) this.$refs.ImportExcelDialog.cancel() setTimeout(() => { justUpdateFilledFormData(); }, 100); }, - downloadExcelTemplate(arr){ + downloadExcelTemplate(arr) { this.exportExcel(arr) }, // 导入动物 - onImportAnimal(){ + onImportAnimal(item, index) { + this.currentIndex = index; this.$refs.ImportExcelDialog.show() }, // 删除表格行 deleteTableRow(rowIndex, refName) { - this.$refs[refName].deleteRow(rowIndex) + this.$refs[refName][0].deleteRow(rowIndex) }, //获取已填写的表单数据 getFilledFormData() { @@ -202,18 +209,18 @@ export default { // 基础表单验证 let content = await this.validFormFields(compRefs); if (!content) return null; - + // 验证多个样本说明项 for (let index = 0; index < this.formData.ybsmDataList.length; index++) { // 验证样本说明表单 const ybsmFormValid = await this.$refs[`ybsmFormPackageRef${index}`][0]?.getFormData() || true; if (!ybsmFormValid) return null; - + // 验证步骤数据 const stepValid = await this.$refs[`stepRef${index}`][0]?.getFormData() || true; if (!stepValid) return null; } - + // 获取所有数据 return this.getFilledFormData(); }, @@ -272,6 +279,7 @@ export default { .print-btn { margin-bottom: 20px; } + .config-header { display: flex; justify-content: space-between; diff --git a/src/views/business/comps/template/comps/sp/SP00456.vue b/src/views/business/comps/template/comps/sp/SP00456.vue index d5cdc80..c06aa51 100644 --- a/src/views/business/comps/template/comps/sp/SP00456.vue +++ b/src/views/business/comps/template/comps/sp/SP00456.vue @@ -25,7 +25,7 @@
-
+
{{ $t('template.common.xzpxpz') }} @@ -41,6 +41,7 @@ :tableColumns="ladderStepColumns" :prefixKey="'ladder_' + ladderIndex" :configType="'ladder'" :ref="`ladderRef_${ladderIndex}`" :fieldItemLabel="'template.common.jtpz'" + :showHeader="!isPcr234" @deleteConfig="deleteConfig('ladderConfigs', ladderConfig)" :fillType="fillType" />
@@ -52,9 +53,10 @@ :tableColumns="paralleStepColumns" :prefixKey="'paralle_' + paralleIndex" :configType="'paralle'" :ref="`paralleRef_${paralleIndex}`" :fieldItemLabel="'template.common.pxpz'" + :showHeader="!isPcr234" @deleteConfig="deleteConfig('paralleConfigs', paralleConfig)" :fillType="fillType" />
-