Commit dfe1976f by liangjianmin

bug

parent f6bc895c
......@@ -85,6 +85,7 @@
<script>
import { API } from '@/util/api.js';
import { titleCase } from '@/util/util.js';
import w_md5 from '../../js_sdk/zww-md5/w_md5.js';
export default {
......@@ -146,8 +147,9 @@ export default {
this.form.info_pic.splice(index, 1);
},
scanChange() {
this.form.logistics_number = '';
uni.scanCode({
success: function(res) {
success: res => {
console.log(res);
if (res.errMsg == 'scanCode:ok') {
this.form.logistics_number = res.result;
......@@ -214,6 +216,26 @@ export default {
});
},
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) {
uni.showModal({
title: '提示',
......@@ -229,6 +251,17 @@ export default {
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 => {
if (res.err_code === 0) {
uni.showModal({
......
......@@ -126,8 +126,9 @@ export default {
});
},
scanChange() {
this.form.logistics_number = '';
uni.scanCode({
success: function(res) {
success: res => {
console.log(res);
if (res.errMsg == 'scanCode:ok') {
this.form.logistics_number = res.result;
......@@ -271,6 +272,12 @@ export default {
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 => {
if (res.err_code === 0) {
uni.showToast({
......
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