Merge pull request 'master-dev' (#170) from master-dev into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-frontend/pulls/170
This commit is contained in:
commit
b4ff9d05b8
@ -255,15 +255,17 @@
|
||||
|
||||
<script>
|
||||
import { listEmisTmsCostFee, getEmisTmsCostFee,reCalcSplitCostFee, delEmisTmsCostFee, addEmisTmsCostFee, updateEmisTmsCostFee } from "@/api/emis/emisTmsCostFee";
|
||||
import { listEmisTmsCostFeeSplit } from "@/api/emis/emisTmsCostFeeSplit";
|
||||
import EmisTmsCostFeeForm from '@/views/emis/emisTmsCostFee/emisTmsCostFeeForm';
|
||||
import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker';
|
||||
import EmisSupplierPicker from '@/views/emis/EmisBaseTools/EmisSupplierPicker';
|
||||
import EmisTmsSiteBatchPicker from '@/views/emis/EmisBaseTools/EmisTmsSiteBatchPicker';
|
||||
import { listEmisTmsSiteBatchDtl} from "@/api/emis/emisTmsSiteBatchDtl";
|
||||
|
||||
export default {
|
||||
name: "EmisTmsCostFee",
|
||||
components: { EmisTmsCostFeeForm ,elDateAdvPicker,EmisSupplierPicker,EmisTmsSiteBatchPicker},
|
||||
dicts: ['emis_cost_fee_type','emis_supplier_name','emis_cost_split_type','emis_biz_shipping_method','emis_payment_type'],
|
||||
dicts: ['emis_cost_fee_type','emis_supplier_name','emis_cost_split_type','emis_biz_shipping_method','emis_payment_type','emis_qujian_fangshi','emis_declare_mode','emis_customs_clear','emis_cost_split_type'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@ -606,62 +608,89 @@ export default {
|
||||
}))
|
||||
},
|
||||
|
||||
handleDownBatchDtl(batchName){
|
||||
async handleDownBatchDtl(batchName){
|
||||
const loadingInstance = this.$loading({
|
||||
text: '正在导出...'
|
||||
})
|
||||
|
||||
if(this.selectionList&&this.selectionList.length>0){
|
||||
this.selectionList.forEach(item=>{
|
||||
})
|
||||
if(this.selectList&&this.selectList.length>0){
|
||||
// this.selectList.forEach(item=>{
|
||||
const batchNo=this.selectList[0].batchNo;
|
||||
let billCodeList='';
|
||||
let qExportParam={
|
||||
pageNum:1,
|
||||
pageSize:20000,
|
||||
batchNo: item.batchNo
|
||||
batchNo: batchNo
|
||||
};
|
||||
let batchName=item.batchNo;
|
||||
listEmisTmsSiteBatchDtl(qExportParam).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.exportDataDtl(batchName,response.rows,loadingInstance);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
let res= await listEmisTmsSiteBatchDtl(qExportParam);
|
||||
if (res.code === 200) {
|
||||
//拼接运单号
|
||||
billCodeList=res.rows.map(item=>item.billCode).join(',');
|
||||
}
|
||||
let qExportParamSplit={
|
||||
pageNum:1,
|
||||
pageSize:20000,
|
||||
batchNo: batchNo,
|
||||
billCode:billCodeList
|
||||
};
|
||||
let resSplit= await listEmisTmsCostFeeSplit(qExportParamSplit);
|
||||
if (resSplit.code === 200) {
|
||||
//拼接运单号
|
||||
this.exportDataDtl(batchNo,resSplit.rows,loadingInstance);
|
||||
}
|
||||
}
|
||||
},
|
||||
exportDataDtl(batchName,selData,loadingInstance){
|
||||
exportDataDtl(batchNo,selData,loadingInstance){
|
||||
const curList =selData
|
||||
import('@/vendor/Export2Excel').then(excel => {
|
||||
const tHeader = ['运单号','寄件国家','目的国家','线路','产品类型','预计到达时间','总件数','实际重量','总体积','体积重量','结算重量','收件人','收件公司','取件方式','付款方式','运费','寄件人','寄件公司','录单备注','寄件网点','清关方式','报关方式'];
|
||||
const tHeader = ['运单号','主单号','成本时间','费用类型','费用','分摊类型','分摊重量','供应商','发件地','目的地','运输号','批次号','固定费用','计算总重量','分摊总费用','计算公式','计算备注','备注','账单月份','快件类型','支付方式','月结客户','起始国','目的国','寄件日期','寄件网点','寄件公司','线路','产品类型','寄件人','件数','实际重量','体积','体积重量','结算重量','运费','收款状态','标准报价','费用备注','创建日期'];
|
||||
const filterVal=[
|
||||
"billCode",
|
||||
"mainBillCode",
|
||||
"tradeDate",
|
||||
"feeType",
|
||||
"costFee",
|
||||
"splitType",
|
||||
"billWeight",
|
||||
"supplierName",
|
||||
"sendPlace",
|
||||
"destPlace",
|
||||
"transSignNo",
|
||||
"batchNo",
|
||||
"blManual",
|
||||
"transWeight",
|
||||
"transCostFee",
|
||||
"calcExpr",
|
||||
"calcRemark",
|
||||
"remark",
|
||||
"billMonth",
|
||||
"kjlx",
|
||||
"paymentType",
|
||||
"custName",
|
||||
"sendCountryName",
|
||||
"receiveCountryName",
|
||||
"sendDate",
|
||||
"sendSiteName",
|
||||
"sendCompany",
|
||||
"transLineTypeName",
|
||||
"productTypeName",
|
||||
"estimateDate",
|
||||
"sendName",
|
||||
"parcelQty",
|
||||
"billWeight",
|
||||
"totalVolume",
|
||||
"totalVolume",//1
|
||||
"volumeWeight",
|
||||
"settlementWeight",
|
||||
"receiveName",
|
||||
"receiveCompany",
|
||||
"pickupMethod",
|
||||
"paymentType",
|
||||
"freight",
|
||||
"sendName",
|
||||
"sendCompany",
|
||||
"remark",
|
||||
"sendSiteName",
|
||||
"customsEclaration",
|
||||
"customsClear"
|
||||
"billFee",
|
||||
"paymentStatus",
|
||||
"realFee",
|
||||
"feeRemark",
|
||||
"createTime"
|
||||
];
|
||||
|
||||
const data = this.formatJsonDtl(filterVal, curList, selData)
|
||||
excel.export_json_to_excel({
|
||||
header: tHeader,
|
||||
data,
|
||||
filename: batchName+'批次明细表',
|
||||
filename: batchNo+'批次明细表',
|
||||
autoWidth: true
|
||||
})
|
||||
loadingInstance.close()
|
||||
@ -671,7 +700,8 @@ export default {
|
||||
let index = 0
|
||||
return jsonData.map(v => filterVal.map(j => {
|
||||
|
||||
|
||||
// console.log('v',v);
|
||||
// console.log('j', j);
|
||||
if (j === 'index') {
|
||||
return ++index
|
||||
}
|
||||
@ -792,26 +822,26 @@ export default {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (j === 'calcFeeType') {
|
||||
return this.selectDictLabel(this.dict.type.emis_calc_fee_type,v['waybillDetail']['calcFeeType']);
|
||||
}
|
||||
// if (j === 'calcFeeType') {
|
||||
// return this.selectDictLabel(this.dict.type.emis_calc_fee_type,v['waybillDetail']['calcFeeType']);
|
||||
// }
|
||||
|
||||
if (j === 'waybillDetail.paymentStatus') {
|
||||
return this.selectDictLabel(this.dict.type.emis_payment_status,v['waybillDetail']['paymentStatus']);
|
||||
}
|
||||
// if (j === 'waybillDetail.paymentStatus') {
|
||||
// return this.selectDictLabel(this.dict.type.emis_payment_status,v['waybillDetail']['paymentStatus']);
|
||||
// }
|
||||
|
||||
if (j === 'pickupMethod') {
|
||||
return this.selectDictLabel(this.dict.type.emis_qujian_fangshi,v['waybillDetail']['pickupMethod']);
|
||||
}
|
||||
if (j === 'customsEclaration') {
|
||||
if (j === 'customsEclaration') {
|
||||
return this.selectDictLabel(this.dict.type.emis_declare_mode,v['waybillDetail']['customsEclaration']);
|
||||
}
|
||||
if (j === 'customsClear') {
|
||||
return this.selectDictLabel(this.dict.type.emis_customs_clear,v['waybillDetail']['customsClear']);
|
||||
}
|
||||
if (j === 'packType') {
|
||||
return this.selectDictLabels(this.dict.type.emis_tab_packing_type,v['waybillDetail']['packType']);
|
||||
}
|
||||
// if (j === 'packType') {
|
||||
// return this.selectDictLabels(this.dict.type.emis_tab_packing_type,v['waybillDetail']['packType']);
|
||||
// }
|
||||
|
||||
if (j === 'dispatchMethod') {
|
||||
if(v['waybillDetail']['dispatchMethod'] == 1){
|
||||
@ -844,6 +874,40 @@ export default {
|
||||
if (j === 'paymentType') {
|
||||
return this.selectDictLabel(this.dict.type.emis_payment_type,v['waybillDetail']['paymentType']);
|
||||
}
|
||||
if (j === 'custName') {
|
||||
return v['waybillDetail']['custName'];
|
||||
}
|
||||
if (j === 'feeType') {
|
||||
return this.selectDictLabel(this.dict.type.emis_cost_fee_type,v['feeType']);
|
||||
}
|
||||
if(j === 'blManual'){
|
||||
if(v['blManual'] == 1){
|
||||
return '是';
|
||||
}else{
|
||||
return '否';
|
||||
}
|
||||
}
|
||||
if(j === 'billFee'){
|
||||
const realFee = v['waybillDetail']['realFee'];
|
||||
const freight = v['waybillDetail']['freight'];
|
||||
if(realFee!==freight){
|
||||
return freight;
|
||||
}else{
|
||||
return realFee;
|
||||
}
|
||||
}
|
||||
if(j === 'paymentStatus'){
|
||||
if(v['waybillDetail']['paymentStatus'] == 0){
|
||||
return '未付款';
|
||||
}else if(v['waybillDetail']['paymentStatus'] == 1){
|
||||
return '已付款';
|
||||
}else if(v['waybillDetail']['paymentStatus'] == 2){
|
||||
return '部分付款';
|
||||
}
|
||||
}
|
||||
if(j === 'splitType'){
|
||||
return this.selectDictLabel(this.dict.type.emis_cost_split_type,v['splitType']);
|
||||
}
|
||||
return v[j]
|
||||
}))
|
||||
},
|
||||
|
||||
@ -983,6 +983,15 @@ data() {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
//校验货物名称 不能为只包含空字符、特殊字符、标点符号
|
||||
var checkGoodsName = (rule, value, callback) => {
|
||||
const reg = /^(?=.*[a-zA-Z0-9\u4e00-\u9fa5])[\s\S]*$/;
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error('货物名称不能只填写空字符、特殊字符、标点符号'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
return {
|
||||
activeNames:['1','2','3','4'],
|
||||
exchangeRate:null,
|
||||
@ -1125,7 +1134,8 @@ data() {
|
||||
{ required: true, message: "取件方式为空", trigger: ["blur",'change'] }
|
||||
],
|
||||
goodsInfo: [
|
||||
{ required: true, message: "货物名称不能为空", trigger: ["blur",'change'] }
|
||||
{ required: true, message: "货物名称不能为空", trigger: ["blur",'change'] },
|
||||
{validator: checkGoodsName ,trigger: ['blur', 'change']}
|
||||
],
|
||||
totalVolume: [
|
||||
{ required: true, message: "总体积不能为空", trigger: "blur" }
|
||||
|
||||
@ -1004,6 +1004,15 @@ data() {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
//校验货物名称 不能为只包含空字符、特殊字符、标点符号
|
||||
var checkGoodsName = (rule, value, callback) => {
|
||||
const reg = /^(?=.*[a-zA-Z0-9\u4e00-\u9fa5])[\s\S]*$/;
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error('货物名称不能只填写空字符、特殊字符、标点符号'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
return {
|
||||
activeNames:['1','2','3','4'],
|
||||
exchangeRate:null,
|
||||
@ -1151,7 +1160,8 @@ data() {
|
||||
{ required: true, message: "取件方式为空", trigger: ["blur",'change'] }
|
||||
],
|
||||
goodsInfo: [
|
||||
{ required: true, message: "货物名称不能为空", trigger: ["blur",'change'] }
|
||||
{ required: true, message: "货物名称不能为空", trigger: ["blur",'change'] },
|
||||
{validator: checkGoodsName ,trigger: ['blur', 'change']}
|
||||
],
|
||||
totalVolume: [
|
||||
{ required: true, message: "总体积不能为空", trigger: "blur" }
|
||||
|
||||
@ -1006,6 +1006,15 @@ data() {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
//校验货物名称 不能为只包含空字符、特殊字符、标点符号
|
||||
var checkGoodsName = (rule, value, callback) => {
|
||||
const reg = /^(?=.*[a-zA-Z0-9\u4e00-\u9fa5])[\s\S]*$/;
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error('货物名称不能只填写空字符、特殊字符、标点符号'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
return {
|
||||
activeNames:['1','2','3','4'],
|
||||
exchangeRate:null,
|
||||
@ -1168,7 +1177,8 @@ data() {
|
||||
{ required: true, message: "取件方式为空", trigger: ["blur",'change'] }
|
||||
],
|
||||
goodsInfo: [
|
||||
{ required: true, message: "货物名称不能为空", trigger: ["blur",'change'] }
|
||||
{ required: true, message: "货物名称不能为空", trigger: ["blur",'change'] },
|
||||
{validator: checkGoodsName ,trigger: ['blur', 'change']}
|
||||
],
|
||||
totalVolume: [
|
||||
{ required: true, message: "总体积不能为空", trigger: "blur" }
|
||||
|
||||
@ -1374,6 +1374,15 @@ export default {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
//校验货物名称 不能为只包含空字符、特殊字符、标点符号
|
||||
var checkGoodsName = (rule, value, callback) => {
|
||||
const reg = /^(?=.*[a-zA-Z0-9\u4e00-\u9fa5])[\s\S]*$/;
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error('货物名称不能只填写空字符、特殊字符、标点符号'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
return {
|
||||
triggerCount:0,
|
||||
activeNames:['1','2','3','4'],
|
||||
@ -1502,7 +1511,8 @@ export default {
|
||||
{ required: true, message: "取件方式为空", trigger: ["blur",'change'] }
|
||||
],
|
||||
goodsInfo: [
|
||||
{ required: true, message: "货物名称不能为空", trigger: ["blur",'change'] }
|
||||
{ required: true, message: "货物名称不能为空", trigger: ["blur",'change'] },
|
||||
{validator: checkGoodsName ,trigger: ['blur', 'change']}
|
||||
],
|
||||
totalVolume: [
|
||||
{ required: true, message: "总体积不能为空", trigger: "blur" }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user