You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
865 lines
29 KiB
865 lines
29 KiB
<template>
|
|
<div class="app-container">
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
|
<el-form-item label="疫苗标题" prop="title">
|
|
<el-input
|
|
v-model="queryParams.title"
|
|
placeholder="请输入疫苗标题"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="牲畜类型" prop="livestockType">
|
|
<el-select v-model="queryParams.livestockType" placeholder="请选择牲畜类型" clearable>
|
|
<el-option
|
|
v-for="dict in dict.type.livestock_type"
|
|
:key="dict.value"
|
|
:label="dict.label"
|
|
:value="dict.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<!-- <el-form-item label="疫苗类型" prop="vaccineType">-->
|
|
<!-- <el-select v-model="queryParams.vaccineType" placeholder="请选择疫苗类型" clearable>-->
|
|
<!-- <el-option-->
|
|
<!-- v-for="dict in dict.type.vaccine_type"-->
|
|
<!-- :key="dict.value"-->
|
|
<!-- :label="dict.label"-->
|
|
<!-- :value="dict.value"-->
|
|
<!-- />-->
|
|
<!-- </el-select>-->
|
|
<!-- </el-form-item>-->
|
|
<el-form-item label="状态" prop="status">
|
|
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
|
<el-option
|
|
v-for="dict in dict.type.vaccine_info_status"
|
|
:key="dict.value"
|
|
:label="dict.label"
|
|
:value="dict.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="接种日期" prop="vaccinationDate">
|
|
<el-date-picker clearable
|
|
v-model="queryParams.vaccinationDate"
|
|
type="date"
|
|
value-format="yyyy-MM-dd"
|
|
placeholder="请选择接种日期">
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
<el-form-item label="接种地点" prop="vaccinationLocation">
|
|
<el-input
|
|
v-model="queryParams.vaccinationLocation"
|
|
placeholder="请输入接种地点"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="报名截止时间" prop="endTime">
|
|
<el-date-picker clearable
|
|
v-model="queryParams.endTime"
|
|
type="date"
|
|
value-format="yyyy-MM-dd"
|
|
placeholder="请选择报名截止时间">
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
<el-form-item label="可预约数量" prop="availableSlots">
|
|
<el-input
|
|
v-model="queryParams.availableSlots"
|
|
placeholder="请输入可预约数量"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="总数量" prop="totalSlots">
|
|
<el-input
|
|
v-model="queryParams.totalSlots"
|
|
placeholder="请输入总数量"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<!-- <el-form-item label="发布时间" prop="publishTime">-->
|
|
<!-- <el-date-picker clearable-->
|
|
<!-- v-model="queryParams.publishTime"-->
|
|
<!-- type="date"-->
|
|
<!-- value-format="yyyy-MM-dd"-->
|
|
<!-- placeholder="请选择发布时间">-->
|
|
<!-- </el-date-picker>-->
|
|
<!-- </el-form-item>-->
|
|
<el-form-item>
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="primary"
|
|
plain
|
|
icon="el-icon-plus"
|
|
size="mini"
|
|
@click="handleAdd"
|
|
v-hasPermi="['system:vacInfo:add']"
|
|
>新增</el-button>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="success"
|
|
plain
|
|
icon="el-icon-edit"
|
|
size="mini"
|
|
:disabled="single"
|
|
@click="handleUpdate"
|
|
v-hasPermi="['system:vacInfo:edit']"
|
|
>修改</el-button>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="danger"
|
|
plain
|
|
icon="el-icon-delete"
|
|
size="mini"
|
|
:disabled="multiple"
|
|
@click="handleDelete"
|
|
v-hasPermi="['system:vacInfo:remove']"
|
|
>删除</el-button>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="warning"
|
|
plain
|
|
icon="el-icon-download"
|
|
size="mini"
|
|
@click="handleExport"
|
|
v-hasPermi="['system:vacInfo:export']"
|
|
>导出</el-button>
|
|
</el-col>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
</el-row>
|
|
|
|
<el-table v-loading="loading" :data="vacInfoList" @selection-change="handleSelectionChange">
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<!-- <el-table-column label="疫苗信息ID" align="center" prop="id" />-->
|
|
<el-table-column label="疫苗标题" align="center" prop="title" width="200px" :show-overflow-tooltip="true"/>
|
|
<el-table-column label="牲畜类型" align="center" prop="livestockType" width="100px">
|
|
<template slot-scope="scope">
|
|
<dict-tag :options="dict.type.livestock_type" :value="scope.row.livestockType"/>
|
|
</template>
|
|
</el-table-column>
|
|
<!-- <el-table-column label="疫苗类型" align="center" prop="vaccineType" width="200px">-->
|
|
<!-- <template slot-scope="scope">-->
|
|
<!-- <dict-tag :options="dict.type.vaccine_type" :value="scope.row.vaccineType"/>-->
|
|
<!-- </template>-->
|
|
<!-- </el-table-column>-->
|
|
<el-table-column label="疫苗类型" align="center" prop="vaccineType" width="200px" :show-overflow-tooltip="true"/>
|
|
<el-table-column label="详细描述" align="center" prop="description" width="300px" :show-overflow-tooltip="true"/>
|
|
<el-table-column label="接种日期" align="center" prop="vaccinationDate" width="180">
|
|
<template slot-scope="scope">
|
|
<span>{{ parseTime(scope.row.vaccinationDate, '{y}-{m}-{d}') }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="接种地点" align="center" prop="vaccinationLocation" width="200px"/>
|
|
<el-table-column label="可预约数量" align="center" prop="availableSlots" width="200px"/>
|
|
<el-table-column label="总数量" align="center" prop="totalSlots" width="200px"/>
|
|
<el-table-column label="状态" align="center" prop="status">
|
|
<template slot-scope="scope">
|
|
<dict-tag :options="dict.type.vaccine_info_status" :value="scope.row.status"/>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="发布时间" align="center" prop="publishTime" width="180">
|
|
<template slot-scope="scope">
|
|
<span>{{ parseTime(scope.row.publishTime, '{y}-{m}-{d}') }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="报名截止时间" align="center" prop="endTime" width="180">
|
|
<template slot-scope="scope">
|
|
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="300">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-edit"
|
|
style="color: #42B983"
|
|
class="info-btn alter-btn"
|
|
@click="handleUpdate(scope.row)"
|
|
v-hasPermi="['system:vacInfo:edit']"
|
|
>修改</el-button>
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-delete"
|
|
style="color: #f56c6c"
|
|
class="info-btn delete-btn"
|
|
@click="handleDelete(scope.row)"
|
|
v-hasPermi="['system:vacInfo:remove']"
|
|
>删除</el-button>
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-s-order"
|
|
style="color: rgb(92 169 179)"
|
|
class="info-btn reservation-btn"
|
|
@click="handleRegistrationList(scope.row)"
|
|
v-hasPermi="['system:vacInfo:list']"
|
|
>预约列表</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
|
|
<div class="pagestyle">
|
|
<pagination
|
|
v-show="total>0"
|
|
:total="total"
|
|
:page.sync="queryParams.pageNum"
|
|
:limit.sync="queryParams.pageSize"
|
|
@pagination="getList"
|
|
/>
|
|
</div>
|
|
|
|
<!-- 添加或修改疫苗信息对话框 -->
|
|
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
<el-row>
|
|
<el-col :span="12">
|
|
<el-form-item label="疫苗标题" prop="title">
|
|
<el-input v-model="form.title" placeholder="请输入疫苗标题" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="牲畜类型" prop="livestockType">
|
|
<el-select v-model="form.livestockType" placeholder="请选择牲畜类型" clearable @change="handleLivestockTypeChange">
|
|
<el-option
|
|
v-for="dict in dict.type.livestock_type"
|
|
:key="dict.value"
|
|
:label="dict.label"
|
|
:value="dict.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
|
|
<el-row>
|
|
<el-col :span="12">
|
|
<el-form-item label="疫苗类型" prop="vaccineType">
|
|
<el-select
|
|
v-model="form.vaccineType"
|
|
placeholder="请先选择牲畜类型"
|
|
clearable
|
|
:disabled="!form.livestockType"
|
|
@change="handleVaccineTypeChange"
|
|
@focus="handleVaccineTypeFocus"
|
|
filterable
|
|
>
|
|
<el-option
|
|
v-for="item in vaccineTypeOptions"
|
|
:key="item.id"
|
|
:label="getVaccineDisplayName(item)"
|
|
:value="item.id"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="状态" prop="status">
|
|
<el-select v-model="form.status" placeholder="请选择状态">
|
|
<el-option
|
|
v-for="dict in dict.type.vaccine_info_status"
|
|
:key="dict.value"
|
|
:label="dict.label"
|
|
:value="parseInt(dict.value)"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="12">
|
|
<el-form-item label="接种日期" prop="vaccinationDate">
|
|
<el-date-picker clearable
|
|
v-model="form.vaccinationDate"
|
|
type="date"
|
|
value-format="yyyy-MM-dd"
|
|
placeholder="请选择接种日期"
|
|
style="width: 100%;">
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="接种地点" prop="vaccinationLocation">
|
|
<el-input v-model="form.vaccinationLocation" placeholder="请输入接种地点" />
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
|
|
<el-row>
|
|
<el-col :span="12">
|
|
<el-form-item label="可预约数量" prop="availableSlots">
|
|
<el-input v-model="form.availableSlots" placeholder="请输入可预约数量" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="总数量" prop="totalSlots">
|
|
<el-input v-model="form.totalSlots" placeholder="请输入总数量" />
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="12">
|
|
<el-form-item label="报名截止期" prop="endTime">
|
|
<el-date-picker clearable
|
|
v-model="form.endTime"
|
|
type="date"
|
|
value-format="yyyy-MM-dd"
|
|
placeholder="请选择报名截止时间"
|
|
style="width: 100%;">
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="发布时间" prop="publishTime">
|
|
<el-date-picker clearable
|
|
v-model="form.publishTime"
|
|
type="date"
|
|
value-format="yyyy-MM-dd"
|
|
placeholder="请选择发布时间"
|
|
style="width: 100%;">
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-form-item label="详细描述">
|
|
<editor v-model="form.description" :min-height="192"/>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
|
|
<!-- 疫苗详细信息展示 -->
|
|
<div v-if="selectedVaccine" style="margin: 20px 0; border: 1px solid #ebeef5; border-radius: 4px; padding: 15px;">
|
|
<div style="font-weight: bold; margin-bottom: 10px; color: #409EFF;">疫苗详细信息</div>
|
|
<el-descriptions :column="2" border size="small">
|
|
<el-descriptions-item label="通用名称">{{ selectedVaccine.genericName || '暂无' }}</el-descriptions-item>
|
|
<el-descriptions-item label="商品名称">{{ selectedVaccine.tradeName || '暂无' }}</el-descriptions-item>
|
|
<el-descriptions-item label="兽药批准文号">{{ selectedVaccine.approvalNumber || '暂无' }}</el-descriptions-item>
|
|
<el-descriptions-item label="产品批号">{{ selectedVaccine.batchNumber || '暂无' }}</el-descriptions-item>
|
|
<el-descriptions-item label="规格">{{ selectedVaccine.specification || '暂无' }}</el-descriptions-item>
|
|
<el-descriptions-item label="生产厂家">{{ selectedVaccine.manufacturer || '暂无' }}</el-descriptions-item>
|
|
<el-descriptions-item label="生产日期">{{ parseTime(selectedVaccine.manufactureDate, '{y}-{m}-{d}') || '暂无' }}</el-descriptions-item>
|
|
<el-descriptions-item label="有效期至">{{ parseTime(selectedVaccine.expiryDate, '{y}-{m}-{d}') || '暂无' }}</el-descriptions-item>
|
|
<el-descriptions-item label="适用动物" :span="2">
|
|
<dict-tag :options="dict.type.livestock_type" :value="selectedVaccine.livestockType"/>
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="预防疫病">{{ selectedVaccine.preventDisease || '暂无' }}</el-descriptions-item>
|
|
<el-descriptions-item label="是否强制免疫">{{ selectedVaccine.isMandatory === '1' ? '是' : '否' }}</el-descriptions-item>
|
|
<el-descriptions-item label="免疫期(天)">{{ selectedVaccine.immunePeriod || '暂无' }}</el-descriptions-item>
|
|
<el-descriptions-item label="用法用量">{{ selectedVaccine.dosage || '暂无' }}</el-descriptions-item>
|
|
<el-descriptions-item label="接种途径">{{ selectedVaccine.administrationRoute || '暂无' }}</el-descriptions-item>
|
|
<el-descriptions-item label="贮藏条件">{{ selectedVaccine.storageCondition || '暂无' }}</el-descriptions-item>
|
|
<el-descriptions-item label="注意事项">{{ selectedVaccine.precautions || '暂无' }}</el-descriptions-item>
|
|
<el-descriptions-item label="库存数量">{{ selectedVaccine.stockQuantity || '暂无' }}</el-descriptions-item>
|
|
<el-descriptions-item label="已使用数量">{{ selectedVaccine.usedQuantity || '暂无' }}</el-descriptions-item>
|
|
</el-descriptions>
|
|
</div>
|
|
|
|
<el-row>
|
|
<el-col :span="12">
|
|
<el-form-item label="删除标志" prop="delFlag">
|
|
<el-input v-model="form.delFlag" placeholder="请输入删除标志" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="创建者" prop="createBy">
|
|
<el-input v-model="form.createBy" placeholder="请输入创建者" :disabled="true" />
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-form-item label="备注" prop="remark">
|
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" :rows="3" />
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
|
|
<!-- 疫苗预约列表弹窗 -->
|
|
<el-dialog
|
|
:title="registrationDialogTitle"
|
|
:visible.sync="registrationDialogVisible"
|
|
width="80%"
|
|
append-to-body
|
|
@close="handleRegistrationClose"
|
|
class="registration-dialog"
|
|
>
|
|
<div v-if="registrationDialogVisible" style="height: 70vh; overflow-y: auto;">
|
|
<VacRegistration
|
|
:key="currentVaccineId"
|
|
ref="registrationComponent"
|
|
/>
|
|
</div>
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button @click="handleRegistrationClose">关 闭</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { listVacInfo, getVacInfo, delVacInfo, addVacInfo, updateVacInfo } from "@/api/system/vacInfo"
|
|
import { getVacCategorylist } from "@/api/system/vacInfo"
|
|
import VacRegistration from '@/views/system/VacRegistration/index.vue'
|
|
|
|
export default {
|
|
name: "VacInfo",
|
|
components: {
|
|
VacRegistration
|
|
},
|
|
dicts: ['vaccine_type', 'vaccine_info_status', 'livestock_type'],
|
|
data() {
|
|
return {
|
|
// 遮罩层
|
|
loading: true,
|
|
// 选中数组
|
|
ids: [],
|
|
// 非单个禁用
|
|
single: true,
|
|
// 非多个禁用
|
|
multiple: true,
|
|
// 显示搜索条件
|
|
showSearch: true,
|
|
// 总条数
|
|
total: 0,
|
|
// 疫苗信息表格数据
|
|
vacInfoList: [],
|
|
// 弹出层标题
|
|
title: "",
|
|
// 是否显示弹出层
|
|
open: false,
|
|
// 疫苗类型选项(联动获取)
|
|
vaccineTypeOptions: [],
|
|
// 选中的疫苗详细信息
|
|
selectedVaccine: null,
|
|
|
|
// 新增预约列表弹窗相关数据
|
|
registrationDialogVisible: false,
|
|
currentVaccineId: null,
|
|
registrationDialogTitle: "",
|
|
|
|
// 查询参数
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
title: null,
|
|
livestockType: null,
|
|
vaccineType: null,
|
|
description: null,
|
|
vaccinationDate: null,
|
|
vaccinationLocation: null,
|
|
availableSlots: null,
|
|
totalSlots: null,
|
|
status: null,
|
|
publishTime: null,
|
|
endTime: null,
|
|
},
|
|
// 表单参数
|
|
form: {},
|
|
// 表单校验
|
|
rules: {
|
|
title: [
|
|
{ required: true, message: "疫苗标题不能为空", trigger: "blur" }
|
|
],
|
|
livestockType: [
|
|
{ required: true, message: "牲畜类型不能为空", trigger: "change" }
|
|
],
|
|
vaccineType: [
|
|
{ required: true, message: "疫苗类型不能为空", trigger: "change" }
|
|
],
|
|
description: [
|
|
{ required: true, message: "详细描述不能为空", trigger: "blur" }
|
|
],
|
|
vaccinationDate: [
|
|
{ required: true, message: "接种日期不能为空", trigger: "blur" }
|
|
],
|
|
vaccinationLocation: [
|
|
{ required: true, message: "接种地点不能为空", trigger: "blur" }
|
|
],
|
|
availableSlots: [
|
|
{ required: true, message: "可预约数量不能为空", trigger: "blur" }
|
|
],
|
|
totalSlots: [
|
|
{ required: true, message: "总数量不能为空", trigger: "blur" }
|
|
],
|
|
status: [
|
|
{ required: true, message: "状态:1-进行中 2-已结束 3-已取消不能为空", trigger: "change" }
|
|
],
|
|
publishTime: [
|
|
{ required: true, message: "发布时间不能为空", trigger: "blur" }
|
|
],
|
|
endTime: [
|
|
{ required: true, message: "报名截止时间不能为空", trigger: "blur" }
|
|
],
|
|
}
|
|
}
|
|
},
|
|
created() {
|
|
this.getList()
|
|
},
|
|
methods: {
|
|
/** 查询疫苗信息列表 */
|
|
getList() {
|
|
this.loading = true
|
|
listVacInfo(this.queryParams).then(response => {
|
|
this.vacInfoList = response.rows
|
|
this.total = response.total
|
|
this.loading = false
|
|
})
|
|
},
|
|
/** 获取疫苗显示名称 */
|
|
getVaccineDisplayName(vaccine) {
|
|
if (!vaccine) return '';
|
|
let displayName = vaccine.genericName || vaccine.tradeName || '未知疫苗';
|
|
if (vaccine.approvalNumber) {
|
|
displayName += ` (${vaccine.approvalNumber})`;
|
|
}
|
|
if (vaccine.batchNumber) {
|
|
displayName += ` - ${vaccine.batchNumber}`;
|
|
}
|
|
return displayName;
|
|
},
|
|
/** 牲畜类型变化时处理 */
|
|
handleLivestockTypeChange(livestockType) {
|
|
if (livestockType) {
|
|
// 清空疫苗相关数据
|
|
this.form.vaccineType = null;
|
|
this.selectedVaccine = null;
|
|
this.vaccineTypeOptions = [];
|
|
} else {
|
|
this.form.vaccineType = null;
|
|
this.selectedVaccine = null;
|
|
this.vaccineTypeOptions = [];
|
|
}
|
|
},
|
|
/** 疫苗类型获得焦点时加载选项 */
|
|
handleVaccineTypeFocus() {
|
|
if (this.form.livestockType && this.vaccineTypeOptions.length === 0) {
|
|
this.loadVaccineOptions(this.form.livestockType);
|
|
}
|
|
},
|
|
/** 疫苗类型变化时更新详细信息 */
|
|
handleVaccineTypeChange(vaccineId) {
|
|
if (vaccineId) {
|
|
this.updateSelectedVaccine(vaccineId);
|
|
} else {
|
|
this.selectedVaccine = null;
|
|
}
|
|
},
|
|
/** 加载疫苗选项 */
|
|
loadVaccineOptions(livestockType) {
|
|
const query = { livestockType: livestockType };
|
|
return getVacCategorylist(query).then(response => {
|
|
this.vaccineTypeOptions = response.rows || [];
|
|
return this.vaccineTypeOptions;
|
|
}).catch(() => {
|
|
this.vaccineTypeOptions = [];
|
|
this.$message.error('获取疫苗列表失败');
|
|
return [];
|
|
});
|
|
},
|
|
/** 更新选中的疫苗详细信息 */
|
|
updateSelectedVaccine(vaccineId) {
|
|
if (vaccineId) {
|
|
const vaccine = this.vaccineTypeOptions.find(item => item.id == vaccineId);
|
|
this.selectedVaccine = vaccine || null;
|
|
} else {
|
|
this.selectedVaccine = null;
|
|
}
|
|
},
|
|
/** 预约列表按钮操作 */
|
|
handleRegistrationList(row) {
|
|
this.currentVaccineId = row.id;
|
|
this.registrationDialogTitle = `疫苗预约列表 - ${row.title}`;
|
|
this.registrationDialogVisible = true;
|
|
|
|
// 等组件渲染后设置查询条件,过滤该疫苗的预约记录
|
|
this.$nextTick(() => {
|
|
if (this.$refs.registrationComponent) {
|
|
this.$refs.registrationComponent.queryParams.vaccineId = row.id;
|
|
this.$refs.registrationComponent.getList();
|
|
}
|
|
});
|
|
},
|
|
|
|
/** 关闭预约列表弹窗 */
|
|
handleRegistrationClose() {
|
|
this.registrationDialogVisible = false;
|
|
this.currentVaccineId = null;
|
|
// 重置预约组件的查询条件
|
|
if (this.$refs.registrationComponent) {
|
|
this.$refs.registrationComponent.queryParams.vaccineId = null;
|
|
}
|
|
},
|
|
// 取消按钮
|
|
cancel() {
|
|
this.open = false
|
|
this.reset()
|
|
},
|
|
// 表单重置
|
|
reset() {
|
|
this.form = {
|
|
id: null,
|
|
title: null,
|
|
livestockType: null,
|
|
vaccineType: null,
|
|
description: null,
|
|
vaccinationDate: null,
|
|
vaccinationLocation: null,
|
|
availableSlots: null,
|
|
totalSlots: null,
|
|
status: null,
|
|
publishTime: null,
|
|
endTime: null,
|
|
delFlag: null,
|
|
createBy: null,
|
|
createTime: null,
|
|
updateBy: null,
|
|
updateTime: null,
|
|
remark: null
|
|
}
|
|
this.vaccineTypeOptions = [];
|
|
this.selectedVaccine = null;
|
|
this.resetForm("form")
|
|
},
|
|
/** 搜索按钮操作 */
|
|
handleQuery() {
|
|
this.queryParams.pageNum = 1
|
|
this.getList()
|
|
},
|
|
/** 重置按钮操作 */
|
|
resetQuery() {
|
|
this.resetForm("queryForm")
|
|
this.handleQuery()
|
|
},
|
|
// 多选框选中数据
|
|
handleSelectionChange(selection) {
|
|
this.ids = selection.map(item => item.id)
|
|
this.single = selection.length!==1
|
|
this.multiple = !selection.length
|
|
},
|
|
/** 新增按钮操作 */
|
|
handleAdd() {
|
|
this.reset()
|
|
this.open = true
|
|
this.title = "添加疫苗信息"
|
|
},
|
|
/** 修改按钮操作 */
|
|
handleUpdate(row) {
|
|
this.reset()
|
|
const id = row.id || this.ids
|
|
getVacInfo(id).then(response => {
|
|
this.form = response.data
|
|
this.open = true
|
|
this.title = "修改疫苗信息"
|
|
|
|
// 如果表单中有牲畜类型和疫苗类型,需要更新选中的疫苗详细信息
|
|
if (this.form.livestockType && this.form.vaccineType) {
|
|
// 先加载疫苗选项
|
|
this.loadVaccineOptions(this.form.livestockType).then(() => {
|
|
// 然后更新选中的疫苗详细信息
|
|
this.updateSelectedVaccine(this.form.vaccineType);
|
|
});
|
|
}
|
|
})
|
|
},
|
|
/** 提交按钮 */
|
|
submitForm() {
|
|
this.$refs["form"].validate(valid => {
|
|
if (valid) {
|
|
if (this.form.id != null) {
|
|
updateVacInfo(this.form).then(response => {
|
|
this.$modal.msgSuccess("修改成功")
|
|
this.open = false
|
|
this.getList()
|
|
})
|
|
} else {
|
|
addVacInfo(this.form).then(response => {
|
|
this.$modal.msgSuccess("新增成功")
|
|
this.open = false
|
|
this.getList()
|
|
})
|
|
}
|
|
}
|
|
})
|
|
},
|
|
/** 删除按钮操作 */
|
|
handleDelete(row) {
|
|
const ids = row.id || this.ids
|
|
this.$modal.confirm('是否确认删除疫苗信息编号为"' + ids + '"的数据项?').then(function() {
|
|
return delVacInfo(ids)
|
|
}).then(() => {
|
|
this.getList()
|
|
this.$modal.msgSuccess("删除成功")
|
|
}).catch(() => {})
|
|
},
|
|
/** 导出按钮操作 */
|
|
handleExport() {
|
|
this.download('system/vacInfo/export', {
|
|
...this.queryParams
|
|
}, `vacInfo_${new Date().getTime()}.xlsx`)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
/* 调整弹窗样式 */
|
|
.registration-dialog .el-dialog__body {
|
|
padding: 20px;
|
|
max-height: 70vh;
|
|
overflow-y: auto;
|
|
}
|
|
</style>
|
|
|
|
<style scoped>
|
|
::v-deep .pagestyle .el-input{
|
|
width: auto !important;
|
|
}
|
|
</style>
|
|
|
|
<style scoped lang="scss">
|
|
// 操作按钮样式
|
|
.info-btn {
|
|
padding: 6px 10px;
|
|
border-radius: 4px;
|
|
margin: 0 10px;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.alter-btn:hover{
|
|
background-color: rgb(230, 255, 238);
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
.delete-btn:hover {
|
|
background-color: rgba(245, 108, 108, 0.1);
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
.reservation-btn:hover {
|
|
background-color: rgb(219, 244, 244);
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
// 新增/修改的弹窗
|
|
::v-deep .el-dialog {
|
|
border-radius: 12px;
|
|
overflow: hidden;
|
|
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
|
|
animation: dialogFadeIn 0.3s ease;
|
|
}
|
|
|
|
::v-deep .el-dialog__header {
|
|
background: linear-gradient(135deg, #2c7a4d 0%, #42b983 100%);
|
|
padding: 18px 24px;
|
|
border-bottom: none;
|
|
position: relative;
|
|
}
|
|
|
|
::v-deep .el-dialog__title {
|
|
font-size: 17px;
|
|
font-weight: 600;
|
|
color: white;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
::v-deep .el-dialog__headerbtn:hover .el-dialog__close {
|
|
color: #ffd04b;
|
|
transform: rotate(90deg);
|
|
}
|
|
|
|
::v-deep .el-dialog__body {
|
|
padding: 28px 24px 20px;
|
|
background-color: #f8fafc;
|
|
max-height: 70vh;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
::v-deep .el-form-item {
|
|
margin-bottom: 20px;
|
|
transition: all 0.3s;
|
|
}
|
|
|
|
::v-deep .el-form-item__label {
|
|
font-weight: 500;
|
|
color: #2d3748;
|
|
font-size: 14px;
|
|
transition: color 0.3s;
|
|
}
|
|
|
|
::v-deep .el-input,
|
|
::v-deep .el-textarea,
|
|
::v-deep .el-select {
|
|
width: 100%;
|
|
}
|
|
|
|
::v-deep .el-input__inner,
|
|
::v-deep .el-textarea__inner {
|
|
border-radius: 8px;
|
|
border: 1px solid #dcdfe6;
|
|
font-size: 14px;
|
|
transition: all 0.3s;
|
|
background-color: #fcfdfe;
|
|
}
|
|
|
|
::v-deep .el-input__inner:focus,
|
|
::v-deep .el-textarea__inner:focus {
|
|
border-color: #42B983;
|
|
box-shadow: 0 0 0 3px rgb(230, 255, 238);
|
|
background-color: white;
|
|
}
|
|
|
|
::v-deep .el-select .el-input__inner {
|
|
padding-right: 35px;
|
|
}
|
|
|
|
::v-deep .el-dialog__footer {
|
|
padding: 20px 24px;
|
|
background-color: #f8fafc;
|
|
border-top: 1px solid #eef2f7;
|
|
border-radius: 0 0 12px 12px;
|
|
}
|
|
</style>
|
|
|
|
<style scoped>
|
|
::v-deep .el-descriptions-item__cell{
|
|
width: 90px;
|
|
}
|
|
|
|
::v-deep .pagestyle .el-input{
|
|
width: auto !important;
|
|
}
|
|
|
|
::v-deep .el-descriptions-row th{
|
|
text-align: center !important;color: #7b7c7f;
|
|
background: #faf7f7;
|
|
}
|
|
|
|
::v-deep .el-descriptions .is-bordered .el-descriptions-item__cell {
|
|
border: 1px solid #bcbbbb;
|
|
padding: 12px 10px;
|
|
}
|
|
</style>
|