Browse Source

新需求

feature/v2.3
xpz2018 4 years ago
parent
commit
56ff00afa0
34 changed files with 740 additions and 97 deletions
  1. 2
      app.json
  2. 2
      pages/home/customer-info/index.wxml
  3. 30
      pages/home/customer-list/index.wxml
  4. 37
      pages/home/factory-info/index.js
  5. 10
      pages/home/factory-info/index.json
  6. 51
      pages/home/factory-info/index.wxml
  7. 1
      pages/home/factory-info/index.wxss
  8. 8
      pages/home/index/index.wxml
  9. 1
      pages/home/qrcode-info/index.json
  10. 10
      pages/home/qrcode-info/index.wxml
  11. 6
      pages/home/user-info/index.wxml
  12. 215
      pages/process/order-add/index.js
  13. 19
      pages/process/order-add/index.json
  14. 107
      pages/process/order-add/index.wxml
  15. 57
      pages/process/order-add/index.wxss
  16. 14
      pages/process/order-info/index.wxml
  17. 5
      pages/process/order-list/index.js
  18. 9
      pages/process/order-list/index.wxml
  19. 28
      pages/process/outside-info/index.js
  20. 15
      pages/process/outside-info/index.wxml
  21. 12
      pages/process/outside-list/index.js
  22. 8
      pages/process/outside-list/index.wxml
  23. 6
      pages/process/payment/index.wxml
  24. 70
      pages/storage/order-create/index.js
  25. 1
      pages/storage/order-create/index.json
  26. 31
      pages/storage/order-create/index.wxml
  27. 24
      pages/storage/order-info/index.wxml
  28. 14
      pages/storage/order-list/index.js
  29. 4
      pages/storage/order-list/index.wxml
  30. 3
      pages/storage/order-settlement/index.js
  31. 9
      pages/storage/order-settlement/index.wxml
  32. 4
      pages/storage/pound-info/index.js
  33. 2
      pages/storage/pound-list/index.wxml
  34. 22
      utils/util.js

2
app.json

@ -7,6 +7,7 @@
"pages/home/employee-info/index", "pages/home/employee-info/index",
"pages/home/customer-list/index", "pages/home/customer-list/index",
"pages/home/factory-list/index", "pages/home/factory-list/index",
"pages/home/factory-info/index",
"pages/home/customer-info/index", "pages/home/customer-info/index",
"pages/home/qrcode-info/index", "pages/home/qrcode-info/index",
"pages/home/factory-qrcode/index", "pages/home/factory-qrcode/index",
@ -15,6 +16,7 @@
"pages/ztbvip/payment/index", "pages/ztbvip/payment/index",
"pages/process/agent-list/index", "pages/process/agent-list/index",
"pages/process/order-list/index", "pages/process/order-list/index",
"pages/process/order-add/index",
"pages/process/order-price/index", "pages/process/order-price/index",
"pages/process/order-check/index", "pages/process/order-check/index",
"pages/process/order-info/index", "pages/process/order-info/index",

2
pages/home/customer-info/index.wxml

@ -3,7 +3,7 @@
</cu-custom> </cu-custom>
<van-notice-bar color="#1989fa" background="#008AFF" left-icon="info-o" text="{{form.id ? '点击可以修改客户信息' : (cardNo ? '选择客户重新进行绑定' : '添加客户信息')}}" mode="{{ cardNo ? 'link' : '' }}" bind:click="chooseMember"/> <van-notice-bar color="#1989fa" background="#008AFF" left-icon="info-o" text="{{form.id ? '点击可以修改客户信息' : (cardNo ? '选择客户重新进行绑定' : '添加客户信息')}}" mode="{{ cardNo ? 'link' : '' }}" bind:click="chooseMember"/>
<van-field value="{{ form.cardNo }}" label="卡号:" disabled wx:if="{{ form.cardNo }}" />
<van-field value="{{ form.cardNo }}" label="IC卡号:" disabled wx:if="{{ form.cardNo }}" />
<van-field id="name" value="{{ form.name }}" required label="客户姓名:" clearable placeholder="请输入客户姓名" bind:input="bindInput" /> <van-field id="name" value="{{ form.name }}" required label="客户姓名:" clearable placeholder="请输入客户姓名" bind:input="bindInput" />
<van-field id="mobile" value="{{ form.mobile }}" type="number" label="手机号码:" placeholder="请输入手机号码" clearable <van-field id="mobile" value="{{ form.mobile }}" type="number" label="手机号码:" placeholder="请输入手机号码" clearable
bind:input="bindInput" maxlength="11" /> bind:input="bindInput" maxlength="11" />

30
pages/home/customer-list/index.wxml

@ -25,16 +25,14 @@
<view class="text-empty">{{loading? '正在搜索' : '暂无数据'}}</view> <view class="text-empty">{{loading? '正在搜索' : '暂无数据'}}</view>
</view> </view>
<van-cell clickable wx:for="{{searchList}}" wx:key="index"> <van-cell clickable wx:for="{{searchList}}" wx:key="index">
<view slot="title" class="flex flex-justify" data-index="{{index}}" bindtap="customerInfo">
<view slot="title" data-index="{{index}}" bindtap="customerInfo">
<!-- <van-image round width="80rpx" height="80rpx" src="{{ item.avatarUrl || '/assets/image/ygImg.png' }}" /> --> <!-- <van-image round width="80rpx" height="80rpx" src="{{ item.avatarUrl || '/assets/image/ygImg.png' }}" /> -->
<view style="width:100%;flex:1">
<view class="text-sg text-bold">{{item.name || ''}}</view>
<view class="text-sm text-gray" style="line-height:32rpx;height:32rpx">
<text wx:if="{{item.mobile}}" style="padding-right: 24rpx;">{{'电话号码:' + item.mobile}}</text>
<text wx:if="{{item.cardNo}}">{{'卡号:' + item.cardNo}}</text>
</view>
<view class="text-sg text-bold">{{item.name || ''}}</view>
<view class="text-sm text-gray" style="line-height:32rpx;height:32rpx">
<text wx:if="{{item.mobile}}" style="padding-right: 24rpx;">{{'电话号码:' + item.mobile}}</text>
<text wx:if="{{item.cardNo}}">{{'IC卡号:' + item.cardNo}}</text>
</view> </view>
<view class="text-blue" style="padding:6rpx 0rpx" data-index="{{index}}" catchtap="bindCustomer" wx:if="{{!item.userId}}">注册纸通宝</view>
<!-- <view class="text-blue" style="padding:6rpx 0rpx" data-index="{{index}}" catchtap="bindCustomer" wx:if="{{!item.userId}}">注册纸通宝</view> -->
</view> </view>
</van-cell> </van-cell>
</view> </view>
@ -45,17 +43,15 @@
<text class="text-sg" style="line-height:50rpx;padding-left:32rpx">{{pageItem.sign}}</text> <text class="text-sg" style="line-height:50rpx;padding-left:32rpx">{{pageItem.sign}}</text>
</view> </view>
<van-cell clickable wx:for="{{pageItem.data}}" wx:key="index"> <van-cell clickable wx:for="{{pageItem.data}}" wx:key="index">
<view slot="title" class="flex flex-justify" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="customerInfo">
<view slot="title" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="customerInfo">
<!-- <van-image round width="80rpx" height="80rpx" src="{{ item.avatarUrl || '/assets/image/ygImg.png' }}" /> --> <!-- <van-image round width="80rpx" height="80rpx" src="{{ item.avatarUrl || '/assets/image/ygImg.png' }}" /> -->
<view style="width:100%;flex:1">
<view class="text-sg text-bold">{{item.name || ''}}</view>
<view class="text-sm text-gray" style="line-height:32rpx;height:32rpx">
<text wx:if="{{item.mobile}}" style="padding-right: 24rpx;">{{'电话号码:' + item.mobile}}</text>
<text wx:if="{{item.cardNo}}">{{'卡号:' + item.cardNo}}</text>
</view>
<view class="text-sg text-bold">{{item.name || ''}}</view>
<view class="text-sm text-gray" style="line-height:32rpx;height:32rpx">
<text wx:if="{{item.mobile}}" style="padding-right: 24rpx;">{{'电话号码:' + item.mobile}}</text>
<text wx:if="{{item.cardNo}}">{{'IC卡号:' + item.cardNo}}</text>
</view> </view>
<view class="text-blue" style="padding:6rpx 24rpx;" data-page="{{pageIndex}}" data-index="{{index}}"
catchtap="bindCustomer" wx:if="{{!item.userId}}">注册纸通宝</view>
<!-- <view class="text-blue" style="padding:6rpx 24rpx;" data-page="{{pageIndex}}" data-index="{{index}}"
catchtap="bindCustomer" wx:if="{{!item.userId}}">注册纸通宝</view> -->
</view> </view>
</van-cell> </van-cell>
</block> </block>

37
pages/home/factory-info/index.js

