Commit dfe1976f by liangjianmin

bug

parent f6bc895c
...@@ -9,6 +9,6 @@ ...@@ -9,6 +9,6 @@
</head> </head>
<body> <body>
<div id="app"><!--app-html--></div> <div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script> <script type="module" src="/main.js"></script>
</body> </body>
</html> </html>
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
<script> <script>
import { API } from '@/util/api.js'; import { API } from '@/util/api.js';
import { titleCase } from '@/util/util.js';
import w_md5 from '../../js_sdk/zww-md5/w_md5.js'; import w_md5 from '../../js_sdk/zww-md5/w_md5.js';
export default { export default {
...@@ -146,8 +147,9 @@ export default { ...@@ -146,8 +147,9 @@ export default {
this.form.info_pic.splice(index, 1); this.form.info_pic.splice(index, 1);
}, },
scanChange() { scanChange() {
this.form.logistics_number = '';
uni.scanCode({ uni.scanCode({
success: function(res) { success: res => {
console.log(res); console.log(res);
if (res.errMsg == 'scanCode:ok') { if (res.errMsg == 'scanCode:ok') {
this.form.logistics_number = res.result; this.form.logistics_number = res.result;
...@@ -214,6 +216,26 @@ export default { ...@@ -214,6 +216,26 @@ export default {
}); });
}, },
submit() { submit() {
if (this.delivery_method_index == 0) {
if (!this.form.logistics_company) {
uni.showModal({
title: '提示',
content: '请选择物流公司',
showCancel: false
});
return false;
}
if (!this.form.logistics_number) {
uni.showModal({
title: '提示',
content: '请输入物流单号',
showCancel: false
});
return false;
}
}
if (this.form.info_pic.length <= 0) { if (this.form.info_pic.length <= 0) {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
...@@ -229,6 +251,17 @@ export default { ...@@ -229,6 +251,17 @@ export default {
return false; return false;
} }
//如果选择的fedex就截取后12位
if (this.delivery_method_index == 0) {
let str = this.form.logistics_number;
this.form.logistics_number = str.substring(str.length - 12);
}
//自动转成大写
if (this.form.erp_order_sn) {
this.form.erp_order_sn = titleCase(this.form.erp_order_sn);
}
this.request(API.addUnusualCheckIn, 'POST', this.form, true).then(res => { this.request(API.addUnusualCheckIn, 'POST', this.form, true).then(res => {
if (res.err_code === 0) { if (res.err_code === 0) {
uni.showModal({ uni.showModal({
......
...@@ -126,8 +126,9 @@ export default { ...@@ -126,8 +126,9 @@ export default {
}); });
}, },
scanChange() { scanChange() {
this.form.logistics_number = '';
uni.scanCode({ uni.scanCode({
success: function(res) { success: res => {
console.log(res); console.log(res);
if (res.errMsg == 'scanCode:ok') { if (res.errMsg == 'scanCode:ok') {
this.form.logistics_number = res.result; this.form.logistics_number = res.result;
...@@ -271,6 +272,12 @@ export default { ...@@ -271,6 +272,12 @@ export default {
this.form.erp_order_sn = titleCase(this.form.erp_order_sn); //自动转成大写 this.form.erp_order_sn = titleCase(this.form.erp_order_sn); //自动转成大写
//如果选择的fedex就截取后12位
if (this.index == 0) {
let str = this.form.logistics_number;
this.form.logistics_number = str.substring(str.length - 12);
}
this.request(API.addCheckIn, 'POST', this.form, true).then(res => { this.request(API.addCheckIn, 'POST', this.form, true).then(res => {
if (res.err_code === 0) { if (res.err_code === 0) {
uni.showToast({ uni.showToast({
......
...@@ -118,7 +118,7 @@ export default { ...@@ -118,7 +118,7 @@ export default {
}); });
} }
}, },
fail: res => { fail: res => {
console.log(res); console.log(res);
uni.showToast({ uni.showToast({
title: '扫码失败', title: '扫码失败',
......
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