5.31宁夏领料申请数量限制
This commit is contained in:
parent
f70d1317f2
commit
8d50f332ec
|
|
@ -18,6 +18,7 @@
|
|||
:clear="false"
|
||||
></uni-data-select>
|
||||
</view>
|
||||
<h5 class="tit">当前型号剩余库存:{{ leftNum }}</h5>
|
||||
<h5 class="tit">预约数量</h5>
|
||||
<view class="select-num">
|
||||
<uni-number-box v-model="deviceNum" @change="numChange" :min="1"/>
|
||||
|
|
@ -56,6 +57,7 @@ import { basePath } from '../../public';
|
|||
specRange: [
|
||||
|
||||
],
|
||||
leftNum: '',
|
||||
companyId: '',
|
||||
status: '',
|
||||
baseUrl: 'http://112.29.103.165:21624/dev-api/system'
|
||||
|
|
@ -79,6 +81,7 @@ import { basePath } from '../../public';
|
|||
this.status = this.specRange[e].status
|
||||
this.typeId = this.specRange[e].typeId
|
||||
this.specVal = this.specRange[e].leasePrice
|
||||
this.leftNum = this.specRange[e].leftNum
|
||||
this.devicePrice = '¥' + (Math.round((e * this.deviceNum) * 100)/100)
|
||||
},
|
||||
numChange (e) {
|
||||
|
|
@ -93,8 +96,14 @@ import { basePath } from '../../public';
|
|||
title: '请选择规格!'
|
||||
})
|
||||
} else {
|
||||
console.log(this.typeId, this.deviceNum, this.companyId);
|
||||
console.log(this.typeId, this.deviceNum, this.companyId, this.leftNum);
|
||||
// 向购物车内添加商品
|
||||
if (this.deviceNum > this.leftNum) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '当前领料数量大于库存数量!'
|
||||
})
|
||||
} else {
|
||||
that.$api.fetchMaterial.addItemToCart({
|
||||
typeId: this.typeId,
|
||||
bookNum: this.deviceNum,
|
||||
|
|
@ -120,6 +129,7 @@ import { basePath } from '../../public';
|
|||
}).catch(err => {
|
||||
console.log(err);
|
||||
})
|
||||
}
|
||||
/* let localGoodList = uni.getStorageSync('goodList')
|
||||
localGoodList.push({
|
||||
pic: this.bgList[0],
|
||||
|
|
@ -167,7 +177,8 @@ import { basePath } from '../../public';
|
|||
value: index,
|
||||
status: item['status'],
|
||||
typeId: item['typeId'],
|
||||
leasePrice: item['leasePrice']
|
||||
leasePrice: item['leasePrice'],
|
||||
leftNum: item['num']
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
|
@ -199,14 +210,14 @@ import { basePath } from '../../public';
|
|||
width: 90%;
|
||||
font-weight: normal;
|
||||
font-size: 14px;
|
||||
margin: 1vh auto;
|
||||
margin: 2vh auto;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.drop-menu, .select-num{
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 6vh;
|
||||
margin-bottom: 2vh;
|
||||
}
|
||||
.operation{
|
||||
width: 100%;
|
||||
|
|
|
|||
Loading…
Reference in New Issue