diff --git a/sub-government-affairs-service/src/apis/land.js b/sub-government-affairs-service/src/apis/land.js
index b5c043f..2763bf2 100644
--- a/sub-government-affairs-service/src/apis/land.js
+++ b/sub-government-affairs-service/src/apis/land.js
@@ -6,17 +6,51 @@ export function getLandsList(params = {}) {
params,
});
}
-/* 新增土地 */
-export function lnadSave(data = {}) {
- return request('/land-resource/landManage/save', {
+
+export function saveLand(params = {}) {
+ return request('land-resource/landManage/save', {
method: 'POST',
- data,
+ params,
});
}
-/* 导出土地 */
-export function exportLands(params = {}) {
- return request('/land-resource/landManage/export', {
+
+export function getAnnualList(params = {}) {
+ return request('land-resource/annualManage/page', {
method: 'GET',
params,
});
}
+
+export function saveAnnual(data) {
+ return request('land-resource/annualManage/save', {
+ method: 'POST',
+ data,
+ });
+}
+export function editAnnual(data = {}) {
+ return request('land-resource/annualManage/edit', {
+ method: 'PUT',
+ data,
+ });
+}
+export function examineAnnual(data = {}) {
+ return request('land-resource/annualManage/exam', {
+ method: 'PUT',
+ data,
+ });
+}
+
+export function exportAnnua(params = {}) {
+ return request('/land-resource/annualManage/export', {
+ method: 'GET',
+ params,
+ responseType: 'blob',
+ });
+}
+
+export function delAnnual(params) {
+ return request('/trace/code/annualManage/delete', {
+ method: 'DELETE',
+ params,
+ });
+}
diff --git a/sub-government-affairs-service/src/router/index.js b/sub-government-affairs-service/src/router/index.js
index 559f362..5b8e0d8 100644
--- a/sub-government-affairs-service/src/router/index.js
+++ b/sub-government-affairs-service/src/router/index.js
@@ -12,6 +12,7 @@ import Layout from '@/layouts/index.vue';
import resourceRouter from './modules/resource';
import plantingAndBreedingRouter from './modules/plantingAndBreeding';
import landsRoutes from './modules/lands';
+import annualplanRoutes from './modules/annualplan';
const { VITE_APP_NAME } = import.meta.env;
@@ -55,6 +56,7 @@ export const constantRoutes = [
},
...resourceRouter,
...plantingAndBreedingRouter,
+ ...annualplanRoutes,
...landsRoutes,
];
diff --git a/sub-government-affairs-service/src/router/modules/annualplan.js b/sub-government-affairs-service/src/router/modules/annualplan.js
new file mode 100644
index 0000000..2d90b63
--- /dev/null
+++ b/sub-government-affairs-service/src/router/modules/annualplan.js
@@ -0,0 +1,26 @@
+import Layout from '@/layouts/index.vue';
+
+const annualplanRoutes = [
+ {
+ path: '/annualPlan',
+ name: 'annualPlan',
+ component: Layout,
+ redirect: '/annualPlans',
+ meta: { title: '年度计划', icon: 'Document' },
+ children: [
+ {
+ path: '/annualPlans',
+ name: 'annualPlans',
+ component: () => import('@/views/annualPlan/component/annualPlans/index.vue'),
+ meta: { title: '年度计划', icon: 'Document' },
+ },
+ {
+ path: '/plantings',
+ name: 'plantings',
+ component: () => import('@/views/annualPlan/component/plantings/index.vue'),
+ meta: { title: '网格种植进度', icon: 'Document' },
+ },
+ ],
+ },
+];
+export default annualplanRoutes;
diff --git a/sub-government-affairs-service/src/utils/axios.js b/sub-government-affairs-service/src/utils/axios.js
index bd8f061..2bf2463 100644
--- a/sub-government-affairs-service/src/utils/axios.js
+++ b/sub-government-affairs-service/src/utils/axios.js
@@ -75,8 +75,10 @@ publicAxios.interceptors.request.use(async (config) => {
* @param res
* @returns
*/
-const formatResult = (res) => {
+const formatResult = async (res) => {
const code = res.data.code || res.status;
+ // console.info('formatResult', code)
+ const UserStore = useUserStore();
switch (code) {
case 200:
case 0:
@@ -87,6 +89,11 @@ const formatResult = (res) => {
// code === 1 或 500 代表存在错误
ElNotification.error(res.data.msg);
break;
+ case 401:
+ // code === 401 代表登录过期
+ await UserStore.logout();
+ router.push('/login');
+ break;
default:
ElNotification.error(res.data.msg);
break;
@@ -97,6 +104,7 @@ const formatResult = (res) => {
*/
publicAxios.interceptors.response.use((response) => {
const { config } = response;
+ // console.info('响应拦截器', response);
if (config?.responseType) {
return response;
}
diff --git a/sub-government-affairs-service/src/views/annualPlan/component/annualPlans/index.vue b/sub-government-affairs-service/src/views/annualPlan/component/annualPlans/index.vue
new file mode 100644
index 0000000..216ee62
--- /dev/null
+++ b/sub-government-affairs-service/src/views/annualPlan/component/annualPlans/index.vue
@@ -0,0 +1,407 @@
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 重置
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 待提交
+ 审核中
+ 通过
+ 拒绝
+
+
+
+
+ 审核
+ 编辑
+ 详情
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 亩
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 周
+
+
+ -
+
+
+ 周
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sub-government-affairs-service/src/views/annualPlan/component/plantings/index.vue b/sub-government-affairs-service/src/views/annualPlan/component/plantings/index.vue
new file mode 100644
index 0000000..e69de29
diff --git a/sub-government-affairs-service/src/views/annualPlan/index.vue b/sub-government-affairs-service/src/views/annualPlan/index.vue
new file mode 100644
index 0000000..d7d9c29
--- /dev/null
+++ b/sub-government-affairs-service/src/views/annualPlan/index.vue
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
diff --git a/sub-government-affairs-service/src/views/landManage/component/plantPlan/index.vue b/sub-government-affairs-service/src/views/landManage/component/plantPlan/index.vue
index 13c0cc7..c4a094c 100644
--- a/sub-government-affairs-service/src/views/landManage/component/plantPlan/index.vue
+++ b/sub-government-affairs-service/src/views/landManage/component/plantPlan/index.vue
@@ -8,8 +8,8 @@
-
-
+
+
@@ -146,7 +146,7 @@
import { ref, reactive, onMounted } from 'vue';
import Pagina from '@/components/pagina.vue';
import CustCard from '@/components/CustCard.vue';
-import { getLandsList } from '@/apis/land.js';
+import { getLandsList, saveLand } from '@/apis/land.js';
import { useApp } from '@/hooks';
onMounted(() => {
getList();
@@ -158,9 +158,11 @@ const app = useApp();
const searchRef = ref();
const searchCondition = reactive({
- name: '',
- person: '',
+ landName: '',
+ owner: '',
+ crop: '',
});
+
const pageData = reactive({
page: 1,
size: 10,
@@ -176,6 +178,23 @@ const btns = reactive([
method: function () {
console.log('add');
infoVisible.value = true;
+ let parmer = {
+ landId: '1892400039696359426,1892400422703423489',
+ planId: '1890242496744136706',
+ crop: '水稻',
+ seedSupplier: '园艺',
+ planDate: '2025-02-25',
+ };
+ saveLand({})
+ .then((res) => {
+ if (res.code === 200) {
+ app.$message.success('添加成功!');
+ }
+ })
+ .catch((err) => {
+ app.$message.error(err.msg);
+ })
+ .finally(() => {});
},
},
{
@@ -244,8 +263,10 @@ const stageOptions = reactive([
async function getList() {
const params = { current: pageData.page, size: pageData.size };
- let res = await getLandsList(params);
- console.log('res ---------', res);
+ let { code, data, msg } = await getLandsList(params);
+ //console.log('res ---------', data);
+ list.value = data.records || [];
+ pageData.total = data.total;
}
function handleResetSearch() {