tag20250616-master

This commit is contained in:
沈鸿 2025-06-16 13:31:47 +08:00
parent f05f06133d
commit 5af0f0aefe
7 changed files with 498 additions and 37 deletions

View File

@ -14,7 +14,6 @@ import productOperateMainRoutes from './modules/productOperateMain';
import inputSuppliesRoutes from './modules/inputSupplies'; import inputSuppliesRoutes from './modules/inputSupplies';
import plantingAndBreedingRouter from './modules/plantingAndBreeding'; import plantingAndBreedingRouter from './modules/plantingAndBreeding';
import systemRouter from './modules/system'; import systemRouter from './modules/system';
import produceGoods from './modules/produceGoods';
export const constantRoutes = [ export const constantRoutes = [
{ {
@ -47,7 +46,21 @@ export const constantRoutes = [
...resourceRouter, ...resourceRouter,
...productOperateMainRoutes, ...productOperateMainRoutes,
...inputSuppliesRoutes, ...inputSuppliesRoutes,
// produceGoods, {
path: '/sub-government-affairs-service/output-products',
name: 'outputProducts',
component: Layout,
redirect: '/sub-government-affairs-service/output-products/index',
meta: { title: '产出品管理', icon: 'Box' },
children: [
{
path: '/sub-government-affairs-service/output-products/index',
component: () => import('@/views/outputProductsManage/index.vue'),
name: 'outputProductsIndex',
meta: { title: '产出品管理', icon: 'List' },
},
],
},
// ...plantingAndBreedingRouter, // ...plantingAndBreedingRouter,
...traceRouter, ...traceRouter,
// ...systemRouter, // ...systemRouter,

View File

@ -37,7 +37,7 @@ const inputSuppliesRoutes = [
path: '/sub-government-affairs-service/material/others', path: '/sub-government-affairs-service/material/others',
name: 'input-supplies-others', name: 'input-supplies-others',
component: () => import('@/views/inputSuppliesManage/material/others/index.vue'), component: () => import('@/views/inputSuppliesManage/material/others/index.vue'),
meta: { title: '其他投入品', icon: 'TakeawayBox' }, meta: { title: '其他投入品管理', icon: 'TakeawayBox' },
}, },
], ],
}, },

View File

@ -1,24 +0,0 @@
import Layout from '@/layouts/index.vue';
export default {
path: '/sub-government-affairs-service/produceGoodsMain',
name: 'produceGoodsMain',
component: Layout,
redirect: '/sub-government-affairs-service/produceGoods',
meta: { title: '产出品', icon: 'Document' },
children: [
// {
// path: '/sub-government-affairs-service/produceGoods',
// name: 'produceGoods',
// component: () => import('@/views/produceGoods/list/index.vue'),
// meta: { title: '产出品列表', icon: 'Document' },
// },
// {
// path: '/sub-government-affairs-service/produceGoods1',
// name: 'produceGoods1',
// component: () => import('@/views/produceGoods/test/index.vue'),
// meta: { title: '投入品监管平台', icon: 'Document' },
// },
],
};
// export default produceGoodsRoutes;

View File

@ -63,6 +63,30 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<!-- 种植信息登记 -->
<div>
<p class="form-group">种植信息登记</p>
<el-form :model="plantingForm" disabled label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="备案种植作物" prop="recordedCrop">
<el-input v-model="plantingForm.recordedCrop" placeholder="请输入备案种植作物" />
</el-form-item>
<el-form-item label="实际种植作物" prop="actualCrop">
<el-input v-model="plantingForm.actualCrop" placeholder="请输入实际种植作物" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="与备案相符" prop="isCropMatch">
<el-radio-group v-model="plantingForm.isCropMatch">
<el-radio value="1"></el-radio>
<el-radio value="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<!-- 巡查信息登记只有进行过结果登记的才显示 --> <!-- 巡查信息登记只有进行过结果登记的才显示 -->
<template v-if="dialogTitle !== '查看' && dialogTitle !== '详情' && dialogTitle !== '新增' && dialogTitle !== '编辑'"> <template v-if="dialogTitle !== '查看' && dialogTitle !== '详情' && dialogTitle !== '新增' && dialogTitle !== '编辑'">
<p class="form-group">巡查信息登记</p> <p class="form-group">巡查信息登记</p>
@ -218,6 +242,14 @@ const illegalForm = ref({
img: '', // img: '', //
status: '', // status: '', //
}); });
const plantingForm = ref({
id: '',
inspectionId: '', // ID
inspectionTaskName: '', //
recordedCrop: '甘蔗', //
isCropMatch: '1', //
actualCrop: '甘蔗', //
});
const illegalForms = ref([{ ...illegalForm.value }]); const illegalForms = ref([{ ...illegalForm.value }]);
const crudData = ref([]); const crudData = ref([]);
const loading = ref(false); const loading = ref(false);

