feat(xumu): 新增死亡审核功能
- 添加死亡审核列表页面,支持筛选、搜索和导出功能 - 实现死亡审核详情页面,包括基础信息、死亡信息和审核信息 - 集成字典加载和用户信息获取 - 优化表格展示和表单验证
This commit is contained in:
		
							
								
								
									
										112
									
								
								project/xumu/AppDeathAudit/list.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										112
									
								
								project/xumu/AppDeathAudit/list.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,112 @@ | ||||
| <script> | ||||
| import {mapState} from "vuex" | ||||
|  | ||||
| const columns = [ | ||||
|   {label: "序号", type: "index"}, | ||||
|   {label: "养殖场", format: (v, row) => `${[row.farmName, row.houseName, row.penName].join("-")}`}, | ||||
|   {label: "生物芯片耳标号", prop: "biochipEarNumber"}, | ||||
|   {label: "类别", prop: "category", dict: "category", width: 120}, | ||||
|   {label: "品种", prop: "variety", dict: "variety", width: 120}, | ||||
|   {label: "日龄(天)", prop: "age", width: 80}, | ||||
|   {label: "死亡时间", prop: "deathTime"}, | ||||
|   {label: "死亡原因", prop: "reason", dict: "deathReason", width: 80}, | ||||
|   {label: "登记时间", prop: "createTime"}, | ||||
|   {label: "操作人", prop: "userName", width: 100}, | ||||
|   {label: "审核状态", prop: "auditStatus", dict: "auditStatus", width: 80}, | ||||
| ] | ||||
| export default { | ||||
|   name: "deathList", | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     dict: Object, | ||||
|     permissions: Function | ||||
|   }, | ||||
|   data() { | ||||
|     return { | ||||
|       columns, | ||||
|       tableData: [], | ||||
|       page: {pageNum: 1, pageSize: 10, total: 0}, | ||||
|       search: {}, | ||||
|     } | ||||
|   }, | ||||
|   computed: { | ||||
|     ...mapState(['user']), | ||||
|     userinfo: v => v.user.info || {}, | ||||
|     pageTitle: v => v.$parent.menuName || v.$parent.$options.label | ||||
|   }, | ||||
|   watch: { | ||||
|     search: { | ||||
|       deep: true, | ||||
|       handler() { | ||||
|         this.page.pageNum = 1 | ||||
|         this.getTableData() | ||||
|       } | ||||
|     } | ||||
|   }, | ||||
|   methods: { | ||||
|     getTableData() { | ||||
|       this.instance.post("/api/breed/death/getAuditPage", {...this.page, ...this.search}).then(res => { | ||||
|         if (res?.data) { | ||||
|           this.tableData = res.data?.records.map(e => ({...e, permit: `${e.status}` + e.auditStatus})) | ||||
|           this.page.total = res.data.total | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|   }, | ||||
|   created() { | ||||
|     this.getTableData() | ||||
|   } | ||||
| } | ||||
| </script> | ||||
|  | ||||
| <template> | ||||
|   <ai-page class="deathList" :title="pageTitle"> | ||||
|     <ai-search-bar> | ||||
|       <template #left> | ||||
|         <ai-select placeholder="全部养殖场" v-model="search.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${userinfo.id}`" :prop="{label:'name'}"/> | ||||
|         <ai-select placeholder="全部养殖舍" v-model="search.houseId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.farmId||-1}`" :prop="{label:'name'}"/> | ||||
|         <ai-select placeholder="全部养殖栏" v-model="search.penId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.houseId||-1}`" :prop="{label:'name'}"/> | ||||
|         <ai-select placeholder="全部审核状态" v-model="search.auditStatus" dict="auditStatus"/> | ||||
|         <ai-search label="死亡日期"> | ||||
|           <el-date-picker v-model="search.deathBeginDate" type="datetime" placeholder="开始日期" size="small"/> | ||||
|           <el-date-picker v-model="search.deathEndDate" type="datetime" placeholder="结束日期" size="small"/> | ||||
|         </ai-search> | ||||
|         <ai-search label="登记日期"> | ||||
|           <el-date-picker v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/> | ||||
|           <el-date-picker v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/> | ||||
|         </ai-search> | ||||
|         <ai-input placeholder="原场耳标号" v-model="search.originalEarNumber"/> | ||||
|         <ai-input placeholder="生物芯片耳标号" v-model="search.biochipEarNumber"/> | ||||
|         <ai-input placeholder="电子耳标号" v-model="search.electronicEarNumber"/> | ||||
|       </template> | ||||
|     </ai-search-bar> | ||||
|     <ai-search-bar> | ||||
|       <template #left> | ||||
|         <ai-download :instance="instance" url="/api/breed/death/export" :params="{...search,...page}" :fileName="`${pageTitle}导出表-${Date.now()}`"/> | ||||
|       </template> | ||||
|     </ai-search-bar> | ||||
|     <ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData" | ||||
|               :total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize"> | ||||
|       <el-table-column slot="options" label="操作" fixed="right" align="center"> | ||||
|         <template slot-scope="{row}"> | ||||
|           <div class="table-options"> | ||||
|             <template v-if="['1'].includes(row.auditStatus)"> | ||||
|               <el-button type="text" @click="$router.push({hash:'#audit',query:{id:row.id}})">审核</el-button> | ||||
|             </template> | ||||
|             <el-button v-else type="text" @click="$router.push({hash:'#add',query:{id:row.id}})">查看</el-button> | ||||
|           </div> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|     </ai-table> | ||||
|   </ai-page> | ||||
| </template> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
| .deathList { | ||||
|   height: 100%; | ||||
|  | ||||
|   .deleteBtn { | ||||
|     color: $errorColor; | ||||
|   } | ||||
| } | ||||
| </style> | ||||
		Reference in New Issue
	
	Block a user