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