Commit 40ae6512 by liangjianmin

feat(consignmentInventory): add handling for empty original step price data

- Introduced a new flag to track if the original step price data returned from the backend is empty.
- Updated the input handling logic to allow unlimited order quantities when the original step price data is empty.
- Enhanced data retrieval logic to set the new flag based on the response from the API.
parent 6fc12aed
......@@ -415,6 +415,7 @@
priceData: [],//修改价格数据
message: {},
skuOriginalStepPriceData: [],
isOriginalStepPriceEmpty: false, // 后台返回的阶梯价数据是否为空
goods_id: '',
stock: 0,
tableData: [],
......@@ -496,6 +497,8 @@
* 监听起订量
*/
handleInput(index) {
// 后台返回数据为空时,不限制起订量
if (this.isOriginalStepPriceEmpty) return;
var val = Number(this.skuOriginalStepPriceData[index].purchases) || 0;
var max = Number(this.stock) || 0;
if (val > max) {
......@@ -844,6 +847,8 @@
this.$http('GET', "/api/sku/getSkuOriginalStepPrice", { goods_id: goods_id }).then(res => {
if (res.code == 0) {
this.skuOriginalStepPriceData = res.data.data;
// 标记后台返回的阶梯价数据是否为空
this.isOriginalStepPriceEmpty = !res.data.data || res.data.data.length === 0;
this.goods_id = goods_id;
} else {
this.$message({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment