wangxinhui
9 天以前 834294889ab62bafaf034b1b87c2ead961c33476
ÏîÄ¿´úÂë/ÁúÀûµÃPDA/pages/stash/AGVFinish.vue
@@ -2,9 +2,11 @@
   <view>
      <view class="itemstyle">
         <uni-forms label-width="180">
            <uni-forms-item label="托盘条码:">
               <uni-easyinput type="text" placeholder="请扫描托盘条码" ref='midInput' :focus="!focus" v-model="barcode"
                  @input="barcodeInput" />
            <uni-forms-item label="任务编号:">
               <uni-easyinput type="number" v-model="taskNum" placeholder="请输入任务编号" ref='midInput'/>
            </uni-forms-item>
            <uni-forms-item label="地址条码:">
               <uni-easyinput type="text" placeholder="请扫描地址条码" ref='midInput' :focus="!focus" v-model="address" @confirm="addressInput" />
            </uni-forms-item>
            <uni-forms-item>
               <button @click="AGVFinish" type="primary" size="default" style="margin-top: 2%;">确认完成</button>
@@ -21,7 +23,8 @@
      data() {
         return {
            focus: false,
            barcode: "",
            taskNum: "",
            address: ""
         }
      },
      onShow() {},
@@ -29,33 +32,38 @@
         this.focus = false;
      },
      methods: {
         // voiceSpeech(src) {
         //    innerAudioContext.src = src; // '../../static/success.mp3';
         //    innerAudioContext.play();
         // },
         barcodeInput() {
         addressInput() {
            this.$nextTick(function(x) {
               if (this.barcode.length > 0) {
               if (this.address.length > 0) {
                  this.focus = true;
               }
            })
         },
         AGVFinish() {
            if (this.barcode == "") {
            if (this.address == "") {
               this.$refs.uToast.show({
                  title: "请扫描托盘码",
                  title: "请扫描地址条码",
                  type: 'error'
               })
               return;
            }
            this.$u.post('http://10.30.4.92:9291/api/CTU_AGV/AGVFinish?barcode=' + this.barcode).then(
            if (this.taskNum == "") {
               this.$refs.uToast.show({
                  title: "请输入任务编号",
                  type: 'error'
               })
               return;
            }
            this.$u.post('http://192.168.35.3:9281/api/AGV/AGVFinish?address=' + this.address +'&taskNum='+ this.taskNum).then(
               res => {
                  if (res.status) {
                     this.$refs.uToast.show({
                        title: "完成成功",
                        title: "成功",
                        type: "success"
                     })
                     this.barcode = "";
                     this.taskNum = "";
                     this.address = "";
                     this.focus = false;
                  } else {
                     this.$refs.uToast.show({
                        title: res.message,