From f749fe64d57ab41b7dddfa30df2f9542877197f1 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Fri, 09 Sep 2022 10:38:55 +0800
Subject: [PATCH] 绑定溯源列表跟随农场变化
---
src/views/traceability/recovery.vue | 36 +++++++++++++++++++++++++++++++-----
1 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/src/views/traceability/recovery.vue b/src/views/traceability/recovery.vue
index a2b46c2..f5dd49e 100644
--- a/src/views/traceability/recovery.vue
+++ b/src/views/traceability/recovery.vue
@@ -35,7 +35,7 @@
<script>
import { getList } from "@/api/farmplant/recovery";
import { update } from "@/api/traceability/traceability";
-import { getLandList } from "@/api/land/land";
+import { getLandList,selectRecoveryLandList } from "@/api/land/land";
import { getStrainList } from "@/api/farmplant/strain";
import { mapGetters } from "vuex";
export default {
@@ -69,11 +69,16 @@
column: [
{
label: "采收品种",
+ prop: "strainName",
+ },
+ {
+ label: "采收品种",
prop: "strainId",
search: true,
searchSpan: 4,
span: 12,
type: "tree",
+ hide:true,
dicData: [],
props: {
label: "strainName",
@@ -150,6 +155,10 @@
},
{
label: "操作人",
+ prop: "realName",
+ },
+ {
+ label: "操作人",
prop: "operator",
type: "tree",
dicData: [],
@@ -157,6 +166,7 @@
label: "realName",
value: "id",
},
+ hide:true,
span: 12,
labelWidth: 145,
rules: [
@@ -176,7 +186,7 @@
this.initData();
},
computed: {
- ...mapGetters(["permission", "userInfo"]),
+ ...mapGetters(["permission", "userInfo","$farmId"]),
ids() {
let ids = [];
this.selectionList.forEach((ele) => {
@@ -184,6 +194,21 @@
});
return ids.join(",");
},
+ },
+ watch:{
+ '$farmId':{
+ handler (newName, oldName) {
+ //获取农地数据
+ selectRecoveryLandList(this.$farmId).then((res) => {
+ if (res.data.code == 200) {
+ var landIdcolumn = this.findObject(this.option.column, "landId");
+ this.landList = res.data.data;
+ landIdcolumn.dicData = res.data.data;
+ }
+ })
+ this.onLoad(this.page)
+ }
+ }
},
mounted() {},
methods: {
@@ -196,7 +221,7 @@
initData() {
var that = this;
//获取农地数据
- getLandList(this.userInfo.user_id).then((res) => {
+ selectRecoveryLandList(this.$farmId).then((res) => {
if (res.data.code == 200) {
var landIdcolumn = that.findObject(that.option.column, "landId");
that.landList = res.data.data;
@@ -272,8 +297,9 @@
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
- params['tenantId'] = this.userInfo.tenant_id;
- // params['deptId'] = this.userInfo.dept_id;
+ // params['tenantId'] = this.userInfo.tenant_id;
+ params['farmId'] = this.$farmId;
+ console.log(this.$farmId,1111111111)
this.loading = true;
getList(
page.currentPage,
--
Gitblit v1.9.3