Browse Source

Merge branch 'master' of http://git.huihenduo.com.cn:3000/wzh/JiangYunPhotosCargoOwner_WebApp into wuchan

wzh 3 years ago
parent
commit
bb342de43b
4 changed files with 328 additions and 35 deletions
  1. 1 1
      src/App.vue
  2. 14 0
      src/apis/fetch.js
  3. 247 5
      src/views/voyage/voyageDetail.vue
  4. 66 29
      src/views/voyage/voyageList.vue

+ 1 - 1
src/App.vue

@@ -74,7 +74,7 @@ export default {
 .main-section {
   margin: 24px 0 0 24px;
   height: calc(100% - 76px);
-  overflow: scroll;
+  overflow-y: auto;
 }
 
 .line-container-p18 {

+ 14 - 0
src/apis/fetch.js

@@ -142,4 +142,18 @@ export default {
   getFYFIDownloadUrl(data) {
     return $http("/fydi/getLastest", data);
   },
+  // 获取提货单列表
+  getLabList(data) {
+    return $http("/voyage/getLabList", data);
+  },
+
+  // 获取港口天气列表
+  getPortWeatherList(data) {
+    return $http("/voyage/getPortWeatherList", data);
+  },
+
+  // 获取超期航次提醒
+  getLongDaysInPort(data) {
+    return $http("/voyage/cargo/longDaysInPort", data);
+  },
 };

+ 247 - 5
src/views/voyage/voyageDetail.vue

@@ -10,7 +10,20 @@
   </div>
 
   <div class="container-title df aic jcsb">
-    <div>航次信息</div>
+    <div class="df aic">
+      <div class="mr30">航次信息</div>
+      <el-tooltip
+        v-if="blockchainInfo"
+        class="box-item"
+        effect="light"
+        :content="blockchainInfo.hash"
+        placement="top"
+      >
+        <div class="pointer" style="font-size: 14px; font-weight: normal">
+          汇很多科技区块链认证
+        </div>
+      </el-tooltip>
+    </div>
     <el-button
       v-auth="'DOWNLOADSHIPTRACK'"
       style="width: 220px; margin-right: 20px"
@@ -342,7 +355,153 @@
           </div>
         </div>
       </div>
-      <hr class="hr m30-0" />
+    </div>
+  </div>
+  <div class="container-title">卸货信息</div>
+  <div class="line-container-p24">
+    <div v-auth="'SHIPDISCHARGE'">
+      <div class="container-second-title df aic jcsb">
+        <div>{{ voyage.dischargeProt }} - 天气信息</div>
+      </div>
+      <el-table style="width: 800px" :data="weatherTableData" stripe>
+        <el-table-column
+          type="index"
+          label="序号"
+          min-width="120"
+          align="center"
+        ></el-table-column>
+        <el-table-column
+          prop="weather"
+          label="天气"
+          min-width="120"
+          align="center"
+        ></el-table-column>
+        <el-table-column
+          prop="temperature"
+          label="温度"
+          min-width="100"
+          align="center"
+        ></el-table-column>
+        <el-table-column
+          prop="winddirection"
+          label="风向"
+          min-width="100"
+          align="center"
+        ></el-table-column>
+        <el-table-column
+          prop="windpower"
+          label="风力"
+          min-width="100"
+          align="center"
+        ></el-table-column>
+        <el-table-column
+          prop="reporttime"
+          label="记录时间"
+          min-width="100"
+          align="center"
+        ></el-table-column>
+      </el-table>
+      <div style="width: 800px; text-align: right; margin-top: 43px">
+        <el-pagination
+          background
+          layout="prev, pager, next"
+          :total="weatherTotal"
+          @current-change="weatherPageChange"
+        ></el-pagination>
+      </div>
+      <div class="hr m30-0"></div>
+    </div>
+    <div v-auth="'SHIPDISCHARGE'">
+      <div class="container-second-title df aic jcsb">
+        <div>提单信息</div>
+      </div>
+      <el-table :data="labTableData" stripe style="width: 800px">
+        <el-table-column
+          type="index"
+          label="序号"
+          min-width="120"
+          align="center"
+        ></el-table-column>
+        <el-table-column
+          prop="billingDate"
+          label="开单日期"
+          min-width="120"
+          align="center"
+        ></el-table-column>
+        <el-table-column
+          prop="billingNum"
+          label="开单数量"
+          min-width="100"
+          align="center"
+        ></el-table-column>
+
+        <el-table-column label="单据" min-width="150" align="center">
+          <template v-slot="scope">
+            <el-button
+              @click="showLab(scope.row, scope.$index, '查看提单')"
+              type="primary"
+              size="small"
+            >
+              查看
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div style="text-align: right; margin-top: 43px">
+        <el-pagination
+          background
+          layout="prev, pager, next"
+          :total="labTotal"
+          @current-change="labPageChange"
+        ></el-pagination>
+      </div>
+      <el-dialog
+        v-model="isAddLabVisable"
+        :title="labModalType"
+        width="780px"
+        center
+        @close="cancelUploadLab"
+      >
+        <el-form
+          :model="labForm"
+          inline
+          style="margin-bottom: 20px"
+          label-width="100px"
+        >
+          <el-form-item label="开单日期">
+            <el-date-picker
+              class="info-line-text"
+              v-model="labForm.billingDate"
+              type="date"
+              format="YYYY/MM/DD"
+              value-format="YYYY/MM/DD"
+              placeholder="开单日期"
+              disabled
+            ></el-date-picker>
+          </el-form-item>
+          <el-form-item label="开单数量">
+            <el-input
+              style="width: 240px"
+              v-model="labForm.billingNum"
+              placeholder="开单数量"
+              disabled
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="提单">
+            <Uploader
+              disabled
+              :actionUrl="store.state.wayBillUrl"
+              :uploaderId="'labLoad'"
+              :params="labParams"
+              @onSendFileList="getLabBillList"
+              :fileList="labBillList"
+              uploadText="上传提单"
+              :limit="1"
+            ></Uploader>
+          </el-form-item>
+        </el-form>
+      </el-dialog>
+      <div class="hr m30-0"></div>
     </div>
     <div v-auth="'SHIPDISCHARGE'">
       <div class="container-second-title df aic jcsb">
@@ -623,7 +782,17 @@
     </el-dialog>
   </div>
   <div v-auth="'BILLINFO'">
-    <div class="container-title">单据信息</div>
+    <div class="container-title df aic jcsb">
+      单据信息
+      <el-button
+        style="margin-right: 30px"
+        size="medium"
+        type="primary"
+        @click="downloadBillZip"
+        :loading="billZipLoading"
+        >下载单据</el-button
+      >
+    </div>
     <div class="line-container-p24" style="padding-left: 60px">
       <div class="df aic">
         <div class="info-line-title">保险单:</div>
@@ -666,8 +835,11 @@
                 {{ item.shipName }} 拍摄于
                 <br />
                 {{ item.createTime }}
+                <br />
+                天气 : {{ item.weather.weather }} - 气温 :
+                {{ item.weather.temperature }}℃
               </div>
-              <div class="medias-box" style="position: relative">
+              <div class="medias-box mb10" style="position: relative">
                 <el-image
                   v-if="item.mediaType == 1"
                   style="width: 100%; height: 100%"
@@ -817,7 +989,7 @@ async function getVoyageDetail(type) {
         title: res.data.msg,
       });
     }
