智慧农业后台管理页面
guoshilong
2022-08-08 f0614eae87c06eedf0b11070a9e3a1ad3289f974
src/views/wel/index.vue
@@ -75,7 +75,8 @@
                            <el-button plain size="small" @click="recovery(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.id)">结束</el-button> -->
                            <el-button plain size="small" @click="over(item)">结束</el-button>
                        </div>
                    </div>
                </div>
@@ -168,6 +169,8 @@
        </div>
        <!-- 弹窗, 采收 -->
        <recovery v-if="recoveryVisible" ref="recovery" :farmDetail="farm"></recovery>
        <!-- 弹窗,结束种养-->
        <over v-if="overVisible" ref="over" :farmDetail="farm"></over>
        <!-- 圈地 -->
        <land v-if="landVisible" ref="land"></land>
        <!-- 种养品 -->
@@ -187,6 +190,7 @@
import { StockCount } from "@/api/stock/stock"
import {getFarmList} from "@/api/farm/farm";
import recovery from "./recovery.vue"
import over from "./over.vue"
import land from "./land.vue"
import plant from "./plant.vue"
import farming from "./farming.vue"
@@ -194,6 +198,7 @@
export default {
    components: {
        recovery,
        over,
        land,
        plant,
        farming,
@@ -213,6 +218,7 @@
            farmingCount: 0,
            farmPlanList: [],
            recoveryVisible: false,
            overVisible:false,
            landVisible: false,
            plantVisible: false,
            farmingVisible: false,
@@ -321,29 +327,36 @@
                this.$refs.recovery.init(data)
            })
        },
        //结束种植
        over (id) {
            var that = this
            this.$confirm("确定结束当前种植的农产品?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
        //结束种养
        over(data) {
            this.overVisible = true
            this.$nextTick(() => {
                this.$refs.over.initData(data)
            })
                .then(() => {
                    const data = {
                        id: id,
                        status: 2,
                    }
                    return update(data)
                })
                .then(() => {
                    that.onLoad()
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    })
                })
        },
        //结束种植
        // over (id) {
        //     var that = this
        //     this.$confirm("确定结束当前种植的农产品?", {
        //         confirmButtonText: "确定",
        //         cancelButtonText: "取消",
        //         type: "warning",
        //     })
        //         .then(() => {
        //             const data = {
        //                 id: id,
        //                 status: 2,
        //             }
        //             return update(data)
        //         })
        //         .then(() => {
        //             that.onLoad()
        //             this.$message({
        //                 type: "success",
        //                 message: "操作成功!",
        //             })
        //         })
        // },
        //圈地
        land () {
            this.landVisible = true