819527061@qq.com
2024-02-05 fbd20431d9947d6989f6508ae47ccaad96576d68
pages/jihua/jihua.vue
@@ -27,16 +27,24 @@
                     <view class="main-flex">
                        <view class="carNum-box">
                           <view>计划车数:</view>
                           <!-- <u--input placeholder="请输入发运车数" border="surround" v-model="item.numPlan" @change="inputChange" @focus="faYunPlanCarsFocus(item)"></u--input> -->
                           <view class="planCars" :style="{color:item.numPlan  ? '#111':'#ccc'}" @click="faYunPlanCarsFocus(item)">
                              <text v-model="item.numPlan">{{ item.numPlan || '点击输入数量' }}</text>
                              <view class="cursor" v-if="isCursor && fayunPlanFocusId == item.orderId"><image src="@/static/cursor.gif" mode=""><image></view>
                           </view>
                            <u--input
                       placeholder="请输入发运车数"
                       border="surround"
                       v-model="item.numPlan"
                       @change="inputChange(item)"
                       @focus="faYunPlanCarsFocus(item)"
                       type="number" pattern="[0-9]*"></u--input>
                  <!--                           <view class="planCars" :style="{color:item.numPlan  ? '#111':'#ccc'}" @click="faYunPlanCarsFocus(item)">
                                      <text v-model="item.numPlan">{{ item.numPlan || '点击输入数量' }}</text>
                  &lt;!&ndash;                    <text v-model="item.numPlan">{{ item.numPlan || '点击输入数量' }}</text>&ndash;&gt;
                                      <view class="cursor" v-if="isCursor && fayunPlanFocusId == item.orderId"><image src="@/static/cursor.gif" mode=""><image></view>
                                    </view>-->
                        </view>
                        <view style="margin-right:10px">实际发车数:{{ item.numReal || '暂无' }}</view>
                     </view>
                  </view>
                  <u-keyboard
                  <u-keyboard
                     @change="valChange"
                     @backspace="backspace"
                     @confirm="keyBoardConfirm"
@@ -48,7 +56,7 @@
                     :overlay="false"
                     :closeOnClickOverlay="false"
                     :dotDisabled="true"
                     zIndex="100000"
                     zIndex="100000"
                  ></u-keyboard>
               </view>
@@ -70,18 +78,24 @@
                     <view class="main-flex">
                        <view class="carNum-box">
                           <view>计划车数:</view>
                           <!-- <u--input placeholder="请输入发运车数" border="surround" v-model="item.numPlan" @change="inputTotalChange(item)" @focus="faYunPlanCarsFocus(item)"></u--input> -->
                           <view class="planCars" :style="{color:item.numPlan  ? '#111':'#ccc'}" @click="faYunPlanCarsFocus(item)">
                            <u--input
                       placeholder="请输入发运车数"
                       border="surround"
                       v-model="item.numPlan"
                       @change="inputTotalChange(item)"
                       @focus="faYunPlanCarsFocus(item)"
                       type="number" pattern="[0-9]*"></u--input>
<!--                           <view class="planCars" :style="{color:item.numPlan  ? '#111':'#ccc'}" @click="faYunPlanCarsFocus(item)">
                              <text v-model="item.numPlan">{{ item.numPlan || '点击输入数量' }}</text>
                              <view class="cursor" v-if="isCursor && fayunPlanFocusId == item.orderId">
                                 <image src="@/static/cursor.gif" mode="" />
                              </view>
                           </view>
                           </view>-->
                        </view>
                        <view style="margin-right:10px">实际发车数:{{ item.numReal == null ? '暂无' : item.numReal }}</view>
                     </view>
                  </view>
                  <u-keyboard
<!--                  <u-keyboard
                     @change="valChange"
                     @backspace="backspace"
                     @confirm="keyBoardConfirm"
@@ -94,17 +108,17 @@
                     :closeOnClickOverlay="false"
                     :dotDisabled="true"
                     zIndex="100000"
                  ></u-keyboard>
                  ></u-keyboard>-->
               </view>
            </view>
         </view>
      </view>
      <!-- 修改弹出框 -->
      <u-popup :show="editPopupShow" @close="editPopupClose" @open="editPopupOpen" mode="top" round="10">
         <view class="editPopup">
            <view class="editPopup__title"><text>计划车数</text></view>
            <view class="editPopup__input"><u--input v-model="keyBoardValue" @change="change" placeholder="请输入内容" type="number" border="surround"></u--input></view>
            <view class="editPopup__input"><u--input v-model="keyBoardValue" placeholder="请输入内容" type="number" border="surround"></u--input></view>
            <!-- <view class="editPopup__btn"><u-button text="确定" type="primary" @click="popupDetermineClick"></u-button></view> -->
         </view>
      </u-popup>
@@ -118,7 +132,8 @@
<script>
import popupMenu from '@/components/common/popup-menu/popup-menu.vue';
import tool from '@/utils/tool.js';
import { TrackOpTypes } from "vue";
import { TrackOpTypes } from "vue";
import row from "../../uni_modules/uview-ui/libs/config/props/row";
export default {
   components: {
      popupMenu
@@ -127,7 +142,7 @@
      return {
         radioValue: '全部',
         tabList: [
            {
            {
               name: '今日发运计划'
            },
            {
@@ -162,6 +177,7 @@
   onPageScroll(e) {
      // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
      this.scrollTop = e.scrollTop;
      // console.log('屏幕滚动监听事件',this.scrollTop);
   },
   // 点击导航栏菜单后
   onNavigationBarButtonTap(e) {
@@ -194,17 +210,17 @@
         },
         deep: true,
         immediate: true
      },
      scrollTop: {
         handler: function(newV, oldV) {
            if (newV != oldV) {
               this.keyBoardClose();
               // this.keyBoardShow = false;
            }
         }
      },
      deep: true,
      immediate: true
      }
      // scrollTop: {
      //    handler: function(newV, oldV) {
      //          if (newV != oldV) {
      //             this.keyBoardClose();
      //             // this.keyBoardShow = false;
      //          }
      //    },
      //    deep: true,
      //    immediate: true
      // }
   },
   methods: {
      init() {
@@ -217,7 +233,7 @@
      fyList() {
         this.overlayShow = true;
         //列表查询
         uni.showLoading({
         uni.showLoading({
            title: '正在加载...'
         });
         let compId = uni.getStorageSync('userInfo').compId;
@@ -265,21 +281,25 @@
      //提交
      dataFormSubmit() {
         this.overlayShow = true;
         uni.showLoading({
            title:'加载中...'
         })
         this.fyData.forEach(e => {
            if(!e.shippingDate && e.numPlan){
               e.shippingDate = this.info.shippingDate
            }
         });
         this.$reqPost('addObj', this.fyData).then(res => {
         this.$reqPost('xscarshippingdayplanAddObj', this.fyData).then(res => {
            uni.hideLoading();
            if(res.code == 0){
               setTimeout(()=>{
                  uni.showToast({
                     title:'更新成功!',
                     icon:'none',
                     duration:1000
                  })
               },0)
               this.fyList();
          setTimeout(()=>{
            uni.showToast({
              title:'更新成功!',
              icon:'none',
              duration:1000
            })
          },0)
            }
         });
      },
@@ -322,13 +342,15 @@
      // 修改弹出框
      editPopupClose(){
         console.log('修改弹出框Close');
         // this.editPopupShow = false;
         this.editPopupShow = false;
         this.keyBoardShow = false;
      },
      editPopupOpen(){
         console.log('修改弹出框Open');
      },
      // 切换全部和已设置
      groupChange(n) {
         this.initVariable();
         this.isTomJihua = n;
         if (n == '已设置的计划') {
            this.xscarshippingdayplan();
@@ -338,6 +360,7 @@
      },
      //切换今日和明日
      tabClick(item) {
         this.initVariable();
         if (item.index == 1) {
            this.info.shippingDate = this.tomorrowDate();
            if (this.isTomJihua == '已设置的计划') {
@@ -354,20 +377,43 @@
            }
         }
      },
      inputChange(val) {
         console.log('全部计划', val);
      // 初始化变量
      initVariable(){
         this.keyBoardShow = false;
         this.keyBoardValue = null;
         this.fayunPlanFocusId = null;
         uni.pageScrollTo({
            scrollTop: 0,
            duration: 300
         });
      },
      inputChange(item) {
      if(item.numPlan) {
        let total = Math.floor(item.order.executiveSurplus / Number(34));
        let max = total + (item.numReal ? item.numReal : 0) + 1
        if(item.numPlan > max) {
          this.$nextTick(() => {
            item.numPlan = max
            this.$set(item,'numPlan',max)
          })
          uni.showToast({
            title:`该订单最大设置车数为:${max}`,
            icon:'none',
            duration:1000
          })
        }
      }
      },
    changeIn(val) {
      console.log(val,'val=====')
    },
      inputTotalChange(val) {
         console.log(val, 'val2=======val2,已设置计划');
         this.editRow = val;
      },
      },
      // input获取焦点
      faYunPlanCarsFocus(item) {
         // 获取该焦点在页面的位置
         // let boxBottom = document.getElementById('#u-dropdown');
         // console.log('元素',boxBottom);
         // let bottom = this.$refs.planViewRef.offsetHeight
         this.keyBoardShow = true;
      console.log(item,'发运车数计划------------===========')
         this.fayunPlanFocusId = item.orderId;
         this.keyBoardValue = item.numPlan + '';
         if(this.isTomJihua == '已设置的计划'){
@@ -375,6 +421,17 @@
         } else{
            this.isCursor = true;
         }
         // 根据列表下标,使屏幕滚动到相应可视位置
         // for(let i = 0;i<this.fyData.length;i++){
         //    if(this.fyData[i].orderId == item.orderId){
         //       uni.pageScrollTo({
         //          scrollTop: i*144,
         //          duration: 300
         //       });
         //    }
         // }
      },
      // 键盘
      valChange(val) {
@@ -447,8 +504,15 @@
   }
};
</script>
<style>
input{-webkit-appearance: none;}
</style>
<style lang="scss" scoped>
.ceshi-box{
  width: 100%;
  display: flex;
  flex-direction: column;
}
::v-deep {
   .u-tabs__wrapper__nav {
      padding-left: vww(75.5);
@@ -470,7 +534,7 @@
      width: vww(100);
      z-index: 1;
   }
   .u-radio-group--row {
      height: 100%;
      width: 100%;
@@ -531,14 +595,14 @@
   //    transform: translateX(-50%);
   //    border-radius: vww(20);
   // }
}
.jihua-main {
   display: flex;
   flex-direction: column;
   width: 100%;
   padding: vww(44) vww(10) vww(70) vww(10);
   padding: vww(44) vww(10) vww(270) vww(10);
   box-sizing: border-box;
   .main-inside {
      width: 100%;
@@ -558,7 +622,7 @@
   .main-block-box {
      box-shadow: 0px 0px 8px 0px rgba(216, 218, 238, 0.8);
      height: vww(120);
      //height: vww(120);
      padding: vww(10);
      box-sizing: border-box;
      margin-top: vww(12);
@@ -596,8 +660,8 @@
                  border: 1px solid #dddddd;
                  border-radius: vww(4);
                  padding: vww(1) vww(10);
                  // 输入焦点图片
                  .cursor {
                     // float: left;
@@ -650,4 +714,4 @@
      //    }
      // }
   }
</style>
</style>