初始化
This commit is contained in:
		
							
								
								
									
										72
									
								
								packages/2.0.5/AppGridMember/AppGridMember.vue
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										72
									
								
								packages/2.0.5/AppGridMember/AppGridMember.vue
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,72 @@ | ||||
| <template> | ||||
|   <div class="AppGridMember"> | ||||
|     <keep-alive :include="['List']"> | ||||
|       <component | ||||
|         ref="component" | ||||
|         :is="component" | ||||
|         @change="onChange" | ||||
|         :params="params" | ||||
|         :instance="instance" | ||||
|         :dict="dict" | ||||
|       ></component> | ||||
|     </keep-alive> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| import List from "./components/list"; | ||||
| import Add from "./components/add"; | ||||
|  | ||||
| export default { | ||||
|   name: "AppGridMember", | ||||
|   label: "网格管理员", | ||||
|  | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     dict: Object, | ||||
|   }, | ||||
|  | ||||
|   data() { | ||||
|     return { | ||||
|       component: "List", | ||||
|       params: {}, | ||||
|       include: [], | ||||
|     }; | ||||
|   }, | ||||
|  | ||||
|   components: { | ||||
|     Add, | ||||
|     List, | ||||
|   }, | ||||
|  | ||||
|   mounted() {}, | ||||
|  | ||||
|   methods: { | ||||
|     onChange(data) { | ||||
|       if (data.type === "Add") { | ||||
|         this.component = "Add"; | ||||
|         this.params = data.params; | ||||
|       } | ||||
|  | ||||
|       if (data.type === "list") { | ||||
|         this.component = "List"; | ||||
|         this.params = data.params; | ||||
|  | ||||
|         this.$nextTick(() => { | ||||
|           if (data.isRefresh) { | ||||
|             this.$refs.component.getList(); | ||||
|           } | ||||
|         }); | ||||
|       } | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
|  | ||||
| <style lang="scss"> | ||||
| .AppGridMember { | ||||
|   height: 100%; | ||||
|   background: #f3f6f9; | ||||
|   overflow: auto; | ||||
| } | ||||
| </style> | ||||
							
								
								
									
										451
									
								
								packages/2.0.5/AppGridMember/components/add.vue
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										451
									
								
								packages/2.0.5/AppGridMember/components/add.vue
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,451 @@ | ||||
| <template> | ||||
|   <section style="height: 100%"> | ||||
|     <ai-detail class="add"> | ||||
|       <template #title> | ||||
|         <ai-title :title="title" :isShowBack="true" :isShowBottomBorder="true" @onBackClick="cancel(false)"></ai-title> | ||||
|       </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=='网格员详情'"> | ||||
|               <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="save()">保存</span> | ||||
|             </template> | ||||
|             <template slot="content"> | ||||
|               <div class="above" v-if="editOne==true"> | ||||
|                 <div class="left"> | ||||
|                   <el-form-item label="网格员姓名" prop="name" > | ||||
|                     <el-row type="flex" justify="space-between"> | ||||
|                       <el-col :span="17"> | ||||
|                         <el-input v-model="forms.name" placeholder="请输入…" disabled></el-input> | ||||
|                       </el-col> | ||||
|                       <el-col :span="6"> | ||||
|                         <ai-person-select :instance="instance" headerTitle="帐号列表" customRightText @selectPerson="getSelectPerson" url="/admin/user/pageForWeb"  > | ||||
|                           <template v-slot:option ="{ item }"> | ||||
|                             <span class="iconfont iconProlife">{{ item.name }}</span> | ||||
|                             <span>{{ item.phone }}</span> | ||||
|                           </template> | ||||
|                         </ai-person-select> | ||||
|                       </el-col> | ||||
|                     </el-row>              | ||||
|                   </el-form-item> | ||||
|                   <el-form-item label="选用日期" prop="selectionDate" > | ||||
|                     <el-date-picker | ||||
|                       v-model="forms.selectionDate" | ||||
|                       type="date" | ||||
|                       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> | ||||
|                 </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"/> | ||||
|                   </el-form-item> | ||||
|                 </div>              | ||||
|               </div> | ||||
|               <div class="above" v-if="editOne==true"> | ||||
|                 <div class="left"> | ||||
|                   <el-form-item label="出生日期" prop="birthday" > | ||||
|                     <el-date-picker | ||||
|                         v-model="forms.birthday" | ||||
|                         type="date" | ||||
|                         value-format="yyyy-MM-dd" | ||||
|                         size="medium" | ||||
|                         placeholder="选择日期"> | ||||
|                     </el-date-picker> | ||||
|                   </el-form-item> | ||||
|                   <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-select size="medium" v-model="forms.sex" placeholder="请选择..." clearable> | ||||
|                       <el-option | ||||
|                         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> | ||||
|                 </div> | ||||
|               </div> | ||||
|               <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> | ||||
|                   </div> | ||||
|                   <div class="right"> | ||||
|                     <ai-wrapper label-width="120px"  :columnsNumber="1"  style="margin-top: 16px;"> | ||||
|                       <ai-info-item label="照片:" v-if="forms.photo"> | ||||
|                         <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-wrapper> | ||||
|                   </div> | ||||
|                 </div> | ||||
|               </template> | ||||
|             </template> | ||||
|           </ai-card> | ||||
|           <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="save()">保存</span> | ||||
|             </template> | ||||
|             <template slot="content"> | ||||
|               <template v-if="editTwo==true"> | ||||
|                 <el-form-item label="责任网格" prop="girdInfoList" style="margin-top: 8px;">                                                                      | ||||
|                   <el-tag | ||||
|                     :key="index" | ||||
|                     v-for="(tag,index) in forms.girdInfoList" | ||||
|                     closable | ||||
|                     :disable-transitions="false" | ||||
|                     @close="handleClose(tag)"> | ||||
|                     {{tag.girdName}} | ||||
|                   </el-tag>                                       | ||||
|                   <el-button size="small" @click="showGrid=true">选择网格</el-button>                                                                           | ||||
|                 </el-form-item> | ||||
|                 <div class="above"> | ||||
|                   <div class="left"> | ||||
|                     <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-select v-model="forms.politicsStatus" size="medium" placeholder="请选择..." clearable> | ||||
|                         <el-option v-for="(item,i) in dict.getDict('politicsStatus')" :key="i" :label="item.dictName" :value="item.dictValue"></el-option> | ||||
|                       </el-select> | ||||
|                     </el-form-item> | ||||
|                   </div> | ||||
|                   <div class="right"> | ||||
|                     <el-form-item label="特殊网格员" prop="girdMemberType" v-if="forms.isGirdMember==1">                                        | ||||
|                       <el-select v-model="forms.girdMemberType" size="medium" placeholder="请选择..." clearable> | ||||
|                         <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-select v-model="forms.education" size="medium" 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-input | ||||
|                     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-input | ||||
|                     type="textarea" | ||||
|                     maxlength="200" | ||||
|                     show-word-limit | ||||
|                     :rows="4" | ||||
|                     placeholder="请输入内容" | ||||
|                     v-model="forms.motto"> | ||||
|                   </el-input> | ||||
|                 </el-form-item> | ||||
|               </template> | ||||
|               <template v-if="editTwo==false"> | ||||
|                 <ai-wrapper label-width="120px" :columnsNumber="2" style="margin-top: 16px;"> | ||||
|                   <ai-info-item label="责任网格:" style="width: 100%;"><span >{{forms.girdInfoListStr}}</span></ai-info-item> | ||||
|                   <ai-info-item label="是否特殊网格员:"><span >{{forms.isGirdMember==1?'是':'否'}}</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"  @opened="beforeSelectTree"  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="treeObj.checkedKeys" default-expand-all  highlight-current>                   | ||||
|             </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> | ||||
|         </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> | ||||
|       </template> | ||||
|     </ai-detail> | ||||
|   </section> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| export default { | ||||
|   name: "add", | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     dict: Object, | ||||
|     permissions: Function, | ||||
|     params: Object, | ||||
|   }, | ||||
|   data() { | ||||
|     return { | ||||
|       forms: { | ||||
|         birthday: "", | ||||
|         education: "", | ||||
|         girdId: "", | ||||
|         girdInfoList: [], | ||||
|         girdMemberType: "", | ||||
|         id: "", | ||||
|         introduction: "", | ||||
|         isGirdMember: "", | ||||
|         mail: "", | ||||
|         motto: "", | ||||
|         name: "", | ||||
|         phone: "", | ||||
|         photo: "", | ||||
|         politicsStatus: "", | ||||
|         selectionDate: "", | ||||
|         sex: "", | ||||
|         userId: "", | ||||
|       }, | ||||
|       showGrid: false, | ||||
|       treeObj: { | ||||
|         treeList: [], | ||||
|         defaultProps: { | ||||
|           children: "girdList", | ||||
|           label: "girdName", | ||||
|         }, | ||||
|         checkedKeys: [], | ||||
|       }, | ||||
|       photoList: [], | ||||
|       title: "添加网格员", | ||||
|       editOne: false, | ||||
|       editTwo: false, | ||||
|     }; | ||||
|   }, | ||||
|   created() { | ||||
|     if (this.params.id) { | ||||
|       this.searchDetail(); | ||||
|       this.title = "网格员详情"; | ||||
|       this.editOne = false; | ||||
|       this.editTwo = false; | ||||
|     } else { | ||||
|       this.title = "添加网格员"; | ||||
|       this.editOne = true; | ||||
|       this.editTwo = true; | ||||
|     } | ||||
|   }, | ||||
|   computed: { | ||||
|     formRules() { | ||||
|       var IdNumberPass = (rule, value, callback) => { | ||||
|         if (value) { | ||||
|           if (this.idCardNoUtil.checkIdCardNo(value)) { | ||||
|             callback(); | ||||
|           } else { | ||||
|             callback(new Error("身份证号格式错误")); | ||||
|           } | ||||
|         } else { | ||||
|           callback(new Error("请输入身份证号")); | ||||
|         } | ||||
|       }; | ||||
|       let phonePass = (rule, value, callback) => { | ||||
|         let reg = /^(?:(?:\+|00)86)?1\d{10}$/; | ||||
|         if (value) { | ||||
|           if (reg.test(value)) { | ||||
|             callback(); | ||||
|           } else { | ||||
|             callback(new Error("联系电话格式错误")); | ||||
|           } | ||||
|         } else { | ||||
|           callback(new Error("请输入联系电话")); | ||||
|         } | ||||
|       }; | ||||
|       return { | ||||
|         name: [ | ||||
|           { required: true, message: "请填写网格员姓名", trigger: "change" }, | ||||
|         ], | ||||
|         selectionDate: [ | ||||
|           { required: true, message: "请选择选用日期", trigger: "change" }, | ||||
|         ], | ||||
|         phone: [{ required: true, validator: phonePass, trigger: "blur" }], | ||||
|         idNumber: [ | ||||
|           { required: true, validator: IdNumberPass, trigger: "blur" }, | ||||
|         ], | ||||
|         girdInfoList: [ | ||||
|           { required: true, message: "请选择责任网络", trigger: "change" }, | ||||
|         ], | ||||
|         mail: [ | ||||
|           { | ||||
|             type: "email", | ||||
|             message: "请输入正确的邮箱地址", | ||||
|             trigger: ["blur", "change"], | ||||
|           }, | ||||
|         ], | ||||
|         isGirdMember: [ | ||||
|           { | ||||
|             required: true, | ||||
|             message: "请选择是否特殊网格员", | ||||
|             trigger: "change", | ||||
|           }, | ||||
|         ], | ||||
|       }; | ||||
|     }, | ||||
|   }, | ||||
|   methods: { | ||||
|     cancel (isRefresh) { | ||||
|       this.$emit('change', { | ||||
|         type: 'list', | ||||
|         isRefresh: isRefresh ? true : false, | ||||
|       }) | ||||
|     }, | ||||
|     photoChange(val) { | ||||
|       console.log(val); | ||||
|       this.forms.photo = val[0].url; | ||||
|     }, | ||||
|     getSelectPerson(val) { | ||||
|       console.log(val); | ||||
|       this.forms.name = val.name; | ||||
|       this.forms.phone = val.phone; | ||||
|       this.forms.userId = val.id | ||||
|     }, | ||||
|     getCheckedTree() { | ||||
|       this.forms.girdInfoList = this.$refs.tree.getCheckedNodes(); | ||||
|       this.showGrid = false; | ||||
|     }, | ||||
|     handleClose(tag) { | ||||
|       this.forms.girdInfoList.splice(this.forms.girdInfoList.indexOf(tag), 1); | ||||
|     }, | ||||
|     beforeSelectTree() { | ||||
|       this.treeObj.checkedKeys = []; | ||||
|       this.instance.post(`/app/appgirdinfo/listAll`, null, null).then((res) => { | ||||
|         if (res.code == 0) { | ||||
|           this.treeObj.treeList = res.data; | ||||
|           this.forms.girdInfoList.map((e) => { | ||||
|             this.treeObj.checkedKeys.push(e.id); | ||||
|           }); | ||||
|         } | ||||
|       }); | ||||
|     }, | ||||
|     save() { | ||||
|       this.$refs["rules"].validate((valid) => { | ||||
|         if (valid) { | ||||
|           this.instance | ||||
|             .post( | ||||
|               `/app/appgirdmemberinfo/addOrUpdate`, | ||||
|               { | ||||
|                 ...this.forms, | ||||
|               }, | ||||
|               null | ||||
|             ) | ||||
|             .then((res) => { | ||||
|               if (res.code == 0) { | ||||
|                 if (this.title == "添加网格员") { | ||||
|                   this.cancel(true) | ||||
|                 } else { | ||||
|                   this.editOne = false; | ||||
|                   this.editTwo = false; | ||||
|                   this.searchDetail(); | ||||
|                 } | ||||
|               } | ||||
|             }); | ||||
|         } else { | ||||
|           console.log("error submit!!"); | ||||
|           return false; | ||||
|         } | ||||
|       }); | ||||
|     }, | ||||
|     searchDetail() { | ||||
|       this.instance | ||||
|         .post(`/app/appgirdmemberinfo/queryDetailById`, null, { | ||||
|           params: { id: this.params.id }, | ||||
|         }) | ||||
|         .then((res) => { | ||||
|           if (res.code == 0) { | ||||
|             this.forms = { ...res.data }; | ||||
|             this.photoList = [{ url: this.forms.photo }]; | ||||
|           } | ||||
|         }); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
|  | ||||
| <style lang="scss" scoped> | ||||
| .add { | ||||
|   height: 100%; | ||||
|   .ai-detail__title { | ||||
|     background-color: #fff; | ||||
|   } | ||||
|   .ai-detail__content { | ||||
|     .ai-detail__content--wrapper { | ||||
|       .el-form { | ||||
|         // background-color: #fff; | ||||
|         // padding: 0 60px; | ||||
|         .flex { | ||||
|           display: flex; | ||||
|           flex-wrap: wrap; | ||||
|           justify-content: space-between; | ||||
|           .el-form-item { | ||||
|             width: 48%; | ||||
|           } | ||||
|           .buildingTypes { | ||||
|             width: 100%; | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|   ::v-deep .el-tag { | ||||
|     margin-right: 8px; | ||||
|     color: #333333; | ||||
|   } | ||||
|   .footer-btn { | ||||
|     width: 92px; | ||||
|   } | ||||
|   .above{ | ||||
|     display: flex; | ||||
|     .left, .right{ | ||||
|       flex: 1; | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </style> | ||||
							
								
								
									
										220
									
								
								packages/2.0.5/AppGridMember/components/list.vue
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										220
									
								
								packages/2.0.5/AppGridMember/components/list.vue
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,220 @@ | ||||
| <template> | ||||
|   <ai-list class="list"> | ||||
|     <template slot="title"> | ||||
|       <ai-title title="网格员管理" :isShowBottomBorder="true"></ai-title> | ||||
|     </template> | ||||
|     <template slot="content"> | ||||
|       <ai-search-bar> | ||||
|         <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="网格员/网格名称" | ||||
|             @keyup.enter.native="(page.current = 1), getList()" | ||||
|             clearable | ||||
|             prefix-icon="iconfont iconSearch" | ||||
|           /> | ||||
|           <el-button | ||||
|             type="primary" | ||||
|             icon="iconfont iconSearch" | ||||
|             size="small" | ||||
|             @click="(page.current = 1), getList()" | ||||
|             >查询</el-button | ||||
|           > | ||||
|           <el-button | ||||
|             icon="el-icon-refresh-right" | ||||
|             size="small" | ||||
|             @click="resetSearch" | ||||
|             >重置</el-button | ||||
|           > | ||||
|         </template> | ||||
|       </ai-search-bar> | ||||
|       <ai-search-bar style="padding: 16px 0"> | ||||
|         <template slot="left"> | ||||
|           <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 | ||||
|           > | ||||
|           <!-- <ai-download :instance="instance" url="/app/appgirdinfo/downloadGirdInfo" :params="{...searchObj,ids}" fileName="网格区块"> | ||||
|                           <el-button  icon="iconfont iconExported" size="small">导出全部</el-button> | ||||
|                       </ai-download>                         | ||||
|                       <ai-import | ||||
|                           ref="import" | ||||
|                           style="margin-top: -8px;" | ||||
|                           title="导入" | ||||
|                           name="网格区块" | ||||
|                           url="/app/appgirdinfo/downloadGirdInfo" | ||||
|                           importUrl="/app/appgirdinfo/importGirdInfo" | ||||
|                           suffixName="xlsx" | ||||
|                           :customCliker="true" | ||||
|                           :instance="instance"> | ||||
|                           <template slot="tips"> | ||||
|                               <p>如果表格中已经存在数据,则会被本次导入的数据覆盖;不存在数据,系统将生成新的标准记录;</p> | ||||
|                           </template> | ||||
|                           <el-button  size="small" icon="iconfont iconImport">导入</el-button> | ||||
|                       </ai-import> --> | ||||
|         </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()" | ||||
|       > | ||||
|         <el-table-column label="操作" slot="options" align="center"> | ||||
|           <template v-slot="{ row }"> | ||||
|             <el-button type="text" @click="add(row.id)">查看</el-button> | ||||
|             <el-button type="text" @click="deleteById(row.id)">删除</el-button> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|       </ai-table> | ||||
|     </template> | ||||
|   </ai-list> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| export default { | ||||
|   name: "list", | ||||
|   label: "网格员管理", | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     dict: Object, | ||||
|     permissions: Function, | ||||
|   }, | ||||
|   data() { | ||||
|     return { | ||||
|       searchObj: { | ||||
|         name: "", | ||||
|         selectionDate: "", | ||||
|       }, | ||||
|       page: { | ||||
|         current: 1, | ||||
|         size: 10, | ||||
|         total: 0, | ||||
|       }, | ||||
|       goAdd: false, | ||||
|       tableData: [], | ||||
|       fileList: [], | ||||
|       ids: [], | ||||
|       detail: {}, | ||||
|     }; | ||||
|   }, | ||||
|   created() { | ||||
|     this.dict.load("sex", "girdMemberType", "politicsStatus", "education"); | ||||
|     this.getList(); | ||||
|   }, | ||||
|   computed: { | ||||
|     colConfigs() { | ||||
|       let _ = this; | ||||
|       return [ | ||||
|         { | ||||
|           type: "selection", | ||||
|         }, | ||||
|         { | ||||
|           prop: "name", | ||||
|           align: "center", | ||||
|           label: "网格员姓名", | ||||
|         }, | ||||
|         { | ||||
|           prop: "girdInfoListStr", | ||||
|           align: "left", | ||||
|           label: "责任网格", | ||||
|         }, | ||||
|         { | ||||
|           prop: "phone", | ||||
|           align: "left", | ||||
|           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; | ||||
|           } | ||||
|         }); | ||||
|     }, | ||||
|     deleteById(ids) { | ||||
|       ids && | ||||
|         this.$confirm("是否要删除该网格员?", { | ||||
|           type: "error", | ||||
|         }) | ||||
|           .then(() => { | ||||
|             this.instance | ||||
|               .post("/app/appgirdmemberinfo/delete", null, { | ||||
|                 params: { ids }, | ||||
|               }) | ||||
|               .then((res) => { | ||||
|                 if (res?.code == 0) { | ||||
|                   this.$message.success("删除成功!"); | ||||
|                   this.getList(); | ||||
|                 } | ||||
|               }); | ||||
|           }) | ||||
|           .catch(() => {}); | ||||
|     }, | ||||
|     add(id) { | ||||
|       this.$emit('change', { | ||||
|         type: 'Add', | ||||
|         params: { | ||||
|           id: id || '' | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     handleSelectionChange(val) { | ||||
|       this.ids = []; | ||||
|       val.map((e) => { | ||||
|         this.ids.push(e.id); | ||||
|       }); | ||||
|     }, | ||||
|     resetSearch() { | ||||
|       Object.keys(this.searchObj).map((e) => { | ||||
|         this.searchObj[e] = ""; | ||||
|       }); | ||||
|       this.getList(); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
|  | ||||
| <style lang="scss" scoped> | ||||
| </style> | ||||
		Reference in New Issue
	
	Block a user