Commit 56e7358b by LJM

add

parent 6a623e37
...@@ -88,6 +88,7 @@ ...@@ -88,6 +88,7 @@
transition: all 0.4s ease; transition: all 0.4s ease;
&.disabled { &.disabled {
background-color: #f2f9ff; background-color: #f2f9ff;
border: 1px solid #bbdcfd;
} }
.pb16 { .pb16 {
padding-bottom: 16rpx; padding-bottom: 16rpx;
......
...@@ -178,6 +178,8 @@ ...@@ -178,6 +178,8 @@
this.noexebshowFalg = false; //不允许再次触发onshow这个生命周期 this.noexebshowFalg = false; //不允许再次触发onshow这个生命周期
var self = this; var self = this;
var time = parseInt(new Date().getTime() / 1000); var time = parseInt(new Date().getTime() / 1000);
// #ifdef MP-WEIXIN
uni.chooseMedia({ uni.chooseMedia({
count: 4, count: 4,
mediaType: ['image'], mediaType: ['image'],
...@@ -225,6 +227,58 @@ ...@@ -225,6 +227,58 @@
} }
} }
}); });
// #endif
// #ifdef APP-PLUS
uni.chooseImage({
count: 4,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: chooseImageRes => {
uni.showLoading({
title: '上传中...'
});
const tempFilePaths = chooseImageRes.tempFilePaths;
let maxNum = tempFilePaths.length * 1 + self.form.check_in_pic.length * 1;
if (maxNum > 4) {
uni.hideLoading();
uni.showToast({
title: '图片不超过4张'
});
return false;
}
for (let i = 0; i < tempFilePaths.length; i++) {
uni.uploadFile({
url: API.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);
if (data.code === 200) {
self.form.check_in_pic.push(data.data[0]);
} else {
uni.showToast({
title: data.message,
icon: 'error'
});
}
},
fail: error => {
uni.hideLoading();
}
});
}
}
});
// #endif
}, },
inputChange() { inputChange() {
if (this.form.check_in_remark.length <= 200) { if (this.form.check_in_remark.length <= 200) {
......
...@@ -2,12 +2,22 @@ ...@@ -2,12 +2,22 @@
<view class="home-index"> <view class="home-index">
<view class="head"> <view class="head">
<!-- 未登录 --> <!-- 未登录 -->
<!-- #ifdef MP-WEIXIN -->
<navigator class="row verCenter box" v-if="!is_login" url="/pages/mine/auth" hover-class="none"> <navigator class="row verCenter box" v-if="!is_login" url="/pages/mine/auth" hover-class="none">
<view class="row verCenter"> <view class="row verCenter">
<text class="iconfont icon-juxing"></text> <text class="iconfont icon-juxing"></text>
<text class="t1">未登录</text> <text class="t1">未登录</text>
</view> </view>
</navigator> </navigator>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<navigator class="row verCenter box" v-if="!is_login" url="/pages/mine/login" hover-class="none">
<view class="row verCenter">
<text class="iconfont icon-juxing"></text>
<text class="t1">未登录</text>
</view>
</navigator>
<!-- #endif -->
<!-- 已登录 --> <!-- 已登录 -->
<view class="row bothSide verCenter box" v-else> <view class="row bothSide verCenter box" v-else>
<view class="row verCenter"> <view class="row verCenter">
...@@ -58,6 +68,7 @@ ...@@ -58,6 +68,7 @@
is_login: false, is_login: false,
userInfo: {}, userInfo: {},
rawData: '', rawData: '',
// #ifdef MP-WEIXIN
gridList: [{ gridList: [{
name: '快递回单上传', name: '快递回单上传',
iconfont: 'icon-a-juxing1', iconfont: 'icon-a-juxing1',
...@@ -139,6 +150,20 @@ ...@@ -139,6 +150,20 @@
tips: '' tips: ''
} }
] ]
// #endif
// #ifdef APP-PLUS
gridList: [{
name: '收货登记',
iconfont: 'icon-juxing3',
tips: ''
},
{
name: '入库理货',
iconfont: 'icon-a-10cangkucangchu4',
tips: ''
}
]
// #endif
}; };
}, },
onShow() { onShow() {
...@@ -187,27 +212,37 @@ ...@@ -187,27 +212,37 @@
}); });
}, },
toUrl() { toUrl() {
// #ifdef MP-WEIXIN
uni.navigateTo({ uni.navigateTo({
url: '/pages/mine/auth' url: '/pages/mine/auth'
}); });
// #endif
// #ifdef APP-PLUS
uni.navigateTo({
url: '/pages/mine/login'
});
// #endif
}, },
gridClick(item, index) { gridClick(item, index) {
if (item.name == '快递回单上传') { if (item.name == '快递回单上传') {
this.scanChange(); this.scanChange();
} else if (item.name == '打印标签') { } else if (item.name == '打印标签') {
// #ifdef MP-WEIXIN
uni.navigateTo({ uni.navigateTo({
url: '/pages/tag/print' url: '/pages/tag/print'
}); });
//是否启用蓝牙wifi打印
// if (this.userInfo.is_new_print == 1) { // #endif
// uni.navigateTo({
// url: '/pages/tag/printNew' // #ifdef APP-PLUS
// }); uni.navigateTo({
// } else { url: '/pages/tag/printNew'
// uni.navigateTo({ });
// url: '/pages/tag/print' // #endif
// });
// }
} else if (item.name == '追加标签') { } else if (item.name == '追加标签') {
uni.navigateTo({ uni.navigateTo({
url: '/pages/tag/repairPrint' url: '/pages/tag/repairPrint'
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<template v-else> <template v-else>
<view class="logged-in row bothSide verCenter"> <view class="logged-in row bothSide verCenter">
<view class="row verCenter"> <view class="row verCenter">
<image class="uni-img" :src="userData.head_pic || 'http://img.ichunt.com/images/ichunt/minProgram/scm/14ec21333cd69cc5269772811b46b7ac.png'" mode="aspectFill"></image> <image class="uni-img" src="http://img.ichunt.com/images/ichunt/minProgram/scm/14ec21333cd69cc5269772811b46b7ac.png" mode="aspectFill"></image>
<view class="text column"> <view class="text column">
<text class="t1">{{ userInfo.name }}</text> <text class="t1">{{ userInfo.name }}</text>
<text class="t2">{{ userInfo.email }}</text> <text class="t2">{{ userInfo.email }}</text>
...@@ -25,54 +25,63 @@ ...@@ -25,54 +25,63 @@
</template> </template>
<script> <script>
import { API } from '@/util/api.js'; import { API } from '@/util/api.js';
export default { export default {
data() { data() {
return { return {
is_login: false, is_login: false,
userInfo: {} userInfo: {}
}; };
},
onShow() {
this.getData();
},
methods: {
getData() {
this.request(API.userInfo, 'POST', {}, false).then(res => {
if (res.err_code === 0) {
this.userInfo = res.data;
this.is_login = true;
} else {
this.is_login = false;
}
});
}, },
toUrl() { onShow() {
uni.navigateTo({ this.getData();
url: '/pages/mine/auth'
});
}, },
exit() { methods: {
uni.showModal({ getData() {
title: '提示', this.request(API.userInfo, 'POST', {}, false).then(res => {
content: '您确定退出系统嘛', if (res.err_code === 0) {
success: res => { this.userInfo = res.data;
if (res.confirm) { this.is_login = true;
this.request(API.unBindUserInfo, 'POST', {}, true).then(res => {}); } else {
uni.removeStorageSync('token'); this.is_login = false;
uni.switchTab({ }
url: '/pages/home/index' });
}); },
} else if (res.cancel) { toUrl() {
console.log('用户点击取消'); // #ifdef MP-WEIXIN
uni.navigateTo({
url: '/pages/mine/auth'
});
// #endif
// #ifdef APP-PLUS
uni.navigateTo({
url: '/pages/mine/login'
});
// #endif
},
exit() {
uni.showModal({
title: '提示',
content: '您确定退出系统嘛',
success: res => {
if (res.confirm) {
this.request(API.unBindUserInfo, 'POST', {}, true).then(res => {});
uni.removeStorageSync('token');
uni.switchTab({
url: '/pages/home/index'
});
} else if (res.cancel) {
console.log('用户点击取消');
}
} }
} });
}); }
} }
} };
};
</script> </script>
<style lang="scss"> <style lang="scss">
@import '../../assets/css/mine/index.scss'; @import '../../assets/css/mine/index.scss';
</style> </style>
\ No newline at end of file
...@@ -18,59 +18,59 @@ ...@@ -18,59 +18,59 @@
</template> </template>
<script> <script>
import { API } from '@/util/api.js'; import { API } from '@/util/api.js';
export default { export default {
data() { data() {
return { return {
account: '', account: '',
passwd: '' passwd: ''
}; };
}, },
onLoad(options) {}, onShareTimeline() {
onShareTimeline(res) { return {
return { title: '',
title: '', imageUrl: ''
imageUrl: '' };
}; },
}, methods: {
methods: { submit() {
submit() { if (!this.account) {
if (!this.account) { uni.showToast({
uni.showToast({ title: '请输入登录账号',
title: '请输入登录账号', icon: 'error'
icon: 'error'
});
return false;
}
if (!this.passwd) {
uni.showToast({
title: '请输入登录密码',
icon: 'error'
});
return false;
}
let unionid = uni.getStorageSync('unionid');
this.request(API.login, 'POST', { account: this.account, passwd: this.passwd, unionid: unionid }, true).then(res => {
if (res.err_code === 0) {
uni.setStorageSync('token', res.data.token);
uni.navigateBack({
delta: 3
}); });
} else { return false;
}
if (!this.passwd) {
uni.showToast({ uni.showToast({
title: res.err_msg, title: '请输入登录密码',
icon: 'error' icon: 'error'
}); });
return false;
} }
}); let unionid = uni.getStorageSync('unionid');
this.request(API.login, 'POST', { account: this.account, passwd: this.passwd, unionid: unionid }, true).then(res => {
if (res.err_code === 0) {
uni.setStorageSync('token', res.data.token);
uni.setStorageSync('email', res.data.email);
uni.navigateBack({
delta: 3
});
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
}
} }
} };
};
</script> </script>
<style lang="scss"> <style lang="scss">
@import '../../assets/css/mine/login.scss'; @import '../../assets/css/mine/login.scss';
</style> </style>
\ No newline at end of file
...@@ -123,6 +123,7 @@ ...@@ -123,6 +123,7 @@
export default { export default {
data() { data() {
return { return {
email: uni.getStorageSync('email') || '', //操作人邮箱
curr: 0, curr: 0,
arr: ['全部未装箱', '美产', '商检', '已装箱'], arr: ['全部未装箱', '美产', '商检', '已装箱'],
num: '', //异常数量总数 num: '', //异常数量总数
...@@ -298,8 +299,13 @@ ...@@ -298,8 +299,13 @@
}); });
return false; return false;
} }
this.request(API.fixBox, 'POST', { old_box_sn_str: this.old_box_sn_str }, true).then(res => { var params = {
if (res.err_code === 0) { type: 1,
email: this.email,
print_json: JSON.stringify([{ box_sn: this.box_sn }])
}
this.request(API.addSCTallyData, 'POST', params, true).then(res => {
if (res.code === 0) {
uni.showModal({ uni.showModal({
title: '', title: '',
content: '打印成功,请查看打印机', content: '打印成功,请查看打印机',
......
...@@ -222,6 +222,7 @@ ...@@ -222,6 +222,7 @@
export default { export default {
data() { data() {
return { return {
email: uni.getStorageSync('email') || '', //操作人邮箱
is_focus: true, //获取焦点动态化 is_focus: true, //获取焦点动态化
title: '', title: '',
step: 0, step: 0,
...@@ -243,7 +244,8 @@ ...@@ -243,7 +244,8 @@
form: {}, form: {},
isRequestSent: false, isRequestSent: false,
isStopRequest: false, isStopRequest: false,
gross_weight: '' gross_weight: '',
net_weight_total: 0 //净重合计
}; };
}, },
watch: { watch: {
...@@ -336,6 +338,7 @@ ...@@ -336,6 +338,7 @@
chooseImageChange(key) { chooseImageChange(key) {
this.noexebshowFalg = false; this.noexebshowFalg = false;
// 使用 chooseImage选择图片 // 使用 chooseImage选择图片
// #ifdef MP-WEIXIN
uni.chooseMedia({ uni.chooseMedia({
count: 5, count: 5,
mediaType: ['image'], mediaType: ['image'],
...@@ -413,6 +416,87 @@ ...@@ -413,6 +416,87 @@
}); });
} }
}); });
// #endif
// #ifdef APP-PLUS
uni.chooseImage({
count: 5,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: chooseImageRes => {
console.log('选择图片成功:', chooseImageRes);
// 显示loading
uni.showLoading({
title: '上传中...'
});
// 获取选择的图片路径数组
const imagePaths = chooseImageRes.tempFilePaths;
// 判断选择的图片数量是否超过最大限制数量
let maxNum = Number(imagePaths.length) + Number(this.image_list.length); //当前上传的+已经上传的
if (maxNum > 5) {
uni.hideLoading();
uni.showToast({
title: '图片不超过5张',
icon: 'none'
});
return false;
}
// 遍历图片路径数组,对每张图片进行压缩
imagePaths.forEach((imagePath) => {
// 使用compressImage 压缩图片
uni.compressImage({
src: imagePath,
quality: 60, //压缩质量,范围0~100,数值越小,质量越低,压缩率越高
success: compressedRes => {
console.log('压缩图片成功:', compressedRes);
// 获取压缩后的图片路径
const compressedImagePath = compressedRes.tempFilePath;
// 在这里处理压缩后的图片,上传到服务器
uni.uploadFile({
url: API.uploadImageHk + '?sys_type=4',
filePath: compressedImagePath,
name: 'file',
timeout: 10000,
header: {
'Content-Type': 'multipart/form-data'
},
success: uploadFileRes => {
console.log('服务器上传图片成功:', uploadFileRes);
uni.hideLoading();
let data = JSON.parse(uploadFileRes.data);
if (data.code === 0) {
this.image_list[key].push(data.data.oss_image_url);
this.$forceUpdate();
} else {
uni.showToast({
title: data.msg,
icon: 'none'
});
}
},
fail: () => {
uni.hideLoading();
uni.showToast({
title: '上传图片失败',
icon: 'none'
});
}
});
},
fail: err => {
console.log('压缩图片失败:', err);
}
});
});
}
});
// #endif
}, },
/** /**
* 预览图片 * 预览图片
...@@ -559,6 +643,7 @@ ...@@ -559,6 +643,7 @@
if (res.data.detail.length > 0) { if (res.data.detail.length > 0) {
// 使用 map 方法生成表单数组 // 使用 map 方法生成表单数组
this.form = res.data.detail.map((item) => ({ this.form = res.data.detail.map((item) => ({
tally_status: item.tally_status, //理货状态
tally_num: item.tally_num, // 入库数量 tally_num: item.tally_num, // 入库数量
origin: item.origin, // 原产地 origin: item.origin, // 原产地
net_weight: item.net_weight, // 净重 net_weight: item.net_weight, // 净重
...@@ -571,6 +656,8 @@ ...@@ -571,6 +656,8 @@
this.image_list = res.data.detail.map(() => new Array()); //图片特殊处理 this.image_list = res.data.detail.map(() => new Array()); //图片特殊处理
//还原理货的图片
res.data.detail.forEach((item, index) => { res.data.detail.forEach((item, index) => {
if (item.goods_check_pic) { if (item.goods_check_pic) {
this.image_list[index] = item.goods_check_pic.split(','); this.image_list[index] = item.goods_check_pic.split(',');
...@@ -696,7 +783,10 @@ ...@@ -696,7 +783,10 @@
* 关单封箱 * 关单封箱
*/ */
closeBox() { closeBox() {
this.title = `入仓号${this.erp_order_sn}已经全部验货完毕是否更换新的箱子?`; this.net_weight_total = this.form
.filter(item => item.tally_status === 3) // 筛选出 tally_status 等于 3 的数据
.reduce((acc, curr) => acc + parseFloat(curr.net_weight), 0); // 将 net_weight 转换为数字并计算总和
this.title = `入仓号${this.erp_order_sn}已经全部验货完毕是否更换新的箱子?\n\n总净重:${this.net_weight_total}`;
this.$refs.inputDialog.open(); this.$refs.inputDialog.open();
}, },
/** /**
...@@ -710,6 +800,23 @@ ...@@ -710,6 +800,23 @@
}); });
return false; return false;
} }
// 判断 val 是否为数字
if (isNaN(val)) {
uni.showToast({
title: '请输入合法数字',
icon: 'error'
});
return false;
}
if (Number(val) < Number(this.net_weight_total)) {
uni.showToast({
title: '毛重不能小于总净重',
icon: 'none'
});
return false;
}
this.request(API.closeBox, 'POST', { wsty_id: this.wsty_id, gross_weight: val }, true).then(res => { this.request(API.closeBox, 'POST', { wsty_id: this.wsty_id, gross_weight: val }, true).then(res => {
if (res.err_code === 0) { if (res.err_code === 0) {
uni.showToast({ uni.showToast({
...@@ -736,32 +843,9 @@ ...@@ -736,32 +843,9 @@
* 不需要换箱 * 不需要换箱
*/ */
dialogInputClose() { dialogInputClose() {
if (!this.gross_weight) { this.$refs.inputDialog.close();
uni.showToast({ this.tallyData = [];
title: '请输入毛重', this.erp_order_sn = '';
icon: 'error'
});
return false;
}
this.request(API.closeBox, 'POST', { wsty_id: this.wsty_id, gross_weight: this.gross_weight }, true).then(res => {
if (res.err_code === 0) {
uni.showToast({
title: '操作成功',
icon: 'success',
duration: 2000
});
setTimeout(() => {
this.$refs.inputDialog.close();
this.tallyData = [];
this.erp_order_sn = '';
}, 2000);
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
}, },
/** /**
* 打印箱号 * 打印箱号
...@@ -775,8 +859,13 @@ ...@@ -775,8 +859,13 @@
}); });
return false; return false;
} }
this.request(API.fixBox, 'POST', { old_box_sn_str: this.old_box_sn_str }, true).then(res => { var params = {
if (res.err_code === 0) { type: 1,
email: this.email,
print_json: JSON.stringify([{ box_sn: this.box_sn }])
}
this.request(API.addSCTallyData, 'POST', params, true).then(res => {
if (res.code === 0) {
uni.showModal({ uni.showModal({
title: '', title: '',
content: '打印成功,请查看打印机', content: '打印成功,请查看打印机',
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
export default { export default {
data() { data() {
return { return {
email: uni.getStorageSync('email') || '', //操作人邮箱
is_focus: true, //获取焦点动态化 is_focus: true, //获取焦点动态化
box_sn: '' box_sn: ''
}; };
...@@ -27,8 +28,13 @@ ...@@ -27,8 +28,13 @@
}); });
return false; return false;
} }
this.request(API.fixBox, 'POST', { old_box_sn_str: this.old_box_sn_str }, true).then(res => { var params = {
if (res.err_code === 0) { type: 1,
email: this.email,
print_json: JSON.stringify([{ box_sn: this.box_sn }])
}
this.request(API.addSCTallyData, 'POST', params, true).then(res => {
if (res.code === 0) {
uni.showModal({ uni.showModal({
title: '', title: '',
content: '打印成功,请查看打印机', content: '打印成功,请查看打印机',
......
...@@ -196,6 +196,18 @@ ...@@ -196,6 +196,18 @@
this.request(API.askCustomerProblemListV2, 'GET', this.searchParams, true).then(res => { this.request(API.askCustomerProblemListV2, 'GET', this.searchParams, true).then(res => {
if (res.err_code === 0) { if (res.err_code === 0) {
this.list = res.data.data; this.list = res.data.data;
} else if (res.err_code == 20045) {
// #ifdef MP-WEIXIN
uni.navigateTo({
url: '/pages/mine/auth'
});
// #endif
// #ifdef APP-PLUS
uni.navigateTo({
url: '/pages/mine/login'
});
// #endif
} else { } else {
uni.showToast({ uni.showToast({
title: res.err_msg, title: res.err_msg,
...@@ -212,11 +224,6 @@ ...@@ -212,11 +224,6 @@
if (res.err_code === 0) { if (res.err_code === 0) {
this.ask_customer_status_one_num = res.data.ask_customer_status_one_num; //商务已回复更新统计数量 this.ask_customer_status_one_num = res.data.ask_customer_status_one_num; //商务已回复更新统计数量
this.ask_customer_status_two_num = res.data.ask_customer_status_two_num; //等待回复更新统计数量 this.ask_customer_status_two_num = res.data.ask_customer_status_two_num; //等待回复更新统计数量
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
} }
}); });
}, },
......
...@@ -299,9 +299,9 @@ const API = { ...@@ -299,9 +299,9 @@ const API = {
*/ */
cancelRelease: API_BASE + '/supplywechatwms/cancelRelease', cancelRelease: API_BASE + '/supplywechatwms/cancelRelease',
/** /**
* 识别二维码的数量和型号 * 供应链理货打印 - 箱号标签
* */ */
identifyQrCodeNumAndSn: API_BASE_WMS + '/api/stockIn/identifyQrCodeNumAndSn', addSCTallyData: API_BASE_WMS + '/open/label/addSCTallyData'
} }
......
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