diff --git a/pages/process/index/index.js b/pages/process/index/index.js index 22c49fd..1a41726 100644 --- a/pages/process/index/index.js +++ b/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' }) } diff --git a/pages/storage/order-info/index.js b/pages/storage/order-info/index.js index 10d71c1..7f37580 100644 --- a/pages/storage/order-info/index.js +++ b/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' }) diff --git a/pages/storage/order-info/index.wxml b/pages/storage/order-info/index.wxml index 031cd05..8acee68 100644 --- a/pages/storage/order-info/index.wxml +++ b/pages/storage/order-info/index.wxml @@ -217,10 +217,10 @@ - - - 审核不通过 - 审核通过 + + + 审核不通过 + 审核通过 收款结算 diff --git a/pages/storage/order-list/index.js b/pages/storage/order-list/index.js index 11f58ed..ae7a7e2 100644 --- a/pages/storage/order-list/index.js +++ b/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(){ diff --git a/pages/storage/order-list/index.wxml b/pages/storage/order-list/index.wxml index 8969e3d..efcc31c 100644 --- a/pages/storage/order-list/index.wxml +++ b/pages/storage/order-list/index.wxml @@ -20,55 +20,20 @@ {{item.tipsTime}} - - - - - 客户名称:{{item.factoryCustomerName}} - ({{item.factoryCustomerMobile}}) - - 毛重:{{item.totalWeight}}公斤 - - 品类:{{item.productName}} - 毛重:{{item.totalWeight}}公斤 - - - 品类:{{item.productName}} - 金额:{{item.settlePrice}}元 - - - - 取消 - 定价 - - - 待过皮重 - - - 审核 + + + + 出货纸厂:{{item.consigneeName}} + {{statusOrder(item.status)}} - - - - 客户名称:{{item.factoryCustomerName}} - ({{item.factoryCustomerMobile}}) - - - 待付款 - 代付中 - 待结算 - 已完成 - - - - 品类:{{item.productName}} - 重量:{{item.settleWeight}}公斤 - 金额:{{item.settlePrice}}元 - + + 品类:{{item.productName}} + 净重(公斤):{{item.netWeight || ''}} + + + 车牌号码:{{item.plateNumber}} + 出货人:{{item.operaterName || ''}} @@ -81,4 +46,18 @@ - \ No newline at end of file + + + 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 + \ No newline at end of file diff --git a/pages/storage/order-list/index.wxss b/pages/storage/order-list/index.wxss index bc19567..f4c8ecc 100644 --- a/pages/storage/order-list/index.wxss +++ b/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; } \ No newline at end of file diff --git a/pages/storage/order-settlement/index.js b/pages/storage/order-settlement/index.js index b07c16c..8d11c8a 100644 --- a/pages/storage/order-settlement/index.js +++ b/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++) {