md
This commit is contained in:
parent
f639e4a4ba
commit
ea4d4dd574
@ -8,6 +8,8 @@
|
||||
</template>
|
||||
<div>
|
||||
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="运单号" prop="billCode" >
|
||||
<div style="display:inline-flex">
|
||||
@ -30,7 +32,6 @@
|
||||
<el-col :span="10">
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="6">
|
||||
<el-form-item label="目的国" prop="reciever.country">
|
||||
<CountryPicker0 v-model="form.reciever.country"></CountryPicker0>
|
||||
@ -193,8 +194,11 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="寄件公司" prop="sender.company">
|
||||
<el-input v-model="form.sender.company" placeholder="" />
|
||||
<el-form-item label="寄件公司" prop="sender.company"
|
||||
:rules="form.paymentType != 2 ? rules.sender.company : []"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.sender.company" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
@ -255,7 +259,9 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="收件公司" prop="reciever.company">
|
||||
<el-form-item label="收件公司" prop="reciever.company"
|
||||
:rules="form.paymentType != 4 ? rules.reciever.company : []"
|
||||
>
|
||||
<el-input v-model="form.reciever.company" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -321,7 +327,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="总件数" prop="parcelQty" label-width="70px">
|
||||
<el-input v-model="form.parcelQty" style="text-align: right;" @blur="handleGenGoods" @keyup.enter.native="handleGenGoods" placeholder="" />
|
||||
<el-input v-model="form.parcelQty" style="text-align: right;" @blur="handleInitGenGoods" @keyup.enter.native="handleInitGenGoods" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@ -383,22 +389,39 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="cargoQty" label="件数" align="center" width="60">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.cargoQty" size="mini" placeholder=""></el-input>
|
||||
<el-input v-model="scope.row.cargoQty" @blur="(val)=>handleCargoQtyChange(val,scope.row)" @keyup.enter.native="(val)=>handleCargoQtyChange(val,scope.row)" size="mini" placeholder=""></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- @input="(val)=>handleCalcQty(val,scope.row)" -->
|
||||
<!-- <el-table-column prop="goodsName" label="描述" align="center" width="100">
|
||||
<!-- <el-table-column prop="goodsName" label="描述" align="center" width="60">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.goodsName" @input="(val)=>handleCalcQty(val,scope.row)" size="mini" placeholder=""></el-input>
|
||||
<el-input v-model="scope.row.goodsName" size="mini" placeholder=""></el-input>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
|
||||
<el-table-column label="操作" align="left" min-width="50">
|
||||
<template slot-scope="scope">
|
||||
|
||||
<!-- <span style="cursor: pointer;font-size: 21px;color: #6e6e6e;" title="删除"
|
||||
@click="()=>{deleteGoodsItem(scope.row);event.stopPropagation()}"
|
||||
>
|
||||
<i class="el-icon-delete" />
|
||||
</span>
|
||||
|
||||
|
||||
<span style="cursor: pointer;font-size: 21px;color: #6e6e6e;" title="复制"
|
||||
@click="()=>{copyGoodsItem(scope.row);event.stopPropagation()}"
|
||||
>
|
||||
<i class="el-icon-copy-document" />
|
||||
</span> -->
|
||||
|
||||
<span class="icon iconfont"
|
||||
style="cursor: pointer;font-size: 21px;color: #6e6e6e;"
|
||||
@click="()=>deleteGoodsItem(scope.row)"></span>
|
||||
@click="()=>deleteGoodsItem(scope.row,scope.$index)"></span>
|
||||
<span class="icon iconfont"
|
||||
style="cursor: pointer;font-size: 21px;color: #6e6e6e;"
|
||||
@click="()=>copyGoodsItem(scope.row,scope.$index)"></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -628,29 +651,25 @@
|
||||
<el-col :span="12">
|
||||
</el-col>
|
||||
<el-col :span="24" v-show="form.paymentType == 2 || form.paymentType == 4 || form.paymentType == 5">
|
||||
<el-form-item label="月结账号" prop="thirdCustomerCode" label-width="70px">
|
||||
<el-form-item label="月结账号" prop="custNo" label-width="70px">
|
||||
<EmisMonthpayAccountPicker v-model="form.custNo" @onChange="onSelectMonthUser"></EmisMonthpayAccountPicker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="回款联系人" prop="payee" label-width="80px">
|
||||
<el-form-item label="回款联系人" prop="payee" label-width="85px">
|
||||
<PayeePicker v-if="form.paymentType == 2 || form.paymentType == 4 || form.paymentType == 5" :placeholder="$t('回款联系人')" v-model="form.payee" :disabled="true" ></PayeePicker>
|
||||
<PayeePicker v-else :placeholder="$t('回款联系人')" v-model="form.payee" ></PayeePicker>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="销售联系人" prop="salesmen" label-width="80px">
|
||||
<el-form-item label="销售联系人" prop="salesmen" label-width="85px">
|
||||
<SalemanPicker v-if="form.paymentType == 2 || form.paymentType == 4 || form.paymentType == 5" :placeholder="$t('销售联系人')" v-model="form.salesmen" :disabled="true" ></SalemanPicker>
|
||||
<SalemanPicker v-else :placeholder="$t('销售联系人')" v-model="form.salesmen" ></SalemanPicker>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
|
||||
</el-col>
|
||||
@ -827,6 +846,9 @@ data() {
|
||||
province: [
|
||||
{ required: true, message: "省不能为空", trigger: ["blur",'change'] }
|
||||
],
|
||||
company: [
|
||||
{ required: true, message: "发件公司不能为空", trigger: ["blur",'change'] }
|
||||
],
|
||||
// city: [
|
||||
// { required: true, message: "市不能为空", trigger: "blur" }
|
||||
// ],
|
||||
@ -850,6 +872,10 @@ data() {
|
||||
province: [
|
||||
{ required: true, message: "寄件省不能为空", trigger: ["blur",'change'] }
|
||||
],
|
||||
company: [
|
||||
{ required: true, message: "发件公司不能为空", trigger: ["blur",'change'] }
|
||||
],
|
||||
|
||||
// city: [
|
||||
// { required: true, message: "寄件市不能为空", trigger: "blur" }
|
||||
// ],
|
||||
@ -917,12 +943,15 @@ data() {
|
||||
dispatchUnderlingSiteCode: [
|
||||
{ required: true, message: "目的地网点代码不能为空", trigger: "blur" }
|
||||
],
|
||||
// payee: [
|
||||
// { required: true, message: "销售回款人不能为空", trigger: "blur" }
|
||||
// ],
|
||||
// salesmen: [
|
||||
// { required: true, message: "销售联系人不能为空", trigger: "blur" }
|
||||
// ],
|
||||
custNo: [
|
||||
{ required: true, message: "月结卡号不能为空", trigger: "blur" }
|
||||
],
|
||||
payee: [
|
||||
{ required: true, message: "销售回款人不能为空", trigger: "blur" }
|
||||
],
|
||||
salesmen: [
|
||||
{ required: true, message: "销售联系人不能为空", trigger: "blur" }
|
||||
],
|
||||
takePieceEmployeeCode: [
|
||||
{ required: true, message: "取件员代码不能为空", trigger: ["blur",'change'] }
|
||||
],
|
||||
@ -1049,76 +1078,101 @@ methods: {
|
||||
this.printerStatusMessage="打印组件已断开!";
|
||||
},
|
||||
handleBatchPrint(){
|
||||
|
||||
if(this.form.billCode){
|
||||
// 重要,设置为true才会把右上角X和取消区分开来
|
||||
this.$confirm("确定打印?", "提示", {
|
||||
cancelButtonText: "不打印",
|
||||
confirmButtonText: "确定打印",
|
||||
type: "warning",
|
||||
distinguishCancelAndClose: true,
|
||||
closeOnClickModal: false
|
||||
}).then(() => {
|
||||
// 打印主单,子单
|
||||
let orderList=[];
|
||||
// this.currentSelection.forEach(item=>{
|
||||
// orderList.push(item.billCode);
|
||||
// });
|
||||
// 打印主单
|
||||
orderList.push(this.form.billCode);
|
||||
let selPrinterName=this.tanexPrinter.getDefaultPrinter();
|
||||
let selTplName="探路速运-主单联(通用)";
|
||||
this.tanexPrinter.batchPrint(selTplName,selPrinterName,orderList)
|
||||
if(this.printerStatus == 1){
|
||||
if(this.form.billCode){
|
||||
// 重要,设置为true才会把右上角X和取消区分开来
|
||||
this.$confirm("确定打印?", "提示", {
|
||||
cancelButtonText: "不打印",
|
||||
confirmButtonText: "确定打印",
|
||||
type: "warning",
|
||||
distinguishCancelAndClose: true,
|
||||
closeOnClickModal: false
|
||||
}).then(() => {
|
||||
// 打印主单,子单
|
||||
let orderList=[];
|
||||
// this.currentSelection.forEach(item=>{
|
||||
// orderList.push(item.billCode);
|
||||
// });
|
||||
// 打印主单
|
||||
orderList.push(this.form.billCode);
|
||||
let selPrinterName=this.tanexPrinter.getDefaultPrinter();
|
||||
let selTplName="探路速运-主单联(通用)";
|
||||
this.tanexPrinter.batchPrint(selTplName,selPrinterName,orderList)
|
||||
|
||||
|
||||
// 打印子单
|
||||
selTplName="探路速运-子单联(通用)";
|
||||
// 打印子单
|
||||
selTplName="探路速运-子单联(通用)";
|
||||
|
||||
let childOrderList=[]
|
||||
orderList=this.form.billCodeSub.split(',');
|
||||
orderList.forEach(item=>{
|
||||
if(item!=null && item!=''){
|
||||
childOrderList.push(item);
|
||||
}
|
||||
});
|
||||
this.tanexPrinter.batchPrint(selTplName,selPrinterName,childOrderList)
|
||||
let childOrderList=[]
|
||||
orderList=this.form.billCodeSub.split(',');
|
||||
orderList.forEach(item=>{
|
||||
if(item!=null && item!=''){
|
||||
childOrderList.push(item);
|
||||
}
|
||||
});
|
||||
this.tanexPrinter.batchPrint(selTplName,selPrinterName,childOrderList)
|
||||
|
||||
|
||||
}).catch(() => {});
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.$confirm("打印组件未连接,可【返回操作】稍后打印,或【操作下一单】", "提示", {
|
||||
cancelButtonText: "返回操作",
|
||||
confirmButtonText: "操作下一单",
|
||||
type: "warning",
|
||||
distinguishCancelAndClose: true,
|
||||
closeOnClickModal: false
|
||||
}).then(() => {
|
||||
this.reset();
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
async handlePrintPreview(){
|
||||
|
||||
if(this.form.billCode){
|
||||
let pdfUrlList=[];
|
||||
let selPrinterName=this.tanexPrinter.getDefaultPrinter();
|
||||
let selTplName="探路速运-主单联(通用)";
|
||||
let url=this.tanexPrinter.getPdfUrl(this.form.billCode,selTplName,selPrinterName);
|
||||
pdfUrlList.push(url)
|
||||
// 子单url
|
||||
if(this.form.billCodeSub){
|
||||
selTplName="探路速运-子单联(通用)";
|
||||
let orderList=this.form.billCodeSub.split(',');
|
||||
orderList.forEach(item=>{
|
||||
if(item!=null && item!=''){
|
||||
let url=this.tanexPrinter.getPdfUrl(item,selTplName,selPrinterName);
|
||||
pdfUrlList.push(url)
|
||||
}
|
||||
if(this.printerStatus == 1){
|
||||
if(this.form.billCode){
|
||||
let pdfUrlList=[];
|
||||
let selPrinterName=this.tanexPrinter.getDefaultPrinter();
|
||||
let selTplName="探路速运-主单联(通用)";
|
||||
let url=this.tanexPrinter.getPdfUrl(this.form.billCode,selTplName,selPrinterName);
|
||||
pdfUrlList.push(url)
|
||||
// 子单url
|
||||
if(this.form.billCodeSub){
|
||||
selTplName="探路速运-子单联(通用)";
|
||||
let orderList=this.form.billCodeSub.split(',');
|
||||
orderList.forEach(item=>{
|
||||
if(item!=null && item!=''){
|
||||
let url=this.tanexPrinter.getPdfUrl(item,selTplName,selPrinterName);
|
||||
pdfUrlList.push(url)
|
||||
}
|
||||
});
|
||||
}
|
||||
let pdfUtils=new PdfUtils({});
|
||||
const loadingInstance = this.$loading({
|
||||
text: '正在生成预览...'
|
||||
})
|
||||
pdfUtils.mergePdf2(pdfUrlList, (new Date()).getTime()+".pdf" )
|
||||
.then(url=>{
|
||||
loadingInstance.close();
|
||||
this.pdfUrl=url;
|
||||
this.openPdfView = true;
|
||||
})
|
||||
.catch(error => {
|
||||
});
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.$confirm("打印组件未连接,可【返回操作】稍后打印,或【操作下一单】", "提示", {
|
||||
cancelButtonText: "返回操作",
|
||||
confirmButtonText: "操作下一单",
|
||||
type: "warning",
|
||||
distinguishCancelAndClose: true,
|
||||
closeOnClickModal: false
|
||||
}).then(() => {
|
||||
this.reset();
|
||||
});
|
||||
}
|
||||
let pdfUtils=new PdfUtils({});
|
||||
const loadingInstance = this.$loading({
|
||||
text: '正在生成预览...'
|
||||
})
|
||||
pdfUtils.mergePdf2(pdfUrlList, (new Date()).getTime()+".pdf" )
|
||||
.then(url=>{
|
||||
loadingInstance.close();
|
||||
this.pdfUrl=url;
|
||||
this.openPdfView = true;
|
||||
})
|
||||
.catch(error => {
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
@ -1155,20 +1209,7 @@ methods: {
|
||||
})
|
||||
|
||||
},
|
||||
deleteGoodsItem(row){
|
||||
this.$confirm('确定删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let newList = this.form.cargoList.filter(item => item.goodsName !== row.goodsName);
|
||||
this.form.cargoList=newList;
|
||||
this.handleCalcQty();
|
||||
this.handleCalcVolume();
|
||||
}).catch(() => {
|
||||
})
|
||||
|
||||
},
|
||||
lpadZero(val,len) {
|
||||
return (new Array(len + 1).join('0') + val).slice(-len);
|
||||
},
|
||||
@ -1178,10 +1219,10 @@ methods: {
|
||||
for(let i=1;i<=this.form.parcelQty;i++){
|
||||
let subBillCode = this.form.billCode+""+this.lpadZero(i,4);
|
||||
billSubCodeStr=billSubCodeStr+subBillCode+","
|
||||
console.log(billSubCodeStr);
|
||||
// console.log(billSubCodeStr);
|
||||
}
|
||||
// let billSubCodeStr = this.form.billCode+"["+this.lpadZero(1,3)+"-"+this.lpadZero(this.form.parcelQty,3)+"]";
|
||||
console.log(billSubCodeStr);
|
||||
// console.log(billSubCodeStr);
|
||||
this.form.billCodeSub=billSubCodeStr;
|
||||
}else{
|
||||
this.form.billCodeSub=null;
|
||||
@ -1193,10 +1234,6 @@ methods: {
|
||||
},
|
||||
initData() {
|
||||
this.reset();
|
||||
this.form.sendDate = parseTime(new Date());
|
||||
this.form.sendSiteCode=this.$store.getters.ownerSiteCode;
|
||||
this.form.sendSiteName=this.$store.getters.ownerSiteName;
|
||||
console.log(this.form.sendSiteName)
|
||||
|
||||
if(this.billCode !=null) {
|
||||
this.loading = true;
|
||||
@ -1206,12 +1243,16 @@ methods: {
|
||||
this.loading = false;
|
||||
|
||||
this.isNeedSave=true;
|
||||
this.form.printTypeCheckList=[1,5]
|
||||
|
||||
});
|
||||
}else{
|
||||
// console.log(this.dict.type.emis_declare_mode[0]);
|
||||
|
||||
// this.form.customsEclaration = this.dict.type.emis_declare_mode[0].value;
|
||||
this.form.sendDate = parseTime(new Date());
|
||||
this.form.sendSiteCode=this.$store.getters.ownerSiteCode;
|
||||
this.form.sendSiteName=this.$store.getters.ownerSiteName;
|
||||
console.log(this.form.sendSiteName)
|
||||
|
||||
this.form.customsEclaration='1';
|
||||
this.form.customsClear='1';
|
||||
// this.form.pickupMethod='2';
|
||||
@ -1229,7 +1270,7 @@ methods: {
|
||||
this.isNeedSave=true;
|
||||
this.form.printTypeCheckList=[1,5],
|
||||
|
||||
this.handleGenGoods();
|
||||
this.handleInitGenGoods();
|
||||
}
|
||||
|
||||
|
||||
@ -1439,7 +1480,7 @@ methods: {
|
||||
let totalVolume=0.0;
|
||||
if(row!=null){
|
||||
let volume=parseFloat(row.length)*parseFloat(row.width)*parseFloat(row.height);
|
||||
row.volume=parseFloat((volume/1000000).toFixed(5));
|
||||
row.volume=parseFloat((volume/1000000).toFixed(5))*parseFloat(row.cargoQty);
|
||||
}
|
||||
|
||||
this.form.cargoList.forEach(item=>{
|
||||
@ -1448,35 +1489,17 @@ methods: {
|
||||
this.form.totalVolume = parseFloat(totalVolume.toFixed(5));
|
||||
|
||||
},
|
||||
handleCalcQty(val,row){
|
||||
let totalCargoQty=0;
|
||||
let goodsInfo='';
|
||||
|
||||
this.form.cargoList.forEach(item=>{
|
||||
totalCargoQty=totalCargoQty+parseInt(item.cargoQty);
|
||||
goodsInfo=goodsInfo+item.goodsName+"x"+item.cargoQty+",";
|
||||
|
||||
});
|
||||
|
||||
|
||||
this.form.parcelQty = totalCargoQty;
|
||||
|
||||
this.handleGenSubbill();
|
||||
},
|
||||
handleCalcFeeItem(val,row){
|
||||
|
||||
let childRealFee=0.0;
|
||||
if(row!=null){
|
||||
|
||||
if(row.calcExp){
|
||||
let expr=row.calcExp+"";
|
||||
let expr="s+w*d";
|
||||
expr=expr.replace("s",row.initialWeightFee);
|
||||
expr=expr.replace("d",row.addWeightPrice);
|
||||
expr=expr.replace("w",this.form.settlementWeight);
|
||||
console.log(expr);
|
||||
let childRealFee=parseFloat(eval(expr)).toFixed(2);
|
||||
row.realFee=childRealFee;
|
||||
console.log(childRealFee);
|
||||
row.realFee=parseFloat(eval(expr)).toFixed(2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1587,53 +1610,26 @@ methods: {
|
||||
this.form.goodsInfo = selNameStr;
|
||||
},
|
||||
|
||||
handleGenGoods(){
|
||||
handleInitGenGoods(){
|
||||
if(this.form.parcelQty>0){
|
||||
|
||||
let currentParcelQty = 0;
|
||||
if(this.form.cargoList){
|
||||
this.form.cargoList=[];
|
||||
}
|
||||
|
||||
this.form.cargoList.forEach(item=>{
|
||||
currentParcelQty = currentParcelQty+parseInt(item.cargoQty);
|
||||
});
|
||||
|
||||
// 新件数大于
|
||||
if(this.form.parcelQty>=this.form.cargoList.length){
|
||||
console.log()
|
||||
let len=this.form.parcelQty-this.form.cargoList.length;
|
||||
for(let i=0;i<len;i++){
|
||||
if(this.form.parcelQty>currentParcelQty){
|
||||
let len=this.form.parcelQty-currentParcelQty;
|
||||
if(this.form.parcelQty>20){
|
||||
let cargo={
|
||||
"goodsCode": "",
|
||||
"goodsName": "",
|
||||
"cargoQty": 1,
|
||||
"length": 0,
|
||||
"width": 0,
|
||||
"height": 0,
|
||||
"volume": 0,
|
||||
}
|
||||
this.form.cargoList.push(cargo);
|
||||
}
|
||||
}
|
||||
else{
|
||||
let newList=[];
|
||||
for(let i=0;i<this.form.parcelQty;i++){
|
||||
newList.push(this.form.cargoList[i])
|
||||
}
|
||||
this.form.cargoList=newList;
|
||||
}
|
||||
}else{
|
||||
this.form.cargoList=[];
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onGoodsChange_old(goodsName){
|
||||
if(goodsName&& goodsName!='') {
|
||||
// 旧map
|
||||
let nameOldMap = new Map();
|
||||
if(this.form.cargoList!=null&& this.form.cargoList.length>0){
|
||||
this.form.cargoList.forEach(item=>{
|
||||
nameOldMap[item.goodsName]=item;
|
||||
});
|
||||
}
|
||||
|
||||
if(!(goodsName in nameOldMap)){
|
||||
let cargo={
|
||||
"goodsCode": goodsName,
|
||||
"goodsName": goodsName,
|
||||
"cargoQty": 1,
|
||||
"goodsCode": "",
|
||||
"goodsName": "",
|
||||
"cargoQty": len,
|
||||
"length": 0,
|
||||
"width": 0,
|
||||
"height": 0,
|
||||
@ -1641,10 +1637,81 @@ methods: {
|
||||
}
|
||||
this.form.cargoList.push(cargo);
|
||||
}
|
||||
|
||||
this.handleCalcQty();
|
||||
this.handleCalcVolume();
|
||||
else{
|
||||
for(let i=0;i<len;i++){
|
||||
let cargo={
|
||||
"goodsCode": "",
|
||||
"goodsName": "",
|
||||
"cargoQty": 1,
|
||||
"length": 0,
|
||||
"width": 0,
|
||||
"height": 0,
|
||||
"volume": 0,
|
||||
}
|
||||
this.form.cargoList.push(cargo);
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
let newList=[];
|
||||
let incQty=0;
|
||||
let zeroItem=null;
|
||||
for(let i=0;i<this.form.cargoList.length;i++){
|
||||
let item=this.form.cargoList[i];
|
||||
// 忽略未填写体积的数据
|
||||
if(item.length==0&&item.width==0&&item.height==0){
|
||||
zeroItem=item;
|
||||
zeroItem.cargoQty=1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if((incQty+parseInt(item.cargoQty))<this.form.parcelQty){
|
||||
incQty = incQty+parseInt(item.cargoQty);
|
||||
newList.push(item)
|
||||
}else{
|
||||
item.cargoQty=this.form.parcelQty-incQty;
|
||||
newList.push(item)
|
||||
incQty = incQty+parseInt(item.cargoQty);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 补足数量
|
||||
let bzLen=this.form.parcelQty-incQty;
|
||||
for(let i=0;i<bzLen;i++){
|
||||
let newItem=Object.assign({},zeroItem);
|
||||
newList.push(newItem);
|
||||
}
|
||||
|
||||
this.form.cargoList=newList;
|
||||
}
|
||||
}else{
|
||||
this.form.cargoList=[];
|
||||
}
|
||||
},
|
||||
handleCargoQtyChange(){
|
||||
this.handleInitGenGoods();
|
||||
this.handleCalcVolume();
|
||||
},
|
||||
deleteGoodsItem(row,index){
|
||||
this.$confirm('确定删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// let newList = this.form.cargoList.filter(item => item.goodsName !== row.goodsName);
|
||||
// this.form.cargoList=newList;
|
||||
console.log(index);
|
||||
this.form.cargoList.splice(index,1)
|
||||
this.handleCalcVolume();
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
copyGoodsItem(row,index){
|
||||
let newItem = Object.assign({},row);
|
||||
newItem.cargoQty=1;
|
||||
this.form.cargoList.splice(index+1, 0, newItem);
|
||||
// this.form.cargoList.push(newItem);
|
||||
handleCargoQtyChange();
|
||||
},
|
||||
showLocalTime(){
|
||||
|
||||
|
||||
@ -7,14 +7,19 @@
|
||||
<div class="form-group-title"><span class="title">{{ $t('发货信息') }}</span></div>
|
||||
</template>
|
||||
<div>
|
||||
|
||||
|
||||
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
|
||||
<el-col :span="6">
|
||||
|
||||
|
||||
<!-- 运单录入 -->
|
||||
<el-col :span="6" v-if="action=='add'">
|
||||
<el-form-item :label="$t('发货时间')" prop="sendDate">
|
||||
<el-input v-model="form.sendDate" placeholder="" readonly="" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="18">
|
||||
<el-col :span="18" v-if="action=='add'">
|
||||
<el-form-item label="运单号" prop="billCode" >
|
||||
<div style="display:inline-flex">
|
||||
<div>
|
||||
@ -27,6 +32,33 @@
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 运单录入 end -->
|
||||
|
||||
<!-- 运单修改 -->
|
||||
<el-col :span="8" v-if="action=='modify'">
|
||||
<el-form-item label="运单号" prop="billCode" >
|
||||
<div style="display:inline-flex">
|
||||
<div>
|
||||
<el-input v-model="form.billCode" placeholder="单号输入后按回车" @keyup.enter.native="handleScanInput" style="font-weight:600;color:black" >
|
||||
<i slot="suffix" class="iconfont"></i>
|
||||
</el-input>
|
||||
</div>
|
||||
<!-- <div style="padding-left:5px"> <el-checkbox style="font-size:400;margin-right:10px;font-size:10px" @change="checked=>handleBillCodeChange(checked)"><span style="font-size:10px">电子主单</span></el-checkbox></div> -->
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6" v-if="action=='modify'">
|
||||
<el-form-item :label="$t('发货时间')" prop="sendDate">
|
||||
<el-input v-model="form.sendDate" placeholder="" readonly="" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="10" v-if="action=='modify'">
|
||||
</el-col>
|
||||
<!-- 运单修改 end -->
|
||||
|
||||
|
||||
|
||||
<el-col :span="6">
|
||||
<el-form-item label="目的国" prop="reciever.country">
|
||||
@ -805,6 +837,7 @@ data() {
|
||||
loading: true,
|
||||
isNeedSave:false,
|
||||
triggerCount:0,
|
||||
action:null,
|
||||
// 表单参数
|
||||
form: {},
|
||||
timer:null,
|
||||
@ -957,6 +990,8 @@ data() {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
},
|
||||
watch: {
|
||||
"form.reciever.province":{
|
||||
handler (newValue, oldValue) {
|
||||
@ -972,13 +1007,13 @@ data() {
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
"form.volumeWeight":{
|
||||
handler (newValue, oldValue) {
|
||||
this.reCalcSettlementWeight();
|
||||
},
|
||||
immediate: false,
|
||||
deep: true
|
||||
},
|
||||
// "form.volumeWeight":{
|
||||
// handler (newValue, oldValue) {
|
||||
// this.reCalcSettlementWeight();
|
||||
// },
|
||||
// immediate: false,
|
||||
// deep: true
|
||||
// },
|
||||
"form.billWeight":{
|
||||
handler (newValue, oldValue) {
|
||||
this.reCalcSettlementWeight();
|
||||
@ -1031,6 +1066,7 @@ updated(){
|
||||
},
|
||||
created() {
|
||||
this.billCode=this.$route.query.billCode;
|
||||
this.action=this.$route.query.action;
|
||||
this.initData();
|
||||
this.initTanexPrinterSdk();
|
||||
|
||||
@ -1230,11 +1266,8 @@ methods: {
|
||||
},
|
||||
initData() {
|
||||
this.reset();
|
||||
this.form.sendDate = parseTime(new Date());
|
||||
this.form.sendSiteCode=this.$store.getters.ownerSiteCode;
|
||||
this.form.sendSiteName=this.$store.getters.ownerSiteName;
|
||||
console.log(this.form.sendSiteName)
|
||||
|
||||
// console.log(this.form.sendSiteName)
|
||||
if(this.billCode !=null) {
|
||||
this.loading = true;
|
||||
getWaybillDetail(this.billCode).then(response => {
|
||||
@ -1243,12 +1276,15 @@ methods: {
|
||||
this.loading = false;
|
||||
|
||||
this.isNeedSave=true;
|
||||
this.form.printTypeCheckList=[1,5]
|
||||
|
||||
});
|
||||
}else{
|
||||
// console.log(this.dict.type.emis_declare_mode[0]);
|
||||
|
||||
// this.form.customsEclaration = this.dict.type.emis_declare_mode[0].value;
|
||||
this.form.sendDate = parseTime(new Date());
|
||||
this.form.sendSiteCode=this.$store.getters.ownerSiteCode;
|
||||
this.form.sendSiteName=this.$store.getters.ownerSiteName;
|
||||
|
||||
this.form.customsEclaration='1';
|
||||
this.form.customsClear='1';
|
||||
// this.form.pickupMethod='2';
|
||||
@ -1553,6 +1589,8 @@ methods: {
|
||||
|
||||
},
|
||||
calcBillFee(){
|
||||
console.log("11111=>"+this.isNeedSave)
|
||||
|
||||
// 初始化不计算
|
||||
if(!this.isNeedSave){
|
||||
return;
|
||||
@ -1610,9 +1648,14 @@ methods: {
|
||||
if(this.form.parcelQty>0){
|
||||
|
||||
let currentParcelQty = 0;
|
||||
if(this.form.cargoList){
|
||||
this.form.cargoList=[];
|
||||
}
|
||||
|
||||
this.form.cargoList.forEach(item=>{
|
||||
currentParcelQty = currentParcelQty+parseInt(item.cargoQty);
|
||||
});
|
||||
|
||||
// 新件数大于
|
||||
if(this.form.parcelQty>currentParcelQty){
|
||||
let len=this.form.parcelQty-currentParcelQty;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user