代码迁移
This commit is contained in:
		
							
								
								
									
										69
									
								
								project/biaopin/AppResidentInfo/AppResidentInfo.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										69
									
								
								project/biaopin/AppResidentInfo/AppResidentInfo.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,69 @@ | ||||
| <template> | ||||
|   <div class="AppHelp"> | ||||
|     <keep-alive :include="['List']"> | ||||
|       <component ref="component" :permissions="permissions" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component> | ||||
|     </keep-alive> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
|   import Add from './components/Add' | ||||
|   import List from './components/List' | ||||
|   import Detail from './components/Detail' | ||||
|  | ||||
|   export default { | ||||
|     name: 'AppResidentInfo', | ||||
|     label: '居民信息', | ||||
|  | ||||
|     props: { | ||||
|       instance: Function, | ||||
|       dict: Object, | ||||
|       permissions: Function | ||||
|     }, | ||||
|  | ||||
|     data () { | ||||
|       return { | ||||
|         component: 'List', | ||||
|         params: {}, | ||||
|         include: [] | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     components: { | ||||
|       Add, | ||||
|       List, | ||||
|       Detail | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       onChange (data) { | ||||
|         if (data.type === 'Add') { | ||||
|           this.component = 'Add' | ||||
|           this.params = data.params | ||||
|         } | ||||
|  | ||||
|         if (data.type === 'Detail') { | ||||
|           this.component = 'Detail' | ||||
|           this.params = data.params | ||||
|         } | ||||
|  | ||||
|         if (data.type === 'List') { | ||||
|           this.component = 'List' | ||||
|           this.params = data.params | ||||
|  | ||||
|           this.$nextTick(() => { | ||||
|             this.$refs.component.getList() | ||||
|           }) | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| <style lang="scss"> | ||||
|   .AppHelp { | ||||
|     height: 100%; | ||||
|     background: #F3F6F9; | ||||
|     overflow: auto; | ||||
|   } | ||||
| </style> | ||||
							
								
								
									
										717
									
								
								project/biaopin/AppResidentInfo/components/Add.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										717
									
								
								project/biaopin/AppResidentInfo/components/Add.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,717 @@ | ||||
| <template> | ||||
|   <ai-detail class="residentDetail"> | ||||
|     <ai-title slot="title" :title="pageTitle" isShowBack @onBackClick="back" isShowBottomBorder> | ||||
|       <template v-if="params.type === 'Detail'" #rightBtn> | ||||
|         <el-button icon="iconfont iconDelete" @click="handleDelete()"> | ||||
|           删除人员 | ||||
|         </el-button> | ||||
|       </template> | ||||
|     </ai-title> | ||||
|     <template #content> | ||||
|       <el-form class="content-right" :model="baseInfo" ref="ruleForm" :rules="rules" label-width="130px" | ||||
|                 label-position="right" size="small"> | ||||
|         <template v-if="params.type === 'Detail'"> | ||||
|             <ai-edit-card slot="" :title="baseInfo.name||'基本信息'" :show-btn="permissions('app_appresident_edit')" | ||||
|                           @save="saveFrom" @cancel="getDetail(baseInfo.id)"> | ||||
|               <template #edit> | ||||
|                 <el-row type="flex"> | ||||
|                   <div class="fill"> | ||||
|                     <el-form-item label="姓名:" prop="name"> | ||||
|                       <el-input | ||||
|                           v-model="baseInfo.name" | ||||
|                           autocomplete="off" | ||||
|                           placeholder="请输入姓名" | ||||
|                           maxlength="20" | ||||
|                           :disabled="isEdit" | ||||
|                           show-word-limit/> | ||||
|                     </el-form-item> | ||||
|                     <el-form-item label="身份证号:" prop="idNumber"> | ||||
|                       <el-input v-model="baseInfo.idNumber" placeholder="请输入身份证号" :maxlength="18" show-word-limit | ||||
|                                 @change="idChange" :disabled="isEdit"/> | ||||
|                     </el-form-item> | ||||
|                     <el-form-item label="性别:" prop="sex"> | ||||
|                       <ai-select v-model="baseInfo.sex" :selectList="dict.getDict('sex')" :disabled="isEdit"/> | ||||
|                     </el-form-item> | ||||
|                   </div> | ||||
|                   <el-form-item label="个人照片:" prop="photo" class="fill"> | ||||
|                     <ai-avatar :instance="instance" v-model="baseInfo.photo"/> | ||||
|                   </el-form-item> | ||||
|                 </el-row> | ||||
|                 <el-row type="flex"> | ||||
|                   <div class="fill"> | ||||
|                     <el-form-item label="出生日期:"> | ||||
|                       <el-date-picker | ||||
|                           disabled | ||||
|                           :editable="false" | ||||
|                           value-format="yyyy-MM-dd HH:mm:ss" | ||||
|                           format="yyyy-MM-dd" | ||||
|                           v-model="baseInfo.birthday" | ||||
|                           type="date" | ||||
|                           placeholder="选择日期" | ||||
|                       /> | ||||
|                     </el-form-item> | ||||
|                     <el-form-item label="文化程度:" prop="education"> | ||||
|                       <ai-select v-model="baseInfo.education" :selectList="dict.getDict('education')"/> | ||||
|                     </el-form-item> | ||||
|                     <el-form-item label="政治面貌:" prop="politicsStatus"> | ||||
|                       <ai-select v-model="baseInfo.politicsStatus" :selectList="dict.getDict('politicsStatus')"/> | ||||
|                     </el-form-item> | ||||
|                     <el-form-item label="职业:" prop="job"> | ||||
|                       <ai-select v-model="baseInfo.job" :selectList="dict.getDict('job')"/> | ||||
|                     </el-form-item> | ||||
|                     <el-form-item label="宗教信仰:" prop="faithType"> | ||||
|                       <ai-select v-model="baseInfo.faithType" :selectList="dict.getDict('faithType')"/> | ||||
|                     </el-form-item> | ||||
|                   </div> | ||||
|                   <div class="fill"> | ||||
|                     <el-form-item label="年龄:" prop="age"> | ||||
|                       <el-input | ||||
|                           disabled | ||||
|                           v-model="baseInfo.age" | ||||
|                           autocomplete="off" | ||||
|                           size="small" | ||||
|                           placeholder="请输入年龄" | ||||
|                           type="number" | ||||
|                           @mousewheel.native.prevent | ||||
|                       /> | ||||
|                       <!-- <p v-else>{{baseInfo.age}}</p> --> | ||||
|                     </el-form-item> | ||||
|                     <el-form-item label="民族:" prop="nation"> | ||||
|                       <ai-select v-model="baseInfo.nation" :selectList="dict.getDict('nation')"/> | ||||
|                     </el-form-item> | ||||
|                     <el-form-item label="婚姻状况:" prop="maritalStatus"> | ||||
|                       <ai-select v-model="baseInfo.maritalStatus" :selectList="dict.getDict('maritalStatus')"/> | ||||
|                     </el-form-item> | ||||
|                     <el-form-item label="兵役状况:" prop="militaryStatus"> | ||||
|                       <ai-select v-model="baseInfo.militaryStatus" :selectList="dict.getDict('militaryStatus')"/> | ||||
|                     </el-form-item> | ||||
|                   </div> | ||||
|                 </el-row> | ||||
|                 <el-form-item label="籍贯:" prop=" birthplaceAreaId"> | ||||
|                   <ai-area-select | ||||
|                       clearable | ||||
|                       always-show | ||||
|                       :instance="instance" | ||||
|                       v-model="baseInfo.birthplaceAreaId" | ||||
|                       :areaLevel="3" | ||||
|                   /> | ||||
|                 </el-form-item> | ||||
|               </template> | ||||
|               <template> | ||||
|                 <ai-card title="基本信息"> | ||||
|                   <ai-wrapper class="fill" slot="content"> | ||||
|                     <ai-info-item label="性别" :value="dict.getLabel('sex', baseInfo.sex)"/> | ||||
|                     <ai-info-item label="身份证号"> | ||||
|                       <ai-id mode="show" v-model="baseInfo.idNumber" right-btn class="line-center"/> | ||||
|                     </ai-info-item> | ||||
|                     <ai-info-item label="出生日期" :value="baseInfo.birthday"/> | ||||
|                     <ai-info-item label="年龄" :value="baseInfo.age"/> | ||||
|                     <ai-info-item label="籍贯" :value="baseInfo.birthplaceAreaName"/> | ||||
|                     <ai-info-item label="民族" :value="dict.getLabel('nation', baseInfo.nation)"/> | ||||
|                     <ai-info-item label="文化程度" :value="dict.getLabel('education', baseInfo.education)"/> | ||||
|                     <ai-info-item label="婚姻状况" :value="dict.getLabel('maritalStatus', baseInfo.maritalStatus)"/> | ||||
|                     <ai-info-item label="政治面貌" :value="dict.getLabel('politicsStatus', baseInfo.politicsStatus)"/> | ||||
|                     <ai-info-item label="兵役状况" :value="dict.getLabel('militaryStatus', baseInfo.militaryStatus)"/> | ||||
|                     <ai-info-item label="宗教信仰" :value="dict.getLabel('faithType', baseInfo.faithType)"/> | ||||
|                     <ai-info-item label="职业" :value="dict.getLabel('job', baseInfo.job)"/> | ||||
|                   </ai-wrapper> | ||||
|                   <ai-avatar v-model="baseInfo.photo" :editable="false"/> | ||||
|                 </ai-card> | ||||
|               </template> | ||||
|             </ai-edit-card> | ||||
|             <ai-edit-card title="联络信息" | ||||
|                           @save="saveFrom" @cancel="getDetail(baseInfo.id)"> | ||||
|               <template #edit> | ||||
|                 <el-form-item label="联系方式:" prop="phone"> | ||||
|                   <el-input v-model="baseInfo.phone" size="small" placeholder="请输入联系方式" :maxlength="11" | ||||
|                             show-word-limit/> | ||||
|                 </el-form-item> | ||||
|                 <el-form-item label="现住址:" prop="currentAreaId"> | ||||
|                   <ai-area-select clearable always-show :instance="instance" :disabled-level="disabledLevel" | ||||
|                                   v-model="baseInfo.currentAreaId" :valueLevel="4"/> | ||||
|                   <el-form-item> | ||||
|                     <el-input v-model="baseInfo.currentAddress" placeholder="详细地址" maxlength="30" show-word-limit | ||||
|                               clearable/> | ||||
|                   </el-form-item> | ||||
|                 </el-form-item> | ||||
|               </template> | ||||
|               <template> | ||||
|                 <ai-card title="联络信息" type="flex"> | ||||
|                   <ai-wrapper slot="content"> | ||||
|                     <ai-info-item label="联系方式" :value="baseInfo.phone"/> | ||||
|                     <ai-info-item label="现住址" isLine | ||||
|                                   :value="[baseInfo.currentAreaName, baseInfo.currentAddress].join('')"/> | ||||
|                   </ai-wrapper> | ||||
|                 </ai-card> | ||||
|               </template> | ||||
|             </ai-edit-card> | ||||
|             <ai-edit-card title="户籍信息" | ||||
|                           @save="saveFrom" @cancel="getDetail(baseInfo.id)"> | ||||
|               <template #edit> | ||||
|                 <el-row type="flex"> | ||||
|                   <div class="fill"> | ||||
|                     <el-form-item label="是否户主:" prop="householdName"> | ||||
|                       <ai-select v-model="baseInfo.householdName" :selectList="dict.getDict('householdName')" | ||||
|                                   @change="householdRelationChange"/> | ||||
|                     </el-form-item> | ||||
|                     <el-form-item label="与户主关系:" prop="householdRelation" v-if="baseInfo.householdName==0"> | ||||
|                       <ai-select v-model="baseInfo.householdRelation" | ||||
|                                   :selectList="dict.getDict('householdRelation')"/> | ||||
|                     </el-form-item> | ||||
|                   </div> | ||||
|                   <div class="fill"> | ||||
|                     <el-form-item label="户主身份证号:" prop="householdIdNumber" v-if="baseInfo.householdName==0"> | ||||
|                       <el-input v-model="baseInfo.householdIdNumber" placeholder="请输入户主身份证号" :maxlength="18" | ||||
|                                 clearable/> | ||||
|                     </el-form-item> | ||||
|                   </div> | ||||
|                 </el-row> | ||||
|                 <el-form-item label="户籍地:" prop="householdAreaId"> | ||||
|                   <ai-area-select clearable always-show :instance="instance" v-model="baseInfo.householdAreaId"/> | ||||
|                   <el-form-item v-if="baseInfo.householdAreaId"> | ||||
|                     <el-input v-model="baseInfo.householdAddress" placeholder="详细地址" maxlength="30" show-word-limit | ||||
|                               clearable/> | ||||
|                   </el-form-item> | ||||
|                 </el-form-item> | ||||
|               </template> | ||||
|               <template> | ||||
|                 <ai-card title="户籍信息"> | ||||
|                   <ai-wrapper slot="content"> | ||||
|                     <ai-info-item label="是否户主" :value="dict.getLabel('householdName', baseInfo.householdName)"/> | ||||
|                     <template v-if="baseInfo.householdName==0"> | ||||
|                       <ai-info-item label="与户主关系" | ||||
|                                     :value="dict.getLabel('householdRelation', baseInfo.householdRelation)"/> | ||||
|                       <ai-info-item label="户主身份证号" :value="baseInfo.householdIdNumber"/> | ||||
|                     </template> | ||||
|                     <ai-info-item label="户籍地" isLine | ||||
|                                   :value="[baseInfo.householdAreaName, baseInfo.householdAddress].join('')"/> | ||||
|                   </ai-wrapper> | ||||
|                 </ai-card> | ||||
|               </template> | ||||
|             </ai-edit-card> | ||||
|         </template> | ||||
|         <template v-else> | ||||
|           <ai-card title="基本信息"> | ||||
|             <template #content> | ||||
|               <el-row type="flex"> | ||||
|                 <div class="fill"> | ||||
|                   <el-form-item label="姓名:" prop="name"> | ||||
|                     <el-input | ||||
|                         v-model="baseInfo.name" | ||||
|                         autocomplete="off" | ||||
|                         size="small" | ||||
|                         placeholder="请输入姓名" | ||||
|                         maxlength="20" | ||||
|                         show-word-limit/> | ||||
|                   </el-form-item> | ||||
|                   <el-form-item label="身份证号:" prop="idNumber"> | ||||
|                     <el-input v-model="baseInfo.idNumber" placeholder="请输入身份证号" :maxlength="18" show-word-limit /> | ||||
|                   </el-form-item> | ||||
|                   <el-form-item label="性别:" prop="sex"> | ||||
|                     <ai-select v-model="baseInfo.sex" :selectList="dict.getDict('sex')"/> | ||||
|                   </el-form-item> | ||||
|                 </div> | ||||
|                 <el-form-item label="个人照片:" prop="photo" class="fill"> | ||||
|                   <ai-avatar :instance="instance" v-model="baseInfo.photo"/> | ||||
|                 </el-form-item> | ||||
|               </el-row> | ||||
|               <el-row type="flex"> | ||||
|                 <div class="fill"> | ||||
|                   <el-form-item label="出生日期:"> | ||||
|                     <el-date-picker | ||||
|                       value-format="yyyy-MM-dd HH:mm:ss" | ||||
|                       format="yyyy-MM-dd" | ||||
|                       v-model="baseInfo.birthday" | ||||
|                       type="date" | ||||
|                       placeholder="选择日期" | ||||
|                     /> | ||||
|                   </el-form-item> | ||||
|                   <el-form-item label="文化程度:" prop="education"> | ||||
|                     <ai-select v-model="baseInfo.education" :selectList="dict.getDict('education')"/> | ||||
|                   </el-form-item> | ||||
|                   <el-form-item label="政治面貌:" prop="politicsStatus"> | ||||
|                     <ai-select v-model="baseInfo.politicsStatus" :selectList="dict.getDict('politicsStatus')"/> | ||||
|                   </el-form-item> | ||||
|                   <el-form-item label="职业:" prop="job"> | ||||
|                     <ai-select v-model="baseInfo.job" :selectList="dict.getDict('job')"/> | ||||
|                   </el-form-item> | ||||
|                   <el-form-item label="宗教信仰:" prop="faithType"> | ||||
|                     <ai-select v-model="baseInfo.faithType" :selectList="dict.getDict('faithType')"/> | ||||
|                   </el-form-item> | ||||
|                 </div> | ||||
|                 <div class="fill"> | ||||
|                   <el-form-item label="年龄:" prop="age"> | ||||
|                     <el-input | ||||
|                       v-model="baseInfo.age" | ||||
|                       size="small" | ||||
|                       placeholder="请输入年龄" | ||||
|                       type="number" | ||||
|                     /> | ||||
|                     <!-- <p v-else>{{baseInfo.age}}</p> --> | ||||
|                   </el-form-item> | ||||
|                   <el-form-item label="民族:" prop="nation"> | ||||
|                     <ai-select v-model="baseInfo.nation" :selectList="dict.getDict('nation')"/> | ||||
|                   </el-form-item> | ||||
|                   <el-form-item label="婚姻状况:" prop="maritalStatus"> | ||||
|                     <ai-select v-model="baseInfo.maritalStatus" :selectList="dict.getDict('maritalStatus')"/> | ||||
|                   </el-form-item> | ||||
|                   <el-form-item label="兵役状况:" prop="militaryStatus"> | ||||
|                     <ai-select v-model="baseInfo.militaryStatus" :selectList="dict.getDict('militaryStatus')"/> | ||||
|                   </el-form-item> | ||||
|                 </div> | ||||
|               </el-row> | ||||
|               <el-form-item label="籍贯:" prop=" birthplaceAreaId"> | ||||
|                 <ai-area-select | ||||
|                     clearable | ||||
|                     always-show | ||||
|                     :instance="instance" | ||||
|                     v-model="baseInfo.birthplaceAreaId" | ||||
|                     :areaLevel="3" | ||||
|                 /> | ||||
|               </el-form-item> | ||||
|             </template> | ||||
|           </ai-card> | ||||
|           <ai-card title="联络信息"> | ||||
|             <template #content> | ||||
|               <el-form-item label="联系方式:" prop="phone"> | ||||
|                 <el-input v-model="baseInfo.phone" size="small" placeholder="请输入联系方式" :maxlength="11" | ||||
|                           show-word-limit/> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="现住址:" prop="currentAreaId"> | ||||
|                 <ai-area-select clearable always-show :instance="instance" :disabled-level="disabledLevel" | ||||
|                                 v-model="baseInfo.currentAreaId" :valueLevel="4"/> | ||||
|                 <el-form-item> | ||||
|                   <el-input v-model="baseInfo.currentAddress" placeholder="详细地址" maxlength="30" show-word-limit | ||||
|                             clearable/> | ||||
|                 </el-form-item> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="所属网格" prop="girdName" required> | ||||
|                 <ai-picker | ||||
|                   :instance="instance" | ||||
|                   dialogTitle="选择所属网格" | ||||
|                   :ops="{label: 'girdName', id: 'id'}" | ||||
|                   pageTitle="所属网格" | ||||
|                   :action="'/app/appgirdinfo/girdList'" | ||||
|                   v-model="baseInfo.girdId" | ||||
|                   @pick="onPick"> | ||||
|                   <div class="AppAnnounceDetail-select"> | ||||
|                     <el-input size="small" class="AppAnnounceDetail-select__input" placeholder="请选择..." disabled v-model="baseInfo.girdName"></el-input> | ||||
|                     <div class="select-left" v-if="girdList.length"> | ||||
|                       <span v-for="(item, index) in girdList" :key="index">{{ item.girdName }}</span> | ||||
|                     </div> | ||||
|                     <i v-if="!girdList.length">请选择网格</i> | ||||
|                     <div class="select-right">{{ girdList.length ? '重新选择' : '选择网格' }}</div> | ||||
|                   </div> | ||||
|                 </ai-picker> | ||||
|               </el-form-item> | ||||
|             </template> | ||||
|           </ai-card> | ||||
|           <ai-card title="户籍信息"> | ||||
|             <template #content> | ||||
|               <el-row type="flex"> | ||||
|                 <div class="fill"> | ||||
|                   <el-form-item label="是否户主:" prop="isHousehold"> | ||||
|                     <ai-select v-model="baseInfo.isHousehold" :selectList="dict.getDict('householdName')" | ||||
|                                 @change="householdRelationChange"/> | ||||
|                   </el-form-item> | ||||
|                   <el-form-item label="与户主关系:" prop="householdRelation" v-if="baseInfo.isHousehold==0"> | ||||
|                     <ai-select v-model="baseInfo.householdRelation" :selectList="dict.getDict('householdRelation')"/> | ||||
|                   </el-form-item> | ||||
|                 </div> | ||||
|                 <div class="fill"> | ||||
|                   <el-form-item label="户主身份证号:" prop="householdIdNumber" v-if="baseInfo.isHousehold==0"> | ||||
|                     <el-input v-model="baseInfo.householdIdNumber" placeholder="请输入户主身份证号" :maxlength="18" | ||||
|                               clearable/> | ||||
|                   </el-form-item> | ||||
|                 </div> | ||||
|               </el-row> | ||||
|               <el-form-item label="户籍地:" prop="householdAreaId"> | ||||
|                 <ai-area-select clearable always-show :instance="instance" v-model="baseInfo.householdAreaId"/> | ||||
|                 <el-form-item v-if="baseInfo.householdAreaId"> | ||||
|                   <el-input v-model="baseInfo.householdAddress" placeholder="详细地址" maxlength="30" show-word-limit | ||||
|                             clearable/> | ||||
|                 </el-form-item> | ||||
|               </el-form-item> | ||||
|             </template> | ||||
|           </ai-card> | ||||
|         </template> | ||||
|       </el-form> | ||||
|     </template> | ||||
|     <template v-if="params.type !== 'Detail'" #footer> | ||||
|       <el-button @click="back">取消</el-button> | ||||
|       <el-button type="primary" @click="saveFrom()">保存</el-button> | ||||
|     </template> | ||||
|   </ai-detail> | ||||
| </template> | ||||
| <script> | ||||
| import {mapState} from "vuex"; | ||||
| import {ID} from "dui/lib/js/utils"; | ||||
|  | ||||
| export default { | ||||
|   name: "Add", | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     dict: Object, | ||||
|     permissions: Function, | ||||
|     params: Object, | ||||
|     name: {default: ""} | ||||
|   }, | ||||
|   data() { | ||||
|     let IdNumberPass = (rule, value, callback) => { | ||||
|       if (value) { | ||||
|         if (ID.check(value)) { | ||||
|           callback(); | ||||
|         } else { | ||||
|           callback(new Error("身份证号格式错误")); | ||||
|         } | ||||
|       } else { | ||||
|         callback(new Error("请输入身份证号")); | ||||
|       } | ||||
|     }; | ||||
|     return { | ||||
|       buildingCascader: true, | ||||
|       houseCascader: true, | ||||
|       navId: 0, | ||||
|       girdList: [], | ||||
|       baseInfo: { | ||||
|         registerStatus: "", | ||||
|         tips: [], | ||||
|         age: "", | ||||
|         girdName: '', | ||||
|         girdId: [], | ||||
|         birthplaceAreaId: "", | ||||
|         currentAddress: "", | ||||
|         currentAreaId: "", | ||||
|         education: "", | ||||
|         faithType: "", | ||||
|         fileStatus: "", | ||||
|         householdAddress: "", | ||||
|         householdAreaId: "", | ||||
|         householdIdNumber: "", | ||||
|         isHousehold: "", | ||||
|         householdRelation: "", | ||||
|         id: "", | ||||
|         idNumber: "", | ||||
|         job: "", | ||||
|         logoutDescription: "", | ||||
|         logoutReason: "", | ||||
|         logoutTime: "", | ||||
|         logoutUserId: "", | ||||
|         maritalStatus: "", | ||||
|         militaryStatus: "", | ||||
|         name: "", | ||||
|         nation: "", | ||||
|         phone: "", | ||||
|         photo: "", | ||||
|         politicsStatus: "", | ||||
|         sex: "", | ||||
|         tsrqInfos: [] | ||||
|       }, | ||||
|       family: [], | ||||
|       familyInfo: {}, | ||||
|       writeInfo: { | ||||
|         id: "", | ||||
|         logoutReason: "", | ||||
|         logoutDescription: "", | ||||
|         fileStatus: "1" | ||||
|       }, | ||||
|       rules: { | ||||
|         name: [{required: true, message: "请输入姓名", trigger: "blur"}], | ||||
|         idNumber: [ | ||||
|           {required: true, message: "请输入身份证号", trigger: "blur"} | ||||
|         ], | ||||
|         sex: [{required: true, message: "请选择性别", trigger: "change"}], | ||||
|         currentAreaId: [{message: "请选择现住址", required: true, trigger: "change"}, | ||||
|           { | ||||
|             validator: (r, v, cb) => { | ||||
|               if (/.+0{3}$/.test(v)) { | ||||
|                 cb("现住址必须选到村级") | ||||
|               } else cb() | ||||
|             }, trigger: "blur" | ||||
|           }], | ||||
|         currentAddress: [{message: "请选择现住址详细地址", required: true}], | ||||
|         householdAreaId: [ | ||||
|           { | ||||
|             validator: (r, v, cb) => { | ||||
|               if (/.+0{3}$/.test(v) && v) { | ||||
|                 cb("户籍地必须选到村级") | ||||
|               } else cb() | ||||
|             }, trigger: "blur" | ||||
|           } | ||||
|         ], | ||||
|         phone: [ | ||||
|           {required: true, message: "请输入联系方式", trigger: "blur"} | ||||
|         ], | ||||
|         girdName: [ | ||||
|           {required: true, message: "请选择网格", trigger: "change"} | ||||
|         ], | ||||
|         isHousehold: [ | ||||
|           {required: true, message: "请选择是否户主", trigger: "change"} | ||||
|         ], | ||||
|         householdRelation: [ | ||||
|           {required: true, message: "请选择与户主关系", trigger: "change"} | ||||
|         ], | ||||
|         householdIdNumber: [ | ||||
|           {required: true, message: "请输入身份证号", trigger: "blur"} | ||||
|         ], | ||||
|         householdAddress: [ | ||||
|           {required: true, message: "请选择户籍地详细地址", trigger: "blur"} | ||||
|         ] | ||||
|       }, | ||||
|       imgUrl: "", | ||||
|       fileList: [], | ||||
|       disabledLevel: 0, | ||||
|       currentTab: "0" | ||||
|     }; | ||||
|   }, | ||||
|   computed: { | ||||
|     ...mapState(["user"]), | ||||
|     isEdit() { | ||||
|       return this.params.type === 'Edit' | ||||
|     }, | ||||
|     pageTitle() { | ||||
|       return { | ||||
|         Edit: '编辑居民信息', | ||||
|         Add: '添加居民信息', | ||||
|         Detail: '居民信息详情' | ||||
|       }[this.params.type] | ||||
|     }, | ||||
|     hasSpecial() { | ||||
|       //是否有特殊人员信息 | ||||
|       return this.baseInfo.tsrqInfos?.length > 0 | ||||
|     }, | ||||
|     colConfigs() { | ||||
|       return [ | ||||
|         { | ||||
|           label: "与户主关系", align: 'center', | ||||
|           render: (h, {row}) => h('p', this.dict.getLabel('householdRelation', row.householdRelation)) | ||||
|         }, | ||||
|         {label: "姓名", prop: "name"}, | ||||
|         {label: "性别", prop: "sex", dict: "sex", align: 'center'}, | ||||
|         {label: "年龄", prop: "age", align: 'center'}, | ||||
|         {label: "身份证号", render: (h, {row}) => h('p', ID.hideId(row.idNumber))}, | ||||
|         {slot: "options"} | ||||
|       ] | ||||
|     } | ||||
|   }, | ||||
|   methods: { | ||||
|     back() { | ||||
|       this.$emit('change', { | ||||
|         type: 'List' | ||||
|       }) | ||||
|     }, | ||||
|     onPick (e) { | ||||
|       if (e.length) { | ||||
|         this.baseInfo.girdName = e[0].girdName | ||||
|       } else { | ||||
|         this.baseInfo.girdName = '' | ||||
|         this.baseInfo.girdId = [] | ||||
|       } | ||||
|  | ||||
|       this.girdList = e | ||||
|     }, | ||||
|     householdRelationChange() { | ||||
|       this.baseInfo.householdIdNumber = ""; | ||||
|       this.baseInfo.householdRelation = ""; | ||||
|     }, | ||||
|     saveFrom(cb) { | ||||
|       this.$refs.ruleForm.validate(v => { | ||||
|         if (v) { | ||||
|           this.saveFromFn().then(() => { | ||||
|             if (cb) { | ||||
|               cb() | ||||
|               this.getDetail() | ||||
|             } else { | ||||
|               this.back() | ||||
|             } | ||||
|           }); | ||||
|         } | ||||
|       }); | ||||
|     }, | ||||
|  | ||||
|     familyInit() { | ||||
|       Object.keys(this.writeInfo).forEach(e => { | ||||
|         this.writeInfo[e] = ""; | ||||
|       }); | ||||
|       this.$refs.writeInfo.resetFields(); | ||||
|     }, | ||||
|     saveFromFn() { | ||||
|       let {currentHouseList, householdHouseList, tips} = this.baseInfo | ||||
|       return this.instance.post(`/app/appresidentapplet/addOrUpdate`, { | ||||
|         residentType: this.$route.query.type, | ||||
|         ...this.baseInfo, | ||||
|         currentHouseList: currentHouseList?.join("|"), | ||||
|         householdHouseList: householdHouseList?.join("|"), | ||||
|         tips: tips?.join("|"), | ||||
|         girdId: this.baseInfo.girdId[0] | ||||
|       }).then(res => { | ||||
|         if (res?.code == 0) { | ||||
|           this.$message.success("保存成功"); | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     getDetail() { | ||||
|       this.instance.post(`/app/appresidentapplet/queryDetailById?id=${this.params.id}`).then(res => { | ||||
|         if (res?.data) { | ||||
|           this.baseInfo = { | ||||
|             ...res.data, | ||||
|             girdId: [res.data.girdId] | ||||
|           }; | ||||
|           this.girdList = [{ | ||||
|             id: res.data.girdId, | ||||
|             girdName: res.data.girdName | ||||
|           }] | ||||
|         } | ||||
|       }); | ||||
|     }, | ||||
|     handleDelete() { | ||||
|       this.$confirm("删掉档案后,\n" + | ||||
|           `<span class="username">${this.baseInfo.name}</span>` + | ||||
|           "        的历史相关信息可能无法追溯查看,是否确定删除该人员档案?", { | ||||
|         title: "档案删除" | ||||
|       }).then(() => { | ||||
|         this.instance.post(`/app/appresidentapplet/delete?ids=${this.baseInfo.id}`).then(res => { | ||||
|           if (res && res.code == 0) { | ||||
|             this.$message.success("删除成功"); | ||||
|             this.$router.push({query: {}}); | ||||
|           } | ||||
|         }); | ||||
|       }).catch(() => 0) | ||||
|     }, | ||||
|     idChange(val) { | ||||
|       if (val.length == 18) { | ||||
|         this.IdCard(val); | ||||
|       } | ||||
|     }, | ||||
|     IdCard(UUserCard) { | ||||
|       if (UUserCard) { | ||||
|         const idCard = new ID(UUserCard) | ||||
|         this.baseInfo.age = idCard.age | ||||
|         this.baseInfo.sex = idCard.sex | ||||
|         this.baseInfo.birthday = idCard.birthday | ||||
|       } | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|     this.$dict.load(['sex', 'education', 'politicsStatus', 'job', 'faithType', 'nation', 'maritalStatus', 'militaryStatus', 'householdName', 'householdRelation', ]).then(()=> { | ||||
|       this.disabledLevel = this.user.info.areaMap[this.user.info.areaId].length; | ||||
|       if (!this.params.id) { | ||||
|         // this.baseInfo.householdAreaId = JSON.parse(JSON.stringify(this.user.info.areaId)) | ||||
|         this.baseInfo.currentAreaId = this.user.info.areaId | ||||
|       } else { | ||||
|         this.getDetail(this.params.id); | ||||
|       } | ||||
|     }) | ||||
|   } | ||||
| }; | ||||
| </script> | ||||
| <style lang="scss" scoped> | ||||
| .residentDetail { | ||||
|   font-size: 14px; | ||||
|     .AppAnnounceDetail-select { | ||||
|       display: flex; | ||||
|       align-items: center; | ||||
|       min-height: 32px; | ||||
|       line-height: 1; | ||||
|       background: #F5F5F5; | ||||
|       border-radius: 4px; | ||||
|       border: 1px solid #D0D4DC; | ||||
|       cursor: pointer; | ||||
|       overflow: hidden; | ||||
|       transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); | ||||
|  | ||||
|       &:hover { | ||||
|         border-color: #26f; | ||||
|       } | ||||
|  | ||||
|       & > i { | ||||
|         flex: 1; | ||||
|         height: 100%; | ||||
|         line-height: 32px; | ||||
|         padding: 0 12px; | ||||
|         color: #888888; | ||||
|         font-size: 14px; | ||||
|         font-style: normal; | ||||
|         border-right: 1px solid #D0D4DC; | ||||
|         background: #fff; | ||||
|       } | ||||
|  | ||||
|       .AppAnnounceDetail-select__input { | ||||
|         position: absolute; | ||||
|         left: 0; | ||||
|         top: 0; | ||||
|         z-index: -1; | ||||
|         opacity: 0; | ||||
|         height: 100%; | ||||
|       } | ||||
|  | ||||
|       .select-right { | ||||
|         height: 100%; | ||||
|         padding: 0 12px; | ||||
|         color: #222222; | ||||
|         font-size: 12px; | ||||
|         cursor: pointer; | ||||
|         transition: all ease 0.3s; | ||||
|  | ||||
|         &:hover { | ||||
|           opacity: 0.5; | ||||
|         } | ||||
|       } | ||||
|  | ||||
|       .select-left { | ||||
|         display: flex; | ||||
|         flex-wrap: wrap; | ||||
|         flex: 1; | ||||
|         padding: 5px 0 0px 12px; | ||||
|         border-right: 1px solid #D0D4DC; | ||||
|         border-radius: 4px 0 0 4px; | ||||
|         background: #fff; | ||||
|  | ||||
|         em { | ||||
|           height: 22px; | ||||
|           line-height: 22px; | ||||
|           margin: 0 4px 5px 0; | ||||
|           color: #222222; | ||||
|           font-size: 12px; | ||||
|           font-style: normal; | ||||
|         } | ||||
|  | ||||
|         span { | ||||
|           height: 22px; | ||||
|           line-height: 22px; | ||||
|           margin: 0 4px 5px 0; | ||||
|           padding: 0 8px; | ||||
|           font-size: 12px; | ||||
|           color: #222222; | ||||
|           background: #F3F4F7; | ||||
|           border-radius: 2px; | ||||
|           border: 1px solid #D0D4DC; | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   :deep( .AiID ){ | ||||
|     line-height: unset; | ||||
|  | ||||
|     .el-button--text { | ||||
|       padding: 0 8px; | ||||
|       height: fit-content; | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   :deep( .el-form-item ){ | ||||
|     margin-bottom: 10px; | ||||
|  | ||||
|     .el-form-item { | ||||
|       margin-top: 10px; | ||||
|     } | ||||
|  | ||||
|     .el-cascader, .el-select, .el-date-editor { | ||||
|       width: 100%; | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   :deep( .el-form-item__error ){ | ||||
|     position: static; | ||||
|   } | ||||
| } | ||||
| </style> | ||||
							
								
								
									
										122
									
								
								project/biaopin/AppResidentInfo/components/Detail.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										122
									
								
								project/biaopin/AppResidentInfo/components/Detail.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,122 @@ | ||||
| <template> | ||||
|   <ai-detail class="activitiesAdd"> | ||||
|     <template slot="title"> | ||||
|       <ai-title title="居民信息详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)"></ai-title> | ||||
|     </template> | ||||
|     <template slot="content"> | ||||
|       <ai-card title="基本信息"> | ||||
|         <ai-wrapper class="fill" slot="content"> | ||||
|           <ai-info-item label="姓名" isLine :value="baseInfo.name"/> | ||||
|           <ai-info-item label="照片"> | ||||
|             <ai-avatar v-model="baseInfo.photo" :editable="false"/> | ||||
|           </ai-info-item> | ||||
|           <ai-info-item label="性别" :value="dict.getLabel('sex', baseInfo.sex)"/> | ||||
|           <ai-info-item label="身份证号" :value="baseInfo.idNumber"> | ||||
|             <!-- <ai-id mode="show" v-model="baseInfo.idNumber" right-btn class="line-center"/> --> | ||||
|           </ai-info-item> | ||||
|           <ai-info-item label="出生日期" :value="baseInfo.birthday"/> | ||||
|           <ai-info-item label="年龄" :value="baseInfo.age"/> | ||||
|           <ai-info-item label="籍贯" :value="baseInfo.birthplaceAreaName"/> | ||||
|           <ai-info-item label="民族" :value="dict.getLabel('nation', baseInfo.nation)"/> | ||||
|           <ai-info-item label="文化程度" :value="dict.getLabel('education', baseInfo.education)"/> | ||||
|           <ai-info-item label="婚姻状况" :value="dict.getLabel('maritalStatus', baseInfo.maritalStatus)"/> | ||||
|           <ai-info-item label="政治面貌" :value="dict.getLabel('politicsStatus', baseInfo.politicsStatus)"/> | ||||
|           <ai-info-item label="兵役状况" :value="dict.getLabel('militaryStatus', baseInfo.militaryStatus)"/> | ||||
|           <ai-info-item label="宗教信仰" :value="dict.getLabel('faithType', baseInfo.faithType)"/> | ||||
|           <ai-info-item label="职业" :value="dict.getLabel('job', baseInfo.job)"/> | ||||
|         </ai-wrapper> | ||||
|       </ai-card> | ||||
|       <ai-card title="联络信息" type="flex"> | ||||
|         <ai-wrapper slot="content"> | ||||
|           <ai-info-item label="联系方式" :value="baseInfo.phone"/> | ||||
|           <ai-info-item label="现住址" isLine :value="[baseInfo.currentAreaName, baseInfo.currentAddress].join('')"/> | ||||
|           <ai-info-item label="所属网格" :value="baseInfo.girdName"/> | ||||
|         </ai-wrapper> | ||||
|       </ai-card> | ||||
|       <ai-card title="户籍信息"> | ||||
|         <ai-wrapper slot="content"> | ||||
|           <ai-info-item label="是否户主" :value="dict.getLabel('householdName', baseInfo.isHousehold)"/> | ||||
|           <template v-if="baseInfo.isHousehold == 0"> | ||||
|             <ai-info-item label="与户主关系" :value="dict.getLabel('householdRelation', baseInfo.householdRelation)"/> | ||||
|             <ai-info-item label="户主身份证号" :value="baseInfo.householdIdNumber"/> | ||||
|           </template> | ||||
|           <ai-info-item label="户籍地" isLine :value="[baseInfo.householdAreaName, baseInfo.householdAddress].join('')"></ai-info-item> | ||||
|         </ai-wrapper> | ||||
|       </ai-card> | ||||
|     </template> | ||||
|   </ai-detail> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
|   import { ID } from 'dui/lib/js/utils' | ||||
|   export default { | ||||
|     props: { | ||||
|       instance: Function, | ||||
|       dict: Object, | ||||
|       params: Object, | ||||
|     }, | ||||
|  | ||||
|     data () { | ||||
|       return { | ||||
|         baseInfo: {}, | ||||
|         id: '' | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     created () { | ||||
|       this.id = this.params.id | ||||
|  | ||||
|       this.getDetail() | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       cancel (isRefresh) { | ||||
|         this.$emit('change', { | ||||
|           type: 'List', | ||||
|           isRefresh: !!isRefresh | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       IdCard (UUserCard) { | ||||
|         if (UUserCard) { | ||||
|           const idCard = new ID(UUserCard) | ||||
|           this.baseInfo.age = idCard.age | ||||
|           this.baseInfo.sex = idCard.sex | ||||
|           this.baseInfo.birthday = idCard.birthday | ||||
|         } | ||||
|       }, | ||||
|  | ||||
|       getDetail() { | ||||
|         this.instance.post(`/app/appresidentapplet/queryDetailById?id=${this.params.id}`).then(res => { | ||||
|           if (res.data) { | ||||
|             this.baseInfo = { | ||||
|               ...res.data | ||||
|             } | ||||
|             this.IdCard(res.data.idNumber) | ||||
|           } | ||||
|         }) | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| <style lang="scss" scope> | ||||
|   .activitiesAdd { | ||||
|     height: 100%; | ||||
|  | ||||
|     :deep( .amap-logo ){ | ||||
|       display: none!important; | ||||
|     } | ||||
|     :deep( .amap-copyright ){ | ||||
|       display: none!important; | ||||
|     } | ||||
|  | ||||
|     :deep( .el-date-editor .el-input ){ | ||||
|       width: 100%; | ||||
|     } | ||||
|  | ||||
|     .amap-container { | ||||
|       height: 380px; | ||||
|     } | ||||
|   } | ||||
| </style> | ||||
							
								
								
									
										181
									
								
								project/biaopin/AppResidentInfo/components/List.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										181
									
								
								project/biaopin/AppResidentInfo/components/List.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,181 @@ | ||||
| <template> | ||||
|   <ai-list class="activitiesList"> | ||||
|     <ai-title | ||||
|       slot="title" | ||||
|       title="居民信息" | ||||
|       isShowBottomBorder | ||||
|       isShowArea | ||||
|       :hideLevel="$store.state.user.info.areaList.length - 1" | ||||
|       v-model="search.areaId" | ||||
|       :instance="instance" | ||||
|       @change="search.current = 1, getList()"> | ||||
|     </ai-title> | ||||
|     <template #content> | ||||
|       <ai-search-bar bottomBorder> | ||||
|         <template #left> | ||||
|           <el-button type="primary" icon="iconfont iconAdd" @click="toAdd('')">添加</el-button> | ||||
|           <ai-import | ||||
|             :instance="instance" | ||||
|             :dict="dict" | ||||
|             type="appresidentapplet" | ||||
|             name="居民信息" | ||||
|             @success="search.current = 1, getList()"> | ||||
|           </ai-import> | ||||
|         </template> | ||||
|         <template #right> | ||||
|           <el-input | ||||
|             v-model="search.name" | ||||
|             size="small" | ||||
|             placeholder="姓名/身份证/联系方式" | ||||
|             clearable | ||||
|             v-throttle="() => {search.current = 1, getList()}" | ||||
|             @clear="search.name = '', getList()" | ||||
|             suffix-icon="iconfont iconSearch"> | ||||
|           </el-input> | ||||
|         </template> | ||||
|       </ai-search-bar> | ||||
|       <ai-table | ||||
|         :tableData="tableData" | ||||
|         :total="search.total" | ||||
|         :current.sync="search.current" | ||||
|         :size.sync="search.size" | ||||
|         @getList="getList" | ||||
|         :col-configs="colConfigs" | ||||
|         :dict="dict"> | ||||
|         <el-table-column slot="options" label="操作" fixed="right" align="center" width="160px"> | ||||
|           <template slot-scope="{ row }"> | ||||
|             <div class="table-options"> | ||||
|               <el-button type="text" @click="toDetail(row.id)">详情</el-button> | ||||
|               <el-button type="text" @click="toAdd(row.id)">编辑</el-button> | ||||
|               <el-button type="text" @click="remove(row.id)">删除</el-button> | ||||
|               <el-button type="text" @click="qrCode(row)">生成二维码</el-button> | ||||
|             </div> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|       </ai-table> | ||||
|       <ai-dialog :visible.sync="dialogCode" title="二维码" width="500px" customFooter> | ||||
|         <div class="code-div"> | ||||
|           <img :src="codeImgUrl" alt="" class="code-img"> | ||||
|         </div> | ||||
|         <el-button slot="footer" @click="dialogCode=false" type="primary">关闭</el-button> | ||||
|       </ai-dialog> | ||||
|     </template> | ||||
|   </ai-list> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
|   export default { | ||||
|     props: { | ||||
|       instance: Function, | ||||
|       dict: Object | ||||
|     }, | ||||
|  | ||||
|     data () { | ||||
|       return { | ||||
|         search: { | ||||
|           current: 1, | ||||
|           size: 10, | ||||
|           total: 0, | ||||
|           name: '', | ||||
|           areaId: '' | ||||
|         }, | ||||
|         tableData: [], | ||||
|         dialogCode: false, | ||||
|         codeImgUrl: '' | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     computed: { | ||||
|       colConfigs() { | ||||
|         return [ | ||||
|           { label: "姓名", prop: "name", align: "left" }, | ||||
|           // { label: "性别", prop: "sex", dict: 'sex', align: "center" }, | ||||
|           { prop: 'idNumber', label: '身份证号', align: 'center'}, | ||||
|           // format: v => v.substring(0, 10) + '****' + v.substring(14, 18) | ||||
|           // { label: "年龄", prop: "age", align: "center"}, | ||||
|           { label: "现住址", prop: "currentAreaName", align: "center" }, | ||||
|           { label: "网格", prop: "girdName", align: "center" }, | ||||
|           { label: "民族", prop: "nation", align: "center", dict: "nation" }, | ||||
|           { label: "文化程度", prop: "education", align: "center", dict: "education" }, | ||||
|           { label: "政治面貌", prop: "politicsStatus", align: "center", dict: "politicsStatus" }, | ||||
|           { slot: "options", }, | ||||
|         ] | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     created () { | ||||
|       this.search.areaId = this.$store.state.user.info.areaId | ||||
|       this.$dict.load(['nation', 'education', 'politicsStatus']).then(()=> { | ||||
|         this.getList() | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       getList() { | ||||
|         this.instance.post(`/app/appresidentapplet/list`,null, { | ||||
|           params: { | ||||
|             ...this.search, | ||||
|           } | ||||
|         }).then(res=> { | ||||
|           if(res?.data) { | ||||
|             this.tableData = res.data.records | ||||
|             this.search.total = res.data.total | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       toDetail (id) { | ||||
|         this.$emit('change', { | ||||
|           type: 'Detail', | ||||
|           params: { | ||||
|             id: id || '', | ||||
|             type: 'Detail' | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       toAdd(id) { | ||||
|         this.$emit('change', { | ||||
|           type: 'Add', | ||||
|           params: { | ||||
|             type: id ? 'Edit' : 'Add', | ||||
|             id: id || '' | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       remove (id) { | ||||
|         this.$confirm('确定删除该数据?').then(() => { | ||||
|           this.instance.post(`/app/appresidentapplet/delete?ids=${id}`).then(res=>{ | ||||
|             if(res.code == 0) { | ||||
|               this.$message.success('删除成功!') | ||||
|               this.getList() | ||||
|             } | ||||
|           }) | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       qrCode(row) { | ||||
|         this.instance.post(`/app/appresidentapplet/generateQrCode?id=${row.id}`).then(res=>{ | ||||
|           if(res.code == 0) { | ||||
|             this.dialogCode = true | ||||
|             this.codeImgUrl = res.data | ||||
|           } | ||||
|         }) | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| <style lang="scss" scoped> | ||||
|   .activitiesList { | ||||
|     height: 100%; | ||||
|     .code-div { | ||||
|       text-align: center; | ||||
|     } | ||||
|     .code-img { | ||||
|       width: 300px; | ||||
|       height: 300px; | ||||
|     } | ||||
|   } | ||||
| </style> | ||||
| @@ -0,0 +1,64 @@ | ||||
| <template> | ||||
|   <div class="AppActivitiesManagement"> | ||||
|     <keep-alive :include="['List']"> | ||||
|       <component ref="component" :is="component" :permissions="permissions " @change="onChange" :params="params" :instance="instance" :dict="dict"></component> | ||||
|     </keep-alive> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
|   import List from './components/List' | ||||
|   import Detail from './components/Detail' | ||||
|  | ||||
|   export default { | ||||
|     name: 'AppResidentIntegrating', | ||||
|     label: '居民积分', | ||||
|  | ||||
|     props: { | ||||
|       instance: Function, | ||||
|       dict: Object, | ||||
|       permissions: Function | ||||
|     }, | ||||
|  | ||||
|     data () { | ||||
|       return { | ||||
|         component: 'List', | ||||
|         params: {}, | ||||
|         include: [] | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     components: { | ||||
|       List, | ||||
|       Detail | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       onChange (data) { | ||||
|         if (data.type === 'Detail') { | ||||
|           this.component = 'Detail' | ||||
|           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"> | ||||
| .AppActivitiesManagement { | ||||
|   height: 100%; | ||||
|   background: #F3F6F9; | ||||
|   overflow: auto; | ||||
| } | ||||
| </style> | ||||
							
								
								
									
										181
									
								
								project/biaopin/AppResidentIntegrating/components/Detail.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										181
									
								
								project/biaopin/AppResidentIntegrating/components/Detail.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,181 @@ | ||||
| <template> | ||||
|   <ai-detail> | ||||
|     <template slot="title"> | ||||
|       <ai-title title="详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)"> | ||||
|       </ai-title> | ||||
|     </template> | ||||
|     <template slot="content"> | ||||
|       <el-row style="margin-bottom: 16px;"> | ||||
|         <div class="card_list"> | ||||
|           <div class="card"> | ||||
|             <h2>姓名</h2> | ||||
|             <p class="color1">{{ info.userName }}</p> | ||||
|           </div> | ||||
|           <div class="card"> | ||||
|             <h2>积分余额</h2> | ||||
|             <p class="color2">{{ info.integral || 0 }}</p> | ||||
|           </div> | ||||
|           <div class="card"> | ||||
|             <h2>已用积分</h2> | ||||
|             <p class="color3">{{ info.usedIntegral || 0 }}</p> | ||||
|           </div> | ||||
|         </div> | ||||
|       </el-row> | ||||
|       <ai-card> | ||||
|         <ai-title slot="title" title="余额变动明细"/> | ||||
|         <template #content> | ||||
|           <ai-search-bar> | ||||
|             <template #left> | ||||
|               <ai-select v-model="search.type" placeholder="请选择类型" @change="search.current = 1, getList()" :selectList="dict.getDict('integralType')"/> | ||||
|             </template> | ||||
|             <template #right> | ||||
|               <ai-download | ||||
|                 :instance="instance" | ||||
|                 :url="`/app/appintegraluser/changeIntegralExport?id=${params.id}`" | ||||
|                 :params="search" | ||||
|                 fileName="余额变动明细" | ||||
|                 :disabled="tableData.length == 0"> | ||||
|                 <el-button size="small">导出</el-button> | ||||
|               </ai-download> | ||||
|             </template> | ||||
|           </ai-search-bar> | ||||
|           <ai-table :tableData="tableData" :total="total" :current.sync="search.current" :size.sync="search.size" | ||||
|                     @getList="getList" :col-configs="colConfigs" :dict="dict"> | ||||
|             <el-table-column slot="changeIntegral" label="变动积分" align="center"> | ||||
|               <template slot-scope="{ row }"> | ||||
|                 <span>{{ row.integralCalcType == 0 ? '-' : '+' }}{{ row.changeIntegral }}</span> | ||||
|               </template> | ||||
|             </el-table-column> | ||||
|             <el-table-column slot="eventDesc" label='事件' align="center" show-overflow-tooltip> | ||||
|               <template slot-scope="{ row }"> | ||||
|                 <span>{{ row.eventDesc || row.eventName }}</span> | ||||
|               </template> | ||||
|             </el-table-column> | ||||
|           </ai-table> | ||||
|         </template> | ||||
|       </ai-card> | ||||
|     </template> | ||||
|   </ai-detail> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
|   export default { | ||||
|     name: 'Detail', | ||||
|  | ||||
|     props: { | ||||
|       instance: Function, | ||||
|       dict: Object, | ||||
|       params: Object | ||||
|     }, | ||||
|  | ||||
|     data () { | ||||
|       return { | ||||
|         info: {}, | ||||
|         id: '', | ||||
|         search: { | ||||
|           current: 1, | ||||
|           size: 10, | ||||
|           type: '' | ||||
|         }, | ||||
|         total: 0, | ||||
|         tableData: [] | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     computed: { | ||||
|       colConfigs() { | ||||
|         return [ | ||||
|           {prop: "doTime", label: '时间', align: "left", width: "200px"}, | ||||
|           {prop: "integralType", label: '类型', align: "center", dict: "integralType"}, | ||||
|           {slot: "changeIntegral"}, | ||||
|           {prop: "nowIntegral", label: '剩余积分', align: "center" }, | ||||
|           {slot: "eventDesc"}, | ||||
|         ] | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     created () { | ||||
|       console.log(this.params) | ||||
|       this.dict.load('integralType').then(() => { | ||||
|         this.getInfo() | ||||
|         this.getList() | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       getInfo (id) { | ||||
|         this.instance.post(`/app/appintegraluser/girdDetail?id=${this.params.id}`).then(res => { | ||||
|           if (res.code === 0) { | ||||
|             this.info = res.data | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       getList () { | ||||
|         this.instance.post(`/app/appintegraluser/getChangeDetail`, null, { | ||||
|           params: { | ||||
|             ...this.search, | ||||
|             id: this.params.id | ||||
|           } | ||||
|         }).then(res => { | ||||
|           if (res.code === 0) { | ||||
|             this.tableData = res.data.records | ||||
|             this.total = res.data.total | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       cancel (isRefresh) { | ||||
|         this.$emit('change', { | ||||
|           type: 'List', | ||||
|           isRefresh: !!isRefresh | ||||
|         }) | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
|   .card_list { | ||||
|     display: flex; | ||||
|  | ||||
|     .card { | ||||
|       flex: 1; | ||||
|       height: 96px; | ||||
|       background: #FFFFFF; | ||||
|       box-shadow: 0px 4px 6px -2px rgba(15, 15, 21, 0.1500); | ||||
|       border-radius: 4px; | ||||
|       margin-right: 20px; | ||||
|       padding: 16px 24px; | ||||
|       box-sizing: border-box; | ||||
|  | ||||
|       h2 { | ||||
|         color: #888888; | ||||
|         font-weight: 600; | ||||
|         font-size: 16px; | ||||
|       } | ||||
|  | ||||
|       p { | ||||
|         margin-top: 8px; | ||||
|         font-size: 24px; | ||||
|         font-weight: 600; | ||||
|       } | ||||
|  | ||||
|       .color1 { | ||||
|         color: #2891FF; | ||||
|       } | ||||
|  | ||||
|       .color2 { | ||||
|         color: #22AA99; | ||||
|       } | ||||
|  | ||||
|       .color3 { | ||||
|         color: #F8B425; | ||||
|       } | ||||
|     } | ||||
|  | ||||
|     .card:last-child { | ||||
|       margin-right: 0; | ||||
|     } | ||||
|   } | ||||
| </style> | ||||
							
								
								
									
										278
									
								
								project/biaopin/AppResidentIntegrating/components/List.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										278
									
								
								project/biaopin/AppResidentIntegrating/components/List.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,278 @@ | ||||
| <template> | ||||
|   <ai-list class="notice"> | ||||
|     <ai-title slot="title" title="居民积分" v-model="search.areaId" isShowBottomBorder isShowArea :hideLevel="hideLevel - 1" @change="search.current = 1, getList()"></ai-title> | ||||
|     <template slot="content"> | ||||
|       <ai-search-bar class="search-bar"> | ||||
|         <template #left> | ||||
|           <el-button type="primary" size="small" icon="iconfont iconAdd" @click="changeIntegral('',0)"> 批量调整积分</el-button> | ||||
|           <ai-download | ||||
|             :instance="instance" | ||||
|             url="/app/appwechatuserqujing/export" | ||||
|             :params="params" | ||||
|             v-if="permissions('app_appwechatuserqujing_export')" | ||||
|             fileName="居民积分" | ||||
|              :disabled="tableData.length == 0"> | ||||
|             <el-button icon="iconfont iconExported" :disabled="tableData.length == 0">导出</el-button> | ||||
|           </ai-download> | ||||
|         </template> | ||||
|         <template #right> | ||||
|           <el-input | ||||
|             v-model="search.idNumber" | ||||
|             class="search-input" | ||||
|             size="small" | ||||
|             v-throttle="() => {search.current = 1, getList()}" | ||||
|             placeholder="姓名/身份证/手机号" | ||||
|             clearable | ||||
|             @clear="search.current = 1, search.idNumber = '', getList()" | ||||
|             suffix-icon="iconfont iconSearch"> | ||||
|           </el-input> | ||||
|         </template> | ||||
|       </ai-search-bar> | ||||
|       <ai-table | ||||
|         :tableData="tableData" | ||||
|         :col-configs="colConfigs" | ||||
|         :total="total" | ||||
|         style="margin-top: 6px;" | ||||
|         :current.sync="search.current" | ||||
|         :size.sync="search.size" | ||||
|         @getList="getList"> | ||||
|         <el-table-column slot="options" width="120px" fixed="right" label="操作" align="center"> | ||||
|           <template slot-scope="{ row }"> | ||||
|             <div class="table-options"> | ||||
|               <el-button type="text" @click="toDetail(row.integralUserId)">详情</el-button> | ||||
|               <el-button type="text" @click="changeIntegral(row,1)">调整积分</el-button> | ||||
|             </div> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|       </ai-table> | ||||
|       <ai-dialog | ||||
|         title="调整积分" | ||||
|         :visible.sync="dialog" | ||||
|         :destroyOnClose="true" | ||||
|         width="720px" | ||||
|         @onConfirm="onConfirm" | ||||
|         @closed="form={},chooseUserList=[]"> | ||||
|         <el-form ref="form" :model="form" :rules="rules" label-width="80px"> | ||||
|           <el-form-item label="选择人员" prop="ids" v-if="!isEdit"> | ||||
|             <ai-person-select :instance="instance" keys="openId" customRightText :customClicker="true" :chooseUserList="chooseUserList" | ||||
|                 :url="`/app/appwechatuserqujing/listByFdAppletUser?areaId=${search.areaId}`" headerTitle="用户列表" | ||||
|                 :isMultiple="true" dialogTitle="选择" @selectPerson="selectPerson" class="aipersonselect"> | ||||
|               <template name="option" v-slot:option="{ item }"> | ||||
|                 <span class="iconfont iconProlife">{{ item.realName }}</span> | ||||
|                 <!-- <ai-id mode="show" :show-eyes="false" :value="item.idNumber"/> --> | ||||
|                 <span>{{ item.phone }}</span> | ||||
|               </template> | ||||
|             </ai-person-select> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="调整说明" prop="eventDesc"> | ||||
|             <el-input v-model="form.eventDesc" placeholder="请输入..." type="textarea" :rows="4" show-word-limit | ||||
|                       maxlength="100"></el-input> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="类型" prop="integralCalcType"> | ||||
|             <ai-select v-model="form.integralCalcType" :selectList="dict.getDict('integralCalcType')"/> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="积分" prop="integral"> | ||||
|             <el-input v-model.trim="form.integral" placeholder="请输入正数" size="small"></el-input> | ||||
|           </el-form-item> | ||||
|         </el-form> | ||||
|       </ai-dialog> | ||||
|     </template> | ||||
|   </ai-list> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
|   import { mapState } from 'vuex' | ||||
|   export default { | ||||
|     name: 'List', | ||||
|  | ||||
|     props: { | ||||
|       instance: Function, | ||||
|       dict: Object, | ||||
|       permissions: Function | ||||
|     }, | ||||
|  | ||||
|     data() { | ||||
|       return { | ||||
|         search: { | ||||
|           current: 1, | ||||
|           size: 10, | ||||
|           idNumber: '', | ||||
|           areaId: '' | ||||
|         }, | ||||
|         form: { | ||||
|           ids: [], | ||||
|           eventDesc: "", | ||||
|           enclosure: "", | ||||
|           integralCalcType: "", | ||||
|           integral: '' | ||||
|         }, | ||||
|         dialog: false, | ||||
|         chooseUserList: [], | ||||
|         total: 0, | ||||
|         isEdit: false, | ||||
|         colConfigs: [ | ||||
|           { prop: 'realName',  label: '姓名', align: 'left', width: '200px' }, | ||||
|           { prop: 'phone',  label: '手机号', align: 'center' }, | ||||
|           { prop: 'idNumber', label: '身份证号', align: 'center' }, | ||||
|           { prop: 'areaName', label: '所属地区', align: 'center' }, | ||||
|           { prop: 'girdName', label: '所属网格', align: 'center' }, | ||||
|           { prop: 'integral', label: '剩余积分', align: 'center' }, | ||||
|           { prop: 'usedIntegral', label: '已用积分', align: 'center' } | ||||
|         ], | ||||
|         tableData: [] | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     computed: { | ||||
|       ...mapState(['user']), | ||||
|  | ||||
|       hideLevel () { | ||||
|         return this.user.info.areaList.length || 0 | ||||
|       }, | ||||
|  | ||||
|       params () { | ||||
|         return { | ||||
|           ...this.search, | ||||
|           size: 1000 | ||||
|         } | ||||
|       }, | ||||
|  | ||||
|       rules() { | ||||
|         return { | ||||
|           ids: [{required: true, message: '请选择人员', trigger: 'blur'}], | ||||
|           eventDesc: [{required: true, message: '请输入调整说明', trigger: 'blur'}], | ||||
|           integralCalcType: [{required: true, message: '请选择类型', trigger: 'blur'}], | ||||
|           integral: [{required: true, message: '请输入积分', trigger: 'blur' }, | ||||
|           {pattern: /^([1-9]\d*|0)(\.\d{1,2})?$/, message: '请输入正数且最多只能保留两位小数'}], | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     created() { | ||||
|       this.search.areaId = this.user.info.areaId | ||||
|       this.dict.load('integralCalcType').then(() => { | ||||
|         this.getList() | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       getList () { | ||||
|         this.instance.post(`/app/appwechatuserqujing/listByFdAppletUser`, null, { | ||||
|           params: { | ||||
|             ...this.search, | ||||
|             areaId: this.search.areaId | ||||
|           } | ||||
|         }).then(res => { | ||||
|           if (res.code == 0) { | ||||
|             this.tableData = res.data.records | ||||
|             this.total = res.data.total | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       selectPerson(val) { | ||||
|         if (val) { | ||||
|           this.personList = val | ||||
|           this.form.ids = [...this.personList.map(e => e.openId)] | ||||
|         } else { | ||||
|           this.form.ids = this.chooseUserList.map(e => e.openId) | ||||
|         } | ||||
|       }, | ||||
|  | ||||
|       changeIntegral(row,type) { | ||||
|         this.isEdit = false | ||||
|         if(type==0) { | ||||
|           this.dialog = true | ||||
|         } else if(type ==1) { | ||||
|           this.isEdit = true | ||||
|           this.chooseUserList = [{ | ||||
|             openId: row.openId, | ||||
|             name: row.realName | ||||
|           }] | ||||
|           this.form = { | ||||
|             ids: this.chooseUserList.map(e => e.openId) | ||||
|           } | ||||
|  | ||||
|           this.dialog = true | ||||
|         } | ||||
|       }, | ||||
|  | ||||
|       changeTableSort(col) { | ||||
|         if(col.prop === 'integral') { // 剩余积分 | ||||
|           this.search.sortFiled = 0 | ||||
|           if(col.order === 'ascending') { | ||||
|             this.search.sortRule = true | ||||
|           } else if(col.order === 'descending') { | ||||
|             this.search.sortRule = false | ||||
|           } else if(col.order === null) { | ||||
|             this.search.sortRule = '' | ||||
|           } | ||||
|         } else if(col.prop === 'totalIntegral') {  // 累计积分 | ||||
|           this.search.sortFiled = 1 | ||||
|           if(col.order === 'ascending') { | ||||
|             this.search.sortRule = true | ||||
|           } else if(col.order === 'descending') { | ||||
|             this.search.sortRule = false | ||||
|           } else if(col.order === null) { | ||||
|             this.search.sortRule = '' | ||||
|           } | ||||
|         } else if(col.prop === 'usedIntegral') {  // 已用积分 | ||||
|           this.search.sortFiled = 2 | ||||
|           if(col.order === 'ascending') { | ||||
|             this.search.sortRule = true | ||||
|           } else if(col.order === 'descending') { | ||||
|             this.search.sortRule = false | ||||
|           } else if(col.order === null) { | ||||
|             this.search.sortRule = '' | ||||
|           } | ||||
|         } | ||||
|         this.getList() | ||||
|       }, | ||||
|  | ||||
|       onConfirm() { | ||||
|         if(this.flag) return | ||||
|  | ||||
|         if(this.form.file?.length) { | ||||
|           this.form.enclosure = this.form.file[0].url | ||||
|         } | ||||
|         this.$refs.form.validate((valid)=> { | ||||
|           if(valid) { | ||||
|             this.flag = true | ||||
|             this.instance.post(`/app/appintegraluser/changeIntegral`,{ | ||||
|               ids: this.form.ids, | ||||
|               eventDesc: this.form.eventDesc, | ||||
|               enclosure: this.form.enclosure,   // 附件 | ||||
|               integralCalcType: this.form.integralCalcType, | ||||
|               integral: this.form.integral, | ||||
|               integralUserType: 3 | ||||
|             }).then(res => { | ||||
|               if(res?.code == 0) { | ||||
|                 this.$message.success('调整积分成功') | ||||
|                 setTimeout(() =>{ | ||||
|                   this.dialog = false | ||||
|                   this.getList() | ||||
|                   this.flag = false | ||||
|                 }, 600) | ||||
|               } else { | ||||
|                 this.flag = false | ||||
|               } | ||||
|             }) | ||||
|           } | ||||
|         }) | ||||
|  | ||||
|       }, | ||||
|  | ||||
|       toDetail(id) { | ||||
|         this.$emit('change', { | ||||
|           type: 'Detail', | ||||
|           params: { | ||||
|             id: id || '' | ||||
|           } | ||||
|         }) | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| <style lang="scss" scoped> | ||||
| </style> | ||||
		Reference in New Issue
	
	Block a user