yangan
2024-08-16 3d87bf45986772678752aa2d53a2d2dba51efc0b
pages/customer-page/customer-index/customer-index.vue
@@ -3,14 +3,14 @@
      <view class="customer-index">
         <view class="customer-index-body">
            
            <!-- 待领取和转发提煤单 -->
            <!-- 待领取和转发收发单 -->
            <view class="wait-collection"
               style="background: url('https://mx.jzeg.cn:9096/appimg/image/banner/customerbanner.png') no-repeat;background-size:contain">
               style="background: url('https://wrzs.czjlchem.com:9090/appimg/image/banner/customerbanner.png') no-repeat;background-size:contain">
            </view>
               <!-- 自主配送界面 -->
            <view class="self-deliver">
            <view class="self-deliver" v-if="personnelType === 1">
               <view class="self-deliver_text">
                  创建日计划订单
                  创建日计划订单
               </view>
               <view class="self-deliver_btn">
                  <u-button text="去创建"
@@ -34,8 +34,8 @@
                  @click="cardBodyClick(item)">
                  <view class="first-line">
                     <view class="dispatch-receive">
                        <view class="dispatch-dept">{{ item.deptName }}</view>
                        <view class="black-bar"></view>
                        <!-- <view class="dispatch-dept">{{ item.deptName }}</view>
                        <view class="black-bar"></view> -->
                        <view class="dispatch">{{ item.filedName }}</view>
                     </view>
                     <view class="point-number">
@@ -45,12 +45,12 @@
                  </view>
                  <view class="second-line"
                     style="width: 94%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
                     v-if="item.orderType==='内销'||item.orderType==='外购'">
                     v-if="item.orderType==='内销'||item.orderType==='外购' || item.orderType==='外购退'">
                     {{item.customerName}}
                  </view>
                  <view class="second-line">
                     <view class="coal-name">
                        <view class="">{{ item.productName }}</view>
                        <view class="coal-name-tag">{{ item.productNames || item.productName }}</view>
                        <view class="black-bar"></view>
                        <view class="coal-type"
                           v-if="item.orderType">{{ item.orderType }}</view>
@@ -62,14 +62,16 @@
                  <view class="third-line">
                     <view class="time-icon">
                        <view
                           style="width: 24rpx;height: 24rpx;li ne-height: 24rpx;background: url('https://mx.jzeg.cn:9096/appimg/image/banner/clock.png') no-repeat;background-size: cover">
                           style="width: 12rpx;height: 12rpx;line-height: 24rpx;background: url('https://wrzs.czjlchem.com:9090/appimg/image/banner/clock.png') no-repeat;background-size: cover">
                        </view>
                     </view>
                     <view class="send-date">{{ item.sendDate }}</view>
                  </view>
                  <view class="fourth-line">
                     <view class="receive"
                        @click.stop="receiveClick(item)">
                        @click.stop="receiveClick(item)"
                        v-if="Number(item.cars2)  <  Number(item.carNum)"
                        >
                        <view class="button-image">领取</view>
                     </view>
                     <view class="forward"
@@ -80,9 +82,9 @@
               </view>
            </view>
            <!-- 历史提煤单 -->
            <!-- 历史收发单 -->
            <view class="history-numbers">
               <combined-title title="历史提煤单"></combined-title>
               <combined-title title="历史收发单"></combined-title>
               <scroll-view :scroll-top="scrollTop"
                  scroll-y="true"
                  class="scroll-Y"
@@ -98,13 +100,13 @@
                     :key="index"
                     @click="faYundetail(item)">
                     <view class="first">
                        <view class="">{{ item.deptName || '' }}</view>
                        <view class="">{{ item.filedName || '' }}</view>
                        <view class=""><u-icon name="arrow-right"
                              color="#999999"
                              size="40"></u-icon></view>
                     </view>
                     <view class="second">
                        <view class="coal-name">{{ item.coalName ||  item.productName }}</view>
                        <view class="coal-name">{{  item.productNames || item.productName }}</view>
                        <view class="order-type">{{ item.orderType || '' }}</view>
                     </view>
                     <view class="third">