View File

@ -0,0 +1,318 @@
<template>
<div class="custom-page">
<avue-crud
ref="crudRef"
v-model:page="pageData"
:data="crudData"
:option="crudOptions"
:table-loading="loading"
@refresh-change="handleRefresh"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
>
<template #search>
<div class="custom-search">
<AreaCascader v-model:region-code="searchForm.regionCode" v-model:grid-id="searchForm.id" :width="600" />
<el-button type="primary" @click="handleSearch"> 搜索 </el-button>
<el-button @click="resetSearch"> 重置 </el-button>
</div>
</template>
<!-- <template #menu-left>
<el-button type="primary" icon="Plus" @click="handleAdd">新增网格</el-button>
</template> -->
<template #menu="scope">
<custom-table-operate :actions="crudOptions.actions" :data="scope" />
</template>
</avue-crud>
<el-dialog :key="dialogTitle" v-model="visible" :title="dialogTitle" width="60%" align-center :draggable="true">
<el-form ref="form" :model="formData" :rules="rules" :disabled="isReadonly" label-width="120px" class="form-item">
<el-row :gutter="20">
<el-col :span="24"><p class="form-title">基础信息</p></el-col>
<el-col :span="12">
<el-form-item label="农产品名称" prop="productName">
<el-input v-model="formData.productName" placeholder="请输入网格名称" />
</el-form-item>
<el-form-item label="面积(亩)" prop="area">
<el-input v-model="formData.area" placeholder="请输入种植面积" />
</el-form-item>
<el-form-item label="行政区划" prop="gridAreaCode">
<AreaSelect v-model="formData.gridAreaCode" :label="null" :emit-path="false" />
</el-form-item>
<el-form-item label="联系方式" prop="contactInfo">
<el-input v-model="formData.contactInfo" placeholder="请输入联系方式" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="地块" prop="landName">
<el-input v-model="formData.landName" placeholder="请输入地块名称" />
</el-form-item>
<el-form-item label="网格" prop="gridName">
<el-input v-model="formData.gridName" placeholder="请输入网格名称" />
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input v-model="formData.name" placeholder="请输入姓名" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24"><p class="form-title">品质信息</p></el-col>
<el-col :span="12">
<el-form-item label="采收时间" prop="harvestTime">
<el-input v-model="formData.harvestTime" placeholder="请输入采收时间" />
</el-form-item>
<el-form-item label="地块总产(公斤)" prop="totalYield">
<el-input v-model="formData.totalYield" placeholder="请输入地块总产" />
</el-form-item>
<el-form-item label="价格(元/公斤)" prop="price">
<el-input v-model="formData.price" placeholder="请输入价格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="亩产(公斤)" prop="yieldPerMu">
<el-input v-model="formData.yieldPerMu" placeholder="请输入亩产" />
</el-form-item>
<el-form-item label="品质" prop="quality">
<el-input v-model="formData.quality" placeholder="请输入品质" />
</el-form-item>
<el-form-item label="产值(元)" prop="outputValue">
<el-input v-model="formData.outputValue" placeholder="请输入产值" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="handleCancel">取消</el-button>
<el-button v-if="!isReadonly" type="primary" @click="handleSubmit()"> 保存 </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup>
// ---------------------------------------------------------------------
// avue-crud
// ---------------------------------------------------------------------
import { ref, reactive, watch, onMounted, computed, nextTick } from 'vue';
import { CRUD_OPTIONS } from '@/config';
import { ElMessage, ElMessageBox } from 'element-plus';
import { useUserStore } from '@/store/modules/user';
const UserStore = useUserStore();
const user = UserStore.getUserInfo();
console.log('admin 属性:', user.admin);
const loading = ref(false);
const visible = ref(false);
const isReadonly = ref(false);
const dialogTitle = ref();
const formData = ref({
gridName: '',
gridAreaCode: '',
scope: '',
scopeImg: '',
note: '',
});
const initialFormData = { ...formData.value };
const resetForm = () => {
formData.value = { ...initialFormData };
};
const pageData = ref({
currentPage: 1,
pageSize: 10,
total: 0,
});
const searchForm = ref({
gridName: '',
keyword: '',
regionCode: '',
id: '',
status: -1,
});
const initialSearchForm = { ...searchForm.value };
const resetSearch = () => {
searchForm.value = { ...initialSearchForm };
};
//
const filterObject = (obj) => {
const newObj = {};
Object.keys(obj).forEach((key) => {
const value = obj[key];
// null undefined
if (value !== '' && value !== null && value !== undefined) {
newObj[key] = value;
}
});
return newObj;
};
const crudData = ref([]);
const crudOptions = reactive({
...CRUD_OPTIONS,
addBtn: false,
searchBtn: false,
emptyBtn: false,
height: 'calc(100vh - 340px)',
column: [
{ label: '农产品名称', prop: 'productName', width: 150 },
{ label: '地块', prop: 'landName' },
{ label: '面积(亩)', prop: 'area' },
{ label: '网格', prop: 'gridName' },
{ label: '行政区划', prop: 'gridAreaName' },
{ label: '姓名', prop: 'name' },
{ label: '联系方式', prop: 'contactInfo' },
{ label: '采收时间', prop: 'harvestTime' },
{ label: '亩产(公斤)', prop: 'yieldPerMu', width: 80 },
{ label: '地块总产(公斤)', prop: 'totalYield' },
{ label: '品质', prop: 'quality' },
{ label: '价格(元/公斤)', prop: 'price' },
{ label: '产值(元)', prop: 'outputValue' },
],
actions: [
{
name: '查看',
icon: 'view',
event: ({ row }) => handleView(row),
},
{
name: '编辑',
icon: 'edit',
event: ({ row }) => handleEdit(row),
},
{
type: 'danger',
name: '删除',
icon: 'delete',
event: ({ row }) => handleDelete(row),
},
],
});
const handleRefresh = async () => {
searchForm.value = { ...initialSearchForm };
getData();
};
const handleCurrentChange = (val) => {
pageData.value.currentPage = val;
};
const handleSizeChange = (val) => {
pageData.value.pageSize = val;
};
const handleView = (row) => {
isReadonly.value = true;
formData.value = { ...row };
dialogTitle.value = '查看网格';
visible.value = true;
};
const handleEdit = (row) => {
isReadonly.value = false;
formData.value = { ...row };
dialogTitle.value = '编辑网格';
visible.value = true;
};
const handleDelete = async (row) => {
try {
await ElMessageBox.confirm('确认删除该网格吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
});
const response = await deleteGrid(row.id);
ElMessage.success('删除成功');
getData();
} catch (error) {
if (error === 'cancel') {
ElMessage.info('已取消删除');
} else {
ElMessage.error('删除失败');
console.error('删除异常:', error);
}
}
};
const handleSubmit = async () => {
console.log('提交表单:', formData.value);
try {
if (dialogTitle.value === '新增网格') {
await createGrid(formData.value);
ElMessage.success('新增成功');
resetForm();
visible.value = false;
getData();
} else {
await updateGrid(formData.value);
ElMessage.success('更新成功');
resetForm();
visible.value = false;
getData();
}
} catch (error) {
ElMessage.error(error.message || '新增失败,请重试');
}
};
// ---------------------------------------------------------------------
//
// ---------------------------------------------------------------------
import { createGrid, updateGrid, deleteGrid, fetchGridList, getGridDetail, exportGrid } from '@/apis/landResourceManagement/gridManagement';
import { mockData } from './output';
onMounted(() => {
getData();
});
const getData = async () => {
// const filteredParams = filterObject(searchForm.value);
// const response = await fetchGridList(filteredParams);
// crudData.value = Array.isArray(response.data.records) ? response.data.records : [];
await new Promise((resolve) => setTimeout(resolve, 300));
crudData.value = mockData;
pageData.value.total = crudData.value.length;
};
const handleAdd = () => {
console.log('handleAdd');
resetForm();
isReadonly.value = false;
dialogTitle.value = '新增网格';
visible.value = true;
};
const handleSearch = () => {
getData();
};
const handleCancel = () => {
visible.value = false;
};
</script>
<style scoped lang="scss">
:deep(.el-dialog__body) {
padding: 20px;
height: calc(100vh - 300px);
overflow-y: auto;
}
.form-title {
font-size: 16px;
font-weight: 500;
margin: 30px 0;
color: #333333;
}
.form-item {
margin: 0 auto;
}
.dialog-footer {
text-align: center;
}
.custom-search {
display: flex;
align-items: center;
margin-bottom: 16px;
.el-button {
margin-left: 12px;
}
}
</style>

