|
@@ -31,7 +31,7 @@
|
|
|
</div>
|
|
|
<div class="flex-align-center" style="margin-bottom:30px">
|
|
|
<p>数量: </p>
|
|
|
- <el-input-number v-model="count" :min="selectProduct.orderminqty" step-strictly :step="selectProduct.orderaddqty" size="small" label="描述文字"></el-input-number>
|
|
|
+ <el-input-number v-model="count" :min="selectProduct.orderminqty" :step="selectProduct.orderaddqty" @change="changeQty" size="small" label="描述文字"></el-input-number>
|
|
|
<span style="color:#888;font-size: 14px;margin-left: 10px">起订量:{{selectProduct.orderminqty}}</span>
|
|
|
<span style="color:#888;font-size: 14px;margin-left: 10px">增量:{{selectProduct.orderaddqty}}</span>
|
|
|
<span style="color:#888;font-size: 14px;margin-left: 10px">库存:
|
|
@@ -124,7 +124,7 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
detail: '',
|
|
|
- count: 1,
|
|
|
+ count: 0,
|
|
|
selectProduct: '',
|
|
|
actImage:{},
|
|
|
tradefield:[],
|
|
@@ -159,17 +159,28 @@ export default {
|
|
|
this.actImage = this.detail ? this.detail[0].attinfos ? this.detail[0].attinfos[0]:{} : {}
|
|
|
this.tradefield = this.detail ? this.detail[0].tradefield : []
|
|
|
this.actTradefield = this.detail?this.detail[0].tradefield?this.detail[0].tradefield[0].tradefield:'':''
|
|
|
+ this.count = this.detail[0].orderminqty
|
|
|
|
|
|
},
|
|
|
countChange (num) {
|
|
|
this.count = num
|
|
|
},
|
|
|
+ changeQty(num){
|
|
|
+ let a = num - this.selectProduct.orderminqty
|
|
|
+ let b = a / this.selectProduct.orderaddqty
|
|
|
+ if (b < 1) {
|
|
|
+ this.count = this.selectProduct.orderminqty + this.selectProduct.orderaddqty
|
|
|
+ } else {
|
|
|
+ this.count = this.selectProduct.orderminqty + this.selectProduct.orderaddqty * b.toFixed(0)
|
|
|
+ }
|
|
|
+ },
|
|
|
typeClick (data) {
|
|
|
console.log(data,"切换")
|
|
|
this.selectProduct = data
|
|
|
this.actImage = data.attinfos[0]
|
|
|
this.actTradefield = data.tradefield[0].tradefield
|
|
|
this.count = data.orderminqty
|
|
|
+ console.log(this.count)
|
|
|
},
|
|
|
|
|
|
async addCart () {
|