|
@@ -1,8 +1,368 @@
|
|
<template>
|
|
<template>
|
|
|
|
+ <a-card :bordered="false" class="cleanDetail-container">
|
|
|
|
+ <!-- 搜索条件 -->
|
|
|
|
+ <div class="cleanDetail-container-searchForm">
|
|
|
|
+ <a-form-model
|
|
|
|
+ ref="queryParam"
|
|
|
|
+ :model="queryParam"
|
|
|
|
+ layout="inline"
|
|
|
|
+ @keyup.enter.native="$refs.table.refresh(true)"
|
|
|
|
+ v-bind="formItemLayout">
|
|
|
|
+ <a-row :gutter="24">
|
|
|
|
+ <a-col :xs="24" :sm="12" :md="6" :lg="5">
|
|
|
|
+ <a-form-model-item label="最后清运时间" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
|
+ <a-range-picker
|
|
|
|
+ id="netWorkCleanRecord-time"
|
|
|
|
+ v-model="time"
|
|
|
|
+ style="width: 100%;"
|
|
|
|
+ :format="dateFormat"
|
|
|
|
+ :placeholder="['开始时间','结束时间']"
|
|
|
|
+ :disabledDate="disabledDate"
|
|
|
|
+ @change="onChange" />
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :xs="24" :sm="12" :md="6" :lg="5">
|
|
|
|
+ <a-form-model-item label="网点名称" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
|
+ <a-select
|
|
|
|
+ id="netWorkCleanRecord-stationNo"
|
|
|
|
+ placeholder="请选择网点名称"
|
|
|
|
+ allowClear
|
|
|
|
+ v-model="queryParam.stationNo"
|
|
|
|
+ :showSearch="true"
|
|
|
|
+ option-filter-prop="children"
|
|
|
|
+ :filter-option="filterOption">
|
|
|
|
+ <a-select-option v-for="item in optionData" :key="item.stationNo" :value="item.stationNo">{{ item.name }}</a-select-option>
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :xs="24" :sm="12" :md="6" :lg="5">
|
|
|
|
+ <a-form-model-item label="设备编号" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
|
+ <a-input allowClear placeholder="请输入设备编号" v-model.trim="queryParam.phone" id="netWorkCleanRecord-stationNo"/>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :xs="24" :sm="12" :md="6" :lg="5">
|
|
|
|
+ <a-form-model-item label="排序规则" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
|
+ <v-select code="ENABLE_FLAG" v-model="queryParam.loginFlag" allowClear placeholder="请选择操作人" id="netWorkCleanRecord-stationNo" ></v-select>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :xs="24" :sm="12" :md="6" :lg="4">
|
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)" id="netWorkCleanRecord-refresh" style="margin: 4px 10px 0 20px">查询</a-button>
|
|
|
|
+ <a-button type="" @click="reset" id="netWorkCleanRecord-reset" style="margin-top: 4px">重置</a-button>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ <a-row :gutter="24">
|
|
|
|
+ <a-col :xs="24" :sm="12" :md="6" :lg="5">
|
|
|
|
+ <a-form-model-item prop="provinceCode" label="所属区域:" :label-col="{ span:8 }" :wrapper-col="{ span:16}">
|
|
|
|
+ <a-select id="rubbishTotal-provinceCode" allowClear v-model="queryParam.provinceCode" @change="getCityList" placeholder="请选择省">
|
|
|
|
+ <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :xs="24" :sm="12" :md="6" :lg="5">
|
|
|
|
+ <a-form-model-item prop="cityCode" label=" " :colon="false" :label-col="{ span:8 }" :wrapper-col="{ span:16}">
|
|
|
|
+ <a-select allowClear id="rubbishTotal-cityCode" v-model="queryParam.cityCode" @change="getAreaList" placeholder="请选择市">
|
|
|
|
+ <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :xs="24" :sm="12" :md="6" :lg="5">
|
|
|
|
+ <a-form-model-item prop="districtCode" label=" " :colon="false" :label-col="{ span:8}" :wrapper-col="{ span:16}">
|
|
|
|
+ <a-select allowClear id="rubbishTotal-districtCode" v-model="queryParam.districtCode" placeholder="请选择区/县">
|
|
|
|
+ <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ </a-form-model>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 合计 -->
|
|
|
|
+ <a-alert type="info" showIcon style="margin-bottom:15px">
|
|
|
|
+ <div class="ftext" slot="message">总计<span> {{ }} </span>条,可回收垃圾总计<span> {{ }} </span>kg。 其中,废旧衣物<span> {{ }} </span>kg,废旧纸张<span> {{ }} </span>kg,废旧金属<span> {{ }} </span>kg,废旧塑料<span> {{ }} </span>kg,废旧金属/塑料<span> {{ }} </span>kg,废旧玻璃<span> {{ }} </span>kg,可回收物<span> {{ }} </span>kg</div>
|
|
|
|
+ <!-- <div class="ftext" slot="message">其中,废旧衣物<span> {{ }} </span>kg,废旧衣物<span> {{ }} </span>kg,废旧衣物<span> {{ }} </span>kg,废旧衣物<span> {{ }} </span>kg,废旧衣物<span> {{ }} </span>kg,废旧衣物<span> {{ }} </span>kg</div> -->
|
|
|
|
+ </a-alert>
|
|
|
|
+ <!-- 列表 -->
|
|
|
|
+ <a-table
|
|
|
|
+ ref="table"
|
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :data-source="data"
|
|
|
|
+ bordered
|
|
|
|
+ @change="changeSort">
|
|
|
|
+ <template slot="customTitle">
|
|
|
|
+ <a-tooltip placement="top">
|
|
|
|
+ <template slot="title">
|
|
|
|
+ <span>当【套餐管理】中的套餐启用时,可在当前页面进行合作商对应套餐的启用和禁用操作。禁用后,该套餐将不能被对应合作商销售。如果【套餐管理】中套餐被禁用,则在当前页面不能进行合作商套餐的启用和禁用操作。</span>
|
|
|
|
+ </template>
|
|
|
|
+ 可回收垃圾库存量(kg)
|
|
|
|
+ <a-icon type="question-circle" :style="{ color: '#1890FF' }" />
|
|
|
|
+ </a-tooltip>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 操作 -->
|
|
|
|
+ <span slot="action" slot-scope="text,record">
|
|
|
|
+ <a-button type="primary" @click="handleDetail(record)">立即清运</a-button>
|
|
|
|
+ </span>
|
|
|
|
+ </a-table>
|
|
|
|
+ <!-- 清运弹窗 -->
|
|
|
|
+ <cleanModal :id="itemId" :visible="isOpenModal" @click="isOpenModal=false"></cleanModal>
|
|
|
|
+ </a-card>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import {
|
|
|
|
+ STable,
|
|
|
|
+ VSelect
|
|
|
|
+} from '@/components'
|
|
|
|
+import {
|
|
|
|
+ stationList
|
|
|
|
+} from '@/api/releaseRecord.js'
|
|
|
|
+import {
|
|
|
|
+ getProvince,
|
|
|
|
+ getCityByPro,
|
|
|
|
+ getDistrictByCity
|
|
|
|
+} from '@/api/station'
|
|
|
|
+import cleanModal from './cleanModal.vue'
|
|
|
|
+import moment from 'moment'
|
|
|
|
+import getDate from '@/libs/getDate.js'
|
|
|
|
+const columns = [{
|
|
|
|
+ title: '网点名称',
|
|
|
|
+ dataIndex: 'no',
|
|
|
|
+ width: 60,
|
|
|
|
+ align: 'center'
|
|
|
|
+},
|
|
|
|
+{
|
|
|
|
+ title: '设备编号',
|
|
|
|
+ dataIndex: 'name',
|
|
|
|
+ width: 100,
|
|
|
|
+ align: 'center',
|
|
|
|
+ customRender: (text) => {
|
|
|
|
+ return text || '--'
|
|
|
|
+ }
|
|
|
|
+},
|
|
|
|
+{
|
|
|
|
+ slots: {title: 'customTitle'},
|
|
|
|
+ children: [
|
|
|
|
+ { title: '废旧衣物', width: 100, align: 'center',customRender: (text) => {return text || 0} },
|
|
|
|
+ { title: '废旧纸张', width: 100, align: 'center',customRender: (text) => {return text || 0} },
|
|
|
|
+ { title: '废旧塑料', width: 100, align: 'center', customRender: (text) => {return text || 0} },
|
|
|
|
+ { title: '废旧金属', width: 100, align: 'center', customRender: (text) => {return text || 0} },
|
|
|
|
+ { title: '废旧金属/塑料', width: 100, align: 'center', customRender: (text) => {return text || 0} },
|
|
|
|
+ { title: '废旧玻璃', width: 100, align: 'center', customRender: (text) => {return text || 0} },
|
|
|
|
+ { title: '可回收物', width: 100, align: 'center', customRender: (text) => {return text || 0} }
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '可回收垃圾小计(kg)',
|
|
|
|
+ dataIndex: 'createDate',
|
|
|
|
+ width: 100,
|
|
|
|
+ align: 'center',
|
|
|
|
+ },
|
|
|
|
+{
|
|
|
|
+ title: '最后清运时间',
|
|
|
|
+ dataIndex: 'changjia',
|
|
|
|
+ width: 100,
|
|
|
|
+ align: 'center',
|
|
|
|
+ customRender: (text) => {
|
|
|
|
+ return text || '--'
|
|
|
|
+ }
|
|
|
|
+},
|
|
|
|
+{
|
|
|
|
+ title: '操作',
|
|
|
|
+ dataIndex: 'action',
|
|
|
|
+ width: 100,
|
|
|
|
+ align: 'center',
|
|
|
|
+ scopedSlots: {
|
|
|
|
+ customRender: 'action'
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+]
|
|
|
|
+const data = [{
|
|
|
|
+ createDate: '2020-01-05',
|
|
|
|
+ MAC: '22210245224555',
|
|
|
|
+ name: '电子秤',
|
|
|
|
+ num: '2222554585877',
|
|
|
|
+ org: 'X-001',
|
|
|
|
+ changjia: '上海电子厂'
|
|
|
|
+},
|
|
|
|
+{
|
|
|
|
+ createDate: '2020-01-05',
|
|
|
|
+ MAC: '22210245224555',
|
|
|
|
+ name: '电子秤',
|
|
|
|
+ num: '2222554585877',
|
|
|
|
+ org: 'X-001',
|
|
|
|
+ changjia: '上海电子厂'
|
|
|
|
+},
|
|
|
|
+{
|
|
|
|
+ createDate: '2020-01-05',
|
|
|
|
+ MAC: '22210245224555',
|
|
|
|
+ name: '电子秤',
|
|
|
|
+ num: '2222554585877',
|
|
|
|
+ org: 'X-001',
|
|
|
|
+ changjia: '上海电子厂'
|
|
|
|
+},
|
|
|
|
+{
|
|
|
|
+ createDate: '2020-01-05',
|
|
|
|
+ MAC: '22210245224555',
|
|
|
|
+ name: '电子秤',
|
|
|
|
+ num: '2222554585877',
|
|
|
|
+ org: 'X-001',
|
|
|
|
+ changjia: '上海电子厂'
|
|
|
|
+}
|
|
|
|
+]
|
|
|
|
+export default {
|
|
|
|
+ components: {
|
|
|
|
+ STable,
|
|
|
|
+ VSelect,
|
|
|
|
+ cleanModal
|
|
|
|
+ },
|
|
|
|
+ data () {
|
|
|
|
+ return {
|
|
|
|
+ formItemLayout: {
|
|
|
|
+ labelCol: {
|
|
|
|
+ span: 8
|
|
|
|
+ },
|
|
|
|
+ wrapperCol: {
|
|
|
|
+ span: 16
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ isOpenModal: false, // 默认弹窗关闭
|
|
|
|
+ itemId: '', // 行id
|
|
|
|
+ // 查询参数
|
|
|
|
+ queryParam: {
|
|
|
|
+ stationNo: undefined,
|
|
|
|
+ phone: '',
|
|
|
|
+ loginFlag: '',
|
|
|
|
+ beginDate: null,
|
|
|
|
+ endDate: null,
|
|
|
|
+ provinceCode: undefined, // 省
|
|
|
|
+ cityCode: undefined, // 市
|
|
|
|
+ districtCode: undefined // 区
|
|
|
|
+ },
|
|
|
|
+ // 网点名称数据
|
|
|
|
+ optionData: [],
|
|
|
|
+ addrProvinceList: [], // 省下拉
|
|
|
|
+ addrCityList: [], // 市下拉
|
|
|
|
+ addrDistrictList: [], // 区下拉
|
|
|
|
+ columns,
|
|
|
|
+ data,
|
|
|
|
+ // 将默认当天时间日期回显在时间选择框中
|
|
|
|
+ time: [
|
|
|
|
+ moment(getDate.getRecentday().starttime, 'YYYY-MM-DD'),
|
|
|
|
+ moment(getDate.getRecentday().endtime, 'YYYY-MM-DD')
|
|
|
|
+ ],
|
|
|
|
+ dateFormat: 'YYYY-MM-DD'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ mounted () {
|
|
|
|
+ this.getStationList()
|
|
|
|
+ this.getProvinceList()
|
|
|
|
+ this.queryParam.loginFlag = '1'
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ // 不可选日期
|
|
|
|
+ disabledDate (date, dateStrings) {
|
|
|
|
+ return date && date.valueOf() > Date.now()
|
|
|
|
+ },
|
|
|
|
+ // 创建时间change
|
|
|
|
+ onChange (dates, dateStrings) {
|
|
|
|
+ if ((dates, dateStrings)) {
|
|
|
|
+ this.queryParam.beginDate = dateStrings[0]
|
|
|
|
+ this.queryParam.endDate = dateStrings[1]
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ filterOption (input, option) {
|
|
|
|
+ return (
|
|
|
|
+ option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
|
+ )
|
|
|
|
+ },
|
|
|
|
+ // 获取合作商数据
|
|
|
|
+ getStationList () {
|
|
|
|
+ stationList().then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.optionData = res.data || []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 获取省列表'
|
|
|
|
+ getProvinceList () {
|
|
|
|
+ getProvince().then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.addrProvinceList = res.data || []
|
|
|
|
+ } else {
|
|
|
|
+ this.addrProvinceList = []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 获取城市列表
|
|
|
|
+ getCityList (val) {
|
|
|
|
+ this.addrCityList = []
|
|
|
|
+ this.addrDistrictList = []
|
|
|
|
+ this.queryParam.cityCode = undefined
|
|
|
|
+ this.queryParam.districtCode = undefined
|
|
|
|
+ this.getCityListRequest(val)
|
|
|
|
+ },
|
|
|
|
+ getCityListRequest (val) {
|
|
|
|
+ getCityByPro({
|
|
|
|
+ id: val
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.addrCityList = res.data || []
|
|
|
|
+ } else {
|
|
|
|
+ this.addrCityList = []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 获取区县列表
|
|
|
|
+ getAreaList (val) {
|
|
|
|
+ this.addrDistrictList = []
|
|
|
|
+ this.queryParam.districtCode = undefined
|
|
|
|
+ this.getAreaListRequest(val)
|
|
|
|
+ },
|
|
|
|
+ getAreaListRequest (val) {
|
|
|
|
+ getDistrictByCity({
|
|
|
|
+ id: val
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.addrDistrictList = res.data || []
|
|
|
|
+ } else {
|
|
|
|
+ this.addrDistrictList = []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 排序
|
|
|
|
+ changeSort () {
|
|
|
|
+ console.log('-------------排序 ')
|
|
|
|
+ },
|
|
|
|
+ // 重置
|
|
|
|
+ reset () {
|
|
|
|
+ this.queryParam = {
|
|
|
|
+ stationNo: undefined,
|
|
|
|
+ phone: '',
|
|
|
|
+ loginFlag: '',
|
|
|
|
+ beginDate: null,
|
|
|
|
+ endDate: null
|
|
|
|
+ }
|
|
|
|
+ this.time = [
|
|
|
|
+ moment(getDate.getRecentday().starttime, 'YYYY-MM-DD'),
|
|
|
|
+ moment(getDate.getRecentday().endtime, 'YYYY-MM-DD')
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ // 查看清运详情
|
|
|
|
+ handleDetail (record) {
|
|
|
|
+ // this.itemId = record.id
|
|
|
|
+ this.isOpenModal = true
|
|
|
|
+ console.log('----------详情')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
|
|
|
+<style lang='less' scoped>
|
|
|
|
+ .cleanDetail-container {
|
|
|
|
+ .cleanDetail-container-searchForm {
|
|
|
|
+ .ant-form-inline .ant-form-item {
|
|
|
|
+ width: 100%;
|
|
|
|
+ margin-bottom: 15px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|