| | |
| | | </el-input-number> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <!-- ===================== æ°å¢ï¼ä¾åºåç¼ç ï¼å®æ¶æç´¢ä¸æï¼ ===================== --> |
| | | <el-form ref="form" :model="form" label-width="90px"> |
| | | <el-form-item label="ä¾åºåç¼ç :"> |
| | | <el-select |
| | | v-model="supplierCode" |
| | | filterable |
| | | remote |
| | | reserve-keyword |
| | | placeholder="请è¾å
¥/éæ©ä¾åºåç¼ç " |
| | | :remote-method="remoteSearchSupplier" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in supplierList" |
| | | :key="item" |
| | | :label="item" |
| | | :value="item" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <!-- ======================================================================== --> |
| | | |
| | | </template> |
| | | <template #footer> |
| | | <div> |
| | | <!-- æ·»å loadingç¶æådisabled屿§ --> |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | |
| | | show: false, |
| | | locationTypes: [], |
| | | locationType: "", |
| | | // æ°å¢æäº¤ç¶ææ è¯ |
| | | isSubmitting: false |
| | | isSubmitting: false, |
| | | // ================= æ°å¢ ================= |
| | | supplierCode: '', // ä¾åºåç¼ç ç»å® |
| | | supplierList: [] // 䏿å表 |
| | | // ======================================= |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | 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}`, {}, 'æ°æ®å¤çä¸...') |
| | | // ===================== æ¹é æ¥å£ï¼å¸¦ä¸ supplierCode ===================== |
| | | this.http.post( |
| | | `/api/Task/PalletOutboundTask?num=${this.num}&locationType=${this.locationType}&SupplierCode=${this.supplierCode || ''}`, |
| | | {}, 'æ°æ®å¤çä¸...') |
| | | // ==================================================================== |
| | | .then((x) => { |
| | | if (!x.status) { |
| | | this.$message.error(x.message) |
| | |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | // æè·è¯·æ±å¼å¸¸ï¼æç¤ºç¨æ· |
| | | this.$message.error('请æ±å¤±è´¥ï¼è¯·ç¨åéè¯'); |
| | | console.error('æäº¤å¤±è´¥:', error); |
| | | }) |
| | | .finally(() => { |
| | | // 3. 请æ±å®æï¼æå/失败ï¼åéç½®æäº¤ç¶æ |
| | | this.isSubmitting = false; |
| | | }); |
| | | }) |
| | |
| | | this.locationTypes = x.data; |
| | | }) |
| | | }, |
| | | |
| | | remoteSearchSupplier(keyword) { |
| | | if (!keyword) { |
| | | this.supplierList = []; |
| | | return; |
| | | } |
| | | // è°ç¨åç«¯å®æ¶æç´¢æ¥å£ |
| | | this.http.get(`/api/Task/SearchSupplierCode?keyword=${keyword}`) |
| | | .then(res => { |
| | | if (res.status) { |
| | | this.supplierList = res.data || []; |
| | | } |
| | | }) |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |