diff --git a/src/api/policy.js b/src/api/policy.js
index b6483ab..95c57e8 100644
--- a/src/api/policy.js
+++ b/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: {}
+ })
+}
diff --git a/src/views/firstPages/policy.vue b/src/views/firstPages/policy.vue
index b21a5f6..12deda2 100644
--- a/src/views/firstPages/policy.vue
+++ b/src/views/firstPages/policy.vue
@@ -185,6 +185,16 @@
+
+
+
+
@@ -289,6 +299,16 @@
+
+
+
+
@@ -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
})
},