1
yangpeixing
2026-03-12 9181f3dce9e6f617b34fa80b7bb72bb490be788b
¼ª°²PDA/pages/stash/Syncretism.vue
@@ -3,12 +3,12 @@
      <view class="itemstyle">
         <uni-forms label-width="180">
            <uni-forms-item label="原始托盘条码:">
               <uni-easyinput type="text" placeholder="请扫描托盘条码" ref='midInput' :focus="sourceFocus"
                  v-model="soussAddress" @input="barcodeInput" />
               <uni-easyinput type="text" placeholder="请扫描托盘条码" ref='midInput' :focus="!focus" v-model="soussAddress"
                  @input="barcodeInput" />
            </uni-forms-item>
            <uni-forms-item label="目标托盘条码:">
               <uni-easyinput type="text" placeholder="请扫描托盘条码" ref='midInput' :focus="targetFocus"
                  v-model="targetAddress" @input="barcodeInput" />
               <uni-easyinput type="text" placeholder="请扫描托盘条码" ref='midInput' :focus="!focus" v-model="targetAddress"
                  @input="barcodeInput" />
            </uni-forms-item>
            <uni-forms-item>
               <button @click="AGVTasks" type="primary" size="default" style="margin-top: 2%;">确认完成</button>
@@ -20,29 +20,28 @@
</template>
<script>
   const innerAudioContext = uni.createInnerAudioContext();
   export default {
      data() {
         return {
            sourceFocus: true, // é»˜è®¤åŽŸå§‹æ‰˜ç›˜è¾“å…¥æ¡†èŽ·å¾—ç„¦ç‚¹
            targetFocus: false, // ç›®æ ‡æ‰˜ç›˜è¾“入框不获得焦点
            focus: false,
            soussAddress: "",
            targetAddress: "",
            warehouseId: "",
               warehouseId: "",
         }
      },
      onShow() {},
      onLoad(res) {
         this.warehouseId = res.warehouseId;
         this.focus = false;
         this.warehouseId=res.warehouseId;
      },
      methods: {
         barcodeInput(type) {
            if (type != '') {
               if (this.soussAddress == "") {
                  setTimeout(() => {
                     this.sourceFocus = false;
                     this.targetFocus = true;
                  }, 100);
         barcodeInput() {
            this.$nextTick(function(x) {
               if (this.barcode.length > 0) {
                  this.focus = true;
               }
            }
            })
         },
         AGVTasks() {
            if (this.soussAddress == "") {
@@ -50,8 +49,6 @@
                  title: "请扫描原始托盘条码",
                  type: 'error'
               })
               this.sourceFocus = true;
               this.targetFocus = false;
               return;
            }
            if (this.targetAddress == "") {
@@ -59,37 +56,28 @@
                  title: "请扫描目标托盘条码",
                  type: 'error'
               })
               this.sourceFocus = false;
               this.targetFocus = true;
               return;
            }
            var postDate = {
               MainData: {
                  soussAddress: this.soussAddress,
                  targetAddress: this.targetAddress,
                  warehouseId: this.warehouseId,
                  warehouseId:this.warehouseId,
               }
            }
            this.$u.post('/api/InboundOrder/SYMaterielGroup', postDate).then(
               res => {
                  if (res.status) {
                     this.$refs.uToast.show({
                        title: "合托成功",
                        title: "任务创建成功成功",
                        type: "success"
                     })
                     this.soussAddress = "";
                     this.targetAddress = "";
                     this.sourceFocus = true;
                     this.targetFocus = false;
                     this.barcode = "";
                  } else {
                     this.$refs.uToast.show({
                        title: res.message,
                        type: "error"
                     })
                     this.sourceFocus = true;
                     this.targetFocus = false;
                  }
               })
         },