feat(AppBreedArchive): 优化档案查询页面
- 新增免疫记录、治疗记录、淘汰记录、死亡记录、设备检测、贷款信息、保险信息等模块 -优化列表展示方式,使用 tabs进行分类展示 -调整列表列宽和对齐
This commit is contained in:
		| @@ -17,7 +17,7 @@ export default { | |||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   created() { |   created() { | ||||||
|     this.dict.load("archiveStatus", "category", "variety") |     this.dict.load("archiveStatus", "category", "variety", "insuranceType", "deathReason", "dataSources", "yesOrNo") | ||||||
|   } |   } | ||||||
| } | } | ||||||
| </script> | </script> | ||||||
|   | |||||||
| @@ -8,10 +8,78 @@ const columns = { | |||||||
|     {label: "称重时间", prop: "createTime"}, |     {label: "称重时间", prop: "createTime"}, | ||||||
|     {label: "数据来源", prop: "source", dict: "dataSources"}, |     {label: "数据来源", prop: "source", dict: "dataSources"}, | ||||||
|     {label: "是否变更过", prop: "isUpdate", dict: "yesOrNo"}, |     {label: "是否变更过", prop: "isUpdate", dict: "yesOrNo"}, | ||||||
|  |   ], | ||||||
|  |   immunityList: [ | ||||||
|  |     {label: "序号", type: "index"}, | ||||||
|  |     {label: "疫苗名称", prop: "vaccineName"}, | ||||||
|  |     {label: "用药方式", prop: "method"}, | ||||||
|  |     {label: "药量", prop: "dosage"}, | ||||||
|  |     {label: "生产厂家", prop: "factory"}, | ||||||
|  |     {label: "厂家批号", prop: "batchNumber"}, | ||||||
|  |     {label: "免疫时间", prop: "immunityTime"}, | ||||||
|  |     {label: "登记时间", prop: "createTime"}, | ||||||
|  |     {label: "防疫员", prop: "userName"}, | ||||||
|  |   ], | ||||||
|  |   treatmentList: [ | ||||||
|  |     {label: "序号", type: "index"}, | ||||||
|  |     {label: "药品名称", prop: "drugName"}, | ||||||
|  |     {label: "药量", prop: "dosage"}, | ||||||
|  |     {label: "生产厂家", prop: "factory"}, | ||||||
|  |     {label: "厂家批号", prop: "batchNumber"}, | ||||||
|  |     {label: "疾病名称", prop: "diseaseName"}, | ||||||
|  |     {label: "症状", prop: "symptom"}, | ||||||
|  |     {label: "兽医", prop: "userName"}, | ||||||
|  |     {label: "治疗时间", prop: "immunityTime"}, | ||||||
|  |     {label: "登记时间", prop: "createTime"}, | ||||||
|  |   ], | ||||||
|  |   outList: [ | ||||||
|  |     {label: "序号", type: "index"}, | ||||||
|  |     {label: "养殖场", prop: "userName", 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: "outTime"}, | ||||||
|  |     {label: "淘汰原因", prop: "reason"} | ||||||
|  |   ], | ||||||
|  |   deathList: [ | ||||||
|  |     {label: "序号", type: "index"}, | ||||||
|  |     {label: "养殖场", prop: "userName", 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}, | ||||||
|  |   ], | ||||||
|  |   insuranceList: [ | ||||||
|  |     {label: "序号", type: "index"}, | ||||||
|  |     {label: "保险类型", prop: "insuranceType", dict: "insuranceType"}, | ||||||
|  |     {label: "保单编号", prop: "orderNo"}, | ||||||
|  |   ] | ||||||
|  | } | ||||||
|  | const forms = { | ||||||
|  |   device: [ | ||||||
|  |     {label: "当前温度", prop: "temperature"}, | ||||||
|  |     {label: "温度状态", prop: "temperatureStatus", dict: "temperatureStatus"}, | ||||||
|  |     {label: "运动状态", prop: "sportsSituation", dict: "sportsSituation"}, | ||||||
|  |     {label: "在栏状态", prop: "status", dict: "archiveStatus"}, | ||||||
|  |   ], | ||||||
|  |   loan: [ | ||||||
|  |     {label: "贷款合同编号", prop: "contractNo"}, | ||||||
|   ] |   ] | ||||||
| } | } | ||||||
| const navs = [ | const navs = [ | ||||||
|   {label: "体重记录", value: "weightList"} |   {label: "体重记录", value: "weightList"}, | ||||||
|  |   {label: "免疫记录", value: "immunityList"}, | ||||||
|  |   {label: "治疗记录", value: "treatmentList"}, | ||||||
|  |   {label: "淘汰记录", value: "outList"}, | ||||||
|  |   {label: "死亡记录", value: "deathList"}, | ||||||
|  |   {label: "设备检测", value: "device"}, | ||||||
|  |   {label: "贷款信息", value: "loan"}, | ||||||
|  |   {label: "保险信息", value: "insuranceList"}, | ||||||
| ] | ] | ||||||
| export default { | export default { | ||||||
|   name: "baAdd", |   name: "baAdd", | ||||||
| @@ -24,7 +92,7 @@ export default { | |||||||
|     return { |     return { | ||||||
|       detail: {detailList: []}, |       detail: {detailList: []}, | ||||||
|       active: "weightList", |       active: "weightList", | ||||||
|       columns, navs |       columns, navs, forms | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   computed: { |   computed: { | ||||||
| @@ -46,7 +114,10 @@ export default { | |||||||
|       return id && this.instance.post("/api/report/getInfo", null, {params: {biochipEarNumber: id}}).then(res => { |       return id && this.instance.post("/api/report/getInfo", null, {params: {biochipEarNumber: id}}).then(res => { | ||||||
|         if (res?.data) { |         if (res?.data) { | ||||||
|           const detail = res.data |           const detail = res.data | ||||||
|           return this.detail = {detailList: [], ...detail} |           Object.keys(columns).forEach(key => { | ||||||
|  |             detail[key] = detail[key] || [] | ||||||
|  |           }) | ||||||
|  |           return this.detail = {...detail} | ||||||
|         } |         } | ||||||
|       }) |       }) | ||||||
|     }, |     }, | ||||||
| @@ -86,9 +157,18 @@ export default { | |||||||
|           </el-form-item> |           </el-form-item> | ||||||
|         </div> |         </div> | ||||||
|       </ai-card> |       </ai-card> | ||||||
|       <ai-card title="记录"> |       <el-tabs type="border-card" v-model="active"> | ||||||
|         <ai-table :colConfigs="columns[active]" :table-data="detail[active]" :isShowPagination="!1"/> |         <el-tab-pane v-for="(nav,i) in navs" :key="i" :label="nav.label" :name="nav.value" lazy> | ||||||
|       </ai-card> |           <template v-if="active==nav.value"> | ||||||
|  |             <ai-table v-if="columns[nav.value]" :colConfigs="columns[nav.value]" :table-data="detail[nav.value]" :isShowPagination="!1"/> | ||||||
|  |             <el-form v-if="forms[nav.value]" size="small" class="grid" label-width="120px"> | ||||||
|  |               <el-form-item v-for="(item,i) in forms[nav.value]" :key="i" :label="item.label" :prop="item.prop"> | ||||||
|  |                 <b v-text="dict.getLabel(item.dict||'yesOrNo',detail[item.prop])"/> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-form> | ||||||
|  |           </template> | ||||||
|  |         </el-tab-pane> | ||||||
|  |       </el-tabs> | ||||||
|     </el-form> |     </el-form> | ||||||
|     <div slot="footer"> |     <div slot="footer"> | ||||||
|       <el-button @click="back">返回</el-button> |       <el-button @click="back">返回</el-button> | ||||||
|   | |||||||
| @@ -3,16 +3,16 @@ import {mapState} from "vuex" | |||||||
|  |  | ||||||
| const columns = [ | const columns = [ | ||||||
|   {label: "序号", type: "index"}, |   {label: "序号", type: "index"}, | ||||||
|   {label: "养殖户", prop: "userName"}, |   {label: "养殖户", prop: "userName", width: 100}, | ||||||
|   {label: "养殖场", format: (v, row) => `${[row.farmName, row.houseName, row.penName].join("-")}`}, |   {label: "养殖场", format: (v, row) => `${[row.farmName, row.houseName, row.penName].join("-")}`, minWidth: 200}, | ||||||
|   {label: "生物芯片耳标号", prop: "biochipEarNumber"}, |   {label: "生物芯片耳标号", prop: "biochipEarNumber"}, | ||||||
|   {label: "电子耳标号", prop: "biochipEarNumber"}, |   {label: "电子耳标号", prop: "biochipEarNumber"}, | ||||||
|   {label: "原厂耳标号", prop: "biochipEarNumber"}, |   {label: "原厂耳标号", prop: "biochipEarNumber"}, | ||||||
|   {label: "入栏日期", prop: "createTime", width: 160}, |   {label: "入栏日期", prop: "createTime", width: 160}, | ||||||
|   {label: "饲养时长(天)", prop: "days", width: 120}, |   {label: "饲养时长(天)", prop: "days", width: 100, align: 'right', headerAlign: 'center'}, | ||||||
|   {label: "最新体重(公斤)", prop: "weight", width: 120}, |   {label: "最新体重(公斤)", prop: "weight", width: 120, align: 'right', headerAlign: 'center'}, | ||||||
|   {label: "当前体温", prop: "temperatureStatus", dict: 'temperatureStatus'}, |   // {label: "当前体温", prop: "temperatureStatus", dict: 'temperatureStatus'}, | ||||||
|   {label: "运动情况", prop: "sportsSituation", dict: "sportsSituation"}, |   // {label: "运动情况", prop: "sportsSituation", dict: "sportsSituation"}, | ||||||
| ] | ] | ||||||
| export default { | export default { | ||||||
|   name: "baList", |   name: "baList", | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user