diff --git a/src/views/emis/emisTmsSiteBatch/panel/BatchImportSiteBatch.vue b/src/views/emis/emisTmsSiteBatch/panel/BatchImportSiteBatch.vue index 2a5e1dab..25e1a019 100644 --- a/src/views/emis/emisTmsSiteBatch/panel/BatchImportSiteBatch.vue +++ b/src/views/emis/emisTmsSiteBatch/panel/BatchImportSiteBatch.vue @@ -103,6 +103,7 @@ import { listSimpleEmisSite } from "@/api/emis/emisSite"; import { listSimpleEmisSupplier } from "@/api/emis/emisSupplier"; import { listEmisTmsSiteBatchDtl, delEmisTmsSiteBatchDtl, addEmisTmsSiteBatchDtl } from "@/api/emis/emisTmsSiteBatchDtl"; import { listEmisWaybill } from "@/api/emis/emisWaybill"; +import { listSimpleEmisCountry} from "@/api/emis/emisCountry"; import { parseTime,parseExcelTime } from "@/utils/custom"; import {timeDiffTime,timeFormat} from '@/utils/dateUtils' @@ -493,6 +494,21 @@ export default { postForm.nextSiteName=nextSite.siteName; postForm.nextSiteSizeCode3=nextSite.sizeCode3||'-'; + if(itemData.destCountry){ + let country = await this.getCountryByName(itemData.destCountry); + if(country==null){ + let rst = { + code:500, + msg:'目的国不存在', + data:{ + result:'fail' + } + } + return rst; + } + postForm.destCountry=country.code; + } + // 供应商 let supplier=await this.getSupplierByName(itemData.supplierName); if(supplier==null){ @@ -669,6 +685,22 @@ export default { } return resStartSite.rows[0]; }, + async getCountryByName(name){ + // 计算网点是否存在 + let qParam = { + pageNum:1, + pageSize:1, + name:name + }; + let rst = await listSimpleEmisCountry(qParam); + if(!rst || rst.code != 200){ + return null; + } + if(rst.rows==null || rst.rows.length==0){ + return null; + } + return rst.rows[0]; + }, async getSupplierByName(supplierName){ // 计算网点是否存在 let qParam = {