Commit 94e3df2c authored by dcy's avatar dcy

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/views/ecw/order/index.vue
parents cf10e689 0fd82d4d
//==本JS是加载Lodop插件或Web打印服务CLodop/Lodop7的综合示例,可直接使用,建议理解后融入自己程序==
//用双端口加载主JS文件Lodop.js(或CLodopfuncs.js兼容老版本)以防其中某端口被占:
var MainJS ="CLodopfuncs.js",
URL_WS1 = "ws://localhost:8000/"+MainJS, //ws用8000/18000
URL_WS2 = "ws://localhost:18000/"+MainJS,
URL_HTTP1 = "http://localhost:8000/"+MainJS, //http用8000/18000
URL_HTTP2 = "http://localhost:18000/"+MainJS,
URL_HTTP3 = "https://localhost.lodop.net:8443/"+MainJS; //https用8000/8443
var CreatedOKLodopObject, CLodopIsLocal, LoadJsState;
//==判断是否需要CLodop(那些不支持插件的浏览器):==
function needCLodop() {
try {
var ua = navigator.userAgent;
if (ua.match(/Windows\sPhone/i) ||
ua.match(/iPhone|iPod|iPad/i) ||
ua.match(/Android/i) ||
ua.match(/Edge\D?\d+/i))
return true;
var verTrident = ua.match(/Trident\D?\d+/i);
var verIE = ua.match(/MSIE\D?\d+/i);
var verOPR = ua.match(/OPR\D?\d+/i);
var verFF = ua.match(/Firefox\D?\d+/i);
var x64 = ua.match(/x64/i);
if ((!verTrident) && (!verIE) && (x64)) return true;
else if (verFF) {
verFF = verFF[0].match(/\d+/);
if ((verFF[0] >= 41) || (x64)) return true;
} else if (verOPR) {
verOPR = verOPR[0].match(/\d+/);
if (verOPR[0] >= 32) return true;
} else if ((!verTrident) && (!verIE)) {
var verChrome = ua.match(/Chrome\D?\d+/i);
if (verChrome) {
verChrome = verChrome[0].match(/\d+/);
if (verChrome[0] >= 41) return true;
}
}
return false;
} catch (err) {
return true;
}
}
//==检查加载成功与否,如没成功则用http(s)再试==
//==低版本CLODOP6.561/Lodop7.043及前)用本方法==
function checkOrTryHttp() {
if (window.CLODOP2015_7028) {
LoadJsState = "complete";
return true;
}
if (LoadJsState == "loadingB" || LoadJsState == "complete") return;
LoadJsState = "loadingB";
var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement;
var JS1 = document.createElement("script")
,JS2 = document.createElement("script")
,JS3 = document.createElement("script");
JS1.src = URL_HTTP1;
JS2.src = URL_HTTP2;
JS3.src = URL_HTTP3;
JS1.onload = JS2.onload = JS3.onload = JS2.onerror = JS3.onerror=function(){LoadJsState = "complete";}
JS1.onerror = function(e) {
if (window.location.protocol !== 'https:')
head.insertBefore(JS2, head.firstChild); else
head.insertBefore(JS3, head.firstChild);
}
head.insertBefore(JS1,head.firstChild);
}
//==加载Lodop对象的主过程:==
(function loadCLodop(){
if (!needCLodop()) return;
CLodopIsLocal = !!((URL_WS1 + URL_WS2).match(/\/\/localho|\/\/127.0.0./i));
LoadJsState = "loadingA";
if (!window.WebSocket && window.MozWebSocket) window.WebSocket=window.MozWebSocket;
//ws方式速度快(小于200ms)且可避免CORS错误,但要求Lodop版本足够新:
try {
var WSK1=new WebSocket(URL_WS1);
WSK1.onopen = function(e) { setTimeout("checkOrTryHttp();",200); }
WSK1.onmessage = function(e) {if (!window.CLODOP2015_7028) eval(e.data);}
WSK1.onerror = function(e) {
var WSK2=new WebSocket(URL_WS2);
WSK2.onopen = function(e) {setTimeout("checkOrTryHttp();",200);}
WSK2.onmessage = function(e) {if (!window.CLODOP2015_7028) eval(e.data);}
WSK2.onerror= function(e) {checkOrTryHttp();}
}
} catch(e){
checkOrTryHttp();
}
})();
//==获取LODOP对象主过程,判断是否安装、需否升级:==
function getLodop(oOBJECT, oEMBED) {
var strFontTag = "<br><font color='#FF00FF'>打印控件";
var strLodopInstall = strFontTag + "未安装!点击这里<a href='install_lodop32.exe' target='_self'>执行安装</a>";
var strLodopUpdate = strFontTag + "需要升级!点击这里<a href='install_lodop32.exe' target='_self'>执行升级</a>";
var strLodop64Install = strFontTag + "未安装!点击这里<a href='install_lodop64.exe' target='_self'>执行安装</a>";
var strLodop64Update = strFontTag + "需要升级!点击这里<a href='install_lodop64.exe' target='_self'>执行升级</a>";
var strCLodopInstallA = "<br><font color='#FF00FF'>Web打印服务CLodop未安装启动,点击这里<a href='CLodop_Setup_for_Win32NT.exe' target='_self'>下载执行安装</a>";
var strCLodopInstallB = "<br>(若此前已安装过,可<a href='CLodop.protocol:setup' target='_self'>点这里直接再次启动</a>)";
var strCLodopUpdate = "<br><font color='#FF00FF'>Web打印服务CLodop需升级!点击这里<a href='CLodop_Setup_for_Win32NT.exe' target='_self'>执行升级</a>";
var strLodop7FontTag = "<br><font color='#FF00FF'>Web打印服务Lodop7";
var strLodop7HrefX86 = "点击这里<a href='Lodop7_Linux_X86_64.tar.gz' target='_self'>下载安装</a>(下载后解压,点击lodop文件开始执行)";
var strLodop7HrefARM = "点击这里<a href='Lodop7_Linux_ARM64.tar.gz' target='_self'>下载安装</a>(下载后解压,点击lodop文件开始执行)";
var strLodop7Install_X86 = strLodop7FontTag + "未安装启动," + strLodop7HrefX86;
var strLodop7Install_ARM = strLodop7FontTag + "未安装启动," + strLodop7HrefARM;
var strLodop7Update_X86 = strLodop7FontTag + "需升级," + strLodop7HrefX86;
var strLodop7Update_ARM = strLodop7FontTag + "需升级," + strLodop7HrefARM;
var strInstallOK = ",成功后请刷新本页面或重启浏览器。</font>";
var LODOP;
try {
var isWinIE = (/MSIE/i.test(navigator.userAgent)) || (/Trident/i.test(navigator.userAgent));
var isWinIE64 = isWinIE && (/x64/i.test(navigator.userAgent));
var isLinuxX86 = (/Linux/i.test(navigator.platform)) && (/x86/i.test(navigator.platform));
var isLinuxARM = (/Linux/i.test(navigator.platform)) && (/aarch/i.test(navigator.platform));
if (needCLodop() || isLinuxX86 || isLinuxARM) {
try {
LODOP = window.CLODOP2015_7028;
} catch (err) {}
if (!LODOP && LoadJsState !== "complete") {
if (!LoadJsState)
alert("未曾加载Lodop主JS文件,请先调用loadCLodop过程."); else
alert("网页还没下载完毕,请稍等一下再操作." + LoadJsState);
return;
}
var strAlertMessage;
if (!LODOP) {
if (isLinuxX86)
strAlertMessage = strLodop7Install_X86;
else if (isLinuxARM)
strAlertMessage = strLodop7Install_ARM;
else
strAlertMessage = strCLodopInstallA + (CLodopIsLocal ? strCLodopInstallB : "");
document.body.innerHTML = strAlertMessage + strInstallOK + document.body.innerHTML;
return;
} else {
if (isLinuxX86 && LODOP.CVERSION < "7.0.4.3")
strAlertMessage = strLodop7Update_X86;
else if (isLinuxARM && LODOP.CVERSION < "7.0.4.3")
strAlertMessage = strLodop7Update_ARM;
else if (CLODOP.CVERSION < "6.5.6.6")
strAlertMessage = strCLodopUpdate;
if (strAlertMessage)
document.body.innerHTML = strAlertMessage + strInstallOK + document.body.innerHTML;
}
} else {
//==如果页面有Lodop插件就直接使用,否则新建:==
if (oOBJECT || oEMBED) {
if (isWinIE)
LODOP = oOBJECT;
else
LODOP = oEMBED;
} else if (!CreatedOKLodopObject) {
LODOP = document.createElement("object");
LODOP.setAttribute("width", 0);
LODOP.setAttribute("height", 0);
LODOP.setAttribute("style", "position:absolute;left:0px;top:-100px;width:0px;height:0px;");
if (isWinIE)
LODOP.setAttribute("classid", "clsid:2105C259-1E0C-4534-8141-A753534CB4CA");
else
LODOP.setAttribute("type", "application/x-print-lodop");
document.documentElement.appendChild(LODOP);
CreatedOKLodopObject = LODOP;
} else
LODOP = CreatedOKLodopObject;
//==Lodop插件未安装时提示下载地址:==
if ((!LODOP) || (!LODOP.VERSION)) {
document.body.innerHTML = (isWinIE64 ? strLodop64Install : strLodopInstall) + strInstallOK + document.body.innerHTML;
return LODOP;
}
if (LODOP.VERSION < "6.2.2.6") {
document.body.innerHTML = (isWinIE64 ? strLodop64Update : strLodopUpdate) + strInstallOK + document.body.innerHTML;
}
}
//===如下空白位置适合调用统一功能(如注册语句、语言选择等):=======================
LODOP.SET_LICENSES("江西省晨尚科技有限公司","9D5CB0779D3B7FF8B70BD2F896DA5312","","");
//===============================================================================
return LODOP;
} catch (err) {
alert("getLodop出错:" + err);
}
}
...@@ -52,6 +52,14 @@ export function exportOrderExcel(query) { ...@@ -52,6 +52,14 @@ export function exportOrderExcel(query) {
responseType: 'blob' responseType: 'blob'
}) })
} }
// 打印标签
export function printTag(id) {
return request({
url: '/order/print/orderTagPrint?orderId=' + id,
method: 'get',
})
}
//根据订单号获得订单费用申请列表 //根据订单号获得订单费用申请列表
export function feeApplicationListByOrderId(query){ export function feeApplicationListByOrderId(query){
return request({ return request({
......
...@@ -199,6 +199,7 @@ export default { ...@@ -199,6 +199,7 @@ export default {
cursor: pointer; cursor: pointer;
transition: 0.5s; transition: 0.5s;
box-shadow: #bfbfbf 3px 3px 14px 0; box-shadow: #bfbfbf 3px 3px 14px 0;
user-select: none;
} }
.warehouse-block:hover{ .warehouse-block:hover{
opacity: 0.9; opacity: 0.9;
...@@ -227,6 +228,7 @@ export default { ...@@ -227,6 +228,7 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1px; gap: 1px;
user-select: none;
} }
.position-item{ .position-item{
width: 100%; width: 100%;
......
...@@ -99,6 +99,7 @@ export const DICT_TYPE = { ...@@ -99,6 +99,7 @@ export const DICT_TYPE = {
ECW_RECEIPT_STATE: 'receipt_state',//收款单状态 ECW_RECEIPT_STATE: 'receipt_state',//收款单状态
ECW_SUING_METHOD: 'suing_method', // 出单方式 ECW_SUING_METHOD: 'suing_method', // 出单方式
ECW_HARVEST_METHOD: 'harvest_method', // 收货方式 ECW_HARVEST_METHOD: 'harvest_method', // 收货方式
ECW_PAY_ADVANCE: 'pay_advance', // 是否预付
//--------ecw--------- //--------ecw---------
CUSTOMER_STATUS: 'customer_status', CUSTOMER_STATUS: 'customer_status',
CUSTOMER_SOURCE: 'customer_source', CUSTOMER_SOURCE: 'customer_source',
......
const lodop = function(){
return new Promise((resolve, reject) => {
if(!window.getLodop){
var hm = document.createElement("script");
hm.src = "/static/LodopFuncs.js";
hm.onload = function(){
console.log('lodop.js已加载')
// 加载js文件后会自动链接ws,等一会再操作
setTimeout(res => {
resolve(getLodop())
}, 500)
}
hm.onerror = function(err){
reject(err)
}
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
}else resolve(getLodop())
})
}
export default lodop
\ No newline at end of file
<template>
<el-dialog :title="title" visible :before-close="closeDialog">
<div class="" v-if="step == 'form'">
<el-form ref="form" :model="form" label-position="left" label-width="100px">
<el-form-item v-if="detail" label="订单号">
<el-input v-model="detail.orderNo" readonly></el-input>
</el-form-item>
<el-form-item label="起始标签" prop="start" required>
<el-input v-model.number="form.start" type="number"></el-input>
</el-form-item>
<el-form-item label="结束标签" prop="end" required>
<el-input v-model.number="form.end" type="number" :max="detail ? detail.num : 1"></el-input>
</el-form-item>
<el-form-item label="">
<el-button type="primary" @click="showPreview">去打印</el-button>
</el-form-item>
</el-form>
</div>
<template v-if="step=='preview'">
<div style="width: 80mm; margin: 0 auto;" id="order-print-tag" v-if="detail">
<div style="float: left; width: 28mm; border-bottom: 0.2mm solid #333; border-right: 0.2mm solid #333; " >
<img :src="detail.url" alt="ECP0063704N-1" style="width: 26mm" />
<p style=" text-align: center; height: 5mm; font-size: 3mm; -webkit-margin-before: 0em; -webkit-margin-after: 0em; margin-top: 0mm; " >
{{detail.orderNo}}-{{currentNo}}
</p>
<p style="margin-top: -1mm; text-align: center">
<span style="text-align: center; font-weight: 600; font-size: 6mm" >{{currentNo}}</span>
</p>
</div>
<div style="float: left; width: 50mm; margin-bottom: 2mm">
<p style=" padding-top: 0px; border-bottom: 0.2mm solid #333; text-align: center; line-height: 6mm; padding: 0px; padding-bottom: 2.5mm; margin: 0px; font-weight: 600; font-size: 6mm; " >
{{detail.orderNo}}
</p>
<p style=" padding: 0px; border-bottom: 0.2mm solid #333; text-align: center; line-height: 6mm; padding: 0px; padding-top: 2.6mm; padding-bottom: 2.6mm; margin: 0px; font-weight: 600; font-size: 6mm; " >
{{detail.marks}}
</p>
<p style=" padding: 0px; border-bottom: 0.2mm solid #333; text-align: center; line-height: 6mm; padding: 0px; margin: 0px; font-size: 5mm; text-transform: uppercase; padding-top: 3.5mm; padding-bottom: 2.5mm; " >
{{detail.startTitleEn}} --&gt;
<label style="font-weight: 600; font-size: 5.5mm">{{detail.destTitleEn}} </label>
</p>
<p style=" padding: 0px; padding-top: 2.7mm; padding-bottom: 2.7mm; padding-left: 3mm; float: left; width: 29%; border-bottom: 0.2mm solid #333; text-align: center; line-height: 6mm; font-size: 4mm; text-transform: uppercase; margin: 0px; " >
LCL
</p>
<p style=" padding: 0px; padding-top: 2.7mm; padding-bottom: 2.7mm; padding-left: 4mm; float: left; border-left: 0.2mm solid #333; border-bottom: 0.2mm solid #333; text-align: center; line-height: 6mm; margin: 0px; font-size: 5mm; text-transform: uppercase; font-weight: 500; " >
{{detail.inTime|parseTime('{y}-{m}-{d}')}}
</p>
</div>
<div style="width: 76mm">
<p style="text-align: center">
<label
style="font-size: 5mm; font-weight: 600; padding-right: 1mm"
>E&amp;C</label
>{{detail.foot}}
</p>
</div>
</div>
<div style="text-align:center;">
<el-button type="primary" @click="print">确定打印</el-button>
</div>
</template>
</el-dialog>
</template>
<script>
import {printTag} from '@/api/ecw/order'
import {parseTime} from '@/utils/ruoyi'
import lodop from '@/utils/lodop'
export default {
filters: {parseTime},
props:{
orderId: [String, Number]
},
data(){
return {
show: false,
detail: null,
step: 'form',
form:{
start: 1,
end: 1
},
currentNo: 1
}
},
computed:{
title(){
let t = '打印标签'
if(this.detail){
t += '-' + this.detail.orderNo
}
return t
}
},
created(){
this.show = true
this.loadData()
},
methods:{
loadData(){
printTag(this.orderId).then(res => {
this.$set(this, 'detail', res.data[0])
})
},
closeDialog(){
console.log('关闭')
this.show = false
this.$emit('close');
},
showPreview(){
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
this.currentNo = this.form.start
this.step = 'preview'
})
},
print(){
lodop().then(LODOP => {
LODOP.PRINT_INIT(this.title);
LODOP.SET_PRINT_STYLE("FontSize",18);
LODOP.SET_PRINT_STYLE("Bold",1);
// LODOP.ADD_PRINT_TEXT(50,231,260,39,"打印页面部分内容");
for(let i = this.form.start; i <= this.form.end; i ++){
LODOP.ADD_PRINT_HTM(88,200,350,600, document.getElementById("order-print-tag").innerHTML);
LODOP.PRINT();
}
this.$alert('已发起打印任务');
// LODOP.PREVIEW(); // 预览
/* LODOP.PRINTA(); // 选择打印机
// 直接打印 */
console.log('打印哦')
}).catch(err => {
console.error('lodop异常', err)
alert('请检查LODOP打印控件是否安装并启动');
})
}
}
}
</script>
\ No newline at end of file
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
<el-table-column label="品牌" width="100px"> <el-table-column label="品牌" width="100px">
<template slot-scope="{row}"> <template slot-scope="{row}">
<dict-selector v-model="row.brand" :type="DICT_TYPE.ECW_IS_BRAND" formatter="bool" defaultable @input="calculationPrice(row)" :disabled="!form.lineId" /> <dict-selector v-model="row.brand" :type="DICT_TYPE.ECW_IS_BRAND" defaultable @input="calculationPrice(row)" :disabled="!form.lineId" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="件数" width="90px"> <el-table-column label="件数" width="90px">
...@@ -164,19 +164,22 @@ ...@@ -164,19 +164,22 @@
<el-table-column label="运费" width="200px"> <el-table-column label="运费" width="200px">
<template slot-scope="{row}"> <template slot-scope="{row}">
<template v-if="row.fee"> <template v-if="row.fee && row.fee.charging == 1">
全包价:{{row.fee.freight}} {{currentcyMap[row.fee.freightCurrency]}} / {{unitMap[row.fee.freightVolume]}}
</template>
<template v-else-if="row.fee">
<div> <div>
运费:{{row.fee.seaFreight}} {{currentcyMap[row.fee.seaFreightCurrency]}} / {{unitMap[row.fee.seaFreightVolume]}} 运费:{{row.fee.freight}} {{currentcyMap[row.fee.freightCurrency]}} / {{unitMap[row.fee.freightVolume]}}
</div> </div>
<div> <div>
清关费:{{row.fee.clearanceFreight}} {{currentcyMap[row.fee.clearanceFreightCurrency]}} / {{unitMap[row.fee.clearanceFreightVolume]}} 清关费:{{row.fee.clearanceFee}} {{currentcyMap[row.fee.clearanceFeeCurrency]}} / {{unitMap[row.fee.clearanceFeeVolume]}}
</div> </div>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="是否预付" width="200px"> <el-table-column label="是否预付">
<template slot-scope="{row}"> <template slot-scope="{row}">
{{row.yufu || '未知'}} <dict-tag v-if="row.fee" :type="DICT_TYPE.ECW_PAY_ADVANCE" :value="row.fee.isPayAdvance" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="80px" fixed="right"> <el-table-column label="操作" width="80px" fixed="right">
...@@ -188,7 +191,7 @@ ...@@ -188,7 +191,7 @@
<!-- <!--
</el-card> </el-card>
<el-card class="mt-10"> --> <el-card class="mt-10"> -->
<div class="card-title" style="padding:20px 0;">费用小</div> <div class="card-title" style="padding:20px 0;"></div>
<el-descriptions :column="4" border> <el-descriptions :column="4" border>
<el-descriptions-item label="总件数"> <el-descriptions-item label="总件数">
{{sum.totalNum || 0}} {{sum.totalNum || 0}}
...@@ -208,6 +211,60 @@ ...@@ -208,6 +211,60 @@
</el-descriptions> </el-descriptions>
</el-card> </el-card>
<el-card class="mt-10">
<div class="card-title" slot="header">预计费用</div>
<el-descriptions :column="5" border>
<el-descriptions-item label="保价费">
{{fee.insuranceFee || 0}} 人民币
</el-descriptions-item>
<el-descriptions-item label="总运费">
<div>{{fee.seaNGN || 0}}奈拉</div>
<div>{{fee.seaRMB || 0}}人民币</div>
<div>{{fee.seaUSD || 0}}美元</div>
</el-descriptions-item>
<!--代收货款,只有非控货订单、并且线路开通了代收货款后,才显示是否代收货款选项-->
<el-descriptions-item label="总清关费">
<div>{{fee.clearanceNGN || 0}}奈拉</div>
<div>{{fee.clearanceRMB || 0}}人民币</div>
<div>{{fee.clearanceUSD || 0}}美元</div>
</el-descriptions-item>
<el-descriptions-item label="其他费用">
<!--TODO 缺少其他费用字段-->
<el-input v-model="form.collectionProxy" placeholder="" style="width:200px"></el-input>
<selector v-model="form.collectionProxyCurrency" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
</el-descriptions-item>
<el-descriptions-item label="原价" :span="2">
<!--TODO 缺少字段-->
<div>{{fee.clearanceNGN || 0}}奈拉</div>
<div>{{fee.clearanceRMB || 0}}人民币</div>
<div>{{fee.clearanceUSD || 0}}美元</div>
</el-descriptions-item>
</el-descriptions>
<div class="card-title" style="padding:20px 0;">优惠信息</div>
<el-row v-for="(item, index) in getDictDatas(DICT_TYPE.ECW_COUPON_TYPE)" :key="item.value">
<el-col :span="2">{{index+1}}.{{item.label}}</el-col>
<el-col :span="4">
<el-select placeholder="">
</el-select>
</el-col>
<el-col :span="2">-10美元</el-col>
<el-col :span="5">有效期:永久有效</el-col>
</el-row>
<el-descriptions :column="1" border>
<el-descriptions-item label="优惠合计">
1233.1美元
</el-descriptions-item>
<el-descriptions-item label="预计费用">
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="mt-10"> <el-card class="mt-10">
<div class="card-title" slot="header">通用</div> <div class="card-title" slot="header">通用</div>
...@@ -332,11 +389,10 @@ import Selector from '@/components/Selector' ...@@ -332,11 +389,10 @@ import Selector from '@/components/Selector'
import CustomerContactSelector from '@/components/CustomerContactSelector' import CustomerContactSelector from '@/components/CustomerContactSelector'
import {openedRouterList as getOpenedRouterList} from '@/api/ecw/warehouse' import {openedRouterList as getOpenedRouterList} from '@/api/ecw/warehouse'
import {getTradeCityList} from '@/api/ecw/region' import {getTradeCityList} from '@/api/ecw/region'
import {getDictData} from '@/utils/dict' import {getDictData, getDictDatas} from '@/utils/dict'
import Fee from '@/components/Fee' import Fee from '@/components/Fee'
import {getCurrencyList} from '@/api/ecw/currency' import {getCurrencyList} from '@/api/ecw/currency'
import {getUnitList} from '@/api/ecw/unit' import {getUnitList} from '@/api/ecw/unit'
import { getDictDatas } from '@/utils/dict';
import { getCustomer } from '@/api/ecw/customer'; import { getCustomer } from '@/api/ecw/customer';
import { getListTree } from "@/api/ecw/region"; import { getListTree } from "@/api/ecw/region";
import AreaSelector from '@/components/AreaSelector' import AreaSelector from '@/components/AreaSelector'
...@@ -391,6 +447,9 @@ export default { ...@@ -391,6 +447,9 @@ export default {
getDictData(){ getDictData(){
return (type, value) => getDictData(type, value) || {} return (type, value) => getDictData(type, value) || {}
}, },
getDictDatas(){
return getDictDatas
},
// 根据线路id显示线路名称 // 根据线路id显示线路名称
getRouterNameById(){ getRouterNameById(){
...@@ -460,6 +519,9 @@ export default { ...@@ -460,6 +519,9 @@ export default {
// 收货联系人发生变化获取收货客户 // 收货联系人发生变化获取收货客户
consigneeContact(){ consigneeContact(){
this.getConsignee() this.getConsignee()
},
productList(){
console.log('计算运费')
} }
}, },
created() { created() {
...@@ -533,61 +595,13 @@ export default { ...@@ -533,61 +595,13 @@ export default {
this.consignee = res.data this.consignee = res.data
}) })
}, },
/* onTransportChange(row, val){
this.this.calculationPrice(row)
if(this.getDictData(this.DICT_TYPE.ECW_TRANSPORT_TYPE, val).cssClass != 'channel') row.channelId = null
this.updateEnabledTransports()
},
onLineChange(row){
this.getProductFee(row)
this.updateEnabledTransports()
},
onChannelChange(row){
this.getProductFee(row)
}, */
onProductAttrChange(row, attr){ onProductAttrChange(row, attr){
console.log(attr) console.log(attr)
this.calculationPrice(row) this.calculationPrice(row)
/* // 需要强制刷新,否则勾选框不更新 /* // 需要强制刷新,否则勾选框不更新
this.$forceUpdate() */ this.$forceUpdate() */
}, },
// 更新运输方式
/* updateEnabledTransports(){
let enabled = {}
this.productList.forEach(prod => {
if(prod.transportId){
if(!enabled[prod.transportId]){
enabled[prod.transportId] = {
// transportId: prod.transportId,
lineIdSet: new Set(),
channelIdSet: new Set(),
routers:[]
}
}
if(prod.lineId){
enabled[prod.transportId].lineIdSet.add(prod.lineId)
}
if(prod.channelId){
enabled[prod.transportId].channelIdSet.add(prod.channelId)
}
if(prod.lineId && enabled[prod.transportId].routers.findIndex(item => { item.lineId == prod.lineId && item.channelId == prod.channelId }) < 0){
enabled[prod.transportId].routers.push({
lineId: prod.lineId,
channelId: prod.channelId
})
}
}
})
console.log(JSON.stringify(enabled))
let enabledTransportIds = Object.keys(enabled).map(item => +item)
this.transportList.forEach(transport => {
this.$set(transport, '_enabled', enabledTransportIds.indexOf(transport.transportId) > -1 && enabled[transport.transportId].routers.length)
if(transport._enabled){
Object.assign(transport, enabled[transport.transportId])
}
})
}, */
addProduct(data){ addProduct(data){
this.productList.push(data || {prodAttrArr:[]}) this.productList.push(data || {prodAttrArr:[]})
}, },
...@@ -604,7 +618,7 @@ export default { ...@@ -604,7 +618,7 @@ export default {
channelId: this.form.channelId, channelId: this.form.channelId,
prodConditionParamList: [row] prodConditionParamList: [row]
}).then(res => { }).then(res => {
this.$set(row, 'fee', res.data[0] || {}) this.$set(row, 'fee', res.data.prodCostDtoList[0] || {})
}) })
}, },
// 获取路线 // 获取路线
......
...@@ -146,8 +146,12 @@ ...@@ -146,8 +146,12 @@
v-hasPermi="['ecw:order:update']">入仓</el-button> v-hasPermi="['ecw:order:update']">入仓</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ecw:order:update']">退仓</el-button> v-hasPermi="['ecw:order:update']">退仓</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="$router.push('/order/special?id=' + scope.row.orderId)"
v-hasPermi="['ecw:order:update']">特价</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ecw:order:delete']">删除</el-button> v-hasPermi="['ecw:order:delete']">删除</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="printTagOrderId=scope.row.orderId"
v-hasPermi="['ecw:order:delete']">打印标签</el-button>
<el-button type="text" size="mini" @click="$router.push(`/order/fee-application/${scope.row.orderId}`)">费用申请</el-button> <el-button type="text" size="mini" @click="$router.push(`/order/fee-application/${scope.row.orderId}`)">费用申请</el-button>
<el-button type="text" size="mini" @click="orderId = scope.row.orderId;isShow = true" >特殊</el-button> <el-button type="text" size="mini" @click="orderId = scope.row.orderId;isShow = true" >特殊</el-button>
<el-button type="text" size="mini" @click="$router.push(`/order/associated-order/${scope.row.orderId}`)" >关联</el-button> <el-button type="text" size="mini" @click="$router.push(`/order/associated-order/${scope.row.orderId}`)" >关联</el-button>
...@@ -190,6 +194,12 @@ ...@@ -190,6 +194,12 @@
</div> </div>
</el-dialog> </el-dialog>
<special-needs :show.sync="isShow":order-id="orderId" @determine="getList" ></special-needs> <special-needs :show.sync="isShow":order-id="orderId" @determine="getList" ></special-needs>
<!-- <el-dialog :title="'打印标签'" visible.sync="showPrintTag">
</el-dialog> -->
<print-tag v-if="printTagOrderId !== null" :order-id="printTagOrderId" @close="printTagOrderId=null" />
<special-needs :show.sync="isShow" :order-id="orderId" ></special-needs>
</div> </div>
</template> </template>
...@@ -202,11 +212,12 @@ import specialNeeds from '@/views/ecw/order/components/specialNeeds'; ...@@ -202,11 +212,12 @@ import specialNeeds from '@/views/ecw/order/components/specialNeeds';
import { getTradeCityList } from '@/api/ecw/region' import { getTradeCityList } from '@/api/ecw/region'
import { createOrder, updateOrder, deleteOrder, getOrder, getOrderPage, exportOrderExcel } from "@/api/ecw/order"; import { createOrder, updateOrder, deleteOrder, getOrder, getOrderPage, exportOrderExcel } from "@/api/ecw/order";
import { getDictDatas, DICT_TYPE } from '@/utils/dict'; import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import PrintTag from './components/PrintTag'
export default { export default {
name: "Order", name: "Order",
components: { components: {
CustomerSelector, ProductSelector, Selector,specialNeeds, CustomerSelector, ProductSelector, Selector,specialNeeds,PrintTag
}, },
filters: { filters: {
cargoControlStatusFilter(e, cargoControlStatusList) { cargoControlStatusFilter(e, cargoControlStatusList) {
...@@ -259,60 +270,7 @@ export default { ...@@ -259,60 +270,7 @@ export default {
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10
orderNo: null,
number: null,
tidanNo: null,
parentNumber: null,
oldNumbers: null,
transportId: null,
lineId: null,
channelId: null,
orderType: null,
userId: null,
marks: null,
productRecord: null,
isCargoControl: null,
cargoControlStatus: null,
customsType: null,
upFile: null,
payType: null,
status: null,
isDel: null,
collectionProxy: null,
isCollection: null,
zhongPao: null,
wVolume: null,
vWeight: null,
weightUnit: null,
warehouseType: null,
countryAbbreviation: null,
countryCode: null,
sendsms: null,
commissionId: null,
documentsFile: null,
remarks: null,
isTodoOrder: null,
advanceType: null,
transFee: null,
transCurrency: null,
plateFee: null,
boxFee: null,
todoDetail: null,
advanceWho: null,
toDepartureId: null,
sumNum: null,
sumVolume: null,
sumWeight: null,
weightRatio: null,
customerId: null,
wareId: null,
areaId: null,
locationId: null,
locationName: null,
sumValue: null,
valuationFee: null,
cost: null,
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -334,6 +292,8 @@ export default { ...@@ -334,6 +292,8 @@ export default {
denominator: '', //重货比分母 denominator: '', //重货比分母
dateFilterType: '', //日期筛选类别 dateFilterType: '', //日期筛选类别
dateFilter: [], //筛选日期 dateFilter: [], //筛选日期
printTagOrderId: null, // 显示打印标签的订单号
isShow:false,//特殊显示 isShow:false,//特殊显示
orderId:undefined, orderId:undefined,
}; };
...@@ -352,6 +312,9 @@ export default { ...@@ -352,6 +312,9 @@ export default {
getTradeCityList().then(res => this.tradeCityList = res.data) getTradeCityList().then(res => this.tradeCityList = res.data)
}, },
methods: { methods: {
printTag(item){
},
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true;
......
<template>
<div class="app-container">
<el-card>
<div slot="header" class="card-title">申请特价</div>
<!-- 列表 -->
<div class="offer-header">
<span style="font-size: 15px;">订单号:{{ offer.number }}</span>
</div>
<el-table v-loading="loading" :data="offer.offerProdRespVOList">
<el-table-column label="序号" align="center" prop="id" type="index"></el-table-column>
<el-table-column
prop="prodTitleZh"
label="品名">
<template v-slot="{row}">
{{ row.prodTitleZh }}/{{ row.prodTitleEn }}
</template>
</el-table-column>
<el-table-column
prop="prodAttrIds"
label="填单货物属性">
<template v-slot="{row}">
{{ getProductNamesByIds(row.prodAttrIds) }}
</template>
</el-table-column>
<el-table-column
prop="address"
label="入库货物属性">
<template v-slot="{row}">
品牌:{{ row.brand ? '' : '' }}<br>
箱数:{{ row.num }}<br>
体积:{{ row.volume }}<br>
重量:{{ row.weight }}Kg
</template>
</el-table-column>
<el-table-column
prop="updateTime"
:formatter="(_, __, v) => parseTime(v)"
label="最后操作时间">
</el-table-column>
<el-table-column
label="原价">
<template v-slot="{row}">
运费:{{ row.originalSeaFreight }} {{ currentMap[row.seaFreightCurrency] }}/{{ unitMap[row.seaFreightVolume] }}
<br>
清关费:{{ row.originalClearanceFreight }} {{ currentMap[row.clearanceFreightCurrency] }}/{{ unitMap[row.clearanceFreightVolume] }}
</template>
</el-table-column>
<el-table-column
prop="address"
label="成本价">
<template v-slot="{row}">
运费:{{ row.seaFreight }} {{ currentMap[row.seaFreightCurrency] }}/{{ unitMap[row.seaFreightVolume] }}
<br>
清关费:{{ row.clearanceFreight }} {{ currentMap[row.clearanceFreightCurrency] }}/{{ unitMap[row.clearanceFreightVolume] }}
</template>
</el-table-column>
<el-table-column
prop="address"
label="销售价">
<template v-slot="{row}">
运费:{{ row.seaFreight }} {{ currentMap[row.seaFreightCurrency] }}/{{ unitMap[row.seaFreightVolume] }}
<br>
清关费:{{ row.clearanceFreight }} {{ currentMap[row.clearanceFreightCurrency] }}/{{ unitMap[row.clearanceFreightVolume] }}
</template>
</el-table-column>
<el-table-column
prop="status"
:formatter="(v) => ['取消报价', '特价审批中', '需求确认(草稿)', '跟进中', '赢单', '输单', '报价完成', '审批通过', '审批拒绝'][v.status]"
label="审核状态">
</el-table-column>
<el-table-column
prop="address"
label="操作">
<template v-slot="{row}">
<el-button size="mini" type="text" v-hasPermi="['ecw:offer:update']" @click="$router.push(`/offer/discount/${row.offerProdId}?offerId=${row.offerId}`)">优惠申请</el-button>
<!-- <el-button size="mini" type="text" v-hasPermi="['ecw:offer:update']">佣金规则</el-button>-->
<!-- <el-button size="mini" type="text" v-hasPermi="['ecw:offer:update']">管理折扣</el-button>-->
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 80px">
<el-button type="primary">申请重货优惠</el-button>
<el-button type="primary">申请泡货优惠</el-button>
<el-button type="primary">关闭窗口</el-button>
</div>
</el-card>
</div>
</template>
<script>
import {DICT_TYPE, getDictDataLabel} from '@/utils/dict'
import {getUnitList} from "@/api/ecw/unit"
import {getCurrencyList} from "@/api/ecw/currency"
import {getProductAttrList} from "@/api/ecw/productAttr"
import { parseTime } from '@/utils/ruoyi'
import {getOrder} from "@/api/ecw/order"
export default {
name: "OrderSpecial",
components: {
},
props: {
offerId: String
},
data() {
return {
parseTime,
DICT_TYPE,
getDictDataLabel,
// 遮罩层
loading: true,
list: [],
total:0,
params:{
page:1,
rows:20,
offerId:0,
type:2
},
relationId:0,
creatorName:'test',
offer: {
number: '',
offerProdRespVOList: []
},
unitList:[],
currencyList:[],
productAttrList:[],
};
},
created() {
if(this.offerId){
this.params.offerId = this.offerId
this.getOrder()
}
getUnitList().then(res => this.unitList = res.data)
getCurrencyList().then(res => this.currencyList = res.data)
getProductAttrList().then(res => this.productAttrList = res.data)
},
methods: {
getOrder(){
this.loading = true
getOrder(this.offerId).then(response => {
this.loading = false
this.offer = response.data
})
},
getProductNamesByIds(ids){
const result = []
ids.split(',').forEach(e => {
this.productAttrList.forEach(f => {
if (parseInt(e) === f.id) {
result.push(f.attrName)
}
})
})
return result.join(',')
}
},
computed: {
currentMap(){
let map = {}
this.currencyList.forEach(item => {
map[item.id] = item.titleZh
})
return map
},
unitMap(){
let map = {}
this.unitList.forEach(item => {
map[item.id] = item.titleZh
})
return map
}
}
};
</script>
<style>
.card-title{
font-size: 18px;
font-weight: bold;
}
.offer-header{
padding-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
}
</style>
...@@ -87,7 +87,7 @@ export default { ...@@ -87,7 +87,7 @@ export default {
data() { data() {
return { return {
DICT_TYPE, DICT_TYPE,
opened: true, opened: false,
form: { form: {
material: undefined, material: undefined,
time: 0 time: 0
......
...@@ -56,8 +56,8 @@ ...@@ -56,8 +56,8 @@
label="操作"> label="操作">
<template v-slot="{row}"> <template v-slot="{row}">
<el-button size="mini" type="text" @click="handleWarehousing(row.prodId)">入仓</el-button> <el-button size="mini" type="text" @click="handleWarehousing(row.prodId)">入仓</el-button>
<el-button size="mini" type="text">追加</el-button> <el-button size="mini" type="text" @click="handleWarehousing(row.prodId)">追加</el-button>
<el-button size="mini" type="text">退仓</el-button> <el-button size="mini" type="text" @click="handleWarehousingReturn(row)">退仓</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -203,6 +203,24 @@ export default { ...@@ -203,6 +203,24 @@ export default {
handleWarehousing(id) { handleWarehousing(id) {
this.warehousingId = id this.warehousingId = id
this.warehousingVisible = true this.warehousingVisible = true
},
handleWarehousingReturn(item){
this.$confirm(item.prodTitleZh + '退仓后不可恢复,是否确认退仓?', '确定要退仓?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log(item.id)
this.$message({
type: 'success',
message: '删除成功!'
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment