seaStepDetail.vue 11 KB
Newer Older
huhaiqing's avatar
huhaiqing committed
1
<template>
huhaiqing106's avatar
huhaiqing106 committed
2 3 4 5
  <div class="app-seaStepDetail">
    <el-scrollbar :vertical="true">
      <div class="shipping-step">
        <template v-for="(step, index) in flatSeaStep">
6
          <div :key="index" v-if="shipmentObj[step.voName] && columnsMapping[step.voName]" class="step-table">
huhaiqing106's avatar
huhaiqing106 committed
7 8 9 10 11 12 13 14 15 16
            <div class="step-title">{{step.title}}</div>
            <div v-for="(data, index) in columnsMapping[step.voName]" :key="index" class="step-content">
              <p>{{data.title}}</p>
              <p>{{getObjInfo(step.voName, data)}}</p>
            </div>
          </div>
        </template>
      </div>
    </el-scrollbar>
  </div>
huhaiqing's avatar
huhaiqing committed
17 18 19
</template>

<script>
huhaiqing106's avatar
huhaiqing106 committed
20
import dayjs from "dayjs";
huhaiqing's avatar
huhaiqing committed
21
import * as _C from "./utils";
huhaiqing106's avatar
huhaiqing106 committed
22 23 24

export default {
  name: "seaStepDetail",
huhaiqing's avatar
huhaiqing committed
25
  inheritAttrs: false,
huhaiqing106's avatar
huhaiqing106 committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
  props: {
    shipmentObj: Object,
    seaBaseData: Array,
  },
  data() {
    return {
      flatSeaStep: this.seaBaseData.flat(),
      columnsMapping: {
        bookSeaInfo: [
          {
            title: "SO NO",
            key: "sono",
          },
          {
            title: "船公司类型",
            key: "shipCompanyType",
            type: "supplier",
          },
          {
            title: "驳船港",
            key: "bargePortId",
            type: "dock",
          },
          {
            title: "大船港",
            key: "bigPortId",
            type: "dock",
          },
          {
            title: "目的港",
            key: "destPortId",
            type: "dock",
          },
          {
            title: "订舱公司",
            key: "spaceCompanyId",
            type: "supplier",
          },
          {
            title: "预计驳船时间",
            key: "bargeTime",
            type: "date",
          },
          {
            title: "预计开船时间",
            key: "sailTime",
            type: "date",
          },
          {
            title: "业务员",
            key: "operator",
          },
        ],
        preInstallInfo: [
          {
            title: "预装时间",
            key: "createTime",
            type: "date",
          },
          {
            title: "业务员",
            key: "operator",
          },
        ],
        trailerInfo: [
          {
            title: "货柜号",
            key: "tlContainerNo",
          },
          {
            title: "封条",
            key: "tlStripSeal",
          },
          {
            title: "拖车公司",
            key: "tlCompanyId",
102
            type: "supplier",
huhaiqing106's avatar
huhaiqing106 committed
103 104 105 106
          },
          {
            title: "拖车时间",
            key: "tlTime",
huhaiqing's avatar
huhaiqing committed
107
            type: "date",
huhaiqing106's avatar
huhaiqing106 committed
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
          },
          {
            title: "车牌",
            key: "tlLicensePlate",
          },
          {
            title: "司机",
            key: "tlDriver",
          },
          {
            title: "联系方式",
            key: "tlDriverContact",
          },
          {
            title: "业务员",
            key: "operator",
          },
        ],
        agentInfo: [
          {
            title: "代理商",
            key: "agentId",
huhaiqing's avatar
huhaiqing committed
130
            type: "supplier",
huhaiqing106's avatar
huhaiqing106 committed
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
          },
          {
            title: "业务员",
            key: "operator",
          },
        ],
        cabinetInfo: [
          {
            title: "到仓时间",
            key: "ldInWarehouseTime",
            type: "date",
          },
          {
            title: "仓库类型",
            key: "ldWarehouseType",
huhaiqing's avatar
huhaiqing committed
146
            type: "warehouse",
huhaiqing106's avatar
huhaiqing106 committed
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
          },
          {
            title: "装柜时间",
            key: "ldBoxTime",
            type: "date",
          },
          {
            title: "出仓时间",
            key: "ldOutWarehouseTime",
            type: "date",
          },
          {
            title: "业务员",
            key: "operator",
          },
        ],
        customsInfo: [
          {
            title: "报关方式",
            key: "dcCustomsType",
huhaiqing's avatar
huhaiqing committed
167
            type: "shipping_customs_type",
huhaiqing106's avatar
huhaiqing106 committed
168 169 170 171
          },
          {
            title: "报关行公司",
            key: "dcCompanyId",
huhaiqing's avatar
huhaiqing committed
172
            type: "supplier",
huhaiqing106's avatar
huhaiqing106 committed
173 174 175 176 177 178 179 180 181
          },
          {
            title: "截关时间",
            key: "dcCutOffTime",
            type: "date",
          },
          {
            title: "状态",
            key: "dcCustomsStatus",
huhaiqing's avatar
huhaiqing committed
182
            type: "shipping_dcCustoms_status",
huhaiqing106's avatar
huhaiqing106 committed
183 184 185 186
          },
          {
            title: "放行时间",
            key: "dcPassTime",
huhaiqing's avatar
huhaiqing committed
187
            type: "date",
huhaiqing106's avatar
huhaiqing106 committed
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
          },
          {
            title: "新封条",
            key: "dcStripSeal",
          },
          {
            title: "柜重",
            key: "dcBoxWgt",
          },
          {
            title: "货重",
            key: "dcGoodsWgt",
          },
          {
            title: "VGM重量",
            key: "dcVgmWgt",
          },
          {
            title: "业务员",
            key: "operator",
          },
        ],
        shipConfigInfo: [
          {
            title: "已配/免配",
            key: "saExmtStatus",
huhaiqing's avatar
huhaiqing committed
214
            type: "saExmtStatus",
huhaiqing106's avatar
huhaiqing106 committed
215 216 217 218 219 220 221 222 223 224
          },
          {
            title: "业务员",
            key: "operator",
          },
        ],
        ladingBillInfo: [
          {
            title: "清关代理",
            key: "agentId",
huhaiqing's avatar
huhaiqing committed
225
            type: "supplier",
huhaiqing106's avatar
huhaiqing106 committed
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
          },
          {
            title: "提单品名",
            key: "blMblNo",
          },
          {
            title: "通知方",
            key: "notifyingId",
          },
          {
            title: "提单备注",
            key: "remarks",
          },
          {
            title: "数量",
huhaiqing's avatar
huhaiqing committed
241
            key: "packageNum",
huhaiqing106's avatar
huhaiqing106 committed
242 243 244
          },
          {
            title: "体积",
huhaiqing's avatar
huhaiqing committed
245
            key: "cbm",
huhaiqing106's avatar
huhaiqing106 committed
246 247 248 249 250 251 252 253 254 255
          },
          {
            title: "业务员",
            key: "operator",
          },
        ],
        bargeInfo: [
          {
            title: "驳船",
            key: "bgExmtStatus",
huhaiqing's avatar
huhaiqing committed
256
            type: "bgExmtStatus",
huhaiqing106's avatar
huhaiqing106 committed
257 258 259 260 261 262 263 264 265 266
          },
          {
            title: "业务员",
            key: "operator",
          },
        ],
        shippingInfo: [
          {
            title: "实际开船时间",
            key: "dtRealShipTime",
huhaiqing's avatar
huhaiqing committed
267
            type: "datetime",
huhaiqing106's avatar
huhaiqing106 committed
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282
          },
          {
            title: "预计到港时间",
            key: "dtEstArrivalTime",
            type: "date",
          },
          {
            title: "业务员",
            key: "operator",
          },
        ],
        clearanceDocInfo: [
          {
            title: "agent list",
            key: "cdAgentlistType",
huhaiqing's avatar
huhaiqing committed
283
            type: "isFile",
huhaiqing106's avatar
huhaiqing106 committed
284 285 286 287
          },
          {
            title: "soncap",
            key: "cdSoncapType",
huhaiqing's avatar
huhaiqing committed
288
            type: "isFile",
huhaiqing106's avatar
huhaiqing106 committed
289 290 291 292
          },
          {
            title: "出单方式",
            key: "cdOutBillType",
huhaiqing's avatar
huhaiqing committed
293
            type: "billingMethod",
huhaiqing106's avatar
huhaiqing106 committed
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308
          },
          {
            title: "寄送时间",
            key: "cdSendTime",
            type: "date",
          },
          {
            title: "业务员",
            key: "operator",
          },
        ],
        arrivalInfo: [
          {
            title: "实际到港时间",
            key: "apRealTime",
huhaiqing's avatar
huhaiqing committed
309
            type: "datetime",
huhaiqing106's avatar
huhaiqing106 committed
310 311 312 313
          },
          {
            title: "确认到港",
            key: "apConfirmTime",
huhaiqing's avatar
huhaiqing committed
314
            type: "datetime",
huhaiqing106's avatar
huhaiqing106 committed
315 316 317 318
          },
          {
            title: "卸港时间",
            key: "apUnloadPortTime",
huhaiqing's avatar
huhaiqing committed
319
            type: "date",
huhaiqing106's avatar
huhaiqing106 committed
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334
          },
          {
            title: "业务员",
            key: "operator",
          },
        ],
        clearanceInfo: [
          {
            title: "预计清关时间",
            key: "clEstTime",
            type: "date",
          },
          {
            title: "清关时间",
            key: "clClearTime",
huhaiqing's avatar
huhaiqing committed
335
            type: "datetime",
huhaiqing106's avatar
huhaiqing106 committed
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385
          },
          {
            title: "业务员",
            key: "operator",
          },
        ],
        cabinetUnloadInfo: [
          {
            title: "到仓时间",
            key: "ulWarehouseTime",
            type: "date",
          },
          {
            title: "卸货时间",
            key: "ulBoxTime",
            type: "date",
          },
          {
            title: "业务员",
            key: "operator",
          },
        ],
        settlementInfo: [
          {
            title: "可结算",
            key: "slSettlementTime",
            type: "date",
          },
          {
            title: "已结算",
            key: "slSettledTime",
            type: "date",
          },
          {
            title: "业务员",
            key: "operator",
          },
        ],
      },
    };
  },
  methods: {
    getObjInfo(voName, data) {
      const { key, type } = data;
      let val = this.shipmentObj[voName]?.[key] ?? "";
      if (val) {
        switch (type) {
          case "date":
            val = dayjs(val).format("YYYY-MM-DD");
            break;
huhaiqing's avatar
huhaiqing committed
386 387 388
          case "datetime":
            val = dayjs(val).format("YYYY-MM-DD HH:mm:ss");
            break;
huhaiqing106's avatar
huhaiqing106 committed
389 390 391 392 393 394
          case "supplier":
            val = this.getSupplier(Number(val));
            break;
          case "dock":
            val = this.getDock(Number(val));
            break;
huhaiqing's avatar
huhaiqing committed
395 396 397
          case "warehouse":
            val = this.getWarehouse(Number(val));
            break;
huhaiqing's avatar
huhaiqing committed
398
          case "shipping_dcCustoms_status":
huhaiqing's avatar
huhaiqing committed
399 400 401 402
          case "shipping_customs_type":
            val = this.getDict(type, String(val));
            break;
          case "saExmtStatus":
huhaiqing's avatar
huhaiqing committed
403 404 405
          case "bgExmtStatus":
          case "isFile":
          case "billingMethod":
huhaiqing's avatar
huhaiqing committed
406 407
            val = this.getConstant(type, String(val));
            break;
huhaiqing106's avatar
huhaiqing106 committed
408 409 410 411 412 413 414 415 416 417
        }
      }
      return val;
    },
    getSupplier(id) {
      return (
        this.$attrs.allSupplier.find((item) => item.id === id)?.companyZh ?? id
      );
    },
    getDock(id) {
huhaiqing's avatar
huhaiqing committed
418
      return this.$attrs.allDocks.find((item) => item.id === id)?.titleZh ?? id;
huhaiqing106's avatar
huhaiqing106 committed
419
    },
huhaiqing's avatar
huhaiqing committed
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434
    getWarehouse(id) {
      return (
        this.$attrs.warehouseList.find((item) => item.id === id)?.titleZh ?? id
      );
    },
    getDict(code, id) {
      return (
        this.getDictDatas(code).find((item) => item.value === id)?.label ?? id
      );
    },
    getConstant(code, id) {
      return (
        _C.constantDict[code].find((item) => item.value === id)?.label ?? id
      );
    },
huhaiqing106's avatar
huhaiqing106 committed
435 436
  },
};
huhaiqing's avatar
huhaiqing committed
437 438
</script>

huhaiqing106's avatar
huhaiqing106 committed
439 440 441 442 443 444 445 446
<style lang="scss">
.app-seaStepDetail {
  .shipping-step {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: flex-start;
huhaiqing's avatar
huhaiqing committed
447
    height: 550px;
huhaiqing106's avatar
huhaiqing106 committed
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480

    p {
      margin: 0;
    }
    .step-table {
      width: 200px;
      border: 1px solid gray;
      margin-bottom: 15px;
      margin-right: 15px;

      .step-title {
        font-size: 16px;
        font-weight: bolder;
        background-color: #c6c8ce;
        line-height: 30px;
        text-align: center;
      }
      .step-content {
        display: grid;
        border-top: 1px solid gray;
        font-size: 14px;
        line-height: 25px;
        grid-template-columns: repeat(2, 1fr);
        > p:first-child {
          border-right: 1px solid gray;
        }
        > p {
          padding: 0 5px;
        }
      }
    }
  }
}
huhaiqing's avatar
huhaiqing committed
481
</style>