网格基础设置调整
This commit is contained in:
		| @@ -133,12 +133,6 @@ | ||||
|         }) | ||||
|       }, | ||||
|       handleNodeClick (val) { | ||||
|         if (val.girdLevel === '0') { | ||||
|           this.getLeafNodes() | ||||
|  | ||||
|           return false | ||||
|         } | ||||
|          | ||||
|         this.instance.post(`/app/appgirdinfo/queryChildGirdInfoByGirdId?girdId=${val.id}`).then((res) => { | ||||
|           if (res?.data) { | ||||
|             const arr = res.data.map(v => { | ||||
|   | ||||
| @@ -50,7 +50,7 @@ | ||||
|       </ai-table> | ||||
|       <ai-dialog | ||||
|           :visible.sync="dialog" | ||||
|           width="890px" | ||||
|           width="1100px" | ||||
|           @close="closeDialog" | ||||
|           title="添加户主" | ||||
|           @onConfirm="onConfirm"> | ||||
| @@ -94,8 +94,6 @@ export default { | ||||
|       }, | ||||
|       isLoading: false, | ||||
|       form: {}, | ||||
|       userList: [], | ||||
|       name: '', | ||||
|       chooseUser: [], | ||||
|       dialog: false, | ||||
|       total: 10, | ||||
| @@ -127,7 +125,6 @@ export default { | ||||
|     this.dict.load('epidemicDangerousAreaLevel').then(() => { | ||||
|       this.getGirdList() | ||||
|       this.getList() | ||||
|       this.getUserList() | ||||
|     }) | ||||
|   }, | ||||
|  | ||||
| @@ -167,11 +164,6 @@ export default { | ||||
|     handleSelectionChange(e) { | ||||
|       this.ids = e.map(v => v.gmrId) | ||||
|     }, | ||||
|  | ||||
|     clearAll() { | ||||
|       this.chooseUser = [] | ||||
|     }, | ||||
|  | ||||
|     onConfirm() { | ||||
|       if (!this.girdId) { | ||||
|         return this.$message.error('请选择网格') | ||||
| @@ -196,42 +188,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' | ||||
|   | ||||
| @@ -51,71 +51,24 @@ | ||||
|       </ai-table> | ||||
|       <ai-dialog | ||||
|           :visible.sync="isShow" | ||||
|           width="890px" | ||||
|           width="1100px" | ||||
|           @close="closeDialog" | ||||
|           title="添加户主" | ||||
|           @onConfirm="onConfirm"> | ||||
|         <ai-area-select clearable always-show :instance="instance" v-model="areaId" :disabled-level="disabledLevel" | ||||
|                         @change="search.current = 1, getUserList()"></ai-area-select> | ||||
|         <span style="margin-top:16px;"><span style="color:#f46;margin-right:4px;">*</span>网格:</span> | ||||
|         <el-select size="small" style="width: 280px;margin-top:16px;" v-model="girdId" placeholder="请选择网格" clearable> | ||||
|           <el-option | ||||
|               v-for="(item,i) in girdList" | ||||
|               :key="i" | ||||
|               :label="item.girdName" | ||||
|               :value="item.id" | ||||
|           > | ||||
|           </el-option> | ||||
|         </el-select> | ||||
|         <div class="AiWechatSelecter-container"> | ||||
|           <div class="AiWechatSelecter-container__left" v-loading="isLoading"> | ||||
|             <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> | ||||
|         <el-form ref="DialogForm" size="small" label-width="0"> | ||||
|           <el-form-item> | ||||
|             <ai-area-select clearable always-show :instance="instance" v-model="areaId" :disabled-level="disabledLevel"/> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="网格:" required label-width="80px"> | ||||
|             <el-select size="small" v-model="girdId" placeholder="请选择网格" clearable> | ||||
|               <el-option v-for="(item,i) in girdList" :key="i" :label="item.girdName" :value="item.id"/> | ||||
|             </el-select> | ||||
|           </el-form-item> | ||||
|           <el-form-item> | ||||
|             <ai-table-select :instance="instance" :action="`/app/appresident/list?householdName=1&areaId=${areaId}`" | ||||
|                              @select="v=>chooseUser=v"/> | ||||
|           </el-form-item> | ||||
|         </el-form> | ||||
|       </ai-dialog> | ||||
|     </template> | ||||
|   </ai-list> | ||||
|   | ||||
| @@ -375,10 +375,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,14 +426,6 @@ 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`,{ | ||||
|   | ||||
| @@ -4,51 +4,52 @@ | ||||
|       <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="选用时间"> | ||||
|               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" /> | ||||
|               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> | ||||
|       </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 +98,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: "selectionDate", 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', { | ||||
| @@ -168,7 +144,7 @@ export default { | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     toMonitorUser (id) { | ||||
|     toMonitorUser(id) { | ||||
|       this.$emit('change', { | ||||
|         type: 'MonitorUser', | ||||
|         params: { | ||||
| @@ -177,7 +153,7 @@ export default { | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     toFamily (id) { | ||||
|     toFamily(id) { | ||||
|       this.$emit('change', { | ||||
|         type: 'Family', | ||||
|         params: { | ||||
| @@ -185,7 +161,6 @@ export default { | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     handleSelectionChange(val) { | ||||
|       this.ids = []; | ||||
|       val.map((e) => { | ||||
| @@ -197,7 +172,7 @@ export default { | ||||
|         this.searchObj[e] = ""; | ||||
|       }); | ||||
|       this.getList(); | ||||
|     }, | ||||
|     } | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user