Commit 10d758f8 by liangjianmin

连接蓝牙

parent 9a1bb78e
......@@ -11,6 +11,26 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-a-juxing12:before {
content: "\e77f";
}
.icon-juxing7:before {
content: "\e77d";
}
.icon-sanjiaoxing2:before {
content: "\e77e";
}
.icon-bianzu:before {
content: "\e77b";
}
.icon-a-Fill3:before {
content: "\e77c";
}
.icon-xingzhuangjiehe:before {
content: "\e74f";
}
......
......@@ -24,14 +24,18 @@
}
.toggle {
.iconfont {
font-size: 16rpx;
font-size: 15rpx;
color: #9ca8ad;
transform: rotate(180deg);
}
.tt {
margin-left: 11rpx;
font-size: 24rpx;
color: #404547;
}
.rotate{
transform: rotate(0deg);
}
}
}
.pp {
......@@ -81,6 +85,14 @@
color: #6e767a;
margin-right: 60rpx;
}
.input-wrap{
width: calc(100% - 160rpx);
.tab-panel{
&:last-child{
margin-right: 0;
}
}
}
.tab {
.tab-panel {
width: 120rpx;
......@@ -132,6 +144,8 @@
}
}
.upload-box {
position: relative;
z-index: 1;
padding-top: 23rpx;
padding-bottom: 24rpx;
.title {
......@@ -204,6 +218,8 @@
}
}
.btn {
position: relative;
z-index: 2;
height: 88rpx;
background: #197adb;
border-radius: 4rpx;
......
.tally{
}
\ No newline at end of file
.tally {
padding-top: 100rpx;
.fix {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 10;
}
.search-box {
width: 100%;
background: #ffffff;
border-top: 1rpx solid #cad9e0;
.search-input {
position: relative;
height: 100rpx;
padding-left: 72rpx;
padding-right: 24rpx;
.icon-a-riqi11 {
position: absolute;
top: 32rpx;
left: 24rpx;
font-size: 36rpx;
color: #6e767a;
}
.uni-input {
font-size: 26rpx;
color: #404547;
width: 480rpx;
}
.scan {
font-size: 52rpx;
color: #197adb;
}
}
}
.tab {
height: 114rpx;
background-color: #f1f4f6;
padding-left: 24px;
.box {
position: relative;
font-size: 26rpx;
color: #404547;
margin-right: 44rpx;
transition: all 0.4s ease;
.t2 {
display: block;
}
&.curr {
color: #1e2021;
font-size: 32rpx;
font-weight: bold;
.t2 {
display: flex;
}
&:after {
position: absolute;
bottom: -16rpx;
left: 0;
right: 0;
width: 100%;
height: 6rpx;
background: #197adb;
border-radius: 3rpx;
content: '';
}
}
}
}
.list {
margin-top: 24rpx;
padding: 0 24rpx;
.box {
position: relative;
padding: 0 20rpx;
height: 198rpx;
background: #ffffff;
border-radius: 4rpx;
margin-bottom: 40rpx;
.bill-number {
position: absolute;
top: -20rpx;
left: 20rpx;
width: 185rpx;
height: 48rpx;
border-radius: 4rpx;
font-size: 26rpx;
color: #ffffff;
font-weight: bold;
&.color1 {
background: #197adb;
}
&.color2 {
background: #f39d18;
}
}
.text {
.p1 {
font-size: 22rpx;
color: #6e767a;
margin-right: 16rpx;
}
.p2 {
font-size: 22rpx;
color: #404547;
}
.mr49 {
margin-right: 49rpx;
}
}
.t1 {
font-size: 28rpx;
color: #1e2021;
margin-bottom: 18rpx;
}
.words-text {
font-size: 26rpx;
color: #197adb;
}
}
}
}
.tallyDetail {
margin-top: 24rpx;
padding: 0 24rpx 24rpx 24rpx;
.base-information {
padding: 24rpx;
background: #ffffff;
border-radius: 4rpx;
margin-bottom: 16rpx;
.top {
margin-bottom: 24rpx;
.title {
.arrow {
width: 12rpx;
height: 12rpx;
background: #197adb;
margin-right: 16rpx;
border-radius: 50%;
}
.tt {
font-size: 32rpx;
color: #1e2021;
font-weight: bold;
}
}
.toggle {
.iconfont {
font-size: 15rpx;
color: #9ca8ad;
transform: rotate(180deg);
}
.tt {
margin-left: 11rpx;
font-size: 24rpx;
color: #404547;
}
.rotate {
transform: rotate(0deg);
}
}
}
.pp {
margin-bottom: 20rpx;
&.mb0 {
margin-bottom: 0;
}
.t1 {
width: 120rpx;
font-size: 24rpx;
color: #6e767a;
margin-right: 16rpx;
}
.t2 {
width: 73%;
font-size: 24rpx;
color: #404547;
}
.type {
width: 72rpx;
height: 36rpx;
border-radius: 4rpx;
border: 1px solid #197adb;
font-size: 24rpx;
color: #197adb;
margin-left: 28rpx;
}
}
}
.tally-base-information {
padding: 24rpx 24rpx 0 24rpx;
background: #ffffff;
border-radius: 4rpx;
.top {
.title {
.arrow {
width: 12rpx;
height: 12rpx;
background: #197adb;
margin-right: 16rpx;
border-radius: 50%;
}
.tt {
font-size: 32rpx;
color: #1e2021;
font-weight: bold;
}
}
}
.list {
.box {
position: relative;
padding: 24rpx 0;
border-bottom: 1px solid #e6edf0;
.pp {
.w {
flex: 0 0 50%;
}
margin-bottom: 16rpx;
.t1 {
font-size: 22rpx;
color: #6e767a;
}
.t2 {
font-size: 22rpx;
color: #404547;
}
}
.input-box {
.t1 {
font-size: 22rpx;
color: #6e767a;
}
.uni-input {
width: 319rpx;
height: 48rpx;
background: #e6edf0;
border-radius: 4rpx;
font-size: 24rpx;
color: #404547;
padding-left: 20rpx;
margin-left: 9rpx;
}
}
.photograph {
width: 80rpx;
height: 48rpx;
background: #197adb;
border-radius: 4rpx;
font-size: 22rpx;
color: #ffffff;
}
.pic {
position: absolute;
right: 0;
top: 24rpx;
width: 88rpx;
height: 88rpx;
}
}
}
.btn-submit {
height: 77rpx;
border-bottom: 1px solid #e6edf0;
.t1 {
font-size: 22rpx;
color: #404547;
}
.t2 {
font-size: 22rpx;
color: #197adb;
}
}
.receiving-information {
padding: 0 24rpx 0 24rpx;
background: #ffffff;
border-radius: 4rpx;
.top {
margin-bottom: 24rpx;
.title {
.arrow {
width: 12rpx;
height: 12rpx;
background: #197adb;
margin-right: 16rpx;
border-radius: 50%;
}
.tt {
font-size: 32rpx;
color: #1e2021;
font-weight: bold;
}
}
}
.box {
height: 80rpx;
border-bottom: 1px solid #e6edf0;
.label {
width: 98rpx;
font-size: 24rpx;
color: #6e767a;
margin-right: 60rpx;
}
.input-wrap {
width: calc(100% - 160rpx);
.tab-panel {
&:last-child {
margin-right: 0;
}
}
}
.tab {
.tab-panel {
width: 120rpx;
height: 48rpx;
background: #9ca8ad;
border-radius: 4rpx;
font-size: 24rpx;
color: #ffffff;
margin-right: 24rpx;
&.curr {
background: #197adb;
}
}
}
.uni-list-cell-db {
width: calc(100% - 160rpx);
position: relative;
.icon-sanjiaoxing1 {
position: absolute;
right: 0;
top: 15rpx;
font-size: 17rpx;
color: #9ca8ad;
}
}
.uni-input {
font-size: 24rpx;
color: #404547;
font-weight: bold;
}
.uni-input-box {
width: calc(100% - 160rpx);
.uni-input {
font-size: 24rpx;
color: #404547;
font-weight: bold;
}
.scan-view {
.iconfont {
font-size: 48rpx;
color: #197adb;
margin-right: 10rpx;
}
.tt {
font-size: 24rpx;
color: #197adb;
}
}
}
}
.textarea-box {
border-bottom: 1px solid #e6edf0;
position: relative;
padding-top: 23rpx;
height: 137rpx;
textarea {
height: 100%;
font-size: 24rpx;
color: #6e767a;
}
.text {
position: absolute;
right: 0;
bottom: 24rpx ;
font-size: 24rpx;
color: #9ca8ad;
}
}
}
}
.btn {
position: relative;
z-index: 2;
height: 88rpx;
background: #197adb;
border-radius: 4rpx;
font-size: 28rpx;
color: #ffffff;
margin-top: 48rpx;
}
}
.tallyExectionDetail{
}
\ No newline at end of file
.tallyDetail {
margin-top: 24rpx;
padding: 0 24rpx 24rpx 24rpx;
.base-information {
padding: 24rpx;
background: #ffffff;
border-radius: 4rpx;
margin-bottom: 16rpx;
.top {
margin-bottom: 24rpx;
.title {
.arrow {
width: 12rpx;
height: 12rpx;
background: #197adb;
margin-right: 16rpx;
border-radius: 50%;
}
.tt {
font-size: 32rpx;
color: #1e2021;
font-weight: bold;
}
}
.toggle {
.iconfont {
font-size: 15rpx;
color: #9ca8ad;
transform: rotate(180deg);
}
.tt {
margin-left: 11rpx;
font-size: 24rpx;
color: #404547;
}
.rotate {
transform: rotate(0deg);
}
}
}
.pp {
margin-bottom: 20rpx;
&.mb0 {
margin-bottom: 0;
}
.t1 {
width: 120rpx;
font-size: 24rpx;
color: #6e767a;
margin-right: 16rpx;
}
.t2 {
width: 73%;
font-size: 24rpx;
color: #404547;
}
.type {
width: 72rpx;
height: 36rpx;
border-radius: 4rpx;
border: 1px solid #197adb;
font-size: 24rpx;
color: #197adb;
margin-left: 28rpx;
}
}
}
.question-box {
padding: 0 24rpx;
background: #ffffff;
border-radius: 4rpx;
.top {
height: 87rpx;
.t1 {
width: 156rpx;
font-size: 24rpx;
color: #6e767a;
}
.el-select-box {
width: calc(100% - 156rpx);
.uni-input {
font-size: 24rpx;
color: #404547;
font-weight: bold;
}
}
}
.uni-table {
.uni-th {
height: 62rpx;
background: #f1f4f6;
border-top: 1px solid #cad9e0;
border-bottom: 1px solid #cad9e0;
text {
flex: 0 0 25%;
font-size: 22rpx;
color: #6e767a;
padding-left: 23rpx;
border-right: 1px solid #cad9e0;
&:last-child {
border-right: none;
}
}
}
.uni-tr {
height: 62rpx;
border-bottom: 1px solid #cad9e0;
.icon-a-Fill3{
font-size: 24rpx;
color: #6E767A;
}
.txt{
font-size: 22rpx;
color: #404547;
}
.uni-input{
font-size: 22rpx;
color: #404547;
}
.default{
width: 24rpx;
height: 24rpx;
border: 1px solid #D2DFE5;
border-radius: 50%;
}
.iconfont{
font-size: 24rpx;
color: #197ADB;
}
.w {
height: 100%;
flex: 0 0 25%;
padding-left: 23rpx;
border-right: 1px solid #cad9e0;
&:last-child {
border-right: none;
}
}
}
}
.upload-box {
position: relative;
z-index: 1;
padding-top: 23rpx;
padding-bottom: 24rpx;
.title {
margin-bottom: 24rpx;
.tt-l {
font-size: 24rpx;
color: #6e767a;
}
.tt-r {
font-size: 24rpx;
color: #404547;
}
}
.upload-list {
padding-bottom: 48rpx;
border-bottom: 1px solid #e6edf0;
.default {
width: 144rpx;
height: 144rpx;
background-color: #f1f4f6;
border: 1rpx solid #e6edf0;
.iconfont {
font-size: 48rpx;
color: #d8d8d8;
}
}
.pic-box {
position: relative;
flex: 0 0 25%;
margin-right: 10rpx;
&:nth-of-type(4n) {
margin-right: 0;
}
image {
width: 144rpx;
height: 144rpx;
}
.delete {
position: absolute;
right: 10rpx;
top: -13rpx;
width: 30rpx;
height: 30rpx;
border-radius: 50%;
background-color: #bb3434;
z-index: 999;
.iconfont {
font-size: 20rpx;
color: #ffffff;
}
}
}
}
.textarea-box {
position: relative;
padding-top: 23rpx;
height: 80rpx;
textarea {
font-size: 24rpx;
color: #6e767a;
}
.text {
position: absolute;
right: 0;
bottom: 0;
font-size: 24rpx;
color: #9ca8ad;
}
}
}
.textarea-box {
position: relative;
padding-top: 23rpx;
height: 137rpx;
textarea {
height: 100%;
font-size: 24rpx;
color: #6e767a;
}
.text {
position: absolute;
right: 0;
bottom: 24rpx;
font-size: 24rpx;
color: #9ca8ad;
}
}
}
.btn {
position: relative;
z-index: 2;
height: 88rpx;
background: #bb3434;
border-radius: 4rpx;
font-size: 28rpx;
color: #ffffff;
margin-top: 48rpx;
}
.rebtn {
height: 88rpx;
background: transparent;
font-size: 28rpx;
color: #197adb;
}
}
.deviceList {
padding: 24rpx 24rpx 0 24rpx;
.device-box {
padding: 0 24rpx;
height: 88rpx;
background: #ffffff;
border-radius: 4rpx;
.icon-juxing7 {
font-size: 36rpx;
color: #9ca8ad;
}
.t1 {
font-size: 28rpx;
color: #1e2021;
margin-left: 20rpx;
}
.close {
font-size: 28rpx;
color: #bb3434;
}
}
.title {
height: 92rpx;
padding-right: 24rpx;
.t1 {
font-size: 28rpx;
color: #1e2021;
}
.iconfont {
font-size: 36rpx;
color: #404547;
}
.t2 {
font-size: 22rpx;
color: #404547;
margin-left: 8rpx;
}
}
.list{
background: #FFFFFF;
border-radius: 4rpx;
.box{
margin: 0 24rpx;
height: 88rpx;
border-bottom: 1px solid #E6EDF0;
&:last-child{
border-bottom: none;
}
.t1{
font-size: 28rpx;
color: #1E2021;
}
.t2{
font-size: 26rpx;
color: #197ADB;
}
}
}
}
.print-index{
padding: 24rpx 24rpx 0 24rpx;
.device-box{
height: 88rpx;
background: #FFFFFF;
border-radius: 4rpx;
padding: 0 24rpx;
margin-bottom: 16rpx;
.t1{
font-size: 28rpx;
color: #1E2021;
margin-left: 20rpx ;
}
.t2{
font-size: 22rpx;
color: #6E767A;
margin-right: 14rpx ;
&.active{
color: #1E2021;
font-weight: bold;
}
}
.icon-juxing7{
font-size: 36rpx;
color: #9CA8AD;
}
.icon-sanjiaoxing2{
font-size: 20rpx;
color: #9CA8AD;
}
}
.print-form{
background: #FFFFFF;
border-radius: 4rpx;
......
......@@ -70,7 +70,27 @@
"style": {
"navigationBarTitleText": "理货列表"
}
},{
"path": "pages/goods/tallyExectionDetail",
"style": {
"navigationBarTitleText": "理货作业"
}
},{
"path": "pages/goods/tallyDetail",
"style": {
"navigationBarTitleText": "理货作业"
}
}, {
"path": "pages/goods/tallyQuestion",
"style": {
"navigationBarTitleText": "异常理货问客"
}
},{
"path": "pages/tag/deviceList",
"style": {
"navigationBarTitleText": "连接设备"
}
},{
"path": "pages/mine/login",
"style": {
"navigationBarTitleText": "登录"
......
......@@ -6,24 +6,24 @@
<text class="arrow row rowCenter verCenter"></text>
<text class="tt">基础信息</text>
</view>
<view class="toggle row verCenter">
<text class="iconfont icon-sanjiaoxing"></text>
<text class="tt">隐藏</text>
<view class="toggle row verCenter" @click="toggle()">
<text class="iconfont icon-sanjiaoxing" :class="{ rotate: flag }"></text>
<text class="tt">{{ flag ? '隐藏' : '展开' }}</text>
</view>
</view>
<view class="pp row verCenter">
<text class="t1">入仓号:</text>
<text class="t2">A123456</text>
</view>
<view class="pp row verCenter">
<view class="pp row verCenter" v-if="flag">
<text class="t1">订单时间:</text>
<text class="t2">2020/07/20 15:12</text>
</view>
<view class="pp row verCenter">
<view class="pp row verCenter" v-if="flag">
<text class="t1">订单客户:</text>
<text class="t2">富开香港有限公司</text>
</view>
<view class="pp row verCenter">
<view class="pp row verCenter" v-if="flag">
<text class="t1">供应商:</text>
<text class="t2">SAMSUNG SDI CO., LTD</text>
</view>
......@@ -46,9 +46,16 @@
<view class="box row verCenter">
<text class="label">收货方式</text>
<view class="tab row verCenter">
<view class="tab-panel row rowCenter verCenter curr">物流</view>
<view class="tab-panel row rowCenter verCenter">送货</view>
<view class="tab-panel row rowCenter verCenter">上门取货</view>
<view class="tab-panel row rowCenter verCenter" @click="changeTab(index, 1)" :class="{ curr: currentIndex == index }" v-for="(item, index) in textArr" :key="index">{{ item }}</view>
</view>
</view>
<view class="box row verCenter">
<text class="label">登记数量</text>
<view class="input-wrap row bothSide">
<input type="number" v-model="form.total_num" placeholder="请输入" class="uni-input" placeholder-style="color:#404547;font-weight:bold;"/>
<view class="tab row verCenter">
<view class="tab-panel row rowCenter verCenter" @click="changeTab(index, 2)" :class="{ curr: unitIndex == index }" v-for="(item, index) in unitArr" :key="index">{{ item }}</view>
</view>
</view>
</view>
<view class="box row verCenter">
......@@ -63,8 +70,8 @@
<view class="box row verCenter">
<text class="label">物流单号</text>
<view class="uni-input-box row bothSide">
<input type="text" class="uni-input" placeholder="请输入物流单号" placeholder-style="color:#404547;font-weight:bold;" />
<view class="scan-view row verCenter">
<input type="text" class="uni-input" placeholder="请输入物流单号" placeholder-style="color:#404547;font-weight:bold;" v-model="form.logistics_number" />
<view class="scan-view row verCenter" @click="scanChange()">
<text class="iconfont icon-juxing6"></text>
<text class="tt">扫描</text>
</view>
......@@ -73,53 +80,190 @@
<view class="upload-box">
<view class="title row bothSide verCenter">
<text class="tt-l">收货图片上传(选填)</text>
<text class="tt-r">2/4</text>
<text class="tt-r">{{ attachAddress.length }}/4</text>
</view>
<view class="upload-list row verCenter">
<view class="pic-box">
<image src="http://img.ichunt.com/images/ichunt/minProgram/scm/wms/202203/01/7778c9170eb7160d61dc5b10633f7865.png" mode="aspectFill"></image>
<view class="delete row rowCenter verCenter"><text class="iconfont icon-shanchu"></text></view>
</view>
<view class="pic-box">
<image src="http://img.ichunt.com/images/ichunt/minProgram/scm/wms/202203/01/7778c9170eb7160d61dc5b10633f7865.png" mode="aspectFill"></image>
<view class="delete row rowCenter verCenter"><text class="iconfont icon-shanchu"></text></view>
</view>
<view class="pic-box">
<image src="http://img.ichunt.com/images/ichunt/minProgram/scm/wms/202203/01/7778c9170eb7160d61dc5b10633f7865.png" mode="aspectFill"></image>
<view class="delete row rowCenter verCenter"><text class="iconfont icon-shanchu"></text></view>
</view>
<view class="default row rowCenter verCenter"><text class="iconfont icon-xingzhuangjiehe"></text></view>
<template v-if="attachAddress.length > 0">
<view class="pic-box" v-for="(v, index) in attachAddress" :key="index">
<image :src="v" mode="aspectFill" lazy-load="true" @click="previewChange(attachAddress, index)"></image>
<view class="delete row rowCenter verCenter" @click="deletePic(index)"><text class="iconfont icon-shanchu"></text></view>
</view>
</template>
<view class="default row rowCenter verCenter" @click="chooseImageChange()" v-if="attachAddress.length < 4"><text class="iconfont icon-xingzhuangjiehe"></text></view>
</view>
<view class="textarea-box">
<textarea placeholder="请输入收货备注" placeholder-style="color:#6E767A;"></textarea>
<text class="text">0/200</text>
<textarea @input="inputChange()" maxlength="200" placeholder="请输入收货备注" placeholder-style="color:#6E767A;" v-model="form.check_in_remark"></textarea>
<text class="text">{{ limitword }}/200</text>
</view>
</view>
</view>
<view class="btn row rowCenter verCenter">确认收货</view>
<view class="btn row rowCenter verCenter" @click="submit()">确认收货</view>
</view>
</template>
<script>
import { API } from '@/util/api.js';
import w_md5 from '../../js_sdk/zww-md5/w_md5.js';
export default {
data() {
return {
array: ['中国', '美国', '巴西', '日本'],
index: -1
array: ['京东', '顺丰', '中通'],
textArr: ['物流', '送货', '上门取货'],
unitArr: ['件', '箱'],
index: -1,
flag: false,
text: '展开',
currentIndex: 0,
unitIndex: 0,
limitword: 0,
id: '',
attachAddress: [],
form: {
delivery_method: 1,
logistics_company: '',
logistics_number: '',
total_num: '',
unit: '',
check_in_pic: '',
check_in_remark: '',
checkIn: ''
}
};
},
onLoad(options) {
//this.id = options.number;
},
watch: {},
onShow() {
this.getData();
},
methods: {
getData() {
this.request(API.getCheckInList, 'POST', { number: this.id }, this.loading).then(res => {
if (res.err_code === 0) {
this.form.checkIn = JSON.stringify(res.data[0]);
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
},
scanChange() {
uni.scanCode({
success: function(res) {
console.log(res);
if (res.errMsg == 'scanCode:ok') {
this.form.logistics_number = res.result;
}
},
fail: function(res) {
console.log(res);
uni.showToast({
title: '扫码失败',
icon: 'error'
});
}
});
},
previewChange(img, index) {
uni.previewImage({
current: index,
urls: img
});
},
deletePic(index) {
this.attachAddress.splice(index, 1);
},
chooseImageChange() {
var self = this;
var time = parseInt(new Date().getTime() / 1000);
uni.chooseImage({
count: 4,
sourceType: ['album', 'camera'],
success: chooseImageRes => {
uni.showLoading({
title: '上传中...'
});
const tempFilePaths = chooseImageRes.tempFilePaths;
let maxNum = tempFilePaths.length * 1 + self.attachAddress.length * 1;
if (maxNum > 4) {
uni.hideLoading();
uni.showToast({
title: '图片不超过4张'
});
return false;
}
for (let i = 0; i < tempFilePaths.length; i++) {
console.log(tempFilePaths[i]);
uni.uploadFile({
url: 'http://api.liexin.com/oss/upload',
filePath: tempFilePaths[i],
name: 'upload',
formData: {
source: '1',
k1: time,
k2: w_md5.hex_md5_32(w_md5.hex_md5_32(String(time)) + 'fh6y5t4rr351d2c3bryi')
},
success: uploadFileRes => {
uni.hideLoading();
var data = JSON.parse(uploadFileRes.data);
console.log(data);
if (data.code === 200) {
self.attachAddress.push(data.data[0]);
} else {
uni.showToast({
title: data.message,
icon: 'error'
});
}
},
fail: error => {
uni.hideLoading();
console.log(error);
}
});
}
}
});
},
inputChange() {
if (this.form.check_in_remark.length <= 200) {
this.limitword = this.form.check_in_remark.length;
}
},
changeTab(index, type) {
if (type == 1) {
this.currentIndex = index;
this.form.delivery_method = index + 1;
} else if (type == 2) {
this.unitIndex = index;
}
},
toggle() {
this.flag = !this.flag;
},
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.target.value);
this.index = e.target.value;
this.form.logistics_company = this.array[e.target.value];
},
getData() {
this.request(API.userInfo, 'POST', {}, false).then(res => {});
submit() {
this.request(API.addCheckIn, 'POST', this.form, true).then(res => {
if (res.err_code === 0) {
uni.showToast({
title: res.err_msg,
icon: 'success'
});
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
}
}
};
......
......@@ -5,16 +5,14 @@
<view class="search-input row bothSide verCenter">
<text class="iconfont icon-a-riqi11"></text>
<text class="iconfont icon-jinggao2" v-if="input_status" @click="clearInput()"></text>
<input type="text" @input="inputChange()" placeholder="请手动输入入仓号" class="uni-input" v-model="param.orderNo" />
<input type="text" @input="inputChange()" placeholder="请手动输入入仓号" class="uni-input" v-model="number" placeholder-style="color:#6e767a" />
<view class="more row verCenter" :class="{ curr: shade_flag }" @click="filterChange()">
<text class="t1">{{ shade_flag ? '更少条件' : '更多条件' }}</text>
<text class="iconfont icon-sanjiaoxing1 arrow"></text>
</view>
</view>
<view class="show-box" v-if="shade_flag">
<view class="input-time row verCenter">
<uni-datetime-picker @change="change" v-model="datetimerange" type="daterange" rangeSeparator="至" />
</view>
<view class="input-time row verCenter"><uni-datetime-picker @change="changeTimeRange" v-model="datetimerange" type="daterange" rangeSeparator="至" /></view>
<view class="row bottom bothSide">
<view class="btn row rowCenter verCenter" @click="submit()">查 询</view>
<view class="canel row rowCenter verCenter" @click="canel()">重 置</view>
......@@ -22,125 +20,124 @@
</view>
</view>
</view>
<view class="list">
<navigator class="box row bothSide verCenter" url="/pages/goods/addReceiving" hover-class="none">
<view class="bill-number color1 row rowCenter verCenter">A123456-01</view>
<view class="list" v-if="checkInList.length > 0">
<navigator class="box row bothSide verCenter" :url="'/pages/goods/addReceiving?number=' + item.number" hover-class="none" v-for="(item, index) in checkInList" :key="index">
<view class="bill-number row rowCenter verCenter" :class="numberType[index] ? 'color1' : 'color2'">{{ item.number }}</view>
<view>
<text class="t1">供应商:富开香港有限公司</text>
<text class="t1">供应商:{{ item.customer }}</text>
<view class="text">
<text class="p1">订单时间:</text>
<text class="p2 mr49">2020/07/20 15:12</text>
<text class="p2 mr49">{{ item.orderDate }}</text>
<text class="p1">商务:</text>
<text class="p2">周红丹</text>
<text class="p2">{{ item.businessPerson }}</text>
</view>
</view>
<text class="words-text">快递物流</text>
<text class="words-text">{{ item.delivery }}</text>
</navigator>
<view class="box row bothSide verCenter">
<view class="bill-number color2 row rowCenter verCenter">B123456-01</view>
<view>
<text class="t1">供应商:富开香港有限公司</text>
<view class="text">
<text class="p1">订单时间:</text>
<text class="p2 mr49">2020/07/20 15:12</text>
<text class="p1">商务:</text>
<text class="p2">周红丹</text>
</view>
</view>
<text class="words-text">上门取货</text>
</view>
<view class="box row bothSide verCenter">
<view class="bill-number color1 row rowCenter verCenter">B123456-01</view>
<view>
<text class="t1">供应商:富开香港有限公司</text>
<view class="text">
<text class="p1">订单时间:</text>
<text class="p2 mr49">2020/07/20 15:12</text>
<text class="p1">商务:</text>
<text class="p2">周红丹</text>
</view>
</view>
<text class="words-text">上门取货</text>
</view>
<view class="box row bothSide verCenter">
<view class="bill-number color1 row rowCenter verCenter">B123456-01</view>
<view>
<text class="t1">供应商:富开香港有限公司</text>
<view class="text">
<text class="p1">订单时间:</text>
<text class="p2 mr49">2020/07/20 15:12</text>
<text class="p1">商务:</text>
<text class="p2">周红丹</text>
</view>
</view>
<text class="words-text">快递物流</text>
</view>
<view class="box row bothSide verCenter">
<view class="bill-number color1 row rowCenter verCenter">B123456-01</view>
<view>
<text class="t1">供应商:富开香港有限公司</text>
<view class="text">
<text class="p1">订单时间:</text>
<text class="p2 mr49">2020/07/20 15:12</text>
<text class="p1">商务:</text>
<text class="p2">周红丹</text>
</view>
</view>
<text class="words-text">快递物流</text>
</view>
</view>
<template v-else>
<view class="no-data column verCenter rowCenter">
<text class="iconfont icon-jinggao2"></text>
<text class="text">查找不到相关信息</text>
<text class="p">1、请输入正确的入仓号</text>
</view>
</template>
<!-- 遮罩 -->
<view class="shade" v-if="shade_flag" @click="shade_flag = false"></view>
</view>
</template>
<script>
import { API } from '@/util/api.js';
import { API } from '@/util/api.js';
export default {
data() {
return {
flage: false,
shade_flag: false,
input_status: false,
date: '',
datetimerange: ['', ''],
};
export default {
data() {
return {
shade_flag: false,
input_status: false,
date: '',
datetimerange: ['', ''],
number: '',
total: 1,
page: 1,
limit: 100,
is_loading: false,
loading: false,
checkInList: [],
numberType: []
};
},
onReachBottom() {
if (this.is_loading) return;
this.page++;
this.loading = true;
this.getData();
},
onShow() {
this.getData();
},
methods: {
getData() {
this.request(API.getCheckInList, 'POST', { page: this.page, limit: this.limit, number: this.number, startDate: this.datetimerange[0], endDate: this.datetimerange[1] }, this.loading).then(res => {
if (res.err_code === 0) {
if (res.data.length > 0) {
this.is_loading = false;
this.checkInList = res.data;
//判断A单 B单
if (res.data.length > 0) {
for (let i = 0; i < res.data.length; i++) {
if (res.data[i].number.indexOf('B')) {
this.numberType.push(true);
} else {
this.numberType.push(false);
}
}
}
} else {
this.is_loading = true;
}
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
},
clearInput() {
this.input_status = false;
},
onShow() {
inputChange() {
this.total = 0;
this.page = 1;
this.checkInList = [];
this.getData();
},
methods: {
getData() {
this.request(API.userInfo, 'POST', {}, false).then(res => {
});
},
clearInput() {
this.input_status = false;
},
inputChange() {
},
filterChange() {
this.shade_flag = !this.shade_flag;
},
change(e) {
this.datetimerange = e;
this.getData();
},
submit() {
this.shade_flag = !this.shade_flag;
this.getData();
},
canel() {
this.shade_flag = !this.shade_flag;
this.getData();
}
filterChange() {
this.shade_flag = !this.shade_flag;
},
changeTimeRange(e) {
this.datetimerange = e;
this.total = 0;
this.page = 1;
this.checkInList = [];
this.getData();
},
submit() {
this.shade_flag = !this.shade_flag;
this.getData();
},
canel() {
this.page = 1;
this.datetimerange = ['', ''];
this.shade_flag = !this.shade_flag;
this.getData();
}
};
}
};
</script>
<style scoped lang="scss">
@import '../../assets/css/goods/receiving.scss';
@import '../../assets/css/goods/receiving.scss';
</style>
<template>
<view class="tally">
<view class="fix">
<view class="search-box">
<view class="search-input row bothSide verCenter">
<text class="iconfont icon-a-riqi11"></text>
<input type="text" @input="inputChange()" placeholder="请手动输入入仓号或扫描" class="uni-input" v-model="number" placeholder-style="color:#6e767a" />
<text class="scan iconfont icon-juxing6"></text>
</view>
</view>
</view>
<view class="tab row verCenter">
<view class="box row" @click="changeTab(index)" :class="{ curr: index == currentIndex }" :key="index" v-for="(item, index) in textArr">
<text class="t1">{{ item }}</text>
<text class="t2">({{ total }})</text>
</view>
</view>
<view class="list" v-if="checkInList.length > 0">
<navigator class="box row bothSide verCenter" :url="'/pages/goods/tallyDetail?number=' + item.number" hover-class="none" v-for="(item, index) in checkInList" :key="index">
<view class="bill-number row rowCenter verCenter" :class="numberType[index] ? 'color1' : 'color2'">{{ item.number }}</view>
<view>
<text class="t1">客户:{{ item.customer }}</text>
<view class="text">
<text class="p1">下单:</text>
<text class="p2 mr49">{{ item.orderDate }}</text>
<text class="p1">登记数量:</text>
<text class="p2">{{ item.businessPerson }}</text>
</view>
<view class="text">
<text class="p1">备注:</text>
<text class="p2">INV-9500148113这张里有个是光辉的,TRM</text>
</view>
</view>
<text class="words-text">{{ item.delivery }}</text>
</navigator>
</view>
<template v-else>
<view class="no-data column verCenter rowCenter">
<text class="iconfont icon-jinggao2"></text>
<text class="text">查找不到相关信息</text>
<text class="p">1、请输入正确的入仓号</text>
</view>
</template>
</view>
</template>
......@@ -10,15 +50,60 @@ import { API } from '@/util/api.js';
export default {
data() {
return {
currentIndex: 0,
date: '',
datetimerange: ['', ''],
textArr: ['等待理货', '理货异常'],
number: '',
total: 1,
page: 1,
limit: 100,
is_loading: false,
loading: false,
checkInList: [],
numberType: []
};
},
onReachBottom() {
if (this.is_loading) return;
this.page++;
this.loading = true;
this.getData();
},
onShow() {
this.getData();
},
methods: {
changeTab(index) {
this.currentIndex = index;
},
getData() {
this.request(API.userInfo, 'POST', {}, false).then(res => {});
this.request(API.getCheckInList, 'POST', { page: this.page, limit: this.limit, number: this.number, startDate: this.datetimerange[0], endDate: this.datetimerange[1] }, this.loading).then(res => {
if (res.err_code === 0) {
if (res.data.length > 0) {
this.is_loading = false;
this.checkInList = res.data;
//判断A单 B单
if (res.data.length > 0) {
for (let i = 0; i < res.data.length; i++) {
if (res.data[i].number.indexOf('B')) {
this.numberType.push(true);
} else {
this.numberType.push(false);
}
}
}
} else {
this.is_loading = true;
}
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
}
}
};
......
<template>
<view class="tallyDetail">
<view class="base-information">
<view class="top row bothSide verCenter">
<view class="title row verCenter">
<text class="arrow row rowCenter verCenter"></text>
<text class="tt">基础信息</text>
</view>
<view class="toggle row verCenter" @click="toggle()">
<text class="iconfont icon-sanjiaoxing" :class="{ rotate: flag }"></text>
<text class="tt">{{ flag ? '隐藏' : '展开' }}</text>
</view>
</view>
<view class="pp row verCenter">
<text class="t1">入仓号:</text>
<text class="t2" style="width: auto;">A123456</text>
<text class="type row rowCenter verCenter">商检</text>
</view>
<view class="pp row verCenter" v-if="flag">
<text class="t1">订单时间:</text>
<text class="t2">2021-11-02 15:17</text>
</view>
<view class="pp row verCenter" v-if="flag">
<text class="t1">订单客户:</text>
<text class="t2">富开香港有限公司</text>
</view>
<view class="pp row verCenter" v-if="flag">
<text class="t1">供应商:</text>
<text class="t2">SAMSUNG SDI CO., LTD</text>
</view>
<view class="pp row verCenter">
<text class="t1">登记数量:</text>
<text class="t2">1箱</text>
</view>
<view class="pp row">
<text class="t1">采购备注:</text>
<text class="t2">INV-9500148113这张里有个是光辉的,理货的人员记得看备注,多大200字符长度</text>
</view>
</view>
<view class="tally-base-information">
<view class="top row bothSide verCenter">
<view class="title row verCenter">
<text class="arrow row rowCenter verCenter"></text>
<text class="tt">理货基础信息</text>
</view>
</view>
<view class="list">
<view class="box">
<view class="pp row verCenter">
<view class="w row verCenter">
<text class="t1">规格型号:</text>
<text class="t2">962886-1</text>
</view>
<view class="w row verCenter">
<text class="t1">品牌:</text>
<text class="t2">Molex</text>
</view>
</view>
<view class="pp row verCenter">
<view class="w row verCenter">
<text class="t1">订单数量:</text>
<text class="t2">150,000</text>
</view>
<view class="w row verCenter">
<text class="t1">单位:</text>
<text class="t2"></text>
</view>
</view>
<view class="pp row verCenter">
<view class="w row verCenter">
<text class="t1">原产国:</text>
<text class="t2">吉尔吉斯斯坦</text>
</view>
<view class="w row verCenter">
<text class="t1">货物名称:</text>
<text class="t2">集成电路</text>
</view>
</view>
<view class="input-box row verCenter bothSide">
<view class="row verCenter">
<text class="t1">净重:</text>
<input type="text" placeholder="请输入" class="uni-input" />
</view>
<view class="photograph row rowCenter verCenter">拍照</view>
</view>
<image src="http://img.ichunt.com/images/ichunt/minProgram/scmMinProgram/wms/202203/08/d034765db26eb07075b2965dc96b8b35.png" mode="aspectFill" class="pic"></image>
</view>
<view class="box">
<view class="pp row verCenter">
<view class="w row verCenter">
<text class="t1">规格型号:</text>
<text class="t2">962886-1</text>
</view>
<view class="w row verCenter">
<text class="t1">品牌:</text>
<text class="t2">Molex</text>
</view>
</view>
<view class="pp row verCenter">
<view class="w row verCenter">
<text class="t1">订单数量:</text>
<text class="t2">150,000</text>
</view>
<view class="w row verCenter">
<text class="t1">单位:</text>
<text class="t2"></text>
</view>
</view>
<view class="pp row verCenter">
<view class="w row verCenter">
<text class="t1">原产国:</text>
<text class="t2">吉尔吉斯斯坦</text>
</view>
<view class="w row verCenter">
<text class="t1">货物名称:</text>
<text class="t2">集成电路</text>
</view>
</view>
<view class="input-box row verCenter bothSide">
<view class="row verCenter">
<text class="t1">净重:</text>
<input type="text" placeholder="请输入" class="uni-input" />
</view>
<view class="photograph row rowCenter verCenter">拍照</view>
</view>
<image src="http://img.ichunt.com/images/ichunt/minProgram/scmMinProgram/wms/202203/08/d034765db26eb07075b2965dc96b8b35.png" mode="aspectFill" class="pic"></image>
</view>
</view>
<navigator class="btn-submit row rowCenter verCenter" url="/pages/goods/tallyQuestion" hover-class="none">
<text class="t1">理货异常?</text>
<text class="t2">去提交</text>
</navigator>
<view class="receiving-information">
<view class="box row verCenter">
<text class="label">理货数量</text>
<view class="input-wrap row bothSide">
<input type="number" v-model="form.total_num" placeholder="请输入" class="uni-input" placeholder-style="color:#404547;font-weight:bold;" />
<view class="tab row verCenter">
<view class="tab-panel row rowCenter verCenter" @click="changeTab(index, 2)" :class="{ curr: currentIndex == index }" v-for="(item, index) in textArr" :key="index">{{ item }}</view>
</view>
</view>
</view>
<view class="box row verCenter">
<text class="label">毛重(KG)</text>
<view class="input-wrap row bothSide">
<input type="number" v-model="form.total_num" placeholder="请输入" class="uni-input" placeholder-style="color:#404547;font-weight:bold;" />
</view>
</view>
<view class="box row verCenter">
<text class="label">打印类型</text>
<view class="tab row verCenter">
<view class="tab-panel row rowCenter verCenter" @click="changeTab(index, 1)" :class="{ curr: currentIndex == index }" v-for="(item, index) in textArr" :key="index">{{ item }}</view>
</view>
</view>
<view class="box row verCenter">
<text class="label">总箱数</text>
<view class="input-wrap row bothSide">
<input type="number" v-model="form.total_num" placeholder="请输入" class="uni-input" placeholder-style="color:#404547;font-weight:bold;" />
</view>
</view>
<view class="textarea-box">
<textarea @input="inputChange()" maxlength="200" placeholder="请输入理货备注" placeholder-style="color:#6E767A;" v-model="form.check_in_remark"></textarea>
<text class="text">{{ limitword }}/200</text>
</view>
<view class="box row verCenter" style="border-bottom: none;">
<text class="label">放置托盘</text>
<view class="uni-list-cell-db">
<text class="iconfont icon-sanjiaoxing1"></text>
<picker @change="bindPickerChange" :value="index" :range="array">
<view class="uni-input">{{ array[index] || '请选择卡板信息' }}</view>
</picker>
</view>
</view>
</view>
</view>
<view class="btn row rowCenter verCenter" @click="submit()">确认收货</view>
</view>
</template>
<script>
import { API } from '@/util/api.js';
export default {
data() {
return {
flag: false,
index: -1,
currentIndex: 1,
textArr: ['件', '箱'],
array: ['京东', '顺丰', '中通'],
limitword: 0,
form: {
delivery_method: 1,
logistics_company: '',
logistics_number: '',
total_num: '',
unit: '',
check_in_pic: '',
check_in_remark: '',
checkIn: ''
}
};
},
onShow() {
this.getData();
},
methods: {
getData() {
this.request(API.getCheckInList, 'POST', { number: this.id }, this.loading).then(res => {
if (res.err_code === 0) {
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
},
inputChange() {
if (this.form.check_in_remark.length <= 200) {
this.limitword = this.form.check_in_remark.length;
}
},
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.target.value);
this.index = e.target.value;
this.form.logistics_company = this.array[e.target.value];
},
changeTab(index) {
this.currentIndex = index;
},
toggle() {
this.flag = !this.flag;
},
submit() {}
}
};
</script>
<style scoped lang="scss">
@import '../../assets/css/goods/tallyDetail.scss';
</style>
<template>
<view class="tallyExectionDetail"></view>
</template>
<script>
import { API } from '@/util/api.js';
export default {
data() {
return {};
},
onShow() {
this.getData();
},
methods: {
getData() {
this.request(API.getCheckInList, 'POST', {}).then(res => {
if (res.err_code === 0) {
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
}
}
};
</script>
<style scoped lang="scss">
@import '../../assets/css/goods/tallyExectionDetail.scss';
</style>
<template>
<view class="tallyDetail">
<view class="base-information">
<view class="top row bothSide verCenter">
<view class="title row verCenter">
<text class="arrow row rowCenter verCenter"></text>
<text class="tt">基础信息</text>
</view>
<view class="toggle row verCenter" @click="toggle()">
<text class="iconfont icon-sanjiaoxing" :class="{ rotate: flag }"></text>
<text class="tt">{{ flag ? '隐藏' : '展开' }}</text>
</view>
</view>
<view class="pp row verCenter">
<text class="t1">入仓号:</text>
<text class="t2" style="width: auto;">A123456</text>
<text class="type row rowCenter verCenter">商检</text>
</view>
<view class="pp row verCenter" v-if="flag">
<text class="t1">订单时间:</text>
<text class="t2">2021-11-02 15:17</text>
</view>
<view class="pp row verCenter" v-if="flag">
<text class="t1">订单客户:</text>
<text class="t2">富开香港有限公司</text>
</view>
<view class="pp row verCenter" v-if="flag">
<text class="t1">供应商:</text>
<text class="t2">SAMSUNG SDI CO., LTD</text>
</view>
<view class="pp row verCenter">
<text class="t1">登记数量:</text>
<text class="t2">1箱</text>
</view>
<view class="pp row">
<text class="t1">采购备注:</text>
<text class="t2">INV-9500148113这张里有个是光辉的,理货的人员记得看备注,多大200字符长度</text>
</view>
</view>
<view class="question-box">
<view class="top row verCenter">
<text class="t1">问题类型</text>
<view class="el-select-box">
<picker @change="bindPickerChange" :value="index" :range="array">
<view class="uni-input">{{ array[index] || '请选择' }}</view>
</picker>
</view>
</view>
<view class="uni-table">
<view class="uni-th row">
<text class="row verCenter">规格型号</text>
<text class="row verCenter">订单数量</text>
<text class="row verCenter">实到数量</text>
<text class="row verCenter">是否</text>
</view>
<view class="uni-tr row verCenter">
<text class="txt w row verCenter">962886-1</text>
<text class="txt w row verCenter">50,000</text>
<input type="text" placeholder="" v-model="d" class="w uni-input" />
<view class="w row verCenter">
<text class="default"></text>
</view>
</view>
<view class="uni-tr row">
<text class="txt w row verCenter">962886-1</text>
<text class="txt w row verCenter">50,000</text>
<input type="text" placeholder="" v-model="d" class="w uni-input" />
<text class="iconfont icon-bianzu w row verCenter"></text>
</view>
<view class="uni-tr row">
<text class="txt w row verCenter">962886-1</text>
<text class="txt w row verCenter">50,000</text>
<input type="text" placeholder="" v-model="d" class="w uni-input" />
<view class="w row verCenter">
<text class="default"></text>
</view>
</view>
</view>
<view class="upload-box">
<view class="title row bothSide verCenter">
<text class="tt-l">来货图片上传(必填)</text>
<text class="tt-r">{{ attachAddress.length }}/4</text>
</view>
<view class="upload-list row verCenter">
<template v-if="attachAddress.length > 0">
<view class="pic-box" v-for="(v, index) in attachAddress" :key="index">
<image :src="v" mode="aspectFill" lazy-load="true" @click="previewChange(attachAddress, index)"></image>
<view class="delete row rowCenter verCenter" @click="deletePic(index)"><text class="iconfont icon-shanchu"></text></view>
</view>
</template>
<view class="default row rowCenter verCenter" @click="chooseImageChange()" v-if="attachAddress.length < 4"><text class="iconfont icon-xingzhuangjiehe"></text></view>
</view>
</view>
<view class="textarea-box">
<textarea @input="inputChange()" maxlength="200" placeholder="请输入异常备注" placeholder-style="color:#6E767A;" v-model="form.check_in_remark"></textarea>
<text class="text">{{ limitword }}/200</text>
</view>
</view>
<view class="btn row rowCenter verCenter" @click="submit()">提交委托单问客</view>
<view class="rebtn row rowCenter verCenter">保存并继续添加问题</view>
</view>
</template>
<script>
import { API } from '@/util/api.js';
import w_md5 from '../../js_sdk/zww-md5/w_md5.js';
export default {
data() {
return {
d: '12',
flag: false,
limitword: 0,
index: -1,
attachAddress: [],
array: ['日本', '美国'],
form: {
check_in_remark: ''
}
};
},
onShow() {
this.getData();
},
methods: {
getData() {
this.request(API.getCheckInList, 'POST', { number: this.id }, this.loading).then(res => {
if (res.err_code === 0) {
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
},
previewChange(img, index) {
uni.previewImage({
current: index,
urls: img
});
},
deletePic(index) {
this.attachAddress.splice(index, 1);
},
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.target.value);
this.index = e.target.value;
},
chooseImageChange() {
var self = this;
var time = parseInt(new Date().getTime() / 1000);
uni.chooseImage({
count: 4,
sourceType: ['album', 'camera'],
success: chooseImageRes => {
uni.showLoading({
title: '上传中...'
});
const tempFilePaths = chooseImageRes.tempFilePaths;
let maxNum = tempFilePaths.length * 1 + self.attachAddress.length * 1;
if (maxNum > 4) {
uni.hideLoading();
uni.showToast({
title: '图片不超过4张'
});
return false;
}
for (let i = 0; i < tempFilePaths.length; i++) {
console.log(tempFilePaths[i]);
uni.uploadFile({
url: 'http://api.liexin.com/oss/upload',
filePath: tempFilePaths[i],
name: 'upload',
formData: {
source: '1',
k1: time,
k2: w_md5.hex_md5_32(w_md5.hex_md5_32(String(time)) + 'fh6y5t4rr351d2c3bryi')
},
success: uploadFileRes => {
uni.hideLoading();
var data = JSON.parse(uploadFileRes.data);
console.log(data);
if (data.code === 200) {
self.attachAddress.push(data.data[0]);
} else {
uni.showToast({
title: data.message,
icon: 'error'
});
}
},
fail: error => {
uni.hideLoading();
console.log(error);
}
});
}
}
});
},
inputChange() {
if (this.form.check_in_remark.length <= 200) {
this.limitword = this.form.check_in_remark.length;
}
},
submit() {}
}
};
</script>
<style scoped lang="scss">
@import '../../assets/css/goods/tallyQuestion.scss';
</style>
......@@ -12,7 +12,7 @@
</view>
</view>
<view class="show-box" v-if="shade_flag">
<view class="input-time row verCenter"><uni-datetime-picker @change="change" v-model="datetimerange" type="daterange" rangeSeparator="至" /></view>
<view class="input-time row verCenter"><uni-datetime-picker @change="changeTimeRange" v-model="datetimerange" type="daterange" rangeSeparator="至" /></view>
<view class="row bottom bothSide">
<view class="btn row rowCenter verCenter" @click="submit()">查 询</view>
<view class="canel row rowCenter verCenter" @click="canel()">重 置</view>
......@@ -90,12 +90,14 @@ export default {
total: 1,
page: 1,
limit: 10,
is_loading: false
is_loading: false,
loading: false
};
},
onReachBottom() {
if (this.is_loading) return;
this.page++;
this.loading=true;
this.getData();
},
onShow() {
......@@ -103,9 +105,10 @@ export default {
},
methods: {
getData() {
this.request(API.warehouseOperationList, 'POST', { page: this.page, limit: this.limit, erp_order_sn: this.erp_order_sn, begin_time: this.datetimerange[0], end_time: this.datetimerange[1] }, false).then(res => {
this.request(API.warehouseOperationList, 'POST', { page: this.page, limit: this.limit, erp_order_sn: this.erp_order_sn, begin_time: this.datetimerange[0], end_time: this.datetimerange[1] }, this.loading).then(res => {
if (res.err_code === 0) {
if (res.data.data.length > 0) {
this.is_loading = false;
this.warehouseOperation = this.warehouseOperation.concat(res.data.data);
this.total = res.data.total;
} else {
......@@ -134,8 +137,11 @@ export default {
filterChange() {
this.shade_flag = !this.shade_flag;
},
change(e) {
changeTimeRange(e) {
this.datetimerange = e;
this.total = 0;
this.page = 1;
this.warehouseOperation = [];
this.getData();
},
submit() {
......
......@@ -85,17 +85,21 @@ export default {
weonlt_id: '', //仓内作业列表ID
operation_img: [], //作业图片
actual_operation_num: [], //作业数量 来自 instructions_num
weondl_ids: [] //仓内作业详情ID
weondl_ids: [], //仓内作业详情ID,
noexebshowFalg: true //控制是否会触发生命周期
};
},
onLoad(options) {
this.weonlt_id = options.weonlt_id;
},
onShow() {
this.getData();
if (this.noexebshowFalg) {
this.getData();
}
},
methods: {
clickImg(img, index) {
this.noexebshowFalg = false; //不允许再次触发onshow这个生命周期
uni.previewImage({
current: index,
urls: img
......
<template>
<view class="deviceList">
<view class="device-box row verCenter bothSide">
<template v-if="status">
<view class="row verCenter">
<text class="iconfont icon-juxing7"></text>
<text class="t1">已连接设备: {{ deviceName }}</text>
</view>
</template>
<template v-else>
<view class="row verCenter">
<text class="iconfont icon-juxing7"></text>
<text class="t1">未连接设备</text>
</view>
</template>
<text class="close" v-if="status" @click="closeBLEConnection()">断开连接</text>
</view>
<view class="title row verCenter bothSide">
<text class="t1">搜索到蓝牙设备</text>
<view class="row verCenter" @click="refresh()">
<text class="iconfont icon-a-juxing12"></text>
<text class="t2">刷新</text>
</view>
</view>
<view class="list">
<view class="box row verCenter bothSide" v-for="(item, index) in list" :key="index" @click="connectChange(item.name, item.deviceId, index)">
<text class="t1">{{ item.name }}</text>
<text class="t2">连接</text>
</view>
</view>
</view>
</template>
<script>
import { API } from '@/util/api.js';
export default {
data() {
return {
status: false,
deviceName: '',
list: [],
isOpenBle: false,
deviceId: ''
};
},
onLoad() {
//在页面加载时候初始化蓝牙适配器
uni.openBluetoothAdapter({
success: e => {
console.log('初始化蓝牙成功:' + e.errMsg);
this.isOpenBle = true;
console.log(this.isOpenBle);
// 初始化完毕开始搜索
this.startBluetoothDeviceDiscovery();
},
fail: e => {
console.log('初始化蓝牙失败,错误码:' + (e.errCode || e.errMsg));
wx.showModal({
title: '提示',
content: '蓝牙初始化失败,请到设置打开蓝牙',
showCancel: false
});
}
});
},
methods: {
startBluetoothDeviceDiscovery() {
uni.showLoading({
title: '搜索蓝牙设备',
mask: true
});
//在页面显示的时候判断是都已经初始化完成蓝牙适配器若成功,则开始查找设备
let self = this;
setTimeout(function() {
if (self.isOpenBle) {
console.log('开始搜寻智能设备');
uni.startBluetoothDevicesDiscovery({
success: res => {
self.onBluetoothDeviceFound();
},
fail: res => {
uni.hideLoading();
console.log('查找设备失败!');
uni.showToast({
icon: 'none',
title: '查找设备失败!',
duration: 3000
});
}
});
} else {
console.log('未初始化蓝牙是配饰器:' + self.isOpenBle);
}
}, 300);
},
/**
/**
* 发现外围设备
*/
onBluetoothDeviceFound() {
console.log('监听寻找新设备');
// this.getBluetoothDevices();
uni.onBluetoothDeviceFound(el => {
console.log('开始监听寻找到新设备的事件');
this.getBluetoothDevices();
});
},
/**
* 获取在蓝牙模块生效期间所有已发现的蓝牙设备。包括已经和本机处于连接状态的设备。
*/
getBluetoothDevices() {
console.log('获取蓝牙设备');
uni.getBluetoothDevices({
success: res => {
console.log('获取蓝牙设备成功:' + res.errMsg);
console.log(res);
var devices = [];
var num = 0;
for (var i = 0; i < res.devices.length; i++) {
if (res.devices[i].name != '未知设备') {
devices[num] = res.devices[i];
num++;
}
}
this.list = devices;
if (this.list.length > 0) {
uni.hideLoading();
}
}
});
},
/**
* 停止搜索蓝牙设备
*/
stopBluetoothDevicesDiscovery() {
//成功找到对应蓝牙设备后 停止搜寻附近的蓝牙外围设备
let that = this;
uni.stopBluetoothDevicesDiscovery({
success(res) {
console.log('停止搜索', JSON.stringify(res.errMsg));
that.getBLEDeviceServices();
}
});
},
getBLEDeviceServices() {
//来获取蓝牙设备所有服务
uni.createBLEConnection({
deviceId: this.deviceId,
success: res => {
console.log('连接成功', JSON.stringify(res.errMsg));
this.status = true;
uni.hideLoading();
}
});
},
connectChange(name, deviceId) {
uni.showLoading({
title: '连接设备中'
});
uni.closeBLEConnection({
deviceId: this.deviceId,
success: res => {
console.log('断开蓝牙连接:', JSON.stringify(res.errMsg));
this.deviceName = name;
this.deviceId = deviceId;
uni.setStorageSync('device', { name: name, deviceId: deviceId });
this.stopBluetoothDevicesDiscovery();
}
});
},
refresh() {
uni.stopBluetoothDevicesDiscovery({
success: res => {
console.log('停止搜索', JSON.stringify(res.errMsg));
this.list = [];
this.startBluetoothDeviceDiscovery();
}
});
},
closeBLEConnection() {
uni.closeBLEConnection({
deviceId: this.deviceId,
success: res => {
console.log('断开蓝牙连接:', JSON.stringify(res.errMsg));
this.status = false;
this.deviceId = '';
this.deviceName = '';
}
});
}
}
};
</script>
<style scoped lang="scss">
@import '../../assets/css/tag/deviceList.scss';
</style>
<template>
<view class="print-index">
<navigator class="device-box row bothSide verCenter" url="/pages/tag/deviceList">
<view class="row verCenter">
<text class="iconfont icon-juxing7"></text>
<text class="t1">连接设备</text>
</view>
<view class="row verCenter">
<template v-if="device_name != ''">
<text class="t2 active">{{ device_name }}</text>
</template>
<template v-else>
<text class="t2">未连接</text>
</template>
<text class="iconfont icon-sanjiaoxing2"></text>
</view>
</navigator>
<view class="print-form">
<view class="box row verCenter">
<view class="label">订单类型</view>
......@@ -35,321 +50,334 @@
</template>
<script>
import { API } from '@/util/api.js';
const ToBase64 = require('../../util/base64gb2312.js');
import { API } from '@/util/api.js';
const ToBase64 = require('../../util/base64gb2312.js');
export default {
data() {
return {
print_number: 0,
serviceId: '',
deviceId: '',
characteristics: '',
text: '总箱数',
index: -1,
index_erp_order_sn_pre: -1,
index_print_type: 0,
items_erp_order_sn_pre: ['A单号', 'B单号', 'D单号'],
items_print_type: ['卡板', '散箱'],
traySelectOption: [],
sendData64: '',
printLabelData: [],
print_text: '总箱数',
form: {
erp_order_sn_pre: '',
print_type: 1,
erp_order_sn_number: '',
label_num: '1',
tray_remark: ''
export default {
data() {
return {
print_number: 0,
serviceId: '',
deviceId: '',
characteristics: '',
text: '总箱数',
index: -1,
index_erp_order_sn_pre: -1,
index_print_type: 0,
items_erp_order_sn_pre: ['A单号', 'B单号', 'D单号'],
items_print_type: ['卡板', '散箱'],
traySelectOption: [],
sendData64: '',
printLabelData: [],
print_text: '总箱数',
device_name: '',
form: {
erp_order_sn_pre: '',
print_type: 1,
erp_order_sn_number: '',
label_num: '1',
tray_remark: ''
}
};
},
onShow() {
const deviceData = uni.getStorageSync('device') || '';
if (deviceData) {
this.deviceId = deviceData.deviceId;
this.device_name = deviceData.name;
}
},
created() {
this.getTraySelectOption();
},
methods: {
getTraySelectOption() {
this.request(API.getTraySelectOption, 'POST', {}, false).then(res => {
if (res.err_code === 0) {
this.traySelectOption = res.data;
let token = uni.getStorageSync('token');
let tray_sn_index = uni.getStorageSync('tray_sn_index');
let tray_sn_value = uni.getStorageSync('tray_sn_value');
if (token) {
this.index = tray_sn_index;
this.form.tray_remark = tray_sn_value;
}
}
};
});
},
created() {
this.getTraySelectOption();
bindPickerChange: function(e) {
this.index = e.target.value;
this.form.tray_remark = this.traySelectOption[e.target.value].wstylt_id;
uni.setStorageSync('tray_sn_index', this.index);
uni.setStorageSync('tray_sn_value', this.traySelectOption[e.target.value].wstylt_id);
},
methods: {
getTraySelectOption() {
this.request(API.getTraySelectOption, 'POST', {}, false).then(res => {
if (res.err_code === 0) {
this.traySelectOption = res.data;
let token = uni.getStorageSync('token');
let tray_sn_index = uni.getStorageSync('tray_sn_index');
let tray_sn_value = uni.getStorageSync('tray_sn_value');
if (token) {
this.index = tray_sn_index;
this.form.tray_remark = tray_sn_value;
}
}
submit() {
if (!this.form.erp_order_sn_pre) {
uni.showToast({
icon: 'error',
title: '请选择订单类型'
});
},
bindPickerChange: function(e) {
this.index = e.target.value;
this.form.tray_remark = this.traySelectOption[e.target.value].wstylt_id;
uni.setStorageSync('tray_sn_index', this.index);
uni.setStorageSync('tray_sn_value', this.traySelectOption[e.target.value].wstylt_id);
},
submit() {
if (!this.form.erp_order_sn_pre) {
uni.showToast({
icon: 'error',
title: '请选择订单类型'
});
return false;
}
if (!this.form.erp_order_sn_number) {
return false;
}
if (!this.form.erp_order_sn_number) {
uni.showToast({
icon: 'error',
title: '请输入入仓号'
});
return false;
}
if (!/(^[0-9]*$)/.test(this.form.erp_order_sn_number)) {
uni.showToast({
icon: 'error',
title: '入仓号为纯数字'
});
return false;
}
if (!this.form.label_num) {
uni.showToast({
icon: 'error',
title: '请输入' + this.text
});
return false;
}
if (!/(^[0-9]*$)/.test(this.form.label_num)) {
uni.showToast({
icon: 'error',
title: this.text + '为纯数字'
});
return false;
}
if (!this.form.tray_remark) {
uni.showToast({
icon: 'error',
title: '请选择放置托盘'
});
return false;
}
this.request(API.printLabel, 'POST', this.form, false).then(res => {
if (res.err_code === 0) {
this.printLabelData = res.data;
if (!this.device_name) {
uni.showToast({
icon: 'error',
title: '请连接蓝牙设备'
});
} else {
this.getBLEDeviceServices();
}
} else {
uni.showToast({
icon: 'error',
title: '请输入入仓号'
title: res.err_msg,
icon: 'error'
});
return false;
}
if (!/(^[0-9]*$)/.test(this.form.erp_order_sn_number)) {
});
},
openBluetoothAdapter() {
//先查看系统蓝牙状态
let that = this;
uni.openBluetoothAdapter({
success(res) {
that.startBluetoothDevicesDiscovery();
},
fail() {
uni.showToast({
icon: 'error',
title: '入仓号为纯数字'
title: '请打开蓝牙',
icon: 'error'
});
return false;
}
if (!this.form.label_num) {
uni.showToast({
icon: 'error',
title: '请输入' + this.text
});
},
startBluetoothDevicesDiscovery() {
//搜索附近的蓝牙设备并且监听寻找到新设备的事件
let that = this;
uni.startBluetoothDevicesDiscovery({
success: function(res) {
console.log('搜索设备start', JSON.stringify(res.errMsg));
uni.onBluetoothDeviceFound(function(el) {
//找到对应蓝牙设备名字
if (el.devices[0].name == that.device_name) {
that.deviceId = el.devices[0].deviceId; //成功后存储设备id
that.stopBluetoothDevicesDiscovery(); //关闭搜索
console.log('成功搜索设备', el.devices[0].deviceId);
}
});
return false;
}
if (!/(^[0-9]*$)/.test(this.form.label_num)) {
},
fail: function() {
uni.hideLoading();
uni.showToast({
icon: 'error',
title: this.text + '为纯数字'
title: '请断开蓝牙,重新连接',
icon: 'error'
});
return false;
}
if (!this.form.tray_remark) {
uni.showToast({
icon: 'error',
title: '请选择放置托盘'
});
return false;
});
},
stopBluetoothDevicesDiscovery() {
//成功找到对应蓝牙设备后 停止搜寻附近的蓝牙外围设备
let that = this;
uni.stopBluetoothDevicesDiscovery({
success(res) {
console.log('停止搜索', JSON.stringify(res.errMsg));
that.getBLEDeviceServices();
}
this.request(API.printLabel, 'POST', this.form, false).then(res => {
if (res.err_code === 0) {
this.printLabelData = res.data;
this.openBluetoothAdapter();
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
},
openBluetoothAdapter() {
//先查看系统蓝牙状态
let that = this;
uni.openBluetoothAdapter({
success(res) {
that.startBluetoothDevicesDiscovery();
},
fail() {
uni.showToast({
title: '请打开蓝牙',
icon: 'error'
});
}
});
},
startBluetoothDevicesDiscovery() {
//搜索附近的蓝牙设备并且监听寻找到新设备的事件
let that = this;
uni.showLoading({
title: '连接设备中',
mask: true
});
uni.startBluetoothDevicesDiscovery({
success: function(res) {
console.log('搜索设备start', JSON.stringify(res.errMsg));
uni.onBluetoothDeviceFound(function(el) {
//找到对应蓝牙设备名字
if (el.devices[0].name == 'HM-A300-647a') {
that.deviceId = el.devices[0].deviceId; //成功后存储设备id
that.stopBluetoothDevicesDiscovery(); //关闭搜索
console.log("成功搜索设备", el.devices[0].deviceId);
});
},
getBLEDeviceServices() {
//来获取蓝牙设备所有服务
let that = this;
uni.showLoading({
title: '连接设备中...'
});
uni.createBLEConnection({
deviceId: this.deviceId,
success: res => {
console.log('连接成功', JSON.stringify(res.errMsg));
//需延时连接,不然会报错
setTimeout(() => {
uni.getBLEDeviceServices({
deviceId: that.deviceId,
success: res => {
console.log('获取蓝牙设备所有服务', JSON.stringify(res.errMsg));
that.serviceId = res.services[0].uuid;
that.getBLEDeviceCharacteristics();
}
});
},
fail: function() {
uni.hideLoading();
uni.showToast({
title: '请断开蓝牙,重新连接',
icon: 'error'
});
}
});
},
stopBluetoothDevicesDiscovery() {
//成功找到对应蓝牙设备后 停止搜寻附近的蓝牙外围设备
let that = this;
uni.stopBluetoothDevicesDiscovery({
success(res) {
console.log('停止搜索', JSON.stringify(res.errMsg));
that.getBLEDeviceServices();
}
});
},
getBLEDeviceServices() {
//来获取蓝牙设备所有服务
let that = this;
uni.createBLEConnection({
deviceId: this.deviceId,
success: res => {
console.log('连接成功', JSON.stringify(res.errMsg));
//需延时连接,不然会报错
setTimeout(() => {
uni.getBLEDeviceServices({
deviceId: that.deviceId,
success: res => {
console.log('获取蓝牙设备所有服务', JSON.stringify(res.errMsg));
that.serviceId = res.services[0].uuid;
that.getBLEDeviceCharacteristics();
}
});
}, 1000)
}
});
},
getBLEDeviceCharacteristics() {
//获取蓝牙设备某个服务中所有特征值
let that = this;
uni.getBLEDeviceCharacteristics({
deviceId: that.deviceId,
serviceId: that.serviceId,
success: res => {
that.characteristics = res.characteristics[0].uuid;
}, 1000);
}
});
},
getBLEDeviceCharacteristics() {
//获取蓝牙设备某个服务中所有特征值
let that = this;
uni.getBLEDeviceCharacteristics({
deviceId: that.deviceId,
serviceId: that.serviceId,
success: res => {
that.characteristics = res.characteristics[0].uuid;
that.sendDataChange();
console.log('服务功能特征值', JSON.stringify(res.errMsg));
},
fail: res => {
console.log('失败', res);
}
});
},
sendDataChange() {
console.log('第' + this.print_number + '次打印');
//发送数据 二进制
let data = [];
if (this.printLabelData.length > 0) {
data.push('! 60 200 200 250 1\r\n');
data.push('T 8 0 10 20 入仓号:' + this.printLabelData[this.print_number].erp_order_sn + '\r\n');
if (this.form.print_type == 1) {
data.push('T 8 0 10 70 总箱数:' + this.printLabelData[this.print_number].label_num + '箱\r\n');
} else {
data.push('T 8 0 10 70 箱号:' + this.printLabelData[this.print_number].label_sort + '/' + this.printLabelData[this.print_number].label_num + '\r\n');
}
data.push('T 8 0 10 120 时间:' + this.printLabelData[this.print_number].create_time_cn + '\r\n');
data.push('T 8 0 10 170 仓库代码:' + this.printLabelData[this.print_number].warehouse_code + '\r\n');
data.push('T 8 0 10 220 流水号:' + this.printLabelData[this.print_number].wstyptll_id_sn + '\r\n');
data.push('B QR 260 20 M 2 U 8\r\n');
data.push('MA,' + this.printLabelData[this.print_number].erp_order_sn + '#\r\n');
data.push('ENDQR\r\n');
data.push('FORM\r\n');
data.push('PRINT\r\n');
}
let arrayBuffer = uni.base64ToArrayBuffer(ToBase64.encode64gb2312(data.join('')));
this.sendData64 = arrayBuffer;
this.writeBLECharacteristicValue();
console.log(data.join(''));
},
writeBLECharacteristicValue() {
//写入二进制数据
let that = this;
uni.writeBLECharacteristicValue({
deviceId: that.deviceId,
serviceId: that.serviceId,
characteristicId: that.characteristics,
value: that.sendData64,
success(res) {
that.print_number++;
console.log('蓝牙写入成功:', JSON.stringify(res.errMsg));
console.log('打印计数:' + that.print_number);
if (that.print_number < that.printLabelData.length) {
that.sendDataChange();
console.log('服务功能特征值', JSON.stringify(res.errMsg));
},
fail: res => {
console.log('失败', res);
}
});
},
sendDataChange() {
console.log('第' + this.print_number + '次打印');
//发送数据 二进制
let data = [];
if (this.printLabelData.length > 0) {
data.push("! 60 200 200 250 1\r\n");
data.push("T 8 0 10 20 入仓号:" + this.printLabelData[this.print_number].erp_order_sn + "\r\n");
if (this.form.print_type == 1) {
data.push("T 8 0 10 70 总箱数:" + this.printLabelData[this.print_number].label_num + "箱\r\n");
} else {
data.push("T 8 0 10 70 箱号:" + this.printLabelData[this.print_number].label_sort + '/' + this.printLabelData[this.print_number].label_num + "\r\n");
}
data.push("T 8 0 10 120 时间:" + this.printLabelData[this.print_number].create_time_cn + "\r\n");
data.push("T 8 0 10 170 仓库代码:" + this.printLabelData[this.print_number].warehouse_code + "\r\n");
data.push("T 8 0 10 220 流水号:" + this.printLabelData[this.print_number].wstyptll_id_sn + "\r\n");
data.push("B QR 260 20 M 2 U 8\r\n");
data.push("MA," + this.printLabelData[this.print_number].erp_order_sn + "#\r\n");
data.push("ENDQR\r\n");
data.push("FORM\r\n");
data.push("PRINT\r\n");
}
let arrayBuffer = uni.base64ToArrayBuffer(ToBase64.encode64gb2312(data.join('')));
this.sendData64 = arrayBuffer;
this.writeBLECharacteristicValue();
console.log(data.join(''))
},
writeBLECharacteristicValue() {
//写入二进制数据
let that = this;
uni.writeBLECharacteristicValue({
deviceId: that.deviceId,
serviceId: that.serviceId,
characteristicId: that.characteristics,
value: that.sendData64,
success(res) {
that.print_number++;
console.log('蓝牙写入成功:', JSON.stringify(res.errMsg))
console.log('打印计数:' + that.print_number)
if (that.print_number < that.printLabelData.length) {
that.sendDataChange();
} else {
uni.hideLoading();
uni.closeBLEConnection({
deviceId: that.deviceId,
success(res) {
console.log('关闭蓝牙连接:', JSON.stringify(res.errMsg));
//清空数据
that.print_number = 0;
that.printLabelData = [];
that.sendData64 = '';
uni.showModal({
title: '提示',
content: '提交成功,请查看标签打印机',
showCancel: false,
confirmText: '关闭',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
})
}
},
fail() {
uni.hideLoading();
uni.showModal({
title: '提示',
content: '无法打印,请查看标签打印机连接状态',
showCancel: false,
confirmText: '关闭',
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
console.log('用户点击取消');
}
uni.closeBLEConnection({
deviceId: that.deviceId,
success(res) {
console.log('关闭蓝牙连接:', JSON.stringify(res.errMsg));
//清空数据
that.print_number = 0;
that.printLabelData = [];
that.sendData64 = '';
uni.showModal({
title: '提示',
content: '提交成功,请查看标签打印机',
showCancel: false,
confirmText: '关闭',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
});
}
})
},
change(index, type) {
if (type == 'erp_order_sn_pre') {
//订单类型
this.index_erp_order_sn_pre = index;
if (index == 0) {
this.form.erp_order_sn_pre = 'A';
} else if (index == 1) {
this.form.erp_order_sn_pre = 'B';
} else if (index == 2) {
this.form.erp_order_sn_pre = 'D';
}
} else if (type == 'print_type') {
//打印类型
this.index_print_type = index;
if (index == 0) {
this.form.print_type = 1;
this.text = '总箱数';
this.print_text = '总箱数';
} else if (index == 1) {
this.form.print_type = 2;
this.text = '标签数量';
this.print_text = '箱号';
}
},
fail() {
uni.hideLoading();
uni.showModal({
title: '提示',
content: '无法打印,请查看标签打印机连接状态',
showCancel: false,
confirmText: '关闭',
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
});
},
change(index, type) {
if (type == 'erp_order_sn_pre') {
//订单类型
this.index_erp_order_sn_pre = index;
if (index == 0) {
this.form.erp_order_sn_pre = 'A';
} else if (index == 1) {
this.form.erp_order_sn_pre = 'B';
} else if (index == 2) {
this.form.erp_order_sn_pre = 'D';
}
} else if (type == 'print_type') {
//打印类型
this.index_print_type = index;
if (index == 0) {
this.form.print_type = 1;
this.text = '总箱数';
this.print_text = '总箱数';
} else if (index == 1) {
this.form.print_type = 2;
this.text = '标签数量';
this.print_text = '箱号';
}
}
}
};
}
};
</script>
<style scoped lang="scss">
@import '../../assets/css/tag/print.scss';
@import '../../assets/css/tag/print.scss';
</style>
......@@ -21,322 +21,349 @@
</template>
<script>
import { API } from '@/util/api.js';
import { getPlatform } from '@/util/util.js'
const ToBase64 = require('../../util/base64gb2312.js');
import { API } from '@/util/api.js';
import { getPlatform } from '@/util/util.js';
const ToBase64 = require('../../util/base64gb2312.js');
export default {
data() {
return {
print_number: 0,
serviceId: '',
deviceId: '',
characteristics: '',
text: '标签数量',
index_erp_order_sn_pre: -1,
items_erp_order_sn_pre: ['A单号', 'B单号', 'D单号'],
sendData64: '',
platform: 'android',
printLabelData: [],
print_text: '总箱数',
print_type: 1,
form: {
erp_order_sn_pre: '',
erp_order_sn_number: '',
label_sort: ''
}
};
export default {
data() {
return {
print_number: 0,
serviceId: '',
deviceId: '',
characteristics: '',
text: '标签数量',
index_erp_order_sn_pre: -1,
items_erp_order_sn_pre: ['A单号', 'B单号', 'D单号'],
sendData64: '',
platform: 'android',
printLabelData: [],
print_text: '总箱数',
print_type: 1,
form: {
erp_order_sn_pre: '',
erp_order_sn_number: '',
label_sort: ''
}
};
},
methods: {
onKeyInput: function(event) {
if (event.target.value.length > 3) {
this.getErpOrderSnPrintLabelType();
}
},
methods: {
onKeyInput: function(event) {
if (event.target.value.length > 3) {
this.getErpOrderSnPrintLabelType();
}
},
getErpOrderSnPrintLabelType() {
this.request(API.getErpOrderSnPrintLabelType, 'POST', { erp_order_sn: this.form.erp_order_sn_pre + this.form.erp_order_sn_number }, false).then(res => {
if (res.err_code === 0) {
if (res.data == 1) {
this.text = '标签数量';
this.print_type = 2;
} else {
this.text = '子箱号';
this.print_type = 1;
}
getErpOrderSnPrintLabelType() {
this.request(API.getErpOrderSnPrintLabelType, 'POST', { erp_order_sn: this.form.erp_order_sn_pre + this.form.erp_order_sn_number }, false).then(res => {
if (res.err_code === 0) {
if (res.data == 1) {
this.text = '标签数量';
this.print_type = 2;
} else {
this.text = '子箱号';
this.print_type = 1;
}
}
});
},
submit() {
if (!this.form.erp_order_sn_pre) {
uni.showToast({
icon: 'error',
title: '请选择订单类型'
});
},
submit() {
if (!this.form.erp_order_sn_pre) {
return false;
}
if (!this.form.erp_order_sn_number) {
uni.showToast({
icon: 'error',
title: '请输入入仓号'
});
return false;
}
if (!/(^[0-9]*$)/.test(this.form.erp_order_sn_number)) {
uni.showToast({
icon: 'error',
title: '入仓号为纯数字'
});
return false;
}
if (!this.form.label_sort) {
uni.showToast({
icon: 'error',
title: '请输入' + this.text
});
return false;
}
if (!/(^[0-9]*$)/.test(this.form.label_sort)) {
uni.showToast({
icon: 'error',
title: this.text + '为纯数字'
});
return false;
}
this.request(API.getPrintLabel, 'POST', { erp_order_sn: this.form.erp_order_sn_pre + this.form.erp_order_sn_number, label_sort: this.form.label_sort }, true).then(res => {
if (res.err_code === 0) {
this.printLabelData = res.data;
this.openBluetoothAdapter();
} else {
uni.showToast({
icon: 'error',
title: '请选择订单类型'
title: res.err_msg,
icon: 'error'
});
return false;
}
if (!this.form.erp_order_sn_number) {
});
},
openBluetoothAdapter() {
//先查看系统蓝牙状态
let that = this;
uni.openBluetoothAdapter({
success(res) {
that.startBluetoothDevicesDiscovery();
},
fail() {
uni.showToast({
icon: 'error',
title: '请输入入仓号'
title: '请打开蓝牙',
icon: 'error'
});
return false;
}
});
},
startBluetoothDevicesDiscovery() {
//搜索附近的蓝牙设备并且监听寻找到新设备的事件
let that = this;
uni.showLoading({
title: '连接设备中',
mask: true
});
uni.startBluetoothDevicesDiscovery({
success: function(res) {
console.log('搜索设备start', res);
uni.onBluetoothDeviceFound(function(el) {
//找到对应蓝牙设备名字
if (el.devices[0].name == 'HM-A300-647a') {
that.deviceId = el.devices[0].deviceId; //成功后存储设备id
that.stopBluetoothDevicesDiscovery(); //关闭搜索
console.log('成功搜索设备', el);
console.log(el.devices[0].deviceId);
}
if (!/(^[0-9]*$)/.test(this.form.erp_order_sn_number)) {
uni.showToast({
icon: 'error',
title: '入仓号为纯数字'
});
return false;
}
//找到对应蓝牙设备名字
if (el.devices[0].name == 'HM-A300-9fb6') {
that.deviceId = el.devices[0].deviceId; //成功后存储设备id
that.stopBluetoothDevicesDiscovery(); //关闭搜索
console.log('成功搜索设备', el.devices[0].deviceId);
}
if (!this.form.label_sort) {
uni.showToast({
icon: 'error',
title: '请输入' + this.text
});
return false;
}
//找到对应蓝牙设备名字
if (el.devices[0].name == 'HM-A300-bfe3') {
that.deviceId = el.devices[0].deviceId; //成功后存储设备id
that.stopBluetoothDevicesDiscovery(); //关闭搜索
console.log('成功搜索设备', el.devices[0].deviceId);
}
if (!/(^[0-9]*$)/.test(this.form.label_sort)) {
//找到对应蓝牙设备名字
if (el.devices[0].name == 'HM-A300-c0a6') {
that.deviceId = el.devices[0].deviceId; //成功后存储设备id
that.stopBluetoothDevicesDiscovery(); //关闭搜索
console.log('成功搜索设备', el.devices[0].deviceId);
}
//找到对应蓝牙设备名字
if (el.devices[0].name == 'HM-A300-be61') {
that.deviceId = el.devices[0].deviceId; //成功后存储设备id
that.stopBluetoothDevicesDiscovery(); //关闭搜索
console.log('成功搜索设备', el.devices[0].deviceId);
}
});
},
fail: function() {
uni.hideLoading();
uni.showToast({
icon: 'error',
title: this.text + '为纯数字'
title: '请断开蓝牙,重新连接',
icon: 'error'
});
return false;
}
this.request(API.getPrintLabel, 'POST', { erp_order_sn: this.form.erp_order_sn_pre + this.form.erp_order_sn_number, label_sort: this.form.label_sort }, true).then(res => {
if (res.err_code === 0) {
this.printLabelData = res.data;
this.openBluetoothAdapter();
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
},
openBluetoothAdapter() {
//先查看系统蓝牙状态
let that = this;
uni.openBluetoothAdapter({
success(res) {
that.startBluetoothDevicesDiscovery();
},
fail() {
uni.showToast({
title: '请打开蓝牙',
icon: 'error'
});
}
});
},
startBluetoothDevicesDiscovery() {
//搜索附近的蓝牙设备并且监听寻找到新设备的事件
let that = this;
uni.showLoading({
title: '连接设备中',
mask: true
});
uni.startBluetoothDevicesDiscovery({
success: function(res) {
console.log('搜索设备start', res);
uni.onBluetoothDeviceFound(function(el) {
//找到对应蓝牙设备名字
if (el.devices[0].name == 'HM-A300-647a') {
that.deviceId = el.devices[0].deviceId; //成功后存储设备id
that.stopBluetoothDevicesDiscovery(); //关闭搜索
console.log("成功搜索设备", el);
console.log(el.devices[0].deviceId);
});
},
stopBluetoothDevicesDiscovery() {
//成功找到对应蓝牙设备后 停止搜寻附近的蓝牙外围设备
let that = this;
uni.stopBluetoothDevicesDiscovery({
success(res) {
console.log('停止搜索', res);
that.getBLEDeviceServices();
}
});
},
getBLEDeviceServices() {
//来获取蓝牙设备所有服务
let that = this;
uni.createBLEConnection({
deviceId: this.deviceId,
success: res => {
console.log('连接成功', JSON.stringify(res));
//需延时连接,不然会报错
setTimeout(function() {
uni.getBLEDeviceServices({
deviceId: that.deviceId,
success: res => {
console.log('获取蓝牙设备所有服务', res);
that.serviceId = res.services[0].uuid;
that.getBLEDeviceCharacteristics();
}
});
},
fail: function() {
uni.hideLoading();
uni.showToast({
title: '请断开蓝牙,重新连接',
icon: 'error'
});
}
});
},
stopBluetoothDevicesDiscovery() {
//成功找到对应蓝牙设备后 停止搜寻附近的蓝牙外围设备
let that = this;
uni.stopBluetoothDevicesDiscovery({
success(res) {
console.log('停止搜索', res);
that.getBLEDeviceServices();
}
});
},
getBLEDeviceServices() {
//来获取蓝牙设备所有服务
let that = this;
uni.createBLEConnection({
deviceId: this.deviceId,
success: res => {
console.log('连接成功', JSON.stringify(res));
//需延时连接,不然会报错
setTimeout(function() {
uni.getBLEDeviceServices({
deviceId: that.deviceId,
success: res => {
console.log('获取蓝牙设备所有服务', res);
that.serviceId = res.services[0].uuid;
that.getBLEDeviceCharacteristics();
}
});
}, 1000);
}
});
},
getBLEDeviceCharacteristics() {
//获取蓝牙设备某个服务中所有特征值
let that = this;
uni.getBLEDeviceCharacteristics({
deviceId: that.deviceId,
serviceId: that.serviceId,
success: res => {
that.characteristics = res.characteristics[0].uuid;
that.sendDataChange();
console.log('服务功能特征值', res);
},
fail: res => {
console.log('失败', res);
}
});
},
sendDataChangeAll() {
console.log('第' + this.print_number + '次打印');
//发送数据 二进制
let data = [];
var h = 0; //记录高度增量
data.push("! 10 200 200 " + (this.printLabelData.length * 250) + " 1\r\n");
for (let i = 0; i < this.printLabelData.length; i++) {
data.push("T 8 0 10 " + ((50 * (i + 1)) - (30 * 1) + h) + " 入仓号:" + this.printLabelData[i].erp_order_sn + "\r\n");
if (this.print_type == 1) {
data.push("T 8 0 10 " + ((50 * (i + 2)) - (30 * 1) + h) + " 总箱数:" + this.printLabelData[0].label_num + "箱\r\n");
} else {
data.push("T 8 0 10 " + ((50 * (i + 2)) - (30 * 1) + h) + " 箱号:" + this.printLabelData[i].label_sort + '/' + this.printLabelData[0].label_num + "\r\n");
}
data.push("T 8 0 10 " + ((50 * (i + 3)) - (30 * 1) + h) + " 时间:" + this.printLabelData[i].create_time_cn + "\r\n");
data.push("T 8 0 10 " + ((50 * (i + 4)) - (30 * 1) + h) + " 仓库代码:" + i + "\r\n");
data.push("B QR 290 " + ((50 * (i + 1)) - (30 * 1) + h) + " M 2 U 8\r\n");
data.push("MA," + this.printLabelData[i].erp_order_sn + "\r\n");
data.push("ENDQR\r\n");
h += 210;
}, 1000);
}
data.push("PRINT\r\n");
let arrayBuffer = uni.base64ToArrayBuffer(ToBase64.encode64gb2312(data.join('')));
this.sendData64 = arrayBuffer;
this.writeBLECharacteristicValue();
console.log(data.join(''))
},
sendDataChange() {
console.log('第' + this.print_number + '次打印');
//发送数据 二进制
let data = [];
if (this.printLabelData.length > 0) {
data.push("! 60 200 200 200 1\r\n");
data.push("T 8 0 10 20 入仓号:" + this.printLabelData[this.print_number].erp_order_sn + "\r\n");
if (this.print_type == 1) {
data.push("T 8 0 10 70 总箱数:" + this.printLabelData[this.print_number].label_num + "箱\r\n");
} else {
data.push("T 8 0 10 70 箱号:" + this.printLabelData[this.print_number].label_sort + '/' + this.printLabelData[this.print_number].label_num + "\r\n");
}
data.push("T 8 0 10 120 时间:" + this.printLabelData[this.print_number].create_time_cn + "\r\n");
data.push("T 8 0 10 170 仓库代码:" + this.printLabelData[this.print_number].warehouse_code + "\r\n");
data.push("B QR 290 20 M 2 U 8\r\n");
data.push("MA," + this.printLabelData[this.print_number].erp_order_sn + "#\r\n");
data.push("ENDQR\r\n");
data.push("FORM\r\n");
data.push("PRINT\r\n");
});
},
getBLEDeviceCharacteristics() {
//获取蓝牙设备某个服务中所有特征值
let that = this;
uni.getBLEDeviceCharacteristics({
deviceId: that.deviceId,
serviceId: that.serviceId,
success: res => {
that.characteristics = res.characteristics[0].uuid;
that.sendDataChange();
console.log('服务功能特征值', res);
},
fail: res => {
console.log('失败', res);
}
let arrayBuffer = uni.base64ToArrayBuffer(ToBase64.encode64gb2312(data.join('')));
this.sendData64 = arrayBuffer;
this.writeBLECharacteristicValue();
console.log(data.join(''))
},
writeBLECharacteristicValue() {
//写入二进制数据
let that = this;
uni.writeBLECharacteristicValue({
deviceId: that.deviceId,
serviceId: that.serviceId,
characteristicId: that.characteristics,
value: that.sendData64,
success(res) {
console.log('writeBLECharacteristicValue success', res.errMsg)
that.print_number++;
if (that.print_number < that.printLabelData.length) {
setTimeout(function() {
that.sendDataChange();
}, 0);
} else {
uni.hideLoading();
uni.closeBLEConnection({
deviceId: that.deviceId,
success(res) {
console.log('关闭蓝牙连接:', JSON.stringify(res.errMsg));
//清空数据
that.print_number = 0;
that.printLabelData = [];
that.sendData64 = '';
uni.showModal({
title: '提示',
content: '提交成功,请查看标签打印机',
showCancel: false,
confirmText: '关闭',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
})
}
},
fail() {
});
},
sendDataChangeAll() {
console.log('第' + this.print_number + '次打印');
//发送数据 二进制
let data = [];
var h = 0; //记录高度增量
data.push('! 10 200 200 ' + this.printLabelData.length * 250 + ' 1\r\n');
for (let i = 0; i < this.printLabelData.length; i++) {
data.push('T 8 0 10 ' + (50 * (i + 1) - 30 * 1 + h) + ' 入仓号:' + this.printLabelData[i].erp_order_sn + '\r\n');
if (this.print_type == 1) {
data.push('T 8 0 10 ' + (50 * (i + 2) - 30 * 1 + h) + ' 总箱数:' + this.printLabelData[0].label_num + '箱\r\n');
} else {
data.push('T 8 0 10 ' + (50 * (i + 2) - 30 * 1 + h) + ' 箱号:' + this.printLabelData[i].label_sort + '/' + this.printLabelData[0].label_num + '\r\n');
}
data.push('T 8 0 10 ' + (50 * (i + 3) - 30 * 1 + h) + ' 时间:' + this.printLabelData[i].create_time_cn + '\r\n');
data.push('T 8 0 10 ' + (50 * (i + 4) - 30 * 1 + h) + ' 仓库代码:' + i + '\r\n');
data.push('B QR 290 ' + (50 * (i + 1) - 30 * 1 + h) + ' M 2 U 8\r\n');
data.push('MA,' + this.printLabelData[i].erp_order_sn + '\r\n');
data.push('ENDQR\r\n');
h += 210;
}
data.push('PRINT\r\n');
let arrayBuffer = uni.base64ToArrayBuffer(ToBase64.encode64gb2312(data.join('')));
this.sendData64 = arrayBuffer;
this.writeBLECharacteristicValue();
console.log(data.join(''));
},
sendDataChange() {
console.log('第' + this.print_number + '次打印');
//发送数据 二进制
let data = [];
if (this.printLabelData.length > 0) {
data.push('! 60 200 200 200 1\r\n');
data.push('T 8 0 10 20 入仓号:' + this.printLabelData[this.print_number].erp_order_sn + '\r\n');
if (this.print_type == 1) {
data.push('T 8 0 10 70 总箱数:' + this.printLabelData[this.print_number].label_num + '箱\r\n');
} else {
data.push('T 8 0 10 70 箱号:' + this.printLabelData[this.print_number].label_sort + '/' + this.printLabelData[this.print_number].label_num + '\r\n');
}
data.push('T 8 0 10 120 时间:' + this.printLabelData[this.print_number].create_time_cn + '\r\n');
data.push('T 8 0 10 170 仓库代码:' + this.printLabelData[this.print_number].warehouse_code + '\r\n');
data.push('B QR 290 20 M 2 U 8\r\n');
data.push('MA,' + this.printLabelData[this.print_number].erp_order_sn + '#\r\n');
data.push('ENDQR\r\n');
data.push('FORM\r\n');
data.push('PRINT\r\n');
}
let arrayBuffer = uni.base64ToArrayBuffer(ToBase64.encode64gb2312(data.join('')));
this.sendData64 = arrayBuffer;
this.writeBLECharacteristicValue();
console.log(data.join(''));
},
writeBLECharacteristicValue() {
//写入二进制数据
let that = this;
uni.writeBLECharacteristicValue({
deviceId: that.deviceId,
serviceId: that.serviceId,
characteristicId: that.characteristics,
value: that.sendData64,
success(res) {
console.log('writeBLECharacteristicValue success', res.errMsg);
that.print_number++;
if (that.print_number < that.printLabelData.length) {
setTimeout(function() {
that.sendDataChange();
}, 0);
} else {
uni.hideLoading();
uni.showModal({
title: '提示',
content: '无法打印,请查看标签打印机连接状态',
showCancel: false,
confirmText: '关闭',
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
console.log('用户点击取消');
}
uni.closeBLEConnection({
deviceId: that.deviceId,
success(res) {
console.log('关闭蓝牙连接:', JSON.stringify(res.errMsg));
//清空数据
that.print_number = 0;
that.printLabelData = [];
that.sendData64 = '';
uni.showModal({
title: '提示',
content: '提交成功,请查看标签打印机',
showCancel: false,
confirmText: '关闭',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
});
}
})
},
change(index, type) {
if (type == 'erp_order_sn_pre') {
//订单类型
this.index_erp_order_sn_pre = index;
if (index == 0) {
this.form.erp_order_sn_pre = 'A';
} else if (index == 1) {
this.form.erp_order_sn_pre = 'B';
} else if (index == 2) {
this.form.erp_order_sn_pre = 'D';
}
},
fail() {
uni.hideLoading();
uni.showModal({
title: '提示',
content: '无法打印,请查看标签打印机连接状态',
showCancel: false,
confirmText: '关闭',
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
});
},
change(index, type) {
if (type == 'erp_order_sn_pre') {
//订单类型
this.index_erp_order_sn_pre = index;
if (index == 0) {
this.form.erp_order_sn_pre = 'A';
} else if (index == 1) {
this.form.erp_order_sn_pre = 'B';
} else if (index == 2) {
this.form.erp_order_sn_pre = 'D';
}
}
}
};
}
};
</script>
<style scoped lang="scss">
@import '../../assets/css/tag/print.scss';
@import '../../assets/css/tag/print.scss';
</style>
No preview for this file type
......@@ -60,7 +60,8 @@ $uni-color-paragraph: #3f536e; // 文章段落颜色
$uni-font-size-paragraph: 15px;
view,
text {
text,
input {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
......@@ -155,4 +156,4 @@ image {
font-size: 22rpx;
color: #6e767a;
}
}
\ No newline at end of file
}
......@@ -44,7 +44,23 @@ const API = {
/**
* 执行仓内作业
* */
execWarehouseOperation: API_BASE + '/supplywechatwms/execWarehouseOperation'
execWarehouseOperation: API_BASE + '/supplywechatwms/execWarehouseOperation',
/**
* 收货登记列表
* */
getCheckInList: API_BASE + '/supplywechatwms/getCheckInList',
/**
* 新增收货登记
* */
addCheckIn: API_BASE + '/supplywechatwms/addCheckIn',
/**
* 新增异常收货登记
* */
addUnusualCheckIn: API_BASE + '/supplywechatwms/addUnusualCheckIn',
/**
* 理货列表
* */
getGoodsArrangeData: API_BASE + '/supplywechatwms/getGoodsArrangeData'
}
......
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