qingyiay
2023-04-24 bb52e0d4baffe8e0486c951e525b6614bd4aaa28
pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
@@ -8,158 +8,124 @@
         </view>
      </view>
      <view class="collapse-main">
         <u-collapse>
            <u-collapse-item :title="dateRange" value="筛选">
               <view class="filter-main">
                  <view class="filter-body">
                     <view class="condition-name">煤种:</view>
                     <view class="filter-name">
                        <view class="filter-button" v-for="(item, index) in coalList" :key="index" @click="filterCondition(0, index, item.condition)">
                           <u-button shape="circle" :text="item.condition" :type="item.active ? 'success' : ''" size="small" v-if="index < coalShow"></u-button>
                        </view>
                        <view class="toggle-button">
                           <u-button
                              shape="circle"
                              :text="coalShow < coalTotal ? '查看更多' : '收起'"
                              type="primary"
                              size="small"
                              @click="toggle(0)"
                              v-if="coalTotal > 3"
                           ></u-button>
                        </view>
                     </view>
                  </view>
                  <view class="filter-body">
                     <view class="condition-name">类型:</view>
                     <view class="filter-name">
                        <view class="filter-button" v-for="(item, index) in typeList" :key="index" @click="filterCondition(1, index, item.condition)">
                           <u-button shape="circle" :text="item.condition" :type="item.active ? 'success' : ''" size="small"></u-button>
                        </view>
                        <view class="toggle-button">
                           <u-button
                              shape="circle"
                              :text="typeShow < typeTotal ? '查看更多' : '收起'"
                              type="primary"
                              size="small"
                              @click="toggle(1)"
                              v-if="typeTotal > 3"
                           ></u-button>
                        </view>
                     </view>
                  </view>
                  <view class="filter-body">
                     <view class="condition-name">客户:</view>
                     <view class="filter-name">
                        <view class="filter-button" v-for="(item, index) in customerList" :key="index" @click="filterCondition(2, index, item.condition)">
                           <u-button shape="circle" :text="item.condition" :type="item.active ? 'success' : ''" size="small"></u-button>
                        </view>
                        <view class="toggle-button">
                           <u-button
                              shape="circle"
                              :text="customerShow < customerTotal ? '查看更多' : '收起'"
                              type="primary"
                              size="small"
                              @click="toggle(2)"
                              v-if="customerTotal > 3"
                           ></u-button>
                        </view>
                     </view>
                  </view>
                  <view class="filter-body" v-if="roleType == 1">
                     <view class="condition-name">货代:</view>
                     <view class="filter-name">
                        <view class="filter-button" v-for="(item, index) in forwarderList" :key="index" @click="filterCondition(3, index, item.condition)">
                           <u-button shape="circle" :text="item.condition" :type="item.active ? 'success' : ''" size="small"></u-button>
                        </view>
                        <view class="toggle-button">
                           <u-button
                              shape="circle"
                              :text="forwarderShow < forwarderTotal ? '查看更多' : '收起'"
                              type="primary"
                              size="small"
                              @click="toggle(3)"
                              v-if="forwarderTotal > 3"
                           ></u-button>
                        </view>
                     </view>
                  </view>
                  <view class="filter-body" v-if="roleType != 3">
                     <view class="condition-name">车队:</view>
                     <view class="filter-name">
                        <view class="filter-button" v-for="(item, index) in fleetList" :key="index" @click="filterCondition(4, index, item.condition)">
                           <u-button shape="circle" :text="item.condition" :type="item.active ? 'success' : ''" size="small"></u-button>
                        </view>
                        <view class="toggle-button">
                           <u-button
                              shape="circle"
                              :text="fleetShow < fleetTotal ? '查看更多' : '收起'"
                              type="primary"
                              size="small"
                              @click="toggle(4)"
                              v-if="fleetTotal > 3"
                           ></u-button>
                        </view>
                     </view>
                  </view>
                  <view class="filter-body" v-if="roleType != 1">
                     <view class="condition-name">矿场:</view>
                     <view class="filter-name">
                        <view class="filter-button" v-for="(item, index) in filedList" :key="index" @click="filterCondition(5, index, item.condition)">
                           <u-button shape="circle" :text="item.condition" :type="item.active ? 'success' : ''" size="small"></u-button>
                        </view>
                        <view class="toggle-button">
                           <u-button
                              shape="circle"
                              :text="filedShow < filedTotal ? '查看更多' : '收起'"
                              type="primary"
                              size="small"
                              @click="toggle(5)"
                              v-if="filedTotal > 3"
                           ></u-button>
                        </view>
                     </view>
                  </view>
                  <view class="filter-body" v-if="roleType == 2">
                     <view class="condition-name">车牌号:</view>
                     <view class="filter-name">
                        <view class="filter-button" v-for="(item, index) in carNoList" :key="index" @click="filterCondition(6, index, item.condition)">
                           <u-button shape="circle" :text="item.condition" :type="item.active ? 'success' : ''" size="small"></u-button>
                        </view>
                        <view class="toggle-button">
                           <u-button
                              shape="circle"
                              :text="carNoShow < carNoTotal ? '查看更多' : '收起'"
                              type="primary"
                              size="small"
                              @click="toggle(6)"
                              v-if="carNoTotal > 3"
                           ></u-button>
                        </view>
                     </view>
                  </view>
                  <view class="filter-body">
                     <view class="condition-name">日期:</view>
                     <view class="filter-name">
                        <u-button :text="dateselect" @click="opencalendar"></u-button>
                        <view class="filter-button">
                           <uni-calendar
                              ref="calendar"
                              class="uni-calendar--hook"
                              :clear-date="true"
                              :date="info.date"
                              :insert="info.insert"
                              :lunar="info.lunar"
                              :startDate="info.startDate"
                              :endDate="info.endDate"
                              :range="info.range"
                              @confirm="confirm"
                           />
                        </view>
         <view class="filter-show">
            <view class="filtershow-date">{{ dateRange }}</view>
            <view class="filter-icon"><u-icon name="grid" :size="40" color="#9ec16c "></u-icon></view>
            <view class="filtershow-text" @click="showPopup">筛选</view>
         </view>
         <u-popup :show="conditinonShow" mode="top" :closeable="true" :closeOnClickOverlay="true" @close="conditinonclose">
            <view class="filter-main">
               <view class="filter-body date-button">
                  <view class="condition-name">日期</view>
                  <view class="filter-name">
                     <u-button :text="dateselect" @click="opencalendar"></u-button>
                     <view class="filter-button ">
                        <uni-calendar
                           ref="calendar"
                           class="uni-calendar--hook"
                           :clear-date="true"
                           :date="info.date"
                           :insert="info.insert"
                           :lunar="info.lunar"
                           :startDate="info.startDate"
                           :endDate="info.endDate"
                           :range="info.range"
                           @confirm="confirm"
                        />
                     </view>
                  </view>
               </view>
            </u-collapse-item>
         </u-collapse>
               <view class="filter-body">
                  <view class="condition-name">煤种</view>
                  <view class="filter-name">
                     <view class="filter-button" v-for="(item, index) in coalList" :key="index" @click="filterCondition(0, index, item.condition)">
                        <u-button :text="item.condition" :type="item.active ? 'success' : ''" size="small" v-if="index < coalShow"></u-button>
                     </view>
                     <view class="toggle-button">
                        <u-button :text="coalShow < coalTotal ? '查看更多' : '收起'" type="primary" size="small" @click="toggle(0)" v-if="coalTotal > 3"></u-button>
                     </view>
                  </view>
               </view>
               <view class="filter-body">
                  <view class="condition-name">类型</view>
                  <view class="filter-name">
                     <view class="filter-button" v-for="(item, index) in typeList" :key="index" @click="filterCondition(1, index, item.condition)">
                        <u-button :text="item.condition" :type="item.active ? 'success' : ''" size="small" v-if="index < typeShow"></u-button>
                     </view>
                     <view class="toggle-button">
                        <u-button :text="typeShow < typeTotal ? '查看更多' : '收起'" type="primary" size="small" @click="toggle(1)" v-if="typeTotal > 3"></u-button>
                     </view>
                  </view>
               </view>
               <view class="filter-body">
                  <view class="condition-name">客户</view>
                  <view class="filter-name">
                     <view class="filter-button" v-for="(item, index) in customerList" :key="index" @click="filterCondition(2, index, item.condition)">
                        <u-button :text="item.condition" :type="item.active ? 'success' : ''" size="small" v-if="index < customerShow"></u-button>
                     </view>
                     <view class="toggle-button">
                        <u-button
                           :text="customerShow < customerTotal ? '查看更多' : '收起'"
                           type="primary"
                           size="small"
                           @click="toggle(2)"
                           v-if="customerTotal > 3"
                        ></u-button>
                     </view>
                  </view>
               </view>
               <view class="filter-body" v-if="roleType == 1">
                  <view class="condition-name">货代</view>
                  <view class="filter-name">
                     <view class="filter-button" v-for="(item, index) in forwarderList" :key="index" @click="filterCondition(3, index, item.condition)">
                        <u-button :text="item.condition" :type="item.active ? 'success' : ''" v-if="index < forwarderShow"></u-button>
                     </view>
                     <view class="toggle-button">
                        <u-button
                           :text="forwarderShow < forwarderTotal ? '查看更多' : '收起'"
                           type="primary"
                           size="small"
                           @click="toggle(3)"
                           v-if="forwarderTotal > 3"
                        ></u-button>
                     </view>
                  </view>
               </view>
               <view class="filter-body" v-if="roleType != 3">
                  <view class="condition-name">车队</view>
                  <view class="filter-name">
                     <view class="filter-button" v-for="(item, index) in fleetList" :key="index" @click="filterCondition(4, index, item.condition)">
                        <u-button :text="item.condition" :type="item.active ? 'success' : ''" size="small" v-if="index < fleetShow"></u-button>
                     </view>
                     <view class="toggle-button">
                        <u-button :text="fleetShow < fleetTotal ? '查看更多' : '收起'" type="primary" size="small" @click="toggle(4)" v-if="fleetTotal > 3"></u-button>
                     </view>
                  </view>
               </view>
               <view class="filter-body" v-if="roleType != 1">
                  <view class="condition-name">矿场</view>
                  <view class="filter-name">
                     <view class="filter-button" v-for="(item, index) in filedList" :key="index" @click="filterCondition(5, index, item.condition)">
                        <u-button :text="item.condition" :type="item.active ? 'success' : ''" size="small" v-if="index < filedShow"></u-button>
                     </view>
                     <view class="toggle-button">
                        <u-button :text="filedShow < filedTotal ? '查看更多' : '收起'" type="primary" size="small" @click="toggle(5)" v-if="filedTotal > 3"></u-button>
                     </view>
                  </view>
               </view>
               <view class="filter-body" v-if="roleType == 2">
                  <view class="condition-name">车牌号</view>
                  <view class="filter-name">
                     <view class="filter-button" v-for="(item, index) in carNoList" :key="index" @click="filterCondition(6, index, item.condition)">
                        <u-button :text="item.condition" :type="item.active ? 'success' : ''" size="small" v-if="index < carNoShow"></u-button>
                     </view>
                     <view class="toggle-button">
                        <u-button :text="carNoShow < carNoTotal ? '查看更多' : '收起'" type="primary" size="small" @click="toggle(6)" v-if="carNoTotal > 3"></u-button>
                     </view>
                  </view>
               </view>
            </view>
         </u-popup>
      </view>
      <view class="date-information">
         <view class="statistics-card" v-for="(item, index) in filterList" :key="index">
