无等级网格版合并
This commit is contained in:
		| @@ -1,27 +1,7 @@ | ||||
| <template> | ||||
|   <ai-list class="AppGridMember" v-if="!isShowDetail"> | ||||
|     <template slot="title"> | ||||
|       <ai-title title="网格员管理" :isShowBottomBorder="false"></ai-title> | ||||
|     </template> | ||||
|     <template slot="tabs"> | ||||
|       <el-tabs v-model="currIndex"> | ||||
|         <el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label"> | ||||
|           <component :ref="String(i)" v-if="currIndex == i" :is="tab.comp" @change="onChange" lazy :instance="instance" | ||||
|                      :dict="dict" :permissions="permissions"/> | ||||
|         </el-tab-pane> | ||||
|       </el-tabs> | ||||
|     </template> | ||||
|   </ai-list> | ||||
|   <Add v-else-if="component === 'Add'" :params="params" :instance="instance" :dict="dict" :permissions="permissions" | ||||
|        @change="onChange"></Add> | ||||
|   <Family v-else-if="component === 'Family'" :params="params" :instance="instance" :dict="dict" | ||||
|           :permissions="permissions" @change="onChange"></Family> | ||||
|   <MonitorUser v-else-if="component === 'MonitorUser'" :params="params" :instance="instance" :dict="dict" | ||||
|                :permissions="permissions" @change="onChange"></MonitorUser> | ||||
|   <ApplyDetail v-else-if="component === 'ApplyDetail'" :params="params" :instance="instance" :dict="dict" | ||||
|                :permissions="permissions" @change="onChange"></ApplyDetail> | ||||
|   <ApplyAdd v-else-if="component === 'ApplyAdd'" :params="params" :instance="instance" :dict="dict" | ||||
|             :permissions="permissions" @change="onChange"></ApplyAdd> | ||||
|   <keep-alive include="GmList"> | ||||
|     <component :is="currentPage" v-bind="$props" @change="onChange"/> | ||||
|   </keep-alive> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| @@ -32,39 +12,29 @@ import ApplyDetail from './components/ApplyDetail' | ||||
| import ApplyAdd from './components/ApplyAdd' | ||||
| import Family from './components/Family' | ||||
| import MonitorUser from './components/MonitorUser' | ||||
| import GmList from "./components/gmList"; | ||||
|  | ||||
| export default { | ||||
|   name: "AppGridMember", | ||||
|   label: "网格管理员", | ||||
|  | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     dict: Object, | ||||
|     permissions: Function | ||||
|   }, | ||||
|  | ||||
|   data() { | ||||
|     return { | ||||
|       component: "List", | ||||
|       params: {}, | ||||
|       include: [], | ||||
|       currIndex: '0', | ||||
|       isShowDetail: false | ||||
|     }; | ||||
|   }, | ||||
|  | ||||
|   computed: { | ||||
|     tabs() { | ||||
|       return [ | ||||
|         {label: '网格员信息', name: 'List', comp: List, permission: ''}, | ||||
|         {label: '申报信息', name: 'ApplyList', comp: ApplyList, permission: 'app_appgirdmemberapply_detail'} | ||||
|       ].filter(item => { | ||||
|         return item.name !== 'ApplyList' || this.permissions(item.permission) | ||||
|       }) | ||||
|     currentPage() { | ||||
|       let {hash} = this.$route | ||||
|       return hash == "#Family" ? Family : | ||||
|           hash == "#MonitorUser" ? MonitorUser : | ||||
|               hash == "#Add" ? Add : | ||||
|                   hash == "#ApplyAdd" ? ApplyAdd : | ||||
|                       hash == "#ApplyDetail" ? ApplyDetail : | ||||
|                           GmList | ||||
|     } | ||||
|   }, | ||||
|  | ||||
|   components: { | ||||
|     GmList, | ||||
|     Add, | ||||
|     List, | ||||
|     Family, | ||||
| @@ -76,46 +46,9 @@ export default { | ||||
|  | ||||
|   methods: { | ||||
|     onChange(data) { | ||||
|       if (data.type === "Add") { | ||||
|         this.component = "Add" | ||||
|         this.isShowDetail = true | ||||
|         this.params = data.params | ||||
|       } | ||||
|  | ||||
|       if (data.type === "Family") { | ||||
|         this.component = "Family" | ||||
|         this.isShowDetail = true | ||||
|         this.params = data.params | ||||
|       } | ||||
|  | ||||
|       if (data.type === "MonitorUser") { | ||||
|         this.component = "MonitorUser" | ||||
|         this.isShowDetail = true | ||||
|         this.params = data.params | ||||
|       } | ||||
|       if (data.type === "ApplyDetail") { | ||||
|         this.component = "ApplyDetail" | ||||
|         this.isShowDetail = true | ||||
|         this.params = data.params | ||||
|       } | ||||
|  | ||||
|       if (data.type === "ApplyAdd") { | ||||
|         this.component = "ApplyAdd" | ||||
|         this.isShowDetail = true | ||||
|         this.params = data.params | ||||
|       } | ||||
|  | ||||
|       if (data.type === "list") { | ||||
|         this.component = "List" | ||||
|         this.isShowDetail = false | ||||
|         this.params = data.params | ||||
|       } | ||||
|  | ||||
|       if (data.type === "ApplyList") { | ||||
|         this.component = "ApplyList" | ||||
|         this.isShowDetail = false | ||||
|         this.params = data.params | ||||
|       } | ||||
|       let {type, params: query} = data, | ||||
|           hash = ["ApplyList", "list"].includes(type) ? "" : "#" + type | ||||
|       this.$router.push({hash, query}) | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| <template> | ||||
|   <ai-detail class="content-add"> | ||||
|     <template slot="title"> | ||||
|       <ai-title :title="params.id ? '编辑' : '添加'" isShowBack isShowBottomBorder @onBackClick="cancel(false)"> | ||||
|       <ai-title :title="$route.query.id ? '编辑' : '添加'" isShowBack isShowBottomBorder @onBackClick="cancel(false)"> | ||||
|       </ai-title> | ||||
|     </template> | ||||
|     <template slot="content"> | ||||
| @@ -35,7 +35,6 @@ | ||||
|     props: { | ||||
|       instance: Function, | ||||
|       dict: Object, | ||||
|       params: Object | ||||
|     }, | ||||
|  | ||||
|     data () { | ||||
| @@ -51,9 +50,9 @@ | ||||
|     }, | ||||
|  | ||||
|     created () { | ||||
|       if (this.params && this.params.id) { | ||||
|         this.id = this.params.id | ||||
|         this.getInfo(this.params.id) | ||||
|       if ( this.$route.query.id) { | ||||
|         this.id = this.$route.query.id | ||||
|         this.getInfo(this.$route.query.id) | ||||
|       } | ||||
|     }, | ||||
|  | ||||
| @@ -76,7 +75,7 @@ | ||||
|             this.isLoading = true | ||||
|             this.instance.post(`/app/appgirdmemberapply/addOrUpdate`, { | ||||
|               ...this.form, | ||||
|               id: this.params.id || '' | ||||
|               id: this.$route.query.id || '' | ||||
|             }).then(res => { | ||||
|               if (res.code == 0) { | ||||
|                 this.$message.success('提交成功') | ||||
|   | ||||
| @@ -19,46 +19,45 @@ | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
|   export default { | ||||
|     name: 'ApplyDetail', | ||||
| export default { | ||||
|   name: 'ApplyDetail', | ||||
|  | ||||
|     props: { | ||||
|       instance: Function, | ||||
|       dict: Object, | ||||
|       params: Object | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     dict: Object, | ||||
|   }, | ||||
|  | ||||
|   data() { | ||||
|     return { | ||||
|       info: {}, | ||||
|       id: '' | ||||
|     } | ||||
|   }, | ||||
|  | ||||
|   created() { | ||||
|     if (this.$route.query.id) { | ||||
|       this.id = this.$route.query.id | ||||
|       this.getInfo(this.$route.query.id) | ||||
|     } | ||||
|   }, | ||||
|  | ||||
|   methods: { | ||||
|     getInfo(id) { | ||||
|       this.instance.post(`/app/appgirdmemberapply/queryDetailById?id=${id}`).then(res => { | ||||
|         if (res.code === 0) { | ||||
|           this.info = res.data | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     data () { | ||||
|       return { | ||||
|         info: {}, | ||||
|         id: '' | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     created () { | ||||
|       if (this.params && this.params.id) { | ||||
|         this.id = this.params.id | ||||
|         this.getInfo(this.params.id) | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       getInfo (id) { | ||||
|         this.instance.post(`/app/appgirdmemberapply/queryDetailById?id=${id}`).then(res => { | ||||
|           if (res.code === 0) { | ||||
|             this.info = res.data | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       cancel (isRefresh) { | ||||
|         this.$emit('change', { | ||||
|           type: 'ApplyList', | ||||
|           isRefresh: !!isRefresh | ||||
|         }) | ||||
|       } | ||||
|     cancel(isRefresh) { | ||||
|       this.$emit('change', { | ||||
|         type: 'ApplyList', | ||||
|         isRefresh: !!isRefresh | ||||
|       }) | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </script> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
|   | ||||
| @@ -144,18 +144,14 @@ | ||||
|       add (id) { | ||||
|         this.$emit('change', { | ||||
|           type: 'ApplyAdd', | ||||
|           params: { | ||||
|             id: id || '' | ||||
|           } | ||||
|           params: {id} | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       toDetail (id) { | ||||
|         this.$emit('change', { | ||||
|           type: 'ApplyDetail', | ||||
|           params: { | ||||
|             id | ||||
|           } | ||||
|           params: {id} | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
| @@ -176,4 +172,4 @@ | ||||
| </script> | ||||
|  | ||||
| <style lang="scss" scoped> | ||||
| </style> | ||||
| </style> | ||||
|   | ||||
| @@ -64,8 +64,8 @@ | ||||
|             </el-select> | ||||
|           </el-form-item> | ||||
|           <el-form-item> | ||||
|             <ai-table-select :instance="instance" :action="`/app/appresident/list?householdName=1&areaId=${areaId}&auditStatus=1`" | ||||
|                               @select="v=>chooseUser=v" multiple/> | ||||
|             <ai-table-select :instance="instance" :action="`/app/appresident/list?householdName=1&areaId=${areaId||''}&auditStatus=1`" | ||||
|                              @select="v=>chooseUser=v" multiple/> | ||||
|           </el-form-item> | ||||
|         </el-form> | ||||
|       </ai-dialog> | ||||
| @@ -81,7 +81,6 @@ export default { | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     dict: Object, | ||||
|     params: Object | ||||
|   }, | ||||
|  | ||||
|   data() { | ||||
| @@ -94,8 +93,6 @@ export default { | ||||
|       }, | ||||
|       isLoading: false, | ||||
|       form: {}, | ||||
|       userList: [], | ||||
|       name: '', | ||||
|       chooseUser: [], | ||||
|       dialog: false, | ||||
|       total: 10, | ||||
| @@ -120,20 +117,16 @@ export default { | ||||
|   computed: { | ||||
|     ...mapState(['user']) | ||||
|   }, | ||||
|  | ||||
|   created() { | ||||
|     this.areaId = this.user.info.areaId | ||||
|     this.disabledLevel = this.user.info.areaList.length | ||||
|     this.dict.load('epidemicDangerousAreaLevel').then(() => { | ||||
|       this.getGirdList() | ||||
|       this.getList() | ||||
|       this.getUserList() | ||||
|     }) | ||||
|     this.areaId = this.user.info.areaId || "" | ||||
|     this.disabledLevel = this.user.info.areaList?.length || 0 | ||||
|     this.getGirdList() | ||||
|     this.getList() | ||||
|     this.dict.load('epidemicDangerousAreaLevel') | ||||
|   }, | ||||
|  | ||||
|   methods: { | ||||
|     getGirdList() { | ||||
|       this.instance.post(`/app/appgirdmemberinfo/queryMyGirdListByLevel2?girdMemberId=${this.params.id}`).then(res => { | ||||
|       this.instance.post(`/app/appgirdmemberinfo/queryMyGirdListByLevel2?girdMemberId=${this.$route.query.id}`).then(res => { | ||||
|         if (res.code == 0) { | ||||
|           this.girdList = res.data | ||||
|         } | ||||
| @@ -147,7 +140,7 @@ export default { | ||||
|       this.instance.post(`/app/appgirdmemberresident/listByGirdMember`, null, { | ||||
|         params: { | ||||
|           ...this.search, | ||||
|           girdMemberId: this.params.id, | ||||
|           girdMemberId: this.$route.query.id, | ||||
|           areaId: this.areaId | ||||
|         } | ||||
|       }).then(res => { | ||||
| @@ -167,11 +160,6 @@ export default { | ||||
|     handleSelectionChange(e) { | ||||
|       this.ids = e.map(v => v.gmrId) | ||||
|     }, | ||||
|  | ||||
|     clearAll() { | ||||
|       this.chooseUser = [] | ||||
|     }, | ||||
|  | ||||
|     onConfirm() { | ||||
|       if (!this.girdId) { | ||||
|         return this.$message.error('请选择网格') | ||||
| @@ -183,7 +171,7 @@ export default { | ||||
|  | ||||
|       const residentList = this.chooseUser.map(v => { | ||||
|         return { | ||||
|           girdMemberId: this.params.id, | ||||
|           girdMemberId: this.$route.query.id, | ||||
|           name: v.name, | ||||
|           residentId: v.id, | ||||
|           girdId: this.girdId | ||||
| @@ -196,42 +184,18 @@ export default { | ||||
|           this.current = 1 | ||||
|           this.getList() | ||||
|           this.$message.success('添加成功') | ||||
|           this.closeDialog() | ||||
|           this.dialog = false | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     closeDialog() { | ||||
|       this.dialog = false | ||||
|       this.chooseUser = [] | ||||
|       this.girdId = '' | ||||
|       this.name = '' | ||||
|       this.areaId = this.user.info.areaId | ||||
|       this.getUserList() | ||||
|     }, | ||||
|  | ||||
|     del(e) { | ||||
|       this.chooseUser.splice(this.chooseUser.indexOf(e), 1) | ||||
|     }, | ||||
|  | ||||
|     getUserList() { | ||||
|       this.isLoading = true | ||||
|       this.instance.post(`/app/appresident/list`, null, { | ||||
|         params: { | ||||
|           current: 1, | ||||
|           size: 200, | ||||
|           con: this.name, | ||||
|           householdName: 1, | ||||
|           areaId: this.areaId, | ||||
|         } | ||||
|       }).then(res => { | ||||
|         if (res.code == 0) { | ||||
|           this.userList = res.data.records | ||||
|         } | ||||
|  | ||||
|         this.isLoading = false | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     onBack() { | ||||
|       this.$emit('change', { | ||||
|         type: 'list' | ||||
|   | ||||
| @@ -83,7 +83,6 @@ export default { | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     dict: Object, | ||||
|     params: Object | ||||
|   }, | ||||
|  | ||||
|   data() { | ||||
| @@ -94,9 +93,7 @@ export default { | ||||
|         name: '', | ||||
|         girdId: '' | ||||
|       }, | ||||
|       isLoading: false, | ||||
|       form: {}, | ||||
|       userList: [], | ||||
|       name: '', | ||||
|       chooseUser: [], | ||||
|       isShow: false, | ||||
| @@ -129,13 +126,12 @@ export default { | ||||
|     this.dict.load('epidemicDangerousAreaLevel').then(() => { | ||||
|       this.getGirdList() | ||||
|       this.getList() | ||||
|       this.getUserList() | ||||
|     }) | ||||
|   }, | ||||
|  | ||||
|   methods: { | ||||
|     getGirdList() { | ||||
|       this.instance.post(`/app/appgirdmemberinfo/queryMyGirdListByLevel2?girdMemberId=${this.params.id}`).then(res => { | ||||
|       this.instance.post(`/app/appgirdmemberinfo/queryMyGirdListByLevel2?girdMemberId=${this.$route.query.id}`).then(res => { | ||||
|         if (res.code == 0) { | ||||
|           this.girdList = res.data | ||||
|         } | ||||
| @@ -149,7 +145,7 @@ export default { | ||||
|       this.instance.post(`/app/appgirdmemberpoverty/listByGirdMemberByWeb`, null, { | ||||
|         params: { | ||||
|           ...this.search, | ||||
|           girdMemberId: this.params.id, | ||||
|           girdMemberId: this.$route.query.id, | ||||
|         } | ||||
|       }).then(res => { | ||||
|         if (res.code == 0) { | ||||
| @@ -168,11 +164,6 @@ export default { | ||||
|     handleSelectionChange(e) { | ||||
|       this.ids = e.map(v => v.gmpId) | ||||
|     }, | ||||
|  | ||||
|     clearAll() { | ||||
|       this.chooseUser = [] | ||||
|     }, | ||||
|  | ||||
|     onConfirm() { | ||||
|       if (!this.girdId) { | ||||
|         return this.$message.error('请选择网格') | ||||
| @@ -184,7 +175,7 @@ export default { | ||||
|  | ||||
|       const povertyList = this.chooseUser.map(v => { | ||||
|         return { | ||||
|           girdMemberId: this.params.id, | ||||
|           girdMemberId: this.$route.query.id, | ||||
|           name: v.split('~')[0], | ||||
|           girdId: this.girdId, | ||||
|           povertyId: v.split('~')[1] | ||||
| @@ -207,38 +198,12 @@ export default { | ||||
|       this.girdId = '' | ||||
|       this.name = '' | ||||
|       this.areaId = this.user.info.areaId | ||||
|       this.getUserList() | ||||
|     }, | ||||
|  | ||||
|     del(e) { | ||||
|       this.chooseUser.splice(this.chooseUser.indexOf(e), 1) | ||||
|     }, | ||||
|  | ||||
|     getUserList() { | ||||
|       this.isLoading = true | ||||
|       this.instance.post(`/app/apppreventionreturntopoverty/list`, null, { | ||||
|         params: { | ||||
|           current: 1, | ||||
|           size: 200, | ||||
|           con: this.name, | ||||
|           isHousehold: 1, | ||||
|           areaId: this.areaId | ||||
|         } | ||||
|       }).then(res => { | ||||
|         if (res.code == 0) { | ||||
|           this.userList = res.data.records | ||||
|         } | ||||
|  | ||||
|         this.isLoading = false | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     onBack() { | ||||
|       this.$emit('change', { | ||||
|         type: 'list' | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     remove(ids) { | ||||
|       this.$confirm('确定删除该数据?').then(() => { | ||||
|         this.instance.post(`/app/appgirdmemberpoverty/delete`, null, { | ||||
|   | ||||
| @@ -6,22 +6,23 @@ | ||||
|       </template> | ||||
|       <template #content> | ||||
|         <el-form | ||||
|           ref="rules" | ||||
|           :model="forms" | ||||
|           :rules="formRules" | ||||
|           size="small" | ||||
|           label-suffix=":" | ||||
|           label-width="136px"> | ||||
|           <ai-card title="基础信息" > | ||||
|             <template #right  v-if="title=='网格员详情'"> | ||||
|             ref="rules" | ||||
|             :model="forms" | ||||
|             :rules="formRules" | ||||
|             size="small" | ||||
|             label-suffix=":" | ||||
|             label-width="136px"> | ||||
|           <ai-card title="基础信息"> | ||||
|             <template #right v-if="title=='网格员详情'"> | ||||
|               <span style="color:#2266FF;cursor: pointer;font-size: 12px;" class="iconfont iconEdit" v-if="editOne==false" @click="editOne=true">修改</span> | ||||
|               <span style="color:#2266FF;margin-left: 16px;cursor: pointer;font-size: 12px;" v-if="editOne==true" @click="searchDetail(),editOne=false">取消</span> | ||||
|               <span style="color:#2266FF;margin-left: 16px;cursor: pointer;font-size: 12px;" v-if="editOne==true" | ||||
|                     @click="searchDetail(),editOne=false">取消</span> | ||||
|               <span style="color:#2266FF;margin-left: 16px;cursor: pointer;font-size: 12px;" v-if="editOne==true" @click="save()">保存</span> | ||||
|             </template> | ||||
|             <template slot="content"> | ||||
|               <div class="above" v-if="editOne==true"> | ||||
|                 <div class="left"> | ||||
|                   <el-form-item label="网格员姓名" prop="name" > | ||||
|                   <el-form-item label="网格员姓名" prop="name"> | ||||
|                     <el-input v-model="forms.name" placeholder="请选择网格员" disabled> | ||||
|                       <template #append> | ||||
|                         <ai-wechat-selecter :isMultiple="false" refs="addTags" :instance="instance" v-model="users" @change="getSelectPerson"> | ||||
| @@ -30,30 +31,20 @@ | ||||
|                       </template> | ||||
|                     </el-input> | ||||
|                   </el-form-item> | ||||
|                   <el-form-item label="选用日期" prop="selectionDate" > | ||||
|                     <el-date-picker | ||||
|                       v-model="forms.selectionDate" | ||||
|                       type="date" | ||||
|                       style="width: 100%" | ||||
|                       value-format="yyyy-MM-dd" | ||||
|                       size="medium" | ||||
|                       placeholder="选择日期"> | ||||
|                     </el-date-picker> | ||||
|                   </el-form-item> | ||||
|                   <el-form-item label="身份证号" prop="idNumber" > | ||||
|                       <el-input v-model="forms.idNumber" placeholder="请输入…" maxlength="18" show-word-limit></el-input> | ||||
|                   <el-form-item label="身份证号" prop="idNumber"> | ||||
|                     <el-input v-model="forms.idNumber" placeholder="请输入…" maxlength="18" show-word-limit></el-input> | ||||
|                   </el-form-item> | ||||
|                 </div> | ||||
|                 <div class="right"> | ||||
|                   <el-form-item label="照片" prop="photo"> | ||||
|                     <!-- <ai-uploader :instance="instance" v-model="photoList" :limit="1" @change="photoChange"></ai-uploader> --> | ||||
|                     <ai-avatar :instance="instance"  v-model="forms.photo"/> | ||||
|                     <ai-avatar :instance="instance" v-model="forms.photo"/> | ||||
|                   </el-form-item> | ||||
|                 </div> | ||||
|               </div> | ||||
|               <div class="above" v-if="editOne==true"> | ||||
|                 <div class="left"> | ||||
|                   <el-form-item label="出生日期" prop="birthday" > | ||||
|                   <el-form-item label="出生日期" prop="birthday"> | ||||
|                     <el-date-picker | ||||
|                         v-model="forms.birthday" | ||||
|                         type="date" | ||||
| @@ -63,70 +54,71 @@ | ||||
|                         placeholder="选择日期"> | ||||
|                     </el-date-picker> | ||||
|                   </el-form-item> | ||||
|                   <el-form-item label="联系电话" prop="phone" > | ||||
|                   <el-form-item label="联系电话" prop="phone"> | ||||
|                     <el-input v-model.number="forms.phone" placeholder="请输入…" maxlength="11" show-word-limit></el-input> | ||||
|                   </el-form-item> | ||||
|                 </div> | ||||
|                 <div class="right"> | ||||
|                   <el-form-item label="性别" prop="sex" > | ||||
|                   <el-form-item label="性别" prop="sex"> | ||||
|                     <el-select size="medium" style="width: 100%" v-model="forms.sex" placeholder="请选择..." clearable> | ||||
|                       <el-option | ||||
|                         v-for="(item,i) in dict.getDict('sex')" | ||||
|                         :key="i" | ||||
|                         :label="item.dictName" | ||||
|                         :value="item.dictValue" | ||||
|                           v-for="(item,i) in dict.getDict('sex')" | ||||
|                           :key="i" | ||||
|                           :label="item.dictName" | ||||
|                           :value="item.dictValue" | ||||
|                       > | ||||
|                       </el-option> | ||||
|                     </el-select> | ||||
|                   </el-form-item> | ||||
|                   <el-form-item label="电子邮箱" prop="mail" > | ||||
|                       <el-input v-model="forms.mail" placeholder="请输入…"></el-input> | ||||
|                   <el-form-item label="电子邮箱" prop="mail"> | ||||
|                     <el-input v-model="forms.mail" placeholder="请输入…"></el-input> | ||||
|                   </el-form-item> | ||||
|                 </div> | ||||
|               </div> | ||||
|               <template  v-if="editOne==false"> | ||||
|               <template v-if="editOne==false"> | ||||
|                 <div class="above"> | ||||
|                   <div class="left"> | ||||
|                     <ai-wrapper label-width="120px"  :columnsNumber="1"  style="margin-top: 16px;"> | ||||
|                       <ai-info-item label="网格员姓名:"><span >{{forms.name}}</span></ai-info-item> | ||||
|                       <ai-info-item label="选用日期:"><span >{{forms.selectionDate}}</span></ai-info-item> | ||||
|                       <ai-info-item label="身份证号:"><span >{{forms.idNumber}}</span></ai-info-item> | ||||
|                       <ai-info-item label="性别:"><span >{{dict.getLabel('sex', forms.sex)}}</span></ai-info-item> | ||||
|                       <ai-info-item label="出生日期:"><span >{{forms.birthday}}</span></ai-info-item> | ||||
|                       <ai-info-item label="电子邮箱:"><span >{{forms.mail}}</span></ai-info-item> | ||||
|                     <ai-wrapper label-width="120px" :columnsNumber="1" style="margin-top: 16px;"> | ||||
|                       <ai-info-item label="网格员姓名:"><span>{{ forms.name }}</span></ai-info-item> | ||||
|                       <ai-info-item label="身份证号:"><span>{{ forms.idNumber }}</span></ai-info-item> | ||||
|                       <ai-info-item label="性别:"><span>{{ dict.getLabel('sex', forms.sex) }}</span></ai-info-item> | ||||
|                       <ai-info-item label="出生日期:"><span>{{ forms.birthday }}</span></ai-info-item> | ||||
|                       <ai-info-item label="电子邮箱:"><span>{{ forms.mail }}</span></ai-info-item> | ||||
|                     </ai-wrapper> | ||||
|                   </div> | ||||
|                   <div class="right"> | ||||
|                     <ai-wrapper label-width="120px"  :columnsNumber="1"  style="margin-top: 16px;"> | ||||
|                     <ai-wrapper label-width="120px" :columnsNumber="1" style="margin-top: 16px;"> | ||||
|                       <ai-info-item label="照片:" v-if="forms.photo"> | ||||
|                         <span > | ||||
|                         <span> | ||||
|                           <ai-uploader :instance="instance" v-model="photoList" disabled :limit="1" @change="photoChange"></ai-uploader> | ||||
|                         </span> | ||||
|                       </ai-info-item> | ||||
|                       <ai-info-item label="联系电话:"><span >{{forms.phone}}</span></ai-info-item> | ||||
|                       <ai-info-item label="联系电话:"><span>{{ forms.phone }}</span></ai-info-item> | ||||
|                     </ai-wrapper> | ||||
|                   </div> | ||||
|                 </div> | ||||
|               </template> | ||||
|             </template> | ||||
|           </ai-card> | ||||
|           <ai-card title="关联信息" > | ||||
|             <template #right  v-if="title=='网格员详情'"> | ||||
|           <ai-card title="关联信息"> | ||||
|             <template #right v-if="title=='网格员详情'"> | ||||
|               <span style="color:#2266FF;cursor: pointer;font-size: 12px;" class="iconfont iconEdit" v-if="editTwo==false" @click="editTwo=true">修改</span> | ||||
|               <span style="color:#2266FF;margin-left: 16px;cursor: pointer;font-size: 12px;" v-if="editTwo==true" @click="searchDetail(),editTwo=false">取消</span> | ||||
|               <span style="color:#2266FF;margin-left: 16px;cursor: pointer;font-size: 12px;" v-if="editTwo==true" | ||||
|                     @click="searchDetail(),editTwo=false">取消</span> | ||||
|               <span style="color:#2266FF;margin-left: 16px;cursor: pointer;font-size: 12px;" v-if="editTwo==true" @click="save()">保存</span> | ||||
|             </template> | ||||
|             <template slot="content"> | ||||
|               <template v-if="editTwo==true"> | ||||
|                 <el-form-item label="责任网格" prop="girdInfoList" style="margin-top: 8px;"> | ||||
|                   <el-form-item style="width: 100%" label-width="80px" :label="'网格' + (index + 1)" v-for="(item, index) in forms.girdInfoList" :key="'选项' + (index + 1)"> | ||||
|                   <el-form-item style="width: 100%" label-width="80px" :label="'网格' + (index + 1)" v-for="(item, index) in forms.girdInfoList" | ||||
|                                 :key="'选项' + (index + 1)"> | ||||
|                     <div class="form-flex"> | ||||
|                       <el-select v-model="item.checkType" placeholder="请选择网格角色"> | ||||
|                         <el-option | ||||
|                           v-for="item in options" | ||||
|                           :key="item.value" | ||||
|                           :label="item.label" | ||||
|                           :value="item.value"> | ||||
|                             v-for="item in options" | ||||
|                             :key="item.value" | ||||
|                             :label="item.label" | ||||
|                             :value="item.value"> | ||||
|                         </el-option> | ||||
|                       </el-select> | ||||
|                       <el-input disabled v-model="item.girdName" :maxlength="200" size="small" placeholder="请选择责任网格"> | ||||
| @@ -142,13 +134,13 @@ | ||||
|                 </el-form-item> | ||||
|                 <div class="above"> | ||||
|                   <div class="left"> | ||||
|                     <el-form-item label="是否特殊网格员" prop="isGirdMember" > | ||||
|                     <el-form-item label="是否特殊网格员" prop="isGirdMember"> | ||||
|                       <el-radio-group v-model="forms.isGirdMember"> | ||||
|                         <el-radio label="0">否</el-radio> | ||||
|                         <el-radio label="1">是</el-radio> | ||||
|                       </el-radio-group> | ||||
|                     </el-form-item> | ||||
|                     <el-form-item label="政治面貌" prop="politicsStatus" > | ||||
|                     <el-form-item label="政治面貌" prop="politicsStatus"> | ||||
|                       <el-select v-model="forms.politicsStatus" size="small" style="width: 100%" placeholder="请选择..." clearable> | ||||
|                         <el-option v-for="(item,i) in dict.getDict('politicsStatus')" :key="i" :label="item.dictName" :value="item.dictValue"></el-option> | ||||
|                       </el-select> | ||||
| @@ -160,31 +152,31 @@ | ||||
|                         <el-option v-for="(item,i) in dict.getDict('girdMemberType')" :key="i" :label="item.dictName" :value="item.dictValue"></el-option> | ||||
|                       </el-select> | ||||
|                     </el-form-item> | ||||
|                     <el-form-item label="学历" prop="education" > | ||||
|                     <el-form-item label="学历" prop="education"> | ||||
|                       <el-select v-model="forms.education" style="width: 100%" size="small" placeholder="请选择..." clearable> | ||||
|                         <el-option v-for="(item,i) in dict.getDict('education')" :key="i" :label="item.dictName" :value="item.dictValue"></el-option> | ||||
|                       </el-select> | ||||
|                     </el-form-item> | ||||
|                   </div> | ||||
|                 </div> | ||||
|                 <el-form-item label="个人简介" prop="introduction" > | ||||
|                 <el-form-item label="个人简介" prop="introduction"> | ||||
|                   <el-input | ||||
|                     type="textarea" | ||||
|                     maxlength="200" | ||||
|                     show-word-limit | ||||
|                     :rows="4" | ||||
|                     placeholder="请输入内容" | ||||
|                     v-model="forms.introduction"> | ||||
|                       type="textarea" | ||||
|                       maxlength="200" | ||||
|                       show-word-limit | ||||
|                       :rows="4" | ||||
|                       placeholder="请输入内容" | ||||
|                       v-model="forms.introduction"> | ||||
|                   </el-input> | ||||
|                 </el-form-item> | ||||
|                 <el-form-item label="人生格言" prop="motto" > | ||||
|                 <el-form-item label="人生格言" prop="motto"> | ||||
|                   <el-input | ||||
|                     type="textarea" | ||||
|                     maxlength="200" | ||||
|                     show-word-limit | ||||
|                     :rows="4" | ||||
|                     placeholder="请输入内容" | ||||
|                     v-model="forms.motto"> | ||||
|                       type="textarea" | ||||
|                       maxlength="200" | ||||
|                       show-word-limit | ||||
|                       :rows="4" | ||||
|                       placeholder="请输入内容" | ||||
|                       v-model="forms.motto"> | ||||
|                   </el-input> | ||||
|                 </el-form-item> | ||||
|               </template> | ||||
| @@ -194,39 +186,40 @@ | ||||
|                   <ai-info-item label="是否特殊网格员:"> | ||||
|                     <span>{{ !forms.isGirdMember ? '-' : forms.isGirdMember === '0' ? '否' : '是' }}</span> | ||||
|                   </ai-info-item> | ||||
|                   <ai-info-item label="特殊网格员:" v-if="forms.isGirdMember==1"><span >{{dict.getLabel('girdMemberType', forms.girdMemberType)}}</span></ai-info-item> | ||||
|                   <ai-info-item label="政治面貌:"><span >{{dict.getLabel('politicsStatus', forms.politicsStatus)}}</span></ai-info-item> | ||||
|                   <ai-info-item label="学历:"><span >{{dict.getLabel('education', forms.education)}}</span></ai-info-item> | ||||
|                   <ai-info-item label="人生格言:" style="width: 100%;"><span >{{forms.motto}}</span></ai-info-item> | ||||
|                   <ai-info-item label="个人简介:" style="width: 100%;"><span >{{forms.introduction}}</span></ai-info-item> | ||||
|                   <ai-info-item label="特殊网格员:" v-if="forms.isGirdMember==1"><span>{{ dict.getLabel('girdMemberType', forms.girdMemberType) }}</span> | ||||
|                   </ai-info-item> | ||||
|                   <ai-info-item label="政治面貌:"><span>{{ dict.getLabel('politicsStatus', forms.politicsStatus) }}</span></ai-info-item> | ||||
|                   <ai-info-item label="学历:"><span>{{ dict.getLabel('education', forms.education) }}</span></ai-info-item> | ||||
|                   <ai-info-item label="人生格言:" style="width: 100%;"><span>{{ forms.motto }}</span></ai-info-item> | ||||
|                   <ai-info-item label="个人简介:" style="width: 100%;"><span>{{ forms.introduction }}</span></ai-info-item> | ||||
|                 </ai-wrapper> | ||||
|               </template> | ||||
|             </template> | ||||
|           </ai-card> | ||||
|         </el-form> | ||||
|         <ai-dialog title="选择网格" :visible.sync="showGrid" :customFooter="true"  :destroyOnClose="true" border  width="720px"> | ||||
|         <ai-dialog title="选择网格" :visible.sync="showGrid" :customFooter="true" :destroyOnClose="true" border width="720px"> | ||||
|           <div class="grid"> | ||||
|             <el-tree | ||||
|               :data="treeObj.treeList" | ||||
|               :props="treeObj.defaultProps" | ||||
|               node-key="id" | ||||
|               ref="tree" | ||||
|               :check-strictly="true" | ||||
|               show-checkbox | ||||
|               :default-checked-keys="currCheckedKeys" | ||||
|               default-expand-all | ||||
|               @check="onCheckChange"> | ||||
|                 :data="treeObj.treeList" | ||||
|                 :props="treeObj.defaultProps" | ||||
|                 node-key="id" | ||||
|                 ref="tree" | ||||
|                 :check-strictly="true" | ||||
|                 show-checkbox | ||||
|                 :default-checked-keys="currCheckedKeys" | ||||
|                 default-expand-all | ||||
|                 @check="onCheckChange"> | ||||
|             </el-tree> | ||||
|           </div> | ||||
|           <div class="dialog-footer" slot="footer" > | ||||
|             <el-button  size="medium" @click="showGrid=false">取消</el-button> | ||||
|             <el-button  type="primary" size="medium" @click="getCheckedTree()">确认</el-button> | ||||
|           <div class="dialog-footer" slot="footer"> | ||||
|             <el-button size="medium" @click="showGrid=false">取消</el-button> | ||||
|             <el-button type="primary" size="medium" @click="getCheckedTree()">确认</el-button> | ||||
|           </div> | ||||
|         </ai-dialog> | ||||
|       </template> | ||||
|       <template #footer v-if="title=='添加网格员'"> | ||||
|         <el-button @click="cancel(false)" class="delete-btn footer-btn" >取 消</el-button> | ||||
|         <el-button type="primary" @click="save()"  class="footer-btn">提 交</el-button> | ||||
|         <el-button @click="cancel(false)" class="delete-btn footer-btn">取 消</el-button> | ||||
|         <el-button type="primary" @click="save()" class="footer-btn">提 交</el-button> | ||||
|       </template> | ||||
|     </ai-detail> | ||||
|   </section> | ||||
| @@ -239,7 +232,6 @@ export default { | ||||
|     instance: Function, | ||||
|     dict: Object, | ||||
|     permissions: Function, | ||||
|     params: Object, | ||||
|   }, | ||||
|   data() { | ||||
|     return { | ||||
| @@ -290,7 +282,7 @@ export default { | ||||
|   }, | ||||
|   created() { | ||||
|     this.beforeSelectTree() | ||||
|     if (this.params.id) { | ||||
|     if (this.$route.query.id) { | ||||
|       this.searchDetail(); | ||||
|       this.title = "网格员详情"; | ||||
|       this.editOne = false; | ||||
| @@ -302,7 +294,7 @@ export default { | ||||
|     } | ||||
|   }, | ||||
|   computed: { | ||||
|     currCheckedKeys () { | ||||
|     currCheckedKeys() { | ||||
|       if (this.forms && this.forms.girdInfoList && this.forms.girdInfoList[this.currIndex] && this.forms.girdInfoList[this.currIndex].id) { | ||||
|         return [this.forms.girdInfoList[this.currIndex].id] | ||||
|       } | ||||
| @@ -324,14 +316,11 @@ export default { | ||||
|       }; | ||||
|       return { | ||||
|         name: [ | ||||
|           { required: true, message: "请输入网格员姓名", trigger: "change" }, | ||||
|           {required: true, message: "请输入网格员姓名", trigger: "change"}, | ||||
|         ], | ||||
|         selectionDate: [ | ||||
|           { required: true, message: "请选择选用日期", trigger: "change" }, | ||||
|         ], | ||||
|         phone: [{ required: true, validator: phonePass, trigger: "blur" }], | ||||
|         phone: [{required: true, validator: phonePass, trigger: "blur"}], | ||||
|         girdInfoList: [ | ||||
|           { required: true, message: "请选择责任网络", trigger: "change" }, | ||||
|           {required: true, message: "请选择责任网络", trigger: "change"}, | ||||
|         ], | ||||
|         mail: [ | ||||
|           { | ||||
| @@ -344,14 +333,14 @@ export default { | ||||
|     }, | ||||
|   }, | ||||
|   methods: { | ||||
|     cancel (isRefresh) { | ||||
|     cancel(isRefresh) { | ||||
|       this.$emit('change', { | ||||
|         type: 'list', | ||||
|         isRefresh: !!isRefresh, | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     onCheckChange (e) { | ||||
|     onCheckChange(e) { | ||||
|       this.$nextTick(() => { | ||||
|         this.$refs.tree.getCheckedKeys().forEach(v => { | ||||
|           this.$refs.tree.setChecked(v, false) | ||||
| @@ -360,11 +349,11 @@ export default { | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     removeGrid (index) { | ||||
|     removeGrid(index) { | ||||
|       this.forms.girdInfoList.splice(index, 1) | ||||
|     }, | ||||
|  | ||||
|     addGrid () { | ||||
|     addGrid() { | ||||
|       this.forms.girdInfoList.push({ | ||||
|         id: '', | ||||
|         girdName: '', | ||||
| @@ -375,10 +364,13 @@ export default { | ||||
|       this.forms.photo = val[0].url; | ||||
|     }, | ||||
|     getSelectPerson(val) { | ||||
|       this.forms.name = val[0].name; | ||||
|       this.forms.phone = val[0].phone; | ||||
|       this.forms.userId = val[0].sysUserId | ||||
|       this.forms.wxUserId = val[0].id | ||||
|       if (val.length) { | ||||
|         this.forms.name = val[0].name; | ||||
|         this.forms.phone = val[0].phone; | ||||
|         this.forms.userId = val[0].sysUserId | ||||
|         this.forms.wxUserId = val[0].id | ||||
|         this.$refs.rules.validateField('name') | ||||
|       } | ||||
|     }, | ||||
|     getCheckedTree() { | ||||
|       if (!this.$refs.tree.getCheckedNodes().length) { | ||||
| @@ -423,17 +415,9 @@ export default { | ||||
|             if (!currInfo.id) { | ||||
|               return this.$message.error('请选择网格') | ||||
|             } | ||||
|  | ||||
|             if (currInfo.checkType === '1' && currInfo.girdLevel !== '2') { | ||||
|               return this.$message.error(`一级、二级网格不能添加网格员`) | ||||
|             } | ||||
|  | ||||
|             if (sameInfo.length) { | ||||
|               return this.$message.error('不能选择同一网格重复绑定') | ||||
|             } | ||||
|           } | ||||
|  | ||||
|           this.instance.post(`/app/appgirdmemberinfo/addOrUpdate`,{ | ||||
|           this.instance.post(`/app/appgirdmemberinfo/addOrUpdate`, { | ||||
|             ...this.forms, | ||||
|             girdInfoListStr: this.forms.girdInfoList.map(v => v.girdName).join(',') | ||||
|           }).then((res) => { | ||||
| @@ -453,31 +437,30 @@ export default { | ||||
|       }); | ||||
|     }, | ||||
|     searchDetail() { | ||||
|       this.instance | ||||
|         .post(`/app/appgirdmemberinfo/queryDetailById`, null, { | ||||
|           params: { id: this.params.id }, | ||||
|         }) | ||||
|         .then((res) => { | ||||
|           if (res.code == 0) { | ||||
|             this.forms = { | ||||
|               ...res.data, | ||||
|               girdInfoList: res.data.girdInfoList || [] | ||||
|             }; | ||||
|             this.users = [{ | ||||
|               name: res.data.name, | ||||
|               phone: res.data.phone, | ||||
|               userId: res.data.id, | ||||
|               id: res.data.wxUserId | ||||
|             }] | ||||
|             this.girdInfoStr = '' | ||||
|             this.photoList = [{ url: this.forms.photo }]; | ||||
|             if (res.data.girdInfoList) { | ||||
|               res.data.girdInfoList.forEach((e) => { | ||||
|                 this.girdInfoStr = this.girdInfoStr + `${e.checkType === '1' ? '网格员' : '网格长'}-${e.girdName} ` | ||||
|               }) | ||||
|             } | ||||
|       let {id} = this.$route.query | ||||
|       this.instance.post(`/app/appgirdmemberinfo/queryDetailById`, null, { | ||||
|         params: {id} | ||||
|       }).then((res) => { | ||||
|         if (res.code == 0) { | ||||
|           this.forms = { | ||||
|             ...res.data, | ||||
|             girdInfoList: res.data.girdInfoList || [] | ||||
|           }; | ||||
|           this.users = [{ | ||||
|             name: res.data.name, | ||||
|             phone: res.data.phone, | ||||
|             userId: res.data.id, | ||||
|             id: res.data.wxUserId | ||||
|           }] | ||||
|           this.girdInfoStr = '' | ||||
|           this.photoList = [{url: this.forms.photo}]; | ||||
|           if (res.data.girdInfoList) { | ||||
|             res.data.girdInfoList.forEach((e) => { | ||||
|               this.girdInfoStr = this.girdInfoStr + `${e.checkType === '1' ? '网格员' : '网格长'}-${e.girdName} ` | ||||
|             }) | ||||
|           } | ||||
|         }); | ||||
|         } | ||||
|       }); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
| @@ -487,26 +470,28 @@ export default { | ||||
| .add { | ||||
|   height: 100%; | ||||
|  | ||||
|     .form-flex { | ||||
|       display: flex; | ||||
|       align-items: center; | ||||
|   .form-flex { | ||||
|     display: flex; | ||||
|     align-items: center; | ||||
|  | ||||
|       & > .el-button { | ||||
|         margin-left: 20px; | ||||
|       } | ||||
|  | ||||
|       .el-input { | ||||
|         width: 300px; | ||||
|         margin-left: 20px; | ||||
|       } | ||||
|  | ||||
|       ::v-deep .el-form-item__content { | ||||
|         margin-left: 0!important; | ||||
|       } | ||||
|     & > .el-button { | ||||
|       margin-left: 20px; | ||||
|     } | ||||
|  | ||||
|     .el-input { | ||||
|       width: 300px; | ||||
|       margin-left: 20px; | ||||
|     } | ||||
|  | ||||
|     ::v-deep .el-form-item__content { | ||||
|       margin-left: 0 !important; | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   .ai-detail__title { | ||||
|     background-color: #fff; | ||||
|   } | ||||
|  | ||||
|   .ai-detail__content { | ||||
|     .ai-detail__content--wrapper { | ||||
|       .el-form { | ||||
| @@ -516,9 +501,11 @@ export default { | ||||
|           display: flex; | ||||
|           flex-wrap: wrap; | ||||
|           justify-content: space-between; | ||||
|  | ||||
|           .el-form-item { | ||||
|             width: 48%; | ||||
|           } | ||||
|  | ||||
|           .buildingTypes { | ||||
|             width: 100%; | ||||
|           } | ||||
| @@ -526,16 +513,20 @@ export default { | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   ::v-deep .el-tag { | ||||
|     margin-right: 8px; | ||||
|     color: #333333; | ||||
|   } | ||||
|  | ||||
|   .footer-btn { | ||||
|     width: 92px; | ||||
|   } | ||||
|   .above{ | ||||
|  | ||||
|   .above { | ||||
|     display: flex; | ||||
|     .left, .right{ | ||||
|  | ||||
|     .left, .right { | ||||
|       flex: 1; | ||||
|     } | ||||
|   } | ||||
|   | ||||
							
								
								
									
										55
									
								
								packages/grid/AppGridMember/components/gmList.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								packages/grid/AppGridMember/components/gmList.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,55 @@ | ||||
| <template> | ||||
|   <section class="gmList"> | ||||
|     <ai-list class="AppGridMember"> | ||||
|       <template slot="title"> | ||||
|         <ai-title title="网格员管理" :isShowBottomBorder="false"></ai-title> | ||||
|       </template> | ||||
|       <template slot="tabs"> | ||||
|         <el-tabs v-model="currIndex"> | ||||
|           <el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label"> | ||||
|             <component :ref="String(i)" v-if="currIndex == i" :is="tab.comp" lazy :instance="instance" | ||||
|                        :dict="dict" :permissions="permissions" v-on="$listeners"/> | ||||
|           </el-tab-pane> | ||||
|         </el-tabs> | ||||
|       </template> | ||||
|     </ai-list> | ||||
|   </section> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| import List from "./list"; | ||||
| import ApplyList from "./ApplyList"; | ||||
|  | ||||
| export default { | ||||
|   name: "gmList", | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     dict: Object, | ||||
|     permissions: Function | ||||
|   }, | ||||
|   computed: { | ||||
|     tabs() { | ||||
|       return [ | ||||
|         {label: '网格员信息', name: 'List', comp: List, permission: ''}, | ||||
|         {label: '申报信息', name: 'ApplyList', comp: ApplyList, permission: 'app_appgirdmemberapply_detail'} | ||||
|       ].filter(item => { | ||||
|         return item.name !== 'ApplyList' || this.permissions(item.permission) | ||||
|       }) | ||||
|     } | ||||
|   }, | ||||
|   data() { | ||||
|     return { | ||||
|       currIndex: '0', | ||||
|     } | ||||
|   }, | ||||
|   methods: {}, | ||||
|   created() { | ||||
|   } | ||||
| } | ||||
| </script> | ||||
|  | ||||
| <style lang="scss" scoped> | ||||
| .gmList { | ||||
|   height: 100%; | ||||
| } | ||||
| </style> | ||||
| @@ -1,54 +1,43 @@ | ||||
| <template> | ||||
|   <ai-list class="list" isTabs> | ||||
|     <template slot="content"> | ||||
|       <ai-search-bar bottomBorder> | ||||
|         <template slot="left"> | ||||
|           <el-date-picker | ||||
|             v-model="searchObj.selectionDate" | ||||
|             type="date" | ||||
|             @change="(page.current = 1), getList()" | ||||
|             value-format="yyyy-MM-dd" | ||||
|             size="small" | ||||
|             placeholder="选用时间"> | ||||
|           </el-date-picker> | ||||
|         </template> | ||||
|         <template slot="right"> | ||||
|           <el-input | ||||
|             v-model="searchObj.name" | ||||
|             size="small" | ||||
|             placeholder="网格员/责任网格" | ||||
|             v-throttle="() => {page.current = 1, getList()}" | ||||
|             clearable | ||||
|             @clear="(searchObj.name = '', page.current = 1), getList()" | ||||
|             suffix-icon="iconfont iconSearch" /> | ||||
|         </template> | ||||
|       </ai-search-bar> | ||||
|       <ai-search-bar style="padding: 16px 0 0"> | ||||
|         <template slot="left"> | ||||
|           <el-button | ||||
|             icon="iconfont iconAdd" | ||||
|             type="primary" | ||||
|             size="small" | ||||
|             @click="add('')" | ||||
|             >添加</el-button | ||||
|               icon="iconfont iconAdd" | ||||
|               type="primary" | ||||
|               size="small" | ||||
|               @click="add('')" | ||||
|           >添加 | ||||
|           </el-button | ||||
|           > | ||||
|           <el-button | ||||
|             icon="iconfont iconDelete" | ||||
|             @click="deleteById(ids.join(','))" | ||||
|             :disabled="!Boolean(ids.length)" | ||||
|             >删除</el-button | ||||
|               icon="iconfont iconDelete" | ||||
|               @click="deleteById(ids.join(','))" | ||||
|               :disabled="!Boolean(ids.length)" | ||||
|           >删除 | ||||
|           </el-button | ||||
|           > | ||||
|         </template> | ||||
|         <template slot="right"> | ||||
|           <el-input | ||||
|               v-model="searchObj.name" | ||||
|               size="small" | ||||
|               placeholder="网格员/责任网格" | ||||
|               v-throttle="() => {page.current = 1, getList()}" | ||||
|               clearable | ||||
|               @clear="(searchObj.name = '', page.current = 1), getList()" | ||||
|               suffix-icon="iconfont iconSearch"/> | ||||
|         </template> | ||||
|       </ai-search-bar> | ||||
|       <ai-table | ||||
|         :tableData="tableData" | ||||
|         :col-configs="colConfigs" | ||||
|         :total="page.total" | ||||
|         ref="aitableex" | ||||
|         :current.sync="page.current" | ||||
|         :size.sync="page.size" | ||||
|         @selection-change="(v) => (ids = v.map((e) => e.id))" | ||||
|         @getList="getList()"> | ||||
|           :tableData="tableData" | ||||
|           :col-configs="colConfigs" | ||||
|           :total="page.total" | ||||
|           :current.sync="page.current" | ||||
|           :size.sync="page.size" | ||||
|           @selection-change="(v) => (ids = v.map((e) => e.id))" | ||||
|           @getList="getList()"> | ||||
|         <el-table-column label="操作" slot="options" align="center" fixed="right" width="220"> | ||||
|           <template slot-scope="{ row }"> | ||||
|             <div class="table-options"> | ||||
| @@ -97,67 +86,42 @@ export default { | ||||
|   }, | ||||
|   computed: { | ||||
|     colConfigs() { | ||||
|       let _ = this; | ||||
|       return [ | ||||
|         { | ||||
|           type: "selection", | ||||
|         }, | ||||
|         { | ||||
|           prop: "name", | ||||
|           label: "网格员姓名", | ||||
|         }, | ||||
|         { | ||||
|           prop: "girdInfoListStr", | ||||
|           align: "center", | ||||
|           label: "责任网格", | ||||
|         }, | ||||
|         { | ||||
|           prop: "phone", | ||||
|           align: "center", | ||||
|           label: "联系电话", | ||||
|         }, | ||||
|         { | ||||
|           prop: "selectionDate", | ||||
|           align: "center", | ||||
|           label: "选用时间", | ||||
|         }, | ||||
|         {type: "selection"}, | ||||
|         {prop: "name", label: "网格员姓名"}, | ||||
|         {prop: "girdInfoListStr", align: "center", label: "责任网格"}, | ||||
|         {prop: "phone", align: "center", label: "联系电话"}, | ||||
|         {prop: "createTime", align: "center", label: "创建时间"}, | ||||
|       ]; | ||||
|     }, | ||||
|   }, | ||||
|   methods: { | ||||
|     getList() { | ||||
|       this.instance | ||||
|         .post("/app/appgirdmemberinfo/list", null, { | ||||
|           params: { | ||||
|             ...this.searchObj, | ||||
|             ...this.page, | ||||
|           }, | ||||
|         }) | ||||
|         .then((res) => { | ||||
|           if (res.code == 0) { | ||||
|             this.tableData = res.data.records; | ||||
|             this.page.total = res.data.total; | ||||
|           } | ||||
|         }); | ||||
|       this.instance.post("/app/appgirdmemberinfo/list", null, { | ||||
|         params: {...this.searchObj, ...this.page} | ||||
|       }).then((res) => { | ||||
|         if (res?.data) { | ||||
|           this.tableData = res.data.records; | ||||
|           this.page.total = res.data.total; | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     deleteById(ids) { | ||||
|       ids && | ||||
|         this.$confirm("是否要删除该网格员?", { | ||||
|           type: "error", | ||||
|       ids && this.$confirm("是否要删除该网格员?", { | ||||
|         type: "error", | ||||
|       }).then(() => { | ||||
|         this.instance | ||||
|         .post("/app/appgirdmemberinfo/delete", null, { | ||||
|           params: {ids}, | ||||
|         }) | ||||
|           .then(() => { | ||||
|             this.instance | ||||
|               .post("/app/appgirdmemberinfo/delete", null, { | ||||
|                 params: { ids }, | ||||
|               }) | ||||
|               .then((res) => { | ||||
|                 if (res?.code == 0) { | ||||
|                   this.$message.success("删除成功!"); | ||||
|                   this.getList(); | ||||
|                 } | ||||
|               }); | ||||
|           }) | ||||
|           .catch(() => {}); | ||||
|         .then((res) => { | ||||
|           if (res?.code == 0) { | ||||
|             this.$message.success("删除成功!"); | ||||
|             this.getList(); | ||||
|           } | ||||
|         }); | ||||
|       }) | ||||
|       .catch(() => 0); | ||||
|     }, | ||||
|     add(id) { | ||||
|       this.$emit('change', { | ||||
| @@ -167,8 +131,7 @@ export default { | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     toMonitorUser (id) { | ||||
|     toMonitorUser(id) { | ||||
|       this.$emit('change', { | ||||
|         type: 'MonitorUser', | ||||
|         params: { | ||||
| @@ -176,8 +139,7 @@ export default { | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     toFamily (id) { | ||||
|     toFamily(id) { | ||||
|       this.$emit('change', { | ||||
|         type: 'Family', | ||||
|         params: { | ||||
| @@ -185,7 +147,6 @@ export default { | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     handleSelectionChange(val) { | ||||
|       this.ids = []; | ||||
|       val.map((e) => { | ||||
| @@ -197,7 +158,7 @@ export default { | ||||
|         this.searchObj[e] = ""; | ||||
|       }); | ||||
|       this.getList(); | ||||
|     }, | ||||
|     } | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user