indexSeaAir.vue 19.9 KB
Newer Older
wh's avatar
wh committed
1 2 3
<template>
  <div class="app-container">
    <!-- 搜索工作栏 -->
zhoutong's avatar
zhoutong committed
4 5 6 7 8 9 10 11
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
    >
12
      <el-form-item :label="$t('自编号')" prop="selfNo">
zhoutong's avatar
zhoutong committed
13 14
        <el-input
          v-model="queryParams.selfNo"
15
          :placeholder="$t('请输入自编号')"
zhoutong's avatar
zhoutong committed
16 17 18
          clearable
          @keyup.enter.native="handleQuery"
        />
wh's avatar
wh committed
19
      </el-form-item>
20
      <el-form-item :label="$t('柜号')" prop="cubNo">
zhoutong's avatar
zhoutong committed
21 22
        <el-input
          v-model="queryParams.cubNo"
23
          :placeholder="$t('请输入柜号')"
zhoutong's avatar
zhoutong committed
24 25 26
          clearable
          @keyup.enter.native="handleQuery"
        />
wh's avatar
wh committed
27
      </el-form-item>
28 29
      <el-form-item :label="$t('柜型')" prop="cabinetId">
        <el-select v-model="queryParams.cabinetId" :placeholder="$t('请选择柜型')">
zhoutong's avatar
zhoutong committed
30 31 32 33 34 35
          <el-option
            v-for="item in cabinetList"
            :label="item.name"
            :value="item.name"
            :key="item.id"
          ></el-option>
wh's avatar
wh committed
36 37
        </el-select>
      </el-form-item>
wanglianghe's avatar
wanglianghe committed
38

39
      <el-form-item :label="$t('始发地')" prop="startWarehouseId">
zhoutong's avatar
zhoutong committed
40 41
        <el-select
          v-model="queryParams.startWarehouseId"
42
          :placeholder="$t('请选择始发地')"
zhoutong's avatar
zhoutong committed
43 44 45
        >
          <el-option
            v-for="item in exportWarehouseList"
46
            :label="$l(item, 'title')"
zhoutong's avatar
zhoutong committed
47 48 49
            :value="item.id"
            :key="item.id"
          ></el-option>
wh's avatar
wh committed
50
        </el-select>
wh's avatar
wh committed
51
      </el-form-item>
wanglianghe's avatar
wanglianghe committed
52

53
      <el-form-item :label="$t('目的地')" prop="destWarehouseId">
zhoutong's avatar
zhoutong committed
54 55
        <el-select
          v-model="queryParams.destWarehouseId"
56
          :placeholder="$t('请选择目的地')"
zhoutong's avatar
zhoutong committed
57 58 59
        >
          <el-option
            v-for="item in importWarehouseList"
60
            :label="$l(item, 'title')"
zhoutong's avatar
zhoutong committed
61 62 63
            :value="item.id"
            :key="item.id"
          ></el-option>
wh's avatar
wh committed
64
        </el-select>
wh's avatar
wh committed
65
      </el-form-item>
wanglianghe's avatar
wanglianghe committed
66 67

      <el-form-item label="" prop="date">
zhoutong's avatar
zhoutong committed
68 69
        <el-select
          v-model="queryParams.dateType"
70
          :placeholder="$t('请选择时间类型')"
zhoutong's avatar
zhoutong committed
71 72 73 74 75 76 77 78 79
          clearable
          size="small"
        >
          <el-option
            v-for="item in dateTypes"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
wh's avatar
wh committed
80
        </el-select>
wh's avatar
wh committed
81
      </el-form-item>
wanglianghe's avatar
wanglianghe committed
82 83

      <el-form-item label="">
zhoutong's avatar
zhoutong committed
84 85 86 87 88 89
        <el-date-picker
          v-model="queryParams.dateRangeCreateTime"
          style="width: 240px"
          value-format="yyyy-MM-dd HH:mm:ss"
          type="datetimerange"
          range-separator="-"
