|
|
@@ -46,7 +46,6 @@
|
|
|
:bigCount=" getSelectItemById(productItem.id, classItem.classId).bigCount"
|
|
|
:smallCount="getSelectItemById(productItem.id, classItem.classId).smallCount"
|
|
|
:itemPrice="getSelectItemById(productItem.id, classItem.classId).itemPrice"
|
|
|
- :realityWeight="getSelectItemById(productItem.id, classItem.classId).realityWeight"
|
|
|
@customNum="customNum"
|
|
|
@add="addEvent"
|
|
|
@addOneEvent="addCustomNumEvent"
|
|
|
@@ -79,24 +78,14 @@
|
|
|
<view class="select-view">
|
|
|
<view class="select-cmd_bx">
|
|
|
<view class="num_bx">
|
|
|
- <view class="kc">
|
|
|
- 数量
|
|
|
- </view>
|
|
|
- <input v-model="customData.bigCount" :focus="isFocus" @input="countWeight" type="number" />扎
|
|
|
- <input v-model="customData.smallCount" @input="countWeight" type="number" style="margin-left:24upx"/>支
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="select-cmd_bx">
|
|
|
- <view class="num_bx">
|
|
|
- <view class="kc">总价</view>
|
|
|
- <input v-model="customData.itemPrice" @focus="customData.itemPrice = null" type="number" placeholder="采购金额" />
|
|
|
- <text style="margin-left: 20rpx">元</text>
|
|
|
+ <view class="kc">数量</view>
|
|
|
+ <input v-model="customData.bigCount" :focus="isFocus" type="number" placeholder="扎" />
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="select-cmd_bx">
|
|
|
<view class="num_bx">
|
|
|
- <view class="kc">重量</view>
|
|
|
- <input readonly v-model="customData.realityWeight" @focus="customData.realityWeight = null" type="number" placeholder="公斤" />
|
|
|
+ <view class="kc">单价</view>
|
|
|
+ <input v-model="customData.itemPrice" @focus="customData.itemPrice = null" type="number" placeholder="元" />
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -144,7 +133,6 @@ export default {
|
|
|
smallCount: null,
|
|
|
itemPrice: null,
|
|
|
weight:null,
|
|
|
- realityWeight:null,
|
|
|
},
|
|
|
autoLoad: false, //不自动请求数据 自定义请求
|
|
|
};
|
|
|
@@ -166,14 +154,6 @@ export default {
|
|
|
this.initData({ type, shopId: this.shopId,status:0});
|
|
|
},
|
|
|
methods: {
|
|
|
- // 计算重量
|
|
|
- countWeight(){
|
|
|
- let ratio = this.customData.ratio;
|
|
|
- let smallCount = this.customData.smallCount;
|
|
|
- let bigCount = this.customData.bigCount;
|
|
|
- let weight = this.customData.weight;
|
|
|
- this.customData.realityWeight = (smallCount * weight / ratio + bigCount * weight).toFixed(2)
|
|
|
- },
|
|
|
// 离开全选input alone
|
|
|
moveAloneAllInput(e){
|
|
|
this.isAloneAllActive=false;
|
|
|
@@ -181,13 +161,6 @@ export default {
|
|
|
if(e==''){return}
|
|
|
this.customData.itemPrice = e;
|
|
|
},
|
|
|
- // 公斤离开全选input alone
|
|
|
- moveWeightAllInput(e){
|
|
|
- this.isWeightActive=false;
|
|
|
- this.isWeightFocus=false;
|
|
|
- if(e==''){return}
|
|
|
- this.customData.realityWeight = e;
|
|
|
- },
|
|
|
//input点击删除按键
|
|
|
deleteAloneInputVal(){
|
|
|
this.isAloneAllActive=false;
|
|
|
@@ -196,7 +169,6 @@ export default {
|
|
|
//input重量点击删除按键
|
|
|
deleteWeightInputVal(){
|
|
|
this.isWeightActive=false;
|
|
|
- this.customData.realityWeight = '';
|
|
|
},
|
|
|
//自定义数量
|
|
|
customNum(info) {
|
|
|
@@ -205,7 +177,6 @@ export default {
|
|
|
this.isFocus = false;
|
|
|
this.$nextTick(()=>{
|
|
|
this.customData.itemPrice = this.customData.itemPrice==0?null:this.customData.itemPrice;
|
|
|
- this.customData.realityWeight = this.customData.realityWeight==0?null:this.customData.realityWeight;
|
|
|
this.customData.smallCount = this.customData.smallCount==0?null:this.customData.smallCount;
|
|
|
this.customData.bigCount = this.customData.bigCount==0?null:this.customData.bigCount;
|
|
|
this.isFocus = true;
|
|
|
@@ -257,11 +228,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(this.customData.realityWeight<=0){
|
|
|
- uni.showToast({title:"请输入花材重量",icon:"none"})
|
|
|
- return;
|
|
|
- }
|
|
|
- // delAllEvent
|
|
|
//超过库存时 设置为库存最大值
|
|
|
this.updateItemEvent(this.customData);
|
|
|
this.modalCancel();
|