jiangping
2024-12-16 214e6fe7a754ddf4900e07033a2fda6200f4d7a1
h5/pages/waybill/list.vue
@@ -1,34 +1,35 @@
<template>
   <view class="main_app">
      <view class="head_wrap">
      <view class="head_wrap" @click="openModal">
         <view class="search_box">
            <image src="@/static/ic_search@2x.png" class="search" mode=""></image>
            <input type="text" placeholder-class="placeholder9" v-model="param.name" @confirm="handleQuery" />
            <!-- <input type="text" disabled placeholder-class="placeholder9" v-model="param.contractNumber" @confirm="handleQuery" /> -->
         </view>
         <view class="right" @click="openModal">
         <view class="right">
            <image src="@/static/ic_shaixuan@2x.png" mode=""></image>
            <text>筛选</text>
         </view>
      </view>
      <!--  -->
      <scroll-view scroll-y="true" class="scroll_Y" @scrolltolower="scrolltolower">
      <view class="main_list">
         <view class="item" v-for="item,index in list" :key="index">
            <view class="head">
               <view class="code">{{item.contractNumber}}</view>
               <view class="status">{{item.orderStatus}}</view>
                  <view class="status">{{item.orderStatusDesc }}</view>
            </view>
            <view class="content">
               <view class="line">
                  <view class="la">发货地:</view>
                  <view class="val">{{item.fromRepertoty || '-'}}</view>
                     <view class="val">{{item.fromRepertoty || item.deliveryEnterprise || '-'}}</view>
               </view>
               <view class="line">
                  <view class="la">到货地:</view>
                  <view class="val">{{item.toRepertoty || '-'}}</view>
                     <view class="val">{{item.toRepertoty || item.receiveEnterprise || '-'}}</view>
               </view>
               <view class="line">
                  <view class="la">车牌号:</view>
                  <view class="val">{{item.plateNumber || '-'}}</view>
                     <view class="val">{{item.plateNumber || item.plateName || '-'}}</view>
               </view>
            </view>
            <view class="footer">
@@ -41,6 +42,8 @@
            <view class="placeholder9 fs24">暂无数据</view>
         </view>
      </view>
      </scroll-view>
      <!--  -->
      <u-popup :show="showModal" round="12" @close="showModal = false">
         <view class="modal">
@@ -48,45 +51,47 @@
            <view class="line">
               <view class="la">合同号</view>
               <view class="val">
                  <input type="text" placeholder-class="placeholder9" v-model="form.contract" />
                  <input type="text" placeholder-class="placeholder9" v-model="form.contractNumber" />
               </view>
            </view>
            <view class="line">
               <view class="la">制单开始日期</view>
               <view class="val" @click="showStarttime = true">
                  <text class="mr12"
                     :class="{placeholder9: !form.starttime}">{{ form.starttime ? form.starttime : '请选择' }}</text>
                     :class="{placeholder9: !form.ncCreateDateTimeStart}">{{ form.ncCreateDateTimeStart ? form.ncCreateDateTimeStart : '请选择' }}</text>
                  <u-icon name="arrow-right" size="14" color="#999999"></u-icon>
               </view>
            </view>
            <view class="line">
               <view class="la">制单结束日期</view>
               <view class="val" @click="showEndtime = true">
                  <text class="mr12" :class="{placeholder9: !form.endtime}">{{ form.endtime ? form.endtime : '请选择' }}</text>
                  <text class="mr12"
                     :class="{placeholder9: !form.ncCreateDateTimeEnd}">{{ form.ncCreateDateTimeEnd ? form.ncCreateDateTimeEnd : '请选择' }}</text>
                  <u-icon name="arrow-right" size="14" color="#999999"></u-icon>
               </view>
            </view>
            <view class="line">
               <view class="la">发货地</view>
               <view class="val">
                  <input type="text" placeholder-class="placeholder9" v-model="form.fromRepertoty" />
                  <input type="text" placeholder-class="placeholder9" v-model="form.deliveryEnterprise" />
               </view>
            </view>
            <view class="line">
               <view class="la">到货地</view>
               <view class="val">
                  <input type="text" placeholder-class="placeholder9" v-model="form.toRepertoty" />
                  <input type="text" placeholder-class="placeholder9" v-model="form.receiveEnterprise" />
               </view>
            </view>
            <view class="line">
               <view class="la">省份</view>
               <view class="val" @click="showPri = true">
                  <text class="mr12" :class="{placeholder9: !form.provinceName}">{{ form.provinceName ? form.provinceName : '请选择' }}</text>
                  <text class="mr12"
                     :class="{placeholder9: !form.provinceName}">{{ form.provinceName ? form.provinceName : '请选择' }}</text>
                  <u-icon name="arrow-right" size="14" color="#999999"></u-icon>
               </view>
            </view>
            <view class="btns">
               <view class="btn" @click="showModal = false">取消</view>
               <view class="btn" @click="clear">取消</view>
               <view class="btn sub" @click="modalSub">提交</view>
            </view>
         </view>