90 91
          start-:placeholder="$t('开始日期')"
          end-:placeholder="$t('结束日期')"
zhoutong's avatar
zhoutong committed
92
        />
wh's avatar
wh committed
93
      </el-form-item>
wanglianghe's avatar
wanglianghe committed
94

95
      <el-form-item :label="$t('状态')" prop="boxStatus">
zhoutong's avatar
zhoutong committed
96 97
        <el-select
          v-model="queryParams.boxStatus"
98
          :placeholder="$t('请选择状态')"
zhoutong's avatar
zhoutong committed
99 100 101 102
          clearable
          size="small"
        >
          <el-option
wanglianghe's avatar
wanglianghe committed
103
            v-for="dict in this.getDictDatas(DICT_TYPE.BOX_SEA_AIR_SHIPMENT_STATUS)"
zhoutong's avatar
zhoutong committed
104
            :key="dict.value"
105
            :label="$l(dict, 'label')"
zhoutong's avatar
zhoutong committed
106 107
            :value="dict.value"
          />
wanglianghe's avatar
wanglianghe committed
108 109 110
        </el-select>
      </el-form-item>

wh's avatar
wh committed
111
      <el-form-item>
112 113
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
        <el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
wh's avatar
wh committed
114 115 116 117 118 119
      </el-form-item>
    </el-form>

    <!-- 操作工具栏 -->
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
zhoutong's avatar
zhoutong committed
120 121 122 123 124 125 126
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['shipment:box:create']"
127
          >{{$t('出货安排')}}
wh's avatar
wh committed
128
        </el-button>
wh's avatar
wh committed
129 130
      </el-col>
      <el-col :span="1.5">
zhoutong's avatar
zhoutong committed
131 132 133 134 135 136 137 138
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          :loading="exportLoading"
          v-hasPermi="['shipment:box:export']"
139
          >{{$t('导出')}}
wh's avatar
wh committed
140
        </el-button>
wh's avatar
wh committed
141
      </el-col>
zhoutong's avatar
zhoutong committed
142 143 144 145
      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
      ></right-toolbar>
wh's avatar
wh committed
146 147 148 149
    </el-row>

    <!-- 列表 -->
    <el-table v-loading="loading" :data="list">
150
      <el-table-column :label="$t('自编号')" align="center" prop="selfNo">
zhoutong's avatar
zhoutong committed
151 152 153 154
        <template slot-scope="scope">
          <a href="javascript:void(0)" @click="handleCommand(scope.row, 'detail')">{{ scope.row.selfNo }}</a>
        </template>
      </el-table-column>
155 156
      <el-table-column :label="$t('柜号')" align="center" prop="cubNo" />
      <el-table-column :label="$t('柜型')" align="center" prop="cabinetId">
wanglianghe's avatar
wanglianghe committed
157 158
        <template slot-scope="scope">
          <span>{{ getCabinetName(scope.row.cabinetId) }}</span>
wh's avatar
wh committed
159 160
        </template>
      </el-table-column>
161
      <el-table-column :label="$t('运输方式')" align="center" prop="transportType">
wh's avatar
wh committed
162
        <template slot-scope="scope">
zhoutong's avatar
zhoutong committed
163 164 165 166
          <dict-tag
            :type="DICT_TYPE.ECW_TRANSPORT_TYPE"
            :value="scope.row.transportType"
          />
wh's avatar
wh committed
167 168
        </template>
      </el-table-column>
wanglianghe's avatar
wanglianghe committed
169

170
      <el-table-column :label="$t('出货渠道')" align="center" prop="shippingChannelId">
wanglianghe's avatar
wanglianghe committed
171 172 173
        <template slot-scope="scope">
          <span>{{ getShipChannelName(scope.row.shippingChannelId) }}</span>
        </template>
wh's avatar
wh committed
174
      </el-table-column>
wanglianghe's avatar
wanglianghe committed
175

zhoutong's avatar
zhoutong committed
176
      <el-table-column
177
        :label="$t('方数') + '(' + $t('预装') + '/' + $t('已装') + ')'"
zhoutong's avatar
zhoutong committed
178 179 180 181 182
        align="center"
        prop="squareNumber"
      >
        <template slot-scope="{ row }">
          {{ row.boxStatistics.volume }}/{{ row.boxStatistics.loadVolume }}
wanglianghe's avatar
wanglianghe committed
183 184
        </template>
      </el-table-column>
185
      <el-table-column :label="$t('重量')+'(' + $t('预装') + '/' + $t('已装' + ')')" align="center" prop="weight">
zhoutong's avatar
zhoutong committed
186 187
        <template slot-scope="{ row }">
          {{ row.boxStatistics.weight }}/{{ row.boxStatistics.loadWeight }}
zhoutong's avatar
zhoutong committed
188 189 190
        </template>
      </el-table-column>

191
      <el-table-column :label="$t('状态')" align="center" prop="shipmentStatusText" />
huhaiqing's avatar
huhaiqing committed
192

zhoutong's avatar
zhoutong committed
193
      <el-table-column
194
        :label="$t('日期')"
zhoutong's avatar
zhoutong committed
195 196 197 198 199 200 201 202 203
        align="center"
        prop="createTime"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{
            new Date(scope.row.createTime).format('yyyy-MM-dd hh:mm:ss')
          }}</span>
        </template>
wh's avatar
wh committed
204
      </el-table-column>
205
      <el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width" width="200px">
wh's avatar
wh committed
206
        <template slot-scope="scope">
207
          <!-- <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)"
208
                     v-hasPermi="['shipment:box:query']">{{$t('查看')}}</el-button>
wh's avatar
wh committed
209
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
210
                     v-hasPermi="['shipment:box:update']">{{$t('修改')}}</el-button>
wh's avatar
wh committed
211
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
212
                     v-hasPermi="['shipment:box:delete']">{{$t('删除')}}</el-button> -->
zhoutong's avatar
zhoutong committed
213 214 215 216 217
          <el-dropdown
            trigger="click"
            @command="(command) => handleCommand(scope.row, command)"
            style="marginRight:10px;"
          >
218
            <el-button type="primary">
219
              {{$t('操作')}}<i class="el-icon-arrow-down el-icon--right"></i>
220 221
            </el-button>
            <el-dropdown-menu slot="dropdown">
222
              <el-dropdown-item command="edit">{{$t('编辑')}}</el-dropdown-item>
zhoutong's avatar
zhoutong committed
223
              <el-dropdown-item command="seaAir"
224
                >{{$t('操作')}}-{{$t('海空联运')}}</el-dropdown-item
zhoutong's avatar
zhoutong committed
225
              >
226 227 228
              <el-dropdown-item command="error">{{$t('异常登记')}}</el-dropdown-item>
              <el-dropdown-item command="cost">{{$t('费用登记')}}</el-dropdown-item>
              <el-dropdown-item command="delete">{{$t('删除')}}</el-dropdown-item>
229
              <el-dropdown-item :disabled="scope.row.ldStatus<46" command="editLadingBill">{{$t('编辑提货单')}}</el-dropdown-item>
230 231
            </el-dropdown-menu>
          </el-dropdown>
zhoutong's avatar
zhoutong committed
232
          <el-dropdown trigger="click" @command="(command)=>handleCommand(scope.row, command)">
zhoutong's avatar
zhoutong committed
233
            <el-button type="primary">
234
              {{$t('下载')}}<i class="el-icon-arrow-down el-icon--right"></i>
zhoutong's avatar
zhoutong committed
235 236
            </el-button>
            <el-dropdown-menu slot="dropdown">
237 238 239
              <el-dropdown-item command="downloadPreloadGoodsList">{{$t('预装单')}}</el-dropdown-item>
              <el-dropdown-item command="downloadLoadGoodsList">{{$t('已装单')}}</el-dropdown-item>
              <el-dropdown-item command="downloadReceivableList">{{$t('应收汇总表')}}</el-dropdown-item>
