|
@@ -31,6 +31,7 @@
|
|
|
import tableItem from "./tableItem";
|
|
|
import FileSaver from "file-saver";
|
|
|
import XLSXStyle from 'xlsx-style'
|
|
|
+import { isNumber } from '../../ADMINISTRATORS/app';
|
|
|
export default {
|
|
|
name: "TableView",
|
|
|
components: {
|
|
@@ -404,6 +405,49 @@ export default {
|
|
|
this.axios.post("/api/v1/tms/selectAllShipDynamaics").then(res => {
|
|
|
if (res.data.code == "200") {
|
|
|
this.tableData = res.data.data;
|
|
|
+ console.log("this.tableData:",this.tableData);
|
|
|
+ this.tableData.forEach(item=>{
|
|
|
+ try {
|
|
|
+ item.tonnage=item.tonnage.toFixed(2);
|
|
|
+ } catch (error) {
|
|
|
+
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ if(item.capacityNumber1 || item.capacityNumber1==0){
|
|
|
+ item.capacityNumber1=parseFloat(item.capacityNumber1).toFixed(2);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ if(item.capacityNumber2 || item.capacityNumber2==0){
|
|
|
+ item.capacityNumber2=parseFloat(item.capacityNumber2).toFixed(2);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ if(item.capacityNumber3 || item.capacityNumber3==0){
|
|
|
+ item.capacityNumber3=parseFloat(item.capacityNumber3).toFixed(2);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ if(item.capacityNumber4 || item.capacityNumber4==0){
|
|
|
+ item.capacityNumber4=parseFloat(item.capacityNumber4).toFixed(2);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ if(isNumber(item.capacity1)){
|
|
|
+ item.capacity1=parseFloat(item.capacity1).toFixed(2);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
console.log(this.tableData);
|
|
|
} else {
|
|
|
this.$message({
|