Browse Source

信息公示 人员管理列表

master
songyunpeng 6 years ago
parent
commit
b1bf9c8c43
  1. 95
      src/views/modules/custom/consultconf-add-or-update.vue
  2. 69
      src/views/modules/custom/consultconf.vue
  3. 245
      src/views/modules/custom/gridoperatorinfo-add-or-update.vue
  4. 186
      src/views/modules/custom/gridoperatorinfo-detail.vue
  5. 167
      src/views/modules/custom/gridoperatorinfo.vue

95
src/views/modules/custom/consultconf-add-or-update.vue

@ -0,0 +1,95 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<el-form-item label="是否公示网格员信息" prop="gridOperatorFlag" label-width="200px">
<el-select v-model="dataForm.gridOperatorFlag" placeholder="是否公示网格员信息" @change="selectModel($event)">
<el-option v-for="item in gridOperatorFlag" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" >
</el-option>
</el-select>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
gridOperatorFlag: '',
delFlag: '',
revision: '',
createdBy: '',
createdTime: '',
updatedBy: '',
updatedTime: ''
},
gridOperatorFlag: [
{ dictValue: '1', dictName: '是' },
{ dictValue: '0', dictName: '否' }
]
}
},
computed: {
dataRule () {
return {
gridOperatorFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getInfo () {
this.$http.get(`/custom/consultconf/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/custom/consultconf/', this.dataForm).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.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>

69
src/views/modules/custom/consultconf.vue

@ -0,0 +1,69 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-__consultconf}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-button v-if="$hasPermission('custom:consultconf:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('custom:consultconf:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
</el-form>
<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="gridOperatorFlag" label="是否公示网格员信息" header-align="center" align="center" :formatter="showFlagFormat"></el-table-column>
<el-table-column prop="createdTime" 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('custom:consultconf:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('custom:consultconf:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './consultconf-add-or-update'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/custom/consultconf/page',
getDataListIsPage: true,
deleteURL: '/custom/consultconf',
deleteIsBatch: true
},
dataForm: {
id: ''
}
}
},
components: {
AddOrUpdate
},
methods: {
showFlagFormat (row, column) {
if (row.gridOperatorFlag === '0') {
return '否'
} else {
return '是'
}
}
}
}
</script>

245
src/views/modules/custom/gridoperatorinfo-add-or-update.vue

@ -0,0 +1,245 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<el-form-item label="姓名" prop="realName">
<el-input v-model="dataForm.realName" placeholder="姓名"></el-input>
</el-form-item>
<el-form-item label="性别" prop="sex">
<el-select v-model="dataForm.sex" placeholder="性别">
<el-option v-for="item in sexFlagArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" >
</el-option>
</el-select>
</el-form-item>
<el-form-item label="身份证号" prop="identityNo">
<el-input v-model="dataForm.identityNo" placeholder="身份证号"></el-input>
</el-form-item>
<el-form-item label="联系电话" prop="mobile">
<el-input v-model="dataForm.mobile" placeholder="联系电话"></el-input>
</el-form-item>
<el-form-item label="所属网格" prop="allDeptIds">
<el-cascader v-model="dataForm.allDeptIds"
:options="options"
clearable></el-cascader>
</el-form-item>
<el-form-item label="网络职责"
prop="dutyCategoryId">
<el-select v-model="dataForm.dutyCategoryId"
@change="changeCaterory"
placeholder="请选择网络职责">
<el-option v-for="item in dutyCategorys"
:key="item.id"
:label="item.dutyCategoryName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item>
<el-form-item label="工作单位" prop="workUnit">
<el-input v-model="dataForm.workUnit" placeholder="工作单位"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item>
<el-form-item label="上传相片"
v-loading="loading"
prop="faceImg">
<el-upload class="avatar-uploader"
:action="this.uploadUrl"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:on-error="handelError"
:before-upload="beforeAvatarUpload">
<img v-if="dataForm.faceImg"
:src="dataForm.faceImg"
class="avatar">
<i v-else
class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import Cookies from 'js-cookie'
import debounce from 'lodash/debounce'
export default {
data () {
return {
visible: false,
dataForm: {
realName: '',
sex: '',
sort: '',
mobile: '',
identityNo: '',
faceImg: '',
workUnit: '',
dutyCategoryId: '',
showFlag: '',
remark: '',
allDeptIds: ''
},
sexFlagArr: [
{ dictValue: '1', dictName: '男' },
{ dictValue: '0', dictName: '女' }
],
loading: false,
uploadUrl: '',
options: [],
dutyCategorys: []
}
},
computed: {
dataRule () {
return {
realName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
sex: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
mobile: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
dutyCategoryId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
allDeptIds: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
created () {
this.getListCategory()
},
methods: {
init () {
this.getByLoginUser()
this.getDutyCategory()
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
} else {
this.dataForm.allDeptIds = []
}
})
},
//
getInfo () {
this.$http.get(`/custom/gridoperatorinfo/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/custom/gridoperatorinfo/', this.dataForm).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.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false }),
//
handleAvatarSuccess (res, file) {
this.dataForm.faceImg = res.data.url
this.loading = false
},
beforeAvatarUpload (file) {
this.loading = true
},
handelError () {
this.loading = false
},
getByLoginUser () {
this.$http
.get(`/sys/dept/party/getDeptTree`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
})
.catch(() => { })
},
getDutyCategory () {
this.$http
.get(`/sys/dept/party/getDeptTree`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
})
.catch(() => { })
},
changeCaterory () {
let choosenItem = this.dutyCategorys.filter(item => item.id === this.dataForm.dutyCategoryId)[0]
this.dataForm.dutyCategoryId = choosenItem.id
},
getListCategory () {
this.$http.get(`/custom/gridoperatordutycategory/getAllDutyCat`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dutyCategorys = res.data
})
.catch(() => { })
}
}
}
</script>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 378px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 300px;
height: 178px;
display: block;
}
</style>

