123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- // pages/record/recorddetailsinfo/recorddetailsinfo.js
- const app = getApp()
- // const util = require('../../..//utils/util.js')
- // const BL = require('../../../utils/lanya.js')
- var pos = require('../../../utils/pos.js')
- var GXZT;//更新状态
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- id: 0,
- info: '',
- show: 0,
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.setData({
- id: options.id,
- show: options.si ? 1 : 0
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- onClick() {
- wx.navigateBack({
- delta: 2 //想要返回的层级
- })
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- this.getinfo()
- },
- getinfo() {
- let that = this
- wx.showLoading()
- app.api.useApi(app.globalData.baseAppUrl + "api/admin/sorting/pack/InventoryRecord", { id: that.data.id }, "get").then(function (res) {
- wx.hideLoading()
- if (res.code == 200) {
- that.setData({ info: res.message.data })
- }
- }).catch(function (err) {
- console.log(222);
- })
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- },
- pd: function () {
- var that=this;
- console.log("开始打印")
- //pos.PrintText("情景4:综合支付不使用零钱也不存零,无找零");//打印标题
- pos.PrintJumpLines(1);
- pos.PrintTitle("客户信息");//打印标题
- pos.PrintNameValue('姓名: ', that.data.info.users.username);
- pos.PrintNameValue("手机:",that.data.info.users.phone);//打印标题
- pos.PrintNameValue('地址:',that.data.info.users.address);
- pos.PrintTitle("物流单信息");//打印标题
- pos.PrintNameValue("物流单号:",that.data.info.logistic.seal_no);
- pos.PrintNameValue("目的地:",that.data.info.title);
- pos.PrintTitle("打包衣物:"+that.data.hand.length+"件");
- var hand=that.data.info.hand;
- hand.forEach(element => {
- pos.PrintNameValue("","#".element.wash_code+element.cat_title+"-"+element.goods_title+"-"+element.standard_title);
- });
- // pos.PrintText("可口可乐(听)");
- // pos.PPP("2.0", "2", "4.00");
- // pos.PrintText("大泽山葡萄(kg)");
- // pos.PPP("12.8", "2.0", "25.6");
- // pos.PrintText("大泽山葡萄(盒)");
- // pos.PPP("30", "2.0", "60.0");
- // pos.PrintMiddleText('--------------------------------');
- // pos.PrintNameValue('合计数量: ', '6.0');
- // pos.PrintNameValue('标价金额: ', '128.8');
- // pos.PrintText('合计优惠(促销/特价等): -2.3');
- // pos.PrintNameValue('合计应收: ', '126.5');
- // pos.PrintNameValue('实际收款: ', '126.5');
- // //pos.PrintNameValue('优惠(抹零): ', '0.5');
- // pos.PrintMiddleText('--------------------------------');
- // pos.PrintText("收款明细: ");//打印标题
- // pos.PrintNameValue('现金: ', '100');
- // pos.PrintNameValue('微信刷卡: ', '26.5');
- // //pos.PrintNameValue('零钱包支付: ', '0.5');
- // //pos.PrintNameValue('现金找零: ', '4.0');
- // pos.PrintMiddleText('--------------------------------');
- // pos.PrintNameValue('会员卡: ', '132****8588');
- // //pos.PrintNameValue('支付前余额: ', '5.00');
- // pos.PrintNameValue('当前可用余额: ', '4.5');
- // pos.PrintNameValue('本次积分: ', '12.0');
- // pos.PrintNameValue('当前可用积分: ', '285.0');
- // pos.PrintMiddleText('--------------------------------');
- // pos.PrintText("谢谢您的惠顾,欢迎下次光临!");//打印标题
- // pos.PrintQRcode('http://xxx.xxx.xxx');//二维码 PrintBarcode: PrintBarcode,//打印条码
- // pos.PrintJumpLines(3);
- // pos.PrintBarcode('6934199500017');//条码
- pos.PrintJumpLines(3);
- pos.DaYin(function (res) {
- if (res == "err") {
- pos.ClearQueue();//清空打印列队
- //提示,打印出错,请稍后再试,仍然出错请重新设置打印机
- }
- })
- }
- })
|