This commit is contained in:
linfso 2024-07-20 13:00:02 +08:00
parent 62c577c869
commit 1cf9209da9
10 changed files with 205 additions and 154 deletions

View File

@ -35,8 +35,7 @@
>
<div class="setting-row-content">
<div style="text-align:right;display: inline-flex;width:240px;border-bottom: 1px solid #d5d4d438;padding: 0px 0px 10px 0px;">
<!-- <el-button @click="delAllStorage">恢复系统表格设置</el-button>
<el-button @click="delStorage">恢复当前表格设置</el-button> -->
<div style="text-align: left;width: 55%;">
<el-select
v-model="curentTbShowTpl"
@ -58,11 +57,8 @@
:value="item.tplCode"
/>
</el-select>
<!-- <el-button type="text" size="mini" plain @click="changeTbShowTpl" >切换模版</el-button> -->
</div>
<!-- <div style="text-align: right;width: 50%;">
<el-button type="text" size="mini" plain @click="delAllStorage" >重置</el-button>
</div> -->
<div style="text-align: right;width: 45%;line-height: 30px;display:inline-flex">
<el-button type="text" size="mini" style="padding: 7px 5px;" @click="savaTbShowTpl" :disabled="!isNeedDbSaveTpl">保存</el-button>
<el-button type="text" size="mini" style="padding: 7px 5px;" icon="el-icon-refresh" @click="delStorage" ></el-button>
@ -83,21 +79,9 @@
>
<div v-for="col in storageList" :key="col.label" class="setting-row">
<!-- <i class="el-icon-s-operation" /> -->
<i class="el-icon-s-operation icon iconfont icon-ui_drag_horizontally" />
<el-checkbox v-model="col.show" class="label" @change="showOrHidden($event,col)">{{ col.label }}</el-checkbox>
<!-- <el-button
size="mini"
class="btn icon iconfont icon-fixed-left"
:type="col.fixed === 'left' ? 'primary' : 'default'"
@click="setFixed('left',col)"
></el-button>
<el-button
class="btn icon iconfont icon-fixed-right"
size="mini"
:type="col.fixed === 'right' ? 'primary' : 'default'"
@click="setFixed('right',col)"
></el-button> -->
</div>
</draggable>
</el-scrollbar>
@ -143,9 +127,9 @@
style="transform-origin: center top; z-index: 2009;width: 180px;"
x-placement="bottom-end">
<li class="el-dropdown-menu__item" @click.stop="handleCopySelect($event)" > <span >复制</span></li>
<!-- <li class="el-dropdown-menu__item" > <span @click="handleCopySelect(null,$event)">复制选中数据</span></li> -->
<!-- <li class="el-dropdown-menu__item" > <span @click="handleCopySelect(null,$event)">复制行</span></li> -->
<!-- <li class="el-dropdown-menu__item" > <span @click="handleCopySelect(null,$event)">复制列</span></li> -->
<li class="el-dropdown-menu__item" @click.stop="handleSelectCurrentColumn($event)" > <span >选中当前列</span></li>
<li class="el-dropdown-menu__item" > <span @click="handleSelectCurrentRow(null,$event)">选中当前行</span></li>
</ul>
</div>
<el-dialog title="设置模板" :visible.sync="openTbShowTplDlg" width="50%">
@ -200,19 +184,17 @@
</div>
</template>
<script>
import { listSysCustomizeTpl, getSysCustomizeTpl, delSysCustomizeTpl, addSysCustomizeTpl, updateSysCustomizeTpl } from "@/api/system/sysCustomizeTpl";
import { parseTime,genJsSeqNo } from "@/utils/custom";
import { listSysCustomizeTpl, delSysCustomizeTpl, addSysCustomizeTpl, updateSysCustomizeTpl } from "@/api/system/sysCustomizeTpl";
import { genJsSeqNo } from "@/utils/custom";
import clip from '@/utils/clipboard'
import Sortable from 'sortablejs'
import draggable from 'vuedraggable'
import origTable from './table.jsx'
// import setHeight from '@/mixins/setHeight'
const components = { origTable, draggable }
export default {
name: 'XdTable',
components,
// mixins: [setHeight],
props: {
id: {
type: String,
@ -270,13 +252,17 @@ export default {
tbBodyDiv.onmousedown = function (ev) {
var evt = window.event || arguments[0];
var flag = true;
// 鼠标右键菜单
// 鼠标右键菜单,并且记录当前位置
if(evt.button == 2){
flag=false;
if(vnode.context.multipleSelection&&vnode.context.multipleSelection.length>0){
vnode.context.currentOdiv=oDiv;
vnode.context.currentCell=evt.target;
showContextMenu(evt);
const currentCellInfo=getCellPosition(evt.target);
vnode.context.currentCellInfo=currentCellInfo;
}
return;
}
@ -313,7 +299,6 @@ export default {
//重置选中css
for (var i = 0; i < fileNodes.length; i++) {
if (fileNodes[i].className.indexOf("el-table__cell") != -1) {
// fileNodes[i].className = "el-table__cell";
fileNodes[i].classList.remove("seled");
selList.push(fileNodes[i]);
}
@ -321,7 +306,6 @@ export default {
setMouseCellSelect(evt.target);
var _x = null;
var _y = null;
// vnode.context.clearEventBubble(evt);
@ -336,7 +320,6 @@ export default {
// if(Math.abs(_x - startX)<5 && Math.abs(_y - startY)<5){
// return;
// }
//为了确保只有一次的渲染每次框选都把默认选中为空
if(flag){
flag = false;
}
@ -359,15 +342,14 @@ export default {
selDiv.style.width = Math.abs(_x - startX) + "px";
selDiv.style.height = Math.abs(_y - startY) + "px";
// 核心,判断选择的区域
var _l = selDiv.offsetLeft, _t = selDiv.offsetTop;
var _w = selDiv.offsetWidth, _h = selDiv.offsetHeight;
for (var i = 0; i < selList.length; i++) {
var sl = selList[i].offsetWidth + selList[i].offsetLeft;
var st = selList[i].offsetHeight + selList[i].offsetTop;
if (sl > _l && st > _t && selList[i].offsetLeft < _l + _w && selList[i].offsetTop < _t + _h) {
if(sl > _l && st > _t && selList[i].offsetLeft < _l + _w && selList[i].offsetTop < _t + _h) {
// 选择列不允许选择
if(selList[i].className.indexOf("--selection") != -1 ){
continue;
@ -378,25 +360,9 @@ export default {
const cellInfo=getCellPosition(selList[i]);
vnode.context.multipleSelection.push(cellInfo);
// vnode.context.$refs.table.$refs.elTable.toggleRowSelection(vnode.context.tableData[i],true)
//把选中的都存入到table标签中的已选中
// if(vnode.context.tableData[i]){
// vnode.context.multipleSelection.push(vnode.context.tableData[i]);
// }
}
} else {
if (selList[i].className.indexOf("seled") != -1 ) {
// selList[i].className = "el-table__cell";
selList[i].classList.remove("seled");
}
}
}
// console.log(vnode.context.multipleSelection);
}
}
vnode.context.clearEventBubble(evt);
};
@ -568,6 +534,9 @@ export default {
currentCellInfo:null,
currentSelectStr:null,
currentOdiv:null,
currentCell:null,
checkAll: false, //招标阶段 是否全选
isIndeterminate: false, //全选复选框标识
@ -818,6 +787,67 @@ export default {
// this.$emit('handleSelect',this.multipleSelection)
},
getCellInfo(cell) {
try{
while(cell.tagName !== 'TD'){
cell = cell.parentElement;
}
const rowIndex = cell.parentElement.rowIndex;
const cellIndex = cell.cellIndex;
const text = cell.innerText;
return { row:rowIndex,col: cellIndex ,text:text};
}catch(e){
return { rowIndex:-1,cellIndex:-1};
}
},
// 复制选中数据
handleCopySelect(event) {
this.contextVisible=false;
if(this.currentSelectStr){
navigator.clipboard.writeText(this.currentSelectStr).then(() => {
this.$message({message: '复制成功', type:'success'})//提示
this.currentSelectStr=null;
});
}
},
// 选择整行
handleSelectCurrentRow(evt){
this.contextVisible=false;
var fileNodes = this.currentOdiv.getElementsByTagName("td");
if(this.currentCellInfo){
this.multipleSelection=[];
for (var i = 0; i < fileNodes.length; i++) {
const selItem=fileNodes[i];
if (selItem.className.indexOf("el-table__cell") != -1 && selItem.parentElement.rowIndex == this.currentCellInfo.row ) {
selItem.className = selItem.className + " seled";
const cellInfo=this.getCellInfo(selItem);
this.multipleSelection.push(cellInfo);
}else{
selItem.classList.remove("seled");
}
}
}
},
// 选择整列
handleSelectCurrentColumn(evt){
this.contextVisible=false;
var fileNodes = this.currentOdiv.getElementsByTagName("td");
if(this.currentCellInfo){
this.multipleSelection=[];
for (var i = 0; i < fileNodes.length; i++) {
const selItem=fileNodes[i];
if (selItem.className.indexOf("el-table__cell") != -1 && selItem.cellIndex == this.currentCellInfo.col ) {
selItem.className = selItem.className + " seled";
const cellInfo=this.getCellInfo(selItem);
this.multipleSelection.push(cellInfo);
}else{
selItem.classList.remove("seled");
}
}
}
},
trimTabChar(str,char, type) {
if (char) {
if (type == 'left') {
@ -851,18 +881,7 @@ export default {
clip(text, event)
},
handleCopySelect(event) {
this.contextVisible=false;
if(this.currentSelectStr){
navigator.clipboard.writeText(this.currentSelectStr).then(() => {
this.$message({message: '复制成功', type:'success'})//提示
this.currentSelectStr=null;
});
}
},
handleSelectCurrentRow(){
},
setHeaderSortable(){
let that=this;
this.$nextTick(function () {
@ -897,9 +916,7 @@ export default {
}
})
},
handleSelectCurrentColumn(){
},
// 定义方法 isEqual 来比较两个选中数据对象是否相同
isEqual(data1, data2) {
return (
@ -1172,9 +1189,20 @@ export default {
user-select: none;
}
.el-table__body tr.current-row>td {
background: #453878 !important;
}
// :deep .el-table__body tr.current-row>td {
// background: none !important;
// }
// :deep .el-table__body tr:hover > td {
// background-color: pink !important;
// }
// :deep .el-table__body .el-table-column--selection {
// .parent {
// background-color: pink !important;
// }
// }
// 拖拽

View File

@ -40,17 +40,18 @@
},
watch: {
value(newVal,oldVal) {
if(this.value!=null){
this.svalue=this.value;
// 判断默认值中是否存在,若存在则不继续查询
if(this.optionItems){
let selItem = this.optionItems.find(item => item.regionCode == this.svalue);
if(selItem){
return;
}
}
this.queryData(null,this.svalue);
}
this.svalue=this.value;
// if(this.value!=null){
// // 判断默认值中是否存在,若存在则不继续查询
// if(this.optionItems){
// let selItem = this.optionItems.find(item => item.regionCode == this.svalue);
// if(selItem){
// return;
// }
// }
// }
this.queryData(null,this.svalue);
},
parentCode(newVal,oldVal) {
if(newVal!=oldVal){
@ -59,9 +60,9 @@
}
},
created() {
if(this.svalue!=null){
this.queryData(null,this.svalue);
}
// if(this.svalue!=null){
// }
this.queryData(null,this.svalue);
},
methods: {
onClick(){

View File

@ -40,17 +40,18 @@
},
watch: {
value(newVal,oldVal) {
if(this.value!=null){
this.svalue=this.value;
// 判断默认值中是否存在,若存在则不继续查询
if(this.optionItems){
let selItem = this.optionItems.find(item => item.regionCode == this.svalue);
if(selItem){
return;
}
}
this.queryData(null,this.svalue);
}
// if(this.value!=null){
// // 判断默认值中是否存在,若存在则不继续查询
// if(this.optionItems){
// let selItem = this.optionItems.find(item => item.regionCode == this.svalue);
// if(selItem){
// return;
// }
// }
// }
this.svalue=this.value;
this.queryData(null,this.svalue);
},
parentCode(newVal,oldVal) {
if(newVal!=oldVal){
@ -59,9 +60,9 @@
}
},
created() {
if(this.svalue!=null){
this.queryData(null,this.svalue);
}
// if(this.svalue!=null){
// }
this.queryData(null,this.svalue);
},
methods: {
onClick(){

View File

@ -437,9 +437,9 @@
<!-- <el-table-column :label="$t('进仓单号')" align="center" prop="warehouseInNo" width="80" :show-overflow-tooltip="true"/> -->
<el-table-column :label="$t('客户名称')" align="center" prop="customerName" min-width="80" :show-overflow-tooltip="true">
<el-table-column :label="$t('客户名称')" align="center" prop="custName" min-width="80" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.paymentType==2 || scope.row.paymentType==4 || scope.row.paymentType==5">{{scope.row.customerName}}</span>
<span v-if="scope.row.paymentType==2 || scope.row.paymentType==4 || scope.row.paymentType==5">{{scope.row.custName}}</span>
<span v-else></span>
</template>
</el-table-column>

View File

@ -439,9 +439,9 @@
<!-- <el-table-column :label="$t('进仓单号')" align="center" prop="warehouseInNo" width="80" :show-overflow-tooltip="true"/> -->
<el-table-column :label="$t('客户名称')" align="center" prop="customerName" min-width="80" :show-overflow-tooltip="true">
<el-table-column :label="$t('客户名称')" align="center" prop="custName" min-width="80" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.paymentType==2 || scope.row.paymentType==4 || scope.row.paymentType==5">{{scope.row.customerName}}</span>
<span v-if="scope.row.paymentType==2 || scope.row.paymentType==4 || scope.row.paymentType==5">{{scope.row.custName}}</span>
<span v-else></span>
</template>
</el-table-column>

View File

@ -281,7 +281,10 @@
@queryTable="getList"
@selection-change="handleSelectionChange"
@sort-change="handleSortChange"
@row-dblclick="handleShowTraceInfo"
@row-dblclick="handleShowTraceInfo"
:row-class-name="tableRowClassName"
>
<div slot="toolbar">
@ -402,7 +405,7 @@
</el-table-column>
<el-table-column :label="$t('录入人')" align="center" prop="registerManName" min-width="80" :show-overflow-tooltip="true" />
<el-table-column :label="$t('客户名称')" align="center" prop="customerName" min-width="80" :show-overflow-tooltip="true">
<el-table-column :label="$t('客户名称')" align="center" prop="custName" min-width="80" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.paymentType==2 || scope.row.paymentType==4 || scope.row.paymentType==5">{{scope.row.custName}}</span>
<span v-else></span>
@ -835,6 +838,10 @@ export default {
//标红table指定行
tableRowClassName({row, rowIndex}) {
if (this.selectionList.some((item) => item === row)) {
return "select-row";
}
if (row.blSign=='1') {
return 'success-row';
}
@ -1086,6 +1093,10 @@ export default {
margin-bottom: 0px !important;
}
// :deep .el-table .select-row {
// // background-color: rgb(255, 244, 232);
// }
:deep .el-table .success-row {
color: rgb(21, 174, 31) !important;
}

View File

@ -408,7 +408,7 @@
<!-- <el-table-column :label="$t('进仓单号')" align="center" prop="warehouseInNo" width="80" :show-overflow-tooltip="true"/> -->
<el-table-column :label="$t('客户名称')" align="center" prop="customerName" min-width="80" :show-overflow-tooltip="true">
<el-table-column :label="$t('客户名称')" align="center" prop="custName" min-width="80" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.paymentType==2 || scope.row.paymentType==4 || scope.row.paymentType==5">{{scope.row.custName}}</span>
<span v-else></span>

View File

@ -31,7 +31,7 @@
<el-descriptions-item label="合同号" :span="4">{{ form.custOrderId }}</el-descriptions-item>
<el-descriptions-item label="取件员/操作员">{{ form.takePieceEmployeeName }}/{{ form.operateEmployeeName }}</el-descriptions-item>
<el-descriptions-item label="录单员">{{ form.registerManName }}</el-descriptions-item>
<el-descriptions-item v-if="form.paymentType == 2 || form.paymentType == 4 || form.paymentType == 5" label="月结客户" >{{ form.customerName }}</el-descriptions-item>
<el-descriptions-item v-if="form.paymentType == 2 || form.paymentType == 4 || form.paymentType == 5" label="月结客户" >{{ form.custName }}</el-descriptions-item>
<el-descriptions-item label="回款联系人">{{ form.payee }}</el-descriptions-item>
<el-descriptions-item label="销售联系人">{{ form.salesmen }}</el-descriptions-item>
</el-descriptions>
@ -148,7 +148,7 @@
<dict-tag :options="dict.type.emis_payment_type" :value="form.paymentType"/>
</el-descriptions-item>
<!-- <el-descriptions-item label="费用币种">{{ form.currency }}</el-descriptions-item> -->
<el-descriptions-item v-if="form.paymentType == 2 || form.paymentType == 4 || form.paymentType == 5" label="月结客户" :span="4">{{ form.customerName }}</el-descriptions-item>
<el-descriptions-item v-if="form.paymentType == 2 || form.paymentType == 4 || form.paymentType == 5" label="月结客户" :span="4">{{ form.custName }}</el-descriptions-item>
<el-descriptions-item label="回款联系人">{{ form.payee }}</el-descriptions-item>
<el-descriptions-item label="销售联系人" :span="3">{{ form.salesmen }}</el-descriptions-item>
<el-descriptions-item label="费用明细" :span="4">

View File

@ -385,22 +385,22 @@
</el-table-column>
<el-table-column prop="length" :label="$t('长(cm)')" align="center" width="60">
<template slot-scope="scope">
<el-input v-model="scope.row.length" @input="(val)=>handleCalcVolumeDebounce(scope.row)" size="mini" placeholder=""></el-input>
<el-input v-model="scope.row.length" @input="(val)=>handleCalcVolumeDebounce(scope.row)" :ref="'input_'+(scope.$index+1)" @keyup.native.enter="focusNextInput('input_'+(scope.$index+2)+'')" size="mini" placeholder=""></el-input>
</template>
</el-table-column>
<el-table-column prop="width" :label="$t('宽(cm)')" align="center" width="60">
<template slot-scope="scope">
<el-input v-model="scope.row.width" @input="(val)=>handleCalcVolumeDebounce(scope.row)" size="mini" placeholder=""></el-input>
<el-input v-model="scope.row.width" @input="(val)=>handleCalcVolumeDebounce(scope.row)" :ref="'input_'+(scope.$index+2)" @keyup.native.enter="focusNextInput('input_'+(scope.$index+3)+'')" size="mini" placeholder=""></el-input>
</template>
</el-table-column>
<el-table-column prop="height" :label="$t('高(cm)')" align="center" width="60">
<template slot-scope="scope">
<el-input v-model="scope.row.height" @input="(val)=>handleCalcVolumeDebounce(scope.row)" size="mini" placeholder=""></el-input>
<el-input v-model="scope.row.height" @input="(val)=>handleCalcVolumeDebounce(scope.row)" :ref="'input_'+(scope.$index+3)" @keyup.native.enter="focusNextInput('input_'+(scope.$index+4)+'')" size="mini" placeholder=""></el-input>
</template>
</el-table-column>
<el-table-column prop="cargoQty" :label="$t('件数')" align="center" width="60">
<template slot-scope="scope">
<el-input v-model="scope.row.cargoQty" @blur="(val)=>handleCargoQtyChangeDebounce(scope.row)" @keyup.enter.native="(val)=>handleCargoQtyChange(scope.row)" size="mini" placeholder=""></el-input>
<el-input v-model="scope.row.cargoQty" @blur="(val)=>handleCargoQtyChangeDebounce(scope.row)" :ref="'input_'+(scope.$index+4)" @keyup.enter.native="(val)=>handleCargoQtyChange(scope.row)" size="mini" placeholder=""></el-input>
</template>
</el-table-column>
<el-table-column prop="volume" :label="$t('体积(m³)')" align="center" width="80">
@ -1155,18 +1155,20 @@ methods: {
}
}
else{
this.$confirm("打印组件未连接,可【返回操作】稍后打印,或【操作下一单】", "提示", {
confirmButtonText: "操作下一单",
type: "warning",
distinguishCancelAndClose: true,
closeOnClickModal: false,
showCancelButton: false,
showClose: false
}).then(() => {
this.billCode=null;
this.form.billCode=null;
this.initData();
});
this.billCode=null;
this.form.billCode=null;
this.initData();
// this.$confirm("打印组件未连接,可【返回操作】稍后打印,或【操作下一单】", "提示", {
// confirmButtonText: "操作下一单",
// type: "warning",
// distinguishCancelAndClose: true,
// closeOnClickModal: false,
// showCancelButton: false,
// showClose: false
// }).then(() => {
// });
}
},
@ -1230,34 +1232,36 @@ methods: {
}
}
else{
this.$confirm("打印组件未连接,可【返回操作】稍后打印,或【操作下一单】", "提示", {
confirmButtonText: "操作下一单",
type: "warning",
distinguishCancelAndClose: true,
closeOnClickModal: false,
showCancelButton: false,
showClose: false
}).then(() => {
this.billCode=null;
this.form.billCode=null;
this.initData();
});
// this.$confirm("打印组件未连接,可【返回操作】稍后打印,或【操作下一单】", "提示", {
// confirmButtonText: "操作下一单",
// type: "warning",
// distinguishCancelAndClose: true,
// closeOnClickModal: false,
// showCancelButton: false,
// showClose: false
// }).then(() => {
// });
this.billCode=null;
this.form.billCode=null;
this.initData();
}
},
onComplete(){
this.$confirm("操作已完成是否【操作下一单】", "提示", {
confirmButtonText: "操作下一单",
type: "warning",
distinguishCancelAndClose: true,
closeOnClickModal: false,
showCancelButton: false,
showClose: false
}).then(() => {
// this.$confirm("操作已完成是否【操作下一单】", "提示", {
// confirmButtonText: "操作下一单",
// type: "warning",
// distinguishCancelAndClose: true,
// closeOnClickModal: false,
// showCancelButton: false,
// showClose: false
// }).then(() => {
// });
this.billCode=null;
this.form.billCode=null;
this.initData();
});
},
onDestCountryChange(item){
if(item){
@ -1721,7 +1725,9 @@ methods: {
});
}
},
focusNextInput(nextRef) {
this.$refs[nextRef].focus()
},
handleCalcVolumeDebounce(row){
// 控制触发频率
debounce(250, this.handleCalcVolume(row))
@ -1762,7 +1768,7 @@ methods: {
}
let feeRemark="";
let totalFee=0;
let totalFee=Number(0);
if(this.form.feeItems&&this.form.feeItems.length>0){
let len=this.form.feeItems.length;
for(let i=0;i<len;i++){
@ -1771,16 +1777,17 @@ methods: {
if(item.currency&&item.currency !='CNY'){
let res= await getValidExchangeRate({from:item.currency,to:'CNY'});
if(res.code==200){
newFee=newFee*parseFloat(res.data);
newFee=newFee*Number(res.data);
}
}
newFee=newFee.toFixed(2);
feeRemark= feeRemark+item.feeName+":" + newFee+",";
totalFee=parseFloat(totalFee)+parseFloat(newFee);
totalFee=Number(totalFee)+Number(newFee);
}
}
this.form.feeRemark=feeRemark;
this.form.freight = totalFee;
this.form.freight = totalFee.toFixed(2);
},
// 计算体积重量
handleCalcVolumeWeight(){

View File

@ -385,22 +385,22 @@
</el-table-column>
<el-table-column prop="length" :label="$t('长(cm)')" align="center" width="60">
<template slot-scope="scope">
<el-input v-model="scope.row.length" @input="(val)=>handleCalcVolumeDebounce(scope.row)" size="mini" placeholder=""></el-input>
<el-input v-model="scope.row.length" @input="(val)=>handleCalcVolumeDebounce(scope.row)" :ref="'input_'+(scope.$index+1)" @keyup.native.enter="focusNextInput('input_'+(scope.$index+2)+'')" size="mini" placeholder=""></el-input>
</template>
</el-table-column>
<el-table-column prop="width" :label="$t('宽(cm)')" align="center" width="60">
<template slot-scope="scope">
<el-input v-model="scope.row.width" @input="(val)=>handleCalcVolumeDebounce(scope.row)" size="mini" placeholder=""></el-input>
<el-input v-model="scope.row.width" @input="(val)=>handleCalcVolumeDebounce(scope.row)" :ref="'input_'+(scope.$index+2)" @keyup.native.enter="focusNextInput('input_'+(scope.$index+3)+'')" size="mini" placeholder=""></el-input>
</template>
</el-table-column>
<el-table-column prop="height" :label="$t('高(cm)')" align="center" width="60">
<template slot-scope="scope">
<el-input v-model="scope.row.height" @input="(val)=>handleCalcVolumeDebounce(scope.row)" size="mini" placeholder=""></el-input>
<el-input v-model="scope.row.height" @input="(val)=>handleCalcVolumeDebounce(scope.row)" :ref="'input_'+(scope.$index+3)" @keyup.native.enter="focusNextInput('input_'+(scope.$index+4)+'')" size="mini" placeholder=""></el-input>
</template>
</el-table-column>
<el-table-column prop="cargoQty" :label="$t('件数')" align="center" width="60">
<template slot-scope="scope">
<el-input v-model="scope.row.cargoQty" @blur="(val)=>handleCargoQtyChangeDebounce(scope.row)" @keyup.enter.native="(val)=>handleCargoQtyChange(scope.row)" size="mini" placeholder=""></el-input>
<el-input v-model="scope.row.cargoQty" @blur="(val)=>handleCargoQtyChangeDebounce(scope.row)" :ref="'input_'+(scope.$index+4)" @keyup.enter.native="(val)=>handleCargoQtyChange(scope.row)" size="mini" placeholder=""></el-input>
</template>
</el-table-column>
<el-table-column prop="volume" :label="$t('体积(m³)')" align="center" width="80">
@ -1725,7 +1725,9 @@ methods: {
});
}
},
focusNextInput(nextRef) {
this.$refs[nextRef].focus()
},
handleCalcVolumeDebounce(row){
// 控制触发频率
debounce(250, this.handleCalcVolume(row))
@ -1766,7 +1768,7 @@ methods: {
}
let feeRemark="";
let totalFee=0;
let totalFee=Number(0);
if(this.form.feeItems&&this.form.feeItems.length>0){
let len=this.form.feeItems.length;
for(let i=0;i<len;i++){
@ -1775,16 +1777,17 @@ methods: {
if(item.currency&&item.currency !='CNY'){
let res= await getValidExchangeRate({from:item.currency,to:'CNY'});
if(res.code==200){
newFee=newFee*parseFloat(res.data);
newFee=newFee*Number(res.data);
}
}
newFee=newFee.toFixed(2);
feeRemark= feeRemark+item.feeName+":" + newFee+",";
totalFee=parseFloat(totalFee)+parseFloat(newFee);
totalFee=Number(totalFee)+Number(newFee);
}
}
this.form.feeRemark=feeRemark;
this.form.freight = totalFee;
this.form.freight = totalFee.toFixed(2);
},
// 计算体积重量
handleCalcVolumeWeight(){