Bladeren bron

船舶动态表增加预警

shxiaoc 10 maanden geleden
bovenliggende
commit
b06fb60ade

+ 6 - 2
src/views/TMS/components/importedShip/loadShip.vue

@@ -9,7 +9,7 @@
         clearable
       >
       </el-input>
-<!-- 
+<!--
        <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期"></el-date-picker>
       <span>至</span>
       <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期"></el-date-picker> -->
@@ -23,8 +23,11 @@
       <el-button type="primary" @click="refresh()">
         <i class="el-icon-refresh"></i>刷新
       </el-button>
+      <el-button type="primary" @click="exportData()">
+        <i class="el-icon-download"></i>导出(Excel)
+      </el-button>
     </div>
-    <dilTable v-bind.sync="option">
+    <dilTable v-bind.sync="option" ref="excelDom">
       <el-table-column fixed="right" label="操作" align="center" width="100">
         <template slot-scope="scope">
           <el-button @click="click(scope.row.resultId)" type="text" size="small"
@@ -49,6 +52,7 @@ export default {
   name: "homeworkPath",
   data() {
     return {
+      tableTitle: "装船作业",
       startTime: null,
       endTime: null,
       input: "",

+ 159 - 0
src/views/statisticalReport/components/shipWarning.vue

@@ -0,0 +1,159 @@
+<template>
+  <div class="sale">
+    <div class="top">
+       <el-input
+        v-model="con"
+        clearable
+        placeholder="报警内容"
+      >
+      </el-input>
+      <!--
+      <span class="text">计时时间:</span>
+      <el-date-picker
+        v-model="startTime"
+        type="datetime"
+        placeholder="选择日期"
+      >
+      </el-date-picker>
+      <span class="text">至</span>
+      <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
+      </el-date-picker>
+      <el-button type="primary" @click="exportAllExcel()">
+        <i class="el-icon-download"></i>导出(Excel)
+      </el-button>
+      -->
+      <el-button type="primary" class="btn" @click="onclick">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+    </div>
+    <div class="tab">
+      <dilTable v-bind.sync="option"  max-height="300">
+        <el-table-column fixed="right" label="操作" width="180">
+          <template slot-scope="scope">
+            <div class="step">
+              <el-button
+                @click="editRemark(scope.row)"
+                type="primary"
+                size="small"
+                icon="el-icon-edit"
+                >编辑备注</el-button
+              >
+            </div>
+          </template>
+        </el-table-column>
+      </dilTable>
+    </div>
+
+    <el-dialog title="编辑备注" :visible.sync="editopen" width="500px" append-to-body @submit.native.prevent>
+      <el-form ref="form" :model="form" label-width="100px">
+        <el-form-item label="异常内容" prop="abnormalContent">
+          <el-input type="textarea" :rows="3" resize="none" v-model="form.abnormalContent" disabled style="width: 300px"/>
+        </el-form-item>
+        <el-form-item label="异常时间" prop="abnormalTime">
+          <el-input v-model="form.abnormalTime" disabled style="width: 300px"/>
+        </el-form-item>
+        <el-form-item label="跟踪备注" prop="trackRemark">
+          <el-input type="textarea" :rows="3" v-model="form.trackRemark" placeholder="请输入跟踪备注" style="width: 300px"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { getCookie } from "@/utils/util.js";
+
+export default {
+  data() {
+    return {
+      inputText: "",
+      option: {
+        // 表格请求数据的地址
+        requestUrl: ""
+      },
+      orderId: 0,
+      con:'',
+      editopen: false,
+      form: {}
+    };
+  },
+  created() {
+    this.option.requestUrl = "/api/v1/tms/getShipWarningList?apiId=540";
+  },
+  methods: {
+    reset() {
+      this.form = {
+        orderId: undefined,
+        abnormalContent: undefined,
+        abnormalTime: undefined,
+        trackRemark: undefined,
+        trackTime: undefined
+      };
+    },
+    editRemark(row) {
+      this.reset();
+      this.orderId = row.orderId;
+      let map = {
+        orderId: this.orderId
+      };
+      this.axios.post("/api/v1/tms/getShipWarningResult", map).then(res => {
+        this.form = res.data.data
+        this.editopen = true;
+      });
+    },
+    onclick() {
+      this.option.requestUrl =
+        "/api/v1/tms/getShipWarningList?apiId=540" +
+        "&con="+
+        this.con;
+    },
+    submitForm(){
+      if(this.form.trackRemark==null || this.form.trackRemark == ""){
+        this.$message.error("请输入内容");
+        return;
+      }
+      let map = {
+        orderId: this.form.orderId,
+        trackRemark: this.form.trackRemark,
+        userId: getCookie('userId')
+      };
+      this.axios.post("/api/v1/tms/updateShipWarning", map).then(res => {
+        this.$message.success("编辑成功");
+        this.editopen = false;
+        this.$router.go(0)
+      });
+    },
+    cancel() {
+      this.editopen = false;
+      this.reset();
+    }
+  }
+};
+</script>
+<style lang="scss">
+.sale {
+  .top {
+    padding: 1.25rem 1.875rem;
+    .el-input {
+      width: 20%;
+    }
+  }
+}
+.el-table th.el-table__cell > .cell {
+  display: inline-block;
+  -webkit-box-sizing: border-box;
+  box-sizing: border-box;
+  position: relative;
+  vertical-align: middle;
+  padding-left: 10px;
+  padding-right: 10px;
+  width: 100%;
+  text-align: center;
+}
+.step {
+  text-align: center;
+}
+</style>

+ 15 - 0
src/views/statisticalReport/router/index.js

@@ -102,6 +102,11 @@ const saleChemicalCokeFormMonitor = () =>
   import(
     '@/views/statisticalReport/components/salesLogisticsStatistics/saleChemicalCokeFormMonitor.vue'
   )
+
+const shipWarning = () =>
+  import(
+    '@/views/statisticalReport/components/shipWarning.vue'
+  )
 Vue.use(Router)
 
 const constantRouterMap = [
@@ -391,6 +396,16 @@ const constantRouterMap = [
           code: 'xtpzgl-yhgl'
         },
         component: saleCoproductFormMonitor
+      },
+      {
+        path: 'shipWarning',
+        name: 'shipWarning',
+        meta: {
+          code: 'xtpzgl-yhgl',
+          keepAlive: true,
+          title: '船舶预警管理'
+        },
+        component: shipWarning
       }
     ]
   }