Selaa lähdekoodia

船舶动态表

liyg 2 vuotta sitten
vanhempi
commit
ecbe21077d

+ 3 - 0
build/webpack.base.conf.js

@@ -115,6 +115,9 @@ module.exports = {
       }
     ]
   },
+  externals: {
+    './cptable': 'var cptable'
+  },
   node: {
     // prevent webpack from injecting useless setImmediate polyfill because Vue
     // source contains it (although only uses it if it's native).

+ 3 - 2
package.json

@@ -27,6 +27,7 @@
     "axios": "^0.26.1",
     "babel-polyfill": "^6.26.0",
     "bignumber.js": "^9.0.2",
+    "codemirror": "5.65.5",
     "crypto": "^1.0.1",
     "echarts": "^4.1.0",
     "el-cascader-multi": "^1.1.8",
@@ -71,8 +72,8 @@
     "x2js": "^3.3.0",
     "xe-utils": "^3.5.4",
     "xlsx": "^0.18.4",
-    "xterm": "3.12.0",
-    "codemirror": "5.65.5"
+    "xlsx-style": "^0.8.13",
+    "xterm": "3.12.0"
   },
   "devDependencies": {
     "@vue/test-utils": "^1.0.0-beta.24",

+ 2 - 0
src/views/TMS/components/bmsship/threeSectionFeeDetails.vue

@@ -51,6 +51,8 @@ export default {
       option: {
         // 表格请求数据的地址
         requestUrl: null,
+        isshowSummary:true,
+        showSummaryList:['resultInspectionFee','realWeight','resultWaterTonnage','planWeight']
       },
     };
   },

+ 16 - 8
src/views/TMS/components/importedShip/addLoadShip.vue

@@ -51,7 +51,7 @@
       </div>
     </div>
     <div class="button_box_addLoadShip">
-      <el-button type="primary" @click="makeSure">新增装船作业</el-button>
+      <el-button type="primary" @click="makeSure" :loading="isLoading">新增装船作业</el-button>
     </div>
   </div>
 </template>
@@ -70,6 +70,7 @@ export default {
       batchInfactoryId:"",
       restaurants: [],
       state: "",
+      isLoading:false,
       form: {
         waterUnitPrice:null,
       },
@@ -155,8 +156,10 @@ export default {
 
     // 新增
     makeSure() {
+      this.isLoading=true;
       if (JSON.stringify(this.rowMap).length == 2) {
         this.$message.error("未选择江船");
+        this.isLoading=false;
         return;
       }
       let mapVal = {
@@ -199,10 +202,15 @@ export default {
         mapVal.resultArrivalTime == null ||
         mapVal.resultOutWharyName == null ||
         mapVal.resultOutWharyTime == null
-      )
+      ){
         this.$message.error("存在空值!");
-      else if (!isNumber(val)) this.$message.warning("实装数量必须为数字!");
-      else
+         this.isLoading=false;
+      }
+      else if (!isNumber(val)) {
+        this.$message.warning("实装数量必须为数字!");
+        this.isLoading=false;
+      }
+      else{
         this.axios
           .post("/api/v1/tms/addLoadShip", {
             mapVal: mapVal,
@@ -220,10 +228,10 @@ export default {
             } else {
               this.$message.error("新增失败!");
             }
-            this.$refs["table"].resetField();
-          });
-
-
+            this.isLoading=false;
+          })
+      }
+      //
       // if (
       //   mapVal.resultActualInstallations == null ||
       //   // mapVal.portId==null||

+ 12 - 6
src/views/statisticalReport/components/Ship_dynamic_table.vue

@@ -27,6 +27,7 @@
 <script>
 import tableItem from "./tableItem";
 import FileSaver from "file-saver";
+import XLSXStyle from 'xlsx-style'
 export default {
   name: "TableView",
   components: {
@@ -180,6 +181,12 @@ export default {
           }
         });
     },
