Commit d032b2d7 by 施宇

11

parent ddb60012
{"ignoreds":["node_modules/**/*","**/node_modules/**","**/.git/**",".git/**/*","**/.svn/**",".svn/**/*",".DS_Store","**/.DS_Store"],"folderInfo":{"./":{"mtimeMs":1588039958728.2603,"children":["app.js","app.json","app.wxss","project.config.json","sitemap.json"]},"pages/":{"mtimeMs":1588045516900.1838,"children":[]},"res/":{"mtimeMs":1587987929535.54,"children":[]},"res/css/":{"mtimeMs":1587468648224.7944,"children":["res/css/base.wxss"]},"res/img/":{"mtimeMs":1587693859514.1584,"children":["res/img/arrow-left.png","res/img/arrow-right.png","res/img/ck-icon-a.png","res/img/ck-icon.png","res/img/close-icon.png","res/img/kc-icon-a.png","res/img/kc-icon.png","res/img/login-img.png","res/img/login-text.png","res/img/nav-arrow-down.png","res/img/question-icon.png","res/img/search-icon.png","res/img/sh-icon-a.png","res/img/sh-icon.png","res/img/sj-icon-a.png","res/img/sj-icon.png","res/img/sz-icon-a.png","res/img/sz-icon.png","res/img/warn-icon.png"]},"utils/":{"mtimeMs":1588040145835.5574,"children":["utils/api.js","utils/axios.js","utils/md5.js","utils/util.js"]},".git/":{"mtimeMs":1588145892497.218,"children":[]},".wechatide/":{"mtimeMs":1587519550088.0625,"children":[".wechatide/fileCache.cfg"]},"pages/home/":{"mtimeMs":1587536014892.4702,"children":["pages/home/home.js","pages/home/home.json","pages/home/home.wxml","pages/home/home.wxss"]},"pages/login/":{"mtimeMs":1587535974795.0686,"children":["pages/login/login.js","pages/login/login.json","pages/login/login.wxml","pages/login/login.wxss"]},"components/":{"mtimeMs":1587538211879.0247,"children":[]},"components/navC/":{"mtimeMs":1587538221287.4016,"children":["components/navC/navC.js","components/navC/navC.json","components/navC/navC.wxml","components/navC/navC.wxss"]},"pages/receivinggoods/":{"mtimeMs":1587538742321.587,"children":["pages/receivinggoods/receivinggoods.js","pages/receivinggoods/receivinggoods.json","pages/receivinggoods/receivinggoods.wxml","pages/receivinggoods/receivinggoods.wxss"]},"pages/upperShelf/":{"mtimeMs":1587622056930.153,"children":["pages/upperShelf/upperShelf.js","pages/upperShelf/upperShelf.json","pages/upperShelf/upperShelf.wxml","pages/upperShelf/upperShelf.wxss"]},"pages/outbound/":{"mtimeMs":1587626008346.8442,"children":["pages/outbound/outbound.js","pages/outbound/outbound.json","pages/outbound/outbound.wxml","pages/outbound/outbound.wxss"]},"pages/scanDelivery/":{"mtimeMs":1587627596586.3196,"children":["pages/scanDelivery/scanDelivery.js","pages/scanDelivery/scanDelivery.json","pages/scanDelivery/scanDelivery.wxml","pages/scanDelivery/scanDelivery.wxss"]},"pages/picking/":{"mtimeMs":1587631234329.3645,"children":["pages/picking/picking.js","pages/picking/picking.json","pages/picking/picking.wxml","pages/picking/picking.wxss"]},"pages/cardBoard/":{"mtimeMs":1587632724321.1174,"children":["pages/cardBoard/cardBoard.js","pages/cardBoard/cardBoard.json","pages/cardBoard/cardBoard.wxml","pages/cardBoard/cardBoard.wxss"]},"pages/changeWarehouse/":{"mtimeMs":1587635396534.957,"children":["pages/changeWarehouse/changeWarehouse.js","pages/changeWarehouse/changeWarehouse.json","pages/changeWarehouse/changeWarehouse.wxml","pages/changeWarehouse/changeWarehouse.wxss"]},"pages/systemSettings/":{"mtimeMs":1587637181028.4365,"children":["pages/systemSettings/systemSettings.js","pages/systemSettings/systemSettings.json","pages/systemSettings/systemSettings.wxml","pages/systemSettings/systemSettings.wxss"]},"pages/printer/":{"mtimeMs":1587637593187.5686,"children":["pages/printer/printer.js","pages/printer/printer.json","pages/printer/printer.wxml","pages/printer/printer.wxss"]},"pages/inventoryQuery/":{"mtimeMs":1587639536186.8396,"children":["pages/inventoryQuery/inventoryQuery.js","pages/inventoryQuery/inventoryQuery.json","pages/inventoryQuery/inventoryQuery.wxml","pages/inventoryQuery/inventoryQuery.wxss"]},"pages/startPage/":{"mtimeMs":1588045543126.067,"children":["pages/startPage/startPage.js","pages/startPage/startPage.json","pages/startPage/startPage.wxml","pages/startPage/startPage.wxss"]}},"cacheVersion":1}
\ No newline at end of file
{"ignoreds":["node_modules/**/*","**/node_modules/**","**/.git/**",".git/**/*","**/.svn/**",".svn/**/*",".DS_Store","**/.DS_Store"],"folderInfo":{"./":{"mtimeMs":1588039958728.2603,"children":["app.js","app.json","app.wxss","project.config.json","sitemap.json"]},"pages/":{"mtimeMs":1588045516900.1838,"children":[]},"res/":{"mtimeMs":1587987929535.54,"children":[]},"res/css/":{"mtimeMs":1587468648224.7944,"children":["res/css/base.wxss"]},"res/img/":{"mtimeMs":1588153975467.2988,"children":["res/img/all-check-left-a.png","res/img/all-check-left.png","res/img/all-check-right-a.png","res/img/all-check-right.png","res/img/ck-icon-a.png","res/img/ck-icon.png","res/img/close-icon.png","res/img/kc-icon-a.png","res/img/kc-icon.png","res/img/login-img.png","res/img/login-text.png","res/img/nav-arrow-down.png","res/img/question-icon.png","res/img/search-icon.png","res/img/sh-icon-a.png","res/img/sh-icon.png","res/img/sigle-check-left-a.png","res/img/sigle-check-left.png","res/img/sigle-check-right-a.png","res/img/sigle-check-right.png","res/img/sj-icon-a.png","res/img/sj-icon.png","res/img/sz-icon-a.png","res/img/sz-icon.png","res/img/warn-icon.png"]},"utils/":{"mtimeMs":1588235657705.948,"children":["utils/api.js","utils/axios.js","utils/md5.js","utils/print.js","utils/printerjobs.js","utils/textEncoding.js","utils/util.js"]},".git/":{"mtimeMs":1588235995853.019,"children":[]},".wechatide/":{"mtimeMs":1587519550088.0625,"children":[".wechatide/fileCache.cfg"]},"pages/home/":{"mtimeMs":1587536014892.4702,"children":["pages/home/home.js","pages/home/home.json","pages/home/home.wxml","pages/home/home.wxss"]},"pages/login/":{"mtimeMs":1587535974795.0686,"children":["pages/login/login.js","pages/login/login.json","pages/login/login.wxml","pages/login/login.wxss"]},"components/":{"mtimeMs":1587538211879.0247,"children":[]},"components/navC/":{"mtimeMs":1587538221287.4016,"children":["components/navC/navC.js","components/navC/navC.json","components/navC/navC.wxml","components/navC/navC.wxss"]},"pages/receivinggoods/":{"mtimeMs":1587538742321.587,"children":["pages/receivinggoods/receivinggoods.js","pages/receivinggoods/receivinggoods.json","pages/receivinggoods/receivinggoods.wxml","pages/receivinggoods/receivinggoods.wxss"]},"pages/upperShelf/":{"mtimeMs":1587622056930.153,"children":["pages/upperShelf/upperShelf.js","pages/upperShelf/upperShelf.json","pages/upperShelf/upperShelf.wxml","pages/upperShelf/upperShelf.wxss"]},"pages/outbound/":{"mtimeMs":1587626008346.8442,"children":["pages/outbound/outbound.js","pages/outbound/outbound.json","pages/outbound/outbound.wxml","pages/outbound/outbound.wxss"]},"pages/scanDelivery/":{"mtimeMs":1587627596586.3196,"children":["pages/scanDelivery/scanDelivery.js","pages/scanDelivery/scanDelivery.json","pages/scanDelivery/scanDelivery.wxml","pages/scanDelivery/scanDelivery.wxss"]},"pages/picking/":{"mtimeMs":1587631234329.3645,"children":["pages/picking/picking.js","pages/picking/picking.json","pages/picking/picking.wxml","pages/picking/picking.wxss"]},"pages/cardBoard/":{"mtimeMs":1587632724321.1174,"children":["pages/cardBoard/cardBoard.js","pages/cardBoard/cardBoard.json","pages/cardBoard/cardBoard.wxml","pages/cardBoard/cardBoard.wxss"]},"pages/changeWarehouse/":{"mtimeMs":1587635396534.957,"children":["pages/changeWarehouse/changeWarehouse.js","pages/changeWarehouse/changeWarehouse.json","pages/changeWarehouse/changeWarehouse.wxml","pages/changeWarehouse/changeWarehouse.wxss"]},"pages/systemSettings/":{"mtimeMs":1587637181028.4365,"children":["pages/systemSettings/systemSettings.js","pages/systemSettings/systemSettings.json","pages/systemSettings/systemSettings.wxml","pages/systemSettings/systemSettings.wxss"]},"pages/printer/":{"mtimeMs":1587637593187.5686,"children":["pages/printer/printer.js","pages/printer/printer.json","pages/printer/printer.wxml","pages/printer/printer.wxss"]},"pages/inventoryQuery/":{"mtimeMs":1587639536186.8396,"children":["pages/inventoryQuery/inventoryQuery.js","pages/inventoryQuery/inventoryQuery.json","pages/inventoryQuery/inventoryQuery.wxml","pages/inventoryQuery/inventoryQuery.wxss"]},"pages/startPage/":{"mtimeMs":1588045543126.067,"children":["pages/startPage/startPage.js","pages/startPage/startPage.json","pages/startPage/startPage.wxml","pages/startPage/startPage.wxss"]}},"cacheVersion":1}
\ No newline at end of file
......@@ -4,7 +4,7 @@ App({
},
globalData: {
userInfo: null,
storeInfo: wx.getStorageSync('storeInfo'),
}
})
\ No newline at end of file
{
"pages": [
"pages/cardBoard/cardBoard",
"pages/startPage/startPage",
"pages/changeWarehouse/changeWarehouse",
"pages/receivinggoods/receivinggoods",
......@@ -9,7 +11,6 @@
"pages/printer/printer",
"pages/systemSettings/systemSettings",
"pages/cardBoard/cardBoard",
"pages/picking/picking",
"pages/scanDelivery/scanDelivery",
"pages/outbound/outbound",
......
......@@ -5,6 +5,7 @@ import {
import {
apis
} from '../../utils/api.js';
let app = getApp();
Component({
/**
* 组件的属性列表
......@@ -13,11 +14,6 @@ Component({
title: { // 页面标题
type: String,
value: '供应链仓储管理系统'
},
store:{//仓库名称
type: String,
value: ''
}
},
......@@ -26,24 +22,32 @@ Component({
*/
data: {
userInfo:wx.getStorageSync('userInfo'),
storeInfo:wx.getStorageSync('storeInfo'),
storeInfo:null,
drop1:false,
drop2:false,
index:0,
},
attached: function() {
// 在组件实例进入页面节点树时执行
pageLifetimes:{
show: function() {
let me = this;
me.judgePagePath()
if(!me.data.userInfo){
this.getUserData();
}
if(!me.data.storeInfo){
// 页面被展示
if(!app.globalData.storeInfo){
this.getStoreInfo();
}else{
me.triggerEvent('getInfo', me.store||me.data.storeInfo.store_name)
me.setData({
storeInfo:app.globalData.storeInfo
})
me.triggerEvent('getInfo',app.globalData.storeInfo.store_name)
}
},
},
attached: function() {
// 在组件实例进入页面节点树时执行
this.judgePagePath();
if(!this.data.userInfo){
this.getUserData();
}
},
......@@ -161,6 +165,7 @@ Component({
me.setData({
storeInfo:data.current_store
});
app.globalData.storeInfo = data.current_store;
wx.setStorage({
key: "storeInfo",
data: data.current_store
......
......@@ -44,7 +44,7 @@
</view>
</view>
<view class="html-title ellipsis">{{title}}</view>
<view class="nav-right">当前仓库:{{store||storeInfo.store_name||'--'}}</view>
<view class="nav-right">当前仓库:{{storeInfo.store_name||'--'}}</view>
</view>
<slot></slot>
</view>
\ No newline at end of file
// pages/cardBoard/cardBoard.js
import {
getData
} from '../../utils/axios.js';
import {
apis
} from '../../utils/api.js';
import {
openBluetoothAdapter
} from '../../utils/print.js';
Page({
/**
* 页面的初始数据
*/
data: {
tableData:[],
numText:"",//卡板号
},
test:function(){
openBluetoothAdapter()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
formInput:function(e){
let {value} = e.detail ;
if(value){
this.getData(value)
}
},
getData:function(val){
let me = this;
getData(apis.pallet_box_list, 'post', {"pallet_sn":val}, function(res) {
if (res.errcode === 0) {
let data = res.data;
me.setData({
tableData:data,
numText:val
})
} else {
wx.showToast({
title: res.errmsg,
icon: 'none',
duration: 2000
});
}
}, true,true)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
......
<nav-c title="装卡板">
<view class="card-board-view width-854px nav-view borderBox">
<nav-c></nav-c>
<view class="card-board-wrapper ">
<view class="view-top Bflex aic">
<text class="desc">卡板号/箱号:</text>
<input class="input input-border" placeholder="请输入用户名"></input>
<input class="input input-border" placeholder="请输入用户名" bindconfirm="formInput"></input>
<view class="number">
卡板号: <text>0609</text>
卡板号: <text>{{numText}}</text>
</view>
</view>
<view class="data-view Bflex aic">
<view class="data-table borderBox">
<view class="head Bflex">
<view class="td-1 td borderBox Iflex jcc aic td-50"><text>选项</text></view>
<view class="td-2 td borderBox Iflex jcc aic"><text>状态</text></view>
<view class="td-2 td borderBox Iflex jcc aic"><text>拣货说明</text></view>
<view class="td-2 td borderBox Iflex jcc aic td-80"><text>货位</text></view>
<view class="td-2 td borderBox Iflex jcc aic"><text>卡板号</text></view>
<view class="td-2 td borderBox Iflex jcc aic"><text>箱号</text></view>
<view class="td-2 td borderBox Iflex jcc aic td-80"><text>操作</text></view>
</view>
<view class="body">
<block wx:if="{{!tableData.length}}">
<view class="body-data Bflex">
<view class="no-data-td ">暂无数据</view>
</view>
</block>
<block wx:else>
<view class="body-data Bflex" wx:for="{{tableData}}" wx:key="index">
<view class="td-1 td borderBox Iflex jcc aic td-50"><text class="box-icon"></text></view>
<view class="td-2 td borderBox Iflex jcc aic"><text>状态</text></view>
<view class="td-2 td borderBox Iflex jcc aic"><text>拣货说明</text></view>
<view class="td-2 td borderBox Iflex jcc aic td-80"><text>货位</text></view>
<view class="td-2 td borderBox Iflex jcc aic"><text>{{item.pallet_sn}}</text></view>
<view class="td-2 td borderBox Iflex jcc aic"><text>{{item.box_sn}}</text></view>
<view class="td-2 td borderBox Iflex jcc aic td-80"><text class="underline-text">取消</text></view>
</view>
</block>
</view>
</view>
<view class="btn-group Bflex">
<view class="btn-item btn blue-border-btn">装卡板</view>
<view class="btn-item btn blue-border-btn" catchtap="test">装卡板</view>
<view class="btn-item btn blue-border-btn">补打卡板标签</view>
<view class="btn-item btn disbled-btn">清卡板记录</view>
<view class="btn-item btn disbled-btn">清卡板记录</view>
</view>
</view>
</view>
</view>
</nav-c>
......@@ -5,6 +5,7 @@ import {
import {
apis
} from '../../utils/api.js';
let app = getApp()
Page({
/**
......@@ -83,15 +84,14 @@ Page({
icon: 'none',
duration: 2000,
success:function(){
// me.cancelFun();
me.cancelFun();
}
});
wx.setStorage({
key: "storeInfo",
data: chooseObj
});
app.globalData.storeInfo = chooseObj;
} else {
wx.showToast({
title: res.errmsg,
......
<nav-c title="出库管理">
<view class="outbound-view width-854px nav-view borderBox">
<nav-c></nav-c>
<view class="outbound-wrapper Bflex aic jcc">
<view class="items Bflex">
<view class="item borderBox noMarginTop noMarginLeft c-E7E1E1">
<navigator class="item borderBox noMarginTop noMarginLeft c-E7E1E1" url="/pages/picking/picking">
拣货确认
</view>
<view class="item borderBox noMarginTop c-E2E7E1">
</navigator>
<navigator class="item borderBox noMarginTop c-E2E7E1" url="/pages/cardBoard/cardBoard">
装卡板
</view>
<view class="item borderBox noMarginLeft c-D2D8EA">
</navigator>
<navigator class="item borderBox noMarginLeft c-D2D8EA" url="/pages/scanDelivery/scanDelivery">
扫描出库
</view>
</navigator>
<view class="item borderBox">
</view>
......@@ -23,3 +24,4 @@
</view>
</view>
</view>
</nav-c>
\ No newline at end of file
<nav-c title="拣货确认">
<view class="pinking-view width-854px nav-view borderBox">
<nav-c></nav-c>
<view class="pinking-wrapper ">
<view class="view-top Bflex aic">
<text class="desc">上架任务号/货位/卡板号/箱号/型号:</text>
......@@ -63,3 +63,4 @@
</view>
</view>
</nav-c>
......@@ -34,12 +34,12 @@ Page({
pp:"",//品牌
cd:"",//产地
dc:"",//dc
zl:""//重量
},
searchByXh:"",//通过输入型号去获取单个入仓数据
countryList:[],//国家列表
xiangIndex:0,//装新箱或者合箱
orderNum:"",//箱号
orderZl:"",//重量
},
/**
......@@ -102,9 +102,6 @@ Page({
//加入扫描
let data = e.currentTarget.dataset;
this.fillDataByScanXh(data.info,data.info.goods_name)
// this.setData({
// chooseOrder:data.info,
// });
},
closeMask:function(){
//关闭入仓数据选择弹窗
......@@ -131,7 +128,7 @@ Page({
});
this.getList1();
this.getReceivingList(1);
// this.getReceivingList(2)
this.getReceivingList(2)
},
getMaskList:function(){
......@@ -141,7 +138,7 @@ Page({
if (res.errcode === 0) {
let data = res.data;
let errorText = false;
if(data.data){
if((data.data)&&(data.data instanceof Array)){
let len = data.data.length;
if(!len){
errorText = true
......@@ -153,7 +150,7 @@ Page({
});
me.getList1();
me.getReceivingList(1);
// me.getReceivingList(2)
me.getReceivingList(2)
}else{
me.setData({
maskList:data.data,
......@@ -185,7 +182,7 @@ Page({
if (res.errcode === 0) {
let data = res.data;
let dataArr = [];
if(data.data){
if((data.data)&&(data.data instanceof Array)){
let len = data.data.length;
if(!len){
dataArr = []
......@@ -210,6 +207,18 @@ Page({
}
}, true,true)
},
formOrderNumInput:function(e){
let {value} = e.detail ;
this.setData({
orderNum:value
})
},
formOrderZlInput:function(e){
let {value} = e.detail ;
this.setData({
orderZl:value
})
},
formtmInput:function(e){
//监听条码的input
let {value} = e.detail ;
......@@ -334,7 +343,7 @@ Page({
let data = res.data;
let str="";
let dataObj = "";
if(data.data){
if((data.data)&&(data.data instanceof Array)){
let len = data.data.length;
if(!len){
dataObj = ""
......@@ -366,7 +375,7 @@ Page({
},
checkNum:function(val) {
//判断是否是数字
  var re = /^[0-9]+.?[0-9]*$/; //判断字符串是否为数字
  var re = /^\d+(\.\d+)?$/; //判断字符串是否为数字
  if (!re.test(val)) {
    return false;
  }else{
......@@ -486,12 +495,14 @@ Page({
errorArr: this.data.errorArr
})
},
showToastFunAndErrorArr:function(errorText){
showToastFunAndErrorArr:function(errorText,notErrorArr){
//处理错误的弹窗同时增加错误日志
if(!errorText){
return
}
if(!notErrorArr){
this.dealErrorArr(errorText)
}
wx.showToast({
title:errorText,
icon: 'none',
......@@ -588,7 +599,7 @@ Page({
if (res.errcode === 0) {
let data = res.data;
let dataArr = [];
if(data.data){
if((data.data)&&(data.data instanceof Array)){
let len = data.data.length;
if(!len){
dataArr = []
......@@ -613,7 +624,7 @@ Page({
}, false,true)
},
upDataReceivingStatus:function(e){
let {type,check} = e.currentTarget.dataset
let {type,check} = e.currentTarget.dataset;
let storeId = this.data.chooseOrder['in_store_id'];
let obj = {
"status":type,
......@@ -629,6 +640,7 @@ Page({
icon: 'none',
duration: 2000
});
return
}else{
obj['goods_id'] = this.data.rightChooseId
}
......@@ -640,6 +652,7 @@ Page({
icon: 'none',
duration: 2000
});
return
}else{
obj['receiving_id'] = this.data.leftChooseId
}
......@@ -675,16 +688,18 @@ Page({
chooseLeft:function(e){
//选中左边表格的数据
let {id} = e.currentTarget.dataset;
let oldLeftChooseId = this.data.leftChooseId;
this.setData({
leftChooseId:id,
leftChooseId:id == oldLeftChooseId ? "":id,
rightChooseId:"",
})
},
chooseRight:function(e){
//选择右边表格的数据
let {id} = e.currentTarget.dataset;
let oldRightChooseId = this.data.rightChooseId;
this.setData({
rightChooseId:id,
rightChooseId:id == oldRightChooseId ? "":id,
leftChooseId:""
})
},
......@@ -712,14 +727,80 @@ Page({
}, true,true)
},
changeXiangIndex:function(e){
//装新箱还是合箱
//新箱/合箱/散装
let {index} = e.currentTarget.dataset;
let oldIndex = this.data.xiangIndex;
this.setData({
xiangIndex:index
xiangIndex:index == oldIndex?'0':index,
})
},
saveSaleTask:function(){
saveSaleTask:function(e){
//type为1表示生成上架任务 type为2表示装箱
let {type} = e.currentTarget.dataset;
let me = this;
let obj = {
"in_store_id": me.data.chooseOrder.in_store_id
}
let xiangIndex = me.data.xiangIndex
if(type == 1){
if(me.data.xiangIndex == 0){
obj['sale_type'] = 'bulk';
me.saveSaleTaskAjax(obj)
}else{
return
}
}else{
if(xiangIndex == 0){
me.showToastFunAndErrorArr('请选择装箱方式',true);
return
}else{
let num = me.data.orderZl;
if(!num){
me.showToastFunAndErrorArr('请填写重量',true);
return
}else{
if(!me.checkNum(num)){
me.showToastFunAndErrorArr('重量必须为数字',true);
return
}else{
obj['weight'] = num
}
}
if(xiangIndex == 1){
//新箱
obj['sale_type'] = 'new_box';
me.saveSaleTaskAjax(obj)
}else if(xiangIndex == 2){
//合箱
obj['sale_type'] = 'merge_box';
if(!me.data.orderNum){
me.showToastFunAndErrorArr('合箱时请填写箱号',true);
return
}else{
obj['box_sn'] = me.data.orderNum;
me.saveSaleTaskAjax(obj)
}
}
}
}
},
saveSaleTaskAjax:function(obj){
getData(apis.save_sale_task, 'post', {...obj}, function(res) {
if (res.errcode === 0) {
wx.showToast({
title: '操作成功',
icon: 'none',
duration: 2000
});
}else{
wx.showToast({
title: res.errmsg,
icon: 'none',
duration: 2000
});
}
}, true,true)
}
})
\ No newline at end of file
......@@ -104,7 +104,7 @@
<text class="label">重量(KG)</text>
<view class="version-reslut">
<view class="version">
<input class="zl-input" value="{{formData.zl}}" type="number"></input>
<input class="zl-input" value="{{orderZl}}" type="number" bindinput="formOrderZlInput"></input>
</view>
<view class="reslut borderBox">
<view wx:for="{{errorArr}}" wx:key="index">{{item}}</view>
......@@ -130,7 +130,7 @@
<text class="box-icon {{xiangIndex == 2 ?'checked':'' }}"></text>
<text>合箱</text>
</view>
<input class="input input-border"></input>
<input class="input input-border" value="{{orderNum}}" bindinput="formOrderNumInput"></input>
</view>
<view class="bottom-table-view Bflex">
......@@ -206,8 +206,8 @@
<!-- <view class="td-1 td borderBox Iflex jcc aic"><text class="box-icon"></text></view> -->
<view class="td-2 td borderBox Iflex jcc aic"><text>{{item.goods_name}}</text></view>
<view class="td-3 td borderBox Iflex jcc aic"><text>{{item.brand_name}}</text></view>
<view class="td-4 td borderBox Iflex jcc aic"><text>{{item.number}}</text></view>
<view class="td-5 td borderBox Iflex jcc aic"><text>{{item.goods_name}}</text></view>
<view class="td-4 td borderBox Iflex jcc aic"><text>{{item.box_sn}}</text></view>
<view class="td-5 td borderBox Iflex jcc aic"><text>{{item.number}}</text></view>
</view>
</block>
......@@ -227,8 +227,8 @@
</view>
</view> -->
<view class="btn-group Bflex jcc">
<view class="btn-sigle blue-border-btn btn">生成上架任务</view>
<view class="btn-sigle zx-btn blue-border-btn btn">装箱</view>
<view class="btn-sigle blue-border-btn btn {{xiangIndex != 0 ?'disabled':'' }}" catchtap="saveSaleTask" data-type="1">生成上架任务</view>
<view class="btn-sigle zx-btn blue-border-btn btn" catchtap="saveSaleTask" data-type="2">装箱</view>
</view>
</view>
</view>
......
......@@ -357,9 +357,7 @@ page {
.sigle-check:hover .active{
display: block;
}
.body-data.active{
background-color: #F0F7FF;
}
.all_check {
margin-top: 6px;
}
......@@ -383,6 +381,11 @@ page {
line-height: 33px;
}
.btn-sigle.disabled {
border: 1px solid #D1D1D1;
color: #999999;
background-color: #F6F6F6;
}
.zx-btn {
margin-left: 38px;
......@@ -519,12 +522,7 @@ page {
.puchase-table .box-icon {
margin: 0;
}
.no-data-td {
text-align: center;
flex:1;
padding: 6px 0;
color:#666;
}
.input.disabled{
background-color:#F8F8F8 ;
}
<nav-c title="扫描出库">
<view class="scan-delivery-view width-854px nav-view borderBox">
<nav-c></nav-c>
<view class="scan-delivery-wrapper ">
<view class="view-top Bflex aic">
<text class="desc">卡板号/箱号:</text>
......@@ -44,3 +44,4 @@
</view>
</view>
</view>
</nav-c>
<nav-c title="上架">
<view class="upper-shelf-view width-854px nav-view borderBox">
<nav-c></nav-c>
<view class="upper-shelf-wrapper">
<view class="view-top Bflex aic">
<text class="desc">上架任务号/货位/卡板号/箱号/型号:</text>
......@@ -51,3 +51,4 @@
</view>
</view>
</nav-c>
\ No newline at end of file
......@@ -137,3 +137,12 @@ page {
.underline-text{
text-decoration:underline
}
.no-data-td {
text-align: center;
flex:1;
padding: 6px 0;
color:#666;
}
.body-data.active{
background-color: #F0F7FF;
}
\ No newline at end of file
const user_url = 'http://user.liexin.net';
const in_store_url = 'http://scm.in.store.liexin.net';
const out_store_url = 'http://outstoreapi.liexin.net';
export const apis = {
login:user_url+'/pwd/login',//登入
me:user_url+'/pwd/me',//获取用户信息
// 入库开始
get_in_store_warehousing_sn:in_store_url+"/in_store/get_in_store_warehousing_sn",//根据入仓单号查找入库单
in_store_detail_list:in_store_url+'/in_store/in_store_detail_list',//获取入库单详情
get_country:in_store_url+'/country/get_country',//获取国家
......@@ -12,7 +14,11 @@ export const apis = {
receiving_list:in_store_url+'/in_store/receiving_list',//收货列表
update_receiving_status:in_store_url+'/in_store/update_receiving_status',//修改收货详情状态
delete_receiving:in_store_url+'/in_store/delete_receiving',//删除收货
save_sale_task:in_store_url+'/sale_task/save_sale_task',//生成上架任务与装箱
save_sale_task:in_store_url+'/in_store/save_sale_task',//生成上架任务与装箱
// 入库结束
//出库开始
pallet_box_list:out_store_url+'/out_store/pallet_box_list',
//出库结束
get_store_list:in_store_url+"/store_account/get_store_list",//获取仓库列表
change_store:in_store_url+'/store_account/change_store',//变更仓库
}
\ No newline at end of file
const PrinterJobs = require('printerjobs');
let deviceName = "L51 BT Printer";
let deviceId = "";
let connectedDeviceId = "";
let services = [];
let notifyCharacteristicsId = ""
let _deviceId ="";
let _serviceId="";
let _characteristicId = "";
function openBluetoothAdapter(){
console.log(11)
if (wx.openBluetoothAdapter) {
wx.openBluetoothAdapter({
success: function(res) {
/* 获取本机的蓝牙状态 */
setTimeout(() => {
getBluetoothAdapterState()
}, 1000)
},
fail: function(err) {
// 初始化失败
}
})
} else {
}
}
function getBluetoothAdapterState() {
// var that = this;
// that.toastTitle = '检查蓝牙状态'
wx.getBluetoothAdapterState({
success: function(res) {
startBluetoothDevicesDiscovery()
},
fail(res) {
console.log(res)
}
})
}
function startBluetoothDevicesDiscovery() {
// var that = this;
setTimeout(() => {
wx.startBluetoothDevicesDiscovery({
success: function(res) {
console.log(res)
/* 获取蓝牙设备列表 */
getBluetoothDevices()
},
fail(res) {
}
})
}, 1000)
}
function getBluetoothDevices() {
console.log(111)
setTimeout(() => {
wx.getBluetoothDevices({
services: [],
allowDuplicatesKey: false,
interval: 0,
success: function(res) {
if (res.devices.length > 0) {
if (JSON.stringify(res.devices).indexOf(deviceName) !== -1) {
for (let i = 0; i < res.devices.length; i++) {
if (deviceName === res.devices[i].name) {
/* 根据指定的蓝牙设备名称匹配到deviceId */
deviceId = res.devices[i].deviceId;
setTimeout(() => {
connectTO();
}, 2000);
};
};
} else {
}
} else {
}
},
fail(res) {
console.log(res, '获取蓝牙设备列表失败=====')
}
})
}, 2000)
}
function connectTO() {
wx.createBLEConnection({
deviceId: deviceId,
success: function(res) {
connectedDeviceId = deviceId;
/* 4.获取连接设备的service服务 */
getBLEDeviceServices();
wx.stopBluetoothDevicesDiscovery({
success: function(res) {
console.log(res, '停止搜索')
},
fail(res) {
}
})
},
fail: function(res) {
}
})
}
function getBLEDeviceServices() {
setTimeout(() => {
wx.getBLEDeviceServices({
deviceId: connectedDeviceId,
success: function(res) {
services = res.services
/* 获取连接设备的所有特征值 */
// getBLEDeviceCharacteristics()
for (let i = 0; i < res.services.length; i++) {
if (res.services[i].isPrimary) {
getBLEDeviceCharacteristics(deviceId, res.services[i].uuid)
return
}
}
},
fail: (res) => {
}
})
}, 2000)
}
function getBLEDeviceCharacteristics(deviceId, serviceId) {
setTimeout(() => {
wx.getBLEDeviceCharacteristics({
deviceId: deviceId,
serviceId: serviceId,
success: function(res) {
console.log('getBLEDeviceCharacteristics success', res.characteristics)
for (let i = 0; i < res.characteristics.length; i++) {
let item = res.characteristics[i]
if (item.properties.write) {
_deviceId = deviceId
_serviceId = serviceId
_characteristicId = item.uuid
writeBLECharacteristicValue()
}
if (item.properties.notify || item.properties.indicate) {
wx.notifyBLECharacteristicValueChange({
deviceId,
serviceId,
characteristicId: item.uuid,
state: true,
})
}
}
// console.log(res)
// for (var i = 0; i < res.characteristics.length; i++) {
// if ((res.characteristics[i].properties.notify || res.characteristics[i].properties.indicate) &&
// (res.characteristics[i].properties.read && res.characteristics[i].properties.write)) {
// console.log(res.characteristics[i].uuid, '蓝牙特征值 ==========')
// /* 获取蓝牙特征值 */
// notifyCharacteristicsId = res.characteristics[i].uuid
// // 启用低功耗蓝牙设备特征值变化时的 notify 功能
// // that.notifyBLECharacteristicValueChange()
// }
// }
},
fail: function(res) {
}
})
}, 1000)
}
function writeBLECharacteristicValue() {
let printerJobs = new PrinterJobs();
let str = "! 0 200 200 400 1 \n"+
"B QR 200 0 M 2 2 10 \n"+
"MA,QR code :'1','2','3','4'\n"+
"ENDQR\n"+
"TEXT 55 1 380 20 卡板号: \n"+
"TEXT 55 1 380 60 内含箱数: \n"+
"TEXT 55 1 380 100 净重: \n"+
"TEXT 55 1 480 20 卡板号 \n"+
"TEXT 55 1 480 60 内含箱数 \n"+
"TEXT 55 1 480 100 净重 \n"+
"FORM \n"+
"PRINT"
printerJobs
.print(str)
// await printerJobs.printQRCode('http://hqn.fun:9999/code.png');
// .print('2018年12月5日17:34')
// .print(printerUtil.fillLine())
// .setAlign('ct')
// .setSize(2, 2)
// .print('#20饿了么外卖')
// .setSize(1, 1)
// .print('切尔西Chelsea')
// .setSize(2, 2)
// .print('在线支付(已支付)')
// .setSize(1, 1)
// .print('订单号:5415221202244734')
// .print('下单时间:2017-07-07 18:08:08')
// .setAlign('lt')
// .print(printerUtil.fillAround('一号口袋'))
// .print(printerUtil.inline('意大利茄汁一面 * 1', '15'))
// .print(printerUtil.fillAround('其他'))
// .print('餐盒费:1')
// .print('[赠送康师傅冰红茶] * 1')
// .print(printerUtil.fillLine())
// .setAlign('rt')
// .print('原价:¥16')
// .print('总价:¥16')
// .setAlign('lt')
// .print(printerUtil.fillLine())
// .print('备注')
// .print("无")
// .print(printerUtil.fillLine())
// .println();
let buffer = printerJobs.buffer();
console.log('ArrayBuffer', 'length: ' + buffer.byteLength, ' hex: ' + ab2hex(buffer));
// 1.并行调用多次会存在写失败的可能性
// 2.建议每次写入不超过20字节
// 分包处理,延时调用
const maxChunk = 100;
const delay = 100;
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(_writeBLECharacteristicValue, j * delay, subPackage);
}
}
function _writeBLECharacteristicValue(buffer) {
// 向蓝牙设备发送一个0x00的16进制数据
wx.writeBLECharacteristicValue({
deviceId: _deviceId,
serviceId: _serviceId,
characteristicId:_characteristicId,
value: buffer,
success:function(){
console.log('写入成功')
},
complete:function(res){
console.log(res)
},
fail:function(res){
console.log(res)
}
})
}
// ArrayBuffer转16进度字符串示例
function ab2hex(buffer) {
const hexArr = Array.prototype.map.call(
new Uint8Array(buffer),
function (bit) {
return ('00' + bit.toString(16)).slice(-2)
}
)
return hexArr.join(',')
}
module.exports = {
openBluetoothAdapter
}
\ No newline at end of file
const TextEncoder = require('textEncoding').TextEncoder;
const printerJobs = function () {
this._queue = Array.from([0x1b, 0x40]);
this._encoder = new TextEncoder("gb2312", {NONSTANDARD_allowLegacyEncoding: true});
this._enqueue = function (cmd) {
this._queue.push.apply(this._queue, cmd);
}
};
/**
* 增加打印内容
* @param {string} content 文字内容
*/
printerJobs.prototype.text = function (content) {
if (content) {
let uint8Array = this._encoder.encode(content);
let encoded = Array.from(uint8Array);
this._enqueue(encoded);
}
return this;
};
/**
* 打印文字
* @param {string} content 文字内容
*/
printerJobs.prototype.print = function (content) {
this.text(content);
this._enqueue([0x0a]);
return this;
};
/**
* 返回ArrayBuffer
*/
printerJobs.prototype.buffer = function () {
return new Uint8Array(this._queue).buffer;
};
module.exports = printerJobs;
\ No newline at end of file
This diff could not be displayed because it is too large.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment