1
wankeda
2 天以前 786c5ca17012ff3a01faf466b751bdbe70629b97
´úÂë¹ÜÀí/NEWCode/WIDESEAWCS_PDA/pages/½ÐÁÏ/¿ÕÍлØÁ÷.vue
@@ -1,20 +1,21 @@
<template>
   <view>
      <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem">
      </uni-segmented-control>
      <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem"></uni-segmented-control>
      <view class="content">
         <view v-if="current === 0" class="headerstyle">
            <view class="itemstyle">
               <uni-forms label-width="120">
                  <uni-forms-item label="起点缓存架地址">
                     <uni-easyinput type="text" :focus="!addressFocus" v-model="sourceAddress"
                        placeholder="请扫瞄起点地址" ref='midInput' @input="inputChangebarcode" />
                     <!-- <uni-data-select v-model="value" :localdata="rangs"></uni-data-select> -->
                  <uni-forms-item label="第一起点缓存架地址">
                     <uni-easyinput type="text" v-model="sourceAddress" placeholder="请扫瞄起点地址" ref='firstInput'
                        :focus="focusFirst" @confirm="handleFirstInputConfirm" @input="checkFirstInput" />
                  </uni-forms-item>
                  <uni-forms-item label="终点输送线地址">
                     <uni-easyinput type="text" :focus="!addressFocus" v-model="targetAddress"
                        placeholder="请扫描终点地址" ref='midInput' @input="inputChangebarcode" />
                  <uni-forms-item label="第二起点缓存架地址">
                     <uni-easyinput type="text" v-model="sourceAddress1" placeholder="请扫瞄起点地址" ref='secondInput'
                        :focus="focusSecond" @confirm="handleSecondInputConfirm" />
                  </uni-forms-item>
<!--                   <uni-forms-item label="终点输送线地址">
                     <uni-data-select v-model="value" :localdata="rangs"></uni-data-select>
                  </uni-forms-item> -->
                  <uni-forms-item>
                     <button @click="inbound" type="primary" size="default"
                        style="margin-top: 2%;">输送线搬运确认</button>
@@ -46,6 +47,7 @@
            addressFocus: false,
            targetAddress: "",
            sourceAddress: "",
            sourceAddress1: "",
            Exception: "",
            address: "",
            check: true,
@@ -53,7 +55,18 @@
            matInfo: [],
            value2: "",
            matTotals: [],
            focusFirst: true, // åˆå§‹èšç„¦ç¬¬ä¸€ä¸ªè¾“入框
            focusSecond: false, // åˆå§‹ä¸èšç„¦ç¬¬äºŒä¸ªè¾“入框
            value: 0,
            rangs: [{
                  value: "FJXL-KPHLX001",
                  text: "FJXL-KPHLX001"
               },
               {
                  value: "ZJXL-KPHLX001",
                  text: "ZJXL-KPHLX001"
               },
            ],
            // range: [],
         }
      },
@@ -98,6 +111,26 @@
         //       }
         //    })
         // },
         // æ£€æŸ¥ç¬¬ä¸€ä¸ªè¾“入框内容
         checkFirstInput(value) {
            if (value && value.length > 0) {
               // å¦‚果第一个输入框有内容,自动跳转到第二个输入框
               this.focusFirst = false;
               this.$nextTick(() => {
                  this.focusSecond = true;
               });
            }
         },
         // å¤„理第一个输入框确认事件
         handleFirstInputConfirm() {
            this.focusFirst = false;
            this.$nextTick(() => {
               this.focusSecond = true;
            });
         },
         onClickItem(e) {
            this.focus = false;
            this.addressFocus = false;
@@ -118,31 +151,38 @@
         inbound() {
            // æå–输入框的值
            const sourceAddress = this.sourceAddress;
            const targetAddress = this.targetAddress;
            const sourceAddress1 = this.sourceAddress1;
            const targetAddress = this.value;
            if (sourceAddress == "") {
               this.$t.message.toast('请选择起点位置');
               return;
            }
            if (targetAddress == "") {
               this.$t.message.toast('请扫瞄终点位置');
            if (sourceAddress1 == "") {
               this.$t.message.toast('请选择起点位置');
               return;
            }
            // if (targetAddress == "") {
            //    this.$t.message.toast('请扫瞄终点位置');
            //    return;
            // }
            var postData = {
               MainData: {
                  "sourceAddress": this.sourceAddress,
                  "targetAddress": this.targetAddress,
                  "sourceAddress1": this.sourceAddress1,
                  // "targetAddress": this.value,
               }
            }
            // console.log(Exception);
            this.$u.post('/api/PDA/EmptyTask', postData).then(res => {
               this.$t.message.closeLoading();
               console.log(postData);
               if (res.code == 0) {
               if (res.code == 200) {
                  this.$t.message.toast('呼叫成功');
                  this.sourceAddress = "";
                     this.targetAddress = "";
                     // this.$refs.popup.close();
                  this.sourceAddress1 = "";
                  // this.value = "";
                  // this.$refs.popup.close();
                  // this.submit();
               } else {
                  this.$t.message.toast(res.message);
@@ -163,6 +203,10 @@
               }
            })
         },
         onReady() {
            // é¡µé¢åŠ è½½å®ŒæˆåŽè‡ªåŠ¨èšç„¦ç¬¬ä¸€ä¸ªè¾“å…¥æ¡†
            this.focusFirst = true;
         }
         // getEndLocations() {
         //    this.$u.post('/api/CachePoint/GetEndPoints', null).then(res => {
         //       if (res.status) {