Browse Source

民警维护功能增加群补建

feature/yujt_analysis_pc
zhangyuan 5 years ago
parent
commit
1f131394b3
  1. 1
      src/views/modules/police/police-add-or-update.vue
  2. 72
      src/views/modules/police/police.vue

1
src/views/modules/police/police-add-or-update.vue

@ -19,6 +19,7 @@
prop="deptId">
<el-cascader v-model="dataForm.deptId" style="width: 100%"
:options="options"
:disabled="dataForm.id"
ref="grid"
@change="deptHandleChange"
filterable

72
src/views/modules/police/police.vue

@ -17,13 +17,22 @@
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission(':police:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
<el-button v-if="$hasPermission(':police:save')" type="primary" @click="addOrUpdateHandle()">{{
$t('add') }}
</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission(':police:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
<el-button v-if="$hasPermission(':police:delete')" type="danger" @click="deleteHandle()">{{
$t('deleteBatch') }}
</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission(':police:save')" type="primary" @click="supplementHandle()">警民群补建
</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table v-loading="dataListLoading" :data="dataList" border
@selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="policeName" label="民警姓名" header-align="center" align="center"></el-table-column>
<el-table-column prop="policeAvatar" label="照片" header-align="center" align="center"></el-table-column>
@ -31,8 +40,12 @@
<el-table-column prop="deptName" label="所属社区" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission(':police:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission(':police:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
<el-button v-if="$hasPermission(':police:update')" type="text" size="small"
@click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}
</el-button>
<el-button v-if="$hasPermission(':police:delete')" type="text" size="small"
@click="deleteHandle(scope.row.id)">{{ $t('delete') }}
</el-button>
</template>
</el-table-column>
</el-table>
@ -52,11 +65,12 @@
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './police-add-or-update'
export default {
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './police-add-or-update'
export default {
mixins: [mixinViewModule],
data () {
data() {
return {
mixinViewModuleOptions: {
getDataListURL: '/property/police/page',
@ -73,15 +87,15 @@ export default {
components: {
AddOrUpdate
},
mounted () {
mounted() {
//
this.getByLoginUser()
},
methods: {
getByLoginUser () {
getByLoginUser() {
this.$http
.get(`/sys/user/deptOptions/getMiddleByLoginUser`)
.then(({ data: res }) => {
.then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
@ -90,9 +104,39 @@ export default {
.catch(() => {
})
},
handleChange (value) {
handleChange(value) {
this.dataForm.deptId = value.slice(-1).shift()
},
supplementHandle(id) {
if (!id && this.dataListSelections.length <= 0) {
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', id ? [id] : this.dataListSelections.map(item => item.deptId)).then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.getDataList()
}
})
}).catch(() => {
})
}).catch(() => {
})
}
}
}
}
</script>

Loading…
Cancel
Save