diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue index 408329b..c07ae20 100644 --- a/src/components/Template/CustomTable.vue +++ b/src/components/Template/CustomTable.vue @@ -84,7 +84,7 @@ -
@@ -109,7 +109,7 @@
item.label === value) || {}; return !!o.checked; }, // 获取或创建checkedItem getOrCreateCheckedItem(value) { - let checkedItem = this.inputValue.checkedValues.find(item => item.label === value); + const {checkedValues = []} = this.inputValue; + let checkedItem = checkedValues.find(item => item.label === value); if (!checkedItem) { checkedItem = { label: value, checked: false }; - this.inputValue.checkedValues.push(checkedItem); + checkedValues.push(checkedItem); } return checkedItem; }, @@ -999,7 +1004,6 @@ export default { } }); } - this.onCommonHandleSaveRecord(); }, @@ -1126,11 +1130,11 @@ export default { return o[this.currentHandleType]; }, getCheckboxTreeInfo() { - const { checkedValues, otherValues } = this.inputValue; + const { checkedValues = [], otherValues = {} } = this.inputValue; const { checkedValues: oldCheckedValues, otherValues: oldOtherValues } = this.oldValue; const { currentHandleType, currentCheckboxTreeValue } = this; const newItem = checkedValues.find(item => item.label === currentCheckboxTreeValue); - const oldItem = oldCheckedValues.find(item => item.label === currentCheckboxTreeValue); + const oldItem = (oldCheckedValues || []).find(item => item.label === currentCheckboxTreeValue); const o = { "checkboxTreeCheckbox": { oldValue: oldItem, newValue: newItem, des: "" }, "checkboxTreeOther": { oldValue: oldOtherValues[currentCheckboxTreeValue], newValue: otherValues[currentCheckboxTreeValue], des: `${currentCheckboxTreeValue}:`, key: this.fieldKey + "_" + currentCheckboxTreeValue }, @@ -1203,19 +1207,20 @@ export default { const current = this.getFqyqInfo(); isSame = isEqual(current.oldValue, current.newValue); if (this.currentHandleType === "inputValue") { - isOldValueEmpty = this.isUnSubmitted(current.key); + isOldValueEmpty = this.isUnSubmitted(this.fieldKey+current.key); } else { isOldValueEmpty = isValueEmpty(current.oldValue); } } else if (this.type === "checkboxTree") { const current = this.getCheckboxTreeInfo() || {}; const { oldValue = {}, newValue = {} } = current; + console.log(oldValue,newValue,"oldValue,newValue") if (currentHandleType === "checkboxTreeCheckbox") { isSame = isEqual(oldValue.checked, newValue.checked); isOldValueEmpty = oldValue.checked === undefined; } else { isSame = isEqual(current.oldValue, current.newValue); - isOldValueEmpty = this.isUnSubmitted(current.key); + isOldValueEmpty = this.isUnSubmitted(this.fieldKey+current.key); } } else if(this.type === "radioTree"){ @@ -1223,11 +1228,10 @@ export default { const { oldValue = {}, newValue = {} } = current; if (this.currentHandleType === "checkboxTreeCheckbox") { isSame = isEqual(oldValue, newValue); - console.log(oldValue,newValue,oldValue !== newValue,"newValue") isOldValueEmpty = oldValue === newValue; } else { isSame = isEqual(current.oldValue, current.newValue); - isOldValueEmpty = this.isUnSubmitted(current.key); + isOldValueEmpty = this.isUnSubmitted(this.fieldKey+current.key); } } else if (this.type === "checkbox") { @@ -1311,7 +1315,7 @@ export default { recordOldVlaue = `${current.des + current.oldValue}`; recordValue = `${current.des + current.newValue}`; if (this.currentHandleType === "inputValue") { - finallyKey = current.key; + finallyKey = this.fieldKey+current.key; } isModify = !!this.oldFqyqValue.mainRadio } else if (this.type === "checkboxTree") { @@ -1325,7 +1329,7 @@ export default { } else { recordOldVlaue = `${current.des + (current.oldValue || '')}`; recordValue = `${current.des + (current.newValue || '')}`; - finallyKey = current.key; + finallyKey = this.fieldKey+current.key; isModify = !!current.oldValue; } } else if (this.type === "radioTree") { @@ -1338,7 +1342,7 @@ export default { } else { recordOldVlaue = `${current.des + (current.oldValue || '')}`; recordValue = `${current.des + (current.newValue || '')}`; - finallyKey = current.key; + finallyKey = this.fieldKey+current.key; isModify = !!current.oldValue; } } else if (this.type === "checkbox") { @@ -1548,6 +1552,7 @@ export default { //获取字段修改记录 getModifyRecords() { const { fieldKey, getZdxgjl } = this; + const records = getZdxgjl().filter(item => item.key === fieldKey); return records; }, diff --git a/src/components/Template/mixins/operationMixins.js b/src/components/Template/mixins/operationMixins.js index 1073b21..931b05d 100644 --- a/src/components/Template/mixins/operationMixins.js +++ b/src/components/Template/mixins/operationMixins.js @@ -24,7 +24,7 @@ export default { const { fieldItemLabel, columnsData } = this.columns; const { row } = this; const desArr = columnsData.map((item) => { - const label = this.$t(item.label), otherValue = "", subValue = "", mainValue = row[item.prop]; + let label = this.$t(item.label), otherValue = "", subValue = "", mainValue = row[item.prop]; if (item.bodySubKey && (item.bodySubType !== "button")) { subValue = row[item.bodySubKey]; } @@ -44,7 +44,8 @@ export default { "value": "", "title": "修改", "time": moment().format("YYYY-MM-DD HH:mm:ss"), - "reason": remark + "reason": remark, + type:"deleteRow" } ] this.sureDelete(record); diff --git a/src/views/business/comps/template/comps/gsp/GSP015.vue b/src/views/business/comps/template/comps/gsp/GSP015.vue index a82a677..f294836 100644 --- a/src/views/business/comps/template/comps/gsp/GSP015.vue +++ b/src/views/business/comps/template/comps/gsp/GSP015.vue @@ -56,9 +56,9 @@ + @beforeReagentSubmit="(e) => beforeReagentSubmit(e, index, 'ybsm')" + @onRegentSubmit="(e) => onRegentSubmit(e, index, 'ybsm')" fieldItemLabel="取样进样信息" + :formData="item">