-
+    blockchainInfo.value = res.data.result.blockChain;
     coordinates.value = res.data.result.coordinates;
     voyage.value = res.data.result.voyage;
     medias.value = res.data.result.medias;
@@ -1256,11 +1428,81 @@ function showTruckRecord(item, index, text) {
 
 let truckLoadParams = ref({});
 function getTruckLoadBillList() {}
+let blockchainInfo = ref("");
+
+let billZipLoading = ref(false);
+async function downloadBillZip() {
+  billZipLoading.value = true;
+  let res = await downloadBlobFile(
+    `${url.baseurl}/voyage/exportBillZip`,
+    { voyageId: route.query.id },
+    "单据文件",
+    "post",
+    "application/zip"
+  );
+
+  billZipLoading.value = false;
+}
+
+let weatherTableData = ref([]);
+let weatherCurrentPage = ref(1);
+let weatherTotal = ref(0);
+async function getPortWeatherList() {
+  let res = await api.getPortWeatherList({
+    voyageId: route.query.id,
+    size: 10,
+    currentPage: weatherCurrentPage.value,
+  });
+  weatherTableData.value = res.data.result;
+  for (let i of weatherTableData.value) {
+    i.reporttime = i.reporttime.substring(0, 10);
+  }
+  weatherTotal.value = res.data.total;
+}
+
+function weatherPageChange(e) {
+  weatherCurrentPage.value = e;
+  getPortWeatherList();
+}
+
+let labTableData = ref([]);
+let labTotal = ref(0);
+let labCurrentPage = ref(1);
+
+async function getLabList() {
+  let res = await api.getLabList({
+    voyageId: route.query.id,
+    currentPage: labCurrentPage.value,
+    size: 10,
+  });
+  labTableData.value = res.data.result;
+  labTotal.value = res.data.total;
+}
+function labPageChange(e) {
+  labCurrentPage.value = e;
+  getLabList();
+}
+let isAddLabVisable = ref(false);
+let labBillList = ref([]);
+let labForm = ref({});
+function showLab(item) {
+  isAddLabVisable.value = true;
+  if (item.file) {
+    labBillList.value[0] = {
+      ...item.file,
+      url: item.file.viewUrl,
+    };
+  }
+
+  labForm.value = { ...item };
+}
 
 onMounted(() => {
   getVoyageDetail(1);
   getDischargeList(1);
   getTruckLoadRecord();
+  getLabList();
+  getPortWeatherList();
 });
 </script>
 <style scoped>

+ 66 - 29
src/views/voyage/voyageList.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="line-container-p24">
-    <div style="display: flex; justify-content: space-between">
+    <div class="df jcsb aic">
       <div class="df aic">
         <div
           @click="changeVoyageType(0)"
@@ -58,7 +58,7 @@
           prefix-icon="el-icon-search"
           v-model="term"
           clearable
-          style="width: 330px"
+          style="width: 240px"
         ></el-input>
         <div class="search-btn" @click="getVoyageList()">查询</div>
       </div>
@@ -68,22 +68,28 @@
       <div>
         <el-button
           type="primary"
-          size="medium"
-          class="mr20"
-          @click="showExportModal('卸货信息')"
-          >导出卸货信息</el-button
+          size="small"
+          @click="showExportModal('航次列表')"
+          >导出航次列表</el-button
         >
         <el-button
           type="primary"
-          size="medium"
-          class="mr20"
-          @click="showExportModal('航次信息')"
-          >导出航次信息</el-button
+          size="small"
+          v-auth="'MULTDOWNLOADSHIPTRACK'"
+          @click="showExportModal('航次跟踪')"
+          >导出航次跟踪</el-button
+        >
+        <el-button
+          type="primary"
+          size="small"
+          @click="showExportModal('卸货记录')"
+          v-auth="'MULTDOWNLOADDISCHARGE'"
+          >导出卸货记录</el-button
         >
         <el-button
           v-auth="'DOWNLOADFYDI'"
           type="primary"
-          size="medium"
+          size="small"
           @click="downloadFYDI"
           >下载FYDI指数</el-button
         >
@@ -193,13 +199,18 @@
         </span>
       </template>
     </el-dialog>
-    <el-table :data="tableData" stripe style="width: 100%; margin-top: 24px">
-      <el-table-column
+    <el-table
+      :data="tableData"
+      stripe
+      style="width: 100%; margin-top: 24px"
+      :row-style="rowStyle"
+    >
+      <!-- <el-table-column
         type="index"
         label="序号"
         min-width="80"
         align="center"
-      ></el-table-column>
+      ></el-table-column> -->
       <el-table-column
         prop="voyageName"
         label="航次名称"
@@ -209,21 +220,26 @@
       <el-table-column
         prop="loadDiscPort"
         label="装货港-卸货港"
-        min-width="200"
+        min-width="160"
         align="center"
       ></el-table-column>
-      <el-table-column
+      <!-- <el-table-column
         prop="setSailTime"
         label="开航时间"
         min-width="100"
         align="center"
-      ></el-table-column>
+      ></el-table-column> -->
       <el-table-column
         prop="expectedArrivalTime"
         label="预计到港时间"
+        sortable
         min-width="100"
         align="center"
-      ></el-table-column>
+      >
+        <template v-slot="scope">
+          {{ scope.row.arrived ? "已到港" : scope.row.expectedArrivalTime }}
+        </template>
+      </el-table-column>
       <el-table-column
         prop="abnormalStatus"
         label="航次状态"
@@ -237,29 +253,41 @@
       <el-table-column
         prop="daysInPort"
         label="在港天数"
-        min-width="80"
+        sortable
+        min-width="70"
         align="center"
       ></el-table-column>
       <el-table-column
         prop="todayPhotoCount"
         label="今日照片"
-        min-width="80"
+        min-width="70"
         align="center"
       ></el-table-column>
       <el-table-column
         prop="cargo"
         label="货种"
+        min-width="70"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        prop="actualLoadTons"
+        label="装载吨位"
         min-width="80"
         align="center"
       ></el-table-column>
-
       <el-table-column
-        prop="tons"
-        label="吨位(吨)"
+        prop="unloadedtons"
+        label="已卸货吨位"
         min-width="80"
         align="center"
       ></el-table-column>
       <el-table-column
+        prop="remainTons"
+        label="剩余吨位"
+        min-width="80"
+        align="center"
+      ></el-table-column>
+      <!-- <el-table-column
         prop="waybillStatus"
         sortable
         label="签单状态"
@@ -275,7 +303,7 @@
               : "已签单"
           }}
         </template>
