wk
2024-08-29 f833e3d516178e022d2457eb25b0ef6dbc02f304
pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
@@ -10,8 +10,12 @@
                     <view class="content-num">发运车数</view>
                  </view>
                  <view class="content-text">
                     <view class="content-container">{{ totalTon.toFixed(2) }}</view>
                     <view class="content-container">{{ totalTon}}</view>
                     <view class="content-num">发运吨数</view>
                  </view>
                  <view class="content-text">
                     <view class="content-container">{{ tmNum}}</view>
                     <view class="content-num">发运件数</view>
                  </view>
               </view>
            </view>
@@ -35,6 +39,7 @@
                  icon="http://cdn.uviewui.com/uview/empty/data.png"
                  textSize="30"
                  iconSize="1000"
                  text="暂无数据"
                  v-if="filterList.length == 0"></u-empty>
               <view class="statistics-card"
                  v-for="(item, index) in filterList"
@@ -42,27 +47,31 @@
                  <view class="card-top">
                     <view class="left"><combined-title :title="item.condition"></combined-title></view>
                     <view class="card-top_num">
                        {{ item.taskCoalList.length }}车{{
                           item.taskCoalList
                              .reduce((prev, cur) => {
                                 return prev + cur.clean;
                              }, 0)
                              .toFixed(2)
                        }}吨
                        {{ item.taskCoalList.length }}车
                        {{Number(item.taskCoalList
                                        .reduce((prev, cur) => {
                                            cur.clean=cur.clean||0
                                            return prev + cur.clean;
                                        }, 0)).toFixed(2)}}吨
                         {{Number(item.taskCoalList
                                        .reduce((prev, cur) => {
                                            cur.productQuantity=cur.productQuantity||0
                                            return prev + cur.productQuantity;
                                        }, 0))}}件
                     </view>
                  </view>
                  <view class="card-main"
                     v-for="(value, i) in item.taskCoalList"
                     :key="i"
                     @click="faYunDetail(value.id)">
                     @click="faYunDetail(value.id,value)">
                     <view class="first-line">
                        <view class="main-information">
                           <view class="sign">装</view>
                           <view class="filedname">
                              <text
                                 v-if="value.orderType == '外销' || value.orderType == '内销' || value.orderType == '转出'">{{ value.deptName || '' }}</text>
                                 v-if="value.orderType == '外销' || value.orderType == '内销' || value.orderType == '外销退' || value.orderType == '转出'">{{ value.deptName || '' }}</text>
                              <text
                                 v-else-if="value.orderType == '外购' || value.orderType == '内购' || value.orderType == '转入'">{{ value.customerName || '' }}</text>
                                 v-else-if="value.orderType == '外购' || value.orderType == '内购' || value.orderType == '外购退' || value.orderType == '转入'">{{ value.customerName || '' }}</text>
                           </view>
                        </view>
                        <view class="main-divider"></view>
@@ -73,15 +82,15 @@
                           <view class="sign">卸</view>
                           <view class="filedname">
                              <text
                                 v-if="value.orderType == '外销' || value.orderType == '内销' || value.orderType == '转出'">{{ value.customerName || '' }}</text>
                                 v-if="value.orderType == '外销' || value.orderType == '内销' || value.orderType == '外销退' || value.orderType == '转出'">{{ value.customerName || '' }}</text>
                              <text
                                 v-else-if="value.orderType == '外购' || value.orderType == '内购' || value.orderType == '转入'">{{ value.deptName || '' }}</text>
                                 v-else-if="value.orderType == '外购' || value.orderType == '内购' || value.orderType == '外购退' || value.orderType == '转入'">{{ value.filedName || '' }}</text>
                           </view>
                        </view>
                     </view>
                     <view class="second-line">
                        <view class="coal-name">
                           <view class="">{{ value.coalName }}</view>
                           <view class="productName">{{ value.productNames || value.productName }}</view>
                           <view class="black-bar"></view>
                           <view class="coal-type"
                              v-if="value.orderType">{{ value.orderType }}</view>
@@ -91,7 +100,7 @@
                     </view>
                     <view class="third-line">
                        <view class="carnum-icon">
                           <image src="https://mx.jzeg.cn:9095/appimg/image/banner/carNO.png"
                           <image src="https://wrzs.czjlchem.com:9090/appimg/image/banner/carNO.png"
                              mode="widthFix"></image>
                        </view>
                        <view class="carnum-text">{{ value.carNo || '' }}</view>
