付延余
2023-03-21 d36eb757af8867278125c6999fcaa5bdb902151c
pages/driver-page/appointment/appointment.vue
@@ -1,7 +1,6 @@
<template>
   <view class="appointment">
      <!-- <h1>东庞矿——1/3提煤单</h1> -->
      <combined-title title="东庞矿——1/3提煤单"></combined-title>
      <combined-title :title="yuYueData.length != 0 ? yuYueData[0].filedName + '——' + yuYueData[0].sendDate : '暂无预约列表'"></combined-title>
      <view class="appointment-table">
         <uni-table border stripe emptyText="暂无更多数据">
            <uni-tr>
@@ -23,15 +22,21 @@
<script>
import combinedTitle from '@/components/combined-title/combined-title.vue';
import { BigNumber } from 'bignumber.js';
export default {
   components: {
      combinedTitle
   },
   data() {
      return {
         takeCoalId: null,
         yuYueId: null,
         yuYueListParams: {
            filedId: '',
            deptId: '',
            sendDate: ''
         },
         yuYuePostParams: {
            takeCoalId: null,
            yuYueId: null
         },
         yuYueData: [],
         isRCSQ: false, // 入场申请接口控制
         rcsqData: {
@@ -50,7 +55,10 @@
         this.isRCSQ = true;
         this.rcsqData.originalYyId = params.yyId;
      }
      this.takeCoalId = params.takeCoalId;
      this.yuYuePostParams.takeCoalId = params.takeCoalId;
      this.yuYueListParams.filedId = params.filedId;
      this.yuYueListParams.deptId = params.deptId;
      this.yuYueListParams.sendDate = params.sendDate;
   },
   onShow() {
      this.init();
@@ -64,7 +72,7 @@
         uni.showLoading({
            title: '加载中...'
         });
         this.$reqGet('yuYueList').then(res => {
         this.$reqGet('yuYueList', this.yuYueListParams).then(res => {
            uni.hideLoading();
            if (res.code == 0) {
               this.yuYueData = res.data;
@@ -74,7 +82,7 @@
      // 预约和入场申请共用事件
      yuYueBtnClick(value) {
         if (this.isRCSQ) {
            this.rcsqData.taskId = this.takeCoalId;
            this.rcsqData.taskId = this.yuYuePostParams.takeCoalId;
            this.saveRCSQ(value);
         } else {
            this.yuYueClick(value.id);
@@ -82,10 +90,15 @@
      },
      // 预约
      yuYueClick(id) {
         this.yuYueId = id;
         this.$reqPost('yuYue', { takeCoalId: this.takeCoalId, yuYueId: this.yuYueId }, 'params').then(res => {
         this.yuYuePostParams.yuYueId = id;
         this.$reqPost('yuYue', { takeCoalId: this.yuYuePostParams.takeCoalId, yuYueId: this.yuYuePostParams.yuYueId }, 'params').then(res => {
            if (res.code == 0) {
               this.$u.toast('预约成功!');
               uni.navigateBack({
                  delta: 1
               })
            } else {
               this.$u.toast(res.data ? res.data : '预约失败');
            }
            setTimeout(() => {
               this.yuYueList();