Browse Source

no message

feature/v1.3
xpz2018 5 years ago
parent
commit
c102a57bce
6 changed files with 91 additions and 58 deletions
  1. 8
      pages/storage/order-create/index.js
  2. 16
      pages/storage/order-info/index.js
  3. 28
      pages/storage/order-list/index.js
  4. 42
      pages/storage/order-settlement/index.js
  5. 1
      pages/storage/order-settlement/index.json
  6. 54
      pages/storage/order-settlement/index.wxml

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

@ -1,6 +1,6 @@
// pages/storage/index/index.js // pages/storage/index/index.js
import Scene from '../../index/scene' import Scene from '../../index/scene'
import { getFactoryOrderInfo, getPaperList } from "../../../api/saas"
import { getPoundInfo, getPaperList, createOutOrder } from "../../../api/saas"
const util = require('../../../utils/util') const util = require('../../../utils/util')
const event = require('../../../utils/event') const event = require('../../../utils/event')
const app = getApp() const app = getApp()
@ -34,7 +34,7 @@ Scene({
this.setData({ safeBottom: app.globalData.safeBottom }) this.setData({ safeBottom: app.globalData.safeBottom })
util.showToast(err) util.showToast(err)
}) })
getFactoryOrderInfo(options.id).then(result => {
getPoundInfo(options.id).then(result => {
wx.hideLoading() wx.hideLoading()
result.data.sign = 1 result.data.sign = 1
this.setData({ form: result.data }) this.setData({ form: result.data })
@ -93,7 +93,7 @@ Scene({
this.setData({ activeNames: detail }); this.setData({ activeNames: detail });
}, },
submitForm: function(){ submitForm: function(){
if(util.isEmpty(this.data.form.facttoryName)){
if(util.isEmpty(this.data.form.factoryName)){
util.showToast('请选择出货方名称') util.showToast('请选择出货方名称')
return return
} }
@ -106,7 +106,7 @@ Scene({
return return
} }
wx.showLoading({ title: '正在处理', mask: true }) wx.showLoading({ title: '正在处理', mask: true })
receiptOutOrder(this.data.form).then(result => {
createOutOrder(this.data.form).then(result => {
wx.hideLoading() wx.hideLoading()
util.showBackToast('处理成功') util.showBackToast('处理成功')
event.emit('OrderMessage', { what: 20, desc: 'cancelOrder' }) event.emit('OrderMessage', { what: 20, desc: 'cancelOrder' })

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

@ -1,8 +1,9 @@
// pages/storage/index/index.js // pages/storage/index/index.js
import Scene from '../../index/scene' import Scene from '../../index/scene'
import Dialog from '../../../components/dialog/dialog' import Dialog from '../../../components/dialog/dialog'
import { getOutOrderInfo } from "../../../api/saas"
import { getOutOrderInfo, auditOutOrder } from "../../../api/saas"
const util = require('../../../utils/util') const util = require('../../../utils/util')
const event = require('../../../utils/event')
const app = getApp() const app = getApp()
Scene({ Scene({
@ -36,16 +37,25 @@ Scene({
if(e.currentTarget.id == 'refuse'){ if(e.currentTarget.id == 'refuse'){
Dialog.confirm({ title: '温馨提示', message: '确定此出货单有问题,进行驳回?' }).then(() => { Dialog.confirm({ title: '温馨提示', message: '确定此出货单有问题,进行驳回?' }).then(() => {
wx.showLoading({ title: '正在处理', mask: true }) wx.showLoading({ title: '正在处理', mask: true })
repeatOrder(this.data.form.id).then(result => {
auditOutOrder({id: this.data.form.id, auditStatus: 0 }).then(result => {
wx.hideLoading() wx.hideLoading()
util.showBackToast('出货单已经驳回') util.showBackToast('出货单已经驳回')
event.emit('OrderMessage', { what: 21, desc: 'cancelOrder' })
}).catch(err => { }).catch(err => {
wx.hideLoading() wx.hideLoading()
util.showToast(err) util.showToast(err)
}) })
}) })
} else { } else {
wx.showLoading({ title: '正在处理', mask: true })
auditOutOrder({id: this.data.form.id, auditStatus: 1 }).then(result => {
wx.hideLoading()
util.showBackToast('出货单已经通过审核')
event.emit('OrderMessage', { what: 21, desc: 'cancelOrder' })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
} }
} }
}) })

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

@ -1,7 +1,7 @@
// pages/process/order-list/index.js // pages/process/order-list/index.js
import Scene from '../../index/scene' import Scene from '../../index/scene'
import Dialog from '../../../components/dialog/dialog' import Dialog from '../../../components/dialog/dialog'
import { getFactoryOrderList, cancelOrder } from "../../../api/saas"
import { getOutOrderList, cancelOrder } from "../../../api/saas"
const event = require('../../../utils/event') const event = require('../../../utils/event')
const util = require('../../../utils/util') const util = require('../../../utils/util')
const app = getApp() const app = getApp()
@ -16,7 +16,7 @@ Scene({
{id: 1, name: '待审核', badge: 0, status: 1 }, {id: 1, name: '待审核', badge: 0, status: 1 },
{id: 2, name: '待收款', badge: 0, status: 2 }, {id: 2, name: '待收款', badge: 0, status: 2 },
{id: 3, name: '已完成', badge: 0, status: 3 }, {id: 3, name: '已完成', badge: 0, status: 3 },
{id: 4, name: '已关闭', badge: 0, status: 5 },
{id: 4, name: '已关闭', badge: 0, status: 5 }
// {id: 8, name: '已取消', badge: 0, status: 6 } // {id: 8, name: '已取消', badge: 0, status: 6 }
], ],
loading: true, loading: true,
@ -25,7 +25,6 @@ Scene({
top: 0, top: 0,
orderList: [], orderList: [],
form: { form: {
funcType: 0,
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}, },
@ -35,7 +34,14 @@ Scene({
// * 生命周期函数--监听页面加载 // * 生命周期函数--监听页面加载
onLoad: function (options) { onLoad: function (options) {
if(options.status){ if(options.status){
this.setData({ height: app.globalData.fragmentHeight - 90, tabIndex: Number(options.status) })
this.data.form.status = options.status
for (let index = 0; index < this.data.tabList.length; index++) {
if(this.data.tabList[index].status == Number(options.status)){
this.data.tabIndex = index
break
}
}
this.setData({ height: app.globalData.fragmentHeight - 90, tabIndex: this.data.tabIndex })
} else { } else {
this.setData({ height: app.globalData.fragmentHeight - 90 }) this.setData({ height: app.globalData.fragmentHeight - 90 })
} }
@ -73,7 +79,7 @@ Scene({
} else { } else {
this.setData({ requesting: true }) this.setData({ requesting: true })
} }
getFactoryOrderList(this.data.form).then(result => {
getOutOrderList(this.data.form).then(result => {
this.handResult(result) this.handResult(result)
}).catch(err => { }).catch(err => {
this.setData({ requesting: false, loading: false }) this.setData({ requesting: false, loading: false })
@ -130,17 +136,7 @@ Scene({
}, },
lookItem: function (e) { lookItem: function (e) {
var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index] var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index]
if(item.status == 1){
wx.navigateTo({ url: `/pages/process/order-price/index?id=${item.id}` })
} else {
wx.navigateTo({ url: `/pages/process/order-info/index?id=${item.id}` })
}
},
priceOrder: function(e){
wx.navigateTo({ url: '/pages/process/order-price/index?id=' + e.currentTarget.dataset.id })
},
checkOrder: function(e){
wx.navigateTo({ url: '/pages/process/order-info/index?id=' + e.currentTarget.dataset.id })
wx.navigateTo({ url: `/pages/storage/order-price/index?id=${item.id}` })
}, },
onUnload: function(){ onUnload: function(){
event.remove('OrderMessage', this) event.remove('OrderMessage', this)

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

@ -1,6 +1,7 @@
// pages/storage/index/index.js // pages/storage/index/index.js
import Scene from '../../index/scene' import Scene from '../../index/scene'
import { getOutOrderInfo, getPaperList, receiptOutOrder } from "../../../api/saas"
import Dialog from '../../../components/dialog/dialog'
import { getOutOrderInfo, getPaperList, receiptOutOrder, closeOutOrder } from "../../../api/saas"
const util = require('../../../utils/util') const util = require('../../../utils/util')
const event = require('../../../utils/event') const event = require('../../../utils/event')
const math = require('../../../utils/math') const math = require('../../../utils/math')
@ -12,7 +13,8 @@ Scene({
*/ */
data: { data: {
safeBottom: app.globalData.safeBottom, safeBottom: app.globalData.safeBottom,
form: null,
form: {},
orderInfo: null,
activeNames: [], activeNames: [],
columns: [], columns: [],
visible: false, visible: false,
@ -38,8 +40,8 @@ Scene({
}) })
getOutOrderInfo(options.id).then(result => { getOutOrderInfo(options.id).then(result => {
wx.hideLoading() wx.hideLoading()
result.data.sign = 1
this.setData({ form: result.data })
this.data.form.id = result.data.id
this.setData({ orderInfo: result.data })
}).catch(err => { }).catch(err => {
wx.hideLoading() wx.hideLoading()
util.showToast(err) util.showToast(err)
@ -68,8 +70,8 @@ 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.setData({ visible: false, ['form.productName']: detail.value })
this.data.form.categoryId = this.data.nowItem.id
this.setData({ visible: false, ['form.categoryName']: detail.value })
}, },
bindInput: function (e) { bindInput: function (e) {
this.data.form[e.target.id] = e.detail.value this.data.form[e.target.id] = e.detail.value
@ -106,8 +108,8 @@ Scene({
statAmount: function(){ statAmount: function(){
if(!util.isEmpty(this.data.form.settleUnitPrice) && !util.isEmpty(this.data.form.settleWeight)){ if(!util.isEmpty(this.data.form.settleUnitPrice) && !util.isEmpty(this.data.form.settleWeight)){
var amout = math.times(this.data.form.settleUnitPrice, this.data.form.settleWeight) var amout = math.times(this.data.form.settleUnitPrice, this.data.form.settleWeight)
if(!util.isEmpty(this.data.form.otherPrice)){
amout = math.minus(amout, this.data.form.otherPrice)
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.toFixed(2) })
} }
@ -115,8 +117,20 @@ Scene({
fileChange: function({detail}){ fileChange: function({detail}){
this.data.fileList = detail.fileList this.data.fileList = detail.fileList
}, },
closeForm: function(){
Dialog.confirm({ title: '温馨提示', message: '确定关闭该出货单?' }).then(() => {
wx.showLoading({ title: '正在处理', mask: true })
closeOutOrder( {id: this.data.form.id }).then(result => {
wx.hideLoading()
util.showBackToast('磅单处理成功')
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
})
},
settlementForm: function(){ settlementForm: function(){
if(util.isEmpty(this.data.form.productId) || Number(this.data.form.productId) <= 0){
if(util.isEmpty(this.data.form.categoryId) || Number(this.data.form.categoryId) <= 0){
util.showToast('请选择废纸品类') util.showToast('请选择废纸品类')
return return
} }
@ -133,6 +147,16 @@ Scene({
return return
} }
wx.showLoading({ title: '正在处理', mask: true }) wx.showLoading({ title: '正在处理', mask: true })
var weightNoteImageUrls = []
for (let index = 0; index < this.data.fileList.length; index++) {
const element = this.data.fileList[index]
if(!util.isEmpty(element.url)){
weightNoteImageUrls.push(element.url)
}
}
if(weightNoteImageUrls.length){
this.data.form.weightNoteImageUrls = weightNoteImageUrls
}
receiptOutOrder(this.data.form).then(result => { receiptOutOrder(this.data.form).then(result => {
wx.hideLoading() wx.hideLoading()
util.showBackToast('处理成功') util.showBackToast('处理成功')

1
pages/storage/order-settlement/index.json

@ -9,6 +9,7 @@
"van-collapse-item": "/components/collapse-item/index", "van-collapse-item": "/components/collapse-item/index",
"van-picker": "/components/picker/index", "van-picker": "/components/picker/index",
"van-popup": "/components/popup/index", "van-popup": "/components/popup/index",
"van-dialog": "/components/dialog/index",
"notification": "/pages/message/notification/index" "notification": "/pages/message/notification/index"
} }
} }

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

@ -3,14 +3,14 @@
<view slot="content">出货结算</view> <view slot="content">出货结算</view>
</cu-custom> </cu-custom>
<view wx:if="{{form}}">
<view wx:if="{{orderInfo}}">
<van-cell center is-link bind:click="showCategory"> <van-cell center is-link bind:click="showCategory">
<view slot="title" class="flex flex-justify"> <view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black"> <view class="flex flex-center text-black">
<view class="text-red text-xxl" style="line-height: 10px; padding-top: 10px">*</view> <view class="text-red text-xxl" style="line-height: 10px; padding-top: 10px">*</view>
<text>废纸品类</text> <text>废纸品类</text>
</view> </view>
<view class="text-gray">{{form.productName || '请选择废纸品类'}}</view>
<view class="text-gray">{{form.categoryName || '请选择废纸品类'}}</view>
</view> </view>
</van-cell> </van-cell>
<van-cell> <van-cell>
@ -50,8 +50,8 @@
<van-cell> <van-cell>
<view slot="title" class="flex flex-justify"> <view slot="title" class="flex flex-justify">
<view class="text-black">其他费用(元)</view> <view class="text-black">其他费用(元)</view>
<input id="otherPrice" type="digit" placeholder-style="color:#aaa" style="text-align: right" maxlength="8"
placeholder="请输入其他费用" value="{{form.otherPrice || ''}}" bindinput="bindInput" />
<input id="otherFee" type="digit" placeholder-style="color:#aaa" style="text-align: right" maxlength="8"
placeholder="请输入其他费用" value="{{form.otherFee || ''}}" bindinput="bindInput" />
</view> </view>
</van-cell> </van-cell>
<van-cell> <van-cell>
@ -70,91 +70,93 @@
</view> </view>
</view> </view>
<view class="margin-top"></view> <view class="margin-top"></view>
<van-collapse value="{{ activeNames }}" bind:change="onChange" wx:if="{{form}}">
<van-collapse value="{{ activeNames }}" bind:change="onChange" wx:if="{{orderInfo}}">
<van-collapse-item title="出货信息" content-class="collapse-item" name="2"> <van-collapse-item title="出货信息" content-class="collapse-item" name="2">
<van-cell center> <van-cell center>
<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">{{form.factoryName || ''}}</view>
<view class="text-gray">{{orderInfo.factoryName || ''}}</view>
</view> </view>
</van-cell> </van-cell>
<van-cell center> <van-cell center>
<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">{{form.productName || ''}}</view>
<view class="text-gray">{{orderInfo.categoryName || ''}}</view>
</view> </view>
</van-cell> </van-cell>
<van-cell wx:if="{{form.packageNumber}}">
<van-cell wx:if="{{orderInfo.packageNumber}}">
<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">{{form.packageNumber || ''}}</view>
<view class="text-gray">{{orderInfo.packageNumber || ''}}</view>
</view> </view>
</van-cell> </van-cell>
<van-cell center> <van-cell center>
<view class="flex flex-justify text-black"> <view class="flex flex-justify text-black">
<view class="text-black">车牌号码</view> <view class="text-black">车牌号码</view>
<view class="text-gray">{{form.plateNumber || ''}}</view>
<view class="text-gray">{{orderInfo.plateNumber || ''}}</view>
</view> </view>
</van-cell> </van-cell>
<van-cell wx:if="{{form.driverName}}">
<van-cell wx:if="{{orderInfo.driverName}}">
<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">{{ form.driverName || ''}}</view>
<view class="text-gray">{{ orderInfo.driverName || ''}}</view>
</view> </view>
</van-cell> </van-cell>
<van-field label="备注" type="textarea" input-align="right" readonly autosize border="{{ false }}" /> <van-field label="备注" type="textarea" input-align="right" readonly autosize border="{{ false }}" />
</van-collapse-item> </van-collapse-item>
<view class="margin-top"></view> <view class="margin-top"></view>
<van-collapse-item title="过磅信息" content-class="collapse-item" name="1"> <van-collapse-item title="过磅信息" content-class="collapse-item" name="1">
<van-cell wx:if="{{form.emptyWeighingPicture && form.emptyWeighingPicture.length}}">
<van-cell wx:if="{{orderInfo.emptyWeighingPicture && orderInfo.emptyWeighingPicture.length}}">
<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">{{form.factoryCustomerName}}</view>
<view class="text-gray">{{orderInfo.factoryCustomerName}}</view>
</view> </view>
</van-cell> </van-cell>
<view class="bg-white flex flex-justify" style="padding:24rpx 32rpx" wx:if="{{form.emptyWeighingPicture && form.emptyWeighingPicture.length}}">
<van-image wx:for="{{form.emptyWeighingPicture}}" wx:key="index" use-loading-slot width="320rpx" height="240rpx"
<view class="bg-white flex flex-justify" style="padding:24rpx 32rpx" wx:if="{{orderInfo.emptyWeighingPicture && orderInfo.emptyWeighingPicture.length}}">
<van-image wx:for="{{orderInfo.emptyWeighingPicture}}" wx:key="index" use-loading-slot width="320rpx" height="240rpx"
data-url="{{item.url}}" fit="cover" data-type="0" src="{{item.url}}" bind:click="viewImage"> data-url="{{item.url}}" fit="cover" data-type="0" src="{{item.url}}" bind:click="viewImage">
<view class="image-load" slot="loading"> <view class="image-load" slot="loading">
<van-loading type="spinner" size="32" /> <van-loading type="spinner" size="32" />
</view> </view>
</van-image> </van-image>
</view> </view>
<van-cell wx:if="{{form.totalWeighingPicture && form.totalWeighingPicture.length}}">
<van-cell wx:if="{{orderInfo.totalWeighingPicture && orderInfo.totalWeighingPicture.length}}">
<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">重量(公斤):34250</view> <view class="text-gray">重量(公斤):34250</view>
</view> </view>
</van-cell> </van-cell>
<view class="bg-white flex flex-justify" style="padding:24rpx 32rpx" wx:if="{{form.totalWeighingPicture && form.totalWeighingPicture.length}}">
<van-image wx:for="{{form.totalWeighingPicture}}" wx:key="index" use-loading-slot width="320rpx" height="240rpx"
<view class="bg-white flex flex-justify" style="padding:24rpx 32rpx" wx:if="{{orderInfo.totalWeighingPicture && orderInfo.totalWeighingPicture.length}}">
<van-image wx:for="{{orderInfo.totalWeighingPicture}}" wx:key="index" use-loading-slot width="320rpx" height="240rpx"
data-url="{{item.url}}" fit="cover" data-type="1" src="{{item.url}}" bind:click="viewImage"> data-url="{{item.url}}" fit="cover" data-type="1" src="{{item.url}}" bind:click="viewImage">
<view class="image-load" slot="loading"> <view class="image-load" slot="loading">
<van-loading type="spinner" size="32" /> <van-loading type="spinner" size="32" />
</view> </view>
</van-image> </van-image>
</view> </view>
<van-cell wx:if="{{form.totalWeighingPicture && form.totalWeighingPicture.length}}">
<van-cell wx:if="{{orderInfo.totalWeighingPicture && orderInfo.totalWeighingPicture.length}}">
<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">{{form.createTime}}</view>
<view class="text-gray">{{orderInfo.createTime}}</view>
</view> </view>
</van-cell> </van-cell>
<van-cell wx:if="{{form.totalWeighingPicture && form.totalWeighingPicture.length}}">
<van-cell wx:if="{{orderInfo.totalWeighingPicture && orderInfo.totalWeighingPicture.length}}">
<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">{{form.createTime}}</view>
<view class="text-gray">{{orderInfo.createTime}}</view>
</view> </view>
</van-cell> </van-cell>
</van-collapse-item> </van-collapse-item>
</van-collapse> </van-collapse>
<view style="height:{{136 + safeBottom}}rpx;" wx:if="{{form }}"></view>
<view class="cu-bar bg-white foot" style="height:{{120 + safeBottom}}rpx;padding:0rpx 32rpx {{safeBottom}}rpx 32rpx;" wx:if="{{form && form.status == 2}}">
<van-button type="info" custom-style="height:88rpx;width:686" bind:click="settlementForm" wx:if="{{form.status == 2}}">确认收款</van-button>
<view style="height:{{136 + safeBottom}}rpx;" wx:if="{{orderInfo }}"></view>
<view class="cu-bar bg-white foot" style="height:{{120 + safeBottom}}rpx;padding:0rpx 32rpx {{safeBottom}}rpx 32rpx;" wx:if="{{orderInfo && orderInfo.status == 2}}">
<van-button type="danger" custom-style="height:88rpx;width:254rpx" bind:click="closeForm">关闭订单</van-button>
<van-button type="info" custom-style="margin-left:32rpx;height:88rpx;width:400rpx" bind:click="settlementForm">确认收款</van-button>
</view> </view>
<van-popup position="bottom" show="{{ visible }}" bind:close="onHide" z-index="29"> <van-popup position="bottom" show="{{ visible }}" bind:close="onHide" z-index="29">
<van-picker show-toolbar title="选择纸品" columns="{{ columns }}" bind:cancel="onHide" bind:confirm="onConfirm" /> <van-picker show-toolbar title="选择纸品" columns="{{ columns }}" bind:cancel="onHide" bind:confirm="onConfirm" />
</van-popup> </van-popup>
<van-dialog id="van-dialog" />
<notification id="qn-notification"/> <notification id="qn-notification"/>
Loading…
Cancel
Save