diff --git a/components/icon/index.wxss b/components/icon/index.wxss index efea571..26fc99e 100644 --- a/components/icon/index.wxss +++ b/components/icon/index.wxss @@ -940,7 +940,6 @@ display: -webkit-inline-flex; display: inline-flex; padding-top: 4rpx; - margin-right: -8rpx; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; diff --git a/pages/formate.wxs b/pages/formate.wxs index 1856223..0a74ffd 100644 --- a/pages/formate.wxs +++ b/pages/formate.wxs @@ -63,9 +63,37 @@ function formateWeight(weight) { return (parseFloat(weight) / 1000).toFixed(2) } +function maxWeight(fweight, sweight) { + if(fweight && sweight){ + if(fweight > sweight){ + return fweight + } + return sweight + } + if(sweight){ + return sweight + } + return '- -' +} + +function minWeight(fweight, sweight) { + if(fweight && sweight){ + if(fweight < sweight){ + return fweight + } + return sweight + } + if(fweight){ + return fweight + } + return '- -' +} + module.exports = { formateAmount: formateAmount, formateWeight: formateWeight, formatTime: formatTime, - formateDate: formateDate + formateDate: formateDate, + maxWeight: maxWeight, + minWeight: minWeight } \ No newline at end of file diff --git a/pages/process/index/index.js b/pages/process/index/index.js index 5748acc..22c49fd 100644 --- a/pages/process/index/index.js +++ b/pages/process/index/index.js @@ -110,7 +110,6 @@ Component({ }, outList: function(e){ if(e.currentTarget.dataset.status == 1){ - // wx.navigateTo({ url: '/pages/storage/order-settlement/index?id=579730676195135488' }) 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' }) diff --git a/pages/storage/order-create/index.js b/pages/storage/order-create/index.js index 240b131..bd50048 100644 --- a/pages/storage/order-create/index.js +++ b/pages/storage/order-create/index.js @@ -11,7 +11,8 @@ Scene({ */ data: { safeBottom: app.globalData.safeBottom, - form: null, + form: {}, + poundInfo: null, activeNames: [], columns: [], visible: false, @@ -36,8 +37,21 @@ Scene({ }) getPoundInfo(options.id).then(result => { wx.hideLoading() - result.data.sign = 1 - this.setData({ form: result.data }) + result.data.emptyWeighingPicture = [] + if(result.data.firstWeightImageUrls1){ + result.data.emptyWeighingPicture.push(result.data.firstWeightImageUrls1) + } + if(result.data.firstWeightImageUrls2){ + result.data.emptyWeighingPicture.push(result.data.firstWeightImageUrls2) + } + result.data.totalWeighingPicture = [] + if(result.data.secondWeightImageUrls1){ + result.data.totalWeighingPicture.push(result.data.secondWeightImageUrls1) + } + if(result.data.secondWeightImageUrls2){ + result.data.totalWeighingPicture.push(result.data.secondWeightImageUrls2) + } + this.setData({ poundInfo: result.data }) }).catch(err => { wx.hideLoading() util.showToast(err) @@ -51,7 +65,13 @@ Scene({ events: { onCallback: (data) => { if (data.what == 140) { - that.data.form.facttoryId = data.detail.id + if(data.detail.paperMillId){ + that.data.form.deliveryChannelType = 2 + that.data.form.factoryDeliveryChannelId = data.detail.paperMillId + } else { + that.data.form.deliveryChannelType = 1 + that.data.form.factoryDeliveryChannelId = data.detail.id + } that.setData({ ['form.factoryName']: data.detail.name }) } } @@ -105,6 +125,7 @@ Scene({ util.showToast('请输入车牌号码') return } + this.data.form.weightNoteId = this.data.poundInfo.id wx.showLoading({ title: '正在处理', mask: true }) createOutOrder(this.data.form).then(result => { wx.hideLoading() @@ -114,5 +135,18 @@ Scene({ wx.hideLoading() util.showToast(err) }) + }, + viewImage: function (e) { + var imgList = [] + if(e.currentTarget.dataset.type == 0){ + for (let index = 0; index < this.data.poundInfo.totalWeighingPicture.length; index++) { + imgList.push(this.data.poundInfo.totalWeighingPicture[index]) + } + } else { + for (let index = 0; index < this.data.poundInfo.emptyWeighingPicture.length; index++) { + imgList.push(this.data.poundInfo.emptyWeighingPicture[index]) + } + } + wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url }) } }) \ No newline at end of file diff --git a/pages/storage/order-create/index.wxml b/pages/storage/order-create/index.wxml index 50fcb40..1208dcb 100644 --- a/pages/storage/order-create/index.wxml +++ b/pages/storage/order-create/index.wxml @@ -1,4 +1,5 @@ + 出货信息 @@ -25,8 +26,8 @@ 纸品包数 - + @@ -50,53 +51,53 @@ - + - + 第一次过磅(皮重) - {{form.factoryCustomerName}} + {{formate.minWeight(poundInfo.firstWeight, poundInfo.secondWeight)}} - - + + - + 第二次过磅(毛重) - 重量(公斤):34250 + 重量(公斤):{{formate.maxWeight(poundInfo.firstWeight, poundInfo.secondWeight)}} - - + + - + 净重(公斤) - {{form.createTime}} + {{form.netWeight}} - + 过磅人 - {{form.createTime}} + {{poundInfo.operaterName}} - - + + 提交 diff --git a/pages/storage/order-info/index.js b/pages/storage/order-info/index.js index fe48536..10d71c1 100644 --- a/pages/storage/order-info/index.js +++ b/pages/storage/order-info/index.js @@ -13,7 +13,10 @@ Scene({ data: { safeBottom: app.globalData.safeBottom, form: null, + poundInfo: null, + orderInfo: null, activeNames: [], + fileList: [] }, /** * 生命周期函数--监听页面加载 @@ -22,8 +25,43 @@ Scene({ if(options.id){ wx.showLoading({ title: '正在获取', mask: true }) getOutOrderInfo(options.id).then(result => { + result.data.weightNote.emptyWeighingPicture = [] + if(result.data.weightNote.firstWeightImageUrls1){ + result.data.weightNote.emptyWeighingPicture.push(result.data.weightNote.firstWeightImageUrls1) + } + if(result.data.weightNote.firstWeightImageUrls2){ + result.data.weightNote.emptyWeighingPicture.push(result.data.weightNote.firstWeightImageUrls2) + } + result.data.weightNote.totalWeighingPicture = [] + if(result.data.weightNote.secondWeightImageUrls1){ + result.data.weightNote.totalWeighingPicture.push(result.data.weightNote.secondWeightImageUrls1) + } + if(result.data.weightNote.secondWeightImageUrls2){ + result.data.weightNote.totalWeighingPicture.push(result.data.weightNote.secondWeightImageUrls2) + } + if(result.data.outboundDeliveryOrderSettlementInfo){ + this.data.fileList = [] + if(result.data.outboundDeliveryOrderSettlementInfo.weightNoteImageUrlsArr){ + for (let index = 0; index < result.data.outboundDeliveryOrderSettlementInfo.weightNoteImageUrlsArr.length; index++) { + const element = result.data.outboundDeliveryOrderSettlementInfo.weightNoteImageUrlsArr[index] + this.data.fileList.push({ url: element}) + } + } + this.setData({ + safeBottom: app.globalData.safeBottom, + poundInfo: result.data.weightNote, + orderInfo: result.data.outboundDeliveryOrder, + form: result.data.outboundDeliveryOrderSettlementInfo, + fileList: this.data.fileList + }) + } else { + this.setData({ + safeBottom: app.globalData.safeBottom, + poundInfo: result.data.weightNote, + orderInfo: result.data.outboundDeliveryOrder + }) + } wx.hideLoading() - this.setData({ safeBottom: app.globalData.safeBottom, form: result.data }) }).catch(err => { wx.hideLoading() util.showToast(err) @@ -57,5 +95,8 @@ Scene({ util.showToast(err) }) } + }, + settleForm: function(){ + wx.redirectTo({ url: `/pages/storage/order-settlement/index?id=${this.data.orderInfo.id}` }) } }) \ No newline at end of file diff --git a/pages/storage/order-info/index.json b/pages/storage/order-info/index.json index 3df4ac0..546c462 100644 --- a/pages/storage/order-info/index.json +++ b/pages/storage/order-info/index.json @@ -6,9 +6,11 @@ "van-loading": "/components/loading/index", "van-image": "/components/image/index", "van-button": "/components/button/index", + "van-notice-bar": "/components/notice-bar/index", "van-dialog": "/components/dialog/index", "van-collapse": "/components/collapse/index", "van-collapse-item": "/components/collapse-item/index", + "van-uploader": "/components/uploader/index", "notification": "/pages/message/notification/index" } } \ No newline at end of file diff --git a/pages/storage/order-info/index.wxml b/pages/storage/order-info/index.wxml index e690ea2..031cd05 100644 --- a/pages/storage/order-info/index.wxml +++ b/pages/storage/order-info/index.wxml @@ -1,93 +1,242 @@ + 出货详情 - - - - - 收货方名称 - {{form.factoryName || ''}} - - - - - 废纸品类 - {{form.productName || ''}} - - - - - 纸品包数 - {{form.packageNumber || ''}} - - - - - 车牌号码 - {{form.plateNumber || ''}} - - - - - 司机姓名 - {{ form.driverName || ''}} - - - - - - - - + + + + + - 第一次过磅(皮重) - {{form.factoryCustomerName}} + 收货方名称 + {{orderInfo.consigneeName || ''}} - - - - - - - - + + + 废纸品类 + {{orderInfo.productName || ''}} + + + + + 纸品包数 + {{orderInfo.packageNumber || ''}} + + + + + 车牌号码 + {{orderInfo.plateNumber || ''}} + + + - 第二次过磅(毛重) - 重量(公斤):34250 + 司机姓名 + {{ orderInfo.driverName || ''}} - - - - + + + + + + + + 第一次过磅(皮重) + {{formate.minWeight(poundInfo.firstWeight, poundInfo.secondWeight)}} + + + + + + + + + + + + 第二次过磅(毛重) + 重量(公斤):{{formate.maxWeight(poundInfo.firstWeight, poundInfo.secondWeight)}} + + + + + + + + + + + + 净重(公斤) + {{form.netWeight}} + + + + + 过磅人 + {{poundInfo.operaterName}} - + + + + + + + + + + 纸品品类 + {{orderInfo.categoryName || ''}} + + + + + 结算单价(元/吨) + {{orderInfo.settleUnitPrice || ''}} + + + + + 净重(吨) + {{formate.formateWeight(orderInfo.netWeight)}} + + + + + 结算重量(吨) + {{formate.formateWeight(orderInfo.settleWeight)}} + + + + + 扣点(%) + {{ orderInfo.deductPercent || ''}} + + + + + 其他费用(元) + {{ orderInfo.otherFee}} + + + + + 结算金额(元) + {{ orderInfo.settlePrice}} + + + + + 纸厂磅单 + + - + + + + + - 净重(公斤) - {{form.createTime}} + 收货方名称 + {{orderInfo.consigneeName || ''}} - + - 过磅人 - {{form.createTime}} + 废纸品类 + {{orderInfo.productName || ''}} + + + 纸品包数 + {{orderInfo.packageNumber || ''}} + + + + + 车牌号码 + {{orderInfo.plateNumber || ''}} + + + + + 司机姓名 + {{ orderInfo.driverName || ''}} + + + - - - - - 审核不通过 - 审核通过 + + + + 第一次过磅(皮重) + {{formate.minWeight(poundInfo.firstWeight, poundInfo.secondWeight)}} + + + + + + + + + + + + 第二次过磅(毛重) + 重量(公斤):{{formate.maxWeight(poundInfo.firstWeight, poundInfo.secondWeight)}} + + + + + + + + + + + + 净重(公斤) + {{form.netWeight}} + + + + + 过磅人 + {{poundInfo.operaterName}} + + + + + + + + 审核不通过 + 审核通过 + 收款结算 + + 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 + diff --git a/pages/storage/order-list/index.js b/pages/storage/order-list/index.js index e0f4fc5..11f58ed 100644 --- a/pages/storage/order-list/index.js +++ b/pages/storage/order-list/index.js @@ -136,7 +136,11 @@ Scene({ }, lookItem: function (e) { var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index] - wx.navigateTo({ url: `/pages/storage/order-price/index?id=${item.id}` }) + if(item.status == 1){ + wx.navigateTo({ url: `/pages/storage/order-settlement/index?id=${item.id}` }) + } else [ + wx.navigateTo({ url: `/pages/storage/order-info/index?id=${item.id}` }) + ] }, onUnload: function(){ event.remove('OrderMessage', this) diff --git a/pages/storage/order-settlement/index.js b/pages/storage/order-settlement/index.js index 8ddc1b1..b07c16c 100644 --- a/pages/storage/order-settlement/index.js +++ b/pages/storage/order-settlement/index.js @@ -14,6 +14,7 @@ Scene({ data: { safeBottom: app.globalData.safeBottom, form: {}, + poundInfo: null, orderInfo: null, activeNames: [], columns: [], @@ -39,9 +40,35 @@ Scene({ util.showToast(err) }) getOutOrderInfo(options.id).then(result => { + result.data.weightNote.emptyWeighingPicture = [] + if(result.data.weightNote.firstWeightImageUrls1){ + result.data.weightNote.emptyWeighingPicture.push(result.data.weightNote.firstWeightImageUrls1) + } + if(result.data.weightNote.firstWeightImageUrls2){ + result.data.weightNote.emptyWeighingPicture.push(result.data.weightNote.firstWeightImageUrls2) + } + result.data.weightNote.totalWeighingPicture = [] + if(result.data.weightNote.secondWeightImageUrls1){ + result.data.weightNote.totalWeighingPicture.push(result.data.weightNote.secondWeightImageUrls1) + } + if(result.data.weightNote.secondWeightImageUrls2){ + result.data.weightNote.totalWeighingPicture.push(result.data.weightNote.secondWeightImageUrls2) + } + if(result.data.outboundDeliveryOrderSettlementInfo){ + this.setData({ + safeBottom: app.globalData.safeBottom, + poundInfo: result.data.weightNote, + orderInfo: result.data.outboundDeliveryOrder, + form: result.data.outboundDeliveryOrderSettlementInfo + }) + } else { + this.setData({ + safeBottom: app.globalData.safeBottom, + poundInfo: result.data.weightNote, + orderInfo: result.data.outboundDeliveryOrder + }) + } wx.hideLoading() - this.data.form.id = result.data.id - this.setData({ orderInfo: result.data }) }).catch(err => { wx.hideLoading() util.showToast(err) @@ -165,5 +192,18 @@ Scene({ wx.hideLoading() util.showToast(err) }) + }, + viewImage: function (e) { + var imgList = [] + if(e.currentTarget.dataset.type == 0){ + for (let index = 0; index < this.data.poundInfo.totalWeighingPicture.length; index++) { + imgList.push(this.data.poundInfo.totalWeighingPicture[index]) + } + } else { + for (let index = 0; index < this.data.poundInfo.emptyWeighingPicture.length; index++) { + imgList.push(this.data.poundInfo.emptyWeighingPicture[index]) + } + } + wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url }) } }) \ No newline at end of file diff --git a/pages/storage/order-settlement/index.wxml b/pages/storage/order-settlement/index.wxml index 80f6c29..039c62a 100644 --- a/pages/storage/order-settlement/index.wxml +++ b/pages/storage/order-settlement/index.wxml @@ -1,4 +1,5 @@ + 出货结算 @@ -75,13 +76,13 @@ 收货方名称 - {{orderInfo.factoryName || ''}} + {{orderInfo.consigneeName || ''}} 废纸品类 - {{orderInfo.categoryName || ''}} + {{orderInfo.productName || ''}} @@ -106,51 +107,51 @@ - + 第一次过磅(皮重) - {{orderInfo.factoryCustomerName}} + {{formate.minWeight(poundInfo.firstWeight, poundInfo.secondWeight)}} - - + + - + 第二次过磅(毛重) - 重量(公斤):34250 + 重量(公斤):{{formate.maxWeight(poundInfo.firstWeight, poundInfo.secondWeight)}} - - + + - + 净重(公斤) - {{orderInfo.createTime}} + {{form.netWeight}} - + 过磅人 - {{orderInfo.createTime}} + {{poundInfo.operaterName}} - - + + 关闭订单 确认收款 diff --git a/pages/storage/pound-info/index.js b/pages/storage/pound-info/index.js index 466242e..b5187a3 100644 --- a/pages/storage/pound-info/index.js +++ b/pages/storage/pound-info/index.js @@ -2,6 +2,8 @@ import Scene from '../../index/scene' import Dialog from '../../../components/dialog/dialog' import { getPoundInfo, repeatPound, deletePound } from "../../../api/saas" +const event = require('../../../utils/event') +const util = require('../../../utils/util') const app = getApp() Scene({ @@ -20,6 +22,20 @@ Scene({ wx.showLoading({ title: '正在获取', mask: true }) getPoundInfo(options.id).then(result => { wx.hideLoading() + result.data.emptyWeighingPicture = [] + if(result.data.firstWeightImageUrls1){ + result.data.emptyWeighingPicture.push(result.data.firstWeightImageUrls1) + } + if(result.data.firstWeightImageUrls2){ + result.data.emptyWeighingPicture.push(result.data.firstWeightImageUrls2) + } + result.data.totalWeighingPicture = [] + if(result.data.secondWeightImageUrls1){ + result.data.totalWeighingPicture.push(result.data.secondWeightImageUrls1) + } + if(result.data.secondWeightImageUrls2){ + result.data.totalWeighingPicture.push(result.data.secondWeightImageUrls2) + } this.setData({ safeBottom: app.globalData.safeBottom, form: result.data }) }).catch(err => { wx.hideLoading() @@ -30,9 +46,10 @@ Scene({ repeatForm: function(){ Dialog.confirm({ title: '温馨提示', message: '磅单数据有问题,确定重新过磅?' }).then(() => { wx.showLoading({ title: '正在处理', mask: true }) - repeatPound(this.data.form.id).then(result => { + repeatPound({id: this.data.form.id}).then(result => { wx.hideLoading() util.showBackToast('磅单处理成功') + event.emit('OrderMessage', { what: 20, desc: 'cancelPound' }) }).catch(err => { wx.hideLoading() util.showToast(err) @@ -42,9 +59,10 @@ Scene({ deleteForm: function(){ Dialog.confirm({ title: '温馨提示', message: '确定删除该磅单?' }).then(() => { wx.showLoading({ title: '正在处理', mask: true }) - deletePound(this.data.form.id).then(result => { + deletePound({id: this.data.form.id}).then(result => { wx.hideLoading() util.showBackToast('磅单已经删除') + event.emit('OrderMessage', { what: 20, desc: 'cancelPound' }) }).catch(err => { wx.hideLoading() util.showToast(err) @@ -58,11 +76,11 @@ Scene({ var imgList = [] if(e.currentTarget.dataset.type == 0){ for (let index = 0; index < this.data.form.totalWeighingPicture.length; index++) { - imgList.push(this.data.form.totalWeighingPicture[index].url) + imgList.push(this.data.form.totalWeighingPicture[index]) } } else { for (let index = 0; index < this.data.form.emptyWeighingPicture.length; index++) { - imgList.push(this.data.form.emptyWeighingPicture[index].url) + imgList.push(this.data.form.emptyWeighingPicture[index]) } } wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url }) diff --git a/pages/storage/pound-info/index.wxml b/pages/storage/pound-info/index.wxml index 0ee5f0c..fad33cd 100644 --- a/pages/storage/pound-info/index.wxml +++ b/pages/storage/pound-info/index.wxml @@ -1,58 +1,58 @@ + 磅单处理 - + 第一次过磅(皮重) - 重量(公斤):{{form.factoryCustomerName}} + 重量(公斤):{{formate.minWeight(form.firstWeight, form.secondWeight)}} - + + data-url="{{item}}" fit="cover" data-type="0" src="{{item}}" bind:click="viewImage"> - + 第二次过磅(毛重) - 重量(公斤):34250 + 重量(公斤):{{formate.maxWeight(form.firstWeight, form.secondWeight)}} - + + data-url="{{item}}" fit="cover" data-type="1" src="{{item}}" bind:click="viewImage"> - + 重新过磅 - + 净重(公斤) - {{form.createTime}} + {{form.netWeight}} - + 过磅人 - {{form.createTime}} + {{form.operaterName}} - - + 删除 - 关联出货单 + 关联出货单 diff --git a/pages/storage/pound-list/index.wxml b/pages/storage/pound-list/index.wxml index 6f253bc..0920701 100644 --- a/pages/storage/pound-list/index.wxml +++ b/pages/storage/pound-list/index.wxml @@ -1,4 +1,5 @@ + 磅单列表 @@ -18,16 +19,16 @@ - 磅单编号:{{item.factoryCustomerName}} + 磅单编号:{{item.id}} 过磅中 已过磅 - 毛重:{{item.productName}}公斤 - 皮重:{{item.settleWeight}}公斤 - 净重:{{item.netWeight}}公斤 + 皮重(公斤):{{formate.minWeight(item.firstWeight, item.secondWeight)}} + 毛重(公斤):{{formate.maxWeight(item.firstWeight, item.secondWeight)}} + 净重(公斤):{{item.netWeight || '- -'}}