You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1007 lines
34 KiB

<template>
<view>
<cmd-nav-bar iconOne="menu" @iconOne="goToInfo" :title="shopName" background-color="#fff"></cmd-nav-bar>
<view class="IndexContent">
<view class="contentPadding">
<view style="width: 95%;display: flex;margin: 0 auto;">
<view v-if = "wluserType != 2" class="top-btn" style="width: 100%;" @tap="gokaidan">开单</view>
<view v-else class="top-btn" style="width: 100%;">
<kk-printer ref="kkprinter" :bufferData="bufferData" :defaultText="'打印票据'"
@onPrint="goPrintList"></kk-printer>
</view>
</view>
<view class="title">
<i class="iconfont icon-xiaoshouyuce"> 今日营收详情
<view class="btn" @tap="gotoSearchData">
数据统计 >
</view>
</i>
</view>
<view style="display: flex;text-align: center;font-size: 30rpx;">
<view class="title-four" @tap='shijiPrice = true'>
<view style="line-height:80rpx;font-size:34rpx;">{{orderStatistics.totalFreight!=null?orderStatistics.totalFreight:0}}</view>
<view>客户运费</view>
</view>
<view class="title-four">
<view style="line-height:80rpx;font-size:34rpx;">{{orderStatistics.totalOrder!=null?orderStatistics.totalOrder:0}}</view>
<view>总单数</view>
</view>
<view class="title-four">
<view style="line-height:80rpx;font-size:34rpx;">{{orderStatistics.totalWeight!=null?orderStatistics.totalWeight:0}}</view>
<view>总重量</view>
</view>
<view class="title-four">
<view style="line-height:80rpx;font-size:34rpx;">{{orderStatistics.totalCount!=null?orderStatistics.totalCount:0}}</view>
<view>总件数</view>
</view>
</view>
</view>
<view class="contentPadding" style="margin-top: 20rpx;">
<view>
<uni-datetime-picker style="margin-bottom:10px;" v-model="range" @change="searchList" type="daterange" />
<uni-search-bar class="uni-mt-10" radius="5" placeholder="输入线路/物流公司/收发货人搜索" cancelButton="none"
@confirm="searchList" @clear="searchList" />
</view>
<view style="display: flex;width: 95%;margin: 0 auto;">
<uni-data-select v-model="lineValue" :localdata="lineList" @change="lineChange" placeholder="线路" style="width: 49%;margin: 0 1.5%;"></uni-data-select>
<!-- <uni-data-select v-model="companyValue" :localdata="comPanyList" @change="companyChange" placeholder="物流公司" style="width: 32%;margin: 0 1.5%;"></uni-data-select> -->
<uni-data-select v-model="stationName" :localdata="arrivalStationList" @change="stationChange" placeholder="到达站" style="width: 49%;"></uni-data-select>
</view>
<view class="title">
<i class="iconfont icon-wenjianliebiao">订单列表</i>
</view>
<ul class="inventoryList" v-if="orderList.length > 0">
<li v-for="(item,index) in orderList" :key="index">
<uni-card :title="item.companyName == null ?'暂无':item.companyName"
:sub-title="item.createTime" :extra="'¥'+(item.allCost == null ?'暂无':item.allCost)"
@tap="gotoDetail(item)">
<view class="uni-body">
<text class="cardText">单号:</text>
{{item.orderNumber}}
</view>
<view class="uni-body">
{{item.goStationName}}
<text class="cardText"></text>
{{item.arrivalStationName}}
</view>
<view class="uni-body">
(){{ item.shipperName == null ?'暂无':item.shipperName}} -
(){{ item.receiverName == null ?'暂无':item.receiverName }}
</view>
<view class="uni-body">
<text class="cardText">重量:{{item.weight}}</text>
<text class="cardText" style="padding-left: 20rpx;">件数:{{item.count}}</text>
</view>
<view class="uni-body">
<text class="cardText">接站人:{{item.receivingUserName}}</text>
</view>
<view v-if = "wluserType != 2" @tap.stop="goAddOrderPage(item)" style="position: absolute;bottom: 20rpx;right: 20rpx;color: #00B5FF;">
修改订单
</view>
<view v-if = "wluserType != 2" @tap.stop="delOrder(item)" style="position: absolute;bottom: 100rpx;right: 20rpx;color: #00B5FF;">
删除订单
</view>
<view v-if="item.changeCount != '0'" style="position: absolute;top: 140rpx;right: 20rpx;color: #00B5FF;">
修改次数:{{item.changeCount}}
</view>
</uni-card>
</li>
</ul>
<u-empty v-else mode="order" text="暂无物流订单"></u-empty>
</view>
</view>
<u-popup :show="settingShow1" @close="settingShow1 = false" closeOnClickOverlay mode="left" safeAreaInsetTop>
<view class="popup-content">
<view style="z-index:999">
<u-cell-group>
<u-cell icon="grid-fill" url="/package2/other/logisticsPeopleList" title="人员管理" clickable isLink
arrow-direction="left"></u-cell>
<u-cell v-if="companyId == '1782981706819702784' || companyId == '1751796589518786560' || companyId == '1899370468356526080' || companyId == '1898907758179258368' || companyId == '1899371352842964992'" icon="grid-fill" url="/package2/other/stationList" title="到达站管理" clickable isLink
arrow-direction="left"></u-cell>
<u-cell icon="grid-fill" url="/package2/other/upCarRecord" title="装车记录" clickable isLink
arrow-direction="left"></u-cell>
<u-cell icon="setting-fill" url="/package2/other/logisticsSystemSet" title="系统配置" clickable isLink
arrow-direction="left"></u-cell>
<u-cell icon="setting-fill" v-if="shopName == '测试勿选'" url="/package2/other/internationalLogistics" title="国际物流" clickable isLink
arrow-direction="left"></u-cell>
<view class="border-line"></view>
<u-cell icon="rewind-left-fill" @click="goBack" title="退出登录" clickable isLink
arrow-direction="left"></u-cell>
</u-cell-group>
</view>
</view>
</u-popup>
<view v-if="shijiPrice" style="width:100%;height:100%;position: fixed;top: 0;background: rgba(0,0,0,0.7);">
<view
style="position: fixed;margin:auto;height:340rpx;left:0;right:0;top:0;bottom:0;width:600rpx;background:#fff;border-radius: 10px;color: #000;">
<view style="width:100%;height:80rpx;font-size: 30rpx;text-align: center;line-height: 80rpx;font-weight: bold;">
运费明细
</view>
<view style="width: 95%;height:160rpx;margin: 0 auto;border-top: 1px solid #eee;">
<view class="tan-lirun">
<text style="font-weight: bold;margin-top: 20rpx;">1000</text>
<text>提付</text>
</view>
<view class="tan-lirun" style="margin: 10px 2% 0 2%;" >
<text style="font-weight: bold;margin-top: 20rpx;">520</text>
<text>月付</text>
</view>
<view class="tan-lirun">
<text style="font-weight: bold;margin-top: 20rpx;">1000</text>
<text>现金</text>
</view>
</view>
<view @tap="shijiPrice = false" style="height: 100rpx;width: 100%;line-height: 100rpx;text-align: center;border-top: 1px solid #eee;font-size: 40rpx;">
确定
</view>
</view>
</view>
</view>
</template>
<script>
import util from '@/components/kk-printer/utils/util.js';
import * as blesdk from '@/components/kk-printer/utils/bluetoolth.js';
import kkPrinter from '@/components/kk-printer/index.vue';
import gbk from '@/components/kk-printer/utils/printUtil-GBK.js';
export default {
data() {
return {
arrivalStationList:[],
shopName:'',
pageNum:1,
searchStr:'',
allCount:0,
shijiPrice: false,
settingShow1: false,
orderList:[],
lineList:[],
range:[],
lineValue:'',
comPanyList:[],
wluserType:uni.getStorageSync('wluserType'),
companyValue:'',
stationName:'',
stationValue:{
stationName:'',
id:''
},
companyId:"",
itemData:{},
circuitId:'',
arrivalStationId:'',
lineRange:[],
companyRange:[],
bufferDataList:[],
orderStatistics:{},
bufferData:[],
stationRange:[],
shopRemark:[],
companyTel:''
}
},
components: {
kkPrinter
},
onShareAppMessage() {
return {
title: '查看我的物流单',
imageUrl: 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/b28b3d46c21d4f60a334b25f56175cf3.jpg',
path: '/package2/other/logisticsOrderDetail?item='+ JSON.stringify(this.itemData)
}
},
onShow() {
this.pageNum = 1
this.orderList = []
this.getOrderList()
this.getStation()
this.getLine()
this.getLineByCompany('')
this.getAllNum()
// 初始化蓝牙模块
wx.openBluetoothAdapter({
mode: 'central'
})
},
onLoad() {
let that = this;
this.getMonth();
this.companyId = uni.getStorageSync('transCompany');
this.shopName = uni.getStorageSync('companyName');
uni.setNavigationBarTitle({
title: this.shopName
});
if(uni.getStorageSync('remark')){
let remark = uni.getStorageSync('remark')
this.shopRemark = remark.split('\n');
}
if(uni.getStorageSync('companyTel')){
this.companyTel = uni.getStorageSync('companyTel')
}
},
onReachBottom() {
if (this.pageNum >= this.pages) return;
this.status = 'loading';
this.pageNum ++;
this.getOrderList();
},
methods: {
goPrintList() {
let that = this;
this.bufferData = this.bufferDataList
// this.xierushuju(this.bufferData)
this.$nextTick(() => {
setTimeout(res => {
that.bufferData = []
}, 1000 * that.orderList.length)
uni.hideLoading();
})
},
xierushuju() {
let that = this;
//写入数据
if (this.defaultText == '小标签') {
that.$emit('onPrintSmall1');
} else if (this.defaultText == '确认打印') {
that.$emit('goPrint');
} else {
that.$emit('onPrint');
}
that.$nextTick(() => {
var dataStr = ''
for (let m = 0; m < that.bufferData.length; m++) {
dataStr += that.bufferData[m]
}
const maxChunk = that.deviceType == 'android' ? 20 : 180;
const delay = that.deviceType == 'android' ? 20 : 180;
let buffer = gbk.strToGBKByte(dataStr)
for (let i = 0, j = 0, length = buffer.byteLength; i < length; i += maxChunk, j++) {
let subPackage = buffer.slice(i, i + maxChunk <= length ? (i + maxChunk) : length);
setTimeout(that._writeBLECharacteristicValue, j * delay, subPackage);
}
})
return;
},
_writeBLECharacteristicValue(buffer) {
let that = this;
wx.writeBLECharacteristicValue({
deviceId: uni.getStorageSync('deviceId'),
serviceId: uni.getStorageSync('serviceId'),
characteristicId: uni.getStorageSync('characteristicId'),
value: buffer,
success(res) {
},
fail(res) {
wx.closeBLEConnection({
deviceId: uni.getStorageSync('deviceId'),
success(res) {
}
})
if (uni.getStorageSync('deviceId')) {
that.xierushuju()
} else {
that.jiantingshebei()
}
}
})
uni.hideLoading();
},
getLineByCompany(id){
if(id == ''){
let data = {
text:uni.getStorageSync('companyName'),
value:uni.getStorageSync('transCompany')
}
this.comPanyList.push(data)
return
}
uni.request({
url: this.tui.interfaceUrl() + '/app/logisticsCompanyRoute/getLogisticsCompanyRoutePageList',
data:{
pageNum:1,
pageSize:100,
companyId:this.companyId,
companyName:"",
circuitId:id,
circuitName:""
},
header: {
'content-type': 'application/json',
'appWLToken': this.tui.getToken()
},
method: 'POST', //'GET','POST'
dataType: 'json',
success: (res) => {
if(res.data.code == 401){
uni.clearStorage()
uni.navigateTo({
url: '/package2/login/login'
})
}
if (res.data.code == 200){
for (let i = 0; i < res.data.result.records.length; i++) {
res.data.result.records[i].value = res.data.result.records[i].companyId
res.data.result.records[i].text = res.data.result.records[i].companyName
}
setTimeout(res1=>{
this.comPanyList = res.data.result.records
},500)
}
},
fail: (res) => {
this.tui.toast("网络不给力,请稍后再试~")
}
})
},
convertToChineseNumeral1(money) {
let fu = false
if (money == 0) {
return '零元整'
}
if (JSON.stringify(money).indexOf('-') != -1) {
money = JSON.stringify(money).split('-')[1]
fu = true
}
const cnNums = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']
const cnIntRadice = ['', '拾', '佰', '仟']
const cnIntUnits = ['', '万', '亿', '兆']
const cnDecUnits = ['角', '分', '毫', '厘']
const cnInteger = '整'
const cnIntLast = '元'
const maxNum = 999999999999999.9999
let integerNum
let decimalNum
let chineseStr = ''
let parts
if (money == '') {
return ''
}
money = parseFloat(money)
if (money >= maxNum) {
return ''
}
if (money == 0) {
chineseStr = cnNums[0] + cnIntLast + cnInteger
return chineseStr
}
money = money.toString()
if (money.indexOf('.') == -1) {
integerNum = money
decimalNum = ''
} else {
parts = money.split('.')
integerNum = parts[0]
decimalNum = parts[1].substr(0, 4)
}
if (parseInt(integerNum, 10) > 0) {
let zeroCount = 0
const IntLen = integerNum.length
for (let i = 0; i < IntLen; i++) {
const n = integerNum.substr(i, 1)
const p = IntLen - i - 1
const q = p / 4
const m = p % 4
if (n == '0') {
zeroCount++
} else {
if (zeroCount > 0) {
chineseStr += cnNums[0]
}
zeroCount = 0
chineseStr += cnNums[parseInt(n)] + cnIntRadice[m]
}
if (m == 0 && zeroCount < 4) {
chineseStr += cnIntUnits[q]
}
}
chineseStr += cnIntLast
}
if (decimalNum != '') {
const decLen = decimalNum.length
for (let i = 0; i < decLen; i++) {
const n = decimalNum.substr(i, 1)
if (n != '0') {
chineseStr += cnNums[Number(n)] + cnDecUnits[i]
}
}
}
if (chineseStr == '') {
chineseStr += cnNums[0] + cnIntLast + cnInteger
} else if (decimalNum == '') {
chineseStr += cnInteger
}
if (fu == true) {
chineseStr = '负' + chineseStr
}
return chineseStr
},
getAllNum(){
let currentTime = new Date();
let year = currentTime.getFullYear();
let month = currentTime.getMonth() + 1; // 月份从0开始,因此需要加1
let day = currentTime.getDate();
uni.request({
url: this.tui.interfaceUrl() + '/app/logisticsOrder/getLogisticsOrderStatistics',
data:{
companyId:this.companyId,
startDate:year+'-'+month+'-'+day,
endDate:year+'-'+month+'-'+day
},
header: {
'content-type': 'application/json',
'appWLToken': this.tui.getToken()
},
method: 'POST', //'GET','POST'
dataType: 'json',
success: (res) => {
if(res.data.code == 401){
uni.clearStorage()
uni.navigateTo({
url: '/package2/login/login'
})
}
if (res.data.code == 200){
this.orderStatistics = res.data.result
}
},
fail: (res) => {
this.tui.toast("网络不给力,请稍后再试~")
}
})
},
getLine(){
uni.request({
url: this.tui.interfaceUrl() + '/app/logisticsCompanyRoute/getLogisticsCompanyRoutePageList',
data:{
pageNum:1,
pageSize:100,
companyId:uni.getStorageSync('transCompany'),
companyName:"",
circuitId:"",
circuitName:""
},
header: {
'content-type': 'application/json',
'appWLToken': this.tui.getToken()
},
method: 'POST', //'GET','POST'
dataType: 'json',
success: (res) => {
if(res.data.code == 401){
uni.clearStorage()
uni.navigateTo({
url: '/package2/login/login'
})
}
if (res.data.code == 200){
for (let i = 0; i < res.data.result.records.length; i++) {
res.data.result.records[i].value = res.data.result.records[i].circuitId
res.data.result.records[i].text = res.data.result.records[i].circuitName
}
setTimeout(res1=>{
this.lineList = res.data.result.records
},500)
}
},
fail: (res) => {
this.tui.toast("网络不给力,请稍后再试~")
}
})
},
//数据统计
gotoSearchData() {
uni.navigateTo({
url: '/package2/other/logisticsDataStatistics'
})
},
goAddOrderPage(data){
uni.navigateTo({
url:'/package2/other/newLogisticsBill?editData='+JSON.stringify(data)
})
},
goToInfo() {
this.settingShow1 = true
},
gotoDetail(item){
uni.navigateTo({
url:'/package2/other/logisticsOrderDetail?item='+ JSON.stringify(item)
})
},
getOrderList(){
let that = this
that.bufferDataList = []
uni.request({
url: this.tui.interfaceUrl() + '/app/logisticsOrder/getLogisticsOrderPageList',
data:{ //stationId
pageNum:this.pageNum,
pageSize:this.wluserType == '2' ? "1000" : "10",
companyName:"",
companyId:this.companyId,
circuitName:"",
circuitId:this.circuitId,
arrivalStationId:this.arrivalStationId,
shipperName:"",
shipperMobile:"",
shipperAddress:"",
receiverName:"",
startDate:that.range[0],
endDate:that.range[1],
searchStr:this.searchStr
},
header: {
'content-type': 'application/json',
'appWLToken': this.tui.getToken()
},
method: 'POST', //'GET','POST'
dataType: 'json',
success: (res) => {
this.status = 'nomore';
if(res.data.code == 401){
uni.clearStorage()
uni.navigateTo({
url: '/package2/login/login'
})
}
if (res.data.code == 200){
if (this.pages == 1) {
this.orderList = res.data.result.records
} else {
this.orderList = [...this.orderList, ...res.data.result.records]
}
//收货单横向打印
for(let i=0;i<that.orderList.length;i++){
//let strCmd = blesdk.CreatCPCLPage(600, 480, 1, 0,0);
let strCmd = blesdk.CreatCPCLPage(780, 1590, 1, 0,0);
strCmd += blesdk.addCPCLSETMAG(2, 2)
strCmd += blesdk.addCPCLLocation(2);
strCmd += blesdk.addCPCLText('0', (1590 + (that.orderList[i].companyName.length * 40))/2, '24', '1', 1, that.orderList[i].companyName)
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('50', 1500, '24', '0.5', 1, '开票日期:'+ that.orderList[i].createTime + ' 发站:' +that.orderList[i].goStationName +'-->'+ that.orderList[i].arrivalStationName +' 卸货地点:'+ that.orderList[i].arrivalStationName +' 货号:'+that.orderList[i].orderNumber)
//正文第一行
strCmd += blesdk.addCPCLText('90', 1290, '24', '0', 1, '收货人')
strCmd += blesdk.addCPCLLine(80, 1200, 125, 1200, 2);
strCmd += blesdk.addCPCLText('90', 1180, '24', '0', 1, that.orderList[i].receiverName)
strCmd += blesdk.addCPCLLine(80, 1070, 125, 1070, 2);
strCmd += blesdk.addCPCLText('90', 1050, '24', '0', 1, '电话')
strCmd += blesdk.addCPCLLine(80, 970, 125, 970, 2);
strCmd += blesdk.addCPCLText('90', 960, '24', '0', 1, that.orderList[i].receiverMobile)
strCmd += blesdk.addCPCLLine(80, 760, 125, 760, 2);
strCmd += blesdk.addCPCLText('90', 740, '24', '0', 1, '票号')
strCmd += blesdk.addCPCLLine(80, 660, 125, 660, 2);
strCmd += blesdk.addCPCLText('90', 640, '24', '0', 1, '')
//正文第二行
strCmd += blesdk.addCPCLText('135', 1290, '24', '0', 1, '发货人')
strCmd += blesdk.addCPCLLine(125, 1200, 170, 1200, 2);
strCmd += blesdk.addCPCLText('135', 1180, '24', '0', 1, that.orderList[i].shipperName)
strCmd += blesdk.addCPCLLine(125, 1070, 170, 1070, 2);
strCmd += blesdk.addCPCLText('135', 1050, '24', '0', 1, '电话')
strCmd += blesdk.addCPCLLine(125, 970, 170, 970, 2);
strCmd += blesdk.addCPCLText('135', 960, '24', '0', 1, that.orderList[i].shipperMobile)
strCmd += blesdk.addCPCLLine(125, 760, 170, 760, 2);
strCmd += blesdk.addCPCLText('135', 740, '24', '0', 1, '身份证')
strCmd += blesdk.addCPCLLine(125, 630, 170, 630, 2);
strCmd += blesdk.addCPCLText('135', 620, '24', '0', 1, '')
//正文第三行
strCmd += blesdk.addCPCLText('180', 1290, '24', '0', 1, '货名')
strCmd += blesdk.addCPCLLine(170, 1200, 215, 1200, 2);
strCmd += blesdk.addCPCLText('180', 1180, '24', '0', 1, '件数')
strCmd += blesdk.addCPCLLine(170, 1070, 215, 1070, 2);
strCmd += blesdk.addCPCLText('180', 1050, '24', '0', 1, '付款方式')
strCmd += blesdk.addCPCLLine(170, 900, 215, 900, 2);
strCmd += blesdk.addCPCLText('180', 890, '24', '0', 1, '运费')
strCmd += blesdk.addCPCLLine(170, 800, 215, 800, 2);
strCmd += blesdk.addCPCLText('180', 790, '24', '0', 1, '送货')
strCmd += blesdk.addCPCLLine(170, 700, 215, 700, 2);
strCmd += blesdk.addCPCLText('180', 690, '24', '0', 1, '中转')
strCmd += blesdk.addCPCLLine(170, 600, 215, 600, 2);
strCmd += blesdk.addCPCLText('180', 590, '24', '0', 1, '工本费')
strCmd += blesdk.addCPCLLine(170, 500, 215, 500, 2);
strCmd += blesdk.addCPCLText('180', 490, '24', '0', 1, '保费')
strCmd += blesdk.addCPCLLine(170, 400, 215, 400, 2);
strCmd += blesdk.addCPCLText('180', 390, '24', '0', 1, '垫付')
strCmd += blesdk.addCPCLLine(170, 300, 215, 300, 2);
strCmd += blesdk.addCPCLText('180', 290, '24', '0', 1, '代收款')
strCmd += blesdk.addCPCLLine(170, 200, 215, 200, 2);
strCmd += blesdk.addCPCLText('180', 190, '24', '0', 1, '货到付款')
//正文第四行
strCmd += blesdk.addCPCLText('225', 1290, '24', '0', 1, that.orderList[i].objectName)
strCmd += blesdk.addCPCLLine(215, 1200, 260, 1200, 2);
strCmd += blesdk.addCPCLText('225', 1180, '24', '0', 1, that.orderList[i].count)
strCmd += blesdk.addCPCLLine(215, 1070, 260, 1070, 2);
strCmd += blesdk.addCPCLText('225', 1050, '24', '0', 1, that.orderList[i].methodOfSettlement == 0 ?'现金':that.orderList[i].methodOfSettlement == 1 ?'月付':that.orderList[i].methodOfSettlement == 2 ?'到付':'')
strCmd += blesdk.addCPCLLine(215, 900, 260, 900, 2);
strCmd += blesdk.addCPCLText('225', 890, '24', '0', 1, that.orderList[i].freight)
strCmd += blesdk.addCPCLLine(215, 800, 260, 800, 2);
strCmd += blesdk.addCPCLText('225', 790, '24', '0', 1, that.orderList[i].deliveryFee)
strCmd += blesdk.addCPCLLine(215, 700, 260, 700, 2);
strCmd += blesdk.addCPCLText('225', 690, '24', '0', 1, that.orderList[i].transitFee)
strCmd += blesdk.addCPCLLine(215, 600, 260, 600, 2);
strCmd += blesdk.addCPCLText('225', 590, '24', '0', 1, that.orderList[i].cost)
strCmd += blesdk.addCPCLLine(215, 500, 260, 500, 2);
strCmd += blesdk.addCPCLText('225', 490, '24', '0', 1, that.orderList[i].premium)
strCmd += blesdk.addCPCLLine(215, 400, 260, 400, 2);
strCmd += blesdk.addCPCLText('225', 390, '24', '0', 1, '')
strCmd += blesdk.addCPCLLine(215, 300, 260, 300, 2);
strCmd += blesdk.addCPCLText('225', 290, '24', '0', 1, that.orderList[i].paymentForGoods)
strCmd += blesdk.addCPCLLine(215, 200, 260, 200, 2);
let allmoney = Number(that.orderList[i].premium)+Number(that.orderList[i].cost)+Number(that.orderList[i].freight)+Number(that.orderList[i].deliveryFee)+Number(that.orderList[i].transitFee)
if(that.orderList[i].methodOfSettlement == 2){
strCmd += blesdk.addCPCLText('225', 190, '24', '0', 1, allmoney)
}else{
strCmd += blesdk.addCPCLText('225', 190, '24', '0', 1, '')
}
//正文第五行
strCmd += blesdk.addCPCLText('270', 1290, '24', '0', 1, '运费合计:'+that.convertToChineseNumeral1(allmoney)+' ¥'+allmoney)
strCmd += blesdk.addCPCLLine(260, 700, 305, 700, 2);
strCmd += blesdk.addCPCLText('270', 690, '24', '0', 1, '代收款:'+that.convertToChineseNumeral1(Number(that.orderList[i].paymentForGoods))+' ¥'+that.orderList[i].paymentForGoods)
//正文第六行
strCmd += blesdk.addCPCLText('315', 1290, '24', '0', 1, '备注 '+that.orderList[i].remark)
strCmd += blesdk.addCPCLLine(305, 700, 350, 700, 2);
strCmd += blesdk.addCPCLText('315', 690, '24', '0', 1, '特别声明')
//正文第七行
strCmd += blesdk.addCPCLLocation(0);
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('360', 1290, '24', '0', 1, '注')
strCmd += blesdk.addCPCLText('390', 1290, '24', '0', 1, '意')
strCmd += blesdk.addCPCLText('420', 1290, '24', '0', 1, '事')
strCmd += blesdk.addCPCLText('450', 1290, '24', '0', 1, '项')
strCmd += blesdk.addCPCLLine(350, 1260, 475, 1260, 2);
if(that.shopRemark.length > 0){
let beginheight = 0
for(let q = 0;q<that.shopRemark.length;q++){
strCmd += blesdk.addCPCLText((360 + beginheight).toString(), 1250, '24', '0', 1, that.shopRemark[q])
beginheight+=30
}
}
//正文第八行
strCmd += blesdk.addCPCLText('485', 1290, '24', '0', 1, that.companyTel)
//左一竖线
strCmd += blesdk.addCPCLLine(80, 1500, 510, 1500, 2);
//左二竖线
strCmd += blesdk.addCPCLLine(80, 1300, 510, 1300, 2);
//右一竖线
strCmd += blesdk.addCPCLLine(80, 80, 510, 80, 2);
//第一条横线
strCmd += blesdk.addCPCLLine(80, 1500, 80, 80, 2);
//第二条横线
strCmd += blesdk.addCPCLLine(125, 1300, 125, 80, 2);
//第三条横线
strCmd += blesdk.addCPCLLine(170, 1300, 170, 80, 2);
//第四条横线
strCmd += blesdk.addCPCLLine(215, 1300, 215, 80, 2);
//第五条横线
strCmd += blesdk.addCPCLLine(260, 1300, 260, 80, 2);
//第六条横线
strCmd += blesdk.addCPCLLine(305, 1300, 305, 80, 2);
//第七条横线
strCmd += blesdk.addCPCLLine(350, 1300, 350, 80, 2);
//第八条横线
strCmd += blesdk.addCPCLLine(475, 1300, 475, 80, 2);
//第九条横线
strCmd += blesdk.addCPCLLine(520, 1500, 520, 80, 2);
// strCmd += blesdk.addCPCLLine(50, 1500, 250, 100, 2);
/*
strCmd += blesdk.addCPCLLine(10,140,570,140,2) //画线
strCmd += blesdk.addCPCLLine(382,140,382,316,2) //画线
strCmd += blesdk.addCPCLSETMAG(2, 2)
strCmd += blesdk.addCPCLText('20', 160, '24', '0', 0, '到站:'+ arrivalStationName)
strCmd += blesdk.addCPCLLine(10,220,382,220,2) //画线
strCmd += blesdk.addCPCLText('20', 248, '24', '0', 0, '收:'+receiverName)
strCmd += blesdk.addCPCLLine(10,316,570,316,2) //画线
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLText('20', 336, '24', '0', 0, '共'+ this.itemData.count + '件')
strCmd += blesdk.addCPCLText('112', 336, '24', '0', 0, '自提')
strCmd += blesdk.addCPCLLine(170,316,170,450,2) //画线
strCmd += blesdk.addCPCLText('186', 336, '24', '0', 0, '单号:'+ orderNumber + '-' +i)
strCmd += blesdk.addCPCLLine(10,376,570,376,2) //画线
strCmd += blesdk.addCPCLText('20', 396, '24', '0', 0, this.itemData.receiverMobile == 'undefined' || this.itemData.receiverMobile == null ? '' : this.itemData.receiverMobile)
strCmd += blesdk.addCPCLText('186', 396, '24', '0', 0, '备注:'+this.itemData.remark)
strCmd += blesdk.addCPCLQRCode(400, 150 , 'H', '1', 4, orderNumber) //二维码 */
strCmd += blesdk.addCPCLPrint();
console.log("strCmd",strCmd)
that.bufferDataList.push(strCmd);
}
this.pages = res.data.result.pages
this.allCount = 0
}
},
fail: (res) => {
this.tui.toast("网络不给力,请稍后再试~")
}
})
},
delOrder(item){
let that = this;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
uni.showLoading({
title: '加载中...'
})
if (res.confirm) {
uni.request({
url: that.tui.interfaceUrl() + '/app/logisticsOrder/deleteLogisticsOrder',
data:{
id:item.id
},
header: {
'content-type': 'application/x-www-form-urlencoded',
'appWLToken': that.tui.getToken()
},
method: 'POST', //'GET','POST'
dataType: 'json',
success: (res) => {
if(res.data.code == 401){
uni.clearStorage()
uni.navigateTo({
url: '/package2/login/login'
})
}
if(res.data.code == 200){
uni.showToast({
title:'删除成功'
})
setTimeout(res1=>{
that.pageNum = 1
that.orderList = []
that.getOrderList()
that.getAllNum()
},500)
}
},
fail: (res) => {
that.tui.toast("网络不给力,请稍后再试~")
}
})
}
setTimeout(res => {
uni.hideLoading();
}, 500)
}
})
},
//到达站列表
getStation(){
uni.request({
url: this.tui.interfaceUrl() + '/app/logisticsStation/getLogisticsStationListByCompanyId',
data:{
companyId:uni.getStorageSync('transCompany')
},
header: {
'content-type': 'application/json',
'appWLToken': this.tui.getToken()
},
method: 'POST', //'GET','POST'
dataType: 'json',
success: (res) => {
if(res.data.code == 401){
uni.clearStorage()
uni.navigateTo({
url: '/package2/login/login'
})
}
if(res.data.code == 200){
for (let i = 0; i < res.data.result.length; i++) {
res.data.result[i].value = res.data.result[i].id
res.data.result[i].text = res.data.result[i].stationName
}
setTimeout(res1=>{
this.arrivalStationList = res.data.result
},200)
}
},
fail: (res) => {
this.tui.toast("网络不给力,请稍后再试~")
}
})
},
searchList(res) {
this.searchStr = res.value
this.pageNum = 1;
this.orderList = [];
this.getOrderList()
},
goBack(){
uni.showModal({
title:'提示',
content:'确定要退出登录吗?',
success(res) {
if(res.confirm){
uni.clearStorageSync();
uni.reLaunch({
url:'/package2/login/login'
})
}
}
})
},
gokaidan(){
uni.navigateTo({
url:'/package2/other/newLogisticsBill'
})
},
cancelSale(item,type){
this.tui.request('/app/sale/cancelSale', "POST", {
id:item.id
}, true, true).then((res1) => {
if (res1.code == 200) {
if (type == 'goPay') {
this.goSaleGoods(item)
} else {
this.getSaleInfo()
}
} else {
this.tui.toast(res.message)
}
}).catch((res1) => {})
},
//获取当月1日到当前时间
getMonth() {
let date = new Date()
let year = date.getFullYear().toString() //'年'
let month = date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1).toString():(date.getMonth()+1).toString() //'月'
let da = date.getDate() < 10 ? '0'+date.getDate().toString():date.getDate().toString() //'日'
let end = year + '-' + month + '-' + da //当天
this.range = [end,end]
},
lineChange(e){
if(e == ''){
this.comPanyList = []
}
this.circuitId = e
this.getOrderList()
this.getLineByCompany(e)
},
stationChange(e){
if(e == ''){
this.arrivalStationId = ""
this.getOrderList()
}else{
for(let i=0;i<this.arrivalStationList.length;i++){
if(this.arrivalStationList[i].id == e){
this.arrivalStationId = this.arrivalStationList[i].id
this.getOrderList()
}
}
}
},
}
}
</script>
<style lang="scss">
.top-btn{
height: 80rpx;
border-radius: 20rpx;
background: #00B5FF;
margin: 0 auto;
font-size: 35rpx;
color: #fff;
text-align: center;
line-height: 80rpx;
margin-bottom: 20rpx;
}
.IndexContent {
margin-top:180rpx;
.contentPadding {
padding: 28upx 20upx;
background-color: #fff;
color: #909399;
.title {
padding-left: 20rpx;
font-size: 32rpx;
color: #303133;
margin-bottom: 26rpx;
line-height: 66rpx;
.btn {
text-align: right;
width: 24%;
float: right;
font-size: 26rpx;
color: $u-primary;
}
}
.grid-text {
font-size: 28rpx;
margin-bottom: 26rpx;
}
}
}
.u-grid-item {
width: 30% !important;
height: 160rpx;
background-image: linear-gradient(#84C1FF, #C4E1FF) !important;
margin-left: 3%;
border-radius: 30rpx;
margin-top: 20rpx !important;
color: #fff !important;
}
.u-count-num {
color: #FFF !important
}
.floatRight {
float: right;
padding: 14rpx;
color: $u-primary;
font-size: 26upx;
}
.border-line {
width: 100%;
height: 15rpx;
background: #eee;
}
.uni-date {
width: 95% !important;
margin: 0 auto;
}
.tan-lirun{
margin-top: 20rpx;
width: 32%;
height: 60px;
display: flex;
flex-direction: column;
text-align: center;
float: left;
background-image: linear-gradient(#84C1FF, #C4E1FF) !important;
color: #fff;
border-radius: 10px;
}
.title-four{
width: 23% !important;
height: 160rpx;
background-image: linear-gradient(#84C1FF, #C4E1FF) !important;
margin-left: 2%;
border-radius: 30rpx;
margin-top: 20rpx !important;
color: #fff !important;
}
</style>