Prechádzať zdrojové kódy

接口调整和登录调整

caojunjie 4 rokov pred
rodič
commit
80318a69ea

+ 13 - 0
src/request/request.js

@@ -45,6 +45,19 @@ export function request(config) {
   // 响应拦截
   newVar.interceptors.response.use(function (response) {
     // console.log(response);
+    if (response.data.code == 401) {
+      MessageBox.confirm('未登录或登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
+          confirmButtonText: '重新登录',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }
+      ).then(() => {
+        // store.dispatch('LogOut').then(() => {
+        //   location.href = '/login';
+          window.location.href= '/login'
+        // })
+      })
+    }
     return Promise.resolve(response);
   }, function (error) {
     // console.log('返回进入拦截失败')

+ 125 - 96
src/views/inquiryAndOrder/index.vue

@@ -144,113 +144,132 @@
         <button class="stealthbutton"></button>
       </div>
       <div>
-        <el-button type="primary" @click="schedule">船期查询</el-button>
+        <el-button type="primary" v-if="activeIndex2 === '1'||activeIndex2 === '2'||activeIndex2 === '3'" disabled>船期查询</el-button>
+        <el-button type="primary" @click="schedule" v-else>船期查询</el-button>
       </div>
       <el-divider>查询船期</el-divider>
-      <div
-        style="width: 100%;padding: 10px;display: flex;justify-content: space-around;border: 1px solid #E8E8E8;box-shadow: 0 2px 7px 0 rgb(71 71 71 / 20%);">
-        <div style="width: 50%;line-height: 40px;">
-          <div
-            style="background-color: #f10724;width: 80px;margin-top: 15px;margin-right: 5px;margin-left: 5px;height: 30px;line-height: 30px;border-radius: 20px;color: #ffffff;float: left">
-            丹东
-          </div>
-          <div style="width: 40px;height: 60px;float: left">
-            <div style="width: 100%;height: 30px;">
-              <img style="width: 50%;" src="../../assets/ship.png" alt="">
+      <div style="width: 100%;" v-for="(item,index) in detailedList" :key="index">
+        <div
+             style="width: 100%;padding: 10px;margin-left: -10px;display: flex;justify-content: space-around;border: 1px solid #E8E8E8;box-shadow: 0 2px 7px 0 rgba(71,71,71,.2);">
+          <div style="width: 50%;line-height: 40px;">
+            <div
+              style="background-color: #f10724;width: 80px;margin-top: 15px;margin-right: 5px;margin-left: 5px;height: 30px;line-height: 30px;border-radius: 20px;color: #ffffff;float: left">
+              {{item.portofloadidName}}
             </div>
-            <div style="width: 100%;height: 30px;line-height: 30px;border-top: 1px solid #f33434">
-              驳
+            <div style="width: 40px;height: 60px;float: left">
+              <div style="width: 100%;height: 30px;">
+                <img style="width: 50%;" src="../../assets/ship.png" alt="">
+              </div>
+              <div style="width: 100%;height: 30px;line-height: 30px;border-top: 1px solid #f33434">
+                驳
+              </div>
             </div>
-          </div>
-        </div>
-        <div
-          style="width: 25%;margin: 0 auto;display: flex;align-items: center;justify-content: center;border-left: 1px solid #E8E8E8">
-          <div>
-            <span style="color: #999999">全程运输时长:</span>
-            <span style="font-weight:bold">9天</span>
-            <br>
-            <span style="color: #999999">单证有效时间:</span>
-            <span style="font-weight:bold">6天</span>
-          </div>
-        </div>
-        <div style="width: 30%;border-left: 1px solid #E8E8E8;display:flex;justify-content: space-around">
-          <div>
-            <div>20GP</div>
-            <div style="color:#bc1920 ">
-              <span>¥</span>
-              <span style="font-size: 20px;">2590</span>
-              <span>起</span>
+            <div
+              style="background-color: #f10724;width: 80px;margin-top: 15px;margin-right: 5px;margin-left: 5px;height: 30px;line-height: 30px;border-radius: 20px;color: #ffffff;float: left">
+              {{item.portoftransshipmentName}}
+            </div>
+            <div style="width: 40px;height: 60px;float: left">
+              <div style="width: 100%;height: 30px;">
+                <img style="width: 50%;" src="../../assets/ship.png" alt="">
+              </div>
+              <div style="width: 100%;height: 30px;line-height: 30px;border-top: 1px solid #f33434">
+                驳
+              </div>
+            </div>
+            <div
+              style="background-color: #f10724;width: 80px;margin-top: 15px;margin-right: 5px;margin-left: 5px;height: 30px;line-height: 30px;border-radius: 20px;color: #ffffff;float: left">
+              {{item.portofdischargeidName}}
             </div>
           </div>
-          <div>
-            <div>40HC</div>
-            <div style="color:#bc1920 ">
-              <span>¥</span>
-              <span style="font-size: 20px;">2590</span>
-              <span>起</span>
+          <div
+            style="width: 25%;margin: 0 auto;display: flex;align-items: center;justify-content: center;border-left: 1px solid #E8E8E8">
+            <div>
+              <span style="color: #999999">全程运输时长:</span>
+              <span style="font-weight:bold">{{item.fDays}}天</span>
+              <br>
+              <span style="color: #999999">单证有效时间:</span>
+              <span style="font-weight:bold">{{item.closing}}天</span>
             </div>
           </div>
-          <div>
-            <div>40RH</div>
+          <div style="width: 30%;border-left: 1px solid #E8E8E8;display:flex;justify-content: space-around">
+            <div>
+              <div>20GP</div>
+              <div style="color:#bc1920 ">
+                <span>¥</span>
+                <span style="font-size: 20px;">{{item.twenty}}</span>
+                <span>起</span>
+              </div>
+            </div>
             <div>
-              <span>-</span>
-              <span>-</span>
-              <span>-</span>
+              <div>40HC</div>
+              <div style="color:#bc1920 ">
+                <span>¥</span>
+                <span style="font-size: 20px;">{{ item.fortyHc }}</span>
+                <span>起</span>
+              </div>
+            </div>
+            <div>
+              <div>40RH</div>
+              <div style="color:#bc1920 ">
+                <span>¥</span>
+                <span>{{ item.fortyRh }}</span>
+                <span>起</span>
+              </div>
             </div>
           </div>
+          <div class="query">
+            <el-button type="primary" @click="item.introduction = !item.introduction">查看船期</el-button>
+          </div>
         </div>
-        <div class="query">
-          <el-button type="primary">查看船期</el-button>
-        </div>
-      </div>
-      <div style="width: 98%;background-color: #99a9bf;margin: 0 auto">
-        <div style="float: left;padding: 5px;color:#ffffff;">
-          <span>天津</span>
-          →
-          <span>青岛</span>
-        </div>
-        <div style="border: 1px solid #EBEEF5">
-          <el-table
-            :data="tableData"
-            style="width: 100%">
-            <el-table-column
-              prop="date"
-              label="预计开航"
-              width="180">
-              <template slot-scope="scope">
-                {{ scope.row.date }}
-              </template>
-            </el-table-column>
-            <el-table-column
-              prop="name"
-              label="预计抵港"
-              width="180">
-            </el-table-column>
-            <el-table-column
-              prop="address"
-              label="重箱回场截止时间">
-            </el-table-column>
-            <el-table-column
-              prop="address"
-              label="船名航次">
-            </el-table-column>
-            <el-table-column
-              prop="address"
-              label="20GP">
-            </el-table-column>
-            <el-table-column
-              prop="address"
-              label="40HC">
-            </el-table-column>
-            <el-table-column
-              prop="address"
-              label="40RH">
-            </el-table-column>
-            <el-table-column
-              label="操作">
-              <el-button type="primary">订舱</el-button>
-            </el-table-column>
-          </el-table>
+        <div style="width: 98%;background-color: #99a9bf;margin: 0 auto" v-if="item.introduction === true">
+          <div style="float: left;padding: 5px;color:#ffffff;">
+            <span>天津</span>
+            →
+            <span>青岛</span>
+          </div>
+          <div style="border: 1px solid #EBEEF5">
+            <el-table
+              :data="tableData"
+              style="width: 100%">
+              <el-table-column
+                prop="date"
+                label="预计开航"
+                width="180">
+                <template slot-scope="scope">
+                  {{ scope.row.date }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="name"
+                label="预计抵港"
+                width="180">
+              </el-table-column>
+              <el-table-column
+                prop="address"
+                label="重箱回场截止时间">
+              </el-table-column>
+              <el-table-column
+                prop="address"
+                label="船名航次">
+              </el-table-column>
+              <el-table-column
+                prop="address"
+                label="20GP">
+              </el-table-column>
+              <el-table-column
+                prop="address"
+                label="40HC">
+              </el-table-column>
+              <el-table-column
+                prop="address"
+                label="40RH">
+              </el-table-column>
+              <el-table-column
+                label="操作">
+                <el-button type="primary">订舱</el-button>
+              </el-table-column>
+            </el-table>
+          </div>
         </div>
       </div>
     </div>
@@ -272,17 +291,19 @@ export default {
         fEta:'',
         portofloadidName:''
       },
+      detailedList:[],
       value1: '',
       selection: '1',
       whether: false,
       activeIndex: '1',
-      activeIndex2: '1',
+      activeIndex2: '4',
       labelPosition: 'right',
       formLabelAlign: {
         name: '',
         region: '',
         type: ''
       },
+      list:[],
       tableData: [{
         date: '测试数据',
         name: '测试数据',
@@ -305,10 +326,12 @@ export default {
   methods: {
     handleSelect(key, keyPath) {
       this.whether = false;
+      this.activeIndex2 = key
       console.log(key, keyPath);
       this.selection = key;
     },
     schedule(){
+      console.log(this.detailedList);
       // v-if="selection === '1'"
       // switch (this.selection){
       //   case '1':
@@ -328,6 +351,12 @@ export default {
         params: this.portToPort
       }).then(res => {
         console.log(res);
+        this.detailedList = []
+        this.list = res.data.rows
+        res.data.rows.map(((item, index)=> {
+          this.detailedList.push(Object.assign({},item,{introduction:false}))
+        }))
+        console.log(this.detailedList);
       }).catch(err => {
         console.log(err);
       })

+ 6 - 1
src/views/navigation/navigation.vue

@@ -56,7 +56,7 @@
       <div style="width: 100px;margin-top: 18px;float: right;color: #909399;font-size: 15px;" v-else>
         <span>{{ username }}</span>
-        <span>注销</span>
+        <span @click="cancellation">注销</span>
       </div>
     </el-menu>
   </div>
@@ -87,6 +87,11 @@ export default {
     }
   },
   methods: {
+    cancellation(){
+      Cookies.remove('TokenKey');
+      Cookies.remove('username');
+      this.loginStatus = false
+    },
     handleSelect(key, keyPath) {
       this.$router.push(key);
       console.log(keyPath);