indexSeaAir.vue 21.5 KB
Newer Older
wh's avatar
wh committed
1 2 3
<template>
  <div class="app-container">
    <!-- 搜索工作栏 -->
huhaiqing's avatar
huhaiqing committed
4
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
5
      <el-form-item :label="$t('自编号')" prop="selfNo">
huhaiqing's avatar
huhaiqing committed
6
        <el-input v-model="queryParams.selfNo" :placeholder="$t('请输入自编号')" clearable @keyup.enter.native="handleQuery" />
wh's avatar
wh committed
7
      </el-form-item>
8
      <el-form-item :label="$t('柜号')" prop="cubNo">
huhaiqing's avatar
huhaiqing committed
9
        <el-input v-model="queryParams.cubNo" :placeholder="$t('请输入柜号')" clearable @keyup.enter.native="handleQuery" />
wh's avatar
wh committed
10
      </el-form-item>
11
      <el-form-item :label="$t('柜型')" prop="cabinetId">
huhaiqing's avatar
huhaiqing committed
12
        <el-select v-model="queryParams.cabinetId" :placeholder="$t('请选择柜型')" clearable>
huhaiqing's avatar
huhaiqing committed
13
          <el-option v-for="item in cabinetList" :label="$l(item, 'name')" :value="item.id" :key="item.id"></el-option>
wh's avatar
wh committed
14 15
        </el-select>
      </el-form-item>
wanglianghe's avatar
wanglianghe committed
16

17
      <el-form-item :label="$t('始发地')" prop="startWarehouseId">
huhaiqing's avatar
huhaiqing committed
18 19
        <el-select v-model="queryParams.startWarehouseId" :placeholder="$t('请选择始发地')" clearable>
          <el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
wh's avatar
wh committed
20
        </el-select>
wh's avatar
wh committed
21
      </el-form-item>
wanglianghe's avatar
wanglianghe committed
22

23
      <el-form-item :label="$t('目的地')" prop="destWarehouseId">
huhaiqing's avatar
huhaiqing committed
24 25
        <el-select v-model="queryParams.destWarehouseId" :placeholder="$t('请选择目的地')" clearable>
          <el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
wh's avatar
wh committed
26
        </el-select>
wh's avatar
wh committed
27
      </el-form-item>
wanglianghe's avatar
wanglianghe committed
28

huhaiqing's avatar
huhaiqing committed
29 30 31
      <el-form-item label="" prop="dateType">
        <el-select v-model="queryParams.dateType" :placeholder="$t('请选择时间类型')" clearable size="small">
          <el-option v-for="item in dateTypes" :key="item.value" :label="$l(item, 'label')" :value="item.value" />
wh's avatar
wh committed
32
        </el-select>
wh's avatar
wh committed
33
      </el-form-item>
wanglianghe's avatar
wanglianghe committed
34

huhaiqing's avatar
huhaiqing committed
35 36
      <el-form-item label="" prop="dateRangeCreateTime">
        <el-date-picker v-model="queryParams.dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" clearable />
wh's avatar
wh committed
37
      </el-form-item>
wanglianghe's avatar
wanglianghe committed
38

39
      <el-form-item :label="$t('状态')" prop="boxStatus">
huhaiqing's avatar
huhaiqing committed
40 41
        <el-select v-model="queryParams.boxStatus" :placeholder="$t('请选择状态')" clearable size="small">
          <el-option v-for="dict in this.getDictDatas(DICT_TYPE.BOX_SEA_AIR_SHIPMENT_STATUS)" :key="dict.value" :label="$l(dict, 'label')" :value="dict.value" />
wanglianghe's avatar
wanglianghe committed
42 43 44
        </el-select>
      </el-form-item>

wh's avatar
wh committed
45
      <el-form-item>
46 47
        <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
48 49 50 51 52 53
      </el-form-item>
    </el-form>

    <!-- 操作工具栏 -->
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
zhoutong's avatar
zhoutong committed
54
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['shipment:box:create:seaAir']">{{$t('出货安排')}}
wh's avatar
wh committed
55
        </el-button>
wh's avatar
wh committed
56 57
      </el-col>
      <el-col :span="1.5">
houjn@hikoon.cn's avatar
houjn@hikoon.cn committed
58
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" v-hasPermi="['shipment:box:export:seaAir']">{{$t('导出')}}
wh's avatar
wh committed
59
        </el-button>
