1
dengjunjie
3 天以前 29cd467ba62b2bdf49c6546e78ae3ec809c4a723
´úÂë¹ÜÀí/ZhongHePDA/pages/task/AgvTask.vue
@@ -9,6 +9,10 @@
                  <uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="EndAddress"
                     placeholder="请输入终点" ref='midInput' />
               </uni-forms-item>
               <uni-forms-item label="起点">
                  <uni-easyinput type="text" :focus="istrue" v-model="StartAddress1" placeholder="请输入起点"
                     ref='midInput' />
               </uni-forms-item>
            </uni-forms>
            <button @click="CallMateriel" type="primary" size="default" style="margin-top: 2%;">呼料</button>
            <u-toast ref="CallMaterieluToast" />
@@ -18,8 +22,12 @@
         <view style="padding: 5%;">
            <uni-forms label-width="120">
               <uni-forms-item label="起点">
                  <uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="StartAddress"
                  <uni-easyinput type="text" :focus="!istrue1" @input="carNoInputChange1" v-model="StartAddress"
                     placeholder="请输入起点" ref='midInput' />
               </uni-forms-item>
               <uni-forms-item label="终点">
                  <uni-easyinput type="text" :focus="istrue1" v-model="EndAddress1" placeholder="请输入终点"
                     ref='midInput' />
               </uni-forms-item>
            </uni-forms>
            <button @click="MaterielCarry" type="primary" size="default" style="margin-top: 2%;">取料</button>
@@ -35,8 +43,11 @@
      data() {
         return {
            istrue: false,
            istrue1: false,
            range: [],
            EndAddress: "",
            EndAddress1:"",
            StartAddress1:"",
            StartAddress: "",
            PalletCode: "",
            Point: "",
@@ -50,12 +61,31 @@
      methods: {
         onClickItem(e) {
            this.istrue = false;
            this.istrue1 = false;
            this.StartAddress = "";
            this.EndAddress == "";
            this.StartAddress1 = "";
            this.EndAddress1 == "";
            if (this.current !== e.currentIndex) {
               this.current = e.currentIndex;
               if (this.current == 2) {
                  this.getData();
               }
            }
         },
         carNoInputChange() {
            this.$nextTick(function(x) {
               if (this.EndAddress.length > 0) {
                  this.istrue = true;
               }
            })
         },
         carNoInputChange1() {
            this.$nextTick(function(x) {
               if (this.StartAddress.length > 0) {
                  this.istrue1 = true;
               }
            })
         },
         CallMateriel() {
            if (this.EndAddress == "") {
@@ -70,21 +100,23 @@
            //       "endPoint": this.EndAddress
            //    },
            // }
            this.$u.post('/api/PDA/CallMateriel?endPoint=' + this.EndAddress, {}).then(res => {
               if (res.status) {
                  this.$refs.CallMaterieluToast.show({
                     title: "呼叫Agv送料成功",
                     type: "success"
                  })
                  this.EndAddress = "";
                  this.istrue = false;
               } else {
                  this.$refs.CallMaterieluToast.show({
                     title: res.message,
                     type: "error"
                  })
               }
            })
            this.$u.post('/api/PDA/CallMateriel?endPoint=' + this.EndAddress + '&startPoint=' + this.StartAddress1, {})
               .then(res => {
                  if (res.status) {
                     this.$refs.CallMaterieluToast.show({
                        title: "呼叫Agv送料成功",
                        type: "success"
                     })
                     this.StartAddress1 = "";
                     this.EndAddress = "";
                     this.istrue = false;
                  } else {
                     this.$refs.CallMaterieluToast.show({
                        title: res.message,
                        type: "error"
                     })
                  }
               })
         },
         MaterielCarry() {
            if (this.StartAddress == "") {
@@ -99,21 +131,23 @@
            //       "startPoint": this.StartAddress
            //    },
            // }
            this.$u.post('/api/PDA/MaterielCarry?startPoint=' + this.StartAddress, {}).then(res => {
               if (res.status) {
                  this.$refs.MaterielCarryuToast.show({
                     title: "呼叫Agv取料成功",
                     type: "success"
                  })
                  this.StartAddress = "";
                  this.istrue = false;
               } else {
                  this.$refs.MaterielCarryuToast.show({
                     title: res.message,
                     type: "error"
                  })
               }
            })
            this.$u.post('/api/PDA/MaterielCarry?startPoint=' + this.StartAddress + '&endPoint=' + this.EndAddress1, {})
               .then(res => {
                  if (res.status) {
                     this.$refs.MaterielCarryuToast.show({
                        title: "呼叫Agv取料成功",
                        type: "success"
                     })
                     this.StartAddress = "";
                     this.EndAddress1 = "";
                     this.istrue = false;
                  } else {
                     this.$refs.MaterielCarryuToast.show({
                        title: res.message,
                        type: "error"
                     })
                  }
               })
         },
      }
   }