|
|
@ -24,12 +24,11 @@ |
|
|
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue" |
|
|
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue" |
|
|
:disabled="getDisabled()" :placeholder="getPlaceholder()" @change="onItemCheckboxChange"> |
|
|
:disabled="getDisabled()" :placeholder="getPlaceholder()" @change="onItemCheckboxChange"> |
|
|
</el-checkbox> |
|
|
</el-checkbox> |
|
|
<el-radio-group v-else-if="type === 'radio'" v-model="inputValue" |
|
|
|
|
|
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" |
|
|
|
|
|
:disabled="getDisabled()" |
|
|
|
|
|
@change="onItemCheckboxChange" |
|
|
|
|
|
> |
|
|
|
|
|
<el-radio v-for="option in item.options" :key="option.value" :label="option.value" :disabled="getDisabled()"> |
|
|
|
|
|
|
|
|
<el-radio-group v-else-if="type === 'radio'" v-model="inputValue" |
|
|
|
|
|
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" :disabled="getDisabled()" |
|
|
|
|
|
@change="onItemCheckboxChange"> |
|
|
|
|
|
<el-radio v-for="option in item.options" :key="option.value" :label="option.value" |
|
|
|
|
|
:disabled="getDisabled()"> |
|
|
{{ option.label }} |
|
|
{{ option.label }} |
|
|
</el-radio> |
|
|
</el-radio> |
|
|
</el-radio-group> |
|
|
</el-radio-group> |
|
|
@ -41,11 +40,10 @@ |
|
|
{{ option.label }} |
|
|
{{ option.label }} |
|
|
</el-checkbox> |
|
|
</el-checkbox> |
|
|
<div v-if="option.otherCode && inputValue.includes(option.value)"> |
|
|
<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)" /> |
|
|
|
|
|
|
|
|
<el-input v-model="otherValues[option.otherCode]" |
|
|
|
|
|
:placeholder="option.otherPlaceholder || '请输入'" |
|
|
|
|
|
:class="{ 'error-border': isOtherInputError(option.otherCode) }" @blur="onBlur" |
|
|
|
|
|
@input="onOtherInputChange(option.otherCode, $event)" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</el-checkbox-group> |
|
|
</el-checkbox-group> |
|
|
@ -63,7 +61,7 @@ |
|
|
<el-button v-else-if="type === 'button'" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" |
|
|
<el-button v-else-if="type === 'button'" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" |
|
|
:disabled="getDisabled()" type="primary" @click="handleClickButton(item)"> |
|
|
:disabled="getDisabled()" type="primary" @click="handleClickButton(item)"> |
|
|
{{ $t(item.buttonName) }} |
|
|
{{ $t(item.buttonName) }} |
|
|
<input type="hidden" v-model="inputValue" > |
|
|
|
|
|
|
|
|
<input type="hidden" v-model="inputValue"> |
|
|
</el-button> |
|
|
</el-button> |
|
|
|
|
|
|
|
|
<div class="clickable" |
|
|
<div class="clickable" |
|
|
@ -89,28 +87,26 @@ |
|
|
<div slot="tip" class="el-upload__tip">支持扩展名:.rar .zip .doc .docx .pdf .jpg,文件大小不超过2MB</div> |
|
|
<div slot="tip" class="el-upload__tip">支持扩展名:.rar .zip .doc .docx .pdf .jpg,文件大小不超过2MB</div> |
|
|
</el-upload> |
|
|
</el-upload> |
|
|
</template> |
|
|
</template> |
|
|
<div v-else-if="type === 'checkboxTag'" class="flex1 checkbox-tag-container" |
|
|
|
|
|
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')"> |
|
|
|
|
|
<div class="checkbox-tag-item"> |
|
|
|
|
|
<el-checkbox v-model="checkboxTagChecked" :disabled="getDisabled()" @change="onCheckboxTagChange"></el-checkbox> |
|
|
|
|
|
<div class="tag-content blue-border" @click="onTagClick"> |
|
|
|
|
|
<el-input v-if="isEditingTag" |
|
|
|
|
|
v-model="tagValue" |
|
|
|
|
|
ref="tagInput" |
|
|
|
|
|
:maxlength="item.maxlength || 20" |
|
|
|
|
|
@blur="onTagBlur" |
|
|
|
|
|
@keyup.enter.native="onTagBlur" |
|
|
|
|
|
placeholder="请输入" |
|
|
|
|
|
size="mini" |
|
|
|
|
|
class="tag-input" /> |
|
|
|
|
|
<el-tag v-else |
|
|
|
|
|
:type="'info'" |
|
|
|
|
|
class="tag-display" |
|
|
|
|
|
:closable="false"> |
|
|
|
|
|
{{ tagValue || '点击输入' }} |
|
|
|
|
|
</el-tag> |
|
|
|
|
|
|
|
|
<div v-else-if="type === 'checkboxTag'" class="flex1 checkbox-tag-wrapper" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')"> |
|
|
|
|
|
<div v-for="(tag, tagIndex) in checkboxTagList" :key="tagIndex" class="checkbox-tag-container"> |
|
|
|
|
|
<div class="checkbox-tag-item"> |
|
|
|
|
|
<el-checkbox v-model="tag.checked" :disabled="getDisabled()" |
|
|
|
|
|
@change="onCheckboxTagChange(tagIndex, $event)"></el-checkbox> |
|
|
|
|
|
<div class="tag-content blue-border"> |
|
|
|
|
|
<el-input v-if="templateFillType === 'preFill'" v-model="tag.tagValue" |
|
|
|
|
|
:ref="'tagInput_' + tagIndex" :maxlength="item.maxlength || 20" |
|
|
|
|
|
@blur="onTagBlur(tagIndex)" @keyup.enter.native="onTagBlur(tagIndex)" |
|
|
|
|
|
placeholder="请输入" size="mini" class="tag-input" /> |
|
|
|
|
|
<el-tag v-else :type="'info'" class="tag-display" :closable="false"> |
|
|
|
|
|
{{ tag.tagValue }} |
|
|
|
|
|
</el-tag> |
|
|
|
|
|
<el-popconfirm confirm-button-text='确认' cancel-button-text='取消' icon="el-icon-info" |
|
|
|
|
|
icon-color="red" title="确认删除当前编号?" @confirm="onDeleteTag(tagIndex)"> |
|
|
|
|
|
<i slot="reference" v-if="templateFillType === 'preFill'" |
|
|
|
|
|
class="el-icon-close delete-icon"></i> |
|
|
|
|
|
</el-popconfirm> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<i class="el-icon-close delete-icon" @click="onDeleteTag" v-if="tagValue"></i> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
@ -242,23 +238,26 @@ export default { |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
let initialValue = this.value; |
|
|
let initialValue = this.value; |
|
|
let initialOtherValues = {},checkboxTagChecked = false,tagValue = ''; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let initialOtherValues = {}, checkboxTagList = []; |
|
|
|
|
|
|
|
|
// 如果是checkboxList类型且value是对象格式 |
|
|
// 如果是checkboxList类型且value是对象格式 |
|
|
if (this.type === 'checkboxList' && this.value && typeof this.value === 'object') { |
|
|
if (this.type === 'checkboxList' && this.value && typeof this.value === 'object') { |
|
|
initialValue = this.value.checkboxValues || []; |
|
|
initialValue = this.value.checkboxValues || []; |
|
|
initialOtherValues = this.value.otherValues || {}; |
|
|
initialOtherValues = this.value.otherValues || {}; |
|
|
} else if (this.type === 'checkboxList' && !Array.isArray(this.value)) { |
|
|
} else if (this.type === 'checkboxList' && !Array.isArray(this.value)) { |
|
|
initialValue = []; |
|
|
initialValue = []; |
|
|
}else if (this.type === 'checkboxTag' && this.value && typeof this.value === 'object') { |
|
|
|
|
|
checkboxTagChecked = this.value.checked || false; |
|
|
|
|
|
tagValue = this.value.tagValue || ''; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} else if (this.type === 'checkboxTag' && Array.isArray(this.value)) { |
|
|
|
|
|
// checkboxTag类型,value是数组格式 |
|
|
|
|
|
checkboxTagList = this.value.map(tag => ({ |
|
|
|
|
|
checked: tag.checked, |
|
|
|
|
|
tagValue: tag.tagValue || '' |
|
|
|
|
|
})); |
|
|
|
|
|
} |
|
|
return { |
|
|
return { |
|
|
inputValue: initialValue, |
|
|
inputValue: initialValue, |
|
|
oldValue: initialValue, // 记录上一次的值 |
|
|
oldValue: initialValue, // 记录上一次的值 |
|
|
otherValues: initialOtherValues, // 存储checkboxList中otherCode对应的输入值 |
|
|
otherValues: initialOtherValues, // 存储checkboxList中otherCode对应的输入值 |
|
|
oldOtherValues: {...initialOtherValues}, // 记录上一次的otherValues |
|
|
|
|
|
|
|
|
oldOtherValues: { ...initialOtherValues }, // 记录上一次的otherValues |
|
|
showModal: false, // 控制模态框显示 |
|
|
showModal: false, // 控制模态框显示 |
|
|
modificationRecords: [], // 存储修改记录 |
|
|
modificationRecords: [], // 存储修改记录 |
|
|
modalTimer: null, // 用于延迟隐藏模态框 |
|
|
modalTimer: null, // 用于延迟隐藏模态框 |
|
|
@ -268,9 +267,8 @@ export default { |
|
|
replyContent: '', // 回复内容 |
|
|
replyContent: '', // 回复内容 |
|
|
visible: false,//是否显示弹窗 |
|
|
visible: false,//是否显示弹窗 |
|
|
checkboxValue: this.getChecked(),//是否选中 |
|
|
checkboxValue: this.getChecked(),//是否选中 |
|
|
checkboxTagChecked: checkboxTagChecked, // checkboxTag类型的checkbox选中状态 |
|
|
|
|
|
tagValue: tagValue, // checkboxTag类型的tag值 |
|
|
|
|
|
isEditingTag: false, // 是否正在编辑tag |
|
|
|
|
|
|
|
|
checkboxTagList: checkboxTagList, // checkboxTag类型的列表数据 |
|
|
|
|
|
oldCheckboxTagList: JSON.parse(JSON.stringify(checkboxTagList)), // 记录上一次的checkboxTagList |
|
|
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: {},//选择的试剂/仪器/供试品等信息 |
|
|
@ -281,18 +279,22 @@ export default { |
|
|
}, |
|
|
}, |
|
|
pendingUploadFile: null, // 用于存储待上传的文件 |
|
|
pendingUploadFile: null, // 用于存储待上传的文件 |
|
|
pendingRemoveFile: null, // 用于存储待删除的文件 |
|
|
pendingRemoveFile: null, // 用于存储待删除的文件 |
|
|
|
|
|
currentTagIndex:-1,//当前选中的checkboxTag索引 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
|
value(newVal) { |
|
|
value(newVal) { |
|
|
console.log(newVal,"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.inputValue = newVal.checkboxValues || []; |
|
|
this.otherValues = newVal.otherValues || {}; |
|
|
this.otherValues = newVal.otherValues || {}; |
|
|
} else if (this.type === 'checkboxTag' && newVal && typeof newVal === 'object') { |
|
|
|
|
|
this.checkboxTagChecked = newVal.checked || false; |
|
|
|
|
|
this.tagValue = newVal.tagValue || ''; |
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
} else if (this.type === 'checkboxTag' && Array.isArray(newVal)) { |
|
|
|
|
|
// checkboxTag类型,value是数组格式 |
|
|
|
|
|
this.checkboxTagList = newVal.map(tag => ({ |
|
|
|
|
|
checked: tag.checked, |
|
|
|
|
|
tagValue: tag.tagValue || '' |
|
|
|
|
|
})); |
|
|
|
|
|
} else { |
|
|
this.inputValue = this.type === 'checkboxList' && !Array.isArray(newVal) ? [] : newVal; |
|
|
this.inputValue = this.type === 'checkboxList' && !Array.isArray(newVal) ? [] : newVal; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -328,13 +330,13 @@ export default { |
|
|
EventBus.$off("onMixReagentSubmit", this.onMixReagentSubmit) |
|
|
EventBus.$off("onMixReagentSubmit", this.onMixReagentSubmit) |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
getFlexClass(){ |
|
|
|
|
|
const noFlexArr = ["radio","checkboxTag"] |
|
|
|
|
|
|
|
|
getFlexClass() { |
|
|
|
|
|
const noFlexArr = ["radio", "checkboxTag"] |
|
|
return noFlexArr.includes(this.type) ? '' : 'flex1' |
|
|
return noFlexArr.includes(this.type) ? '' : 'flex1' |
|
|
}, |
|
|
}, |
|
|
getDecimalDigits(){ |
|
|
|
|
|
const {precision} = this.item; |
|
|
|
|
|
if(!isNaN(precision)){ |
|
|
|
|
|
|
|
|
getDecimalDigits() { |
|
|
|
|
|
const { precision } = this.item; |
|
|
|
|
|
if (!isNaN(precision)) { |
|
|
return precision |
|
|
return precision |
|
|
} |
|
|
} |
|
|
return 6 |
|
|
return 6 |
|
|
@ -526,11 +528,11 @@ export default { |
|
|
// 执行试剂提交的共同逻辑 |
|
|
// 执行试剂提交的共同逻辑 |
|
|
executeReagentSubmit(data) { |
|
|
executeReagentSubmit(data) { |
|
|
this.inputValue = data.selectedId; |
|
|
this.inputValue = data.selectedId; |
|
|
const {filledCodes=[]} = this.item; |
|
|
|
|
|
console.log(filledCodes,"filledCodes") |
|
|
|
|
|
const {selectInfo,row} = data; |
|
|
|
|
|
if(filledCodes.length>0){ |
|
|
|
|
|
this.inputValue = row[filledCodes[0]]+"("+row[filledCodes[1]]+")"; |
|
|
|
|
|
|
|
|
const { filledCodes = [] } = this.item; |
|
|
|
|
|
console.log(filledCodes, "filledCodes") |
|
|
|
|
|
const { selectInfo, row } = data; |
|
|
|
|
|
if (filledCodes.length > 0) { |
|
|
|
|
|
this.inputValue = row[filledCodes[0]] + "(" + row[filledCodes[1]] + ")"; |
|
|
} |
|
|
} |
|
|
this.selectRegentInfo = data; |
|
|
this.selectRegentInfo = data; |
|
|
EventBus.$emit("hideSelectMixReagentDialog"); |
|
|
EventBus.$emit("hideSelectMixReagentDialog"); |
|
|
@ -654,7 +656,7 @@ export default { |
|
|
preFill: "blue-border",//预填写的边框颜色 |
|
|
preFill: "blue-border",//预填写的边框颜色 |
|
|
} |
|
|
} |
|
|
// 如果有错误状态,返回红色边框样式,覆盖原有的边框颜色 |
|
|
// 如果有错误状态,返回红色边框样式,覆盖原有的边框颜色 |
|
|
if (this.error && this.type !== "attachment") { |
|
|
|
|
|
|
|
|
if (this.error && this.type !== "attachment" && this.type !== "checkboxTag") { |
|
|
return "error-border"; |
|
|
return "error-border"; |
|
|
} |
|
|
} |
|
|
return typeObj[fillType] || "" |
|
|
return typeObj[fillType] || "" |
|
|
@ -774,7 +776,7 @@ export default { |
|
|
// 检查是否有被取消选中的checkbox |
|
|
// 检查是否有被取消选中的checkbox |
|
|
if (this.oldValue && Array.isArray(this.oldValue)) { |
|
|
if (this.oldValue && Array.isArray(this.oldValue)) { |
|
|
const uncheckedValues = this.oldValue.filter(oldVal => !this.inputValue.includes(oldVal)); |
|
|
const uncheckedValues = this.oldValue.filter(oldVal => !this.inputValue.includes(oldVal)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 清除被取消选中的checkbox对应的otherValues |
|
|
// 清除被取消选中的checkbox对应的otherValues |
|
|
if (uncheckedValues.length > 0) { |
|
|
if (uncheckedValues.length > 0) { |
|
|
this.item.options.forEach(option => { |
|
|
this.item.options.forEach(option => { |
|
|
@ -785,19 +787,19 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
value = { |
|
|
value = { |
|
|
checkboxValues: this.inputValue, |
|
|
|
|
|
otherValues: this.otherValues |
|
|
|
|
|
}; |
|
|
|
|
|
if(val){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
checkboxValues: this.inputValue, |
|
|
|
|
|
otherValues: this.otherValues |
|
|
|
|
|
}; |
|
|
|
|
|
if (val) { |
|
|
|
|
|
|
|
|
this.onCommonHandleSaveRecord(); |
|
|
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 = this.isValueEmpty(value); |
|
|
@ -813,38 +815,32 @@ export default { |
|
|
this.onInputChange(); |
|
|
this.onInputChange(); |
|
|
}, |
|
|
}, |
|
|
// checkboxTag的checkbox变化处理 |
|
|
// checkboxTag的checkbox变化处理 |
|
|
onCheckboxTagChange() { |
|
|
|
|
|
|
|
|
onCheckboxTagChange(tagIndex, e) { |
|
|
|
|
|
this.currentTagIndex = tagIndex; |
|
|
|
|
|
this.checkboxTagList[tagIndex].checked = e; |
|
|
this.emitCheckboxTagValue(); |
|
|
this.emitCheckboxTagValue(); |
|
|
|
|
|
this.onCommonHandleSaveRecord(); |
|
|
}, |
|
|
}, |
|
|
// 点击tag区域 |
|
|
|
|
|
onTagClick() { |
|
|
|
|
|
this.isEditingTag = true; |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
this.$refs.tagInput && this.$refs.tagInput.focus(); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// tag输入框失去焦点 |
|
|
// tag输入框失去焦点 |
|
|
onTagBlur() { |
|
|
|
|
|
this.isEditingTag = false; |
|
|
|
|
|
|
|
|
onTagBlur(tagIndex) { |
|
|
|
|
|
this.currentTagIndex = tagIndex; |
|
|
|
|
|
const value = this.checkboxTagList[tagIndex].tagValue; |
|
|
this.emitCheckboxTagValue(); |
|
|
this.emitCheckboxTagValue(); |
|
|
// 触发保存记录 |
|
|
|
|
|
if (this.tagValue) { |
|
|
|
|
|
this.onCommonHandleSaveRecord(this.tagValue); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.onCommonHandleSaveRecord(value); |
|
|
}, |
|
|
}, |
|
|
// 删除tag |
|
|
// 删除tag |
|
|
onDeleteTag() { |
|
|
|
|
|
this.tagValue = ''; |
|
|
|
|
|
|
|
|
onDeleteTag(tagIndex) { |
|
|
|
|
|
this.currentTagIndex = tagIndex; |
|
|
|
|
|
// 从列表中删除指定索引的tag |
|
|
this.emitCheckboxTagValue(); |
|
|
this.emitCheckboxTagValue(); |
|
|
this.onCommonHandleSaveRecord(''); |
|
|
|
|
|
|
|
|
this.$emit("deleteTag", tagIndex); |
|
|
}, |
|
|
}, |
|
|
// 发送checkboxTag的值 |
|
|
// 发送checkboxTag的值 |
|
|
emitCheckboxTagValue() { |
|
|
emitCheckboxTagValue() { |
|
|
const value = { |
|
|
|
|
|
checked: this.checkboxTagChecked, |
|
|
|
|
|
tagValue: this.tagValue |
|
|
|
|
|
}; |
|
|
|
|
|
this.$emit('change', value); |
|
|
|
|
|
|
|
|
// 发送整个数组 |
|
|
|
|
|
this.$emit('input', [...this.checkboxTagList]); |
|
|
|
|
|
this.$emit('change', [...this.checkboxTagList]); |
|
|
}, |
|
|
}, |
|
|
// 统一处理失去焦点事件 |
|
|
// 统一处理失去焦点事件 |
|
|
onBlur(e) { |
|
|
onBlur(e) { |
|
|
@ -921,19 +917,28 @@ export default { |
|
|
this.$emit("change", this.inputValue); |
|
|
this.$emit("change", this.inputValue); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 值发生了变化,需要弹出密码输入框 |
|
|
// 值发生了变化,需要弹出密码输入框 |
|
|
const isSame = this.isEqual(this.oldValue, this.inputValue); |
|
|
|
|
|
let isOtherValuesSame = true; |
|
|
|
|
|
|
|
|
let isSame = true, isOldValueEmpty = true; |
|
|
// 如果是checkboxList类型,需要同时比较otherValues |
|
|
// 如果是checkboxList类型,需要同时比较otherValues |
|
|
if (this.type === 'checkboxList' && this.otherValues) { |
|
|
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) { |
|
|
|
|
|
|
|
|
isSame = this.isEqual(this.oldOtherValues, this.otherValues); |
|
|
|
|
|
isOldValueEmpty = this.isValueEmpty(this.oldOtherValues); |
|
|
|
|
|
} 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 = this.isValueEmpty(oldTag.checked); |
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
isSame = this.isEqual(this.oldValue, this.inputValue) |
|
|
|
|
|
isOldValueEmpty = this.isValueEmpty(this.oldValue); |
|
|
|
|
|
} |
|
|
|
|
|
if (isSame) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if (!this.isValueEmpty(this.oldValue) && !(isSame && isOtherValuesSame) && this.templateFillType === "actFill") { |
|
|
|
|
|
|
|
|
if (!isOldValueEmpty && !(isSame) && this.templateFillType === "actFill") { |
|
|
// 通过EventBus触发电子签名弹窗 |
|
|
// 通过EventBus触发电子签名弹窗 |
|
|
EventBus.$emit('showEditSignDialog', { uuid: this.uuid }); |
|
|
EventBus.$emit('showEditSignDialog', { uuid: this.uuid }); |
|
|
} else {//如果是第一次填写,不需要密码验证 |
|
|
} else {//如果是第一次填写,不需要密码验证 |
|
|
@ -946,11 +951,22 @@ export default { |
|
|
// 用户点击取消,还原数据 |
|
|
// 用户点击取消,还原数据 |
|
|
let oldValue = this.oldValue; |
|
|
let oldValue = this.oldValue; |
|
|
if (this.type === 'checkboxList') { |
|
|
if (this.type === 'checkboxList') { |
|
|
oldValue = { |
|
|
|
|
|
|
|
|
oldValue = { |
|
|
checkboxValues: oldValue.checkboxValues || oldValue, |
|
|
checkboxValues: oldValue.checkboxValues || oldValue, |
|
|
otherValues: this.oldOtherValues |
|
|
otherValues: this.oldOtherValues |
|
|
}; |
|
|
}; |
|
|
} |
|
|
|
|
|
|
|
|
} else if (this.type === "checkboxTag") { |
|
|
|
|
|
// checkboxTag类型,只回退当前tagIndex的数据 |
|
|
|
|
|
if (this.currentTagIndex >= 0 && this.currentTagIndex < this.oldCheckboxTagList.length) { |
|
|
|
|
|
const oldTag = this.oldCheckboxTagList[this.currentTagIndex]; |
|
|
|
|
|
this.checkboxTagList[this.currentTagIndex] = { ...oldTag }; |
|
|
|
|
|
oldValue = [...this.checkboxTagList]; |
|
|
|
|
|
} else { |
|
|
|
|
|
// 如果没有指定tagIndex,回退整个数组 |
|
|
|
|
|
this.checkboxTagList = JSON.parse(JSON.stringify(this.oldCheckboxTagList)); |
|
|
|
|
|
oldValue = [...this.checkboxTagList]; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
this.inputValue = this.oldValue; |
|
|
this.inputValue = this.oldValue; |
|
|
this.$emit('input', oldValue); // 触发 v-model 更新 |
|
|
this.$emit('input', oldValue); // 触发 v-model 更新 |
|
|
// this.$emit("blur", this.oldValue); |
|
|
// this.$emit("blur", this.oldValue); |
|
|
@ -961,18 +977,30 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//处理更新记录 |
|
|
//处理更新记录 |
|
|
handleUpdateRecord(data,recordData) { |
|
|
|
|
|
|
|
|
handleUpdateRecord(data, recordData) { |
|
|
const baseInfo = this.getCommonRecordInfo(); |
|
|
const baseInfo = this.getCommonRecordInfo(); |
|
|
if (!this.oldValue && !this.inputValue) return; |
|
|
|
|
|
if(recordData){ |
|
|
|
|
|
|
|
|
if (!this.oldValue && !this.inputValue) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if (recordData) { |
|
|
this.oldValue = recordData.oldValue; |
|
|
this.oldValue = recordData.oldValue; |
|
|
this.inputValue = recordData.inputValue; |
|
|
this.inputValue = recordData.inputValue; |
|
|
} |
|
|
} |
|
|
|
|
|
let recordOldVlaue = this.oldValue, recordValue = this.inputValue, isModify = !!this.oldValue; |
|
|
|
|
|
if (this.type === "checkboxTag") { |
|
|
|
|
|
// checkboxTag类型,只记录当前tagIndex的数据变化 |
|
|
|
|
|
const oldTag = this.oldCheckboxTagList[this.currentTagIndex] || {}; |
|
|
|
|
|
const currentTag = this.checkboxTagList[this.currentTagIndex] || {}; |
|
|
|
|
|
recordOldVlaue = `${oldTag.tagValue || ''}:${oldTag.checked ? '勾选' : '未勾选'}`; |
|
|
|
|
|
recordValue = `${currentTag.tagValue || ''}:${currentTag.checked ? '勾选' : '未勾选'}`; |
|
|
|
|
|
isModify = oldTag.checked !== undefined |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
const record = { |
|
|
const record = { |
|
|
...baseInfo, |
|
|
...baseInfo, |
|
|
oldValue: this.oldValue, |
|
|
|
|
|
value: this.inputValue, |
|
|
|
|
|
title: this.oldValue ? "修改" : "提交", |
|
|
|
|
|
|
|
|
oldValue: recordOldVlaue, |
|
|
|
|
|
value: recordValue, |
|
|
|
|
|
title: isModify ? "修改" : "提交", |
|
|
time: moment().format("YYYY-MM-DD HH:mm:ss"), |
|
|
time: moment().format("YYYY-MM-DD HH:mm:ss"), |
|
|
} |
|
|
} |
|
|
if (data) { |
|
|
if (data) { |
|
|
@ -984,11 +1012,19 @@ export default { |
|
|
newRecord: [record], |
|
|
newRecord: [record], |
|
|
resourceList: this.getZdxgjl(), |
|
|
resourceList: this.getZdxgjl(), |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 更新oldValue和oldOtherValues |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 更新oldValue和oldOtherValues |
|
|
if (this.type === 'checkboxList') { |
|
|
if (this.type === 'checkboxList') { |
|
|
this.oldValue = [...this.inputValue]; |
|
|
this.oldValue = [...this.inputValue]; |
|
|
this.oldOtherValues = { ...this.otherValues }; |
|
|
this.oldOtherValues = { ...this.otherValues }; |
|
|
|
|
|
} else if (this.type === "checkboxTag") { |
|
|
|
|
|
// checkboxTag类型,只更新当前tagIndex的数据 |
|
|
|
|
|
if (this.currentTagIndex >= 0 && this.currentTagIndex < this.checkboxTagList.length) { |
|
|
|
|
|
this.oldCheckboxTagList[this.currentTagIndex] = { ...this.checkboxTagList[this.currentTagIndex] }; |
|
|
|
|
|
} else { |
|
|
|
|
|
// 如果没有指定tagIndex,更新整个数组 |
|
|
|
|
|
this.oldCheckboxTagList = JSON.parse(JSON.stringify(this.checkboxTagList)); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
let value = this.inputValue; |
|
|
let value = this.inputValue; |
|
|
if (this.type === 'checkboxList') { |
|
|
if (this.type === 'checkboxList') { |
|
|
@ -996,10 +1032,12 @@ export default { |
|
|
checkboxValues: this.inputValue, |
|
|
checkboxValues: this.inputValue, |
|
|
otherValues: this.otherValues |
|
|
otherValues: this.otherValues |
|
|
}; |
|
|
}; |
|
|
|
|
|
} else if (this.type === "checkboxTag") { |
|
|
|
|
|
value = [...this.checkboxTagList]; |
|
|
} |
|
|
} |
|
|
if(this.type === "button"){ |
|
|
|
|
|
this.$emit('clickButton', this.item,this.inputValue,data); |
|
|
|
|
|
if(this.templateFillType === "preFill"){ |
|
|
|
|
|
|
|
|
if (this.type === "button") { |
|
|
|
|
|
this.$emit('clickButton', this.item, this.inputValue, data); |
|
|
|
|
|
if (this.templateFillType === "preFill") { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -1017,7 +1055,7 @@ export default { |
|
|
} |
|
|
} |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
EventBus.$emit('onModifyRecord', params,) |
|
|
EventBus.$emit('onModifyRecord', params,) |
|
|
console.log(params,"onModifyRecord") |
|
|
|
|
|
|
|
|
console.log(params, "onModifyRecord") |
|
|
if (this.regentType.includes(this.item.type)) { |
|
|
if (this.regentType.includes(this.item.type)) { |
|
|
this.$emit("onRegentSubmit", this.selectRegentInfo, this.inputValue); |
|
|
this.$emit("onRegentSubmit", this.selectRegentInfo, this.inputValue); |
|
|
} |
|
|
} |
|
|
@ -1106,7 +1144,7 @@ export default { |
|
|
isShowHandle() { |
|
|
isShowHandle() { |
|
|
const { fillType } = this.item; |
|
|
const { fillType } = this.item; |
|
|
//只有当模板状态不是预填时,才显示操作按钮 |
|
|
//只有当模板状态不是预填时,才显示操作按钮 |
|
|
return this.templateFillType !== "preFill" && fillType === "actFill"&&this.type!=="button" |
|
|
|
|
|
|
|
|
return this.templateFillType !== "preFill" && fillType === "actFill" && this.type !== "button" |
|
|
}, |
|
|
}, |
|
|
//判断是否禁用 |
|
|
//判断是否禁用 |
|
|
getDisabled() { |
|
|
getDisabled() { |
|
|
@ -1582,15 +1620,17 @@ export default { |
|
|
margin-right: 16px; |
|
|
margin-right: 16px; |
|
|
display: flex; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
|
|
|
|
|
|
&:not(:last-child) { |
|
|
&:not(:last-child) { |
|
|
margin-bottom: 10px; |
|
|
margin-bottom: 10px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// display: inline-block; |
|
|
// display: inline-block; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.el-input { |
|
|
.el-input { |
|
|
width: 200px; |
|
|
width: 200px; |
|
|
margin-left: 10px; |
|
|
margin-left: 10px; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&.error-border { |
|
|
&.error-border { |
|
|
.el-input__inner { |
|
|
.el-input__inner { |
|
|
border-color: #ff5d5d !important; |
|
|
border-color: #ff5d5d !important; |
|
|
@ -1600,7 +1640,7 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.orange-border { |
|
|
.orange-border { |
|
|
@ -1612,6 +1652,7 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.el-checkbox { |
|
|
.el-checkbox { |
|
|
&.is-checked { |
|
|
&.is-checked { |
|
|
.el-checkbox__label { |
|
|
.el-checkbox__label { |
|
|
@ -1624,6 +1665,7 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.el-radio { |
|
|
.el-radio { |
|
|
&.is-checked { |
|
|
&.is-checked { |
|
|
.el-radio__label { |
|
|
.el-radio__label { |
|
|
@ -1646,16 +1688,15 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// checkboxTag样式 |
|
|
// checkboxTag样式 |
|
|
|
|
|
.checkbox-tag-wrapper { |
|
|
|
|
|
display: flex; |
|
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
|
gap: 10px; |
|
|
|
|
|
padding: 8px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.checkbox-tag-container { |
|
|
.checkbox-tag-container { |
|
|
border-radius: 4px; |
|
|
border-radius: 4px; |
|
|
// transition: all 0.3s; |
|
|
|
|
|
margin-bottom: 5px; |
|
|
|
|
|
margin-right: 5px; |
|
|
|
|
|
|
|
|
|
|
|
&.error-border { |
|
|
|
|
|
border-color: #ff5d5d !important; |
|
|
|
|
|
box-shadow: 0 0 6px #ffc3c3 !important; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.checkbox-tag-item { |
|
|
.checkbox-tag-item { |
|
|
display: flex; |
|
|
display: flex; |
|
|
@ -1664,6 +1705,7 @@ export default { |
|
|
|
|
|
|
|
|
.tag-content { |
|
|
.tag-content { |
|
|
cursor: pointer; |
|
|
cursor: pointer; |
|
|
|
|
|
position: relative; |
|
|
|
|
|
|
|
|
.tag-input { |
|
|
.tag-input { |
|
|
width: 100px; |
|
|
width: 100px; |
|
|
@ -1678,15 +1720,14 @@ export default { |
|
|
.delete-icon { |
|
|
.delete-icon { |
|
|
cursor: pointer; |
|
|
cursor: pointer; |
|
|
color: #909399; |
|
|
color: #909399; |
|
|
font-size: 14px; |
|
|
|
|
|
|
|
|
font-size: 12px; |
|
|
padding: 2px; |
|
|
padding: 2px; |
|
|
border-radius: 50%; |
|
|
border-radius: 50%; |
|
|
// transition: all 0.3s; |
|
|
|
|
|
|
|
|
|
|
|
&:hover { |
|
|
|
|
|
color: #ff5d5d; |
|
|
|
|
|
background-color: #f5f5f5; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
position: absolute; |
|
|
|
|
|
top: 6px; |
|
|
|
|
|
right: 5px; |
|
|
|
|
|
color: red; |
|
|
|
|
|
background-color: #f5f5f5; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |