智慧农业后台管理页面
guoshilong
2022-08-12 5e0b78cb60332234ff6074dd8dba6c5694885dde
溯源码显示页面随农场切换,添加溯源码时机构id更改为存储农场id
2 files modified
23 ■■■■ changed files
src/views/traceability/addTraceability.vue 8 ●●●●● patch | view | raw | blame | history
src/views/traceability/traceability.vue 15 ●●●● patch | view | raw | blame | history
src/views/traceability/addTraceability.vue
@@ -29,7 +29,7 @@
                <div style="width: 65%; float: left; font-size: 12px">
                  <div style="margin-top: 5px">
                    <input type="radio" v-model="radio" value="1" />
                    男不使用禁用农药兽药、停用兽药和非法添加物
                    不使用禁用农药兽药、停用兽药和非法添加物
                  </div>
                  <div style="margin-top: 3px">
                    <input type="radio" v-model="radio" value="1" />
@@ -224,6 +224,7 @@
      radio: "1",
      title: "创建溯源码",
      form: {},
      farm:{},
      formLabelAlign: {
        productName: "",
        createTime: "",
@@ -400,6 +401,7 @@
  computed: {
    ...mapState({
      userInfo: (state) => state.user.userInfo,
      $farmId: state => state.user.$farmId,
    }),
  },
  methods: {
@@ -436,7 +438,7 @@
    submit() {
      var that = this;
      that.formLabelAlign['tenantId'] = this.userInfo.tenant_id;
      that.formLabelAlign['deptId'] = this.userInfo.dept_id;
      that.formLabelAlign['deptId'] = this.$farmId
      this.$refs["formLabelAlign"].validate((valid) => {
        if (valid) {
          that.formLabelAlign.createTime =
@@ -501,7 +503,7 @@
        that.formLabelAlign['bind'] = '0';
      }
      that.formLabelAlign['tenantId'] = this.userInfo.tenant_id;
      that.formLabelAlign['deptId'] = this.userInfo.dept_id;
      that.formLabelAlign['deptId'] = this.$farmId;
      //新增
      save(that.formLabelAlign).then(
        () => {
src/views/traceability/traceability.vue
@@ -215,8 +215,16 @@
  created() {
    this.initData();
  },
  watch: {
      '$farmId':{
      handler (newName, oldName) {
          this.query={}
          this.onLoad(this.page)
      }
    }
  },
  computed: {
    ...mapGetters(["permission", "userInfo"]),
    ...mapGetters(["permission", "userInfo","$farmId"]),
    // permissionList() {
    //   return {
    //     addBtn: this.vaildData(this.permission.social_add, true),
@@ -384,11 +392,12 @@
      this.onLoad(this.page, this.query);
    },
    onLoads(){
      this.onLoad(this.page, this.query);
      // this.onLoad(this.page, this.query);
      this.onLoad(this.page);
    },
    onLoad(page, params = {}) {
      params['tenantId'] = this.userInfo.tenant_id;
      params['deptId'] = this.userInfo.dept_id;
      params.deptId = this.$farmId
      this.loading = true;
      getList(
        page.currentPage,