index.vue 9.61 KB
<template>
  <div class="entry" v-loading="loadings.entryLoading">
    <div class="entryTitle">
      <div>离境单详情</div>
      <div>
        <el-button class="entrySaveButton" @click="back">返 回</el-button>
      </div>
    </div>
    <el-form
      class="fedexFormStyle"
      ref="sreachForm"
      :model="formData"
      label-position="top"
      disabled
      size="small"
    >
      <el-row :gutter="5">
        <!-- 提运单号 -->
        <el-col :span="3">
          <Formitem label="提运单号" prop="billNo">
            <el-input
              type="text"
              class="inputShadow"
              id="inputInner--billNo"
              resize="none"
              v-model="formData.billNo"
              clearable
              placeholder=""
            ></el-input>
          </Formitem>
        </el-col>
        <!-- 报送类型 -->
        <el-col :span="3">
          <Formitem label="报送类型" prop="appType">
            <el-input
              type="text"
              class="inputShadow"
              id="inputInner--appType"
              resize="none"
              v-model="formData.appType"
              clearable
              placeholder=""
            ></el-input>
          </Formitem>
        </el-col>
        <!-- 业务状态 -->
        <el-col :span="3">
          <Formitem label="报送状态" prop="appStatus">
            <el-select
              type="text"
              id="inputInner--appStatus"
              v-model="formData.appStatus"
              clearable
              placeholder=""
            >
              <el-option
                v-for="(item, index) in $store.getters.dict.APP_STATUS"
                :key="index"
                :label="item.itemChineseName"
                :value="item.itemValue"
              ></el-option>
            </el-select>
          </Formitem>
        </el-col>
        <!-- 报送时间 -->
        <el-col :span="3">
          <Formitem label="报送时间" prop="appTime">
            <el-input
              type="text"
              class="inputShadow"
              id="inputInner--appTime"
              resize="none"
              v-model="formData.appTime"
              clearable
              placeholder=""
            ></el-input>
          </Formitem>
        </el-col>
        <!-- 物流企业名称 -->
        <el-col :span="3">
          <Formitem label="物流企业名称" prop="logisticsName">
            <el-input
              type="text"
              class="inputShadow"
              id="inputInner--logisticsName"
              resize="none"
              v-model="formData.logisticsName"
              clearable
              placeholder=""
            ></el-input>
          </Formitem>
        </el-col>
        <!-- 物流企业代码 -->
        <el-col :span="3">
          <Formitem label="物流企业代码" prop="logisticsCode">
            <el-input
              type="text"
              class="inputShadow"
              id="inputInner--logisticsCode"
              resize="none"
              v-model="formData.logisticsCode"
              clearable
              placeholder=""
            ></el-input>
          </Formitem>
        </el-col>
        <!-- 申报地海关代码 -->
        <el-col :span="3">
          <Formitem label="申报地海关代码" prop="customsCode">
            <el-input
              type="text"
              class="inputShadow"
              id="inputInner--customsCode"
              resize="none"
              v-model="formData.customsCode"
              clearable
              placeholder=""
            ></el-input>
          </Formitem>
        </el-col>
        <!-- 运输方式 -->
        <el-col :span="3">
          <Formitem label="运输方式" prop="trafMode">
            <el-select
              type="text"
              id="inputInner--trafMode"
              v-model="formData.trafMode"
              clearable
              placeholder=""
            >
              <el-option
                v-for="(item, index) in $store.getters.dict.DECLARE_TRAFMODE"
                :key="index"
                :label="item.itemChineseName"
                :value="item.itemValue"
              ></el-option>
            </el-select>
          </Formitem>
        </el-col>
      </el-row>
      <el-row :gutter="5">
        <!-- 运输工具名称 -->
        <el-col :span="3">
          <Formitem label="运输工具名称" prop="trafName">
            <el-input
              type="text"
              class="inputShadow"
              id="inputInner--trafName"
              resize="none"
              v-model="formData.trafName"
              clearable
              placeholder=""
            ></el-input>
          </Formitem>
        </el-col>
        <!-- 离境时间 -->
        <el-col :span="3">
          <Formitem label="离境时间" prop="leaveTime">
            <el-input
              type="text"
              class="inputShadow"
              id="inputInner--leaveTime"
              resize="none"
              v-model="formData.leaveTime"
              clearable
              placeholder=""
            ></el-input>
          </Formitem>
        </el-col>
        <!-- 申报日期 -->
        <!-- <el-col :span="3">
          <Formitem label="申报日期" prop="createTimeStr">
            <el-input
              type="text"
              class="inputShadow"
              id="inputInner--createTimeStr"
              resize="none"
              v-model="formData.createTimeStr"
              clearable
              placeholder=""
            ></el-input>
          </Formitem>
        </el-col> -->
        <!-- 备注 -->
        <el-col :span="9">
          <Formitem label="备注" prop="note">
            <el-input
              type="text"
              class="inputShadow"
              id="inputInner--note"
              resize="none"
              v-model="formData.note"
              clearable
              placeholder=""
            ></el-input>
          </Formitem>
        </el-col>
      </el-row>
    </el-form>
    <div
      :class="{ entryTitle: true, titleBorder: logtableType ? false : true }"
      style="margin-top: 10px"
    >
      <div>
        回执信息
        <el-button type="text" @click="hiddenLogTable">
          <svg-icon v-if="logtableType" icon-class="downIcon"></svg-icon>
          <svg-icon v-else icon-class="upIcon"></svg-icon>
        </el-button>
      </div>
    </div>
    <ReceiptInfoTable
      v-if="logtableType"
      :tableData="logData"
      :headerData="logHeaderData"
    />
    <div class="entryTitle" style="margin-top: 10px">商品明细</div>
    <ProductDetailTable
      :tableData="detailData"
      :bodyHeader="detialHeaderData"
    />
    <div style="margin-bottom: 20px; text-align: center"></div>
  </div>
