|
@@ -4,22 +4,22 @@
|
|
|
<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" type="number" placeholder="请输入" v-model="form.gatherNum_other" />
|
|
|
+ <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>
|
|
|
<u-form-item prop="gatherNum_chuyu" label="厨余垃圾:" >
|
|
|
- <u-input :disabled="isView" placeholder="请输入" type="number" v-model="form.gatherNum_chuyu" />
|
|
|
+ <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-form-item>
|
|
|
<u-form-item prop="gatherNum_jianzhu" label="建筑垃圾:" >
|
|
|
- <u-input :disabled="isView" placeholder="请输入" type="number" v-model="form.gatherNum_jianzhu" />
|
|
|
+ <u-input :disabled="isView" @input="numberToFixed('gatherNum_jianzhu',2,999999)" placeholder="请输入" type="number" v-model="form.gatherNum_jianzhu" />
|
|
|
<text slot="right" style="color: #000000;">吨(约{{form.gatherNum_jianzhu*1000}}kg)</text>
|
|
|
</u-form-item>
|
|
|
</u-form>
|
|
|
</view>
|
|
|
<view class="form-data remark">
|
|
|
<text>信息备注</text>
|
|
|
- <textarea :disabled="isView" :auto-height="true" :maxlength="500" v-model="form.remark" class="receiveAddress"/>
|
|
|
+ <textarea :disabled="isView" :auto-height="true" :maxlength="30" v-model="form.remarks" class="receiveAddress"/>
|
|
|
</view>
|
|
|
<view class="form-data qyImg">
|
|
|
<text>清运照片</text>
|
|
@@ -51,6 +51,7 @@
|
|
|
import uniPopup from '@/components/uni-popup/uni-popup.vue'
|
|
|
import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
|
|
|
import {gatherSave} from '@/api/index.js'
|
|
|
+ import {numberToFixed} from '@/libs/tools.js'
|
|
|
export default {
|
|
|
components: {
|
|
|
uniPopup,uniPopupDialog
|
|
@@ -64,7 +65,7 @@
|
|
|
gatherNum_other: '', // 其它垃圾
|
|
|
gatherNum_chuyu: '', // 厨余垃圾
|
|
|
gatherNum_jianzhu: '', // 建筑垃圾
|
|
|
- remark: '' // 备注
|
|
|
+ remarks: '' // 备注
|
|
|
},
|
|
|
isView: false // 是否是查看详情
|
|
|
};
|
|
@@ -77,13 +78,22 @@
|
|
|
}else {
|
|
|
console.log('--------新增')
|
|
|
this.photograph = []
|
|
|
+ this.form.remarks = ''
|
|
|
this.$refs.uForm.resetFields()
|
|
|
}
|
|
|
},
|
|
|
onUnload() {
|
|
|
},
|
|
|
methods: {
|
|
|
- // 签到拍照
|
|
|
+ // 保留几位小数
|
|
|
+ numberToFixed: function (key, num, max) {
|
|
|
+ let val = this.form[key]
|
|
|
+ let ret = numberToFixed(val, num, max)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.form[key] = ret
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 拍照或从相册选图片
|
|
|
goPhotograph() {
|
|
|
uni.chooseImage({
|
|
|
count: 3, //默认9
|
|
@@ -126,7 +136,8 @@
|
|
|
this.$refs.openModal.close()
|
|
|
let params = {
|
|
|
rubbishEntityList: [],
|
|
|
- imageUrlList: this.photograph
|
|
|
+ imageUrlList: this.photograph,
|
|
|
+ remarks: this.form.remarks
|
|
|
}
|
|
|
if(this.form.gatherNum_other) {
|
|
|
params.rubbishEntityList.push({
|