fix: 增加立减金库存
This commit is contained in:
parent
c8c580c4bb
commit
c31f1f697f
|
@ -75,8 +75,8 @@ const tableColumn = [
|
|||
},
|
||||
{
|
||||
title: "库存数量",
|
||||
name: "quantity",
|
||||
prop: "quantity",
|
||||
name: "stock",
|
||||
prop: "stock",
|
||||
type: "normal",
|
||||
width: "auto",
|
||||
},
|
||||
|
|
|
@ -36,6 +36,7 @@ const UseGoodsScopePop = forwardRef((props, ref) => {
|
|||
let form_model = productEl.current.getFormModel();
|
||||
form_model.upstream = "直连天下";
|
||||
form_model.type = 1;
|
||||
form_model.stock = form_model.quantity;
|
||||
form_model.all_budget = mulNum(
|
||||
Number(form_model.contract_price),
|
||||
Number(form_model.quantity)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import { divNum } from "./number";
|
||||
// 立减金对象重构
|
||||
export const knockGoldFun = (item) => {
|
||||
console.log("库存", item.stock);
|
||||
let table_obj = {};
|
||||
table_obj.type = 2; // 类型
|
||||
table_obj.upstream = String(item.channel) === "1" ? "支付宝" : "微信"; // 上游平台
|
||||
|
@ -10,6 +12,9 @@ export const knockGoldFun = (item) => {
|
|||
table_obj.official_price = item.reduce_amount; // 官方价
|
||||
table_obj.contract_price = item.price; // 合同价格
|
||||
table_obj.quantity = item.total_stock; // 库存数量
|
||||
table_obj.stock = item.stock
|
||||
? item.stock
|
||||
: divNum(item.all_budget, item.reduce_amount); // 剩余库存数量
|
||||
table_obj.channel_activity_id = item.channel_activity_id; // 批次号
|
||||
table_obj.all_budget = Number(item.all_budget); // 总预算
|
||||
table_obj.effectDate = `${item.time_limit.effect_time.start_time} 至 ${item.time_limit.effect_time.end_time}`; // 有效时间段
|
||||
|
|
Loading…
Reference in New Issue