zhoutong's avatar
zhoutong committed
240 241
              <el-dropdown-item command="downloadAgentListFiles">agent list</el-dropdown-item>
              <el-dropdown-item command="downloadSoncapFiles">soncap</el-dropdown-item>
242 243
              <el-dropdown-item command="zipDownload">{{$t('提货单')}}</el-dropdown-item>
              <el-dropdown-item command="downloadLadingCopy">{{$t('提单Copy')}}</el-dropdown-item>
zhoutong's avatar
zhoutong committed
244 245
            </el-dropdown-menu>
          </el-dropdown>
wh's avatar
wh committed
246 247 248 249
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
zhoutong's avatar
zhoutong committed
250 251 252 253 254 255 256
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNo"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
wh's avatar
wh committed
257 258

    <!-- 对话框(添加 / 修改) -->
zhoutong's avatar
zhoutong committed
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
    <el-dialog
      :title="dialogCfg.title"
      :visible.sync="dialogCfg.open"
      :width="dialogCfg.width"
      :fullscreen="dialogCfg.fullscreen"
      append-to-body
      class="shippingSea-dialog"
    >
      <template
        v-if="
          dialogCfg.dialogType === 'edit' || dialogCfg.dialogType === 'add'
        "
      >
        <editForm
          v-if="dialogCfg.open"
          @closeDialog="closeDialog"
          :shipmentObj="currRow"
          :warehouseList="warehouseList"
          :transportTypes="transportTypes"
          :cabinetList="cabinetList"
        />
      </template>
      <template v-if="dialogCfg.dialogType === 'cost'">
        <costForm
          v-if="dialogCfg.open"
          @closeDialog="closeDialog"
          :shipmentObj="currRow"
        />
      </template>
      <template v-if="dialogCfg.dialogType === 'error'">
        <regError
          v-if="dialogCfg.open"
          @closeDialog="closeDialog"
          :shipmentObj="currRow"
huhaiqing's avatar
huhaiqing committed
293
          :allUsers="allUsers"
zhoutong's avatar
zhoutong committed
294 295
        />
      </template>
huyf's avatar
huyf committed
296 297 298
      <template v-if="dialogCfg.dialogType === 'editLadingBill'">
        <ladingBill v-if="dialogCfg.open" @closeDialog="closeDialog" :shipmentObj="currRow" :getCabinetName="getCabinetName" />
      </template>
wh's avatar
wh committed
299 300 301 302 303
    </el-dialog>
  </div>
</template>

<script>
zhoutong's avatar
zhoutong committed
304 305 306 307 308 309
import {
  deletebox,
  getbox,
  getboxPage,
  exportboxExcel
} from '@/api/ecw/box'
zhoutong's avatar
zhoutong committed
310 311 312 313 314
import {
  downloadFile,
  downloadFileByUrl,
  formatDate,
} from "./shippingSea/utils";
zhoutong's avatar
zhoutong committed
315 316 317 318 319 320
import { getCabinetPage } from '@/api/ecw/cabinet'
import { getChannelList } from '@/api/ecw/channel'
import { getWarehouseList } from '@/api/ecw/warehouse'
import costForm from './costForm.vue'
import regError from './regError.vue'
import editForm from './editSeaAirForm.vue'
huyf's avatar
huyf committed
321
import ladingBill from "./ladingBill/index.vue";
huhaiqing's avatar
huhaiqing committed
322
import { listUser } from "@/api/system/user";
zhoutong's avatar
zhoutong committed
323 324

