Commit 80ed84f1 by LJM

移动端--理货--digikey扫码识别型号优化

parent 6282268f
Showing with 24 additions and 12 deletions
......@@ -200,7 +200,7 @@
import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce';
var that = '';
export default {
data() {
return {
......@@ -267,6 +267,7 @@
}
},
onShow() {
that = this;
if (this.noexebshowFalg) {
this.resetChange();
this.getData();
......@@ -484,7 +485,7 @@
this.input_flag = false;
this.getData();
}
}, 2000),
}, that.index == 3 ? 0 : 500),
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
......@@ -553,8 +554,19 @@
* @param {Object} code_type 供应商类型(DigKey,Rochester,TME,Chip1stop)
*/
identifyQrCodeNumAndSn(code_str, code_type) {
console.log(code_str);
this.request(API.identifyQrCodeNumAndSn, 'POST', { code_str: code_str, code_type: code_type }, true).then(res => {
// 找到第一个1P的位置
var index = code_str.indexOf('1P');
var result = '';
if (index !== -1) {
// 从第七位开始截取直到第一个1P的位置
var result = code_str.substring(6, index);
} else {
uni.showToast({
title: '未识别到匹配的内容',
icon: 'error'
});
}
this.request(API.identifyQrCodeNumAndSn, 'POST', { code_str: result, code_type: code_type }, true).then(res => {
if (res.code === 0) {
this.searchParams.goods_name = res.data.sn; //赋值检索出来的型号
this.getData();
......
// const API_BASE_USER = 'http://user.liexindev.net'; //用户系统
// const API_BASE_PUR = 'http://pur.liexindev.net'; //采购系统
// const API_BASE = 'http://wms.liexindev.net'; //WMS系统
// const API_BASE_OSS = 'http://image.liexindev.net'; //oss系统
const API_BASE_USER = 'http://user.liexindev.net'; //用户系统
const API_BASE_PUR = 'http://pur.liexindev.net'; //采购系统
const API_BASE = 'http://wms.liexindev.net'; //WMS系统
const API_BASE_OSS = 'http://image.liexindev.net'; //oss系统
const API_BASE_USER = 'https://user.ichunt.net'; //用户系统
const API_BASE_PUR = 'https://purchase.ichunt.net'; //采购系统
const API_BASE = 'https://wms.ichunt.net'; //WMS系统
const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统
// const API_BASE_USER = 'https://user.ichunt.net'; //用户系统
// const API_BASE_PUR = 'https://purchase.ichunt.net'; //采购系统
// const API_BASE = 'https://wms.ichunt.net'; //WMS系统
// const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统
const API = {
......
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