|
@@ -63,13 +63,13 @@
|
|
|
icon="el-icon-paperclip"
|
|
|
@click="Back(multipleSelection[0])"
|
|
|
>回复</el-button>
|
|
|
- <!-- <el-button
|
|
|
+ <el-button
|
|
|
type="danger"
|
|
|
:size="!sms?'mini':'small'"
|
|
|
:disabled="disabledBtn"
|
|
|
icon="el-icon-delete"
|
|
|
@click="del(multipleSelection[0])"
|
|
|
- >删除</el-button> -->
|
|
|
+ >删除</el-button>
|
|
|
<el-button
|
|
|
type="warning"
|
|
|
:size="!sms?'mini':'small'"
|
|
@@ -247,7 +247,7 @@
|
|
|
|
|
|
<script>
|
|
|
import TableItem from '@/components/Table'
|
|
|
-import { getProblem, postProblem, putProblem, getKnowledgeList, postproblemBack } from '@/api/hotline'
|
|
|
+import { getProblem, postProblem, putProblem, getKnowledgeList, postproblemBack,delProblem } from '@/api/hotline'
|
|
|
import { client } from '@/utils/index'
|
|
|
export default {
|
|
|
components: { TableItem },
|
|
@@ -394,7 +394,8 @@ export default {
|
|
|
children: 'list',
|
|
|
label: 'title'
|
|
|
},
|
|
|
- selectId: ''
|
|
|
+ selectId: '',
|
|
|
+ delRow:null
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -472,9 +473,10 @@ export default {
|
|
|
}
|
|
|
console.log(this.fileList, value)
|
|
|
},
|
|
|
- del() {
|
|
|
+ del(row) {
|
|
|
this.dialogDelete = true
|
|
|
this.dialogTitle = '删除问题'
|
|
|
+ this.delRow = row
|
|
|
},
|
|
|
SP(value) {
|
|
|
if (value.shbz === '0') {
|
|
@@ -484,8 +486,33 @@ export default {
|
|
|
this.$message.error('请选择未审核数据')
|
|
|
}
|
|
|
},
|
|
|
- confirmDelete() {
|
|
|
|
|
|
+ confirmDelete() {
|
|
|
+ let user = this.$store.state.user
|
|
|
+ if(parseInt(user.userId) === parseInt(this.delRow.createUser)){
|
|
|
+ if(this.delRow.sfrk === '1'){
|
|
|
+ this.$message.warning('进入知识库的问题不能删除!')
|
|
|
+ this.dialogDelete = false
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ delProblem(this.delRow.id).then(res=>{
|
|
|
+ if(res.code === 1){
|
|
|
+ this.$message.success('删除成功!')
|
|
|
+ this.fetchData()
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.$message.error('删除失败!')
|
|
|
+ }
|
|
|
+ }).catch(ex=>{
|
|
|
+ this.$message.error('删除失败!')
|
|
|
+ }).finally(()=>{
|
|
|
+ this.dialogDelete = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.$message.warning('只能删除自己创建的问题!')
|
|
|
+ this.dialogDelete = false
|
|
|
+ }
|
|
|
},
|
|
|
handleNodeClick(data) {
|
|
|
console.log(data)
|