From 504306a0cf2183413bb4131efadc4deb154ef203 Mon Sep 17 00:00:00 2001 From: quyixiao <2621048238@qq.com> Date: Fri, 14 Aug 2020 23:32:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../record/recorddetail-add-or-update.vue | 41 +++++++++++-------- .../modules/result/record/recorddetail.vue | 16 +++++--- 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/src/views/modules/result/record/recorddetail-add-or-update.vue b/src/views/modules/result/record/recorddetail-add-or-update.vue index f37d696..038a64d 100644 --- a/src/views/modules/result/record/recorddetail-add-or-update.vue +++ b/src/views/modules/result/record/recorddetail-add-or-update.vue @@ -47,6 +47,8 @@ export default { visible: false, keyResultEditor: null, checkResultEditor: null, + recordResultId: null, + type: 0, dataForm: { id: 0, target: '', @@ -68,26 +70,31 @@ export default { }, methods: { - init (id) { + init (id, type, recordResultId) { + this.type = type + this.recordResultId = recordResultId this.dataForm.id = id || 0 this.visible = true this.$nextTick(async () => { this.$refs['dataForm'].resetFields() - this.keyResultEditor = new E('#keyResultEditorElem') - this.keyResultEditor.customConfig.uploadImgServer = '/uploadPicture' - this.keyResultEditor.customConfig.uploadFileName = 'file' - this.keyResultEditor.customConfig.uploadImgParams = '' - this.keyResultEditor.customConfig.debug = true - this.keyResultEditor.create() + if (this.keyResultEditor === null) { + this.keyResultEditor = new E('#keyResultEditorElem') + this.keyResultEditor.customConfig.uploadImgServer = '/uploadPicture' + this.keyResultEditor.customConfig.uploadFileName = 'file' + this.keyResultEditor.customConfig.uploadImgParams = '' + this.keyResultEditor.customConfig.debug = true + this.keyResultEditor.create() + } + if (this.checkResultEditor === null) { + this.checkResultEditor = new E('#checkResultEditorElem') + this.checkResultEditor.customConfig.uploadImgServer = '/uploadPicture' + this.checkResultEditor.customConfig.uploadFileName = 'file' + this.checkResultEditor.customConfig.uploadImgParams = '' + this.checkResultEditor.customConfig.debug = true + this.checkResultEditor.create() + } - this.checkResultEditor = new E('#checkResultEditorElem') - this.checkResultEditor.customConfig.uploadImgServer = '/uploadPicture' - this.checkResultEditor.customConfig.uploadFileName = 'file' - this.checkResultEditor.customConfig.uploadImgParams = '' - this.checkResultEditor.customConfig.debug = true - this.checkResultEditor.create() - - if (this.dataForm.id) { + if (this.dataForm.id && this.dataForm.id > 0) { const data = await apiDetailInfo(this.dataForm.id) if (data && data.code === 0) { this.dataForm.target = data.detailInfo.target @@ -107,13 +114,15 @@ export default { dataFormSubmit () { recorddetailAddOrUpdate({ 'id': this.dataForm.id || undefined, + 'type': this.type, 'target': this.dataForm.target, 'keyResult': Base64.encode(this.keyResultEditor.txt.html()), 'checkWeight': this.dataForm.checkWeight, 'checkResult': Base64.encode(this.checkResultEditor.txt.html()), 'superScore': this.dataForm.superScore, 'acquireScore': this.dataForm.acquireScore, - 'scoreComment': this.dataForm.scoreComment + 'scoreComment': this.dataForm.scoreComment, + 'recordId': this.recordResultId }).then(res => { if (res && res.code === 0) { this.$message({ diff --git a/src/views/modules/result/record/recorddetail.vue b/src/views/modules/result/record/recorddetail.vue index 36f6209..a7b0e30 100644 --- a/src/views/modules/result/record/recorddetail.vue +++ b/src/views/modules/result/record/recorddetail.vue @@ -33,7 +33,13 @@ v-loading.body="loading" element-loading-text="Loading" border fit highlight-current-row> - + + + +