|
|
|
@ -67,7 +67,7 @@ |
|
|
|
</el-checkbox> |
|
|
|
<div v-if="(child.value === '样品信息' || child.value === '其他') && isCheckboxTreeChecked(child.value)" |
|
|
|
class="checkbox-tree-input-container"> |
|
|
|
<el-input v-model="inputValue.otherValues[child.value]" |
|
|
|
<el-input maxlength = "100" v-model="inputValue.otherValues[child.value]" |
|
|
|
placeholder="请输入" @blur="onCheckboxTreeOtherBlur(child.value, $event)" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -224,10 +224,8 @@ import Question from "./icons/Question.vue"; |
|
|
|
import DecimalInput from "./DecimalInput.vue"; |
|
|
|
import { EventBus } from "@/utils/eventBus"; |
|
|
|
import moment from "moment"; |
|
|
|
import { deepClone } from "@/utils/index"; |
|
|
|
import { getuuid } from "@/utils/index.js"; |
|
|
|
import { getuuid,isEqual ,deepClone,getDefaultValueByOptions,isValueEmpty} from "@/utils/index.js"; |
|
|
|
import { getToken } from "@/utils/auth" |
|
|
|
import { isValueEmpty, getDefaultValueByOptions } from '@/utils/index.js'; |
|
|
|
|
|
|
|
export default { |
|
|
|
inject: ['templateData', 'templateFillType', "getZdxgjl", "getFhyjjl", "updateZdxgjl", "replaceFhyjjl", "updateFhyjjl", "getFieldCheckObj", "updateFieldCheckObj"], |
|
|
|
@ -339,6 +337,7 @@ export default { |
|
|
|
currentHandleType: '',//当前操作的类型 |
|
|
|
currentOtherCode: '',//当前操作的otherCode |
|
|
|
currentCheckboxTreeValue: '',//当前操作的checkboxTree值 |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
@ -1169,32 +1168,32 @@ export default { |
|
|
|
// 如果是checkboxList类型,需要同时比较otherValues |
|
|
|
if (this.type === 'checkboxList') { |
|
|
|
const current = this.getCheckboxListInfo(); |
|
|
|
isSame = this.isEqual(current.oldValue, current.newValue); |
|
|
|
isSame = isEqual(current.oldValue, current.newValue); |
|
|
|
isOldValueEmpty = isValueEmpty(current.oldValue); |
|
|
|
} else if (this.type === "checkboxTag") { |
|
|
|
// checkboxTag类型,只比较当前tagIndex的数据 |
|
|
|
const currentTag = this.checkboxTagList[this.currentTagIndex]; |
|
|
|
const oldTag = this.oldCheckboxTagList[this.currentTagIndex] || {}; |
|
|
|
isSame = this.isEqual(oldTag.checked, currentTag.checked); |
|
|
|
isOldValueEmpty = isValueEmpty(oldTag.checked); |
|
|
|
isSame = isEqual(oldTag.checked, currentTag.checked); |
|
|
|
isOldValueEmpty = oldTag.checked===undefined; |
|
|
|
} else if (this.type === "fqyq") { |
|
|
|
const current = this.getFqyqInfo(); |
|
|
|
isSame = this.isEqual(current.oldValue, current.newValue); |
|
|
|
isSame = isEqual(current.oldValue, current.newValue); |
|
|
|
isOldValueEmpty = isValueEmpty(current.oldValue); |
|
|
|
} else if (this.type === "checkboxTree") { |
|
|
|
const current = this.getCheckboxTreeInfo(); |
|
|
|
const { oldValue, newValue } = current; |
|
|
|
if (currentHandleType === "checkboxTreeCheckbox") { |
|
|
|
isSame = this.isEqual(oldValue.checked, newValue.checked); |
|
|
|
isOldValueEmpty = isValueEmpty(oldValue.checked); |
|
|
|
isSame = isEqual(oldValue.checked, newValue.checked); |
|
|
|
isOldValueEmpty = oldValue.checked===undefined; |
|
|
|
} else { |
|
|
|
isSame = this.isEqual(current.oldValue, current.newValue); |
|
|
|
isSame = isEqual(current.oldValue, current.newValue); |
|
|
|
isOldValueEmpty = isValueEmpty(current.oldValue); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
isSame = this.isEqual(this.oldValue, this.inputValue) |
|
|
|
isSame = isEqual(this.oldValue, this.inputValue) |
|
|
|
isOldValueEmpty = isValueEmpty(this.oldValue); |
|
|
|
} |
|
|
|
console.log(isSame, isOldValueEmpty, this.currentCheckboxTreeValue, this.oldValue, this.inputValue, "isSame") |
|
|
|
@ -1352,17 +1351,6 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
//判断两个值是否相等 |
|
|
|
isEqual(oldValue, nowValue) { |
|
|
|
if (oldValue === null || nowValue === null) { |
|
|
|
return oldValue === nowValue; |
|
|
|
} |
|
|
|
if (typeof oldValue === 'object' && typeof nowValue === 'object') { |
|
|
|
return JSON.stringify(oldValue) === JSON.stringify(nowValue); |
|
|
|
} |
|
|
|
return oldValue === nowValue; |
|
|
|
}, |
|
|
|
|
|
|
|
//获取公共记录信息 |
|
|
|
getCommonRecordInfo() { |
|
|
|
const { nickName, name } = this.$store.getters; |
|
|
|
@ -1385,23 +1373,6 @@ export default { |
|
|
|
} |
|
|
|
return commonInfo; |
|
|
|
}, |
|
|
|
|
|
|
|
// 判断值是否为空 |
|
|
|
isValueEmpty(value) { |
|
|
|
if (value === null || value === undefined || value === '') { |
|
|
|
return true; |
|
|
|
} |
|
|
|
if (typeof value === 'string' && value.trim() === '') { |
|
|
|
return true; |
|
|
|
} |
|
|
|
if (Array.isArray(value) && value.length === 0) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
if (Object.keys(value).length === 0) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
return false; |
|
|
|
}, |
|
|
|
// 判断checkboxList中特定otherCode输入框是否有错误 |
|
|
|
isOtherInputError(otherCode) { |
|
|
|
if (!this.error) { |
|
|
|
|