批量输入的字符,分割成数组后做前后去空格的处理

This commit is contained in:
liuyp 2024-07-18 15:40:30 +08:00
parent 953c143a3b
commit 2ffb0f9a4c
17 changed files with 20 additions and 3 deletions

View File

@ -265,6 +265,7 @@ export default {
let haveCode = null;
let dm = this.dataMap;
let scList=bcList.map(function(code) {
code = code.trim();
if(dm[code+"30"] || dm[code+"40"]){
haveCode = code;
return;

View File

@ -251,6 +251,7 @@ export default {
let haveCode = null;
let dm = this.dataMap;
let scList=bcList.map(function(code) {
code = code.trim();
if(dm[code]){
haveCode = code;
return;

View File

@ -268,6 +268,7 @@ export default {
let haveCode = null;
let dm = this.dataMap;
let scList=bcList.map(function(code) {
code = code.trim();
if(dm[code]){
haveCode = code;
return;

View File

@ -259,6 +259,7 @@ export default {
let haveCode = null;
let dm = this.dataMap;
let scList=bcList.map(function(code) {
code = code.trim();
if(dm[code]){
haveCode = code;
return;

View File

@ -262,6 +262,7 @@ export default {
let haveCode = null;
let dm = this.dataMap;
let scList=bcList.map(function(code) {
code = code.trim();
if(dm[code]){
haveCode = code;
return;

View File

@ -253,6 +253,7 @@ export default {
let haveCode = null;
let dm = this.dataMap;
let scList=bcList.map(function(code) {
code = code.trim();
if(dm[code]){
haveCode = code;
return;

View File

@ -264,6 +264,7 @@ export default {
let haveCode = null;
let dm = this.dataMap;
let scList=bcList.map(function(code) {
code = code.trim();
if(dm[code]){
haveCode = code;
return;

View File

@ -261,6 +261,7 @@ export default {
let haveCode = null;
let dm = this.dataMap;
let scList=bcList.map(function(code) {
code = code.trim();
if(dm[code]){
haveCode = code;
return;

View File

@ -262,6 +262,7 @@ export default {
let haveCode = null;
let dm = this.dataMap;
let scList=bcList.map(function(code) {
code = code.trim();
if(dm[code]){
haveCode = code;
return;

View File

@ -252,6 +252,7 @@ export default {
let haveCode = null;
let dm = this.dataMap;
let scList=bcList.map(function(code) {
code = code.trim();
if(dm[code]){
haveCode = code;
return;

View File

@ -321,6 +321,7 @@ export default {
}
let bcList=this.formBatch.billCode.split(/[;\;\,\,\n]/)||[];
bcList.forEach((code) => {
code = code.trim();
this.getDetail(code, true)
})
this.openBatch=false;

View File

@ -243,6 +243,7 @@ export default {
let haveCode = null;
let dm = this.dataMap;
let scList=bcList.map(function(code) {
code = code.trim();
if(dm[code]){
haveCode = code;
return;

View File

@ -330,6 +330,7 @@ export default {
let haveCode = null;
let dm = this.dataMap;
let scList=bcList.map(function(code) {
code = code.trim();
if(dm[code+"10"] || dm[code+"20"]){
haveCode = code;
return;

View File

@ -245,6 +245,7 @@ export default {
let haveCode = null;
let dm = this.dataMap;
let scList=bcList.map(function(code) {
code = code.trim();
if(dm[code]){
haveCode = code;
return;

View File

@ -237,6 +237,7 @@ export default {
let haveCode = null;
let dm = this.dataMap;
let scList=bcList.map(function(code) {
code = code.trim();
if(dm[code]){
haveCode = code;
return;

View File

@ -1536,6 +1536,8 @@ export default {
let bcList=this.formBatchBillList.trim().split(/[;\;\,\,\n]/)||[];
bcList.forEach(async (billcode) => {
billcode = billcode.trim();
if(this.emisCoPackDetail.filter(wb => wb.billCode == billcode).length == 0){
let billRes = await listEmisWaybill({billCode:billcode});
if(!billRes || billRes.code != 200 || !billRes.rows || billRes.rows.length < 1){

View File

@ -669,12 +669,12 @@ export default {
// return;
// }
// }
let exitlist = this.emisWaybillList.filter(item => (item.billCode == bcList[bc] && item.problemId == this.form.problemId));
let exitlist = this.emisWaybillList.filter(item => (item.billCode == bcList[bc].trim() && item.problemId == this.form.problemId));
if(exitlist.length > 0){
this.$message.error("单号:"+ bcList[bc] + ", 已存在");
this.$message.error("单号:"+ bcList[bc].trim() + ", 已存在");
continue;
}else{
await this.addToList(bcList[bc]);
await this.addToList(bcList[bc].trim());
}
}
this.loading = false;