| | |
| | | @confirm="treeChooseValue" /> |
| | | </u-form-item> |
| | | <u-form-item labelWidth="20%" |
| | | label="购买总量" |
| | | label="购买总量(KG)" |
| | | ref="item1" prop="buyTotal1"> |
| | | <u--input v-model="buyTotal1" |
| | | :customStyle="{ border: '1px solid #dddddd' }"></u--input> |
| | | </u-form-item> |
| | | <u-form-item labelWidth="20%" |
| | | label="购买总量(吨)" |
| | | ref="item1" prop="buyTotal"> |
| | | <u--input v-model="form.buyTotal" |
| | | <u--input v-model="form.buyTotal" disabled |
| | | :customStyle="{ border: '1px solid #dddddd' }"></u--input> |
| | | </u-form-item> |
| | | <u-form-item labelWidth="25%" |
| | |
| | | qianTree |
| | | }, |
| | | onLoad(params) { |
| | | this.role = params.role; |
| | | if (params.fleetId) { |
| | | this.fleetId = params.fleetId; |
| | | if(params.data){ |
| | | this.form=Object.assign({},this.form,JSON.parse(decodeURIComponent(params.data))) |
| | | this.productName=this.form.productName |
| | | this.range=[this.form.startDate,this.form.endDate] |
| | | if (this.fileList1.length == 0 && this.form.buyFilePath) { |
| | | this.fileList1.push({ |
| | | url: `${BaseUrl}${this.form.buyFilePath}` |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | watch:{ |
| | | form(newval,oldval){ |
| | | if(!newval||newval==''){ |
| | | this.form.buyTotal=null |
| | | }else{ |
| | | this.buyTotal1=(newval.buyTotal*1000).toFixed(2) |
| | | } |
| | | }, |
| | | buyTotal1(newval,oldval){ |
| | | if(!newval||newval==''){ |
| | | this.form.buyTotal=null |
| | | }else{ |
| | | this.form.buyTotal=(newval/1000).toFixed(2) |
| | | } |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | buyTotal1:0, |
| | | form:{ |
| | | buyTotal:"", |
| | | buyTotal:0, |
| | | cardNumber:"", |
| | | customerId, |
| | | productId:"", |
| | |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | buyTotal: [{ |
| | | type: 'number', |
| | | required: true, |
| | | message: '请输入购买总量', |
| | | // blur和change事件触发检验 |
| | |
| | | duration: 2000 |
| | | }); |
| | | } else { |
| | | this.$reqPost('addBuycard', this.form, 'json').then(result => { |
| | | if (result.code == 0) { |
| | | this.$u.toast('提交成功'); |
| | | let timer = setTimeout(() => { |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }); |
| | | uni.$emit('needRefresh') |
| | | }, 500); |
| | | } else { |
| | | this.$u.toast(result.msg ? result.msg : '提交失败'); |
| | | } |
| | | }); |
| | | if(this.form.id){ |
| | | this.$reqPut('putBuycard',{ ...this.form,status:0,}, 'json').then(result => { |
| | | if (result.code == 0) { |
| | | this.$u.toast('提交成功'); |
| | | let timer = setTimeout(() => { |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }); |
| | | uni.$emit('needRefresh') |
| | | }, 500); |
| | | } else { |
| | | this.$u.toast(result.msg ? result.msg : '提交失败'); |
| | | } |
| | | }) |
| | | }else{ |
| | | this.$reqPost('addBuycard', this.form, 'json').then(result => { |
| | | if (result.code == 0) { |
| | | this.$u.toast('提交成功'); |
| | | let timer = setTimeout(() => { |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }); |
| | | uni.$emit('needRefresh') |
| | | }, 500); |
| | | } else { |
| | | this.$u.toast(result.msg ? result.msg : '提交失败'); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | |
| | | margin: 0 auto; |
| | | } |
| | | } |
| | | ::v-deep.tki-tree .tki-tree-mask .tki-tree-cnt{ |
| | | position: fixed; |
| | | top: 50vh; |
| | | } |
| | | </style> |