wh's avatar
wh committed
60
      </el-col>
huhaiqing's avatar
huhaiqing committed
61
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
wh's avatar
wh committed
62 63 64 65
    </el-row>

    <!-- 列表 -->
    <el-table v-loading="loading" :data="list">
66
      <el-table-column :label="$t('自编号')" align="center" prop="selfNo">
zhoutong's avatar
zhoutong committed
67 68 69 70
        <template slot-scope="scope">
          <a href="javascript:void(0)" @click="handleCommand(scope.row, 'detail')">{{ scope.row.selfNo }}</a>
        </template>
      </el-table-column>
71 72
      <el-table-column :label="$t('柜号')" align="center" prop="cubNo" />
      <el-table-column :label="$t('柜型')" align="center" prop="cabinetId">
wanglianghe's avatar
wanglianghe committed
73 74
        <template slot-scope="scope">
          <span>{{ getCabinetName(scope.row.cabinetId) }}</span>
wh's avatar
wh committed
75 76
        </template>
      </el-table-column>
77
      <el-table-column :label="$t('运输方式')" align="center" prop="transportType">
wh's avatar
wh committed
78
        <template slot-scope="scope">
huhaiqing's avatar
huhaiqing committed
79
          <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="scope.row.transportType" />
wh's avatar
wh committed
80 81
        </template>
      </el-table-column>
wanglianghe's avatar
wanglianghe committed
82

83
      <el-table-column :label="$t('出货渠道')" align="center" prop="shippingChannelId">
wanglianghe's avatar
wanglianghe committed
84 85 86
        <template slot-scope="scope">
          <span>{{ getShipChannelName(scope.row.shippingChannelId) }}</span>
        </template>
wh's avatar
wh committed
87
      </el-table-column>
wanglianghe's avatar
wanglianghe committed
88

huhaiqing's avatar
huhaiqing committed
89
      <el-table-column :label="$t('方数') + '(' + $t('预装') + '/' + $t('已装') + ')'" align="center" prop="squareNumber">
zhoutong's avatar
zhoutong committed
90 91
        <template slot-scope="{ row }">
          {{ row.boxStatistics.volume }}/{{ row.boxStatistics.loadVolume }}
wanglianghe's avatar
wanglianghe committed
92 93
        </template>
      </el-table-column>
94
      <el-table-column :label="$t('重量')+'(' + $t('预装') + '/' + $t('已装' + ')')" align="center" prop="weight">
zhoutong's avatar
zhoutong committed
95 96
        <template slot-scope="{ row }">
          {{ row.boxStatistics.weight }}/{{ row.boxStatistics.loadWeight }}
zhoutong's avatar
zhoutong committed
97 98 99
        </template>
      </el-table-column>

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

huhaiqing's avatar
huhaiqing committed
102
      <el-table-column :label="$t('日期')" align="center" prop="createTime" width="180">
zhoutong's avatar
zhoutong committed
103
        <template slot-scope="scope">
huhaiqing's avatar
huhaiqing committed
104
          <span>{{ new Date(scope.row.createTime).format('yyyy-MM-dd hh:mm:ss') }}</span>
zhoutong's avatar
zhoutong committed
105
        </template>
wh's avatar
wh committed
106
      </el-table-column>
107
      <el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width" width="200px">
wh's avatar
wh committed
108
        <template slot-scope="scope">
109
          <el-dropdown trigger="click" v-hasPermi="['shipment:seaAir:action:edit','shipment:seaAir:action:sea','shipment:seaAir:action:error','shipment:seaAir:action:cost','shipment:seaAir:action:delete','shipment:seaAir:action:editLadingBill']" @command="(command)=>handleCommand(scope.row, command)" style="marginRight:10px;">
110
            <el-button type="primary">
111
              {{$t('操作')}}<i class="el-icon-arrow-down el-icon--right"></i>
112 113
            </el-button>
            <el-dropdown-menu slot="dropdown">