186
src/views/modules/custom/gridoperatorinfo-detail.vue

@ -0,0 +1,186 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<el-form-item label="姓名" prop="realName" v-if="dataForm.realName">
<span>{{dataForm.realName}}</span>
</el-form-item>
<el-form-item label="性别" prop="sex" v-if="dataForm.sex">
<span>{{dataForm.sex === '0'?'女':'男'}}</span>
</el-form-item>
<el-form-item label="身份证号" prop="identityNo" v-if="dataForm.identityNo">
<span>{{dataForm.identityNo}}</span>
</el-form-item>
<el-form-item label="联系电话" prop="mobile" v-if="dataForm.mobile">
<span>{{dataForm.mobile}}</span>
</el-form-item>
<el-form-item label="所属网格" prop="allDeptNames" v-if="dataForm.allDeptNames">
<span>{{dataForm.allDeptNames}}</span>
</el-form-item>
<el-form-item label="网络职责"
prop="dutyCategoryId">
<span>{{changeCatergory()}}</span>
</el-form-item>
<el-form-item label="排序" prop="sort" v-if="dataForm.sort">
<span>{{dataForm.sort}}</span>
</el-form-item>
<el-form-item label="工作单位" prop="workUnit" v-if="dataForm.workUnit">
<span>{{dataForm.workUnit}}</span>
</el-form-item>
<el-form-item label="备注" prop="remark" v-if="dataForm.remark">
<span>{{dataForm.remark}}</span>
</el-form-item>
<el-form-item label="大头照"
v-loading="loading"
prop="faceImg" v-if="dataForm.mobile">
<img v-if="dataForm.faceImg"
:src="dataForm.faceImg"
class="avatar">
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false"
type="primary">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import Cookies from 'js-cookie'
import debounce from 'lodash/debounce'
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
realName: '',
sex: '',
sort: '',
mobile: '',
identityNo: '',
faceImg: '',
workUnit: '',
dutyCategoryId: '',
showFlag: '',
remark: '',
allDeptIds: ''
},
sexFlagArr: [
{ dictValue: '1', dictName: '男' },
{ dictValue: '0', dictName: '女' }
],
loading: false,
uploadUrl: '',
options: [],
dutyCategoryName: '',
dutyCategorys: []
}
},
computed: {
dataRule () {
return {
}
}
},
created () {
this.getListCategory()
},
methods: {
init () {
this.getByLoginUser()
this.getDutyCategory()
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
} else {
this.dataForm.allDeptIds = []
}
})
},
//
getInfo () {
this.$http.get(`/custom/gridoperatorinfo/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/custom/gridoperatorinfo/', this.dataForm).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.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false }),
//
handleAvatarSuccess (res, file) {
this.dataForm.faceImg = res.data.url
this.loading = false
},
beforeAvatarUpload (file) {
this.loading = true
},
handelError () {
this.loading = false
},
getByLoginUser () {
this.$http
.get(`/sys/dept/party/getDeptTree`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
})
.catch(() => { })
},
getDutyCategory () {
this.$http
.get(`/sys/dept/party/getDeptTree`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
})
.catch(() => { })
},
getListCategory () {
this.$http.get(`/custom/gridoperatordutycategory/getAllDutyCat`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dutyCategorys = res.data
}).catch(() => { })
},
changeCatergory () {
let choosenItem = this.dutyCategorys.filter(item => item.id === this.dataForm.dutyCategoryId)[0]
if (choosenItem !== undefined) {
return choosenItem.dutyCategoryName
}
}
}
}
</script>

167
src/views/modules/custom/gridoperatorinfo.vue

@ -0,0 +1,167 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-__gridoperatorinfo}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<div>
<el-form-item label="区域">
<el-cascader v-model="ids" :options="options" :props="{ checkStrictly: true }" clearable>
</el-cascader>
</el-form-item>
</div>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('custom:gridoperatorinfo:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('custom:gridoperatorinfo:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
</el-form>
<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="realName" label="姓名" header-align="center" align="center"></el-table-column>
<el-table-column prop="sex" label="性别" header-align="center" align="center" :formatter="showFlagFormat"></el-table-column>
<el-table-column prop="mobile" label="联系电话" header-align="center" align="center"></el-table-column>
<el-table-column prop="identityNo" label="身份证号" header-align="center" align="center"></el-table-column>
<el-table-column prop="allDeptNames" label="所属网格" header-align="center" align="center"></el-table-column>Id
<el-table-column prop="dutyCategoryId" label="网格员类型" header-align="center" align="center" :formatter = "dutyCategoryFormat"></el-table-column>
<el-table-column prop="workUnit" label="工作单位" header-align="center" align="center"></el-table-column>
<el-table-column prop="sort" label="显示排序" header-align="center" align="center"></el-table-column>
<el-table-column prop="remark" label="备注" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="200">
<template slot-scope="scope">
<el-button v-if="$hasPermission('custom:gridoperatorinfo:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('custom:gridoperatorinfo:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
<el-button type="text" size="small" @click="gridOperatorDetailHandle(scope.row.id)">查看</el-button>
<el-switch
v-model="scope.row.showFlag"
active-color="#36c6d3"
active-value="1"
inactive-value="0"
@change="active_text($event, scope.row)"
></el-switch>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<gridoperatorinfo-detail v-if="gridOperatorInfoDetailStatus" ref="gridoperatorinfoDetail" @refreshDataList="getDataList"></gridoperatorinfo-detail>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './gridoperatorinfo-add-or-update'
import GridoperatorinfoDetail from './gridoperatorinfo-detail'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/custom/gridoperatorinfo/page',
getDataListIsPage: true,
deleteURL: '/custom/gridoperatorinfo',
deleteIsBatch: true
},
dataForm: {
id: ''
},
ids: [],
options: [],
gridOperatorInfoDetailStatus: false,
dutyCategorys: []
}
},
components: {
AddOrUpdate,
GridoperatorinfoDetail
},
created: function () {
this.getOptions()
this.getListCategory()
},
watch: {
'ids': function (val) {
if (val.length === 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 1) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 2) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = ''
}
if (val.length === 3) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = this.ids[2]
}
}
},
methods: {
getOptions () {
this.$http.get(`/sys/dept/party/getDeptTreeForEpiDemic`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
}).catch(() => {})
},
showFlagFormat (row, column) {
if (row.sex === '0') {
return '女'
} else {
return '男'
}
},
gridOperatorDetailHandle (id) {
this.gridOperatorInfoDetailStatus = true
this.$nextTick(() => {
this.$refs.gridoperatorinfoDetail.dataForm.id = id
this.$refs.gridoperatorinfoDetail.init()
})
},
active_text (value, row) {
this.$http.post(`/custom/gridoperatorinfo/changeShowFlag`, row).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
}).catch(() => {})
},
getListCategory () {
this.$http.get(`/custom/gridoperatordutycategory/getAllDutyCat`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dutyCategorys = res.data
}).catch(() => { })
},
dutyCategoryFormat (row) {
let choosenItem = this.dutyCategorys.filter(item => item.id === row.dutyCategoryId)[0]
if (choosenItem !== undefined) {
return choosenItem.dutyCategoryName
}
}
}
}
</script>
Loading…
Cancel
Save