View File

@ -0,0 +1,122 @@
export const mockData = [
{
productName: '甘蔗',
landName: '勐撒坝子南片',
area: 28,
gridName: '勐撒村第三网格',
gridAreaName: '耿马县勐撒镇勐撒村',
name: '岩温罕',
contactInfo: '183****8823',
harvestTime: '2023-12-15',
yieldPerMu: 5800,
totalYield: 162400,
quality: '优等',
price: 0.48,
outputValue: 77952,
},
{
productName: '茶叶(普洱生茶)',
landName: '芒洪古茶山',
area: 6.5,
gridName: '芒洪村第一网格',
gridAreaName: '耿马县芒洪拉祜族布朗族乡',
name: '李秀兰',
contactInfo: '138****4671',
harvestTime: '2023-04-08',
yieldPerMu: 210,
totalYield: 1365,
quality: '特级',
price: 85,
outputValue: 116025,
},
{
productName: '澳洲坚果',
landName: '四排山基地',
area: 35,
gridName: '翁达村第五网格',
gridAreaName: '耿马县四排山乡翁达村',
name: '赵卫东',
contactInfo: '159****3098',
harvestTime: '2023-09-20',
yieldPerMu: 320,
totalYield: 11200,
quality: '良好',
price: 18.5,
outputValue: 207200,
},
{
productName: '橡胶',
landName: '河外胶林',
area: 42,
gridName: '河外村第二网格',
gridAreaName: '耿马县孟定镇河外村',
name: '叶嘎',
contactInfo: '187****5546',
harvestTime: '2023-11-01',
yieldPerMu: 95,
totalYield: 3990,
quality: '中等',
price: 10.2,
outputValue: 40698,
},
{
productName: '咖啡(阿拉比卡)',
landName: '福荣坡地',
area: 15,
gridName: '福荣村第四网格',
gridAreaName: '耿马县勐永镇福荣村',
name: '艾叶',
contactInfo: '152****7720',
harvestTime: '2023-02-18',
yieldPerMu: 280,
totalYield: 4200,
quality: '优等',
price: 26.8,
outputValue: 112560,
},
{
productName: '火龙果(红心)',
landName: '允捧大棚区',
area: 8,
gridName: '允捧村第一网格',
gridAreaName: '耿马县孟定镇允捧村',
name: '玉罕香',
contactInfo: '135****9924',
harvestTime: '2023-07-12',
yieldPerMu: 1800,
totalYield: 14400,
quality: '特级',
price: 7.5,
outputValue: 108000,
},
{
productName: '香蕉(威廉斯)',
landName: '班幸河谷',
area: 20,
gridName: '班幸村第四网格',
gridAreaName: '耿马县孟定镇班幸村',
name: '岩峰',
contactInfo: '158****3367',
harvestTime: '2023-06-30',
yieldPerMu: 3200,
totalYield: 64000,
quality: '良好',
price: 3.1,
outputValue: 198400,
},
{
productName: '砂仁(中药材)',
landName: '大浪坝林下',
area: 18,
gridName: '大浪坝村第三网格',
gridAreaName: '耿马县勐简乡大浪坝村',
name: '田志强',
contactInfo: '139****7189',
harvestTime: '2023-09-08',
yieldPerMu: 65,
totalYield: 1170,
quality: '中等',
price: 42,
outputValue: 49140,
},
];

