Browse Source

loading

master
han\hanst 3 months ago
parent
commit
eaf9fa363d
  1. 50
      src/views/modules/other-transaction/other-inbound.vue
  2. 43
      src/views/modules/other-transaction/other-outbound.vue

50
src/views/modules/other-transaction/other-inbound.vue

@ -119,10 +119,11 @@
<!-- 底部操作按钮 -->
<div class="bottom-actions" v-if="scannedItems.length > 0">
<button class="action-btn primary" @click="confirmInbound">
确认其它入库
<button class="action-btn primary" @click="confirmInbound" :disabled="loading">
<i v-if="loading" class="el-icon-loading"></i>
{{ loading ? '处理中...' : '确认其它入库' }}
</button>
<button class="action-btn secondary" style="margin-left: 10px;" @click="cancelProcess">
<button class="action-btn secondary" style="margin-left: 10px;" @click="cancelProcess" :disabled="loading">
取消
</button>
</div>
@ -144,7 +145,8 @@ export default {
targetLocationId: ''
},
scannedItems: [],
site: localStorage.getItem('site') || 'SITE01'
site: localStorage.getItem('site'),
loading: false //
};
},
methods: {
@ -240,7 +242,11 @@ export default {
this.$message.error('HandlingUnit站点不匹配');
return;
}
// HU
if (huInfo.inStockFlag !== 'X') {
this.$message.error(unitId+'不是未入库状态');
return;
}
//
this.scannedItems.push({
id: Date.now(),
@ -321,6 +327,9 @@ export default {
scannedItems: this.scannedItems
};
//
this.loading = true;
// API
confirmOtherInbound(params).then(({ data }) => {
if (data && data.code === 0) {
@ -330,9 +339,10 @@ export default {
duration: 3000
});
//
//
setTimeout(() => {
this.$router.push({ path: '/otherinout' });
this.clearFormData();
this.focusScanInput();
}, 1000);
} else {
this.$message.error(data.msg || '其它入库失败');
@ -340,6 +350,9 @@ export default {
}).catch(error => {
console.error('其它入库失败:', error);
this.$message.error('其它入库失败,请重试');
}).finally(() => {
//
this.loading = false;
});
},
@ -363,6 +376,29 @@ export default {
//
initFormData() {
//
},
//
clearFormData() {
this.scanCode = '';
this.isRemoveMode = false;
this.inboundForm = {
inboundReason: '',
targetLocationId: ''
};
this.scannedItems = [];
this.loading = false; //
console.log('表单数据已清空');
},
//
focusScanInput() {
this.$nextTick(() => {
if (this.$refs.scanInput) {
this.$refs.scanInput.focus();
console.log('扫描框已聚焦');
}
});
}
},

43
src/views/modules/other-transaction/other-outbound.vue

@ -109,10 +109,11 @@
<!-- 底部操作按钮 -->
<div class="bottom-actions" v-if="scannedItems.length > 0">
<button class="action-btn primary" @click="confirmOutbound">
确认其它出库
<button class="action-btn primary" @click="confirmOutbound" :disabled="loading">
<i v-if="loading" class="el-icon-loading"></i>
{{ loading ? '处理中...' : '确认其它出库' }}
</button>
<button class="action-btn secondary" style="margin-left: 10px;" @click="cancelProcess">
<button class="action-btn secondary" style="margin-left: 10px;" @click="cancelProcess" :disabled="loading">
取消
</button>
</div>
@ -134,7 +135,8 @@ export default {
outboundReason: ''
},
scannedItems: [],
site: localStorage.getItem('site') || 'SITE01'
site: localStorage.getItem('site'),
loading: false //
};
},
methods: {
@ -245,6 +247,9 @@ export default {
scannedItems: this.scannedItems
};
//
this.loading = true;
// API
confirmOtherOutbound(params).then(({ data }) => {
if (data && data.code === 0) {
@ -254,9 +259,10 @@ export default {
duration: 3000
});
//
//
setTimeout(() => {
this.$router.push({ path: '/otherinout' });
this.clearFormData();
this.focusScanInput();
}, 1000);
} else {
this.$message.error(data.msg || '其它出库失败');
@ -264,6 +270,9 @@ export default {
}).catch(error => {
console.error('其它出库失败:', error);
this.$message.error('其它出库失败,请重试');
}).finally(() => {
//
this.loading = false;
});
},
@ -287,6 +296,28 @@ export default {
//
initFormData() {
//
},
//
clearFormData() {
this.scanCode = '';
this.isRemoveMode = false;
this.outboundForm = {
outboundReason: ''
};
this.scannedItems = [];
this.loading = false; //
console.log('表单数据已清空');
},
//
focusScanInput() {
this.$nextTick(() => {
if (this.$refs.scanInput) {
this.$refs.scanInput.focus();
console.log('扫描框已聚焦');
}
});
}
},
mounted() {

Loading…
Cancel
Save