|
|
@ -235,7 +235,7 @@ import { getToken } from "@/utils/auth"; |
|
|
import { isShowOtherByCheckboxTree } from "@/utils/formPackageCommon"; |
|
|
import { isShowOtherByCheckboxTree } from "@/utils/formPackageCommon"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
inject: ['templateData', 'templateFillType', "getZdxgjl", "getFhyjjl", "updateZdxgjl", "replaceFhyjjl", "updateFhyjjl", "getFieldCheckObj", "updateFieldCheckObj"], |
|
|
|
|
|
|
|
|
inject: ['templateData', 'templateFillType',"getSubmittedCodes","updateSubmittedCodes", "getZdxgjl", "getFhyjjl", "updateZdxgjl", "replaceFhyjjl", "updateFhyjjl", "getFieldCheckObj", "updateFieldCheckObj"], |
|
|
components: { |
|
|
components: { |
|
|
Question, |
|
|
Question, |
|
|
DecimalInput, |
|
|
DecimalInput, |
|
|
@ -1096,9 +1096,10 @@ export default { |
|
|
const { mainRadio: oldMainRadio, inputValue: oldInputValue, subRadio: oldSubRadio } = this.oldFqyqValue; |
|
|
const { mainRadio: oldMainRadio, inputValue: oldInputValue, subRadio: oldSubRadio } = this.oldFqyqValue; |
|
|
const o = { |
|
|
const o = { |
|
|
"mainRadio": { oldValue: oldMainRadio, newValue: mainRadio, des: "" }, |
|
|
"mainRadio": { oldValue: oldMainRadio, newValue: mainRadio, des: "" }, |
|
|
"inputValue": { oldValue: oldInputValue, newValue: inputValue, des: "" }, |
|
|
|
|
|
|
|
|
"inputValue": { oldValue: oldInputValue, newValue: inputValue, des: "",key: this.fieldKey+"_inputValue" }, |
|
|
"subRadio": { oldValue: oldSubRadio, newValue: subRadio, des: "是否在规定时间完成:" } |
|
|
"subRadio": { oldValue: oldSubRadio, newValue: subRadio, des: "是否在规定时间完成:" } |
|
|
} |
|
|
} |
|
|
|
|
|
console.log(o, this.currentHandleType, this.fqyqValue,"fqyqValue") |
|
|
return o[this.currentHandleType]; |
|
|
return o[this.currentHandleType]; |
|
|
}, |
|
|
}, |
|
|
getCheckboxTreeInfo() { |
|
|
getCheckboxTreeInfo() { |
|
|
@ -1109,7 +1110,7 @@ export default { |
|
|
const oldItem = oldCheckedValues.find(item => item.label === currentCheckboxTreeValue); |
|
|
const oldItem = oldCheckedValues.find(item => item.label === currentCheckboxTreeValue); |
|
|
const o = { |
|
|
const o = { |
|
|
"checkboxTreeCheckbox": { oldValue: oldItem, newValue: newItem, des: "" }, |
|
|
"checkboxTreeCheckbox": { oldValue: oldItem, newValue: newItem, des: "" }, |
|
|
"checkboxTreeOther": { oldValue: oldOtherValues[currentCheckboxTreeValue], newValue: otherValues[currentCheckboxTreeValue], des: `${currentCheckboxTreeValue}:` }, |
|
|
|
|
|
|
|
|
"checkboxTreeOther": { oldValue: oldOtherValues[currentCheckboxTreeValue], newValue: otherValues[currentCheckboxTreeValue], des: `${currentCheckboxTreeValue}:`,key: this.fieldKey+"_"+currentCheckboxTreeValue }, |
|
|
} |
|
|
} |
|
|
return o[currentHandleType]; |
|
|
return o[currentHandleType]; |
|
|
}, |
|
|
}, |
|
|
@ -1168,7 +1169,11 @@ export default { |
|
|
} else if (this.type === "fqyq") { |
|
|
} else if (this.type === "fqyq") { |
|
|
const current = this.getFqyqInfo(); |
|
|
const current = this.getFqyqInfo(); |
|
|
isSame = isEqual(current.oldValue, current.newValue); |
|
|
isSame = isEqual(current.oldValue, current.newValue); |
|
|
isOldValueEmpty = isValueEmpty(current.oldValue); |
|
|
|
|
|
|
|
|
if(this.currentHandleType === "inputValue"){ |
|
|
|
|
|
isOldValueEmpty =this.isUnSubmitted(current.key); |
|
|
|
|
|
}else{ |
|
|
|
|
|
isOldValueEmpty = isValueEmpty(current.oldValue); |
|
|
|
|
|
} |
|
|
} else if (this.type === "checkboxTree") { |
|
|
} else if (this.type === "checkboxTree") { |
|
|
const current = this.getCheckboxTreeInfo() || {}; |
|
|
const current = this.getCheckboxTreeInfo() || {}; |
|
|
const { oldValue = {}, newValue = {} } = current; |
|
|
const { oldValue = {}, newValue = {} } = current; |
|
|
@ -1177,16 +1182,16 @@ export default { |
|
|
isOldValueEmpty = oldValue.checked === undefined; |
|
|
isOldValueEmpty = oldValue.checked === undefined; |
|
|
} else { |
|
|
} else { |
|
|
isSame = isEqual(current.oldValue, current.newValue); |
|
|
isSame = isEqual(current.oldValue, current.newValue); |
|
|
isOldValueEmpty = isValueEmpty(current.oldValue); |
|
|
|
|
|
|
|
|
isOldValueEmpty = this.isUnSubmitted(current.key); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if(this.type === "checkbox"){ |
|
|
} else if(this.type === "checkbox"){ |
|
|
isSame = isEqual(this.oldValue, this.inputValue) |
|
|
isSame = isEqual(this.oldValue, this.inputValue) |
|
|
isOldValueEmpty = this.oldValue === ''; |
|
|
|
|
|
|
|
|
isOldValueEmpty =this.isUnSubmitted(); |
|
|
}else { |
|
|
}else { |
|
|
isSame = isEqual(this.oldValue, this.inputValue) |
|
|
isSame = isEqual(this.oldValue, this.inputValue) |
|
|
isOldValueEmpty = isValueEmpty(this.oldValue); |
|
|
|
|
|
|
|
|
isOldValueEmpty = this.isUnSubmitted(); |
|
|
} |
|
|
} |
|
|
console.log(isSame, isOldValueEmpty, this.currentCheckboxTreeValue, this.oldValue, this.inputValue, "isSame") |
|
|
console.log(isSame, isOldValueEmpty, this.currentCheckboxTreeValue, this.oldValue, this.inputValue, "isSame") |
|
|
if (isSame) { |
|
|
if (isSame) { |
|
|
@ -1200,6 +1205,13 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//是否提交过 |
|
|
|
|
|
isUnSubmitted(key){ |
|
|
|
|
|
const finallyKey = key || this.fieldKey; |
|
|
|
|
|
const has = this.getSubmittedCodes().includes(finallyKey) |
|
|
|
|
|
return !has; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
//如果用户取消,那么回退到上一次的值 |
|
|
//如果用户取消,那么回退到上一次的值 |
|
|
resetRecord() { |
|
|
resetRecord() { |
|
|
// 用户点击取消,还原数据 |
|
|
// 用户点击取消,还原数据 |
|
|
@ -1232,6 +1244,7 @@ export default { |
|
|
if (!this.oldValue && !this.inputValue) { |
|
|
if (!this.oldValue && !this.inputValue) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
let finallyKey = this.fieldKey; |
|
|
if (recordData) { |
|
|
if (recordData) { |
|
|
this.oldValue = recordData.oldValue; |
|
|
this.oldValue = recordData.oldValue; |
|
|
this.inputValue = recordData.inputValue; |
|
|
this.inputValue = recordData.inputValue; |
|
|
@ -1248,6 +1261,9 @@ export default { |
|
|
const current = this.getFqyqInfo(); |
|
|
const current = this.getFqyqInfo(); |
|
|
recordOldVlaue = `${current.des + current.oldValue}`; |
|
|
recordOldVlaue = `${current.des + current.oldValue}`; |
|
|
recordValue = `${current.des + current.newValue}`; |
|
|
recordValue = `${current.des + current.newValue}`; |
|
|
|
|
|
if(this.currentHandleType === "inputValue"){ |
|
|
|
|
|
finallyKey = current.key; |
|
|
|
|
|
} |
|
|
isModify = !!this.oldFqyqValue.mainRadio |
|
|
isModify = !!this.oldFqyqValue.mainRadio |
|
|
} else if (this.type === "checkboxTree") { |
|
|
} else if (this.type === "checkboxTree") { |
|
|
// checkboxTree类型,记录当前操作的值变化 |
|
|
// checkboxTree类型,记录当前操作的值变化 |
|
|
@ -1257,6 +1273,7 @@ export default { |
|
|
recordOldVlaue = `${oldValue?.label || ''}:${oldValue?.checked ? '勾选' : '未勾选'}`; |
|
|
recordOldVlaue = `${oldValue?.label || ''}:${oldValue?.checked ? '勾选' : '未勾选'}`; |
|
|
recordValue = `${newValue.label || ''}:${newValue.checked ? '勾选' : '未勾选'}`; |
|
|
recordValue = `${newValue.label || ''}:${newValue.checked ? '勾选' : '未勾选'}`; |
|
|
isModify = newValue.checked !== undefined; |
|
|
isModify = newValue.checked !== undefined; |
|
|
|
|
|
finallyKey = current.key; |
|
|
} else { |
|
|
} else { |
|
|
recordOldVlaue = `${current.des + (current.oldValue || '')}`; |
|
|
recordOldVlaue = `${current.des + (current.oldValue || '')}`; |
|
|
recordValue = `${current.des + (current.newValue || '')}`; |
|
|
recordValue = `${current.des + (current.newValue || '')}`; |
|
|
@ -1271,7 +1288,7 @@ export default { |
|
|
...baseInfo, |
|
|
...baseInfo, |
|
|
oldValue: recordOldVlaue, |
|
|
oldValue: recordOldVlaue, |
|
|
value: recordValue, |
|
|
value: recordValue, |
|
|
title: isModify ? "修改" : "提交", |
|
|
|
|
|
|
|
|
title: !this.isUnSubmitted(finallyKey) ? "修改" : "提交", |
|
|
time: moment().format("YYYY-MM-DD HH:mm:ss"), |
|
|
time: moment().format("YYYY-MM-DD HH:mm:ss"), |
|
|
} |
|
|
} |
|
|
if (data) { |
|
|
if (data) { |
|
|
@ -1281,6 +1298,7 @@ export default { |
|
|
const params = { |
|
|
const params = { |
|
|
type: "fieldChanged", |
|
|
type: "fieldChanged", |
|
|
newRecord: [record], |
|
|
newRecord: [record], |
|
|
|
|
|
submittedCodes: this.getSubmittedCodes(), |
|
|
resourceList: this.getZdxgjl(), |
|
|
resourceList: this.getZdxgjl(), |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -1320,6 +1338,7 @@ export default { |
|
|
|
|
|
|
|
|
if (this.templateFillType === "actFill") {//只有实际填报的时候才记录修改记录 |
|
|
if (this.templateFillType === "actFill") {//只有实际填报的时候才记录修改记录 |
|
|
this.updateZdxgjl(record); |
|
|
this.updateZdxgjl(record); |
|
|
|
|
|
this.updateSubmittedCodes(finallyKey); |
|
|
} |
|
|
} |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
EventBus.$emit('onModifyRecord', params,) |
|
|
EventBus.$emit('onModifyRecord', params,) |
|
|
|