647556386
2026-03-31 6f0ffcf4a6e75ac3a76c6cfd75e02de3a17d46e3
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/outbound/extend/EmptyTrayOutbound.vue
@@ -1,29 +1,48 @@
<template>
  <vol-box v-model="show" title="空托出库" :width="400" :height="600">
  <vol-box v-model="show" title="空托出库" :width="800" :height="1200">
    <template #content>
      <el-form ref="form" :model="form" label-width="90px">
        <el-form-item label="出库区域:">
          <el-select v-model="locationType" placeholder="请选择出库区域">
            <el-option v-for="item in locationTypes" :key="item.locationType" :label="item.locationTypeDesc.toString()" :value="item.locationType">
            <el-option
              v-for="item in locationTypes"
              :key="item.locationType"
              :label="item.locationTypeDesc.toString()"
              :value="item.locationType">
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <el-form ref="form" :model="form" label-width="90px">
        <el-form-item label="出库数量:">
          <el-select v-model="num" placeholder="请选择出库数量">
            <el-option v-for="item in 6" :key="item" :label="item.toString()" :value="item">
            </el-option>
          </el-select>
          <el-input-number
            v-model="num"
            :min="1"
            :max="999"
            :controls="true"
            placeholder="请选择出库数量"
            style="width: 100%;">
          </el-input-number>
        </el-form-item>
      </el-form>
    </template>
    <template #footer>
      <div>
        <el-button type="danger" size="small" plain @click="submit">
        <!-- æ·»åŠ loading状态和disabled属性 -->
        <el-button
          type="danger"
          size="small"
          plain
          @click="submit"
          :loading="isSubmitting"
          :disabled="isSubmitting">
          <i class="el-icon-check">确认</i>
        </el-button>
        <el-button size="small" type="primary" plain @click="() => { this.show = false }">
        <el-button
          size="small"
          type="primary"
          plain
          @click="() => { this.show = false }">
          <i class="el-icon-close">关闭</i>
        </el-button>
      </div>
@@ -42,7 +61,9 @@
      num: 1,
      show: false,
      locationTypes: [],
      locationType:"",
      locationType: "",
      // æ–°å¢žæäº¤çŠ¶æ€æ ‡è¯†
      isSubmitting: false
    }
  },
  methods: {
@@ -51,6 +72,15 @@
      this.getData();
    },
    submit() {
      // 1. éªŒè¯å¿…填项
      if (!this.locationType) {
        this.$message.warning('请选择出库区域');
        return;
      }
      // 2. è®¾ç½®æäº¤çŠ¶æ€ä¸ºtrue,禁用按钮
      this.isSubmitting = true;
      this.$emit('parentCall', ($vue) => {
        this.http.post(`/api/Task/PalletOutboundTask?num=${this.num}&locationType=${this.locationType}`, {}, '数据处理中...')
          .then((x) => {
@@ -62,15 +92,23 @@
              $vue.refresh();
            }
          })
          .catch((error) => {
            // æ•获请求异常,提示用户
            this.$message.error('请求失败,请稍后重试');
            console.error('提交失败:', error);
          })
          .finally(() => {
            // 3. è¯·æ±‚完成(成功/失败)后重置提交状态
            this.isSubmitting = false;
          });
      })
    },
    getData() {
      this.http.post("api/LocationInfo/GetLocationTypes",null, "查询中")
      this.http.post("api/LocationInfo/GetLocationTypes", null, "查询中")
        .then((x) => {
          this.locationTypes = x.data;
        })
    },
  }
}
</script>
</script>