@@ -120,14 +122,14 @@
                              v-else-if="roleType == 2">{{ item.carNumSurplus }}</view>
                        </view>
                        <view class="third-line">
                           <view class="third-line_text">提煤单个数:</view>
                           <view class="third-line_text">收发单个数:</view>
                           <view class="third-line_num">{{ item.tmCount }}</view>
                        </view>
                     </view>
                     <view class="fourth">
                        <view class="fourth-icon">
                           <view
                              style="width: 24rpx;height: 24rpx;line-height: 24rpx;background: url('https://mx.jzeg.cn:9096/appimg/image/banner/clock.png') no-repeat;background-size: cover">
                              style="width: 24rpx;height: 24rpx;line-height: 24rpx;background: url('https://wrzs.czjlchem.com:9090/appimg/image/banner/clock.png') no-repeat;background-size: cover">
                           </view>
                        </view>
                        <view class="senddate">{{ item.sendDate }}</view>
@@ -135,7 +137,7 @@
                     <view class="fourth">
                        <view class="fourth-icon">
                           <view
                              style="width: 26rpx;height: 26rpx;line-height: 26rpx;background: url('https://mx.jzeg.cn:9096/appimg/image/banner/carnNUm.png') no-repeat;background-size: cover;">
                              style="width: 26rpx;height: 26rpx;line-height: 26rpx;background: url('https://wrzs.czjlchem.com:9090/appimg/image/banner/carnNUm.png') no-repeat;background-size: cover;">
                           </view>
                        </view>
                        <view class="senddate">{{ item.orderCode }}</view>
