clan.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. <template>
  2. <div class="clan">
  3. <el-page-header @back="$router.go(-1)" style="margin-bottom: 15px;">
  4. <template v-slot:content>
  5. <h3>系谱管理</h3>
  6. </template>
  7. </el-page-header>
  8. <!-- rowspan="2" -->
  9. <section class="section">
  10. <div class="container">
  11. <div class="left">
  12. <table cellspacing="0">
  13. <thead>
  14. <th colspan="4">基 本 情 况</th>
  15. </thead>
  16. <tr>
  17. <td class="title">品 种</td>
  18. <td>{{ self.variety }}</td>
  19. <td class="title">耳 标 编 号</td>
  20. <td>{{ self.id }}</td>
  21. </tr>
  22. <tr>
  23. <td class="title">性 别</td>
  24. <td>{{ self.gender==0?'母':self.gender==1?'公':'' }}</td>
  25. <td class="title">出 生 日 期</td>
  26. <td>{{ self.birthday.substr(0,10) }}</td>
  27. </tr>
  28. <tr>
  29. <td class="title">同 胞 数</td>
  30. <td>{{ self.brotherNum }}</td>
  31. <td class="title">出 生 体 重</td>
  32. <td>{{ self.birthWeight }}kg</td>
  33. </tr>
  34. <tr>
  35. <td class="title">6月龄体重</td>
  36. <td>{{ self.sixWeight }}kg</td>
  37. <td class="title">12月龄体重</td>
  38. <td>{{ self.twelveWeight }}kg</td>
  39. </tr>
  40. <tr>
  41. <td class="title">级 别</td>
  42. <td>
  43. <div
  44. v-for="item in $store.state['seedSheedLevel']"
  45. :key="item.value"
  46. >
  47. <span v-if="item.value == self.level">{{ item.label }}</span>
  48. </div>
  49. </td>
  50. <td class="title">胎 次</td>
  51. <td>{{ self.parity }}</td>
  52. </tr>
  53. </table>
  54. </div>
  55. <div class="right">
  56. <article class="l">
  57. <span class="title">系谱</span>
  58. <span class="line"></span>
  59. </article>
  60. <article class="m">
  61. <p>
  62. <span class="title">父</span>
  63. <span class="content">{{ father.id }}</span>
  64. </p>
  65. <p>
  66. <span class="title">母</span>
  67. <span class="content">{{ mother.id }}</span>
  68. </p>
  69. </article>
  70. <article class="m">
  71. <div>
  72. <p>
  73. <span class="title">父父</span>
  74. <span class="content">{{ fatherFather.id }}</span>
  75. </p>
  76. <p>
  77. <span class="title">父母</span>
  78. <span class="content">{{ fatherMother.id }}</span>
  79. </p>
  80. </div>
  81. <div>
  82. <p>
  83. <span class="title">母父</span>
  84. <span class="content">{{ motherFather.id }}</span>
  85. </p>
  86. <p>
  87. <span class="title">母母</span>
  88. <span class="content">{{ motherMother.id }}</span>
  89. </p>
  90. </div>
  91. </article>
  92. </div>
  93. </div>
  94. <table cellspacing="0">
  95. <tr>
  96. <td rowspan="2" class="title">代别</td>
  97. <td rowspan="2" class="title">个体编码</td>
  98. <td rowspan="2" class="title">产自单(多)羔羊</td>
  99. <td colspan="2" class="title">体高</td>
  100. <td colspan="3" class="title">体重</td>
  101. <td rowspan="2" class="title">12月龄剪毛重</td>
  102. <td rowspan="2" class="title">繁殖成绩</td>
  103. </tr>
  104. <tr>
  105. <td class="title">12月龄</td>
  106. <td class="title">24月龄</td>
  107. <td class="title">6月龄</td>
  108. <td class="title">12月龄</td>
  109. <td class="title" style="border-right: 1px solid #ccc;">24月龄</td>
  110. </tr>
  111. <tr>
  112. <td class="title">父</td>
  113. <td>{{ father.id }}</td>
  114. <td>{{ father.brotherNum>1?'是':'否' }}</td>
  115. <td>{{ father.twelveHeight }}</td>
  116. <td>{{ father.twFourHeight }}</td>
  117. <td>{{ father.sixWeight }}</td>
  118. <td>{{ father.twelveWeight }}</td>
  119. <td>{{ father.twFourWeight }}</td>
  120. <td>{{ father.twelveHair }}</td>
  121. <!-- <td>{{ father.deliverRank }}</td> -->
  122. <td>{{ calc_seedSheedLevel(father.deliverRank) }}</td>
  123. </tr>
  124. <tr>
  125. <td class="title">母</td>
  126. <td>{{ mother.id }}</td>
  127. <td>{{ mother.brotherNum>1?'是':'否' }}</td>
  128. <td>{{ mother.twelveHeight }}</td>
  129. <td>{{ mother.twFourHeight }}</td>
  130. <td>{{ mother.sixWeight }}</td>
  131. <td>{{ mother.twelveWeight }}</td>
  132. <td>{{ mother.twFourWeight }}</td>
  133. <td>{{ mother.twelveHair }}</td>
  134. <!-- <td>{{ mother.deliverRank }}</td> -->
  135. <td>{{ calc_seedSheedLevel(mother.deliverRank) }}</td>
  136. </tr>
  137. <tr>
  138. <td class="title">父父</td>
  139. <td>{{ fatherFather.id }}</td>
  140. <td>{{ fatherFather.brotherNum>1?'是':'否' }}</td>
  141. <td>{{ fatherFather.twelveHeight }}</td>
  142. <td>{{ fatherFather.twFourHeight }}</td>
  143. <td>{{ fatherFather.sixWeight }}</td>
  144. <td>{{ fatherFather.twelveWeight }}</td>
  145. <td>{{ fatherFather.twFourWeight }}</td>
  146. <td>{{ fatherFather.twelveHair }}</td>
  147. <!-- <td>{{ fatherFather.deliverRank }}</td> -->
  148. <td>{{ calc_seedSheedLevel(fatherFather.deliverRank) }}</td>
  149. </tr>
  150. <tr>
  151. <td class="title">父母</td>
  152. <td>{{ fatherMother.id }}</td>
  153. <td>{{ fatherMother.brotherNum>1?'是':'否' }}</td>
  154. <td>{{ fatherMother.twelveHeight }}</td>
  155. <td>{{ fatherMother.twFourHeight }}</td>
  156. <td>{{ fatherMother.sixWeight }}</td>
  157. <td>{{ fatherMother.twelveWeight }}</td>
  158. <td>{{ fatherMother.twFourWeight }}</td>
  159. <td>{{ fatherMother.twelveHair }}</td>
  160. <!-- <td>{{ fatherMother.deliverRank }}</td> -->
  161. <td>{{ calc_seedSheedLevel(fatherMother.deliverRank) }}</td>
  162. </tr>
  163. <tr>
  164. <td class="title">母父</td>
  165. <td>{{ motherFather.id }}</td>
  166. <td>{{ motherFather.brotherNum>1?'是':'否' }}</td>
  167. <td>{{ motherFather.twelveHeight }}</td>
  168. <td>{{ motherFather.twFourHeight }}</td>
  169. <td>{{ motherFather.sixWeight }}</td>
  170. <td>{{ motherFather.twelveWeight }}</td>
  171. <td>{{ motherFather.twFourWeight }}</td>
  172. <td>{{ motherFather.twelveHair }}</td>
  173. <!-- <td>{{ motherFather.deliverRank }}</td> -->
  174. <td>{{ calc_seedSheedLevel(motherFather.deliverRank) }}</td>
  175. </tr>
  176. <tr>
  177. <td class="title">母母</td>
  178. <td>{{ motherMother.id }}</td>
  179. <td>{{ motherMother.brotherNum>1?'是':'否' }}</td>
  180. <td>{{ motherMother.twelveHeight }}</td>
  181. <td>{{ motherMother.twFourHeight }}</td>
  182. <td>{{ motherMother.sixWeight }}</td>
  183. <td>{{ motherMother.twelveWeight }}</td>
  184. <td>{{ motherMother.twFourWeight }}</td>
  185. <td>{{ motherMother.twelveHair }}</td>
  186. <!-- <td>{{ motherMother.deliverRank }}</td> -->
  187. <td>{{ calc_seedSheedLevel(motherMother.deliverRank) }}</td>
  188. </tr>
  189. </table>
  190. </section>
  191. </div>
  192. </template>
  193. <script>
  194. import { reqClanInfo } from "@/api/cultivateSeed.js";
  195. export default {
  196. name: "clan",
  197. data() {
  198. return {
  199. self: {
  200. birthday: "" // 防报错
  201. },
  202. father: {},
  203. fatherFather: {},
  204. fatherMother: {},
  205. mother: {},
  206. motherFather: {},
  207. motherMother: {},
  208. aa: this.$store.state["seedSheedLevel"],
  209. calc_seedSheedLevel(id) {
  210. let obj = this.$store.state["seedSheedLevel"].find(item => {
  211. return item.value == id;
  212. });
  213. if (obj) return obj.label;
  214. }
  215. };
  216. },
  217. created() {
  218. // 系谱信息
  219. this.getClanInfo();
  220. },
  221. methods: {
  222. // 系谱信息
  223. getClanInfo() {
  224. reqClanInfo({
  225. id: this.$route.query.id
  226. })
  227. .then(res => {
  228. // this.CF = res;
  229. console.log(res);
  230. this.self = res.self;
  231. this.father = res.father;
  232. this.fatherFather = res.fatherFather;
  233. this.fatherMother = res.fatherMother;
  234. this.mother = res.mother;
  235. this.motherFather = res.motherFather;
  236. this.motherMother = res.motherMother;
  237. })
  238. .catch(err => {
  239. console.log(err);
  240. });
  241. }
  242. }
  243. };
  244. </script>
  245. <style lang="scss" scoped>
  246. $border: 1px solid #ccc;
  247. .clan {
  248. .section {
  249. width: 92%;
  250. .container {
  251. display: flex;
  252. .left {
  253. width: 55%;
  254. }
  255. .right {
  256. flex-grow: 1;
  257. border: $border;
  258. border-left: none;
  259. display: flex;
  260. color: #777;
  261. article {
  262. width: 33%;
  263. height: 100%;
  264. display: flex;
  265. flex-direction: column;
  266. justify-content: center;
  267. align-items: center;
  268. }
  269. .title {
  270. font-weight: 600;
  271. color: #555;
  272. font-size: 15px;
  273. }
  274. .l {
  275. display: flex;
  276. flex-direction: row;
  277. .line {
  278. display: inline-block;
  279. width: 50%;
  280. border-bottom: 1px solid #000;
  281. transform: translateY(0.5px);
  282. margin-left: 5px;
  283. }
  284. }
  285. .m {
  286. p {
  287. margin: 35px;
  288. .content {
  289. width: 100px;
  290. display: inline-block;
  291. margin-left: 10px;
  292. border-bottom: 1px solid #444;
  293. text-align: center;
  294. }
  295. }
  296. }
  297. }
  298. }
  299. }
  300. }
  301. table {
  302. border: $border;
  303. width: 100%;
  304. thead {
  305. th {
  306. height: 60px;
  307. font-size: 20px;
  308. color: #555;
  309. }
  310. }
  311. tr {
  312. height: 56px;
  313. td {
  314. border-top: $border;
  315. border-right: $border;
  316. text-align: center;
  317. color: #777;
  318. }
  319. td:last-of-type {
  320. border-right: none;
  321. }
  322. .title {
  323. font-weight: 600;
  324. color: #555;
  325. font-size: 15px;
  326. }
  327. }
  328. }
  329. </style>