平板端快衣店
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.
 
 
 
 
 

1 lines
45 KiB

require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["package2/other/newLogisticsBill"],{"1d00":function(e,t,i){"use strict";i.r(t);var a=i("b75b"),o=i("383a");for(var r in o)["default"].indexOf(r)<0&&function(e){i.d(t,e,(function(){return o[e]}))}(r);i("8fd8");var s=i("828b"),n=Object(s["a"])(o["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],void 0);t["default"]=n.exports},"33fe":function(e,t,i){},"36a2":function(e,t,i){"use strict";(function(e,a){var o=i("47a9"),r=i("3b2d");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=o(i("7eb4")),n=o(i("ee10")),c=o(i("af34")),d=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!==typeof e)return{default:e};var i=l(t);if(i&&i.has(e))return i.get(e);var a={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var n=o?Object.getOwnPropertyDescriptor(e,s):null;n&&(n.get||n.set)?Object.defineProperty(a,s,n):a[s]=e[s]}a.default=e,i&&i.set(e,a);return a}(i("b37f")),u=o(i("301e"));function l(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(l=function(e){return e?i:t})(e)}var h=requirePlugin("WechatSI"),g=h.getRecordRecognitionManager(),v={data:function(){return{faBookShow:!1,weightCount:1,shouBookShow:!1,moreShouList:[],weigthAdd:"",moreFaList:[],newFa:!1,orderList:[],daodaList:[],newShou:!1,linshiPrice:0,addForm:{nickName:"",mobile:"",address:""},pageNum:1,bufferData:[],voiceText:"",addressType:"",isVoice:!1,priceCurrent:0,priceItems:[{value:0,name:"否"},{value:1,name:"是"}],arrivalStationList:[],goStationList:[],payTypeList:[{value:"0",text:"现金"},{value:"1",text:"月付"},{value:"2",text:"提付"}],userData:{},isSearching:!1,isShowSearch:!1,devicesList:[],deviceId:"",services:"",serviceId:"",deviceType:"ios",voiceData:{createBy:e.getStorageSync("mobile"),companyId:e.getStorageSync("transCompany"),companyName:e.getStorageSync("companyName"),imagePath:"",weightHistory:"",circuitId:"",circuitName:"",shipperName:"",shipperMobile:"",shipperAddress:"",receiverName:"",receiverMobile:"",receiverAddress:"",newReceiverName:"",newShipperName:"",goStationId:"",goStationName:"沧州",arrivalStationId:"",arrivalStationName:"",landingFee:0,deliveryFee:0,weight:0,count:1,freight:0,premium:0,transitFee:0,transferAddition:0,paymentForGoods:0,tips:0,methodOfSettlement:"2",cost:0,allCost:0,orderNumber:"",objectName:"",remark:"",receivingUserId:"",receivingUserName:""},recordState:!1,userList:[],isEdit:!1,transferStationList:[],productPicture:[],customList:[]}},onShow:function(){var t=this;e.getSystemInfo({success:function(e){t.deviceType=e.osName},fail:function(e){console.log("getSystemInfo",e)}}),"1751796589518786560"==e.getStorageSync("transCompany")&&a.openBluetoothAdapter({mode:"central",success:function(t){a.createBLEConnection({deviceId:e.getStorageSync("deviceId"),success:function(){},fail:function(e){console.log("createBLEConnection",e)}})},fail:function(i){console.log("初始化失败",i),"10001"==i.errCode?(console.log("蓝牙未打开",i),e.showToast({duration:2e3,title:"请打开蓝牙后,再进行连接",icon:"none",mask:!0})):(t.tui.toast("连接失败,请重启蓝牙或删除小程序重新进入-1"),console.log("连接失败----11"),t.isShowSearch=!0),setTimeout((function(t){e.hideLoading()}),2e3)}}),e.authorize({scope:"scope.record",success:function(){},fail:function(){this.tui.toast("您未授权,语音功能可能会出现错误")}}),console.log("userData",this.userData),this.userData&&("ji"==this.userData.userType?(this.voiceData.shipperName=this.userData.shipperOrReceiverName,this.voiceData.shipperMobile=this.userData.mobile,this.voiceData.shipperAddress=this.userData.addressInfo,this.voiceData.shipperId=this.userData.id):"shou"==this.userData.userType&&(this.voiceData.receiverName=this.userData.shipperOrReceiverName,this.voiceData.receiverMobile=this.userData.mobile,this.voiceData.receiverAddress=this.userData.addressInfo,this.voiceData.receiverId=this.userData.id)),this.getStationByCompanyId(),this.getGoStationList(),this.getUserList()},onLoad:function(e){if(e.editData){this.isEdit=!0;var t=JSON.parse(e.editData);this.voiceData.imagePath=t.imagePath,this.voiceData.circuitId=t.circuitId,this.voiceData.circuitName=t.circuitName,this.voiceData.shipperName=t.shipperName,this.voiceData.shipperMobile=t.shipperMobile,this.voiceData.shipperAddress=t.shipperAddress,this.voiceData.receiverName=t.receiverName,this.voiceData.receiverMobile=t.receiverMobile,this.voiceData.receiverAddress=t.receiverAddress,this.voiceData.goStationId=t.goStationId,this.voiceData.goStationName=t.goStationName,this.voiceData.arrivalStationId=t.arrivalStationId,this.voiceData.arrivalStationName=t.arrivalStationName,this.voiceData.landingFee=t.landingFee,this.voiceData.deliveryFee=t.deliveryFee,this.voiceData.weight=t.weight,this.voiceData.count=t.count,this.voiceData.freight=t.freight,this.voiceData.premium=t.premium,this.voiceData.transitFee=t.transitFee,this.voiceData.paymentForGoods=t.paymentForGoods,this.voiceData.tips=t.tips,this.voiceData.methodOfSettlement=t.methodOfSettlement,this.voiceData.cost=t.cost,this.voiceData.allCost=t.allCost,this.voiceData.orderNumber=t.orderNumber,this.voiceData.objectName=t.objectName,this.voiceData.remark=t.remark,this.voiceData.weightHistory=t.weightHistory,this.voiceData.receivingUserId=t.receivingUserId,this.voiceData.receivingUserName=t.receivingUserName,this.voiceData.id=t.id,this.getStationByCompanyId(),this.arrivalStationChange(t.arrivalStationId)}},methods:{doNothing:function(){console.log("doNothing")},addWeight:function(){""!=this.voiceData.weightHistory&&void 0!=this.voiceData.weightHistory||(this.voiceData.weightHistory=this.voiceData.weight+"+"),this.$refs.inputDialog.open()},addWeight1:function(e){e.target.value>0&&(-1==e.target.value.indexOf(".")&&-1==String(this.voiceData.weight).indexOf(".")?this.voiceData.weight=Number(this.voiceData.weight)+Number(e.target.value):this.voiceData.weight=(Number(this.voiceData.weight)+Number(e.target.value)).toFixed(2),this.voiceData.weightHistory+=e.target.value+"+")},priceChange:function(t,i){var a=this;e.showLoading({title:"加载中...",mask:!0});if(this.voiceData.transferAddition=t,this.priceCurrent=i,0==t){this.voiceData.transitFee=0;for(var o=0;o<this.transferStationList.length;o++)console.log(this.voiceData.transitFee),this.voiceData.transitFee=(Number(this.voiceData.transitFee)+Number(this.transferStationList[o].transitFee)*Number(this.voiceData.weight)).toFixed(2)}else 1==t&&(this.voiceData.transitFee=0);setTimeout((function(t){a.getAllCost(),e.hideLoading()}),500),this.$forceUpdate()},addressBook:function(t){e.navigateTo({url:"/package2/other/logisticsAddressBook?userType="+t})},inputFocus:function(e,t){""!=e.target.value?this.getCustomList(e.target.value,t):this.customList=[],"fa"==t?(this.newFa=!0,this.shipperId="",this.faBookShow=!0):"shou"==t&&(this.newShou=!0,this.receiverId="",this.shouBookShow=!0)},checkNewPeople:function(e){"fa"==e?(this.newFa=!0,this.voiceData.shipperName=this.voiceData.newShipperName,this.voiceData.shipperMobile=this.voiceData.newShipperMobile,this.voiceData.shipperId=""):(this.newShou=!0,this.voiceData.receiverName=this.voiceData.newReceiverName,this.voiceData.receiverMobile=this.voiceData.newReceiverMobile,this.voiceData.receiverId=""),this.$forceUpdate()},kuaijieName:function(e){this.voiceData.objectName="fuzhuang"==e?"服装":"xiezi"==e?"鞋子":"其他"},getAllCost:function(e,t){"yunshufei"==t?this.linshiPrice==e.target.value?this.voiceData.freight=e.target.value:""==e.target.value?this.voiceData.freight=this.linshiPrice:this.voiceData.freight=e.target.value:"zhongzhuanfei"==t?this.linshiPrice==e.target.value?this.voiceData.transitFee=e.target.value:""==e.target.value?this.voiceData.transitFee=this.linshiPrice:this.voiceData.transitFee=e.target.value:"luodifei"==t?this.linshiPrice==e.target.value?this.voiceData.landingFee=e.target.value:""==e.target.value?this.voiceData.landingFee=this.linshiPrice:this.voiceData.landingFee=e.target.value:"zhongzhuanfei"==t?this.linshiPrice==e.target.value?this.voiceData.songhuofei=e.target.value:""==e.target.value?this.voiceData.songhuofei=this.linshiPrice:this.voiceData.songhuofei=e.target.value:"baofei"==t?this.linshiPrice==e.target.value?this.voiceData.premium=e.target.value:""==e.target.value?this.voiceData.premium=this.linshiPrice:this.voiceData.premium=e.target.value:"xiaofei"==t?this.linshiPrice==e.target.value?this.voiceData.tips=e.target.value:""==e.target.value?this.voiceData.tips=this.linshiPrice:this.voiceData.tips=e.target.value:"gongbenfei"==t?this.linshiPrice==e.target.value?this.voiceData.cost=e.target.value:""==e.target.value?this.voiceData.cost=this.linshiPrice:this.voiceData.cost=e.target.value:"songhuofei"==t&&(this.linshiPrice==e.target.value?this.voiceData.deliveryFee=e.target.value:""==e.target.value?this.voiceData.deliveryFee=this.linshiPrice:this.voiceData.deliveryFee=e.target.value),"zongfeiyong"!=t&&(this.voiceData.allCost=Number(Number(this.voiceData.landingFee)+Number(this.voiceData.deliveryFee)+Number(this.voiceData.freight)+Number(this.voiceData.premium)+Number(this.voiceData.transitFee)+Number(this.voiceData.tips)+Number(this.voiceData.cost)).toFixed(2))},getUserList:function(){var t=this;e.request({url:this.tui.interfaceUrl()+"/app/logisticsUser/getLogisticsUserPageList",data:{pageNum:1,pageSize:"100",companyId:e.getStorageSync("transCompany"),nickName:""},header:{"content-type":"application/json",appWLToken:this.tui.getToken()},method:"POST",dataType:"json",success:function(i){if(401==i.data.code&&(e.clearStorage(),e.navigateTo({url:"/package2/login/login"})),200==i.data.code){for(var a=0;a<i.data.result.records.length;a++)i.data.result.records[a].value=i.data.result.records[a].id,i.data.result.records[a].text=i.data.result.records[a].nickName,"2"==i.data.result.records[a].userRole&&(t.voiceData.receivingUserId=i.data.result.records[a].id,t.voiceData.receivingUserName=i.data.result.records[a].nickName);setTimeout((function(e){console.log("this.voiceData",t.voiceData),t.userList=i.data.result.records}),200)}},fail:function(e){t.tui.toast("网络不给力,请稍后再试~")}})},getOrderList:function(){var t=this;e.request({url:this.tui.interfaceUrl()+"/app/logisticsOrder/getLogisticsOrderPageList",data:{pageNum:1,pageSize:"100",companyId:e.getStorageSync("transCompany"),orderStatus:2},header:{"content-type":"application/json",appWLToken:this.tui.getToken()},method:"POST",dataType:"json",success:function(i){t.status="nomore",401==i.data.code&&(e.clearStorage(),e.navigateTo({url:"/package2/login/login"})),200==i.data.code&&(1==t.pages?t.orderList=i.data.result.records:t.orderList=[].concat((0,c.default)(t.orderList),(0,c.default)(i.data.result.records)),t.pages=i.data.result.pages)},fail:function(e){t.tui.toast("网络不给力,请稍后再试~")}})},checkName:function(e,t){"fa"==t?(this.newFa=!1,this.voiceData.shipperName=e.shipperOrReceiverName,this.voiceData.shipperMobile=e.mobile,this.voiceData.shipperAddress=e.addressInfo,this.voiceData.shipperId=e.id):(this.newShou=!1,this.voiceData.receiverName=e.shipperOrReceiverName,this.voiceData.receiverMobile=e.mobile,this.voiceData.receiverAddress=e.addressInfo,this.voiceData.receiverId=e.id),this.shouBookShow=!1,this.faBookShow=!1,this.$forceUpdate()},getGuadan:function(){this.getOrderList(),this.$refs.shopPopup.open("bottom")},sreachName:function(e,t){"ji"==t?(console.log("ji",e.detail.value),this.voiceData.shipperName=e.detail.value,this.getCustomList(e.detail.value,t)):(console.log("shou",e.detail.value),this.voiceData.receiverName=e.detail.value,this.getCustomList(e.detail.value,t))},getCustomList:function(t,i){var a=this;this.customList=[],e.request({url:this.tui.interfaceUrl()+"/app/logisticsAddressBook/getLogisticsAddressBookPageList",data:{pageNum:this.pageNum,pageSize:100,keyWord:t,companyId:e.getStorageSync("transCompany"),addressType:"ji"==i?"1":"shou"==i?"2":""},header:{"content-type":"application/json",appWLToken:this.tui.getToken()},method:"POST",dataType:"json",success:function(t){a.status="loading",401==t.data.code&&(e.clearStorage(),e.navigateTo({url:"/package2/login/login"})),200==t.data.code&&(0==t.data.result.records.length?"ji"==i?(a.newFa=!0,a.voiceData.shipperId="",a.voiceData.shipperMobile="",a.voiceData.shipperAddress=""):(a.newShou=!0,a.voiceData.receiverId="",a.voiceData.receiverMobile="",a.voiceData.receiverAddress=""):(a.status="nomore",1==a.pages?a.customList=t.data.result.records:a.customList=[].concat((0,c.default)(a.customList),(0,c.default)(t.data.result.records)),a.pages=t.data.result.pages))},fail:function(e){a.tui.toast("网络不给力,请稍后再试~")}})},getStationByCompanyId:function(){var t=this;e.request({url:this.tui.interfaceUrl()+"/app/logisticsStation/getLogisticsStationListByCompanyId",data:{companyId:e.getStorageSync("transCompany")},header:{"content-type":"application/json",appWLToken:this.tui.getToken()},method:"POST",dataType:"json",success:function(i){if(401==i.data.code&&(e.clearStorage(),e.navigateTo({url:"/package2/login/login"})),200==i.data.code){for(var a=0;a<i.data.result.length;a++)t.daodaList.push(i.data.result[a].stationName),i.data.result[a].value=i.data.result[a].id,i.data.result[a].text=i.data.result[a].stationName+"("+i.data.result[a].freightRules+"元/每公斤)",t.voiceData.arrivalStationId==i.data.result[a].id&&(t.voiceData.arrivalStationId=i.data.result[a].id,t.voiceData.arrivalStationName=i.data.result[a].stationName,t.voiceData.freight=(t.voiceData.weight*i.data.result[a].freightRules).toFixed(2),t.voiceData.circuitId=i.data.result[a].circuitId,t.voiceData.freightRules=i.data.result[a].freightRules,t.voiceData.landingFee=i.data.result[a].landingFeeRules,t.voiceData.deliveryFee=i.data.result[a].deliveryFeeRules);setTimeout((function(e){console.log("voiceData",t.voiceData),t.arrivalStationList=i.data.result}),200)}},fail:function(e){t.tui.toast("网络不给力,请稍后再试~")}})},getGoStationList:function(){var t=this;e.request({url:this.tui.interfaceUrl()+"/app/logisticsStation/getLogisticsStationListByCompanyId",data:{companyId:e.getStorageSync("transCompany")},header:{"content-type":"application/json",appWLToken:this.tui.getToken()},method:"POST",dataType:"json",success:function(i){if(401==i.data.code&&(e.clearStorage(),e.navigateTo({url:"/package2/login/login"})),200==i.data.code){for(var a=0;a<i.data.result.length;a++)i.data.result[a].value=i.data.result[a].id,i.data.result[a].text=i.data.result[a].stationName,"沧州"==i.data.result[a].stationName&&(t.voiceData.goStationId=i.data.result[a].id,t.voiceData.goStationName=i.data.result[a].stationName);setTimeout((function(e){t.goStationList=i.data.result}),200)}},fail:function(e){t.tui.toast("网络不给力,请稍后再试~")}})},kaishi:function(){0==this.isVoice&&(this.recordState=!0,e.vibrateShort(),g.start({duration:6e4,lang:"zh_CN"}))},jieshu:function(){this.recordState=!1,g.stop()},extractInfo:function(e){var t={};return[{name:"shipperName",regex:/发货人:(.*?),/},{name:"shipperMobile",regex:/发货电话:(.*?),/},{name:"receiverName",regex:/收货人:(.*?),/},{name:"receiverMobile",regex:/收货电话:(.*?),/},{name:"arrivalStationName",regex:/到达站:(.*),/},{name:"arrivalStationName",regex:/物品名称:(.*),/},{name:"weight",regex:/重量:(.*?),/},{name:"count",regex:/数量:(.*?),/},{name:"tips",regex:/小费:(.*?),/},{name:"premium",regex:/保费:(.*?)/}].forEach((function(i){var a=i.name,o=i.regex,r=e.match(o);r&&r[1]&&(t[a]=r[1].trim())})),t},payTypeChange:function(e){for(var t=0;t<this.payTypeList.length;t++)this.payTypeList[t].value==e&&(this.voiceData.methodOfSettlement=e)},arrivalStationChange:function(e){var t=this;console.log("新乐",e);for(var i=0;i<this.arrivalStationList.length;i++)this.arrivalStationList[i].id==e&&(this.voiceData.arrivalStationId=this.arrivalStationList[i].id,this.voiceData.arrivalStationName=this.arrivalStationList[i].stationName,this.voiceData.freight=(this.voiceData.weight*this.arrivalStationList[i].freightRules).toFixed(2),this.voiceData.circuitId=this.arrivalStationList[i].circuitId,this.voiceData.freightRules=this.arrivalStationList[i].freightRules,this.voiceData.landingFee=this.arrivalStationList[i].landingFeeRules,this.voiceData.deliveryFee=this.arrivalStationList[i].deliveryFeeRules);setTimeout((function(e){t.getTransferStation()}),300)},getTransferStation:function(){var t=this;e.request({url:this.tui.interfaceUrl()+"/app/logisticsTransferStation/getLogisticsTransferStationPageList",data:{arrivalStation:"",goStation:"",pageNum:1,pageSize:100,stationId:this.voiceData.arrivalStationId},header:{"content-type":"application/json",appWLToken:this.tui.getToken()},method:"POST",dataType:"json",success:function(i){if(401==i.data.code&&(e.clearStorage(),e.navigateTo({url:"/package2/login/login"})),200==i.data.code){if(t.voiceData.transitFee=0,t.transferStationList=i.data.result.records,0==t.priceCurrent)for(var a=0;a<i.data.result.records.length;a++)t.voiceData.transitFee+=Number(i.data.result.records[a].transitFee)*Number(t.voiceData.weight).toFixed(2);setTimeout((function(e){t.getAllCost()}),300)}},fail:function(e){t.tui.toast("网络不给力,请稍后再试~")}})},goAddOrderPage:function(t){this.$refs.shopPopup.close(),e.navigateTo({url:"/package2/other/newLogisticsBill?editData="+JSON.stringify(t)})},delOrder:function(t){this.$refs.shopPopup.close();var i=this;e.showModal({title:"提示",content:"确定删除此条商品吗?",success:function(a){e.showLoading({title:"加载中..."}),a.confirm&&e.request({url:i.tui.interfaceUrl()+"/app/logisticsOrder/deleteLogisticsOrder",data:{id:t.id},header:{"content-type":"application/x-www-form-urlencoded",appWLToken:i.tui.getToken()},method:"POST",dataType:"json",success:function(t){401==t.data.code&&(e.clearStorage(),e.navigateTo({url:"/package2/login/login"})),200==t.data.code&&(e.showToast({title:"删除成功"}),setTimeout((function(e){i.pageNum=1,i.orderList=[],i.getOrderList(),i.getAllNum()}),500))},fail:function(e){i.tui.toast("网络不给力,请稍后再试~")}}),setTimeout((function(t){e.hideLoading()}),500)}})},goStationChange:function(e){console.log(this.goStationList);for(var t=0;t<this.goStationList.length;t++)this.goStationList[t].id==e&&(this.voiceData.goStationId=this.goStationList[t].id,this.voiceData.goStationName=this.goStationList[t].stationName)},stationUserChange:function(e){for(var t=0;t<this.userList.length;t++)this.userList[t].id==e&&(console.log(this.userList),this.voiceData.receivingUserId=this.userList[t].id,this.voiceData.receivingUserName=this.userList[t].nickName)},freightCount:function(e){if(this.linshiPrice==e.target.value?this.voiceData.weight=e.target.value:""==e.target.value?this.voiceData.weight=this.linshiPrice:this.voiceData.weight=e.target.value,this.voiceData.weightHistory=this.voiceData.weight+"+",this.voiceData.freight=Number((void 0==this.voiceData.freightRules?0:this.voiceData.freightRules)*this.voiceData.weight).toFixed(2),this.voiceData.transitFee=0,0==this.priceCurrent)for(var t=0;t<this.transferStationList.length;t++)console.log(this.voiceData.transitFee),this.voiceData.transitFee=(Number(this.voiceData.transitFee)+Number(this.transferStationList[t].transitFee)*Number(this.voiceData.weight)).toFixed(2);this.getAllCost()},clickGetOneShou:function(e){this.voiceData.receiverName=e.shipperOrReceiverName,this.voiceData.receiverMobile=e.mobile,this.voiceData.receiverId=e.id,this.voiceData.receiverAddress=e.addressInfo,""==e.id&&(this.newShou=!0),this.$forceUpdate(),this.$refs.moreShouPopup.close()},clickGetOneFa:function(e){this.voiceData.shipperName=e.shipperOrReceiverName,this.voiceData.shipperMobile=e.mobile,this.voiceData.shipperId=e.id,this.voiceData.shipperAddress=e.addressInfo,""==e.id&&(this.newFa=!0),this.$forceUpdate(),this.$refs.moreFaPopup.close()},yuyinChange:function(){console.log("yuyin"),this.isVoice=!1},trimWhitespace:function(e){return e.replace(/\s+/g,"")},replaceCharAfterNumber:function(e,t,i){var a=new RegExp("\\d".concat(t),"g");return e.replace(a,(function(e){return e.replace(t,i)}))},timestampToDatetime:function(){var e=new Date,t=e.getFullYear(),i=e.getMonth()+1,a=e.getDate(),o=e.getHours(),r=e.getMinutes(),s=e.getSeconds();return t+"-"+i+"-"+a+" "+o+":"+r+":"+s},kuaijieFocus:function(){this.kjFocus=this.voiceData.objectName,this.voiceData.objectName=""},kuaijieBlur:function(){""==this.voiceData.objectName&&(this.voiceData.objectName=this.kjFocus)},obtainPrice:function(e,t,i,a){this.linshiPrice=e.target.value,"zhongliang"==t?this.voiceData.weight="":"shuliang"==t?this.voiceData.count="":"yunshufei"==t?this.voiceData.freight="":"xiaofei"==t?this.voiceData.tips="":"zongfeiyong"==t?this.voiceData.allCost="":"baofei"==t?this.voiceData.premium="":"zhongzhuanfei"==t?this.voiceData.transitFee="":"luodifei"==t?this.voiceData.landingFee="":"songhuofei"==t?this.voiceData.deliveryFee="":"gongbenfei"==t?this.voiceData.cost="":"zhongliangAdd"==t&&(this.weigthAdd="")},getVoiceData:function(){var t=this;if(console.log("this.voiceText",this.voiceText),""!=this.voiceText){e.showLoading({title:"Ai识别中..."});var i=this.trimWhitespace(this.voiceText);-1!=i.indexOf("点")&&(i=this.replaceCharAfterNumber(i,"点",".")),-1!=i.indexOf("发货人,")&&(i=i.replace(/发货人,/g,"发货人")),-1!=i.indexOf("发货人::")&&(i=i.replace(/发货人::/g,"发货人")),-1!=i.indexOf("发货人:")&&(i=i.replace(/发货人:/g,"发货人")),-1!=i.indexOf("发货人")&&(i=i.replace(/发货人/g,",发货人:")),-1!=i.indexOf(",发货电话")&&(i=i.replace(/,发货电话/g,"发货电话")),-1!=i.indexOf("发货电话,")&&(i=i.replace(/发货电话,/g,"发货电话")),-1!=i.indexOf("发货电话::")&&(i=i.replace(/发货电话::/g,"发货电话")),-1!=i.indexOf("发货电话:")&&(i=i.replace(/发货电话:/g,"发货电话")),-1!=i.indexOf("发货电话")&&(i=i.replace(/发货电话/g,",发货电话:")),-1!=i.indexOf(",收货人")&&(i=i.replace(/,收货人/g,"收货人")),-1!=i.indexOf("收货人,")&&(i=i.replace(/收货人,/g,"收货人")),-1!=i.indexOf("收货人::")&&(i=i.replace(/收货人::/g,"收货人")),-1!=i.indexOf("收货人:")&&(i=i.replace(/收货人:/g,"收货人")),-1!=i.indexOf("收货人")&&(i=i.replace(/收货人/g,",收货人:")),-1!=i.indexOf(",收货电话")&&(i=i.replace(/,收货电话/g,"收货电话")),-1!=i.indexOf("收货电话,")&&(i=i.replace(/收货电话,/g,"收货电话")),-1!=i.indexOf("收货电话::")&&(i=i.replace(/收货电话::/g,"收货电话")),-1!=i.indexOf("收货电话:")&&(i=i.replace(/收货电话:/g,"收货电话")),-1!=i.indexOf("收货电话")&&(i=i.replace(/收货电话/g,",收货电话:")),-1!=i.indexOf(",重量")&&(i=i.replace(/,重量/g,"重量")),-1!=i.indexOf("重量,")&&(i=i.replace(/重量,/g,"重量")),-1!=i.indexOf("重量::")&&(i=i.replace(/重量::/g,"重量")),-1!=i.indexOf("重量:")&&(i=i.replace(/重量:/g,"重量")),-1!=i.indexOf("重量")&&(i=i.replace(/重量/g,",重量:")),-1!=i.indexOf(",数量")&&(i=i.replace(/,数量/g,"数量")),-1!=i.indexOf("数量,")&&(i=i.replace(/数量,/g,"数量")),-1!=i.indexOf("数量::")&&(i=i.replace(/数量::/g,"数量")),-1!=i.indexOf("数量:")&&(i=i.replace(/数量:/g,"数量")),-1!=i.indexOf("数量")&&(i=i.replace(/数量/g,",数量:")),-1!=i.indexOf(",小费")&&(i=i.replace(/,小费/g,"小费")),-1!=i.indexOf("小费,")&&(i=i.replace(/小费,/g,"小费")),-1!=i.indexOf("小费::")&&(i=i.replace(/小费::/g,"小费")),-1!=i.indexOf("小费:")&&(i=i.replace(/小费:/g,"小费")),-1!=i.indexOf("小费")&&(i=i.replace(/小费/g,",小费:")),-1!=i.indexOf(",保费")&&(i=i.replace(/,保费/g,"保费")),-1!=i.indexOf("保费,")&&(i=i.replace(/保费,/g,"保费")),-1!=i.indexOf("保费::")&&(i=i.replace(/保费::/g,"保费")),-1!=i.indexOf("保费:")&&(i=i.replace(/保费:/g,"保费")),-1!=i.indexOf("保费")&&(i=i.replace(/保费/g,",保费:")),-1!=i.indexOf(",物品")&&(i=i.replace(/,物品/g,"物品")),-1!=i.indexOf("物品,")&&(i=i.replace(/物品,/g,"物品")),-1!=i.indexOf("物品::")&&(i=i.replace(/物品::/g,"物品")),-1!=i.indexOf("物品:")&&(i=i.replace(/物品:/g,"物品")),-1!=i.indexOf("物品")&&(i=i.replace(/物品/g,",物品:")),-1!=i.indexOf(",到达站")&&(i=i.replace(/,到达站/g,"到达站")),-1!=i.indexOf("到达站,")&&(i=i.replace(/到达站,/g,"到达站")),-1!=i.indexOf("到达站::")&&(i=i.replace(/到达站::/g,"到达站")),-1!=i.indexOf("到达站:")&&(i=i.replace(/到达站:/g,"到达站")),-1!=i.indexOf("到达站")&&(i=i.replace(/到达站/g,",到达站:'"),"。"!=i.charAt(i.length-1)&&","!=i.charAt(i.length-1)||(i=i.slice(0,-1)),i+="'"),-1!=i.indexOf("13行")&&(i=i.replace(/13行/g,"十三行")),i=this.convertStringCorrectly(i),i=this.spliceMsg(i),0==i.indexOf(",")&&(i=i.substr(1)),console.log("convertedStr",i);var a=new Date,o=a.getFullYear(),r=a.getMonth()+1,s=a.getDate(),n=a.getHours(),c=a.getMinutes(),d=a.getSeconds(),u=o+"/"+r+"/"+s+" "+n+":"+c+":"+d;console.log("开始",u),this.$refs.popup.close(),e.request({url:this.tui.interfaceUrl()+"/purchaseOcrPicture/getLogisticsOrderOfAi",data:{questionMsg:i},header:{"content-type":"application/x-www-form-urlencoded",appWLToken:this.tui.getToken()},method:"POST",dataType:"json",success:function(i){if(401==i.data.code&&(e.clearStorage(),e.navigateTo({url:"/package2/login/login"})),200==i.data.code)for(var a in null!=i.data.result.data[0].receiverList&&i.data.result.data[0].receiverList.length>1&&(t.newShou=!1,t.voiceData.newReceiverName="",t.voiceData.newReceiverMobile="",i.data.result.data[0].receiverList.push({mobile:i.data.result.data[0].receiverMobile,shipperOrReceiverName:i.data.result.data[0].receiverName,id:""}),t.moreShouList=i.data.result.data[0].receiverList,t.$refs.moreShouPopup.open()),null!=i.data.result.data[0].shipperList&&i.data.result.data[0].shipperList.length>1&&(t.newFa=!1,t.voiceData.newShipperName="",t.voiceData.newShipperMobile="",i.data.result.data[0].shipperList.push({mobile:i.data.result.data[0].shipperMobile,shipperOrReceiverName:i.data.result.data[0].shipperName,id:""}),t.moreFaList=i.data.result.data[0].shipperList,t.$refs.moreFaPopup.open()),i.data.result.data[0])""!=i.data.result.data[0][a]&&null!=i.data.result.data[0][a]&&0!=i.data.result.data[0][a]&&(i.data.result.data[0].arrivalStationName&&"arrivalStationName"==a&&t.pinyinMatch(i.data.result.data[0].arrivalStationName),i.data.result.data[0].hasOwnProperty(a)&&t.voiceData.hasOwnProperty(a)&&"receiverName"!=i.data.result.data[0][a]&&"receiverMobile"!=i.data.result.data[0][a]&&"shipperName"!=i.data.result.data[0][a]&&"shipperMobile"!=i.data.result.data[0][a]&&(t.voiceData[a]=i.data.result.data[0][a]),null!=i.data.result.data[0].receiverList&&0==i.data.result.data[0].receiverList.length?(t.voiceData.receiverName=i.data.result.data[0].receiverName,t.voiceData.receiverMobile=i.data.result.data[0].receiverMobile,t.voiceData.newReceiverName="",t.voiceData.newReceiverMobile="",t.newShou=!0):null!=i.data.result.data[0].receiverList&&1==i.data.result.data[0].receiverList.length&&(t.newShou=!1,t.voiceData.receiverName=i.data.result.data[0].receiverList[0].shipperOrReceiverName,t.voiceData.receiverMobile=i.data.result.data[0].receiverList[0].mobile,t.voiceData.receiverAddress=i.data.result.data[0].receiverList[0].addressInfo,t.voiceData.receiverId=i.data.result.data[0].receiverList[0].id,t.voiceData.newReceiverName=i.data.result.data[0].receiverName,t.voiceData.newReceiverMobile=i.data.result.data[0].receiverMobile),null!=i.data.result.data[0].shipperList&&0==i.data.result.data[0].shipperList.length?(t.voiceData.shipperName=i.data.result.data[0].shipperName,t.voiceData.shipperMobile=i.data.result.data[0].shipperMobile,t.newFa=!0,t.voiceData.newShipperName="",t.voiceData.newShipperMobile=""):null!=i.data.result.data[0].shipperList&&1==i.data.result.data[0].shipperList.length&&(t.voiceData.shipperName=i.data.result.data[0].shipperList[0].shipperOrReceiverName,t.voiceData.shipperMobile=i.data.result.data[0].shipperList[0].mobile,t.voiceData.shipperAddress=i.data.result.data[0].shipperList[0].addressInfo,t.voiceData.shipperId=i.data.result.data[0].shipperList[0].id,t.voiceData.newShipperName=i.data.result.data[0].shipperName,t.voiceData.newShipperMobile=i.data.result.data[0].shipperMobile,t.newFa=!1),t.$forceUpdate());e.hideLoading(),setTimeout((function(e){console.log("数据啊",t.voiceData),t.getAllCost()}),300)},fail:function(i){t.tui.toast("网络不给力,请稍后再试~"),e.hideLoading()}})}else this.tui.toast("识别内容不能为空")},shuliangChange:function(e){this.linshiPrice==e.target.value?this.voiceData.count=e.target.value:""==e.target.value?this.voiceData.count=this.linshiPrice:this.voiceData.count=e.target.value},pinyinMatch:function(t){var i=this;-1!=t.indexOf("。")&&(t=t.split("。")[0]),e.request({url:this.tui.interfaceUrl()+"/app/logisticsStation/getLogisticsStationPageList",data:{pageNum:1,pageSize:10,circuitId:"",stationName:t},header:{"content-type":"application/json",appWLToken:this.tui.getToken()},method:"POST",dataType:"json",success:function(t){if(401==t.data.code&&(e.clearStorage(),e.navigateTo({url:"/package2/login/login"})),200==t.data.code)if(""!=t.data.result.records)for(var a=0;a<i.arrivalStationList.length;a++)for(var o=0;o<t.data.result.records.length;o++)i.arrivalStationList[a].id==t.data.result.records[o].id&&(i.voiceData.arrivalStationId=t.data.result.records[o].id,i.voiceData.arrivalStationName=t.data.result.records[o].stationName,i.arrivalStationChange(t.data.result.records[o].id));else i.tui.toast("当前到达站查无此信息,请确认")},fail:function(e){i.tui.toast("网络不给力,请稍后再试~")}})},getMonth:function(){var e=new Date,t=e.getFullYear().toString(),i=e.getMonth()+1<10?"0"+(e.getMonth()+1).toString():(e.getMonth()+1).toString(),a=e.getDate()<10?"0"+e.getDate().toString():e.getDate().toString(),o=t+"-"+i+"-"+a;return o},convertStringCorrectly:function(e){var t=e.replace(/(\d+)十(?!\d)/g,"$10"),i=t.replace(/(\d+)十(?=\d)/g,"$1");return i},convertChineseToArabic:function(e){var t={"零":0,"一":1,"二":2,"两":2,"三":3,"四":4,"五":5,"六":6,"七":7,"八":8,"九":9,"时1":"11","时2":"12","时3":"13","时4":"14","时5":"15","时6":"16","时7":"17","时8":"18","时9":"19","消费":"小费","报废":"保费","报费":"保费"};return e.replace(/(零|一|二|两|三|四|五|六|七|八|九|时1|时2|时3|时4|时5|时6|时7|时8|时9|消费|报废|报费)/g,(function(e){return t[e]}))},spliceMsg:function(e){return e.replace(/嗯|啊|儿|阿|恩/g,"")},toggle:function(e,t){this.initRecord(),this.voiceText="",this.$refs.popup.open("center")},clearText:function(){this.voiceText=""},initRecord:function(){var t=this;g.stop(),g.onStop=function(e){t.voiceText=e.result,console.log("that.voiceText",t.voiceText)},g.onError=function(i){"-30011"==i.retcode&&(t.isVoice=!0),"-30004"==i.retcode&&(t.isVoice=!1,e.hideToast(),e.showToast({title:"未识别到声音信息,请重新录入",icon:"none"})),"-40001"==i.retcode&&e.showToast({title:"使用次数超限制,请联系管理员!",icon:"none"})}},setGuaBill:function(){var t,i=this;""!=this.voiceData.receiverName&&""!=this.voiceData.arrivalStationId?(this.voiceData.orderStatus=2,t=1!=this.isEdit?"/app/logisticsOrder/addLogisticsOrder":"/app/logisticsOrder/updateLogisticsOrder",e.request({url:this.tui.interfaceUrl()+t,data:this.voiceData,header:{"content-type":"application/json",appWLToken:this.tui.getToken()},method:"POST",dataType:"json",success:function(t){401==t.data.code&&(e.clearStorage(),e.navigateTo({url:"/package2/login/login"})),200==t.data.code&&(i.tui.toast("挂单成功",500),i.clearData(""),i.$forceUpdate(),1!=i.isEdit||setTimeout((function(t){e.navigateBack()}),500))},fail:function(e){i.tui.toast("网络不给力,请稍后再试~")}})):e.showToast({title:(""==this.voiceData.receiverName?"收货人":""==this.voiceData.arrivalStationId?"到达站":"")+"不能为空",icon:"none"})},setBill:function(){var t,i=this;(console.log(this.voiceData),""!=this.voiceData.receiverName&&""!=this.voiceData.arrivalStationId&&""!=this.voiceData.objectName)?(this.voiceData.orderStatus=1,t=1!=this.isEdit?"/app/logisticsOrder/addLogisticsOrder":"/app/logisticsOrder/updateLogisticsOrder",e.request({url:this.tui.interfaceUrl()+t,data:this.voiceData,header:{"content-type":"application/json",appWLToken:this.tui.getToken()},method:"POST",dataType:"json",success:function(t){401==t.data.code&&(e.clearStorage(),e.navigateTo({url:"/package2/login/login"})),200==t.data.code&&(i.tui.toast("开单成功",500),1!=i.isEdit?(console.log("开单成功deviceId",e.getStorageSync("deviceId")),"1751796589518786560"==e.getStorageSync("transCompany")?(""!=e.getStorageSync("deviceId")&&void 0!=e.getStorageSync("deviceId")?i.huoqufuwu(e.getStorageSync("deviceId")):i.handlePrintTap(),i.voiceData.orderNumber=t.data.result.orderNumber):i.clearData("1")):setTimeout((function(t){e.navigateBack()}),500))},fail:function(e){i.tui.toast("网络不给力,请稍后再试~")}})):e.showToast({title:(""==this.voiceData.receiverName?"收货人":""==this.voiceData.arrivalStationId?"到达站":""==this.voiceData.objectName?"物品名":"")+"不能为空",icon:"none"})},pictureAdd:function(){var t=this;e.chooseMedia({count:1,mediaType:["image"],sourceType:["album","camera"],success:function(i){e.showLoading({title:"加载中...",mask:!0}),t.upLoadFile(i.tempFiles[0].tempFilePath)}})},upLoadFile:function(t){var i=this;return(0,n.default)(s.default.mark((function a(){var o,r;return s.default.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return o=i,r=e.getStorageSync("hiver_token"),o.productPicture=[],a.next=5,e.uploadFile({url:o.tui.interfaceUrl()+"/upload/file",filePath:t,name:"file",header:{"content-type":"multipart/form-data",appWLToken:r},formData:{},success:function(e){var t=JSON.parse(e.data);o.voiceData.imagePath=t.result,o.productPicture.push(t.result),o.$forceUpdate()},fail:function(t){e.hideLoading(),e.showToast({title:JSON.stringify(t),icon:"none"})}});case 5:return a.next=7,setTimeout((function(t){e.hideLoading()}),1e3);case 7:case"end":return a.stop()}}),a)})))()},handlePrintTap:function(){var t=this;e.showLoading({mask:!0,title:"打印中..."}),e.getSystemInfo({success:function(e){t.deviceType=e.osName},fail:function(e){console.log("getSystemInfo",e)}}),a.openBluetoothAdapter({mode:"central",success:function(e){t.sousuo()},fail:function(i){console.log("初始化失败",i),"10001"==i.errCode?(console.log("蓝牙未打开",i),e.showToast({duration:2e3,title:"请打开蓝牙后,再进行连接",icon:"none",mask:!0})):(t.tui.toast("连接失败,请重启蓝牙或删除小程序重新进入-1"),console.log("连接失败----11"),t.isShowSearch=!0),setTimeout((function(t){e.hideLoading()}),2e3)}})},sousuo:function(){var t=this;this.devicesList=[],a.startBluetoothDevicesDiscovery({success:function(e){t.jiantingshebei()},fail:function(i){t.tui.toast("连接失败,请重启蓝牙或删除小程序重新进入-2",i),console.log("连接失败----22"),a.closeBLEConnection({deviceId:e.getStorageSync("deviceId"),success:function(e){},fail:function(e){console.log("closeBLEConnection",e)}}),a.closeBluetoothAdapter({success:function(e){console.log(e)},fail:function(e){console.log("closeBluetoothAdapter",e)}}),e.removeStorageSync("deviceId"),t.handlePrintTap(),t.isShowSearch=!0,setTimeout((function(t){e.hideLoading()}),2e3)}})},stopSearchBtnTap:function(){a.stopBluetoothDevicesDiscovery()},jiantingshebei:function(){var t=this;e.getStorageSync("deviceId")?(console.log("监听到lianejieshebei"),t.lianejieshebei(e.getStorageSync("deviceId"))):(console.log("没监听到"),e.hideLoading(),t.clearData("1"),t.isShowSearch=!0,t.$forceUpdate(),a.onBluetoothDeviceFound((function(e){e.devices.forEach((function(e){(e.name||e.localName)&&t.devicesList.push(e)}))})))},lianejieshebei:function(t){var i=this;e.showLoading({mask:!0,title:"加载中..."});var o=setTimeout((function(){console.log("111"),a.closeBLEConnection({deviceId:t,success:function(e){},fail:function(e){console.log("lianejieshebei--closeBLEConnection",e)}}),console.log("222"),a.closeBluetoothAdapter({success:function(e){console.log(e)},fail:function(e){console.log("lianejieshebei--closeBluetoothAdapter",e)}}),console.log("333"),e.removeStorageSync("deviceId"),console.log("444"),i.handlePrintTap(),i.isShowSearch=!0}),5e3);console.log("有deviceId吗?",t),a.createBLEConnection({deviceId:t,success:function(){clearTimeout(o),i.isShowSearch=!1,i.huoqufuwu(t)},fail:function(e){console.log("createBLEConnection",e),clearTimeout(o),"1509007"==e.errno&&i.huoqufuwu(t),"1509003"==e.errno&&i.lianejieshebei(t)}})},huoqufuwu:function(t){var i=this;a.getBLEDeviceServices({deviceId:t,success:function(e){i.duxietezhengzhi(t,e)},fail:function(o){i.tui.toast("连接失败,请重启蓝牙或删除小程序重新进入-4",o),console.log("连接失败---44"),a.closeBLEConnection({deviceId:t,success:function(e){},fail:function(e){console.log("lianejieshebei--closeBLEConnection",e)}}),console.log("222"),a.closeBluetoothAdapter({success:function(e){console.log(e)},fail:function(e){console.log("lianejieshebei--closeBluetoothAdapter",e)}}),console.log("444"),e.removeStorageSync("deviceId"),i.handlePrintTap(),i.isShowSearch=!0,setTimeout((function(t){e.hideLoading()}),2e3)}})},duxietezhengzhi:function(t,i){var o=this;a.getBLEDeviceCharacteristics({deviceId:t,serviceId:i.services[0].uuid,success:function(a){console.log("characteristics",a.characteristics);for(var r=0;r<a.characteristics.length;r++){var s=a.characteristics[r];if(o.startNoticeBle(t,i.services[0].uuid,a.characteristics[2].uuid),s.properties.write)return e.setStorageSync("deviceId",t),e.setStorageSync("serviceId",i.services[0].uuid),e.setStorageSync("characteristicId",s.uuid),void o.xierushuju()}},fail:function(t){o.tui.toast("连接失败,请重启蓝牙或删除小程序重新进入-5",t),console.log("连接失败----55"),a.closeBLEConnection({deviceId:e.getStorageSync("deviceId"),success:function(e){}}),e.removeStorageSync("deviceId"),console.log("断开111"),o.$forceUpdate(),o.sousuo(),o.isShowSearch=!0,e.hideLoading(),setTimeout((function(t){e.hideLoading()}),2e3)}})},startNoticeBle:function(t,i,a){var o=this;e.notifyBLECharacteristicValueChange({state:!0,deviceId:t,serviceId:i,characteristicId:a,success:function(e){console.log("监听成功===",e.errMsg,"deviceId===",t),o.GetDataFromBle()},fail:function(e){console.log("开启监听失败",e)}})},GetDataFromBle:function(){var t=this;e.onBLECharacteristicValueChange((function(i){e.hideLoading(),console.log("断开222"),t.clearData(""),t.$forceUpdate()}))},clearData:function(t){""==t&&(this.bufferData=[]),this.productPicture=[],this.newFa=!1,this.newShou=!1,this.transferStationList=[],this.voiceData={createBy:e.getStorageSync("mobile"),companyId:e.getStorageSync("transCompany"),companyName:e.getStorageSync("companyName"),imagePath:"",circuitId:"",circuitName:"",shipperName:"",shipperMobile:"",shipperAddress:"",receiverName:"",receiverMobile:"",receiverAddress:"",goStationId:"",goStationName:"沧州",arrivalStationId:"",arrivalStationName:"",landingFee:0,deliveryFee:0,weight:0,weightHistory:"",count:0,freight:0,premium:0,transitFee:0,transferAddition:0,paymentForGoods:0,tips:0,methodOfSettlement:"2",cost:0,allCost:0,orderNumber:"",objectName:"",remark:"",newShipperName:"",newReceiverName:"",newReceiverMobile:"",newShipperMobile:"",receivingUserId:"",receivingUserName:""},this.$forceUpdate()},getPrintByte:function(e){return void 0==e||null==e?"":e},smallData:function(){var e=this;return new Promise((function(t,i){for(var a=0==e.voiceData.count?1:e.voiceData.count,o=1;o<=a;o++){var r=d.CreatCPCLPage(600,480,1,0,0);r+=d.addCPCLBox(10,10,570,450,3),r+=d.addCPCLLocation(2),r+=d.addCPCLSETMAG(2,2),r+=d.addCPCLText("0",20,"24","0",0,e.voiceData.companyName),r+=d.addCPCLLine(10,80,570,80,2),r+=d.addCPCLLocation(0),r+=d.addCPCLSETMAG(1,1),r+=d.addCPCLText("20",100,"24","0",0,"开票日期:"+e.getMonth()),r+=d.addCPCLLine(10,140,570,140,2),r+=d.addCPCLLine(382,140,382,316,2),r+=d.addCPCLSETMAG(2,2),r+=d.addCPCLText("20",160,"24","0",0,"到站:"+e.voiceData.arrivalStationName),r+=d.addCPCLLine(10,220,382,220,2),r+=d.addCPCLText("20",248,"24","0",0,"收:"+e.voiceData.receiverName),r+=d.addCPCLLine(10,316,570,316,2),r+=d.addCPCLSETMAG(1,1),r+=d.addCPCLText("20",336,"24","0",0,"共"+a+"件");var s="";"0"==e.getPrintByte(e.voiceData.methodOfSettlement)?s="现金":"1"==e.getPrintByte(e.voiceData.methodOfSettlement)?s="月付":"2"==e.getPrintByte(e.voiceData.methodOfSettlement)&&(s="提付"),r+=d.addCPCLText("112",336,"24","0",0,s),r+=d.addCPCLLine(170,316,170,450,2),r+=d.addCPCLText("186",336,"24","0",0,"单号:"+e.voiceData.orderNumber+"-"+o),r+=d.addCPCLLine(10,376,570,376,2),r+=d.addCPCLText("20",396,"24","0",0,e.voiceData.receiverMobile),r+=d.addCPCLText("186",396,"24","0",0,"备注:"+e.voiceData.remark),r+=d.addCPCLQRCode(400,150,"H","1",4,"1321646846846546"),r+=d.addCPCLPrint(),e.bufferData.push(r),t(e.bufferData)}}))},wuliuData:function(){var t=this;return console.log("数据",this.voiceData),new Promise((function(i,a){for(var o=e.getStorageSync("wlNum"),r=0;r<o;r++){var s="";s=d.CreatCPCLPage(600,480,1,0,0),s+=d.addCPCLBox(10,10,570,450,3),s+=d.addCPCLSETMAG(2,2),s+=d.addCPCLSETBOLD("2"),s+=d.addCPCLLocation(0),s+=d.addCPCLText("30","30","24","0","0",t.getPrintByte(e.getStorageSync("companyName"))),s+=d.addCPCLSETMAG(1,1),s+=d.addCPCLSETBOLD("2"),s+=d.addCPCLText("300","30","24","0","0","单号:"+t.voiceData.orderNumber),s+=d.addCPCLSETBOLD("2"),s+=d.addCPCLBox(25,50,555,50,2),s+=d.addCPCLText("30","90","24","0","0","收货人:"+t.getPrintByte(t.voiceData.receiverName)),s+=d.addCPCLText("300","90","24","0","0","到达站:"+t.getPrintByte(t.voiceData.arrivalStationName)),s+=d.addCPCLText("30","140","24","0","0","地址:"+t.getPrintByte(t.voiceData.receiverAddress)),s+=d.addCPCLText("300","140","24","0","0","电话:"+t.getPrintByte(t.voiceData.receiverMobile)),s+=d.addCPCLLine(25,180,555,180,2),s+=d.addCPCLText("30","190","24","0","0","发货人:"+t.getPrintByte(t.voiceData.shipperName)),s+=d.addCPCLText("300","190","24","0","0","电话:"+t.getPrintByte(t.voiceData.shipperMobile)),s+=d.addCPCLLine(25,240,555,240,2),s+=d.addCPCLText("30","250","24","0","0","重量:"+t.getPrintByte(t.voiceData.weight)),s+=d.addCPCLText("300","250","24","0","0","件数:"+t.getPrintByte(t.voiceData.count)+"件");var n="";"0"==t.getPrintByte(t.voiceData.methodOfSettlement)?n="现金":"1"==t.getPrintByte(t.voiceData.methodOfSettlement)?n="月付":"2"==t.getPrintByte(t.voiceData.methodOfSettlement)&&(n="提付"),s+=d.addCPCLText("30","290","24","0","0","结算方式:"+n),s+=d.addCPCLLine(25,330,555,330,2),s+=d.addCPCLText("30","340","24","0","0","备注:"+t.getPrintByte(t.voiceData.remark)),s+=d.addCPCLLine(25,400,555,400,2),s+=d.addCPCLText("30","410","24","0","0","操作人:"+t.getPrintByte(t.voiceData.creatBy)),s+=d.addCPCLText("300","410","24","0","0",t.timestampToDatetime()),s+=d.addCPCLPrint(),t.bufferData.push(s),i(t.bufferData)}}))},xierushuju:function(){var t=this;return(0,n.default)(s.default.mark((function i(){var a;return s.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(a=t,1!=e.getStorageSync("xbqNum")){i.next=4;break}return i.next=4,t.smallData();case 4:return i.next=6,t.wuliuData();case 6:return a.$nextTick((function(){for(var e="",t=0;t<a.bufferData.length;t++)e+=a.bufferData[t];for(var i="android"==a.deviceType?20:180,o="android"==a.deviceType?20:180,r=u.default.strToGBKByte(e),s=0,n=0,c=r.byteLength;s<c;s+=i,n++){var d=r.slice(s,s+i<=c?s+i:c);setTimeout(a._writeBLECharacteristicValue,n*o,d)}})),i.abrupt("return");case 8:case"end":return i.stop()}}),i)})))()},_writeBLECharacteristicValue:function(t){var i=this;a.writeBLECharacteristicValue({deviceId:e.getStorageSync("deviceId"),serviceId:e.getStorageSync("serviceId"),characteristicId:e.getStorageSync("characteristicId"),value:t,success:function(e){},fail:function(t){a.closeBLEConnection({deviceId:e.getStorageSync("deviceId"),success:function(e){}}),e.getStorageSync("deviceId")?i.xierushuju():i.jiantingshebei(),e.hideLoading()}})},handleSearchClose:function(){a.closeBluetoothAdapter({success:function(e){console.log("999",e)}}),this.isShowSearch=!1}}};t.default=v}).call(this,i("df3c")["default"],i("3223")["default"])},"383a":function(e,t,i){"use strict";i.r(t);var a=i("36a2"),o=i.n(a);for(var r in a)["default"].indexOf(r)<0&&function(e){i.d(t,e,(function(){return a[e]}))}(r);t["default"]=o.a},7054:function(e,t,i){"use strict";(function(e,t){var a=i("47a9");i("82ca");a(i("3240"));var o=a(i("1d00"));e.__webpack_require_UNI_MP_PLUGIN__=i,t(o.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},"8fd8":function(e,t,i){"use strict";var a=i("33fe"),o=i.n(a);o.a},b75b:function(e,t,i){"use strict";i.d(t,"b",(function(){return o})),i.d(t,"c",(function(){return r})),i.d(t,"a",(function(){return a}));var a={uniDataSelect:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-data-select/components/uni-data-select/uni-data-select")]).then(i.bind(null,"c807"))},uniIcons:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(i.bind(null,"d3ec"))},uniPopup:function(){return i.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(i.bind(null,"4d18"))},uniCard:function(){return i.e("uni_modules/uni-card/components/uni-card/uni-card").then(i.bind(null,"afb8"))},uniForms:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-forms/components/uni-forms/uni-forms")]).then(i.bind(null,"9657"))}},o=function(){var e=this,t=e.$createElement,i=(e._self._c,e.faBookShow&&e.faBookShow?e.customList.length:null),a=e.shouBookShow&&e.shouBookShow?e.customList.length:null,o=e.devicesList.length,r=e.orderList.length;e._isMounted||(e.e0=function(t){e.faBookShow=!1},e.e1=function(t){e.shouBookShow=!1},e.e2=function(t){return e.$refs.popup.close()},e.e3=function(t){return e.$refs.inputDialog.close()},e.e4=function(t){return e.$refs.inputDialog.close()}),e.$mp.data=Object.assign({},{$root:{g0:i,g1:a,g2:o,g3:r}})},r=[]}},[["7054","common/runtime","common/vendor"]]]);