export default {
huhaiqing's avatar
huhaiqing committed
325
  name: 'EcwBoxIndexseaair',
zhoutong's avatar
zhoutong committed
326 327 328
  components: {
    costForm,
    regError,
huyf's avatar
huyf committed
329 330
    editForm,
    ladingBill,
zhoutong's avatar
zhoutong committed
331 332 333 334
  },
  data() {
    return {
      dateTypes: [
335 336 337 338 339 340
        { value: '1', label: this.$t('预装时间') },
        { value: '2', label: this.$t('装柜时间') },
        { value: '3', label: this.$t('起运时间') },
        { value: '4', label: this.$t('到港时间') },
        { value: '5', label: this.$t('清关时间') },
        { value: '6', label: this.$t('提货时间') }
zhoutong's avatar
zhoutong committed
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357
      ],

      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 出货列表
      list: [],
      // 弹出层标题
      title: '',
      // 是否显示弹出层
      open: false,
      dialogCfg: {
wh's avatar
wh committed
358
        title: "",
zhoutong's avatar
zhoutong committed
359 360
        dialogType: "",
        width: "600px",
wh's avatar
wh committed
361 362
        // 是否显示弹出层
        open: false,
zhoutong's avatar
zhoutong committed
363
        fullscreen: false,
wh's avatar
wh committed
364
      },
zhoutong's avatar
zhoutong committed
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379
      // 当前行
      currRow: {},
      dateRangeCreateTime: [],
      // 查询参数
      queryParams: {
        pageNo: 1,
        pageSize: 10,
        id: null,
        selfNo: null,
        cubNo: null,
        cabinetId: null,
        boxStatus: null,
        startWarehouseId: null,
        destWarehouseId: null,
        transportType: null
wanglianghe's avatar
wanglianghe committed
380
      },
zhoutong's avatar
zhoutong committed
381 382 383
      cabinetList: [],
      channelList: [],
      warehouseList: [],
huhaiqing's avatar
huhaiqing committed
384
      allUsers: []
zhoutong's avatar
zhoutong committed
385 386 387 388 389 390 391 392 393 394 395 396 397
    }
  },
  computed: {
    exportWarehouseList() {
      return this.warehouseList.filter(
        (item) => item.tradeType == '2' || item.type == '3'
      )
    },
    importWarehouseList() {
      return this.warehouseList.filter(
        (item) => item.tradeType == '1' || item.type == '3'
      )
    },
wanglianghe's avatar
wanglianghe committed
398

zhoutong's avatar
zhoutong committed
399 400 401 402 403 404
    getCabinetName() {
      return (cabinetId) => {
        for (let index in this.cabinetList) {
          let cabinetItem = this.cabinetList[index]
          if (cabinetItem.id == cabinetId) {
            return cabinetItem.name
wanglianghe's avatar
wanglianghe committed
405 406
          }
        }
zhoutong's avatar
zhoutong committed
407 408 409
        return '/'
      }
    },
wanglianghe's avatar
wanglianghe committed
410

zhoutong's avatar
zhoutong committed
411 412 413 414 415
    getShipChannelName() {
      return (shippingChannelId) => {
        for (let index in this.channelList) {
          let channelItem = this.channelList[index]
          if (channelItem.channelId == shippingChannelId) {
416
            return this.$l(channelItem, 'name')
wanglianghe's avatar
wanglianghe committed
417 418
          }
        }
zhoutong's avatar
zhoutong committed
419
        return '/'
wanglianghe's avatar
wanglianghe committed
420
      }
zhoutong's avatar
zhoutong committed
421 422 423
    }
  },
  created() {
huhaiqing's avatar
huhaiqing committed
424 425 426 427 428
    // 用户
    listUser({ pageNo: "1", pageSize: "10000" }).then((res) => {
      const { data } = res;
      this.allUsers = data.list ?? [];
    });
zhoutong's avatar
zhoutong committed
429 430 431 432 433 434 435 436 437 438 439 440 441 442
    this.transportTypes = this.getDictDatas(
      this.DICT_TYPE.ECW_TRANSPORT_TYPE
    ).filter((item) => item.value == '4')
    getWarehouseList().then((res) => (this.warehouseList = res.data))
    getCabinetPage(null).then((response) => {
      this.cabinetList = response.data.list
    })
    this.getList()
    this.getChannelList()
  },
  methods: {
    getChannelList() {
      getChannelList().then((res) => (this.channelList = res.data))
    },
wanglianghe's avatar
wanglianghe committed
443

zhoutong's avatar
zhoutong committed
444 445 446 447 448 449 450 451 452 453 454 455 456
    /** 查询列表 */
    getList() {
      this.loading = true
      // 处理查询参数
      let params = { ...this.queryParams }
      params.transportType = 4
      this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime')
      // 执行查询
      getboxPage(params).then((response) => {
        this.list = response.data.list
        this.total = response.data.total
        this.loading = false
      })
wh's avatar
wh committed
457
    },
zhoutong's avatar
zhoutong committed
458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486
    /** 取消按钮 */
    cancel() {
      this.open = false
      this.reset()
    },
    /** 表单重置 */
    reset() {
      this.form = {
        id: undefined,
        cabinetId: undefined,
        startWarehouseId: undefined,
        destWarehouseId: undefined,
        transportType: '4'
      }
      this.resetForm('form')
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNo = 1
      this.getList()
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRangeCreateTime = []
      this.resetForm('queryForm')
      this.handleQuery()
    },
    /** 新增按钮操作 */
    handleAdd() {
487
      this.$set(this.dialogCfg, "title", this.$t("添加出货"));
zhoutong's avatar
zhoutong committed
488 489 490 491
      this.$set(this.dialogCfg, "dialogType", "add");
      this.$set(this.dialogCfg, "width", "600px");
      this.$set(this.dialogCfg, "fullscreen", false);
      this.$set(this.dialogCfg, "open", true);
huhaiqing's avatar
huhaiqing committed
492 493 494
      this.currRow = {
        transportType: "4",
      };
zhoutong's avatar
zhoutong committed
495 496 497 498 499 500
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      const id = row.id;
      getbox(id).then((response) => {
        this.currRow = response.data;
501
        this.$set(this.dialogCfg, "title", this.$t("修改出货"));
zhoutong's avatar
zhoutong committed
502 503 504
        this.$set(this.dialogCfg, "dialogType", "edit");
        this.$set(this.dialogCfg, "width", "600px");
        this.$set(this.dialogCfg, "open", true);
wh's avatar
wh committed
505 506
      });
    },
zhoutong's avatar
zhoutong committed
507 508 509 510
    /* 关闭弹窗 */
    closeDialog(type) {
      this.$set(this.dialogCfg, "open", false);
      if (type === "add" || type === "edit") {
wh's avatar
wh committed
511
        this.getList();
zhoutong's avatar
zhoutong committed
512 513
      }
    },
huyf's avatar
huyf committed
514

zhoutong's avatar
zhoutong committed
515 516 517 518
    /** 删除按钮操作 */
    handleDelete(row) {
      const id = row.id
      this.$modal
519
        .confirm(this.$t('是否确认删除出货编号为{id}的数据项?', {id}))
zhoutong's avatar
zhoutong committed
520 521 522 523 524
        .then(function () {
          return deletebox(id)
        })
        .then(() => {
          this.getList()
525
          this.$modal.msgSuccess(this.$t('删除成功'))
zhoutong's avatar
zhoutong committed
526 527 528 529 530 531 532 533 534 535 536 537
        })
        .catch(() => {})
    },
    /** 导出按钮操作 */
    handleExport() {
      // 处理查询参数
      let params = { ...this.queryParams }
      params.pageNo = undefined
      params.pageSize = undefined
      this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime')
      // 执行导出
      this.$modal
538
        .confirm(this.$t('是否确认导出所有出货数据项?'))
zhoutong's avatar
zhoutong committed
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556
        .then(() => {
          this.exportLoading = true
          return exportboxExcel(params)
        })
        .then((response) => {
          this.$download.excel(response, '${table.classComment}.xls')
          this.exportLoading = false
        })
        .catch(() => {})
    },
    /** 查看按钮操作 */
    handleCommand(row, command) {
      this.$set(this.dialogCfg, "fullscreen", false);
      switch (command) {
        case 'seaAir':
          this.$router.push('/boxSeaAir/shippingSeaAir/' + row.id)
          break

zhoutong's avatar
zhoutong committed
557 558 559 560
        case "detail":
        this.$router.push("/boxSeaAir/query/" + row.id);
          break;

zhoutong's avatar
zhoutong committed
561 562 563 564 565 566 567 568
        case 'edit':
          this.handleUpdate(row)
          break

        case 'delete':
          this.handleDelete(row)
          break

huyf's avatar
huyf committed
569 570
        case "editLadingBill":
            const cabinetLabel = this.getCabinetName(row.cabinetId);
huhaiqing's avatar
huhaiqing committed
571
            /* const title =
572 573

            `查看提单 ${row.selfNo ?? ""} 柜号:${
huyf's avatar
huyf committed
574
                row.cubNo ?? ""
575 576 577 578 579 580
            } 柜型:${cabinetLabel}`; */
            const title = this.$t('查看提单 {selfNo} 柜号:{cubNo} 柜型:{cabinetLabel}`', {
              selfNo: row.selfNo,
              cubNo: row.cubNo,
              cabinetLabel: cabinetLabel
            })
huyf's avatar
huyf committed
581 582 583 584
            this.$set(this.dialogCfg, "title", title);
            this.$set(this.dialogCfg, "fullscreen", true);
            break;

zhoutong's avatar
zhoutong committed
585
        case 'cost':
586
          this.$set(this.dialogCfg, 'title', this.$t('费用登记'))
zhoutong's avatar
zhoutong committed
587 588 589
          break

        case 'error':
590
          this.$set(this.dialogCfg, 'title', this.$t('异常登记'))
zhoutong's avatar
zhoutong committed
591
          break
zhoutong's avatar
zhoutong committed
592 593 594 595
        case "downloadPreloadGoodsList":
          downloadFile(
            command,
            { shipmentId: row.id },
596
            this.$t('预装单') + `(${row.selfNo}).xlsx`,
zhoutong's avatar
zhoutong committed
597 598 599 600 601 602 603
            "xlsx"
          );
          break;
        case "downloadLoadGoodsList":
          downloadFile(
            command,
            { shipmentId: row.id },
604
            this.$t('已装单') + `(${row.selfNo}).xlsx`,
zhoutong's avatar
zhoutong committed
605 606 607 608 609 610 611
            "xlsx"
          );
          break;
        case "downloadReceivableList":
          downloadFile(
            command,
            { shipmentId: row.id },
612
            this.$t('应收汇总表') + `(${row.selfNo}).xlsx`,
zhoutong's avatar
zhoutong committed
613 614 615 616 617 618 619
            "xlsx"
          );
          break;
        case "zipDownload":
          downloadFile(
            command,
            { shipmentId: row.id },
620
            this.$t('提货单') + `(${row.selfNo}).zip`,
zhoutong's avatar
zhoutong committed
621 622 623 624 625 626 627 628
            "zip"
          );
          break;
        case "downloadAgentListFiles":
        case "downloadSoncapFiles":
        case "downloadLadingCopy":
          downloadFileByUrl(command, { shipmentId: row.id });
          break;
zhoutong's avatar
zhoutong committed
629 630 631
      }
      if (["editLadingBill", "cost", "error"].includes(command)) {
        this.currRow = row;
632
        this.currRow.bosType = 'seaAir'
zhoutong's avatar
zhoutong committed
633 634 635 636
        this.$set(this.dialogCfg, "dialogType", command);
        this.$set(this.dialogCfg, "width", "600px");
        this.$set(this.dialogCfg, "open", true);
      }
wh's avatar
wh committed
637
    }
zhoutong's avatar
zhoutong committed
638 639
  }
}
wh's avatar
wh committed
640
</script>