shippingSea.vue 4.59 KB
Newer Older
1 2 3
<template>
  <div>
    <el-row type="flex" style="margin-top: 15px; margin-bottom: 15px" justify="center">
huhaiqing106's avatar
huhaiqing106 committed
4
      <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="19">
5
        <div style="display: flex; justify-content: space-between;align-items: flex-end;">
6
          <h2>{{$t('海运出货操作')}}</h2>
7
        </div>
huhaiqing's avatar
huhaiqing committed
8 9

        <!-- 信息 -->
10 11
        <el-card style="margin-top: 15px">
          <el-descriptions :column="5" border>
12 13
            <el-descriptions-item :label="$t('自编号')">{{shipmentObj.selfNo}}</el-descriptions-item>
            <el-descriptions-item :label="$t('运输方式')">
huhaiqing's avatar
huhaiqing committed
14 15
              <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="shipmentObj.transportType" />
            </el-descriptions-item>
16
            <el-descriptions-item :label="$t('始发地')">
huhaiqing's avatar
huhaiqing committed
17 18
              {{importCityName(shipmentObj.startWarehouseId)}}
            </el-descriptions-item>
19
            <el-descriptions-item :label="$t('目的地')">
huhaiqing's avatar
huhaiqing committed
20 21
              {{importCityName(shipmentObj.destWarehouseId)}}
            </el-descriptions-item>
22
            <el-descriptions-item :label="$t('状态')">
huhaiqing's avatar
huhaiqing committed
23
              {{shipmentObj.shipmentStatusText}}
huhaiqing's avatar
huhaiqing committed
24
            </el-descriptions-item>
25 26 27
          </el-descriptions>
        </el-card>

huhaiqing's avatar
huhaiqing committed
28
        <!-- 海运流程图 -->
29
        <seaProcess :seaBaseData="seaBaseData" :shipmentObj="shipmentObj" :allSupplier="allSupplier" :allDocks="allDocks" :allUsers="allUsers" :allLading="allLading" :warehouseList="warehouseList" @getBoxInfo="getBoxInfo" />
huhaiqing106's avatar
huhaiqing106 committed
30 31

        <!-- 海运步骤图 -->
huhaiqing's avatar
huhaiqing committed
32
        <seaStepDetail :seaBaseData="seaBaseData" :shipmentObj="shipmentObj" :allSupplier="allSupplier" :allDocks="allDocks" :allUsers="allUsers" :warehouseList="warehouseList" />
33 34 35 36 37 38
      </el-col>
    </el-row>
  </div>
</template>

<script>
huhaiqing106's avatar
huhaiqing106 committed
39 40
import seaProcess from "./seaProcess.vue";
import seaStepDetail from "./seaStepDetail.vue";
huhaiqing's avatar
huhaiqing committed
41 42
import { getbox } from "@/api/ecw/box";
import { getWarehouseList } from "@/api/ecw/warehouse";
huhaiqing106's avatar
huhaiqing106 committed
43 44 45
import { getSupplierPage } from "@/api/ecw/supplier";
import { getDockPage } from "@/api/ecw/dock";
import { listUser } from "@/api/system/user";
46
import { getLadingShipperPage } from "@/api/ecw/ladingShipper";
47 48

// 这里引入的数据切换语言后要刷新才生效,优化办法是label同时配备labelEn字段,然后再页面上用$l函数调用
huhaiqing's avatar
huhaiqing committed
49
import { seaBaseData } from "./utils";
huhaiqing's avatar
huhaiqing committed
50 51 52
/**
 * 海运操作主页面
 */
