xialei hace 1 año
padre
commit
fe5f3e9102
Se han modificado 1 ficheros con 24 adiciones y 25 borrados
  1. 24 25
      src/views/product/addProduct/index.vue

+ 24 - 25
src/views/product/addProduct/index.vue

@@ -450,7 +450,6 @@
450
                         <el-input v-model="scope.row.pension_num" placeholder="请输入" type="number" :min="0" :max="100" class="priceBox" @input="handleChangePension" />
450
                         <el-input v-model="scope.row.pension_num" placeholder="请输入" type="number" :min="0" :max="100" class="priceBox" @input="handleChangePension" />
451
                       </template>
451
                       </template>
452
                     </el-table-column>
452
                     </el-table-column>
453
-
454
                   </template>
453
                   </template>
455
 
454
 
456
                   <template>
455
                   <template>
@@ -481,14 +480,14 @@
481
                 </template>
480
                 </template>
482
 
481
 
483
                 <template v-if="this.Spu_id==null||this.Spu_id==''||this.Spu_id==undefined">
482
                 <template v-if="this.Spu_id==null||this.Spu_id==''||this.Spu_id==undefined">
484
-                  <el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="120">
483
+                  <el-table-column v-if="formThead[iii].title != '成本价格'" v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="120">
485
                     <template slot-scope="scope">
484
                     <template slot-scope="scope">
486
-                      <el-input @input="handleInput(scope.row,formThead[iii].title)" v-model="scope.row[iii]" :disabled="formThead[iii].title==='销售价格'?'text':disabled" :type="formThead[iii].title==='商品编号'?'text':'number'" :min="0" class="priceBox" placeholder="请输入" />
485
+                      <el-input @input="handleInput(scope.row,formThead[iii].title)" v-model="scope.row[iii]"  :type="formThead[iii].title==='商品编号'?'text':'number'" :min="0" class="priceBox" placeholder="请输入" />
487
                     </template>
486
                     </template>
488
                   </el-table-column>
487
                   </el-table-column>
489
                 </template>
488
                 </template>
490
 
489
 
491
-                <template v-else>
490
+                <template v-else> 
492
                   <el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="120">
491
                   <el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="120">
493
                     <template slot-scope="scope">
492
                     <template slot-scope="scope">
494
                       <el-input v-model="scope.row[iii]" :disabled="formThead[iii].title==='成本价'?'text':disabled" :type="formThead[iii].title==='商品编号'?'text':'number'" :min="0" class="priceBox" placeholder="请输入" />
493
                       <el-input v-model="scope.row[iii]" :disabled="formThead[iii].title==='成本价'?'text':disabled" :type="formThead[iii].title==='商品编号'?'text':'number'" :min="0" class="priceBox" placeholder="请输入" />
@@ -592,9 +591,9 @@
592
                 </template>
591
                 </template>
593
 
592
 
594
                 <template v-if="this.Spu_ids==null || this.Spu_ids=='' || this.Spu_ids==undefined">
593
                 <template v-if="this.Spu_ids==null || this.Spu_ids=='' || this.Spu_ids==undefined">
595
-                  <el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="120">
594
+                  <el-table-column v-if="formThead[iii].title != '成本价格'" v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="120">
596
                     <template slot-scope="scope">
595
                     <template slot-scope="scope">
597
-                      <el-input v-model="scope.row[iii]" @input="handleInput(scope.row,formThead[iii].title)" :disabled="formThead[iii].title==='销售价格'?'text':disabled" :type="formThead[iii].title==='商品编号'?'text':'number'" class="priceBox" placeholder="请输入" />
596
+                      <el-input v-model="scope.row[iii]" @input="handleInput(scope.row,formThead[iii].title)" :type="formThead[iii].title==='商品编号'?'text':'number'" class="priceBox" placeholder="请输入" />
598
                     </template> 
597
                     </template> 
599
                   </el-table-column>
598
                   </el-table-column>
600
                 </template>
599
                 </template>
@@ -878,25 +877,25 @@ export default {
878
   },
877
   },
879
   methods: {
878
   methods: {
880
     handleInput(value, title) {
879
     handleInput(value, title) {
881
-      if(title == '成本价格' || title == '分润比例'){
882
-        if (title == '分润比例') {
883
-          console.log('输入的分润比例', value.extension_one)
884
-          if(value.extension_one < 5){
885
-            value.extension_one = 5;
886
-            this.$message.error('分润比例不得低于百分之5')
887
-          }
888
-        }
889
-        console.log('输入的内容:', value);
890
-        var bili = value.extension_one / 100;//比例
891
-        var gong_mer_profit = value.cost * bili//利润
892
-        var gong_market_price = Number(value.cost) + Number(gong_mer_profit)//加入利润后的价格
893
-        var plate_mer_profit = gong_mer_profit;
894
-        value.price = gong_market_price
895
-        value.gong_mer_profit = gong_mer_profit
896
-        value.gong_market_price = gong_market_price
897
-        value.plate_mer_profit = plate_mer_profit
898
-        console.log('计算的内容:', value);
899
-      }
880
+      // if(title == '成本价格' || title == '分润比例'){
881
+      //   if (title == '分润比例') {
882
+      //     console.log('输入的分润比例', value.extension_one)
883
+      //     if(value.extension_one < 5){
884
+      //       value.extension_one = 5;
885
+      //       this.$message.error('分润比例不得低于百分之5')
886
+      //     }
887
+      //   }
888
+      //   console.log('输入的内容:', value);
889
+      //   var bili = value.extension_one / 100;//比例
890
+      //   var gong_mer_profit = value.cost * bili//利润
891
+      //   var gong_market_price = Number(value.cost) + Number(gong_mer_profit)//加入利润后的价格
892
+      //   var plate_mer_profit = gong_mer_profit;
893
+      //   value.price = gong_market_price
894
+      //   value.gong_mer_profit = gong_mer_profit
895
+      //   value.gong_market_price = gong_market_price
896
+      //   value.plate_mer_profit = plate_mer_profit
897
+      //   console.log('计算的内容:', value);
898
+      // }
900
       // 这里可以执行其他逻辑,如发送数据到服务器等
899
       // 这里可以执行其他逻辑,如发送数据到服务器等
901
     },
900
     },
902
     // 获取商户分润比例
901
     // 获取商户分润比例