Commit f186ab76 by liangjianmin

理货

parent 8c5824b7
......@@ -66,10 +66,11 @@
}
}
.tally-base-information {
padding: 24rpx 24rpx 0 24rpx;
padding: 24rpx 0 0 0;
background: #ffffff;
border-radius: 4rpx;
.top {
padding: 0 24rpx;
.title {
.arrow {
width: 12rpx;
......@@ -86,10 +87,14 @@
}
}
.list {
padding: 0 24rpx;
.box {
position: relative;
padding: 24rpx 0;
border-bottom: 1px solid #e6edf0;
&:last-child {
border-bottom: none;
}
.pp {
.w {
flex: 0 0 50%;
......@@ -127,6 +132,9 @@
border-radius: 4rpx;
font-size: 22rpx;
color: #ffffff;
&.curr {
background: #9ca8ad;
}
}
.pic {
position: absolute;
......@@ -139,7 +147,8 @@
}
.btn-submit {
height: 77rpx;
border-bottom: 1px solid #e6edf0;
border-bottom: 16rpx solid #e6edf0;
border-top: 1px solid #e6edf0;
.t1 {
font-size: 22rpx;
color: #404547;
......@@ -149,6 +158,35 @@
color: #197adb;
}
}
.device-box {
height: 77rpx;
background: #ffffff;
border-radius: 4rpx;
padding: 0 24rpx;
border-bottom: 16rpx solid #e6edf0;
.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;
}
}
.receiving-information {
padding: 0 24rpx 0 24rpx;
background: #ffffff;
......@@ -250,7 +288,7 @@
.text {
position: absolute;
right: 0;
bottom: 24rpx ;
bottom: 24rpx;
font-size: 24rpx;
color: #9ca8ad;
}
......
......@@ -70,7 +70,17 @@
background: #ffffff;
border-radius: 4rpx;
.top {
position: relative;
height: 87rpx;
border-bottom: 1px solid #e6edf0;
margin-bottom: 23rpx;
.iconfont {
position: absolute;
right: 14rpx;
top: 40rpx;
font-size: 15rpx;
color: #9ca8ad;
}
.t1 {
width: 156rpx;
font-size: 24rpx;
......@@ -105,27 +115,27 @@
.uni-tr {
height: 62rpx;
border-bottom: 1px solid #cad9e0;
.icon-a-Fill3{
.icon-a-Fill3 {
font-size: 24rpx;
color: #6E767A;
color: #6e767a;
}
.txt{
.txt {
font-size: 22rpx;
color: #404547;
}
.uni-input{
.uni-input {
font-size: 22rpx;
color: #404547;
}
.default{
.default {
width: 24rpx;
height: 24rpx;
border: 1px solid #D2DFE5;
border: 1px solid #d2dfe5;
border-radius: 50%;
}
.iconfont{
.iconfont {
font-size: 24rpx;
color: #197ADB;
color: #197adb;
}
.w {
height: 100%;
......
......@@ -52,7 +52,7 @@
<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;"/>
<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>
......@@ -199,7 +199,7 @@ export default {
for (let i = 0; i < tempFilePaths.length; i++) {
console.log(tempFilePaths[i]);
uni.uploadFile({
url: 'http://api.liexin.com/oss/upload',
url: API.upload,
filePath: tempFilePaths[i],
name: 'upload',
formData: {
......
......@@ -18,23 +18,23 @@
</view>
<view class="pp row verCenter" v-if="flag">
<text class="t1">订单时间:</text>
<text class="t2">{{goodsArrangeData.orderDate}}</text>
<text class="t2">{{ goodsArrangeData.orderDate }}</text>
</view>
<view class="pp row verCenter" v-if="flag">
<text class="t1">订单客户:</text>
<text class="t2">{{goodsArrangeData.customer}}</text>
<text class="t2">{{ goodsArrangeData.customer }}</text>
</view>
<view class="pp row verCenter" v-if="flag">
<text class="t1">供应商:</text>
<text class="t2">{{goodsArrangeData.supplier}}</text>
<text class="t2">{{ goodsArrangeData.supplier }}</text>
</view>
<view class="pp row verCenter">
<text class="t1">登记数量:</text>
<text class="t2">{{goodsArrangeData.num}}</text>
<text class="t2">{{ goodsArrangeData.num }}</text>
</view>
<view class="pp row">
<text class="t1">采购备注:</text>
<text class="t2">{{goodsArrangeData.remark}}</text>
<text class="t2">{{ goodsArrangeData.remark }}</text>
</view>
</view>
<view class="tally-base-information">
......@@ -45,43 +45,43 @@
</view>
</view>
<view class="list">
<view class="box" v-for="(item,index) in goodsArrangeData.entrys" :key="index">
<view class="box" v-for="(item, index) in goodsArrangeData.entrys" :key="index">
<view class="pp row verCenter">
<view class="w row verCenter">
<text class="t1">规格型号:</text>
<text class="t2">{{item.model}}</text>
<text class="t2">{{ item.model }}</text>
</view>
<view class="w row verCenter">
<text class="t1">品牌:</text>
<text class="t2">{{item.brand}}</text>
<text class="t2">{{ item.brand }}</text>
</view>
</view>
<view class="pp row verCenter">
<view class="w row verCenter">
<text class="t1">订单数量:</text>
<text class="t2">{{item.qty}}</text>
<text class="t2">{{ item.qty }}</text>
</view>
<view class="w row verCenter">
<text class="t1">单位:</text>
<text class="t2">{{item.unit}}</text>
<text class="t2">{{ item.unit }}</text>
</view>
</view>
<view class="pp row verCenter">
<view class="w row verCenter">
<text class="t1">原产国:</text>
<text class="t2">{{item.country || '--'}}</text>
<text class="t2">{{ item.country || '--' }}</text>
</view>
<view class="w row verCenter">
<text class="t1">货物名称:</text>
<text class="t2">{{item.material}}</text>
<text class="t2">{{ item.material }}</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" />
<input type="text" placeholder="请输入" class="uni-input" @input="onInput($event, index)" :data="index" />
</view>
<view class="photograph row rowCenter verCenter">拍照</view>
<view class="photograph row rowCenter verCenter" :class="{ curr: picTextStatus[index] }" @click="chooseImageChange(index)">{{ picTextStatus[index] ? '已上传' : '拍照' }}</view>
</view>
<image src="http://img.ichunt.com/images/ichunt/minProgram/scmMinProgram/wms/202203/08/d034765db26eb07075b2965dc96b8b35.png" mode="aspectFill" class="pic"></image>
</view>
......@@ -90,40 +90,55 @@
<text class="t1">理货异常?</text>
<text class="t2">去提交</text>
</navigator>
<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="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;" />
<input type="number" v-model="form.sort_goods_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 class="tab-panel row rowCenter verCenter" @click="change(index, 'goods_unit')" :class="{ curr: index_sort_goods_unit == 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 class="input-wrap row bothSide"><input type="number" v-model="form.gross_weight" 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 class="tab-panel row rowCenter verCenter" @click="change(index, 'print_type')" :class="{ curr: index_print_type == index }" v-for="(item, index) in printTypeText" :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 class="label">{{ text }}</view>
<view class="input-wrap row bothSide"><input type="number" v-model="printForm.label_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>
<textarea @input="inputChange()" maxlength="200" placeholder="请输入理货备注" placeholder-style="color:#6E767A;" v-model="form.sort_goods_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 @change="bindPickerChange" :value="index" :range="traySelectOption" range-key="tray_sn">
<view class="uni-input">{{ traySelectOption[index].tray_sn || '请选择' }}</view>
</picker>
</view>
</view>
......@@ -135,41 +150,98 @@
<script>
import { API } from '@/util/api.js';
import w_md5 from '../../js_sdk/zww-md5/w_md5.js';
export default {
data() {
return {
flag: false,
index: -1,
currentIndex: 1,
number:'',
goodsArrangeData: {},
textArr: ['件', '箱'],
array: ['京东', '顺丰', '中通'],
limitword: 0,
flag: false, //toggle
goodsArrangeData: {}, //理货列表数据
textArr: ['件', '箱'], //理货单位
index_sort_goods_unit: 0, //理货单位索引
printTypeText: ['卡板', '散箱'], //打印类型
index_print_type: 0, //打印类型索引
limitword: 0, //备注文字限制
noexebshowFalg: true, //控制是否会触发生命周期
index: -1, //托盘索引
traySelectOption: [], //放置托盘
serviceId: '', //蓝牙信息
deviceId: '', //蓝牙信息
device_name: '', //蓝牙信息
characteristics: '', //蓝牙信息
sendData64: '', //蓝牙发送数据
printLabelData: '', //打印标签数据
print_number: '', //打印计数
picTextStatus: [], //照片文字说明
print_text: '总箱数',
text: '总箱数',
printForm: {
erp_order_sn_pre: '', //A单B单
print_type: 1, //打印类型
erp_order_sn_number: '', //入仓号
label_num: '1', //总箱数 标签
tray_remark: '' //托盘ID
},
form: {
delivery_method: 1,
logistics_company: '',
logistics_number: '',
total_num: '',
unit: '',
check_in_pic: '',
check_in_remark: '',
checkIn: ''
sort_goods_remark: '', //理货备注
number: 'B50413', //入仓号
sort_goods_num: '', //理货数量
gross_weight: '', //毛重
sort_goods_unit: '件', //理货单位
wstylt_id: '', //托盘ID
entrys: [], //附加信息
baseinfo: [] //基础信息
}
};
},
onLoad(options) {
this.number=options.number || '';
this.form.number = options.number || ''; //获取参数入仓号
this.getTraySelectOption(); //获取托盘数据
},
onShow() {
const deviceData = uni.getStorageSync('device') || ''; //获取已连接蓝牙设备信息
if (deviceData) {
this.deviceId = deviceData.deviceId;
this.device_name = deviceData.name;
} else {
this.deviceId = '';
this.device_name = '';
}
if (this.noexebshowFalg) {
this.getData();
}
},
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.wstylt_id = tray_sn_value;
this.printForm.tray_remark = tray_sn_value;
}
}
});
},
getData() {
this.request(API.getGoodsArrangeData, 'POST', { page: this.page, number: this.number }, true).then(res => {
this.request(API.getGoodsArrangeData, 'POST', { page: this.page, number: '' }, true).then(res => {
if (res.err_code === 0) {
this.goodsArrangeData = res.data[0];
this.form.entrys = res.data[0];
if (res.data[0].entrys.length > 0) {
for (let i = 0; i < res.data[0].entrys.length; i++) {
this.picTextStatus.push(false);
this.form.baseinfo.push({
weight: '',
pic: ''
});
}
}
} else {
uni.showToast({
title: res.err_msg,
......@@ -178,23 +250,290 @@ export default {
}
});
},
inputChange() {
if (this.form.check_in_remark.length <= 200) {
this.limitword = this.form.check_in_remark.length;
change(index, type) {
if (type == 'goods_unit') {
//理货单位
this.index_sort_goods_unit = index;
if (index == 0) {
this.form.sort_goods_unit = '件';
} else if (index == 1) {
this.form.sort_goods_unit = '箱';
}
} else if (type == 'print_type') {
//打印类型
this.index_print_type = index;
if (index == 0) {
this.printForm.print_type = 1;
this.text = '总箱数';
this.print_text = '总箱数';
} else if (index == 1) {
this.printForm.print_type = 2;
this.text = '标签数量';
this.print_text = '箱号';
}
}
},
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.target.value);
this.index = e.target.value;
this.form.logistics_company = this.array[e.target.value];
this.form.wstylt_id = this.traySelectOption[e.target.value].wstylt_id;
this.printForm.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);
},
changeTab(index) {
this.currentIndex = index;
onInput(e, index) {
this.form.baseinfo[index].weight = e.detail.value;
},
toggle() {
this.flag = !this.flag;
},
submit() {}
inputChange() {
if (this.form.sort_goods_remark.length <= 200) {
this.limitword = this.form.sort_goods_remark.length;
}
},
chooseImageChange(index) {
this.noexebshowFalg = false; //不允许再次触发onshow这个生命周期
var time = parseInt(new Date().getTime() / 1000);
uni.chooseImage({
count: 1,
sourceType: ['album', 'camera'],
success: chooseImageRes => {
uni.showLoading({
title: '上传中...'
});
const tempFilePaths = chooseImageRes.tempFilePaths;
uni.uploadFile({
url: API.upload,
filePath: tempFilePaths[0],
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);
if (data.code === 200) {
this.$set(this.form.baseinfo[index], 'pic', data.data[0]);
this.$set(this.picTextStatus, index, true);
} else {
uni.showToast({
title: data.message,
icon: 'error'
});
}
},
fail: error => {
uni.hideLoading();
console.log(error);
}
});
}
});
},
submit() {
if (!this.form.sort_goods_num) {
uni.showToast({
icon: 'error',
title: '请输入理货数量'
});
return false;
}
if (!this.form.gross_weight) {
uni.showToast({
icon: 'error',
title: '请输入毛重'
});
return false;
}
if (this.form.number) {
this.printForm.erp_order_sn_pre = this.form.number.substr(0, 1);
this.printForm.erp_order_sn_number = this.form.number.slice(1, this.form.number.length);
}
this.request(API.addSortGodds, 'POST', this.form, true).then(res => {
if (res.err_code === 0) {
uni.showModal({
title: '提示',
content: '确认收货成功,点击确定打印',
showCancel: false,
success: res => {
if (res.confirm) {
this.print();
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
},
print() {
this.request(API.printLabel, 'POST', this.printForm, true).then(res => {
if (res.err_code === 0) {
this.printLabelData = res.data;
this.getBLEDeviceServices(); //根据获取的设备信息,连接设备
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
},
/**
* 来获取蓝牙设备所有服务
*/
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();
}
});
}, 1000);
},
fail: res => {
uni.hideLoading();
uni.showToast({
icon: 'error',
title: '连接设备失败!',
duration: 3000
});
}
});
},
/**
* 获取蓝牙设备某个服务中所有特征值
*/
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 => {
uni.hideLoading();
uni.showToast({
icon: 'error',
title: '连接设备失败!',
duration: 3000
});
}
});
},
/**
* 向蓝牙发送数据
*/
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('用户点击取消');
}
}
});
}
});
}
}
};
</script>
......
......@@ -40,40 +40,25 @@
<view class="question-box">
<view class="top row verCenter">
<text class="t1">问题类型</text>
<text class="iconfont icon-sanjiaoxing1"></text>
<view class="el-select-box">
<picker @change="bindPickerChange" :value="index" :range="array">
<view class="uni-input">{{ array[index] || '请选择' }}</view>
<picker @change="bindPickerChange" :value="index" :range="typeList" range-key="content">
<view class="uni-input">{{ typeList[index].content || '请选择' }}</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>
<text class="row verCenter">订单{{ text }}</text>
<text class="row verCenter">实到{{ text }}</text>
<text class="row verCenter">是否异常</text>
</view>
<view class="uni-tr row verCenter" v-for="(item, index) in exceptionlist" :key="index">
<text class="txt w row verCenter">{{ item.model }}</text>
<text class="txt w row verCenter">{{ item.order_data }}</text>
<input class="w uni-input" type="text" />
<view class="w" style="padding-left: 0;"><switch checked style="transform: scale(0.5);" color="#197ADB" /></view>
</view>
</view>
<view class="upload-box">
......@@ -92,7 +77,7 @@
</view>
</view>
<view class="textarea-box">
<textarea @input="inputChange()" maxlength="200" placeholder="请输入异常备注" placeholder-style="color:#6E767A;" v-model="form.check_in_remark"></textarea>
<textarea @input="inputChange()" maxlength="200" placeholder="请输入异常备注" placeholder-style="color:#6E767A;" v-model="form.ask_customer_remark"></textarea>
<text class="text">{{ limitword }}/200</text>
</view>
</view>
......@@ -108,24 +93,67 @@ import w_md5 from '../../js_sdk/zww-md5/w_md5.js';
export default {
data() {
return {
d: '12',
flag: false,
limitword: 0,
index: -1,
flag: false, //toggle
limitword: 0, //备注文字限制
index: 0,
attachAddress: [],
array: ['日本', '美国'],
goodsArrangeData: {}, //理货列表数据
noexebshowFalg: true, //控制是否会触发生命周期
limitword: 0, //备注文字限制,
ask_customer_exception_id: '',
typeList: [],
exceptionlist: [],
text: '',
form: {
check_in_remark: ''
erp_order_sn: 'B50413', //入仓号
sort_goods_img: '', //问题图片
ask_customer_remark: '', //仓库问客备注
entrys: {}
}
};
},
onLoad(options) {
this.form.erp_order_sn = options.number || 'B50413'; //获取参数入仓号
},
onShow() {
if (this.noexebshowFalg) {
this.getData();
}
},
methods: {
getData() {
this.request(API.getCheckInList, 'POST', { number: this.id }, this.loading).then(res => {
this.request(API.getGoodsArrangeData, 'POST', { page: this.page, number: '' }, true).then(res => {
if (res.err_code === 0) {
this.goodsArrangeData = res.data[0];
this.form.entrys = res.data[0];
this.getAllException();
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
},
getAllException() {
this.request(API.getAllException, 'POST', {}, true).then(res => {
if (res.err_code === 0) {
this.typeList = res.data;
this.ask_customer_exception_id = res.data[0].ask_customer_exception_id; //默认
this.text = res.data[0].content.substr(0, 2); //默认
this.getExceptionData();
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
},
getExceptionData() {
this.request(API.getExceptionData, 'POST', { ask_customer_exception_id: this.ask_customer_exception_id, entrys: this.form.entrys }, true).then(res => {
if (res.err_code === 0) {
this.exceptionlist = res.data;
} else {
uni.showToast({
title: res.err_msg,
......@@ -134,20 +162,33 @@ export default {
}
});
},
toggle() {
this.flag = !this.flag;
},
previewChange(img, index) {
this.noexebshowFalg = false; //不允许再次触发onshow这个生命周期
uni.previewImage({
current: index,
urls: img
});
},
inputChange() {
if (this.form.ask_customer_remark.length <= 200) {
this.limitword = this.form.ask_customer_remark.length;
}
},
deletePic(index) {
this.attachAddress.splice(index, 1);
},
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.target.value);
this.index = e.target.value;
this.ask_customer_exception_id = this.typeList[e.target.value].ask_customer_exception_id;
this.text = this.typeList[e.target.value].content.substr(0, 2); //文字
this.getExceptionData();
},
chooseImageChange() {
this.noexebshowFalg = false; //不允许再次触发onshow这个生命周期
var self = this;
var time = parseInt(new Date().getTime() / 1000);
uni.chooseImage({
......@@ -169,7 +210,7 @@ export default {
for (let i = 0; i < tempFilePaths.length; i++) {
console.log(tempFilePaths[i]);
uni.uploadFile({
url: 'http://api.liexin.com/oss/upload',
url: API.upload,
filePath: tempFilePaths[i],
name: 'upload',
formData: {
......@@ -199,12 +240,18 @@ export default {
}
});
},
inputChange() {
if (this.form.check_in_remark.length <= 200) {
this.limitword = this.form.check_in_remark.length;
submit() {
this.form.sort_goods_img = this.attachAddress;
this.request(API.addAskCustomer, 'POST', this.form, true).then(res => {
if (res.err_code === 0) {
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
}
},
submit() {}
}
};
</script>
......
......@@ -117,7 +117,7 @@ export default {
const time = parseInt(new Date().getTime() / 1000);
console.log(tempFilePaths);
uni.uploadFile({
url: 'http://api.liexin.com/oss/upload',
url: API.upload,
filePath: tempFilePaths[0],
name: 'upload',
formData: {
......@@ -126,6 +126,8 @@ export default {
k2: w_md5.hex_md5_32(w_md5.hex_md5_32(String(time)) + 'fh6y5t4rr351d2c3bryi')
},
success: uploadFileRes => {
this.noexebshowFalg = false; //不允许再次触发onshow这个生命周期
uni.hideLoading();
var data = JSON.parse(uploadFileRes.data);
if (data.code === 200) {
......
......@@ -77,7 +77,7 @@ export default {
for (let i = 0; i < tempFilePaths.length; i++) {
console.log(tempFilePaths[i]);
uni.uploadFile({
url: 'https://api.ichunt.com/oss/upload',
url: API.upload,
filePath: tempFilePaths[i],
name: 'upload',
formData: {
......
......@@ -52,6 +52,16 @@ export default {
};
},
onLoad() {
const deviceData = uni.getStorageSync('device') || ''; //获取已连接蓝牙设备信息
if (deviceData) {
this.status=true;
this.deviceId = deviceData.deviceId;
this.deviceName = deviceData.name;
} else {
this.deviceId = '';
this.deviceName = '';
}
//在页面加载时候初始化蓝牙适配器
uni.openBluetoothAdapter({
success: e => {
......
......@@ -90,7 +90,7 @@ export default {
this.device_name = '';
}
},
created() {
onLoad() {
this.getTraySelectOption();
},
methods: {
......
......@@ -64,7 +64,23 @@ const API = {
/**
* 获取理货异常列表
* */
getUnusualCheckInList: API_BASE + '/supplywechatwms/getUnusualCheckInList'
getUnusualCheckInList: API_BASE + '/supplywechatwms/getUnusualCheckInList',
/**
* 新增理货异常问客
*/
addAskCustomer: API_BASE + '/supplywechatwms/addAskCustomer',
/**
* 新增理货
*/
addSortGodds: API_BASE + '/supplywechatwms/addSortGodds',
/**
* 获取理货异常问题列表
*/
getAllException: API_BASE + '/supplywechatwms/getAllException',
/**
* 获取理货异常问题对应的数据数组
*/
getExceptionData: API_BASE + '/supplywechatwms/getExceptionData'
}
......
......@@ -31,9 +31,10 @@ const request = (url = '', type = 'GET', param = {}, Loading) => {
let [error, res] = response;
resolve(res.data);
}).catch(error => {
if (Loading) {
uni.hideLoading();
}
uni.showToast({
title: '网络出现问题',
icon: 'error'
});
let [err, res] = error;
reject(err);
})
......
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