@@ -173,8 +139,8 @@
                  }}吨
               </view>
            </view>
            <view class="card-main" v-for="(value, i) in item.taskCoalList" :key="i">
               <view class="arrow-right" @click="faYunDetail(value.id)"><u-icon name="arrow-right" size="50"></u-icon></view>
            <view class="card-main" v-for="(value, i) in item.taskCoalList" :key="i" @click="faYunDetail(value.id)">
               <view class="arrow-right"><u-icon name="arrow-right" size="50"></u-icon></view>
               <view class="main-body">
                  <view class="coal-name">煤种:{{ value.coalName || '' }}</view>
                  <view class="clean">执行量:{{ value.clean.toFixed(2) || 0 }}</view>
@@ -185,6 +151,7 @@
            </view>
         </view>
      </view>
      <tab-bar :current="1"></tab-bar>
   </view>
</template>
@@ -213,6 +180,8 @@
         filterList: [],
         totalLength: 0,
         totalTon: 0,
         // 筛选弹出层
         conditinonShow: false,
         // 超过两行自动隐藏
         coalShow: 3,
         typeShow: 3,
@@ -414,6 +383,7 @@
         }
      },
      confirm(e) {
         console.log(e, '日期选择');
         this.first = e.range.before;
         this.last = e.range.after;
      },