View File

@ -5,7 +5,7 @@ export const mockData = [
area: 8.72, area: 8.72,
landTypeName: '耕地', landTypeName: '耕地',
soilTypeName: '红壤', soilTypeName: '红壤',
fullRegionName: '云南省临沧市耿马傣族佤族自治县耿马镇允楞村', fullRegionName: '耿马傣族佤族自治县耿马镇允楞村',
gridName: '耿马网格1', gridName: '耿马网格1',
address: '允楞村委会旁', address: '允楞村委会旁',
propertyName: '刘勇', propertyName: '刘勇',
@ -27,7 +27,7 @@ export const mockData = [
area: 12.34, area: 12.34,
landTypeName: '耕地', landTypeName: '耕地',
soilTypeName: '黄壤', soilTypeName: '黄壤',
fullRegionName: '云南省临沧市耿马傣族佤族自治县耿马镇复兴村', fullRegionName: '耿马傣族佤族自治县耿马镇复兴村',
gridName: '耿马网格A', gridName: '耿马网格A',
address: '复兴村大路东侧', address: '复兴村大路东侧',
propertyName: '张芳', propertyName: '张芳',
@ -49,7 +49,7 @@ export const mockData = [
area: 5.6, area: 5.6,
landTypeName: '耕地', landTypeName: '耕地',
soilTypeName: '壤土', soilTypeName: '壤土',
fullRegionName: '云南省临沧市耿马傣族佤族自治县勐撒镇城子村', fullRegionName: '耿马傣族佤族自治县勐撒镇城子村',
gridName: '勐撒网格B', gridName: '勐撒网格B',
address: '城子村太阳路北侧', address: '城子村太阳路北侧',
propertyName: '赵杰', propertyName: '赵杰',
@ -71,7 +71,7 @@ export const mockData = [
area: 14.28, area: 14.28,
landTypeName: '耕地', landTypeName: '耕地',
soilTypeName: '砂壤', soilTypeName: '砂壤',
fullRegionName: '云南省临沧市耿马傣族佤族自治县孟定镇罕宏村', fullRegionName: '耿马傣族佤族自治县孟定镇罕宏村',
gridName: '孟定网格C', gridName: '孟定网格C',
address: '罕宏村公路旁', address: '罕宏村公路旁',
propertyName: '周涛', propertyName: '周涛',
@ -93,7 +93,7 @@ export const mockData = [
area: 7.95, area: 7.95,
landTypeName: '耕地', landTypeName: '耕地',
soilTypeName: '钙质红壤', soilTypeName: '钙质红壤',
fullRegionName: '云南省临沧市耿马傣族佤族自治县贺派乡芒抗村', fullRegionName: '耿马傣族佤族自治县贺派乡芒抗村',
gridName: '贺派网格D', gridName: '贺派网格D',
address: '芒抗村文化站东侧', address: '芒抗村文化站东侧',
propertyName: '钱海', propertyName: '钱海',
@ -115,7 +115,7 @@ export const mockData = [
area: 10.5, area: 10.5,
landTypeName: '耕地', landTypeName: '耕地',
soilTypeName: '红壤', soilTypeName: '红壤',
fullRegionName: '云南省临沧市耿马傣族佤族自治县四排山乡东坡村', fullRegionName: '耿马傣族佤族自治县四排山乡东坡村',
gridName: '四排山网格E', gridName: '四排山网格E',
address: '东坡村卫生室旁', address: '东坡村卫生室旁',
propertyName: '吴强', propertyName: '吴强',
@ -137,7 +137,7 @@ export const mockData = [
area: 6.3, area: 6.3,
landTypeName: '耕地', landTypeName: '耕地',
soilTypeName: '砂壤', soilTypeName: '砂壤',
fullRegionName: '云南省临沧市耿马傣族佤族自治县勐撒镇箐门口村', fullRegionName: '耿马傣族佤族自治县勐撒镇箐门口村',
gridName: '勐撒网格F', gridName: '勐撒网格F',
address: '箐门口村村委路口', address: '箐门口村村委路口',
propertyName: '郑飞', propertyName: '郑飞',
@ -159,7 +159,7 @@ export const mockData = [
area: 9.11, area: 9.11,
landTypeName: '耕地', landTypeName: '耕地',
soilTypeName: '壤土', soilTypeName: '壤土',
fullRegionName: '云南省临沧市耿马傣族佤族自治县孟定镇景信村', fullRegionName: '耿马傣族佤族自治县孟定镇景信村',
gridName: '孟定网格G', gridName: '孟定网格G',
address: '景信村村口', address: '景信村村口',
propertyName: '钱芳', propertyName: '钱芳',
@ -181,7 +181,7 @@ export const mockData = [
area: 11.76, area: 11.76,
landTypeName: '耕地', landTypeName: '耕地',
soilTypeName: '红壤', soilTypeName: '红壤',
fullRegionName: '云南省临沧市耿马傣族佤族自治县耿马镇团结村', fullRegionName: '耿马傣族佤族自治县耿马镇团结村',
gridName: '耿马网格H', gridName: '耿马网格H',
address: '团结村大桥旁', address: '团结村大桥旁',
propertyName: '孙明', propertyName: '孙明',
@ -203,7 +203,7 @@ export const mockData = [
area: 7.22, area: 7.22,
landTypeName: '耕地', landTypeName: '耕地',
soilTypeName: '砂壤', soilTypeName: '砂壤',
fullRegionName: '云南省临沧市耿马傣族佤族自治县贺派乡落阳村', fullRegionName: '耿马傣族佤族自治县贺派乡落阳村',
gridName: '贺派网格I', gridName: '贺派网格I',
address: '落阳村学校旁', address: '落阳村学校旁',
propertyName: '李平', propertyName: '李平',