</template>

<script>
import ReceiptInfoTable from "../components/ReceiptInfoTable/index.vue";
import ProductDetailTable from "../components/ProductDetailTable/index.vue";
import { getLogisticsExitDetail } from "@/api/exportDetail-api.js";
export default {
  name: "index.vue",
  components: { ProductDetailTable, ReceiptInfoTable },
  data() {
    return {
      id: null,
      formData: {},
      logData: [],
      logHeaderData: [
        {
          name: "回执状态",
          value: "returnStatus",
          width: "200",
          align: "left",
        },
        {
          name: "状态时间",
          value: "returnTime",
          width: "400",
          align: "left",
        },
        {
          name: "回执描述",
          value: "returnInfo",
          width: "",
          align: "left",
        },
      ],
      detailData: [],
      detialHeaderData: [
        {
          name: "序号",
          value: "gnum",
          width: "",
          align: "left",
        },
        {
          name: "总包号",
          value: "totalPackageNo",
          width: "",
          align: "left",
        },
        {
          name: "物流运单编号",
          value: "logisticsNo",
          width: "",
          align: "left",
        },
        {
          name: "备注",
          value: "note",
          width: "",
          align: "left",
        },
      ],
      loadings: {
        entryLoading: false,
      },
      logtableType: true,
    };
  },
  created() {
    if (this.$route.params.data) {
      this.id = this.$route.params.data.id;
      this.searchData();
    } else {
      this.back();
    }
  },
  methods: {
    searchData() {
      this.loadings.entryLoading = true;
      getLogisticsExitDetail({ logisticsDepartureId: this.id })
        .then((res) => {
          if (res.code === "200") {
            this.formData = res.data.exportLogisticsDeparture;
            this.detailData = res.data.exportLogisticsDepartureItemList;
            this.logData = res.data.exportLogisticsDepartureReceiptList;
            this.detailData.forEach((item, idx) => {
              item.index = idx;
            });
          } else {
            this.alertWarningMsg(res.message);
          }
          this.loadings.entryLoading = false;
        })
        .catch((err) => {
          console.log(err);
          this.loadings.entryLoading = false;
        });
    },
    searchLogData() {},
    hiddenLogTable() {
      this.logtableType = !this.logtableType;
    },
    back() {
      this.$router.go(-1);
    },
  },
};
</script>

<style scoped lang="scss">
.entry {
  width: 100%;
  height: 100%;
  padding: 10px;
  background-color: #fff;
  overflow: auto;

  .entryInformation {
    width: 100%;
    height: 100%;
  }

  .entryTitle {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-weight: 16px;
    color: #000;
    margin-bottom: 10px;
  }

  .titleBorder {
    border-bottom: 1px solid #333;
  }
}
</style>