From 0c36432c23a1e6d6eafdae914e8c2027fbe9df9c Mon Sep 17 00:00:00 2001
From: weipengfei <2187978347@qq.com>
Date: Fri, 26 Jan 2024 17:29:25 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/api.js | 1 +
api/dict.js | 7 +
api/index.js | 4 +
api/manage.js | 13 +
components/plant/landInfo.vue | 28 +-
config/app.js | 2 +-
pages/Login/login.vue | 43 +-
pages/Login/resgier.vue | 2 +-
pages/addPlant/addPlant.vue | 151 +++++-
pages/index/massif.vue | 41 +-
pages/plantAdmin/addBreed.vue | 7 +-
pages/plantAdmin/addHouse.vue | 867 +++++++++++++------------------
pages/plantAdmin/house.vue | 72 +--
pages/plantAdmin/houseDetail.vue | 20 +-
store/index.js | 25 +-
15 files changed, 680 insertions(+), 603 deletions(-)
create mode 100644 api/manage.js
diff --git a/api/api.js b/api/api.js
index 464e080..9266c17 100644
--- a/api/api.js
+++ b/api/api.js
@@ -42,6 +42,7 @@ export const listForType = (data) => syhttp.get('/action/listForType', data)
//首页
export const lindexist = (data) => syhttp.get('/index/index', data)
+
//产品列表
export const landproduct = (data) => syhttp.get('/land/product', data)
diff --git a/api/dict.js b/api/dict.js
index fe1f64a..98ccdce 100644
--- a/api/dict.js
+++ b/api/dict.js
@@ -8,3 +8,10 @@ export const farmTypeLists = () => syhttp.get('/common/dict_data_lists_by_type_v
//养殖种类
export const breedTypeLists = () => syhttp.get('/common/dict_data_lists_by_type_value', {type_value: 'breed_type'});
+
+//栏舍类型
+export const fenceHouseTypeLists = () => syhttp.get('/common/dict_data_lists_by_type_value', {type_value: 'fence_house_type'});
+
+//动物类型
+export const animalTypeLists = () => syhttp.get('/common/dict_data_lists_by_type_value', {type_value: 'animal_type'});
+
diff --git a/api/index.js b/api/index.js
index d9acebb..b17442f 100644
--- a/api/index.js
+++ b/api/index.js
@@ -24,3 +24,7 @@ export const farmTypeLists = (data) => syhttp.get('/farm_type', data);
//新增养殖基地
export const farmAdd = (data) => syhttp.post('/farm/add', data);
+
+//养殖基地列表
+export const fenceHouseData = (data) => syhttp.get('/fence_house/datas', data);
+
diff --git a/api/manage.js b/api/manage.js
new file mode 100644
index 0000000..9441e11
--- /dev/null
+++ b/api/manage.js
@@ -0,0 +1,13 @@
+import syhttp from "@/utils/syhttp.js";
+import http from "@/utils/http.js";
+
+
+//新增栏舍
+export const fenceHouseAdd = (data) => syhttp.post('/fence_house/add', data);
+
+//栏舍列表
+export const fenceHouseList = (data) => syhttp.get('/fence_house/list', data);
+
+//栏舍详情
+export const fenceHouseDetail = (data) => syhttp.get('/fence_house/detail', data);
+
diff --git a/components/plant/landInfo.vue b/components/plant/landInfo.vue
index 8f4c1e0..2f244fd 100644
--- a/components/plant/landInfo.vue
+++ b/components/plant/landInfo.vue
@@ -2,32 +2,32 @@
- 栏舍一号
+ {{info.fence_house_name}}
动物名称
- 黑山羊
+ {{info.animal_name}}
动物类型
- 哺乳动物
+ {{getAnimalType(info.animal_type)}}
栏舍容量
- 50只
+ {{info.capacity}}
栏舍负责人
- 赵桑
+ {{info.master}}
@@ -46,14 +46,28 @@
\ No newline at end of file
diff --git a/pages/Login/resgier.vue b/pages/Login/resgier.vue
index e6273b2..00711dc 100644
--- a/pages/Login/resgier.vue
+++ b/pages/Login/resgier.vue
@@ -15,7 +15,7 @@
您好!
- 欢迎进入吟龙土壤墒情监测溯系统!
+ 欢迎进入吟龙养殖测溯系统!
diff --git a/pages/addPlant/addPlant.vue b/pages/addPlant/addPlant.vue
index 9547d1d..d286586 100644
--- a/pages/addPlant/addPlant.vue
+++ b/pages/addPlant/addPlant.vue
@@ -28,7 +28,7 @@
style="pointer-events: none;">
-
@@ -43,21 +43,33 @@
地址信息
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
@@ -100,14 +112,23 @@
+ @close="show = false" @select="leavaType">
+ @select="leavaType1">
+ @select="leavaType2">
+
+
+
+
+
+
@@ -163,11 +184,14 @@
province: '',
city: '',
area: '',
+ street: '',
+ village: '',
+ bridge: '',
address: '',
lat: "",
lon: "",
master_name: '',
- pic: []
+ image: []
},
rules: {
farm_name: [{
@@ -212,6 +236,24 @@
message: '请选择所在区县',
trigger: 'change'
}],
+ street: {
+ type: 'string',
+ required: true,
+ message: '请选择所在镇街',
+ trigger: ['blur', 'change']
+ },
+ village: {
+ type: 'string',
+ required: true,
+ message: '请选择所在乡村',
+ trigger: ['blur', 'change']
+ },
+ bridge: {
+ type: 'string',
+ required: true,
+ message: '请选择小队',
+ trigger: ['blur', 'change']
+ },
address: [{
type: 'string',
required: true,
@@ -247,17 +289,26 @@
const province_name = ref(null)
const city_name = ref(null)
const area_name = ref(null)
+ const street_name = ref(null)
+ const village_name = ref(null)
+ const bridge_name = ref(null)
const farm_type_name = ref(null)
const breed_type_name = ref(null)
const show = ref(false)
const show1 = ref(false)
const show2 = ref(false)
+ const show3 = ref(false)
+ const show4 = ref(false)
+ const show5 = ref(false)
const showFarm = ref(false)
const showBreed = ref(false)
const columns = reactive([])
const columns1 = reactive([])
const columns2 = reactive([])
+ const columns3 = reactive([])
+ const columns4 = reactive([])
+ const columns5 = reactive([])
const farm_tpye_list = reactive([])
const breed_tpye_list = reactive([])
@@ -275,7 +326,6 @@
}
const cityn = (id) => {
-
city({
province_code: id
}).then((res) => {
@@ -302,6 +352,48 @@
});
}
+ const townsn = (id) => {
+ towns({
+ county_code: id
+ }).then((res) => {
+ columns3.splice(0, columns.length, ...res.data.map((step, index) => {
+ return {
+ name: step.town_name,
+ id: step.town_code,
+
+ };
+ }));
+
+ });
+ }
+
+
+ const villagesn = (id) => {
+ villages({
+ town_code: id
+ }).then((res) => {
+ columns4.splice(0, columns.length, ...res.data.map((step, index) => {
+ return {
+ name: step.village_name,
+ id: step.village_code,
+
+ };
+ }));
+
+ });
+ }
+ const groupsn = () => {
+ groups().then((res) => {
+ columns5.splice(0, columns.length, ...res.data.map((step, index) => {
+ return {
+ name: step.group_name,
+ id: step.group_code,
+ };
+ }));
+
+ });
+ }
+
const farmTypeListsn = (id) => {
farmTypeLists().then((res) => {
farm_tpye_list.splice(0, farm_tpye_list.length, ...res.data.map((step, index) => {
@@ -382,15 +474,24 @@
// 地址 省 市 街道 乡村 小队
- const isshow1 = () => {
+ const isshow = () => {
show.value = true
}
- const isshow2 = () => {
+ const isshow1 = () => {
show1.value = true
}
- const isshow3 = () => {
+ const isshow2 = () => {
show2.value = true
}
+ const isshow3 = () => {
+ show3.value = true
+ }
+ const isshow4 = () => {
+ show4.value = true
+ }
+ const isshow5 = () => {
+ show5.value = true
+ }
const isshowFarm = () =>{
showFarm.value = true
@@ -400,23 +501,41 @@
showBreed.value = true
}
- const leavaType1 = (e) => {
+ const leavaType = (e) => {
console.log(e);
province_name.value = e.name
data.formData.province = e.id
cityn(e.id)
}
- const leavaType2 = (e) => {
+ const leavaType1 = (e) => {
city_name.value = e.name
data.formData.city = e.id
countyn(e.id)
}
- const leavaType3 = (e) => {
+ const leavaType2 = (e) => {
area_name.value = e.name
data.formData.area = e.id
+ townsn(e.id)
}
+ const leavaType3 = (e) => {
+ street_name.value = e.name
+ data.formData.street = e.id
+ villagesn(e.id)
+ }
+
+ const leavaType4 = (e) => {
+ village_name.value = e.name
+ data.formData.village = e.id
+ groupsn()
+ }
+
+ const leavaType5 = (e) => {
+ bridge_name.value = e.name
+ data.formData.bridge = e.id
+ }
+
const location = () => {
@@ -453,7 +572,7 @@
uni.$u.toast('请上传图片')
return
}
- data.formData.pic = JSON.stringify(pic)
+ data.formData.image = JSON.stringify(pic)
// 表单验证通过,执行提交操作
farmAdd(data.formData).then((res) => {
diff --git a/pages/index/massif.vue b/pages/index/massif.vue
index 338ae7d..a97de77 100644
--- a/pages/index/massif.vue
+++ b/pages/index/massif.vue
@@ -60,14 +60,14 @@
养殖基地规模
- {{dataobj.form_scale|| "--"}}
+ {{dataobj.form_scale|| "--"}}亩
养殖种类
- {{dataobj.total_area-dataobj.residual_area||"--"}}
+ {{farm_type||"--"}}
@@ -130,8 +130,7 @@
-
-
@@ -178,7 +177,8 @@
diff --git a/pages/plantAdmin/addHouse.vue b/pages/plantAdmin/addHouse.vue
index c146276..ebc8749 100644
--- a/pages/plantAdmin/addHouse.vue
+++ b/pages/plantAdmin/addHouse.vue
@@ -1,543 +1,414 @@
-
+
-
-
+
+
- 栏舍信息
-
-
-
-
-
-
+ 栏舍信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
-
+
-
- 养殖基地图片
-
-
-
-
-
-
-
-
-
-
+
+ 栏舍图片
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
- 点击上传图片
-
-
+
+
+
+
+
+
+ 点击上传图片
+
+
-
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
- 提交
-
-
+
+
+
+ 提交
+
+
\ No newline at end of file
diff --git a/pages/plantAdmin/house.vue b/pages/plantAdmin/house.vue
index 2501f42..f38d2a5 100644
--- a/pages/plantAdmin/house.vue
+++ b/pages/plantAdmin/house.vue
@@ -31,25 +31,25 @@
栏舍信息
-
-
+
+
- {{item.name}}
+ {{item.fence_house_name}}
动物名称:
{{item.animal_name}}
动物类型:
- {{item.animal_type}}
+ {{getAnimalType(item.animal_type)}}
容量:
{{item.capacity}}
- 创建人:
- {{item.create_by}}
+ 负责人:
+ {{item.master}}
创建时间:
@@ -73,7 +73,7 @@
-