6 files modified
1 files added
| | |
| | | } |
| | | }, |
| | | { |
| | | path: '/mapPattern', |
| | | component: () => |
| | | import( /* webpackChunkName: "page" */ '@/page/error-page/mapPattern'), |
| | | name: 'mapPattern', |
| | | meta: { |
| | | keepAlive: false, |
| | | isTab: false, |
| | | isAuth: false |
| | | } |
| | | }, |
| | | { |
| | | path: '/stockInfo', |
| | | name: '登录页', |
| | | component: () => |
| | |
| | | .dv { |
| | | .el-tabs { |
| | | height: 100%; |
| | | |
| | | .el-tabs__header { |
| | | .el-tabs__nav { |
| | | transform: translateX(60px) !important; |
| | | } |
| | | } |
| | | |
| | | .el-tabs__content { |
| | | height: calc(100% - 75px); |
| | | overflow-y: auto; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .el-dialog__body { |
| | | position: relative; |
| | | height: 60%; |
| | | } |
| | | } |
| | | |
| | | |
| | | .current-map-box { |
| | | |
| | | &>.el-dialog { |
| | | |
| | | width: 1200px; |
| | | height: 620px; |
| | | |
| | | |
| | | .el-dialog__header {} |
| | | |
| | | .el-dialog__body { |
| | | position: relative; |
| | | height: calc(100% - 54px); |
| | | box-sizing: border-box; |
| | | |
| | | .save { |
| | | position: absolute; |
| | | bottom: 10px; |
| | | right: 10px; |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | </div> |
| | | <div class="dc">占地面积:{{ landArea }}{{ dica }}</div> |
| | | <div class="dck">所属农场:{{ deptname }}</div> |
| | | |
| | | <div class="edit"> |
| | | <el-button @click="btnGrounpShow = !btnGrounpShow" icon="el-icon-menu"></el-button> |
| | | |
| | | <div v-show="btnGrounpShow" class="btn-grounp"> |
| | | <el-button>删除地块</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="dv"> |
| | | <el-tabs v-model="activeName" @tab-click="handleClick"> |
| | |
| | | |
| | | <el-dialog |
| | | title="地块位置" |
| | | class="current-map-box" |
| | | :visible.sync="gradeBoxVisible1" |
| | | width="width" |
| | | :modal="true" |
| | | :modal-append-to-body="true" |
| | | :append-to-body="true" |
| | |
| | | :before-close="dialogBeforeClose" |
| | | > |
| | | <getMapDataInThere ref="getMapData" id="getMapData" @setMapData="setMapData"></getMapDataInThere> |
| | | <el-button>54654</el-button> |
| | | <el-button class="save" type="success">保存</el-button> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | |
| | | addDisplay: true |
| | | } |
| | | ], |
| | | } |
| | | }, |
| | | btnGrounpShow: false |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | } |
| | | |
| | | .da { |
| | | position: relative; |
| | | width: 100%; |
| | | line-height: 60px; |
| | | background: #fff; |
| | | |
| | | .edit { |
| | | position: absolute; |
| | | top: 25px; |
| | | right: 60px; |
| | | |
| | | .btn-grounp { |
| | | padding: 0 10px; |
| | | position: absolute; |
| | | top: 40px; |
| | | right: 60px; |
| | | background: #fff; |
| | | box-shadow: 0 0 10px 1px #ccc; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .dv { |
| | |
| | | size="small" |
| | | @change="stypeChange" |
| | | > |
| | | <el-option label="全部分类" value=""></el-option> |
| | | <el-option label="全部分类" value></el-option> |
| | | <el-option label="大田" value="0"></el-option> |
| | | <el-option label="大棚" value="1"></el-option> |
| | | <el-option label="果园" value="2"></el-option> |
| | |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <el-button size="small" |
| | | ><span style="color: #5abf78" @click="out(row)">进入地图模式</span></el-button |
| | | > |
| | | <el-button type="success" size="small" @click="land" style="margin-right: 50px;width: 80px;">圈地</el-button> |
| | | <el-button size="small"> |
| | | <span style="color: #5abf78" @click="out(row)">进入地图模式</span> |
| | | </el-button> |
| | | <el-button |
| | | type="success" |
| | | size="small" |
| | | @click="land" |
| | | style="margin-right: 50px;width: 80px;" |
| | | >圈地</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="landhome"> |
| | | <div class="land" v-for="(item, index) in farmPlanList" :key="index" @click="landInfo(item)"> |
| | | <div |
| | | class="land" |
| | | v-for="(item, index) in farmPlanList" |
| | | :key="index" |
| | | @click="landInfo(item)" |
| | | > |
| | | <div class="land-img" > |
| | | <img :src="item.url" class="landimg" /></div> |
| | | <img :src="item.url" class="landimg" /> |
| | | </div> |
| | | <div class="text"> |
| | | <div class="land-name">{{ item.landName }}</div> |
| | | <div class="land-area"> |
| | | <div class="box"> |
| | | {{ item.landArea }} {{ item.dica }} |
| | | </div> |
| | | <div class="box">{{ item.landArea }} {{ item.dica }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | background |
| | | layout="total, prev, pager, next" |
| | | :total="page.total" |
| | | > |
| | | </el-pagination> |
| | | ></el-pagination> |
| | | </div> |
| | | <landAdd v-if="landVisible" ref="land" @refreshOnLoad="onLoad"></landAdd> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapGetters } from "vuex"; |
| | | import {getList} from "@/api/land/land"; |
| | | import landAdd from "./landAdd"; |
| | | import { mapGetters } from "vuex" |
| | | import { getList } from "@/api/land/land" |
| | | import landAdd from "./landAdd" |
| | | export default { |
| | | components: { |
| | | landAdd, |
| | |
| | | } |
| | | ] |
| | | }, |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo"]), |
| | | }, |
| | | created() { |
| | | this.onLoad(); |
| | | this.onLoad() |
| | | }, |
| | | methods: { |
| | | //圈地 |
| | | land() { |
| | | this.landVisible = true; |
| | | this.landVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.land.init(); |
| | | }); |
| | | this.$refs.land.init() |
| | | }) |
| | | }, |
| | | //农资类型select 改变事件 |
| | | stypeChange(value) { |
| | | this.query["landType"] = value; |
| | | this.onLoad(this.page, this.query); |
| | | this.query["landType"] = value |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | //库存 select 改变事件 |
| | | stateChange(value) { |
| | | this.query["state"] = value; |
| | | this.onLoad(this.page, this.query); |
| | | this.query["state"] = value |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | //keywordChange 输入事件 |
| | | keywordChange(value) { |
| | | this.query["landName"] = value; |
| | | this.onLoad(this.page, this.query); |
| | | this.query["landName"] = value |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | //分页 |
| | | handleSizeChange(val) { |
| | | this.page.pageSize = val; |
| | | this.onLoad(this.page); |
| | | this.page.pageSize = val |
| | | this.onLoad(this.page) |
| | | }, |
| | | //改变页码 |
| | | handleCurrentChange(val) { |
| | | this.page.currentPage = val; |
| | | this.onLoad(this.page); |
| | | this.page.currentPage = val |
| | | this.onLoad(this.page) |
| | | }, |
| | | landInfo(item){ |
| | | this.$router.push({ |
| | | path: `/LandDetail`, |
| | | query: item, |
| | | }); |
| | | }) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | getList(1, 10, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | const data = res.data.data |
| | | |
| | | this.farmPlanList = data.records; |
| | | }); |
| | | this.farmPlanList = data.records |
| | | }) |
| | | } |
| | | }, |
| | | }; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | .search { |
| | | padding-top: 40px; |
| | |
| | | <div class="getMapData" :key="Refresh"> |
| | | <MapInThere ref="getMapDataRefs" /> |
| | | <div class="notDatas" v-show="isCheck"> |
| | | <div style="color: red">*</div> |
| | | 未绘画区域 |
| | | <div style="color: red">*</div>未绘画区域 |
| | | </div> |
| | | <div class="controlMapWindowTitle"> |
| | | <el-button-group> |
| | | <el-button type="primary" icon="el-icon-finished" @click="drawFace" |
| | | >绘画区域</el-button |
| | | > |
| | | <el-button type="danger" @click="giveUp" icon="el-icon-close" |
| | | >取消</el-button |
| | | > |
| | | <el-button type="primary" icon="el-icon-finished" @click="drawFace">绘画区域</el-button> |
| | | <el-button type="danger" @click="giveUp" icon="el-icon-close">取消</el-button> |
| | | </el-button-group> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapGetters } from "vuex"; |
| | | import MapInThere from "@/components/map/mainInThere.vue"; |
| | | import { mapGetters } from "vuex" |
| | | import MapInThere from "@/components/map/mainInThere.vue" |
| | | export default { |
| | | name: "getMapData", |
| | | components: { |
| | |
| | | ourDatas: { |
| | | handler(val) { |
| | | this.checkDom("getMapDataRefs", (dom) => { |
| | | dom.onceOnlodad(val); |
| | | }); |
| | | dom.onceOnlodad(val) |
| | | }) |
| | | }, |
| | | deep: true, |
| | | }, |
| | | polygons() { |
| | | if (this.polygons.length > 0) { |
| | | this.isCheck = false; |
| | | this.isCheck = false |
| | | } |
| | | }, |
| | | }, |
| | |
| | | ourDatas: [], |
| | | nowId: 0, |
| | | isCheck: false, |
| | | }; |
| | | } |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | methods: { |
| | | draw(usePolygons) { |
| | | this.$store.commit("setpolygon", usePolygons); //用vuex传最终数据 |
| | | this.$store.commit("setpolygon", usePolygons) //用vuex传最终数据 |
| | | this.doThat(usePolygons) |
| | | }, |
| | | doThat(val) { |
| | | this.checkDom("getMapDataRefs", (dom) => { |
| | | dom.addLines(val); |
| | | dom.addLines(val) |
| | | // 移动位置 |
| | | dom.move(val); |
| | | }); |
| | | dom.move(val) |
| | | }) |
| | | }, |
| | | drawFace() { |
| | | this.$refs.getMapDataRefs.drawStart(); |
| | | this.$refs.getMapDataRefs.drawStart() |
| | | }, |
| | | giveUp() { |
| | | this.$refs.getMapDataRefs.closeDraw(); |
| | | this.$refs.getMapDataRefs.closeDraw() |
| | | }, |
| | | openDrawLineMethod() { |
| | | let id = this.nowId++; |
| | | let id = this.nowId++ |
| | | this.ourDatas.push({ |
| | | label: "路径" + +id, |
| | | value: "", |
| | |
| | | notPath: false, |
| | | isLine: true, |
| | | id: +id, |
| | | }); |
| | | }) |
| | | }, |
| | | openDrawPointMethod() { |
| | | let id = this.nowId++; |
| | | let id = this.nowId++ |
| | | this.ourDatas.push({ |
| | | label: "标点" + +id, |
| | | value: "", |
| | |
| | | notPath: false, |
| | | isLine: false, |
| | | id: +id, |
| | | }); |
| | | }) |
| | | }, |
| | | deleteRowOurs(index) { |
| | | this.ourDatas.splice(index, 1); |
| | | this.ourDatas.splice(index, 1) |
| | | }, |
| | | backMapDataOurData(val, index) { |
| | | if (val == "line") { |
| | | this.ourDatas[index].value = this.rotesData; |
| | | this.ourDatas[index].value = this.rotesData |
| | | } else if (val == "point") { |
| | | this.ourDatas[index].value = this.pointData; |
| | | this.ourDatas[index].value = this.pointData |
| | | } else if (val == "notData") { |
| | | this.ourDatas[index].value = ""; |
| | | this.ourDatas[index].value = "" |
| | | } |
| | | //单个验证 |
| | | this.myRules(index); |
| | | this.myRules(index) |
| | | }, |
| | | //以上是添加数据集方法 |
| | | //选择map数据 |
| | | openMap(val, num, value) { |
| | | this.MapDataShow = true; |
| | | this.openTitle = val; |
| | | this.$refs.getMapDataRefs.init(val, num, value); |
| | | this.MapDataShow = true |
| | | this.openTitle = val |
| | | this.$refs.getMapDataRefs.init(val, num, value) |
| | | }, |
| | | closeOpenedMap() { |
| | | this.MapDataShow = false; |
| | | this.MapDataShow = false |
| | | // this.openTitle = ""; |
| | | }, |
| | | //下面是旧代码 |
| | | editInit(val) { |
| | | //查看情况逆转String成为当页可使用数据,并做动作 |
| | | this.reverseMapData(val); |
| | | this.reverseMapData(val) |
| | | }, |
| | | viewInit(val) { |
| | | //查看情况逆转String成为当页可使用数据,并做动作 |
| | | this.reverseMapData(val); |
| | | this.fromView = true; //查看数据不可改 |
| | | this.reverseMapData(val) |
| | | this.fromView = true //查看数据不可改 |
| | | }, |
| | | reverseMapData(val, label) { |
| | | //解释数据 |
| | | let rname = val[0][0].split(";"), |
| | | r = val[0][1].split(";"), |
| | | pname = val[1][0].split(";"), |
| | | p = val[1][1].split(";"); |
| | | this.ourDatas = []; |
| | | p = val[1][1].split(";") |
| | | this.ourDatas = [] |
| | | for (let k in r) { |
| | | this.ourDatas.push({ |
| | | label: "路径" + (+k + 1), |
| | |
| | | notPath: false, |
| | | isLine: true, |
| | | id: this.ourDatas.length, |
| | | }); |
| | | }) |
| | | } |
| | | for (let k in p) { |
| | | let potion = p[k].split(","); |
| | | let potion = p[k].split(",") |
| | | this.ourDatas.push({ |
| | | label: "标点" + (+k + 1), |
| | | value: [+potion[0], +potion[1]], |
| | |
| | | notPath: false, |
| | | isLine: false, |
| | | id: this.ourDatas.length, |
| | | }); |
| | | }) |
| | | } |
| | | this.nowId = +this.ourDatas.length + 1; |
| | | this.nowId = +this.ourDatas.length + 1 |
| | | }, |
| | | myRules(index) { |
| | | //单个验证 |
| | | if (this.ourDatas[index].name && this.ourDatas[index].value) { |
| | | this.ourDatas[index].notPath = false; |
| | | this.ourDatas[index].notPath = false |
| | | } else { |
| | | this.ourDatas[index].notPath = 2; |
| | | this.ourDatas[index].notPath = 2 |
| | | } |
| | | }, |
| | | //自定义验证 |
| | | myRulesUse() { |
| | | //把一个数组拆开两个来对应之前的数据 |
| | | let ourData = this.ourDatas; |
| | | let lineBefor = []; |
| | | let pointBefor = []; |
| | | let ourData = this.ourDatas |
| | | let lineBefor = [] |
| | | let pointBefor = [] |
| | | for (let o in ourData) { |
| | | if (ourData[o].isLine) { |
| | | lineBefor.push(ourData[o]); |
| | | lineBefor.push(ourData[o]) |
| | | } else { |
| | | pointBefor.push(ourData[o]); |
| | | pointBefor.push(ourData[o]) |
| | | } |
| | | } |
| | | let line = this.changeMapData(lineBefor, "name"); |
| | | let point = this.changeMapData(pointBefor, "name"); |
| | | let line = this.changeMapData(lineBefor, "name") |
| | | let point = this.changeMapData(pointBefor, "name") |
| | | if (line[0] == "namenot" || point[0] == "namenot") { |
| | | //需要显示验证失败合集 |
| | | let errorId = []; |
| | | let errorId = [] |
| | | if (line[0] == "namenot") { |
| | | errorId.push(...line[1]); |
| | | errorId.push(...line[1]) |
| | | } |
| | | if (point[0] == "namenot") { |
| | | errorId.push(...point[1]); |
| | | errorId.push(...point[1]) |
| | | } |
| | | for (let x in this.ourDatas) { |
| | | let flog = true; |
| | | let flog = true |
| | | for (let k in errorId) { |
| | | if (errorId[k] == this.ourDatas[x].id) { |
| | | flog = false; |
| | | flog = false |
| | | } |
| | | } |
| | | if (flog) { |
| | | this.ourDatas[x].notPath = false; |
| | | this.ourDatas[x].notPath = false |
| | | } else { |
| | | this.ourDatas[x].notPath = 2; |
| | | this.ourDatas[x].notPath = 2 |
| | | } |
| | | } |
| | | return false; |
| | | return false |
| | | } else { |
| | | for (let i in this.ourDatas) { |
| | | this.ourDatas[i].notPath = false; |
| | | this.ourDatas[i].notPath = false |
| | | } |
| | | return [line, point]; |
| | | return [line, point] |
| | | } |
| | | }, |
| | | //规则 |
| | | changeMapData(item, names) { |
| | | let name = "", |
| | | value = "", |
| | | notData = []; |
| | | let itemLength = item.length - 1; |
| | | notData = [] |
| | | let itemLength = item.length - 1 |
| | | for (let k in item) { |
| | | let inItem = item[k]; |
| | | let inItem = item[k] |
| | | for (let kin in inItem) { |
| | | if ( |
| | | inItem[kin] == "" && |
| | |
| | | kin != "isLine" && |
| | | kin != "id" |
| | | ) { |
| | | notData.push(inItem.id); |
| | | break; |
| | | notData.push(inItem.id) |
| | | break |
| | | } |
| | | if (kin == names) { |
| | | name += inItem[kin]; |
| | | name += inItem[kin] |
| | | if (k != itemLength) { |
| | | name += ";"; |
| | | name += ";" |
| | | } |
| | | } |
| | | if (kin == "value") { |
| | | value += inItem[kin]; |
| | | value += inItem[kin] |
| | | if (k != itemLength) { |
| | | value += ";"; |
| | | value += ";" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return notData.length > 0 ? [names + "not", notData] : [name, value]; |
| | | return notData.length > 0 ? [names + "not", notData] : [name, value] |
| | | }, |
| | | checkDom(name, fn) { |
| | | // 声明定时器 |
| | | let that = this; |
| | | var timer = null; |
| | | let that = this |
| | | var timer = null |
| | | // 检查dom是否执行完成 |
| | | function checkDom() { |
| | | let dom = that.$refs[name]; |
| | | let dom = that.$refs[name] |
| | | if (dom) { |
| | | // 执行dom加载完成后的操作 |
| | | // 清除定时器 |
| | | if (!timer) { |
| | | clearTimeout(timer); |
| | | clearTimeout(timer) |
| | | } |
| | | if (fn) { |
| | | //回调函数 |
| | | fn(dom); |
| | | return; |
| | | fn(dom) |
| | | return |
| | | } else { |
| | | return dom; |
| | | return dom |
| | | } |
| | | } else { |
| | | // 自我调用 |
| | | timer = setTimeout(checkDom, 100); |
| | | timer = setTimeout(checkDom, 100) |
| | | } |
| | | } |
| | | // 首次执行 |
| | | checkDom(); |
| | | checkDom() |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | position: relative; |
| | | .controlMapWindowTitle { |
| | | position: absolute; |
| | | left: calc(50% - 42px); |
| | | left: calc(50% - 102.5px); |
| | | top: 0; |
| | | } |
| | | .notPath { |
| New file |
| | |
| | | <template> |
| | | <div></div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | </style> |
| | |
| | | <p style="position: relative; top: -12px"> |
| | | <span |
| | | style="font-size: 32px; font-weight: 550; margin-top: -10px" |
| | | >{{ landInfo.rate || 0 }}</span |
| | | >% |
| | | >{{ landInfo.rate || 0 }}</span>% |
| | | </p> |
| | | </div> |
| | | <div class="avue-statis"> |
| | |
| | | <div class="land-statis"> |
| | | <div class="land-title">地块总面积</div> |
| | | <div class="land-num"> |
| | | <span>{{ landInfo.zarea }}</span |
| | | > 亩 |
| | | <span>{{ landInfo.zarea }}</span> 亩 |
| | | </div> |
| | | </div> |
| | | <div class="land-statis"> |
| | | <div class="land-title">当前种养面积</div> |
| | | <div class="land-num"> |
| | | <span>{{ landInfo.sarea }}</span |
| | | > 亩 |
| | | <span>{{ landInfo.sarea }}</span> 亩 |
| | | </div> |
| | | </div> |
| | | <div class="land-statis"> |
| | | <div class="land-title">当前种养品种</div> |
| | | <div class="land-num"> |
| | | <span>{{ landInfo.num }}</span |
| | | > 种 |
| | | <span>{{ landInfo.num }}</span> 种 |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="title">当前种养品种</div> |
| | | <div class="content"> |
| | | <div class="farm" v-for="(item, index) in farmPlanList" :key="index"> |
| | | <div class="farm-img" @click="recoveryDetail(item)"><img :src="item.url" class="img" /></div> |
| | | <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="area"> |
| | | 种植面积: |
| | | <span>{{ item.area }}</span>亩 |
| | | </div> |
| | | <div class="btn"> |
| | | <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="recovery(item)"> |
| | | <span style="color: #5abf78">采收</span> |
| | | </el-button> |
| | | <el-button plain size="small" @click="over(item.id)">结束</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | <div class="text">添加种养品种</div> |
| | | </div> |
| | | <div |
| | | class="button" |
| | | style="background-color: #f37ba1" |
| | | @click="farming" |
| | | > |
| | | <div class="button" style="background-color: #f37ba1" @click="farming"> |
| | | <div class="btn-img"> |
| | | <img src="../../../public/img/wel/tuo.png" class="img" /> |
| | | </div> |
| | |
| | | <div class="left"> |
| | | <div class="farm-text">本年农事操作</div> |
| | | <div class="num"> |
| | | <span>{{ total }}</span |
| | | > 次 |
| | | <span>{{ total }}</span> 次 |
| | | </div> |
| | | </div> |
| | | <div class="right"> |
| | | <el-link type="success" :underline="false" @click="farmPlantDetail" |
| | | >明细>></el-link |
| | | > |
| | | <el-link type="success" :underline="false" @click="farmPlantDetail">明细>></el-link> |
| | | </div> |
| | | </div> |
| | | <div class="farming-divider" v-if="isFarmingDetail"> |
| | | <el-divider></el-divider> |
| | | </div> |
| | | <div class="farming-details" :v-if="isFarmingDetail"> |
| | | <div class="detail" v-for="(item, index) in farmingList" :key="index" @click="farmPlantDetails(item)"> |
| | | <div |
| | | class="detail" |
| | | v-for="(item, index) in farmingList" |
| | | :key="index" |
| | | @click="farmPlantDetails(item)" |
| | | > |
| | | <div class="detail-title">{{ item.name }}</div> |
| | | <div class="detail-number"> |
| | | <span>{{ item.value }}</span |
| | | >次 |
| | | <span>{{ item.value }}</span>次 |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="repertory-centont"> |
| | | <div class="detail" v-for="(item, index) in stockList" :key="index" @click="stockDetails(item)"> |
| | | <div |
| | | class="detail" |
| | | v-for="(item, index) in stockList" |
| | | :key="index" |
| | | @click="stockDetails(item)" |
| | | > |
| | | <div class="detail-title">{{ item.name}}</div> |
| | | <div class="detail-number">剩余库存 <span>{{ item.val}}</span>公斤</div> |
| | | <div class="detail-number"> |
| | | 剩余库存 |
| | | <span>{{ item.val}}</span>公斤 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapGetters } from "vuex"; |
| | | import { getList, update } from "@/api/farmplant/farmplant"; |
| | | import { getFarmingCount, getFarmingStatis } from "@/api/farm/farmingrecord"; |
| | | import { selectCount } from "@/api/land/land"; |
| | | import { mapGetters } from "vuex" |
| | | import { getList, update } from "@/api/farmplant/farmplant" |
| | | import { getFarmingCount, getFarmingStatis } from "@/api/farm/farmingrecord" |
| | | import { selectCount } from "@/api/land/land" |
| | | import {StockCount} from "@/api/stock/stock" |
| | | import recovery from "./recovery.vue"; |
| | | import land from "./land.vue"; |
| | | import plant from "./plant.vue"; |
| | | import farming from "./farming.vue"; |
| | | import stock from "./stock.vue"; |
| | | import recovery from "./recovery.vue" |
| | | import land from "./land.vue" |
| | | import plant from "./plant.vue" |
| | | import farming from "./farming.vue" |
| | | import stock from "./stock.vue" |
| | | export default { |
| | | components: { |
| | | recovery, |
| | |
| | | span: 8, |
| | | data: [], |
| | | }, |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo"]), |
| | | }, |
| | | created() { |
| | | //地块使用率统计 |
| | | this.getCountStatis(); |
| | | this.getCountStatis() |
| | | //采收列表 |
| | | this.onLoad(); |
| | | this.onLoad() |
| | | //本年农事操作记录 |
| | | this.getFarmingCount(); |
| | | this.getFarmingCount() |
| | | //本年农事操作记录,分组 |
| | | this.getFarmingStatis(); |
| | | this.StockCount(); |
| | | this.getFarmingStatis() |
| | | this.StockCount() |
| | | }, |
| | | methods: { |
| | | //本年农事操作记录 |
| | | getFarmingCount() { |
| | | var that = this; |
| | | var that = this |
| | | getFarmingCount(this.userInfo.farmId).then((res) => { |
| | | that.total = res.data.data; |
| | | that.total = res.data.data |
| | | // that.total = 0; |
| | | if (that.total > 0) { |
| | | that.isFarmingDetail = true; |
| | | that.isFarmingDetail = true |
| | | } |
| | | }); |
| | | }) |
| | | }, |
| | | //本年农事操作记录,分组统计 |
| | | getFarmingStatis() { |
| | | var that = this; |
| | | var that = this |
| | | getFarmingStatis(this.userInfo.farmId).then((res) => { |
| | | that.farmingList = res.data.data; |
| | | }); |
| | | that.farmingList = res.data.data |
| | | }) |
| | | }, |
| | | StockCount() { |
| | | var that = this; |
| | | var that = this |
| | | StockCount(this.userInfo.farmId).then((res) => { |
| | | that.stockList= res.data.data; |
| | | that.stockList = res.data.data |
| | | console.log(that.stockList) |
| | | }); |
| | | }) |
| | | }, |
| | | //地块使用率统计 |
| | | getCountStatis() { |
| | | var that = this; |
| | | var that = this |
| | | selectCount(this.userInfo.farmId).then((res) => { |
| | | var data = res.data.data; |
| | | that.landInfo = data; |
| | | }); |
| | | var data = res.data.data |
| | | that.landInfo = data |
| | | }) |
| | | }, |
| | | handleChange(val) { |
| | | window.console.log(val); |
| | | window.console.log(val) |
| | | }, |
| | | //获取种植中的种养品 |
| | | onLoad() { |
| | | var params = { |
| | | status: 1, |
| | | }; |
| | | params['tenantId'] = this.userInfo.tenant_id; |
| | | params['farmId'] = this.userInfo.farmId; |
| | | } |
| | | params['tenantId'] = this.userInfo.tenant_id |
| | | params['farmId'] = this.userInfo.farmId |
| | | getList(1, 10, Object.assign(params)).then((res) => { |
| | | const data = res.data.data; |
| | | this.farmPlanList = data.records; |
| | | }); |
| | | const data = res.data.data |
| | | this.farmPlanList = data.records |
| | | }) |
| | | }, |
| | | //采收 |
| | | recovery(data) { |
| | | this.recoveryVisible = true; |
| | | this.recoveryVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.recovery.init(data); |
| | | }); |
| | | this.$refs.recovery.init(data) |
| | | }) |
| | | }, |
| | | //结束种植 |
| | | over(id) { |
| | | var that = this; |
| | | var that = this |
| | | this.$confirm("确定结束当前种植的农产品?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | |
| | | const data = { |
| | | id: id, |
| | | status: 2, |
| | | }; |
| | | return update(data); |
| | | } |
| | | return update(data) |
| | | }) |
| | | .then(() => { |
| | | that.onLoad(); |
| | | that.onLoad() |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | //圈地 |
| | | land() { |
| | | this.landVisible = true; |
| | | this.landVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.land.init(); |
| | | }); |
| | | this.$refs.land.init() |
| | | }) |
| | | }, |
| | | //种植 |
| | | plant() { |
| | | this.plantVisible = true; |
| | | this.plantVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.plant.init(); |
| | | }); |
| | | this.$refs.plant.init() |
| | | }) |
| | | }, |
| | | //农事操作 |
| | | farming() { |
| | | this.farmingVisible = true; |
| | | this.farmingVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.farming.init(); |
| | | }); |
| | | this.$refs.farming.init() |
| | | }) |
| | | }, |
| | | //农资入库 |
| | | stock() { |
| | | this.stockVisible = true; |
| | | this.stockVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.stock.init(); |
| | | }); |
| | | this.$refs.stock.init() |
| | | }) |
| | | }, |
| | | //本年农事操作明细 |
| | | farmPlantDetail() { |
| | | const data = { |
| | | activeName: "tab2", |
| | | }; |
| | | } |
| | | this.$router.push({ |
| | | path: `/farmDetail`, |
| | | query: data, |
| | | }); |
| | | }) |
| | | }, |
| | | stockDetail() { |
| | | this.$router.push({ |
| | | path: `/stockmanage`, |
| | | }); |
| | | }) |
| | | }, |
| | | //本年农事操作明细--有参 |
| | | farmPlantDetails(item) { |
| | | console.log(item,11111); |
| | | console.log(item, 11111) |
| | | const data = { |
| | | type:item.value, |
| | | activeName: "tab2", |
| | | }; |
| | | } |
| | | this.$router.push({ |
| | | path: `/farmDetail`, |
| | | query: data, |
| | | }); |
| | | }) |
| | | }, |
| | | //农资库存点击事件 |
| | | stockDetails(item) { |
| | | var type; |
| | | var type |
| | | if (item.name=="化肥"){ |
| | | type=0 |
| | | } |
| | |
| | | } |
| | | const data = { |
| | | type:type, |
| | | }; |
| | | } |
| | | this.$router.push({ |
| | | path: `/stockmanage`, |
| | | query: data, |
| | | }); |
| | | }) |
| | | }, |
| | | //采收记录 |
| | | recoveryDetail() { |
| | | const data = { |
| | | activeName: "tab1", |
| | | }; |
| | | } |
| | | this.$router.push({ |
| | | path: `/farmDetail`, |
| | | query: data, |
| | | }); |
| | | }) |
| | | }, |
| | | }, |
| | | }; |