@@ -134,7 +143,7 @@
                     </view>
                  </view>
                  <view class="filter-body">
                     <view class="condition-name">煤种</view>
                     <view class="condition-name">产品</view>
                     <view class="filter-name">
                        <view class="filter-button"
                           v-for="(item, index) in coalList"
@@ -186,7 +195,7 @@
                  </view>
                  <view class="filter-body"
                     v-if="roleType == 1">
                     <view class="condition-name">货代</view>
                     <view class="condition-name">承运商</view>
                     <view class="filter-name">
                        <view class="filter-button"
                           v-for="(item, index) in forwarderList"
@@ -223,7 +232,7 @@
                     </view> -->
                     </view>
                  </view>
                  <view class="filter-body">
                  <view class="filter-body" v-if="false">
                     <view class="condition-name">矿场</view>
                     <view class="filter-name">
                        <view class="filter-button"
@@ -279,6 +288,7 @@
</template>
<script>
   import BigNumber from "bignumber.js"
   import combinedTitle from '@/components/combined-title/combined-title.vue';
   export default {
      components: {
@@ -329,12 +339,12 @@
            // 点击右箭头详情弹窗
            faYunDetailobj: {},
            modalShow: false,
            coalStatus: ['领取', '预约', '签到', '入场', '称皮', '称毛', '离场', '入磅房', '出磅房', '入煤仓', '出煤仓', '放空', '作废', '入场申请',
               '进入场院'
            coalStatus: ['领取', '预约', '签到', '入场', '称皮', '称毛', '离场', '入磅房', '出磅房', '入仓库', '出仓库', '放空', '作废', '入场申请',
               '进入场院', '异常审核中', '返回加减吨', '超时', '打印中', '打印中', '填写'
            ]
         };
      },
      onShow() {
      onLoad() {
         this.firstDate();
         this.lastDate();
         this.getShipping();
@@ -431,10 +441,15 @@
                  this.totalLength = this.filterList.map(v => v.taskCoalList.length).reduce((x, y) => x + y);
                  this.totalTon = this.filterList.map(v =>
                     v.taskCoalList.reduce((prev, cur) => {
                        return cur.clean + prev;
                        const cleanvalue = cur.clean || 0
                        return cleanvalue + prev
                     }, 0)
                  );
                  this.totalTon = this.totalTon.reduce((x, y) => x + y);
                  this.totalTon = this.totalTon.reduce((x, y) => {
                     let xx = new BigNumber(x)
                     let yy = new BigNumber(y)
                     return xx.plus(yy).toNumber().toFixed(2)
                  }, new BigNumber(0));
               } else {
                  this.totalLength = 0;
                  this.totalTon = 0;
@@ -476,7 +491,7 @@
               }
            };
            let conditionMapping = {
               coalName: this.coalList.filter(v => v.active == true).map(item => item.condition),
               productName: this.coalList.filter(v => v.active == true).map(item => item.condition),
               orderType: this.typeList.filter(v => v.active == true).map(item => item.condition),
               customerName: this.customerList.filter(v => v.active == true).map(item => item.condition),
               xsUser2Name: this.forwarderList.filter(v => v.active == true).map(item => item.condition),
@@ -486,7 +501,7 @@
            };
            const mapping = {
               coalName: validateFn('coalName'),
               productName: validateFn('productName'),
               orderType: validateFn('orderType'),
               customerName: validateFn('customerName'),
               xsUser2Name: validateFn('xsUser2Name'),
@@ -507,10 +522,15 @@
               this.totalLength = this.filterList.map(v => v.taskCoalList.length).reduce((x, y) => x + y);
               this.totalTon = this.filterList.map(v =>
                  v.taskCoalList.reduce((prev, cur) => {
                     return cur.clean + prev;
                     const cleanvalue = cur.clean || 0
                     return cleanvalue + prev
                  }, 0)
               );
               this.totalTon = this.totalTon.reduce((x, y) => x + y);
               this.totalTon = this.totalTon.reduce((x, y) => {
                  let xx = new BigNumber(x)
                  let yy = new BigNumber(y)
                  return xx.plus(yy).toNumber().toFixed(2)
               }, new BigNumber(0));
            } else {
               this.totalLength = 0;
               this.totalTon = 0;
@@ -543,12 +563,15 @@
            this.filedList.forEach(v => {
               v.active = false;
            });
        this.getTmTaskCoalData()
         },
         confirm(e) {
            console.log(e, '日期选择');
            this.first = e.range.before;
            this.last = e.range.after;
            this.conditinonShow = false;
        this.$nextTick(() => {
          this.$refs.calendar.close()
        })
         },
         opencalendar() {
            this.$refs.calendar.open();
@@ -622,9 +645,16 @@
            }
         },
         // 跳转发运详情
         faYunDetail(takeCoalId) {
         faYunDetail(takeCoalId,value) {
            console.log(takeCoalId,'tackle')
            uni.navigateTo({
               url: `/pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails?id=${takeCoalId}`
               url: `/pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails?id=${takeCoalId}&orderType=${value.orderType}`,
               success(res) {
                  console.log(res);
                  },
                  fail(err) {
                  console.log(err,'跳转不过去');
                  }
            });
         },
         // 打开筛选条件弹窗
@@ -666,7 +696,36 @@
         },
         carNoTotal() {
            return this.carNoList.length;
         }
         },
         //发运件数
         tmNum(){
            console.log(this.filterList,'result')
            if( !this.filterList.length){
               return  0
            }else{
               const result =   this.filterList.map(v =>
                  v.taskCoalList.reduce((prev, cur) => {
                     let  cleanvalue
                     if(!cur.isWeight){
                       cleanvalue = Number(cur.productQuantity)  || 0
                     }else{
                       cleanvalue = 0;
                     }
                     return cleanvalue + prev
                  }, 0)
               );
               if(result.length){
               return  result.reduce((x, y) => {
                     let xx = new BigNumber(x)
                     let yy = new BigNumber(y)
                     return xx.plus(yy).toNumber()
                  }, new BigNumber(0));;
               }else{
                  return 0;
               }
            }
         },
      },
      watch: {
         dateselect(newV, old) {
@@ -831,7 +890,7 @@
            padding: 0 vww(5);
            @include flex .date-text {
               width: 330rpx;
               width: 360rpx;
               height: 40rpx;
               font-size: 28rpx;
               font-weight: 400;
@@ -894,7 +953,8 @@
                  margin-left: vww(20);
                  padding-bottom: vww(12);
                  position: relative;
                  @include flex flex-direction: column;
                  @include flex;
                  flex-direction: column;
                  align-items: flex-start;
                  .first-line {
@@ -917,12 +977,19 @@
                           height: vww(28);
                           line-height: vww(28);
                           text-align: center;
                           background: url('https://mx.jzeg.cn:9095/appimg/image/banner/blueblock.png') no-repeat;
                           background: url('https://wrzs.czjlchem.com:9090/appimg/image/banner/blueblock.png') no-repeat;
                           background-size: contain;
                           font-size: 30rpx;
                           font-weight: 400;
                           color: #ffffff;
                           margin-right: vww(20);
                        }
                        .filedname {
                           white-space: nowrap;
                           overflow: hidden;
                           text-overflow: ellipsis;
                           flex: 1;
                        }
                     }
@@ -950,6 +1017,7 @@
                  .first-extra {
                     @include firstLine;
                     height: vww(32);
                     align-items: center;
                     .main-information {
                        width: 100%;
@@ -963,12 +1031,22 @@
                           height: vww(28);
                           line-height: vww(28);
                           text-align: center;
                           background: url('https://mx.jzeg.cn:9095/appimg/image/banner/redblock.png') no-repeat;
                           // display: flex;
                           // justify-content: center;
                           // align-items: center;
                           background: url('https://wrzs.czjlchem.com:9090/appimg/image/banner/redblock.png') no-repeat;
                           background-size: contain;
                           font-size: 30rpx;
                           font-weight: 400;
                           color: #ffffff;
                           margin-right: vww(20);
                        }
                        .filedname {
                           white-space: nowrap;
                           overflow: hidden;
                           text-overflow: ellipsis;
                           flex: 1;
                        }
                     }
                  }
@@ -984,11 +1062,18 @@
                        flex-grow: 1;
                        height: 30rpx;
                        font-size: 30rpx;
                        width: 50%;
                        font-weight: 300;
                        color: #515151;
                        position: relative;
                        display: flex;
                        align-items: center;
                        .productName{
                           width: 50%;
                              white-space: nowrap;
                           overflow: hidden;
                           text-overflow: ellipsis;
                        }
                        .black-bar {
                           width: 2rpx;
@@ -1170,4 +1255,4 @@
      //    }
      // }
   }
</style>
</style>