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/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/Breeding_records/Breeding_records/index.vue b/src/views/Breeding_records/Breeding_records/index.vue index 10dfb79..7ca9f3e 100644 --- a/src/views/Breeding_records/Breeding_records/index.vue +++ b/src/views/Breeding_records/Breeding_records/index.vue @@ -124,9 +124,29 @@ - + - + + + + + - - - - 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/drymilk/drymilk/index.vue b/src/views/drymilk/drymilk/index.vue index 004f40b..419b816 100644 --- a/src/views/drymilk/drymilk/index.vue +++ b/src/views/drymilk/drymilk/index.vue @@ -99,14 +99,15 @@ - - - - + + + + + - - - @@ -244,9 +245,17 @@ \ No newline at end of file diff --git a/src/views/sale/saleRecord/saleRecord/index.vue b/src/views/sale/saleRecord/saleRecord/index.vue new file mode 100644 index 0000000..666ddc9 --- /dev/null +++ b/src/views/sale/saleRecord/saleRecord/index.vue @@ -0,0 +1,935 @@ + + + + + diff --git a/src/views/sheep_death/death/index.vue b/src/views/sheep_death/death/index.vue index ff55851..e212dd4 100644 --- a/src/views/sheep_death/death/index.vue +++ b/src/views/sheep_death/death/index.vue @@ -70,7 +70,8 @@ icon="Plus" @click="handleAdd" v-hasPermi="['sheep_death:death:add']" - >新增 + >新增 + 修改 + >修改 + 删除 + >删除 + 导出 + >导出 + - - - - - - + + + - + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + @@ -183,17 +192,15 @@ - - - + - + @@ -202,14 +209,14 @@ - - + + - + @@ -217,12 +224,12 @@ - + - + @@ -230,7 +237,7 @@ - +