This commit is contained in:
linfso 2024-07-18 20:05:59 +08:00
commit a9f50bc4be
17 changed files with 123 additions and 6 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

@ -669,6 +669,21 @@
</XdTable>
</el-dialog>
<el-dialog :title="titleBatch" :visible.sync="openBatch" width="50%" v-dialogDrag :close-on-click-modal="false" append-to-body>
<el-form ref="formBatch" :model="formBatch" :rules="rulesBatch" size="mini" label-width="60px">
<el-row>
<el-col :span="24">
<el-form-item :label="$t('运单号')" prop="formBatchBillList">
<el-input v-model="formBatchBillList" type="textarea" :rows="8" placeholder="运单号" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align:center">
<el-button type="primary" @click="submitFormBatch">确 定</el-button>
<el-button @click="cancelBatch">取 消</el-button>
</div>
</el-dialog>
<el-dialog :title="titleWayBill" :visible.sync="openWayBillForm" width="90%" @close="handleCloseWayBill" :destroy-on-close="true" v-dialogDrag append-to-body>
<el-form ref="formCo" size="mini" :model="wayBillData" label-width="100px" class="overflowhidden" >
@ -837,7 +852,7 @@
import { listEmisTmsSiteBatch, getTmsGroupBatchNo, getEmisTmsSiteBatch, delEmisTmsSiteBatch, addEmisTmsSiteBatch, updateEmisTmsSiteBatch } from "@/api/emis/emisTmsSiteBatch";
import { listEmisTmsSiteBatchDtl, delEmisTmsSiteBatchDtl, addEmisTmsSiteBatchDtl } from "@/api/emis/emisTmsSiteBatchDtl";
import { addEmisTmsSiteBatchLoading, listEmisTmsSiteBatchLoading, updateEmisTmsSiteBatchLoading } from "@/api/emis/emisTmsSiteBatchLoading";
import { listEmisWaybill } from "@/api/emis/emisWaybill";
import { listEmisWaybill, getWaybillDetail } from "@/api/emis/emisWaybill";
// import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
import emisTmsPackForm from '@/views/emis/emisTmsPack/emisTmsPackForm';
import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker';
@ -897,6 +912,11 @@ export default {
coData: {
},
openBatch: false,
titleBatch: "",
formBatchBillList:"",
// 新增/修改包详情数据
emisCoPackDetail:[],
blUnpack:"1",
@ -1508,6 +1528,81 @@ export default {
this.tempCoPackList = selection;
this.tempCoPackList.length > 0 ? this.addWayBillDisabled = false : this.addWayBillDisabled = true;
},
async submitFormBatch(){
if(this.formBatchBillList==null || this.formBatchBillList==''){
this.$message.error("请输入单号");
return;
}
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){
this.$modal.msgError((response && response.msg || '无此运单数据') + ": " + billcode)
return;
}
let item = billRes.rows[0];
this.emisCoPackDetail.push(item);
if(this.coPackType=="edit"){
let packDetail = {
batchNo: this.coData.batchNo,
billCode: item.billCode,
scanDate: item.scanDate,
scanStatus: item.scanStatus,
groupStatus: "1",//已组批次
scanMan: item.scanMan,
scanSite: item.scanSite,
createBy: this.$store.getters.empCode,
createTime: parseTime(new Date())
};
let response = await addEmisTmsSiteBatchDtl(packDetail);
if(!response || response.code != 200){
this.$modal.msgError(response && response.msg || '组批次明细新增失败')
return;
}
}
}
})
this.titleBatch="";
this.openBatch=false;
this.formBatchBillList = "";
this.wayBillData = {
pageNum: 1,
pageSize: 20,
params:{}
};
this.emisWayBillList=[];
this.tempCoPackList=[];
this.addWayBillDisabled = true;
this.wayBillotal=0;
this.computeTotal();
// 更新主表
if(this.coPackType=="edit"){
this.tempCoPackInfo.batchName = this.coData.batchName;
this.tempCoPackInfo.transType = this.coData.transType;
this.tempCoPackInfo.startSiteCode = this.coData.startSiteCode;
this.tempCoPackInfo.startSiteName = this.coData.startSiteName || null;
this.tempCoPackInfo.nextSiteCode = this.coData.nextSiteCode;
this.tempCoPackInfo.airBilllNo = this.coData.airBilllNo;
this.tempCoPackInfo.etd = this.coData.etd;
this.tempCoPackInfo.carNo = this.coData.carNo;
this.tempCoPackInfo.destCountry = this.coData.destCountry;
this.tempCoPackInfo.shipNo = this.coData.shipNo;
this.tempCoPackInfo.totalWaybillQty = this.coData.totalWaybillQty;
this.tempCoPackInfo.totalParcelQty = this.coData.totalParcelQty;
this.tempCoPackInfo.totalWeight = this.coData.totalWeight;
this.tempCoPackInfo.totalVolume = this.coData.totalVolume;
this.tempCoPackInfo.loadingFile = this.coData.loadingFile;
let res = await updateEmisTmsSiteBatch(this.tempCoPackInfo);
if(!res || res.code != 200){
this.$modal.msgError(res && res.msg || '未知错误')
return;
}
}
},
async handleCoAdd(){
this.tempCoPackList.forEach(async (item) => {
if(this.emisCoPackDetail.filter(wb => wb.billCode == item.billCode).length == 0){
@ -1782,8 +1877,15 @@ export default {
this.$modal.msgError("请先选择必填项")
return;
}
this.openWayBillForm= true;
this.titleWayBill = "运单列表";
// this.openWayBillForm= true;
// this.titleWayBill = "运单列表";
this.openBatch = true;
this.titleBatch = "批量输入运单号";
},
cancelBatch(){
this.openBatch=false;
this.titleBatch = "";
this.formBatchBillList = "";
},
handleShowMoreInput(){
this.moreInputVisible = !this.moreInputVisible;

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;