From e55377399faa725d3c25ccf05ff1e0f8816dc3b5 Mon Sep 17 00:00:00 2001
From: luojie <125330818@qq.com>
Date: Thu, 12 Mar 2026 22:34:20 +0800
Subject: [PATCH] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86][sp0?=
=?UTF-8?q?21]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/Template/HandleFormItem.vue | 4 +-
.../Template/mixins/formPackageMixins.js | 5 +-
.../business/comps/template/TemplateTable.vue | 1 +
.../business/comps/template/comps/sp/SP0020.vue | 13 +-
.../business/comps/template/comps/sp/SP0021.vue | 70 +++---
.../business/comps/template/comps/sp/SP00456.vue | 10 +-
.../comps/template/comps/sp/comps/LadderConfig.vue | 235 ++++++++++-----------
.../template/formConfig/paralleAndLadderConfig.js | 9 +-
.../comps/template/formConfig/sp/SP0019.js | 2 +-
.../comps/template/formConfig/sp/SP0021.js | 4 +-
10 files changed, 187 insertions(+), 166 deletions(-)
diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue
index 2a2879b..1aab7de 100644
--- a/src/components/Template/HandleFormItem.vue
+++ b/src/components/Template/HandleFormItem.vue
@@ -1165,7 +1165,7 @@ export default {
isOldValueEmpty = isValueEmpty(current.oldValue);
} else if (this.type === "checkboxTree") {
const current = this.getCheckboxTreeInfo();
- const { oldValue, newValue } = current;
+ const { oldValue = {}, newValue } = current;
if (currentHandleType === "checkboxTreeCheckbox") {
isSame = isEqual(oldValue.checked, newValue.checked);
isOldValueEmpty = oldValue.checked === undefined;
@@ -1247,7 +1247,7 @@ export default {
// checkboxTree类型,记录当前操作的值变化
const current = this.getCheckboxTreeInfo();
if (this.currentHandleType === "checkboxTreeCheckbox") {
- const { oldValue, newValue } = current;
+ const { oldValue = {}, newValue = {} } = current;
recordOldVlaue = `${oldValue.label || ''}:${oldValue.checked ? '勾选' : '未勾选'}`;
recordValue = `${newValue.label || ''}:${newValue.checked ? '勾选' : '未勾选'}`;
isModify = newValue.checked !== undefined;
diff --git a/src/components/Template/mixins/formPackageMixins.js b/src/components/Template/mixins/formPackageMixins.js
index 000951a..465eb3f 100644
--- a/src/components/Template/mixins/formPackageMixins.js
+++ b/src/components/Template/mixins/formPackageMixins.js
@@ -401,9 +401,8 @@ export default {
const {options = []} = o;
//需要校验第一层是否有选中项
const parentOptions = options.map(item => item.label);
- const isChecked = parentOptions.some(option => {
- var found = checkedValues.find(item => item.label === option);
- return found && found.checked === true;
+ const isChecked = checkedValues.some(option => {
+ return option.checked === true;
});
//获取所有选中的选项
const allCheckedOptions = checkedValues.filter(item => item.checked).map(item => item.label);
diff --git a/src/views/business/comps/template/TemplateTable.vue b/src/views/business/comps/template/TemplateTable.vue
index 2f34ebc..87e8395 100644
--- a/src/views/business/comps/template/TemplateTable.vue
+++ b/src/views/business/comps/template/TemplateTable.vue
@@ -277,6 +277,7 @@ export default {
'PCR010': 'PCR010',
'PCR011': 'PCR011',
'PCR012': 'PCR012',
+ 'PCR013': 'SP00456',
//LBA
'LBA001': 'SP001',
'LBA002': 'LBA002',
diff --git a/src/views/business/comps/template/comps/sp/SP0020.vue b/src/views/business/comps/template/comps/sp/SP0020.vue
index 0aa0671..e0f4553 100644
--- a/src/views/business/comps/template/comps/sp/SP0020.vue
+++ b/src/views/business/comps/template/comps/sp/SP0020.vue
@@ -13,7 +13,7 @@
@@ -33,7 +33,8 @@ import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
-import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
+import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue";
+import moment from "moment";
import { getBaseInfoFormConfig} from "../../formConfig/sp/SP0019";
import { getSynrFormConfig, getYqjgFormConfig, getCjrqFormConfig, getFxpsjwjFormConfig} from "../../formConfig/sp/SP0020";
@@ -135,7 +136,13 @@ export default {
//获取填写完成的表单数据
async getFormData() {
let content = await this.validFormFields(compRefs);
- console.log(content)
+ if(this.sn === 'SP020' &&!!content){
+ const {cjjsrq,cjksrq} = content;
+ if(moment(cjjsrq).isBefore(moment(cjksrq))){
+ this.$message.error("采集结束时间不能早于采集开始时间");
+ return;
+ }
+ }
return content;
},
//保存
diff --git a/src/views/business/comps/template/comps/sp/SP0021.vue b/src/views/business/comps/template/comps/sp/SP0021.vue
index d92ca00..e1f475b 100644
--- a/src/views/business/comps/template/comps/sp/SP0021.vue
+++ b/src/views/business/comps/template/comps/sp/SP0021.vue
@@ -15,12 +15,14 @@
:formConfig="storageFormConfig" :formData="formData" />
新增
-
+
@@ -63,7 +65,7 @@ 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} from "@/utils/index";
+import {getuuid,justUpdateFilledFormData} from "@/utils/index";
import { getBaseInfoFormConfig, getStorageFormConfig, getRemarkFormConfig, getYbsmFormConfig,getTableColumns } from "../../formConfig/sp/SP0021";
const refConfig = {
baseInfoRef: "baseInfoRef",
@@ -116,42 +118,52 @@ export default {
};
},
mounted() {
- if(this.fillType === 'preFill'){//预填的时候默认新增一个。
+ if(this.fillType === 'preFill' &&!this.formData.ybsmDataList){//预填的时候默认新增一个。
this.onAdd()
}
},
methods: {
//删除样本说明
- deleteConfig(index){
+ deleteConfig(item){
// 确保 ybsmDataList 存在
- if (!this.formData.ybsmDataList) {
- this.formData.ybsmDataList = [{}];
- return;
- }
if (this.formData.ybsmDataList.length > 1) {
- this.formData.ybsmDataList.splice(index, 1);
+ const configIndex = this.formData.ybsmDataList.findIndex(config => config.id === item.id);
+ console.log(configIndex,"configIndex")
+ if(configIndex>-1){
+ const newList = [...this.formData.ybsmDataList]
+ newList.splice(configIndex, 1);
+ this.$set(this.formData, 'ybsmDataList', newList);
+ this.$nextTick(() => {
+ //通知后端保存数据
+ justUpdateFilledFormData();
+ })
+ }
} else {
- this.$message.warning('至少需要保留一个样本说明项');
+ this.$message.warning('至少保留一个样本说明项');
}
+
},
//新增样本说明
onAdd(){
if (!this.formData.ybsmDataList) {
this.$set(this.formData, 'ybsmDataList', []);
}
- // 添加新的平行配制配置
- this.formData.ybsmDataList.push({
+ let defaultInfo = {
id: getuuid(),
- ybsmFormData: {},
stepData: [],
- });
+ }
+ if(this.fillType === "actFill"){
+ const {ybsmDataList} = this.formData
+ defaultInfo.stepData = ybsmDataList[0]?.stepData || []
+ }
+ // 添加新的平行配制配置
+ this.formData.ybsmDataList.push(defaultInfo);
},
onLoadExcelData(excelData) {
const data = excelData.splice(1);
- console.log(data,"ddd")
this.$refs.ImportExcelDialog.cancel()
setTimeout(() => {
- this.justUpdateFilledFormData();
+ justUpdateFilledFormData();
}, 100);
},
downloadExcelTemplate(arr){
@@ -171,13 +183,13 @@ export default {
const baseData = this.getFilledFormDataByRefs(compRefs);
// 处理多个样本说明项
const ybsmDataList = this.formData.ybsmDataList.map((item, index) => {
- const ybsmFormData = this.$refs[`ybsmFormPackageRef${index}`]?.getFilledFormData() || {};
- const ybsmTableData = this.$refs[`ybsmTableRef${index}`]?.getFilledFormData() || [];
- const stepData = this.$refs[`stepRef${index}`]?.getFilledFormData() || {};
+ const ybsmFormData = this.$refs[`ybsmFormPackageRef${index}`][0]?.getFilledFormData() || {};
+ const ybsmTableData = this.$refs[`ybsmTableRef${index}`][0]?.getFilledFormData() || [];
+ const stepData = this.$refs[`stepRef${index}`][0]?.getFilledFormData() || [];
return {
...ybsmFormData,
- ybsmData: ybsmTableData,
- stepData: stepData
+ ...ybsmTableData,
+ stepData: stepData.stepData || []
};
});
return {
@@ -194,11 +206,11 @@ export default {
// 验证多个样本说明项
for (let index = 0; index < this.formData.ybsmDataList.length; index++) {
// 验证样本说明表单
- const ybsmFormValid = await this.$refs[`ybsmFormPackageRef${index}`]?.validFormFields() || true;
+ const ybsmFormValid = await this.$refs[`ybsmFormPackageRef${index}`][0]?.getFormData() || true;
if (!ybsmFormValid) return null;
// 验证步骤数据
- const stepValid = await this.$refs[`stepRef${index}`]?.getFormData() || true;
+ const stepValid = await this.$refs[`stepRef${index}`][0]?.getFormData() || true;
if (!stepValid) return null;
}
@@ -235,7 +247,7 @@ export default {
let allYqResource = [];
// 收集所有样本说明项的步骤资源
for (let index = 0; index < this.formData.ybsmDataList.length; index++) {
- const stepResource = this.$refs[`stepRef${index}`]?.getStepResource() || { sjResource: [], yqResource: [] };
+ const stepResource = this.$refs[`stepRef${index}`][0]?.getStepResource() || { sjResource: [], yqResource: [] };
allSjResource = [...allSjResource, ...(stepResource.sjResource || [])];
allYqResource = [...allYqResource, ...(stepResource.yqResource || [])];
}
diff --git a/src/views/business/comps/template/comps/sp/SP00456.vue b/src/views/business/comps/template/comps/sp/SP00456.vue
index f87ecb7..d5cdc80 100644
--- a/src/views/business/comps/template/comps/sp/SP00456.vue
+++ b/src/views/business/comps/template/comps/sp/SP00456.vue
@@ -10,7 +10,7 @@
ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
-
@@ -193,6 +193,7 @@ export default {
},
data() {
const labArr = ["LBA005", "LBA007"];
+ const sn = this.sn || '';
return {
subSolutionVisible: false,
currentSubKey: "",//当前点击的子项key
@@ -204,6 +205,7 @@ export default {
targetAcSolutionFromTable: true,//是否从表格中获取实际原始溶液浓度
currentRowData: {},//当前点击的行数据
isLba: labArr.includes(this.sn),
+ isSp: sn.includes('SP'),//是否是色谱
};
},
mounted() {
@@ -349,9 +351,9 @@ export default {
getFilledFormData() {
const baseData = this.$refs.baseInfoRef.getFilledFormData();
let conditionData = {}, jcbData = [];
- if (!this.isLba) {
- conditionData = this.$refs.storageConditionRef.getFilledFormData();
- } else {
+ if (this.isSp) {
+ conditionData = this.$refs.storageConditionRef?.getFilledFormData();
+ } else if(this.isLba) {
jcbData = this.$refs.jcbRef.getFilledFormData();
}
const remarkData = this.$refs.remarkRef.getFilledFormData();
diff --git a/src/views/business/comps/template/comps/sp/comps/LadderConfig.vue b/src/views/business/comps/template/comps/sp/comps/LadderConfig.vue
index c499b5d..58495cd 100644
--- a/src/views/business/comps/template/comps/sp/comps/LadderConfig.vue
+++ b/src/views/business/comps/template/comps/sp/comps/LadderConfig.vue
@@ -1,40 +1,37 @@
-
diff --git a/src/views/business/comps/template/formConfig/paralleAndLadderConfig.js b/src/views/business/comps/template/formConfig/paralleAndLadderConfig.js
index d148e22..3f8fdb3 100644
--- a/src/views/business/comps/template/formConfig/paralleAndLadderConfig.js
+++ b/src/views/business/comps/template/formConfig/paralleAndLadderConfig.js
@@ -521,6 +521,7 @@ export const getBaseInfoFormConfig = ($this) => {
const sn = $this.sn
const labArr = ['LBA005', 'LBA007']
const isLba = labArr.includes(sn)
+ const isSp = sn.includes('SP')//是否是色谱
return [
{
type: 'cardItem',
@@ -575,9 +576,8 @@ export const getBaseInfoFormConfig = ($this) => {
}
}
},
- isLba
- ? {}
- : {
+ isSp
+ ?{
type: 'conditionItem',
label: 'template.sp.sp00456.rqcz',
config: {
@@ -590,7 +590,8 @@ export const getBaseInfoFormConfig = ($this) => {
otherCode: 'containerMaterialOther'
}
}
- },
+ }
+ :{} ,
{
type: 'cellItem',
label: isLba
diff --git a/src/views/business/comps/template/formConfig/sp/SP0019.js b/src/views/business/comps/template/formConfig/sp/SP0019.js
index f1b40ab..a3d20f2 100644
--- a/src/views/business/comps/template/formConfig/sp/SP0019.js
+++ b/src/views/business/comps/template/formConfig/sp/SP0019.js
@@ -22,7 +22,7 @@ export const getBaseInfoFormConfig = (formType) => {
versionNum: {
label: 'template.common.versionNumber',
type: 'inputNumber',
- fillType: 'actFill',
+ fillType: formType === 'sp0020' ? 'actFill' : 'preFill',
prepend: 'V',
maxlength: 50
},
diff --git a/src/views/business/comps/template/formConfig/sp/SP0021.js b/src/views/business/comps/template/formConfig/sp/SP0021.js
index 6e4c295..9bdcd43 100644
--- a/src/views/business/comps/template/formConfig/sp/SP0021.js
+++ b/src/views/business/comps/template/formConfig/sp/SP0021.js
@@ -174,7 +174,9 @@ export const getTableColumns = ($this) => {
prop: 'sjjrl',
width: 280,
bodyType: 'inputNumber',
- bodyFillType: 'actFill'
+ bodyFillType: 'actFill',
+ copyFrom: 'lljrl',
+ compareTo: 'lljrl',
}
]
}