|
|
@ -2,6 +2,7 @@ |
|
|
import Scene from '../../index/scene' |
|
|
import Scene from '../../index/scene' |
|
|
import { getPoundInfo, getPaperList, createOutOrder } from "../../../api/saas" |
|
|
import { getPoundInfo, getPaperList, createOutOrder } from "../../../api/saas" |
|
|
const util = require('../../../utils/util') |
|
|
const util = require('../../../utils/util') |
|
|
|
|
|
const math = require('../../../utils/math') |
|
|
const event = require('../../../utils/event') |
|
|
const event = require('../../../utils/event') |
|
|
const app = getApp() |
|
|
const app = getApp() |
|
|
|
|
|
|
|
|
@ -121,13 +122,25 @@ Scene({ |
|
|
onConfirm: function({detail}){ |
|
|
onConfirm: function({detail}){ |
|
|
this.data.nowItem = this.data.paperList[detail.index] |
|
|
this.data.nowItem = this.data.paperList[detail.index] |
|
|
this.data.form.productId = this.data.nowItem.id |
|
|
this.data.form.productId = this.data.nowItem.id |
|
|
this.setData({ visible: false, ['form.productName']: detail.value }) |
|
|
|
|
|
|
|
|
this.data.form.unitPrice = this.data.nowItem.defaultUnitPrice |
|
|
|
|
|
var amount = '' |
|
|
|
|
|
if(!util.isEmpty(this.data.form.unitPrice) && Number(this.data.form.unitPrice) > 0){ |
|
|
|
|
|
amount = math.times(this.data.form.unitPrice, this.data.poundInfo.netWeight) |
|
|
|
|
|
} |
|
|
|
|
|
this.setData({ visible: false, ['form.productName']: detail.value, ['form.unitPrice']: this.data.form.unitPrice, ['form.estimatedAmount']: amount }) |
|
|
}, |
|
|
}, |
|
|
onChange: function({detail}) { |
|
|
onChange: function({detail}) { |
|
|
this.setData({ activeNames: detail }) |
|
|
this.setData({ activeNames: detail }) |
|
|
}, |
|
|
}, |
|
|
bindInput: function (e) { |
|
|
bindInput: function (e) { |
|
|
this.data.form[e.currentTarget.id] = e.detail.value |
|
|
this.data.form[e.currentTarget.id] = e.detail.value |
|
|
|
|
|
if(e.currentTarget.id == 'unitPrice'){ |
|
|
|
|
|
var amount = '' |
|
|
|
|
|
if(!util.isEmpty(this.data.form.unitPrice) && Number(this.data.form.unitPrice) > 0){ |
|
|
|
|
|
amount = math.times(this.data.form.unitPrice, this.data.poundInfo.netWeight) |
|
|
|
|
|
} |
|
|
|
|
|
this.setData({ visible: false, ['form.productName']: detail.value, ['form.estimatedAmount']: amount }) |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
onInputChange: function(e){ |
|
|
onInputChange: function(e){ |
|
|
this.data.form[e.currentTarget.id] = e.detail |
|
|
this.data.form[e.currentTarget.id] = e.detail |
|
|
|