Browse Source

v2.2.0

feature/v2.1
xpz2018 4 years ago
parent
commit
0ba04d912c
21 changed files with 212 additions and 84 deletions
  1. 10
      api/saas.js
  2. 3
      pages/agent/order-detail/item-car-info/index.json
  3. 6
      pages/home/customer-list/index.js
  4. 9
      pages/index/index.js
  5. 31
      pages/process/order-logger/index.js
  6. 7
      pages/process/order-logger/index.json
  7. 10
      pages/process/order-logger/index.wxml
  8. 1
      pages/process/order-logger/index.wxss
  9. 15
      pages/process/outside-add/index.js
  10. 1
      pages/process/outside-add/index.json
  11. 5
      pages/process/outside-add/index.wxml
  12. 14
      pages/process/outside-info/index.js
  13. 52
      pages/process/outside-info/index.wxml
  14. 3
      pages/process/outside-item/index.wxml
  15. 43
      pages/process/outside-price/index.js
  16. 11
      pages/process/outside-price/index.wxml
  17. 3
      pages/setting/vehicle-detial/index.js
  18. 47
      pages/setting/vehicle-list/index.js
  19. 2
      pages/setting/vehicle-list/index.json
  20. 17
      pages/setting/vehicle-list/index.wxml
  21. 6
      utils/util.js

10
api/saas.js

