Browse Source

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

master
Jackwang 4 years ago
parent
commit
e9da5e93a4
  1. 2
      src/views/modules/workRecord/group-user.vue
  2. 40
      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 }) => {
if (res.code !== 0) {
this.isAble = false
this.$refs['dataForm'].resetFields()
return this.$message.error(res.msg)
}
this.$message({
@ -168,6 +169,7 @@
type: 'success',
duration: 500,
onClose: () => {
this.$refs['dataForm'].resetFields()
this.backToGroupList()
}
})

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

@ -1,5 +1,5 @@
<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-item label="姓名" prop="name">
<el-input v-model="dataForm.name" placeholder="姓名"></el-input>
@ -37,11 +37,12 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属机构" >
<el-form-item label="所属网格" prop="ids">
<el-cascader
v-model="ids"
v-model="dataForm.ids"
:options="options"
clearable
@change="changeHandle"
style="width:250px;"
>
</el-cascader>
@ -109,9 +110,11 @@ export default {
updatedTime: '',
streetId: '',
communityId: '',
gridId: ''
gridId: '',
ids:[]
},
ids:[],
adminIds:[],
options: [],
pairingReason:[],
sexList: [
@ -123,6 +126,9 @@ export default {
computed: {
dataRule () {
return {
ids: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
name: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
@ -207,6 +213,28 @@ export default {
}
},
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() {
this.$http
@ -255,6 +283,10 @@ export default {
}
this.$http['post']('/workRecord/familyinfoacquisition/addFamilyInfo', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
this.dataForm.deptInfo=''
return this.$message.error(res.msg)
}
this.$message({

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

@ -19,9 +19,10 @@
<el-table-column prop="telPhone" label="手机号" header-align="center" align="center" width="160"
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="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">
<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>
</template>
</el-table-column>
@ -60,13 +61,13 @@
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
<groupfamily-add v-if="familyAddVisible" ref="groupfamilyAdd" @refreshDataList="init"></groupfamily-add>
</div>
</el-card>
</template>
<script>
import debounce from 'lodash/debounce'
import Cookies from 'js-cookie'
import GroupfamilyAdd from './groupfamily-add'
export default {
data () {
return {
@ -77,15 +78,18 @@
familyList:[]
},
familyListLoading: false,
userListLoading: false
userListLoading: false,
familyAddVisible:false
}
},
computed: {
},
components: {
GroupfamilyAdd
},
created: function () {
this.init()
},
mounted () {
if (this.$route.query.id !== '' && this.$route.query.id != null) {
@ -94,6 +98,14 @@
}
},
methods: {
//
updateFamily(id) {
this.familyAddVisible = true
this.$nextTick(() => {
this.$refs.groupfamilyAdd.dataForm.id = id
this.$refs.groupfamilyAdd.init()
})
},
//
deleteGroupFamily (id) {
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('delete') }), this.$t('prompt.title'), {

Loading…
Cancel
Save