Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
09c87cb373
@ -17,5 +17,5 @@ VITE_APP_UPLOAD_API = '/uploadApis'
|
||||
# VITE_APP_UPLOAD_URL = 'http://47.109.205.240:9300'
|
||||
# 内网接口地址
|
||||
VITE_APP_BASE_URL = 'http://192.168.18.99:8080'
|
||||
VITE_APP_UPLOAD_URL = 'http://192.168.18.74:8080'
|
||||
VITE_APP_UPLOAD_URL = 'http://192.168.18.99:8080'
|
||||
# VITE_APP_VIST_URL = 'http://192.168.18.99'
|
||||
|
||||
@ -12,6 +12,7 @@ declare module 'vue' {
|
||||
'CenterMap copy': typeof import('./src/components/centerMap copy.vue')['default']
|
||||
CodeDialog: typeof import('./src/components/code-dialog/index.vue')['default']
|
||||
Components: typeof import('./src/components/index.js')['default']
|
||||
copy: typeof import('./src/components/centerMap copy.vue')['default']
|
||||
CurrentTime: typeof import('./src/components/currentTime.vue')['default']
|
||||
CustomBack: typeof import('./src/components/customBack.vue')['default']
|
||||
CustomCarouselPicture: typeof import('./src/components/custom-carousel-picture/index.vue')['default']
|
||||
|
||||
@ -10,8 +10,13 @@ VITE_APP_UPLOAD_API = '/uploadApis'
|
||||
|
||||
# 阿里云接口地址
|
||||
# VITE_APP_BASE_URL = 'http://47.109.205.240:8080'
|
||||
# VITE_APP_UPLOAD_URL = 'http://47.109.205.240:9300'
|
||||
# VITE_APP_UPLOAD_URL = 'http://47.109.205.240:9204'
|
||||
|
||||
# 内网接口地址
|
||||
# 内网测试库接口地址
|
||||
VITE_APP_BASE_URL = 'http://192.168.18.99:8080'
|
||||
VITE_APP_UPLOAD_URL = 'http://192.168.18.74:8080'
|
||||
# VITE_APP_UPLOAD_URL = 'http://192.168.18.98:9204'
|
||||
VITE_APP_UPLOAD_URL = 'http://192.168.18.99:8080'
|
||||
|
||||
# 本地开发接口地址
|
||||
# VITE_APP_BASE_URL = 'http://192.168.18.74:8080'
|
||||
# VITE_APP_UPLOAD_URL = 'http://192.168.18.74:8080'
|
||||
@ -248,8 +248,14 @@ export function exportlandInspection(params = {}) {
|
||||
// #region
|
||||
|
||||
/* 查询土地违法处理 */
|
||||
export function getLandIllegal(params = {}) {
|
||||
return request('land-resource/landViolation/page', {
|
||||
// export function getLandIllegal(params = {}) {
|
||||
// return request('land-resource/landViolation/page', {
|
||||
// method: 'GET',
|
||||
// params,
|
||||
// });
|
||||
// }
|
||||
export function getIllegalList(params = {}) {
|
||||
return request('/land-resource/inspection/illegal/list', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
|
||||
@ -18,6 +18,13 @@ export function getLandList(params) {
|
||||
params,
|
||||
});
|
||||
}
|
||||
// 新增全部土地信息(POST)
|
||||
export function createLand(data = {}) {
|
||||
return request('/land-resource/landManage/v1/save', {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存土地基础信息
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.9 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 281 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
@ -120,6 +120,8 @@ const containerStyle = computed(() => ({
|
||||
text-align: right;
|
||||
line-height: 32px;
|
||||
width: 120px;
|
||||
box-sizing: border-box;
|
||||
padding-right: 12px;
|
||||
}
|
||||
.controls {
|
||||
display: flex;
|
||||
|
||||
@ -104,21 +104,6 @@ const fetchAreaData = async () => {
|
||||
// }
|
||||
// );
|
||||
|
||||
// 内部更新 => 外部同步
|
||||
watch(
|
||||
selectedAreaPath,
|
||||
(val) => {
|
||||
if (props.emitPath) {
|
||||
// 期望数组模式,确保输出数组
|
||||
emit('update:modelValue', Array.isArray(val) ? val : []);
|
||||
} else {
|
||||
// 期望字符串模式,确保输出字符串
|
||||
emit('update:modelValue', typeof val === 'string' ? val : '');
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
fetchAreaData();
|
||||
});
|
||||
|
||||
@ -9,123 +9,36 @@ const inputSuppliesRoutes = [
|
||||
redirect: '/sub-government-affairs-service/material/pesticide',
|
||||
meta: { title: '投入品管理', icon: 'FullScreen' },
|
||||
children: [
|
||||
{
|
||||
path: '/sub-government-affairs-service/material/annualPlans',
|
||||
name: 'annualPlans',
|
||||
component: () => import('@/views/inputSuppliesManage/material/annualPlan/index.vue'),
|
||||
meta: { title: '农产品种植管理', icon: 'Timer' },
|
||||
},
|
||||
{
|
||||
path: '/sub-government-affairs-service/material/pesticide',
|
||||
name: 'input-supplies-pesticide',
|
||||
component: () => import('@/views/inputSuppliesManage/material/pesticide/index.vue'),
|
||||
meta: { title: '农药管理', icon: '' },
|
||||
meta: { title: '农药使用管理', icon: 'Orange' },
|
||||
},
|
||||
{
|
||||
path: '/sub-government-affairs-service/material/fertilizer',
|
||||
name: 'input-supplies-fertilizer',
|
||||
component: () => import('@/views/inputSuppliesManage/material/fertilizer/index.vue'),
|
||||
meta: { title: '肥料管理', icon: '' },
|
||||
meta: { title: '肥料使用管理', icon: 'Grid' },
|
||||
},
|
||||
{
|
||||
path: '/sub-government-affairs-service/material/seed',
|
||||
name: 'input-supplies-seed',
|
||||
component: () => import('@/views/inputSuppliesManage/material/seed/index.vue'),
|
||||
meta: { title: '种子使用监督管理', icon: '' },
|
||||
meta: { title: '种子使用管理', icon: 'Watermelon' },
|
||||
},
|
||||
{
|
||||
path: '/sub-government-affairs-service/material/others',
|
||||
name: 'input-supplies-others',
|
||||
component: () => import('@/views/inputSuppliesManage/material/others/index.vue'),
|
||||
meta: { title: '其他投入品', icon: '' },
|
||||
meta: { title: '其他投入品', icon: 'TakeawayBox' },
|
||||
},
|
||||
{
|
||||
path: '/sub-government-affairs-service/material/annualPlans',
|
||||
name: 'annualPlans',
|
||||
component: () => import('@/views/inputSuppliesManage/material/annualPlan/index.vue'),
|
||||
meta: { title: '种植进度网格化管理', icon: '' },
|
||||
},
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/materialManage',
|
||||
// name: 'materialManage',
|
||||
// component: Views,
|
||||
// redirect: '/sub-government-affairs-service/material/pesticide',
|
||||
// meta: { title: '投入品管理', icon: 'OfficeBuilding' },
|
||||
// children: [
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/material/pesticide',
|
||||
// name: 'input-supplies-pesticide',
|
||||
// component: () => import('@/views/inputSuppliesManage/material/pesticide/index.vue'),
|
||||
// meta: { title: '农药管理', icon: '' },
|
||||
// },
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/material/fertilizer',
|
||||
// name: 'input-supplies-fertilizer',
|
||||
// component: () => import('@/views/inputSuppliesManage/material/fertilizer/index.vue'),
|
||||
// meta: { title: '肥料管理', icon: '' },
|
||||
// },
|
||||
// // {
|
||||
// // path: '/sub-government-affairs-service/material/pesticide',
|
||||
// // name: 'input-supplies-pesticide',
|
||||
// // component: () => import('@/views/inputSuppliesManage/material/pesticide/index.vue'),
|
||||
// // meta: { title: '农药管理', icon: '' },
|
||||
// // },
|
||||
// // {
|
||||
// // path: '/sub-government-affairs-service/material/ratPoison',
|
||||
// // name: 'input-supplies-ratPoison',
|
||||
// // component: () => import('@/views/inputSuppliesManage/material/ratPoison/index.vue'),
|
||||
// // meta: { title: '兽药管理', icon: '' },
|
||||
// // },
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/material/seed',
|
||||
// name: 'input-supplies-seed',
|
||||
// component: () => import('@/views/inputSuppliesManage/material/seed/index.vue'),
|
||||
// meta: { title: '种子管理', icon: '' },
|
||||
// },
|
||||
// // {
|
||||
// // path: '/sub-government-affairs-service/material/farmMachinery',
|
||||
// // name: 'input-supplies-farmMachinery',
|
||||
// // component: () => import('@/views/inputSuppliesManage/material/farmMachinery/index.vue'),
|
||||
// // meta: { title: '农机管理', icon: '' },
|
||||
// // },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/productionDealer',
|
||||
// name: 'productionDealer',
|
||||
// component: () => import('@/views/inputSuppliesManage/productionDealer/index.vue'),
|
||||
// meta: { title: '企业经销商管理', icon: '' },
|
||||
// },
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/enterpriseDealerCheck',
|
||||
// name: 'enterpriseDealerCheck',
|
||||
// component: () => import('@/views/inputSuppliesManage/enterpriseDealerCheck/index.vue'),
|
||||
// meta: { title: '企业经销商抽检', icon: '' },
|
||||
// },
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/useSupervise',
|
||||
// name: 'useSupervise',
|
||||
// component: () => import('@/views/inputSuppliesManage/useSupervise/index.vue'),
|
||||
// meta: { title: '使用监管', icon: '' },
|
||||
// },
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/leaseSupervise',
|
||||
// name: 'leaseSupervise',
|
||||
// component: () => import('@/views/inputSuppliesManage/leaseSupervise/index.vue'),
|
||||
// meta: { title: '农机租赁监管', icon: '' },
|
||||
// },
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/redBlackRank',
|
||||
// name: 'redBlackRank',
|
||||
// component: () => import('@/views/inputSuppliesManage/redBlackRank/index.vue'),
|
||||
// meta: { title: '企业红黑榜', icon: '' },
|
||||
// },
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/knowledgeManage',
|
||||
// name: 'knowledgeManage',
|
||||
// component: () => import('@/views/inputSuppliesManage/knowledgeManage/index.vue'),
|
||||
// meta: { title: '知识库', icon: '' },
|
||||
// },
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/patrolCaseManage',
|
||||
// name: 'patrolCaseManage',
|
||||
// component: () => import('@/views/inputSuppliesManage/patrolCaseManage/index.vue'),
|
||||
// meta: { title: '巡查与案件管理', icon: 'Document' },
|
||||
// },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@ -9,12 +9,12 @@ const landsRoutes = [
|
||||
redirect: '/sub-government-affairs-service/plantPlan',
|
||||
meta: { title: '土地管理', icon: 'Grape' },
|
||||
children: [
|
||||
{
|
||||
path: '/sub-government-affairs-service/landsManage',
|
||||
name: 'landsManage',
|
||||
component: () => import('@/views/landManage/component/landsManage/index.vue'),
|
||||
meta: { title: '土地资源信息登记', icon: '' },
|
||||
},
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/landsManage',
|
||||
// name: 'landsManage',
|
||||
// component: () => import('@/views/landManage/component/landsManage/index.vue'),
|
||||
// meta: { title: '土地资源信息登记', icon: '' },
|
||||
// },
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/plantPlan',
|
||||
// name: 'plantPlan',
|
||||
|
||||
@ -18,7 +18,7 @@ export default [
|
||||
path: '/sub-government-affairs-service/individual',
|
||||
component: () => import('@/views/productOperateMain/individual/index.vue'),
|
||||
name: 'individual',
|
||||
meta: { title: '农户管理', icon: '' },
|
||||
meta: { title: '农户管理', icon: 'Place' },
|
||||
},
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/collective',
|
||||
@ -30,7 +30,7 @@ export default [
|
||||
path: '/sub-government-affairs-service/coop',
|
||||
component: () => import('@/views/productOperateMain/coOp/index.vue'),
|
||||
name: 'coop',
|
||||
meta: { title: '企业管理', icon: '' },
|
||||
meta: { title: '企业管理', icon: 'Finished' },
|
||||
},
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/enterprise',
|
||||
|
||||
@ -1,22 +1,57 @@
|
||||
import Layout from '@/layouts/index.vue';
|
||||
// import annualplanRouters from './annualplan';
|
||||
import statisticsRoutes from './statisticAnalysis';
|
||||
import landsRoutes from './lands';
|
||||
// import dictRoutes from './dict';
|
||||
|
||||
export default [
|
||||
{
|
||||
path: '/sub-government-affairs-service/resource',
|
||||
name: 'resourceManagement',
|
||||
component: Layout,
|
||||
redirect: '/sub-government-affairs-service/landCassification',
|
||||
redirect: '/sub-government-affairs-service/resource/database/statistics',
|
||||
meta: { title: '土地资源管理', icon: 'icon-test' },
|
||||
children: [
|
||||
{
|
||||
path: '/sub-government-affairs-service/landCassification',
|
||||
name: 'landCassification',
|
||||
component: () => import('@/views/dict/component/landCassification/index.vue'),
|
||||
meta: { title: '土地分类', icon: '' },
|
||||
path: '/sub-government-affairs-service/resource/database',
|
||||
name: 'landResourceDatabase',
|
||||
redirect: '/sub-government-affairs-service/resource/database/statistics',
|
||||
meta: { title: '土地资源库', icon: 'Connection' },
|
||||
children: [
|
||||
{
|
||||
path: '/sub-government-affairs-service/resource/database/statistics',
|
||||
name: 'landStatistics',
|
||||
component: () => import('@/views/resource/database/Statistics.vue'),
|
||||
meta: { title: '统计数据', icon: '' },
|
||||
},
|
||||
{
|
||||
path: '/sub-government-affairs-service/resource/database/map',
|
||||
name: 'landMap',
|
||||
component: () => import('@/views/resource/database/LandMap.vue'),
|
||||
meta: { title: '地块地图', icon: '' },
|
||||
},
|
||||
{
|
||||
path: '/sub-government-affairs-service/resource/database/cultivated-land',
|
||||
name: 'cultivatedLand',
|
||||
component: () => import('@/views/resource/database/CultivatedLand.vue'),
|
||||
meta: { title: '耕地', icon: '' },
|
||||
},
|
||||
{
|
||||
path: '/sub-government-affairs-service/resource/database/orchard',
|
||||
name: 'orchardLand',
|
||||
component: () => import('@/views/resource/database/Orchard.vue'),
|
||||
meta: { title: '园地', icon: '' },
|
||||
},
|
||||
{
|
||||
path: '/sub-government-affairs-service/resource/database/forest',
|
||||
name: 'forestLand',
|
||||
component: () => import('@/views/resource/database/Forest.vue'),
|
||||
meta: { title: '林地', icon: '' },
|
||||
},
|
||||
{
|
||||
path: '/sub-government-affairs-service/resource/database/grassland',
|
||||
name: 'grassLand',
|
||||
component: () => import('@/views/resource/database/Grassland.vue'),
|
||||
meta: { title: '草地', icon: '' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
redirect: '/sub-government-affairs-service/add-grid',
|
||||
@ -45,10 +80,7 @@ export default [
|
||||
// },
|
||||
],
|
||||
},
|
||||
// ...annualplanRouters,
|
||||
...landsRoutes,
|
||||
// ...statisticsRoutes,
|
||||
// ...dictRoutes,
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@ -55,20 +55,20 @@ export default [
|
||||
path: '/sub-government-affairs-service/trace-search',
|
||||
name: 'trace-search',
|
||||
component: () => import('@/views/trace/search/index.vue'),
|
||||
meta: { title: '溯源查询', icon: '' },
|
||||
meta: { title: '溯源查询', icon: 'Files' },
|
||||
},
|
||||
{
|
||||
path: '/sub-government-affairs-service/trace-info',
|
||||
name: 'trace-info',
|
||||
component: () => import('@/views/trace/search/info.vue'),
|
||||
meta: { title: '溯源详情', icon: '' },
|
||||
meta: { title: '溯源详情', icon: 'DocumentCopy' },
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
path: '/sub-government-affairs-service/trace-statistic',
|
||||
name: 'trace-statistic',
|
||||
component: () => import('@/views/trace/statistic/index.vue'),
|
||||
meta: { title: '溯源统计', icon: '' },
|
||||
meta: { title: '溯源统计', icon: 'Filter' },
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@ -18,21 +18,11 @@
|
||||
@cell-click="handleCellClick"
|
||||
>
|
||||
<template #menu="{ row }">
|
||||
<el-button v-if="row.status == '0'" type="primary" @click="handleInfo(row)">登记处理</el-button>
|
||||
</template>
|
||||
<template #status="{ row }"> {{ row.status == '0' ? '未' : '已' }}处理 </template>
|
||||
<template #sceneProof-form="{ row, type }">
|
||||
<section class="proof_content_">
|
||||
<span v-if="type == 'add'">(照片、视频)</span>
|
||||
<Attrs v-model:attrs="examineForm.proof" :type="type" :limit="5" :file-num="5" accept="image/*,video/*" />
|
||||
</section>
|
||||
</template>
|
||||
<template #attrs_-form="{ row, type }">
|
||||
<FileUpload v-model:attrs="examineForm.attrs" :format="['rar', 'zip', 'doc', 'docx', 'pdf']" :type="type" />
|
||||
<el-button link type="primary" @click="handleInfo(row)">查看</el-button>
|
||||
<el-button link type="primary" @click="handleInfo(row)">案件处理</el-button>
|
||||
</template>
|
||||
</avue-crud>
|
||||
</section>
|
||||
<Register v-model:visible="caseInfo.visible" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -41,7 +31,7 @@ import { CRUD_OPTIONS } from '@/config';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import Register from './common/Register.vue';
|
||||
import FileUpload from './common/FileUpload.vue';
|
||||
import { getLandIllegal, createLandIllegal, registerLandIllegal, illegalInfo } from '@/apis/land';
|
||||
import { getIllegalList, createLandIllegal, registerLandIllegal, illegalInfo } from '@/apis/land';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import Attrs from '../../common/Attrs.vue';
|
||||
import { add } from 'lodash';
|
||||
@ -109,148 +99,78 @@ const documentData = ref([
|
||||
const option = ref({
|
||||
...CRUD_OPTIONS,
|
||||
refreshBtn: false,
|
||||
index: false,
|
||||
rowKey: 'caseId',
|
||||
editTitle: '案件登记处理',
|
||||
selection: false,
|
||||
addBtn: false,
|
||||
column: [
|
||||
{
|
||||
label: '案件编号',
|
||||
prop: 'caseId',
|
||||
label: '违法行为',
|
||||
prop: 'illegalTypeName',
|
||||
search: true,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '案件名称',
|
||||
prop: 'caseName',
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '关联单位',
|
||||
prop: 'relatedUnit',
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '关联土地·',
|
||||
prop: 'landId',
|
||||
type: 'select',
|
||||
addDisplay: true,
|
||||
hide: true,
|
||||
dicUrl: `${VITE_APP_BASE_API}/land-resource/landManage/page`,
|
||||
dicQuery: {
|
||||
current: 1,
|
||||
size: 9999,
|
||||
},
|
||||
props: {
|
||||
value: 'id',
|
||||
label: 'landName',
|
||||
},
|
||||
dicMethod: 'get',
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => {
|
||||
landsArr.value = res?.data?.records ?? [];
|
||||
return res?.data?.records ?? [];
|
||||
},
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '联系电话',
|
||||
prop: 'phone',
|
||||
hide: true,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '法定代表人',
|
||||
prop: 'legalPerson',
|
||||
addDisplay: true,
|
||||
hide: true,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '统一社会信用代码',
|
||||
prop: 'usciCode',
|
||||
addDisplay: true,
|
||||
hide: true,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '违法情况',
|
||||
prop: 'violationSituation',
|
||||
type: 'textarea',
|
||||
addDisplay: true,
|
||||
hide: true,
|
||||
width: '100%',
|
||||
span: 24,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '负责人',
|
||||
prop: 'responsiblePerson',
|
||||
display: false,
|
||||
addDisplay: true,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '案件进度',
|
||||
prop: 'status',
|
||||
display: false,
|
||||
search: true,
|
||||
type: 'select',
|
||||
dicData: [
|
||||
{ label: '未处理', value: 0 },
|
||||
{ label: '已处理', value: 1 },
|
||||
],
|
||||
// rules: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: '请选择',
|
||||
// trigger: 'blur',
|
||||
// },
|
||||
// ],
|
||||
},
|
||||
{
|
||||
label: '违法行为描述',
|
||||
prop: 'desc',
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '任务编号',
|
||||
prop: 'illegalTypeCode',
|
||||
search: true,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入任务编号',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '巡查任务名称',
|
||||
prop: 'inspectionTaskName',
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '巡查任务对象',
|
||||
prop: 'inspectionTaskTarget',
|
||||
addDisplay: true,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '案件结果',
|
||||
label: '状态',
|
||||
prop: 'status',
|
||||
display: false,
|
||||
addDisplay: true,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '处理时间',
|
||||
prop: 'updateTime',
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: true,
|
||||
viewDisplay: false,
|
||||
},
|
||||
],
|
||||
group: [
|
||||
{
|
||||
@ -439,13 +359,14 @@ watch(
|
||||
// #region
|
||||
|
||||
async function getList() {
|
||||
_loading.value = true;
|
||||
// _loading.value = true;
|
||||
let params = {
|
||||
illegalFlag: 1,
|
||||
current: page.value.currentPage,
|
||||
size: page.value.pageSize,
|
||||
...searchData.value,
|
||||
// ...searchData.value,
|
||||
};
|
||||
let res = await getLandIllegal(params);
|
||||
let res = await getIllegalList(params);
|
||||
console.log('res -- ', res);
|
||||
_loading.value = false;
|
||||
if (res.code == 200) {
|
||||
@ -464,10 +385,10 @@ function handleSizeChange(val) {
|
||||
}
|
||||
function handleInfo(row) {
|
||||
console.log('row', row);
|
||||
examineForm.caseId = row.caseId;
|
||||
// caseInfo.value.visible = true;
|
||||
crudRef.value.rowEdit(row);
|
||||
// crudRef.value.rowView(row);
|
||||
// examineForm.caseId = row.caseId;
|
||||
// // caseInfo.value.visible = true;
|
||||
// crudRef.value.rowEdit(row);
|
||||
// // crudRef.value.rowView(row);
|
||||
}
|
||||
async function handleSearch(form, done) {
|
||||
page.value.currentPage = 1;
|
||||
@ -569,7 +490,7 @@ function handleOpenFrom(done, type) {
|
||||
if (type == 'view') {
|
||||
option.value.group.find((v) => v.prop == 'caseHandle').column.find((v) => v.prop == 'attrs_').label = lab;
|
||||
}
|
||||
done();
|
||||
// done();
|
||||
}
|
||||
function handleCloseFrom(done) {
|
||||
console.log('form close');
|
||||
|
||||
@ -30,154 +30,96 @@
|
||||
</avue-crud>
|
||||
|
||||
<!-- 新增弹窗 -->
|
||||
<el-dialog v-model="addDialogVisible" title="新增" width="800px" top="8vh">
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-dialog :key="dialogTitle" v-model="visible" :title="dialogTitle" width="60%" align-center :draggable="true">
|
||||
<el-tabs v-model="activeTab" class="tabs-wrapper">
|
||||
<el-tab-pane label="土地基本信息" name="basic">
|
||||
<el-form ref="basicFormRef" :model="formDataBasic" :rules="basicRules" label-width="120px" class="form-container">
|
||||
<el-form-item label="地块名称" prop="landName">
|
||||
<el-input v-model="formDataBasic.landName" placeholder="请输入地块名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="面积(亩)" prop="area">
|
||||
<el-input-number v-model="formDataBasic.area" :min="0" :precision="2" :step="0.1" controls-position="right" style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-form-item label="土地类型" prop="landType">
|
||||
<el-select v-model="formDataBasic.landType" placeholder="选择土地类型" clearable>
|
||||
<el-option v-for="item in landTypeOptions" :key="item.id" :label="item.landType" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="具体位置" prop="address">
|
||||
<el-input v-model="formDataBasic.address" placeholder="请输入具体位置" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属网格" prop="gridId">
|
||||
<AreaCascader v-model:region-code="formDataBasic.regionCode" v-model:grid-id="formDataBasic.gridId" label="" :width="500" />
|
||||
</el-form-item>
|
||||
<el-form-item label="土壤类型" prop="soilTypeId">
|
||||
<url-select
|
||||
v-model="formDataBasic.soilTypeId"
|
||||
placeholder="选择土壤类型"
|
||||
url="/land-resource/baseInfo/soilTypePage"
|
||||
:params="{ current: 1, size: 100 }"
|
||||
label-key="soilType"
|
||||
value-key="id"
|
||||
:clearable="true"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="土地照片" prop="landUrl">
|
||||
<el-upload
|
||||
:http-request="customUploadRequest"
|
||||
:on-success="(res, file) => handleUploadSuccess(res, file, 'basic')"
|
||||
multiple
|
||||
:show-file-list="true"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">点击上传</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="土地范围" prop="scope">
|
||||
<el-input v-model="formDataBasic.scope" placeholder="请输入土地范围" />
|
||||
<!-- <Attrs v-model:attrs="formDataBasic.scope" type="add" accept="image/*" /> -->
|
||||
</el-form-item>
|
||||
<p class="form-title">编辑基本信息</p>
|
||||
<el-form ref="basicFormRef" :model="formDataBasic" :disabled="isReadonly" label-width="120px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="地块名称" prop="landName">
|
||||
<el-input v-model="formDataBasic.landName" placeholder="请输入地块名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="土地类型" prop="landType">
|
||||
<el-select v-model="formDataBasic.landType" placeholder="选择土地类型" clearable>
|
||||
<el-option v-for="item in landTypeOptions" :key="item.id" :label="item.landType" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="具体位置" prop="address">
|
||||
<el-input v-model="formDataBasic.address" placeholder="请输入具体位置" />
|
||||
</el-form-item>
|
||||
<el-form-item label="土壤类型" prop="soilTypeId">
|
||||
<url-select
|
||||
v-model="formDataBasic.soilTypeId"
|
||||
placeholder="选择土壤类型"
|
||||
url="/land-resource/baseInfo/soilTypePage"
|
||||
:params="{ current: 1, size: 100 }"
|
||||
label-key="soilType"
|
||||
value-key="id"
|
||||
:clearable="true"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="土地照片" prop="landUrl">
|
||||
<FileUploader v-model="formDataBasic.landUrl" :limit="1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="面积(亩)" prop="area">
|
||||
<el-input-number v-model="formDataBasic.area" :min="0" :precision="2" :step="0.1" controls-position="right" style="width: 100%" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="" label-width="0" prop="gridId">
|
||||
<AreaCascader v-model:region-code="formDataBasic.regionCode" v-model:grid-id="formDataBasic.gridId" label="" :split-rows="true" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="土地范围" prop="scope">
|
||||
<el-input v-model="formDataBasic.scope" placeholder="请输入土地范围" />
|
||||
<!-- <Attrs v-model:attrs="formDataBasic.scope" type="add" accept="image/*" /> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="土地产权信息" name="property">
|
||||
<el-form ref="propertyFormRef" :model="formDataProperty" :rules="propertyRules" label-width="120px" class="form-container">
|
||||
<el-form-item label="地块名称">
|
||||
<el-input v-model="formDataProperty.landName" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="产权人姓名" prop="propertyName">
|
||||
<el-input v-model="formDataProperty.propertyName" placeholder="请输入产权人姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系方式" prop="propertyPhone">
|
||||
<el-input v-model="formDataProperty.propertyPhone" placeholder="请输入产权人联系方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产权编号" prop="landCode">
|
||||
<el-input v-model="formDataProperty.landCode" placeholder="请输入产权编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产权证书" prop="propertyCertificateUrl">
|
||||
<FileUploader v-model="formDataProperty.propertyCertificateUrl" :limit="1" />
|
||||
</el-form-item>
|
||||
<p class="form-title">编辑产权信息</p>
|
||||
<el-form ref="propertyFormRef" style="width: 60%" :model="formDataProperty" :disabled="isReadonly" label-width="120px">
|
||||
<el-row :gutter="20">
|
||||
<el-form-item label="地块名称">
|
||||
<el-input v-model="formDataProperty.landName" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="产权人姓名" prop="propertyName">
|
||||
<el-input v-model="formDataProperty.propertyName" placeholder="请输入产权人姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系方式" prop="propertyPhone">
|
||||
<el-input v-model="formDataProperty.propertyPhone" placeholder="请输入产权人联系方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产权编号" prop="landCode">
|
||||
<el-input v-model="formDataProperty.landCode" placeholder="请输入产权编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产权证书" prop="propertyCertificateUrl">
|
||||
<FileUploader v-model="formDataProperty.propertyCertificateUrl" :limit="1" />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="addDialogVisible = false">取消</el-button>
|
||||
<el-button v-if="activeTab === 'basic'" type="primary" @click="handleAddSubmit('basic')">提交</el-button>
|
||||
<el-button v-if="activeTab === 'basic'" :disabled="disabledProperty" @click="activeTab = 'property'">下一步</el-button>
|
||||
<el-button v-else @click="activeTab = 'basic'">上一步</el-button>
|
||||
<el-button v-if="activeTab === 'property'" type="primary" @click="handleAddSubmit('property')"> 提交 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
|
||||
<!-- 查看和编辑共用弹窗 -->
|
||||
<el-dialog v-model="viewEditDialogVisible" :title="viewEditTitle" width="800px" top="8vh">
|
||||
<el-form
|
||||
ref="viewEditFormRef"
|
||||
:model="viewEditFormData"
|
||||
:rules="isView ? {} : editRules"
|
||||
label-width="120px"
|
||||
class="view-edit-form"
|
||||
:disabled="isView"
|
||||
>
|
||||
<h3 class="section-title">土地基本信息</h3>
|
||||
<el-form-item label="地块名称" prop="landName">
|
||||
<el-input v-model="viewEditFormData.landName" />
|
||||
</el-form-item>
|
||||
<el-form-item label="面积(亩)" prop="area">
|
||||
<el-input-number v-model="viewEditFormData.area" :min="0" :precision="2" :step="0.1" controls-position="right" style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-form-item label="土地类型" prop="landType">
|
||||
<el-select v-model="viewEditFormData.landType" clearable>
|
||||
<el-option v-for="item in landTypeOptions" :key="item.id" :label="item.landType" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="具体位置" prop="address">
|
||||
<el-input v-model="viewEditFormData.address" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属网格" prop="gridId">
|
||||
<AreaCascader v-model="viewEditFormData.regionCode" v-model:grid-id="viewEditFormData.gridId" :width="500" label="" />
|
||||
</el-form-item>
|
||||
<el-form-item label="土壤类型" prop="soilTypeId">
|
||||
<url-select
|
||||
v-model="viewEditFormData.soilTypeId"
|
||||
url="/land-resource/baseInfo/soilTypePage"
|
||||
:params="{ current: 1, size: 100 }"
|
||||
label-key="soilType"
|
||||
value-key="id"
|
||||
:clearable="true"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="土地照片" prop="landUrl">
|
||||
<FileUploader v-model="viewEditFormData.landUrl" :limit="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="土地范围" prop="scope">
|
||||
<el-input v-model="viewEditFormData.scope" />
|
||||
</el-form-item>
|
||||
<!-- 土地基本信息 tab -->
|
||||
<template v-if="activeTab === 'basic'">
|
||||
<el-button type="primary" @click="submitBasicInfo">暂存</el-button>
|
||||
<el-button @click="activeTab = 'property'">下一步</el-button>
|
||||
</template>
|
||||
|
||||
<h3 class="section-title">土地产权信息</h3>
|
||||
<el-form-item label="产权人姓名" prop="propertyName">
|
||||
<el-input v-model="viewEditFormData.propertyName" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系方式" prop="propertyPhone">
|
||||
<el-input v-model="viewEditFormData.propertyPhone" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产权编号" prop="landCode">
|
||||
<el-input v-model="viewEditFormData.landCode" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产权证书" prop="propertyCertificateUrl">
|
||||
<FileUploader v-model="viewEditFormData.propertyCertificateUrl" :limit="1" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="viewEditDialogVisible = false">{{ isView ? '关闭' : '取消' }}</el-button>
|
||||
<el-button v-if="isView" type="primary" @click="handleEdit">编辑</el-button>
|
||||
<el-button v-if="!isView" type="primary" @click="handleView">查看</el-button>
|
||||
<el-button v-if="!isView" type="primary" @click="handleViewEditSubmit"> 提交 </el-button>
|
||||
<!-- 土地产权信息 tab -->
|
||||
<template v-else>
|
||||
<el-button @click="activeTab = 'basic'">上一步</el-button>
|
||||
<el-button v-if="formDataProperty.id" type="primary" @click="submitPropertyInfo">提交</el-button>
|
||||
<el-button v-else type="primary" @click="submitAll">保存</el-button>
|
||||
</template>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@ -187,8 +129,9 @@
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, computed, nextTick } from 'vue';
|
||||
import { CRUD_OPTIONS } from '@/config';
|
||||
import { getLandList, saveBaseInfo, saveProperty, editLand, deleteLand } from '@/apis/landResourceManagement/landManagement';
|
||||
import { getLandList, createLand, saveBaseInfo, saveProperty, editLand, deleteLand } from '@/apis/landResourceManagement/landManagement';
|
||||
import { CommonUpload } from '@/apis/index';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import request from '@/utils/axios';
|
||||
|
||||
// ==============================
|
||||
@ -196,17 +139,14 @@ import request from '@/utils/axios';
|
||||
// ==============================
|
||||
const loading = ref(false);
|
||||
const crudRef = ref();
|
||||
const addDialogVisible = ref(false);
|
||||
const visible = ref(false);
|
||||
const isReadonly = ref(false);
|
||||
const activeTab = ref('basic');
|
||||
const viewEditDialogVisible = ref(false);
|
||||
const isView = ref(false);
|
||||
// 控制是否启用验证规则
|
||||
const isValidationEnabled = ref(false);
|
||||
const dialogTitle = ref('新增');
|
||||
|
||||
// 表单引用
|
||||
const basicFormRef = ref(null);
|
||||
const propertyFormRef = ref(null);
|
||||
const viewEditFormRef = ref(null);
|
||||
|
||||
// 分页数据
|
||||
const pageData = ref({
|
||||
@ -251,97 +191,6 @@ const formDataProperty = ref({
|
||||
propertyCertificateUrl: '',
|
||||
});
|
||||
|
||||
const viewEditFormData = ref({
|
||||
id: '',
|
||||
landName: '',
|
||||
gridId: '',
|
||||
gridName: '',
|
||||
area: 0,
|
||||
landType: '',
|
||||
landTypeId: '',
|
||||
landTypeName: '',
|
||||
address: '',
|
||||
detailAddress: '',
|
||||
fullLandType: '',
|
||||
fullRegionName: '',
|
||||
soilTypeId: '',
|
||||
soilType: '',
|
||||
landUrl: '',
|
||||
scope: '',
|
||||
propertyName: '',
|
||||
propertyPhone: '',
|
||||
landCode: '',
|
||||
propertyCertificateUrl: '',
|
||||
updateTime: '',
|
||||
});
|
||||
|
||||
// OSS URL
|
||||
const ossUrl = 'http://gov-cloud.oss-cn-chengdu.aliyuncs.com/';
|
||||
|
||||
// ==============================
|
||||
// 计算属性
|
||||
// ==============================
|
||||
const viewEditTitle = computed(() => {
|
||||
return isView.value ? '查看' : '编辑';
|
||||
});
|
||||
|
||||
const disabledProperty = computed(() => {
|
||||
return formDataBasic.value.id ? false : true;
|
||||
});
|
||||
|
||||
// ==============================
|
||||
// 表单验证规则
|
||||
// ==============================
|
||||
const basicRules = reactive(
|
||||
isValidationEnabled.value
|
||||
? {
|
||||
landName: [{ required: true, message: '请输入地块名称', trigger: 'blur' }],
|
||||
area: [
|
||||
{ required: true, message: '请输入面积', trigger: 'blur' },
|
||||
{
|
||||
type: 'number',
|
||||
min: 0,
|
||||
message: '面积必须大于0',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
landType: [{ required: true, message: '请选择土地类型', trigger: 'change' }],
|
||||
address: [{ required: true, message: '请输入具体位置', trigger: 'blur' }],
|
||||
gridId: [{ required: true, message: '请选择所属网格', trigger: 'change' }],
|
||||
soilTypeId: [{ required: true, message: '请选择土壤类型', trigger: 'change' }],
|
||||
landUrl: [{ required: true, message: '请上传土地照片', trigger: 'change' }],
|
||||
scope: [{ required: true, message: '请输入土地范围', trigger: 'blur' }],
|
||||
}
|
||||
: {}
|
||||
);
|
||||
|
||||
const propertyRules = reactive(
|
||||
isValidationEnabled.value
|
||||
? {
|
||||
propertyName: [{ required: true, message: '请输入产权人姓名', trigger: 'blur' }],
|
||||
propertyPhone: [
|
||||
{ required: true, message: '请输入联系方式', trigger: 'blur' },
|
||||
{
|
||||
pattern: /^1[3-9]\d{9}$/,
|
||||
message: '请输入正确的手机号码',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
landCode: [{ required: true, message: '请输入产权编号', trigger: 'blur' }],
|
||||
propertyCertificateUrl: [{ required: true, message: '请上传产权证书', trigger: 'change' }],
|
||||
}
|
||||
: {}
|
||||
);
|
||||
|
||||
const editRules = reactive(
|
||||
isValidationEnabled.value
|
||||
? {
|
||||
...basicRules,
|
||||
...propertyRules,
|
||||
}
|
||||
: {}
|
||||
);
|
||||
|
||||
// ==============================
|
||||
// CRUD 配置
|
||||
// ==============================
|
||||
@ -353,7 +202,7 @@ const option = reactive({
|
||||
column: [
|
||||
{ label: '地块名称', prop: 'landName' },
|
||||
{ label: '所属网格', prop: 'gridName' },
|
||||
{ label: '面积', prop: 'area', formatter: (row, column, cellValue) => `${cellValue} 亩` },
|
||||
{ label: '面积', prop: 'area', formatter: (row, column, cellValue) => `${Number(cellValue).toFixed(2)} 亩` },
|
||||
{ label: '土地类型', prop: 'landTypeName' },
|
||||
{ label: '所属行政区域', prop: 'fullRegionName' },
|
||||
{ label: '具体位置', prop: 'address' },
|
||||
@ -364,16 +213,16 @@ const option = reactive({
|
||||
{ label: '信息更新时间', prop: 'updateTime' },
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
name: '查看',
|
||||
icon: 'view',
|
||||
event: ({ row }) => handleView(row),
|
||||
},
|
||||
{
|
||||
name: '编辑',
|
||||
icon: 'edit',
|
||||
event: ({ row }) => handleEdit(row),
|
||||
},
|
||||
// {
|
||||
// name: '查看',
|
||||
// icon: 'view',
|
||||
// event: ({ row }) => handleView(row),
|
||||
// },
|
||||
// {
|
||||
// name: '编辑',
|
||||
// icon: 'edit',
|
||||
// event: ({ row }) => handleEdit(row),
|
||||
// },
|
||||
{
|
||||
type: 'danger',
|
||||
name: '删除',
|
||||
@ -440,7 +289,7 @@ const handleAdd = () => {
|
||||
propertyCertificateUrl: '',
|
||||
};
|
||||
|
||||
addDialogVisible.value = true;
|
||||
visible.value = true;
|
||||
activeTab.value = 'basic';
|
||||
|
||||
// 重置表单验证
|
||||
@ -455,22 +304,15 @@ const handleAdd = () => {
|
||||
};
|
||||
|
||||
const handleView = (row) => {
|
||||
isView.value = true;
|
||||
viewEditFormData.value = { ...row };
|
||||
viewEditDialogVisible.value = true;
|
||||
isReadonly.value = true;
|
||||
dialogTitle.value = '土地资源详情';
|
||||
visible.value = true;
|
||||
};
|
||||
|
||||
const handleEdit = (row) => {
|
||||
isView.value = false;
|
||||
viewEditFormData.value = { ...row };
|
||||
viewEditDialogVisible.value = true;
|
||||
|
||||
// 重置表单验证
|
||||
// nextTick(() => {
|
||||
// if (viewEditFormRef.value) {
|
||||
// viewEditFormRef.value.resetFields();
|
||||
// }
|
||||
// });
|
||||
dialogTitle.value = '编辑';
|
||||
isReadonly.value = false;
|
||||
visible.value = true;
|
||||
};
|
||||
|
||||
const handleDelete = (id) => {
|
||||
@ -500,94 +342,57 @@ const resetSearch = () => {
|
||||
// ==============================
|
||||
// 方法 - 表单提交
|
||||
// ==============================
|
||||
const handleAddSubmit = async (tab) => {
|
||||
const submitBasicInfo = async () => {
|
||||
try {
|
||||
if (tab === 'basic') {
|
||||
await basicFormRef.value.validate();
|
||||
const res = await saveBaseInfo(formDataBasic.value);
|
||||
if (res.code === 200) {
|
||||
activeTab.value = 'property';
|
||||
formDataProperty.value.id = res.data.id;
|
||||
formDataProperty.value.landName = formDataBasic.value.landName;
|
||||
}
|
||||
} else if (tab === 'property') {
|
||||
await propertyFormRef.value.validate();
|
||||
const res = await saveProperty(formDataProperty.value);
|
||||
if (res.code === 200) {
|
||||
addDialogVisible.value = false;
|
||||
getData();
|
||||
}
|
||||
await basicFormRef.value.validate();
|
||||
const res = await saveBaseInfo(formDataBasic.value);
|
||||
if (res.code === 200) {
|
||||
formDataProperty.value.id = res.data.id;
|
||||
formDataProperty.value.landName = formDataBasic.value.landName;
|
||||
ElMessage.success('基本信息已暂存');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('表单提交失败', error);
|
||||
console.error('暂存失败', error);
|
||||
}
|
||||
};
|
||||
|
||||
const handleViewEditSubmit = async () => {
|
||||
const submitPropertyInfo = async () => {
|
||||
try {
|
||||
await viewEditFormRef.value.validate();
|
||||
// 合并提交逻辑
|
||||
const { id, ...formData } = viewEditFormData.value;
|
||||
if (id) {
|
||||
// 更新逻辑
|
||||
// await updateLandInfo({ id, ...formData });
|
||||
await editLand({ id, ...formData });
|
||||
viewEditDialogVisible.value = false;
|
||||
await propertyFormRef.value.validate();
|
||||
if (!formDataProperty.value.id) {
|
||||
ElMessage.error('请先保存基本信息');
|
||||
return;
|
||||
}
|
||||
const res = await saveProperty(formDataProperty.value);
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('产权信息提交成功');
|
||||
visible.value = false;
|
||||
getData();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('表单提交失败', error);
|
||||
console.error('产权信息提交失败', error);
|
||||
}
|
||||
};
|
||||
|
||||
// ==============================
|
||||
// 方法 - 文件上传
|
||||
// ==============================
|
||||
const customUploadRequest = async (options) => {
|
||||
const formData = new FormData();
|
||||
formData.append('file', options.file);
|
||||
|
||||
const submitAll = async () => {
|
||||
try {
|
||||
const response = await CommonUpload(formData);
|
||||
options.onSuccess(response, options.file);
|
||||
return response;
|
||||
} catch (err) {
|
||||
console.error('上传失败', err);
|
||||
options.onError(err);
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
await basicFormRef.value.validate();
|
||||
await propertyFormRef.value.validate();
|
||||
|
||||
const handleUploadSuccess = (res, file, type) => {
|
||||
if (res?.data?.url) {
|
||||
const url = res.data.url;
|
||||
|
||||
switch (type) {
|
||||
case 'basic':
|
||||
formDataBasic.value.landUrl = url;
|
||||
break;
|
||||
case 'property':
|
||||
formDataProperty.value.propertyCertificateUrl = url;
|
||||
break;
|
||||
case 'viewEditBasic':
|
||||
viewEditFormData.value.landUrl = url;
|
||||
break;
|
||||
case 'viewEditProperty':
|
||||
viewEditFormData.value.propertyCertificateUrl = url;
|
||||
break;
|
||||
const combinedData = {
|
||||
...formDataProperty.value,
|
||||
...formDataBasic.value,
|
||||
};
|
||||
const baseRes = await createLand(combinedData);
|
||||
if (baseRes.code === 200) {
|
||||
ElMessage.success('全部信息保存成功');
|
||||
visible.value = false;
|
||||
getData();
|
||||
} else {
|
||||
ElMessage.error('信息保存失败');
|
||||
}
|
||||
|
||||
// 手动触发验证
|
||||
nextTick(() => {
|
||||
if (type === 'basic' && basicFormRef.value) {
|
||||
basicFormRef.value.validateField('landUrl');
|
||||
} else if (type === 'property' && propertyFormRef.value) {
|
||||
propertyFormRef.value.validateField('propertyCertificateUrl');
|
||||
} else if (type.includes('viewEdit') && viewEditFormRef.value) {
|
||||
const field = type === 'viewEditBasic' ? 'landUrl' : 'propertyCertificateUrl';
|
||||
viewEditFormRef.value.validateField(field);
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('保存失败', error);
|
||||
}
|
||||
};
|
||||
|
||||
@ -616,6 +421,11 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// :deep(.el-dialog__body) {
|
||||
// padding: 20px;
|
||||
// height: calc(100vh - 300px);
|
||||
// overflow-y: auto;
|
||||
// }
|
||||
.custom-page {
|
||||
padding: 20px;
|
||||
height: calc(100vh - 150px);
|
||||
@ -632,40 +442,40 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
}
|
||||
.tabs-wrapper {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
// background-color: #7daaaa;
|
||||
|
||||
.form-container,
|
||||
.view-edit-form {
|
||||
padding: 0 20px;
|
||||
max-height: calc(100vh - 300px);
|
||||
overflow-y: auto;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 22px;
|
||||
:deep(.el-tabs__item) {
|
||||
font-size: 16px;
|
||||
color: #555555;
|
||||
font-weight: 500;
|
||||
// border: 1 solid #f000;
|
||||
}
|
||||
:deep(.el-tabs__content) {
|
||||
padding: 20px;
|
||||
// background-color: #f5f5f5;
|
||||
border-radius: 4px;
|
||||
height: calc(100vh - 300px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
:deep(.el-tab-pane) {
|
||||
margin: 0 auto;
|
||||
width: 80%;
|
||||
}
|
||||
}
|
||||
|
||||
.view-edit-form {
|
||||
.section-title {
|
||||
color: #409eff;
|
||||
border-bottom: 1px solid #eee;
|
||||
padding-bottom: 10px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.preview-image {
|
||||
max-width: 100%;
|
||||
max-height: 200px;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 4px;
|
||||
display: block;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.form-title {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
margin: 30px 0;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 10px 20px 0;
|
||||
border-top: 1px solid #eee;
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -13,19 +13,7 @@
|
||||
<el-input v-model="localForm.contactPerson" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="农企/合作社照片">
|
||||
<el-upload
|
||||
action="#"
|
||||
:http-request="customUploadRequest"
|
||||
:on-success="(res, file) => handleUploadSuccess(res, file, 'cooperativePhoto')"
|
||||
:file-list="cooperativePhotoList"
|
||||
list-type="picture-card"
|
||||
:limit="1"
|
||||
:on-exceed="handleExceed"
|
||||
:on-remove="() => handleRemove('cooperativePhoto')"
|
||||
>
|
||||
<el-icon><Plus /></el-icon>
|
||||
</el-upload>
|
||||
<!-- <FileUploader v-model="localForm.cooperativePhoto" :limit="1" /> -->
|
||||
<FileUploader v-model="localForm.cooperativePhoto" :limit="1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@ -47,18 +35,6 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="营业执照">
|
||||
<!-- <el-upload
|
||||
action="#"
|
||||
:http-request="customUploadRequest"
|
||||
:on-success="(res, file) => handleUploadSuccess(res, file, 'businessLicence')"
|
||||
:file-list="businessLicenceList"
|
||||
list-type="picture-card"
|
||||
:limit="1"
|
||||
:on-exceed="handleExceed"
|
||||
:on-remove="() => handleRemove('businessLicence')"
|
||||
>
|
||||
<el-icon><Plus /></el-icon>
|
||||
</el-upload> -->
|
||||
<FileUploader v-model="localForm.businessLicence" :limit="1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -67,14 +43,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Plus } from '@element-plus/icons-vue';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
import { CommonUpload } from '@/apis/index';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import Attrs from './Attrs.vue';
|
||||
import { useCoop } from '../../../../store/modules/coop';
|
||||
const localForm = useCoop().$state.data;
|
||||
import { ref, toRefs, reactive, watch } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
@ -82,97 +51,11 @@ const props = defineProps({
|
||||
required: true,
|
||||
default: () => ({}),
|
||||
},
|
||||
// readonly: Boolean,
|
||||
readonly: Boolean,
|
||||
});
|
||||
|
||||
const ossUrl = 'http://gov-cloud.oss-cn-chengdu.aliyuncs.com/';
|
||||
const cooperativePhotoList = ref([]);
|
||||
const businessLicenceList = ref([]);
|
||||
|
||||
const emit = defineEmits(['update:modelValue']);
|
||||
|
||||
// 建立本地副本,避免直接修改 props
|
||||
// const localForm = ref({ ...props.modelValue });
|
||||
|
||||
// 深度监听本地副本的变化,实时更新父组件
|
||||
// watch(
|
||||
// localForm,
|
||||
// (newVal) => {
|
||||
// emit('update:modelValue', { ...newVal });
|
||||
// },
|
||||
// { deep: true }
|
||||
// );
|
||||
// watch(
|
||||
// () => props.modelValue,
|
||||
// (newVal) => {
|
||||
// Object.assign(localForm, cloneDeep(newVal));
|
||||
// },
|
||||
// { deep: true }
|
||||
// );
|
||||
|
||||
const customUploadRequest = async (options) => {
|
||||
const formData = new FormData();
|
||||
formData.append('file', options.file);
|
||||
|
||||
try {
|
||||
const response = await CommonUpload(formData);
|
||||
options.onSuccess(response, options.file);
|
||||
return response;
|
||||
} catch (err) {
|
||||
console.error('上传失败', err);
|
||||
options.onError(err);
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
const handleUploadSuccess = (res, file, fieldName) => {
|
||||
localForm[fieldName] = res.data.url;
|
||||
// 更新预览列表
|
||||
const previewItem = {
|
||||
name: res.data.name,
|
||||
url: ossUrl + res.data.url, // 确保这是完整的可访问URL
|
||||
status: 'success',
|
||||
};
|
||||
if (fieldName === 'cooperativePhoto') {
|
||||
cooperativePhotoList.value = [previewItem];
|
||||
} else {
|
||||
businessLicenceList.value = [previewItem];
|
||||
}
|
||||
};
|
||||
// 处理移除图片
|
||||
const handleRemove = (fieldName) => {
|
||||
localForm[fieldName] = '';
|
||||
if (fieldName === 'cooperativePhoto') {
|
||||
cooperativePhotoList.value = [];
|
||||
} else {
|
||||
businessLicenceList.value = [];
|
||||
}
|
||||
};
|
||||
|
||||
// 处理文件超出限制
|
||||
const handleExceed = () => {
|
||||
ElMessage.warning('只能上传一张图片,请先删除当前图片');
|
||||
};
|
||||
|
||||
// 初始化时如果有图片,设置预览
|
||||
if (localForm.cooperativePhoto) {
|
||||
cooperativePhotoList.value = [
|
||||
{
|
||||
name: '合作社照片',
|
||||
url: ossUrl + localForm.cooperativePhoto,
|
||||
status: 'success',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
if (localForm.businessLicence) {
|
||||
businessLicenceList.value = [
|
||||
{
|
||||
name: '营业执照',
|
||||
url: ossUrl + localForm.businessLicence,
|
||||
status: 'success',
|
||||
},
|
||||
];
|
||||
}
|
||||
const { modelValue: localForm } = toRefs(props);
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@ -72,7 +72,7 @@ import { reactive, watch } from 'vue';
|
||||
import { Plus } from '@element-plus/icons-vue';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
import { useCoop } from '../../../../store/modules/coop';
|
||||
const localForm = useCoop().$state.data;
|
||||
// const localForm = useCoop().$state.data;
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
@ -88,16 +88,16 @@ const props = defineProps({
|
||||
const emit = defineEmits(['update:modelValue']);
|
||||
|
||||
// 本地副本,存放各表的文件列表
|
||||
// const localForm = reactive(cloneDeep(props.modelValue));
|
||||
const localForm = reactive(cloneDeep(props.modelValue));
|
||||
|
||||
// watch 同步回父组件
|
||||
// watch(
|
||||
// () => localForm,
|
||||
// (val) => {
|
||||
// emit('update:modelValue', { ...val });
|
||||
// },
|
||||
// { deep: true }
|
||||
// );
|
||||
watch(
|
||||
() => localForm,
|
||||
(val) => {
|
||||
emit('update:modelValue', { ...val });
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
// watch(
|
||||
// () => props.modelValue,
|
||||
// (newVal) => {
|
||||
|
||||
@ -2,34 +2,32 @@
|
||||
<el-form :model="localForm" label-width="160px" :disabled="readonly">
|
||||
<div class="credit-evaluation">
|
||||
<h3>信用评级</h3>
|
||||
|
||||
<el-form-item label="信用评价">
|
||||
<el-rate v-model="localForm.creditEvaluation" allow-half show-score score-template="{value} 分" />
|
||||
<el-rate v-model="localForm.creditEvaluation" show-score score-template="{value} 分" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="带动周边农户">
|
||||
<el-rate v-model="localForm.supportedFarmers" allow-half show-score score-template="{value} 分" />
|
||||
<el-rate v-model="localForm.supportedFarmers" show-score score-template="{value} 分" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="社会效益">
|
||||
<el-rate v-model="localForm.socialImpact" allow-half show-score score-template="{value} 分" />
|
||||
<el-rate v-model="localForm.socialImpact" show-score score-template="{value} 分" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="高新技术应用">
|
||||
<el-rate v-model="localForm.techApplication" allow-half show-score score-template="{value} 分" />
|
||||
<el-rate v-model="localForm.techApplication" show-score score-template="{value} 分" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="产品质量及服务保障">
|
||||
<el-rate v-model="localForm.productQuality" allow-half show-score score-template="{value} 分" />
|
||||
<el-rate v-model="localForm.productQuality" show-score score-template="{value} 分" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, watch } from 'vue';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
import { useCoop } from '../../../../store/modules/coop';
|
||||
const localForm = useCoop().$state.data;
|
||||
import { toRefs, watch } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
@ -42,8 +40,10 @@ const props = defineProps({
|
||||
|
||||
const emit = defineEmits(['update:modelValue']);
|
||||
|
||||
// const localForm = reactive(cloneDeep(props.modelValue));
|
||||
// 解构出响应式引用,保持与父组件绑定
|
||||
const { modelValue: localForm } = toRefs(props);
|
||||
|
||||
// 如需在评分变化时同步更新父组件(可选,某些场景可能冗余)
|
||||
// watch(
|
||||
// localForm,
|
||||
// (newVal) => {
|
||||
@ -51,14 +51,8 @@ const emit = defineEmits(['update:modelValue']);
|
||||
// },
|
||||
// { deep: true }
|
||||
// );
|
||||
// watch(
|
||||
// () => props.modelValue,
|
||||
// (newVal) => {
|
||||
// Object.assign(localForm, cloneDeep(newVal));
|
||||
// },
|
||||
// { deep: true }
|
||||
// );
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.credit-evaluation {
|
||||
width: 600px;
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
<el-dialog :key="dialogTitle" v-model="dialogVisible" :title="dialogTitle" width="80%">
|
||||
<el-dialog :key="dialogTitle" v-model="dialogVisible" :title="dialogTitle" width="60%" append-to-body>
|
||||
<el-form :model="formData" label-width="120px" class="custom-form" :disabled="isReadonly">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
@ -105,8 +105,15 @@ import { ref, reactive, watch, onMounted, computed } from 'vue';
|
||||
import { CRUD_OPTIONS } from '@/config';
|
||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||
import { getMemberList, addMember, updateMember, deleteMembers } from '@/apis/businessEntity';
|
||||
import { useCoop } from '../../../../store/modules/coop';
|
||||
const defaultFormData = useCoop().$state.data;
|
||||
// import { useCoop } from '../../../../store/modules/coop';
|
||||
// const defaultFormData = useCoop().$state.data;
|
||||
|
||||
const props = defineProps({
|
||||
entId: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const dialogTitle = ref('新增');
|
||||
const dialogVisible = ref(false);
|
||||
@ -121,36 +128,36 @@ const pageData = ref({
|
||||
total: 0,
|
||||
});
|
||||
const searchForm = ref({
|
||||
entId: '',
|
||||
entId: props.entId,
|
||||
userId: '',
|
||||
});
|
||||
const crudData = ref([]);
|
||||
// 定义默认表单数据
|
||||
// const defaultFormData = {
|
||||
// id: '',
|
||||
// entId: '',
|
||||
// name: '',
|
||||
// idType: '101',
|
||||
// idCard: '',
|
||||
// sex: '1',
|
||||
// age: '',
|
||||
// phone: '',
|
||||
// provinceCode: '', // 省
|
||||
// cityCode: '', // 市
|
||||
// countyCode: '', // 区县
|
||||
// townCode: '', // 镇
|
||||
// street: '', // 村
|
||||
// addressArr: [],
|
||||
// detailAddress: '',
|
||||
// area: '',
|
||||
// planCrop: '',
|
||||
// planCropName: '',
|
||||
// address: '',
|
||||
// createTime: '',
|
||||
// createUser: '',
|
||||
// updateTime: '',
|
||||
// updateUser: '',
|
||||
// };
|
||||
const defaultFormData = {
|
||||
id: '',
|
||||
entId: '',
|
||||
name: '',
|
||||
idType: '101',
|
||||
idCard: '',
|
||||
sex: '1',
|
||||
age: '',
|
||||
phone: '',
|
||||
provinceCode: '', // 省
|
||||
cityCode: '', // 市
|
||||
countyCode: '', // 区县
|
||||
townCode: '', // 镇
|
||||
street: '', // 村
|
||||
addressArr: [],
|
||||
detailAddress: '',
|
||||
area: '',
|
||||
planCrop: '',
|
||||
planCropName: '',
|
||||
address: '',
|
||||
createTime: '',
|
||||
createUser: '',
|
||||
updateTime: '',
|
||||
updateUser: '',
|
||||
};
|
||||
// 新增表单数据,使用默认数据初始化
|
||||
const formData = ref({ ...defaultFormData });
|
||||
const resetForm = () => {
|
||||
@ -183,7 +190,7 @@ const crudOptions = reactive({
|
||||
{ label: '年龄', prop: 'age' },
|
||||
{ label: '联系方式', prop: 'phone' },
|
||||
{ label: '居住地行政区划', prop: 'address' },
|
||||
{ label: '种植作物', prop: 'planCrop' },
|
||||
{ label: '种植作物', prop: 'planCropName' },
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
@ -204,15 +211,22 @@ const crudOptions = reactive({
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const syncAddressToForm = () => {
|
||||
const arr = formData.value.addressArr || [];
|
||||
[formData.value.provinceCode, formData.value.cityCode, formData.value.countyCode, formData.value.townCode, formData.value.villageCode] = arr;
|
||||
};
|
||||
async function getData() {
|
||||
loading.value = true;
|
||||
try {
|
||||
const params = {
|
||||
...searchForm.value,
|
||||
// ...searchForm.value,
|
||||
entId: props.entId,
|
||||
current: pageData.value.currentPage,
|
||||
size: pageData.value.pageSize,
|
||||
};
|
||||
if (!props.entId) {
|
||||
return;
|
||||
}
|
||||
const response = await getMemberList(params);
|
||||
if (response.code === 200 && response.data) {
|
||||
crudData.value = response.data.records;
|
||||
@ -231,16 +245,25 @@ async function getData() {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
getData();
|
||||
|
||||
onMounted(() => {
|
||||
getData();
|
||||
});
|
||||
// onMounted(() => {
|
||||
// getData();
|
||||
// });
|
||||
watch(
|
||||
() => props.entId,
|
||||
() => {
|
||||
getData();
|
||||
}
|
||||
);
|
||||
|
||||
const handleSave = async () => {
|
||||
try {
|
||||
let response;
|
||||
syncAddressToForm();
|
||||
if (dialogTitle.value === '新增') {
|
||||
// 新增操作调用 saveFarmerList 接口
|
||||
formData.value.entId = props.entId;
|
||||
response = await addMember(formData.value);
|
||||
if (response.code === 200) {
|
||||
ElMessage.success('新增成功');
|
||||
@ -266,18 +289,6 @@ const handleSave = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// watch(
|
||||
// () => formData.value.addressArr,
|
||||
// (newValue) => {
|
||||
// if (newValue.length <= 3) {
|
||||
// formData.value.provinceCode = '530000';
|
||||
// formData.value.cityCode = '530900';
|
||||
// formData.value.countyCode = newValue[0];
|
||||
// formData.value.townCode = newValue[1];
|
||||
// formData.value.street = newValue[2];
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
const handleAdd = () => {
|
||||
isReadonly.value = false; // 设置为可编辑模式
|
||||
resetForm();
|
||||
@ -289,7 +300,7 @@ function handleView(row) {
|
||||
dialogTitle.value = '查看';
|
||||
isReadonly.value = true; // 设置为只读模式
|
||||
dialogVisible.value = true;
|
||||
const addressArr = [row.countyCode, row.townCode, row.street].filter(Boolean);
|
||||
const addressArr = [row.provinceCode || '', row.cityCode || '', row.countyCode || '', row.townCode || '', row.villageCode || ''];
|
||||
formData.value = {
|
||||
...row,
|
||||
addressArr,
|
||||
@ -300,7 +311,7 @@ async function handleEdit(row) {
|
||||
dialogTitle.value = '编辑';
|
||||
isReadonly.value = false;
|
||||
dialogVisible.value = true;
|
||||
const addressArr = [row.countyCode, row.townCode, row.street].filter(Boolean);
|
||||
const addressArr = [row.provinceCode || '', row.cityCode || '', row.countyCode || '', row.townCode || '', row.villageCode || ''];
|
||||
formData.value = {
|
||||
...row,
|
||||
addressArr,
|
||||
|
||||
@ -71,10 +71,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, watch } from 'vue';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
import { useCoop } from '../../../../store/modules/coop';
|
||||
const localForm = useCoop().$state.data;
|
||||
import { toRefs, reactive, watch } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
@ -86,25 +83,8 @@ const props = defineProps({
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:modelValue']);
|
||||
|
||||
// 创建本地副本(为了避免直接修改 props)
|
||||
// const localForm = reactive(cloneDeep(props.modelValue));
|
||||
|
||||
// 监听本地副本的变化,自动回传给父组件
|
||||
// watch(
|
||||
// localForm,
|
||||
// (newVal) => {
|
||||
// emit('update:modelValue', { ...newVal });
|
||||
// },
|
||||
// { deep: true }
|
||||
// );
|
||||
// watch(
|
||||
// () => props.modelValue,
|
||||
// (newVal) => {
|
||||
// Object.assign(localForm, cloneDeep(newVal));
|
||||
// },
|
||||
// { deep: true }
|
||||
// );
|
||||
// 解构出响应式引用,保持与父组件绑定
|
||||
const { modelValue: localForm } = toRefs(props);
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<el-button type="primary" icon="Plus" @click="handleAdd">新增</el-button>
|
||||
</template>
|
||||
<template #menu="scope">
|
||||
<custom-table-operate :actions="crudOptions.actions" :data="scope" />
|
||||
<custom-table-operate :actions="getActions(scope.row)" :data="scope" />
|
||||
</template>
|
||||
</avue-crud>
|
||||
<el-dialog :key="dialogTitle" v-model="visible" :title="dialogTitle" width="60%" align-center :draggable="true">
|
||||
@ -23,7 +23,7 @@
|
||||
<TabBasicInfo v-model="formData" :readonly="isReadonly" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="登记注册信息" name="register">
|
||||
<TabRegister v-model="formData" />
|
||||
<TabRegister v-model="formData" :readonly="isReadonly" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="经营信息" name="business">
|
||||
<TabBusinessInfo v-model="formData" :readonly="isReadonly" />
|
||||
@ -31,8 +31,8 @@
|
||||
<el-tab-pane label="信用评级" name="credit">
|
||||
<TabCreditEvaluation v-model="formData" :readonly="isReadonly" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane v-if="dialogTitle === '查看'" label="职工/社员管理" name="employee">
|
||||
<TabMember :readonly="isReadonly" />
|
||||
<el-tab-pane v-if="dialogTitle !== '新增'" label="职工/社员管理" name="employee">
|
||||
<TabMember :readonly="isReadonly" :ent-id="formData.id" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
@ -57,10 +57,6 @@ import TabBusinessInfo from './components/TabBusinessInfo.vue';
|
||||
import TabCreditEvaluation from './components/TabCreditEvaluation.vue';
|
||||
import TabMember from './components/TabMember.vue';
|
||||
import { getEnterList, getEnterById, addEnter, updateEnter, approvalEnter, deleteEnter } from '@/apis/businessEntity';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import { useCoop } from '../../../store/modules/coop';
|
||||
|
||||
const useCoopData = useCoop();
|
||||
|
||||
// 控制弹窗显示
|
||||
const visible = ref(false);
|
||||
@ -76,6 +72,7 @@ const searchForm = ref({
|
||||
productType: '',
|
||||
primaryProduct: '',
|
||||
});
|
||||
const initialSearchForm = { ...searchForm.value };
|
||||
// 数据和状态
|
||||
const formData = ref({
|
||||
id: '',
|
||||
@ -116,6 +113,19 @@ const formData = ref({
|
||||
techApplication: 2,
|
||||
productQuality: 1,
|
||||
});
|
||||
const initialFormData = { ...formData.value };
|
||||
|
||||
const resetForm = () => {
|
||||
formData.value = { ...initialFormData };
|
||||
};
|
||||
const syncAddressToForm = () => {
|
||||
const arr = Array.isArray(formData.value.addressArr) ? formData.value.addressArr : [];
|
||||
formData.value.provinceCode = arr[0] || '';
|
||||
formData.value.cityCode = arr[1] || '';
|
||||
formData.value.countyCode = arr[2] || '';
|
||||
formData.value.townCode = arr[3] || '';
|
||||
formData.value.villageCode = arr[4] || '';
|
||||
};
|
||||
|
||||
// 保存处理
|
||||
const handleSubmit = async () => {
|
||||
@ -124,27 +134,22 @@ const handleSubmit = async () => {
|
||||
let response;
|
||||
if (dialogTitle.value === '新增') {
|
||||
formData.value.id = '';
|
||||
syncAddressToForm();
|
||||
response = await addEnter(formData.value);
|
||||
if (response.code === 200) {
|
||||
ElMessage.success('新增成功');
|
||||
visible.value = false;
|
||||
getData(); // 刷新表格数据
|
||||
getData();
|
||||
}
|
||||
} else if (dialogTitle.value === '编辑') {
|
||||
formData.value.provinceCode = formData.value.addressArr[0];
|
||||
formData.value.cityCode = formData.value.addressArr[1];
|
||||
formData.value.countyCode = formData.value.addressArr[2];
|
||||
formData.value.townCode = formData.value.addressArr[3];
|
||||
formData.value.villageCode = formData.value.addressArr[4];
|
||||
|
||||
syncAddressToForm();
|
||||
response = await updateEnter(formData.value);
|
||||
if (response.code === 200) {
|
||||
ElMessage.success('编辑成功');
|
||||
visible.value = false;
|
||||
getData(); // 刷新表格数据
|
||||
getData();
|
||||
}
|
||||
}
|
||||
// 可刷新表格数据
|
||||
} catch (e) {
|
||||
ElMessage.error('保存失败');
|
||||
} finally {
|
||||
@ -168,88 +173,16 @@ const crudOptions = reactive({
|
||||
searchBtn: false,
|
||||
emptyBtn: false,
|
||||
column: [
|
||||
{ label: '农企/合作社名称', prop: 'businessName' },
|
||||
{ label: '地点', prop: 'regAddress' },
|
||||
{ label: '面积', prop: 'area' },
|
||||
{ label: '企业名称', prop: 'businessName' },
|
||||
{ label: '所属行政区划', prop: 'address' },
|
||||
{ label: '面积', prop: 'area', formatter: (row, column, cellValue) => `${Number(cellValue).toFixed(2)} 亩` },
|
||||
{ label: '经营产品', prop: 'businessScope' },
|
||||
{ label: '联系人', prop: 'contactPerson' },
|
||||
{ label: '联系电话', prop: 'phone' },
|
||||
{ label: '聘工人数', prop: 'villageCount' },
|
||||
{ label: '状态', prop: 'status' },
|
||||
// { label: '聘工人数', prop: 'villageCount' },
|
||||
{ label: '信息录入时间', prop: 'createTime' },
|
||||
{ label: '信息更新时间', prop: 'updateTime' },
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
name: '查看',
|
||||
icon: 'view',
|
||||
event: ({ row }) => handleView(row),
|
||||
},
|
||||
{
|
||||
name: '编辑',
|
||||
icon: 'edit',
|
||||
event: ({ row }) => handleEdit(row),
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
name: '删除',
|
||||
icon: 'delete',
|
||||
event: ({ row }) => handleDelete(row.id),
|
||||
},
|
||||
// 驳回原因 showRejectReason (仅显示)
|
||||
{
|
||||
name: '驳回原因',
|
||||
icon: 'warning',
|
||||
event: ({ row }) => {
|
||||
showRejectReason(row);
|
||||
},
|
||||
},
|
||||
|
||||
// 提交审核 handleSubmit
|
||||
{
|
||||
name: '提交审核',
|
||||
icon: 'check',
|
||||
event: ({ row }) => {
|
||||
if (row.status === '待提交') {
|
||||
handleSubmit();
|
||||
} else {
|
||||
ElMessage.warning('当前状态不允许提交审核');
|
||||
}
|
||||
},
|
||||
},
|
||||
// 撤销(待审核 → 待提交),超级管理员和提交人拥有撤销 handleWithdraw
|
||||
{
|
||||
name: '撤销',
|
||||
icon: 'undo',
|
||||
event: ({ row }) => {
|
||||
handleWithdraw(row);
|
||||
},
|
||||
},
|
||||
// 重新提交 handleResubmit
|
||||
{
|
||||
name: '重新提交',
|
||||
icon: 'resubmit',
|
||||
event: (row) => {
|
||||
handleResubmit(row);
|
||||
},
|
||||
},
|
||||
// 通过(待审核 → 已通过) handleApprove
|
||||
{
|
||||
name: '通过',
|
||||
icon: 'check-circle',
|
||||
event: ({ row }) => {
|
||||
handleApprove(row);
|
||||
},
|
||||
},
|
||||
// 驳回(待审核 → 已驳回) handleReject
|
||||
{
|
||||
name: '驳回',
|
||||
icon: 'close-circle',
|
||||
event: ({ row }) => {
|
||||
handleReject(row);
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
// watch(
|
||||
// () => formData.value.addressArr,
|
||||
@ -279,7 +212,6 @@ const getData = async () => {
|
||||
page: pageData.value.currentPage,
|
||||
size: pageData.value.pageSize,
|
||||
});
|
||||
console.log('response', response);
|
||||
crudData.value = response.data.records;
|
||||
pageData.value.total = response.data.total;
|
||||
pageData.value.currentPage = response.data.current;
|
||||
@ -293,47 +225,20 @@ const getData = async () => {
|
||||
|
||||
const getEnterDetail = async (id) => {
|
||||
try {
|
||||
resetForm();
|
||||
const response = await getEnterById(id);
|
||||
if (response?.code === 200 && response.data) {
|
||||
// 使用深拷贝避免污染原始数据
|
||||
formData.value = {
|
||||
...cloneDeep(response.data),
|
||||
// 确保addressArr始终是5个元素,不足的用空字符串填充
|
||||
addressArr: [
|
||||
response.data.provinceCode || '',
|
||||
response.data.cityCode || '',
|
||||
response.data.countyCode || '',
|
||||
response.data.townCode || '',
|
||||
response.data.villageCode || '',
|
||||
],
|
||||
};
|
||||
|
||||
// // 初始化图片预览(如果之前实现了图片预览功能)
|
||||
// if (response.data.cooperativePhoto) {
|
||||
// cooperativePhotoList.value = [
|
||||
// {
|
||||
// name: '合作社照片',
|
||||
// url: response.data.cooperativePhoto,
|
||||
// status: 'success',
|
||||
// },
|
||||
// ];
|
||||
// }
|
||||
// if (response.data.businessLicence) {
|
||||
// businessLicenceList.value = [
|
||||
// {
|
||||
// name: '营业执照',
|
||||
// url: response.data.businessLicence,
|
||||
// status: 'success',
|
||||
// },
|
||||
// ];
|
||||
// }
|
||||
|
||||
console.log('详情数据加载完成', formData.value);
|
||||
} else {
|
||||
ElMessage.error(response?.msg || '获取详情失败:服务器未返回有效数据');
|
||||
}
|
||||
formData.value = {
|
||||
...response.data,
|
||||
// 确保addressArr始终是5个元素,不足的用空字符串填充
|
||||
addressArr: [
|
||||
response.data.provinceCode || '',
|
||||
response.data.cityCode || '',
|
||||
response.data.countyCode || '',
|
||||
response.data.townCode || '',
|
||||
response.data.villageCode || '',
|
||||
],
|
||||
};
|
||||
} catch (error) {
|
||||
console.error('获取详情失败:', error);
|
||||
ElMessage.error(`获取详情失败:${error.message || '请稍后重试'}`);
|
||||
}
|
||||
};
|
||||
@ -345,9 +250,8 @@ function handleTabChange(tab) {
|
||||
}
|
||||
|
||||
const handleAdd = () => {
|
||||
useCoopData.getData({});
|
||||
isReadonly.value = false;
|
||||
// resetForm();
|
||||
resetForm();
|
||||
dialogTitle.value = '新增';
|
||||
visible.value = true;
|
||||
};
|
||||
@ -355,7 +259,6 @@ const handleAdd = () => {
|
||||
const handleView = async (row) => {
|
||||
loading.value = true;
|
||||
dialogTitle.value = '查看';
|
||||
formData.value = null;
|
||||
try {
|
||||
await getEnterDetail(row.id);
|
||||
isReadonly.value = true;
|
||||
@ -368,14 +271,10 @@ const handleView = async (row) => {
|
||||
|
||||
// 编辑详情(可修改)
|
||||
const handleEdit = async (row) => {
|
||||
console.log(row);
|
||||
formData.value = row;
|
||||
formData.value.addressArr = [row.provinceCode, row.cityCode, row.countyCode, row.townCode, row.villageCode];
|
||||
useCoopData.getData(formData.value);
|
||||
loading.value = true;
|
||||
dialogTitle.value = '编辑';
|
||||
try {
|
||||
await getEnterById(row.id);
|
||||
await getEnterDetail(row.id);
|
||||
isReadonly.value = false;
|
||||
activeTab.value = 'basic';
|
||||
visible.value = true;
|
||||
@ -383,6 +282,26 @@ const handleEdit = async (row) => {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
// 提交审核
|
||||
const handleSubmitApprove = async (row) => {
|
||||
try {
|
||||
const params = {
|
||||
id: row.id,
|
||||
status: '1', // 待审核
|
||||
reason: '提交审核',
|
||||
};
|
||||
const res = await approvalEnter(params);
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('提交审核成功');
|
||||
row.status = '1';
|
||||
getData(); // 刷新表格数据
|
||||
} else {
|
||||
ElMessage.error(res.msg || '提交审核失败');
|
||||
}
|
||||
} catch (error) {
|
||||
ElMessage.error('提交审核失败');
|
||||
}
|
||||
};
|
||||
// 重新提交(被驳回 → 待审核)
|
||||
function handleResubmit(row) {
|
||||
ElMessageBox.confirm('确认重新提交吗?', '重新提交').then(() => {
|
||||
@ -534,6 +453,85 @@ function handleSkipSave() {
|
||||
handleSkip();
|
||||
handleSubmit();
|
||||
}
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
const UserStore = useUserStore();
|
||||
const user = UserStore.getUserInfo();
|
||||
console.log('admin 属性:', user.admin);
|
||||
const isAdmin = user.admin;
|
||||
const getActions = (row) => {
|
||||
const actions = [
|
||||
{
|
||||
name: '查看',
|
||||
icon: 'view',
|
||||
event: () => handleView(row),
|
||||
},
|
||||
{
|
||||
name: '编辑',
|
||||
icon: 'edit',
|
||||
event: () => handleEdit(row),
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
name: '删除',
|
||||
icon: 'delete',
|
||||
event: () => handleDelete(row.id),
|
||||
},
|
||||
];
|
||||
|
||||
switch (row.status) {
|
||||
case '0': // 待提交
|
||||
actions.push(
|
||||
{
|
||||
name: '提交审核',
|
||||
icon: 'check',
|
||||
event: () => handleSubmitApprove(row),
|
||||
},
|
||||
{
|
||||
name: '重新提交',
|
||||
icon: 'resubmit',
|
||||
event: () => handleResubmit(row),
|
||||
}
|
||||
);
|
||||
break;
|
||||
|
||||
case '1': // 待审核
|
||||
if (isAdmin) {
|
||||
actions.push(
|
||||
{
|
||||
name: '通过',
|
||||
icon: 'check-circle',
|
||||
event: () => handleApprove(row),
|
||||
},
|
||||
{
|
||||
name: '驳回',
|
||||
icon: 'close-circle',
|
||||
event: () => handleReject(row),
|
||||
}
|
||||
);
|
||||
} else {
|
||||
actions.push({
|
||||
name: '撤销',
|
||||
icon: 'undo',
|
||||
event: () => handleWithdraw(row),
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
case '2': // 已通过
|
||||
// 仅基础操作
|
||||
break;
|
||||
|
||||
case '3': // 已驳回
|
||||
actions.push({
|
||||
name: '驳回原因',
|
||||
icon: 'warning',
|
||||
event: () => showRejectReason(row),
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
return actions;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
</avue-crud>
|
||||
|
||||
<!-- 新增弹窗 -->
|
||||
<el-dialog :key="dialogTitle" v-model="dialogVisible" :title="dialogTitle" width="80%" align-center :draggable="true">
|
||||
<el-dialog :key="dialogTitle" v-model="dialogVisible" :title="dialogTitle" width="60%" align-center :draggable="true">
|
||||
<el-form :model="formData" label-width="120px" class="custom-form" :disabled="isReadonly">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
@ -354,21 +354,17 @@ const getFarmerById = async (id) => {
|
||||
};
|
||||
// 查看
|
||||
async function handleView(row) {
|
||||
console.log('查看', row);
|
||||
dialogTitle.value = '查看';
|
||||
isReadonly.value = true; // 设置为只读模式
|
||||
|
||||
const data = await getFarmerById(row.id);
|
||||
if (data) {
|
||||
console.log('data :>> ', data);
|
||||
const addressArr = [data.provinceCode, data.cityCode, data.countyCode, data.townCode, data.villageCode].filter(Boolean);
|
||||
console.log('addressArr :>> ', addressArr);
|
||||
formData.value = {
|
||||
...data,
|
||||
addressArr: addressArr,
|
||||
};
|
||||
}
|
||||
console.log('cc formData.value :>> ', formData.value.addressArr);
|
||||
nextTick(() => {
|
||||
dialogVisible.value = true;
|
||||
});
|
||||
@ -387,15 +383,18 @@ async function handleEdit(row) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
const data = await getFarmerById(row.id);
|
||||
if (data) {
|
||||
const addressArr = [data.provinceCode, data.cityCode, data.countyCode, data.townCode, data.villageCode].filter(Boolean);
|
||||
formData.value = {
|
||||
...data,
|
||||
addressArr: addressArr,
|
||||
};
|
||||
}
|
||||
dialogTitle.value = '编辑';
|
||||
isReadonly.value = false;
|
||||
dialogVisible.value = true;
|
||||
getFarmerById(row.id).then((data) => {
|
||||
if (data) {
|
||||
formData.value = {
|
||||
...data,
|
||||
};
|
||||
}
|
||||
nextTick(() => {
|
||||
dialogVisible.value = true;
|
||||
});
|
||||
}
|
||||
|
||||
@ -409,7 +408,6 @@ function handleSubmit(row) {
|
||||
};
|
||||
approveFarmer(params)
|
||||
.then(() => {
|
||||
console.log(`ID=${row.id} 提交审核`);
|
||||
row.rejectReason = ''; // 清空驳回原因
|
||||
getData(); // 重新获取数据
|
||||
})
|
||||
|
||||
@ -0,0 +1,324 @@
|
||||
<template>
|
||||
<div class="custom-page">
|
||||
<h1>耕地</h1>
|
||||
<!-- 搜索 -->
|
||||
<el-form :inline="true" :model="searchForm" class="search-bar">
|
||||
<el-form-item label="关键词">
|
||||
<el-input v-model="searchForm.name" placeholder="请输入关键词" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item lable="">
|
||||
<AreaCascader v-model:region-code="searchForm.regionCode" v-model:grid-id="searchForm.id" :width="600" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearch"> 搜索 </el-button>
|
||||
<el-button @click="resetSearch"> 重置 </el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 四个固定 Tabs -->
|
||||
<el-tabs v-model="activeTab" @tab-click="handleTabChange">
|
||||
<!-- <el-tab-pane label="待提交" name="0" /> -->
|
||||
<el-tab-pane label="待审核" name="1" />
|
||||
<el-tab-pane label="已通过" name="2" />
|
||||
<el-tab-pane label="已驳回" name="0" />
|
||||
</el-tabs>
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
v-model:page="pageData"
|
||||
:data="crudData"
|
||||
:option="crudOptions"
|
||||
:table-loading="loading"
|
||||
@current-change="handleCurrentChange"
|
||||
@size-change="handleSizeChange"
|
||||
>
|
||||
<!-- <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="100px" class="form-item">
|
||||
<p class="form-title">填写网格信息</p>
|
||||
<el-form-item label="网格名称" prop="gridName">
|
||||
<el-input v-model="formData.gridName" 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="scopeImg">
|
||||
<FileUploader v-model="formData.scopeImg" :limit="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="note">
|
||||
<el-input v-model="formData.note" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</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';
|
||||
import { mockData } from './landData';
|
||||
|
||||
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 activeTab = ref('1');
|
||||
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,
|
||||
header: false,
|
||||
searchBtn: false,
|
||||
emptyBtn: false,
|
||||
refreshBtn: false,
|
||||
height: 'calc(100vh - 360px)',
|
||||
column: [
|
||||
{ label: '地块编号', prop: 'id', width: 160 },
|
||||
{ label: '地块名称', prop: 'landName', width: 170 },
|
||||
{ label: '面积', prop: 'area', formatter: (row, column, cellValue) => `${Number(cellValue).toFixed(2)} 亩` },
|
||||
{ label: '土地分类', prop: 'landTypeName' },
|
||||
{ label: '土壤类型', prop: 'soilTypeName' },
|
||||
{ label: '所属行政区域', prop: 'fullRegionName', width: 160 },
|
||||
{ label: '所属网格', prop: 'gridName', width: 90 },
|
||||
{ label: '具体位置', prop: 'address', width: 160 },
|
||||
{ label: '土地承包经营人', prop: 'propertyName' },
|
||||
{ label: '联系电话', prop: 'propertyPhone' },
|
||||
{ label: '土地经营权证书编号', prop: 'landCode', width: 160 },
|
||||
{ label: '是否土地流转', prop: 'isTransfer' },
|
||||
{ label: '土地受让方', prop: 'transferName' },
|
||||
{ label: '受让方联系电话', prop: 'transferPhone', width: 100 },
|
||||
{ label: '流转合同', prop: 'transferContract' },
|
||||
{ label: '信息填报人', prop: 'fillName' },
|
||||
{ label: '信息填报单位', prop: 'fillGroup' },
|
||||
{ label: '信息填报时间', prop: 'fillTime' },
|
||||
// { label: '信息更新人', prop: 'updateName' },
|
||||
// { label: '信息更新单位', prop: 'updateGroup' },
|
||||
{ label: '信息更新时间', prop: 'updateTime' },
|
||||
],
|
||||
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 handleTabChange = ({ name }) => {
|
||||
// activeTab.value = name;
|
||||
console.log('切换tab', activeTab.value);
|
||||
getData();
|
||||
};
|
||||
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) => {
|
||||
console.log('删除', 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';
|
||||
|
||||
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 : [];
|
||||
loading.value = true;
|
||||
// 模拟接口延迟
|
||||
await new Promise((resolve) => setTimeout(resolve, 300));
|
||||
crudData.value = mockData.filter((item) => item.status === activeTab.value);
|
||||
pageData.value.total = crudData.value.length;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
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">
|
||||
.custom-page {
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
h1 {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.search-bar {
|
||||
padding-left: 20px;
|
||||
}
|
||||
: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 {
|
||||
width: 500px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.dialog-footer {
|
||||
text-align: center;
|
||||
}
|
||||
.custom-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 20px;
|
||||
|
||||
.el-button {
|
||||
margin-left: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,329 @@
|
||||
<template>
|
||||
<div class="custom-page">
|
||||
<h1>林地</h1>
|
||||
<!-- 搜索 -->
|
||||
<el-form :inline="true" :model="searchForm" class="search-bar">
|
||||
<el-form-item label="关键词">
|
||||
<el-input v-model="searchForm.name" placeholder="请输入关键词" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item lable="">
|
||||
<AreaCascader v-model:region-code="searchForm.regionCode" v-model:grid-id="searchForm.id" :width="600" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearch"> 搜索 </el-button>
|
||||
<el-button @click="resetSearch"> 重置 </el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 四个固定 Tabs -->
|
||||
<el-tabs v-model="activeTab" @tab-click="handleTabChange">
|
||||
<!-- <el-tab-pane label="待提交" name="0" /> -->
|
||||
<el-tab-pane label="待审核" name="1" />
|
||||
<el-tab-pane label="已通过" name="2" />
|
||||
<el-tab-pane label="已驳回" name="0" />
|
||||
</el-tabs>
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
v-model:page="pageData"
|
||||
:data="crudData"
|
||||
:option="crudOptions"
|
||||
:table-loading="loading"
|
||||
@current-change="handleCurrentChange"
|
||||
@size-change="handleSizeChange"
|
||||
>
|
||||
<!-- <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="100px" class="form-item">
|
||||
<p class="form-title">填写网格信息</p>
|
||||
<el-form-item label="网格名称" prop="gridName">
|
||||
<el-input v-model="formData.gridName" 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="scopeImg">
|
||||
<FileUploader v-model="formData.scopeImg" :limit="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="note">
|
||||
<el-input v-model="formData.note" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</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';
|
||||
import { mockData } from './landData';
|
||||
|
||||
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 activeTab = ref('1');
|
||||
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,
|
||||
header: false,
|
||||
searchBtn: false,
|
||||
emptyBtn: false,
|
||||
refreshBtn: false,
|
||||
height: 'calc(100vh - 360px)',
|
||||
column: [
|
||||
{ label: '地块编号', prop: 'id', width: 160 },
|
||||
{ label: '地块名称', prop: 'landName', width: 170 },
|
||||
{ label: '面积', prop: 'area', formatter: (row, column, cellValue) => `${Number(cellValue).toFixed(2)} 亩` },
|
||||
{ label: '土地分类', prop: 'landTypeName' },
|
||||
{ label: '土壤类型', prop: 'soilTypeName' },
|
||||
{ label: '所属行政区域', prop: 'fullRegionName', width: 160 },
|
||||
{ label: '所属网格', prop: 'gridName', width: 90 },
|
||||
{ label: '具体位置', prop: 'address', width: 160 },
|
||||
{ label: '土地承包经营人', prop: 'propertyName' },
|
||||
{ label: '联系电话', prop: 'propertyPhone' },
|
||||
{ label: '土地经营权证书编号', prop: 'landCode', width: 160 },
|
||||
{ label: '是否土地流转', prop: 'isTransfer' },
|
||||
{ label: '土地受让方', prop: 'transferName' },
|
||||
{ label: '受让方联系电话', prop: 'transferPhone', width: 100 },
|
||||
{ label: '流转合同', prop: 'transferContract' },
|
||||
{ label: '信息填报人', prop: 'fillName' },
|
||||
{ label: '信息填报单位', prop: 'fillGroup' },
|
||||
{ label: '信息填报时间', prop: 'fillTime' },
|
||||
// { label: '信息更新人', prop: 'updateName' },
|
||||
// { label: '信息更新单位', prop: 'updateGroup' },
|
||||
{ label: '信息更新时间', prop: 'updateTime' },
|
||||
],
|
||||
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 handleTabChange = ({ name }) => {
|
||||
// activeTab.value = name;
|
||||
console.log('切换tab', activeTab.value);
|
||||
getData();
|
||||
};
|
||||
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) => {
|
||||
console.log('删除', 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';
|
||||
|
||||
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 : [];
|
||||
loading.value = true;
|
||||
// 模拟接口延迟
|
||||
await new Promise((resolve) => setTimeout(resolve, 300));
|
||||
crudData.value = mockData
|
||||
.filter((item) => item.status === activeTab.value)
|
||||
.map((item) => ({
|
||||
...item,
|
||||
landTypeName: '林地',
|
||||
}));
|
||||
pageData.value.total = crudData.value.length;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
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">
|
||||
.custom-page {
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
h1 {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.search-bar {
|
||||
padding-left: 20px;
|
||||
}
|
||||
: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 {
|
||||
width: 500px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.dialog-footer {
|
||||
text-align: center;
|
||||
}
|
||||
.custom-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 20px;
|
||||
|
||||
.el-button {
|
||||
margin-left: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,329 @@
|
||||
<template>
|
||||
<div class="custom-page">
|
||||
<h1>草地</h1>
|
||||
<!-- 搜索 -->
|
||||
<el-form :inline="true" :model="searchForm" class="search-bar">
|
||||
<el-form-item label="关键词">
|
||||
<el-input v-model="searchForm.name" placeholder="请输入关键词" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item lable="">
|
||||
<AreaCascader v-model:region-code="searchForm.regionCode" v-model:grid-id="searchForm.id" :width="600" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearch"> 搜索 </el-button>
|
||||
<el-button @click="resetSearch"> 重置 </el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 四个固定 Tabs -->
|
||||
<el-tabs v-model="activeTab" @tab-click="handleTabChange">
|
||||
<!-- <el-tab-pane label="待提交" name="0" /> -->
|
||||
<el-tab-pane label="待审核" name="1" />
|
||||
<el-tab-pane label="已通过" name="2" />
|
||||
<el-tab-pane label="已驳回" name="0" />
|
||||
</el-tabs>
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
v-model:page="pageData"
|
||||
:data="crudData"
|
||||
:option="crudOptions"
|
||||
:table-loading="loading"
|
||||
@current-change="handleCurrentChange"
|
||||
@size-change="handleSizeChange"
|
||||
>
|
||||
<!-- <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="100px" class="form-item">
|
||||
<p class="form-title">填写网格信息</p>
|
||||
<el-form-item label="网格名称" prop="gridName">
|
||||
<el-input v-model="formData.gridName" 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="scopeImg">
|
||||
<FileUploader v-model="formData.scopeImg" :limit="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="note">
|
||||
<el-input v-model="formData.note" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</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';
|
||||
import { mockData } from './landData';
|
||||
|
||||
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 activeTab = ref('1');
|
||||
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,
|
||||
header: false,
|
||||
searchBtn: false,
|
||||
emptyBtn: false,
|
||||
refreshBtn: false,
|
||||
height: 'calc(100vh - 360px)',
|
||||
column: [
|
||||
{ label: '地块编号', prop: 'id', width: 160 },
|
||||
{ label: '地块名称', prop: 'landName', width: 170 },
|
||||
{ label: '面积', prop: 'area', formatter: (row, column, cellValue) => `${Number(cellValue).toFixed(2)} 亩` },
|
||||
{ label: '土地分类', prop: 'landTypeName' },
|
||||
{ label: '土壤类型', prop: 'soilTypeName' },
|
||||
{ label: '所属行政区域', prop: 'fullRegionName', width: 160 },
|
||||
{ label: '所属网格', prop: 'gridName', width: 90 },
|
||||
{ label: '具体位置', prop: 'address', width: 160 },
|
||||
{ label: '土地承包经营人', prop: 'propertyName' },
|
||||
{ label: '联系电话', prop: 'propertyPhone' },
|
||||
{ label: '土地经营权证书编号', prop: 'landCode', width: 160 },
|
||||
{ label: '是否土地流转', prop: 'isTransfer' },
|
||||
{ label: '土地受让方', prop: 'transferName' },
|
||||
{ label: '受让方联系电话', prop: 'transferPhone', width: 100 },
|
||||
{ label: '流转合同', prop: 'transferContract' },
|
||||
{ label: '信息填报人', prop: 'fillName' },
|
||||
{ label: '信息填报单位', prop: 'fillGroup' },
|
||||
{ label: '信息填报时间', prop: 'fillTime' },
|
||||
// { label: '信息更新人', prop: 'updateName' },
|
||||
// { label: '信息更新单位', prop: 'updateGroup' },
|
||||
{ label: '信息更新时间', prop: 'updateTime' },
|
||||
],
|
||||
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 handleTabChange = ({ name }) => {
|
||||
// activeTab.value = name;
|
||||
console.log('切换tab', activeTab.value);
|
||||
getData();
|
||||
};
|
||||
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) => {
|
||||
console.log('删除', 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';
|
||||
|
||||
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 : [];
|
||||
loading.value = true;
|
||||
// 模拟接口延迟
|
||||
await new Promise((resolve) => setTimeout(resolve, 300));
|
||||
crudData.value = mockData
|
||||
.filter((item) => item.status === activeTab.value)
|
||||
.map((item) => ({
|
||||
...item,
|
||||
landTypeName: '草地',
|
||||
}));
|
||||
pageData.value.total = crudData.value.length;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
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">
|
||||
.custom-page {
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
h1 {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.search-bar {
|
||||
padding-left: 20px;
|
||||
}
|
||||
: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 {
|
||||
width: 500px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.dialog-footer {
|
||||
text-align: center;
|
||||
}
|
||||
.custom-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 20px;
|
||||
|
||||
.el-button {
|
||||
margin-left: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<div class="custom-page" :style="`background-image: url(${getAssetsFile('images/landBase/land1.png')})`">
|
||||
<!-- <h1>统计数据</h1>
|
||||
<div class="content"></div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch, onMounted, computed } from 'vue';
|
||||
import { getAssetsFile } from '@/utils';
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.custom-page {
|
||||
height: calc(100vh - 150px);
|
||||
background-size: cover;
|
||||
// background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,329 @@
|
||||
<template>
|
||||
<div class="custom-page">
|
||||
<h1>园地</h1>
|
||||
<!-- 搜索 -->
|
||||
<el-form :inline="true" :model="searchForm" class="search-bar">
|
||||
<el-form-item label="关键词">
|
||||
<el-input v-model="searchForm.name" placeholder="请输入关键词" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item lable="">
|
||||
<AreaCascader v-model:region-code="searchForm.regionCode" v-model:grid-id="searchForm.id" :width="600" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearch"> 搜索 </el-button>
|
||||
<el-button @click="resetSearch"> 重置 </el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 四个固定 Tabs -->
|
||||
<el-tabs v-model="activeTab" @tab-click="handleTabChange">
|
||||
<!-- <el-tab-pane label="待提交" name="0" /> -->
|
||||
<el-tab-pane label="待审核" name="1" />
|
||||
<el-tab-pane label="已通过" name="2" />
|
||||
<el-tab-pane label="已驳回" name="0" />
|
||||
</el-tabs>
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
v-model:page="pageData"
|
||||
:data="crudData"
|
||||
:option="crudOptions"
|
||||
:table-loading="loading"
|
||||
@current-change="handleCurrentChange"
|
||||
@size-change="handleSizeChange"
|
||||
>
|
||||
<!-- <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="100px" class="form-item">
|
||||
<p class="form-title">填写网格信息</p>
|
||||
<el-form-item label="网格名称" prop="gridName">
|
||||
<el-input v-model="formData.gridName" 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="scopeImg">
|
||||
<FileUploader v-model="formData.scopeImg" :limit="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="note">
|
||||
<el-input v-model="formData.note" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</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';
|
||||
import { mockData } from './landData';
|
||||
|
||||
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 activeTab = ref('1');
|
||||
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,
|
||||
header: false,
|
||||
searchBtn: false,
|
||||
emptyBtn: false,
|
||||
refreshBtn: false,
|
||||
height: 'calc(100vh - 360px)',
|
||||
column: [
|
||||
{ label: '地块编号', prop: 'id', width: 160 },
|
||||
{ label: '地块名称', prop: 'landName', width: 170 },
|
||||
{ label: '面积', prop: 'area', formatter: (row, column, cellValue) => `${Number(cellValue).toFixed(2)} 亩` },
|
||||
{ label: '土地分类', prop: 'landTypeName' },
|
||||
{ label: '土壤类型', prop: 'soilTypeName' },
|
||||
{ label: '所属行政区域', prop: 'fullRegionName', width: 160 },
|
||||
{ label: '所属网格', prop: 'gridName', width: 90 },
|
||||
{ label: '具体位置', prop: 'address', width: 160 },
|
||||
{ label: '土地承包经营人', prop: 'propertyName' },
|
||||
{ label: '联系电话', prop: 'propertyPhone' },
|
||||
{ label: '土地经营权证书编号', prop: 'landCode', width: 160 },
|
||||
{ label: '是否土地流转', prop: 'isTransfer' },
|
||||
{ label: '土地受让方', prop: 'transferName' },
|
||||
{ label: '受让方联系电话', prop: 'transferPhone', width: 100 },
|
||||
{ label: '流转合同', prop: 'transferContract' },
|
||||
{ label: '信息填报人', prop: 'fillName' },
|
||||
{ label: '信息填报单位', prop: 'fillGroup' },
|
||||
{ label: '信息填报时间', prop: 'fillTime' },
|
||||
// { label: '信息更新人', prop: 'updateName' },
|
||||
// { label: '信息更新单位', prop: 'updateGroup' },
|
||||
{ label: '信息更新时间', prop: 'updateTime' },
|
||||
],
|
||||
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 handleTabChange = ({ name }) => {
|
||||
// activeTab.value = name;
|
||||
console.log('切换tab', activeTab.value);
|
||||
getData();
|
||||
};
|
||||
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) => {
|
||||
console.log('删除', 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';
|
||||
|
||||
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 : [];
|
||||
loading.value = true;
|
||||
// 模拟接口延迟
|
||||
await new Promise((resolve) => setTimeout(resolve, 300));
|
||||
crudData.value = mockData
|
||||
.filter((item) => item.status === activeTab.value)
|
||||
.map((item) => ({
|
||||
...item,
|
||||
landTypeName: '园地',
|
||||
}));
|
||||
pageData.value.total = crudData.value.length;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
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">
|
||||
.custom-page {
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
h1 {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.search-bar {
|
||||
padding-left: 20px;
|
||||
}
|
||||
: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 {
|
||||
width: 500px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.dialog-footer {
|
||||
text-align: center;
|
||||
}
|
||||
.custom-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 20px;
|
||||
|
||||
.el-button {
|
||||
margin-left: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,17 @@
|
||||
<template>
|
||||
<div class="custom-page" :style="`background-image: url(${getAssetsFile('images/landBase/land2.png')})`">
|
||||
<!-- <h1>统计数据</h1>
|
||||
<div class="content"></div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch, onMounted, computed } from 'vue';
|
||||
import { getAssetsFile } from '@/utils';
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.custom-page {
|
||||
height: calc(100vh - 150px);
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,222 @@
|
||||
export const mockData = [
|
||||
{
|
||||
id: 'GM2025001',
|
||||
landName: '耿马镇允楞村耕地一号',
|
||||
area: 8.72,
|
||||
landTypeName: '耕地',
|
||||
soilTypeName: '红壤',
|
||||
fullRegionName: '云南省临沧市耿马傣族佤族自治县耿马镇允楞村',
|
||||
gridName: '耿马网格1',
|
||||
address: '允楞村委会旁',
|
||||
propertyName: '刘勇',
|
||||
propertyPhone: '15908761234',
|
||||
landCode: 'GM2025-E1',
|
||||
isTransfer: '否',
|
||||
transferName: '',
|
||||
transferPhone: '',
|
||||
transferContract: '',
|
||||
fillName: '赵敏',
|
||||
fillGroup: '耿马镇农业服务中心',
|
||||
fillTime: '2025-06-02 08:45:00',
|
||||
updateTime: '2025-06-05 13:20:30',
|
||||
status: '0',
|
||||
},
|
||||
{
|
||||
id: 'GM2025002',
|
||||
landName: '耿马镇复兴村耕地二号',
|
||||
area: 12.34,
|
||||
landTypeName: '耕地',
|
||||
soilTypeName: '黄壤',
|
||||
fullRegionName: '云南省临沧市耿马傣族佤族自治县耿马镇复兴村',
|
||||
gridName: '耿马网格A',
|
||||
address: '复兴村大路东侧',
|
||||
propertyName: '张芳',
|
||||
propertyPhone: '13607894521',
|
||||
landCode: 'GM2025-E2',
|
||||
isTransfer: '是',
|
||||
transferName: '李强',
|
||||
transferPhone: '13809123456',
|
||||
transferContract: 'HZ-GM-002.pdf',
|
||||
fillName: '王磊',
|
||||
fillGroup: '耿马镇政府',
|
||||
fillTime: '2025-06-03 09:15:00',
|
||||
updateTime: '2025-06-06 14:05:10',
|
||||
status: '1',
|
||||
},
|
||||
{
|
||||
id: 'GM2025003',
|
||||
landName: '勐撒镇城子村耕地三号',
|
||||
area: 5.6,
|
||||
landTypeName: '耕地',
|
||||
soilTypeName: '壤土',
|
||||
fullRegionName: '云南省临沧市耿马傣族佤族自治县勐撒镇城子村',
|
||||
gridName: '勐撒网格B',
|
||||
address: '城子村太阳路北侧',
|
||||
propertyName: '赵杰',
|
||||
propertyPhone: '15012346789',
|
||||
landCode: 'GM2025-E3',
|
||||
isTransfer: '否',
|
||||
transferName: '',
|
||||
transferPhone: '',
|
||||
transferContract: '',
|
||||
fillName: '孙丽',
|
||||
fillGroup: '勐撒镇农业站',
|
||||
fillTime: '2025-06-04 10:30:00',
|
||||
updateTime: '2025-06-07 16:40:45',
|
||||
status: '2',
|
||||
},
|
||||
{
|
||||
id: 'GM2025004',
|
||||
landName: '孟定镇罕宏村耕地四号',
|
||||
area: 14.28,
|
||||
landTypeName: '耕地',
|
||||
soilTypeName: '砂壤',
|
||||
fullRegionName: '云南省临沧市耿马傣族佤族自治县孟定镇罕宏村',
|
||||
gridName: '孟定网格C',
|
||||
address: '罕宏村公路旁',
|
||||
propertyName: '周涛',
|
||||
propertyPhone: '15876543210',
|
||||
landCode: 'GM2025-E4',
|
||||
isTransfer: '是',
|
||||
transferName: '吴静',
|
||||
transferPhone: '13987654321',
|
||||
transferContract: 'HZ-GM-004.pdf',
|
||||
fillName: '郑勇',
|
||||
fillGroup: '孟定镇人民政府',
|
||||
fillTime: '2025-06-05 11:50:00',
|
||||
updateTime: '2025-06-08 09:10:20',
|
||||
status: '0',
|
||||
},
|
||||
{
|
||||
id: 'GM2025005',
|
||||
landName: '贺派乡芒抗村耕地五号',
|
||||
area: 7.95,
|
||||
landTypeName: '耕地',
|
||||
soilTypeName: '钙质红壤',
|
||||
fullRegionName: '云南省临沧市耿马傣族佤族自治县贺派乡芒抗村',
|
||||
gridName: '贺派网格D',
|
||||
address: '芒抗村文化站东侧',
|
||||
propertyName: '钱海',
|
||||
propertyPhone: '13765432109',
|
||||
landCode: 'GM2025-E5',
|
||||
isTransfer: '否',
|
||||
transferName: '',
|
||||
transferPhone: '',
|
||||
transferContract: '',
|
||||
fillName: '李霞',
|
||||
fillGroup: '贺派乡农村合作社',
|
||||
fillTime: '2025-06-06 08:20:00',
|
||||
updateTime: '2025-06-09 15:35:30',
|
||||
status: '1',
|
||||
},
|
||||
{
|
||||
id: 'GM2025006',
|
||||
landName: '四排山乡东坡村耕地六号',
|
||||
area: 10.5,
|
||||
landTypeName: '耕地',
|
||||
soilTypeName: '红壤',
|
||||
fullRegionName: '云南省临沧市耿马傣族佤族自治县四排山乡东坡村',
|
||||
gridName: '四排山网格E',
|
||||
address: '东坡村卫生室旁',
|
||||
propertyName: '吴强',
|
||||
propertyPhone: '15123459876',
|
||||
landCode: 'GM2025-E6',
|
||||
isTransfer: '否',
|
||||
transferName: '',
|
||||
transferPhone: '',
|
||||
transferContract: '',
|
||||
fillName: '赵慧',
|
||||
fillGroup: '四排山乡政府',
|
||||
fillTime: '2025-06-07 09:40:00',
|
||||
updateTime: '2025-06-10 12:25:15',
|
||||
status: '2',
|
||||
},
|
||||
{
|
||||
id: 'GM2025007',
|
||||
landName: '勐撒镇箐门口村耕地七号',
|
||||
area: 6.3,
|
||||
landTypeName: '耕地',
|
||||
soilTypeName: '砂壤',
|
||||
fullRegionName: '云南省临沧市耿马傣族佤族自治县勐撒镇箐门口村',
|
||||
gridName: '勐撒网格F',
|
||||
address: '箐门口村村委路口',
|
||||
propertyName: '郑飞',
|
||||
propertyPhone: '15234568790',
|
||||
landCode: 'GM2025-E7',
|
||||
isTransfer: '是',
|
||||
transferName: '孙敏',
|
||||
transferPhone: '15345678901',
|
||||
transferContract: 'HZ-GM-007.pdf',
|
||||
fillName: '钱军',
|
||||
fillGroup: '勐撒镇综治办',
|
||||
fillTime: '2025-06-08 14:10:00',
|
||||
updateTime: '2025-06-11 11:55:45',
|
||||
status: '0',
|
||||
},
|
||||
{
|
||||
id: 'GM2025008',
|
||||
landName: '孟定镇景信村耕地八号',
|
||||
area: 9.11,
|
||||
landTypeName: '耕地',
|
||||
soilTypeName: '壤土',
|
||||
fullRegionName: '云南省临沧市耿马傣族佤族自治县孟定镇景信村',
|
||||
gridName: '孟定网格G',
|
||||
address: '景信村村口',
|
||||
propertyName: '钱芳',
|
||||
propertyPhone: '15456789012',
|
||||
landCode: 'GM2025-E8',
|
||||
isTransfer: '否',
|
||||
transferName: '',
|
||||
transferPhone: '',
|
||||
transferContract: '',
|
||||
fillName: '李强',
|
||||
fillGroup: '孟定镇农业站',
|
||||
fillTime: '2025-06-09 10:05:00',
|
||||
updateTime: '2025-06-12 13:40:30',
|
||||
status: '1',
|
||||
},
|
||||
{
|
||||
id: 'GM2025009',
|
||||
landName: '耿马镇团结村耕地九号',
|
||||
area: 11.76,
|
||||
landTypeName: '耕地',
|
||||
soilTypeName: '红壤',
|
||||
fullRegionName: '云南省临沧市耿马傣族佤族自治县耿马镇团结村',
|
||||
gridName: '耿马网格H',
|
||||
address: '团结村大桥旁',
|
||||
propertyName: '孙明',
|
||||
propertyPhone: '15567890123',
|
||||
landCode: 'GM2025-E9',
|
||||
isTransfer: '否',
|
||||
transferName: '',
|
||||
transferPhone: '',
|
||||
transferContract: '',
|
||||
fillName: '周杰',
|
||||
fillGroup: '耿马镇政府',
|
||||
fillTime: '2025-06-10 11:30:00',
|
||||
updateTime: '2025-06-13 16:15:20',
|
||||
status: '2',
|
||||
},
|
||||
{
|
||||
id: 'GM2025010',
|
||||
landName: '贺派乡落阳村耕地十号',
|
||||
area: 7.22,
|
||||
landTypeName: '耕地',
|
||||
soilTypeName: '砂壤',
|
||||
fullRegionName: '云南省临沧市耿马傣族佤族自治县贺派乡落阳村',
|
||||
gridName: '贺派网格I',
|
||||
address: '落阳村学校旁',
|
||||
propertyName: '李平',
|
||||
propertyPhone: '15678901234',
|
||||
landCode: 'GM2025-E10',
|
||||
isTransfer: '是',
|
||||
transferName: '王敏',
|
||||
transferPhone: '15789012345',
|
||||
transferContract: 'HZ-GM-010.pdf',
|
||||
fillName: '张华',
|
||||
fillGroup: '贺派乡综治办',
|
||||
fillTime: '2025-06-11 13:00:00',
|
||||
updateTime: '2025-06-14 09:50:55',
|
||||
status: '0',
|
||||
},
|
||||
];
|
||||
@ -415,10 +415,4 @@ const onExport = () => {
|
||||
.dialog-footer {
|
||||
text-align: center;
|
||||
}
|
||||
:deep(.area-cascader-label) {
|
||||
padding: 0 12px 0 0;
|
||||
margin: 0;
|
||||
width: 120px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -232,9 +232,7 @@ const state = reactive({
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
formatter: (row) => {
|
||||
return row.area + '亩';
|
||||
},
|
||||
formatter: (row, column, cellValue) => `${Number(cellValue).toFixed(2)} 亩`,
|
||||
},
|
||||
{
|
||||
label: '海拔(米)',
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
/*
|
||||
* @Descripttion:
|
||||
* @Author: zenghua.wang
|
||||
* @Date: 2022-09-18 21:24:29
|
||||
* @LastEditors: zenghua.wang
|
||||
* @LastEditTime: 2025-03-20 14:24:31
|
||||
*/
|
||||
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import qiankun from 'vite-plugin-qiankun';
|
||||
|
||||
1
sub-operation-service/components.d.ts
vendored
1
sub-operation-service/components.d.ts
vendored
@ -7,6 +7,7 @@ export {}
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
BreadComp: typeof import('./src/components/breadComp.vue')['default']
|
||||
CenterMap: typeof import('./src/components/centerMap.vue')['default']
|
||||
CodeDialog: typeof import('./src/components/code-dialog/index.vue')['default']
|
||||
copy: typeof import('./src/components/custom-scroll-title copy/index.vue')['default']
|
||||
|
||||
@ -88,10 +88,6 @@ const meuns = ref([
|
||||
label: '智慧种植',
|
||||
path: '/sub-operation-service/smartFarm',
|
||||
},
|
||||
{
|
||||
label: '农事服务',
|
||||
path: '/sub-operation-service/farmService',
|
||||
},
|
||||
{
|
||||
label: '电商交易',
|
||||
path: '/sub-operation-service/ecommerce',
|
||||
@ -108,6 +104,10 @@ const meuns = ref([
|
||||
label: '仓储物流',
|
||||
path: '/sub-operation-service/warehouseLogistics',
|
||||
},
|
||||
{
|
||||
label: '农事服务',
|
||||
path: '/sub-operation-service/farmService',
|
||||
},
|
||||
{
|
||||
label: '公共品牌',
|
||||
path: '/sub-operation-service/brand',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user