@ -0,0 +1,37 @@
// pages/home/qrcode/index.js
import Scene from '../../index/scene'
import { getCustomerList } from "../../../api/saas"
const util = require('../../../utils/util')
const app = getApp()
Scene({
/**
* 页面的初始数据
*/
data: {
settleType: '1',
paymentType: '1',
userInfo: {}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({ userInfo: app.userInfo})
},
onTypeChange: function({detail}){
this.setData({ settleType: detail })
},
onTypeClick(e) {
this.setData({ settleType: e.currentTarget.dataset.name })
},
onPaymentChange: function({detail}){
this.setData({ paymentType: detail })
},
onPaymentClick(e) {
this.setData({ paymentType: e.currentTarget.dataset.name })
},
submitForm: function () {
}
})

10
pages/home/factory-info/index.json

@ -0,0 +1,10 @@
{
"usingComponents": {
"van-cell": "/components/cell/index",
"van-button": "/components/button/index",
"van-checkbox": "/components/checkbox/index",
"van-radio": "/components/radio/index",
"van-radio-group": "/components/radio-group/index",
"notification": "/pages/message/notification/index"
}
}

51
pages/home/factory-info/index.wxml

@ -0,0 +1,51 @@
<!--pages/home/qrcode/index.wxml-->
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">工厂设置</view>
</cu-custom>
<view class="flex flex-center" style="justify-content: flex-start;padding: 16rpx 32rpx">
<view style="height:30rpx;width:6rpx;background-image: linear-gradient(180deg, #007AFF 0%, #027BFF 15%, #5AABFF 45%, #CAF4FE 100%);"></view>
<view class="text-black text-sg text-bold" style="margin-left: 12rpx">收货结算金额设置</view>
</view>
<van-radio-group value="{{ settleType }}" bind:change="onTypeChange">
<van-cell-group>
<van-cell title="正常保留两位小数(默认)" clickable data-name="1" bind:click="onTypeClick">
<van-radio slot="right-icon" name="1" />
</van-cell>
<van-cell title="抹零取整" clickable data-name="3" bind:click="onTypeClick">
<van-radio slot="right-icon" name="3" />
</van-cell>
<van-cell title="四舍五入取整" clickable data-name="4" bind:click="onTypeClick">
<van-radio slot="right-icon" name="4" />
</van-cell>
</van-cell-group>
</van-radio-group>
<view class="flex flex-center" style="justify-content: flex-start;padding: 16rpx 32rpx">
<view style="height:30rpx;width:6rpx;background-image: linear-gradient(180deg, #007AFF 0%, #027BFF 15%, #5AABFF 45%, #CAF4FE 100%);"></view>
<view class="text-black text-sg text-bold" style="margin-left: 12rpx">客户支付方式</view>
</view>
<van-radio-group value="{{ paymentType }}" bind:change="onPaymentChange">
<van-cell-group>
<van-cell title="现金支付(默认)" clickable data-name="1" bind:click="onPaymentClick">
<van-radio slot="right-icon" name="1" />
</van-cell>
<van-cell title="银行卡转账" clickable data-name="2" bind:click="onPaymentClick">
<van-radio slot="right-icon" name="2" />
</van-cell>
<van-cell title="微信支付" clickable data-name="4" bind:click="onPaymentClick">
<van-radio slot="right-icon" name="4" />
</van-cell>
<van-cell title="支付宝支付" clickable data-name="5" bind:click="onPaymentClick">
<van-radio slot="right-icon" name="5" />
</van-cell>
<van-cell title="千鸟代付" clickable data-name="3" bind:click="onPaymentClick">
<van-radio slot="right-icon" name="3" />
</van-cell>
</van-cell-group>
</van-radio-group>
<view style="margin-top:48rpx;padding:40rpx 80rpx">
<van-button block type="info" bind:click="submitForm">保存</van-button>
</view>
<notification id="qn-notification"/>

1
pages/home/factory-info/index.wxss

@ -0,0 +1 @@
/* pages/home/qrcode/index.wxss */

8
pages/home/index/index.wxml

@ -65,12 +65,18 @@
<text class="text-sg" style="margin-left:12rpx">银行卡</text> <text class="text-sg" style="margin-left:12rpx">银行卡</text>
</view> </view>
</van-cell> </van-cell>
<van-cell is-link clickable url="/pages/home/factory-list/index" custom-class="group-bottom">
<van-cell is-link clickable url="/pages/home/factory-list/index">
<view class="flex" slot="title" style="align-items: center"> <view class="flex" slot="title" style="align-items: center">
<van-icon name="/assets/home/icon-qd.png" size="24" /> <van-icon name="/assets/home/icon-qd.png" size="24" />
<text class="text-sg" style="margin-left:12rpx">出货渠道</text> <text class="text-sg" style="margin-left:12rpx">出货渠道</text>
</view> </view>
</van-cell> </van-cell>
<van-cell is-link clickable url="/pages/home/factory-info/index" custom-class="group-bottom">
<view class="flex" slot="title" style="align-items: center">
<van-icon name="/assets/home/icon-bank.png" size="24" />
<text class="text-sg" style="margin-left:12rpx">工厂设置</text>
</view>
</van-cell>
</view> </view>
</view> </view>
</view> </view>

1
pages/home/qrcode-info/index.json

