|
@@ -1,26 +1,40 @@
|
|
|
<template>
|
|
|
<view class="content">
|
|
|
- <view>
|
|
|
+ <view class="content-form">
|
|
|
<view class="form-data">
|
|
|
<u-form :model="form" ref="uForm" :label-width="140" :error-type="['toast']">
|
|
|
- <u-form-item prop="gatherNum_other" label="其他垃圾:" >
|
|
|
- <u-input :disabled="isView" @input="numberToFixed('gatherNum_other',0,999999)" type="number" placeholder="请输入" v-model="form.gatherNum_other" />
|
|
|
- <text slot="right" style="color: #000000;">桶(约{{form.gatherNum_other*240}}kg)</text>
|
|
|
+ <u-form-item prop="gatherNum_huishou" label="可回收物:">
|
|
|
+ <u-input :disabled="isView" @input="numberToFixed('gatherNum_huishou',2,999999)" type="number" placeholder="请输入" v-model="form.gatherNum_huishou" />
|
|
|
+ <text slot="right" style="color: #000000;">KG</text>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item prop="gatherNum_harm" label="有害垃圾:" >
|
|
|
+ <u-input :disabled="isView" @input="numberToFixed('gatherNum_harm',2,999999)" placeholder="请输入" type="number" v-model="form.gatherNum_harm" />
|
|
|
+ <text slot="right" style="color: #000000;">KG</text>
|
|
|
</u-form-item>
|
|
|
+ <u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
|
|
<u-form-item prop="gatherNum_chuyu" label="厨余垃圾:" >
|
|
|
- <u-input :disabled="isView" @input="numberToFixed('gatherNum_chuyu',0,999999)" placeholder="请输入" type="number" v-model="form.gatherNum_chuyu" />
|
|
|
- <text slot="right" style="color: #000000;">桶(约{{form.gatherNum_chuyu*240}}kg)</text>
|
|
|
+ <u-input :disabled="isView" @input="numberToFixed('gatherNum_chuyu',2,999999)" placeholder="请输入" type="number" v-model="form.gatherNum_chuyu" />
|
|
|
+ <text slot="right" style="color: #000000;">L(约{{form.gatherNum_chuyu*1}}KG)</text>
|
|
|
</u-form-item>
|
|
|
+ <u-form-item prop="gatherNum_other" label="其他垃圾:" >
|
|
|
+ <u-input :disabled="isView" @input="numberToFixed('gatherNum_other',2,999999)" type="number" placeholder="请输入" v-model="form.gatherNum_other" />
|
|
|
+ <text slot="right" style="color: #000000;">L(约{{form.gatherNum_other*1}}KG)</text>
|
|
|
+ </u-form-item>
|
|
|
+ <u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
|
|
<u-form-item prop="gatherNum_jianzhu" label="建筑垃圾:" >
|
|
|
<u-input :disabled="isView" @input="numberToFixed('gatherNum_jianzhu',2,999999)" placeholder="请输入" type="digit" v-model="form.gatherNum_jianzhu" />
|
|
|
- <text slot="right" style="color: #000000;">吨(约{{form.gatherNum_jianzhu*1000}}kg)</text>
|
|
|
+ <text slot="right" style="color: #000000;">KG</text>
|
|
|
+ </u-form-item>
|
|
|
+ <u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
|
|
+ <u-form-item prop="remarks" label="信息备注:">
|
|
|
+ <u-input :disabled="isView" placeholder="请输入" v-model="form.remarks" :maxlength="30" class="receiveAddress" height="0" auto-height :clearable="false"></u-input>
|
|
|
</u-form-item>
|
|
|
</u-form>
|
|
|
</view>
|
|
|
- <view class="form-data remark">
|
|
|
+ <!-- <view class="form-data remark">
|
|
|
<text>信息备注</text>
|
|
|
- <textarea :disabled="isView" :auto-height="true" :maxlength="30" v-model="form.remarks" class="receiveAddress"/>
|
|
|
- </view>
|
|
|
+ <textarea :disabled="isView" :auto-height="true" :maxlength="30" v-model="form.remarks" class="receiveAddress" placeholder="请输入" />
|
|
|
+ </view> -->
|
|
|
<view class="form-data qyImg">
|
|
|
<text>清运照片</text>
|
|
|
<view class="info-main">
|
|
@@ -41,12 +55,14 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ </view>
|
|
|
+ <view class="content-btn">
|
|
|
<u-button v-if="isView" @click="isView = false" class="submitBtn" type="waring" shape="circle">修改</u-button>
|
|
|
<u-button v-else @click="submit" :loading="loading" class="submitBtn" type="success" shape="circle">提交</u-button>
|
|
|
- <uni-popup ref="openModal" type="center">
|
|
|
- <uni-popup-dialog content="确认提交吗?" @confirm="onOk" :title="title"></uni-popup-dialog>
|
|
|
- </uni-popup>
|
|
|
</view>
|
|
|
+ <uni-popup ref="openModal" type="center">
|
|
|
+ <uni-popup-dialog content="确认提交吗?" @confirm="onOk" :title="title"></uni-popup-dialog>
|
|
|
+ </uni-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -65,6 +81,8 @@
|
|
|
loading:false, // 提交按钮加载圈
|
|
|
photograph: [], // 图片路径
|
|
|
form: {
|
|
|
+ gatherNum_huishou: '',
|
|
|
+ gatherNum_harm: '',
|
|
|
gatherNum_other: '', // 其它垃圾
|
|
|
gatherNum_chuyu: '', // 厨余垃圾
|
|
|
gatherNum_jianzhu: '', // 建筑垃圾
|
|
@@ -107,9 +125,13 @@
|
|
|
const a = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_BUILDING')
|
|
|
const b = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_OTHER')
|
|
|
const c = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_KITCHEN')
|
|
|
+ const d = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_HARM')
|
|
|
+ const e = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_RECYCLING')
|
|
|
this.form.gatherNum_jianzhu= a ? a.gatherNum.toString() : '0'
|
|
|
this.form.gatherNum_chuyu= c ? c.gatherNum.toString() : '0'
|
|
|
this.form.gatherNum_other= b ? b.gatherNum.toString() : '0'
|
|
|
+ this.form.gatherNum_harm= d ? d.gatherNum.toString() : '0'
|
|
|
+ this.form.gatherNum_huishou= e ? e.gatherNum.toString() : '0'
|
|
|
this.form.remarks=res.data.remarks
|
|
|
this.photograph=res.data.imageUrlList || []
|
|
|
console.log(this.form,'this.form')
|
|
@@ -161,7 +183,7 @@
|
|
|
},
|
|
|
// 提交
|
|
|
submit(){
|
|
|
- if((!this.form.gatherNum_other ||this.form.gatherNum_other==0) && (!this.form.gatherNum_chuyu || this.form.gatherNum_chuyu==0) && (!this.form.gatherNum_jianzhu || this.form.gatherNum_jianzhu==0)) {
|
|
|
+ if((!this.form.gatherNum_huishou ||this.form.gatherNum_huishou==0) && (!this.form.gatherNum_harm ||this.form.gatherNum_harm==0) &&(!this.form.gatherNum_other ||this.form.gatherNum_other==0) && (!this.form.gatherNum_chuyu || this.form.gatherNum_chuyu==0) && (!this.form.gatherNum_jianzhu || this.form.gatherNum_jianzhu==0)) {
|
|
|
uni.showToast({
|
|
|
title: '请至少输入一项垃圾分类的数量!',
|
|
|
icon: 'none'
|
|
@@ -182,20 +204,36 @@
|
|
|
if(this.itemId){
|
|
|
params.id=this.itemId
|
|
|
}
|
|
|
+ if(this.form.gatherNum_huishou) {
|
|
|
+ params.rubbishEntityList.push({
|
|
|
+ "rubbishType":"GATHER_RECYCLING",
|
|
|
+ "rubbishWeight": this.form.gatherNum_huishou*1000,
|
|
|
+ "gatherNum": this.form.gatherNum_huishou,
|
|
|
+ "unit":"KILOGRAM"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.form.gatherNum_harm) {
|
|
|
+ params.rubbishEntityList.push({
|
|
|
+ "rubbishType":"GATHER_HARM",
|
|
|
+ "rubbishWeight": this.form.gatherNum_harm*1000,
|
|
|
+ "gatherNum": this.form.gatherNum_harm,
|
|
|
+ "unit":"KILOGRAM"
|
|
|
+ })
|
|
|
+ }
|
|
|
if(this.form.gatherNum_other) {
|
|
|
params.rubbishEntityList.push({
|
|
|
"rubbishType":"GATHER_OTHER",
|
|
|
- "rubbishWeight": this.form.gatherNum_other*240,
|
|
|
+ "rubbishWeight": this.form.gatherNum_other*1000,
|
|
|
"gatherNum": this.form.gatherNum_other,
|
|
|
- "unit":"BUCKET"
|
|
|
+ "unit":"LITER"
|
|
|
})
|
|
|
}
|
|
|
if(this.form.gatherNum_chuyu) {
|
|
|
params.rubbishEntityList.push({
|
|
|
"rubbishType":"GATHER_KITCHEN",
|
|
|
- "rubbishWeight": this.form.gatherNum_chuyu*240,
|
|
|
+ "rubbishWeight": this.form.gatherNum_chuyu*1000,
|
|
|
"gatherNum": this.form.gatherNum_chuyu,
|
|
|
- "unit":"BUCKET"
|
|
|
+ "unit":"LITER"
|
|
|
})
|
|
|
}
|
|
|
if(this.form.gatherNum_jianzhu) {
|
|
@@ -203,7 +241,7 @@
|
|
|
"rubbishType":"GATHER_BUILDING",
|
|
|
"rubbishWeight": this.form.gatherNum_jianzhu*1000,
|
|
|
"gatherNum": this.form.gatherNum_jianzhu,
|
|
|
- "unit":"TON"
|
|
|
+ "unit":"KILOGRAM"
|
|
|
})
|
|
|
}
|
|
|
this.loading=true
|
|
@@ -240,26 +278,28 @@
|
|
|
height: 100vh;
|
|
|
padding: 0;
|
|
|
background: #F5F5F5;
|
|
|
- // .buttons{
|
|
|
- // font-size: 32upx;
|
|
|
- // display: block;
|
|
|
- // height: 80upx;
|
|
|
- // line-height: 80upx;
|
|
|
- // margin: 0 auto;
|
|
|
- // background-color: #0DC55F;
|
|
|
- // color: #fff;
|
|
|
- // border-radius: 50upx;
|
|
|
- // }
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
.receiveAddress{
|
|
|
width: 100%;
|
|
|
line-height: 1.5em;
|
|
|
box-sizing: border-box;
|
|
|
font-style: normal;
|
|
|
}
|
|
|
+ .content-form{
|
|
|
+ flex:1;
|
|
|
+ overflow-y: scroll;
|
|
|
+ }
|
|
|
.form-data{
|
|
|
- padding: 0 40upx;
|
|
|
+ // padding: 40upx;
|
|
|
margin-bottom: 20upx;
|
|
|
background-color: #fff;
|
|
|
+ .u-form-item.data-v-5e7216f1 {
|
|
|
+ padding:20rpx 40rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .u-form-item{
|
|
|
+ padding: 0 40upx;
|
|
|
}
|
|
|
.remark{
|
|
|
padding: 40upx ;
|
|
@@ -312,13 +352,12 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .content-btn{
|
|
|
+ background-color: #fff;
|
|
|
+ padding: 40rpx;
|
|
|
+ }
|
|
|
.submitBtn{
|
|
|
font-size: 32upx;
|
|
|
- display: block;
|
|
|
- width: 670upx;
|
|
|
- height: 80upx;
|
|
|
- line-height: 80upx;
|
|
|
- margin: 0 auto;
|
|
|
color: #fff;
|
|
|
border-radius: 50upx;
|
|
|
}
|