+    bta(s) {
+      var buf = new ArrayBuffer(s.length);
+      var view = new Uint8Array(buf);
+      for (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
+      return buf;
+    },
     getExcel(tableTitle) {
         //let tables = this.$refs.ship;//此处是拿表格document元素,也可以取父div的ref
         let tables = document.getElementById("pdfDom");
@@ -206,14 +213,13 @@ export default {
        })
        console.log("sheet:",table_book.Sheets.Sheet1);
         //导出
-        var table_write = XLSX.write(table_book, {
-            bookType: "xlsx",
-            bookSST: true,
-            type: "array"
-        });
+        let table_write = XLSXStyle.write(table_book, {
+        type: 'binary',
+        bookType: 'xlsx',
+        })
         try {
             FileSaver.saveAs(
-                new Blob([table_write], { type: "application/octet-stream" }),
+                new Blob([this.bta(table_write)], { type: "application/octet-stream" }),
                 tableTitle+".xlsx"
             );
         } catch (e) {

+ 30 - 20
src/views/statisticalReport/components/tableItem.vue

@@ -1,5 +1,10 @@
 <template>
   <div>
+     <table v-show="false">
+          <tr>
+            <td colspan="22">达州钢铁每日船舶动态明细表</td>
+          </tr>
+        </table>
     <el-table
       :show-summary="isShowSum"
       :data="tableData"
@@ -107,8 +112,10 @@
             width="200px"
             label="时间">
           </el-table-column>
+          <el-table-column
+            width="200px"
+            label="备注">
           </el-table-column>
-          <el-table-column>
           </el-table-column>
           <el-table-column label="进口矿水联运情况简报">
              <el-table-column>
@@ -131,6 +138,7 @@
           :data="controlLinesTable"
           :row-style="{height:'40px'}"
           style="font-size: 12px">
+          <el-table-column label="控制线等闸船舶动态">
           <!-- 4 -->
           <el-table-column
           align="center"
@@ -231,6 +239,8 @@
             width="80px"
             label="总计">
           </el-table-column>
+
+          </el-table-column>
         </el-table>
         </div >
       </div>
@@ -320,10 +330,10 @@ export default {
             let materialName = res.data.data.list[0].materialName;
             this.stockStringArr.push({
               class: "black",
-              value: materialName + res.data.data.list[0].totalTonnage + "吨:"
+              value: materialName +' '+ res.data.data.list[0].totalTonnage + "吨:"
             });
             this.stockString +=
-              materialName + res.data.data.list[0].totalTonnage + "吨 ";
+              materialName +' '+ res.data.data.list[0].totalTonnage + "吨 ";
 
             res.data.data.list.forEach(e => {
               if (e.materialName == materialName) {
@@ -337,10 +347,10 @@ export default {
               } else {
                 materialName = e.materialName;
                 this.stockString +=
-                  materialName + res.data.data.list[0].totalTonnage + "吨 ";
+                  materialName +' '+ res.data.data.list[0].totalTonnage + "吨 ";
                 this.stockString +=
                   ";" +
-                  materialName +
+                  materialName +' '+
                   e.totalTonnage +
                   "吨:" +
                   " “" +
@@ -350,7 +360,7 @@ export default {
                   "吨 ";
                 this.stockStringArr.push({
                   class: "black",
-                  value: ";" + materialName + e.totalTonnage + "吨:"
+                  value: ";" + materialName +' ' + e.totalTonnage + "吨:"
                 });
                 this.stockString +=
                   ";" +
@@ -398,7 +408,7 @@ export default {
             let materialName = res.data.data[0].materialName;
             this.downStockStringArr.push({
               class: "black",
-              value: materialName + res.data.data[0].totalTonnage + "吨:"
+              value: materialName + ' ' + res.data.data[0].totalTonnage + "吨:"
             });
 
             res.data.data.forEach(e => {
@@ -412,7 +422,7 @@ export default {
                 materialName = e.materialName;
                 this.downStockStringArr.push({
                   class: "black",
-                  value: ";" + materialName + e.totalTonnage + "吨:"
+                  value: ";" + materialName + ' ' + e.totalTonnage + "吨:"
                 });
                 this.downStockStringArr.push({
                   class: "normal",
@@ -450,27 +460,27 @@ export default {
             let materialName = res.data.data[0].materialName;
             this.runStockStringArr.push({
               class: "black",
-              value: materialName + res.data.data[0].totalTonnage + "吨:"
+              value: materialName +' ' + res.data.data[0].totalTonnage + "吨:"
             });
 
             res.data.data.forEach(e => {
               if (e.materialName == materialName) {
-                this.runStockStringArr.push({
-                  class: "normal",
-                  value:
-                    " “" + e.resultForeignShipName + "”" + e.gmTonnage + "吨 "
-                });
+                // this.runStockStringArr.push({
+                //   class: "normal",
+                //   value:
+                //     " “" + e.resultForeignShipName + "”" + e.gmTonnage + "吨 "
+                // });
               } else {
                 materialName = e.materialName;
                 this.runStockStringArr.push({
                   class: "black",
-                  value: ";" + materialName + e.totalTonnage + "吨:"
-                });
-                this.runStockStringArr.push({
-                  class: "normal",
-                  value:
-                    " “" + e.resultForeignShipName + "”" + e.gmTonnage + "吨 "
+                  value: ";" + materialName +' '+ e.totalTonnage + "吨"
                 });
+                // this.runStockStringArr.push({
+                //   class: "normal",
+                //   value:
+                //     " “" + e.resultForeignShipName + "”" + e.gmTonnage + "吨 "
+                // });
               }
             });
             console.log("arr:", this.runStockStringArr);