xuxueyang
2024-09-13 731b3a23a6369aaef5c4fdc0ff4524eb6a7f3642
sub_pages/partner/delivery/delivery.vue
@@ -1,6 +1,7 @@
<script>
   export default {
      data() {
         var defaultDatePre = new Date(new Date().getTime() - 24 * 3600 * 1000)
         return {
            query: {
               supplierName: '',
@@ -13,7 +14,7 @@
            },
            show_select_station: false,
            show_select_status: false,
            selecttoday: true,
            selecttoday: false,
            columns_station: [],
            status_columns: [],
            show_time_picker_time: false,
@@ -28,6 +29,8 @@
                  status: 'CHECKED',
               },
            ],
            defaultDate: new Date(),
            defaultDatePre: defaultDatePre
         }
      },
      onLoad(options) {
@@ -35,9 +38,10 @@
         this.query.stationName = options.stationName || ''
         // this.listApi = '/api/delivery/list/today'
         this.listApi = '/api/delivery/check/list/today'
         // this.listApi = '/api/delivery/check/list'
         // this.listApi = '/api/delivery/check/list/today'
         this.listApi = '/api/delivery/check/list'
         this.query.date = this.$util.toDate(this.defaultDatePre)
         this.getList()
         // this.$http.request('get', '/api/station/list', {
         //    params: {}
@@ -70,14 +74,16 @@
      },
      methods: {
         async select_time_picker_time(e) {
            console.log('select_time_picker_time', e)
            var vv = e.value && new Date(e.value) || new Date()
            // console.log('select_time_picker_time', e)
            var vv = e && e.length >= 1 && new Date(e[0]) || new Date()
            // if (vv) {
            //    vv = vv.replace('aN:', '00:')
            // }
            // var time = new Date(`2023-8-21 ${vv}:00`)
            this.show_time_picker_time = false
            this.show_time_picker_time = false;
            this.query.date = this.$util.toDate(vv) || ''
            this.refreshList()
         },
         changeSelecrRange() {
            this.selecttoday = !this.selecttoday
@@ -116,7 +122,7 @@
         },
         toDetail(item) {
            uni.navigateTo({
               url: `/sub_pages/partner/delivery/delivery-supplier-detail-list?warehouseLocationCode=${this.query.warehouseLocationCode||''}&stationId=${this.query.stationId||''}&supplierId=${item.id}&range=` +
               url: `/sub_pages/partner/delivery/delivery-supplier-detail-list?warehouseLocationCode=${this.query.warehouseLocationCode||''}&date=${ this.query.date||''}&stationId=${this.query.stationId||''}&supplierId=${item.id}&range=` +
                  (this
                     .selecttoday ? 'today' : '')
            })
@@ -127,9 +133,11 @@
            const {
               code,
               data
            } = await this.$http.request('get', '/api/delivery/check/list/complete', {
            } = await this.$http.request('get', '/api/delivery/check/list/complete' + (this.selecttoday ?
               "/today" : ""), {
               params: {
                  id: item.id
                  id: item.id,
                  date: this.query.date || null
               }
            })
            if (code === 0) {
@@ -183,15 +191,16 @@
            </view> -->
         <!-- </view> -->
         <view class="m-t-12 m-b-12 flex">
            <view class="" v-if="!selecttoday" :class="[query.date?'':'desc-gray']"
            <!-- v-if="!selecttoday" -->
            <view class="m-l-a m-r-20 w-fit" :class="[query.date?'':'desc-gray']"
               @click="show_time_picker_time=true">
               <!-- 选择日期 -->
               {{query.date || '请选择日期'}}
               订单日期:{{query.date || '请选择日期'}}
            </view>
            <view class="m-l-a m-r-20 w-fit flex">
            <!-- <view class="m-l-a m-r-20 w-fit flex">
               <radio :checked="selecttoday" @click="changeSelecrRange"></radio>
               <view>只查看今日</view>
            </view>
            </view> -->
         </view>
         <!-- <view class="component-filter-container p20 bg-white">
@@ -275,9 +284,13 @@
      <u-picker @confirm="select_status" keyName="label" @cancel="show_select_status=false" :show="show_select_status"
         :columns="status_columns"></u-picker>
      <u-datetime-picker :show="show_time_picker_time" @cancel="show_time_picker_time=false"
         @confirm="select_time_picker_time" v-model="tmp_picker_time" mode="date"></u-datetime-picker>
      <!--       <u-datetime-picker :show="show_time_picker_time" @cancel="show_time_picker_time=false"
         @confirm="select_time_picker_time" v-model="tmp_picker_time" mode="date"></u-datetime-picker> -->
      <u-calendar :show="show_time_picker_time" mode="single" @confirm="select_time_picker_time"
         @cancel="show_time_picker_time = false" :monthNum="12" :maxDate="defaultDate" :defaultDate="defaultDatePre"
         @close="show_time_picker_time = false" minDate="2024-07-01" toolTip="选择订单日期">
      </u-calendar>
   </view>
</template>