647556386
2026-01-27 1378fc4cd7abc24ed3a982e09437c2c8a74e9f2f
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/outbound/extend/EmptyTrayOutbound.vue
@@ -4,7 +4,10 @@
      <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()"
            <el-option
              v-for="item in locationTypes"
              :key="item.locationType"
              :label="item.locationTypeDesc.toString()"
              :value="item.locationType">
            </el-option>
          </el-select>
@@ -12,17 +15,34 @@
      </el-form>
      <el-form ref="form" :model="form" label-width="90px">
        <el-form-item label="出库数量:">
          <el-input-number v-model="num" :min="1" :max="999" :controls="true" placeholder="请选择出库数量"
            style="width: 100%;"></el-input-number>
          <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,6 +62,8 @@
      show: false,
      locationTypes: [],
      locationType: "",
      // æ–°å¢žæäº¤çŠ¶æ€æ ‡è¯†
      isSubmitting: false
    }
  },
  methods: {
@@ -50,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) => {
@@ -61,9 +92,17 @@
              $vue.refresh();
            }
          })
          .catch((error) => {
            // æ•获请求异常,提示用户
            this.$message.error('请求失败,请稍后重试');
            console.error('提交失败:', error);
          })
          .finally(() => {
            // 3. è¯·æ±‚完成(成功/失败)后重置提交状态
            this.isSubmitting = false;
          });
      })
    },
    getData() {
      this.http.post("api/LocationInfo/GetLocationTypes", null, "查询中")
        .then((x) => {
@@ -72,4 +111,4 @@
    },
  }
}
</script>
</script>