storeBelieveInLight vor 1 Jahr
Ursprung
Commit
d4b23ddf2f

+ 47 - 16
shop/productManagementModule/addProduct.vue

@@ -225,7 +225,7 @@
225
           <view class="view-unit-input">%</view>
225
           <view class="view-unit-input">%</view>
226
         </view>
226
         </view>
227
         <!-- 商品成本价 cost-->
227
         <!-- 商品成本价 cost-->
228
-        <view class="form-item-box">
228
+       <view class="form-item-box" v-if="false">
229
           <view class="form-box-txt" :class="['mustBox']">商品成本价</view>
229
           <view class="form-box-txt" :class="['mustBox']">商品成本价</view>
230
 
230
 
231
           <uni-easyinput
231
           <uni-easyinput
@@ -239,7 +239,20 @@
239
           ></uni-easyinput>
239
           ></uni-easyinput>
240
         </view>
240
         </view>
241
         <!-- 商品售价 price-->
241
         <!-- 商品售价 price-->
242
-        <view class="form-item-box">
242
+		<view class="form-item-box">
243
+		   <view class="form-box-txt" :class="['mustBox']">商品售价</view>
244
+		
245
+		   <uni-easyinput
246
+		     type="digit"
247
+		     v-model="attrValueForm.price"
248
+		     :adjust-position="false"
249
+		     placeholder="请输入商品售价"
250
+		     class="placeholder-class"
251
+		     :clearable="false"
252
+		     @change="changeInputHandlePrice"
253
+		   ></uni-easyinput>
254
+		 </view>
255
+<!--        <view class="form-item-box">
243
           <view class="form-box-txt" :class="['mustBox']">商品售价</view>
256
           <view class="form-box-txt" :class="['mustBox']">商品售价</view>
244
           <view class="form-box--arae">
257
           <view class="form-box--arae">
245
             <view class="price-box">
258
             <view class="price-box">
@@ -249,7 +262,7 @@
249
               >
262
               >
250
             </view>
263
             </view>
251
           </view>
264
           </view>
252
-        </view>
265
+        </view> -->
253
         <!-- 商品原价 ot_price-->
266
         <!-- 商品原价 ot_price-->
254
         <view class="form-item-box">
267
         <view class="form-item-box">
255
           <view class="form-box-txt" :class="['mustBox']">商品原价</view>
268
           <view class="form-box-txt" :class="['mustBox']">商品原价</view>
@@ -470,7 +483,7 @@ export default {
470
         extension_two: null,
483
         extension_two: null,
471
         image: "", //商品图片
484
         image: "", //商品图片
472
         extension_one: this.base_commission, //分润比例(%)
485
         extension_one: this.base_commission, //分润比例(%)
473
-        cost: "", //成本价
486
+        cost: 0, //成本价
474
         price: "", //商品售价
487
         price: "", //商品售价
475
         ot_price: "", //商品原价
488
         ot_price: "", //商品原价
476
         stock: "", //商品库存
489
         stock: "", //商品库存
@@ -503,6 +516,7 @@ export default {
503
   },
516
   },
504
   onShow() {},
517
   onShow() {},