@@ -494,8 +464,13 @@
            url: `/pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails?id=${takeCoalId}`
         });
      },
      confirm() {
         this.modalShow = false;
      // 打开筛选条件弹窗
      showPopup() {
         this.conditinonShow = true;
      },
      // 关闭筛选条件弹窗
      conditinonclose() {
         this.conditinonShow = false;
      }
   },
   computed: {
@@ -544,15 +519,14 @@
</script>
<style lang="scss" scoped>
::v-deep .u-cell__value {
   color: #9ec16c !important;
   font-size: vww(18) !important;
::v-deep .toggle-button .u-button {
   width: vww(40);
}
::v-deep .filter-name:nth-last-child(1) {
   .u-button {
      width: 66%;
   }
}
// ::v-deep .filter-name:nth-last-child(1) {
//    .u-button {
//       width: 66%;
//    }
// }
.main {
   width: 96%;
   margin: 0 auto;
@@ -586,11 +560,54 @@
      background-color: #fff;
      border: 1px solid #cccccc;
      border-radius: vww(5);
      .filter-show {
         width: 100%;
         height: vww(40);
         background-color: #fff;
         border-radius: vww(5);
         font-size: vww(18);
         color: #333;
         position: relative;
         display: flex;
         justify-content: space-between;
         align-items: center;
         .filtershow-date {
            font-size: vww(15);
            padding-left: vww(8);
         }
         .filter-icon {
            position: absolute;
            right: vww(45);
            top: vww(11);
         }
         .filtershow-text {
            color: #9ec16c;
            padding-right: vww(8);
            position: relative;
            &::before {
               content: '';
               position: absolute;
               width: 1px;
               height: vww(22);
               background-color: #dcdfe6;
               right: 94px;
               bottom: 0;
            }
         }
      }
      .filter-main {
         width: 100%;
         display: flex;
         flex-direction: column;
         justify-content: space-around;
         .date-button {
            width: 80%;
            height: vww(80);
            margin: vww(5) auto;
            .condition-name {
               margin-bottom: vww(10);
            }
         }
         .filter-body {
            width: 100%;
            position: relative;
@@ -598,31 +615,34 @@
            justify-content: flex-start;
            flex-wrap: wrap;
            .condition-name {
               margin-left: vww(15);
               margin-top: vww(10);
               font-size: vww(16);
               color: #686868;
            }
            .filter-name {
               width: 100%;
               width: 94%;
               margin: 0 auto;
               position: relative;
               display: flex;
               flex-wrap: wrap;
               justify-content: flex-start;
               align-items: flex-start;
               position: relative;
               top: vww(-34);
               .filter-button {
                  color: #393a3c;
                  height: vww(16);
                  padding: vww(8);
                  margin: vww(5) vww(5);
                  &:nth-child(1) {
                     margin-left: vww(48);
                  }
                  margin-bottom: vww(10);
               }
               .toggle-button {
                  margin: vww(12) auto;
                  position: relative;
                  left: -10%;
                  transform: translateX(-50%);
                  width: 30%;
                  display: flex;
                  justify-content: center;
                  position: absolute;
                  right: vww(-21);
                  top: vww(-23);
               }
            }
         }