114 115 116 117 118 119
              <el-dropdown-item :disabled="scope.row.ldStatus>=46" command="edit" v-hasPermi="['shipment:seaAir:action:edit']">{{$t('编辑')}}</el-dropdown-item>
              <el-dropdown-item  command="seaAir" v-hasPermi="['shipment:seaAir:action:seaAir']">{{$t('海空联运')}}</el-dropdown-item>
              <el-dropdown-item command="error" v-hasPermi="['shipment:seaAir:action:error']">{{$t('异常登记')}}</el-dropdown-item>
              <el-dropdown-item command="cost" v-hasPermi="['shipment:seaAir:action:cost']">{{$t('费用登记')}}</el-dropdown-item>
              <el-dropdown-item command="delete" v-hasPermi="['shipment:seaAir:action:delete']">{{$t('删除')}}</el-dropdown-item>
              <el-dropdown-item :disabled="scope.row.ldStatus<46" command="editLadingBill" v-hasPermi="['shipment:seaAir:action:editLadingBill']">{{$t('编辑提货单')}}</el-dropdown-item>
120 121
            </el-dropdown-menu>
          </el-dropdown>
122
          <el-dropdown trigger="click" @command="(command)=>handleCommand(scope.row, command)" v-hasPermi="['shipment:seaAir:download:downloadPreloadGoodsList','shipment:seaAir:download:downloadLoadGoodsList','shipment:seaAir:download:downloadReceivableList','shipment:seaAir:download:downloadAgentListFiles','shipment:seaAir:download:downloadSoncapFiles','shipment:seaAir:download:zipDownload','shipment:seaAir:download:downloadLadingCopy']">
zhoutong's avatar
zhoutong committed
123
            <el-button type="primary">
124
              {{$t('下载')}}<i class="el-icon-arrow-down el-icon--right"></i>
zhoutong's avatar
zhoutong committed
125 126
            </el-button>
            <el-dropdown-menu slot="dropdown">
127 128 129 130 131 132 133
              <el-dropdown-item command="downloadPreloadGoodsList" v-hasPermi="['shipment:seaAir:download:downloadPreloadGoodsList']">{{$t('预装单')}}</el-dropdown-item>
              <el-dropdown-item command="downloadLoadGoodsList" v-hasPermi="['shipment:seaAir:download:downloadLoadGoodsList']">{{$t('已装单')}}</el-dropdown-item>
              <el-dropdown-item command="downloadReceivableList" v-hasPermi="['shipment:seaAir:download:downloadReceivableList']">{{$t('应收汇总表')}}</el-dropdown-item>
              <el-dropdown-item command="downloadAgentListFiles" v-hasPermi="['shipment:seaAir:download:downloadAgentListFiles']">agent list</el-dropdown-item>
              <el-dropdown-item command="downloadSoncapFiles" v-hasPermi="['shipment:seaAir:download:downloadSoncapFiles']">soncap</el-dropdown-item>
              <el-dropdown-item command="zipDownload" v-hasPermi="['shipment:seaAir:download:zipDownload']">{{$t('提货单')}}</el-dropdown-item>
              <el-dropdown-item command="downloadLadingCopy" v-hasPermi="['shipment:seaAir:download:downloadLadingCopy']">{{$t('提单Copy')}}</el-dropdown-item>
zhoutong's avatar
zhoutong committed
134 135
            </el-dropdown-menu>
          </el-dropdown>
wh's avatar
wh committed
136 137 138 139
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
140
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows" @pagination="getList" />
wh's avatar
wh committed
141 142

    <!-- 对话框(添加 / 修改) -->
huhaiqing's avatar
huhaiqing committed
143 144 145
    <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" />
zhoutong's avatar
zhoutong committed
146 147
      </template>
      <template v-if="dialogCfg.dialogType === 'cost'">
huhaiqing's avatar
huhaiqing committed
148
        <costForm v-if="dialogCfg.open" @closeDialog="closeDialog" :shipmentObj="currRow" />
zhoutong's avatar
zhoutong committed
149 150
      </template>
      <template v-if="dialogCfg.dialogType === 'error'">
huhaiqing's avatar
huhaiqing committed
151
        <regError v-if="dialogCfg.open" @closeDialog="closeDialog" :shipmentObj="currRow" :allUsers="allUsers" />
zhoutong's avatar
zhoutong committed
152
      </template>
huyf's avatar
huyf committed
153 154 155
      <template v-if="dialogCfg.dialogType === 'editLadingBill'">
        <ladingBill v-if="dialogCfg.open" @closeDialog="closeDialog" :shipmentObj="currRow" :getCabinetName="getCabinetName" />
      </template>