@@ -130,18 +135,28 @@
      },
      onLoad(options) {
         this.$set(this.param, 'phoneNumber', options.phone)
         this.$set(this.form, 'starttime', dayjs().format('YYYY/MM/DD'))
         const nextMonth = dayjs().add(1, 'month');
         this.$set(this.form, 'endtime', nextMonth.format('YYYY/MM/DD'))
         this.getList()
      },
      methods: {
         clear() {
            this.param = {
               phoneNumber: this.param.phoneNumber
            }
            this.form = {}
            this.page = 1
            this.list = []
            this.showModal = false
            this.getList()
         },
         modalSub() {
            this.handleQuery()
            this.showModal = false
         },
         openModal() {
            this.showModal = true
            // this.$set(this.form, 'ncCreateDateTimeStart', dayjs().subtract(1, 'month').format('YYYY-MM-DD'))
            // const nextMonth = dayjs().add(1, 'month');
            // this.$set(this.form, 'ncCreateDateTimeEnd', dayjs().format('YYYY-MM-DD'))
         },
         confirmPro(e) {
            this.$set(this.form, 'provinceName', e.value[0])
@@ -149,17 +164,19 @@
         },
         confirmStart(e) {
            this.$nextTick(() => {
               this.$set(this.form, 'starttime', dayjs(e.value).format('YYYY/MM/DD'))
               this.$set(this.form, 'ncCreateDateTimeStart', dayjs(e.value).format('YYYY-MM-DD'))
            })
            this.showStarttime = false
         },
         confirmEnd(e) {
            this.$nextTick(() => {
               this.$set(this.form, 'endtime', dayjs(e.value).format('YYYY/MM/DD'))
               this.$set(this.form, 'ncCreateDateTimeEnd', dayjs(e.value).format('YYYY-MM-DD'))
            })
            this.showEndtime = false
         },
         handleQuery() {
            this.page = 1
            this.list = []
            this.getList()
         },
         handleDetail(item) {
@@ -167,22 +184,43 @@
               url: '/pages/waybill/waybillDetail?id=' + item.contractNumber
            })
         },
         scrolltolower() {
            const {
               total,
               list
            } = this
            if (list.length < total) {
               this.page = this.page + 1
               this.getList()
            } else {
               this.showToast('暂无更多数据')
            }
         },
         getList() {
            const {
               param,
               form
               form,
               page
            } = this
            if(form.contract){
               form.contractNumber = [form.contract]
            }else{
               form.contractNumber = null
            }
            // if (form.contract) {
            //    form.contractNumber = form.contract
            // } else {
            //    form.contractNumber = null
            // }
            orderListTms({
               parameters: {
               ...param,
               ...form
               },
               pager: {
                  rows: 10,
                  page
               }
            }).then(res => {
               this.list = res.data || []
               this.total = res.data.total
               if (res.data && res.data.rows) {
                  this.list = [...this.list, ...res.data.rows]
                  this.total = res.data.totalCount
               }
            })
         }
      }
@@ -236,12 +274,15 @@
      }
   }
   .main_list {
   .scroll_Y {
      background-color: #f7f7f7;
      height: calc(100vh - 130rpx);
      .main_list {
      width: 750rpx;
      margin: 0 -30rpx;
      padding: 24rpx 30rpx;
      height: calc(100vh - 140rpx);
      .item {
         border-radius: 8rpx;
@@ -316,6 +357,8 @@
         }
      }
   }
   }
   .modal {
      .modal_title {