| | |
| | | } |
| | | }) |
| | | } |
| | | export const getStrainCountYM = (current, size, params) => { |
| | | return request({ |
| | | url: '/api/farmPlant/strainCountYM', |
| | | method: 'get', |
| | | params: { |
| | | ...params, |
| | | current, |
| | | size, |
| | | } |
| | | }) |
| | | } |
| | | export const remove = (ids) => { |
| | | return request({ |
| | | url: '/api/farmPlant/remove', |
| | |
| | | }) |
| | | } |
| | | |
| | | export const getLandListNoPage = (params) => { |
| | | return request({ |
| | | url: '/api/land/land/getLandList', |
| | | method: 'get', |
| | | params: { |
| | | ...params, |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const getDetail = (id) => { |
| | | return request({ |
| | | url: '/api/land/land/details', |
| | |
| | | <el-button plain size="small" @click="over(item)">结束</el-button> |
| | | </div> |
| | | </div> |
| | | <!-- 秧苗 --> |
| | | <div class="farm" v-for="(item, index) in farmPlanListYM" :key="index"> |
| | | <div class="farm-img" @click="recoveryDetail(item)"> |
| | | <img :src="item.url" class="img" /> |
| | | </div> |
| | | <div class="cai">{{ item.strainName }}(秧苗)</div> |
| | | <div class="area"> |
| | | 种植面积: |
| | | <span>{{ item.area }}</span>亩 |
| | | </div> |
| | | <div class="btn"> |
| | | <el-button plain size="small" @click="plant(item)"> |
| | | <span style="color: #5abf78">移栽</span> |
| | | </el-button> |
| | | <!-- <el-button plain size="small" @click="over(item.id)">结束</el-button> --> |
| | | <el-button plain size="small" @click="over(item)">结束</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="farm-bottom"></div> |
| | |
| | | |
| | | <script> |
| | | import { mapGetters } from "vuex" |
| | | import { getList, update,getStrainCount } from "@/api/farmplant/farmplant" |
| | | import { getList, update,getStrainCount,getStrainCountYM } from "@/api/farmplant/farmplant" |
| | | import { getFarmingCount, getFarmingStatis } from "@/api/farm/farmingrecord" |
| | | import { selectCount } from "@/api/land/land" |
| | | import { StockCount } from "@/api/stock/stock" |
| | |
| | | total: 0, |
| | | farmingCount: 0, |
| | | farmPlanList: [], |
| | | farmPlanListYM:[], |
| | | recoveryVisible: false, |
| | | overVisible:false, |
| | | landVisible: false, |
| | |
| | | e.area = fixed.fixedNum(e.area) |
| | | }) |
| | | }) |
| | | |
| | | getStrainCountYM(1, 100, Object.assign(params)).then((res) => { |
| | | const data = res.data.data.records |
| | | this.farmPlanListYM = data |
| | | this.farmPlanListYM.forEach((e)=>{ |
| | | e.area = fixed.fixedNum(e.area) |
| | | }) |
| | | }) |
| | | }, |
| | | //采收 |
| | | recovery (data) { |
| | |
| | | }) |
| | | }, |
| | | //种植 |
| | | plant () { |
| | | plant (item) { |
| | | this.plantVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.plant.init() |
| | | this.$refs.plant.init(item) |
| | | }) |
| | | }, |
| | | //农事操作 |
| | |
| | | <script> |
| | | |
| | | import { mapState } from "vuex"; |
| | | import { getLandList } from "@/api/land/land"; |
| | | import { getLandList,getLandListNoPage } from "@/api/land/land"; |
| | | import { getStrainList } from "@/api/farmplant/strain"; |
| | | import { save } from "@/api/farmplant/farmplant"; |
| | | import { save,getList } from "@/api/farmplant/farmplant"; |
| | | import { getFarmList } from "../../api/farm/farm"; |
| | | export default { |
| | | data() { |
| | |
| | | gutter: 30, |
| | | column: [ |
| | | { |
| | | label: "品种", |
| | | label: "种类", |
| | | prop: "strainId", |
| | | labelWidth:110, |
| | | type:"tree", |
| | |
| | | ], |
| | | }, |
| | | { |
| | | label: "品种描述", |
| | | label: "品种", |
| | | prop: "varieties", |
| | | labelWidth:110, |
| | | // rules: [ |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | { |
| | | label: "秧苗来源农场", |
| | | prop: "farmId", |
| | | type: "tree", |
| | |
| | | }), |
| | | }, |
| | | watch: { |
| | | "form.plantingWay": { |
| | | "form.plantingWay": { |
| | | handler(val) { |
| | | console.log("plantingWay",val) |
| | | var farmColumn = this.findObject(this.option.column,"farmId") |
| | | var landColumn = this.findObject(this.option.column,"otherLandId") |
| | | if(val != 0 ){ |
| | |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | "$farmId":{ |
| | | handler(val){ |
| | | this.form.farmId = this.$farmId |
| | | //获取农地数据 |
| | | getLandList(this.$farmId).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; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | //计算当前时间 |
| | |
| | | //秒 getSeconds():(0 ~ 59) |
| | | var second = date.getSeconds(); |
| | | //赋值 |
| | | this.form['time'] = year + '-' |
| | | this.form['transplanTime'] = year + '-' |
| | | + this.addZero(month) + '-' |
| | | + this.addZero(day) + ' ' |
| | | + this.addZero(hour) + ':' |
| | |
| | | return s < 10 ? ('0' + s) : s; |
| | | }, |
| | | //初始化 |
| | | init() { |
| | | init(item) { |
| | | var that = this; |
| | | console.log("item",item) |
| | | this.form['operator'] = this.userInfo.user_id; |
| | | //计算当前时间 |
| | | this.getNowTime(); |
| | | var strainColumn = that.findObject(that.option.column,"strainId"); |
| | | // var otherLandColumn = that.findObject(that.option.column,"otherLandId"); |
| | | if(item.strainId){ |
| | | that.form.strainId = item.strainId |
| | | strainColumn.disabled = true |
| | | var params = {} |
| | | params['tenantId'] = this.userInfo.tenant_id |
| | | params['farmId'] = this.$farmId |
| | | params['strainId'] = item.strainId |
| | | // params['plantingWay'] = "2" |
| | | getLandListNoPage(params).then((res)=>{ |
| | | var landArr = [] |
| | | res.data.data.records.forEach(e => { |
| | | landArr.push({ |
| | | id:e.landId, |
| | | landName:e.landName |
| | | }) |
| | | }); |
| | | otherLandColumn.dicData = landArr |
| | | }) |
| | | }else{ |
| | | strainColumn.disabled = false |
| | | that.form.farmId = "" |
| | | } |
| | | this.visible = true; |
| | | var that = this; |
| | | //获取农地数据 |
| | | getLandList(this.$farmId).then((res)=>{ |
| | | if(res.data.code==200){ |