Browse Source

审核页面

master
zhangyuan 3 years ago
parent
commit
60a4819bf4
  1. 185
      src/views/modules/epidemic/epidemicuserinfoaudit-add-or-update.vue
  2. 118
      src/views/modules/epidemic/epidemicuserinfoaudit.vue

185
src/views/modules/epidemic/epidemicuserinfoaudit-add-or-update.vue

@ -0,0 +1,185 @@
<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' ? '140px' : '100px'">
<el-form-item label="姓名" prop="userName">
<el-input disabled v-model="dataForm.userName" placeholder="姓名"></el-input>
</el-form-item>
<el-form-item label="身份证号" prop="idCard">
<el-input disabled v-model="dataForm.idCard" placeholder="身份证号"></el-input>
</el-form-item>
<el-form-item label="性别"
prop="gender">
<el-select v-model="dataForm.gender"
placeholder="性别"
disabled
clearable>
<el-option v-for="item in options"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="联系电话" prop="mobile">
<el-input disabled v-model="dataForm.mobile" placeholder="手机号或座机号"></el-input>
</el-form-item>
<el-form-item label="民族" prop="nation">
<el-input disabled v-model="dataForm.nation" placeholder="民族"></el-input>
</el-form-item>
<el-form-item label="户籍地名称" prop="householdRegisterName">
<el-input disabled v-model="dataForm.householdRegisterName" placeholder="户籍地名称"></el-input>
</el-form-item>
<el-form-item label="详细地址" prop="householdRegisterDetail">
<el-input disabled v-model="dataForm.householdRegisterDetail" placeholder="户籍地详细地址"></el-input>
</el-form-item>
<el-form-item label="与户主关系" prop="relation">
<el-input disabled v-model="dataForm.relation" placeholder="与户主关系"></el-input>
</el-form-item>
<el-form-item label="年龄" prop="age">
<el-input disabled v-model="dataForm.age" placeholder="年龄"></el-input>
</el-form-item>
<el-form-item label="现居住地名称" prop="outLiveAddressName">
<el-input disabled v-model="dataForm.outLiveAddressName" placeholder="现居住地名称"></el-input>
</el-form-item>
<el-form-item label="详细地址" prop="outLiveAddressDetail">
<el-input disabled v-model="dataForm.outLiveAddressDetail" placeholder="现居住地详细地址"></el-input>
</el-form-item>
<el-form-item label="审核原因" prop="auditReason">
<el-input type="textarea" v-model="dataForm.auditReason" placeholder="审核原因"></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" v-if="dataForm.auditState === '0'" @click="beforeSubmit('2')">审核不通过</el-button>
<el-button type="primary" v-if="dataForm.auditState === '0'" @click="beforeSubmit('4')">审核通过</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
export default {
data () {
return {
visible: false,
options: [
{ dictValue: '1', dictName: '男' },
{ dictValue: '0', dictName: '女' }
],
dataForm: {
id: '',
userName: '',
idCard: '',
householdRegisterCode: '',
householdRegisterName: '',
householdRegisterDetail: '',
revision: '',
createdBy: '',
createdTime: '',
updatedBy: '',
updatedTime: '',
delFlag: '',
gender: '',
nation: '',
relation: '',
age: '',
liveAddressCode: '',
liveAddressName: '',
community: '',
gridName: '',
mobile: '',
deptId: '',
deptName: '',
parentDeptIds: '',
parentDeptNames: '',
allDeptIds: '',
allDeptNames: '',
plot: '',
buildingNo: '',
unit: '',
roomNo: '',
outLiveAddressDetail: '',
outLiveAddressCode: '',
outLiveAddressName: '',
userId: '',
recordId: '',
unitId: '',
auditType: '',
auditState: '',
auditReason: ''
}
}
},
computed: {
dataRule () {
return {
auditType: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
auditState: [
{ 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/epidemicuserinfoaudit/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {})
},
beforeSubmit (state) {
if (state === '2') {
if(this.dataForm.auditReason.length === 0){
this.$message({
message: '请填写审核原因',
type:'warning'
})
return false
}
}
this.dataForm.auditState = state
this.dataFormSubmitHandle()
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http.post('/custom/epidemicuserinfoaudit/audit', 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>

118
src/views/modules/epidemic/epidemicuserinfoaudit.vue

@ -0,0 +1,118 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-epidemic__epidemicuserinfoaudit}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label="姓名"
prop="username">
<el-input v-model="dataForm.userName"
placeholder="姓名"
clearable
maxlength="49"
@keyup.native="btKeyUpUsername"></el-input>
</el-form-item>
<el-form-item label="身份证"
prop="idCard"
label-width="90px">
<el-input v-model="dataForm.idCard"
placeholder="身份证"
clearable
maxlength="49"
@keyup.native="btKeyUpIdCard"
style="width:200px"></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('epidemic:epidemicuserinfoaudit:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</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="userName" label="姓名" header-align="center" width="80" align="center"></el-table-column>
<el-table-column prop="idCard" label="身份证号" header-align="center" width="180" align="center"></el-table-column>
<el-table-column prop="gender" label="性别" header-align="center" width="50" align="center">
<template slot-scope="scope">
{{
scope.row.gender === '0'
? "女"
: scope.row.gender === '1'
? "男"
: ""
}}
</template>
</el-table-column>
<el-table-column prop="mobile" label="联系电话" header-align="center" width="180" align="center"></el-table-column>
<el-table-column prop="auditType" label="操作类型" header-align="center" width="100" align="center">
<template slot-scope="scope">
{{
scope.row.auditType === '0'
? "新增"
: scope.row.auditType === '1'
? "修改"
: ""
}}
</template>
</el-table-column>
<el-table-column prop="auditState" label="审核状态" header-align="center" width="120" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.auditState === '0'" size="small" type="warning">{{ '待审核' }}</el-tag>
<el-tag v-if="scope.row.auditState === '2'" size="small" type="danger">{{ '审核不通过' }}</el-tag>
<el-tag v-if="scope.row.auditState === '4'" size="small" type="success">{{ '审核通过' }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="auditReason" 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 type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">审核</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 './epidemicuserinfoaudit-add-or-update'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/custom/epidemicuserinfoaudit/page',
getDataListIsPage: true,
deleteURL: '/custom/epidemicuserinfoaudit',
deleteIsBatch: true
},
dataForm: {
id: ''
}
}
},
components: {
AddOrUpdate
},
methods: {
btKeyUpUsername (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.username = e.target.value
},
btKeyUpIdCard (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.idCard = e.target.value
},
}
}
</script>
Loading…
Cancel
Save