Browse Source

单价修改

feature/v2.3
xpz2018 4 years ago
parent
commit
3275b0a6fb
10 changed files with 59 additions and 16 deletions
  1. 8
      pages/process/order-check/index.js
  2. 6
      pages/process/order-check/index.wxml
  3. 2
      pages/process/order-list/index.wxml
  4. 7
      pages/process/order-price/index.js
  5. 10
      pages/process/outside-add/index.js
  6. 2
      pages/process/outside-add/index.wxml
  7. 7
      pages/process/outside-check-item/index.js
  8. 2
      pages/process/outside-check-item/index.wxml
  9. 23
      pages/storage/order-settlement/index.js
  10. 8
      pages/storage/order-settlement/index.wxml

8
pages/process/order-check/index.js

@ -74,8 +74,14 @@ Scene({
onConfirm: function(e){
this.data.cIndex = e.currentTarget.dataset.index
this.data.nowItem = this.data.paperList[this.data.cIndex]
if(this.data.form.productId == this.data.nowItem.id){
this.onHide()
return
}
this.data.form.productId = this.data.nowItem.id
this.data.form.unitPrice = this.data.nowItem.defaultUnitPrice
// this.data.form.unitPrice = this.data.nowItem.defaultUnitPrice
this.data.form.konePrice = '指导价格:' + this.data.nowItem.defaultUnitPrice
this.data.form.unitPrice = ''
this.data.form.productName = this.data.nowItem.name
this.statAmount()
},

6
pages/process/order-check/index.wxml

@ -61,7 +61,7 @@
placeholder="请输入单价" value="{{form.unitPrice || ''}}" bindinput="bindInput" />
</view>
</van-cell> -->
<van-field id="unitPrice" value="{{ form.unitPrice || '' }}" type="digit" placeholder="请输入单价" clearable input-align="right" bind:change="bindInput">
<van-field id="unitPrice" value="{{ form.unitPrice || '' }}" type="digit" placeholder="{{form.konePrice || '请输入单价'}}" clearable input-align="right" bind:change="bindInput">
<view slot="label" class="flex text-black" style="width:200rpx">
<view class="text-red text-xl" style="line-height: 10px; padding-top: 12px">*</view>
<text>单价(元/公斤)</text>
@ -111,8 +111,8 @@
<submit-layout wx:if="{{form}}">
<view class="flex flex-center" style="flex:1;justify-content: flex-start">
<text class="text-lg" wx:if="{{amout}}">金额:</text>
<text class="text-xxl text-price text-red" wx:if="{{amout}}">{{amout}}</text>
<text class="text-lg">金额:</text>
<text class="text-xxl text-price text-red">{{amout || '- -'}}</text>
</view>
<van-button type="info" custom-style="height:88rpx;width:300rpx" bind:click="checkOrder">通过审核</van-button>
</submit-layout>

2
pages/process/order-list/index.wxml

@ -68,7 +68,7 @@
bind:click="cancelOrder" wx:if="{{item.status != 6 && item.status != 41 && item.status != 42}}">取消订单</van-button>
<van-button round type="info" custom-style="margin-left:24rpx;height:64rpx;width:200rpx" data-id="{{item.id}}"
bind:click="priceOrder" wx:if="{{item.status == 1}}">定价</van-button>
<van-button round plain type="default" custom-style="height:64rpx;width:200rpx" data-id="{{item.id}}"
<van-button round plain type="default" custom-style="margin-left:24rpx;height:64rpx;width:200rpx" data-id="{{item.id}}"
bind:click="repriceOrder" wx:if="{{item.status == 3}}">重新定价</van-button>
<van-button round type="info" custom-style="margin-left:24rpx;height:64rpx;width:200rpx" data-id="{{item.id}}"
bind:click="checkOrder" wx:if="{{item.status == 3}}">审核</van-button>

7
pages/process/order-price/index.js

@ -92,10 +92,13 @@ Scene({
onConfirm: function(e){
this.data.cIndex = e.currentTarget.dataset.index
this.data.nowItem = this.data.paperList[this.data.cIndex]
if(this.data.form.productId == this.data.nowItem.id){
this.onHide()
return
}
this.data.form.productId = this.data.nowItem.id
var konePrice = '指导价格:' + this.data.nowItem.defaultUnitPrice
// this.setData({ visible: false, ['form.productName']: this.data.nowItem.name, ['form.unitPrice']: unitPrice, cIndex: this.data.cIndex })
this.setData({ visible: false, ['form.productName']: this.data.nowItem.name, konePrice, cIndex: this.data.cIndex })
this.setData({ visible: false, ['form.productName']: this.data.nowItem.name, ['form.unitPrice']: '', konePrice, cIndex: this.data.cIndex })
},
loop: function(){
return false

10
pages/process/outside-add/index.js

@ -110,14 +110,18 @@ Scene({
onCateConfirm: function(e){
this.data.cIndex = e.currentTarget.dataset.index
var nowItem = this.data.paperList[this.data.cIndex]
if(nowItem.id == this.data.form.productCategoryInfos[this.data.cateIndex].productId){
this.setData({ visible2: false })
return
}
for (var index = 0; index < this.data.form.productCategoryInfos.length; index++) {
if (this.data.form.productCategoryInfos[index].productId == nowItem.id && this.data.cateIndex != index){
this.setData({ visible: false })
util.showToast('纸品已经存在,请不要重复添加')
util.showToast('纸品已经存在,请不要重复添加')
return
}
}
var product = {productId: nowItem.id, productCategoryName: nowItem.name, unitPrice: nowItem.defaultUnitPrice}
var konePrice = '指导价格:' + nowItem.defaultUnitPrice
var product = {productId: nowItem.id, productCategoryName: nowItem.name, unitPrice: '', konePrice}
product.highestUnitPrice = nowItem.highestUnitPrice
product.lowestUnitPrice = nowItem.lowestUnitPrice
this.setData({ visible2: false, ['form.productCategoryInfos[' + this.data.cateIndex + ']']: product })

2
pages/process/outside-add/index.wxml

@ -68,7 +68,7 @@
<view class="{{item.productCategoryName ? 'text-black' : 'text-gray'}}">{{item.productCategoryName || '请选择品类'}}</view>
</view>
</van-cell>
<van-field data-index="{{index}}" value="{{ item.unitPrice || '' }}" type="digit" placeholder="请输入单价" clearable border="{{ false }}" input-align="right" bind:change="bindInput">
<van-field data-index="{{index}}" value="{{ item.unitPrice || '' }}" type="digit" placeholder="{{item.konePrice || '请输入单价'}}" clearable border="{{ false }}" input-align="right" bind:change="bindInput">
<view slot="label" class="flex text-black" style="width:200rpx">
<view class="text-red text-xl" style="line-height: 10px; padding-top: 12px">*</view>
<text>单价(元/公斤)</text>

7
pages/process/outside-check-item/index.js

@ -25,6 +25,10 @@ Component({
onConfirm: function(e){
this.data.cIndex = e.currentTarget.dataset.index
var nowItem = this.data.list[this.data.cIndex]
if(this.data.item.productId == nowItem.id){
this.onHide()
return
}
for (var i = 0; i < this.data.form.productCategoryInfos.length; i++) {
if (this.data.form.productCategoryInfos[i].productId == nowItem.id){
this.setData({ visible: false })
@ -33,7 +37,8 @@ Component({
}
}
this.data.item.productId = nowItem.id
this.data.item.settleUnitPrice = nowItem.defaultUnitPrice
this.data.item.settleUnitPrice = ''
this.data.item.konePrice = '指导价格:' + nowItem.defaultUnitPrice
this.data.item.highestUnitPrice = nowItem.highestUnitPrice
this.data.item.lowestUnitPrice = nowItem.lowestUnitPrice
this.data.item.productCategoryName = nowItem.name

2
pages/process/outside-check-item/index.wxml

@ -19,7 +19,7 @@
maxlength="8" placeholder="请输入结算单价" value="{{item.settleUnitPrice || ''}}" bindinput="bindInput" />
</view>
</van-cell> -->
<van-field id="settleUnitPrice" value="{{ item.settleUnitPrice || '' }}" type="digit" placeholder="请输入结算单价" clearable input-align="right" bind:change="bindInput">
<van-field id="settleUnitPrice" value="{{ item.settleUnitPrice || '' }}" type="digit" placeholder="{{item.konePrice || '请输入单价'}}" clearable input-align="right" bind:change="bindInput">
<view slot="label" class="flex text-black" style="width:240rpx">
<view class="text-red text-xl" style="line-height: 10px; padding-top: 12px">*</view>
<text>结算单价(元/公斤)</text>

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

@ -94,10 +94,19 @@ Scene({
onConfirm: function(e){
this.data.cIndex = e.currentTarget.dataset.index
this.data.nowItem = this.data.paperList[this.data.cIndex]
if(this.data.form.categoryId == this.data.nowItem.id){
this.setData({ visible: false })
return
}
this.data.form.categoryId = this.data.nowItem.id
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']: this.data.nowItem.name, ['form.settleUnitPrice']: price, cIndex: this.data.cIndex })
this.setData({
visible: false,
['form.categoryName']: this.data.nowItem.name,
['form.settleUnitPrice']: '',
['form.konePrice']: '指导价格:' + math.times(this.data.nowItem.defaultUnitPrice, 1000),
cIndex: this.data.cIndex
})
} else {
this.setData({ visible: false, ['form.categoryName']: this.data.nowItem.name, cIndex: this.data.cIndex })
}
@ -159,6 +168,16 @@ Scene({
})
})
},
printOrderInfo: function(){
wx.showLoading({ title: '正在处理', mask: true })
printOrder({id: this.data.orderInfo.id, printType: 3 }).then(result => {
wx.hideLoading()
util.showToast('即将打印,请稍后')
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
},
settlementForm: function(){
if(util.isEmpty(this.data.form.categoryId) || Number(this.data.form.categoryId) <= 0){
util.showToast('请选择废纸品类')

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

@ -18,7 +18,7 @@
<view class="{{form.categoryName ? 'text-black' : 'text-gray'}}">{{form.categoryName || '请选择废纸品类'}}</view>
</view>
</van-cell>
<van-field id="settleUnitPrice" value="{{ form.settleUnitPrice || '' }}" type="digit" placeholder="请输入结算单价" clearable input-align="right" bind:change="bindInput">
<van-field id="settleUnitPrice" value="{{ form.settleUnitPrice || '' }}" type="digit" placeholder="{{form.konePrice || '请输入结算单价'}}" clearable input-align="right" bind:change="bindInput">
<view slot="label" class="flex text-black" style="width:240rpx">
<view class="text-red text-xl" style="line-height: 10px; padding-top: 12px">*</view>
<text>结算单价(元/吨)</text>
@ -148,6 +148,12 @@
</van-collapse-item>
</van-collapse>
<view style="border-radius: 50rpx;position:fixed;bottom:{{160 + safeBottom}}rpx;right:50rpx" wx:if="{{poundInfo.secondWeight}}">
<van-button round bind:click="printOrderInfo" custom-style="width: 100rpx;height: 100rpx;padding-top:12rpx">
<van-icon name="/assets/image/icon-print.png" size="100rpx"/>
</van-button>
</view>
<view style="height:16rpx" wx:if="{{orderInfo && orderInfo.status == 1}}"></view>
<submit-layout wx:if="{{orderInfo && orderInfo.status == 1}}">
<van-button type="danger" custom-style="height:88rpx;width:254rpx" bind:click="closeForm">关闭订单</van-button>

Loading…
Cancel
Save