智慧农业大数据平台
zengh
2022-07-14 1e3e855dc0142e050436248d538525980ba8a8dd
弹窗修复
2 files modified
358 ■■■■ changed files
src/api/farm/farmingrecord.js 9 ●●●●● patch | view | raw | blame | history
src/views/manage/index.vue 349 ●●●● patch | view | raw | blame | history
src/api/farm/farmingrecord.js
@@ -174,6 +174,15 @@
        }
    })
}
export const productsSuperviseList = (params) => {
    return request({
        url: '/recovery/page',
        method: 'get',
        params: {
            ...params
        }
    })
}
export const pageCount = (params) => {
    return request({
src/views/manage/index.vue
@@ -209,7 +209,7 @@
                            </div>
                        </div>
                        <div class="more" @click="popDetailedFarming">
                        <div class="more" @click="popDetailedFarming({type: '', landId: ''})">
                            更多
                            <img src="/img/icon/more.png" alt />
                        </div>
@@ -252,7 +252,7 @@
        <public-box
            v-show="trpPopupFlag"
            :closeFlag="'trpPopupFlag'"
            :className="'public-trace-table'"
            :className="'public-farm-oper-table'"
        >
            <template slot="public-box-header">
                <div class="logo"></div>
@@ -292,28 +292,21 @@
                </div>
                <div class="table-list">
                    <div class="t-header">
                        <div class="sym-style">农资</div>
                        <div>农资</div>
                        <div>分类</div>
                        <div>规格</div>
                        <div>库存</div>
                        <div>数量</div>
                        <div>操作</div>
                        <div>厂家</div>
                    </div>
                    <div class="t-body">
                        <div class="table-list"  v-for="(item,index) in nztr" :key="index">
                            <div class="sym-style">
                                <div>{{item.agrname}}</div>
                            </div>
                            <div>{{item.agrname}}</div>
                            <div>{{item.stype}}</div>
                            <div>{{item.spn}}</div>
                            <div>{{item.cnum}}</div>
                            <div>
                                <el-button
                                    @click="openPopup('/img/icon/sym.png')"
                                    size="small"
                                    class="look"
                                    type="info"
                                >查看</el-button>
                            </div>
                            <div>{{item.amount}}{{item.dic2}}</div>
                            <div>{{item.cnum}}{{item.dic1}}</div>
                            <div>{{item.factoryName}}</div>
                        </div>
                    </div>
                </div>
@@ -321,70 +314,221 @@
        </public-box>
        <public-box
            v-show="nsjlPopupFlag"
            :closeFlag="'nsjlPopupFlag'"
            :className="'public-trace-table'"
                v-show="nzcrPopupFlag"
                :closeFlag="'nzcrPopupFlag'"
                :className="'public-farm-oper-table'"
        >
            <template slot="public-box-header">
                <div class="logo"></div>
                <div class="title">农事记录</div>
                <div class="title">农资出入库记录</div>
                <img
                    @click="nsjlPopupFlag = false"
                    src="/img/icon/public-close.png"
                    alt
                    class="close"
                        @click="nzcrPopupFlag = false"
                        src="/img/icon/public-close.png"
                        alt
                        class="close"
                />
            </template>
            <template slot="public-box-content">
                <div class="action-bar">
                    <div class="search">
                        <el-input
                            class="search-input"
                            size="small"
                            prefix-icon="el-icon-search"
                            placeholder="请输入内容"
                            v-model="input1"
                                class="search-input"
                                size="small"
                                prefix-icon="el-icon-search"
                                placeholder="请输入内容"
                                v-model="input1"
                        ></el-input>
                    </div>
                    <div class="btn-grounp">
                        <el-button
                            size="small"
                            class="search"
                            type="primary"
                            icon="el-icon-search"
                                size="small"
                                class="search"
                                type="primary"
                                icon="el-icon-search"
                        >查询</el-button>
                        <el-button
                            size="small"
                            class="reset"
                            type="info"
                            icon="el-icon-refresh-right"
                                size="small"
                                class="reset"
                                type="info"
                                icon="el-icon-refresh-right"
                        >重置</el-button>
                    </div>
                </div>
                <div class="table-list">
                    <div class="t-header">
                        <div class="sym-style">农事类型</div>
                        <div>所属地块</div>
                        <div>农资</div>
                        <div>作业方式</div>
                        <div>操作</div>
                        <div>分类</div>
                        <div>规格</div>
                        <div>类型</div>
                        <div>数量</div>
                        <div>操作时间</div>
                        <div>操作人</div>
                    </div>
                    <div class="t-body">
                        <div class="table-list">
                            <div class="sym-style">
                                <div>施肥</div>
                            </div>
                            <div>1号地块</div>
                            <div>1524217070160453633</div>
                            <div>人工</div>
                            <div>
                                <el-button
                                    @click="openPopup('/img/icon/sym.png')"
                                    size="small"
                                    class="look"
                                    type="info"
                                >查看</el-button>
                            </div>
                        <div class="table-list"  v-for="(item,index) in stockrecordAll" :key="index">
                            <div>{{item.agrname}}</div>
                            <div>{{item.stype}}</div>
                            <div>{{item.spn}}</div>
                            <div>{{item.type1}}</div>
                            <div>{{item.count}}</div>
                            <div>{{item.createTime}}</div>
                            <div>{{item.czr}}</div>
                        </div>
                    </div>
                </div>
            </template>
        </public-box>
        <public-box
                v-show="ncpPopupFlag"
                :closeFlag="'ncpPopupFlag'"
                :className="'public-farm-oper-table'"
        >
            <template slot="public-box-header">
                <div class="logo"></div>
                <div class="title">农产品监管</div>
                <img
                        @click="ncpPopupFlag = false"
                        src="/img/icon/public-close.png"
                        alt
                        class="close"
                />
            </template>
            <template slot="public-box-content">
                <div class="action-bar">
                    <div class="search">
                        <el-input
                                class="search-input"
                                size="small"
                                prefix-icon="el-icon-search"
                                placeholder="请输入内容"
                                v-model="input1"
                        ></el-input>
                    </div>
                    <div class="btn-grounp">
                        <el-button
                                size="small"
                                class="search"
                                type="primary"
                                icon="el-icon-search"
                        >查询</el-button>
                        <el-button
                                size="small"
                                class="reset"
                                type="info"
                                icon="el-icon-refresh-right"
                        >重置</el-button>
                    </div>
                </div>
                <div class="table-list">
                    <div class="t-header">
                        <div>农资</div>
                        <div>作业方式</div>
                        <div>采收地块</div>
                        <div>类型</div>
                        <div>采收数量</div>
                        <div>操作时间</div>
                        <div>操作人</div>
                    </div>
                    <div class="t-body">
                        <div class="table-list"  v-for="(item,index) in ncpAll" :key="index">
                            <div>{{item.strainName}}</div>
                            <div>{{item.jobWay}}</div>
                            <div>{{item.landName}}</div>
                            <div>{{Number(item.leaves) + 1}}等品</div>
                            <div>{{item.weight}}公斤</div>
                            <div>{{item.createTime}}</div>
                            <div>{{item.operator}}</div>
                        </div>
                    </div>
                </div>
            </template>
        </public-box>
        <public-box
                v-show="nsjlPopupFlag"
                :closeFlag="'nsjlPopupFlag'"
                :className="'public-farm-oper-table'"
        >
            <template slot="public-box-header">
                <div class="logo"></div>
                <div class="title">农事操作</div>
                <img
                        @click="nsjlPopupFlag = false"
                        src="/img/icon/public-close.png"
                        alt
                        class="close"
                />
            </template>
            <template slot="public-box-content">
                <div class="action-bar">
                    <div class="search">
                        <el-select
                                class="select-type"
                                size="small"
                                v-model="farmOperType"
                                placeholder="选择农事类型"
                        >
                            <el-option
                                    v-for="(item, index) in farmingList"
                                    :key="index"
                                    :label="item.name"
                                    :value="item.type"
                            ></el-option>
                        </el-select>
                        <el-select
                                class="select-plot"
                                size="small"
                                v-model="farmPlotId"
                                placeholder="选择地块"
                        >
                            <el-option
                                    v-for="(item, index) in plotNumArray"
                                    :key="index"
                                    :label="item.landName"
                                    :value="item.id"
                            ></el-option>
                        </el-select>
                    </div>
                    <div class="btn-grounp">
                        <el-button
                                size="small"
                                class="search"
                                type="primary"
                                icon="el-icon-search"
                                @click="farmSelectList"
                        >查询</el-button>
                        <el-button
                                size="small"
                                class="reset"
                                type="info"
                                icon="el-icon-refresh-right"
                                @click="farmResetList"
                        >重置</el-button>
                    </div>
                </div>
                <div class="table-list">
                    <div class="t-header">
                        <div>农事类型</div>
                        <div>地块</div>
                        <div>备注</div>
                        <div>农资</div>
                        <div>作业方式</div>
                        <div>农事操作时间</div>
                        <div>创建时间</div>
                        <div>操作人</div>
                    </div>
                    <div class="t-body">
                        <div class="table-list" v-for="(item, index) in farmOperList" :key="index">
                            <div>{{item.typeName}}</div>
                            <div>{{item.landName}}</div>
                            <div>{{item.remarks == '' ? '--' : item.remarks}}</div>
                            <div>{{item.agriculturalName}}</div>
                            <div>{{item.jobWay == 0 ? '人工' : '机械'}}</div>
                            <div>{{item.time}}</div>
                            <div>{{item.createTime.substr(0,10)}}</div>
                            <div>{{item.realName}}</div>
                        </div>
                    </div>
                </div>
@@ -410,7 +554,11 @@
    productsSupervise,
    pageCountNzCrk,
    getSweepRecordStatistics,
    getSweepRecordStatisticsByDayOrMonthOrYear
    getSweepRecordStatisticsByDayOrMonthOrYear,
    getFarmingRecordList,
    getFarmingStatis,
    getLandList,
    productsSuperviseList
} from '@/api/farm/farmingrecord'
export default {
@@ -462,8 +610,26 @@
            cltjOrsym: 'cltj',
            // 投入品监管窗体控制
            trpPopupFlag: false,
            // 农事记录
            nsjlPopupFlag: false
            // 农事记录窗体控制
            nsjlPopupFlag: false,
            // 农资出入记录窗体控制
            nzcrPopupFlag: false,
            // 农产品监管窗体控制
            ncpPopupFlag: false,
            // 农事操作记录列表
            farmOperList: [],
            // 选择的农事类型
            farmOperType: '',
            // 农场地块id
            farmPlotId: '',
            // 地块下拉
            plotNumArray: [],
            // 农事类型下拉
            farmingList: [],
            // 农资出入库记录弹窗
            stockrecordAll: [],
            // 农产品监管记录弹窗
            ncpAll: []
        }
    },
    created () {
@@ -499,11 +665,56 @@
    methods: {
        // 投入品监管明细弹窗
        popDetailedSupervise () {
            this.trpPopupFlag = true
            if (this.trpOrNcp == 'trp') {
                this.trpPopupFlag = true
            } else {
                var params = {}
                params.codes = '000000'
                params.deptId = '1123598813738675201'
                params.current = '1'
                params.size = '999'
                productsSuperviseList(Object.assign(params)).then((res) => {
                    this.ncpPopupFlag = true
                    this.ncpAll = res.data.data.records
                })
            }
        },
        // 农事记录明细弹窗
        popDetailedFarming () {
            this.nsjlPopupFlag = true
        popDetailedFarming (item) {
            if (this.nsjlOrnz == 'nsjl') {
                this.getFarmingStatis()
                this.getLandList()
                getFarmingRecordList({ type: item.type, landId: item.landId }).then(res => {
                    this.farmOperList = res.data.data
                    this.nsjlPopupFlag = true
                })
            } else {
                    var params = {}
                    params.codes = '000000'
                    params.deptId = '1123598813738675201'
                    params.current = '1'
                    params.size = '999'
                    pageCountNzCrk(Object.assign(params)).then((res) => {
                        this.nzcrPopupFlag = true
                        this.stockrecordAll = res.data.data.records
                    })
            }
        },
        // 农事操作搜索
        farmSelectList () {
            this.farmOperClick({ type: this.farmOperType, landId: this.farmPlotId })
        },
        // 农事操作重置
        farmResetList () {
            this.farmOperType = ''
            this.farmPlotId = ''
            this.farmOperClick({ type: this.farmOperType, landId: this.farmPlotId })
        },
        farmOperClick (item) {
            getFarmingRecordList({ type: item.type, landId: item.landId }).then(res => {
                this.farmOperList = res.data.data
                this.farmOperPopup = true
            })
        },
        // 任务总数时间查询
        getTaskTime (e) {
@@ -1154,6 +1365,20 @@
                // 溯源码
                this.initSymyBar('ClSyEcharts')
            }
        },
        // 本年农事操作记录,分组统计
        getFarmingStatis () {
            var that = this
            var deptId = '1123598813738675201'
            getFarmingStatis(deptId).then((res) => {
                that.farmingList = res.data.data
            })
        },
        // 地块下拉
        getLandList () {
            getLandList().then(res => {
                this.plotNumArray = res.data.data
            })
        }
    }
}