提交修改

This commit is contained in:
quyixiao 2020-08-14 23:32:09 +08:00
parent 49a2e1912d
commit 504306a0cf
2 changed files with 36 additions and 21 deletions

View File

@ -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({

View File

@ -33,7 +33,13 @@
v-loading.body="loading"
element-loading-text="Loading" border fit highlight-current-row>
<el-table-column label="考核维度" prop="checkRange" align="center" width="80"></el-table-column>
<el-table-column label="目标/指标" prop="target" align="center" width="200"></el-table-column>
<el-table-column label="目标/指标" prop="target" align="center" width="200">
<template slot-scope="scope">
<div v-html="scope.row.target" class="rich">
</div>
</template>
</el-table-column>
<el-table-column label="关键结果" prop="keyResult" width="800" align="left">
<template slot-scope="scope">
<div v-html="scope.row.keyResult" class="rich">
@ -66,8 +72,8 @@
<el-table-column width="80" label="操作" align="center" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="primary" style="margin-left:0px;" @click="handleAddOrUpdate()" v-if="scope.row.isAdd===1">添加</el-button>
<el-button size="mini" style="margin-left:0px;" @click="handleAddOrUpdate(scope.row.id)" v-if="scope.row.isAdd >=0 " >编辑</el-button>
<el-button size="mini" type="primary" style="margin-left:0px;" @click="handleAddOrUpdate(0,scope.row.type )" v-if="scope.row.isAdd===1">添加</el-button>
<el-button size="mini" style="margin-left:0px;" @click="handleAddOrUpdate(scope.row.id,scope.row.type)" v-if="scope.row.isAdd >=0 " >编辑</el-button>
</template>
</el-table-column>
</el-table>
@ -149,11 +155,11 @@ export default {
})
},
// /
handleAddOrUpdate (id) {
handleAddOrUpdate (id, type) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
setTimeout(() => {
this.$refs.addOrUpdate.init(id)
this.$refs.addOrUpdate.init(id, type, this.recordResultId)
}, 500)
})
},