diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue
index 84ae255..3bdbb3f 100644
--- a/src/components/Template/HandleFormItem.vue
+++ b/src/components/Template/HandleFormItem.vue
@@ -34,6 +34,7 @@
@@ -727,12 +728,14 @@ export default {
});
}
}
-
value = {
- checkboxValues: this.inputValue,
- otherValues: this.otherValues
- };
- this.onCommonHandleSaveRecord();
+ checkboxValues: this.inputValue,
+ otherValues: this.otherValues
+ };
+ if(val){
+
+ this.onCommonHandleSaveRecord();
+ }
}
this.$emit('input', value);
@@ -835,10 +838,11 @@ export default {
if (this.type === 'checkboxList' && this.otherValues) {
isOtherValuesSame = this.isEqual(this.oldOtherValues, this.otherValues);
}
+ console.log(this.oldValue, this.inputValue, isSame, isOtherValuesSame,this.otherValues,this.oldOtherValues,"是否需要记录修改记录")
if (isSame && isOtherValuesSame) {
return;
}
- if (!this.isValueEmpty(this.oldValue) && !isSame && this.templateFillType === "actFill") {
+ if (!this.isValueEmpty(this.oldValue) && !(isSame && isOtherValuesSame) && this.templateFillType === "actFill") {
// 通过EventBus触发电子签名弹窗
EventBus.$emit('showEditSignDialog', { uuid: this.uuid });
} else {//如果是第一次填写,不需要密码验证
@@ -849,10 +853,18 @@ export default {
//如果用户取消,那么回退到上一次的值
resetRecord() {
// 用户点击取消,还原数据
+ let oldValue = this.oldValue;
+ if (this.type === 'checkboxList') {
+ oldValue = {
+ checkboxValues: oldValue.checkboxValues || oldValue,
+ otherValues: this.oldOtherValues
+ };
+ }
+ console.log(this.oldValue, oldValue,"ooo")
this.inputValue = this.oldValue;
- this.$emit('input', this.inputValue); // 触发 v-model 更新
+ this.$emit('input', oldValue); // 触发 v-model 更新
// this.$emit("blur", this.oldValue);
- this.$emit("change", this.oldValue, "cancel");
+ this.$emit("change", oldValue, "cancel");
if (this.item.type === "clickable") {
this.$emit("resetRecord");
}
@@ -878,16 +890,24 @@ export default {
newRecord: [record],
resourceList: this.getZdxgjl(),
}
- //用户输入密码并点击确定,保存修改
- this.oldValue = this.inputValue; // 更新旧值
+
// 更新oldValue和oldOtherValues
if (this.type === 'checkboxList') {
this.oldValue = [...this.inputValue];
this.oldOtherValues = { ...this.otherValues };
}
- this.$emit("blur", this.inputValue);
- this.$emit('input', this.inputValue);
- this.$emit("change", this.inputValue, data ? "save" : "");
+ let value = this.inputValue;
+ if (this.type === 'checkboxList') {
+ value = {
+ checkboxValues: this.inputValue,
+ otherValues: this.otherValues
+ };
+ }
+ //用户输入密码并点击确定,保存修改
+ this.oldValue = value; // 更新旧值
+ this.$emit("blur", value);
+ this.$emit('input', value);
+ this.$emit("change", value, data ? "save" : "");
if (this.item.type === "clickable") {//clickable的丢给父级去处理
return;
}
@@ -950,6 +970,14 @@ export default {
}
return false;
},
+ // 判断checkboxList中特定otherCode输入框是否有错误
+ isOtherInputError(otherCode) {
+ if (!this.error) {
+ return false;
+ }
+ // 检查该otherCode对应的输入框是否为空
+ return this.isValueEmpty(this.otherValues[otherCode]);
+ },
handleClickable(item, event) {
if (this.templateFillType !== 'actFill') {
return
@@ -1461,6 +1489,13 @@ export default {
.el-input {
width: 200px;
margin-left: 10px;
+
+ &.error-border {
+ .el-input__inner {
+ border-color: #ff5d5d !important;
+ box-shadow: 0 0 6px #ffc3c3 !important;
+ }
+ }
}
}
diff --git a/src/views/business/comps/template/formConfig/sp/SP0019.js b/src/views/business/comps/template/formConfig/sp/SP0019.js
index 682e14a..34b16e8 100644
--- a/src/views/business/comps/template/formConfig/sp/SP0019.js
+++ b/src/views/business/comps/template/formConfig/sp/SP0019.js
@@ -137,10 +137,10 @@ export const getYqphFormConfig = () => {
type: 'checkboxList',
fillType: 'actFill',
options: [
- { label: '流动相平衡', value: 1 },
- { label: '样品平衡', value: 2 },
- { label: '样品', value: 3 ,otherCode:'ypOther'},
- { label: '未平衡', value: 4 }
+ { label: '流动相平衡', value: '流动相平衡' },
+ { label: '样品平衡', value: '样品平衡' },
+ { label: '样品', value: '样品' ,otherCode:'ypOther'},
+ { label: '未平衡', value: '未平衡' }
]
},
}