|
|
|
@ -34,6 +34,7 @@ |
|
|
|
<div v-if="option.otherCode && inputValue.includes(option.value)"> |
|
|
|
<el-input v-model="otherValues[option.otherCode]" |
|
|
|
:placeholder="option.otherPlaceholder || '请输入'" |
|
|
|
:class="{ 'error-border': isOtherInputError(option.otherCode) }" |
|
|
|
@blur="onBlur" |
|
|
|
@input="onOtherInputChange(option.otherCode, $event)" /> |
|
|
|
</div> |
|
|
|
@ -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; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|