|
|
@@ -16,6 +16,9 @@
|
|
16
|
16
|
<el-col :span="3"><span class="yak-detail__label">{{ lfT("fieldGender") }}:</span>{{ asset.gender || dash }}</el-col>
|
|
17
|
17
|
<el-col :span="3"><span class="yak-detail__label">{{ lfT("fieldAgeMonths") }}:</span>{{ formatAgeMonths(asset.ageMonths) }}</el-col>
|
|
18
|
18
|
</el-row>
|
|
|
19
|
+ <el-row v-if="asset.earTagNumber" :gutter="16" class="yak-detail__summary-extra">
|
|
|
20
|
+ <el-col :span="6"><span class="yak-detail__label">{{ lfT("fieldEarTagNumber") }}:</span>{{ asset.earTagNumber }}</el-col>
|
|
|
21
|
+ </el-row>
|
|
19
|
22
|
<div v-if="asset.lastSyncTime" class="yak-detail__sync-hint">{{ lfT("syncTimeHint", { time: parseTime(asset.lastSyncTime) }) }}</div>
|
|
20
|
23
|
</el-card>
|
|
21
|
24
|
|
|
|
@@ -23,9 +26,13 @@
|
|
23
|
26
|
<div slot="header">{{ lfT("sectionBasic") }}</div>
|
|
24
|
27
|
<el-descriptions v-if="asset" :column="3" border size="small">
|
|
25
|
28
|
<el-descriptions-item :label="lfT('fieldYakNo')">{{ asset.yakNo || dash }}</el-descriptions-item>
|
|
|
29
|
+ <el-descriptions-item :label="lfT('fieldEarTagNumber')">{{ asset.earTagNumber || dash }}</el-descriptions-item>
|
|
26
|
30
|
<el-descriptions-item :label="lfT('fieldPastureName')">{{ asset.pastureName || dash }}</el-descriptions-item>
|
|
27
|
31
|
<el-descriptions-item :label="lfT('fieldBatchNo')">{{ asset.batchNo || dash }}</el-descriptions-item>
|
|
|
32
|
+ <el-descriptions-item :label="lfT('fieldEnclosureName')">{{ asset.enclosureName || dash }}</el-descriptions-item>
|
|
|
33
|
+ <el-descriptions-item :label="lfT('fieldEntryCycle')">{{ asset.entryCycle || dash }}</el-descriptions-item>
|
|
28
|
34
|
<el-descriptions-item :label="lfT('fieldGender')">{{ asset.gender || dash }}</el-descriptions-item>
|
|
|
35
|
+ <el-descriptions-item :label="lfT('fieldCattleVariety')">{{ asset.cattleVariety || dash }}</el-descriptions-item>
|
|
29
|
36
|
<el-descriptions-item :label="lfT('fieldBirthDate')">{{ asset.birthDate || dash }}</el-descriptions-item>
|
|
30
|
37
|
<el-descriptions-item :label="lfT('fieldAgeMonths')">{{ formatAgeMonths(asset.ageMonths) }}</el-descriptions-item>
|
|
31
|
38
|
<el-descriptions-item :label="lfT('fieldEntryDate')">{{ asset.entryDate || dash }}</el-descriptions-item>
|
|
|
@@ -33,7 +40,22 @@
|
|
33
|
40
|
<el-descriptions-item :label="lfT('fieldSource')">{{ asset.source || dash }}</el-descriptions-item>
|
|
34
|
41
|
<el-descriptions-item :label="lfT('fieldBreedingMethod')">{{ asset.breedingMethod || dash }}</el-descriptions-item>
|
|
35
|
42
|
<el-descriptions-item :label="lfT('fieldAssetStatus')">{{ assetStatusLabel(asset.assetStatus) }}</el-descriptions-item>
|
|
|
43
|
+ <el-descriptions-item :label="lfT('fieldStatusChangeDate')">{{ asset.statusChangeDate || dash }}</el-descriptions-item>
|
|
|
44
|
+ <el-descriptions-item :label="lfT('fieldStatusChangeReason')">{{ asset.statusChangeReason || dash }}</el-descriptions-item>
|
|
|
45
|
+ <el-descriptions-item :label="lfT('fieldPenLocation')">{{ asset.penLocation || dash }}</el-descriptions-item>
|
|
|
46
|
+ <el-descriptions-item :label="lfT('fieldExpectedOutDate')">{{ asset.expectedOutDate || dash }}</el-descriptions-item>
|
|
|
47
|
+ <el-descriptions-item :label="lfT('fieldSupplementPlan')">{{ asset.supplementPlan || dash }}</el-descriptions-item>
|
|
|
48
|
+ <el-descriptions-item :label="lfT('fieldRegistrant')">{{ asset.registrant || dash }}</el-descriptions-item>
|
|
36
|
49
|
<el-descriptions-item :label="lfT('fieldLastSyncTime')">{{ asset.lastSyncTime ? parseTime(asset.lastSyncTime) : dash }}</el-descriptions-item>
|
|
|
50
|
+ <el-descriptions-item :label="lfT('fieldRemark')" :span="3">{{ asset.remark || dash }}</el-descriptions-item>
|
|
|
51
|
+ <el-descriptions-item v-if="asset.cattlePicture" :label="lfT('fieldCattlePicture')" :span="3">
|
|
|
52
|
+ <el-image
|
|
|
53
|
+ :src="asset.cattlePicture"
|
|
|
54
|
+ fit="contain"
|
|
|
55
|
+ class="yak-detail__picture"
|
|
|
56
|
+ :preview-src-list="[asset.cattlePicture]"
|
|
|
57
|
+ />
|
|
|
58
|
+ </el-descriptions-item>
|
|
37
|
59
|
</el-descriptions>
|
|
38
|
60
|
</el-card>
|
|
39
|
61
|
|
|
|
@@ -84,7 +106,7 @@
|
|
84
|
106
|
</el-select>
|
|
85
|
107
|
</span>
|
|
86
|
108
|
</div>
|
|
87
|
|
- <el-table v-show="growthMode === 'list'" :data="growthRecords" border size="small" max-height="280">
|
|
|
109
|
+ <el-table v-show="growthMode === 'list'" :data="displayGrowthRecords" border size="small" max-height="280">
|
|
88
|
110
|
<el-table-column :label="lfT('colDayAge')" prop="dayAge" align="center" width="80" />
|
|
89
|
111
|
<el-table-column :label="lfT('colWeight')" align="center" width="90">
|
|
90
|
112
|
<template slot-scope="scope">{{ formatWithUnit(scope.row.weightKg, lfCommon('unitKg')) }}</template>
|
|
|
@@ -142,6 +164,24 @@
|
|
142
|
164
|
<el-table-column :label="lfT('colFeedType')" prop="feedType" align="center" min-width="120" :show-overflow-tooltip="true" />
|
|
143
|
165
|
</el-table>
|
|
144
|
166
|
</el-card>
|
|
|
167
|
+
|
|
|
168
|
+ <el-card shadow="never" class="yak-detail__block">
|
|
|
169
|
+ <div slot="header">{{ lfT("sectionPen") }}</div>
|
|
|
170
|
+ <el-table :data="penTableRows" border size="small">
|
|
|
171
|
+ <el-table-column :label="lfT('colEnclosureName')" prop="enclosureName" align="center" min-width="140" :show-overflow-tooltip="true" />
|
|
|
172
|
+ <el-table-column :label="lfT('colPenLocation')" prop="penLocation" align="center" min-width="140" :show-overflow-tooltip="true" />
|
|
|
173
|
+ <el-table-column :label="lfT('fieldYakNo')" prop="yakNo" align="center" min-width="120" />
|
|
|
174
|
+ </el-table>
|
|
|
175
|
+ </el-card>
|
|
|
176
|
+
|
|
|
177
|
+ <el-card shadow="never" class="yak-detail__block">
|
|
|
178
|
+ <div slot="header">{{ lfT("sectionBatch") }}</div>
|
|
|
179
|
+ <el-table :data="batchTableRows" border size="small">
|
|
|
180
|
+ <el-table-column :label="lfT('fieldBatchNo')" prop="batchNo" align="center" min-width="140" :show-overflow-tooltip="true" />
|
|
|
181
|
+ <el-table-column :label="lfT('colEntryCycle')" prop="entryCycle" align="center" min-width="120" :show-overflow-tooltip="true" />
|
|
|
182
|
+ <el-table-column :label="lfT('fieldYakNo')" prop="yakNo" align="center" min-width="120" />
|
|
|
183
|
+ </el-table>
|
|
|
184
|
+ </el-card>
|
|
145
|
185
|
</div>
|
|
146
|
186
|
</el-drawer>
|
|
147
|
187
|
</template>
|
|
|
@@ -192,6 +232,29 @@ export default {
|
|
192
|
232
|
{ value: "chest", label: this.lfT("metricChest") },
|
|
193
|
233
|
{ value: "length", label: this.lfT("metricLength") }
|
|
194
|
234
|
]
|
|
|
235
|
+ },
|
|
|
236
|
+ penTableRows() {
|
|
|
237
|
+ if (!this.asset) {
|
|
|
238
|
+ return []
|
|
|
239
|
+ }
|
|
|
240
|
+ return [{
|
|
|
241
|
+ enclosureName: this.asset.enclosureName,
|
|
|
242
|
+ penLocation: this.asset.penLocation,
|
|
|
243
|
+ yakNo: this.asset.yakNo
|
|
|
244
|
+ }]
|
|
|
245
|
+ },
|
|
|
246
|
+ batchTableRows() {
|
|
|
247
|
+ if (!this.asset) {
|
|
|
248
|
+ return []
|
|
|
249
|
+ }
|
|
|
250
|
+ return [{
|
|
|
251
|
+ batchNo: this.asset.batchNo,
|
|
|
252
|
+ entryCycle: this.asset.entryCycle,
|
|
|
253
|
+ yakNo: this.asset.yakNo
|
|
|
254
|
+ }]
|
|
|
255
|
+ },
|
|
|
256
|
+ displayGrowthRecords() {
|
|
|
257
|
+ return (this.growthRecords || []).filter((row) => this.hasDayAge(row))
|
|
195
|
258
|
}
|
|
196
|
259
|
},
|
|
197
|
260
|
watch: {
|
|
|
@@ -212,7 +275,7 @@ export default {
|
|
212
|
275
|
},
|
|
213
|
276
|
methods: {
|
|
214
|
277
|
assetStatusLabel(status) {
|
|
215
|
|
- if (status == null || status < 1 || status > 11) {
|
|
|
278
|
+ if (status == null || status < 1 || status > 4) {
|
|
216
|
279
|
return this.dash
|
|
217
|
280
|
}
|
|
218
|
281
|
return this.lfT("status" + status)
|
|
|
@@ -313,14 +376,16 @@ export default {
|
|
313
|
376
|
this.$nextTick(() => this.loadGrowthChart())
|
|
314
|
377
|
}
|
|
315
|
378
|
},
|
|
|
379
|
+ hasDayAge(item) {
|
|
|
380
|
+ return item && item.dayAge != null && item.dayAge !== ""
|
|
|
381
|
+ },
|
|
316
|
382
|
chartPointsToSeries(points) {
|
|
317
|
|
- const sorted = (points || []).slice().sort((a, b) => {
|
|
318
|
|
- const da = a.dayAge != null ? a.dayAge : 0
|
|
319
|
|
- const db = b.dayAge != null ? b.dayAge : 0
|
|
320
|
|
- return da - db
|
|
321
|
|
- })
|
|
|
383
|
+ const sorted = (points || [])
|
|
|
384
|
+ .filter((p) => this.hasDayAge(p))
|
|
|
385
|
+ .slice()
|
|
|
386
|
+ .sort((a, b) => a.dayAge - b.dayAge)
|
|
322
|
387
|
return {
|
|
323
|
|
- x: sorted.map((p) => (p.dayAge != null ? String(p.dayAge) : "")),
|
|
|
388
|
+ x: sorted.map((p) => String(p.dayAge)),
|
|
324
|
389
|
y: sorted.map((p) => (p.value != null ? Number(p.value) : null))
|
|
325
|
390
|
}
|
|
326
|
391
|
},
|
|
|
@@ -445,6 +510,13 @@ export default {
|
|
445
|
510
|
.yak-detail__label {
|
|
446
|
511
|
color: #909399;
|
|
447
|
512
|
}
|
|
|
513
|
+.yak-detail__summary-extra {
|
|
|
514
|
+ margin-top: 8px;
|
|
|
515
|
+}
|
|
|
516
|
+.yak-detail__picture {
|
|
|
517
|
+ width: 120px;
|
|
|
518
|
+ height: 120px;
|
|
|
519
|
+}
|
|
448
|
520
|
.yak-detail__sync-hint {
|
|
449
|
521
|
margin-top: 8px;
|
|
450
|
522
|
font-size: 12px;
|