|
|
@@ -211,7 +211,7 @@
|
|
211
|
211
|
:adjust-position="false"
|
|
212
|
212
|
placeholder="请输入分润比例"
|
|
213
|
213
|
class="placeholder-class"
|
|
214
|
|
- @input="changeInputHandleExtensionOne"
|
|
|
214
|
+ @change="changeInputHandleExtensionOne"
|
|
215
|
215
|
:clearable="false"
|
|
216
|
216
|
></uni-easyinput>
|
|
217
|
217
|
<view class="view-unit-input">%</view>
|
|
|
@@ -227,7 +227,7 @@
|
|
227
|
227
|
placeholder="请输入商品成本价"
|
|
228
|
228
|
class="placeholder-class"
|
|
229
|
229
|
:clearable="false"
|
|
230
|
|
- @input="changeInputHandleCost"
|
|
|
230
|
+ @change="changeInputHandleCost"
|
|
231
|
231
|
></uni-easyinput>
|
|
232
|
232
|
</view>
|
|
233
|
233
|
<!-- 商品售价 price-->
|
|
|
@@ -473,8 +473,8 @@ export default {
|
|
473
|
473
|
async onLoad(e) {
|
|
474
|
474
|
this.product_id = e.product_id || "";
|
|
475
|
475
|
this.clickType = e.clickType;
|
|
476
|
|
- await this.getGoodsClassCategoryData();
|
|
477
|
|
- await this.getMerchantProfit();
|
|
|
476
|
+ await this.getGoodsClassCategoryData();
|
|
|
477
|
+ await this.getMerchantProfit();
|
|
478
|
478
|
if (this.clickType == "updated" && this.product_id) {
|
|
479
|
479
|
uni.showLoading({
|
|
480
|
480
|
title: "加载中",
|
|
|
@@ -482,7 +482,7 @@ export default {
|
|
482
|
482
|
});
|
|
483
|
483
|
await this.getProductDetailData(this.product_id);
|
|
484
|
484
|
}
|
|
485
|
|
- await this.initData();
|
|
|
485
|
+ await this.initData();
|
|
486
|
486
|
},
|
|
487
|
487
|
onShow() {},
|
|
488
|
488
|
methods: {
|
|
|
@@ -518,11 +518,11 @@ export default {
|
|
518
|
518
|
dataArr.find((item) => item.value == data.cate_id) || {};
|
|
519
|
519
|
this.pingtaifeilei.name = findObj.label || "";
|
|
520
|
520
|
this.pingtaifeilei.id = findObj.value || data.cate_id || "";
|
|
521
|
|
- console.log(this.base_commission,"this.base_commission")
|
|
|
521
|
+ console.log(this.base_commission, "this.base_commission");
|
|
522
|
522
|
this.getCalcAfterPrice({
|
|
523
|
|
- extension_one:attrValue.extension_one,
|
|
524
|
|
- cost:this.attrValueForm.cost
|
|
525
|
|
- })
|
|
|
523
|
+ extension_one: attrValue.extension_one,
|
|
|
524
|
+ cost: this.attrValueForm.cost,
|
|
|
525
|
+ });
|
|
526
|
526
|
if (data.image) {
|
|
527
|
527
|
this.fengMianImage = [];
|
|
528
|
528
|
let fenMian = {
|
|
|
@@ -554,13 +554,12 @@ export default {
|
|
554
|
554
|
await this.getBrandSelectData();
|
|
555
|
555
|
await this.getShippingListData();
|
|
556
|
556
|
await this.getGoodsClassData();
|
|
557
|
|
-
|
|
|
557
|
+
|
|
558
|
558
|
await this.productCon();
|
|
559
|
559
|
await this.getMerInfo();
|
|
560
|
|
-
|
|
561
|
560
|
},
|
|
562
|
561
|
convertToFlatArray(data) {
|
|
563
|
|
- return Array.isArray(data)
|
|
|
562
|
+ return Array.isArray(data)
|
|
564
|
563
|
? data.flatMap((node) => {
|
|
565
|
564
|
const { value, label, children = [] } = node;
|
|
566
|
565
|
if (typeof value !== "number" || typeof label !== "string")
|
|
|
@@ -796,11 +795,11 @@ export default {
|
|
796
|
795
|
uni.showLoading({
|
|
797
|
796
|
title: "数据提交中...",
|
|
798
|
797
|
});
|
|
799
|
|
- let req = this.clickType === "updated" ? updateProduct : addProduct
|
|
800
|
|
- let product_id = this.clickType === "updated"? this.product_id : ""
|
|
|
798
|
+ let req = this.clickType === "updated" ? updateProduct : addProduct;
|
|
|
799
|
+ let product_id = this.clickType === "updated" ? this.product_id : "";
|
|
801
|
800
|
|
|
802
|
801
|
try {
|
|
803
|
|
- const res = await req(product_id,newParams);
|
|
|
802
|
+ const res = await req(product_id, newParams);
|
|
804
|
803
|
if (res.data.status == 200) {
|
|
805
|
804
|
uni.showToast({
|
|
806
|
805
|
title: "数据提交成功",
|
|
|
@@ -885,11 +884,13 @@ export default {
|
|
885
|
884
|
this.attrValueForm.extension_one = this.base_commission;
|
|
886
|
885
|
});
|
|
887
|
886
|
}
|
|
888
|
|
-
|
|
|
887
|
+ this.attrValueForm.extension_one =
|
|
|
888
|
+ value < 5 ? "5" : value > 100 ? this.base_commission : value;
|
|
889
|
889
|
let data = {
|
|
890
|
890
|
extension_one: this.attrValueForm.extension_one,
|
|
891
|
891
|
cost: this.attrValueForm.cost,
|
|
892
|
892
|
};
|
|
|
893
|
+ console.log("changeInputHandleExtensionOne==>>>", data);
|
|
893
|
894
|
this.getCalcAfterPrice(data);
|
|
894
|
895
|
},
|
|
895
|
896
|
getCalcAfterPrice(data) {
|
|
|
@@ -899,7 +900,12 @@ export default {
|
|
899
|
900
|
console.log(gong_mer_profit, "利润");
|
|
900
|
901
|
let gong_market_price = accAdd(data.cost, gong_mer_profit); //加入利润后的价格
|
|
901
|
902
|
let plate_mer_profit = gong_mer_profit;
|
|
902
|
|
- console.log(gong_market_price, "加入利润后的价格", plate_mer_profit);
|
|
|
903
|
+ console.log(
|
|
|
904
|
+ gong_market_price,
|
|
|
905
|
+ "加入利润后的价格",
|
|
|
906
|
+ "利润==>>>",
|
|
|
907
|
+ plate_mer_profit
|
|
|
908
|
+ );
|
|
903
|
909
|
this.attrValueForm.price = gong_market_price;
|
|
904
|
910
|
this.priceDefault = gong_market_price;
|
|
905
|
911
|
this.attrValueForm.gong_mer_profit = gong_mer_profit;
|