Browse Source

需求删除按钮

master
rose 4 years ago
parent
commit
3be10ce1a0
  1. 13
      src/api/demand.js
  2. 28
      src/views/enterprise/demand.vue

13
src/api/demand.js

@ -39,11 +39,22 @@ export function demandPublishAdd(data) {
url: `/gateway/${demandPublish}/demandPublishAdd`, url: `/gateway/${demandPublish}/demandPublishAdd`,
method: 'post', method: 'post',
data: { data: {
content: data.content, content: data.content,
demandId: data.id, demandId: data.id,
type: data.type type: data.type
}
})
}
export function DemandDelete(id) {
return request({
url: `/gateway${demandPublish}/PolicyDelete`,
method: 'post',
data: {
param: {
id: id
}
} }
}) })
} }

28
src/views/enterprise/demand.vue

@ -81,16 +81,15 @@
<el-table-column <el-table-column
label="操作" label="操作"
align="center" align="center"
width="230" width="260"
class-name="small-padding fixed-width" class-name="small-padding fixed-width"
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-button type="primary" size="mini" @click="edit(row)" <el-button type="primary" size="mini" @click="edit(row)">修改处理状态</el-button>
>修改处理状态</el-button <el-button size="mini" type="danger" @click="declare(row)">发榜</el-button>
> <el-button size="mini" type="danger" @click="handleDelete(row.id)">
<el-button size="mini" type="danger" @click="declare(row)" 删除
>发榜</el-button </el-button>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -159,6 +158,16 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
async handleDelete(id) {
await api.DemandDelete(id).then(res => {
this.getList()
})
this.$message({
message: '删除成功',
duration: 1000
})
},
async getList() { async getList() {
const that = this const that = this
await api.demandQuery(that.data).then(res => { await api.demandQuery(that.data).then(res => {
@ -185,6 +194,11 @@ export default {
console.log(row.id) console.log(row.id)
that.temp = Object.assign({}, row) that.temp = Object.assign({}, row)
await api.demandPublishAdd(that.temp).then(res => {}) await api.demandPublishAdd(that.temp).then(res => {})
this.$message({
message: '发榜成功',
duration: 1000
})
this.getList()
} }
} }
} }

Loading…
Cancel
Save