智慧农业大数据平台
shuishen
2022-07-07 74eb960ad8b1f35c3e23fcb1564af049a2b23129
Merge branch 'master' of http://192.168.0.105:10010/r/zhny-dsjdp
3 files modified
115 ■■■■ changed files
src/api/farm/farmingrecord.js 27 ●●●●● patch | view | raw | blame | history
src/views/home/index.vue 62 ●●●●● patch | view | raw | blame | history
src/views/manage/index.vue 26 ●●●● patch | view | raw | blame | history
src/api/farm/farmingrecord.js
@@ -135,3 +135,30 @@
        }
    })
}
export const selctSaletCount = (params) => {
    return request({
        url: '/sale/sale/selctSaletCount',
        method: 'get',
        params: {
            ...params
        }
    })
}
export const selctSaletZ = (params) => {
    return request({
        url: '/sale/sale/selctSaletZ',
        method: 'get',
        params: {
            ...params
        }
    })
}
export const selectMarketCirculate = (params) => {
    return request({
        url: '/sale/sale/selectMarketCirculate',
        method: 'get',
        params: {
            ...params
        }
    })
}
src/views/home/index.vue
@@ -176,27 +176,9 @@
                            <div class="b-l"></div>
                            <div class="b-r"></div>
                            <div class="title">全年销售总额(元)</div>
                            <div class="price">
                                <div>
                                    <span>1</span>
                                </div>
                                <div>
                                    <span>6</span>
                                </div>
                                <div>
                                    <span>7</span>
                                </div>
                                <div>
                                    <span>8</span>
                                </div>
                                <div>
                                    <span>5</span>
                                </div>
                                <div>
                                    <span>2</span>
                                </div>
                                <div>
                                    <span>0</span>
                            <div class="price" >
                                <div v-for="(item,index) in salaNum" :key="index">
                                    <span>{{item}}</span>
                                </div>
                            </div>
                        </div>
@@ -272,7 +254,7 @@
<script>
// eslint-disable-next-line no-unused-vars
import { getFarmingCount, getFarmingStatis, pagePalnt, SelectCount } from '@/api/farm/farmingrecord'
import { getFarmingCount, getFarmingStatis, pagePalnt, SelectCount, selctSaletCount, selctSaletZ } from '@/api/farm/farmingrecord'
// eslint-disable-next-line no-unused-vars
import { selectXCount } from '@/api/land/land'
@@ -288,7 +270,11 @@
            landwnum: 0,
            ncnum: 0,
            rynum: 0,
            cityShow: false
            cityShow: false,
            // 销售总额
            salaNum: [],
            // 每月销售统计
            salaNumY: []
        }
    },
    created () {
@@ -298,12 +284,13 @@
        this.pagePalnt()
        this.selectXCount()
        this.SelectCount()
        this.selctSaletCount()
        this.selctSaletZ()
    },
    mounted () {
        this.initPie('BeingEcharts', 100)
        this.initPie('LeisureEcharts', 0)
        this.initRightPie('EquipmentEcharts')
        this.initLine('TrendEcharts')
    },
    methods: {
        initPie (dom, val) {
@@ -528,6 +515,13 @@
            const chartDom = document.getElementById(dom)
            const myChart = this.$echarts.init(chartDom)
            var x = []
            var y = []
            for (let i = 1; i <= 12; i++) {
                x.push(i)
                y.push(that.salaNumY[i])
            }
            const option = {
                tooltip: {},
                grid: {
@@ -556,7 +550,7 @@
                            }
                        },
                        axisTick: { show: false },
                        data: ['01', '02', '03', '04', '05', '06', '07']
                        data: x
                    }
                ],
                yAxis: [
@@ -567,7 +561,6 @@
                        },
                        type: 'value',
                        min: 0,
                        max: 40,
                        splitLine: {
                            show: false
                        },
@@ -612,7 +605,7 @@
                                shadowBlur: 20 // shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
                            }
                        },
                        data: [0, 25, 24, 35, 16, 30, 15]
                        data: y
                    }
                ]
            }
@@ -627,6 +620,21 @@
                that.rynum = res.data.data.rynum
            })
        },
        // 大屏销售统计
        selctSaletCount () {
            var that = this
            selctSaletCount().then((res) => {
                that.salaNumY = res.data.data
                this.initLine('TrendEcharts')
            })
        },
        // 统计今年和去年的销售总额
        selctSaletZ () {
            var that = this
            selctSaletZ().then((res) => {
                that.salaNum = res.data.data[0].num.toString().split("")
            })
        },
        getFarmingCount () {
            var that = this
            var deptId = '1123598813738675201'
src/views/manage/index.vue
@@ -59,14 +59,14 @@
                ></statistics-num>
                <statistics-num
                        :className="'lt'"
                        :totalRegion="2678"
                        :totalRegion="salaNumBN"
                        :imgUrl="'/img/icon/lt.png'"
                        :unit="'公斤'"
                        :title="'市场流通量'"
                        :subOneTitle="'去年流通量'"
                        :subOneNum="5280"
                        :subOneNum="salaNumQN"
                        :subTwoTitle="'本月流通量'"
                        :subTwoNum="0"
                        :subTwoNum="salaNumBY"
                ></statistics-num>
            </div>
            <div class="c">
@@ -265,7 +265,7 @@
<script>
    import { selectXCount } from '@/api/land/land'
    // eslint-disable-next-line no-unused-vars
    import { page, getStockCount, pagePalnt, statisticsStockAndYield, pageCount,pageCountNz } from '@/api/farm/farmingrecord'
    import { page, getStockCount, pagePalnt, statisticsStockAndYield, pageCount, pageCountNz, selectMarketCirculate} from '@/api/farm/farmingrecord'
    export default {
        data () {
@@ -292,6 +292,10 @@
                // 农产品投入
                ncptr: [],
                nztr: [],
                // 统计市场流通/去年流通量/本月流通量
                salaNumBN: [],
                salaNumBY: [],
                salaNumQN: [],
                nzOrNcp: 'ncp',
                trpOrNcp: 'trp'
            }
@@ -306,6 +310,8 @@
            this.pageCount()
            // 农资投入
            this.pageCountNz()
            // 统计市场流通/去年流通量/本月流通量
            this.selectMarketCirculate()
        },
        mounted () {
            this.initBar('TaskNumEcharts')
@@ -835,6 +841,18 @@
                    // 投入品监管图表
                    this.initTrpBar('TrpEcharts')
                })
            },
            // 统计市场流通/去年流通量/本月流通量
            selectMarketCirculate () {
                var params = {}
                params.codes = '000000'
                params.deptId = '1123598813738675201'
                params.year = '2022'
                selectMarketCirculate(Object.assign(params)).then((res) => {
                    this.salaNumBN = res.data.data[0].num
                    this.salaNumQN = res.data.data[1].num
                    this.salaNumBY = res.data.data[2].num
                })
            }
        }
    }