505
   methods: {
518
   methods: {
519
+	  
506
     async getProductDetailData(id) {
520
     async getProductDetailData(id) {
507
       try {
521
       try {
508
         const res = await getProductDetail(id);
522
         const res = await getProductDetail(id);
@@ -525,20 +539,23 @@ export default {
525
           });
539
           });
526
 
540
 
527
           this.attrValueForm.extension_one = attrValue.extension_one;
541
           this.attrValueForm.extension_one = attrValue.extension_one;
528
-          this.attrValueForm.cost = attrValue.cost;
542
+          this.attrValueForm.cost = attrValue.cost || 0;
529
           this.priceDefault = attrValue.price;
543
           this.priceDefault = attrValue.price;
544
+		  this.attrValueForm.price = attrValue.price || '0';
530
           this.attrValueForm.ot_price = attrValue.ot_price;
545
           this.attrValueForm.ot_price = attrValue.ot_price;
531
           this.attrValueForm.stock = attrValue.stock;
546
           this.attrValueForm.stock = attrValue.stock;
532
           this.attrValueForm.bar_code = attrValue.bar_code;
547
           this.attrValueForm.bar_code = attrValue.bar_code;
533
           this.attrValueForm.weight = attrValue.weight;
548
           this.attrValueForm.weight = attrValue.weight;
534
           this.attrValueForm.volume = attrValue.volume;
549
           this.attrValueForm.volume = attrValue.volume;
550
+		  
535
           console.log(this.fengMianImage, "this.fengMianImage99945454545");
551
           console.log(this.fengMianImage, "this.fengMianImage99945454545");
536
           this.pingtaifeilei.id = data.cate_id || 0;
552
           this.pingtaifeilei.id = data.cate_id || 0;
553
+		  
537
           console.log(this.base_commission, "this.base_commission");
554
           console.log(this.base_commission, "this.base_commission");
538
-          this.getCalcAfterPrice({
539
-            extension_one: attrValue.extension_one,
540
-            cost: this.attrValueForm.cost,
541
-          });
555
+          // this.getCalcAfterPrice({
556
+          //   extension_one: attrValue.extension_one,
557
+          //   cost: this.attrValueForm.cost,
558
+          // });
542
           if (data.image) {
559
           if (data.image) {
543
             this.fengMianImage = [];
560
             this.fengMianImage = [];
544
             let fenMian = {
561
             let fenMian = {
@@ -760,11 +777,12 @@ export default {
760
         return;
777
         return;
761
       }
778
       }
762
       if (this.attrValueForm.cost == "" || this.attrValueForm.cost == null) {
779
       if (this.attrValueForm.cost == "" || this.attrValueForm.cost == null) {
763
-        uni.showToast({
764
-          title: "请填写商品成本价",
765
-          icon: "none",
766
-        });
767
-        return;
780
+		  this.attrValueForm.cost  = 0
781
+        // uni.showToast({
782
+        //   title: "请填写商品成本价",
783
+        //   icon: "none",
784
+        // });
785
+        // return;
768
       }
786
       }
769
       if (this.attrValueForm.price == "" || this.attrValueForm.price == null) {
787
       if (this.attrValueForm.price == "" || this.attrValueForm.price == null) {
770
         uni.showToast({
788
         uni.showToast({
@@ -866,6 +884,19 @@ export default {
866
       console.log(val, "分润设置选择");
884
       console.log(val, "分润设置选择");
867
       this.attrValueForm.extension_one = this.base_commission;
885
       this.attrValueForm.extension_one = this.base_commission;
868
     },
886
     },
887
+	//成本价
888
+	changeInputHandlePrice(e){
889
+		let value = e;
890
+		const _this = this;
891
+		if (value == "" || value == null || value == undefined ) {
892
+		  uni.showToast({
893
+		    title: "请输入正确的金额",
894
+		    icon: "none",
895
+		  });
896
+		}
897
+		const formatted = this.limitPriceFormat(value);
898
+		_this.attrValueForm.price = formatted;
899
+	},
869
     changeInputHandle(ev, its, item, idx) {
900
     changeInputHandle(ev, its, item, idx) {
870
       if (its.props == "cost" || its.props == "extension_one") {
901
       if (its.props == "cost" || its.props == "extension_one") {
871
         let modulesData =
902
         let modulesData =
@@ -915,7 +946,7 @@ export default {
915
         cost: this.attrValueForm.cost,
946
         cost: this.attrValueForm.cost,
916
       };
947
       };
917
       console.log("changeInputHandleExtensionOne==>>>", data);
948
       console.log("changeInputHandleExtensionOne==>>>", data);
918
-      this.getCalcAfterPrice(data);
949
+      // this.getCalcAfterPrice(data);
919
     },
950
     },
920
     getCalcAfterPrice(data) {
951
     getCalcAfterPrice(data) {
921
       let bili = accDiv(data.extension_one, 100); //比例
952
       let bili = accDiv(data.extension_one, 100); //比例
@@ -957,7 +988,7 @@ export default {
957
         extension_one: this.attrValueForm.extension_one,
988
         extension_one: this.attrValueForm.extension_one,
958
         cost: this.attrValueForm.cost || "0",
989
         cost: this.attrValueForm.cost || "0",
959
       };
990
       };
960
-      this.getCalcAfterPrice(data);
991
+      // this.getCalcAfterPrice(data);
961
     },
992
     },
962
     /**
993
     /**
963
      * 商品原价
994
      * 商品原价

+ 1 - 1
shop/productManagementModule/productManagement.vue

@@ -336,7 +336,7 @@ export default {
336
     },
336
     },
337
     onHandleAddProduct() {
337
     onHandleAddProduct() {
338
       uni.redirectTo({
338
       uni.redirectTo({
339
-        url: `./addProduct`,
339
+        url: `./addProduct?clickType=create`,
340
       });
340
       });
341
     },
341
     },
342
     async getGoodsTabData() {
342
     async getGoodsTabData() {