ソースを参照

Merge branch 'deploy_gather' of chelingzhu-web/zxyj-admin-html into master

李磊 4 年 前
コミット
bab7327ff1

+ 2 - 2
src/config/router.config.js

@@ -418,7 +418,7 @@ export const asyncRouterMap = [{
       name: 'unRecyclableRubbishTotal',
       component: () => import(/* webpackChunkName: "reportForm" */ '@/views/reportForm/unRecyclableRubbishTotal.vue'),
       meta: {
-        title: '非可回收垃圾汇总表',
+        title: '垃圾录入汇总表',
         icon: 'bar-chart',
         permission: 'M_unRecyclableTotal_list'
       }
@@ -428,7 +428,7 @@ export const asyncRouterMap = [{
       name: 'unRecyclableRubbishDetails',
       component: () => import(/* webpackChunkName: "reportForm" */ '@/views/reportForm/unRecyclableRubbishDetails.vue'),
       meta: {
-        title: '非可回收垃圾明细',
+        title: '垃圾录入明细',
         icon: 'fund',
         permission: 'M_unRecyclableDetails_list'
       }

+ 1 - 9
src/views/recoveryManage/recoveryPriceSet.vue

@@ -80,6 +80,7 @@ export default {
       console.log(key, this.type)
     },
     changeInput (item) {
+      console.log(item.advicePrice, '------------------')
       if (item.advicePrice == 0) {
         item.advicePrice = ''
       }
@@ -98,15 +99,6 @@ export default {
     // 保存价格
     save (id, advicePrice) {
       const params = { adviceType: this.type, id: id, advicePrice: advicePrice }
-      if (params.advicePrice == 0 || !params.advicePrice) {
-        this.$message.warning('请输入正确的回收价格')
-        return false
-      }
-      // if (!params.advicePrice) {
-      //   this.$message.warning('回收价格不能为空')
-      //   return false
-      // }
-
       savPrice(params).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)

+ 67 - 2
src/views/reportForm/unRecyclableRubbishDetails.vue

@@ -50,6 +50,7 @@
           <a-col :xs="24" :sm="12" :md="6" :lg="5">
             <a-button type="primary" @click="$refs.table.refresh(true)" id="unRecyclableRubbishDetails-refresh" style="margin-top: 4px">查询</a-button>
             <a-button type="" @click="reset" id="unRecyclableRubbishDetails-reset" style="margin: 4px 0 0 10px">重置</a-button>
+            <!-- <a-button class="export-btn" id="unRecyclableRubbishDetails-export" :loading="loading" @click="handleExport">导出</a-button> -->
           </a-col>
         </a-row>
 
@@ -58,7 +59,7 @@
     <!-- 合计 -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
       <div class="ftext" slot="message">总计<span> {{ orderTotal }} </span>条,<span> {{ total }} </span>kg。
-        其中,其他垃圾总计<span> {{ otherTotal }} </span>kg,厨余垃圾总计<span>{{ chuyuTotal }} </span>kg,建筑垃圾总计<span> {{ jianzhuTotal }} </span>kg
+        其中,可回收物总计<span>{{ huishouTotal }} </span>kg,有害垃圾总计<span>{{ harmTotal }} </span>kg,厨余垃圾总计<span>{{ chuyuTotal }} </span>kg,其他垃圾总计<span> {{ otherTotal }} </span>kg,建筑垃圾总计<span> {{ jianzhuTotal }} </span>kg
       </div>
     </a-alert>
     <!-- 列表 -->
@@ -90,6 +91,8 @@ export default {
     return {
       orderTotal: 0, //  总计条数
       total: 0, //  可回收垃圾总计
+      huishouTotal: 0, // 可回收物
+      harmTotal: 0, // 有害垃圾
       otherTotal: 0, //  其他垃圾总计
       jianzhuTotal: 0, //  建筑垃圾总计
       chuyuTotal: 0, //  厨余垃圾总计
@@ -99,6 +102,7 @@ export default {
         endDate: null, // 结束时间
         queryWord: ''
       },
+      loading: false,
       optionData: [], // 网点列表数据
       // 将默认当天时间日期回显在时间选择框中
       time: [
@@ -112,8 +116,10 @@ export default {
         { title: '网点名称', dataIndex: 'stationName', width: 120, align: 'center', customRender: (text) => { return text || '--' } },
         { title: '采集员姓名', dataIndex: 'gatherName', width: 100, align: 'center', customRender: (text) => { return text || '--' } },
         { title: '采集员手机', dataIndex: 'gatherPhone', width: 100, align: 'center', customRender: (text) => { return text || '--' } },
-        { title: '其他垃圾(kg)', dataIndex: 'gatherOther', width: 80, align: 'center', customRender: (text) => { return text ? (text / 1000).toFixed(3) / 1 : '0' } },
+        { title: '可回收物(kg)', dataIndex: 'gatherRecycling', width: 80, align: 'center', customRender: (text) => { return text ? (text / 1000).toFixed(3) / 1 : '0' } },
+        { title: '有害垃圾(kg)', dataIndex: 'gatherHarm', width: 80, align: 'center', customRender: (text) => { return text ? (text / 1000).toFixed(3) / 1 : '0' } },
         { title: '厨余垃圾(kg)', dataIndex: 'gatherKitchen', width: 80, align: 'center', customRender: (text) => { return text ? (text / 1000).toFixed(3) / 1 : '0' } },
+        { title: '其他垃圾(kg)', dataIndex: 'gatherOther', width: 80, align: 'center', customRender: (text) => { return text ? (text / 1000).toFixed(3) / 1 : '0' } },
         { title: '建筑垃圾(kg)', dataIndex: 'gatherBuilding', width: 80, align: 'center', customRender: (text) => { return text ? (text / 1000).toFixed(3) / 1 : '0' } },
         { title: '总计(kg)', dataIndex: 'gatherTotal', width: 80, align: 'center', customRender: (text) => { return text ? (text / 1000).toFixed(3) / 1 : '0' } },
         { title: '备注', dataIndex: 'remarks', width: 100, align: 'center', customRender: (text) => { return text || '--' } },
@@ -195,10 +201,59 @@ export default {
             this.jianzhuTotal = res.data.GATHER_BUILDING ? (res.data.GATHER_BUILDING / 1000).toFixed(3) / 1 : '0'
             this.chuyuTotal = res.data.GATHER_KITCHEN ? (res.data.GATHER_KITCHEN / 1000).toFixed(3) / 1 : '0'
             this.total = res.data.GATHER_TOTAL ? (res.data.GATHER_TOTAL / 1000).toFixed(3) / 1 : '0'
+            this.harmTotal = res.data.GATHER_HARM ? (res.data.GATHER_HARM / 1000).toFixed(3) / 1 : '0'
+            this.huishouTotal = res.data.GATHER_RECYCLING ? (res.data.GATHER_RECYCLING / 1000).toFixed(3) / 1 : '0'
           }
         }
       })
     },
+    // 导出
+    // handleExport () {
+    //   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 = null
+    //    params.endDate = null
+    //  }
+    //   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个月的数据,请缩小查询区间后再进行导出!')
+    //     return
+    //   }
+    //   this.$confirm({
+    //     title: '提示',
+    //     content: '导出过程可能需要一些时间,且导出期间不能进行其它操作,确定要导出吗?',
+    //     onOk: () => {
+    //       this.loading = true
+    //       exportTnTimeForm(params).then(res => {
+    // 		  this.loading = false
+    // 		  this.download(res)
+    //       })
+    //     },
+    //     onCancel () {
+    //       console.log('Cancel')
+    //     }
+    //   })
+    // },
+    // 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(this.queryParam.beginDate).format('LL') + '-' + moment(this.queryParam.endDate).format('LL')
+    //   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()
+    // },
     // 重置
     reset () {
       this.queryParam.stationNo = undefined
@@ -238,6 +293,16 @@ export default {
   }
   .image:not(:first-child){
     display: none;
+  }
+  .export-btn{
+    background-color: #ff9900;
+    border-color: #ff9900;
+    color: #fff;
+    margin: 4px 0 0 10px
+  }
+  .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>

+ 8 - 2
src/views/reportForm/unRecyclableRubbishTotal.vue

@@ -79,7 +79,7 @@
     <!-- 合计 -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
       <div class="ftext" slot="message">总计<span> {{ orderTotal }} </span>条,<span> {{ total }} </span>kg。
-        其中,其他垃圾总计<span> {{ otherTotal }} </span>kg,厨余垃圾总计<span>{{ chuyuTotal }} </span>kg,建筑垃圾总计<span> {{ jianzhuTotal }} </span>kg
+        其中,可回收物总计<span>{{ huishouTotal }} </span>kg,有害垃圾总计<span>{{ harmTotal }} </span>kg,厨余垃圾总计<span>{{ chuyuTotal }} </span>kg,其他垃圾总计<span> {{ otherTotal }} </span>kg,建筑垃圾总计<span> {{ jianzhuTotal }} </span>kg
       </div>
     </a-alert>
     <!-- 列表 -->
@@ -109,6 +109,8 @@ export default {
     return {
       orderTotal: 0, //  总计条数
       total: 0, //  可回收垃圾总计
+      huishouTotal: 0, // 可回收物
+      harmTotal: 0, // 有害垃圾
       otherTotal: 0, //  其他垃圾总计
       jianzhuTotal: 0, //  建筑垃圾总计
       chuyuTotal: 0, //  厨余垃圾总计
@@ -133,8 +135,10 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
         { title: '网点名称', dataIndex: 'stationName', width: 100, align: 'center', customRender: (text) => { return text || '--' } },
-        { title: '其他垃圾(kg)', dataIndex: 'GATHER_OTHER', width: 100, align: 'center', customRender: (text) => { return text ? (text / 1000).toFixed(3) / 1 : '0' } },
+        { title: '可回收物(kg)', dataIndex: 'GATHER_RECYCLING', width: 100, align: 'center', customRender: (text) => { return text ? (text / 1000).toFixed(3) / 1 : '0' } },
+        { title: '有害垃圾(kg)', dataIndex: 'GATHER_HARM', width: 100, align: 'center', customRender: (text) => { return text ? (text / 1000).toFixed(3) / 1 : '0' } },
         { title: '厨余垃圾(kg)', dataIndex: 'GATHER_KITCHEN', width: 100, align: 'center', customRender: (text) => { return text ? (text / 1000).toFixed(3) / 1 : '0' } },
+        { title: '其他垃圾(kg)', dataIndex: 'GATHER_OTHER', width: 100, align: 'center', customRender: (text) => { return text ? (text / 1000).toFixed(3) / 1 : '0' } },
         { title: '建筑垃圾(kg)', dataIndex: 'GATHER_BUILDING', width: 100, align: 'center', customRender: (text) => { return text ? (text / 1000).toFixed(3) / 1 : '0' } },
         { title: '总计(kg)', dataIndex: 'GATHER_TOTAL', width: 100, align: 'center', customRender: (text) => { return text ? (text / 1000).toFixed(3) / 1 : '0' } }
       ],
@@ -258,6 +262,8 @@ export default {
             this.otherTotal = res.data.GATHER_OTHER ? (res.data.GATHER_OTHER / 1000).toFixed(3) / 1 : '0'
             this.jianzhuTotal = res.data.GATHER_BUILDING ? (res.data.GATHER_BUILDING / 1000).toFixed(3) / 1 : '0'
             this.chuyuTotal = res.data.GATHER_KITCHEN ? (res.data.GATHER_KITCHEN / 1000).toFixed(3) / 1 : '0'
+            this.huishouTotal = res.data.GATHER_RECYCLING ? (res.data.GATHER_RECYCLING / 1000).toFixed(3) / 1 : '0'
+            this.harmTotal = res.data.GATHER_HARM ? (res.data.GATHER_HARM / 1000).toFixed(3) / 1 : '0'
             this.total = res.data.GATHER_TOTAL ? (res.data.GATHER_TOTAL / 1000).toFixed(3) / 1 : '0'
           }
         }