智慧农业大数据平台
guoshilong
2022-08-31 7d8e4eccb1ada1eea39ea34c68481179fa5b3d42
农场地块添加秧苗
2 files modified
49 ■■■■■ changed files
src/api/farm/farmingrecord.js 11 ●●●●● patch | view | raw | blame | history
src/views/farm/index.vue 38 ●●●● patch | view | raw | blame | history
src/api/farm/farmingrecord.js
@@ -53,6 +53,17 @@
    })
}
// 获取种植记录(秧苗)
export const getFarmPlantYMList = (params) => {
    return request({
        url: '/farmPlant/getFarmPlantYMList',
        method: 'get',
        params: {
            ...params
        }
    })
}
export const remove = (ids) => {
    return request({
        url: '/farmingRecord/remove',
src/views/farm/index.vue
@@ -127,6 +127,17 @@
                        <span>{{item.landUnit == 0 ? '亩' : item.landUnit == 1 ? '分' : '平方米'}}</span>
                    </div>
                </div>
                <div v-for="(item, index) in farmPlantYMList" :key="'farmPlantYMList'+index">
                    <div class="title">
                        <img :src="item.url" alt />
                        {{item.strainName}}
                    </div>
                    <div class="num-unit">
                        {{item.area}}
                        <span>{{item.landUnit == 0 ? '亩' : item.landUnit == 1 ? '分' : '平方米'}}</span>
                    </div>
                </div>
            </div>
            <div v-show="zydksb == 'dk'" class="lists-box dk">
@@ -316,7 +327,7 @@
                            <div class="title">{{item.strainName}}</div>
                            <div
                                class="time"
                            >{{item.createTime}} {{item.plantingWay == 0 ? '移摘' : item.plantingWay == 1 ? '直播' : '秧苗'}}</div>
                            >{{item.createTime}} {{item.plantingWay == 0 ? '移栽' : item.plantingWay == 1 ? '直播' : '秧苗'}}</div>
                        </div>
                    </div>
                </div>
@@ -545,7 +556,8 @@
import {
    getLandList,
    getFarmingRecordList,
    getFarmPlantList
    getFarmPlantList,
    getFarmPlantYMList
} from '@/api/farm/farmingrecord'
import dateUtils from '@/utils/dateUtils'
import { getStationDateByStcd, queryEquipmentList } from '@/api/equipment/equipment'
@@ -565,6 +577,7 @@
            sourceList: [],
            farmRecordList: [],
            farmPlantList: [],
            farmPlantYMList:[],
            plotLists: [],
            // 溯源码编号
            sourceCode: '',
@@ -601,6 +614,7 @@
            this.getSourceList({ code: '' })
            this.getFarmingRecordList()
            this.getFarmPlantList()
            this.getFarmPlantYMList()
            this.getLandList()
            this.getStationAndVideo()
        })
@@ -633,10 +647,18 @@
            this.currentClickPlot = params
            this.plotDetailsPlantList = []
            this.plotDetailsRecordList = []
            getFarmPlantList({ farmId: this.currentDetails.id, landId: params.id }).then(res => {
            getFarmPlantList({ farmId: this.currentDetails.id, landId: params.id,status:1 }).then(res => {
                this.plotDetailsPlantList = res.data.data
            })
                getFarmPlantYMList({ farmId: this.currentDetails.id, landId: params.id,status:1  }).then(res => {
                    // res.data.data.forEach((e)=>{
                    //     e.strainName = e.strainName+"("+"秧苗"+")"
                    // })
                    res.data.data.forEach((e)=>{
                        this.plotDetailsPlantList.push(e)
                    })
                })
            })
            getFarmingRecordList({ farmId: this.currentDetails.id, landId: params.id }).then(res => {
                this.plotDetailsRecordList = res.data.data
            })
@@ -704,6 +726,14 @@
            })
        },
        getFarmPlantYMList(){
            getFarmPlantYMList({ farmId: this.currentDetails.id, status: 1 }).then(res => {
                res.data.data.forEach((e)=>{
                    e.strainName = e.strainName+"("+"秧苗"+")"
                })
                this.farmPlantYMList = res.data.data
            })
        },
        getLandList () {
            getLandList({ farmId: this.currentDetails.id }).then(res => {
                res.data.data.forEach(item => {