storeBelieveInLight 1 rok temu
rodzic
commit
d4b23ddf2f

+ 47 - 16
shop/productManagementModule/addProduct.vue

@@ -225,7 +225,7 @@
225 225
           <view class="view-unit-input">%</view>
226 226
         </view>
227 227
         <!-- 商品成本价 cost-->
228
-        <view class="form-item-box">
228
+       <view class="form-item-box" v-if="false">
229 229
           <view class="form-box-txt" :class="['mustBox']">商品成本价</view>
230 230
 
231 231
           <uni-easyinput
@@ -239,7 +239,20 @@
239 239
           ></uni-easyinput>
240 240
         </view>
241 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 256
           <view class="form-box-txt" :class="['mustBox']">商品售价</view>
244 257
           <view class="form-box--arae">
245 258
             <view class="price-box">
@@ -249,7 +262,7 @@
249 262
               >
250 263
             </view>
251 264
           </view>
252
-        </view>
265
+        </view> -->
253 266
         <!-- 商品原价 ot_price-->
254 267
         <view class="form-item-box">
255 268
           <view class="form-box-txt" :class="['mustBox']">商品原价</view>
@@ -470,7 +483,7 @@ export default {
470 483
         extension_two: null,
471 484
         image: "", //商品图片
472 485
         extension_one: this.base_commission, //分润比例(%)
473
-        cost: "", //成本价
486
+        cost: 0, //成本价
474 487
         price: "", //商品售价
475 488
         ot_price: "", //商品原价
476 489
         stock: "", //商品库存
@@ -503,6 +516,7 @@ export default {
503 516
   },
504 517
   onShow() {},
505 518
   methods: {
519
+	  
506 520
     async getProductDetailData(id) {
507 521
       try {
508 522
         const res = await getProductDetail(id);
@@ -525,20 +539,23 @@ export default {
525 539
           });
526 540
 
527 541
           this.attrValueForm.extension_one = attrValue.extension_one;
528
-          this.attrValueForm.cost = attrValue.cost;
542
+          this.attrValueForm.cost = attrValue.cost || 0;
529 543
           this.priceDefault = attrValue.price;
544
+		  this.attrValueForm.price = attrValue.price || '0';
530 545
           this.attrValueForm.ot_price = attrValue.ot_price;
531 546
           this.attrValueForm.stock = attrValue.stock;
532 547
           this.attrValueForm.bar_code = attrValue.bar_code;
533 548
           this.attrValueForm.weight = attrValue.weight;
534 549
           this.attrValueForm.volume = attrValue.volume;
550
+		  
535 551
           console.log(this.fengMianImage, "this.fengMianImage99945454545");
536 552
           this.pingtaifeilei.id = data.cate_id || 0;
553
+		  
537 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 559
           if (data.image) {
543 560
             this.fengMianImage = [];
544 561
             let fenMian = {
@@ -760,11 +777,12 @@ export default {
760 777
         return;
761 778
       }
762 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 787
       if (this.attrValueForm.price == "" || this.attrValueForm.price == null) {
770 788
         uni.showToast({
@@ -866,6 +884,19 @@ export default {
866 884
       console.log(val, "分润设置选择");
867 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 900
     changeInputHandle(ev, its, item, idx) {
870 901
       if (its.props == "cost" || its.props == "extension_one") {
871 902
         let modulesData =
@@ -915,7 +946,7 @@ export default {
915 946
         cost: this.attrValueForm.cost,
916 947
       };
917 948
       console.log("changeInputHandleExtensionOne==>>>", data);
918
-      this.getCalcAfterPrice(data);
949
+      // this.getCalcAfterPrice(data);
919 950
     },
920 951
     getCalcAfterPrice(data) {
921 952
       let bili = accDiv(data.extension_one, 100); //比例
@@ -957,7 +988,7 @@ export default {
957 988
         extension_one: this.attrValueForm.extension_one,
958 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 337
     onHandleAddProduct() {
338 338
       uni.redirectTo({
339
-        url: `./addProduct`,
339
+        url: `./addProduct?clickType=create`,
340 340
       });
341 341
     },
342 342
     async getGoodsTabData() {