|
|
@ -34,16 +34,15 @@ |
|
|
</el-radio-group> |
|
|
</el-radio-group> |
|
|
<div v-else-if="type === 'checkboxList'" class="flex1 checkbox-list-container" |
|
|
<div v-else-if="type === 'checkboxList'" class="flex1 checkbox-list-container" |
|
|
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')"> |
|
|
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')"> |
|
|
<el-checkbox-group v-model="inputValue" @change="onInputChange"> |
|
|
|
|
|
|
|
|
<el-checkbox-group v-model="checkboxListValue.checkboxValues" @change="onCheckboxListChange"> |
|
|
<div v-for="option in item.options" :key="option.value" class="checkbox-item"> |
|
|
<div v-for="option in item.options" :key="option.value" class="checkbox-item"> |
|
|
<el-checkbox :label="option.value" :disabled="getDisabled()"> |
|
|
<el-checkbox :label="option.value" :disabled="getDisabled()"> |
|
|
{{ option.label }} |
|
|
{{ option.label }} |
|
|
</el-checkbox> |
|
|
</el-checkbox> |
|
|
<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 v-if="isShowCheckboxListOther(option)"> |
|
|
|
|
|
<el-input v-model="checkboxListValue.otherValues[option.otherCode]" |
|
|
|
|
|
:class="{ 'error-border': isOtherInputError(option.otherCode) }" |
|
|
|
|
|
:placeholder="option.otherPlaceholder || '请输入'" @blur="onCheckboxListOtherBlur($event, option.otherCode)"/> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</el-checkbox-group> |
|
|
</el-checkbox-group> |
|
|
@ -197,6 +196,8 @@ import moment from "moment"; |
|
|
import { deepClone } from "@/utils/index"; |
|
|
import { deepClone } from "@/utils/index"; |
|
|
import { getuuid } from "@/utils/index.js"; |
|
|
import { getuuid } from "@/utils/index.js"; |
|
|
import { getToken } from "@/utils/auth" |
|
|
import { getToken } from "@/utils/auth" |
|
|
|
|
|
import { isValueEmpty } from '@/utils/index.js'; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
inject: ['templateData', 'templateFillType', "getZdxgjl", "getFhyjjl", "updateZdxgjl", "replaceFhyjjl", "updateFhyjjl", "getFieldCheckObj", "updateFieldCheckObj"], |
|
|
inject: ['templateData', 'templateFillType', "getZdxgjl", "getFhyjjl", "updateZdxgjl", "replaceFhyjjl", "updateFhyjjl", "getFieldCheckObj", "updateFieldCheckObj"], |
|
|
components: { |
|
|
components: { |
|
|
@ -254,14 +255,14 @@ export default { |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
let initialValue = this.value; |
|
|
let initialValue = this.value; |
|
|
let initialOtherValues = {}, checkboxTagList = [], fqyqValue = {}; |
|
|
|
|
|
|
|
|
|
|
|
// 如果是checkboxList类型且value是对象格式 |
|
|
|
|
|
if (this.type === 'checkboxList' && this.value && typeof this.value === 'object') { |
|
|
|
|
|
initialValue = this.value.checkboxValues || []; |
|
|
|
|
|
initialOtherValues = this.value.otherValues || {}; |
|
|
|
|
|
} else if (this.type === 'checkboxList' && !Array.isArray(this.value)) { |
|
|
|
|
|
initialValue = []; |
|
|
|
|
|
|
|
|
let initialOtherValues = {}, checkboxTagList = []; |
|
|
|
|
|
|
|
|
|
|
|
if(this.type === 'checkboxList' && !this.value) { |
|
|
|
|
|
initialValue = { |
|
|
|
|
|
checkboxValues: [], |
|
|
|
|
|
otherValues: {} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
} else if (this.type === 'checkboxTag' && Array.isArray(this.value)) { |
|
|
} else if (this.type === 'checkboxTag' && Array.isArray(this.value)) { |
|
|
// checkboxTag类型,value是数组格式 |
|
|
// checkboxTag类型,value是数组格式 |
|
|
checkboxTagList = this.value.map(tag => ({ |
|
|
checkboxTagList = this.value.map(tag => ({ |
|
|
@ -274,8 +275,6 @@ export default { |
|
|
return { |
|
|
return { |
|
|
inputValue: initialValue, |
|
|
inputValue: initialValue, |
|
|
oldValue: initialValue, // 记录上一次的值 |
|
|
oldValue: initialValue, // 记录上一次的值 |
|
|
otherValues: initialOtherValues, // 存储checkboxList中otherCode对应的输入值 |
|
|
|
|
|
oldOtherValues: { ...initialOtherValues }, // 记录上一次的otherValues |
|
|
|
|
|
showModal: false, // 控制模态框显示 |
|
|
showModal: false, // 控制模态框显示 |
|
|
modificationRecords: [], // 存储修改记录 |
|
|
modificationRecords: [], // 存储修改记录 |
|
|
modalTimer: null, // 用于延迟隐藏模态框 |
|
|
modalTimer: null, // 用于延迟隐藏模态框 |
|
|
@ -289,6 +288,8 @@ export default { |
|
|
oldCheckboxTagList: JSON.parse(JSON.stringify(checkboxTagList)), // 记录上一次的checkboxTagList |
|
|
oldCheckboxTagList: JSON.parse(JSON.stringify(checkboxTagList)), // 记录上一次的checkboxTagList |
|
|
fqyqValue: initialValue, // fqyq类型的值 |
|
|
fqyqValue: initialValue, // fqyq类型的值 |
|
|
oldFqyqValue: {...initialValue}, // 记录上一次的fqyq值 |
|
|
oldFqyqValue: {...initialValue}, // 记录上一次的fqyq值 |
|
|
|
|
|
checkboxListValue: initialValue, // checkboxList类型的值 |
|
|
|
|
|
oldCheckboxListValue: JSON.parse(JSON.stringify(initialValue)), // 记录上一次的checkboxList值 |
|
|
uuid: getuuid(), // 唯一标识符,用于EventBus事件匹配 |
|
|
uuid: getuuid(), // 唯一标识符,用于EventBus事件匹配 |
|
|
regentType: ['sj', 'gsp', 'mix', 'xj', 'xb', 'gyzj', 'mjy', 'yq', 'jcb', 'qxbd'], //试剂/仪器/供试品等类型 |
|
|
regentType: ['sj', 'gsp', 'mix', 'xj', 'xb', 'gyzj', 'mjy', 'yq', 'jcb', 'qxbd'], //试剂/仪器/供试品等类型 |
|
|
selectRegentInfo: {},//选择的试剂/仪器/供试品等信息 |
|
|
selectRegentInfo: {},//选择的试剂/仪器/供试品等信息 |
|
|
@ -300,15 +301,17 @@ export default { |
|
|
pendingUploadFile: null, // 用于存储待上传的文件 |
|
|
pendingUploadFile: null, // 用于存储待上传的文件 |
|
|
pendingRemoveFile: null, // 用于存储待删除的文件 |
|
|
pendingRemoveFile: null, // 用于存储待删除的文件 |
|
|
currentTagIndex:-1,//当前选中的checkboxTag索引 |
|
|
currentTagIndex:-1,//当前选中的checkboxTag索引 |
|
|
currentFqyqType:'',//当前选中的fqyq操作的类型 |
|
|
|
|
|
|
|
|
currentHandleType:'',//当前操作的类型 |
|
|
|
|
|
currentOtherCode:'',//当前操作的otherCode |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
|
value(newVal) { |
|
|
value(newVal) { |
|
|
console.log(newVal, "newVal") |
|
|
|
|
|
if (this.type === 'checkboxList' && newVal && typeof newVal === 'object') { |
|
|
if (this.type === 'checkboxList' && newVal && typeof newVal === 'object') { |
|
|
this.inputValue = newVal.checkboxValues || []; |
|
|
|
|
|
this.otherValues = newVal.otherValues || {}; |
|
|
|
|
|
|
|
|
this.checkboxListValue = { |
|
|
|
|
|
checkboxValues: newVal.checkboxValues || [], |
|
|
|
|
|
otherValues: newVal.otherValues || {} |
|
|
|
|
|
}; |
|
|
} else if (this.type === 'checkboxTag' && Array.isArray(newVal)) { |
|
|
} else if (this.type === 'checkboxTag' && Array.isArray(newVal)) { |
|
|
// checkboxTag类型,value是数组格式 |
|
|
// checkboxTag类型,value是数组格式 |
|
|
this.checkboxTagList = newVal.map(tag => ({ |
|
|
this.checkboxTagList = newVal.map(tag => ({ |
|
|
@ -323,7 +326,7 @@ export default { |
|
|
subRadio: newVal.subRadio || '' |
|
|
subRadio: newVal.subRadio || '' |
|
|
}; |
|
|
}; |
|
|
} else { |
|
|
} else { |
|
|
this.inputValue = this.type === 'checkboxList' && !Array.isArray(newVal) ? [] : newVal; |
|
|
|
|
|
|
|
|
this.inputValue = newVal; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
@ -800,49 +803,17 @@ export default { |
|
|
// 统一处理输入变化 |
|
|
// 统一处理输入变化 |
|
|
onInputChange(val) { |
|
|
onInputChange(val) { |
|
|
let value = val !== undefined ? val : this.inputValue; |
|
|
let value = val !== undefined ? val : this.inputValue; |
|
|
// 如果是checkboxList类型,需要同时发送checkboxValues和otherValues |
|
|
|
|
|
if (this.type === 'checkboxList') { |
|
|
|
|
|
// 检查是否有被取消选中的checkbox |
|
|
|
|
|
if (this.oldValue && Array.isArray(this.oldValue)) { |
|
|
|
|
|
const uncheckedValues = this.oldValue.filter(oldVal => !this.inputValue.includes(oldVal)); |
|
|
|
|
|
|
|
|
|
|
|
// 清除被取消选中的checkbox对应的otherValues |
|
|
|
|
|
if (uncheckedValues.length > 0) { |
|
|
|
|
|
this.item.options.forEach(option => { |
|
|
|
|
|
if (uncheckedValues.includes(option.value) && option.otherCode) { |
|
|
|
|
|
this.$delete(this.otherValues, option.otherCode); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
value = { |
|
|
|
|
|
checkboxValues: this.inputValue, |
|
|
|
|
|
otherValues: this.otherValues |
|
|
|
|
|
}; |
|
|
|
|
|
if (val) { |
|
|
|
|
|
|
|
|
|
|
|
this.onCommonHandleSaveRecord(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.$emit('input', value); |
|
|
this.$emit('input', value); |
|
|
this.$emit('change', value); |
|
|
this.$emit('change', value); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 根据输入值判断是否显示错误状态 |
|
|
// 根据输入值判断是否显示错误状态 |
|
|
const isEmpty = this.isValueEmpty(value); |
|
|
|
|
|
|
|
|
const isEmpty = isValueEmpty(value); |
|
|
if (this.error && !isEmpty) { |
|
|
if (this.error && !isEmpty) { |
|
|
this.$emit('update:error', false); |
|
|
this.$emit('update:error', false); |
|
|
} else if (!this.error && isEmpty) { |
|
|
} else if (!this.error && isEmpty) { |
|
|
this.$emit('update:error', true); |
|
|
this.$emit('update:error', true); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// 处理checkboxList中otherCode对应的输入框变化 |
|
|
|
|
|
onOtherInputChange(code, value) { |
|
|
|
|
|
this.otherValues[code] = value; |
|
|
|
|
|
this.onInputChange(); |
|
|
|
|
|
}, |
|
|
|
|
|
// checkboxTag的checkbox变化处理 |
|
|
// checkboxTag的checkbox变化处理 |
|
|
onCheckboxTagChange(tagIndex, e) { |
|
|
onCheckboxTagChange(tagIndex, e) { |
|
|
this.currentTagIndex = tagIndex; |
|
|
this.currentTagIndex = tagIndex; |
|
|
@ -850,6 +821,20 @@ export default { |
|
|
this.emitCheckboxTagValue(); |
|
|
this.emitCheckboxTagValue(); |
|
|
this.onCommonHandleSaveRecord(); |
|
|
this.onCommonHandleSaveRecord(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 检查是否显示显示checkboxList的其他输入框 |
|
|
|
|
|
isShowCheckboxListOther(option) { |
|
|
|
|
|
const {checkboxValues } = this.checkboxListValue |
|
|
|
|
|
if (!checkboxValues) { |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
return option.otherCode && checkboxValues.includes(option.value); |
|
|
|
|
|
}, |
|
|
|
|
|
// checkboxList的checkbox变化处理 |
|
|
|
|
|
onCheckboxListChange(val) { |
|
|
|
|
|
this.currentHandleType = 'checkboxListValue'; |
|
|
|
|
|
this.checkboxListValue.checkboxValues = val; |
|
|
|
|
|
this.onCommonHandleSaveRecord(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// tag输入框失去焦点 |
|
|
// tag输入框失去焦点 |
|
|
onTagBlur(tagIndex) { |
|
|
onTagBlur(tagIndex) { |
|
|
@ -875,14 +860,14 @@ export default { |
|
|
// fqyq 主radio变化处理 |
|
|
// fqyq 主radio变化处理 |
|
|
onFqyqRadioChange(val, radioType) { |
|
|
onFqyqRadioChange(val, radioType) { |
|
|
this.fqyqValue[radioType] = val; |
|
|
this.fqyqValue[radioType] = val; |
|
|
this.currentFqyqType = radioType; |
|
|
|
|
|
|
|
|
this.currentHandleType = radioType; |
|
|
this.onCommonHandleSaveRecord(); |
|
|
this.onCommonHandleSaveRecord(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// fqyq 输入框失去焦点 |
|
|
// fqyq 输入框失去焦点 |
|
|
onFqyqInputBlur(e) { |
|
|
onFqyqInputBlur(e) { |
|
|
this.fqyqValue.inputValue = e.target.value; |
|
|
this.fqyqValue.inputValue = e.target.value; |
|
|
this.currentFqyqType = 'inputValue'; |
|
|
|
|
|
|
|
|
this.currentHandleType = 'inputValue'; |
|
|
this.onCommonHandleSaveRecord(this.fqyqValue.inputValue); |
|
|
this.onCommonHandleSaveRecord(this.fqyqValue.inputValue); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -890,6 +875,13 @@ export default { |
|
|
onBlur(e) { |
|
|
onBlur(e) { |
|
|
this.onCommonHandleSaveRecord(e.target.value); |
|
|
this.onCommonHandleSaveRecord(e.target.value); |
|
|
}, |
|
|
}, |
|
|
|
|
|
// checkboxList的其他输入框失去焦点处理 |
|
|
|
|
|
onCheckboxListOtherBlur(e, otherCode) { |
|
|
|
|
|
this.currentHandleType = "checkboxListOther"; |
|
|
|
|
|
this.currentOtherCode = otherCode; |
|
|
|
|
|
this.checkboxListValue.otherValues[otherCode] = e.target.value; |
|
|
|
|
|
this.onCommonHandleSaveRecord(e.target.value); |
|
|
|
|
|
}, |
|
|
// 点击question图标 |
|
|
// 点击question图标 |
|
|
onClickQuestion() { |
|
|
onClickQuestion() { |
|
|
const { templateFillType } = this; |
|
|
const { templateFillType } = this; |
|
|
@ -918,6 +910,15 @@ export default { |
|
|
this.visible = true; |
|
|
this.visible = true; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
getCheckboxListInfo(){ |
|
|
|
|
|
const { otherValues,checkboxValues } = this.checkboxListValue; |
|
|
|
|
|
const { otherValues: oldOtherValues,checkboxValues: oldCheckboxValues } = this.oldCheckboxListValue; |
|
|
|
|
|
const o = { |
|
|
|
|
|
"checkboxListValue":{oldValue:oldCheckboxValues,newValue:checkboxValues,des:""}, |
|
|
|
|
|
"checkboxListOther":{oldValue:oldOtherValues[this.currentOtherCode],newValue:otherValues[this.currentOtherCode],des:""}, |
|
|
|
|
|
} |
|
|
|
|
|
return o[this.currentHandleType]; |
|
|
|
|
|
}, |
|
|
getFqyqInfo(){ |
|
|
getFqyqInfo(){ |
|
|
const { mainRadio,inputValue,subRadio } = this.fqyqValue; |
|
|
const { mainRadio,inputValue,subRadio } = this.fqyqValue; |
|
|
const { mainRadio: oldMainRadio,inputValue: oldInputValue,subRadio: oldSubRadio } = this.oldFqyqValue; |
|
|
const { mainRadio: oldMainRadio,inputValue: oldInputValue,subRadio: oldSubRadio } = this.oldFqyqValue; |
|
|
@ -926,10 +927,10 @@ export default { |
|
|
"inputValue":{oldValue:oldInputValue,newValue:inputValue,des:""}, |
|
|
"inputValue":{oldValue:oldInputValue,newValue:inputValue,des:""}, |
|
|
"subRadio":{oldValue:oldSubRadio,newValue:subRadio,des:"是否在规定时间完成:"} |
|
|
"subRadio":{oldValue:oldSubRadio,newValue:subRadio,des:"是否在规定时间完成:"} |
|
|
} |
|
|
} |
|
|
return o[this.currentFqyqType]; |
|
|
|
|
|
|
|
|
return o[this.currentHandleType]; |
|
|
}, |
|
|
}, |
|
|
async onCommonHandleSaveRecord(val) { |
|
|
async onCommonHandleSaveRecord(val) { |
|
|
const isEmpty = this.isValueEmpty(this.inputValue); |
|
|
|
|
|
|
|
|
const isEmpty = isValueEmpty(this.inputValue); |
|
|
if (this.error && !isEmpty) { |
|
|
if (this.error && !isEmpty) { |
|
|
this.$emit('update:error', false); |
|
|
this.$emit('update:error', false); |
|
|
} else if (!this.error && isEmpty) { |
|
|
} else if (!this.error && isEmpty) { |
|
|
@ -974,23 +975,25 @@ export default { |
|
|
|
|
|
|
|
|
// 值发生了变化,需要弹出密码输入框 |
|
|
// 值发生了变化,需要弹出密码输入框 |
|
|
let isSame = true, isOldValueEmpty = true; |
|
|
let isSame = true, isOldValueEmpty = true; |
|
|
|
|
|
const { currentHandleType } = this; |
|
|
// 如果是checkboxList类型,需要同时比较otherValues |
|
|
// 如果是checkboxList类型,需要同时比较otherValues |
|
|
if (this.type === 'checkboxList' && this.otherValues) { |
|
|
|
|
|
isSame = this.isEqual(this.oldOtherValues, this.otherValues); |
|
|
|
|
|
isOldValueEmpty = this.isValueEmpty(this.oldOtherValues); |
|
|
|
|
|
|
|
|
if (this.type === 'checkboxList') { |
|
|
|
|
|
const current = this.getCheckboxListInfo(); |
|
|
|
|
|
isSame = this.isEqual(current.oldValue,current.newValue); |
|
|
|
|
|
isOldValueEmpty = isValueEmpty(current.oldValue); |
|
|
} else if (this.type === "checkboxTag") { |
|
|
} else if (this.type === "checkboxTag") { |
|
|
// checkboxTag类型,只比较当前tagIndex的数据 |
|
|
// checkboxTag类型,只比较当前tagIndex的数据 |
|
|
const currentTag = this.checkboxTagList[this.currentTagIndex]; |
|
|
const currentTag = this.checkboxTagList[this.currentTagIndex]; |
|
|
const oldTag = this.oldCheckboxTagList[this.currentTagIndex] || {}; |
|
|
const oldTag = this.oldCheckboxTagList[this.currentTagIndex] || {}; |
|
|
isSame = this.isEqual(oldTag.checked, currentTag.checked); |
|
|
isSame = this.isEqual(oldTag.checked, currentTag.checked); |
|
|
isOldValueEmpty = this.isValueEmpty(oldTag.checked); |
|
|
|
|
|
|
|
|
isOldValueEmpty = isValueEmpty(oldTag.checked); |
|
|
} else if (this.type === "fqyq") { |
|
|
} else if (this.type === "fqyq") { |
|
|
const current = this.getFqyqInfo(); |
|
|
const current = this.getFqyqInfo(); |
|
|
isSame = this.isEqual(current.oldValue,current.newValue); |
|
|
isSame = this.isEqual(current.oldValue,current.newValue); |
|
|
isOldValueEmpty = this.isValueEmpty(current.oldValue); |
|
|
|
|
|
|
|
|
isOldValueEmpty = isValueEmpty(current.oldValue); |
|
|
} else { |
|
|
} else { |
|
|
isSame = this.isEqual(this.oldValue, this.inputValue) |
|
|
isSame = this.isEqual(this.oldValue, this.inputValue) |
|
|
isOldValueEmpty = this.isValueEmpty(this.oldValue); |
|
|
|
|
|
|
|
|
isOldValueEmpty = isValueEmpty(this.oldValue); |
|
|
} |
|
|
} |
|
|
console.log(isSame,isOldValueEmpty,this.fqyqValue,this.oldFqyqValue,"isSame") |
|
|
console.log(isSame,isOldValueEmpty,this.fqyqValue,this.oldFqyqValue,"isSame") |
|
|
if (isSame) { |
|
|
if (isSame) { |
|
|
@ -1010,8 +1013,8 @@ export default { |
|
|
let oldValue = this.oldValue; |
|
|
let oldValue = this.oldValue; |
|
|
if (this.type === 'checkboxList') { |
|
|
if (this.type === 'checkboxList') { |
|
|
oldValue = { |
|
|
oldValue = { |
|
|
checkboxValues: oldValue.checkboxValues || oldValue, |
|
|
|
|
|
otherValues: this.oldOtherValues |
|
|
|
|
|
|
|
|
checkboxValues: this.oldCheckboxListValue.checkboxValues, |
|
|
|
|
|
otherValues: this.oldCheckboxListValue.otherValues |
|
|
}; |
|
|
}; |
|
|
} else if (this.type === "checkboxTag") { |
|
|
} else if (this.type === "checkboxTag") { |
|
|
// checkboxTag类型,只回退当前tagIndex的数据 |
|
|
// checkboxTag类型,只回退当前tagIndex的数据 |
|
|
@ -1061,6 +1064,11 @@ export default { |
|
|
recordOldVlaue = `${current.des+current.oldValue}`; |
|
|
recordOldVlaue = `${current.des+current.oldValue}`; |
|
|
recordValue = `${current.des+current.newValue}`; |
|
|
recordValue = `${current.des+current.newValue}`; |
|
|
isModify = !!this.oldFqyqValue.mainRadio |
|
|
isModify = !!this.oldFqyqValue.mainRadio |
|
|
|
|
|
}else if(this.type === "checkboxList"){ |
|
|
|
|
|
const current = this.getCheckboxListInfo(); |
|
|
|
|
|
recordOldVlaue = `${current.des+current.oldValue}`; |
|
|
|
|
|
recordValue = `${current.des+current.newValue}`; |
|
|
|
|
|
isModify = !!current.oldValue; |
|
|
} |
|
|
} |
|
|
const record = { |
|
|
const record = { |
|
|
...baseInfo, |
|
|
...baseInfo, |
|
|
@ -1081,8 +1089,7 @@ export default { |
|
|
|
|
|
|
|
|
// 更新oldValue和oldOtherValues |
|
|
// 更新oldValue和oldOtherValues |
|
|
if (this.type === 'checkboxList') { |
|
|
if (this.type === 'checkboxList') { |
|
|
this.oldValue = [...this.inputValue]; |
|
|
|
|
|
this.oldOtherValues = { ...this.otherValues }; |
|
|
|
|
|
|
|
|
this.oldCheckboxListValue = JSON.parse(JSON.stringify(this.checkboxListValue)); |
|
|
} else if (this.type === "checkboxTag") { |
|
|
} else if (this.type === "checkboxTag") { |
|
|
// checkboxTag类型,只更新当前tagIndex的数据 |
|
|
// checkboxTag类型,只更新当前tagIndex的数据 |
|
|
if (this.currentTagIndex >= 0 && this.currentTagIndex < this.checkboxTagList.length) { |
|
|
if (this.currentTagIndex >= 0 && this.currentTagIndex < this.checkboxTagList.length) { |
|
|
@ -1098,8 +1105,8 @@ export default { |
|
|
let value = this.inputValue; |
|
|
let value = this.inputValue; |
|
|
if (this.type === 'checkboxList') { |
|
|
if (this.type === 'checkboxList') { |
|
|
value = { |
|
|
value = { |
|
|
checkboxValues: this.inputValue, |
|
|
|
|
|
otherValues: this.otherValues |
|
|
|
|
|
|
|
|
checkboxValues: this.checkboxListValue.checkboxValues, |
|
|
|
|
|
otherValues: this.checkboxListValue.otherValues |
|
|
}; |
|
|
}; |
|
|
} else if (this.type === "checkboxTag") { |
|
|
} else if (this.type === "checkboxTag") { |
|
|
value = [...this.checkboxTagList]; |
|
|
value = [...this.checkboxTagList]; |
|
|
@ -1178,6 +1185,9 @@ export default { |
|
|
if (Array.isArray(value) && value.length === 0) { |
|
|
if (Array.isArray(value) && value.length === 0) { |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
|
|
|
if (Object.keys(value).length === 0) { |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
return false; |
|
|
return false; |
|
|
}, |
|
|
}, |
|
|
// 判断checkboxList中特定otherCode输入框是否有错误 |
|
|
// 判断checkboxList中特定otherCode输入框是否有错误 |
|
|
@ -1186,7 +1196,7 @@ export default { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
// 检查该otherCode对应的输入框是否为空 |
|
|
// 检查该otherCode对应的输入框是否为空 |
|
|
return this.isValueEmpty(this.otherValues[otherCode]); |
|
|
|
|
|
|
|
|
return isValueEmpty(this.otherValues[otherCode]); |
|
|
}, |
|
|
}, |
|
|
handleClickable(item, event) { |
|
|
handleClickable(item, event) { |
|
|
if (this.templateFillType !== 'actFill') { |
|
|
if (this.templateFillType !== 'actFill') { |
|
|
|