| | |
| | | <script> |
| | | |
| | | import {mapGetters} from "vuex"; |
| | | import {getFarmList} from "@/api/farm/farm"; |
| | | import {getDeptTree} from "@/api/system/dept"; |
| | | import {add} from "@/api/land/land"; |
| | | import website from '@/config/website'; |
| | |
| | | }, |
| | | { |
| | | label: "所属农场", |
| | | prop: "deptId", |
| | | prop: "farmId", |
| | | type: "tree", |
| | | dicData: [], |
| | | props: { |
| | | label: "title" |
| | | label: "farmName", |
| | | value:"id" |
| | | }, |
| | | slot: true, |
| | | rules: [{ |
| | |
| | | }, |
| | | methods: { |
| | | initData(tenantId) { |
| | | getDeptTree(tenantId).then(res => { console.log(res) |
| | | // getDeptTree(tenantId).then(res => { console.log(res) |
| | | |
| | | const column = this.findObject(this.option.column, "deptId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | // const column = this.findObject(this.option.column, "deptId"); |
| | | // column.dicData = res.data.data; |
| | | // }); |
| | | const data = { |
| | | deptId:this.userInfo.dept_id |
| | | } |
| | | getFarmList(data).then(res => { |
| | | const column = this.findObject(this.option.column, "farmId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | }, |
| | | //初始化 |
| | | init() { |
| | | //清空面的数据 |
| | | this.$store.commit('clear_polygon'); |
| | | //计算当前时间 |
| | | this.visible = true; |
| | | }, |
| | | // 表单提交 |
| | | submit(row, loading) { |
| | | row['deptId'] = this.userInfo.dept_id; |
| | | var that = this; |
| | | if (this.polygons.length == 0) { |
| | | //没有面的数据 |
| | |
| | | row.landRange = usePolygons; |
| | | } |
| | | add(row).then(() => { |
| | | that.$emit("refreshOnLoad"); |
| | | that.$refs.form.resetFields(); |
| | | that.visible = false; |
| | | this.$message({ |