@ -1,5 +1,6 @@
{ {
"usingComponents": { "usingComponents": {
"van-notice-bar": "/components/notice-bar/index",
"van-button": "/components/button/index", "van-button": "/components/button/index",
"van-cell": "/components/cell/index", "van-cell": "/components/cell/index",
"van-image": "/components/image/index", "van-image": "/components/image/index",

10
pages/home/qrcode-info/index.wxml

@ -2,13 +2,17 @@
<view slot="content">{{type == 0 ? '客户' : '员工'}}电子卡</view> <view slot="content">{{type == 0 ? '客户' : '员工'}}电子卡</view>
</cu-custom> </cu-custom>
<view style="padding:32rpx;margin-top:72rpx;border-radius: 20rpx" wx:if="{{form}}">
<van-notice-bar color="#1989fa" background="#008AFF" scrollable="{{false}}" left-icon="info-o" text="注意:该二维码只在{{factoryName}}扫码使用" wx:if="{{form}}"/>
<view style="padding:32rpx;margin-top:36rpx;border-radius: 20rpx" wx:if="{{form}}">
<van-cell clickable is-link custom-class="group-top"> <van-cell clickable is-link custom-class="group-top">
<view slot="title" class="flex flex-justify" style="width:100%" bindtap="lookDetail"> <view slot="title" class="flex flex-justify" style="width:100%" bindtap="lookDetail">
<van-image round width="80rpx" height="80rpx" src="{{'/assets/image/ygImg.png' }}" /> <van-image round width="80rpx" height="80rpx" src="{{'/assets/image/ygImg.png' }}" />
<view style="width:100%;flex:1;margin-left: 18rpx"> <view style="width:100%;flex:1;margin-left: 18rpx">
<view class="text-sg text-bold">{{form.name || form.enterpriseMemberName || ''}}</view> <view class="text-sg text-bold">{{form.name || form.enterpriseMemberName || ''}}</view>
<view class="text-sm text-gray" style="line-height:32rpx;height:32rpx">
<view class="text-sm text-gray" style="line-height:32rpx;height:32rpx" wx:if="{{form.cardNo}}">
<text>IC卡号:{{form.cardNo}}</text>
</view>
<view class="text-sm text-gray" style="line-height:32rpx;height:32rpx" wx:else>
<text>联系电话:{{form.mobile || form.phone}}</text> <text>联系电话:{{form.mobile || form.phone}}</text>
</view> </view>
</view> </view>
@ -19,7 +23,7 @@
</view> </view>
</view> </view>
<view style="margin-top:72rpx;padding: 0rpx 72rpx" wx:if="{{form}}">
<view style="margin-top:36rpx;padding: 0rpx 72rpx" wx:if="{{form}}">
<van-divider content-position="center" customStyle="font-size: 18px;">{{factoryName}}</van-divider> <van-divider content-position="center" customStyle="font-size: 18px;">{{factoryName}}</van-divider>
</view> </view>

6
pages/home/user-info/index.wxml

@ -34,9 +34,7 @@
<!-- <van-cell clickable bind:click="settingAgent"> <!-- <van-cell clickable bind:click="settingAgent">
<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="flex flex-center">
<van-switch checked="{{ agenting }}" size="22px" />
</view>
<van-switch checked="{{ agenting }}" size="22px" />
</view> </view>
</van-cell> --> </van-cell> -->
<view style="height:24rpx"></view> <view style="height:24rpx"></view>
@ -65,7 +63,7 @@
<van-button block type="danger" bind:click="loginOut">退出当前账号</van-button> <van-button block type="danger" bind:click="loginOut">退出当前账号</van-button>
</view> </view>
<view style="margin-top:96rpx;padding: 0rpx 120rpx">
<view style="margin-top:48rpx;padding: 0rpx 120rpx">
<van-divider content-position="center">当前版本:{{version}}</van-divider> <van-divider content-position="center">当前版本:{{version}}</van-divider>
</view> </view>

215
pages/process/order-add/index.js

@ -0,0 +1,215 @@
import Scene from '../../index/scene'
import { checkingOrder, getFactoryOrderInfo, getPaperList} from "../../../api/saas"
const event = require('../../../utils/event')
const util = require('../../../utils/util')
const math = require('../../../utils/math')
const app = getApp()
Scene({
/**
* 页面的初始数据
*/
data: {
safeBottom: app.globalData.safeBottom,
paperList: null,
form: { deductType: 1 },
paperList: [],
imageList: [],
focus: 0,
visible: false,
amout: 0,
nowItem: null
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.showLoading({ title: '正在获取', mask: true })
getPaperList({pageNum: 1, pageSize: 100}).then(result => {
this.setData({ safeBottom: app.globalData.safeBottom, paperList: result.data.records })
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
this.setData({ safeBottom: app.globalData.safeBottom })
util.showToast(err)
})
},
selectCustomer: function(){
var that = this
wx.navigateTo({
url: `/pages/home/customer-list/index?type=1`,
events: {
onCallback: (data) => {
if (data.what == 130) {
that.data.form.factoryCustomerId = data.detail.id
that.setData({ ['form.factoryCustomerName']: data.detail.name })
}
}
}
})
},
showPlate: function (e) {
this.keyboard = this.keyboard || this.selectComponent('#wux-keyboard')
this.keyboard.show(this.data.form.plateNumber, 0)
},
onPlatenumber: function({detail}){
if(detail && detail.plateNumber){
this.setData({ ['form.plateNumber']: detail.plateNumber })
}
},
showCategory: function(){
this.setData({ visible: true })
},
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.konePrice = '指导价格:' + this.data.nowItem.defaultUnitPrice
this.data.form.unitPrice = ''
this.data.form.productName = this.data.nowItem.name
if(util.isEmpty(this.data.form.netWeight) || Number(this.data.form.netWeight) <= 0){
this.setData({ visible: false, form: this.data.form, amout: null })
return
}
this.statAmount()
},
onHide: function(){
this.setData({ visible: false })
},
changeDeductType: function(e){
var type = Number(e.currentTarget.dataset.type)
this.setData({ ['form.deductType']: type, focus: type })
},
bindInput: function (e) {
this.data.form[e.target.id] = e.detail
if(e.target.id == 'totalWeight' || e.target.id == 'emptyWeight'){
if(!util.isEmpty(this.data.form.totalWeight) && !util.isEmpty(this.data.form.emptyWeight)){
this.setData({ ['form.netWeight']: math.minus(this.data.form.totalWeight, this.data.form.emptyWeight) })
}
} else if(e.target.id == 'deductPercent'){
if(util.isEmpty(e.detail)){
this.data.form.deductWeight = null
this.data.form.deductPercent = null
} else {
this.data.form.deductWeight = math.divide(math.times(this.data.form.netWeight, Number(e.detail)), 100).toFixed(2)
}
} else if(e.target.id == 'deductWeight'){
if(util.isEmpty(e.detail)){
this.data.form.deductWeight = null
this.data.form.deductPercent = null
} else {
this.data.form.deductPercent = math.times(math.divide(Number(e.detail), this.data.form.netWeight), 100).toFixed(2)
}
}
this.statAmount()
},
statAmount: function(){
if(util.isEmpty(this.data.form.netWeight)){
return
}
this.data.form.settleWeight = this.data.form.netWeight
if(!util.isEmpty(this.data.form.deductWeight)){
this.data.form.settleWeight = math.minus(this.data.form.netWeight, this.data.form.deductWeight)
}
if(!util.isEmpty(this.data.form.unitPrice) && Number(this.data.form.unitPrice) > 0){
this.data.amout = math.times(this.data.form.settleWeight, this.data.form.unitPrice)
} else {
this.data.amout = null
}
this.setData({ visible: false, form: this.data.form, amout: this.data.amout, cIndex: this.data.cIndex })
},
fileChange: function({detail}){
this.data.imageList = detail.fileList
var imageUrls = []
for (let index = 0; index < this.data.imageList.length; index++) {
imageUrls.push(this.data.imageList[index].url)
}
this.data.form.orderImageList = imageUrls
},
checkOrder: function(){
if(util.isEmpty(this.data.form.factoryCustomerId)){
util.showToast('请选择客户')
return
}
if(util.isEmpty(this.data.form.netWeight)){
util.showToast('请输入净重')
return
}
if(Number(this.data.form.netWeight) <= 0){
util.showToast('净重不能小于零')
return
}
if(util.isEmpty(this.data.form.productId) || Number(this.data.form.productId) <= 0){
util.showToast('请选择纸品品类')
return
}
if(util.isEmpty(this.data.form.unitPrice) || Number(this.data.form.unitPrice) <= 0){
util.showToast('请输入单价')
return
}
if(this.data.nowItem){
if(this.data.nowItem.highestUnitPrice && Number(this.data.form.unitPrice) > Number(this.data.nowItem.highestUnitPrice)){
util.showToast('输入单价过高,价格范围:' + this.data.nowItem.lowestUnitPrice + '元/公斤-'+ this.data.nowItem.highestUnitPrice + '元/公斤')
return
}
// if(this.data.nowItem.lowestUnitPrice && Number(this.data.form.unitPrice) < Number(this.data.nowItem.lowestUnitPrice)){
// util.showToast('输入单价过低,价格范围:' + this.data.nowItem.lowestUnitPrice + '元/公斤-'+ this.data.nowItem.highestUnitPrice + '元/公斤')
// return
// }
}
if(!util.isEmpty(this.data.form.deductWeight) && Number(this.data.form.deductWeight) >= Number(this.data.form.totalWeight)){
util.showToast('扣重不得超过皮重')
return
}
if(!util.isEmpty(this.data.form.deductPercent) && Number(this.data.form.deductPecent) >= 100){
util.showToast('扣点范围:0-100')
return
}
var data = {id: this.data.form.id}
if(Number(this.data.form.deductWeight) > 0){
data.deductWeight = Number(this.data.form.deductWeight)
}
if(Number(this.data.form.deductPercent) > 0){
data.deductPercent = Number(this.data.form.deductPercent)
}
data.plateNumber = this.data.form.plateNumber
data.productId = this.data.form.productId
data.deductType = this.data.form.deductType
data.unitPrice = Number(this.data.form.unitPrice)
var factoryCustomerId = this.data.form.factoryCustomerId
var that = this
wx.requestSubscribeMessage({
tmplIds: ['DJaSy0a5TNp9v_ICQ0ZY5-hkZ91dEXZuKq_hQVBTnOA', '4IWtlcg1HhLN7AFepB3VeZF-4D0b9gbjwWBruKMhAJM'],
complete(res) {
wx.showLoading({ title: '处理中', mask: true })
checkingOrder({ id: that.data.form.id, factoryCustomerId, editOrderPriceDto: data }).then(result => {
wx.hideLoading()
event.emit('OrderMessage', { what: 12, desc: 'checkingOrder' })
util.showBackToast('订单审核已通过')
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
}
})
},
viewImage: function (e) {
var imgList = []
for (let index = 0; index < this.data.form.totalWeighingPicture.length; index++) {
var url = this.data.form.totalWeighingPicture[index].url
if(!util.isEmpty(url) && 'error' != url){
imgList.push(url)
}
}
if(imgList.length){
wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url })
}
}
})

19
pages/process/order-add/index.json

@ -0,0 +1,19 @@
{
"usingComponents": {
"van-field": "/components/field/index",
"van-cell": "/components/cell/index",
"van-button": "/components/button/index",
"van-checkbox": "/components/checkbox/index",
"van-loading": "/components/loading/index",
"van-image": "/components/image/index",
"van-grid": "/components/grid/index",
"van-grid-item": "/components/grid-item/index",
"van-icon": "/components/icon/index",
"van-popup": "/components/popup/index",
"vehicle-keyboard": "/components/vehicle-keyboard/index",
"submit-layout": "/components/submit-layout/index",
"vip-dialog": "/pages/message/vip-dialog/index",
"van-uploader": "/components/uploader/index",
"notification": "/pages/message/notification/index"
}
}

107
pages/process/order-add/index.wxml

@ -0,0 +1,107 @@
<!--pages/process/order-check/index.wxml-->
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">新增厂内收货订单</view>
</cu-custom>
<view class="flex flex-center bg-white margin-top" style="justify-content: flex-start;padding: 24rpx 32rpx;border-bottom:1rpx solid #f3f3f3">
<view style="height:30rpx;width:6rpx;background-image: linear-gradient(180deg, #007AFF 0%, #027BFF 15%, #5AABFF 45%, #CAF4FE 100%);"></view>
<view class="text-black text-sg text-bold" style="margin-left: 12rpx">磅单信息</view>
</view>
<van-cell clickable center is-link bind:click="selectCustomer">
<view slot="title" class="flex flex-justify">
<view class="flex">
<view class="text-red text-xl" style="line-height: 10px; padding-top: 12px">*</view>
<text>客户姓名</text>
</view>
<view class="{{form.factoryCustomerName ? 'text-black' : 'text-gray'}}">{{form.factoryCustomerName || '请输选择客户'}}</view>
</view>
</van-cell>
<van-cell clickable center is-link arrow-direction="down" bind:click="showPlate">
<view slot="title" class="flex flex-justify">
<view class="text-black">车牌号码</view>
<view class="{{form.plateNumber ? 'text-black' : 'text-gray'}}">{{form.plateNumber || '请输入车牌号码'}}</view>
</view>
</van-cell>
<van-field id="totalWeight" label="毛重(公斤)" value="{{ form.totalWeight || '' }}" type="digit" placeholder="请输入毛重" clearable input-align="right" bind:change="bindInput">
</van-field>
<van-field id="emptyWeight" label="皮重(公斤)" value="{{ form.emptyWeight || '' }}" type="digit" placeholder="请输入皮重" clearable input-align="right" bind:change="bindInput">
</van-field>
<van-field id="netWeight" value="{{ form.netWeight || '' }}" type="digit" placeholder="请输入净重" 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>
</view>
</van-field>
<view class="flex flex-center bg-white margin-top" style="justify-content: flex-start;padding: 24rpx 32rpx;border-bottom:1rpx solid #f3f3f3">
<view style="height:30rpx;width:6rpx;background-image: linear-gradient(180deg, #007AFF 0%, #027BFF 15%, #5AABFF 45%, #CAF4FE 100%);"></view>
<view class="text-black text-sg text-bold" style="margin-left: 12rpx">定价信息</view>
</view>
<van-cell clickable center is-link arrow-direction="down" bind:click="showCategory">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black">
<view class="text-red text-xl" style="line-height: 10px; padding-top: 8px">*</view>
<text>废纸品类</text>
</view>
<view class="{{form.productName ? 'text-black' : 'text-gray'}}">{{form.productName || '请选择废纸品类'}}</view>
</view>
</van-cell>
<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>
</view>
</van-field>
<van-field id="deductWeight" value="{{ form.deductWeight || '' }}" data-type="1" type="digit" placeholder="请输入扣重重量(选填)" clearable disabled="{{form.deductType == 2}}" input-align="right" focus="{{focus == 1}}" bind:change="bindInput" bind:click-input="changeDeductType">
<view slot="label" class="flex flex-center text-black" style="justify-content: flex-start" data-type="1" bindtap="changeDeductType">
<van-checkbox value="{{ form.deductType == 1 }}" icon-size="32rpx"></van-checkbox>
<text style="margin-left:8rpx">扣重(公斤)</text>
</view>
</van-field>
<van-field id="deductPercent" value="{{ form.deductPercent || '' }}" type="digit" placeholder="请输入扣点比例(选填)" clearable disabled="{{form.deductType == 1}}" input-align="right" focus="{{focus == 2}}" bind:change="bindInput" data-type="2" maxlength="10" bind:click-input="changeDeductType">
<view slot="label" class="flex flex-center text-black" style="justify-content: flex-start" data-type="2" bindtap="changeDeductType">
<van-checkbox value="{{ form.deductType == 2 }}" icon-size="32rpx"></van-checkbox>
<text style="margin-left:8rpx">扣点(%)</text>
</view>
</van-field>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">结算重量(公斤)</view>
<view class="text-gray">{{form.settleWeight || '- -'}}</view>
</view>
</van-cell>
<view id="orderImage" class="bg-white" style="padding: 24rpx 32rpx 20rpx 32rpx">
<view class="flex flex-justify" style="padding-bottom: 24rpx">
<view class="flex flex-center text-black">订单凭证</view>
<text class="text-gray">2张以内,每张图片大小限制5M</text>
</view>
<van-uploader file-list="{{ imageList }}" multiple max-count="2" max-size="{{1024 * 1024 * 5}}" bind:file-change="fileChange" />
</view>
<submit-layout>
<view class="flex flex-center" style="flex:1;justify-content: flex-start">
<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>
<vehicle-keyboard id="wux-keyboard" safeBottom="{{safeBottom}}" triplet="{{1}}" bind:change="onPlatenumber"></vehicle-keyboard>
<van-popup position="bottom" show="{{ visible }}" bind:close="onHide" z-index="29">
<view class="van-picker__toolbar van-hairline--top-bottom toolbar-class">
<view class="van-picker__cancel" hover-stay-time="70"></view>
<view class="van-picker__title van-ellipsis">选择纸品</view>
<view class="van-picker__confirm flex flex-cener" hover-class="van-picker__confirm--hover" hover-stay-time="70" bindtap="onHide">
<van-icon name="cross" size="24" color="#999999" />
</view>
</view>
<scroll-view scroll-y="true" style="height:480rpx;padding: 12rpx 0rpx">
<van-grid column-num="3" border="{{fasle}}">
<van-grid-item use-slot wx:for="{{ paperList }}" wx:key="index" content-style="padding:12rpx">
<van-button plain type="{{index == cIndex ? 'info' : 'default'}}" custom-style="height:88rpx;width:208rpx;padding: 0rpx" data-index="{{index}}" bind:click="onConfirm">{{item.name}}</van-button>
</van-grid-item>
</van-grid>
</scroll-view>
</van-popup>
<vip-dialog id="vip-dialog"/>
<notification id="qn-notification"/>

57
pages/process/order-add/index.wxss

@ -0,0 +1,57 @@
/* pages/process/order-check/index.wxss */
.page-icon {
margin-right: 24rpx;
}
.margin-top{
margin-top: 16rpx;
}
.big-icon{
margin-top: 24rpx;
}
.van-picker__toolbar {
display: -webkit-flex;
display: flex;
-webkit-justify-content: space-between;
justify-content: space-between;
height: 44px;
height: var(--picker-toolbar-height, 44px);
line-height: 44px;
line-height: var(--picker-toolbar-height, 44px)
}
.van-picker__cancel {
padding: 0 16px;
width: 96rpx;
padding: var(--picker-action-padding, 0 16px);
font-size: 14px;
font-size: var(--picker-action-font-size, 14px);
color: #666666;
color: var(--picker-action-text-color, #666666)
}
.van-picker__confirm {
padding: 0 24rpx;
padding: var(--picker-action-padding, 0 24rpx);
font-size: 14px;
font-size: var(--picker-action-font-size, 14px);
color: #1989fa;
color: var(--picker-action-text-color, #1989fa)
}
.van-picker__cancel--hover,
.van-picker__confirm--hover {
background-color: #f2f3f5;
background-color: var(--picker-action-active-color, #f2f3f5)
}
.van-picker__title {
max-width: 50%;
text-align: center;
font-weight: 500;
font-weight: var(--font-weight-bold, 500);
font-size: 16px;
font-size: var(--picker-option-font-size, 16px)
}

14
pages/process/order-info/index.wxml

@ -175,12 +175,16 @@
<van-button plain type="default" custom-style="height:88rpx;width:254rpx" bind:click="cancelOrder">取消订单</van-button> <van-button plain type="default" custom-style="height:88rpx;width:254rpx" bind:click="cancelOrder">取消订单</van-button>
</submit-layout> </submit-layout>
<submit-layout wx:if="{{form && form.status == 3 && !agent }}"> <submit-layout wx:if="{{form && form.status == 3 && !agent }}">
<van-button plain type="default" custom-style="height:88rpx;width:254rpx" bind:click="repeatOrder">重新过皮重</van-button>
<van-button type="info" custom-style="margin-left:32rpx;height:88rpx;width:400rpx" bind:click="checkOrder">通过审核</van-button>
<van-button plain type="default" custom-style="height:88rpx;width:186rpx" bind:click="cancelOrder">取消订单</van-button>
<van-button type="warning" custom-style="margin-left:32rpx;height:88rpx;width:218rpx" bind:click="repeatOrder">重新过皮重</van-button>
<van-button type="info" custom-style="margin-left:32rpx;height:88rpx;width:218rpx" bind:click="checkOrder">通过审核</van-button>
</submit-layout> </submit-layout>
<submit-layout wx:elif="{{form && (form.status == 4 || form.status == 42) && !agent && admin }}">
<van-button type="info" custom-style="height:88rpx;width:686rpx" bind:click="paymentOrder" wx:if="{{form.status == 4}}">进行支付</van-button>
<van-button type="info" custom-style="height:88rpx;width:686rpx" bind:click="paymentOrder" wx:if="{{form.status == 42}}">客户结算</van-button>
<submit-layout wx:elif="{{form && form.status == 4 && !agent && admin }}">
<van-button plain type="default" custom-style="height:88rpx;width:254rpx" bind:click="cancelOrder">取消订单</van-button>
<van-button type="info" custom-style="margin-left:32rpx;height:88rpx;width:400rpx" bind:click="paymentOrder">进行支付</van-button>
</submit-layout>
<submit-layout wx:elif="{{form && form.status == 42 && !agent && admin }}">
<van-button type="info" custom-style="height:88rpx;width:686rpx" bind:click="paymentOrder">客户结算</van-button>
</submit-layout> </submit-layout>
<view style="border-radius: 50rpx;position:fixed;bottom:{{160 + safeBottom}}rpx;right:50rpx" wx:if="{{form && (form.status == 3 || form.status == 4 || form.status == 42)}}"> <view style="border-radius: 50rpx;position:fixed;bottom:{{160 + safeBottom}}rpx;right:50rpx" wx:if="{{form && (form.status == 3 || form.status == 4 || form.status == 42)}}">

5
pages/process/order-list/index.js

@ -136,7 +136,7 @@ Scene({
this.setData({ finished: true, requesting: false, loading: false }) this.setData({ finished: true, requesting: false, loading: false })
} }
}, },
cancelOrder: function(e){
cancelItem: function(e){
Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => { Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => {
wx.showLoading({ title: '正在获取', mask: true }) wx.showLoading({ title: '正在获取', mask: true })
cancelOrder(e.currentTarget.dataset.id).then(result => { cancelOrder(e.currentTarget.dataset.id).then(result => {
@ -169,6 +169,9 @@ Scene({
loggerItem: function(e){ loggerItem: function(e){
wx.navigateTo({url: `/pages/process/order-logger/index?type=1&orderId=${e.currentTarget.dataset.id}` }) wx.navigateTo({url: `/pages/process/order-logger/index?type=1&orderId=${e.currentTarget.dataset.id}` })
}, },
addOrder: function(){
wx.navigateTo({ url: '/pages/process/order-add/index' })
},
paymentItem: function (e) { paymentItem: 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(!this.data.admin) { if(!this.data.admin) {

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

@ -64,8 +64,8 @@
<image class="item-icon" src="/assets/image/icon-delete.png" wx:if="{{item.status == 6}}"></image> <image class="item-icon" src="/assets/image/icon-delete.png" wx:if="{{item.status == 6}}"></image>
</view> </view>
<view class="flex" style="justify-content: flex-end;margin-top:16rpx"> <view class="flex" style="justify-content: flex-end;margin-top:16rpx">
<van-button round type="danger" custom-style="height:64rpx;width:200rpx" data-id="{{item.id}}"
bind:click="cancelOrder" wx:if="{{item.status != 6 && item.status != 41 && item.status != 42}}">取消订单</van-button>
<!-- <van-button round type="danger" custom-style="height:64rpx;width:200rpx" data-id="{{item.id}}"
bind:click="cancelItem" 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}}" <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> bind:click="priceOrder" wx:if="{{item.status == 1}}">定价</van-button>
<van-button round type="warning" custom-style="margin-left:24rpx;height:64rpx;width:200rpx" data-id="{{item.id}}" <van-button round type="warning" custom-style="margin-left:24rpx;height:64rpx;width:200rpx" data-id="{{item.id}}"
@ -91,5 +91,10 @@
</van-divider> </van-divider>
</refresh-view> </refresh-view>
<view style="border-radius: 50rpx;position: fixed;bottom:160rpx;right:50rpx" wx:if="{{admin}}">
<van-button round type="info" icon="plus" bind:click="addOrder" custom-style="width: 100rpx;height: 100rpx;"></van-button>
</view>
<van-dialog id="van-dialog" /> <van-dialog id="van-dialog" />
<notification id="qn-notification"/> <notification id="qn-notification"/>

28
pages/process/outside-info/index.js

@ -1,7 +1,7 @@
// pages/process/order-check/index.js // pages/process/order-check/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 { repeatSideOrder, getSideOrderInfo, printOrder} from "../../../api/saas"
import { repeatSideOrder, getSideOrderInfo, printOrder, 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 math = require('../../../utils/math') const math = require('../../../utils/math')
@ -76,15 +76,39 @@ Scene({
result.data.paymentOrderInfo.lessPrice = 0.00 result.data.paymentOrderInfo.lessPrice = 0.00
} }
} }
this.setData({ form: result.data, admin: app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0, agent: this.data.agent, imageList,safeBottom: app.globalData.safeBottom })
this.setData({
form: result.data,
admin: app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0,
agent: this.data.agent,
imageList,safeBottom: app.globalData.safeBottom
})
}).catch(err => { }).catch(err => {
wx.hideLoading() wx.hideLoading()
util.showToast(err) util.showToast(err)
}) })
}, },
repeatOrder: function(){
wx.navigateTo({url: `/pages/process/outside-check/index?id=${this.data.id}` })
},
orderLogger: function(){ orderLogger: function(){
wx.navigateTo({url: `/pages/process/order-logger/index?type=1&orderId=${this.data.id}` }) wx.navigateTo({url: `/pages/process/order-logger/index?type=1&orderId=${this.data.id}` })
}, },
cancelOrderInfo: function(e){
Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => {
this.cancelOrder()
})
},
cancelOrder: function(){
wx.showLoading({ title: '正在处理', mask: true })
cancelOrder(this.data.form.scrapPaperReceiptId).then(result => {
wx.hideLoading()
util.showBackToast('订单已经取消')
event.emit('OrderMessage', { what: 12, desc: 'cancelOrder' })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
},
printOrderInfo: function(){ printOrderInfo: function(){
wx.showLoading({ title: '正在处理', mask: true }) wx.showLoading({ title: '正在处理', mask: true })
printOrder({id: this.data.id, printType: 2}).then(result => { printOrder({id: this.data.id, printType: 2}).then(result => {

15
pages/process/outside-info/index.wxml

@ -218,18 +218,19 @@
</view> </view>
<submit-layout wx:if="{{form && admin && form.orderStatus == 3}}"> <submit-layout wx:if="{{form && admin && form.orderStatus == 3}}">
<view class="flex flex-center" style="flex:1;justify-content: flex-start">
<text class="text-lg" wx:if="{{form.settleTotalAmount}}">金额:</text>
<text class="text-xxl text-price text-red" wx:if="{{form.settleTotalAmount}}">{{formate.formateAmount(form.settleTotalAmount, 2)}}</text>
</view>
<van-button type="info" custom-style="height:88rpx;width:300rpx" bind:click="submitForm">通过审核</van-button>
<van-button plain type="default" custom-style="height:88rpx;width:186rpx" bind:click="cancelOrderInfo">取消订单</van-button>
<van-button type="warning" custom-style="margin-left:32rpx;height:88rpx;width:218rpx" bind:click="repeatOrder">重新定价</van-button>
<van-button type="info" custom-style="margin-left:32rpx;height:88rpx;width:218rpx" bind:click="submitForm">通过审核</van-button>
</submit-layout>
<submit-layout wx:if="{{form && admin && form.orderStatus == 4}}">
<van-button plain type="default" custom-style="height:88rpx;width:254rpx" bind:click="cancelOrderInfo">取消订单</van-button>
<van-button type="info" custom-style="margin-left:32rpx;height:88rpx;width:400rpx" bind:click="paymentOrder">进行支付</van-button>
</submit-layout> </submit-layout>
<submit-layout wx:if="{{form && admin && (form.orderStatus == 4 || form.orderStatus == 42)}}">
<submit-layout wx:if="{{form && admin && form.orderStatus == 42}}">
<view class="flex flex-center" style="flex:1;justify-content: flex-start"> <view class="flex flex-center" style="flex:1;justify-content: flex-start">
<text class="text-lg" wx:if="{{form.settleTotalAmount}}">金额:</text> <text class="text-lg" wx:if="{{form.settleTotalAmount}}">金额:</text>
<text class="text-xxl text-price text-red" wx:if="{{form.settleTotalAmount}}">{{formate.formateAmount(form.settleTotalAmount, 2)}}</text> <text class="text-xxl text-price text-red" wx:if="{{form.settleTotalAmount}}">{{formate.formateAmount(form.settleTotalAmount, 2)}}</text>
</view> </view>
<van-button type="info" custom-style="height:88rpx;width:300rpx" bind:click="paymentOrder" wx:if="{{form.orderStatus == 4}}">进行支付</van-button>
<van-button type="info" custom-style="height:88rpx;width:300rpx" bind:click="paymentOrder" wx:if="{{form.orderStatus == 42}}">客户结算</van-button> <van-button type="info" custom-style="height:88rpx;width:300rpx" bind:click="paymentOrder" wx:if="{{form.orderStatus == 42}}">客户结算</van-button>
</submit-layout> </submit-layout>

12
pages/process/outside-list/index.js

@ -125,7 +125,7 @@ Scene({
this.refresh.setRefresh(false) this.refresh.setRefresh(false)
}) })
}, },
cancelOrder: function(e){
cancelItem: function(e){
Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => { Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => {
wx.showLoading({ title: '正在获取', mask: true }) wx.showLoading({ title: '正在获取', mask: true })
cancelOrder(e.currentTarget.dataset.id).then(result => { cancelOrder(e.currentTarget.dataset.id).then(result => {
@ -146,16 +146,14 @@ Scene({
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.orderStatus == 0 || item.orderStatus == 1){ if(item.orderStatus == 0 || item.orderStatus == 1){
wx.navigateTo({ url: `/pages/process/outside-price/index?id=${item.orderId}` }) wx.navigateTo({ url: `/pages/process/outside-price/index?id=${item.orderId}` })
} else if(item.orderStatus == 4 || item.orderStatus == 42){
if(this.data.admin) {
wx.navigateTo({ url: `/pages/process/payment/index?id=${item.orderId}` })
} else {
wx.navigateTo({ url: `/pages/process/outside-info/index?id=${item.orderId}` })
}
} else { } else {
wx.navigateTo({ url: `/pages/process/outside-info/index?id=${item.orderId}` }) wx.navigateTo({ url: `/pages/process/outside-info/index?id=${item.orderId}` })
} }
}, },
paymentItem: function(e){
var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index]
wx.navigateTo({ url: `/pages/process/payment/index?id=${item.orderId}` })
},
orderLogger: function(e){ orderLogger: function(e){
wx.navigateTo({url: `/pages/process/order-logger/index?type=1&orderId=${e.currentTarget.dataset.id}` }) wx.navigateTo({url: `/pages/process/order-logger/index?type=1&orderId=${e.currentTarget.dataset.id}` })
}, },

8
pages/process/outside-list/index.wxml

@ -60,8 +60,8 @@
<image class="item-icon" src="/assets/image/icon-delete.png" wx:if="{{item.orderStatus == 6}}"></image> <image class="item-icon" src="/assets/image/icon-delete.png" wx:if="{{item.orderStatus == 6}}"></image>
</view> </view>
<view class="flex" style="justify-content: flex-end;margin-top:16rpx"> <view class="flex" style="justify-content: flex-end;margin-top:16rpx">
<van-button round type="danger" custom-style="height:64rpx;width:200rpx" data-id="{{item.orderId}}"
bind:click="cancelOrder" wx:if="{{item.orderStatus != 6 && item.orderStatus != 41 && item.orderStatus != 42}}">取消订单</van-button>
<!-- <van-button round type="danger" custom-style="height:64rpx;width:200rpx" data-id="{{item.orderId}}"
bind:click="cancelItem" wx:if="{{item.orderStatus != 6 && item.orderStatus != 41 && item.orderStatus != 42}}">取消订单</van-button> -->
<van-button round type="warning" custom-style="margin-left:24rpx;height:64rpx;width:200rpx" data-page="{{pageIndex}}" data-index="{{index}}" <van-button round type="warning" custom-style="margin-left:24rpx;height:64rpx;width:200rpx" data-page="{{pageIndex}}" data-index="{{index}}"
bind:click="editItem" wx:if="{{item.orderStatus == 0}}">修改订单</van-button> bind:click="editItem" wx:if="{{item.orderStatus == 0}}">修改订单</van-button>
<van-button round type="info" custom-style="margin-left:24rpx;height:64rpx;width:200rpx" data-page="{{pageIndex}}" data-index="{{index}}" <van-button round type="info" custom-style="margin-left:24rpx;height:64rpx;width:200rpx" data-page="{{pageIndex}}" data-index="{{index}}"
@ -73,9 +73,9 @@
<van-button round type="info" custom-style="margin-left:24rpx;height:64rpx;width:200rpx" data-page="{{pageIndex}}" data-index="{{index}}" <van-button round type="info" custom-style="margin-left:24rpx;height:64rpx;width:200rpx" data-page="{{pageIndex}}" data-index="{{index}}"
bind:click="lookItem" wx:if="{{item.orderStatus == 3}}">审核订单</van-button> bind:click="lookItem" wx:if="{{item.orderStatus == 3}}">审核订单</van-button>
<van-button round type="info" custom-style="margin-left:24rpx;height:64rpx;width:200rpx" data-page="{{pageIndex}}" data-index="{{index}}" <van-button round type="info" custom-style="margin-left:24rpx;height:64rpx;width:200rpx" data-page="{{pageIndex}}" data-index="{{index}}"
bind:click="lookItem" wx:if="{{item.orderStatus == 4 && admin}}">去支付</van-button>
bind:click="paymentItem" wx:if="{{item.orderStatus == 4 && admin}}">去支付</van-button>
<van-button round type="info" custom-style="margin-left:24rpx;height:64rpx;width:200rpx" data-page="{{pageIndex}}" data-index="{{index}}" <van-button round type="info" custom-style="margin-left:24rpx;height:64rpx;width:200rpx" data-page="{{pageIndex}}" data-index="{{index}}"
bind:click="lookItem" wx:if="{{item.orderStatus == 42 && admin}}">去结算</van-button>
bind:click="paymentItem" wx:if="{{item.orderStatus == 42 && admin}}">去结算</van-button>
<van-button round type="default" custom-style="height:64rpx;margin-left:24rpx;width:200rpx" data-id="{{item.orderId}}" <van-button round type="default" custom-style="height:64rpx;margin-left:24rpx;width:200rpx" data-id="{{item.orderId}}"
bind:click="orderLogger" wx:if="{{item.orderStatus == 5 || item.orderStatus == 6}}">查看日志</van-button> bind:click="orderLogger" wx:if="{{item.orderStatus == 5 || item.orderStatus == 6}}">查看日志</van-button>
</view> </view>

6
pages/process/payment/index.wxml

@ -22,15 +22,15 @@
<van-cell title="{{params.bankCardNo ? '银行卡转账(' + params.bankCardNo + ')' : '银行卡转账' }}" clickable data-name="2" bind:click="onTypeClick"> <van-cell title="{{params.bankCardNo ? '银行卡转账(' + params.bankCardNo + ')' : '银行卡转账' }}" clickable data-name="2" bind:click="onTypeClick">
<van-radio slot="right-icon" name="2" disabled="{{!params.bankCardNo}}" /> <van-radio slot="right-icon" name="2" disabled="{{!params.bankCardNo}}" />
</van-cell> </van-cell>
<van-cell title="使用千鸟代付" clickable data-name="3" bind:click="onTypeClick" wx:if="{{orderStatus == 4}}">
<van-radio slot="right-icon" name="3" />
</van-cell>
<van-cell title="微信支付" clickable data-name="4" bind:click="onTypeClick"> <van-cell title="微信支付" clickable data-name="4" bind:click="onTypeClick">
<van-radio slot="right-icon" name="4" /> <van-radio slot="right-icon" name="4" />
</van-cell> </van-cell>
<van-cell title="支付宝支付" clickable data-name="5" bind:click="onTypeClick"> <van-cell title="支付宝支付" clickable data-name="5" bind:click="onTypeClick">
<van-radio slot="right-icon" name="5" /> <van-radio slot="right-icon" name="5" />
</van-cell> </van-cell>
<van-cell title="使用千鸟代付" clickable data-name="3" bind:click="onTypeClick" wx:if="{{orderStatus == 4}}">
<van-radio slot="right-icon" name="3" />
</van-cell>
</van-cell-group> </van-cell-group>
</van-radio-group> </van-radio-group>
<view class="flex flex-center" style="justify-content: flex-start;padding: 24rpx 32rpx"> <view class="flex flex-center" style="justify-content: flex-start;padding: 24rpx 32rpx">

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

@ -17,7 +17,8 @@ Scene({
activeNames: ['1'], activeNames: ['1'],
paperList: [], paperList: [],
visible: false, visible: false,
cIndex: -1
cIndex: -1,
imageList: []
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
@ -53,6 +54,16 @@ Scene({
wx.hideLoading() wx.hideLoading()
util.showToast(err) util.showToast(err)
}) })
} else {
wx.showLoading({ title: '正在获取', mask: true })
getPaperList({pageNum: 1, pageSize: 100}).then(result => {
this.setData({ safeBottom: app.globalData.safeBottom, paperList: result.data.records })
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
this.setData({ safeBottom: app.globalData.safeBottom })
util.showToast(err)
})
} }
}, },
chooseList: function(e){ chooseList: function(e){
@ -100,7 +111,9 @@ Scene({
wx.showLoading({ title: '正在获取', mask: true }) wx.showLoading({ title: '正在获取', mask: true })
getPaperList({pageNum: 1, pageSize: 100}).then(result => { getPaperList({pageNum: 1, pageSize: 100}).then(result => {
this.setData({ visible: true, paperList: result.data.records }) this.setData({ visible: true, paperList: result.data.records })
wx.hideLoading()
}).catch(err => { }).catch(err => {
wx.hideLoading()
util.showToast(err) util.showToast(err)
}) })
} else { } else {
@ -114,32 +127,49 @@ Scene({
this.data.cIndex = e.currentTarget.dataset.index this.data.cIndex = e.currentTarget.dataset.index
this.data.nowItem = this.data.paperList[this.data.cIndex] this.data.nowItem = this.data.paperList[this.data.cIndex]
this.data.form.productId = this.data.nowItem.id this.data.form.productId = this.data.nowItem.id
var unitPrice = this.data.nowItem.defaultUnitPrice
var amount = ''
if(!util.isEmpty(unitPrice) && Number(unitPrice) > 0){
this.data.form.unitPrice = math.times(unitPrice, 1000)
amount = math.times(unitPrice, this.data.poundInfo.netWeight)
}
this.setData({ visible: false,
['form.productName']: this.data.nowItem.name,
['form.unitPrice']: this.data.form.unitPrice, ['form.estimatedAmount']: amount, cIndex: this.data.cIndex })
this.data.form.productName = this.data.nowItem.name
this.data.form.konePrice = '指导价格:' + math.times(this.data.nowItem.defaultUnitPrice, 1000)
this.data.form.unitPrice = ''
this.statAmount()
}, },
onChange: function({detail}) { onChange: function({detail}) {
this.setData({ activeNames: detail }) this.setData({ activeNames: detail })
}, },
bindInput: function (e) { bindInput: function (e) {
this.data.form[e.currentTarget.id] = e.detail this.data.form[e.currentTarget.id] = e.detail
if(e.currentTarget.id == 'unitPrice'){
var amount = ''
if(!util.isEmpty(this.data.form.unitPrice) && Number(this.data.form.unitPrice) > 0){
amount = math.divide(math.times(this.data.form.unitPrice, this.data.poundInfo.netWeight), 1000)
if(e.target.id == 'totalWeight' || e.target.id == 'emptyWeight'){
if(!util.isEmpty(this.data.form.totalWeight) && !util.isEmpty(this.data.form.emptyWeight)){
this.data.form.netWeight = math.minus(this.data.form.totalWeight, this.data.form.emptyWeight)
} }
this.setData({ visible: false, ['form.estimatedAmount']: amount })
}
}
this.statAmount()
},
statAmount: function(){
if(util.isEmpty(this.data.form.netWeight) && util.isEmpty(this.data.poundInfo)){
this.setData({ visible: false, form: this.data.form, cIndex: this.data.cIndex })
return
}
this.data.form.settleWeight = this.data.form.netWeight
if(!util.isEmpty(this.data.form.unitPrice) && Number(this.data.form.unitPrice) > 0 && !util.isEmpty(this.data.form.settleWeight)){
this.data.form.estimatedAmount = math.divide(math.times(this.data.form.unitPrice, this.data.form.settleWeight), 1000)
} else if(!util.isEmpty(this.data.form.unitPrice) && Number(this.data.form.unitPrice) > 0 && !util.isEmpty(this.data.poundInfo.netWeight)){
this.data.form.estimatedAmount = math.divide(math.times(this.data.form.unitPrice, this.data.poundInfo.netWeight), 1000)
} else {
this.data.form.estimatedAmount = null
}
this.setData({ visible: false, form: this.data.form, cIndex: this.data.cIndex })
}, },
onInputChange: function(e){ onInputChange: function(e){
this.data.form[e.currentTarget.id] = e.detail this.data.form[e.currentTarget.id] = e.detail
}, },
fileChange: function({detail}){
this.data.imageList = detail.fileList
var imageUrls = []
for (let index = 0; index < this.data.imageList.length; index++) {
imageUrls.push(this.data.imageList[index].url)
}
this.data.form.orderImageList = imageUrls
},
submitForm: function(){ submitForm: function(){
if(util.isEmpty(this.data.form.consigneeName)){ if(util.isEmpty(this.data.form.consigneeName)){
util.showToast('请选择出货方名称') util.showToast('请选择出货方名称')
@ -153,6 +183,14 @@ Scene({
util.showToast('请输入车牌号码') util.showToast('请输入车牌号码')
return return
} }
if(util.isEmpty(this.data.form.netWeight)){
util.showToast('请输入净重')
return
}
if(Number(this.data.form.netWeight) <= 0){
util.showToast('净重不能小于零')
return
}
this.data.form.weightNoteId = this.data.poundInfo.id this.data.form.weightNoteId = this.data.poundInfo.id
wx.showLoading({ title: '正在处理', mask: true }) wx.showLoading({ title: '正在处理', mask: true })
createOutOrder(this.data.form).then(result => { createOutOrder(this.data.form).then(result => {

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

@ -14,6 +14,7 @@
"vehicle-keyboard": "/components/vehicle-keyboard/index", "vehicle-keyboard": "/components/vehicle-keyboard/index",
"van-collapse": "/components/collapse/index", "van-collapse": "/components/collapse/index",
"van-collapse-item": "/components/collapse-item/index", "van-collapse-item": "/components/collapse-item/index",
"van-uploader": "/components/uploader/index",
"submit-layout": "/components/submit-layout/index", "submit-layout": "/components/submit-layout/index",
"vip-dialog": "/pages/message/vip-dialog/index", "vip-dialog": "/pages/message/vip-dialog/index",
"notification": "/pages/message/notification/index" "notification": "/pages/message/notification/index"

31
pages/storage/order-create/index.wxml

@ -46,10 +46,10 @@
</view> </view>
</van-cell> </van-cell>
<van-field id="driverName" label="司机姓名" value="{{ form.driverName || '' }}" maxlength="12" placeholder="请输司机姓名" clearable input-align="right" bind:change="bindInput"></van-field> <van-field id="driverName" label="司机姓名" value="{{ form.driverName || '' }}" maxlength="12" placeholder="请输司机姓名" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="unitPrice" label="出货单价(元/吨)" title-width="240rpx" value="{{ form.unitPrice || '' }}" maxlength="8" type="digit" placeholder="{{form.konePrice || '请输入出货单价'}}" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="unitPrice" label="出货单价(元/吨)" title-width="240rpx" value="{{ form.unitPrice || '' }}" maxlength="8" type="digit" placeholder="请输入出货单价" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="estimatedAmount" label="预估金额" value="{{ form.estimatedAmount || '' }}" maxlength="8" type="digit" placeholder="请输入预估金额" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="estimatedAmount" label="预估金额" value="{{ form.estimatedAmount || '- -' }}" disabled input-align="right" bind:change="bindInput"></van-field>
</view> </view>
<view class="margin-top"></view> <view class="margin-top"></view>
@ -103,8 +103,31 @@
</van-cell> </van-cell>
</van-collapse-item> </van-collapse-item>
</van-collapse> </van-collapse>
<view wx:else>
<view class="flex flex-center bg-white margin-top" style="justify-content: flex-start;padding: 24rpx 32rpx;border-bottom:1rpx solid #f3f3f3">
<view style="height:30rpx;width:6rpx;background-image: linear-gradient(180deg, #007AFF 0%, #027BFF 15%, #5AABFF 45%, #CAF4FE 100%);"></view>
<view class="text-black text-sg text-bold" style="margin-left: 12rpx">磅单信息</view>
</view>
<van-field id="totalWeight" label="毛重(公斤)" value="{{ form.totalWeight || '' }}" type="digit" placeholder="请输入毛重" clearable input-align="right" bind:change="bindInput">
</van-field>
<van-field id="emptyWeight" label="皮重(公斤)" value="{{ form.emptyWeight || '' }}" type="digit" placeholder="请输入皮重" clearable input-align="right" bind:change="bindInput">
</van-field>
<van-field id="netWeight" value="{{ form.netWeight || '' }}" type="digit" placeholder="请输入净重" 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>
</view>
</van-field>
<view class="bg-white" style="padding: 24rpx 32rpx 20rpx 32rpx">
<view class="flex flex-justify" style="padding-bottom: 24rpx">
<view class="flex flex-center text-black">出货凭证</view>
<text class="text-gray">4张以内,每张图片大小限制5M</text>
</view>
<van-uploader file-list="{{ imageList }}" multiple max-count="4" max-size="{{1024 * 1024 * 5}}" bind:file-change="fileChange" />
</view>
</view>
<submit-layout wx:if="{{poundInfo}}">
<submit-layout>
<van-button type="info" custom-style="height:88rpx;width:680rpx" bind:click="submitForm">提交</van-button> <van-button type="info" custom-style="height:88rpx;width:680rpx" bind:click="submitForm">提交</van-button>
</submit-layout> </submit-layout>
<vehicle-keyboard id="wux-keyboard" safeBottom="{{safeBottom}}" bind:change="onPlatenumber"></vehicle-keyboard> <vehicle-keyboard id="wux-keyboard" safeBottom="{{safeBottom}}" bind:change="onPlatenumber"></vehicle-keyboard>

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

@ -162,6 +162,30 @@
<view class="text-gray">{{ form.settlePrice}}</view> <view class="text-gray">{{ form.settlePrice}}</view>
</view> </view>
</van-cell> </van-cell>
<van-cell wx:if="{{form.settlePrice}}">
<view slot="title" class="flex flex-justify">
<view class="text-black">代卖费(元)</view>
<view class="text-gray">{{ form.settlePrice}}</view>
</view>
</van-cell>
<van-cell wx:if="{{form.settlePrice}}">
<view slot="title" class="flex flex-justify">
<view class="text-black">运费(元)</view>
<view class="text-gray">{{ form.settlePrice}}</view>
</view>
</van-cell>
<van-cell wx:if="{{form.settlePrice}}">
<view slot="title" class="flex flex-justify">
<view class="text-black">其他费用(元)</view>
<view class="text-gray">{{ form.settlePrice}}</view>
</view>
</van-cell>
<van-cell wx:if="{{form.settlePrice}}">
<view slot="title" class="flex flex-justify">
<view class="text-black">补贴(元)</view>
<view class="text-gray">{{ form.settlePrice}}</view>
</view>
</van-cell>
<view class="bg-white" style="padding: 20rpx 32rpx" wx:if="{{fileList.length}}"> <view class="bg-white" style="padding: 20rpx 32rpx" wx:if="{{fileList.length}}">
<view class="flex flex-justify" style="padding-bottom: 20rpx"> <view class="flex flex-justify" style="padding-bottom: 20rpx">
<text class="text-black">纸厂磅单</text> <text class="text-black">纸厂磅单</text>

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

@ -35,15 +35,16 @@ Scene({
onLoad: function (options) { onLoad: function (options) {
if(!util.isEmpty(options.status) || Number(options.status) == 0){ if(!util.isEmpty(options.status) || Number(options.status) == 0){
this.data.form.status = Number(options.status) this.data.form.status = Number(options.status)
var tabIndex = this.data.tabIndex
for (let index = 0; index < this.data.tabList.length; index++) { 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
tabIndex = index
break break
} }
} }
this.setData({ height: app.globalData.fragmentHeight - 90, tabIndex: this.data.tabIndex })
this.setData({ height: app.globalData.fragmentHeight - 90, tabIndex, admin: app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0})
} else { } else {
this.setData({ height: app.globalData.fragmentHeight - 90 })
this.setData({ height: app.globalData.fragmentHeight - 90, admin: app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0 })
} }
event.on('OrderMessage', this, this.onEvent) event.on('OrderMessage', this, this.onEvent)
this.fetchOrderList() this.fetchOrderList()
@ -125,11 +126,11 @@ Scene({
} }
}, },
cancelOrder: function(e){ cancelOrder: function(e){
Dialog.confirm({ title: '温馨提示', message: '确定取消该单?' }).then(() => {
Dialog.confirm({ title: '温馨提示', message: '确定取消该单?' }).then(() => {
wx.showLoading({ title: '正在获取', mask: true }) wx.showLoading({ title: '正在获取', mask: true })
cancelOrder(e.currentTarget.dataset.id).then(result => { cancelOrder(e.currentTarget.dataset.id).then(result => {
wx.hideLoading() wx.hideLoading()
util.showToast('单已经取消')
util.showToast('单已经取消')
this.onRefreshList() this.onRefreshList()
}).catch(err => { }).catch(err => {
wx.hideLoading() wx.hideLoading()
@ -145,6 +146,9 @@ Scene({
wx.navigateTo({ url: `/pages/storage/order-info/index?id=${item.id}` }) wx.navigateTo({ url: `/pages/storage/order-info/index?id=${item.id}` })
] ]
}, },
addStorageOrder: function(){
wx.navigateTo({ url: `/pages/storage/order-create/index` })
},
onUnload: function(){ onUnload: function(){
event.remove('OrderMessage', this) event.remove('OrderMessage', this)
} }

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

@ -66,6 +66,10 @@
</van-divider> </van-divider>
</refresh-view> </refresh-view>
<view style="border-radius: 50rpx;position: fixed;bottom:160rpx;right:50rpx" wx:if="{{admin}}">
<van-button round type="info" icon="plus" bind:click="addStorageOrder" custom-style="width: 100rpx;height: 100rpx;"></van-button>
</view>
<van-dialog id="van-dialog" /> <van-dialog id="van-dialog" />
<notification id="qn-notification"/> <notification id="qn-notification"/>
<wxs module="statusOrder"> <wxs module="statusOrder">

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

@ -177,6 +177,9 @@ Scene({
wx.hideLoading() wx.hideLoading()
util.showToast(err) util.showToast(err)
}) })
},
saveForm: function(){
}, },
settlementForm: function(){ settlementForm: function(){
if(util.isEmpty(this.data.form.categoryId) || Number(this.data.form.categoryId) <= 0){ if(util.isEmpty(this.data.form.categoryId) || Number(this.data.form.categoryId) <= 0){

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

@ -34,6 +34,10 @@
<van-field id="settleWeight" value="{{ form.settleWeight || '' }}" label="结算重量(吨)" maxlength="8" type="digit" placeholder="请输入结算重量" clearable input-align="right" bind:change="bindInput"></van-field> <van-field id="settleWeight" value="{{ form.settleWeight || '' }}" label="结算重量(吨)" maxlength="8" type="digit" placeholder="请输入结算重量" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="otherFee" value="{{ form.otherFee || '' }}" label="其他费用(元)" maxlength="8" type="digit" placeholder="请输入其他费用" clearable input-align="right" bind:change="bindInput"></van-field> <van-field id="otherFee" value="{{ form.otherFee || '' }}" label="其他费用(元)" maxlength="8" type="digit" placeholder="请输入其他费用" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="settlePrice" value="{{ form.settlePrice || '' }}" label="结算金额(元)" maxlength="8" type="digit" placeholder="请输入结算金额" clearable input-align="right" bind:change="bindInput"></van-field> <van-field id="settlePrice" value="{{ form.settlePrice || '' }}" label="结算金额(元)" maxlength="8" type="digit" placeholder="请输入结算金额" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="settlePrice" value="{{ form.settlePrice || '' }}" label="代卖费(元)" maxlength="8" type="digit" placeholder="请输入代卖费" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="settlePrice" value="{{ form.settlePrice || '' }}" label="运费(元)" maxlength="8" type="digit" placeholder="请输入运费" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="settlePrice" value="{{ form.settlePrice || '' }}" label="其他费用(元)" maxlength="8" type="digit" placeholder="请输入其他费用" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="settlePrice" value="{{ form.settlePrice || '' }}" label="补贴(元)" maxlength="8" type="digit" placeholder="请输入补贴" clearable input-align="right" bind:change="bindInput"></van-field>
<view class="bg-white" style="padding: 24rpx 32rpx 20rpx 32rpx"> <view class="bg-white" style="padding: 24rpx 32rpx 20rpx 32rpx">
<view class="flex flex-justify" style="padding-bottom: 24rpx"> <view class="flex flex-justify" style="padding-bottom: 24rpx">
@ -156,8 +160,9 @@
<view style="height:16rpx" wx:if="{{orderInfo && orderInfo.status == 1}}"></view> <view style="height:16rpx" wx:if="{{orderInfo && orderInfo.status == 1}}"></view>
<submit-layout wx:if="{{orderInfo && orderInfo.status == 1}}"> <submit-layout wx:if="{{orderInfo && orderInfo.status == 1}}">
<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>
<van-button type="danger" custom-style="height:88rpx;width:186rpx" bind:click="closeForm">关闭订单</van-button>
<van-button type="info" custom-style="margin-left:32rpx;height:88rpx;width:218rpx" bind:click="saveForm">保存</van-button>
<van-button type="info" custom-style="margin-left:32rpx;height:88rpx;width:218rpx" bind:click="settlementForm">确认收款</van-button>
</submit-layout> </submit-layout>
<van-popup position="bottom" show="{{ visible }}" bind:close="onHide" z-index="29"> <van-popup position="bottom" show="{{ visible }}" bind:close="onHide" z-index="29">

4
pages/storage/pound-info/index.js

@ -65,11 +65,11 @@ Scene({
}) })
}, },
deleteForm: function(){ deleteForm: function(){
Dialog.confirm({ title: '温馨提示', message: '确定删除该磅单?' }).then(() => {
Dialog.confirm({ title: '温馨提示', message: '确定取消该磅单?' }).then(() => {
wx.showLoading({ title: '正在处理', mask: true }) wx.showLoading({ title: '正在处理', mask: true })
deletePound({id: this.data.form.id}).then(result => { deletePound({id: this.data.form.id}).then(result => {
wx.hideLoading() wx.hideLoading()
util.showBackToast('磅单已经删除')
util.showBackToast('磅单已经取消')
event.emit('OrderMessage', { what: 20, desc: 'cancelPound' }) event.emit('OrderMessage', { what: 20, desc: 'cancelPound' })
}).catch(err => { }).catch(err => {
wx.hideLoading() wx.hideLoading()

2
pages/storage/pound-list/index.wxml

@ -46,7 +46,7 @@
<view class="text-sm text-black">{{item.operaterName}}</view> <view class="text-sm text-black">{{item.operaterName}}</view>
</view> </view>
<view class="flex" style="justify-content: flex-end;margin-top:16rpx"> <view class="flex" style="justify-content: flex-end;margin-top:16rpx">
<van-button round plain type="default" custom-style="height:64rpx" data-id="{{item.id}}"
<van-button round type="danger" custom-style="height:64rpx" data-id="{{item.id}}"
bind:click="cancelOrder" wx:if="{{item.status == 0 || item.status == 1}}">取消磅单</van-button> bind:click="cancelOrder" wx:if="{{item.status == 0 || item.status == 1}}">取消磅单</van-button>
<van-button round type="info" custom-style="margin-left:24rpx;height:64rpx;" data-id="{{item.id}}" <van-button round type="info" custom-style="margin-left:24rpx;height:64rpx;" data-id="{{item.id}}"
bind:click="submitForm" wx:if="{{item.status == 1}}">关联出货单</van-button> bind:click="submitForm" wx:if="{{item.status == 1}}">关联出货单</van-button>

22
utils/util.js

@ -101,16 +101,18 @@ function showBackToast(content) {
}, 500) }, 500)
return return
} }
wx.showToast({
title: content,
icon: 'none',
duration: 500,
success: function () {
setTimeout(function () {
wx.navigateBack()
}, 500)
}
})
setTimeout(function () {
wx.showToast({
title: content,
icon: 'none',
duration: 500,
success: function () {
setTimeout(function () {
wx.navigateBack()
}, 500)
}
})
}, 20)
} }
/* 验证手机号 */ /* 验证手机号 */

Loading…
Cancel
Save