diff --git a/package.json b/package.json index 0abbf3b..4903716 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "clipboard": "2.0.11", "date-fns": "^4.1.0", "echarts": "5.5.1", + "element-china-area-data": "^6.1.0", "element-plus": "^2.7.6", "file-saver": "2.0.5", "fuse.js": "6.6.2", diff --git a/src/api/dairyProducts/parityCorrection/parityCorrection.js b/src/api/dairyProducts/parityCorrection/parityCorrection.js index 0d2488b..98e592f 100644 --- a/src/api/dairyProducts/parityCorrection/parityCorrection.js +++ b/src/api/dairyProducts/parityCorrection/parityCorrection.js @@ -1,56 +1,44 @@ -// import request from '@/utils/request' - -// // 查询胎次校正列表 -// export function listParityCorrection(query) { -// return request({ -// url: '/parityCorrection/parityCorrection/list', -// method: 'get', -// params: query -// }) -// } - -// // 查询胎次校正详细 -// export function getParityCorrection(id) { -// return request({ -// url: '/parityCorrection/parityCorrection/' + id, -// method: 'get' -// }) -// } - -// // 新增胎次校正 -// export function addParityCorrection(data) { -// return request({ -// url: '/parityCorrection/parityCorrection', -// method: 'post', -// data: data -// }) -// } - -// // 修改胎次校正 -// export function updateParityCorrection(data) { -// return request({ -// url: '/parityCorrection/parityCorrection', -// method: 'put', -// data: data -// }) -// } - -// // 删除胎次校正 -// export function delParityCorrection(id) { -// return request({ -// url: '/parityCorrection/parityCorrection/' + id, -// method: 'delete' -// }) -// } -// 可以保留空文件或删除此文件 -// 因为前端不再需要调用后端API import request from '@/utils/request' // 查询胎次校正列表 export function listParityCorrection(query) { return request({ - url: '/parityCorrection/parityCorrection/listAll', + url: '/parityCorrection/parityCorrection/list', method: 'get', params: query }) -} \ No newline at end of file +} + +// 查询胎次校正详细 +export function getParityCorrection(id) { + return request({ + url: '/parityCorrection/parityCorrection/' + id, + method: 'get' + }) +} + +// 新增胎次校正 +export function addParityCorrection(data) { + return request({ + url: '/parityCorrection/parityCorrection', + method: 'post', + data: data + }) +} + +// 修改胎次校正 +export function updateParityCorrection(data) { + return request({ + url: '/parityCorrection/parityCorrection', + method: 'put', + data: data + }) +} + +// 删除胎次校正 +export function delParityCorrection(id) { + return request({ + url: '/parityCorrection/parityCorrection/' + id, + method: 'delete' + }) +} diff --git a/src/api/feed/FeedStatistic.js b/src/api/feed/FeedStatistic.js new file mode 100644 index 0000000..9ba9f49 --- /dev/null +++ b/src/api/feed/FeedStatistic.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询饲喂量统计列表 +export function listFeedStatistic(query) { + return request({ + url: '/feed/FeedStatistic/list', + method: 'get', + params: query + }) +} + +// 查询饲喂量统计详细 +export function getFeedStatistic(id) { + return request({ + url: '/feed/FeedStatistic/' + id, + method: 'get' + }) +} + +// 新增饲喂量统计 +export function addFeedStatistic(data) { + return request({ + url: '/feed/FeedStatistic', + method: 'post', + data: data + }) +} + +// 修改饲喂量统计 +export function updateFeedStatistic(data) { + return request({ + url: '/feed/FeedStatistic', + method: 'put', + data: data + }) +} + +// 删除饲喂量统计 +export function delFeedStatistic(id) { + return request({ + url: '/feed/FeedStatistic/' + id, + method: 'delete' + }) +} + +// 查询饲喂量统计列表 +export function initFeedStatistic(query) { + return request({ + url: '/feed/FeedStatistic/init', + method: 'get', + params: query + }) +} diff --git a/src/api/sale/customer/customer.js b/src/api/sale/customer/customer.js new file mode 100644 index 0000000..3fe02fd --- /dev/null +++ b/src/api/sale/customer/customer.js @@ -0,0 +1,39 @@ +import request from '@/utils/request' + +export function listCustomer(query) { + return request({ + url: '/customer/customer/list', + method: 'get', + params: query + }) +} + +export function getCustomer(id) { + return request({ + url: '/customer/customer/' + id, + method: 'get' + }) +} + +export function addCustomer(data) { + return request({ + url: '/customer/customer', + method: 'post', + data: data + }) +} + +export function updateCustomer(data) { + return request({ + url: '/customer/customer', + method: 'put', + data: data + }) +} + +export function delCustomer(id) { + return request({ + url: '/customer/customer/' + id, + method: 'delete' + }) +} \ No newline at end of file diff --git a/src/api/sale/saleRecord/saleRecord.js b/src/api/sale/saleRecord/saleRecord.js new file mode 100644 index 0000000..5eb4513 --- /dev/null +++ b/src/api/sale/saleRecord/saleRecord.js @@ -0,0 +1,62 @@ +import request from '@/utils/request' + +// 查询羊只销售记录列表 +export function listSaleRecord(query) { + return request({ + url: '/saleRecord/saleRecord/list', + method: 'get', + params: query + }) +} + +// 查询羊只销售记录详细 +export function getSaleRecord(id) { + return request({ + url: '/saleRecord/saleRecord/' + id, + method: 'get' + }) +} + +// 新增羊只销售记录 +export function addSaleRecord(data) { + return request({ + url: '/saleRecord/saleRecord', + method: 'post', + data: data + }) +} + +// 修改羊只销售记录 +export function updateSaleRecord(data) { + return request({ + url: '/saleRecord/saleRecord', + method: 'put', + data: data + }) +} + +// 删除羊只销售记录 +export function delSaleRecord(ids) { + return request({ + url: '/saleRecord/saleRecord/' + ids, + method: 'delete' + }) +} + +// 导出羊只销售记录 +export function exportSaleRecord(query) { + return request({ + url: '/saleRecord/saleRecord/export', + method: 'post', + data: query + }) +} + +// 根据耳号查询羊只信息 +export function getSheepInfo(bsManageTags) { + return request({ + url: '/saleRecord/saleRecord/getSheepInfo', + method: 'get', + params: { bsManageTags } + }) +} diff --git a/src/views/biosafety/diagnosis/add.vue b/src/views/biosafety/diagnosis/add.vue index 8842d69..c9a1c0e 100644 --- a/src/views/biosafety/diagnosis/add.vue +++ b/src/views/biosafety/diagnosis/add.vue @@ -95,13 +95,13 @@ - - + - + @@ -25,8 +25,7 @@ - 新增 + 新增 删除 - + - - + + - + + + - - @@ -433,7 +446,7 @@ import { useRouter } from 'vue-router' const router = useRouter() const { proxy } = getCurrentInstance() -const { sheep_gender,diag_result } = proxy.useDict("sheep_gender","diag_result") +const { sheep_gender, diag_result, treat_status } = proxy.useDict("sheep_gender", "diag_result", "treat_status") /* ---------- 列表区域 ---------- */ @@ -477,6 +490,7 @@ const addForm = reactive({ diseasePid: null, diseaseId: null, veterinarian: '', + stats: '', comment: '' }) @@ -494,6 +508,7 @@ const editForm = reactive({ sheepType: '', monthAge: '', gender: '', + status: '', parity: '', breed: '', lactDay: '', @@ -507,7 +522,7 @@ const rules = { } const swPresDetailList = ref([ - { mediId: null, dosage: 0, unit: null, usageId: null, usetime: new Date().toISOString().slice(0, 10),manufacturer: '', batchNumber: '' } + { mediId: null, dosage: 0, unit: null, usageId: null, usetime: new Date().toISOString().slice(0, 10), manufacturer: '', batchNumber: '' } ]) /* ---------- 新增诊疗 ---------- */ @@ -515,7 +530,8 @@ const diagnosisDialog = ref(false) const selectedSheepNos = ref([]) const addDia = reactive({ sheepfoldId: null, - result:null, + result: null, + datetime: new Date().toISOString().slice(0, 10) }) @@ -533,8 +549,9 @@ function handleAddDiagnosis() { function submitDiagnosis() { const data = { treatIds: ids.value, - result:addDia.result, - sheepfoldId:addDia.sheepfoldId + result: addDia.result, + datetime: addDia.datetime, + sheepfoldId: addDia.sheepfoldId } request.post('/diagnosis/diagnosis/adds', data).then(() => { proxy.$modal.msgSuccess('诊疗成功') @@ -592,7 +609,7 @@ function handleAddSwPresDetail() { dosage: 0, unit: null, usageId: null, - usetime:new Date().toISOString().slice(0, 10), + usetime: new Date().toISOString().slice(0, 10), manufacturer: '', batchNumber: '' }) @@ -669,6 +686,7 @@ function handleUpdate(row) { gender: res.data.gender, parity: res.data.parity, breed: res.data.breed, + status: res.data.status, lactDay: res.data.lactDay, gestDay: res.data.gestDay }) @@ -770,4 +788,3 @@ onMounted(() => { }) }) - diff --git a/src/views/biosafety/usageInfo/index.vue b/src/views/biosafety/usageInfo/index.vue index f82c41e..d5167d6 100644 --- a/src/views/biosafety/usageInfo/index.vue +++ b/src/views/biosafety/usageInfo/index.vue @@ -202,6 +202,11 @@ + + + diff --git a/src/views/dairyProducts/dryMatterCorrection/index.vue b/src/views/dairyProducts/dryMatterCorrection/index.vue index 8d2e6f3..b689612 100644 --- a/src/views/dairyProducts/dryMatterCorrection/index.vue +++ b/src/views/dairyProducts/dryMatterCorrection/index.vue @@ -1,5 +1,6 @@ - - \ No newline at end of file + +// 表单重置 +function reset() { + form.value = { + id: null, + parity: null, + coef: null + } + proxy.resetForm("parityCorrectionRef") +} + +/** 搜索按钮操作 */ +function handleQuery() { + queryParams.value.pageNum = 1 + getList() +} + +/** 重置按钮操作 */ +function resetQuery() { + proxy.resetForm("queryRef") + handleQuery() +} + +// 多选框选中数据 +function handleSelectionChange(selection) { + ids.value = selection.map(item => item.id) + single.value = selection.length != 1 + multiple.value = !selection.length +} + +/** 新增按钮操作 */ +function handleAdd() { + reset() + open.value = true + title.value = "添加胎次校正" +} + +/** 修改按钮操作 */ +function handleUpdate(row) { + reset() + const _id = row.id || ids.value + getParityCorrection(_id).then(response => { + form.value = response.data + open.value = true + title.value = "修改胎次校正" + }) +} + +/** 提交按钮 */ +function submitForm() { + proxy.$refs["parityCorrectionRef"].validate(valid => { + if (valid) { + if (form.value.id != null) { + updateParityCorrection(form.value).then(() => { + proxy.$modal.msgSuccess("修改成功") + open.value = false + getList() + }) + } else { + addParityCorrection(form.value).then(() => { + proxy.$modal.msgSuccess("新增成功") + open.value = false + getList() + }) + } + } + }) +} + +/** 删除按钮操作 */ +function handleDelete(row) { + const _ids = row.id || ids.value + proxy.$modal.confirm('是否确认删除胎次校正编号为"' + _ids + '"的数据项?').then(function() { + return delParityCorrection(_ids) + }).then(() => { + getList() + proxy.$modal.msgSuccess("删除成功") + }).catch(() => {}) +} + +getList() + diff --git a/src/views/dairyProducts/weightCorrection/index.vue b/src/views/dairyProducts/weightCorrection/index.vue index 94737ef..b46fba1 100644 --- a/src/views/dairyProducts/weightCorrection/index.vue +++ b/src/views/dairyProducts/weightCorrection/index.vue @@ -83,7 +83,7 @@ @@ -245,25 +245,31 @@ function handleUpdate(row) { }) } -/** 提交按钮 */ +/* 提交按钮 */ function submitForm() { proxy.$refs["weightCorrectionRef"].validate(valid => { if (valid) { // 确保数值类型正确 form.value.actual = parseFloat(form.value.actual) - form.value.systemMilk = parseFloat(form.value.systemMilk) // 修改这里 + form.value.systemMilk = parseFloat(form.value.systemMilk) if (form.value.id != null) { updateWeightCorrection(form.value).then(response => { proxy.$modal.msgSuccess("修改成功") open.value = false getList() + }).catch(error => { + // 捕获后端返回的错误信息并显示 + proxy.$modal.msgError(error.response.data.msg || "修改失败") }) } else { addWeightCorrection(form.value).then(response => { proxy.$modal.msgSuccess("新增成功") open.value = false getList() + }).catch(error => { + // 捕获后端返回的错误信息并显示 + proxy.$modal.msgError(error.response.data.msg || "新增失败") }) } } diff --git a/src/views/feed/FeedList/index.vue b/src/views/feed/FeedList/index.vue index 5b1f464..0af5624 100644 --- a/src/views/feed/FeedList/index.vue +++ b/src/views/feed/FeedList/index.vue @@ -43,6 +43,12 @@ + + +