Browse Source

no message

feature/v1.3
xpz2018 5 years ago
parent
commit
02d7d506a5
7 changed files with 62 additions and 75 deletions
  1. 6
      pages/process/index/index.js
  2. 13
      pages/storage/order-info/index.js
  3. 8
      pages/storage/order-info/index.wxml
  4. 18
      pages/storage/order-list/index.js
  5. 75
      pages/storage/order-list/index.wxml
  6. 3
      pages/storage/order-list/index.wxss
  7. 14
      pages/storage/order-settlement/index.js

6
pages/process/index/index.js

@ -112,11 +112,11 @@ Component({
if(e.currentTarget.dataset.status == 1){
wx.navigateTo({ url: '/pages/storage/pound-list/index' })
} else if(e.currentTarget.dataset.status == 2){
wx.navigateTo({ url: '/pages/storage/order-list/index?status=1' })
wx.navigateTo({ url: '/pages/storage/order-list/index?status=0' })
} else if(e.currentTarget.dataset.status == 3){
wx.navigateTo({ url: '/pages/storage/order-list/index?status=2' })
wx.navigateTo({ url: '/pages/storage/order-list/index?status=1' })
} else if(e.currentTarget.dataset.status == 4){
wx.navigateTo({ url: '/pages/storage/order-list/index?status=3' })
wx.navigateTo({ url: '/pages/storage/order-list/index?status=2' })
} else {
wx.navigateTo({ url: '/pages/storage/order-list/index' })
}

13
pages/storage/order-info/index.js

@ -16,6 +16,7 @@ Scene({
poundInfo: null,
orderInfo: null,
activeNames: [],
auditable: false,
fileList: []
},
/**
@ -39,7 +40,7 @@ Scene({
if(result.data.weightNote.secondWeightImageUrls2){
result.data.weightNote.totalWeighingPicture.push(result.data.weightNote.secondWeightImageUrls2)
}
if(result.data.outboundDeliveryOrderSettlementInfo){
if(result.data.outboundDeliveryOrderSettlementInfo.id){
this.data.fileList = []
if(result.data.outboundDeliveryOrderSettlementInfo.weightNoteImageUrlsArr){
for (let index = 0; index < result.data.outboundDeliveryOrderSettlementInfo.weightNoteImageUrlsArr.length; index++) {
@ -55,10 +56,14 @@ Scene({
fileList: this.data.fileList
})
} else {
if(app.userInfo.type.indexOf('ADMIN') >= 0 && result.data.outboundDeliveryOrder.status == 0){
this.data.auditable = true
}
this.setData({
safeBottom: app.globalData.safeBottom,
poundInfo: result.data.weightNote,
orderInfo: result.data.outboundDeliveryOrder
orderInfo: result.data.outboundDeliveryOrder,
auditable: this.data.auditable
})
}
wx.hideLoading()
@ -75,7 +80,7 @@ Scene({
if(e.currentTarget.id == 'refuse'){
Dialog.confirm({ title: '温馨提示', message: '确定此出货单有问题,进行驳回?' }).then(() => {
wx.showLoading({ title: '正在处理', mask: true })
auditOutOrder({id: this.data.form.id, auditStatus: 0 }).then(result => {
auditOutOrder({id: this.data.orderInfo.id, auditStatus: 0 }).then(result => {
wx.hideLoading()
util.showBackToast('出货单已经驳回')
event.emit('OrderMessage', { what: 21, desc: 'cancelOrder' })
@ -86,7 +91,7 @@ Scene({
})
} else {
wx.showLoading({ title: '正在处理', mask: true })
auditOutOrder({id: this.data.form.id, auditStatus: 1 }).then(result => {
auditOutOrder({id: this.data.orderInfo.id, auditStatus: 1 }).then(result => {
wx.hideLoading()
util.showBackToast('出货单已经通过审核')
event.emit('OrderMessage', { what: 21, desc: 'cancelOrder' })

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

@ -217,10 +217,10 @@
</van-collapse-item>
</van-collapse>
</view>
<view style="height:{{136 + safeBottom}}rpx;" wx:if="{{orderInfo.status == 0 || orderInfo.status == 1}}"></view>
<view class="cu-bar bg-white foot" style="height:{{120 + safeBottom}}rpx;padding:0rpx 32rpx {{safeBottom}}rpx 32rpx;" wx:if="{{orderInfo.status == 0 || orderInfo.status == 1}}">
<van-button id="refuse" type="danger" custom-style="height:88rpx;width:254rpx" bind:click="submitForm" wx:if="{{orderInfo.status == 0}}">审核不通过</van-button>
<van-button id="agree" type="info" custom-style="margin-left:32rpx;height:88rpx;width:400rpx" bind:click="submitForm" wx:if="{{orderInfo.status == 0}}">审核通过</van-button>
<view style="height:{{136 + safeBottom}}rpx;" wx:if="{{auditable || orderInfo.status == 1}}"></view>
<view class="cu-bar bg-white foot" style="height:{{120 + safeBottom}}rpx;padding:0rpx 32rpx {{safeBottom}}rpx 32rpx;" wx:if="{{auditable || orderInfo.status == 1}}">
<van-button id="refuse" type="danger" custom-style="height:88rpx;width:254rpx" bind:click="submitForm" wx:if="{{auditable}}">审核不通过</van-button>
<van-button id="agree" type="info" custom-style="margin-left:32rpx;height:88rpx;width:400rpx" bind:click="submitForm" wx:if="{{auditable}}">审核通过</van-button>
<van-button type="info" custom-style="height:88rpx;width:686rpx" bind:click="settleForm" wx:if="{{orderInfo.status == 1}}">收款结算</van-button>
</view>

18
pages/storage/order-list/index.js

@ -13,10 +13,10 @@ Scene({
tabIndex: 0,
tabList: [
{id: 0, name: '全部', badge: 0, status: '' },
{id: 1, name: '待审核', badge: 0, status: 1 },
{id: 2, name: '待收款', badge: 0, status: 2 },
{id: 3, name: '已完成', badge: 0, status: 3 },
{id: 4, name: '已关闭', badge: 0, status: 5 }
{id: 1, name: '待审核', badge: 0, status: 0 },
{id: 2, name: '待收款', badge: 0, status: 1 },
{id: 3, name: '已完成', badge: 0, status: 2 },
{id: 4, name: '已关闭', badge: 0, status: 3 }
// {id: 8, name: '已取消', badge: 0, status: 6 }
],
loading: true,
@ -33,10 +33,10 @@ Scene({
},
// * 生命周期函数--监听页面加载
onLoad: function (options) {
if(options.status){
this.data.form.status = options.status
if(!util.isEmpty(options.status) || Number(options.status) == 0){
this.data.form.status = Number(options.status)
for (let index = 0; index < this.data.tabList.length; index++) {
if(this.data.tabList[index].status == Number(options.status)){
if(this.data.tabList[index].status === Number(options.status)){
this.data.tabIndex = index
break
}
@ -137,9 +137,9 @@ Scene({
lookItem: function (e) {
var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index]
if(item.status == 1){
wx.navigateTo({ url: `/pages/storage/order-settlement/index?id=${item.id}` })
wx.navigateTo({ url: `/pages/storage/order-settlement/index?id=${item.weightNoteId}` })
} else [
wx.navigateTo({ url: `/pages/storage/order-info/index?id=${item.id}` })
wx.navigateTo({ url: `/pages/storage/order-info/index?id=${item.weightNoteId}` })
]
},
onUnload: function(){

75
pages/storage/order-list/index.wxml

@ -20,55 +20,20 @@
<view style="background-color:#f3f3f3;" wx:if="{{item.tipsTime}}">
<text class="text-sg" style="line-height:64rpx;padding-left:32rpx">{{item.tipsTime}}</text>
</view>
<view class="item-content" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem">
<view class="flex flex-justify" wx:if="{{item.status == 1 || item.status == 2 || item.status == 3}}">
<view style="height: 88rpx">
<view class="flex flex-center text-sg text-black">
<text>客户名称:{{item.factoryCustomerName}}</text>
<text wx:if="{{item.status != 1 && item.factoryCustomerMobile}}">({{item.factoryCustomerMobile}})</text>
</view>
<view class="text-sm text-gray" style="margin-top:12rpx" wx:if="{{item.status == 1}}">毛重:{{item.totalWeight}}公斤</view>
<view class="flex flex-justify" style="margin-top:12rpx" wx:if="{{item.status == 2}}">
<view class="text-sm text-gray">品类:{{item.productName}}</view>
<view class="text-sm text-gray">毛重:{{item.totalWeight}}公斤</view>
</view>
<view class="flex flex-justify" style="margin-top:12rpx" wx:if="{{item.status == 3}}">
<view class="text-sm text-gray">品类:{{item.productName}}</view>
<view class="text-sm text-gray">金额:{{item.settlePrice}}元</view>
</view>
</view>
<view class="flex flex-center" wx:if="{{item.status == 1}}" style="height: 88rpx">
<van-button plain type="default" custom-style="height:64rpx;width:132rpx" data-id="{{item.id}}"
bind:click="cancelOrder">取消</van-button>
<van-button plain type="info" custom-style="margin-left:24rpx;height:64rpx;width:132rpx" data-id="{{item.id}}"
bind:click="priceOrder">定价</van-button>
</view>
<view class="flex flex-center" wx:elif="{{item.status ==2}}">
<view class="text-df text-black">待过皮重</view>
</view>
<view class="flex flex-center" wx:if="{{item.status == 3}}" style="height: 88rpx">
<van-button plain type="info" custom-style="height:64rpx;width:132rpx" data-id="{{item.id}}"
bind:click="checkOrder">审核</van-button>
<view style="border-bottom:1rpx solid #f3f3f3" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem">
<view class="flex flex-justify" style="padding:24rpx 32rpx;border-bottom:2rpx solid #f3f3f3">
<view class="flex">
<text class="text-bold">出货纸厂:{{item.consigneeName}}</text>
</view>
<text class="text-bold">{{statusOrder(item.status)}}</text>
</view>
<view wx:else>
<view class="flex flex-justify">
<view class="flex flex-center">
<text>客户名称:{{item.factoryCustomerName}}</text>
<text wx:if="{{item.factoryCustomerMobile}}">({{item.factoryCustomerMobile}})</text>
</view>
<view class="flex" >
<view class="text-df" style="color:#FA541C" wx:if="{{item.status == 4}}">待付款</view>
<view class="text-df" style="color:#028A00" wx:elif="{{item.status == 41}}">代付中</view>
<view class="text-df" style="color:#028A00" wx:elif="{{item.status == 42}}">待结算</view>
<view class="text-df" style="color:#028A00" wx:elif="{{item.status == 5}}">已完成</view>
</view>
</view>
<view class="flex flex-justify" style="margin-top:12rpx">
<view class="text-sm text-gray">品类:{{item.productName}}</view>
<view class="text-sm text-gray">重量:{{item.settleWeight}}公斤</view>
<view class="text-sm text-gray">金额:{{item.settlePrice}}元</view>
</view>
<view class="flex flex-justify" style="padding:0rpx 32rpx;margin-top:16rpx">
<text>品类:{{item.productName}}</text>
<text>净重(公斤):{{item.netWeight || ''}}</text>
</view>
<view class="flex flex-justify" style="padding:0rpx 32rpx 24rpx 32rpx;margin-top:16rpx">
<text>车牌号码:{{item.plateNumber}}</text>
<text>出货人:{{item.operaterName || ''}}</text>
</view>
</view>
</view>
@ -81,4 +46,18 @@
</refresh-view>
<van-dialog id="van-dialog" />
<notification id="qn-notification"/>
<notification id="qn-notification"/>
<wxs module="statusOrder">
function statusOrder(status) {
if(status == 0){
return '待审核'
} else if(status == 1){
return '待收款'
} else if(status == 2){
return '已完成'
} else if(status == 3){
return '已关闭'
}
}
module.exports = statusOrder
</wxs>

3
pages/storage/order-list/index.wxss

@ -1,7 +1,6 @@
/* pages/process/order-list/index.wxss */
.item-content{
padding: 20rpx 32rpx 20rpx 0rpx;
padding: 20rpx 32rpx;
border-bottom:1rpx solid #f3f3f3;
margin-left:32rpx;
align-items: flex-start;
}

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

@ -54,7 +54,7 @@ Scene({
if(result.data.weightNote.secondWeightImageUrls2){
result.data.weightNote.totalWeighingPicture.push(result.data.weightNote.secondWeightImageUrls2)
}
if(result.data.outboundDeliveryOrderSettlementInfo){
if(result.data.outboundDeliveryOrderSettlementInfo.id){
this.setData({
safeBottom: app.globalData.safeBottom,
poundInfo: result.data.weightNote,
@ -62,6 +62,7 @@ Scene({
form: result.data.outboundDeliveryOrderSettlementInfo
})
} else {
this.data.form.id = result.data.outboundDeliveryOrder.id
this.setData({
safeBottom: app.globalData.safeBottom,
poundInfo: result.data.weightNote,
@ -101,11 +102,11 @@ Scene({
this.setData({ visible: false, ['form.categoryName']: detail.value })
},
bindInput: function (e) {
this.data.form[e.target.id] = e.detail.value
this.data.form[e.target.id] = Number(e.detail.value)
if(e.target.id == 'netWeight'){
if(!util.isEmpty(this.data.form.deductPercent) && Number(this.data.form.deductPercent) > 0){
var deductWeight = math.divide(math.times(this.data.form.netWeight, this.data.form.deductPercent), 100)
this.setData({ ['form.settleWeight']: math.minus(this.data.form.netWeight, deductWeight).toFixed(2) })
this.setData({ ['form.settleWeight']: math.minus(this.data.form.netWeight, deductWeight) })
} else {
this.setData({ ['form.settleWeight']: e.detail.value })
}
@ -113,7 +114,7 @@ Scene({
if(!util.isEmpty(this.data.form.netWeight) && Number(this.data.form.netWeight) > 0){
if(Number(this.data.form.deductPercent) < 100){
var deductWeight = math.divide(math.times(this.data.form.netWeight, this.data.form.deductPercent), 100)
this.setData({ ['form.settleWeight']: math.minus(this.data.form.netWeight, deductWeight).toFixed(2) })
this.setData({ ['form.settleWeight']: math.minus(this.data.form.netWeight, deductWeight) })
} else {
this.setData({ ['form.settleWeight']: '' })
}
@ -138,7 +139,7 @@ Scene({
if(!util.isEmpty(this.data.form.otherFee)){
amout = math.minus(amout, this.data.form.otherFee)
}
this.setData({ ['form.settlePrice']: amout.toFixed(2) })
this.setData({ ['form.settlePrice']: amout })
}
},
fileChange: function({detail}){
@ -165,14 +166,17 @@ Scene({
util.showToast('请输入结算单价')
return
}
this.data.form.settleUnitPrice = math.divide(this.data.form.settleUnitPrice, 1000)
if(util.isEmpty(this.data.form.netWeight) || Number(this.data.form.netWeight) <= 0){
util.showToast('请输入净重')
return
}
this.data.form.netWeight = math.times(this.data.form.netWeight, 1000)
if(util.isEmpty(this.data.form.settleWeight) || Number(this.data.form.settleWeight) <= 0){
util.showToast('请输入结算重量')
return
}
this.data.form.settleWeight = math.times(this.data.form.settleWeight, 1000)
wx.showLoading({ title: '正在处理', mask: true })
var weightNoteImageUrls = []
for (let index = 0; index < this.data.fileList.length; index++) {

Loading…
Cancel
Save