| | |
| | | <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"; |
| | |
| | | visible: false, |
| | | }; |
| | | }, |
| | | props:{ |
| | | farmDetail:{ |
| | | type:Object |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState({ |
| | | userInfo: (state) => state.user.userInfo, |
| | |
| | | //秒 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字符串 |
| | |
| | | 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, |
| | |
| | | }) |
| | | }, |
| | | // 表单提交 |
| | | 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(); |