Browse Source

【联户结亲】-【修改部门信息】-(王童)-2021/7/22

master
Jackwang 4 years ago
parent
commit
e9da5e93a4
  1. 2
      src/views/modules/workRecord/group-user.vue
  2. 44
      src/views/modules/workRecord/groupfamily-add.vue
  3. 20
      src/views/modules/workRecord/helpgroupDetail.vue

2
src/views/modules/workRecord/group-user.vue

@ -161,6 +161,7 @@
{groupId:this.dataForm.groupId,userList:this.responseData}).then(({ data: res }) => { {groupId:this.dataForm.groupId,userList:this.responseData}).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
this.isAble = false this.isAble = false
this.$refs['dataForm'].resetFields()
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.$message({ this.$message({
@ -168,6 +169,7 @@
type: 'success', type: 'success',
duration: 500, duration: 500,
onClose: () => { onClose: () => {
this.$refs['dataForm'].resetFields()
this.backToGroupList() this.backToGroupList()
} }
}) })

44
src/views/modules/workRecord/groupfamily-add.vue

@ -1,5 +1,5 @@
<template> <template>
<el-dialog :visible.sync="visible" :title=" $t('add') " :close-on-click-modal="false" :close-on-press-escape="false"> <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 :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<el-form-item label="姓名" prop="name"> <el-form-item label="姓名" prop="name">
<el-input v-model="dataForm.name" placeholder="姓名"></el-input> <el-input v-model="dataForm.name" placeholder="姓名"></el-input>
@ -37,11 +37,12 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="所属机构" > <el-form-item label="所属网格" prop="ids">
<el-cascader <el-cascader
v-model="ids" v-model="dataForm.ids"
:options="options" :options="options"
clearable clearable
@change="changeHandle"
style="width:250px;" style="width:250px;"
> >
</el-cascader> </el-cascader>
@ -109,9 +110,11 @@ export default {
updatedTime: '', updatedTime: '',
streetId: '', streetId: '',
communityId: '', communityId: '',
gridId: '' gridId: '',
ids:[]
}, },
ids:[], ids:[],
adminIds:[],
options: [], options: [],
pairingReason:[], pairingReason:[],
sexList: [ sexList: [
@ -123,6 +126,9 @@ export default {
computed: { computed: {
dataRule () { dataRule () {
return { return {
ids: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
name: [ name: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
@ -207,6 +213,28 @@ export default {
} }
}, },
methods: { methods: {
changeHandle(value){
if (value.length === 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (value.length === 1) {
this.dataForm.streetId = this.dataForm.ids[0]
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (value.length === 2) {
this.dataForm.streetId = this.dataForm.ids[0]
this.dataForm.communityId = this.dataForm.ids[1]
this.dataForm.gridId = ''
}
if (value.length === 3) {
this.dataForm.streetId = this.dataForm.ids[0]
this.dataForm.communityId = this.dataForm.ids[1]
this.dataForm.gridId = this.dataForm.ids[2]
}
},
// //
getOptions() { getOptions() {
this.$http this.$http
@ -255,6 +283,10 @@ export default {
} }
this.$http['post']('/workRecord/familyinfoacquisition/addFamilyInfo', this.dataForm).then(({ data: res }) => { this.$http['post']('/workRecord/familyinfoacquisition/addFamilyInfo', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
this.dataForm.deptInfo=''
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.$message({ this.$message({
@ -262,8 +294,8 @@ export default {
type: 'success', type: 'success',
duration: 500, duration: 500,
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refreshDataList') this.$emit('refreshDataList')
} }
}) })
}).catch(() => {}) }).catch(() => {})

20
src/views/modules/workRecord/helpgroupDetail.vue

@ -19,9 +19,10 @@
<el-table-column prop="telPhone" label="手机号" header-align="center" align="center" width="160" <el-table-column prop="telPhone" label="手机号" header-align="center" align="center" width="160"
show-overflow-tooltip></el-table-column> show-overflow-tooltip></el-table-column>
<el-table-column prop="pairingReasonsName" label="结对原因" header-align="center" align="center" show-overflow-tooltip width="160"></el-table-column> <el-table-column prop="pairingReasonsName" label="结对原因" header-align="center" align="center" show-overflow-tooltip width="160"></el-table-column>
<el-table-column prop="allDeptNames" label="所属部门" header-align="center" align="center" show-overflow-tooltip width="305"></el-table-column> <el-table-column prop="allDeptNames" label="所属网格" header-align="center" align="center" show-overflow-tooltip width="305"></el-table-column>
<el-table-column :label="$t('handle')" header-align="center" align="center" width="150"> <el-table-column :label="$t('handle')" header-align="center" align="center" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="updateFamily(scope.row.id)">{{ $t('修改') }}</el-button>
<el-button type="text" size="small" @click="deleteGroupFamily(scope.row.familyGroupId)">{{ $t('delete') }}</el-button> <el-button type="text" size="small" @click="deleteGroupFamily(scope.row.familyGroupId)">{{ $t('delete') }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -60,13 +61,13 @@
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> <el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template> </template>
<groupfamily-add v-if="familyAddVisible" ref="groupfamilyAdd" @refreshDataList="init"></groupfamily-add>
</div> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import debounce from 'lodash/debounce' import GroupfamilyAdd from './groupfamily-add'
import Cookies from 'js-cookie'
export default { export default {
data () { data () {
return { return {
@ -77,15 +78,18 @@
familyList:[] familyList:[]
}, },
familyListLoading: false, familyListLoading: false,
userListLoading: false userListLoading: false,
familyAddVisible:false
} }
}, },
computed: { computed: {
}, },
components: { components: {
GroupfamilyAdd
}, },
created: function () { created: function () {
this.init()
}, },
mounted () { mounted () {
if (this.$route.query.id !== '' && this.$route.query.id != null) { if (this.$route.query.id !== '' && this.$route.query.id != null) {
@ -94,6 +98,14 @@
} }
}, },
methods: { methods: {
//
updateFamily(id) {
this.familyAddVisible = true
this.$nextTick(() => {
this.$refs.groupfamilyAdd.dataForm.id = id
this.$refs.groupfamilyAdd.init()
})
},
// //
deleteGroupFamily (id) { deleteGroupFamily (id) {
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('delete') }), this.$t('prompt.title'), { this.$confirm(this.$t('prompt.info', { 'handle': this.$t('delete') }), this.$t('prompt.title'), {

Loading…
Cancel
Save