53 54 55
export default {
  name: "shippingSea",
  components: {
huhaiqing106's avatar
huhaiqing106 committed
56 57
    seaProcess,
    seaStepDetail,
58 59
  },
  props: {
huhaiqing's avatar
huhaiqing committed
60 61 62 63 64 65
    shipmentId: String,
  },
  data() {
    return {
      shipmentObj: {},
      warehouseList: [],
huhaiqing106's avatar
huhaiqing106 committed
66 67
      // 供应商
      allSupplier: [],
68 69
      // 托运人
      allLading: [],
huhaiqing106's avatar
huhaiqing106 committed
70 71 72 73 74
      // 码头
      allDocks: [],
      // 用户
      allUsers: [],
      // 流程图节点
huhaiqing's avatar
huhaiqing committed
75
      seaBaseData: seaBaseData(),
huhaiqing's avatar
huhaiqing committed
76 77
      // 状态
      statusLabel: "",
huhaiqing's avatar
huhaiqing committed
78 79 80
    };
  },
  created() {
81
    this.getBoxInfo();
huhaiqing106's avatar
huhaiqing106 committed
82
    // 仓库
huhaiqing's avatar
huhaiqing committed
83 84 85
    getWarehouseList().then((r) => {
      this.warehouseList = r.data;
    });
huhaiqing106's avatar
huhaiqing106 committed
86 87 88 89 90 91 92 93 94 95
    // 供应商
    getSupplierPage({ pageNo: "1", pageSize: "10000" }).then((res) => {
      const { data } = res;
      this.allSupplier = data.list.map((item) => {
        if (item.companyType) {
          item.companyTypes = item.companyType.split(",");
        }
        return item;
      });
    });
96 97 98 99
    // 托运人
    getLadingShipperPage({ pageNo: "1", pageSize: "10000" }).then(res=>{
      this.allLading = res.data.list
    })
huhaiqing106's avatar
huhaiqing106 committed
100 101 102 103 104 105 106 107 108 109
    // 码头
    getDockPage({ pageNo: "1", pageSize: "10000" }).then((res) => {
      const { data } = res;
      this.allDocks = data.list;
    });
    // 用户
    listUser({ pageNo: "1", pageSize: "10000" }).then((res) => {
      const { data } = res;
      this.allUsers = data.list ?? [];
    });
huhaiqing's avatar
huhaiqing committed
110 111
  },
  methods: {
huhaiqing's avatar
huhaiqing committed
112
    /* 获取仓库 */
huhaiqing's avatar
huhaiqing committed
113 114
    importCityName(id) {
      var arr = this.warehouseList.filter((item) => item.id == id);
huhaiqing's avatar
huhaiqing committed
115
      return arr.length > 0 ?  this.$l(arr[0], 'title') : "/";
huhaiqing's avatar
huhaiqing committed
116
    },
117 118 119 120 121 122 123
    // 出货
    getBoxInfo() {
      getbox(this.shipmentId).then((res) => {
        const { data } = res;
        this.shipmentObj = data ?? {};
      });
    },
124 125 126 127
  },
};
</script>

huhaiiqng's avatar
huhaiiqng committed
128
<style lang="scss">
huhaiqing's avatar
huhaiqing committed
129 130
// 海运操作统一弹窗样式
.shipping-dialog {
131 132 133
  .custom_type_red {
    color: red;
  }
huhaiqing's avatar
huhaiqing committed
134 135 136 137 138 139
  .el-dialog__body {
    height: calc(100% - 54px);
    > :first-child {
      height: 100%;
    }
  }
huhaiqing's avatar
huhaiqing committed
140
  // 页面内元素弹窗form控件宽度设置
huhaiiqng's avatar
huhaiiqng committed
141
  .el-form-item__content {
142
    > div:not(.el-input-number) {
huhaiiqng's avatar
huhaiiqng committed
143 144 145 146
      width: 100%;
    }
  }
  .operate-button {
147
    padding-top: 10px;
huhaiiqng's avatar
huhaiiqng committed
148 149
    text-align: center;
  }
huhaiqing's avatar
huhaiqing committed
150
  .two-element {
huhaiqing's avatar
huhaiqing committed
151 152 153 154 155 156 157
    .el-form-item__content {
      display: flex;
      > :last-child {
        margin-left: 10px;
      }
    }
  }
158 159
}
</style>