Browse Source

政策发布部门相关修改

master
aBin 4 years ago
parent
commit
487ae4e26f
  1. 14
      src/api/policy.js
  2. 46
      src/views/firstPages/policy.vue

14
src/api/policy.js

@ -1,5 +1,6 @@
import request from '@/utils/request'
const policy = '/enterprise/policy'
const policyArea = '/policy/policy'
export function PolicyDetail(data) {
return request({
@ -30,6 +31,7 @@ export function PolicyUpdate(data) {
imgUrl: data.imgUrl,
intro: data.intro,
title: data.title,
pushDep: data.pushDep,
titleUrl: data.titleUrl,
type: data.type
}
@ -61,8 +63,18 @@ export function PolicyAdd(data) {
intro: data.intro,
publishTime: data.publishTime,
title: data.title,
titleUrl: data.titleUrl
titleUrl: data.titleUrl,
publishDepartId: data.pushDep,
}
}
})
}
export function getAreaBranch() {
return request({
url: `/gateway${policyArea}/area`,
method: 'post',
data: {}
})
}

46
src/views/firstPages/policy.vue

@ -185,6 +185,16 @@
<el-input v-model="temp.imgUrl" />
</el-form-item>
<el-form-item label="发布部门" prop="imgUrl" style="width: 180%">
<el-cascader
v-model="cascader"
v-if="options.length > 0"
:options="options"
@change="handleChange"
:props="{ value: 'id', label: 'areaName', children: 'next' }"
></el-cascader>
</el-form-item>
<el-form-item label="原文内容" prop="content" style="width: 180%">
<!-- <el-button @click="show111 = !show111">原文/编辑</el-button> -->
<!-- <textarea v-if="show111 === false" style="width: 100%;height: 300px" v-text="temp.content" /> -->
@ -289,6 +299,16 @@
<el-input v-model="addPolicy.imgUrl" />
</el-form-item>
<el-form-item label="发布部门" prop="imgUrl" style="width: 180%">
<el-cascader
v-model="cascader1"
v-if="options.length > 0"
:options="options"
@change="handleChange1"
:props="{ value: 'id', label: 'areaName', children: 'next' }"
></el-cascader>
</el-form-item>
<el-form-item label="原文内容" prop="content" style="width: 180%">
<!-- <el-button @click="show111 = !show111">原文/编辑</el-button> -->
<!-- <textarea v-if="show111 === false" style="width: 100%;height: 300px" v-text="temp.content" /> -->
@ -337,6 +357,8 @@ export default {
show111: false,
total: 0,
listLoading: true,
cascader: '',
cascader1: '',
data: {
title: '',
auditStatus: '',
@ -366,17 +388,29 @@ export default {
titleUrl: '',
imgUrl: '',
content: '',
intro: ''
}
intro: '',
pushDep: ''
},
options: []
}
},
computed: {
...mapGetters(['name'])
},
created() {
this.getList()
async created() {
await this.getList()
await api.getAreaBranch().then(res => {
this.options = res
})
},
methods: {
handleChange(value) {
this.temp.pushDep = value[value.length - 1]
console.log(this.temp)
},
handleChange1(value) {
this.addPolicy.pushDep = value[value.length - 1]
},
async Search() {
const that = this
that.listLoading = true
@ -435,6 +469,7 @@ export default {
handleUpdate(row) {
const that = this
that.temp = Object.assign({}, row) // copy obj
console.log(that.temp)
that.temp.timestamp = new Date(that.temp.timestamp)
that.dialogStatus = 'update'
for (const key in that.typeList) {
@ -464,6 +499,7 @@ export default {
}
await api.PolicyUpdate(that.temp).then(res => {
this.getList()
this.cascader = ''
that.dialogFormVisible = false
})
},
@ -471,6 +507,7 @@ export default {
this.listLoading = true
detail.auditStatus = num
await api.PolicyUpdate(detail).then(res => {
this.cascader = ''
this.listLoading = false
})
},
@ -501,6 +538,7 @@ export default {
}
}
api.PolicyAdd(that.addPolicy).then(res => {
this.cascader1 = ''
that.dialogFormVisible1 = false
})
},

Loading…
Cancel
Save