Browse Source

no message

feature/v1.6
xpz2018 4 years ago
parent
commit
708e47a5f2
6 changed files with 15 additions and 10 deletions
  1. 2
      app.js
  2. 9
      pages/storage/order-create/index.js
  3. 2
      pages/storage/order-create/index.wxml
  4. 2
      pages/storage/order-info/index.wxml
  5. 8
      pages/storage/order-settlement/index.js
  6. 2
      pages/storage/order-settlement/index.wxml

2
app.js

@ -1,6 +1,6 @@
//app.js //app.js
App({ App({
evn: 1, // 0: 开发版本;1:测试版本;2:生产版本
evn: 0, // 0: 开发版本;1:测试版本;2:生产版本
tmplIds: ['AFoM5TOfsgERsfcetNSB0UlmEixnLF1ySXr54Bqno2M', 'lOQ8Gvyy_dTk68bYGpRVnVA0M7DsYYrV81Gd39GUPBA'], tmplIds: ['AFoM5TOfsgERsfcetNSB0UlmEixnLF1ySXr54Bqno2M', 'lOQ8Gvyy_dTk68bYGpRVnVA0M7DsYYrV81Gd39GUPBA'],
version: '1.5.2', version: '1.5.2',
xAppId: '503258978847953926', xAppId: '503258978847953926',

9
pages/storage/order-create/index.js

@ -122,10 +122,11 @@ 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.data.form.unitPrice = this.data.nowItem.defaultUnitPrice
var unitPrice = this.data.nowItem.defaultUnitPrice
var amount = '' 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)
if(!util.isEmpty(unitPrice) && Number(unitPrice) > 0){
this.data.form.unitPrice = math.times(unitPrice, 1000)
amount = math.times(unitPrice, this.data.poundInfo.netWeight)
} }
this.setData({ visible: false, ['form.productName']: detail.value, ['form.unitPrice']: this.data.form.unitPrice, ['form.estimatedAmount']: amount }) this.setData({ visible: false, ['form.productName']: detail.value, ['form.unitPrice']: this.data.form.unitPrice, ['form.estimatedAmount']: amount })
}, },
@ -137,7 +138,7 @@ Scene({
if(e.currentTarget.id == 'unitPrice'){ if(e.currentTarget.id == 'unitPrice'){
var amount = '' var amount = ''
if(!util.isEmpty(this.data.form.unitPrice) && Number(this.data.form.unitPrice) > 0){ if(!util.isEmpty(this.data.form.unitPrice) && Number(this.data.form.unitPrice) > 0){
amount = math.times(this.data.form.unitPrice, this.data.poundInfo.netWeight)
amount = math.divide(math.times(this.data.form.unitPrice, this.data.poundInfo.netWeight), 1000)
} }
this.setData({ visible: false, ['form.estimatedAmount']: amount }) this.setData({ visible: false, ['form.estimatedAmount']: amount })
} }

2
pages/storage/order-create/index.wxml

@ -47,7 +47,7 @@
</van-cell> </van-cell>
<van-field id="driverName" label="司机姓名" value="{{ form.driverName || '' }}" maxlength="12" placeholder="请输司机姓名" clearable input-align="right" bind:change="bindInput"></van-field> <van-field id="driverName" label="司机姓名" value="{{ form.driverName || '' }}" maxlength="12" placeholder="请输司机姓名" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="unitPrice" label="出货单价(元/公斤)" title-width="240rpx" value="{{ form.unitPrice || '' }}" maxlength="8" type="digit" placeholder="请输入出货单价" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="unitPrice" label="出货单价(元/)" title-width="240rpx" value="{{ form.unitPrice || '' }}" maxlength="8" type="digit" placeholder="请输入出货单价" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="estimatedAmount" label="预估金额" value="{{ form.estimatedAmount || '' }}" maxlength="8" type="digit" placeholder="请输入预估金额" clearable input-align="right" bind:change="bindInput"></van-field> <van-field id="estimatedAmount" label="预估金额" value="{{ form.estimatedAmount || '' }}" maxlength="8" type="digit" placeholder="请输入预估金额" clearable input-align="right" bind:change="bindInput"></van-field>

2
pages/storage/order-info/index.wxml

@ -46,7 +46,7 @@
</van-cell> </van-cell>
<van-cell center wx:if="{{orderInfo.unitPrice}}"> <van-cell center wx:if="{{orderInfo.unitPrice}}">
<view slot="title" class="flex flex-justify"> <view slot="title" class="flex flex-justify">
<view class="text-black">出货单价</view>
<view class="text-black">出货单价(元/吨)</view>
<view class="text-gray">{{orderInfo.unitPrice || '--'}}</view> <view class="text-gray">{{orderInfo.unitPrice || '--'}}</view>
</view> </view>
</van-cell> </van-cell>

8
pages/storage/order-settlement/index.js

@ -103,8 +103,12 @@ 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.categoryId = this.data.nowItem.id this.data.form.categoryId = this.data.nowItem.id
var price = math.times(this.data.nowItem.defaultUnitPrice, 1000)
this.setData({ visible: false, ['form.categoryName']: detail.value, ['form.settleUnitPrice']: price })
if(!util.isEmpty(this.data.nowItem.defaultUnitPrice) && Number(this.data.nowItem.defaultUnitPrice) > 0){
var price = math.times(this.data.nowItem.defaultUnitPrice, 1000)
this.setData({ visible: false, ['form.categoryName']: detail.value, ['form.settleUnitPrice']: price })
} else {
this.setData({ visible: false, ['form.categoryName']: detail.value })
}
}, },
bindInput: function (e) { bindInput: function (e) {
this.data.form[e.target.id] = Number(e.detail) this.data.form[e.target.id] = Number(e.detail)

2
pages/storage/order-settlement/index.wxml

@ -85,7 +85,7 @@
</van-cell> </van-cell>
<van-cell center wx:if="{{orderInfo.unitPrice}}"> <van-cell center wx:if="{{orderInfo.unitPrice}}">
<view slot="title" class="flex flex-justify"> <view slot="title" class="flex flex-justify">
<view class="text-black">出货单价</view>
<view class="text-black">出货单价(元/吨)</view>
<view class="text-gray">{{orderInfo.unitPrice || '--'}}</view> <view class="text-gray">{{orderInfo.unitPrice || '--'}}</view>
</view> </view>
</van-cell> </van-cell>

Loading…
Cancel
Save