Commit b7fd246c by liangjianmin

bug

parent 8198e180
......@@ -11,6 +11,34 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-juxing5:before {
content: "\e778";
}
.icon-a-10cangkucangchu:before {
content: "\e774";
}
.icon-juxing4:before {
content: "\e777";
}
.icon-jinggao:before {
content: "\e772";
}
.icon-juxing3:before {
content: "\e773";
}
.icon-a-juxing4:before {
content: "\e775";
}
.icon-a-juxing11:before {
content: "\e776";
}
.icon-shanchu:before {
content: "\e8b6";
}
......
......@@ -29,7 +29,6 @@
}
}
.fast-entry {
height: 233rpx;
background: #ffffff;
padding-left: 24rpx;
padding-top: 24rpx;
......@@ -40,13 +39,15 @@
margin-bottom: 36rpx;
}
.bar {
flex-wrap: wrap;
.box {
position: relative;
flex: 0 0 33.3%;
height: 102rpx;
flex: 1;
height: 177rpx;
border-right: 1px solid #e6edf0;
&:last-child {
border-right: none;
border-bottomt: 1px solid #e6edf0;
&:nth-of-type(3n) {
border-right: 1px solid transparent;
}
.num {
position: absolute;
......
.print-index{
padding: 24rpx 24rpx 0 24rpx;
.print-form{
background: #FFFFFF;
border-radius: 4rpx;
.box{
padding: 24rpx;
border-bottom: 1rpx solid #E6EDF0;
&:last-child{
border-bottom: none;
}
.label{
width: 156rpx;
font-size: 24rpx;
color: #6E767A;
}
.uni-input{
height: 32rpx;
font-size: 24rpx;
color: #404547;
font-weight: bold;
}
.el-select{
height: 32rpx;
}
.tab{
.tab-pane{
width: 100rpx;
height: 48rpx;
background: #9CA8AD;
border-radius: 4rpx;
font-size: 24rpx;
color: #FFFFFF;
margin-right: 24rpx;
transition: all 0.4s ease-in-out;
&.curr{
background: #197ADB;
}
&:last-child{
margin-right: 0;
}
}
}
}
}
.btn{
height: 88rpx;
background: #197ADB;
border-radius: 4rpx;
font-size: 28rpx;
color: #FFFFFF;
margin-top: 44rpx;
}
}
\ No newline at end of file
<template>
<view>
<view class="grid">
<view :class="col == 3 ? 'grid-item-3' : 'grid-item-4'" v-for="(item, index) in gridList" :key="index" @click="gridClick(item, index)">
<text class="iconfont" :class="item.iconfont"></text>
<view class="text" v-text="item.name"></view>
<text class="tipNum" v-if="showTip && item.tips" v-text="item.tips"></text>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'zy-grid',
props: {
col: {
//每行显示格子数,支持每行3个或4个(默认为3)
type: Number,
value: 3
},
showTip: {
//格子菜单的数字角标(默认显示)
type: Boolean,
value: true
},
gridList: {
type: Array,
value: []
}
},
methods: {
gridClick(item, index) {
//格子菜单点击事件
this.$emit('gridClickChange', item)
}
}
};
</script>
<style lang="less" scoped>
.grid {
display: flex;
align-items: center;
flex-wrap: wrap;
.grid-item-3,
.grid-item-4 {
box-sizing: border-box;
width: calc(100% / 3);
border-bottom: 1px solid #e6edf0;
border-right: 1px solid #e6edf0;
text-align: center;
padding: 40rpx 0;
position: relative;
.iconfont {
font-size: 64rpx;
color: #197adb;
}
.text {
font-size: 22rpx;
margin-top: 8rpx;
color: #404547;
}
.tipNum {
display: block;
padding: 4rpx 8rpx;
text-align: center;
border-radius: 16rpx;
font-size: 20rpx;
background-color: #bb3434;
color: #ffffff;
position: absolute;
right: 32rpx;
top: 6rpx;
}
}
.grid-item-3:nth-child(3n + 3),
.grid-item-4:nth-child(4n + 4) {
border-right: none;
}
.grid-item-4 {
width: calc(100% / 4);
}
}
</style>
......@@ -31,6 +31,16 @@
"navigationBarTitleText": "授权手机号"
}
}, {
"path": "pages/tag/print",
"style": {
"navigationBarTitleText": "打印标签"
}
},{
"path": "pages/tag/repairPrint",
"style": {
"navigationBarTitleText": "补打标签"
}
},{
"path": "pages/mine/login",
"style": {
"navigationBarTitleText": "绑定账号"
......
......@@ -21,20 +21,9 @@
</view>
<view class="fast-entry">
<view class="tit">快捷操作入口</view>
<view class="row avarage bar">
<view class="row bar">
<template v-if="is_login">
<view class="box column verCenter" @click="scanChange()">
<text class="iconfont icon-a-juxing1"></text>
<text class="text">快递回单上传</text>
</view>
<view class="box column verCenter" @click="scanChange()">
<text class="iconfont icon-a-juxing1"></text>
<text class="text">司机回单上传</text>
</view>
<view class="box column verCenter" @click="scanChange()">
<text class="iconfont icon-a-juxing1"></text>
<text class="text">自提回单上传</text>
</view>
<zy-grid :grid-list="gridList" :show-tip="true" :col="3" @gridClickChange="gridClick"></zy-grid>
</template>
<template v-else>
<navigator class="box column verCenter" url="/pages/mine/login" hover-class="none">
......@@ -61,13 +50,60 @@
<script>
import { API } from '@/util/api.js';
import zyGrid from '../../components/zy-grid/zy-grid.vue';
export default {
data() {
return {
is_login: false,
userInfo: {},
rawData: ''
rawData: '',
gridList: [
{
name: '快递回单上传',
iconfont: 'icon-a-juxing1',
tips: 19
},
{
name: '收货登记',
iconfont: 'icon-juxing3',
tips: ''
},
{
name: '上架',
iconfont: 'icon-a-juxing11',
tips: ''
},
{
name: '拣货',
iconfont: 'icon-juxing4',
tips: ''
},
{
name: '仓内作业',
iconfont: 'icon-juxing5',
tips: ''
},
{
name: '异常收货登记',
iconfont: 'icon-jinggao',
tips: ''
},
{
name: '理货作业',
iconfont: 'icon-a-10cangkucangchu',
tips: ''
},
{
name: '打印标签',
iconfont: 'icon-a-juxing4',
tips: ''
},
{
name: '补打标签',
iconfont: 'icon-a-juxing4',
tips: ''
}
]
};
},
onShow() {
......@@ -88,7 +124,7 @@ export default {
console.log(res);
uni.showToast({
title: '扫码失败',
icon: 'none'
icon: 'error'
});
}
});
......@@ -102,7 +138,37 @@ export default {
this.is_login = false;
}
});
},
gridClick(item, index) {
if (item.name == '快递回单上传') {
this.scanChange();
} else if (item.name == '打印标签') {
uni.navigateTo({
url: '/pages/tag/print'
});
} else if (item.name == '补打标签') {
uni.navigateTo({
url: '/pages/tag/repairPrint'
});
} else {
uni.showModal({
title: '提示',
content: '后续陆续开发此功能!',
showCancel: false,
confirmText: '关闭',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
}
},
components: {
zyGrid
}
};
</script>
......
<template>
<view class="print-index">
<view class="print-form">
<view class="box row verCenter">
<view class="label">订单类型</view>
<view class="tab row verCenter">
<view class="tab-pane row rowCenter verCenter" v-for="(item, index) in items_erp_order_sn_pre" :key="index" :class="{ curr: index_erp_order_sn_pre == index }" @click="change(index, 'erp_order_sn_pre')">{{ item }}</view>
</view>
</view>
<view class="box row verCenter">
<view class="label">打印类型</view>
<view class="tab row verCenter">
<view class="tab-pane row rowCenter verCenter" v-for="(item, index) in items_print_type" :key="index" :class="{ curr: index_print_type == index }" @click="change(index, 'print_type')">{{ item }}</view>
</view>
</view>
<view class="box row verCenter">
<view class="label">入仓号</view>
<input type="number" v-model="form.erp_order_sn_number" placeholder-style="font-size:24rpx;color:#404547;" class="uni-input" placeholder="请输入" />
</view>
<view class="box row verCenter">
<view class="label">{{ text }}</view>
<input type="number" v-model="form.label_num" placeholder-style="font-size:24rpx;color:#404547;" class="uni-input" placeholder="请输入" />
</view>
<view class="box row verCenter">
<view class="label">放置托盘</view>
<view class="el-select row verCenter">
<picker @change="bindPickerChange" :value="index" :range="array">
<view class="uni-input">{{ array[index] || '请选择' }}</view>
</picker>
</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 {
uuid: '',
deviceId: '',
characteristics: '',
text: '总箱数',
index: -1,
array: ['暂时存储', '第1卡板', '第2卡板', '第3卡板', '第4卡板', '第5卡板'],
index_erp_order_sn_pre: -1,
index_print_type: 0,
items_erp_order_sn_pre: ['A单号', 'B单号', 'D单号'],
items_print_type: ['卡板', '散箱'],
form: {
erp_order_sn_pre: '',
print_type: 1,
erp_order_sn_number: '',
label_num: '',
tray_remark: ''
}
};
},
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.target.value);
this.index = e.target.value;
this.form.tray_remark = e.target.value;
},
submit() {
this.openBluetoothAdapter();
return false;
if (!this.form.erp_order_sn_pre) {
uni.showToast({
icon: 'error',
title: '请选择订单类型'
});
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).then(res => {
if (res.err_code === 0) {
uni.showModal({
title: '提示',
content: '提交成功,打印中,请查看标签打印机',
showCancel: false,
confirmText: '关闭',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
} 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.startBluetoothDevicesDiscovery({
success: function(res) {
uni.showLoading({
title: '连接蓝牙中...'
});
uni.onBluetoothDeviceFound(function(el) {
//找到对应蓝牙设备名字
if (el.devices[0].name == 'HM-A300-87d9') {
that.deviceId = el.devices[0].deviceId; //成功后存储设备id
that.stop(); //关闭搜索
console.log(el.devices[0].deviceId);
}
});
}
});
},
stop() {
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.uuid = res.services[0].uuid;
that.getServices();
}
});
}, 1000);
}
});
},
getServices() {
let that = this;
uni.getBLEDeviceCharacteristics({
deviceId: that.deviceId,
serviceId: that.uuid,
success: res => {
uni.hideLoading();
that.characteristics = res.characteristics[0].uuid;
console.log('服务功能', res);
},
fail: res => {
console.log('失败', res);
}
});
},
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';
this.index = -1;
} else if (index == 1) {
this.form.erp_order_sn_pre = 'B';
this.index = 0;
} else if (index == 2) {
this.form.erp_order_sn_pre = 'D';
this.index = 0;
}
} else if (type == 'print_type') {
//打印类型
this.index_print_type = index;
if (index == 0) {
this.form.print_type = 1;
this.text = '总箱数';
} else if (index == 1) {
this.text = '标签数量';
this.form.print_type = 2;
}
}
}
}
};
</script>
<style scoped lang="scss">
@import '../../assets/css/tag/print.scss';
</style>
<template>
<view class="print-index">
<view class="print-form">
<view class="box row verCenter">
<view class="label">订单类型</view>
<view class="tab row verCenter">
<view class="tab-pane row rowCenter verCenter" v-for="(item, index) in items_erp_order_sn_pre" :key="index" :class="{ curr: index_erp_order_sn_pre == index }" @click="change(index, 'erp_order_sn_pre')">{{ item }}</view>
</view>
</view>
<view class="box row verCenter">
<view class="label">入仓号</view>
<input type="number" v-model="form.erp_order_sn_number" placeholder-style="font-size:24rpx;color:#404547;" class="uni-input" placeholder="请输入" />
</view>
<view class="box row verCenter">
<view class="label">{{ text }}</view>
<input type="number" v-model="form.label_num" placeholder-style="font-size:24rpx;color:#404547;" class="uni-input" placeholder="请输入" />
</view>
</view>
<view class="btn row rowCenter verCenter" @click="submit()">提交打印</view>
</view>
</template>
<script>
import { API } from '@/util/api.js';
export default {
data() {
return {
text: '标签数量',
index_erp_order_sn_pre: -1,
index_print_type: 0,
items_erp_order_sn_pre: ['A单号', 'B单号', 'D单号'],
form: {
erp_order_sn_pre: '',
erp_order_sn_number: '',
label_num: '',
tray_remark: ''
}
};
},
onShow() {},
methods: {
submit() {
if (!this.form.erp_order_sn_pre) {
uni.showToast({
icon: 'error',
title: '请选择订单类型'
});
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;
}
this.request(API.printLabel, 'POST', this.form).then(res => {
if (res.err_code === 0) {
uni.showModal({
title: '提示',
content: '提交成功,打印中,请查看标签打印机',
showCancel: false,
confirmText: '关闭',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
},
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';
this.index = -1;
} else if (index == 1) {
this.form.erp_order_sn_pre = 'B';
this.index = 0;
} else if (index == 2) {
this.form.erp_order_sn_pre = 'D';
this.index = 0;
}
}
}
}
};
</script>
<style scoped lang="scss">
@import '../../assets/css/tag/print.scss';
</style>
No preview for this file type
const API_BASE = 'https://api.ichunt.com';
//const API_BASE = 'http://supplyapi.liexin.com'
//const API_BASE = 'https://api.ichunt.com';
const API_BASE = 'http://api.liexin.com'
const API = {
/**
* 上传数据
......@@ -16,7 +16,15 @@ const API = {
/**
* 上传文件
* */
upload: API_BASE + '/oss/upload'
upload: API_BASE + '/oss/upload',
/**
* 生成打印标签数据
* */
printLabel: API_BASE + '/supplywechatwms/printLabel',
/**
* 获取补打标签数据
* */
getPrintLabel: API_BASE + '/supplywechatwms/getPrintLabel'
}
......
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