|
@@ -65,15 +65,14 @@
|
|
|
<modal-module :show="isModel" @cancel="modalCancel" @click="affirm" :title="customData.itemName" color="#333" :size="32" padding="30rpx 30rpx" >
|
|
<modal-module :show="isModel" @cancel="modalCancel" @click="affirm" :title="customData.itemName" color="#333" :size="32" padding="30rpx 30rpx" >
|
|
|
<template slot="customContent">
|
|
<template slot="customContent">
|
|
|
<view class="select-cmd_bx" v-if="customData">
|
|
<view class="select-cmd_bx" v-if="customData">
|
|
|
- <view class="kc"> 库存 {{ customData.stock }} </view>
|
|
|
|
|
|
|
+ <view class="kc">单价:{{ customData.price }} 库存:{{ customData.stock }} </view>
|
|
|
<view class="num_bx">
|
|
<view class="num_bx">
|
|
|
- <!--<input v-model="customData.bigCount" @focus="customData.bigCount = null" type="number" />扎-->
|
|
|
|
|
<input v-model="customData.bigCount" @input="countPrice" :focus="isFocus" type="number" />扎
|
|
<input v-model="customData.bigCount" @input="countPrice" :focus="isFocus" type="number" />扎
|
|
|
<input v-model="customData.smallCount" @input="countPrice" type="number" style="margin-left:24upx" />支
|
|
<input v-model="customData.smallCount" @input="countPrice" type="number" style="margin-left:24upx" />支
|
|
|
</view>
|
|
</view>
|
|
|
<view class="num_bx">
|
|
<view class="num_bx">
|
|
|
<input style="width: 498rpx" v-model="customData.userPrice" @focus="customData.userPrice = null" type="number" placeholder="金额" />
|
|
<input style="width: 498rpx" v-model="customData.userPrice" @focus="customData.userPrice = null" type="number" placeholder="金额" />
|
|
|
- <text style="margin-left: 20rpx">元</text>
|
|
|
|
|
|
|
+ <text style="margin-left: 10rpx">元</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
@@ -198,6 +197,14 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.customData.userPrice) == false){
|
|
|
|
|
+ uni.showToast({title:"金额错误",icon:"none"})
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(this.customData.userPrice <=0){
|
|
|
|
|
+ uni.showToast({title:"金额要大于0",icon:"none"})
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
const { bigCount,smallCount,bigNum,bigUnit,smallNum,smallUnit,ratio} = this.customData;
|
|
const { bigCount,smallCount,bigNum,bigUnit,smallNum,smallUnit,ratio} = this.customData;
|
|
|
const ratioNum = Number(ratio);
|
|
const ratioNum = Number(ratio);
|