huhaiqing's avatar
huhaiqing committed
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
      <template v-if="dialogCfg.dialogType === 'notice'">
        <div class="notice-dialog">
          <div class="notice-title">{{$t('您有{cnt}个待处理出货操作,请尽快前往处理', {cnt: noticeList.length})}}</div>
          <el-table :data="noticeList" height="500px" border>
            <el-table-column :label="$t('自编号')" align="center" prop="selfNo" />
            <el-table-column :label="$t('类型')" align="center">
              <template slot-scope="scope">
                <dict-tag :type="DICT_TYPE.BOX_SHIPPING_NOTICE_TYPE" :value="String(scope.row.noticeType)" />
              </template>
            </el-table-column>
            <el-table-column :label="$t('预计时间')" align="center">
              <template slot-scope="scope">
                {{formatDate(scope.row.createTime)}}
              </template>
            </el-table-column>
            <el-table-column :label="$t('操作')" align="center" width="80">
              <template slot-scope="scope">
                <el-button type="text" @click="handleCommand(scope.row, 'handle')">{{$t('处理')}}</el-button>
              </template>
            </el-table-column>
          </el-table>
          <el-row class="operate-button">
            <el-button type="primary" @click="closeDialog">{{$t('关闭窗口')}}</el-button>
          </el-row>
        </div>

      </template>
wh's avatar
wh committed
183 184 185 186 187
    </el-dialog>
  </div>
</template>

<script>
zhoutong's avatar
zhoutong committed
188 189 190 191
import {
  deletebox,
  getbox,
  getboxPage,
huhaiqing's avatar
huhaiqing committed
192 193 194
  exportboxExcel,
  getNoticeList,
} from "@/api/ecw/box";
zhoutong's avatar
zhoutong committed
195 196 197 198 199
import {
  downloadFile,
  downloadFileByUrl,
  formatDate,
} from "./shippingSea/utils";
huhaiqing's avatar
huhaiqing committed
200 201 202 203 204 205
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
206
import ladingBill from "./ladingBill/index.vue";
huhaiqing's avatar
huhaiqing committed
207
import { listUser } from "@/api/system/user";
zhoutong's avatar
zhoutong committed
208 209

