|
|
@ -37,7 +37,7 @@ export default { |
|
|
sortLv: 0, |
|
|
sortLv: 0, |
|
|
status: true, |
|
|
status: true, |
|
|
fixed: '', |
|
|
fixed: '', |
|
|
columnWidth: 100 |
|
|
|
|
|
|
|
|
columnWidth: 68 |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
userId: this.$store.state.user.name, |
|
|
userId: this.$store.state.user.name, |
|
|
@ -55,7 +55,7 @@ export default { |
|
|
sortLv: 0, |
|
|
sortLv: 0, |
|
|
status: true, |
|
|
status: true, |
|
|
fixed: '', |
|
|
fixed: '', |
|
|
columnWidth: 210 |
|
|
|
|
|
|
|
|
columnWidth: 180 |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
userId: this.$store.state.user.name, |
|
|
userId: this.$store.state.user.name, |
|
|
@ -73,7 +73,7 @@ export default { |
|
|
sortLv: 0, |
|
|
sortLv: 0, |
|
|
status: true, |
|
|
status: true, |
|
|
fixed: '', |
|
|
fixed: '', |
|
|
columnWidth: 80 |
|
|
|
|
|
|
|
|
columnWidth: 48 |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
userId: this.$store.state.user.name, |
|
|
userId: this.$store.state.user.name, |
|
|
@ -109,7 +109,7 @@ export default { |
|
|
sortLv: 0, |
|
|
sortLv: 0, |
|
|
status: true, |
|
|
status: true, |
|
|
fixed: '', |
|
|
fixed: '', |
|
|
columnWidth: 100 |
|
|
|
|
|
|
|
|
columnWidth: 60 |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
userId: this.$store.state.user.name, |
|
|
userId: this.$store.state.user.name, |
|
|
@ -127,7 +127,7 @@ export default { |
|
|
sortLv: 0, |
|
|
sortLv: 0, |
|
|
status: true, |
|
|
status: true, |
|
|
fixed: '', |
|
|
fixed: '', |
|
|
columnWidth: 60 |
|
|
|
|
|
|
|
|
columnWidth: 55 |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
userId: this.$store.state.user.name, |
|
|
userId: this.$store.state.user.name, |
|
|
@ -145,7 +145,7 @@ export default { |
|
|
sortLv: 0, |
|
|
sortLv: 0, |
|
|
status: true, |
|
|
status: true, |
|
|
fixed: '', |
|
|
fixed: '', |
|
|
columnWidth: 60 |
|
|
|
|
|
|
|
|
columnWidth: 55 |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
userId: this.$store.state.user.name, |
|
|
userId: this.$store.state.user.name, |
|
|
@ -163,9 +163,27 @@ export default { |
|
|
sortLv: 0, |
|
|
sortLv: 0, |
|
|
status: true, |
|
|
status: true, |
|
|
fixed: '', |
|
|
fixed: '', |
|
|
columnWidth: 60 |
|
|
|
|
|
} |
|
|
|
|
|
,{ |
|
|
|
|
|
|
|
|
columnWidth: 55 |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
userId: this.$store.state.user.name, |
|
|
|
|
|
functionId: 5011, |
|
|
|
|
|
serialNumber: '5011Table2AdjustToolCost', |
|
|
|
|
|
tableId: '5011Table2', |
|
|
|
|
|
tableName: '报价详情信息表', |
|
|
|
|
|
columnProp: 'adjustToolCost', |
|
|
|
|
|
headerAlign: 'center', |
|
|
|
|
|
align: 'right', |
|
|
|
|
|
columnLabel: 'Tooling Cost', |
|
|
|
|
|
columnHidden: false, |
|
|
|
|
|
columnImage: false, |
|
|
|
|
|
columnSortable: false, |
|
|
|
|
|
sortLv: 0, |
|
|
|
|
|
status: true, |
|
|
|
|
|
fixed: '', |
|
|
|
|
|
columnWidth: 55 |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
userId: this.$store.state.user.name, |
|
|
userId: this.$store.state.user.name, |
|
|
functionId: 5011, |
|
|
functionId: 5011, |
|
|
serialNumber: '5011Table2TotalCost', |
|
|
serialNumber: '5011Table2TotalCost', |
|
|
@ -174,14 +192,14 @@ export default { |
|
|
columnProp: 'totalCost', |
|
|
columnProp: 'totalCost', |
|
|
headerAlign: 'center', |
|
|
headerAlign: 'center', |
|
|
align: 'right', |
|
|
align: 'right', |
|
|
columnLabel: 'Total Cost', |
|
|
|
|
|
|
|
|
columnLabel: 'Total Cost(RMB/KCT)', |
|
|
columnHidden: false, |
|
|
columnHidden: false, |
|
|
columnImage: false, |
|
|
columnImage: false, |
|
|
columnSortable: false, |
|
|
columnSortable: false, |
|
|
sortLv: 0, |
|
|
sortLv: 0, |
|
|
status: true, |
|
|
status: true, |
|
|
fixed: '', |
|
|
fixed: '', |
|
|
columnWidth: 70 |
|
|
|
|
|
|
|
|
columnWidth: 75 |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
userId: this.$store.state.user.name, |
|
|
userId: this.$store.state.user.name, |
|
|
@ -192,14 +210,14 @@ export default { |
|
|
columnProp: 'quoteProfitRate', |
|
|
columnProp: 'quoteProfitRate', |
|
|
headerAlign: 'center', |
|
|
headerAlign: 'center', |
|
|
align: 'right', |
|
|
align: 'right', |
|
|
columnLabel: 'markup(%)', |
|
|
|
|
|
|
|
|
columnLabel: 'markup (%)', |
|
|
columnHidden: false, |
|
|
columnHidden: false, |
|
|
columnImage: false, |
|
|
columnImage: false, |
|
|
columnSortable: false, |
|
|
columnSortable: false, |
|
|
sortLv: 0, |
|
|
sortLv: 0, |
|
|
status: true, |
|
|
status: true, |
|
|
fixed: '', |
|
|
fixed: '', |
|
|
columnWidth: 60 |
|
|
|
|
|
|
|
|
columnWidth: 54 |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
userId: this.$store.state.user.name, |
|
|
userId: this.$store.state.user.name, |
|
|
@ -217,7 +235,7 @@ export default { |
|
|
sortLv: 0, |
|
|
sortLv: 0, |
|
|
status: true, |
|
|
status: true, |
|
|
fixed: '', |
|
|
fixed: '', |
|
|
columnWidth: 80 |
|
|
|
|
|
|
|
|
columnWidth: 65 |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
userId: this.$store.state.user.name, |
|
|
userId: this.$store.state.user.name, |
|
|
@ -253,7 +271,7 @@ export default { |
|
|
sortLv: 0, |
|
|
sortLv: 0, |
|
|
status: true, |
|
|
status: true, |
|
|
fixed: '', |
|
|
fixed: '', |
|
|
columnWidth: 80 |
|
|
|
|
|
|
|
|
columnWidth: 75 |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
userId: this.$store.state.user.name, |
|
|
userId: this.$store.state.user.name, |
|
|
@ -271,7 +289,7 @@ export default { |
|
|
sortLv: 0, |
|
|
sortLv: 0, |
|
|
status: true, |
|
|
status: true, |
|
|
fixed: '', |
|
|
fixed: '', |
|
|
columnWidth: 260 |
|
|
|
|
|
|
|
|
columnWidth: 448 |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
} |
|
|
} |
|
|
@ -303,79 +321,79 @@ export default { |
|
|
this.$message.error(error); |
|
|
this.$message.error(error); |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
alignIsNan(key,arr){ |
|
|
|
|
|
for (let i = 0; i < arr.length; i++) { |
|
|
|
|
|
let item = arr[i]; |
|
|
|
|
|
if (isNaN(item[key])){ |
|
|
|
|
|
return 'left'; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return 'right'; |
|
|
|
|
|
}, |
|
|
|
|
|
flexColumnWidth (str, arr1, flag = 'max') { |
|
|
|
|
|
str = str + '' |
|
|
|
|
|
let columnContent = '' |
|
|
|
|
|
if (flag === 'equal') { |
|
|
|
|
|
// 获取该列中第一个不为空的数据(内容) |
|
|
|
|
|
for (let i = 0; i < arr1.length; i++) { |
|
|
|
|
|
if (arr1[i][str].length > 0) { |
|
|
|
|
|
// console.log('该列数据[0]:', arr1[0][str]) |
|
|
|
|
|
columnContent = arr1[i][str] |
|
|
|
|
|
break |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
// 获取该列中最长的数据(内容) |
|
|
|
|
|
let index = 0 |
|
|
|
|
|
for (let i = 0; i < arr1.length; i++) { |
|
|
|
|
|
if (arr1[i][str] === null) { |
|
|
|
|
|
continue |
|
|
|
|
|
} |
|
|
|
|
|
const now_temp = arr1[i][str] + '' |
|
|
|
|
|
const max_temp = arr1[index][str] + '' |
|
|
|
|
|
if (now_temp.length > max_temp.length) { |
|
|
|
|
|
index = i |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
columnContent = arr1[index][str]+'' |
|
|
|
|
|
} |
|
|
|
|
|
let flexWidth = 0 |
|
|
|
|
|
if (columnContent && columnContent.length > 0){ |
|
|
|
|
|
for (const char of columnContent) { |
|
|
|
|
|
if ((char >= 'A' && char <= 'Z') || (char >= 'a' && char <= 'z')) { |
|
|
|
|
|
// 如果是英文字符,为字符分配8个单位宽度 |
|
|
|
|
|
flexWidth += 8 |
|
|
|
|
|
} else if (char >= '\u4e00' && char <= '\u9fa5') { |
|
|
|
|
|
// 如果是中文字符,为字符分配15个单位宽度 |
|
|
|
|
|
flexWidth += 15 |
|
|
|
|
|
} else { |
|
|
|
|
|
// 其他种类字符,为字符分配8个单位宽度 |
|
|
|
|
|
flexWidth += 8 |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
let flexWidthStr = 0 |
|
|
|
|
|
for (const char of str){ |
|
|
|
|
|
if ((char >= 'A' && char <= 'Z') || (char >= 'a' && char <= 'z')) { |
|
|
|
|
|
// 如果是英文字符,为字符分配8个单位宽度 |
|
|
|
|
|
flexWidthStr += 8 |
|
|
|
|
|
} else if (char >= '\u4e00' && char <= '\u9fa5') { |
|
|
|
|
|
// 如果是中文字符,为字符分配15个单位宽度 |
|
|
|
|
|
flexWidthStr += 15 |
|
|
|
|
|
} else { |
|
|
|
|
|
// 其他种类字符,为字符分配8个单位宽度 |
|
|
|
|
|
flexWidthStr += 8 |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (flexWidthStr > flexWidth){ |
|
|
|
|
|
flexWidth = flexWidthStr |
|
|
|
|
|
} |
|
|
|
|
|
if (flexWidth < 120) { |
|
|
|
|
|
// 设置最小宽度 |
|
|
|
|
|
flexWidth = 120 |
|
|
|
|
|
} |
|
|
|
|
|
return flexWidth + 'px' |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// alignIsNan(key,arr){ |
|
|
|
|
|
// for (let i = 0; i < arr.length; i++) { |
|
|
|
|
|
// let item = arr[i]; |
|
|
|
|
|
// if (isNaN(item[key])){ |
|
|
|
|
|
// return 'left'; |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// return 'right'; |
|
|
|
|
|
// }, |
|
|
|
|
|
// flexColumnWidth (str, arr1, flag = 'max') { |
|
|
|
|
|
// str = str + '' |
|
|
|
|
|
// let columnContent = '' |
|
|
|
|
|
// if (flag === 'equal') { |
|
|
|
|
|
// // 获取该列中第一个不为空的数据(内容) |
|
|
|
|
|
// for (let i = 0; i < arr1.length; i++) { |
|
|
|
|
|
// if (arr1[i][str].length > 0) { |
|
|
|
|
|
// // console.log('该列数据[0]:', arr1[0][str]) |
|
|
|
|
|
// columnContent = arr1[i][str] |
|
|
|
|
|
// break |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// // 获取该列中最长的数据(内容) |
|
|
|
|
|
// let index = 0 |
|
|
|
|
|
// for (let i = 0; i < arr1.length; i++) { |
|
|
|
|
|
// if (arr1[i][str] === null) { |
|
|
|
|
|
// continue |
|
|
|
|
|
// } |
|
|
|
|
|
// const now_temp = arr1[i][str] + '' |
|
|
|
|
|
// const max_temp = arr1[index][str] + '' |
|
|
|
|
|
// if (now_temp.length > max_temp.length) { |
|
|
|
|
|
// index = i |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// columnContent = arr1[index][str]+'' |
|
|
|
|
|
// } |
|
|
|
|
|
// let flexWidth = 0 |
|
|
|
|
|
// if (columnContent && columnContent.length > 0){ |
|
|
|
|
|
// for (const char of columnContent) { |
|
|
|
|
|
// if ((char >= 'A' && char <= 'Z') || (char >= 'a' && char <= 'z')) { |
|
|
|
|
|
// // 如果是英文字符,为字符分配8个单位宽度 |
|
|
|
|
|
// flexWidth += 8 |
|
|
|
|
|
// } else if (char >= '\u4e00' && char <= '\u9fa5') { |
|
|
|
|
|
// // 如果是中文字符,为字符分配15个单位宽度 |
|
|
|
|
|
// flexWidth += 15 |
|
|
|
|
|
// } else { |
|
|
|
|
|
// // 其他种类字符,为字符分配8个单位宽度 |
|
|
|
|
|
// flexWidth += 8 |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// let flexWidthStr = 0 |
|
|
|
|
|
// for (const char of str){ |
|
|
|
|
|
// if ((char >= 'A' && char <= 'Z') || (char >= 'a' && char <= 'z')) { |
|
|
|
|
|
// // 如果是英文字符,为字符分配8个单位宽度 |
|
|
|
|
|
// flexWidthStr += 8 |
|
|
|
|
|
// } else if (char >= '\u4e00' && char <= '\u9fa5') { |
|
|
|
|
|
// // 如果是中文字符,为字符分配15个单位宽度 |
|
|
|
|
|
// flexWidthStr += 15 |
|
|
|
|
|
// } else { |
|
|
|
|
|
// // 其他种类字符,为字符分配8个单位宽度 |
|
|
|
|
|
// flexWidthStr += 8 |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// if (flexWidthStr > flexWidth){ |
|
|
|
|
|
// flexWidth = flexWidthStr |
|
|
|
|
|
// } |
|
|
|
|
|
// if (flexWidth < 120) { |
|
|
|
|
|
// // 设置最小宽度 |
|
|
|
|
|
// flexWidth = 120 |
|
|
|
|
|
// } |
|
|
|
|
|
// return flexWidth + 'px' |
|
|
|
|
|
// }, |
|
|
toFixed(val,fixed){ |
|
|
toFixed(val,fixed){ |
|
|
if (!val || isNaN(val) || !fixed){ |
|
|
if (!val || isNaN(val) || !fixed){ |
|
|
return val |
|
|
return val |
|
|
@ -414,7 +432,7 @@ export default { |
|
|
:show-overflow-tooltip="item.showOverflowTooltip" |
|
|
:show-overflow-tooltip="item.showOverflowTooltip" |
|
|
:align="item.align" |
|
|
:align="item.align" |
|
|
:fixed="item.fixed === ''?false:item.fixed" |
|
|
:fixed="item.fixed === ''?false:item.fixed" |
|
|
:min-width="item.columnWidth" |
|
|
|
|
|
|
|
|
:width="item.columnWidth" |
|
|
:label="item.columnLabel"> |
|
|
:label="item.columnLabel"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<template v-if="numberProp.includes(item.columnProp)"> |
|
|
<template v-if="numberProp.includes(item.columnProp)"> |
|
|
|