智慧农业后台管理页面
tangzy
2022-06-11 b1827484648a4c08fcef04918b1f17ca94288046
src/views/land/landAdd.vue
@@ -23,17 +23,18 @@
<script>
import {mapGetters} from "vuex";
import { getLandList } from "@/api/land/land";
import { getStrainList } from "@/api/farmplant/strain";
import {getDeptTree} from "@/api/system/dept";
import {add} from "@/api/land/land";
import website from '@/config/website';
import getMapDataInThere from "./getMapDataInThere.vue";
export default {
  components: {
    getMapDataInThere
  },
  data() {
    return {
      title:"新增地块",
      title: "新增地块",
      form: {},
      option: {
        emptyBtn: false,
@@ -47,6 +48,21 @@
              required: true,
              message: "请输入地块名称",
              trigger: "blur"
            }]
          },
          {
            label: "所属农场",
            prop: "deptId",
            type: "tree",
            dicData: [],
            props: {
              label: "title"
            },
            slot: true,
            rules: [{
              required: true,
              message: "请选择所属农场",
              trigger: "click"
            }]
          },
          {
@@ -68,6 +84,7 @@
          {
            label: "面积单位",
            prop: "landUnit",
            value: "0",
            type: "select",
            dicUrl: "/api/blade-system/dict-biz/dictionary?code=landunit",
            props: {
@@ -93,14 +110,24 @@
  computed: {
    ...mapGetters(["userInfo", "permission", "polygons"]),
  },
  mounted() {
    this.initData(this.userInfo.tenant_id);
  },
  methods: {
    initData(tenantId) {
      getDeptTree(tenantId).then(res => {        console.log(res)
        const column = this.findObject(this.option.column, "deptId");
        column.dicData = res.data.data;
      });
    },
    //初始化
    init() {
      //计算当前时间
      this.visible = true;
    },
    // 表单提交
    submit(row,loading) {
    submit(row, loading) {
      var that = this;
      if (this.polygons.length == 0) {
        //没有面的数据
@@ -128,6 +155,7 @@
          type: "success",
          message: "操作成功!"
        });
        done();
      }, error => {
        loading();
        window.console.log(error);