|
|
@@ -44,13 +44,18 @@
|
|
|
@click="reductionItemButton(index)"
|
|
|
:src="imagesUrl('commonality/icon_zgsq_jian.png')">
|
|
|
</view>
|
|
|
- <view class="sub-picker-box">
|
|
|
+ <view class="sub-picker-box" v-if="item.forData1&&item.forData4">
|
|
|
<view class="mark-box">*</view>
|
|
|
<view class="title-box">数量:</view>
|
|
|
+ <view class="picker-text-box">{{item.forData4+item.forData5}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="sub-picker-box">
|
|
|
+ <view class="mark-box">*</view>
|
|
|
+ <view class="title-box">称重:</view>
|
|
|
<view class="reduction-button" @click="reductionAdd(1,index)">-</view>
|
|
|
- <input class="input-p" type="digit" maxlength="10" @input="(val)=>handleInput(index,val)" v-model="item.forData4">
|
|
|
+ <input class="input-p" type="digit" maxlength="10" @input="(val)=>handleInput(index,val)" v-model="item.forData6">
|
|
|
<view class="add-button" @click="reductionAdd(2,index)">+</view>
|
|
|
- <view class="unit-p">{{item.forData1?item.forData5:''}}</view>
|
|
|
+ <view class="unit-p">kg</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="add-item-button" v-if="this.addForm.formData4.length < this.dialogOptionForList.length"
|
|
|
@@ -140,7 +145,7 @@
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if(self.addForm.formData4[i].forData4 == 0){
|
|
|
+ if(self.addForm.formData4[i].forData6 == 0){
|
|
|
uni.showToast({
|
|
|
title: self.addForm.formData4[i].forData2+'没有填写数量',
|
|
|
icon: "none",
|
|
|
@@ -160,7 +165,7 @@
|
|
|
for(let i=0;i<self.addForm.formData4.length;i++){
|
|
|
obj.registerOrderAddItemBos.push({
|
|
|
typeId:self.addForm.formData4[i].forData1,
|
|
|
- weight:self.addForm.formData4[i].forData4,
|
|
|
+ weight:self.addForm.formData4[i].forData6,
|
|
|
})
|
|
|
}
|
|
|
uni.navigateTo({
|
|
|
@@ -193,6 +198,7 @@
|
|
|
forData3:o,
|
|
|
forData4:data.data.wasteOrderDetailItemVos[i].quantity,
|
|
|
forData5:self.dialogOptionForList[o].unit,
|
|
|
+ forData6:0,
|
|
|
forList:self.dialogOptionForList,
|
|
|
}
|
|
|
list.push(JSON.parse(JSON.stringify(obj)))
|
|
|
@@ -227,13 +233,13 @@
|
|
|
reductionAdd(type,index){
|
|
|
if(type == 1){
|
|
|
//减
|
|
|
- if(this.addForm.formData4[index].forData4>=1){
|
|
|
- this.$set(this.addForm.formData4[index],'forData4',this.addForm.formData4[index].forData4-1);
|
|
|
+ if(this.addForm.formData4[index].forData6>=1){
|
|
|
+ this.$set(this.addForm.formData4[index],'forData6',this.addForm.formData4[index].forData6-1);
|
|
|
}
|
|
|
}else if(type == 2){
|
|
|
//加
|
|
|
- if(this.addForm.formData4[index].forData4<9999){
|
|
|
- this.$set(this.addForm.formData4[index],'forData4',this.addForm.formData4[index].forData4+1);
|
|
|
+ if(this.addForm.formData4[index].forData6<9999){
|
|
|
+ this.$set(this.addForm.formData4[index],'forData6',this.addForm.formData4[index].forData6+1);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -254,6 +260,7 @@
|
|
|
forData3:'',
|
|
|
forData4:0,
|
|
|
forData5:'',
|
|
|
+ forData6:0,
|
|
|
forList:[],
|
|
|
})
|
|
|
this.filtrateList();
|
|
|
@@ -343,15 +350,15 @@
|
|
|
let value = e.detail.value
|
|
|
// 如果当前输入为空,直接允许清空
|
|
|
if (!value) {
|
|
|
- this.addForm.formData4[index].forData4 = ''
|
|
|
+ this.addForm.formData4[index].forData6 = ''
|
|
|
} else if (value?.charAt(0) === '0' && value.charAt(1) && value.charAt(1) !== '.') {
|
|
|
// // 1. 当第一位为0时,只能输入小数点【第二位必须是小数点】
|
|
|
value = '0'
|
|
|
}
|
|
|
value = value.replace(/[^\d.]/g, '') // 清除"数字"和"."以外的字符
|
|
|
value = value.replace(/\.{2,}/g, '.') // 只保留第一个. 清除多余的
|
|
|
- value = value.match(/^\d*(\.?\d{0,2})/g)[0] || '' // 保留2位小数
|
|
|
- this.addForm.formData4[index].forData4 = value
|
|
|
+ value = value.match(/^\d*(\.?\d{0,3})/g)[0] || '' // 保留3位小数
|
|
|
+ this.addForm.formData4[index].forData6 = value
|
|
|
})
|
|
|
},
|
|
|
//匹配数据
|
|
|
@@ -417,7 +424,14 @@
|
|
|
background-color: #fff;
|
|
|
border-radius:10rpx;
|
|
|
padding:20rpx 20rpx 0 10rpx;
|
|
|
+ .for-content-box:nth-child(1){
|
|
|
+ padding-top:0;
|
|
|
+ border-top:none;
|
|
|
+ }
|
|
|
.for-content-box{
|
|
|
+ margin-bottom:20rpx;
|
|
|
+ padding-top:30rpx;
|
|
|
+ border-top:1px solid #dedede;
|
|
|
.right-button{
|
|
|
margin-top:8rpx;
|
|
|
margin-left:20rpx;
|
|
|
@@ -446,6 +460,10 @@
|
|
|
flex:1;
|
|
|
height:40rpx;
|
|
|
line-height:40rpx;
|
|
|
+ display:block;
|
|
|
+ overflow:hidden;
|
|
|
+ text-overflow:ellipsis;
|
|
|
+ white-space:nowrap;
|
|
|
}
|
|
|
.title-box{
|
|
|
width:100rpx;
|
|
|
@@ -468,7 +486,7 @@
|
|
|
padding:0 20rpx;
|
|
|
color:#666;
|
|
|
line-height:60rpx;
|
|
|
- width:400rpx;
|
|
|
+ width:300rpx;
|
|
|
display:block;
|
|
|
overflow:hidden;
|
|
|
text-overflow:ellipsis;
|
|
|
@@ -478,6 +496,10 @@
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ .picker-text-box{
|
|
|
+ width:400rpx;
|
|
|
+ line-height:60rpx;
|
|
|
+ }
|
|
|
.reduction-button{
|
|
|
width:60rpx;
|
|
|
height:60rpx;
|