新增羊只时的羊只类型,各页面导出功能需求,改品种功能的原品种回显需求,完成
This commit is contained in:
@@ -471,9 +471,15 @@ function handleDelete(row) {
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('frozen/embryo/export', {
|
||||
...queryParams.value
|
||||
}, `embryo_${new Date().getTime()}.xlsx`)
|
||||
queryParams.value.ids = ids.value;
|
||||
|
||||
try {
|
||||
proxy.download('frozen/embryo/export',
|
||||
{...queryParams.value},
|
||||
`冻胚记录${Date.now()}.xlsx`);
|
||||
} finally {
|
||||
queryParams.value.ids = null;
|
||||
}
|
||||
}
|
||||
|
||||
/** 失焦或点击“查询” */
|
||||
|
||||
@@ -500,11 +500,16 @@ function handleDelete(row) {
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('sperm/sperm/export', {
|
||||
...queryParams.value
|
||||
}, `sperm_${new Date().getTime()}.xlsx`)
|
||||
queryParams.value.ids = ids.value;
|
||||
|
||||
try {
|
||||
proxy.download('sperm/sperm/export', {
|
||||
...queryParams.value
|
||||
}, `冻精记录${Date.now()}.xlsx`);
|
||||
} finally {
|
||||
queryParams.value.ids = null;
|
||||
}
|
||||
}
|
||||
|
||||
// 废弃
|
||||
function handleDiscard() {
|
||||
if (!ids.value.length) return proxy.$modal.msgWarning('请选择记录')
|
||||
|
||||
@@ -569,11 +569,13 @@ function handleDelete(row) {
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('body_measure/body_measure/export', {
|
||||
...queryParams.value
|
||||
}, `body_measure_${new Date().getTime()}.xlsx`)
|
||||
queryParams.value.ids = ids.value;
|
||||
try {
|
||||
proxy.download('body_measure/body_measure/export', { ...queryParams.value }, `体尺测量记录${Date.now()}.xlsx`);
|
||||
} finally {
|
||||
queryParams.value.ids = null;
|
||||
}
|
||||
}
|
||||
|
||||
//加载羊舍数据
|
||||
const sheepfoldOptions = ref([])
|
||||
function getSheepfoldOptions() {
|
||||
|
||||
@@ -501,11 +501,13 @@ function handleDelete(row) {
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('body_score/body_score/export', {
|
||||
...queryParams.value
|
||||
}, `body_score_${new Date().getTime()}.xlsx`)
|
||||
queryParams.value.ids = ids.value;
|
||||
try {
|
||||
proxy.download('body_score/body_score/export', { ...queryParams.value }, `体况评分记录${Date.now()}.xlsx`);
|
||||
} finally {
|
||||
queryParams.value.ids = null;
|
||||
}
|
||||
}
|
||||
|
||||
//加载品种数据
|
||||
const varietyOptions = ref([])
|
||||
function loadVarietyOptions() {
|
||||
|
||||
@@ -510,11 +510,13 @@ function handleDelete(row) {
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('breast_rating/breast_rating/export', {
|
||||
...queryParams.value
|
||||
}, `breast_rating_${new Date().getTime()}.xlsx`)
|
||||
queryParams.value.ids = ids.value;
|
||||
try {
|
||||
proxy.download('breast_rating/breast_rating/export', { ...queryParams.value }, `乳况评分记录${Date.now()}.xlsx`);
|
||||
} finally {
|
||||
queryParams.value.ids = null;
|
||||
}
|
||||
}
|
||||
|
||||
//加载羊舍数据
|
||||
const sheepfoldOptions = ref([])
|
||||
function getSheepfoldOptions() {
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
v-hasPermi="['produce:add_sheep:import']">导入</el-button>
|
||||
<el-button type="warning" icon="Upload" @click="handleExportForm">下载模板</el-button>
|
||||
|
||||
|
||||
<!-- 新增/编辑表单 -->
|
||||
<el-form :model="form" ref="formRef" label-position="left" label-width="120px" style="margin-top:15px"
|
||||
:rules="rules">
|
||||
@@ -15,14 +14,6 @@
|
||||
<el-input v-model="form.earNumber" placeholder="请输入耳号" @blur="handleEarNumberBlur" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="入群日期" prop="joinDate">
|
||||
<el-date-picker v-model="form.joinDate" type="date" placeholder="选择入群日期" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="牧场" prop="ranchId">
|
||||
<el-select v-model="form.ranchId" placeholder="请选择牧场" clearable @change="handleRanchChange" required>
|
||||
@@ -30,6 +21,9 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="羊舍" prop="sheepfold">
|
||||
<el-select v-model="form.sheepfold" placeholder="请选择羊舍" clearable :disabled="!form.ranchId">
|
||||
@@ -37,45 +31,50 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="父号" prop="father">
|
||||
<el-input v-model="form.father" placeholder="请输入父号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="母号" prop="mother">
|
||||
<el-input v-model="form.mother" placeholder="请输入母号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="外祖父" prop="grandpa">
|
||||
<el-input v-model="form.grandpa" placeholder="请输入外祖父耳号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="外祖母" prop="grandma">
|
||||
<el-input v-model="form.grandma" placeholder="请输入外祖母耳号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="出生体重(kg)" prop="bornWeight">
|
||||
<el-input v-model="form.bornWeight" placeholder="请输入出生体重" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="断奶体重(kg)" prop="weaningWeight">
|
||||
<el-input v-model="form.weaningWeight" placeholder="请输入断奶体重" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="出生日期" prop="birthday">
|
||||
<el-date-picker v-model="form.birthday" type="date" placeholder="选择出生日期" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="胎次" prop="parity">
|
||||
<el-input-number v-model="form.parity" :min="0" label="胎次" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
@@ -88,6 +87,14 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="胎次" prop="parity">
|
||||
<el-input-number v-model="form.parity" :min="0" label="胎次" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="品种" prop="varietyId">
|
||||
<el-select v-model="form.varietyId" placeholder="请选择品种" clearable>
|
||||
@@ -95,9 +102,6 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="羊只类别" prop="typeId">
|
||||
<el-select v-model="form.typeId" placeholder="请选择羊只类别" clearable>
|
||||
@@ -105,13 +109,21 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="入群日期" prop="joinDate">
|
||||
<el-date-picker v-model="form.joinDate" type="date" placeholder="选择入群日期" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="10">
|
||||
<el-form-item label="技术员" prop="technician">
|
||||
<el-select v-model="form.technician" placeholder="请选择技术员" clearable filterable style="width: 100%">
|
||||
<el-option v-for="item in technicalOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
@@ -174,7 +186,9 @@ const form = ref({
|
||||
joinDate: '',
|
||||
comment: '',
|
||||
technician: '',
|
||||
weaningWeight: ''
|
||||
weaningWeight: '',
|
||||
grandpa: '',
|
||||
grandma: '',
|
||||
})
|
||||
const formRef = ref(null)
|
||||
const sheepfoldOptions = ref([])
|
||||
@@ -209,12 +223,10 @@ const rules = {
|
||||
ranchId: [{ required: true, message: '请选择牧场', trigger: 'change' }],
|
||||
sheepfold: [{ required: true, message: '请选择羊舍', trigger: 'change' }],
|
||||
bornWeight: [{ required: true, message: '请输入出生体重', trigger: 'change' }],
|
||||
weaningWeight: [{ required: true, message: '请输入断奶体重', trigger: 'blur' }],
|
||||
birthday: [{ required: true, message: '请选择出生日期', trigger: 'change' }],
|
||||
gender: [{ required: true, message: '请选择性别', trigger: 'change' }],
|
||||
varietyId: [{ required: true, message: '请选择品种', trigger: 'change' }],
|
||||
joinDate: [{ required: true, message: '请选择入群日期', trigger: 'change' }],
|
||||
technician: [{ required: true, message: '请输入技术员', trigger: 'change' }],
|
||||
}
|
||||
|
||||
// 校验耳号是否存在
|
||||
@@ -354,7 +366,9 @@ function resetForm() {
|
||||
typeId: null,
|
||||
joinDate: '',
|
||||
comment: '',
|
||||
technician: ''
|
||||
technician: '',
|
||||
grandpa: '',
|
||||
grandma: '',
|
||||
}
|
||||
}
|
||||
//下载模板
|
||||
|
||||
@@ -436,11 +436,13 @@ function handleDelete(row) {
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('changeComment/changeComment/export', {
|
||||
...queryParams.value
|
||||
}, `changeComment_${new Date().getTime()}.xlsx`)
|
||||
queryParams.value.ids = ids.value;
|
||||
try {
|
||||
proxy.download('changeComment/changeComment/export', { ...queryParams.value }, `改备注记录${Date.now()}.xlsx`);
|
||||
} finally {
|
||||
queryParams.value.ids = null;
|
||||
}
|
||||
}
|
||||
|
||||
//加载羊舍数据
|
||||
const sheepfoldOptions = ref([])
|
||||
function getSheepfoldOptions() {
|
||||
|
||||
@@ -476,9 +476,12 @@ function handleDelete(row) {
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('changeEar/changeEar/export', {
|
||||
...queryParams.value
|
||||
}, `changeEar_${new Date().getTime()}.xlsx`)
|
||||
queryParams.value.ids = ids.value;
|
||||
try {
|
||||
proxy.download('changeEar/changeEar/export', { ...queryParams.value }, `改耳号记录${Date.now()}.xlsx`);
|
||||
} finally {
|
||||
queryParams.value.ids = null;
|
||||
}
|
||||
}
|
||||
|
||||
//加载羊舍数据
|
||||
|
||||
@@ -157,7 +157,13 @@
|
||||
</el-button>
|
||||
</div>
|
||||
<el-form-item label="原品种" prop="varietyOld">
|
||||
<el-input v-model="form.varietyOld" placeholder="页面自动获取展示" disabled />
|
||||
<span v-if="batchSheep.length === 0" class="placeholder-text">请输入耳号后自动获取</span>
|
||||
<div v-else class="variety-old-list">
|
||||
<el-tag v-for="(sheep, idx) in batchSheep" :key="sheep.id" type="warning" effect="plain" size="small"
|
||||
style="margin: 2px 4px 2px 0;">
|
||||
{{ sheep.varietyName || '未知品种' }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="新品种" prop="varietyNew">
|
||||
<el-select v-model="form.varietyNew" placeholder="请选择新品种" clearable filterable :disabled="!isAdd">
|
||||
@@ -437,12 +443,18 @@ function handleDelete(row) {
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('changeVariety/changeVariety/export', {
|
||||
...queryParams.value
|
||||
}, `changeVariety_${new Date().getTime()}.xlsx`)
|
||||
queryParams.value.ids = ids.value;
|
||||
|
||||
try {
|
||||
proxy.download('changeVariety/changeVariety/export',
|
||||
{ ...queryParams.value },
|
||||
`改品种记录_${Date.now()}.xlsx`
|
||||
);
|
||||
} finally {
|
||||
queryParams.value.ids = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//加载羊舍数据
|
||||
const sheepfoldOptions = ref([])
|
||||
function getSheepfoldOptions() {
|
||||
@@ -589,4 +601,34 @@ onMounted(() => {
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.variety-old-list {
|
||||
min-height: 32px;
|
||||
/* 与el-input高度一致 */
|
||||
max-height: 150px;
|
||||
overflow-y: auto;
|
||||
padding: 4px 8px;
|
||||
background-color: #f5f7fa;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.placeholder-text {
|
||||
display: block;
|
||||
min-height: 32px;
|
||||
line-height: 32px;
|
||||
padding: 0 8px;
|
||||
background-color: #f5f7fa;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
color: #c0c4cc;
|
||||
font-size: 14px;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -759,11 +759,12 @@ function handleDelete(row) {
|
||||
}
|
||||
//导出
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
'/produce/manage_sheep/trans_group/export',
|
||||
{ ...queryParams.value },
|
||||
`trans_group_${Date.now()}.xlsx`
|
||||
);
|
||||
queryParams.value.ids = ids.value;
|
||||
try {
|
||||
proxy.download('/produce/manage_sheep/trans_group/export', { ...queryParams.value }, `转群记录${Date.now()}.xlsx`);
|
||||
} finally {
|
||||
queryParams.value.ids = null;
|
||||
}
|
||||
}
|
||||
|
||||
//加载羊舍数据
|
||||
|
||||
@@ -574,11 +574,12 @@ async function loadSheepInfo() {
|
||||
|
||||
// 导出
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
'/produce/manage_sheep/transition_info/export',
|
||||
{ ...queryParams.value },
|
||||
`transition_info_${Date.now()}.xlsx`
|
||||
);
|
||||
queryParams.value.ids = ids.value;
|
||||
try {
|
||||
proxy.download('/produce/manage_sheep/transition_info/export', { ...queryParams.value }, `转场记录${Date.now()}.xlsx`);
|
||||
} finally {
|
||||
queryParams.value.ids = null;
|
||||
}
|
||||
}
|
||||
|
||||
// 审批
|
||||
|
||||
@@ -510,7 +510,12 @@ function handleDelete(row) {
|
||||
|
||||
//导出
|
||||
function handleExport() {
|
||||
proxy.download('/produce/other/castrate/export', { ...queryParams.value }, `castrate_${new Date().getTime()}.xlsx`)
|
||||
queryParams.value.ids = ids.value;
|
||||
try {
|
||||
proxy.download('/produce/other/castrate/export', { ...queryParams.value }, `去势记录${Date.now()}.xlsx`);
|
||||
} finally {
|
||||
queryParams.value.ids = null;
|
||||
}
|
||||
}
|
||||
// 获取技术员列表(岗位编码:techs)
|
||||
const fetchTechnicalList = () => {
|
||||
|
||||
@@ -470,9 +470,13 @@ function handleDelete(row) {
|
||||
|
||||
//导出
|
||||
function handleExport() {
|
||||
proxy.download('/produce/other/fixHoof/export', { ...queryParams.value }, `fixHoof_${new Date().getTime()}.xlsx`)
|
||||
queryParams.value.ids = ids.value;
|
||||
try {
|
||||
proxy.download('/produce/other/fixHoof/export', { ...queryParams.value }, `修蹄记录${Date.now()}.xlsx`);
|
||||
} finally {
|
||||
queryParams.value.ids = null;
|
||||
}
|
||||
}
|
||||
|
||||
//加载羊舍数据
|
||||
const sheepfoldOptions = ref([])
|
||||
function getSheepfoldOptions() {
|
||||
|
||||
@@ -57,7 +57,7 @@ export default defineConfig(({ mode, command }) => {
|
||||
},
|
||||
// vite 相关配置
|
||||
server: {
|
||||
port: 80,
|
||||
port: 8082,
|
||||
host: true,
|
||||
open: true,
|
||||
proxy: {
|
||||
|
||||
Reference in New Issue
Block a user