-      </el-table-column>
+      </el-table-column> -->
       <!-- <el-table-column
         prop="transStatus"
         label="船舶状态"
@@ -284,15 +312,15 @@
       ></el-table-column> -->
       <el-table-column
         prop="hasInsurance"
-        label="保险状态"
-        min-width="100"
+        label="保险状态"
+        min-width="70"
         align="center"
       >
         <template v-slot="scope">
           {{ scope.row.hasInsurance == 0 ? "未购买" : "已购买" }}
         </template>
       </el-table-column>
-      <el-table-column
+      <!-- <el-table-column
         sortable
         prop="createTime"
         label="创建时间"
@@ -308,12 +336,13 @@
         label="备注"
         min-width="100"
         align="center"
-      ></el-table-column>
+      ></el-table-column> -->
       <el-table-column
         v-auth="'VOYAGEDETAIL'"
         label="操作"
         min-width="80"
         align="center"
+        fixed="right"
       >
         <template v-slot="scope">
           <el-button
@@ -688,7 +717,7 @@ async function exportZip() {
   isLoadingZip.value = true;
   let res = await downloadBlobFile(
     `${url.baseurl}${
-      exportModalTitle.value == "卸货信息"
+      exportModalTitle.value == "卸货记录"
         ? "/voyage/exportMultDischargeExcel"
         : "/voyage/exportMultExcel"
     }`,
@@ -706,6 +735,14 @@ async function exportZip() {
   exportModalVisable.value = false;
 }
 
+function rowStyle({ row }) {
+  let rowStyle = {};
+  if (row.daysInPort >= 30) {
+    rowStyle.color = "red";
+    return rowStyle;
+  }
+}
+
 onMounted(() => {
   getVoyageList();
 });