Browse Source

民警可以增加多个

feature/yujt_analysis_pc
zhangyuan 6 years ago
parent
commit
31087db267
  1. 28
      src/views/modules/police/police.vue

28
src/views/modules/police/police.vue

@ -27,7 +27,7 @@
</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission(':police:save:')" type="primary" @click="supplementHandle()">警民群补建
<el-button v-if="$hasPermission(':police:save')" type="primary" @click="supplementHandle()">警民群补建
</el-button>
</el-form-item>
</el-form>
@ -65,7 +65,7 @@
<el-button v-if="$hasPermission(':police:delete')" type="text" size="small"
@click="beforeDeleteHandle(scope.row.id)">{{ $t('delete') }}
</el-button>
<el-button v-if="$hasPermission(':police:save')" type="text" size="small"
<el-button v-if="$hasPermission(':police:save:')" type="text" size="small"
@click="supplementHandle(scope.row)">补建群
</el-button>
</template>
@ -130,13 +130,13 @@
this.dataForm.deptId = value.slice(-1).shift()
},
beforeDeleteHandle(id) {
this.$confirm('删除民警将会解散全部警民群,是否继续操作?', this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
}).then(() => {
this.deleteHandle(id);
})
// this.$confirm('?', this.$t('prompt.title'), {
// confirmButtonText: this.$t('confirm'),
// cancelButtonText: this.$t('cancel'),
// type: 'warning'
// }).then(() => {
this.deleteHandle(id);
// })
},
supplementHandle(data) {
if (!data && this.dataListSelections.length <= 0) {
@ -146,12 +146,19 @@
duration: 500
})
}
if (!data && this.dataListSelections.length > 1) {
return this.$message({
message: '只能选择一个社区',
type: 'warning',
duration: 500
})
}
this.$confirm(this.$t('prompt.info', {'handle': '补建群'}), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
}).then(() => {
this.$http.put('/property/police/supplement', data ? [data] : this.dataListSelections.map(item => item)).then(({data: res}) => {
this.$http.put('/property/police/supplement', data ? data : this.dataListSelections[0]).then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
@ -171,6 +178,7 @@
}
}
</script>
<style scoped>
.big_image {
width: 300px;

Loading…
Cancel
Save