|
|
@@ -215,8 +215,8 @@
|
|
|
</el-container>
|
|
|
|
|
|
<div slot="footer">
|
|
|
- <el-button type="primary" @click="confirm">确定</el-button>
|
|
|
- <el-button @click="cancel">关闭</el-button>
|
|
|
+ <el-button type="primary" :loading="confirmLoading" @click="confirm">确定</el-button>
|
|
|
+ <el-button :disabled="confirmLoading" @click="cancel">关闭</el-button>
|
|
|
</div>
|
|
|
</ele-modal>
|
|
|
</template>
|
|
|
@@ -261,6 +261,7 @@
|
|
|
}
|
|
|
],
|
|
|
visible: false,
|
|
|
+ confirmLoading: false,
|
|
|
tableData: [],
|
|
|
total: 0,
|
|
|
categoryLevelId: '',
|
|
|
@@ -780,6 +781,7 @@
|
|
|
open(val) {
|
|
|
let that = this;
|
|
|
this.productLists = val || [];
|
|
|
+ this.confirmLoading = false;
|
|
|
this.visible = true;
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.treeList.getTreeData().then((data) => {
|
|
|
@@ -809,43 +811,48 @@
|
|
|
}
|
|
|
console.log(this.selectionList);
|
|
|
let data = null;
|
|
|
- if (this.dimension == 3) {
|
|
|
- data = await storageApi.getHierarchyList({
|
|
|
- ids: this.selectionList.map((item) => item.id).join(','),
|
|
|
- type: this.dimension,
|
|
|
- warehouseId: this.searchForm.warehouseId,
|
|
|
- });
|
|
|
- } else if (this.dimension == 2) {
|
|
|
- data = await storageApi.getHierarchyFifo({
|
|
|
- type: this.dimension,
|
|
|
- ids: this.selectionList.map((item) => item.id),
|
|
|
- builders: this.selectionList.map((item) => {
|
|
|
- return {
|
|
|
- warehouseId: this.searchForm.warehouseId,
|
|
|
- categoryId: item.categoryId,
|
|
|
- batchNo: item.batchNo,
|
|
|
- // 历史数据保持空值,由后端按外部批次号兼容匹配
|
|
|
- systemBatchNo: item.systemBatchNo || '',
|
|
|
- num: item.outboundNum,
|
|
|
- id: item.id
|
|
|
- };
|
|
|
- })
|
|
|
- });
|
|
|
- } else if (this.dimension == 1) {
|
|
|
- data = await storageApi.getHierarchyFifo({
|
|
|
- type: this.dimension,
|
|
|
- builders: this.selectionList.map((item) => {
|
|
|
- return {
|
|
|
- warehouseId: this.searchForm.warehouseId,
|
|
|
- categoryId: item.categoryId,
|
|
|
- num: item.outboundNum
|
|
|
- };
|
|
|
- })
|
|
|
- });
|
|
|
+ this.confirmLoading = true;
|
|
|
+ try {
|
|
|
+ if (this.dimension == 3) {
|
|
|
+ data = await storageApi.getHierarchyList({
|
|
|
+ ids: this.selectionList.map((item) => item.id).join(','),
|
|
|
+ type: this.dimension,
|
|
|
+ warehouseId: this.searchForm.warehouseId,
|
|
|
+ });
|
|
|
+ } else if (this.dimension == 2) {
|
|
|
+ data = await storageApi.getHierarchyFifo({
|
|
|
+ type: this.dimension,
|
|
|
+ ids: this.selectionList.map((item) => item.id),
|
|
|
+ builders: this.selectionList.map((item) => {
|
|
|
+ return {
|
|
|
+ warehouseId: this.searchForm.warehouseId,
|
|
|
+ categoryId: item.categoryId,
|
|
|
+ batchNo: item.batchNo,
|
|
|
+ // 历史数据保持空值,由后端按外部批次号兼容匹配
|
|
|
+ systemBatchNo: item.systemBatchNo || '',
|
|
|
+ num: item.outboundNum,
|
|
|
+ id: item.id
|
|
|
+ };
|
|
|
+ })
|
|
|
+ });
|
|
|
+ } else if (this.dimension == 1) {
|
|
|
+ data = await storageApi.getHierarchyFifo({
|
|
|
+ type: this.dimension,
|
|
|
+ builders: this.selectionList.map((item) => {
|
|
|
+ return {
|
|
|
+ warehouseId: this.searchForm.warehouseId,
|
|
|
+ categoryId: item.categoryId,
|
|
|
+ num: item.outboundNum
|
|
|
+ };
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }
|
|
|
+ console.log('data-------------------', data);
|
|
|
+ this.$emit('detailData', data, this.dimension);
|
|
|
+ this.cancel();
|
|
|
+ } finally {
|
|
|
+ this.confirmLoading = false;
|
|
|
}
|
|
|
- console.log('data-------------------', data);
|
|
|
- this.$emit('detailData', data, this.dimension);
|
|
|
- this.cancel();
|
|
|
},
|
|
|
cancel() {
|
|
|
this.selectionList = [];
|