整合代码
This commit is contained in:
		| @@ -19,68 +19,34 @@ | ||||
|             <ai-select placeholder="民族" v-model="search.nation" | ||||
|                        :selectList="resident.dict.getDict('nation')" | ||||
|                        @change="page.current=1,refreshTable()"/> | ||||
|             <el-date-picker | ||||
|                 value-format="yyyy-MM-dd HH:mm:ss" | ||||
|                 v-model="search.birthStart" | ||||
|                 style="width:250px;border-radius:0;" | ||||
|                 type="date" | ||||
|                 size="small" | ||||
|                 unlink-panels | ||||
|                 placeholder="选择出生开始日期" | ||||
|                 @change="page.current=1,refreshTable()" | ||||
|             /> | ||||
|             <el-date-picker | ||||
|                 value-format="yyyy-MM-dd HH:mm:ss" | ||||
|                 v-model="search.birthEnd" | ||||
|                 style="width:250px;border-radius:0;" | ||||
|                 type="date" | ||||
|                 size="small" | ||||
|                 placeholder="选择出生结束日期" | ||||
|                 unlink-panels | ||||
|                 @change="page.current=1,refreshTable()" | ||||
|             /> | ||||
|             <el-select | ||||
|                 v-model="search.politicsStatus" | ||||
|                 placeholder="政治面貌" | ||||
|                 size="small" | ||||
|                 @change="page.current=1,refreshTable()" | ||||
|                 clearable | ||||
|             > | ||||
|               <el-option | ||||
|                   v-for="(item,i) in resident.dict.getDict('politicsStatus')" | ||||
|                   :key="i" | ||||
|                   :label="item.dictName" | ||||
|                   :value="item.dictValue" | ||||
|               ></el-option> | ||||
|             </el-select> | ||||
|             <el-select | ||||
|                 v-model="search.householdName" | ||||
|                 placeholder="是否户主" | ||||
|                 size="small" | ||||
|                 @change="page.current=1,refreshTable()" | ||||
|                 clearable | ||||
|             > | ||||
|               <el-option | ||||
|                   v-for="(item,i) in resident.dict.getDict('householdName')" | ||||
|                   :key="i" | ||||
|                   :label="item.dictName" | ||||
|                   :value="item.dictValue" | ||||
|               ></el-option> | ||||
|             </el-select> | ||||
|             <el-select | ||||
|                 v-model="search.faithType" | ||||
|                 placeholder="宗教信仰" | ||||
|                 @change="page.current=1,refreshTable()" | ||||
|                 size="small" | ||||
|                 clearable | ||||
|             > | ||||
|               <el-option | ||||
|                   v-for="(item,i) in resident.dict.getDict('faithType')" | ||||
|                   :key="i" | ||||
|                   :label="item.dictName" | ||||
|                   :value="item.dictValue" | ||||
|               ></el-option> | ||||
|             </el-select> | ||||
|             <ai-search label="出生日期"> | ||||
|               <el-date-picker | ||||
|                   value-format="yyyy-MM-dd HH:mm:ss" | ||||
|                   v-model="search.birthStart" | ||||
|                   type="date" | ||||
|                   size="small" | ||||
|                   placeholder="选择开始日期" | ||||
|                   @change="page.current=1,refreshTable()" | ||||
|               /> | ||||
|               <el-date-picker | ||||
|                   value-format="yyyy-MM-dd HH:mm:ss" | ||||
|                   v-model="search.birthEnd" | ||||
|                   type="date" | ||||
|                   size="small" | ||||
|                   placeholder="选择结束日期" | ||||
|                   @change="page.current=1,refreshTable()" | ||||
|               /> | ||||
|             </ai-search> | ||||
|  | ||||
|             <ai-select placeholder="政治面貌" v-model="search.politicsStatus" | ||||
|                        :selectList="resident.dict.getDict('politicsStatus')" | ||||
|                        @change="page.current=1,refreshTable()"/> | ||||
|             <ai-select placeholder="是否户主" v-model="search.householdName" | ||||
|                        :selectList="resident.dict.getDict('householdName')" | ||||
|                        @change="page.current=1,refreshTable()"/> | ||||
|             <ai-select placeholder="宗教信仰" v-model="search.faithType" | ||||
|                        :selectList="resident.dict.getDict('faithType')" | ||||
|                        @change="page.current=1,refreshTable()"/> | ||||
|           </template> | ||||
|           <template #right> | ||||
|             <el-input | ||||
| @@ -232,30 +198,6 @@ export default { | ||||
|     }; | ||||
|   }, | ||||
|   methods: { | ||||
|     handleClick() { | ||||
|       this.tableData = []; | ||||
|       this.multipleSelection = []; | ||||
|       this.searchInit() | ||||
|     }, | ||||
|     searchInit() { | ||||
|       let tempAreaId = this.search.areaId; | ||||
|       this.search = { | ||||
|         fileStatus: "", | ||||
|         sex: "", | ||||
|         nation: "", | ||||
|         education: "", | ||||
|         politicsStatus: "", | ||||
|         birth: [], | ||||
|         faithType: "", | ||||
|         householdName: "", | ||||
|         areaId: "", | ||||
|         con: "", | ||||
|         maritalStatus: "" | ||||
|       }; | ||||
|       this.search.areaId = tempAreaId; | ||||
|       this.page = {current: 1, size: 10, total: 0}; | ||||
|       this.refreshTable() | ||||
|     }, | ||||
|     handleSelectionChange(val) { | ||||
|       this.deleteIds = []; | ||||
|       this.multipleSelection = val; | ||||
| @@ -263,41 +205,6 @@ export default { | ||||
|         this.deleteIds.push(e.id); | ||||
|       }); | ||||
|     }, | ||||
|     exportrExcle() { | ||||
|       if (this.deleteIds.length == 0) { | ||||
|         if (this.search.birth) { | ||||
|           this.search.birth = this.search.birth.join(","); | ||||
|         } | ||||
|         this.resident.instance | ||||
|         .post(`/app/appresident/exportAll`, null, { | ||||
|           params: { | ||||
|             ...this.search, | ||||
|             ...this.page | ||||
|           } | ||||
|         }) | ||||
|         .then(res => { | ||||
|           if (res && res.code == 0) { | ||||
|             this.$message.success(res.data); | ||||
|             if (typeof this.search.birth == "string") { | ||||
|               this.search.birth = this.search.birth.split(","); | ||||
|             } | ||||
|           } | ||||
|         }); | ||||
|       } else { | ||||
|         this.resident.instance.post(`/app/appresident/exportByIds`, { | ||||
|           ids: this.deleteIds, | ||||
|           areaId: this.user.info.areaId | ||||
|         }).then(res => { | ||||
|           if (res?.code == 0) { | ||||
|             this.$message.success(res.data); | ||||
|           } | ||||
|         }); | ||||
|       } | ||||
|     }, | ||||
|     handleSizeChange(val) { | ||||
|       this.page.size = val; | ||||
|       this.refreshTable() | ||||
|     }, | ||||
|     detailShow(row) { | ||||
|       this.$router.push({query: {type: this.active, id: row.id}}) | ||||
|     }, | ||||
| @@ -349,5 +256,15 @@ export default { | ||||
| <style lang="scss" scoped> | ||||
| .ResidentList { | ||||
|   height: 100%; | ||||
|  | ||||
|   ::v-deep.AiSearch { | ||||
|     .el-input + .el-input > .el-input__inner { | ||||
|       border-left-color: transparent; | ||||
|  | ||||
|       &:hover, &:focus { | ||||
|         border-left-color: inherit; | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </style> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user