From 144f5ea091329f04149598f7903dc5f7dbfb3c08 Mon Sep 17 00:00:00 2001
From: piaobo <1913856125@qq.com>
Date: Wed, 20 Aug 2025 11:11:18 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E6=B6=88=E6=AF=92=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/biosafety/disease/index.vue | 7 +-
src/views/biosafety/disinfect/index.vue | 104 ++++++++++++++-------
src/views/biosafety/prescription/index.vue | 6 +-
3 files changed, 78 insertions(+), 39 deletions(-)
diff --git a/src/views/biosafety/disease/index.vue b/src/views/biosafety/disease/index.vue
index 0138522..28a3979 100644
--- a/src/views/biosafety/disease/index.vue
+++ b/src/views/biosafety/disease/index.vue
@@ -82,6 +82,7 @@ const title = ref("")
const isExpandAll = ref(true)
const refreshTable = ref(true)
+
const data = reactive({
form: {},
queryParams: {
@@ -99,6 +100,7 @@ const { queryParams, form, rules } = toRefs(data)
function getList() {
loading.value = true
listDisease(queryParams.value).then(response => {
+
diseaseList.value = proxy.handleTree(response.data, "id", "pid")
loading.value = false
})
@@ -107,10 +109,7 @@ function getList() {
/** 查询疾病下拉树结构 */
function getTreeselect() {
listDisease().then(response => {
- diseaseOptions.value = []
- const data = { id: 0, name: '疾病', children: [] }
- data.children = proxy.handleTree(response.data, "id", "pid")
- diseaseOptions.value.push(data)
+ diseaseOptions.value = response.data.filter(item => item.pid === 0)
})
}
diff --git a/src/views/biosafety/disinfect/index.vue b/src/views/biosafety/disinfect/index.vue
index fe5cabe..fda59c7 100644
--- a/src/views/biosafety/disinfect/index.vue
+++ b/src/views/biosafety/disinfect/index.vue
@@ -2,17 +2,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
@@ -34,13 +43,21 @@
-
- {{ parseTime(scope.row.datetime, '{y}-{m}-{d}') }}
+
+
+ {{ parseTime(scope.row.datetime, '{y}-{m}-{d} {h}:{i}') }}
+
+
-
+
+
+
+
+
+
@@ -66,8 +83,10 @@
+
-
+
@@ -82,7 +101,7 @@
-
+
@@ -90,8 +109,10 @@
-
-
+
+
+
+
@@ -169,8 +190,10 @@
+
-
+
@@ -186,7 +209,9 @@
-
+
+
+
@@ -214,14 +239,14 @@
-
+
-
+
@@ -267,8 +292,9 @@ import request from '@/utils/request'
import { parseTime } from '@/utils/ruoyi'
const { proxy } = getCurrentInstance()
+const { disinfect_type } = proxy.useDict('disinfect_type')
-/* ------------------ 列表 ------------------ */
+/* ---------- 列表 ---------- */
const loading = ref(true)
const showSearch = ref(true)
const total = ref(0)
@@ -318,13 +344,25 @@ function resetQuery() {
handleQuery()
}
-/* ------------------ 新增弹窗 ------------------ */
+/* ---------- 新增弹窗 ---------- */
const openAdd = ref(false)
const titleAdd = ref('新增消毒记录')
+
+// 5️⃣ 默认当前分钟
+const nowMinute = () => {
+ const d = new Date()
+ const Y = d.getFullYear()
+ const M = String(d.getMonth() + 1).padStart(2, '0')
+ const D = String(d.getDate()).padStart(2, '0')
+ const h = String(d.getHours()).padStart(2, '0')
+ const m = String(d.getMinutes()).padStart(2, '0')
+ return `${Y}-${M}-${D} ${h}:${m}`
+}
+
const form = reactive({
id: null,
technician: '',
- datetime: new Date().toISOString().split('T')[0],
+ datetime: nowMinute(), // 精确到分钟
way: '',
ratio: '',
comment: '',
@@ -337,7 +375,7 @@ function resetAdd() {
Object.assign(form, {
id: null,
technician: '',
- datetime: new Date().toISOString().split('T')[0],
+ datetime: nowMinute(),
way: '',
ratio: '',
comment: '',
@@ -372,13 +410,13 @@ function submitAdd() {
})
}
-/* ------------------ 修改弹窗 ------------------ */
+/* ---------- 修改弹窗 ---------- */
const openEdit = ref(false)
const titleEdit = ref('修改消毒记录')
const editForm = reactive({
id: null,
technician: '',
- datetime: new Date().toISOString().split('T')[0],
+ datetime: nowMinute(),
way: '',
ratio: '',
comment: '',
@@ -391,7 +429,7 @@ function resetEdit() {
Object.assign(editForm, {
id: null,
technician: '',
- datetime: new Date().toISOString().split('T')[0],
+ datetime: nowMinute(),
way: '',
ratio: '',
comment: '',
@@ -405,6 +443,8 @@ function handleUpdate(row) {
resetEdit()
const id = row.id || ids.value[0]
getDisinfect(id).then(res => {
+ // 后端返回的是时间戳,转成 YYYY-MM-DD HH:mm 字符串方便 el-date-picker 回显
+ editForm.datetime = parseTime(res.data.datetime, '{y}-{m}-{d} {h}:{i}')
Object.assign(editForm, res.data)
editDetails.value = res.data.usageDetails || []
openEdit.value = true
@@ -431,7 +471,7 @@ function submitEdit() {
})
}
-/* ------------------ 功能 ------------------ */
+/* ---------- 功能 ---------- */
function handleDelete(row) {
const _ids = row.id || ids.value
proxy.$modal.confirm('是否确认删除选中的数据?').then(() => delDisinfect(_ids)).then(() => {
@@ -444,7 +484,7 @@ function handleExport() {
proxy.download('biosafety/disinfect/export', { ...queryParams }, `disinfect_${Date.now()}.xlsx`)
}
-/* ------------------ 下拉数据 ------------------ */
+/* ---------- 下拉数据 ---------- */
const barns = ref([])
const presOptions = ref([])
const units = ref([])
@@ -454,10 +494,12 @@ const medicines = ref([])
/* 校验规则 */
const rules = {
sheepfoldIds: [{ required: true, message: '请选择羊舍', trigger: 'change' }],
+ technician: [{ required: true, message: '请输入技术员', trigger: 'blur' }],
+ way: [{ required: true, message: '请选择消毒方式', trigger: 'change' }],
datetime: [{ required: true, message: '请选择日期', trigger: 'change' }]
}
-/* 处方选择事件 - 新增 */
+/* 处方选择事件 */
function handleSelectPrescription(id) {
if (!id) return
getPrescription(id).then(res => {
@@ -469,8 +511,6 @@ function handleSelectPrescription(id) {
})) || []
})
}
-
-/* 处方选择事件 - 修改 */
function handleSelectPrescriptionEdit(id) {
if (!id) return
getPrescription(id).then(res => {
@@ -483,20 +523,18 @@ function handleSelectPrescriptionEdit(id) {
})
}
-/* 明细添加行 - 新增 */
+/* 明细添加行 */
function handleAddDetail() {
usageDetails.value.push({ mediId: null, dosage: 0, unit: null, usageId: null, manufacturer: null, batchNumber: null })
}
-
-/* 明细添加行 - 修改 */
function handleAddDetailEdit() {
editDetails.value.push({ mediId: null, dosage: 0, unit: null, usageId: null, manufacturer: null, batchNumber: null })
}
-/* ------------------ 初始加载 ------------------ */
+/* ---------- 初始加载 ---------- */
onMounted(() => {
getList()
- /* 加载本地羊舍 */
+ /* 本地羊舍下拉 */
request({ url: '/sheepfold_management/sheepfold_management/list', method: 'get' }).then(res => {
barns.value = res.rows
})
diff --git a/src/views/biosafety/prescription/index.vue b/src/views/biosafety/prescription/index.vue
index 82ac02e..c9c156f 100644
--- a/src/views/biosafety/prescription/index.vue
+++ b/src/views/biosafety/prescription/index.vue
@@ -51,17 +51,19 @@
+
-
+
详情
修改
- {{ scope.row.status?"禁用":"启用" }}
+ {{
+ scope.row.status?"禁用":"启用" }}
删除
From cd0a4d6a0b97d4a0900d35e755c9fd4a9835aed4 Mon Sep 17 00:00:00 2001
From: HashMap
Date: Wed, 20 Aug 2025 11:59:34 +0800
Subject: [PATCH 2/2] =?UTF-8?q?feat(view=20api):=20=E9=85=8D=E6=96=99?=
=?UTF-8?q?=E6=B8=85=E5=8D=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
添加了配料清单功能
---
src/api/feed/FeedList.js | 44 +++++
src/views/feed/FeedList/index.vue | 292 ++++++++++++++++++++++++++++++
2 files changed, 336 insertions(+)
create mode 100644 src/api/feed/FeedList.js
create mode 100644 src/views/feed/FeedList/index.vue
diff --git a/src/api/feed/FeedList.js b/src/api/feed/FeedList.js
new file mode 100644
index 0000000..50e8a9d
--- /dev/null
+++ b/src/api/feed/FeedList.js
@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询配料清单列表
+export function listFeedList(query) {
+ return request({
+ url: '/feed/FeedList/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 查询配料清单详细
+export function getFeedList(id) {
+ return request({
+ url: '/feed/FeedList/' + id,
+ method: 'get'
+ })
+}
+
+// 新增配料清单
+export function addFeedList(data) {
+ return request({
+ url: '/feed/FeedList',
+ method: 'post',
+ data: data
+ })
+}
+
+// 修改配料清单
+export function updateFeedList(data) {
+ return request({
+ url: '/feed/FeedList',
+ method: 'put',
+ data: data
+ })
+}
+
+// 删除配料清单
+export function delFeedList(id) {
+ return request({
+ url: '/feed/FeedList/' + id,
+ method: 'delete'
+ })
+}
diff --git a/src/views/feed/FeedList/index.vue b/src/views/feed/FeedList/index.vue
new file mode 100644
index 0000000..5b1f464
--- /dev/null
+++ b/src/views/feed/FeedList/index.vue
@@ -0,0 +1,292 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 新增
+
+
+ 修改
+
+
+
+ 导出
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.deployDate, '{y}-{m}-{d}') }}
+
+
+
+
+ 详情
+ 修改
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ showFeedList.formulaId }}
+ {{ showFeedList.formulaBatchId }}
+ {{ showFeedList.rootFormula.feedStage }}
+
+
+ 配料列表
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (scope.row.ratio / 100 * showFeedList.rootPlan.planMorningSize).toFixed(2) }}
+
+
+
+
+ {{ (scope.row.ratio / 100 * showFeedList.rootPlan.planNoonSize).toFixed(2) }}
+
+
+
+
+ {{ (scope.row.ratio / 100 * showFeedList.rootPlan.planAfternoonSize).toFixed(2) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+