export default {
huhaiqing's avatar
huhaiqing committed
210
  name: "EcwBoxIndexseaair",
zhoutong's avatar
zhoutong committed
211 212 213
  components: {
    costForm,
    regError,
huyf's avatar
huyf committed
214 215
    editForm,
    ladingBill,
zhoutong's avatar
zhoutong committed
216 217 218 219
  },
  data() {
    return {
      dateTypes: [
huhaiqing's avatar
huhaiqing committed
220 221 222 223 224
        { 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("清关时间") },
wanglianghe's avatar
wanglianghe committed
225
        { value: "6", label: this.$t("卸柜时间") },
zhoutong's avatar
zhoutong committed
226 227 228 229 230 231 232 233 234 235 236 237
      ],
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 出货列表
      list: [],
      // 弹出层标题
huhaiqing's avatar
huhaiqing committed
238
      // 弹出类型
zhoutong's avatar
zhoutong committed
239
      dialogCfg: {
wh's avatar
wh committed
240
        title: "",
zhoutong's avatar
zhoutong committed
241 242
        dialogType: "",
        width: "600px",
wh's avatar
wh committed
243 244
        // 是否显示弹出层
        open: false,
zhoutong's avatar
zhoutong committed
245
        fullscreen: false,
wh's avatar
wh committed
246
      },
zhoutong's avatar
zhoutong committed
247 248 249 250 251
      // 当前行
      currRow: {},
      dateRangeCreateTime: [],
      // 查询参数
      queryParams: {
huhaiqing's avatar
huhaiqing committed
252
        page: 1,
253
        rows: 10,
wanglianghe's avatar
wanglianghe committed
254
      },
zhoutong's avatar
zhoutong committed
255 256 257
      cabinetList: [],
      channelList: [],
      warehouseList: [],
huhaiqing's avatar
huhaiqing committed
258 259 260 261 262
      transportTypes: [],
      // 通知列表
      noticeList: [],
      allUsers: [],
    };
zhoutong's avatar
zhoutong committed
263 264 265 266
  },
  computed: {
    exportWarehouseList() {
      return this.warehouseList.filter(
huhaiqing's avatar
huhaiqing committed
267 268
        (item) => item.tradeType == "2" || item.type == "3"
      );
zhoutong's avatar
zhoutong committed
269 270 271
    },
    importWarehouseList() {
      return this.warehouseList.filter(
huhaiqing's avatar
huhaiqing committed
272 273
        (item) => item.tradeType == "1" || item.type == "3"
      );
zhoutong's avatar
zhoutong committed
274 275 276 277
    },
    getCabinetName() {
      return (cabinetId) => {
        for (let index in this.cabinetList) {
huhaiqing's avatar
huhaiqing committed
278
          let cabinetItem = this.cabinetList[index];
zhoutong's avatar
zhoutong committed
279
          if (cabinetItem.id == cabinetId) {
huhaiqing's avatar
huhaiqing committed
280
            return cabinetItem.name;
wanglianghe's avatar
wanglianghe committed
281 282
          }
        }
huhaiqing's avatar
huhaiqing committed
283 284
        return "/";
      };
zhoutong's avatar
zhoutong committed
285
    },
wanglianghe's avatar
wanglianghe committed
286

zhoutong's avatar
zhoutong committed
287 288 289
    getShipChannelName() {
      return (shippingChannelId) => {
        for (let index in this.channelList) {
huhaiqing's avatar
huhaiqing committed
290
          let channelItem = this.channelList[index];
zhoutong's avatar
zhoutong committed
291
          if (channelItem.channelId == shippingChannelId) {
huhaiqing's avatar
huhaiqing committed
292
            return this.$l(channelItem, "name");
wanglianghe's avatar
wanglianghe committed
293 294
          }
        }
huhaiqing's avatar
huhaiqing committed
295 296 297
        return "/";
      };
    },
zhoutong's avatar
zhoutong committed
298 299
  },
  created() {
huhaiqing's avatar
huhaiqing committed
300 301 302 303 304 305 306 307 308 309
    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();
    this.queryNotice();
huhaiqing's avatar
huhaiqing committed
310 311 312 313 314
    // 用户
    listUser({ pageNo: "1", pageSize: "10000" }).then((res) => {
      const { data } = res;
      this.allUsers = data.list ?? [];
    });
zhoutong's avatar
zhoutong committed
315 316
  },
  methods: {
huhaiqing's avatar
huhaiqing committed
317
    formatDate,
zhoutong's avatar
zhoutong committed
318
    getChannelList() {
huhaiqing's avatar
huhaiqing committed
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333
      getChannelList().then((res) => (this.channelList = res.data));
    },
    queryNotice() {
      getNoticeList({
        transportTypeList: this.transportTypes.map((item) => item.value),
      }).then((res) => {
        const { data } = res;
        this.noticeList = data ?? [];
        if (data.length) {
          this.$set(this.dialogCfg, "title", this.$t("出货操作提醒"));
          this.$set(this.dialogCfg, "dialogType", "notice");
          this.$set(this.dialogCfg, "width", "650px");
          this.$set(this.dialogCfg, "open", true);
        }
      });
zhoutong's avatar
zhoutong committed
334 335 336
    },
    /** 查询列表 */
    getList() {
huhaiqing's avatar
huhaiqing committed
337
      this.loading = true;
zhoutong's avatar
zhoutong committed
338
      // 处理查询参数
huhaiqing's avatar
huhaiqing committed
339 340 341
      let params = { ...this.queryParams };
      params.transportType = 4;
      this.addBeginAndEndTime(params, this.dateRangeCreateTime, "createTime");
zhoutong's avatar
zhoutong committed
342 343
      // 执行查询
      getboxPage(params).then((response) => {
huhaiqing's avatar
huhaiqing committed
344 345 346 347
        this.list = response.data.list;
        this.total = response.data.total;
        this.loading = false;
      });
zhoutong's avatar
zhoutong committed
348 349 350
    },
    /** 搜索按钮操作 */
    handleQuery() {
huhaiqing's avatar
huhaiqing committed
351 352
      this.queryParams.page = 1;
      this.getList();
zhoutong's avatar
zhoutong committed
353 354 355
    },
    /** 重置按钮操作 */
    resetQuery() {
huhaiqing's avatar
huhaiqing committed
356 357 358 359 360 361 362
      this.queryParams = {};
      this.dateRangeCreateTime = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
    resetForm() {
      this.$refs["queryForm"].resetFields();
zhoutong's avatar
zhoutong committed
363 364 365
    },
    /** 新增按钮操作 */
    handleAdd() {
366
      this.$set(this.dialogCfg, "title", this.$t("添加出货"));
zhoutong's avatar
zhoutong committed
367 368 369 370
      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
371 372 373
      this.currRow = {
        transportType: "4",
      };
zhoutong's avatar
zhoutong committed
374 375 376 377 378 379
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      const id = row.id;
      getbox(id).then((response) => {
        this.currRow = response.data;
380
        this.$set(this.dialogCfg, "title", this.$t("修改出货"));
zhoutong's avatar
zhoutong committed
381 382 383
        this.$set(this.dialogCfg, "dialogType", "edit");
        this.$set(this.dialogCfg, "width", "600px");
        this.$set(this.dialogCfg, "open", true);
wh's avatar
wh committed
384 385
      });
    },
zhoutong's avatar
zhoutong committed
386 387
    /** 删除按钮操作 */
    handleDelete(row) {
huhaiqing's avatar
huhaiqing committed
388
      const id = row.id;
zhoutong's avatar
zhoutong committed
389
      this.$modal
huhaiqing's avatar
huhaiqing committed
390
        .confirm(this.$t("是否确认删除出货编号为{id}的数据项?", { id }))
zhoutong's avatar
zhoutong committed
391
        .then(function () {
huhaiqing's avatar
huhaiqing committed
392
          return deletebox(id);
zhoutong's avatar
zhoutong committed
393 394
        })
        .then(() => {
huhaiqing's avatar
huhaiqing committed
395 396
          this.getList();
          this.$modal.msgSuccess(this.$t("删除成功"));
zhoutong's avatar
zhoutong committed
397
        })
huhaiqing's avatar
huhaiqing committed
398
        .catch(() => {});
zhoutong's avatar
zhoutong committed
399 400 401 402
    },
    /** 导出按钮操作 */
    handleExport() {
      // 处理查询参数
huhaiqing's avatar
huhaiqing committed
403 404 405
      let params = { ...this.queryParams };
      params.page = undefined;
      params.pageSize = undefined;
huhaiqing's avatar
huhaiqing committed
406
      params.transportTypeList = ['4'];
huhaiqing's avatar
huhaiqing committed
407
      this.addBeginAndEndTime(params, this.dateRangeCreateTime, "createTime");
zhoutong's avatar
zhoutong committed
408 409
      // 执行导出
      this.$modal
huhaiqing's avatar
huhaiqing committed
410
        .confirm(this.$t("是否确认导出所有出货数据项?"))
zhoutong's avatar
zhoutong committed
411
        .then(() => {
huhaiqing's avatar
huhaiqing committed
412 413
          this.exportLoading = true;
          return exportboxExcel(params);
zhoutong's avatar
zhoutong committed
414 415
        })
        .then((response) => {
huhaiqing's avatar
huhaiqing committed
416
          this.$download.excel(response, this.$t("海空联运") + ".xls");
huhaiqing's avatar
huhaiqing committed
417
          this.exportLoading = false;
zhoutong's avatar
zhoutong committed
418
        })
huhaiqing's avatar
huhaiqing committed
419 420 421 422 423 424 425 426
        .catch(() => {});
    },
    /* 关闭弹窗 */
    closeDialog(type) {
      this.$set(this.dialogCfg, "open", false);
      if (type === "add" || type === "edit") {
        this.getList();
      }
zhoutong's avatar
zhoutong committed
427 428 429 430 431
    },
    /** 查看按钮操作 */
    handleCommand(row, command) {
      this.$set(this.dialogCfg, "fullscreen", false);
      switch (command) {
huhaiqing's avatar
huhaiqing committed
432 433 434
        case "seaAir":
          this.$router.push("/boxSeaAir/shippingSeaAir/" + row.id);
          break;
zhoutong's avatar
zhoutong committed
435

zhoutong's avatar
zhoutong committed
436
        case "detail":
huhaiqing's avatar
huhaiqing committed
437
          this.$router.push("/boxSeaAir/query/" + row.id);
zhoutong's avatar
zhoutong committed
438 439
          break;

huhaiqing's avatar
huhaiqing committed
440 441 442
        case "edit":
          this.handleUpdate(row);
          break;
zhoutong's avatar
zhoutong committed
443

huhaiqing's avatar
huhaiqing committed
444 445 446
        case "delete":
          this.handleDelete(row);
          break;
zhoutong's avatar
zhoutong committed
447

huyf's avatar
huyf committed
448
        case "editLadingBill":
huhaiqing's avatar
huhaiqing committed
449 450 451 452
          const cabinetLabel = this.getCabinetName(row.cabinetId);
          const title = this.$t(
            "查看提单 {selfNo} 柜号:{cubNo} 柜型:{cabinetLabel}",
            {
453 454
              selfNo: row.selfNo,
              cubNo: row.cubNo,
huhaiqing's avatar
huhaiqing committed
455 456 457 458 459 460 461 462 463 464
              cabinetLabel: cabinetLabel,
            }
          );
          this.$set(this.dialogCfg, "title", title);
          this.$set(this.dialogCfg, "fullscreen", true);
          break;

        case "cost":
          this.$set(this.dialogCfg, "title", this.$t("费用登记"));
          break;
huyf's avatar
huyf committed
465

huhaiqing's avatar
huhaiqing committed
466 467 468
        case "error":
          this.$set(this.dialogCfg, "title", this.$t("异常登记"));
          break;
zhoutong's avatar
zhoutong committed
469

zhoutong's avatar
zhoutong committed
470 471 472 473
        case "downloadPreloadGoodsList":
          downloadFile(
            command,
            { shipmentId: row.id },
huhaiqing's avatar
huhaiqing committed
474
            this.$t("预装单") + `(${row.selfNo}).xlsx`,
zhoutong's avatar
zhoutong committed
475 476 477 478 479 480 481
            "xlsx"
          );
          break;
        case "downloadLoadGoodsList":
          downloadFile(
            command,
            { shipmentId: row.id },
huhaiqing's avatar
huhaiqing committed
482
            this.$t("已装单") + `(${row.selfNo}).xlsx`,
zhoutong's avatar
zhoutong committed
483 484 485 486 487 488 489
            "xlsx"
          );
          break;
        case "downloadReceivableList":
          downloadFile(
            command,
            { shipmentId: row.id },
huhaiqing's avatar
huhaiqing committed
490
            this.$t("应收汇总表") + `(${row.selfNo}).xlsx`,
zhoutong's avatar
zhoutong committed
491 492 493 494 495 496 497
            "xlsx"
          );
          break;
        case "zipDownload":
          downloadFile(
            command,
            { shipmentId: row.id },
huhaiqing's avatar
huhaiqing committed
498
            this.$t("提货单") + `(${row.selfNo}).zip`,
zhoutong's avatar
zhoutong committed
499 500 501 502 503 504 505 506
            "zip"
          );
          break;
        case "downloadAgentListFiles":
        case "downloadSoncapFiles":
        case "downloadLadingCopy":
          downloadFileByUrl(command, { shipmentId: row.id });
          break;
huhaiqing's avatar
huhaiqing committed
507 508 509 510 511 512 513 514 515 516
        case "handle":
          const { noticeType } = row;
          if ([1, 2, 3, 4, 8].includes(noticeType)) {
            this.$router.push("/boxSeaAir/shippingSeaAir/" + row.id);
          }
          if ([5, 6, 7].includes(noticeType)) {
            this.$router.push("/boxSeaAir/query/" + row.id);
          }
          this.closeDialog();
          break;
zhoutong's avatar
zhoutong committed
517
      }
huhaiqing's avatar
huhaiqing committed
518

zhoutong's avatar
zhoutong committed
519 520
      if (["editLadingBill", "cost", "error"].includes(command)) {
        this.currRow = row;
huhaiqing's avatar
huhaiqing committed
521
        this.currRow.bosType = "seaAir";
zhoutong's avatar
zhoutong committed
522 523 524 525
        this.$set(this.dialogCfg, "dialogType", command);
        this.$set(this.dialogCfg, "width", "600px");
        this.$set(this.dialogCfg, "open", true);
      }
huhaiqing's avatar
huhaiqing committed
526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545
    },
    /* 分页 */
    pageChange(page) {
      this.pageParam.page = page;
      this.getList();
    },
  },
};
</script>

<style lang="scss" scoped>
.notice-dialog {
  ::v-deep .notice-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
  }
  ::v-deep .operate-button {
    margin-top: 10px;
    text-align: center;
zhoutong's avatar
zhoutong committed
546 547
  }
}
huhaiqing's avatar
huhaiqing committed
548
</style>