@ -52,11 +52,11 @@ const getChanelList = (params) => mGet(`/ztb-factory/factorydeliverychannel/get/
const saveChanel = (params) => mPost(`/ztb-factory/factorydeliverychannel/save/factory-delivery-channel`, params, sconfig) const saveChanel = (params) => mPost(`/ztb-factory/factorydeliverychannel/save/factory-delivery-channel`, params, sconfig)
const getCardList = (params) => mGet(`/ztb-factory/get/self-factory/card-list`, params, sconfig) const getCardList = (params) => mGet(`/ztb-factory/get/self-factory/card-list`, params, sconfig)
const removeCardNop = (cardNo) => mPost(`/ztb-factory/remove/not-bind-card/${cardNo}`, null, sconfig) const removeCardNop = (cardNo) => mPost(`/ztb-factory/remove/not-bind-card/${cardNo}`, null, sconfig)
const getCarList = (params) => mGet(`/ztb-factory/factory/get/factory-car-list`, params, sconfig)
const getCarInfo = (id) => mGet(`/ztb-factory/factory/get/factory-car/${id}`, null, sconfig)
const editCar = (params) => mPost(`/ztb-factory/factory/edit/factory-car`, params, sconfig)
const saveCar = (params) => mPost(`/ztb-factory/factory/save/factory-car`, params, sconfig)
const deleteCar = (id) => mPost(`/ztb-factory/factory/delete/factory-car/${id}`, null, sconfig)
const getCarList = (params) => mGet(`/ztb-factory/get/factory-car-list`, params, sconfig)
const getCarInfo = (id) => mGet(`/ztb-factory/get/factory-car/${id}`, null, sconfig)
const editCar = (params) => mPost(`/ztb-factory/edit/factory-car`, params, sconfig)
const saveCar = (params) => mPost(`/ztb-factory/save/factory-car`, params, sconfig)
const deleteCar = (id) => mPost(`/ztb-factory/delete/factory-car/${id}`, null, sconfig)
const getPoundList = () => mGet(`/ztb-factory/get/self-factory-weight-note-list`, null, sconfig) const getPoundList = () => mGet(`/ztb-factory/get/self-factory-weight-note-list`, null, sconfig)
const getPoundInfo = (id) => mGet(`/ztb-factory/get/weight-note-detail/${id}`, null, sconfig) const getPoundInfo = (id) => mGet(`/ztb-factory/get/weight-note-detail/${id}`, null, sconfig)

3
pages/agent/order-detail/item-car-info/index.json

@ -4,5 +4,6 @@
"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-steps": "/components/steps/index", "van-steps": "/components/steps/index",
"van-step": "/components/step/index"}
"van-step": "/components/step/index"
}
} }

6
pages/home/customer-list/index.js

@ -65,11 +65,7 @@ Scene({
let nowList = `orderList[${this.data.orderList.length}]` let nowList = `orderList[${this.data.orderList.length}]`
var num = this.data.form.pageNum var num = this.data.form.pageNum
var finished = ((num - 1) * this.data.form.pageSize + respList.length) >= result.data.total var finished = ((num - 1) * this.data.form.pageSize + respList.length) >= result.data.total
if(this.data.form.pageNum == 1){
this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false })
} else {
this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false })
}
this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false })
} else { } else {
this.setData({ finished: true, requesting: false, loading: false }) this.setData({ finished: true, requesting: false, loading: false })
} }

9
pages/index/index.js

@ -3,6 +3,7 @@ import Scene from './scene'
import { sconfig, getMessageList } from "../../api/saas" import { sconfig, getMessageList } from "../../api/saas"
import { headerFactoryId } from "../../api/user" import { headerFactoryId } from "../../api/user"
const event = require('../../utils/event') const event = require('../../utils/event')
const util = require('../../utils/util')
const storage = require('../../utils/storage') const storage = require('../../utils/storage')
const app = getApp() const app = getApp()
@ -133,16 +134,12 @@ Scene({
onPopupChange: function({detail}){ onPopupChange: function({detail}){
this.setData({zIndex: detail}) this.setData({zIndex: detail})
}, },
showFactoryList: function(){
showFactoryList: util.throttle(function(){
if(!this.data.arrow){ if(!this.data.arrow){
return return
} }
this.setData({ visible: !this.data.visible, mActiveIndex: this.data.popIndex }) this.setData({ visible: !this.data.visible, mActiveIndex: this.data.popIndex })
// if (this.data.tabIndex == 0) {
// var pageView = this.selectComponent('#' + this.data.tabList[this.data.tabIndex].value)
// pageView.onClose()
// }
},
}),
onHide: function(){ onHide: function(){
this.setData({ visible: false }) this.setData({ visible: false })
}, },

31
pages/process/order-logger/index.js

@ -0,0 +1,31 @@
// pages/process/order-check/index.js
import Scene from '../../index/scene'
import { getFactoryOrderInfo } from "../../../api/saas"
const util = require('../../../utils/util')
Scene({
/**
* 页面的初始数据
*/
data: {
form: null
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if(options.orderId){
this.fetchOrderInfo(options.orderId)
}
},
fetchOrderInfo(orderId){
wx.showLoading({ title: '正在获取', mask: true })
getFactoryOrderInfo(orderId).then(result => {
wx.hideLoading()
this.setData({ form: result.data })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
}
})

7
pages/process/order-logger/index.json

@ -0,0 +1,7 @@
{
"usingComponents": {
"van-steps": "/components/steps/index",
"van-step": "/components/step/index",
"notification": "/pages/message/notification/index"
}
}

10
pages/process/order-logger/index.wxml

@ -0,0 +1,10 @@
<!--pages/process/order-check/index.wxml-->
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">订单日志</view>
</cu-custom>
<van-steps direction="column" dot="{{true}}" step-min-height="128" wx:if="{{form}}">
<van-step wx:for="{{form}}" wx:key="index" title="{{timeItem.description}}" describe="{{item.time}}"></van-step>
</van-steps>
<notification id="qn-notification"/>

1
pages/process/order-logger/index.wxss

@ -0,0 +1 @@
/* pages/process/order-check/index.wxss */

15
pages/process/outside-add/index.js

@ -11,7 +11,6 @@ Scene({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
safeBottom: app.globalData.safeBottom,
paperList: null, paperList: null,
form: { form: {
productCategoryInfos: [{ productId: '', productCategoryName: '', unitPrice: ''}], productCategoryInfos: [{ productId: '', productCategoryName: '', unitPrice: ''}],
@ -49,12 +48,10 @@ Scene({
for (let index = 0; index < this.data.paperList.length; index++) { for (let index = 0; index < this.data.paperList.length; index++) {
this.data.column1.push(this.data.paperList[index].name) this.data.column1.push(this.data.paperList[index].name)
} }
this.setData({ safeBottom: app.globalData.safeBottom })
if(!options.id){ if(!options.id){
wx.hideLoading() wx.hideLoading()
} }
}).catch(err => { }).catch(err => {
this.setData({ safeBottom: app.globalData.safeBottom })
util.showToast(err) util.showToast(err)
if(!options.id){ if(!options.id){
wx.hideLoading() wx.hideLoading()
@ -96,13 +93,13 @@ Scene({
wx.navigateTo({url: `/pages/home/employee/index?type=1`, events}) wx.navigateTo({url: `/pages/home/employee/index?type=1`, events})
}, },
showPlate: function (e) { 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 })
var that = this
var events = {}
events.onCallback = function(data){
that.data.form.driverId = data.detail.driverId
that.setData({ ['form.plateNumber']: data.detail.plateNumber, ['form.driverName']: data.detail.driverName })
} }
wx.navigateTo({url: `/pages/setting/vehicle-list/index?type=1`, events})
}, },
showCategory: function(e){ showCategory: function(e){
if(e.currentTarget.dataset.index >= 0){ if(e.currentTarget.dataset.index >= 0){

1
pages/process/outside-add/index.json

@ -12,7 +12,6 @@
"van-dialog": "/components/dialog/index", "van-dialog": "/components/dialog/index",
"van-field": "/components/field/index", "van-field": "/components/field/index",
"van-switch": "/components/switch/index", "van-switch": "/components/switch/index",
"vehicle-keyboard": "/components/vehicle-keyboard/index",
"submit-layout": "/components/submit-layout/index", "submit-layout": "/components/submit-layout/index",
"notification": "/pages/message/notification/index" "notification": "/pages/message/notification/index"
} }

5
pages/process/outside-add/index.wxml

@ -16,13 +16,13 @@
<view class="{{form.factoryCustomerName ? 'text-black' : 'text-gray'}}">{{form.factoryCustomerName || '请选择客户'}}</view> <view class="{{form.factoryCustomerName ? 'text-black' : 'text-gray'}}">{{form.factoryCustomerName || '请选择客户'}}</view>
</view> </view>
</van-cell> </van-cell>
<van-cell clickable center is-link bind:click="showPlate" arrow-direction="down">
<van-cell clickable center is-link bind:click="showPlate">
<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-xl" style="line-height: 10px; padding-top: 8px">*</view> <view class="text-red text-xl" style="line-height: 10px; padding-top: 8px">*</view>
<text>车牌号码</text> <text>车牌号码</text>
</view> </view>
<view class="{{form.plateNumber ? 'text-black' : 'text-gray'}}">{{form.plateNumber || '请输入车牌号码'}}</view>
<view class="{{form.plateNumber ? 'text-black' : 'text-gray'}}">{{form.plateNumber || '请选择车辆'}}</view>
</view> </view>
</van-cell> </van-cell>
<van-cell id="driverName" clickable center is-link bind:click="chooseEmploy"> <van-cell id="driverName" clickable center is-link bind:click="chooseEmploy">
@ -92,7 +92,6 @@
</submit-layout> </submit-layout>
<van-dialog id="van-dialog" /> <van-dialog id="van-dialog" />
<vehicle-keyboard id="wux-keyboard" safeBottom="{{safeBottom}}" bind:change="onPlatenumber"></vehicle-keyboard>
<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="{{cateIndex >= 0 ? '选择纸品' : '选择预估时间'}}" columns="{{ columns }}" bind:cancel="onHide" bind:confirm="onConfirm" /> <van-picker show-toolbar title="{{cateIndex >= 0 ? '选择纸品' : '选择预估时间'}}" columns="{{ columns }}" bind:cancel="onHide" bind:confirm="onConfirm" />
</van-popup> </van-popup>

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

@ -14,7 +14,8 @@ Scene({
data: { data: {
agent: 0, agent: 0,
id: null, id: null,
form: null
form: null,
imageList: []
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
@ -54,12 +55,21 @@ Scene({
result.data.settleTotalWeight = math.plus(result.data.settleTotalWeight, element.settleWeight) result.data.settleTotalWeight = math.plus(result.data.settleTotalWeight, element.settleWeight)
} }
} }
this.setData({ form: result.data, admin: app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0, agent: this.data.agent })
var imageList = []
if(result.data.orderImageList && result.data.orderImageList.length){
for (let index = 0; index < result.data.orderImageList.length; index++) {
imageList.push({url: result.data.orderImageList[index]})
}
}
this.setData({ form: result.data, admin: app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0, agent: this.data.agent, imageList })
}).catch(err => { }).catch(err => {
wx.hideLoading() wx.hideLoading()
util.showToast(err) util.showToast(err)
}) })
}, },
orderLogger: function(){
wx.navigateTo({url: `/pages/process/order-logger/index?type=1&orderId=${this.data.id}` })
},
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 => {

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

@ -14,25 +14,30 @@
</view> </view>
<view class="text-white" style="padding: 12rpx 0rpx 12rpx 12rpx" bindtap="checkForm">重新定价</view> <view class="text-white" style="padding: 12rpx 0rpx 12rpx 12rpx" bindtap="checkForm">重新定价</view>
</view> </view>
<view class="flex flex-center info_status" style="justify-content: flex-start;" wx:elif="{{form.orderStatus == 4}}">
<image style="height:42rpx;width:42rpx" src="/assets/image/icon_payfor.png"></image>
<view class="text-white text-sg" style="margin-left:12rpx">待付款</view>
</view>
<view class="flex flex-center info_status" style="justify-content: flex-start;" wx:elif="{{form.orderStatus == 41}}">
<image style="height:42rpx;width:42rpx" src="/assets/image/icon_payfor.png"></image>
<view class="text-white text-sg" style="margin-left:12rpx">代付审核中</view>
</view>
<view class="flex flex-center info_status" style="justify-content: flex-start;" wx:elif="{{form.orderStatus == 42}}">
<image style="height:42rpx;width:42rpx" src="/assets/image/icon_payfor.png"></image>
<view class="text-white text-sg" style="margin-left:12rpx">待结算</view>
</view>
<view class="flex flex-center info_status" style="justify-content: flex-start;" wx:elif="{{form.orderStatus == 5}}">
<image style="height:42rpx;width:42rpx" src="/assets/image/icon_payfor.png"></image>
<view class="text-white text-sg" style="margin-left:12rpx">已完成</view>
</view>
<view class="flex flex-center info_status" style="justify-content: flex-start;" wx:elif="{{form.orderStatus == 6}}">
<!-- <image style="height:42rpx;width:42rpx" src="/assets/image/icon_close.png"></image> -->
<view class="text-white text-sg" style="margin-left:12rpx">已取消</view>
<view class="flex flex-justify info_status" bindtap="orderLogger" wx:else>
<view class="flex flex-center" wx:if="{{form.orderStatus == 4}}">
<image style="height:42rpx;width:42rpx" src="/assets/image/icon_payfor.png"></image>
<view class="text-white text-sg" style="margin-left:12rpx">待付款</view>
</view>
<view class="flex flex-center" wx:elif="{{form.orderStatus == 41}}">
<image style="height:42rpx;width:42rpx" src="/assets/image/icon_payfor.png"></image>
<view class="text-white text-sg" style="margin-left:12rpx">代付审核中</view>
</view>
<view class="flex flex-center" wx:elif="{{form.orderStatus == 42}}">
<image style="height:42rpx;width:42rpx" src="/assets/image/icon_payfor.png"></image>
<view class="text-white text-sg" style="margin-left:12rpx">待结算</view>
</view>
<view class="flex flex-center" wx:elif="{{form.orderStatus == 5}}">
<image style="height:42rpx;width:42rpx" src="/assets/image/icon_payfor.png"></image>
<view class="text-white text-sg" style="margin-left:12rpx">已完成</view>
</view>
<view class="flex flex-center" wx:elif="{{form.orderStatus == 6}}">
<view class="text-white text-sg" style="margin-left:12rpx">已取消</view>
</view>
<view class="flex flex-center" style="padding:4rpx 0rpx 4rpx 4rpx">
<view class="text-white text-sm" style="margin-right:8rpx">查看订单日志</view>
<van-icon name="arrow" color="white"/>
</view>
</view> </view>
<template is="agent-info" data="{{form}}" wx:if="{{agent}}"></template> <template is="agent-info" data="{{form}}" wx:if="{{agent}}"></template>
<van-cell clickable center> <van-cell clickable center>
@ -102,6 +107,13 @@
<view class="text-gray">{{form.onsideAndOffsiteDifferences || '- -'}}</view> <view class="text-gray">{{form.onsideAndOffsiteDifferences || '- -'}}</view>
</view> </view>
</van-cell> </van-cell>
<view class="bg-white" style="padding: 24rpx 32rpx 20rpx 32rpx" wx:if="{{imageList.length}}">
<view class="flex flex-justify" style="padding-bottom: 24rpx">
<view class="flex flex-center text-black">订单凭证</view>
</view>
<van-uploader file-list="{{ imageList }}" deletable="{{false}}" show-upload="{{false}}" />
</view>
<!-- <van-cell title="查看订单日志" is-link clickable url="/pages/process/order-logger/index?type=1&orderId={{form.id}}"></van-cell> -->
<view style="height:16rpx"></view> <view style="height:16rpx"></view>
<view class="flex flex-center bg-white" style="justify-content: flex-start;padding: 24rpx 32rpx;border-bottom:1rpx solid #f3f3f3"> <view class="flex flex-center bg-white" 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 style="height:30rpx;width:6rpx;background-image: linear-gradient(180deg, #007AFF 0%, #027BFF 15%, #5AABFF 45%, #CAF4FE 100%);"></view>
@ -145,7 +157,7 @@
<view class="{{item.price ? 'text-black' : 'text-gray'}}">{{item.price || ''}}</view> <view class="{{item.price ? 'text-black' : 'text-gray'}}">{{item.price || ''}}</view>
</view> </view>
</van-cell> --> </van-cell> -->
<view class="bg-white" style="padding: 24rpx 32rpx 20rpx 32rpx">
<view class="bg-white" style="padding: 24rpx 32rpx 20rpx 32rpx" wx:if="{{item.fileList && item.fileList.length}}">
<view class="flex flex-justify" style="padding-bottom: 24rpx"> <view class="flex flex-justify" style="padding-bottom: 24rpx">
<view class="flex flex-center text-black">过磅凭证</view> <view class="flex flex-center text-black">过磅凭证</view>
</view> </view>

3
pages/process/outside-item/index.wxml

@ -39,10 +39,9 @@
<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">
<view class="flex flex-center text-black"> <view class="flex flex-center text-black">
<view class="text-red text-xl" style="line-height: 10px; padding-top: 8px" wx:if="{{status == 0}}">*</view>
<text>过磅凭证</text> <text>过磅凭证</text>
</view> </view>
<text class="text-gray">3-6张,每张图片大小限制5M</text>
<text class="text-gray">非必须,6张以内,每张图片大小限制5M</text>
</view> </view>
<van-uploader file-list="{{ fileList }}" multiple max-count="6" deletable="{{status == 0}}" show-upload="{{status == 0}}" <van-uploader file-list="{{ fileList }}" multiple max-count="6" deletable="{{status == 0}}" show-upload="{{status == 0}}"
max-size="{{1024 * 1024 * 5}}" bind:file-change="fileChange" /> max-size="{{1024 * 1024 * 5}}" bind:file-change="fileChange" />

43
pages/process/outside-price/index.js

@ -20,6 +20,7 @@ Scene({
offsiteGrossWeight: null, offsiteGrossWeight: null,
offsiteTareWeight: null, offsiteTareWeight: null,
}, },
imageList: [],
intoview: '' intoview: ''
}, },
/** /**
@ -38,7 +39,13 @@ Scene({
this.data.param.offsiteGrossWeight = result.data.offsiteGrossWeight this.data.param.offsiteGrossWeight = result.data.offsiteGrossWeight
this.data.param.offsiteTareWeight = result.data.offsiteTareWeight this.data.param.offsiteTareWeight = result.data.offsiteTareWeight
var height = app.globalData.fragmentHeight - app.globalData.safeBottom - 120 var height = app.globalData.fragmentHeight - app.globalData.safeBottom - 120
this.setData({ form: result.data, admin: app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0, height })
var imageList = []
if(result.data.orderImageList && result.data.orderImageList.length){
for (let index = 0; index < result.data.orderImageList.length; index++) {
imageList.push({url: result.data.orderImageList[index]})
}
}
this.setData({ form: result.data, admin: app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0, height, imageList })
}).catch(err => { }).catch(err => {
wx.hideLoading() wx.hideLoading()
util.showToast(err) util.showToast(err)
@ -102,6 +109,7 @@ Scene({
} }
this.data.param.scrapPaperReceiptId = this.data.form.scrapPaperReceiptId this.data.param.scrapPaperReceiptId = this.data.form.scrapPaperReceiptId
this.data.param.weightNoteList = weightNoteList this.data.param.weightNoteList = weightNoteList
this.data.param.orderImageList = this.data.form.orderImageList
wx.showLoading({ title: '处理中', mask: true }) wx.showLoading({ title: '处理中', mask: true })
saveSideOrder(this.data.param).then(result => { saveSideOrder(this.data.param).then(result => {
wx.hideLoading() wx.hideLoading()
@ -112,6 +120,14 @@ Scene({
util.showToast(err) util.showToast(err)
}) })
}, },
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(){
var weightNoteList = [] var weightNoteList = []
for (let index = 0; index < this.data.form.productCategoryInfos.length; index++) { for (let index = 0; index < this.data.form.productCategoryInfos.length; index++) {
@ -120,18 +136,14 @@ Scene({
util.showToast('请输入第' + (index + 1) + '项废纸品类净重') util.showToast('请输入第' + (index + 1) + '项废纸品类净重')
return return
} }
// if(util.isEmpty(element.tareWeight) || Number(element.tareWeight) < 0){
// util.showToast('请输入第' + (index + 1) + '项废纸品类皮重')
// if(util.isEmpty(element.weightNoteImages)){
// util.showToast('请上传第' + (index + 1) + '项废纸品类过磅凭证')
// return
// }
// if(element.weightNoteImages.length < 3){
// util.showToast('每个品类过磅凭证图片必须3张以上')
// return // return
// } // }
if(util.isEmpty(element.weightNoteImages)){
util.showToast('请上传第' + (index + 1) + '项废纸品类过磅凭证')
return
}
if(element.weightNoteImages.length < 3){
util.showToast('每个品类过磅凭证图片必须3张以上')
return
}
var item = {grossWeight: element.grossWeight, tareWeight: element.tareWeight,weightNoteImage: element.weightNoteImages } var item = {grossWeight: element.grossWeight, tareWeight: element.tareWeight,weightNoteImage: element.weightNoteImages }
item.netWeight = element.netWeight item.netWeight = element.netWeight
item.scrapPaperPurchaseOrderId = element.scrapPaperPurchaseOrderId item.scrapPaperPurchaseOrderId = element.scrapPaperPurchaseOrderId
@ -147,8 +159,17 @@ Scene({
util.showToast('请输入厂外毛重') util.showToast('请输入厂外毛重')
return return
} }
if(util.isEmpty(this.data.form.orderImageList)){
util.showToast('请上传订单凭证')
return
}
if(this.data.form.orderImageList.length < 3){
util.showToast('订单凭证图片必须3张或者3张以上')
return
}
this.data.param.scrapPaperReceiptId = this.data.form.scrapPaperReceiptId this.data.param.scrapPaperReceiptId = this.data.form.scrapPaperReceiptId
this.data.param.weightNoteList = weightNoteList this.data.param.weightNoteList = weightNoteList
this.data.param.orderImageList = this.data.form.orderImageList
wx.showLoading({ title: '处理中', mask: true }) wx.showLoading({ title: '处理中', mask: true })
poundSideOrder(this.data.param).then(result => { poundSideOrder(this.data.param).then(result => {
wx.hideLoading() wx.hideLoading()

11
pages/process/outside-price/index.wxml

@ -130,6 +130,17 @@
<text>厂外毛重(公斤)</text> <text>厂外毛重(公斤)</text>
</view> </view>
</van-field> </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 class="text-red text-xl" style="line-height: 10px; padding-top: 12px" wx:if="{{ form.orderStatus == 0}}">*</view>
<text>订单凭证</text>
</view>
<text class="text-gray">3-9张以内,每张图片大小限制5M</text>
</view>
<van-uploader file-list="{{ imageList }}" multiple max-count="9" deletable="{{form.orderStatus == 0}}" show-upload="{{form.orderStatus == 0}}"
max-size="{{1024 * 1024 * 5}}" bind:file-change="fileChange" />
</view>
</scroll-view> </scroll-view>
<submit-layout wx:if="{{admin && form && form.orderStatus == 0}}"> <submit-layout wx:if="{{admin && form && form.orderStatus == 0}}">

3
pages/setting/vehicle-detial/index.js

@ -39,6 +39,7 @@ Scene({
events.onCallback = function(data){ events.onCallback = function(data){
if (data.what == 121) { if (data.what == 121) {
that.data.form.driverId = data.detail.enterpriseMemberId that.data.form.driverId = data.detail.enterpriseMemberId
that.data.form.driverMobile = data.detail.mobile
that.setData({ ['form.driverName']: data.detail.enterpriseMemberName }) that.setData({ ['form.driverName']: data.detail.enterpriseMemberName })
} }
} }
@ -51,7 +52,7 @@ Scene({
} }
}, },
deleteForm: function(e){ deleteForm: function(e){
Dialog.confirm({ title: '温馨提示', message: '确定删除该纸品?' }).then(() => {
Dialog.confirm({ title: '温馨提示', message: '确定删除该车辆信息?' }).then(() => {
wx.showLoading({ title: '正在处理', mask: true }) wx.showLoading({ title: '正在处理', mask: true })
deleteCar(this.data.form.id).then(result => { deleteCar(this.data.form.id).then(result => {
wx.hideLoading() wx.hideLoading()

47
pages/setting/vehicle-list/index.js

@ -1,6 +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 { getCarList } from "../../../api/saas"
import Dialog from '../../../components/dialog/dialog'
import { getCarList, deleteCar } 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()
@ -8,13 +9,14 @@ const app = getApp()
Scene({ Scene({
// * 页面的初始数据 // * 页面的初始数据
data: { data: {
type: 0,
height: app.globalData.fragmentHeight, height: app.globalData.fragmentHeight,
loading: true, loading: true,
requesting: false, requesting: false,
finished: false, finished: false,
top: 0,
orderList: [], orderList: [],
form: { form: {
plateNumber: '',
pageNum: 1, pageNum: 1,
pageSize: 15 pageSize: 15
}, },
@ -23,8 +25,11 @@ Scene({
}, },
// * 生命周期函数--监听页面加载 // * 生命周期函数--监听页面加载
onLoad: function (options) { onLoad: function (options) {
if(options.type){
this.data.type = Number(options.type)
}
event.on('OrderMessage', this, this.onEvent) event.on('OrderMessage', this, this.onEvent)
this.setData({ height: app.globalData.fragmentHeight })
this.setData({ height: app.globalData.fragmentHeight - 100 })
this.fetchOrderList() this.fetchOrderList()
}, },
onEvent: function(message){ onEvent: function(message){
@ -34,6 +39,12 @@ Scene({
this.setData({ [`orderList[${this.data.page}][${this.data.index}]`]: message.detail }) this.setData({ [`orderList[${this.data.page}][${this.data.index}]`]: message.detail })
} }
}, },
onChange: function({detail}) {
this.data.form.plateNumber = detail
},
onSearch: function(){
this.onRefreshList()
},
onRefreshList: function () { onRefreshList: function () {
if (this.data.requesting) { if (this.data.requesting) {
return return
@ -52,11 +63,7 @@ Scene({
let nowList = `orderList[${this.data.orderList.length}]` let nowList = `orderList[${this.data.orderList.length}]`
var num = this.data.form.pageNum var num = this.data.form.pageNum
var finished = ((num - 1) * this.data.form.pageSize + respList.length) >= result.data.total var finished = ((num - 1) * this.data.form.pageSize + respList.length) >= result.data.total
if(this.data.form.pageNum == 1){
this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), finished, top: 0, requesting: false, loading: false })
} else {
this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false })
}
this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false })
} else { } else {
this.setData({ finished: true, requesting: false, loading: false }) this.setData({ finished: true, requesting: false, loading: false })
} }
@ -72,12 +79,32 @@ Scene({
if(e.currentTarget.dataset.page >= 0){ if(e.currentTarget.dataset.page >= 0){
this.data.page = e.currentTarget.dataset.page this.data.page = e.currentTarget.dataset.page
this.data.index = e.currentTarget.dataset.index this.data.index = e.currentTarget.dataset.index
var item = this.data.orderList[this.data.page][ this.data.index]
wx.navigateTo({ url: `/pages/setting/vehicle-detial/index?id=${item.id}` })
var item = this.data.orderList[this.data.page][this.data.index]
if(this.data.type == 1){
const channel = this.getOpenerEventChannel()
channel.emit('onCallback', { what: 140, detail: item })
wx.navigateBack()
} else {
wx.navigateTo({ url: `/pages/setting/vehicle-detial/index?id=${item.id}` })
}
} else { } else {
wx.navigateTo({ url: `/pages/setting/vehicle-detial/index` }) wx.navigateTo({ url: `/pages/setting/vehicle-detial/index` })
} }
}, },
deleteForm: function(e){
var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index]
Dialog.confirm({ title: '温馨提示', message: '确定删除该车辆信息?' }).then(() => {
wx.showLoading({ title: '正在处理', mask: true })
deleteCar(item.id).then(result => {
wx.hideLoading()
this.onRefreshList()
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
}).catch(err => {
})
},
onUnload: function(){ onUnload: function(){
event.remove('OrderMessage', this) event.remove('OrderMessage', this)
} }

2
pages/setting/vehicle-list/index.json

@ -1,10 +1,12 @@
{ {
"usingComponents": { "usingComponents": {
"van-search": "/components/search/index",
"refresh-view": "/components/refresh-view/index", "refresh-view": "/components/refresh-view/index",
"van-button": "/components/button/index", "van-button": "/components/button/index",
"van-cell": "/components/cell/index", "van-cell": "/components/cell/index",
"van-divider": "/components/divider/index", "van-divider": "/components/divider/index",
"van-loading": "/components/loading/index", "van-loading": "/components/loading/index",
"van-dialog": "/components/dialog/index",
"notification": "/pages/message/notification/index" "notification": "/pages/message/notification/index"
} }
} }

17
pages/setting/vehicle-list/index.wxml

@ -3,6 +3,9 @@
<view slot="content" style="color:black;font-size:18px">车辆管理</view> <view slot="content" style="color:black;font-size:18px">车辆管理</view>
</cu-custom> </cu-custom>
<van-search value="{{ form.name }}" shape="round" placeholder="请输入车牌号码" use-action-slot bind:change="onChange">
<view slot="action" bind:tap="onSearch" style="padding: 0rpx 8rpx">搜索</view>
</van-search>
<refresh-view id="refresh" height="{{height}}" bind:refresh="onRefreshList" bind:loadmore="fetchOrderList"> <refresh-view id="refresh" height="{{height}}" bind:refresh="onRefreshList" bind:loadmore="fetchOrderList">
<view class="list-empty" style="height:{{height}}rpx" wx:if="{{!orderList.length}}"> <view class="list-empty" style="height:{{height}}rpx" wx:if="{{!orderList.length}}">
<view style="margin-bottom:24px" wx:if="{{loading}}"> <view style="margin-bottom:24px" wx:if="{{loading}}">
@ -12,12 +15,15 @@
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</view> <view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</view>
</view> </view>
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex"> <view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex">
<van-cell center clickable is-link wx:for="{{pageItem}}" wx:key="index">
<view slot="title" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem">
<view class="text-sg text-bold">车牌号你:{{item.plateNumber}}</view>
<view class="text-sm text-gray" style="line-height: 28rpx">
<text>司机:{{item.driverName}}({{item.mobile}})</text>
<van-cell center clickable wx:for="{{pageItem}}" wx:key="index">
<view slot="title" class="flex flex-justify" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem">
<view>
<view class="text-sg text-bold">车牌号你:{{item.plateNumber}}</view>
<view class="text-sm text-gray" style="line-height: 28rpx">
<text>司机:{{item.driverName}}({{item.driverMobile}})</text>
</view>
</view> </view>
<van-button plain type="danger" size="small" bind:click="deleteForm" data-page="{{pageIndex}}" data-index="{{index}}">删除</van-button>
</view> </view>
</van-cell> </van-cell>
</view> </view>
@ -32,4 +38,5 @@
<van-button round type="info" icon="plus" bind:click="lookItem" custom-style="width: 100rpx;height: 100rpx;"></van-button> <van-button round type="info" icon="plus" bind:click="lookItem" custom-style="width: 100rpx;height: 100rpx;"></van-button>
</view> </view>
<van-dialog id="van-dialog" />
<notification id="qn-notification"/> <notification id="qn-notification"/>

6
utils/util.js

@ -206,11 +206,11 @@ function substring(string, length){
} }
/*函数节流*/ /*函数节流*/
function throttle(fn, interval) { function throttle(fn, interval) {
var enterTime = 0//触发的时间
interval = interval || 300 //间隔时间,如果interval不传,则默认300ms
var enterTime = 0 //触发的时间
var gap = interval || 300//间隔时间,如果interval不传,则默认300ms
return function() { return function() {
var backTime = Date.now()//第一次函数return即触发的时间 var backTime = Date.now()//第一次函数return即触发的时间
if (backTime - enterTime > interval) {
if (backTime - enterTime > gap) {
fn.apply(this, arguments) fn.apply(this, arguments)
enterTime = backTime//赋值给第一次触发的时间,这样就保存了第二次触发的时间 enterTime = backTime//赋值给第一次触发的时间,这样就保存了第二次触发的时间
} }

Loading…
Cancel
Save