| | |
| | | this.initData(); |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission", "userInfo"]), |
| | | ...mapGetters(["permission", "userInfo","$farmId"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.task_add, false), |
| | |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | '$farmId':{ |
| | | handler (newName, oldName) { |
| | | //获取农地数据 |
| | | getLandList(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.query={} |
| | | this.onLoad(this.page) |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | //入库 |
| | |
| | | initData() { |
| | | var that = this; |
| | | //获取农地数据 |
| | | getLandList(this.userInfo.dept_id).then((res) => { |
| | | getLandList(this.$farmId).then((res) => { |
| | | if (res.data.code == 200) { |
| | | var landIdcolumn = that.findObject(that.option.column, "landId"); |
| | | that.landList = res.data.data; |
| | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | params["farmId"] = this.$farmId |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |