智慧农业后台管理页面
guoshilong
2022-08-05 4f7d326b68c18ced8aeeb9bc538de7acdbcb8eb0
src/views/wel/recovery.vue
@@ -15,7 +15,7 @@
<script>
import { mapState } from "vuex";
import { getLandList } from "@/api/land/land";
import { getLandList,getByStrainIdFarmId } from "@/api/land/land";
import { getUserList } from "@/api/system/user";
import { getStrainList } from "@/api/farmplant/strain";
import { save } from "@/api/farmplant/recovery";
@@ -221,6 +221,11 @@
      visible: false,
    };
  },
  props:{
    farmDetail:{
      type:Object
    }
  },
  computed: {
    ...mapState({
      userInfo: (state) => state.user.userInfo,
@@ -243,10 +248,10 @@
        //秒 getSeconds():(0 ~ 59)
        var second = date.getSeconds();
        //赋值
        this.form['time'] = year + '-'
                          + this.addZero(month) + '-'
                          + this.addZero(day) + ' '
                          + this.addZero(hour) + ':'
        this.form['time'] = year + '-'
                          + this.addZero(month) + '-'
                          + this.addZero(day) + ' '
                          + this.addZero(hour) + ':'
                          + this.addZero(minute);
    },
    //小于10的拼接上0字符串
@@ -271,14 +276,20 @@
      this.visible = true;
      var that = this;
      //获取农地数据
      getLandList(this.userInfo.user_id).then((res) => {
      // getLandList(this.userInfo.dept_id).then((res) => {
      //   if (res.data.code == 200) {
      //     var landIdcolumn = that.findObject(that.option.column, "landId");
      //     that.landList = res.data.data;
      //     landIdcolumn.dicData = res.data.data;
      //   }
      // });
      getByStrainIdFarmId(this.form.strainId,this.farmDetail.id).then((res) => {
        if (res.data.code == 200) {
          var landIdcolumn = that.findObject(that.option.column, "landId");
          that.landList = res.data.data;
          landIdcolumn.dicData = res.data.data;
        }
      });
      //获取操作人
      const user = {
        tenantId: this.userInfo.tenant_id,
@@ -298,9 +309,11 @@
      })
    },
    // 表单提交
    submit(row,loading,done) {
    submit(row,done) {
      var that = this;
      row.time = row.time + ":00";
      row['tenantId'] = this.userInfo.tenant_id;
      row['deptId'] = this.userInfo.dept_id;
      save(row).then(
        () => {
          this.$refs.form.resetFields();