死亡,孕检和新增了流产页面
This commit is contained in:
@@ -9,14 +9,6 @@
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="品种" prop="variety">
|
||||
<el-input
|
||||
v-model="queryParams.variety"
|
||||
placeholder="请输入品种"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="事件类型" prop="eventType">
|
||||
<el-input
|
||||
v-model="queryParams.eventType"
|
||||
@@ -33,12 +25,6 @@
|
||||
placeholder="请选择死亡日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-select v-model="queryParams.gender" placeholder="请选择性别" clearable>
|
||||
<el-option label="公" value="1" />
|
||||
<el-option label="母" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="死淘去向" prop="disposalDirection">
|
||||
<el-select v-model="queryParams.disposalDirection" placeholder="请选择死淘去向" clearable>
|
||||
<el-option label="深埋" value="深埋" />
|
||||
@@ -131,7 +117,7 @@
|
||||
<el-table-column label="死亡时羊只类别" align="center" prop="sheepType" width="130" />
|
||||
<el-table-column label="性别" align="center" prop="gender" width="80">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.gender === 1 ? '公' : scope.row.gender === 0 ? '母' : '' }}</span>
|
||||
<span>{{ scope.row.gender === 1 ? '母' : scope.row.gender === 2 ? '公' : '' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="日龄" align="center" prop="dayAge" width="80" />
|
||||
@@ -170,64 +156,13 @@
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改羊只死淘记录对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="800px" append-to-body>
|
||||
<!-- 添加或修改羊只死淘记录对话框 - 简化版 -->
|
||||
<el-dialog :title="title" v-model="open" width="600px" append-to-body>
|
||||
<el-form ref="deathRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="管理耳号" prop="manageTags">
|
||||
<el-input v-model="form.manageTags" placeholder="请输入管理耳号" @blur="handleEarTagBlur" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="事件类型" prop="eventType">
|
||||
<el-input v-model="form.eventType" placeholder="事件类型" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="品种" prop="variety">
|
||||
<el-input v-model="form.variety" placeholder="品种" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="死亡时羊只类别" prop="sheepType">
|
||||
<el-input v-model="form.sheepType" placeholder="羊只类别" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-select v-model="form.gender" placeholder="请选择性别" disabled>
|
||||
<el-option label="公" :value="1" />
|
||||
<el-option label="母" :value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="日龄" prop="dayAge">
|
||||
<el-input-number v-model="form.dayAge" placeholder="日龄" :min="0" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="胎次" prop="parity">
|
||||
<el-input-number v-model="form.parity" placeholder="胎次" :min="0" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="羊舍" prop="sheepfoldName">
|
||||
<el-input v-model="form.sheepfoldName" placeholder="羊舍" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="繁育状态" prop="breedStatus">
|
||||
<el-input v-model="form.breedStatus" placeholder="繁育状态" readonly />
|
||||
<el-input v-model="form.manageTags" placeholder="请输入管理耳号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -241,23 +176,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="死亡时产后天数" prop="postLambingDay">
|
||||
<el-input-number v-model="form.postLambingDay" placeholder="产后天数" :min="0" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="死亡时泌乳天数" prop="lactationDay">
|
||||
<el-input-number v-model="form.lactationDay" placeholder="泌乳天数" :min="0" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="死亡时怀孕天数" prop="gestationDay">
|
||||
<el-input-number v-model="form.gestationDay" placeholder="怀孕天数" :min="0" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="疾病类型ID" prop="diseaseTypeId">
|
||||
@@ -270,6 +189,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="死淘去向" prop="disposalDirection">
|
||||
@@ -285,6 +205,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="处理人" prop="handler">
|
||||
@@ -297,6 +218,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="comment">
|
||||
@@ -316,9 +238,9 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Death">
|
||||
import { listDeath, getDeath, delDeath, addDeath, updateDeath, getSheepInfo } from "@/api/sheep_death/death"
|
||||
import {listDeath, getDeath, delDeath, addDeath, updateDeath} from "@/api/sheep_death/death"
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const {proxy} = getCurrentInstance()
|
||||
|
||||
const deathList = ref([])
|
||||
const open = ref(false)
|
||||
@@ -336,38 +258,28 @@ const data = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
manageTags: null,
|
||||
variety: null,
|
||||
eventType: null,
|
||||
deathDate: null,
|
||||
sheepType: null,
|
||||
gender: null,
|
||||
dayAge: null,
|
||||
parity: null,
|
||||
diseaseTypeId: null,
|
||||
diseaseSubtypeId: null,
|
||||
disposalDirection: null,
|
||||
technician: null,
|
||||
handler: null,
|
||||
sheepfoldName: null,
|
||||
workGroup: null,
|
||||
breedStatus: null,
|
||||
postLambingDay: null,
|
||||
lactationDay: null,
|
||||
gestationDay: null,
|
||||
comment: null,
|
||||
isDelete: null
|
||||
},
|
||||
rules: {
|
||||
manageTags: [
|
||||
{ required: true, message: "管理耳号不能为空", trigger: "blur" }
|
||||
{required: true, message: "管理耳号不能为空", trigger: "blur"}
|
||||
],
|
||||
deathDate: [
|
||||
{ required: true, message: "死亡日期不能为空", trigger: "blur" }
|
||||
{required: true, message: "死亡日期不能为空", trigger: "blur"}
|
||||
],
|
||||
}
|
||||
})
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
const {queryParams, form, rules} = toRefs(data)
|
||||
|
||||
/** 查询羊只死淘记录列表 */
|
||||
function getList() {
|
||||
@@ -385,33 +297,23 @@ function cancel() {
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
// 表单重置 - 简化版
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
sheepId: null,
|
||||
manageTags: null,
|
||||
variety: null,
|
||||
eventType: "死亡",
|
||||
deathDate: new Date().toISOString().split('T')[0],
|
||||
sheepType: null,
|
||||
gender: null,
|
||||
dayAge: null,
|
||||
parity: null,
|
||||
eventType: "死亡", // 默认事件类型
|
||||
deathDate: new Date().toISOString().split('T')[0], // 默认今日
|
||||
diseaseTypeId: null,
|
||||
diseaseSubtypeId: null,
|
||||
disposalDirection: null,
|
||||
technician: null,
|
||||
handler: null,
|
||||
sheepfoldName: null,
|
||||
workGroup: null,
|
||||
breedStatus: null,
|
||||
postLambingDay: null,
|
||||
lactationDay: null,
|
||||
gestationDay: null,
|
||||
comment: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
comment: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
isDelete: null
|
||||
@@ -419,44 +321,6 @@ function reset() {
|
||||
proxy.resetForm("deathRef")
|
||||
}
|
||||
|
||||
/** 管理耳号失去焦点事件 */
|
||||
function handleEarTagBlur() {
|
||||
if (form.value.manageTags && form.value.manageTags.trim()) {
|
||||
getSheepInfo(form.value.manageTags.trim()).then(response => {
|
||||
if (response.code === 200 && response.data) {
|
||||
const sheepData = response.data
|
||||
form.value.sheepId = sheepData.sheepId
|
||||
form.value.variety = sheepData.variety
|
||||
form.value.sheepType = sheepData.sheepType
|
||||
form.value.gender = sheepData.gender
|
||||
form.value.dayAge = sheepData.dayAge
|
||||
form.value.parity = sheepData.parity
|
||||
form.value.sheepfoldName = sheepData.sheepfoldName
|
||||
form.value.breedStatus = sheepData.breedStatus
|
||||
form.value.postLambingDay = sheepData.postLambingDay
|
||||
form.value.lactationDay = sheepData.lactationDay
|
||||
form.value.gestationDay = sheepData.gestationDay
|
||||
} else {
|
||||
proxy.$modal.msgWarning("未找到该耳号对应的羊只信息")
|
||||
// 清空自动填充的字段
|
||||
form.value.sheepId = null
|
||||
form.value.variety = null
|
||||
form.value.sheepType = null
|
||||
form.value.gender = null
|
||||
form.value.dayAge = null
|
||||
form.value.parity = null
|
||||
form.value.sheepfoldName = null
|
||||
form.value.breedStatus = null
|
||||
form.value.postLambingDay = null
|
||||
form.value.lactationDay = null
|
||||
form.value.gestationDay = null
|
||||
}
|
||||
}).catch(() => {
|
||||
proxy.$modal.msgError("查询羊只信息失败")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
@@ -518,12 +382,13 @@ function submitForm() {
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal.confirm('是否确认删除羊只死淘记录编号为"' + _ids + '"的数据项?').then(function() {
|
||||
proxy.$modal.confirm('是否确认删除羊只死淘记录编号为"' + _ids + '"的数据项?').then(function () {
|
||||
return delDeath(_ids)
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}).catch(() => {
|
||||
})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
|
||||
Reference in New Issue
Block a user