网格基础设置调整
This commit is contained in:
		| @@ -133,12 +133,6 @@ | |||||||
|         }) |         }) | ||||||
|       }, |       }, | ||||||
|       handleNodeClick (val) { |       handleNodeClick (val) { | ||||||
|         if (val.girdLevel === '0') { |  | ||||||
|           this.getLeafNodes() |  | ||||||
|  |  | ||||||
|           return false |  | ||||||
|         } |  | ||||||
|          |  | ||||||
|         this.instance.post(`/app/appgirdinfo/queryChildGirdInfoByGirdId?girdId=${val.id}`).then((res) => { |         this.instance.post(`/app/appgirdinfo/queryChildGirdInfoByGirdId?girdId=${val.id}`).then((res) => { | ||||||
|           if (res?.data) { |           if (res?.data) { | ||||||
|             const arr = res.data.map(v => { |             const arr = res.data.map(v => { | ||||||
|   | |||||||
| @@ -50,7 +50,7 @@ | |||||||
|       </ai-table> |       </ai-table> | ||||||
|       <ai-dialog |       <ai-dialog | ||||||
|           :visible.sync="dialog" |           :visible.sync="dialog" | ||||||
|           width="890px" |           width="1100px" | ||||||
|           @close="closeDialog" |           @close="closeDialog" | ||||||
|           title="添加户主" |           title="添加户主" | ||||||
|           @onConfirm="onConfirm"> |           @onConfirm="onConfirm"> | ||||||
| @@ -94,8 +94,6 @@ export default { | |||||||
|       }, |       }, | ||||||
|       isLoading: false, |       isLoading: false, | ||||||
|       form: {}, |       form: {}, | ||||||
|       userList: [], |  | ||||||
|       name: '', |  | ||||||
|       chooseUser: [], |       chooseUser: [], | ||||||
|       dialog: false, |       dialog: false, | ||||||
|       total: 10, |       total: 10, | ||||||
| @@ -127,7 +125,6 @@ export default { | |||||||
|     this.dict.load('epidemicDangerousAreaLevel').then(() => { |     this.dict.load('epidemicDangerousAreaLevel').then(() => { | ||||||
|       this.getGirdList() |       this.getGirdList() | ||||||
|       this.getList() |       this.getList() | ||||||
|       this.getUserList() |  | ||||||
|     }) |     }) | ||||||
|   }, |   }, | ||||||
|  |  | ||||||
| @@ -167,11 +164,6 @@ export default { | |||||||
|     handleSelectionChange(e) { |     handleSelectionChange(e) { | ||||||
|       this.ids = e.map(v => v.gmrId) |       this.ids = e.map(v => v.gmrId) | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     clearAll() { |  | ||||||
|       this.chooseUser = [] |  | ||||||
|     }, |  | ||||||
|  |  | ||||||
|     onConfirm() { |     onConfirm() { | ||||||
|       if (!this.girdId) { |       if (!this.girdId) { | ||||||
|         return this.$message.error('请选择网格') |         return this.$message.error('请选择网格') | ||||||
| @@ -196,42 +188,18 @@ export default { | |||||||
|           this.current = 1 |           this.current = 1 | ||||||
|           this.getList() |           this.getList() | ||||||
|           this.$message.success('添加成功') |           this.$message.success('添加成功') | ||||||
|           this.closeDialog() |           this.dialog = false | ||||||
|         } |         } | ||||||
|       }) |       }) | ||||||
|     }, |     }, | ||||||
|     closeDialog() { |     closeDialog() { | ||||||
|       this.dialog = false |  | ||||||
|       this.chooseUser = [] |       this.chooseUser = [] | ||||||
|       this.girdId = '' |       this.girdId = '' | ||||||
|       this.name = '' |  | ||||||
|       this.areaId = this.user.info.areaId |       this.areaId = this.user.info.areaId | ||||||
|       this.getUserList() |  | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     del(e) { |     del(e) { | ||||||
|       this.chooseUser.splice(this.chooseUser.indexOf(e), 1) |       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() { |     onBack() { | ||||||
|       this.$emit('change', { |       this.$emit('change', { | ||||||
|         type: 'list' |         type: 'list' | ||||||
|   | |||||||
| @@ -51,71 +51,24 @@ | |||||||
|       </ai-table> |       </ai-table> | ||||||
|       <ai-dialog |       <ai-dialog | ||||||
|           :visible.sync="isShow" |           :visible.sync="isShow" | ||||||
|           width="890px" |           width="1100px" | ||||||
|           @close="closeDialog" |           @close="closeDialog" | ||||||
|           title="添加户主" |           title="添加户主" | ||||||
|           @onConfirm="onConfirm"> |           @onConfirm="onConfirm"> | ||||||
|         <ai-area-select clearable always-show :instance="instance" v-model="areaId" :disabled-level="disabledLevel" |         <el-form ref="DialogForm" size="small" label-width="0"> | ||||||
|                         @change="search.current = 1, getUserList()"></ai-area-select> |           <el-form-item> | ||||||
|         <span style="margin-top:16px;"><span style="color:#f46;margin-right:4px;">*</span>网格:</span> |             <ai-area-select clearable always-show :instance="instance" v-model="areaId" :disabled-level="disabledLevel"/> | ||||||
|         <el-select size="small" style="width: 280px;margin-top:16px;" v-model="girdId" placeholder="请选择网格" clearable> |           </el-form-item> | ||||||
|           <el-option |           <el-form-item label="网格:" required label-width="80px"> | ||||||
|               v-for="(item,i) in girdList" |             <el-select size="small" v-model="girdId" placeholder="请选择网格" clearable> | ||||||
|               :key="i" |               <el-option v-for="(item,i) in girdList" :key="i" :label="item.girdName" :value="item.id"/> | ||||||
|               :label="item.girdName" |             </el-select> | ||||||
|               :value="item.id" |           </el-form-item> | ||||||
|           > |           <el-form-item> | ||||||
|           </el-option> |             <ai-table-select :instance="instance" :action="`/app/appresident/list?householdName=1&areaId=${areaId}`" | ||||||
|         </el-select> |                              @select="v=>chooseUser=v"/> | ||||||
|         <div class="AiWechatSelecter-container"> |           </el-form-item> | ||||||
|           <div class="AiWechatSelecter-container__left" v-loading="isLoading"> |         </el-form> | ||||||
|             <div class="AiWechatSelecter-header"> |  | ||||||
|               <div class="AiWechatSelecter-header__left"> |  | ||||||
|                 <h2>户主信息列表</h2> |  | ||||||
|               </div> |  | ||||||
|               <el-input |  | ||||||
|                   class="search-input" |  | ||||||
|                   size="mini" |  | ||||||
|                   placeholder="请输入姓名/身份证号" |  | ||||||
|                   v-model="name" |  | ||||||
|                   clearable |  | ||||||
|                   v-throttle="getUserList" |  | ||||||
|                   @clear="name = '', getUserList()" |  | ||||||
|                   suffix-icon="iconfont iconSearch"> |  | ||||||
|               </el-input> |  | ||||||
|             </div> |  | ||||||
|             <el-scrollbar class="AiWechatSelecter-list"> |  | ||||||
|               <el-checkbox-group v-model="chooseUser"> |  | ||||||
|                 <el-checkbox |  | ||||||
|                     :label="`${item.name}~${item.id}`" |  | ||||||
|                     v-for="(item, index) in userList" |  | ||||||
|                     :key="index"> |  | ||||||
|                   {{ item.name }}-{{ item.idNumber }} |  | ||||||
|                 </el-checkbox> |  | ||||||
|               </el-checkbox-group> |  | ||||||
|               <AiEmpty v-if="!this.userList.length"></AiEmpty> |  | ||||||
|             </el-scrollbar> |  | ||||||
|           </div> |  | ||||||
|           <div class="AiWechatSelecter-container__right"> |  | ||||||
|             <div class="AiWechatSelecter-header AiWechatSelecter-header__right"> |  | ||||||
|               <h2>已选择</h2> |  | ||||||
|               <el-button size="mini" icon="el-icon-delete" @click="clearAll">清空</el-button> |  | ||||||
|             </div> |  | ||||||
|             <el-scrollbar class="AiWechatSelecter-list"> |  | ||||||
|               <div class="tags-wrapper"> |  | ||||||
|                 <el-tag |  | ||||||
|                     v-for="(item, index) in chooseUser" |  | ||||||
|                     :key="index" |  | ||||||
|                     closable |  | ||||||
|                     @close="del(item)" |  | ||||||
|                     size="small" |  | ||||||
|                     type="info"> |  | ||||||
|                   {{ item.split('~')[0] }} |  | ||||||
|                 </el-tag> |  | ||||||
|               </div> |  | ||||||
|             </el-scrollbar> |  | ||||||
|           </div> |  | ||||||
|         </div> |  | ||||||
|       </ai-dialog> |       </ai-dialog> | ||||||
|     </template> |     </template> | ||||||
|   </ai-list> |   </ai-list> | ||||||
|   | |||||||
| @@ -375,10 +375,13 @@ export default { | |||||||
|       this.forms.photo = val[0].url; |       this.forms.photo = val[0].url; | ||||||
|     }, |     }, | ||||||
|     getSelectPerson(val) { |     getSelectPerson(val) { | ||||||
|       this.forms.name = val[0].name; |       if(val.length){ | ||||||
|       this.forms.phone = val[0].phone; |         this.forms.name = val[0].name; | ||||||
|       this.forms.userId = val[0].sysUserId |         this.forms.phone = val[0].phone; | ||||||
|       this.forms.wxUserId = val[0].id |         this.forms.userId = val[0].sysUserId | ||||||
|  |         this.forms.wxUserId = val[0].id | ||||||
|  |         this.$refs.rules.validateField('name') | ||||||
|  |       } | ||||||
|     }, |     }, | ||||||
|     getCheckedTree() { |     getCheckedTree() { | ||||||
|       if (!this.$refs.tree.getCheckedNodes().length) { |       if (!this.$refs.tree.getCheckedNodes().length) { | ||||||
| @@ -423,14 +426,6 @@ export default { | |||||||
|             if (!currInfo.id) { |             if (!currInfo.id) { | ||||||
|               return this.$message.error('请选择网格') |               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`,{ | ||||||
|   | |||||||
| @@ -4,51 +4,52 @@ | |||||||
|       <ai-search-bar bottomBorder> |       <ai-search-bar bottomBorder> | ||||||
|         <template slot="left"> |         <template slot="left"> | ||||||
|           <el-date-picker |           <el-date-picker | ||||||
|             v-model="searchObj.selectionDate" |               v-model="searchObj.selectionDate" | ||||||
|             type="date" |               type="date" | ||||||
|             @change="(page.current = 1), getList()" |               @change="(page.current = 1), getList()" | ||||||
|             value-format="yyyy-MM-dd" |               value-format="yyyy-MM-dd" | ||||||
|             size="small" |               size="small" | ||||||
|             placeholder="选用时间"> |               placeholder="选用时间"> | ||||||
|           </el-date-picker> |           </el-date-picker> | ||||||
|         </template> |         </template> | ||||||
|         <template slot="right"> |         <template slot="right"> | ||||||
|           <el-input |           <el-input | ||||||
|             v-model="searchObj.name" |               v-model="searchObj.name" | ||||||
|             size="small" |               size="small" | ||||||
|             placeholder="网格员/责任网格" |               placeholder="网格员/责任网格" | ||||||
|             v-throttle="() => {page.current = 1, getList()}" |               v-throttle="() => {page.current = 1, getList()}" | ||||||
|             clearable |               clearable | ||||||
|             @clear="(searchObj.name = '', page.current = 1), getList()" |               @clear="(searchObj.name = '', page.current = 1), getList()" | ||||||
|             suffix-icon="iconfont iconSearch" /> |               suffix-icon="iconfont iconSearch"/> | ||||||
|         </template> |         </template> | ||||||
|       </ai-search-bar> |       </ai-search-bar> | ||||||
|       <ai-search-bar style="padding: 16px 0 0"> |       <ai-search-bar style="padding: 16px 0 0"> | ||||||
|         <template slot="left"> |         <template slot="left"> | ||||||
|           <el-button |           <el-button | ||||||
|             icon="iconfont iconAdd" |               icon="iconfont iconAdd" | ||||||
|             type="primary" |               type="primary" | ||||||
|             size="small" |               size="small" | ||||||
|             @click="add('')" |               @click="add('')" | ||||||
|             >添加</el-button |           >添加 | ||||||
|  |           </el-button | ||||||
|           > |           > | ||||||
|           <el-button |           <el-button | ||||||
|             icon="iconfont iconDelete" |               icon="iconfont iconDelete" | ||||||
|             @click="deleteById(ids.join(','))" |               @click="deleteById(ids.join(','))" | ||||||
|             :disabled="!Boolean(ids.length)" |               :disabled="!Boolean(ids.length)" | ||||||
|             >删除</el-button |           >删除 | ||||||
|  |           </el-button | ||||||
|           > |           > | ||||||
|         </template> |         </template> | ||||||
|       </ai-search-bar> |       </ai-search-bar> | ||||||
|       <ai-table |       <ai-table | ||||||
|         :tableData="tableData" |           :tableData="tableData" | ||||||
|         :col-configs="colConfigs" |           :col-configs="colConfigs" | ||||||
|         :total="page.total" |           :total="page.total" | ||||||
|         ref="aitableex" |           :current.sync="page.current" | ||||||
|         :current.sync="page.current" |           :size.sync="page.size" | ||||||
|         :size.sync="page.size" |           @selection-change="(v) => (ids = v.map((e) => e.id))" | ||||||
|         @selection-change="(v) => (ids = v.map((e) => e.id))" |           @getList="getList()"> | ||||||
|         @getList="getList()"> |  | ||||||
|         <el-table-column label="操作" slot="options" align="center" fixed="right" width="220"> |         <el-table-column label="操作" slot="options" align="center" fixed="right" width="220"> | ||||||
|           <template slot-scope="{ row }"> |           <template slot-scope="{ row }"> | ||||||
|             <div class="table-options"> |             <div class="table-options"> | ||||||
| @@ -97,67 +98,42 @@ export default { | |||||||
|   }, |   }, | ||||||
|   computed: { |   computed: { | ||||||
|     colConfigs() { |     colConfigs() { | ||||||
|       let _ = this; |  | ||||||
|       return [ |       return [ | ||||||
|         { |         {type: "selection"}, | ||||||
|           type: "selection", |         {prop: "name", label: "网格员姓名"}, | ||||||
|         }, |         {prop: "girdInfoListStr", align: "center", label: "责任网格"}, | ||||||
|         { |         {prop: "phone", align: "center", label: "联系电话"}, | ||||||
|           prop: "name", |         {prop: "selectionDate", align: "center", label: "选用时间"}, | ||||||
|           label: "网格员姓名", |  | ||||||
|         }, |  | ||||||
|         { |  | ||||||
|           prop: "girdInfoListStr", |  | ||||||
|           align: "center", |  | ||||||
|           label: "责任网格", |  | ||||||
|         }, |  | ||||||
|         { |  | ||||||
|           prop: "phone", |  | ||||||
|           align: "center", |  | ||||||
|           label: "联系电话", |  | ||||||
|         }, |  | ||||||
|         { |  | ||||||
|           prop: "selectionDate", |  | ||||||
|           align: "center", |  | ||||||
|           label: "选用时间", |  | ||||||
|         }, |  | ||||||
|       ]; |       ]; | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|   methods: { |   methods: { | ||||||
|     getList() { |     getList() { | ||||||
|       this.instance |       this.instance.post("/app/appgirdmemberinfo/list", null, { | ||||||
|         .post("/app/appgirdmemberinfo/list", null, { |         params: {...this.searchObj, ...this.page} | ||||||
|           params: { |       }).then((res) => { | ||||||
|             ...this.searchObj, |         if (res?.data) { | ||||||
|             ...this.page, |           this.tableData = res.data.records; | ||||||
|           }, |           this.page.total = res.data.total; | ||||||
|         }) |         } | ||||||
|         .then((res) => { |       }) | ||||||
|           if (res.code == 0) { |  | ||||||
|             this.tableData = res.data.records; |  | ||||||
|             this.page.total = res.data.total; |  | ||||||
|           } |  | ||||||
|         }); |  | ||||||
|     }, |     }, | ||||||
|     deleteById(ids) { |     deleteById(ids) { | ||||||
|       ids && |       ids && this.$confirm("是否要删除该网格员?", { | ||||||
|         this.$confirm("是否要删除该网格员?", { |         type: "error", | ||||||
|           type: "error", |       }).then(() => { | ||||||
|  |         this.instance | ||||||
|  |         .post("/app/appgirdmemberinfo/delete", null, { | ||||||
|  |           params: {ids}, | ||||||
|         }) |         }) | ||||||
|           .then(() => { |         .then((res) => { | ||||||
|             this.instance |           if (res?.code == 0) { | ||||||
|               .post("/app/appgirdmemberinfo/delete", null, { |             this.$message.success("删除成功!"); | ||||||
|                 params: { ids }, |             this.getList(); | ||||||
|               }) |           } | ||||||
|               .then((res) => { |         }); | ||||||
|                 if (res?.code == 0) { |       }) | ||||||
|                   this.$message.success("删除成功!"); |       .catch(() => 0); | ||||||
|                   this.getList(); |  | ||||||
|                 } |  | ||||||
|               }); |  | ||||||
|           }) |  | ||||||
|           .catch(() => {}); |  | ||||||
|     }, |     }, | ||||||
|     add(id) { |     add(id) { | ||||||
|       this.$emit('change', { |       this.$emit('change', { | ||||||
| @@ -168,7 +144,7 @@ export default { | |||||||
|       }) |       }) | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     toMonitorUser (id) { |     toMonitorUser(id) { | ||||||
|       this.$emit('change', { |       this.$emit('change', { | ||||||
|         type: 'MonitorUser', |         type: 'MonitorUser', | ||||||
|         params: { |         params: { | ||||||
| @@ -177,7 +153,7 @@ export default { | |||||||
|       }) |       }) | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     toFamily (id) { |     toFamily(id) { | ||||||
|       this.$emit('change', { |       this.$emit('change', { | ||||||
|         type: 'Family', |         type: 'Family', | ||||||
|         params: { |         params: { | ||||||
| @@ -185,7 +161,6 @@ export default { | |||||||
|         } |         } | ||||||
|       }) |       }) | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     handleSelectionChange(val) { |     handleSelectionChange(val) { | ||||||
|       this.ids = []; |       this.ids = []; | ||||||
|       val.map((e) => { |       val.map((e) => { | ||||||
| @@ -197,7 +172,7 @@ export default { | |||||||
|         this.searchObj[e] = ""; |         this.searchObj[e] = ""; | ||||||
|       }); |       }); | ||||||
|       this.getList(); |       this.getList(); | ||||||
|     }, |     } | ||||||
|   }, |   }, | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user