From 374c2948364b890265396a520fec56eee96ee54a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E6=B0=B8=E8=B6=85?= <2090205686@qq.com> Date: Wed, 18 Jun 2025 17:14:15 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=8A=95=E5=85=A5=E5=93=81=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20-=20=E5=86=9C=E8=8D=AF=E4=BD=BF=E7=94=A8=E7=9B=91?= =?UTF-8?q?=E7=AE=A1=E9=A1=B5=E9=9D=A2=E5=B1=95=E7=A4=BA=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=BC=80=E5=8F=91=EF=BC=8C=E8=A1=A8=E6=A0=BC=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/apis/inputSuppliesApi/material.js | 2 +- .../src/components/tableComponent.vue | 330 ++++++++ sub-government-affairs-service/src/main.js | 1 + .../src/styles/custom.scss | 319 +++++++ .../material/pesticide/index.vue | 794 +++++------------- .../material/pesticide/index原.vue | 624 ++++++++++++++ 6 files changed, 1471 insertions(+), 599 deletions(-) create mode 100644 sub-government-affairs-service/src/components/tableComponent.vue create mode 100644 sub-government-affairs-service/src/styles/custom.scss create mode 100644 sub-government-affairs-service/src/views/inputSuppliesManage/material/pesticide/index原.vue diff --git a/sub-government-affairs-service/src/apis/inputSuppliesApi/material.js b/sub-government-affairs-service/src/apis/inputSuppliesApi/material.js index 71f0e72..979f53b 100644 --- a/sub-government-affairs-service/src/apis/inputSuppliesApi/material.js +++ b/sub-government-affairs-service/src/apis/inputSuppliesApi/material.js @@ -11,7 +11,7 @@ export function getMaterailTypes(params) { /* 获取农药列表 */ export function getPesticideList(params) { - return request('/inputGoods/pesticide/page', { + return request('/inputGoods/supervise/pesticide/page', { params, }); } diff --git a/sub-government-affairs-service/src/components/tableComponent.vue b/sub-government-affairs-service/src/components/tableComponent.vue new file mode 100644 index 0000000..8224a19 --- /dev/null +++ b/sub-government-affairs-service/src/components/tableComponent.vue @@ -0,0 +1,330 @@ + + + + + + + + + + + + + + + {{ (currentPage - 1) * pageSize + $index + 1 }} + + + + + + + + + + + + + + + + + + + + + + diff --git a/sub-government-affairs-service/src/main.js b/sub-government-affairs-service/src/main.js index 1228094..b3afedf 100644 --- a/sub-government-affairs-service/src/main.js +++ b/sub-government-affairs-service/src/main.js @@ -8,6 +8,7 @@ import 'element-plus/dist/index.css'; import Avue from '@smallwei/avue'; import '@smallwei/avue/lib/index.css'; import './utils/permission'; +import './styles/custom.scss'; import { registerDirective } from './directives'; import { registerGlobalComponents } from './plugins/globalComponents'; import { registerElIcons } from './plugins/icon'; diff --git a/sub-government-affairs-service/src/styles/custom.scss b/sub-government-affairs-service/src/styles/custom.scss new file mode 100644 index 0000000..5668ff8 --- /dev/null +++ b/sub-government-affairs-service/src/styles/custom.scss @@ -0,0 +1,319 @@ +.app-container { + .container-custom { + width: 100%; + overflow: hidden; /* 防止全局滚动条 */ + border-radius: 10px; + background: #fff; + + .search-box { + overflow: hidden; + padding: 16px 8px 0 16px; + background: #fff; + .order-tab { + width: 100%; + .el-tabs__nav-wrap::after { + background: transparent !important; + } + .el-tabs__active-bar { + height: 3px !important; + border-radius: 4px; + } + .el-descriptions__label, + .el-descriptions__content { + font-size: 16px !important; + } + .cell-item { + display: inline-flex; + } + .el-descriptions__label { + color: #999; + } + .el-descriptions__content { + color: #333; + } + } + } + .search-bar { + display: flex; + flex-shrink: 0; /* 禁止收缩 */ + + .search-bar-left { + flex: 1; + } + + .search-bar-right { + width: 100px; + text-align: right; + padding-right: 8px; + } + + .demo-form-inline { + text-align: left; + } + + .el-form--inline .el-form-item { + margin-right: 30px; + } + + .demo-form-inline .el-input { + --el-input-width: 160px; + } + + .demo-form-inline .el-select { + --el-select-width: 160px; + } + + .demo-form-inline .el-date-picker { + --el-select-width: 160px; + } + .el-form .el-form-item__label { + font-weight: 400; + } + .custom-form-inline .el-input { + width: 260px; + } + } + .table-toolbar { + text-align: left; + padding-left: 20px; + padding-top: 20px; + background-color: #fff; + } + .table-cont { + padding: 10px 20px; + overflow: hidden; + background-color: #fff; + position: relative; + .el-table__empty-text { + width: 200px; + } + .el-button-custom{ + font-size: 14px !important; + color: #25bf82; + padding: 0; + } + .el-button-delete{ + font-size: 14px !important; + color: #ff4d4f; + padding: 0; + } + } + + /* 自定义弹窗样式 */ + .traceability-dialog { + background: transparent; + box-shadow: none; + border-radius: 16px !important; + } + + /* 主要内容区域 */ + .dialog-content { + display: flex; + flex-direction: column; + align-items: center; + background: white; + border-radius: 8px; + padding: 0 0 20px 0; + box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); + } + + /* 产品信息 */ + .product-info { + width: 100%; + display: flex; + justify-content: space-between; + margin-bottom: 20px; + font-size: 14px; + color: #666; + } + + .product-name { + font-weight: bold; + color: #333; + } + + /* 二维码图片 */ + .qrcode-image { + width: 200px; + height: 200px; + margin: 0 auto; + } + + /* 下载区域 */ + .download-section { + display: flex; + align-items: center; + margin: 0 0 10px 0; + color: #25bf82; + cursor: pointer; + font-size: 12px; + line-height: 18px; + } + + .download-icon { + margin-left: 8px; + font-size: 16px; + } + + /* 遗传编码区域 */ + .code-section { + display: flex; + align-items: center; + margin: 10px 0; + background: rgba(37, 191, 130, 0.1); + border-radius: 4px; + } + + .genetic-code { + font-family: monospace; + font-size: 14px; + color: #25bf82; + display: inline-block; + max-width: 250px; + padding: 0 10px; + } + + .copy-icon { + margin-left: 10px; + color: #409eff; + cursor: pointer; + font-size: 16px; + } + + /* 关闭按钮 */ + .close-button { + position: absolute; + left: 50%; + transform: translateX(-50%); + bottom: -60px; + color: white; + font-size: 30px; + cursor: pointer; + transition: all 0.3s; + } + } + // 表格中文本的颜色 + .color-blue { + color: #3685fe; + } + .color-black { + color: #000000; + } + .color-gray { + color: #5a5a5a; + } + .color-orange { + color: #ffb345; + } + .color-green { + color: #25bf82; + } + .color-red { + color: #ff4348; + } +} +.el-button { + font-size: 12px !important; + font-weight: 400; +} +// 页面添加的自定义容器,上下撑满 +.customer-control { + position: absolute; + height: 100%; + left: 0; + right: 0; + min-width: 1000px; +} +// 表格组件中的各插槽元素自定义样式 +.custom-tooltip-content { + display: flex; + justify-content: space-between; + gap: 10px; + padding: 3px 0; + +} +.el-icon-custom { + vertical-align: middle; + cursor: pointer; + font-size: 16px; + // color: #fff; +} +.table-cell-img-box { + width: 60px; + height: 60px; + text-align: center; + overflow: hidden; /* 隐藏超出部分 */ + display: flex; /* 使用 Flex 布局居中 */ + justify-content: center; + align-items: center; + .table-cell-img { + min-width: 100%; /* 至少撑满宽度 */ + min-height: 100%; /* 至少撑满高度 */ + object-fit: cover; /* 保持比例并覆盖容器 */ + } +} + +// 新增商品页面-开始 +.customer-box { + height: 100%; + border-radius: 16px; + padding: 20px 16px; + overflow-y: auto; + background-color: #fff; + .my-el-select { + width: 200px; + } + .el-input-number .el-input__inner { + text-align: left; + } + // 商品属性 + .attr-item { + display: inline-block; + margin-right: 10px; + .el-icon { + vertical-align: middle; + margin: 5px; + } + } + .attr-row { + display: flex; + flex-direction: row; + justify-content: flex-start; + flex-wrap: nowrap; + gap: 10px; + margin-bottom: 10px; + } + .attr-input { + width: 120px; + } + .attr-clomn { + width: 160px; + } + .attr-clomn200 { + width: 160px; + } + .attr-clomn220 { + width: 220px; + } + .attr-box { + padding: 16px 16px 6px 16px; + border-radius: 6px; + border: 1px solid #999; + } +} +// 新增商品页面-结束 + +.flex-left-top { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: flex-start; +} + +// 溢出隐藏 +.text-ellipsis { + width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} \ No newline at end of file diff --git a/sub-government-affairs-service/src/views/inputSuppliesManage/material/pesticide/index.vue b/sub-government-affairs-service/src/views/inputSuppliesManage/material/pesticide/index.vue index 2f6df0b..5b1888d 100644 --- a/sub-government-affairs-service/src/views/inputSuppliesManage/material/pesticide/index.vue +++ b/sub-government-affairs-service/src/views/inputSuppliesManage/material/pesticide/index.vue @@ -1,617 +1,215 @@ - - 农药基本信息 - - - { - getData(1); - done(); - } - " - @search-reset="getData(1)" - @refresh-change="getData" - @current-change="getData" - @size-change="getData(1)" - @row-save="handleRowSave" - @row-update="handleRowUpdate" - > - - + + + + + + + + + + + + + + 查询 + 重置 + + + + + + + 新增 + + + + + + 详情 + 编辑 + 删除 + + + + + + + + + + + + + - - - - - - 查看报告 - - - - - - - - {{ value }} - - - - {{ value }} - - - - 关闭 - - - - + + - - + diff --git a/sub-government-affairs-service/src/views/inputSuppliesManage/material/pesticide/index原.vue b/sub-government-affairs-service/src/views/inputSuppliesManage/material/pesticide/index原.vue new file mode 100644 index 0000000..e680321 --- /dev/null +++ b/sub-government-affairs-service/src/views/inputSuppliesManage/material/pesticide/index原.vue @@ -0,0 +1,624 @@ + + + 农药使用监管 + + + { + getData(1); + done(); + } + " + @search-reset="getData(1)" + @refresh-change="getData" + @current-change="getData" + @size-change="getData(1)" + @row-save="handleRowSave" + @row-update="handleRowUpdate" + > + + + + + + + + + 查看报告 + + + + + + + + {{ value }} + + + + {{ value }} + + + + 关闭 + + + + + + + + + From c2501411a047984926c23ef4235865492bbb87c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E6=B0=B8=E8=B6=85?= <2090205686@qq.com> Date: Thu, 19 Jun 2025 17:22:26 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=8A=95=E5=85=A5=E5=93=81=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20-=20=E5=86=9C=E8=8D=AF=E4=BD=BF=E7=94=A8=E7=9B=91?= =?UTF-8?q?=E7=AE=A1=E5=A2=9E=E5=88=A0=E6=94=B9=E6=9F=A5=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/apis/inputSuppliesApi/material.js | 16 +- .../src/components/FileUploader/index.vue | 5 + .../src/styles/custom.scss | 29 ++ .../material/pesticide/index.vue | 356 +++++++++++++++--- 4 files changed, 355 insertions(+), 51 deletions(-) diff --git a/sub-government-affairs-service/src/apis/inputSuppliesApi/material.js b/sub-government-affairs-service/src/apis/inputSuppliesApi/material.js index 979f53b..73eea46 100644 --- a/sub-government-affairs-service/src/apis/inputSuppliesApi/material.js +++ b/sub-government-affairs-service/src/apis/inputSuppliesApi/material.js @@ -17,21 +17,29 @@ export function getPesticideList(params) { } /* 新增农药 */ export function addPesticide(data) { - return request('/inputGoods/pesticide/save', { + return request('/inputGoods/supervise/pesticide/save', { method: 'POST', data, }); } -/* 农药检测报告 */ +/* 编辑农药 */ export function pesticideReportSave(data) { - return request('/inputGoods/pesticide/uploadReport', { + return request('/inputGoods/supervise/pesticide/edit', { data, method: 'PUT', }); } /* 删除农药 */ export function delPesticide(ids) { - return request(`/inputGoods/pesticide/delete/${ids}`); + return request(`/inputGoods/supervise/pesticide/delete/${ids}`); +} +/* 获取用药地块下拉选项 */ +export function getLandList() { + return request(`/inputGoods/supervise/pesticide/getLandList`); +} +/* 获取农药用药下拉选项 */ +export function getPesticideSelectList() { + return request(`/inputGoods/pesticide/getPesticideList`); } // #endregion diff --git a/sub-government-affairs-service/src/components/FileUploader/index.vue b/sub-government-affairs-service/src/components/FileUploader/index.vue index 808d766..62afe0c 100644 --- a/sub-government-affairs-service/src/components/FileUploader/index.vue +++ b/sub-government-affairs-service/src/components/FileUploader/index.vue @@ -2,6 +2,7 @@ diff --git a/sub-government-affairs-service/src/styles/custom.scss b/sub-government-affairs-service/src/styles/custom.scss index 5668ff8..4c81671 100644 --- a/sub-government-affairs-service/src/styles/custom.scss +++ b/sub-government-affairs-service/src/styles/custom.scss @@ -5,6 +5,11 @@ border-radius: 10px; background: #fff; + .custom-h2 { + margin: 14px 0 0 20px; + font-size: 24px; + } + .search-box { overflow: hidden; padding: 16px 8px 0 16px; @@ -303,6 +308,7 @@ } // 新增商品页面-结束 +// 弹性布局-左对齐-上对齐 .flex-left-top { display: flex; flex-direction: row; @@ -316,4 +322,27 @@ overflow: hidden; white-space: nowrap; text-overflow: ellipsis; +} + +// 弹窗表单样式-子元素一行2个列 +.dialog-form-container { + .dialog-form-title { + font-weight: bold; + margin-bottom: 20px; + } + .dialog-form-item{ + margin-right: 20px; + .el-input, + .el-select { + width: 230px; + } + } + .dialog-form-many { + position: relative; + .dialog-form-many-delete { + position: absolute; + top: 28px; + right: 0; + } + } } \ No newline at end of file diff --git a/sub-government-affairs-service/src/views/inputSuppliesManage/material/pesticide/index.vue b/sub-government-affairs-service/src/views/inputSuppliesManage/material/pesticide/index.vue index 5b1888d..cc955d8 100644 --- a/sub-government-affairs-service/src/views/inputSuppliesManage/material/pesticide/index.vue +++ b/sub-government-affairs-service/src/views/inputSuppliesManage/material/pesticide/index.vue @@ -1,6 +1,7 @@ + 农药使用监管 @@ -20,7 +21,7 @@ - 新增 + 新增 - - - - - + + + 农药用药详情 + + + + + + + + + + + + 土地残留检测 + + + + + + + + + + + + + + + + + + + + + + + + 农药用药信息 + 添加用药信息 + + + + + + + + + + + + + + + + + + + + + + + + 删除 + + @@ -61,11 +164,14 @@ - + From 9f6847a1a0eca6a4a57ad5c3dac5079b6adc7d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E6=B0=B8=E8=B6=85?= <2090205686@qq.com> Date: Fri, 20 Jun 2025 17:34:31 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=20=E6=8A=95=E5=85=A5=E5=93=81=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20-=20=E7=A7=8D=E5=AD=90=E7=A7=8D=E8=8B=97=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2=E5=B1=95=E7=A4=BA=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/tableComponent.vue | 15 +- .../material/seed/index.vue | 626 +++++++++++------- .../material/seed/index原.vue | 263 ++++++++ 3 files changed, 659 insertions(+), 245 deletions(-) create mode 100644 sub-government-affairs-service/src/views/inputSuppliesManage/material/seed/index原.vue diff --git a/sub-government-affairs-service/src/components/tableComponent.vue b/sub-government-affairs-service/src/components/tableComponent.vue index 8224a19..bebcf19 100644 --- a/sub-government-affairs-service/src/components/tableComponent.vue +++ b/sub-government-affairs-service/src/components/tableComponent.vue @@ -1,9 +1,9 @@ - - - + + + - - + + {{ (currentPage - 1) * pageSize + $index + 1 }} @@ -299,8 +299,9 @@ onBeforeUnmount(() => { /* 自定义表头样式 */ :deep(.custom-header) { color: #333; + background-color: #fafafa !important; } - /* 自定义表头样式 */ + /* 自定义单元格样式 */ :deep(.custom-cell) { color: #606266; } diff --git a/sub-government-affairs-service/src/views/inputSuppliesManage/material/seed/index.vue b/sub-government-affairs-service/src/views/inputSuppliesManage/material/seed/index.vue index 5ad332f..74b710f 100644 --- a/sub-government-affairs-service/src/views/inputSuppliesManage/material/seed/index.vue +++ b/sub-government-affairs-service/src/views/inputSuppliesManage/material/seed/index.vue @@ -1,263 +1,413 @@ - - 种子基本信息 - - - { - getData(1); - done(); - } - " - @search-reset="getData(1)" - @refresh-change="getData" - @current-change="getData" - @size-change="getData(1)" - @row-save="handleRowSave" - > - - 详情 - 删除 + + + 种子种苗管理 + + + + + + + + + + + + + + 查询 + 重置 + + + + + + + 新增 + + + + + + 查看 + 编辑 + 删除 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + +}; +const cancelDialog = async () => { + restDialogForm(); + dialogFormVisible.value = false; +}; +const restDialogForm = () => { + Object.assign(dialogForm, { + id: '', + seedName: '', //种子种苗名称 + varietyName: '', //品种名称 + brand: '', //品牌 + manufacturer: '', //生产厂家 + classifyId: '', //蔬菜种苗id + classifyName: '', //蔬菜种苗名称 + productSpecification: '', //产品规格(number) + productUnit: '', //产品规格单位 + productAttributes: '', //自定义商品属性 + photoUrl: '', //种子种苗主图 + photoUrlDetail: '', //种子种苗详情图 + }); +}; +const seedTypeList = ref([]); +const seedTypeDialogList = ref([]); +const getSeedTypeList = async () => { + try { + let response = await getMaterailTypes({ moduleType: '4' }); + console.log(response); + if (response.code == 200) { + if (response.data?.length > 0) { + seedTypeDialogList.value = response.data[0].children; + let result = extractThirdLevelChildren(response.data); + seedTypeList.value = result; + console.log(seedTypeDialogList.value); + } + } + } catch (error) { + console.error(error); + } +}; +// 级联选择器配置 +const cascaderProps = ref({ + label: 'dataName', // 选项标签字段名 + value: 'id', // 选项值字段名 + children: 'children', // 子选项字段名 + emitPath: true, + expandTrigger: 'hover', +}); +const handleCascaderChange = () => { + const selectedNames = getSelectedNames(dialogForm.classifyId); + console.log('对应的名称:', selectedNames); // 例如: ['花草类种子', '具体种子名称'] + // 如果需要,可以将名称也保存到表单数据中 + dialogForm.classifyName = selectedNames; +}; +const getSelectedNames = (ids) => { + if (!ids || !ids.length) return []; + + let names = []; + let currentLevel = seedTypeDialogList.value; + + for (const id of ids) { + const foundItem = currentLevel.find((item) => item.id === id); + if (!foundItem) break; + + names.push(foundItem.dataName); + currentLevel = foundItem.children || []; + } + + return names; +}; + +onMounted(() => { + onSubmit(); + getSeedTypeList(); +}); + diff --git a/sub-government-affairs-service/src/views/inputSuppliesManage/material/seed/index原.vue b/sub-government-affairs-service/src/views/inputSuppliesManage/material/seed/index原.vue new file mode 100644 index 0000000..5ad332f --- /dev/null +++ b/sub-government-affairs-service/src/views/inputSuppliesManage/material/seed/index原.vue @@ -0,0 +1,263 @@ + + + 种子基本信息 + + + { + getData(1); + done(); + } + " + @search-reset="getData(1)" + @refresh-change="getData" + @current-change="getData" + @size-change="getData(1)" + @row-save="handleRowSave" + > + + 详情 + 删除 + + + + + + + + +