更改组批次的追加方式
This commit is contained in:
parent
578912c6f4
commit
953c143a3b
@ -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,79 @@ 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) => {
|
||||
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 +1875,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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user