@@ -172,9 +174,7 @@
</template>
<script>
   import card from '@/components/card/card.vue';
   import combinedTitle from '@/components/combined-title/combined-title.vue';
   import { customerId } from '@/utils/status';
   export default {
      props: {
         orderPlanDataStore: {
@@ -183,7 +183,6 @@
         }
      },
      components: {
         card,
         combinedTitle
      },
      watch: {
@@ -203,7 +202,8 @@
      data() {
         return {
            orderPlanData: [],
            show: false, // 领取提煤单弹出框
            personnelType:'', // 用户类型
            show: false, // 领取收发单弹出框
            receiveNum: null,
            getOrderNum: {
               num: '',
@@ -223,7 +223,7 @@
            showMoreData: false,
            cars2: "",  //领取日计划的车数
            carNum: "",  //日计划的总车数
            // 剩余的提煤单数量
            // 剩余的收发单数量
            carNumSurplus: '',
            canClick: false,
            popupDetermineClickLoading: false
@@ -236,18 +236,19 @@
         init() {
            this.GetOrderPlan();
            this.getJhOrderPlanDataPage();
            this.getType();
         },
         // 获取发运计划列表
         GetOrderPlan() {
            uni.showLoading({ title: '加载中...' });
            this.$reqGet('GetOrderPlan',{orderType:"外购"}).then(res => {
            this.$reqGet('GetOrderPlan').then(res => {
               if (res.data) {
                  this.orderPlanData = res.data;
                  uni.hideLoading();
               }
            });
         },
         // 获取历史提煤单
         // 获取历史收发单
         getJhOrderPlanDataPage() {
            uni.showLoading({
               title: '加载中'
@@ -272,7 +273,7 @@
            this.pageCurrent++;
            this.getJhOrderPlanDataPage();
         },
         //fix 点击提煤单返回会增加重复数据
         //fix 点击收发单返回会增加重复数据
         ArrSet(Arr, id) {
            var obj = {};
            const arrays = Arr.reduce((setArr, item) => {
@@ -324,7 +325,7 @@
          */
         receiveClick(item) {
            this.show = true;
            this.getOrderNum.id = item.id; // 获取领取提煤单的id
            this.getOrderNum.id = item.id; // 获取领取收发单的id
            this.cars2 = item.cars2
            this.carNum = item.carNum
         },
@@ -337,30 +338,42 @@
            console.log('输入框', e);
            this.canClick = e > (this.carNum - this.cars2)
            if (this.canClick) {
               this.$u.toast('已超过当前日计划提煤单数量,请重新输入')
               this.$u.toast('已超过当前日计划收发单数量,请重新输入')
            }
         },
         // (顶部)发运计划详情
         cardBodyClick(v) {
            uni
               .navigateTo({ url: `/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails?orderPlanId=${v.id}&code=${v.code}&cars2=${v.cars2}` });
               .navigateTo({ url: `/subPages/fayunPlanDetails/fayunPlanDetails?orderPlanId=${v.id}&code=${v.code}&cars2=${v.cars2}` });
         },
         // 点击历史提煤单获取详情
         // 点击历史收发单获取详情
         faYundetail(v) {
            uni.navigateTo({
               url: `/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails?orderPlanId=${v.id}&cars2=${v.cars2}&coalName=${v.coalName}&deptName=${v.deptName}`
               url: `/subPages/fayunPlanDetails/fayunPlanDetails?orderPlanId=${v.id}&cars2=${v.cars2}&productNames=${v.productNames || v.productName}&deptName=${v.deptName}`
            });
         },
         // 转发
         forwardClick(obj) {
            console.log(111,obj)
            if (obj.cars2 == 0) return this.$u.toast('请先领取后再转发');
            uni
               .navigateTo({ url: `/pages/public-page/forward/forward?orderPlanId=${obj.id}&carNumSurplus1=${obj.carNumSurplus1}&carNum=${obj.carNum}&cars2=${obj.cars2}` });
               .navigateTo({ url: `/pages/public-page/forward/forward?orderPlanId=${obj.id}&orderType=${obj.orderType}&carNumSurplus1=${obj.carNumSurplus1}&carNum=${obj.carNum}&cars2=${obj.cars2}` });
         },
         // 自主配送
         selfDeliver() {
            uni.navigateTo({
               url: '/pages/customer-page/addDailyPlan/addDailyPlan'
               url: '/subPages/addDailyPlan/addDailyPlan'
            })
         },
         //获取用户标识
         getType(){
            this.$reqGetId('getPersonnelType',uni.getStorageSync('customerId')).then(res=>{
               console.log(res,'ressss')
               if(res.code === 0){
                 this.personnelType = res.data.personnelType;
               }else{
                  this.personnelType = '';
               }
            })
         }
      }
@@ -457,7 +470,7 @@
         .second {
            width: 100%;
            height: 31rpx;
            height: vw(80);
            font-size: 30rpx;
            font-weight: 300;
            color: #515151;
@@ -466,9 +479,12 @@
            justify-content: flex-start;
            .coal-name {
               min-width: vww(30);
               height: vww(20);
               width: 70%;
               height: vww(50);
               margin-right: vww(21);
                white-space: nowrap; /* 不换行 */
               overflow: hidden; /* 超出隐藏 */
               text-overflow: ellipsis;
            }
            .order-type {
@@ -537,8 +553,8 @@
            top: vww(-144);
            .collection-form-item {
               width: 690rpx;
               height: 370rpx;
               width: 700rpx;
               height: 390rpx;
               background: #ffffff;
               box-shadow: 4rpx 6rpx 25rpx 0rpx rgba(73, 120, 240, 0.15);
               border-radius: 20rpx;
@@ -576,7 +592,7 @@
                     }
                     .dispatch {
                        margin-left: vww(12);
                        // margin-left: vww(12);
                        min-width: vww(50);
                     }
@@ -601,13 +617,15 @@
               .second-line {
                  width: 100%;
                  height: vww(30);
                  height: vww(50);
                  margin-left: vww(16);
                  display: flex;
                  align-items: center;
                  justify-content: flex-start;
                      margin-bottom: 15rpx;
                  .coal-name {
                     width: 80%;
                     flex-grow: 1;
                     height: 30rpx;
                     font-size: 30rpx;
@@ -615,7 +633,14 @@
                     color: #515151;
                     position: relative;
                     display: flex;
                     margin-top: 20rpx;
                     align-items: center;
                     .coal-name-tag{
                        width: 70%;
                     white-space: nowrap; /* 不换行 */
                     overflow: hidden; /* 超出隐藏 */
                         text-overflow: ellipsis;
                     }
                     .black-bar {
                        width: 2rpx;
@@ -645,8 +670,8 @@
                  align-items: center;
                  .send-date {
                     margin-left: vww(14);
                     width: 148rpx;
                     margin-left: vww(5);
                     width: 170rpx;
                     height: 24rpx;
                     line-height: 24rpx;
                     font-size: 28rpx;
@@ -657,7 +682,7 @@
               .fourth-line {
                  width: 100%;
                  height: vww(30);
                  height: vww(40);
                  @include flex;
                  justify-content: flex-start;
                  position: relative;