feat: #10000 数据加载显示优化

This commit is contained in:
赵世界 2022-09-19 13:21:36 +08:00
parent 5f3c64ed88
commit c11353f4d9
2 changed files with 28 additions and 6 deletions

View File

@ -64,7 +64,8 @@
<el-button type="primary" plain @click="update()">上新</el-button>
<el-upload ref="myUpload" action="/api/inventory/goods_skus" :multiple="false"
name="inventoryFile" :show-file-list="false" :on-success="inventorySuccess"
:on-error="inventoryError" style="display:inline-block;margin: 0 10px 0 10px;">
:before-upload="beforeInventory" :on-error="inventoryError"
style="display:inline-block;margin: 0 10px 0 10px;">
<el-button type="primary" plain>盘点导入</el-button>
</el-upload>
<el-button type="primary" plain @click="addNewgoods">新建商品</el-button>
@ -491,6 +492,7 @@ export default {
publicId: "", // id
reference_price: "", //
reserve: "", //
loadingModule: ""
};
},
methods: {
@ -907,17 +909,27 @@ export default {
this.brand = res.data.data;
});
},
beforeInventory() {
this.loadingModule = this.$loading({
lock: true,
text: '盘点导入中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
},
inventorySuccess(response) {
this.$message({
message: response.message,
type: "success",
});
this.loadingModule.close();
},
inventoryError(err) {
this.$message({
message: res.errorMessage,
message: err.errorMessage,
type: "error",
});
this.loadingModule.close();
}
},

View File

@ -32,7 +32,6 @@
<el-button type="success" :disabled="true">{{
scope.row.status
}}</el-button>
<el-button @click="download(scope.row)">下载商品</el-button>
</div>
</template>
</el-table-column>
@ -148,8 +147,18 @@ export default {
//
download(row) {
const loading = this.$loading({
lock: true,
text: row.name + ' 店铺商品下载中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
downloadGoods(row.id).then((res) => {
loading.close();
this.$message({
type: "success",
message: res.data.message,
});
});
},
},
@ -161,6 +170,7 @@ a {
text-decoration: none;
color: white;
}
.block {
margin-top: 20px;
}