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

Loading…
Cancel
Save