shippingSea.vue 4.34 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
        <!-- 海运流程图 -->
huhaiqing's avatar
huhaiqing committed
29
        <seaProcess :seaBaseData="seaBaseData" :shipmentObj="shipmentObj" :allSupplier="allSupplier" :allDocks="allDocks" :allUsers="allUsers" :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 47

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

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