dengjunjie
5 天以前 4f39dcc195f28fa275fc2d065fbf1bf6a46c21b7
´úÂë¹ÜÀí/ZhongHePDA/pages/task/AgvTask.vue
@@ -5,32 +5,16 @@
      <view v-show="current === 0">
         <view style="padding: 5%;">
            <uni-forms label-width="120">
               <uni-forms-item label="托盘数量">
                  <uni-easyinput type="text" :focus="istrue" @input="carNoInputChange" v-model="PalletCode"
                     placeholder="请输入托盘数量" ref='midInput' />
               </uni-forms-item>
               <uni-forms-item label="绑定货位">
                  <uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="Point"
                     placeholder="请输入绑定货位点" ref='midInput' />
               </uni-forms-item>
            </uni-forms>
            <button @click="Bind" type="primary" size="default" style="margin-top: 2%;">绑定</button>
            <u-toast ref="BindluToast" />
         </view>
      </view>
      <view v-show="current === 1">
         <view style="padding: 5%;">
            <uni-forms label-width="120">
               <uni-forms-item label="终点">
                  <uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="EndAddress"
                     placeholder="请输入终点" ref='midInput' />
               </uni-forms-item>
            </uni-forms>
            <button @click="CallMateriel" type="primary" size="default" style="margin-top: 2%;">叫料</button>
            <button @click="CallMateriel" type="primary" size="default" style="margin-top: 2%;">呼料</button>
            <u-toast ref="CallMaterieluToast" />
         </view>
      </view>
      <view v-show="current === 2">
      <view v-show="current === 1">
         <view style="padding: 5%;">
            <uni-forms label-width="120">
               <uni-forms-item label="起点">
@@ -38,7 +22,7 @@
                     placeholder="请输入起点" ref='midInput' />
               </uni-forms-item>
            </uni-forms>
            <button @click="MaterielCarry" type="primary" size="default" style="margin-top: 2%;">搬运</button>
            <button @click="MaterielCarry" type="primary" size="default" style="margin-top: 2%;">取料</button>
            <u-toast ref="MaterielCarryuToast" />
         </view>
      </view>
@@ -56,7 +40,7 @@
            StartAddress: "",
            PalletCode: "",
            Point: "",
            items: ['货位绑定', '叫料', '搬运'],
            items: ['呼料', '取料'],
            current: 0
         }
      },
@@ -65,40 +49,13 @@
      // },
      methods: {
         onClickItem(e) {
            if (this.current != e.currentIndex) {
            this.istrue = false;
            if (this.current !== e.currentIndex) {
               this.current = e.currentIndex;
            }
         },
         Bind() {
            if (this.PalletCode.length == "" || this.Point.length == "") {
               this.$refs.BindluToast.show({
                  title: "托盘数量跟绑定货位不能为空",
                  type: "error"
               })
               return;
            }
            // var param = {
            //    MainData: {
            //       "PalletCode": this.PalletCode,
            //       "Point": this.Point
            //    },
            // }
            this.$u.post('/api/PDA/Bind?qty=' + this.PalletCode + '&point=' + this.Point, {}).then(res => {
               if (res.status) {
                  this.$refs.BindluToast.show({
                     title: "绑定成功",
                     type: "success"
                  })
                  this.Point = "";
                  this.PalletCode = "";
                  this.istrue = false;
               } else {
                  this.$refs.BindluToast.show({
                     title: res.message,
                     type: "error"
                  })
               if (this.current == 2) {
                  this.getData();
               }
            })
            }
         },
         CallMateriel() {
            if (this.EndAddress == "") {
@@ -116,7 +73,7 @@
            this.$u.post('/api/PDA/CallMateriel?endPoint=' + this.EndAddress, {}).then(res => {
               if (res.status) {
                  this.$refs.CallMaterieluToast.show({
                     title: "叫料成功",
                     title: "呼叫Agv送料成功",
                     type: "success"
                  })
                  this.EndAddress = "";
@@ -145,7 +102,7 @@
            this.$u.post('/api/PDA/MaterielCarry?startPoint=' + this.StartAddress, {}).then(res => {
               if (res.status) {
                  this.$refs.MaterielCarryuToast.show({
                     title: "呼叫Agv搬运成功",
                     title: "呼叫Agv取料成功",
                     type: "success"
                  })
                  this.StartAddress = "";