Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
2910577a01
@ -25,7 +25,7 @@
|
|||||||
"echarts": "5.5.1",
|
"echarts": "5.5.1",
|
||||||
"element-china-area-data": "^6.1.0",
|
"element-china-area-data": "^6.1.0",
|
||||||
"element-plus": "^2.7.6",
|
"element-plus": "^2.7.6",
|
||||||
"file-saver": "2.0.5",
|
"file-saver": "^2.0.5",
|
||||||
"fuse.js": "6.6.2",
|
"fuse.js": "6.6.2",
|
||||||
"js-beautify": "1.14.11",
|
"js-beautify": "1.14.11",
|
||||||
"js-cookie": "3.0.5",
|
"js-cookie": "3.0.5",
|
||||||
@ -37,7 +37,8 @@
|
|||||||
"vue-cropper": "1.1.1",
|
"vue-cropper": "1.1.1",
|
||||||
"vue-router": "4.4.0",
|
"vue-router": "4.4.0",
|
||||||
"vuedraggable": "4.1.0",
|
"vuedraggable": "4.1.0",
|
||||||
"vuex": "^4.0.2"
|
"vuex": "^4.0.2",
|
||||||
|
"xlsx": "^0.18.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vitejs/plugin-vue": "5.0.5",
|
"@vitejs/plugin-vue": "5.0.5",
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
// src/api/dairyProducts/sheepMilkAnalysis/sheepMilkAnalysis.js
|
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 查询羊奶产量分析列表(分页 + 条件)
|
// 查询羊奶产量分析列表(分页 + 条件)
|
||||||
@ -17,13 +16,3 @@ export function getSheepMilkAnalysis(sheepId) {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出羊奶产量分析 Excel
|
|
||||||
export function exportSheepMilkAnalysis(query) {
|
|
||||||
return request({
|
|
||||||
url: '/dairyProducts/sheepMilkAnalysis/export',
|
|
||||||
method: 'get',
|
|
||||||
params: query,
|
|
||||||
responseType: 'blob' // 返回二进制流
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
@ -61,3 +61,12 @@ export function addByEarTags(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 树形分组
|
||||||
|
export const listGroupTree = () =>
|
||||||
|
request({
|
||||||
|
url: '/sheep_grouping/sheep_grouping/group/tree',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
@ -55,3 +55,11 @@ export function checkSheepfoldNoExist(ranchId, sheepfoldTypeId, sheepfoldNo) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取树形座位图(牧场 → 类型 → 羊舍 → 排栏)
|
||||||
|
export function getSeatMap() {
|
||||||
|
return request({
|
||||||
|
url: '/sheepfold_management/sheepfold_management/seatMap',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@ -303,6 +303,7 @@ function reset() {
|
|||||||
id: null,
|
id: null,
|
||||||
treatId: null,
|
treatId: null,
|
||||||
sheepId: null,
|
sheepId: null,
|
||||||
|
sheepNo: null,
|
||||||
datetime: null,
|
datetime: null,
|
||||||
sheepType: null,
|
sheepType: null,
|
||||||
gender: null,
|
gender: null,
|
||||||
|
|||||||
@ -471,7 +471,7 @@ function handleDelete(row) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download('biosafety/disinfect/export', { ...queryParams }, `disinfect_${Date.now()}.xlsx`)
|
proxy.download('biosafety/disinfect/export', { ...queryParams }, `消毒_${Date.now()}.xlsx`)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------- 下拉数据 ---------- */
|
/* ---------- 下拉数据 ---------- */
|
||||||
|
|||||||
@ -490,7 +490,7 @@ function handleDelete(row) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download('biosafety/deworm/export', { ...queryParams }, `deworm_${Date.now()}.xlsx`)
|
proxy.download('biosafety/health/export', { ...queryParams }, `保健_${Date.now()}.xlsx`)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------ 药品/处方/下拉 ------------------ */
|
/* ------------------ 药品/处方/下拉 ------------------ */
|
||||||
|
|||||||
@ -489,7 +489,7 @@ function handleDelete(row) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download('biosafety/deworm/export', { ...queryParams }, `deworm_${Date.now()}.xlsx`)
|
proxy.download('biosafety/immunity/export', { ...queryParams }, `免疫_${Date.now()}.xlsx`)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------ 药品/处方/下拉 ------------------ */
|
/* ------------------ 药品/处方/下拉 ------------------ */
|
||||||
|
|||||||
@ -238,7 +238,7 @@ function handleDelete(row) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download('system/medicine/export', { ...queryParams.value }, `medicine_${new Date().getTime()}.xlsx`)
|
proxy.download('system/medicine/export', { ...queryParams.value }, `药品_${new Date().getTime()}.xlsx`)
|
||||||
}
|
}
|
||||||
|
|
||||||
getList()
|
getList()
|
||||||
|
|||||||
@ -220,7 +220,7 @@ function handleDelete(row) {
|
|||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download('biosafety/type/export', {
|
proxy.download('biosafety/type/export', {
|
||||||
...queryParams.value
|
...queryParams.value
|
||||||
}, `type_${new Date().getTime()}.xlsx`)
|
}, `药品类型_${new Date().getTime()}.xlsx`)
|
||||||
}
|
}
|
||||||
|
|
||||||
getList()
|
getList()
|
||||||
|
|||||||
@ -180,7 +180,7 @@ function handleDelete(row) {
|
|||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download('biosafety/unit/export', {
|
proxy.download('biosafety/unit/export', {
|
||||||
...queryParams.value
|
...queryParams.value
|
||||||
}, `unit_${new Date().getTime()}.xlsx`)
|
}, `药品计量单位_${new Date().getTime()}.xlsx`)
|
||||||
}
|
}
|
||||||
|
|
||||||
getList()
|
getList()
|
||||||
|
|||||||
@ -220,7 +220,7 @@ function handleDelete(row) {
|
|||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download('biosafety/usage/export', {
|
proxy.download('biosafety/usage/export', {
|
||||||
...queryParams.value
|
...queryParams.value
|
||||||
}, `usage_${new Date().getTime()}.xlsx`)
|
}, `药品使用方法_${new Date().getTime()}.xlsx`)
|
||||||
}
|
}
|
||||||
|
|
||||||
getList()
|
getList()
|
||||||
|
|||||||
@ -504,7 +504,7 @@ function cancel() {
|
|||||||
* 调用后端通用导出接口,文件名带时间戳
|
* 调用后端通用导出接口,文件名带时间戳
|
||||||
*/
|
*/
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download('biosafety/prescription/export', { ...queryParams.value }, `prescription_${Date.now()}.xlsx`)
|
proxy.download('biosafety/prescription/export', { ...queryParams.value }, `处方_${Date.now()}.xlsx`)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化:加载列表
|
// 初始化:加载列表
|
||||||
|
|||||||
@ -527,9 +527,9 @@ function handleDelete(row) {
|
|||||||
/* 导出 */
|
/* 导出 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download(
|
proxy.download(
|
||||||
'bisosafety/quarantine/export',
|
'/biosafety/quarantine/export',
|
||||||
queryParams,
|
queryParams,
|
||||||
`quarantine_${Date.now()}.xlsx`
|
`检疫_${Date.now()}.xlsx`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -729,7 +729,7 @@ function handleDelete(row) {
|
|||||||
.then(() => { getList(); proxy.$modal.msgSuccess('删除成功') })
|
.then(() => { getList(); proxy.$modal.msgSuccess('删除成功') })
|
||||||
}
|
}
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download('treatment/treatment/export', { ...queryParams }, `treatment_${Date.now()}.xlsx`)
|
proxy.download('treatment/treatment/export', { ...queryParams }, `治疗记录_${Date.now()}.xlsx`)
|
||||||
}
|
}
|
||||||
function resetForm(formObj) {
|
function resetForm(formObj) {
|
||||||
Object.assign(formObj, {
|
Object.assign(formObj, {
|
||||||
|
|||||||
@ -342,7 +342,7 @@ function handleExport() {
|
|||||||
proxy.download(
|
proxy.download(
|
||||||
'biosafety/usageInfo/export',
|
'biosafety/usageInfo/export',
|
||||||
{ ...queryParams.value },
|
{ ...queryParams.value },
|
||||||
`usage_${new Date().getTime()}.xlsx`
|
`药品使用记录_${new Date().getTime()}.xlsx`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -291,6 +291,9 @@
|
|||||||
import { ref, reactive, onMounted } from 'vue';
|
import { ref, reactive, onMounted } from 'vue';
|
||||||
import { listFreshMilkTest, getFreshMilkTest, delFreshMilkTest, addFreshMilkTest, updateFreshMilkTest } from "@/api/dairyProducts/freshMilkTest/freshMilkTest.js";
|
import { listFreshMilkTest, getFreshMilkTest, delFreshMilkTest, addFreshMilkTest, updateFreshMilkTest } from "@/api/dairyProducts/freshMilkTest/freshMilkTest.js";
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||||
|
// 导入xlsx库和file-saver
|
||||||
|
import * as XLSX from 'xlsx';
|
||||||
|
import { saveAs } from 'file-saver';
|
||||||
|
|
||||||
const freshMilkTestList = ref([]);
|
const freshMilkTestList = ref([]);
|
||||||
const open = ref(false);
|
const open = ref(false);
|
||||||
@ -304,6 +307,27 @@ const title = ref("");
|
|||||||
const columnShowDialogVisible = ref(false);
|
const columnShowDialogVisible = ref(false);
|
||||||
const freshMilkTestRef = ref(null);
|
const freshMilkTestRef = ref(null);
|
||||||
|
|
||||||
|
// 列配置映射
|
||||||
|
const columnConfig = [
|
||||||
|
{ prop: 'source', label: '来源' },
|
||||||
|
{ prop: 'datetime', label: '检测日期' },
|
||||||
|
{ prop: 'fat', label: '脂肪g/100g' },
|
||||||
|
{ prop: 'protein', label: '蛋白质g/100g' },
|
||||||
|
{ prop: 'nonFat', label: '非脂g/100g' },
|
||||||
|
{ prop: 'acidity', label: '酸度oT' },
|
||||||
|
{ prop: 'bacterialColony1', label: '菌落总数1' },
|
||||||
|
{ prop: 'bacterialColony2', label: '菌落总数2' },
|
||||||
|
{ prop: 'bacterialColony3', label: '菌落总数3' },
|
||||||
|
{ prop: 'bacterialColony4', label: '菌落总数4' },
|
||||||
|
{ prop: 'bacterialColony5', label: '菌落总数5' },
|
||||||
|
{ prop: 'coli', label: '大肠菌群(CFU/ml)' },
|
||||||
|
{ prop: 'lactoferrin', label: '乳铁蛋白(mg/L)' },
|
||||||
|
{ prop: 'ig', label: '免疫球蛋白(mg/L)' },
|
||||||
|
{ prop: 'commnet', label: '备注' },
|
||||||
|
{ prop: 'createBy', label: '创建人' },
|
||||||
|
{ prop: 'createTime', label: '创建时间' }
|
||||||
|
];
|
||||||
|
|
||||||
// 默认显示的列
|
// 默认显示的列
|
||||||
const selectedColumns = ref([
|
const selectedColumns = ref([
|
||||||
'source', 'datetime', 'fat', 'protein', 'nonFat', 'acidity',
|
'source', 'datetime', 'fat', 'protein', 'nonFat', 'acidity',
|
||||||
@ -545,17 +569,42 @@ function handleDelete(row) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 - 前端实现 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
const params = new URLSearchParams();
|
// 获取当前显示的列配置
|
||||||
for (const key in queryParams) {
|
const visibleColumnsConfig = columnConfig.filter(
|
||||||
if (queryParams[key] !== null && queryParams[key] !== undefined) {
|
col => selectedColumns.value.includes(col.prop)
|
||||||
params.append(key, queryParams[key]);
|
);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = `/freshMilkTest/freshMilkTest/export?${params.toString()}`;
|
// 准备导出数据
|
||||||
window.location.href = url;
|
const exportData = freshMilkTestList.value.map(item => {
|
||||||
|
const rowData = {};
|
||||||
|
visibleColumnsConfig.forEach(col => {
|
||||||
|
// 特殊处理日期字段
|
||||||
|
if (col.prop === 'datetime') {
|
||||||
|
rowData[col.label] = formatDate(item[col.prop]);
|
||||||
|
} else if (col.prop === 'createTime') {
|
||||||
|
rowData[col.label] = formatDateTime(item[col.prop]);
|
||||||
|
} else {
|
||||||
|
rowData[col.label] = item[col.prop];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return rowData;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 创建工作簿和工作表
|
||||||
|
const worksheet = XLSX.utils.json_to_sheet(exportData);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, '鲜奶检验记录');
|
||||||
|
|
||||||
|
// 生成Excel文件并下载
|
||||||
|
const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
|
||||||
|
const blob = new Blob([excelBuffer], {
|
||||||
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
});
|
||||||
|
|
||||||
|
// 使用file-saver保存文件
|
||||||
|
saveAs(blob, `鲜奶检验记录_${new Date().getTime()}.xlsx`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化加载
|
// 初始化加载
|
||||||
|
|||||||
@ -1,16 +1,24 @@
|
|||||||
<!-- index.vue (前端视图,修改 resetQuery 以匹配正确字段) -->
|
<!-- index.vue (前端视图,仅保留单日查询功能) -->
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form ref="queryRef" :model="queryParams" inline label-width="80px">
|
<el-form ref="queryRef" :model="queryParams" inline label-width="80px">
|
||||||
<el-form-item label="日期范围">
|
<!-- 单日查询 -->
|
||||||
<el-date-picker v-model="dateRange" type="daterange" range-separator="至"
|
<el-form-item label="查询日期">
|
||||||
start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD" />
|
<el-date-picker
|
||||||
|
v-model="queryDate"
|
||||||
|
type="date"
|
||||||
|
placeholder="选择查询日期"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 管理耳号变成输入框 -->
|
|
||||||
|
<!-- 管理耳号输入框 -->
|
||||||
<el-form-item label="管理耳号">
|
<el-form-item label="管理耳号">
|
||||||
<el-input v-model="queryParams.manageEarNo" placeholder="请输入管理耳号" clearable />
|
<el-input v-model="queryParams.manageEarNo" placeholder="请输入管理耳号" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 厂区下拉框,数据源来自字典 da_ranch -->
|
|
||||||
|
<!-- 厂区下拉框 -->
|
||||||
<el-form-item label="厂区">
|
<el-form-item label="厂区">
|
||||||
<el-select v-model="queryParams.factory" clearable placeholder="请选择">
|
<el-select v-model="queryParams.factory" clearable placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
@ -20,13 +28,15 @@
|
|||||||
:value="d.value" />
|
:value="d.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 班次只有 1、2 -->
|
|
||||||
|
<!-- 班次下拉框 -->
|
||||||
<el-form-item label="班次">
|
<el-form-item label="班次">
|
||||||
<el-select v-model="queryParams.classes" clearable placeholder="请选择">
|
<el-select v-model="queryParams.classes" clearable placeholder="请选择">
|
||||||
<el-option :value="1" label="1" />
|
<el-option :value="1" label="1" />
|
||||||
<el-option :value="2" label="2" />
|
<el-option :value="2" label="2" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="getList">查询</el-button>
|
<el-button type="primary" @click="getList">查询</el-button>
|
||||||
<el-button @click="resetQuery">重置</el-button>
|
<el-button @click="resetQuery">重置</el-button>
|
||||||
@ -56,7 +66,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="correctedMilk" label="班次校正奶量" >
|
<el-table-column prop="correctedMilk" label="班次校正奶量" >
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ row.milk ? Number(row.milk).toFixed(2) : '-' }}
|
{{ row.correctedMilk ? Number(row.correctedMilk).toFixed(2) : '-' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -82,6 +92,7 @@ import { ref, reactive, onMounted } from 'vue'
|
|||||||
import { listMilkProdclasses, importMilkProdclasses, exportMilkProdclasses } from '@/api/dairyProducts/milkProdclasses/milkProdclasses'
|
import { listMilkProdclasses, importMilkProdclasses, exportMilkProdclasses } from '@/api/dairyProducts/milkProdclasses/milkProdclasses'
|
||||||
import { getToken } from '@/utils/auth'
|
import { getToken } from '@/utils/auth'
|
||||||
import { getRanchList } from '@/api/dairyProducts/ranch/ranch.js'
|
import { getRanchList } from '@/api/dairyProducts/ranch/ranch.js'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
import { Upload, Download, UploadFilled } from '@element-plus/icons-vue';
|
import { Upload, Download, UploadFilled } from '@element-plus/icons-vue';
|
||||||
|
|
||||||
const ranchOptions = ref([])
|
const ranchOptions = ref([])
|
||||||
@ -100,25 +111,36 @@ onMounted(() => {
|
|||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
datetimeStart: null, // 开始日期
|
||||||
|
datetimeEnd: null, // 结束日期
|
||||||
manageEarNo: '', // 管理耳号
|
manageEarNo: '', // 管理耳号
|
||||||
factory: null,
|
factory: null, // 厂区
|
||||||
classes: null
|
classes: null // 班次
|
||||||
})
|
})
|
||||||
const dateRange = ref([])
|
const queryDate = ref(null) // 查询日期
|
||||||
const tableData = ref([])
|
const tableData = ref([]) // 表格数据
|
||||||
const total = ref(0)
|
const total = ref(0) // 总数据条数
|
||||||
const loading = ref(false)
|
const loading = ref(false) // 加载状态
|
||||||
const openImport = ref(false)
|
const openImport = ref(false) // 导入弹窗显示状态
|
||||||
|
|
||||||
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/milkProdclasses/milkProdclasses/import';
|
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/milkProdclasses/milkProdclasses/import';
|
||||||
const headers = { Authorization: 'Bearer ' + getToken() };
|
const headers = { Authorization: 'Bearer ' + getToken() };
|
||||||
|
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
const [start, end] = dateRange.value || []
|
|
||||||
|
// 设置查询参数
|
||||||
|
if (queryDate.value) {
|
||||||
|
queryParams.datetimeStart = queryDate.value;
|
||||||
|
queryParams.datetimeEnd = queryDate.value;
|
||||||
|
} else {
|
||||||
|
queryParams.datetimeStart = null;
|
||||||
|
queryParams.datetimeEnd = null;
|
||||||
|
}
|
||||||
|
|
||||||
listMilkProdclasses({
|
listMilkProdclasses({
|
||||||
datetimeStart: start,
|
datetimeStart: queryParams.datetimeStart,
|
||||||
datetimeEnd: end,
|
datetimeEnd: queryParams.datetimeEnd,
|
||||||
manageEarNo: queryParams.manageEarNo,
|
manageEarNo: queryParams.manageEarNo,
|
||||||
factory: queryParams.factory,
|
factory: queryParams.factory,
|
||||||
classes: queryParams.classes,
|
classes: queryParams.classes,
|
||||||
@ -135,8 +157,15 @@ function getList() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
Object.assign(queryParams, { pageNum: 1, manageEarNo: '', factory: null, classes: null });
|
Object.assign(queryParams, {
|
||||||
dateRange.value = [];
|
pageNum: 1,
|
||||||
|
datetimeStart: null,
|
||||||
|
datetimeEnd: null,
|
||||||
|
manageEarNo: '',
|
||||||
|
factory: null,
|
||||||
|
classes: null
|
||||||
|
});
|
||||||
|
queryDate.value = null;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,20 +177,57 @@ function uploadSuccess(response) {
|
|||||||
console.log('上传成功:', response);
|
console.log('上传成功:', response);
|
||||||
openImport.value = false;
|
openImport.value = false;
|
||||||
getList();
|
getList();
|
||||||
|
ElMessage.success('导入成功');
|
||||||
}
|
}
|
||||||
|
|
||||||
function uploadError(err) {
|
function uploadError(err) {
|
||||||
console.error('上传失败:', err);
|
console.error('上传失败:', err);
|
||||||
|
ElMessage.error('导入失败');
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
const [start, end] = dateRange.value || [];
|
// 设置查询参数
|
||||||
|
if (queryDate.value) {
|
||||||
|
queryParams.datetimeStart = queryDate.value;
|
||||||
|
queryParams.datetimeEnd = queryDate.value;
|
||||||
|
} else {
|
||||||
|
queryParams.datetimeStart = null;
|
||||||
|
queryParams.datetimeEnd = null;
|
||||||
|
}
|
||||||
|
|
||||||
exportMilkProdclasses({
|
exportMilkProdclasses({
|
||||||
datetimeStart: start,
|
datetimeStart: queryParams.datetimeStart,
|
||||||
datetimeEnd: end,
|
datetimeEnd: queryParams.datetimeEnd,
|
||||||
manageEarNo: queryParams.manageEarNo, // 与后台参数统一
|
manageEarNo: queryParams.manageEarNo,
|
||||||
factory: queryParams.factory,
|
factory: queryParams.factory,
|
||||||
classes: queryParams.classes
|
classes: queryParams.classes
|
||||||
|
}).then(response => {
|
||||||
|
// 创建Blob对象,用于文件下载
|
||||||
|
const blob = new Blob([response], {
|
||||||
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
});
|
||||||
|
|
||||||
|
// 创建下载链接
|
||||||
|
const downloadElement = document.createElement('a');
|
||||||
|
const href = window.URL.createObjectURL(blob);
|
||||||
|
downloadElement.href = href;
|
||||||
|
|
||||||
|
// 设置下载文件名,包含当前日期
|
||||||
|
const now = new Date();
|
||||||
|
const dateStr = `${now.getFullYear()}${(now.getMonth()+1).toString().padStart(2, '0')}${now.getDate().toString().padStart(2, '0')}`;
|
||||||
|
downloadElement.download = `班次产奶数据_${dateStr}.xlsx`;
|
||||||
|
|
||||||
|
document.body.appendChild(downloadElement);
|
||||||
|
// 触发点击下载
|
||||||
|
downloadElement.click();
|
||||||
|
// 释放URL对象
|
||||||
|
document.body.removeChild(downloadElement);
|
||||||
|
window.URL.revokeObjectURL(href);
|
||||||
|
|
||||||
|
ElMessage.success('导出成功');
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('导出失败:', error);
|
||||||
|
ElMessage.error('导出失败: ' + (error.message || '未知错误'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -236,6 +236,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="RawMilkTest">
|
<script setup name="RawMilkTest">
|
||||||
|
// 导入xlsx库
|
||||||
|
import * as XLSX from 'xlsx';
|
||||||
|
// 导入file-saver用于文件下载
|
||||||
|
import { saveAs } from 'file-saver';
|
||||||
import { listRawMilkTest, getRawMilkTest, delRawMilkTest, addRawMilkTest, updateRawMilkTest } from "@/api/dairyProducts/rawMilkTest/rawMilkTest.js"
|
import { listRawMilkTest, getRawMilkTest, delRawMilkTest, addRawMilkTest, updateRawMilkTest } from "@/api/dairyProducts/rawMilkTest/rawMilkTest.js"
|
||||||
import { getCurrentInstance, ref, reactive, toRefs, onMounted } from 'vue'
|
import { getCurrentInstance, ref, reactive, toRefs, onMounted } from 'vue'
|
||||||
import { parseTime } from '@/utils/ruoyi'
|
import { parseTime } from '@/utils/ruoyi'
|
||||||
@ -496,9 +500,38 @@ function handleDelete(row) {
|
|||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download('rawMilkTest/rawMilkTest/export', {
|
// 获取当前显示的列配置
|
||||||
...queryParams.value
|
const visibleColumnsConfig = allColumns.value.filter(
|
||||||
}, `rawMilkTest_${new Date().getTime()}.xlsx`)
|
col => visibleColumns.value[col.prop]
|
||||||
|
);
|
||||||
|
|
||||||
|
// 准备导出数据
|
||||||
|
const exportData = rawMilkTestList.value.map(item => {
|
||||||
|
const rowData = {};
|
||||||
|
visibleColumnsConfig.forEach(col => {
|
||||||
|
// 特殊处理日期字段
|
||||||
|
if (col.prop === 'datetime' || col.prop === 'createTime') {
|
||||||
|
rowData[col.label] = parseTime(item[col.prop]);
|
||||||
|
} else {
|
||||||
|
rowData[col.label] = item[col.prop];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return rowData;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 创建工作簿和工作表
|
||||||
|
const worksheet = XLSX.utils.json_to_sheet(exportData);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, '生乳检验记录');
|
||||||
|
|
||||||
|
// 生成Excel文件并下载
|
||||||
|
const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
|
||||||
|
const blob = new Blob([excelBuffer], {
|
||||||
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
});
|
||||||
|
|
||||||
|
// 使用file-saver保存文件
|
||||||
|
saveAs(blob, `生乳检验记录_${new Date().getTime()}.xlsx`);
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@ -16,16 +16,16 @@
|
|||||||
|
|
||||||
<!-- 操作按钮行 -->
|
<!-- 操作按钮行 -->
|
||||||
<div class="button-group">
|
<div class="button-group">
|
||||||
<el-button type="success" @click="handleExport">导出</el-button>
|
|
||||||
|
|
||||||
<el-popover placement="bottom" width="400" trigger="click">
|
<el-popover placement="bottom" width="400" trigger="click">
|
||||||
<el-checkbox-group v-model="selectedFields" class="checkbox-columns">
|
<el-checkbox-group v-model="selectedFields" class="checkbox-columns">
|
||||||
<el-checkbox v-for="col in allColumns" :key="col.prop" :label="col.prop">{{ col.label }}</el-checkbox>
|
<!-- 使用 :value 替代 :label -->
|
||||||
|
<el-checkbox v-for="col in allColumns" :key="col.prop" :value="col.prop">{{ col.label }}</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button type="info">展示列</el-button>
|
<el-button type="info">展示列</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
|
<el-button type="success" @click="handleExport">导出</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 数据表格 -->
|
<!-- 数据表格 -->
|
||||||
@ -55,8 +55,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listSheepMilkAnalysis, exportSheepMilkAnalysis } from "@/api/dairyProducts/sheepMilkAnalysis/sheepMilkAnalysis.js";
|
import { listSheepMilkAnalysis } from "@/api/dairyProducts/sheepMilkAnalysis/sheepMilkAnalysis.js";
|
||||||
import { format } from 'date-fns';
|
import { format } from 'date-fns';
|
||||||
|
import * as XLSX from 'xlsx'; // 导入xlsx库
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "SheepMilkAnalysis",
|
name: "SheepMilkAnalysis",
|
||||||
@ -126,7 +127,6 @@ export default {
|
|||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listSheepMilkAnalysis(this.queryParams).then(response => {
|
listSheepMilkAnalysis(this.queryParams).then(response => {
|
||||||
// 兼容可能的 axios wrapper:有的返回 { data: { rows, total } }, 有的直接返回 { rows, total }
|
|
||||||
const res = response && response.data ? response.data : response;
|
const res = response && response.data ? response.data : response;
|
||||||
this.list = res.rows || res;
|
this.list = res.rows || res;
|
||||||
this.total = res.total || (Array.isArray(this.list) ? this.list.length : 0);
|
this.total = res.total || (Array.isArray(this.list) ? this.list.length : 0);
|
||||||
@ -155,21 +155,33 @@ export default {
|
|||||||
this.queryParams.pageSize = pageSize;
|
this.queryParams.pageSize = pageSize;
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
|
// 前端导出方法
|
||||||
handleExport() {
|
handleExport() {
|
||||||
exportSheepMilkAnalysis(this.queryParams).then(response => {
|
// 准备导出数据
|
||||||
const data = response && response.data ? response.data : response;
|
const exportData = this.list.map(item => {
|
||||||
const blob = new Blob([data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
const row = {};
|
||||||
const url = window.URL.createObjectURL(blob);
|
this.visibleColumns.forEach(col => {
|
||||||
const link = document.createElement('a');
|
let value = item[col.prop];
|
||||||
link.href = url;
|
// 处理日期格式化
|
||||||
link.setAttribute('download', '羊奶分析数据.xlsx');
|
if (col.formatter && typeof col.formatter === 'function') {
|
||||||
document.body.appendChild(link);
|
value = col.formatter(item);
|
||||||
link.click();
|
} else if (value instanceof Date) {
|
||||||
document.body.removeChild(link);
|
value = format(new Date(value), 'yyyy-MM-dd');
|
||||||
window.URL.revokeObjectURL(url);
|
}
|
||||||
}).catch(err => {
|
row[col.label] = value;
|
||||||
this.$message.error('导出失败,请检查后端是否正确返回文件流');
|
|
||||||
});
|
});
|
||||||
|
return row;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 创建工作簿和工作表
|
||||||
|
const worksheet = XLSX.utils.json_to_sheet(exportData);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, "羊奶产量分析");
|
||||||
|
|
||||||
|
// 生成Excel文件并下载
|
||||||
|
XLSX.writeFile(workbook, "羊奶产量分析数据.xlsx");
|
||||||
|
|
||||||
|
this.$message.success('导出成功');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -287,6 +287,9 @@
|
|||||||
import { ref, reactive, onMounted } from 'vue';
|
import { ref, reactive, onMounted } from 'vue';
|
||||||
import { listYogurtTest, getYogurtTest, delYogurtTest, addYogurtTest, updateYogurtTest } from "@/api/dairyProducts/yogurtTest/yogurtTest.js";
|
import { listYogurtTest, getYogurtTest, delYogurtTest, addYogurtTest, updateYogurtTest } from "@/api/dairyProducts/yogurtTest/yogurtTest.js";
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||||
|
// 导入xlsx库和file-saver
|
||||||
|
import * as XLSX from 'xlsx';
|
||||||
|
import { saveAs } from 'file-saver';
|
||||||
|
|
||||||
// 响应式数据
|
// 响应式数据
|
||||||
const yogurtTestList = ref([]);
|
const yogurtTestList = ref([]);
|
||||||
@ -301,6 +304,27 @@ const title = ref("");
|
|||||||
const columnShowDialogVisible = ref(false);
|
const columnShowDialogVisible = ref(false);
|
||||||
const yogurtTestRef = ref(null);
|
const yogurtTestRef = ref(null);
|
||||||
|
|
||||||
|
// 列配置映射
|
||||||
|
const columnConfig = [
|
||||||
|
{ prop: 'source', label: '来源' },
|
||||||
|
{ prop: 'datetime', label: '检测日期' },
|
||||||
|
{ prop: 'fat', label: '脂肪g/100g' },
|
||||||
|
{ prop: 'protein', label: '蛋白质g/100g' },
|
||||||
|
{ prop: 'nonFat', label: '非脂g/100g' },
|
||||||
|
{ prop: 'acidity', label: '酸度oT' },
|
||||||
|
{ prop: 'bacterialColony1', label: '菌落总数1' },
|
||||||
|
{ prop: 'bacterialClony2', label: '菌落总数2' },
|
||||||
|
{ prop: 'bacterialClony3', label: '菌落总数3' },
|
||||||
|
{ prop: 'bacterialClony4', label: '菌落总数4' },
|
||||||
|
{ prop: 'bacterialClony5', label: '菌落总数5' },
|
||||||
|
{ prop: 'yeast', label: '酵母菌(CFU/g)' },
|
||||||
|
{ prop: 'mould', label: '霉菌(CFU/g)' },
|
||||||
|
{ prop: 'lacto', label: '乳酸菌(CFU/g)' },
|
||||||
|
{ prop: 'comment', label: '备注' },
|
||||||
|
{ prop: 'createBy', label: '创建人' },
|
||||||
|
{ prop: 'createTime', label: '创建时间' }
|
||||||
|
];
|
||||||
|
|
||||||
// 默认显示的列
|
// 默认显示的列
|
||||||
const selectedColumns = ref([
|
const selectedColumns = ref([
|
||||||
'source', 'datetime', 'fat', 'protein', 'nonFat', 'acidity',
|
'source', 'datetime', 'fat', 'protein', 'nonFat', 'acidity',
|
||||||
@ -543,17 +567,42 @@ function handleDelete(row) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 - 前端实现 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
const params = new URLSearchParams();
|
// 获取当前显示的列配置
|
||||||
for (const key in queryParams) {
|
const visibleColumnsConfig = columnConfig.filter(
|
||||||
if (queryParams[key] !== null && queryParams[key] !== undefined) {
|
col => selectedColumns.value.includes(col.prop)
|
||||||
params.append(key, queryParams[key]);
|
);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = `/yogurtTest/yogurtTest/export?${params.toString()}`;
|
// 准备导出数据
|
||||||
window.location.href = url;
|
const exportData = yogurtTestList.value.map(item => {
|
||||||
|
const rowData = {};
|
||||||
|
visibleColumnsConfig.forEach(col => {
|
||||||
|
// 特殊处理日期字段
|
||||||
|
if (col.prop === 'datetime') {
|
||||||
|
rowData[col.label] = formatDate(item[col.prop]);
|
||||||
|
} else if (col.prop === 'createTime') {
|
||||||
|
rowData[col.label] = formatDateTime(item[col.prop]);
|
||||||
|
} else {
|
||||||
|
rowData[col.label] = item[col.prop];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return rowData;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 创建工作簿和工作表
|
||||||
|
const worksheet = XLSX.utils.json_to_sheet(exportData);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, '酸奶检疫记录');
|
||||||
|
|
||||||
|
// 生成Excel文件并下载
|
||||||
|
const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
|
||||||
|
const blob = new Blob([excelBuffer], {
|
||||||
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
});
|
||||||
|
|
||||||
|
// 使用file-saver保存文件
|
||||||
|
saveAs(blob, `酸奶检疫记录_${new Date().getTime()}.xlsx`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化加载
|
// 初始化加载
|
||||||
|
|||||||
@ -19,9 +19,9 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<!-- <el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['feed:FeedList:add']">新增</el-button>
|
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['feed:FeedList:add']">新增</el-button>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||||
v-hasPermi="['feed:FeedList:edit']">修改</el-button>
|
v-hasPermi="['feed:FeedList:edit']">修改</el-button>
|
||||||
@ -49,11 +49,11 @@
|
|||||||
<span>{{ scope.row.rootPlan ? parseTime(scope.row.rootPlan.planDate, '{y}-{m}-{d}') : '' }}</span>
|
<span>{{ scope.row.rootPlan ? parseTime(scope.row.rootPlan.planDate, '{y}-{m}-{d}') : '' }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="配料日期" align="center" prop="deployDate" width="180">
|
<!-- <el-table-column label="配料日期" align="center" prop="deployDate" width="180">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{ parseTime(scope.row.deployDate, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.deployDate, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)">详情</el-button>
|
<el-button link type="primary" icon="View" @click="handleView(scope.row)">详情</el-button>
|
||||||
@ -75,11 +75,11 @@
|
|||||||
<el-form-item label="饲草班人员" prop="zookeeper">
|
<el-form-item label="饲草班人员" prop="zookeeper">
|
||||||
<el-input v-model="form.zookeeper" placeholder="请输入饲草班人员名称" />
|
<el-input v-model="form.zookeeper" placeholder="请输入饲草班人员名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="配料日期" prop="deployDate">
|
<!-- <el-form-item label="配料日期" prop="deployDate">
|
||||||
<el-date-picker clearable v-model="form.deployDate" type="date" value-format="YYYY-MM-DD"
|
<el-date-picker clearable v-model="form.deployDate" type="date" value-format="YYYY-MM-DD"
|
||||||
placeholder="请选择配料日期">
|
placeholder="请选择配料日期">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
@ -102,7 +102,7 @@
|
|||||||
|
|
||||||
<el-divider content-position="left">配料列表</el-divider>
|
<el-divider content-position="left">配料列表</el-divider>
|
||||||
|
|
||||||
<el-table :data="showFeedList.formulaList" stripe border style="width: 100%" max-height="300">
|
<el-table :data="showFeedList.rootFormula.sgFormulaList" stripe border style="width: 100%" max-height="300">
|
||||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||||
<!-- <el-table-column label="原料编号" prop="materialId" align="center" /> -->
|
<!-- <el-table-column label="原料编号" prop="materialId" align="center" /> -->
|
||||||
<el-table-column label="原料" align="center">
|
<el-table-column label="原料" align="center">
|
||||||
@ -186,6 +186,7 @@
|
|||||||
openModel.value = "view"
|
openModel.value = "view"
|
||||||
title.value = "配料清单详情"
|
title.value = "配料清单详情"
|
||||||
console.log("查看配料清单", row)
|
console.log("查看配料清单", row)
|
||||||
|
console.log("HandView", showFeedList.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询配料清单列表 */
|
/** 查询配料清单列表 */
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
<el-table v-loading="loading" :data="FeedStatisticList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="FeedStatisticList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="UUID" align="center" prop="id" />
|
<el-table-column label="UID" align="center" prop="id" />
|
||||||
<el-table-column label="配方编号" align="center" prop="formulaId" />
|
<el-table-column label="配方编号" align="center" prop="formulaId" />
|
||||||
<el-table-column label="配方批号" align="center" prop="formulaBatchId" />
|
<el-table-column label="配方批号" align="center" prop="formulaBatchId" />
|
||||||
<el-table-column label="羊只数量" align="center" prop="sheepFoldCount" />
|
<el-table-column label="羊只数量" align="center" prop="sheepFoldCount" />
|
||||||
@ -93,7 +93,7 @@
|
|||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="日期" prop="planDate">
|
<el-form-item label="日期" prop="planDate">
|
||||||
<el-date-picker clearable v-model="showFeedStatistic.feedDate" type="date" value-format="YYYY-MM-DD"
|
<el-date-picker clearable v-model="showFeedStatistic.feedDate" type="date" value-format="YYYY-MM-DD"
|
||||||
placeholder="请选择时间">
|
placeholder="请选择时间" @change="handleDeployDateChange(showFeedStatistic, $event)">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -102,7 +102,11 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" icon="Plus" @click="handleAddMaterial()">添加</el-button>
|
<el-button type="primary" icon="Plus" @click="handleAddMaterial()"
|
||||||
|
:disabled="
|
||||||
|
showFeedStatistic.feedDate == null
|
||||||
|
|| showFeedStatistic.formulaId === null
|
||||||
|
|| showFeedStatistic.formulaBatchId == null">添加</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -152,7 +156,11 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" icon="Plus" @click="handleAddSheep()">添加</el-button>
|
<el-button type="primary" icon="Plus" @click="handleAddSheep()"
|
||||||
|
:disabled ="
|
||||||
|
showFeedStatistic.feedDate == null
|
||||||
|
|| showFeedStatistic.formulaId == null
|
||||||
|
|| showFeedStatistic.formulaBatchId == null">添加</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-table :data="showFeedStatistic.sheepFoldList" :rules="rules"
|
<el-table :data="showFeedStatistic.sheepFoldList" :rules="rules"
|
||||||
@ -231,6 +239,7 @@
|
|||||||
const openModel = ref('')
|
const openModel = ref('')
|
||||||
// 编辑状态
|
// 编辑状态
|
||||||
const isEdit = ref(true)
|
const isEdit = ref(true)
|
||||||
|
|
||||||
const showFeedStatistic = ref({})
|
const showFeedStatistic = ref({})
|
||||||
|
|
||||||
// 用于存储羊舍名称的字典
|
// 用于存储羊舍名称的字典
|
||||||
@ -362,9 +371,10 @@
|
|||||||
|
|
||||||
// 处理配方批号变化 & 当确定批号时加载初始数据
|
// 处理配方批号变化 & 当确定批号时加载初始数据
|
||||||
function handleFormulaBatchIdChange(row, $event) {
|
function handleFormulaBatchIdChange(row, $event) {
|
||||||
if (row.formulaId && row.formulaBatchId) {
|
if (row.formulaId && row.formulaBatchId && row.feedDate) {
|
||||||
queryParams.value.formulaId = row.formulaId
|
queryParams.value.formulaId = row.formulaId
|
||||||
queryParams.value.formulaBatchId = row.formulaBatchId
|
queryParams.value.formulaBatchId = row.formulaBatchId
|
||||||
|
queryParams.value.feedDate = row.feedDate
|
||||||
queryParams.value.id = null // 清空 ID,防止影响查询
|
queryParams.value.id = null // 清空 ID,防止影响查询
|
||||||
// console.log("加载初始数据,查询参数:", queryParams.value)
|
// console.log("加载初始数据,查询参数:", queryParams.value)
|
||||||
initFeedStatistic(queryParams.value).then(response => {
|
initFeedStatistic(queryParams.value).then(response => {
|
||||||
@ -374,6 +384,13 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleDeployDateChange(showFeedStatistic, event) {
|
||||||
|
// 日期改变时回调
|
||||||
|
if (showFeedStatistic.feedDate) {
|
||||||
|
handleFormulaBatchIdChange(showFeedStatistic, event);
|
||||||
|
}
|
||||||
|
}
|
||||||
// 查看详情
|
// 查看详情
|
||||||
function handleMaterialView(row) {
|
function handleMaterialView(row) {
|
||||||
showFeedStatistic.value = row
|
showFeedStatistic.value = row
|
||||||
|
|||||||
@ -4,9 +4,9 @@
|
|||||||
<el-form-item label="饲养阶段" prop="feedStage">
|
<el-form-item label="饲养阶段" prop="feedStage">
|
||||||
<el-input v-model="queryParams.feedStage" placeholder="请输入饲养阶段" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.feedStage" placeholder="请输入饲养阶段" clearable @keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="批号" prop="batchId">
|
<!-- <el-form-item label="批号" prop="batchId">
|
||||||
<el-input v-model="queryParams.batchId" placeholder="请输入批号" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.batchId" placeholder="请输入批号" clearable @keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px" @submit.prevent>
|
||||||
<el-form-item label="分组名称" prop="groupName">
|
<el-form-item label="分组名称" prop="groupName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.groupName"
|
v-model="queryParams.groupName"
|
||||||
@ -20,7 +20,7 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery" native-type="button"> 搜索</el-button>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -256,38 +256,71 @@ async function handleUpdate(row) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
// function submitForm() {
|
||||||
|
// proxy.$refs["group_managementRef"].validate(valid => {
|
||||||
|
// if (valid) {
|
||||||
|
// // 新增:计算祖先路径
|
||||||
|
// if (form.value.parentId === 0) {
|
||||||
|
// form.value.ancestors = "0"
|
||||||
|
// } else {
|
||||||
|
// const parentNode = findNode(group_managementOptions.value, form.value.parentId)
|
||||||
|
// if (parentNode) {
|
||||||
|
// form.value.ancestors = `${parentNode.ancestors},${parentNode.groupId}`
|
||||||
|
// } else {
|
||||||
|
// // 找不到父节点时使用默认值
|
||||||
|
// form.value.ancestors = "0"
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (form.value.groupId != null) {
|
||||||
|
// updateGroup_management(form.value).then(response => {
|
||||||
|
// proxy.$modal.msgSuccess("修改成功")
|
||||||
|
// open.value = false
|
||||||
|
// getList()
|
||||||
|
// })
|
||||||
|
// } else {
|
||||||
|
// addGroup_management(form.value).then(response => {
|
||||||
|
// proxy.$modal.msgSuccess("新增成功")
|
||||||
|
// open.value = false
|
||||||
|
// getList()
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["group_managementRef"].validate(valid => {
|
proxy.$refs["group_managementRef"].validate(valid => {
|
||||||
if (valid) {
|
if (!valid) return;
|
||||||
// 新增:计算祖先路径
|
|
||||||
|
// 计算祖先路径
|
||||||
if (form.value.parentId === 0) {
|
if (form.value.parentId === 0) {
|
||||||
form.value.ancestors = "0"
|
form.value.ancestors = "0";
|
||||||
} else {
|
} else {
|
||||||
const parentNode = findNode(group_managementOptions.value, form.value.parentId)
|
const parentNode = findNode(group_managementOptions.value, form.value.parentId);
|
||||||
if (parentNode) {
|
form.value.ancestors = parentNode
|
||||||
form.value.ancestors = `${parentNode.ancestors},${parentNode.groupId}`
|
? `${parentNode.ancestors},${parentNode.groupId}`
|
||||||
} else {
|
: "0";
|
||||||
// 找不到父节点时使用默认值
|
|
||||||
form.value.ancestors = "0"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (form.value.groupId != null) {
|
const request = form.value.groupId != null
|
||||||
updateGroup_management(form.value).then(response => {
|
? updateGroup_management(form.value)
|
||||||
proxy.$modal.msgSuccess("修改成功")
|
: addGroup_management(form.value);
|
||||||
open.value = false
|
|
||||||
getList()
|
request
|
||||||
})
|
.then(() => {
|
||||||
} else {
|
proxy.$modal.msgSuccess(form.value.groupId ? "修改成功" : "新增成功");
|
||||||
addGroup_management(form.value).then(response => {
|
open.value = false;
|
||||||
proxy.$modal.msgSuccess("新增成功")
|
getList();
|
||||||
open.value = false
|
|
||||||
getList()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
.catch(error => {
|
||||||
|
// ✅ 后端返回的错误信息
|
||||||
|
const msg = error?.response?.data?.msg || "操作失败";
|
||||||
|
proxy.$modal.msgError(msg);
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
|
|||||||
1286
src/views/fileManagement/sheep_file/index.txt
Normal file
1286
src/views/fileManagement/sheep_file/index.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,18 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="羊只id" prop="id">
|
<!-- <el-form-item label="羊只id" prop="id">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.id"
|
v-model="queryParams.id"
|
||||||
placeholder="请输入羊只id"
|
placeholder="请输入羊只id"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item label="管理耳号" prop="bsManageTags">
|
<el-form-item label="耳号" prop="bsManageTags">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.bsManageTags"
|
v-model="queryParams.bsManageTags"
|
||||||
placeholder="请输入管理耳号"
|
placeholder="请输入耳号"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
/>
|
/>
|
||||||
@ -66,7 +66,7 @@
|
|||||||
border
|
border
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
v-if="columns['id'].visible"
|
v-if="columns['id'].visible"
|
||||||
label="羊只id"
|
label="羊只id"
|
||||||
align="center"
|
align="center"
|
||||||
@ -78,10 +78,10 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">羊只id</span>
|
<span style="font-weight: bold; color: #333;">羊只id</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="columns['bsManageTags'].visible"
|
v-if="columns['bsManageTags'].visible"
|
||||||
label="管理耳号"
|
label="耳号"
|
||||||
align="center"
|
align="center"
|
||||||
prop="bsManageTags"
|
prop="bsManageTags"
|
||||||
width="120"
|
width="120"
|
||||||
@ -89,10 +89,10 @@
|
|||||||
sortable
|
sortable
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">管理耳号</span>
|
<span style="font-weight: bold; color: #333;">耳号</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
v-if="columns['ranchId'].visible"
|
v-if="columns['ranchId'].visible"
|
||||||
label="牧场id"
|
label="牧场id"
|
||||||
align="center"
|
align="center"
|
||||||
@ -103,7 +103,7 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">牧场id</span>
|
<span style="font-weight: bold; color: #333;">牧场id</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="columns['drRanch'].visible"
|
v-if="columns['drRanch'].visible"
|
||||||
label="牧场名称"
|
label="牧场名称"
|
||||||
@ -116,7 +116,7 @@
|
|||||||
<span style="font-weight: bold; color: #333;">牧场名称</span>
|
<span style="font-weight: bold; color: #333;">牧场名称</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
v-if="columns['sheepfoldId'].visible"
|
v-if="columns['sheepfoldId'].visible"
|
||||||
label="羊舍id"
|
label="羊舍id"
|
||||||
align="center"
|
align="center"
|
||||||
@ -127,7 +127,7 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">羊舍id</span>
|
<span style="font-weight: bold; color: #333;">羊舍id</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="columns['sheepfoldName'].visible"
|
v-if="columns['sheepfoldName'].visible"
|
||||||
label="羊舍名称"
|
label="羊舍名称"
|
||||||
@ -166,7 +166,7 @@
|
|||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
v-if="columns['varietyId'].visible"
|
v-if="columns['varietyId'].visible"
|
||||||
label="品种id"
|
label="品种id"
|
||||||
align="center"
|
align="center"
|
||||||
@ -177,7 +177,7 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">品种id</span>
|
<span style="font-weight: bold; color: #333;">品种id</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="columns['variety'].visible"
|
v-if="columns['variety'].visible"
|
||||||
label="品种"
|
label="品种"
|
||||||
@ -346,7 +346,7 @@
|
|||||||
<span style="font-weight: bold; color: #333;">当前体重</span>
|
<span style="font-weight: bold; color: #333;">当前体重</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
v-if="columns['breedStatusId'].visible"
|
v-if="columns['breedStatusId'].visible"
|
||||||
label="繁育状态id"
|
label="繁育状态id"
|
||||||
align="center"
|
align="center"
|
||||||
@ -357,7 +357,7 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">繁育状态id</span>
|
<span style="font-weight: bold; color: #333;">繁育状态id</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="columns['breed'].visible"
|
v-if="columns['breed'].visible"
|
||||||
label="繁殖状态"
|
label="繁殖状态"
|
||||||
@ -370,7 +370,7 @@
|
|||||||
<span style="font-weight: bold; color: #333;">繁殖状态</span>
|
<span style="font-weight: bold; color: #333;">繁殖状态</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
v-if="columns['bsFatherId'].visible"
|
v-if="columns['bsFatherId'].visible"
|
||||||
label="父号id"
|
label="父号id"
|
||||||
align="center"
|
align="center"
|
||||||
@ -381,20 +381,20 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">父号id</span>
|
<span style="font-weight: bold; color: #333;">父号id</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="columns['fatherManageTags'].visible"
|
v-if="columns['fatherManageTags'].visible"
|
||||||
label="父亲管理耳号"
|
label="父亲耳号"
|
||||||
align="center"
|
align="center"
|
||||||
prop="fatherManageTags"
|
prop="fatherManageTags"
|
||||||
width="120"
|
width="120"
|
||||||
sortable
|
sortable
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">父亲管理耳号</span>
|
<span style="font-weight: bold; color: #333;">父亲耳号</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
v-if="columns['bsMotherId'].visible"
|
v-if="columns['bsMotherId'].visible"
|
||||||
label="母号id"
|
label="母号id"
|
||||||
align="center"
|
align="center"
|
||||||
@ -405,20 +405,20 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">母号id</span>
|
<span style="font-weight: bold; color: #333;">母号id</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="columns['motherManageTags'].visible"
|
v-if="columns['motherManageTags'].visible"
|
||||||
label="母亲管理耳号"
|
label="母亲耳号"
|
||||||
align="center"
|
align="center"
|
||||||
prop="motherManageTags"
|
prop="motherManageTags"
|
||||||
width="120"
|
width="120"
|
||||||
sortable
|
sortable
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">母亲管理耳号</span>
|
<span style="font-weight: bold; color: #333;">母亲耳号</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
v-if="columns['receptorId'].visible"
|
v-if="columns['receptorId'].visible"
|
||||||
label="受体id"
|
label="受体id"
|
||||||
align="center"
|
align="center"
|
||||||
@ -429,20 +429,20 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">受体id</span>
|
<span style="font-weight: bold; color: #333;">受体id</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="columns['receptorManageTags'].visible"
|
v-if="columns['receptorManageTags'].visible"
|
||||||
label="受体管理耳号"
|
label="受体耳号"
|
||||||
align="center"
|
align="center"
|
||||||
prop="receptorManageTags"
|
prop="receptorManageTags"
|
||||||
width="120"
|
width="120"
|
||||||
sortable
|
sortable
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">受体管理耳号</span>
|
<span style="font-weight: bold; color: #333;">受体耳号</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
v-if="columns['fatherFatherId'].visible"
|
v-if="columns['fatherFatherId'].visible"
|
||||||
label="祖父号id"
|
label="祖父号id"
|
||||||
align="center"
|
align="center"
|
||||||
@ -453,20 +453,20 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">祖父号id</span>
|
<span style="font-weight: bold; color: #333;">祖父号id</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="columns['grandfatherManageTags'].visible"
|
v-if="columns['grandfatherManageTags'].visible"
|
||||||
label="祖父管理耳号"
|
label="祖父耳号"
|
||||||
align="center"
|
align="center"
|
||||||
prop="grandfatherManageTags"
|
prop="grandfatherManageTags"
|
||||||
width="120"
|
width="120"
|
||||||
sortable
|
sortable
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">祖父管理耳号</span>
|
<span style="font-weight: bold; color: #333;">祖父耳号</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
v-if="columns['fatherMotherId'].visible"
|
v-if="columns['fatherMotherId'].visible"
|
||||||
label="祖母号id"
|
label="祖母号id"
|
||||||
align="center"
|
align="center"
|
||||||
@ -477,20 +477,20 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">祖母号id</span>
|
<span style="font-weight: bold; color: #333;">祖母号id</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="columns['grandmotherManageTags'].visible"
|
v-if="columns['grandmotherManageTags'].visible"
|
||||||
label="祖母管理耳号"
|
label="祖母耳号"
|
||||||
align="center"
|
align="center"
|
||||||
prop="grandmotherManageTags"
|
prop="grandmotherManageTags"
|
||||||
width="120"
|
width="120"
|
||||||
sortable
|
sortable
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">祖母管理耳号</span>
|
<span style="font-weight: bold; color: #333;">祖母耳号</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
v-if="columns['fatherId'].visible"
|
v-if="columns['fatherId'].visible"
|
||||||
label="外祖父号id"
|
label="外祖父号id"
|
||||||
align="center"
|
align="center"
|
||||||
@ -501,20 +501,20 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">外祖父号id</span>
|
<span style="font-weight: bold; color: #333;">外祖父号id</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="columns['maternalGrandfatherManageTags'].visible"
|
v-if="columns['maternalGrandfatherManageTags'].visible"
|
||||||
label="外祖父管理耳号"
|
label="外祖父耳号"
|
||||||
align="center"
|
align="center"
|
||||||
prop="maternalGrandfatherManageTags"
|
prop="maternalGrandfatherManageTags"
|
||||||
width="120"
|
width="120"
|
||||||
sortable
|
sortable
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">外祖父管理耳号</span>
|
<span style="font-weight: bold; color: #333;">外祖父耳号</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
v-if="columns['motherId'].visible"
|
v-if="columns['motherId'].visible"
|
||||||
label="外祖母号id"
|
label="外祖母号id"
|
||||||
align="center"
|
align="center"
|
||||||
@ -525,17 +525,17 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">外祖母号id</span>
|
<span style="font-weight: bold; color: #333;">外祖母号id</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="columns['maternalGrandmotherManageTags'].visible"
|
v-if="columns['maternalGrandmotherManageTags'].visible"
|
||||||
label="外祖母管理耳号"
|
label="外祖母耳号"
|
||||||
align="center"
|
align="center"
|
||||||
prop="maternalGrandmotherManageTags"
|
prop="maternalGrandmotherManageTags"
|
||||||
width="120"
|
width="120"
|
||||||
sortable
|
sortable
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">外祖母管理耳号</span>
|
<span style="font-weight: bold; color: #333;">外祖母耳号</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@ -809,7 +809,7 @@
|
|||||||
<span>{{ parseTime(scope.row.sourceDate, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.sourceDate, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
v-if="columns['sourceRanchId'].visible"
|
v-if="columns['sourceRanchId'].visible"
|
||||||
label="来源牧场id"
|
label="来源牧场id"
|
||||||
align="center"
|
align="center"
|
||||||
@ -820,7 +820,7 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<span style="font-weight: bold; color: #333;">来源牧场id</span>
|
<span style="font-weight: bold; color: #333;">来源牧场id</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="columns['sourceRanch'].visible"
|
v-if="columns['sourceRanch'].visible"
|
||||||
label="来源牧场"
|
label="来源牧场"
|
||||||
@ -915,14 +915,14 @@
|
|||||||
<el-dialog v-model="columnDialogVisible" title="显示列设置" width="800px">
|
<el-dialog v-model="columnDialogVisible" title="显示列设置" width="800px">
|
||||||
<div style="max-height: 400px; overflow-y: auto; ">
|
<div style="max-height: 400px; overflow-y: auto; ">
|
||||||
<el-checkbox-group v-model="selectedColumns" style="grid; grid-template-columns: repeat(3, 1fr); gap: 10px;" >
|
<el-checkbox-group v-model="selectedColumns" style="grid; grid-template-columns: repeat(3, 1fr); gap: 10px;" >
|
||||||
<el-checkbox label="id">羊只id</el-checkbox>
|
<!-- <el-checkbox label="id">羊只id</el-checkbox> -->
|
||||||
<el-checkbox label="bsManageTags">管理耳号</el-checkbox>
|
<el-checkbox label="bsManageTags">耳号</el-checkbox>
|
||||||
<el-checkbox label="ranchId">牧场id</el-checkbox>
|
<!-- <el-checkbox label="ranchId">牧场id</el-checkbox> -->
|
||||||
<el-checkbox label="drRanch">牧场名称</el-checkbox>
|
<el-checkbox label="drRanch">牧场名称</el-checkbox>
|
||||||
<el-checkbox label="sheepfoldId">羊舍id</el-checkbox>
|
<!-- <el-checkbox label="sheepfoldId">羊舍id</el-checkbox> -->
|
||||||
<el-checkbox label="sheepfoldName">羊舍名称</el-checkbox>
|
<el-checkbox label="sheepfoldName">羊舍名称</el-checkbox>
|
||||||
<el-checkbox label="electronicTags">电子耳号</el-checkbox>
|
<el-checkbox label="electronicTags">电子耳号</el-checkbox>
|
||||||
<el-checkbox label="varietyId">品种id</el-checkbox>
|
<!-- <el-checkbox label="varietyId">品种id</el-checkbox> -->
|
||||||
<el-checkbox label="variety">品种</el-checkbox>
|
<el-checkbox label="variety">品种</el-checkbox>
|
||||||
<el-checkbox label="family">家系</el-checkbox>
|
<el-checkbox label="family">家系</el-checkbox>
|
||||||
<el-checkbox label="name">羊只类型</el-checkbox>
|
<el-checkbox label="name">羊只类型</el-checkbox>
|
||||||
@ -936,22 +936,22 @@
|
|||||||
<el-checkbox label="statusId">羊只状态</el-checkbox>
|
<el-checkbox label="statusId">羊只状态</el-checkbox>
|
||||||
<el-checkbox label="weaningWeight">断奶体重</el-checkbox>
|
<el-checkbox label="weaningWeight">断奶体重</el-checkbox>
|
||||||
<el-checkbox label="currentWeight">当前体重</el-checkbox>
|
<el-checkbox label="currentWeight">当前体重</el-checkbox>
|
||||||
<el-checkbox label="breedStatusId">繁育状态id</el-checkbox>
|
<!-- <el-checkbox label="breedStatusId">繁育状态id</el-checkbox> -->
|
||||||
<el-checkbox label="breed">繁殖状态</el-checkbox>
|
<el-checkbox label="breed">繁殖状态</el-checkbox>
|
||||||
<el-checkbox label="bsFatherId">父号id</el-checkbox>
|
<!-- <el-checkbox label="bsFatherId">父号id</el-checkbox> -->
|
||||||
<el-checkbox label="fatherManageTags">父亲管理耳号</el-checkbox>
|
<el-checkbox label="fatherManageTags">父亲耳号</el-checkbox>
|
||||||
<el-checkbox label="bsMotherId">母号id</el-checkbox>
|
<!-- <el-checkbox label="bsMotherId">母号id</el-checkbox> -->
|
||||||
<el-checkbox label="motherManageTags">母亲管理耳号</el-checkbox>
|
<el-checkbox label="motherManageTags">母亲耳号</el-checkbox>
|
||||||
<el-checkbox label="receptorId">受体id</el-checkbox>
|
<!-- <el-checkbox label="receptorId">受体id</el-checkbox> -->
|
||||||
<el-checkbox label="receptorManageTags">受体管理耳号</el-checkbox>
|
<el-checkbox label="receptorManageTags">受体耳号</el-checkbox>
|
||||||
<el-checkbox label="fatherFatherId">祖父号id</el-checkbox>
|
<!-- <el-checkbox label="fatherFatherId">祖父号id</el-checkbox> -->
|
||||||
<el-checkbox label="grandfatherManageTags">祖父管理耳号</el-checkbox>
|
<el-checkbox label="grandfatherManageTags">祖父耳号</el-checkbox>
|
||||||
<el-checkbox label="fatherMotherId">祖母号id</el-checkbox>
|
<!-- <el-checkbox label="fatherMotherId">祖母号id</el-checkbox> -->
|
||||||
<el-checkbox label="grandmotherManageTags">祖母管理耳号</el-checkbox>
|
<el-checkbox label="grandmotherManageTags">祖母耳号</el-checkbox>
|
||||||
<el-checkbox label="fatherId">外祖父号id</el-checkbox>
|
<!-- <el-checkbox label="fatherId">外祖父号id</el-checkbox> -->
|
||||||
<el-checkbox label="maternalGrandfatherManageTags">外祖父管理耳号</el-checkbox>
|
<el-checkbox label="maternalGrandfatherManageTags">外祖父耳号</el-checkbox>
|
||||||
<el-checkbox label="motherId">外祖母号id</el-checkbox>
|
<!-- <el-checkbox label="motherId">外祖母号id</el-checkbox> -->
|
||||||
<el-checkbox label="maternalGrandmotherManageTags">外祖母管理耳号</el-checkbox>
|
<el-checkbox label="maternalGrandmotherManageTags">外祖母耳号</el-checkbox>
|
||||||
<el-checkbox label="matingDate">配种日期</el-checkbox>
|
<el-checkbox label="matingDate">配种日期</el-checkbox>
|
||||||
<el-checkbox label="matingTypeId">配种类型</el-checkbox>
|
<el-checkbox label="matingTypeId">配种类型</el-checkbox>
|
||||||
<el-checkbox label="pregDate">孕检日期</el-checkbox>
|
<el-checkbox label="pregDate">孕检日期</el-checkbox>
|
||||||
@ -972,7 +972,7 @@
|
|||||||
<el-checkbox label="breast">乳房评分</el-checkbox>
|
<el-checkbox label="breast">乳房评分</el-checkbox>
|
||||||
<el-checkbox label="source">入群来源</el-checkbox>
|
<el-checkbox label="source">入群来源</el-checkbox>
|
||||||
<el-checkbox label="sourceDate">入群日期</el-checkbox>
|
<el-checkbox label="sourceDate">入群日期</el-checkbox>
|
||||||
<el-checkbox label="sourceRanchId">来源牧场id</el-checkbox>
|
<!-- <el-checkbox label="sourceRanchId">来源牧场id</el-checkbox> -->
|
||||||
<el-checkbox label="sourceRanch">来源牧场</el-checkbox>
|
<el-checkbox label="sourceRanch">来源牧场</el-checkbox>
|
||||||
<el-checkbox label="updateBy">修改人</el-checkbox>
|
<el-checkbox label="updateBy">修改人</el-checkbox>
|
||||||
<el-checkbox label="updateTime">修改日期</el-checkbox>
|
<el-checkbox label="updateTime">修改日期</el-checkbox>
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="分组" prop="groupId">
|
<el-form-item label="分组" prop="groupId">
|
||||||
<el-select
|
<!-- <el-select
|
||||||
v-model="queryParams.groupId"
|
v-model="queryParams.groupId"
|
||||||
placeholder="请选择分组"
|
placeholder="请选择分组"
|
||||||
clearable
|
clearable
|
||||||
@ -30,7 +30,14 @@
|
|||||||
:label="g.groupName"
|
:label="g.groupName"
|
||||||
:value="g.groupId"
|
:value="g.groupId"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select> -->
|
||||||
|
<el-tree-select v-model="queryParams.groupId" :data="groupTree" style="width: 180px;"
|
||||||
|
:props="{ value: 'groupId', label: 'groupName', children: 'children' }"
|
||||||
|
value-key="groupId" placeholder="请选择"
|
||||||
|
check-strictly
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
@ -134,14 +141,27 @@
|
|||||||
<el-input type="textarea" :rows="4" v-model="form.earTags" :disabled="form.earTagsDisabled" placeholder="请输入耳号,多个耳号用逗号或换行分隔"/>
|
<el-input type="textarea" :rows="4" v-model="form.earTags" :disabled="form.earTagsDisabled" placeholder="请输入耳号,多个耳号用逗号或换行分隔"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="分组" prop="groupId">
|
<el-form-item label="分组" prop="groupId">
|
||||||
<el-select v-model="form.groupId" placeholder="请选择分组" clearable>
|
<!-- <el-select v-model="form.groupId" placeholder="请选择分组" clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="g in leafGroupOptions"
|
v-for="g in leafGroupOptions"
|
||||||
:key="g.groupId"
|
:key="g.groupId"
|
||||||
:label="g.groupName"
|
:label="g.groupName"
|
||||||
:value="g.groupId"
|
:value="g.groupId"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select> -->
|
||||||
|
|
||||||
|
<el-tree-select
|
||||||
|
v-model="form.groupId"
|
||||||
|
:data="groupTree"
|
||||||
|
style="width: 180px"
|
||||||
|
:props="{ value: 'groupId', label: 'groupName', children: 'children' }"
|
||||||
|
value-key="groupId"
|
||||||
|
placeholder="请选择分组"
|
||||||
|
clearable
|
||||||
|
check-strictly
|
||||||
|
:select-leaf-only="true"
|
||||||
|
/>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@ -159,6 +179,7 @@ import { listSheep_grouping, getSheep_grouping, delSheep_grouping, addSheep_grou
|
|||||||
import {listLeafGroup} from "@/api/fileManagement/group_management"
|
import {listLeafGroup} from "@/api/fileManagement/group_management"
|
||||||
import {listSheep_grouping_join} from "@/api/fileManagement/sheep_grouping"
|
import {listSheep_grouping_join} from "@/api/fileManagement/sheep_grouping"
|
||||||
import { addByEarTags } from '@/api/fileManagement/sheep_grouping'
|
import { addByEarTags } from '@/api/fileManagement/sheep_grouping'
|
||||||
|
import { listGroupTree } from '@/api/fileManagement/sheep_grouping'
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
|
|
||||||
@ -173,6 +194,8 @@ const total = ref(0)
|
|||||||
const title = ref("")
|
const title = ref("")
|
||||||
const leafGroupOptions = ref([])
|
const leafGroupOptions = ref([])
|
||||||
const { sheep_gender } = proxy.useDict('sheep_gender')
|
const { sheep_gender } = proxy.useDict('sheep_gender')
|
||||||
|
// data 里声明
|
||||||
|
const groupTree = ref([])
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: {
|
form: {
|
||||||
@ -390,17 +413,33 @@ loadLeafGroups()
|
|||||||
getList()
|
getList()
|
||||||
|
|
||||||
|
|
||||||
|
// // 调用示例
|
||||||
|
// function loadLeafGroups() {
|
||||||
|
// listLeafGroup().then(res => {
|
||||||
|
// leafGroupOptions.value = res.data
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
// 调用示例
|
// 调用示例
|
||||||
function loadLeafGroups() {
|
function loadLeafGroups() {
|
||||||
listLeafGroup().then(res => {
|
listGroupTree().then(res => {
|
||||||
leafGroupOptions.value = res.data
|
groupTree.value = res.data
|
||||||
|
console.log(groupTree.value)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 根据 groupId 获取分组名称
|
// 根据 groupId 获取分组名称
|
||||||
|
// function getGroupName(id) {
|
||||||
|
// const group = leafGroupOptions.value.find(g => g.groupId === id)
|
||||||
|
// return group ? group.groupName : ''
|
||||||
|
// }
|
||||||
|
|
||||||
function getGroupName(id) {
|
function getGroupName(id) {
|
||||||
const group = leafGroupOptions.value.find(g => g.groupId === id)
|
const flatten = (arr) =>
|
||||||
return group ? group.groupName : ''
|
arr.reduce((acc, cur) => acc.concat(cur, flatten(cur.children || [])), [])
|
||||||
|
const node = flatten(groupTree.value).find(n => n.groupId === id)
|
||||||
|
return node ? node.groupName : ''
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -103,6 +103,86 @@
|
|||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ===== 图形化展示区域 ===== -->
|
||||||
|
<el-divider>牧场羊舍示意图</el-divider>
|
||||||
|
<el-collapse
|
||||||
|
v-model="activeNames"
|
||||||
|
accordion
|
||||||
|
style="margin-top: 16px; max-width: 100%; overflow-x: auto"
|
||||||
|
>
|
||||||
|
<!-- 一级:牧场 -->
|
||||||
|
<el-collapse-item
|
||||||
|
v-for="ranch in seatMapTree"
|
||||||
|
:key="ranch.ranchId"
|
||||||
|
:title="ranch.ranchName"
|
||||||
|
:name="ranch.ranchId"
|
||||||
|
>
|
||||||
|
<!-- 二级:羊舍类型 -->
|
||||||
|
<el-collapse accordion>
|
||||||
|
<el-collapse-item
|
||||||
|
v-for="type in ranch.types"
|
||||||
|
:key="type.typeId"
|
||||||
|
:title="`${type.typeName} (${type.folds.length}个)`"
|
||||||
|
>
|
||||||
|
<!-- 三级:羊舍卡片 -->
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col
|
||||||
|
v-for="fold in type.folds"
|
||||||
|
:key="fold.foldNo"
|
||||||
|
:xs="24"
|
||||||
|
:sm="12"
|
||||||
|
:md="8"
|
||||||
|
:lg="6"
|
||||||
|
:xl="4"
|
||||||
|
style="margin-bottom: 16px"
|
||||||
|
>
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<template #header>
|
||||||
|
<span>{{ fold.foldNo }}号{{type.typeName}}</span>
|
||||||
|
</template>
|
||||||
|
<!-- 四级:排 -->
|
||||||
|
<div
|
||||||
|
v-for="row in fold.rows"
|
||||||
|
:key="row.rowNo"
|
||||||
|
class="seat-block"
|
||||||
|
>
|
||||||
|
<div class="row-label">{{ row.rowNo }}排</div>
|
||||||
|
<div class="seat-row">
|
||||||
|
<!-- 五级:栏位 -->
|
||||||
|
<div
|
||||||
|
v-for="col in row.columns"
|
||||||
|
:key="col"
|
||||||
|
class="seat"
|
||||||
|
:class="{ occupied: isOccupied(fold.foldNo, row.rowNo, col) }"
|
||||||
|
@click="toggleSeat(fold.foldNo, row.rowNo, col)"
|
||||||
|
>
|
||||||
|
{{ col }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-collapse-item>
|
||||||
|
</el-collapse>
|
||||||
|
</el-collapse-item>
|
||||||
|
</el-collapse>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 添加或修改羊舍管理对话框 -->
|
<!-- 添加或修改羊舍管理对话框 -->
|
||||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||||
<el-form ref="sheepfold_managementRef" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="sheepfold_managementRef" :model="form" :rules="rules" label-width="80px">
|
||||||
@ -190,7 +270,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Sheepfold_management">
|
<script setup name="Sheepfold_management">
|
||||||
import { listSheepfold_management, getSheepfold_management, delSheepfold_management, addSheepfold_management, updateSheepfold_management,checkSheepfoldNoExist } from "@/api/fileManagement/sheepfold_management"
|
import { getSeatMap,listSheepfold_management, getSheepfold_management, delSheepfold_management, addSheepfold_management, updateSheepfold_management,checkSheepfoldNoExist } from "@/api/fileManagement/sheepfold_management"
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
const { bas_sheepfold_type, da_ranch } = proxy.useDict('bas_sheepfold_type', 'da_ranch')
|
const { bas_sheepfold_type, da_ranch } = proxy.useDict('bas_sheepfold_type', 'da_ranch')
|
||||||
@ -206,6 +286,7 @@ const total = ref(0)
|
|||||||
const title = ref("")
|
const title = ref("")
|
||||||
const sheepfoldNoExists = ref(false) // 用于显示羊舍编号是否存在
|
const sheepfoldNoExists = ref(false) // 用于显示羊舍编号是否存在
|
||||||
|
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: {
|
form: {
|
||||||
id: null,
|
id: null,
|
||||||
@ -295,6 +376,7 @@ function reset() {
|
|||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1
|
queryParams.value.pageNum = 1
|
||||||
getList()
|
getList()
|
||||||
|
loadSeatMap()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
@ -388,6 +470,7 @@ function submitForm() {
|
|||||||
proxy.$modal.msgSuccess("修改成功")
|
proxy.$modal.msgSuccess("修改成功")
|
||||||
open.value = false
|
open.value = false
|
||||||
getList()
|
getList()
|
||||||
|
loadSeatMap()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// 新增操作 - 多条记录
|
// 新增操作 - 多条记录
|
||||||
@ -423,6 +506,7 @@ function submitForm() {
|
|||||||
proxy.$modal.msgSuccess(`新增成功,共添加${requests.length}条记录`)
|
proxy.$modal.msgSuccess(`新增成功,共添加${requests.length}条记录`)
|
||||||
open.value = false
|
open.value = false
|
||||||
getList()
|
getList()
|
||||||
|
loadSeatMap()
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
proxy.$modal.msgError("部分记录添加失败:" + error.message)
|
proxy.$modal.msgError("部分记录添加失败:" + error.message)
|
||||||
@ -439,6 +523,7 @@ function handleDelete(row) {
|
|||||||
return delSheepfold_management(_ids)
|
return delSheepfold_management(_ids)
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
getList()
|
getList()
|
||||||
|
loadSeatMap();
|
||||||
proxy.$modal.msgSuccess("删除成功")
|
proxy.$modal.msgSuccess("删除成功")
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
@ -450,7 +535,46 @@ function handleExport() {
|
|||||||
}, `sheepfold_management_${new Date().getTime()}.xlsx`)
|
}, `sheepfold_management_${new Date().getTime()}.xlsx`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ===== 图形化展示所需变量和方法 ===== */
|
||||||
|
const activeNames = ref([]) // 当前展开的牧场
|
||||||
|
const seatMapTree = ref([]) // 树形结构数据
|
||||||
|
const loadSeatMap = () => {
|
||||||
|
getSeatMap()
|
||||||
|
.then(res => (seatMapTree.value = res.data))
|
||||||
|
.catch(err => proxy.$modal.msgError('加载座位图失败:' + err.message))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 演示:点击栏位切换颜色 */
|
||||||
|
const occupied = ref(new Set())
|
||||||
|
const isOccupied = (foldNo, rowNo, col) =>
|
||||||
|
occupied.value.has(`${foldNo}-${rowNo}-${col}`)
|
||||||
|
const toggleSeat = (foldNo, rowNo, col) => {
|
||||||
|
const key = `${foldNo}-${rowNo}-${col}`
|
||||||
|
occupied.value.has(key)
|
||||||
|
? occupied.value.delete(key)
|
||||||
|
: occupied.value.add(key)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 页面加载时拉取数据 */
|
||||||
|
onMounted(() => {
|
||||||
getList()
|
getList()
|
||||||
|
loadSeatMap()
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
getList()
|
||||||
|
loadSeatMap()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@ -462,4 +586,34 @@ getList()
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background-color: #f5f7fa;
|
background-color: #f5f7fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ===== 图形化展示样式 ===== */
|
||||||
|
.seat-block {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
.row-label {
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
.seat-row {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
.seat {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
border: 1px solid #dcdfe6;
|
||||||
|
border-radius: 4px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
background: #f2f6fc;
|
||||||
|
}
|
||||||
|
.seat.occupied {
|
||||||
|
background: #67c23a;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -2,7 +2,10 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="单据日期" prop="docDate">
|
<el-form-item label="单据日期" prop="docDate">
|
||||||
<el-input v-model="queryParams.docDate" placeholder="请输入单据日期" clearable @keyup.enter="handleQuery" />
|
<!-- <el-input v-model="queryParams.docDate" placeholder="请输入单据日期" clearable @keyup.enter="handleQuery" /> -->
|
||||||
|
<el-date-picker clearable v-model="queryParams.docDate" type="date" value-format="YYYY-MM-DD"
|
||||||
|
placeholder="请选择时间" @change="handleQuery">
|
||||||
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="业务类型" prop="businessType">
|
<el-form-item label="业务类型" prop="businessType">
|
||||||
<el-input v-model="queryParams.businessType" placeholder="请输入业务类型" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.businessType" placeholder="请输入业务类型" clearable @keyup.enter="handleQuery" />
|
||||||
@ -21,7 +24,8 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['stock:in:add']" v-show="false">新增</el-button>
|
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['stock:in:add']"
|
||||||
|
v-show="false">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||||
|
|||||||
@ -2,20 +2,13 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="存货" prop="materialName">
|
<el-form-item label="存货" prop="materialName">
|
||||||
<el-input
|
<el-input v-model="queryParams.materialName" placeholder="请输入存货" clearable @keyup.enter="handleQuery" />
|
||||||
v-model="queryParams.materialName"
|
|
||||||
placeholder="请输入存货"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="生产日期" prop="productionDate">
|
<el-form-item label="生产日期" prop="productionDate">
|
||||||
<el-input
|
<!-- <el-input v-model="queryParams.productionDate" placeholder="请输入生产日期" clearable @keyup.enter="handleQuery" /> -->
|
||||||
v-model="queryParams.productionDate"
|
<el-date-picker clearable v-model="queryParams.productionDate" type="date" value-format="YYYY-MM-DD"
|
||||||
placeholder="请输入生产日期"
|
placeholder="请输入生产日期" @change="handleQuery">
|
||||||
clearable
|
</el-date-picker>
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
@ -25,45 +18,24 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
||||||
type="primary"
|
v-hasPermi="['stock:management:add']">新增</el-button>
|
||||||
plain
|
|
||||||
icon="Plus"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['stock:management:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||||
type="success"
|
v-hasPermi="['stock:management:edit']">修改</el-button>
|
||||||
plain
|
|
||||||
icon="Edit"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
v-hasPermi="['stock:management:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||||
type="danger"
|
v-hasPermi="['stock:management:remove']">删除</el-button>
|
||||||
plain
|
|
||||||
icon="Delete"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['stock:management:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||||
type="warning"
|
v-hasPermi="['stock:management:export']">导出</el-button>
|
||||||
plain
|
|
||||||
icon="Download"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['stock:management:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="info" plain icon="Upload" @click="handleImport" v-hasPermi="['stock:management:import']">导入</el-button>
|
<el-button type="info" plain icon="Upload" @click="handleImport"
|
||||||
|
v-hasPermi="['stock:management:import']">导入</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -83,19 +55,16 @@
|
|||||||
<el-table-column label="失效预警" align="center" prop="expirationAlarm" />
|
<el-table-column label="失效预警" align="center" prop="expirationAlarm" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['stock:management:edit']">修改</el-button>
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['stock:management:remove']">删除</el-button>
|
v-hasPermi="['stock:management:edit']">修改</el-button>
|
||||||
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['stock:management:remove']">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||||
v-show="total>0"
|
@pagination="getList" />
|
||||||
:total="total"
|
|
||||||
v-model:page="queryParams.pageNum"
|
|
||||||
v-model:limit="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改饲喂计划对话框 -->
|
<!-- 添加或修改饲喂计划对话框 -->
|
||||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||||
@ -119,18 +88,12 @@
|
|||||||
<el-input v-model="form.currentStock" placeholder="请输入现存量" />
|
<el-input v-model="form.currentStock" placeholder="请输入现存量" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="生产日期" prop="productionDate">
|
<el-form-item label="生产日期" prop="productionDate">
|
||||||
<el-date-picker clearable
|
<el-date-picker clearable v-model="form.productionDate" type="date" value-format="YYYY-MM-DD"
|
||||||
v-model="form.productionDate"
|
|
||||||
type="date"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
placeholder="请选择生产日期">
|
placeholder="请选择生产日期">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="失效日期" prop="expirationDate">
|
<el-form-item label="失效日期" prop="expirationDate">
|
||||||
<el-date-picker clearable
|
<el-date-picker clearable v-model="form.expirationDate" type="date" value-format="YYYY-MM-DD"
|
||||||
v-model="form.expirationDate"
|
|
||||||
type="date"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
placeholder="请选择失效日期">
|
placeholder="请选择失效日期">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|||||||
@ -42,7 +42,7 @@ export default defineConfig(({ mode, command }) => {
|
|||||||
},
|
},
|
||||||
// vite 相关配置
|
// vite 相关配置
|
||||||
server: {
|
server: {
|
||||||
port: 80,
|
port: 82,
|
||||||
host: true,
|
host: true,
|
||||||
open: true,
|
open: true,
|
||||||
proxy: {
|
proxy: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user