Bläddra i källkod

Merge branch 'deploy_baobiao' of http://git.chelingzhu.com/chelingzhu-web/zxyj-admin-html into deploy_baobiao

lilei 4 år sedan
förälder
incheckning
30b155f55a

+ 10 - 0
src/api/luckyDraw.js

@@ -69,3 +69,13 @@ export const getLuckyDrawWinDetail = (params) => {
     method: 'get'
   })
 }
+
+// 中奖纪录导出
+export const exportLuckyDrawWin = (params) => {
+  return axios.request({
+    url: 'luckyDrawWin/exportLuckyDrawWin',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 64 - 0
src/api/reportForm.js

@@ -0,0 +1,64 @@
+import { axios } from '@/utils/request'
+
+// 垃圾投递分时查询表
+// 列表查询
+export const getPutInTimeList = (params) => {
+  const url = `putInTimeShareing/query/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 导出
+export const exportTnTimeForm = (params) => {
+  return axios.request({
+    url: 'putInTimeShareing/exportPutInTimeShareing',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 合计
+export const getDetailTotal = (params) => {
+  const url = `putInTimeShareing/sumAllOfDetail`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+/**
+ * 垃圾投递汇总表
+ */
+// 列表查询
+export const getSumList = (params) => {
+  const url = `putInTimeShareing/querySum/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 导出
+export const exportSumForm = (params) => {
+  return axios.request({
+    url: 'putInTimeShareing/exportPutInTimeShareingSum',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 合计
+export const getSumTotal = (params) => {
+  const url = `putInTimeShareing/sumAllOfSum`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 163 - 92
src/views/market/winingRecord.vue

@@ -38,22 +38,22 @@
           <a-col :span="4">
             <a-button class="handle-btn serach-btn" id="winRecord-btn-serach" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
             <a-button class="handle-btn serach-btn" type="" id="winRecord-btn-reset" @click="handleReset">重置</a-button>
-            <a-button class="export-btn" id="releaseRecordList-export" :loading="loading" @click="handleExport">导出</a-button>
+            <a-button class="export-btn" id="winRecord-btn--export" :loading="loading" @click="handleExport">导出</a-button>
           </a-col>
         </a-row>
         <a-row :gutter="20">
           <a-col :span="5">
             <a-form-item label="活动名称" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-              <a-input id="winRecord-prizeDesc" allowClear v-model="queryParam.prizeDesc" placeholder="请输入活动名称" />
+              <a-input id="winRecord-activeName" allowClear v-model="queryParam.activeName" placeholder="请输入活动名称" />
             </a-form-item>
           </a-col>
           <a-col :span="5">
             <a-form-item label="奖品类型" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
               <v-select
-                v-model="queryParam.state"
+                v-model="queryParam.prizeType"
                 ref="orderState"
-                id="winRecord-state"
-                code="PRIZE_WIN_STATE"
+                id="winRecord-prizeType"
+                code="PRIZE_TYPE"
                 placeholder="请选择奖品类型"
                 allowClear></v-select>
             </a-form-item>
@@ -99,22 +99,38 @@
 </template>
 
 <script>
-import { STable, VSelect } from '@/components'
+import {
+  STable,
+  VSelect
+} from '@/components'
 import GoodsLogistics from './GoodsLogistics.vue'
 import GoodsLogisticsDetail from './GoodsLogisticsDetail.vue'
 import getDate from '@/libs/getDate.js'
 import moment from 'moment'
-import { getLuckyWinList, sendExpress } from '@/api/luckyDraw.js'
+import {
+  getLuckyWinList,
+  sendExpress,
+  exportLuckyDrawWin
+} from '@/api/luckyDraw.js'
 export default {
   name: 'WinRecord',
-  components: { STable, VSelect, GoodsLogistics, GoodsLogisticsDetail },
+  components: {
+    STable,
+    VSelect,
+    GoodsLogistics,
+    GoodsLogisticsDetail
+  },
   data () {
     return {
       openModal: false, //  是否填写物流信息
       openDetailModal: false, //  是否查看物流信息
       formItemLayout: {
-        labelCol: { span: 6 },
-        wrapperCol: { span: 18 }
+        labelCol: {
+          span: 6
+        },
+        wrapperCol: {
+          span: 18
+        }
       },
       // 查询参数
       queryParam: {
@@ -122,21 +138,67 @@ export default {
         endDate: null, // 结束时间
         prizeDesc: '', //  奖品
         customerMobile: '', // 用户
-        state: '' // 状态
+        state: '', // 状态
+        activeName: '', // 活动名称
+        prizeType: '' // 奖品类型
       },
-	  itemId: '', // 发货列id
-	  luckyDrawWinNo: '', // 中奖奖品编码
+      itemId: '', // 发货列id
+      luckyDrawWinNo: '', // 中奖奖品编码
       loading: false, // 导出loading
       // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '中奖时间', dataIndex: 'winTime', width: 200, align: 'center' },
-        { title: '活动名称', dataIndex: 'activeName', width: 200, align: 'center' },
-        { title: '奖品类型', dataIndex: '', width: 200, align: 'center' },
-        { title: '奖品', dataIndex: 'prizeDesc', scopedSlots: { customRender: 'prizeDesc' }, width: 200, align: 'center' },
-        { title: '中奖用户', dataIndex: 'customerMobile', width: 200, align: 'center' },
-        { title: '状态', dataIndex: 'stateDictValue', width: 200, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 80,
+        align: 'center'
+      },
+      {
+        title: '中奖时间',
+        dataIndex: 'winTime',
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '活动名称',
+        dataIndex: 'activeName',
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '奖品类型',
+        dataIndex: 'prizeTypeDictValue',
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '奖品',
+        dataIndex: 'prizeDesc',
+        scopedSlots: {
+          customRender: 'prizeDesc'
+        },
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '中奖用户',
+        dataIndex: 'customerMobile',
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '状态',
+        dataIndex: 'stateDictValue',
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '操作',
+        scopedSlots: {
+          customRender: 'action'
+        },
+        width: 150,
+        align: 'center'
+      }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -190,47 +252,51 @@ export default {
         moment(getDate.getToday().endtime, this.dateFormat)
       ]
       this.queryParam.customerMobile = ''
+      this.queryParam.activeName = ''
+      this.queryParam.prizeType = ''
       this.queryParam.prizeDesc = ''
       this.queryParam.state = ''
       this.$refs.table.refresh(true)
     },
     // 导出
     handleExport () {
-	  const params = this.queryParam
-	  if (this.time && this.time.length) {
-	    params.beginDate = moment(this.time[0]).format('YYYY-MM-DD')
-	    params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
-	  } else {
-	    params.beginDate = ''
-	    params.endDate = ''
-	  }
-	  if (!params.beginDate && !params.endDate) {
-	    this.$message.error('请先选择需要导出的投放时间区间再进行导出!')
-	    return
-	  }
-	  // 判断两个时间段是否相差m个月  第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
-	  if (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 3) {
-	    this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
-	  }
-	  this.loading = true
-	  // exportDeliveryLog(params).then(res => {
-	  //   this.loading = false
-	  //   this.download(res)
-	  // })
+      const params = this.queryParam
+      if (this.time && this.time.length) {
+        params.beginDate = moment(this.time[0]).format('YYYY-MM-DD 00:00:00')
+        params.endDate = moment(this.time[1]).format('YYYY-MM-DD 23:59:59')
+      } else {
+        params.beginDate = ''
+        params.endDate = ''
+      }
+      if (!params.beginDate && !params.endDate) {
+        this.$message.error('请先选择需要导出的投放时间区间再进行导出!')
+        return
+      }
+      // 判断两个时间段是否相差m个月  第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
+      if (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 3) {
+        this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
+      }
+      this.loading = true
+      exportLuckyDrawWin(params).then(res => {
+        this.loading = false
+        this.download(res)
+      })
     },
     download (data) {
-	  if (!data) {
-	    return
-	  }
-	  const url = window.URL.createObjectURL(new Blob([data]))
-	  const link = document.createElement('a')
-	  link.style.display = 'none'
-	  link.href = url
-	  const a = moment().format('YYYY-MM-DD')
-	  const fname = a + '垃圾分类投递量统计表' + '(陕西省西安市)'
-	  link.setAttribute('download', fname + '.xlsx')
-	  document.body.appendChild(link)
-	  link.click()
+      if (!data) {
+        return
+      }
+      const url = window.URL.createObjectURL(new Blob([data]))
+      const link = document.createElement('a')
+      link.style.display = 'none'
+      link.href = url
+      // const a = moment().format('YYYY-MM-DD')
+      const a = moment(this.queryParam.beginDate).format('LL') + '-' + moment(this.queryParam.endDate).format('LL')
+	  console.log(a)
+      const fname = a + '中奖记录表'
+      link.setAttribute('download', fname + '.xlsx')
+      document.body.appendChild(link)
+      link.click()
     },
     //  查看物流详情
     handleView (row) {
@@ -240,52 +306,57 @@ export default {
     // 发货
     sendGood (row) {
       this.itemId = row.id
-	  this.luckyDrawWinNo = row.luckyDrawWinNo
+      this.luckyDrawWinNo = row.luckyDrawWinNo
       this.openModal = true
     },
     // 提交发货
     handleSubmit (data) {
       console.log(data, 'ppppppp')
-	  const params = data
-	  params.luckyDrawWinNo = this.luckyDrawWinNo
-	  sendExpress(params).then(res => {
-		  if (res.status == 200) {
-			  this.openModal = false
-			  this.$message.success(res.message)
-			  this.$refs.table.refresh(true)
-		  }
-	  })
+      const params = data
+      params.luckyDrawWinNo = this.luckyDrawWinNo
+      sendExpress(params).then(res => {
+        if (res.status == 200) {
+          this.openModal = false
+          this.$message.success(res.message)
+          this.$refs.table.refresh(true)
+        }
+      })
     }
   }
 }
 </script>
 <style lang="less" scoped>
-  .winRecord-table-page-search-wrapper{
-    .winRecord-searchForm{
-      .ant-form-inline .ant-form-item{
-        width: 100%;
-      }
-      // 搜索框的下间距
-      .ant-form-item {
-      	margin-bottom: 10px;
-      }
-      .handle-btn{
-        margin-top: 4px;
-        margin-bottom: 20px;
-      }
-      .serach-btn{
-        margin-right: 10px;
-      }
-    }
-	.export-btn {
-		background-color: #ff9900;
-		border-color: #ff9900;
-		color: #fff;
-	}
-	.export-btn.ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger),
-	.export-btn.ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger) {
-		color: #fff;
-		border-color: #ff9900;
+	.winRecord-table-page-search-wrapper {
+		.winRecord-searchForm {
+			.ant-form-inline .ant-form-item {
+				width: 100%;
+			}
+
+			// 搜索框的下间距
+			.ant-form-item {
+				margin-bottom: 10px;
+			}
+
+			.handle-btn {
+				margin-top: 4px;
+				margin-bottom: 20px;
+			}
+
+			.serach-btn {
+				margin-right: 10px;
+			}
+		}
+
+		.export-btn {
+			background-color: #ff9900;
+			border-color: #ff9900;
+			color: #fff;
+		}
+
+		.export-btn.ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger),
+		.export-btn.ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger) {
+			color: #fff;
+			border-color: #ff9900;
+		}
 	}
-  }
 </style>

+ 56 - 70
src/views/reportForm/rubbishDeliverySearchTime.vue

@@ -4,10 +4,11 @@
       <a-form layout="inline" @keyup.enter.native="refresh">
         <a-row :gutter="20">
           <a-col :span="8">
-            <a-form-item label="投递时间:" :label-col="{ span: 7 }" :wrapper-col="{ span: 17}">
+            <a-form-item label="投递时间:" :label-col="{ span: 5 }" :wrapper-col="{ span: 19}">
               <a-range-picker
                 id="network-time"
                 v-model="time"
+                style="width: 100%;"
                 :format="dateFormat"
                 :showTime="{ format: 'HH'}"
                 :placeholder="['开始时间','结束时间']"
@@ -46,7 +47,7 @@
     </div>
     <!-- 合计 -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div class="ftext" slot="message">总计<span> {{ orderTotal }} </span>条,可回收垃圾总计<span> {{ amountTotal }} </span>千克,有害垃圾总计<span> {{ amountTotal }} </span>千克</div>
+      <div class="ftext" slot="message">总计<span> {{ totalNum }} </span>条,可回收垃圾总计<span> {{ recyclTotal }} </span>千克,有害垃圾总计<span> {{ harmTotal }} </span>千克</div>
     </a-alert>
     <s-table
       ref="table"
@@ -55,39 +56,6 @@
       :columns="columns"
       :data="loadData"
       bordered>
-      <!-- 订单状态 -->
-      <template slot="one" slot-scope="text, record">
-        <span v-if="record.rubbishType=='CLOTHES'">{{ record.rubbishWeight }}</span>
-        <span v-else>0</span>
-      </template>
-      <template slot="two" slot-scope="text, record">
-        <span v-if="record.rubbishType=='PAPER'">{{ record.rubbishWeight }}</span>
-        <span v-else>0</span>
-        </span></template>
-      <template slot="three" slot-scope="text, record">
-        <span v-if="record.rubbishType=='PLASTIC'">{{ record.rubbishWeight }}</span>
-        <span v-else>0</span>
-      </template>
-      <template slot="four" slot-scope="text, record">
-        <span v-if="record.rubbishType=='METAL'">{{ record.rubbishWeight }}</span>
-        <span v-else>0</span>
-      </template>
-      <template slot="five" slot-scope="text, record">
-        <span v-if="record.rubbishType=='HARM'">{{ record.rubbishWeight }}</span>
-        <span v-else>0</span>
-      </template>
-      <template slot="six" slot-scope="text, record">
-        <span v-if="record.rubbishType=='MET_PLA'">{{ record.rubbishWeight }}</span>
-        <span v-else>0</span>
-      </template>
-      <template slot="seven" slot-scope="text, record">
-        <span v-if="record.rubbishType=='GLASS'">{{ record.rubbishWeight }}</span>
-        <span v-else>0</span>
-      </template>
-      <template slot="eight" slot-scope="text, record">
-        <span v-if="record.rubbishType=='RECYCLING'">{{ record.rubbishWeight }}</span>
-        <span v-else>0</span>
-      </template>
     </s-table>
   </a-card>
 
@@ -95,8 +63,12 @@
 
 <script>
 import { STable, VSelect } from '@/components'
-import { getDeliveryLogList, getDeliveryLogTotal, stationList, exportDeliveryLog } from '@/api/releaseRecord.js'
+import {
+  stationList
+} from '@/api/releaseRecord.js'
+import { getPutInTimeList, exportTnTimeForm, getDetailTotal } from '@/api/reportForm.js'
 import moment from 'moment'
+import getDate from '@/libs/getDate.js'
 export default {
   components: { STable, VSelect },
   data () {
@@ -107,8 +79,11 @@ export default {
         labelCol: { span: 4 },
         wrapperCol: { span: 16 }
       },
-      // 将默认当天时间日期回显在时间选择框中
-      time: [],
+      // 将默认近七天时间日期回显在时间选择框中
+      time: [
+        moment(getDate.getRecentday().starttime, 'YYYY-MM-DD HH'),
+        moment(getDate.getRecentday().endtime, 'YYYY-MM-DD HH')
+      ],
       dateFormat: 'YYYY-MM-DD HH',
       // 查询参数
       queryParam: {
@@ -117,58 +92,65 @@ export default {
         stationNo: undefined // 网点名称
       },
       optionData: [],
-      orderTotal: 0,	// 总单数
-      amountTotal: 0,	// 总金额
+      totalNum: 0,	// 总条数
+      recyclTotal: 0,	// 可回收总计
+	  harmTotal: 0, // 有害垃圾总计
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
-        { title: '投放时间', dataIndex: 'deliveryTime', width: 100, align: 'center' },
+        { title: '投递时间', dataIndex: 'putInDate', width: 100, align: 'center' },
         { title: '可回收垃圾投递量(kg)',
           children: [
-            { title: '废旧衣物', width: 100, align: 'center', scopedSlots: { customRender: 'one' } },
-            { title: '废旧纸张', width: 100, align: 'center', scopedSlots: { customRender: 'two' } },
-            { title: '废旧塑料', width: 100, align: 'center', scopedSlots: { customRender: 'three' } },
-            { title: '废旧金属', width: 100, align: 'center', scopedSlots: { customRender: 'four' } },
-            // { title: '有害垃圾', width: 100, align: 'center', scopedSlots: { customRender: 'five' } },
-            { title: '废旧金属/塑料', width: 100, align: 'center', scopedSlots: { customRender: 'six' } },
-            { title: '废旧玻璃', width: 100, align: 'center', scopedSlots: { customRender: 'seven' } },
-            { title: '可回收物', width: 100, align: 'center', scopedSlots: { customRender: 'eight' } }
+            { title: '废旧衣物', width: 100, align: 'center', dataIndex: 'clothesWeight', customRender: (text) => { return text || 0 } },
+            { title: '废旧纸张', width: 100, align: 'center', dataIndex: 'paperWeight', customRender: (text) => { return text || 0 } },
+            { title: '废旧塑料', width: 100, align: 'center', dataIndex: 'plasticWeight', customRender: (text) => { return text || 0 } },
+            { title: '废旧金属', width: 100, align: 'center', dataIndex: 'metalWeight', customRender: (text) => { return text || 0 } },
+            { title: '废旧金属/塑料', width: 100, align: 'center', dataIndex: 'plasticOrMetalWeight', customRender: (text) => { return text || 0 } },
+            { title: '废旧玻璃', width: 100, align: 'center', dataIndex: 'glassWeight', customRender: (text) => { return text || 0 } },
+            { title: '可回收物', width: 100, align: 'center', dataIndex: 'recyclingWeight', customRender: (text) => { return text || 0 } }
           ]
         },
-        { title: '有害垃圾(kg)', dataIndex: '', width: 100, align: 'center' }
+        { title: '可回收垃圾小计(kg)', dataIndex: 'recyclTotalWeight', width: 100, align: 'center' },
+        { title: '有害垃圾(kg)', dataIndex: 'harmWeight', width: 100, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         const searchData = Object.assign(parameter, this.queryParam)
         if (this.time && this.time.length) {
-          searchData.beginDate = moment(this.time[0]).format('YYYY-MM-DD HH')
-          searchData.endDate = moment(this.time[1]).format('YYYY-MM-DD HH')
+          searchData.beginDate = moment(this.time[0])
+          searchData.endDate = moment(this.time[1])
         } else {
           searchData.beginDate = ''
           searchData.endDate = ''
         }
-        return getDeliveryLogList(searchData).then(res => {
+        return getPutInTimeList(searchData).then(res => {
           if (res.status == 200) {
             const no = (res.data.pageNo - 1) * res.data.pageSize
             for (let i = 0; i < res.data.list.length; i++) {
               const _item = res.data.list[i]
               _item.no = no + i + 1
             }
+            this.totalNum = res.data.count
             this.getListTotal()
             return res.data
-          }
+          } else {
+			  this.totalNum = 0
+		  }
         })
       }
     }
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.handleReset()
+      vm.time = [
+		  moment(getDate.getRecentday().starttime, 'YYYY-MM-DD HH'),
+		  moment(getDate.getRecentday().endtime, 'YYYY-MM-DD HH')
+	  ]
+      vm.queryParam.stationNo = undefined
       vm.getStationList()
     })
   },
   methods: {
-    moment,
     // 不可选日期
     disabledDate (date, dateStrings) {
       return date && date.valueOf() > Date.now()
@@ -189,22 +171,21 @@ export default {
     handleExport () {
       const params = this.queryParam
       if (this.time && this.time.length) {
-        params.beginDate = moment(this.time[0]).format('YYYY-MM-DD HH')
-        params.endDate = moment(this.time[1]).format('YYYY-MM-DD HH')
+        params.beginDate = moment(this.time[0])
+        params.endDate = moment(this.time[1])
       } else {
         params.beginDate = ''
         params.endDate = ''
       }
       if (!params.beginDate && !params.endDate) {
         this.$message.error('请先选择需要导出的投放时间区间再进行导出!')
-        return
       }
       // 判断两个时间段是否相差m个月  第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
       if (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 3) {
         this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
       }
       this.loading = true
-      exportDeliveryLog(params).then(res => {
+      exportTnTimeForm(params).then(res => {
         this.loading = false
         this.download(res)
       })
@@ -215,8 +196,10 @@ export default {
       const link = document.createElement('a')
       link.style.display = 'none'
       link.href = url
-      const a = moment().format('YYYY-MM-DD-HH')
-      const fname = a + '分时投递统计'
+      const a = moment(this.queryParam.beginDate).format('LL') + '-' + moment(this.queryParam.endDate).format('LL')
+	  console.log(a)
+	  const name = this.queryParam.stationNo ? this.optionData.find(item => item.stationNo == this.queryParam.stationNo).name : ''
+      const fname = a + '分时投递统计表' + (name ? '(' + name + ')' : '')
       link.setAttribute('download', fname + '.xlsx')
       document.body.appendChild(link)
       link.click()
@@ -241,27 +224,30 @@ export default {
         stationNo: this.queryParam.stationNo // 网点名称
       }
       if (this.time && this.time.length) {
-        params.beginDate = moment(this.time[0]).format('YYYY-MM-DD')
-        params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
+        params.beginDate = moment(this.time[0])
+        params.endDate = moment(this.time[1])
       } else {
         params.beginDate = ''
         params.endDate = ''
       }
-      getDeliveryLogTotal(params).then(res => {
+      getDetailTotal(params).then(res => {
         if (res.status == 200) {
           if (res.data) {
-            this.orderTotal = res.data.totalNum || 0
-            this.amountTotal = res.data.goldNum || 0
+            this.recyclTotal = res.data.recyclAll || 0
+            this.harmTotal = res.data.harmAll || 0
           } else {
-            this.orderTotal = 0
-            this.amountTotal = 0
+            this.recyclTotal = 0
+            this.harmTotal = 0
           }
         }
       })
     },
     // 重置
     handleReset () {
-      this.time = [],
+      this.time = [
+		  moment(getDate.getRecentday().starttime, 'YYYY-MM-DD HH'),
+		  moment(getDate.getRecentday().endtime, 'YYYY-MM-DD HH')
+	  ]
       this.queryParam.stationNo = undefined
       this.$refs.table.refresh(true)
     }

+ 93 - 116
src/views/reportForm/rubbishDeliveryTotal.vue

@@ -1,44 +1,45 @@
 <template>
   <a-card :bordered="false" class="shopOrder-table-page-search-wrapper">
     <div class="network-searchForm">
-      <a-form layout="inline" v-bind="formItemLayout" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form-model ref="queryForm" :model="queryParam" layout="inline" v-bind="formItemLayout" @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="24">
           <a-col :span="6">
-            <a-form-item label="投递时间" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+            <a-form-model-item label="投递时间" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
               <a-range-picker
                 id="network-time"
                 v-model="time"
+                style="width: 100%;"
                 :format="dateFormat"
                 :placeholder="['开始时间','结束时间']"
                 :disabledDate="disabledDate"
                 @change="onChange" />
-            </a-form-item>
+            </a-form-model-item>
           </a-col>
-          <a-col :span="4">
-            <a-form-item prop="provinceCode" label="所属区域:">
-              <a-select v-model="queryParam.provinceCode" @change="getCityList" placeholder="请选择省">
+          <a-col :span="6">
+            <a-form-model-item prop="provinceCode" label="所属区域:" :label-col="{ span:8 }" :wrapper-col="{ span:16}">
+              <a-select 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-item>
+            </a-form-model-item>
           </a-col>
-          <a-col :span="4">
-            <a-form-item prop="cityCode">
-              <a-select v-model="queryParam.cityCode" @change="getAreaList" placeholder="请选择市">
+          <a-col :span="5">
+            <a-form-model-item prop="cityCode" label=" " :colon="false" :label-col="{ span:1 }" :wrapper-col="{ span:22}">
+              <a-select allowClear 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-item>
+            </a-form-model-item>
           </a-col>
-          <a-col :span="4">
-            <a-form-item prop="districtCode">
-              <a-select v-model="queryParam.districtCode" placeholder="请选择区/县">
+          <a-col :span="5">
+            <a-form-model-item prop="districtCode" label=" " :colon="false" :label-col="{ span:0 }" :wrapper-col="{ span:20}">
+              <a-select allowClear 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-item>
+            </a-form-model-item>
           </a-col>
         </a-row>
         <a-row :gutter="24">
           <a-col :span="6">
-            <a-form-item label="网点名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+            <a-form-model-item label="网点名称" prop="stationNo" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
               <a-select
                 id="releaseRecordList-stationNo"
                 placeholder="请选择网点名称"
@@ -49,20 +50,19 @@
                 :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-item>
+            </a-form-model-item>
           </a-col>
-          <a-col :span="6">
+          <a-col :span="10">
             <a-button class="handle-btn serach-btn" id="network-btn-serach" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
             <a-button class="handle-btn serach-btn" type="" id="network-btn-reset" @click="handleReset">重置</a-button>
             <a-button class="export-btn" id="releaseRecordList-export" :loading="loading" @click="handleExport">导出</a-button>
           </a-col>
         </a-row>
-      </a-form>
+      </a-form-model>
     </div>
     <!-- 合计 -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div class="ftext" slot="message">总计<span> {{ orderTotal }} </span>条,可回收垃圾总计<span> {{ amountTotal }} </span>千克,有害垃圾总计<span>
-        {{ amountTotal }} </span>千克</div>
+      <div class="ftext" slot="message">总计<span> {{ totalNum }} </span>条,可回收垃圾总计<span> {{ recyclTotal }} </span>千克,有害垃圾总计<span> {{ harmTotal }} </span>千克</div>
     </a-alert>
     <s-table
       ref="table"
@@ -71,39 +71,6 @@
       :columns="columns"
       :data="loadData"
       bordered>
-      <!-- 订单状态 -->
-      <template slot="one" slot-scope="text, record">
-        <span v-if="record.rubbishType=='CLOTHES'">{{ record.rubbishWeight }}</span>
-        <span v-else>0</span>
-      </template>
-      <template slot="two" slot-scope="text, record">
-        <span v-if="record.rubbishType=='PAPER'">{{ record.rubbishWeight }}</span>
-        <span v-else>0</span>
-        </span></template>
-      <template slot="three" slot-scope="text, record">
-        <span v-if="record.rubbishType=='PLASTIC'">{{ record.rubbishWeight }}</span>
-        <span v-else>0</span>
-      </template>
-      <template slot="four" slot-scope="text, record">
-        <span v-if="record.rubbishType=='METAL'">{{ record.rubbishWeight }}</span>
-        <span v-else>0</span>
-      </template>
-      <template slot="five" slot-scope="text, record">
-        <span v-if="record.rubbishType=='HARM'">{{ record.rubbishWeight }}</span>
-        <span v-else>0</span>
-      </template>
-      <template slot="six" slot-scope="text, record">
-        <span v-if="record.rubbishType=='MET_PLA'">{{ record.rubbishWeight }}</span>
-        <span v-else>0</span>
-      </template>
-      <template slot="seven" slot-scope="text, record">
-        <span v-if="record.rubbishType=='GLASS'">{{ record.rubbishWeight }}</span>
-        <span v-else>0</span>
-      </template>
-      <template slot="eight" slot-scope="text, record">
-        <span v-if="record.rubbishType=='RECYCLING'">{{ record.rubbishWeight }}</span>
-        <span v-else>0</span>
-      </template>
     </s-table>
   </a-card>
 
@@ -115,17 +82,20 @@ import {
   VSelect
 } from '@/components'
 import {
-  getDeliveryLogList,
-  getDeliveryLogTotal,
-  stationList,
-  exportDeliveryLog
+  stationList
 } from '@/api/releaseRecord.js'
 import {
   getProvince,
   getCityByPro,
   getDistrictByCity
 } from '@/api/station'
+import {
+  getSumList,
+  exportSumForm,
+  getSumTotal
+} from '@/api/reportForm.js'
 import moment from 'moment'
+import getDate from '@/libs/getDate.js'
 export default {
   components: {
     STable,
@@ -143,8 +113,11 @@ export default {
           span: 17
         }
       },
-      // 将默认当天时间日期回显在时间选择框中
-      time: [],
+      // 将默认近七天时间日期回显在时间选择框中
+      time: [
+        moment(getDate.getRecentday().starttime, 'YYYY-MM-DD HH'),
+        moment(getDate.getRecentday().endtime, 'YYYY-MM-DD HH')
+      ],
       dateFormat: 'YYYY-MM-DD',
       // 查询参数
       queryParam: {
@@ -159,8 +132,9 @@ export default {
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
       optionData: [],
-      orderTotal: 0, // 总单数
-      amountTotal: 0, // 总金额
+      totalNum: 0,	// 总条数
+      recyclTotal: 0,	// 可回收总计
+      harmTotal: 0, // 有害垃圾总计
       // 表头
       columns: [{
         title: '序号',
@@ -169,8 +143,8 @@ export default {
         align: 'center'
       },
       {
-        title: '投放时间',
-        dataIndex: 'deliveryTime',
+        title: '网点名称',
+        dataIndex: 'stationName',
         width: 100,
         align: 'center'
       },
@@ -180,64 +154,76 @@ export default {
           title: '废旧衣物',
           width: 100,
           align: 'center',
-          scopedSlots: {
-            customRender: 'one'
+          dataIndex: 'clothesWeight',
+          customRender: (text) => {
+            return text || 0
           }
         },
         {
           title: '废旧纸张',
           width: 100,
           align: 'center',
-          scopedSlots: {
-            customRender: 'two'
+          dataIndex: 'paperWeight',
+          customRender: (text) => {
+            return text || 0
           }
         },
         {
           title: '废旧塑料',
           width: 100,
           align: 'center',
-          scopedSlots: {
-            customRender: 'three'
+          dataIndex: 'plasticWeight',
+          customRender: (text) => {
+            return text || 0
           }
         },
         {
           title: '废旧金属',
           width: 100,
           align: 'center',
-          scopedSlots: {
-            customRender: 'four'
+          dataIndex: 'metalWeight',
+          customRender: (text) => {
+            return text || 0
           }
         },
-        // { title: '有害垃圾', width: 100, align: 'center', scopedSlots: { customRender: 'five' } },
         {
           title: '废旧金属/塑料',
           width: 100,
           align: 'center',
-          scopedSlots: {
-            customRender: 'six'
+          dataIndex: 'plasticOrMetalWeight',
+          customRender: (text) => {
+            return text || 0
           }
         },
         {
           title: '废旧玻璃',
           width: 100,
           align: 'center',
-          scopedSlots: {
-            customRender: 'seven'
+          dataIndex: 'glassWeight',
+          customRender: (text) => {
+            return text || 0
           }
         },
         {
           title: '可回收物',
           width: 100,
           align: 'center',
-          scopedSlots: {
-            customRender: 'eight'
+          dataIndex: 'recyclingWeight',
+          customRender: (text) => {
+            return text || 0
           }
         }
         ]
       },
+      {
+        title: '可回收垃圾小计(kg)',
+        dataIndex: 'recyclTotalWeight',
+        width: 100,
+        align: 'center'
+      },
       {
         title: '有害垃圾(kg)',
-        dataIndex: '',
+        dataIndex: 'harmWeight',
         width: 100,
         align: 'center'
       }
@@ -252,29 +238,35 @@ export default {
           searchData.beginDate = ''
           searchData.endDate = ''
         }
-        return getDeliveryLogList(searchData).then(res => {
+        return getSumList(searchData).then(res => {
           if (res.status == 200) {
             const no = (res.data.pageNo - 1) * res.data.pageSize
             for (let i = 0; i < res.data.list.length; i++) {
               const _item = res.data.list[i]
               _item.no = no + i + 1
             }
+            this.totalNum = res.data.count
             this.getListTotal()
             return res.data
-          }
+          } else {
+			  this.totalNum = 0
+		  }
         })
       }
     }
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.handleReset()
+      vm.time = [
+		  moment(getDate.getRecentday().starttime, 'YYYY-MM-DD HH'),
+		  moment(getDate.getRecentday().endtime, 'YYYY-MM-DD HH')
+      ]
+      vm.$refs.queryForm.resetFields()
       vm.getStationList()
       vm.getProvinceList()
     })
   },
   methods: {
-    moment,
     // 不可选日期
     disabledDate (date, dateStrings) {
       return date && date.valueOf() > Date.now()
@@ -356,7 +348,7 @@ export default {
         this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
       }
       this.loading = true
-      exportDeliveryLog(params).then(res => {
+      exportSumForm(params).then(res => {
         this.loading = false
         this.download(res)
       })
@@ -369,8 +361,11 @@ export default {
       const link = document.createElement('a')
       link.style.display = 'none'
       link.href = url
-      const a = moment().format('YYYY-MM-DD')
-      const fname = a + '垃圾分类投递量统计表' + '(陕西省西安市)'
+      const a = moment(this.queryParam.beginDate).format('LL') + '-' + moment(this.queryParam.endDate).format('LL')
+      const address = this.queryParam.provinceCode ? this.addrProvinceList.find(item => item.id == this.queryParam.provinceCode).name +
+	  (this.queryParam.cityCode ? this.addrCityList.find(item => item.id == this.queryParam.cityCode).name : '') +
+	  (this.queryParam.districtCode ? this.addrDistrictList.find(item => item.id == this.queryParam.districtCode).name : '') : ''
+      const fname = a + '垃圾分类投递量统计表' + (address ? '(' + address + ')' : '')
       link.setAttribute('download', fname + '.xlsx')
       document.body.appendChild(link)
       link.click()
@@ -389,11 +384,7 @@ export default {
     },
     // 合计
     getListTotal () {
-      const params = {
-        beginDate: this.queryParam.beginDate,
-        endDate: this.queryParam.endDate,
-        stationNo: this.queryParam.stationNo // 网点名称
-      }
+      const params = this.queryParam
       if (this.time && this.time.length) {
         params.beginDate = moment(this.time[0]).format('YYYY-MM-DD')
         params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
@@ -401,22 +392,25 @@ export default {
         params.beginDate = ''
         params.endDate = ''
       }
-      getDeliveryLogTotal(params).then(res => {
+      getSumTotal(params).then(res => {
         if (res.status == 200) {
           if (res.data) {
-            this.orderTotal = res.data.totalNum || 0
-            this.amountTotal = res.data.goldNum || 0
+            this.recyclTotal = res.data.recyclAll || 0
+            this.harmTotal = res.data.harmAll || 0
           } else {
-            this.orderTotal = 0
-            this.amountTotal = 0
+            this.recyclTotal = 0
+            this.harmTotal = 0
           }
         }
       })
     },
     // 重置
     handleReset () {
-      this.time = []
-      this.queryParam.stationNo = undefined
+      this.time = [
+		  moment(getDate.getRecentday().starttime, 'YYYY-MM-DD HH'),
+		  moment(getDate.getRecentday().endtime, 'YYYY-MM-DD HH')
+	  ]
+      this.$refs.queryForm.resetFields()
       this.$refs.table.refresh(true)
     }
   }
@@ -424,23 +418,6 @@ export default {
 </script>
 <style lang="less" scoped>
 	.shopOrder-table-page-search-wrapper {
-
-		// .shopOrder-searchForm{
-		//   .ant-form-inline .ant-form-item{
-		//     width: 100%;
-		//   }
-		//   // 搜索框的下间距
-		//   .ant-form-item {
-		// width: 100%;
-		//   	margin-bottom: 10px;
-		//   }
-		//   .handle-btn{
-		//     margin-bottom: 15px;
-		//   }
-		//   .serach-btn{
-		//     margin-right: 10px;
-		//   }
-		// }
 		.network-searchForm {
 			.ant-form-inline .ant-form-item {
 				width: 100%;

+ 160 - 70
src/views/userInfo/userManageList.vue

@@ -3,54 +3,44 @@
     <div class="userManageList-searchForm">
       <a-form layout="inline" v-bind="formItemLayout" @keyup.enter.native="refresh">
         <a-row :gutter="20">
-          <a-col :span="5">
-            <a-form-item label="投递时间" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <a-col :span="6">
+            <a-form-item label="注册时间" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
               <a-range-picker
                 id="network-time"
-                v-model="time"
+                v-model="registerTime"
                 :format="dateFormat"
                 :placeholder="['开始时间','结束时间']"
                 :disabledDate="disabledDate"
-                @change="onChange" />
+                @change="onChangeregisterTime" />
             </a-form-item>
           </a-col>
-          <a-col :span="5">
+          <a-col :span="6">
             <a-form-item label="最后投递时间" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
               <a-range-picker
                 id="network-time"
-                v-model="time"
+                v-model="lastDeliverTime"
                 :format="dateFormat"
                 :placeholder="['开始时间','结束时间']"
                 :disabledDate="disabledDate"
-                @change="onChange" />
+                @change="onChangelastDeliverTime" />
             </a-form-item>
           </a-col>
-          <a-col :span="5">
+          <a-col :span="6">
             <a-form-item label="用户手机" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
               <a-input id="releaseRecordList-mobile" allowClear :maxLength="11" v-model="queryParam.mobile" placeholder="请输入用户手机" />
             </a-form-item>
           </a-col>
-          <a-col :span="5">
+          <a-col :span="6">
             <a-form-item label="乐豆余额" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
               <div class="input-number">
-                <a-input-number id="releaseRecordList-inputNumber" v-model="queryParam.currentGoldMin" :max="999999999" @change="onChange" />-
-                <a-input-number id="inputNumber" v-model="queryParam.currentGoldMax" :max="999999999" @change="onChange" />
+                <a-input-number id="releaseRecordList-inputNumber" v-model="queryParam.currentGoldMin" :max="999999999" />-
+                <a-input-number id="inputNumber" v-model="queryParam.currentGoldMax" :max="999999999" />
               </div>
             </a-form-item>
           </a-col>
-          <a-col :span="4">
-            <a-button class="handle-btn serach-btn" id="releaseRecordList-btn-serach" type="primary" @click="refresh">查询</a-button>
-            <a-button class="handle-btn" type="" id="releaseRecordList-btn-reset" @click="handleReset">重置</a-button>
-            <a-button
-              class="export-btn"
-              id="releaseRecordList-btn-export"
-              :loading="loading"
-              @click="handleExport"
-              v-hasPermission="'B_user_userManage_export'">导出</a-button>
-          </a-col>
         </a-row>
         <a-row :gutter="20">
-          <a-col :span="5">
+          <a-col :span="6">
             <a-form-item label="账户状态" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
               <v-select
                 v-model="queryParam.state"
@@ -60,7 +50,7 @@
                 allowClear></v-select>
             </a-form-item>
           </a-col>
-          <a-col :span="5">
+          <a-col :span="6">
             <a-form-item label="用户身份" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
               <v-select
                 v-model="queryParam.customerRole"
@@ -70,6 +60,16 @@
                 allowClear></v-select>
             </a-form-item>
           </a-col>
+          <a-col :span="6">
+            <a-button class="handle-btn serach-btn" id="releaseRecordList-btn-serach" type="primary" @click="refresh">查询</a-button>
+            <a-button class="handle-btn" type="" id="releaseRecordList-btn-reset" @click="handleReset">重置</a-button>
+            <a-button
+              class="export-btn"
+              id="releaseRecordList-btn-export"
+              :loading="loading"
+              @click="handleExport"
+              v-hasPermission="'B_user_userManage_export'">导出</a-button>
+          </a-col>
         </a-row>
 
       </a-form>
@@ -113,6 +113,7 @@ import {
   changeStatus,
   customeExport
 } from '@/api/userInfo.js'
+import moment from 'moment'
 export default {
   name: 'UserManageList',
   components: {
@@ -123,13 +124,14 @@ export default {
     return {
       formItemLayout: {
         labelCol: {
-          span: 8
+          span: 7
         },
         wrapperCol: {
-          span: 16
+          span: 17
         }
       },
-      time: [],
+      registerTime: [], // 注册时间
+      lastDeliverTime: [], // 最后投递时间
       dateFormat: 'YYYY-MM-DD',
       // 查询参数
       queryParam: {
@@ -137,7 +139,11 @@ export default {
         state: '', // 账户状态
         customerRole: '', // 用户身份
         currentGoldMin: '', // 乐豆余额最小值
-        currentGoldMax: '' // 乐豆余额最大值
+        currentGoldMax: '', // 乐豆余额最大值
+        beginDate: null, // 最后投递时间的开始时间
+        endDate: null, // 最后投递时间的结束时间
+        beginRegisterTime: null, //  注册时间最小值
+        endRegisterTime: null //  注册时间最大值
       },
       loading: false, // 导出loading
       // 表头
@@ -153,12 +159,12 @@ export default {
         width: 100,
         align: 'center'
       },
-	  {
-	    title: '用户身份',
-	    dataIndex: 'customerRoleDictValue',
-	    width: 100,
-	    align: 'center'
-	  },
+      {
+        title: '用户身份',
+        dataIndex: 'customerRoleDictValue',
+        width: 100,
+        align: 'center'
+      },
       {
         title: '乐豆余额',
         dataIndex: 'currentGold',
@@ -183,7 +189,7 @@ export default {
         width: 200,
         align: 'center',
         customRender: (text) => {
-		  return text || '--'
+          return text || '--'
         }
       },
       {
@@ -192,7 +198,7 @@ export default {
         width: 200,
         align: 'center',
         customRender: (text) => {
-		  return text || '--'
+          return text || '--'
         }
       },
       {
@@ -201,7 +207,7 @@ export default {
         width: 200,
         align: 'center',
         customRender: (text) => {
-		  return text || '--'
+          return text || '--'
         }
       },
       {
@@ -224,7 +230,22 @@ export default {
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        return customerList(Object.assign(parameter, this.queryParam)).then(res => {
+        const searchData = Object.assign(parameter, this.queryParam)
+        if (this.registerTime && this.registerTime.length) {
+          searchData.beginRegisterTime = moment(this.registerTime[0])
+          searchData.endRegisterTime = moment(this.registerTime[1])
+        } else {
+          searchData.beginRegisterTime = null
+          searchData.endRegisterTime = null
+        }
+        if (this.lastDeliverTime && this.lastDeliverTime.length) {
+          searchData.beginDate = moment(this.lastDeliverTime[0])
+          searchData.endDate = moment(this.lastDeliverTime[1])
+        } else {
+          searchData.beginDate = null
+          searchData.endDate = null
+        }
+        return customerList(searchData).then(res => {
           if (res.status == 200) {
             const no = (res.data.pageNo - 1) * res.data.pageSize
             for (let i = 0; i < res.data.list.length; i++) {
@@ -244,17 +265,24 @@ export default {
     })
   },
   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]
-	    }
-	  },
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
+    // 注册时间change
+    onChangeregisterTime (dates, dateStrings) {
+      if ((dates, dateStrings)) {
+        this.queryParam.beginRegisterTime = dateStrings[0]
+        this.queryParam.endRegisterTime = dateStrings[1]
+      }
+    },
+    // 最后投递时间change
+    onChangelastDeliverTime (dates, dateStrings) {
+      if ((dates, dateStrings)) {
+        this.queryParam.beginDate = dateStrings[0]
+        this.queryParam.endDate = dateStrings[1]
+      }
+    },
     refresh () {
       const isONull = this.queryParam.currentGoldMin === null
       const isOEmpty = this.queryParam.currentGoldMin === ''
@@ -289,18 +317,14 @@ export default {
     },
     // 查看乐豆详情
     handleLd (row) {
-    	this.$router.push({
-    		// name: 'ledouDetail',
-    		// params: {
-    		// 	customerNo: row.customerNo,
-    		// 	mobile: row.mobile,
-    		// 	currentGold: row.currentGold,
-      //     id: row.id
-    		// }
-    		path: '/userInfo/userManageList_Ld/detail', query: { customerNo: row.customerNo, id: row.id }
-    	})
+      this.$router.push({
+        path: '/userInfo/userManageList_Ld/detail',
+        query: {
+          customerNo: row.customerNo,
+          id: row.id
+        }
+      })
     },
-    // 启用禁用
     // 更改启用禁用状态
     changeFlagHandle (text, record) {
       const _this = this
@@ -319,22 +343,88 @@ export default {
     },
     // 重置
     handleReset () {
-      this.queryParam.mobile = ''
-      this.queryParam.currentGoldMin = ''
-      this.queryParam.currentGoldMax = ''
-      this.queryParam.state = ''
-      this.queryParam.customerRole = ''
+      this.queryParam.mobile = '' //  用户手机
+      this.queryParam.currentGoldMin = '' // 乐豆余额最小值
+      this.queryParam.currentGoldMax = '' // 乐豆余额最大值
+      this.queryParam.state = '' // 账户状态
+      this.queryParam.customerRole = '' // 用户身份
+      this.queryParam.beginDate = null // 最后投递时间的开始时间
+      this.queryParam.endDate = null // 最后投递时间的结束时间
+      this.queryParam.beginRegisterTime = null //  注册时间最小值
+      this.queryParam.endRegisterTime = null //  注册时间最大值
+      this.registerTime = [],
+      this.lastDeliverTime = [],
       this.$refs.table.refresh(true)
     },
     // 导出
     handleExport () {
-      const params = {
-        mobile: this.queryParam.mobile,
-        customerRole: this.queryParam.customerRole,
-        currentGoldMin: this.queryParam.currentGoldMin,
-        currentGoldMax: this.queryParam.currentGoldMax,
-        state: this.queryParam.state = ''
+      const params = this.queryParam
+      // 情况1  导出只选择注册时间段 没有选择最后投递时间段
+      if ((this.registerTime && this.registerTime.length) && (params.beginDate == null && params.endDate == null)) {
+        params.beginRegisterTime = moment(this.registerTime[0])
+        params.endRegisterTime = moment(this.registerTime[1])
       }
+      // 判断两个时间段是否相差m个月  第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
+      if (moment(params.endRegisterTime).diff(moment(params.beginRegisterTime), 'months', true) > 3) {
+        this.$message.error('单次最多只能导出3个月的数据,请缩小注册时间区间后再进行导出!')
+      }
+      // 情况2 导出只选择最后投递时间段 没有注册时间段
+      if ((this.lastDeliverTime && this.lastDeliverTime.length) && (params.beginRegisterTime == null && params.endRegisterTime == null)) {
+        params.beginDate = moment(this.lastDeliverTime[0])
+        params.endDate = moment(this.lastDeliverTime[1])
+      }
+      if (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 3) {
+        this.$message.error('单次最多只能导出3个月的数据,请缩小最后投递时间区间后再进行导出!')
+      }
+	  // 情况3 导出未选择任何时间段
+	  if ((params.beginRegisterTime == null && params.endRegisterTime == null) && (params.beginDate == null && params.endDate == null)) {
+        this.$message.error('请先选择需要导出的注册时间区间或最后投递时间区间再进行导出(3个月以内)!')
+        return
+	  }
+	  // 情况4 注册时间与最后投递时间都选择
+	  if (!((params.beginRegisterTime == null && params.endRegisterTime == null) && (params.beginDate == null && params.endDate == null))) {
+        params.beginRegisterTime = moment(this.registerTime[0])
+        params.endRegisterTime = moment(this.registerTime[1])
+        params.beginDate = moment(this.lastDeliverTime[0])
+        params.endDate = moment(this.lastDeliverTime[1])
+	  }
+	  if (moment(params.endRegisterTime).diff(moment(params.beginRegisterTime), 'months', true) > 3) {
+	    this.$message.error('单次最多只能导出3个月的数据,请缩小注册时间区间后再进行导出!')
+	  }
+	  if (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 3) {
+	    this.$message.error('单次最多只能导出3个月的数据,请缩小最后投递时间区间后再进行导出!')
+	  }
+      // // 导出注册时间范围判断
+      // // if (this.registerTime && this.registerTime.length) {
+      // //   params.beginRegisterTime = moment(this.registerTime[0]).format('YYYY-MM-DD')
+      // //   params.endRegisterTime = moment(this.registerTime[1]).format('YYYY-MM-DD')
+      // // } else {
+      // //   params.beginRegisterTime = null
+      // //   params.endRegisterTime = null
+      // // }
+      // // if (!params.beginRegisterTime && !params.endRegisterTime) {
+      // //   this.$message.error('请先选择需要导出的注册时间区间再进行导出!')
+      // // }
+      // // // 判断两个时间段是否相差m个月  第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
+      // // if (moment(params.endRegisterTime).diff(moment(params.beginRegisterTime), 'months', true) > 3) {
+      // //   this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
+      // // }
+      // // // 导出最后投递时间范围判断哪
+      // // if (this.lastDeliverTime && this.lastDeliverTime.length) {
+      // //   params.beginDate = moment(this.lastDeliverTime[0]).format('YYYY-MM-DD')
+      // //   params.endDate = moment(this.lastDeliverTime[1]).format('YYYY-MM-DD')
+      // // } else {
+      // //   params.beginDate = null
+      // //   params.endDate = null
+      // // }
+      // // if (!params.beginDate && !params.endDate) {
+      // //   this.$message.error('请先选择需要导出的注册时间区间再进行导出!')
+      // // }
+      // // // 判断两个时间段是否相差m个月  第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
+      // // if (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 3) {
+      // //   this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
+      // // }
+      // console.log(params.beginRegisterTime, params.endRegisterTime, params.beginDate, params.endDate, '--------------导出参数')
       this.loading = true
       customeExport(params).then(res => {
         this.loading = false

+ 2 - 2
vue.config.js

@@ -108,8 +108,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.16.105:8301/gc-admin/',
-        target: 'https://lese.test.sxzxyj.net/gc-admin/',
+        target: 'http://192.168.16.153:8301/gc-admin/',
+        // target: 'https://lese.test.sxzxyj.net/gc-admin/',
         ws: false,
         changeOrigin: true,
         pathRewrite: {