index.vue 30.2 KB
Newer Older
ylpmty's avatar
ylpmty committed
1 2 3 4
<template>
  <div class="app-container">

    <!-- 搜索工作栏 -->
5
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
dragondean@qq.com's avatar
dragondean@qq.com committed
6 7
      <el-form-item :label="$t('编号')" prop="orderNo">
        <el-input v-model="queryParams.numberKey" :placeholder="$t('请输入订单号、唛头、提单号')" clearable @keyup.enter.native="handleQuery" />
ylpmty's avatar
ylpmty committed
8
      </el-form-item>
9
      <!-- <el-form-item label="唛头" prop="marks">
10
        <el-input v-model="queryParams.marks" placeholder="唛头" clearable @keyup.enter.native="handleQuery" />
11
      </el-form-item> -->
12

dragondean@qq.com's avatar
dragondean@qq.com committed
13 14
      <el-form-item :label="$t('发货人')" prop="consignorKey">
        <el-input v-model="queryParams.consignorKey" :placeholder="$t('发货人')" clearable @keyup.enter.native="handleQuery" />
15
      </el-form-item>
dragondean@qq.com's avatar
dragondean@qq.com committed
16 17
      <el-form-item :label="$t('收货人')" prop="consigneeKey">
        <el-input v-model="queryParams.consigneeKey" :placeholder="$t('收货人')" clearable @keyup.enter.native="handleQuery" />
18
      </el-form-item>
19 20
      <el-form-item label="">
        <dict-selector :type="DICT_TYPE.ECW_BEGINTIME_TYPE_ENDTIME" v-model="dateFilterType" defaultable style="width: 150px; margin-right: 5px" />
21
        <el-date-picker v-model="dateFilter"
我在何方's avatar
我在何方 committed
22
          type="daterange" range-separator="-"
23 24 25 26 27 28
          :start-placeholder="$t('开始日期')"
          :end-placeholder="$t('结束日期')"
          value-format="yyyy-MM-dd HH:mm:ss"
          @change="handleQuery"
          >
          </el-date-picker>
ylpmty's avatar
ylpmty committed
29
      </el-form-item>
30 31 32
      <el-form-item :label="$t('始发仓')" prop="startWarehouseId">
        <el-select v-model="queryParams.startWarehouseId" :placeholder="$t('请选择始发仓')" clearable @change="handleQuery">
          <el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
33 34
        </el-select>
      </el-form-item>
35 36 37
      <el-form-item :label="$t('目的仓')" prop="destWarehouseId">
        <el-select v-model="queryParams.destWarehouseId" :placeholder="$t('请选择目的仓')" clearable @change="handleQuery">
          <el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
38 39 40
        </el-select>
      </el-form-item>

dragondean@qq.com's avatar
dragondean@qq.com committed
41
      <el-form-item :label="$t('运输方式')" prop="transportId" v-if="!transportId">
42
        <dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model.number="queryParams.transportId" clearable @change="handleQuery"/>
43 44
      </el-form-item>

45
      <!-- <el-form-item label="商品分类" prop="goodsType">
46 47 48 49 50 51 52 53 54
        <selector v-model="queryParams.goodsType" :options="productAttrList" label-field="attrName" value-field="id">
        </selector>
      </el-form-item>
      <el-form-item label="品名" prop="prodId">
        <product-selector v-model="queryParams.prodId" @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="品牌" prop="brand">
        <dict-selector v-model="queryParams.brand" :type="DICT_TYPE.ECW_IS_BRAND" formatter="bool" clearable
          @keyup.enter.native="handleQuery" />
55 56
      </el-form-item> -->

57 58
      <el-form-item :label="$t('商品')" prop="tidanNo">
        <el-input v-model="queryParams.prodKey" :placeholder="$t('请输入商品类型、品名或品牌')" clearable @keyup.enter.native="handleQuery" />
59 60
      </el-form-item>

61
      <el-form-item :label="$t('控货')" prop="isCargoControl">
dragondean@qq.com's avatar
dragondean@qq.com committed
62
        <dict-selector v-model="queryParams.isCargoControl" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" fomatter="bool" clearable />
63
      </el-form-item>
64
      <el-form-item :label="$t('入仓类型')" prop="warehouseType">
dragondean@qq.com's avatar
dragondean@qq.com committed
65
        <dict-selector :type="DICT_TYPE.ECW_WAREHOUSING_TYPE" v-model="queryParams.warehousingType"  clearable/>
66
      </el-form-item>
67
      <el-form-item :label="$t('客户经理')" >
68
        <user-selector v-model="queryParams.salesmanId" clearable @change="handleQuery"/>
ylpmty's avatar
ylpmty committed
69
      </el-form-item>
70
      <el-form-item :label="$t('订单状态')" prop="status">
71
        <dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status"
dragondean@qq.com's avatar
dragondean@qq.com committed
72
          @keyup.enter.native="handleQuery" clearable />
73
      </el-form-item>
74
      <el-form-item :label="$t('报关方式')" prop="customsType">
75
        <dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="queryParams.customsType" clearable @change="handleQuery" />
76
      </el-form-item>
77
      <el-form-item :label="$t('是否齐货')" >
78
        <!--// 字段存疑-->
79
        <dict-selector v-model="queryParams.isNeat" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" fomatter="bool"  clearable @change="handleQuery"/>
ylpmty's avatar
ylpmty committed
80
      </el-form-item>
81
      <!-- <el-form-item label="重货比" prop="weightRatio">
82 83 84 85 86
        <el-input style="width: 100px;" v-model="molecule" placeholder="" clearable @change="moleculeChange"
          @keyup.enter.native="handleQuery" />
        -
        <el-input style="width: 100px;" v-model="denominator" placeholder="" clearable @change="denominatorChange"
          @keyup.enter.native="handleQuery" />
87
      </el-form-item> -->
88
      <el-form-item :label="$t('备案属性')" prop="productRecord">
89
        <dict-selector :type="DICT_TYPE.PRODUCT_RECORD_ATTRIBUTE" v-model="queryParams.productRecord" clearable @change="handleQuery" />
90
      </el-form-item>
91 92
      <el-form-item :label="$t('快递单号')" prop="number">
        <el-input v-model="queryParams.number" :placeholder="$t('快递单号')" clearable @keyup.enter.native="handleQuery" />
ylpmty's avatar
ylpmty committed
93
      </el-form-item>
dragondean@qq.com's avatar
dragondean@qq.com committed
94 95 96 97 98 99
      <el-form-item :label="$t('外部仓')" prop="number">
        <el-select v-model="queryParams.isExternalWarehouse" :placeholder="$t('请选择')" clearable @change="handleQuery">
          <el-option :label="$t('外部仓')" :value="1"></el-option>
          <el-option :label="$t('自有仓')" :value="0"></el-option>
        </el-select>
      </el-form-item>
ylpmty's avatar
ylpmty committed
100 101

      <el-form-item>
102 103
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
        <el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
ylpmty's avatar
ylpmty committed
104 105 106 107 108 109 110
      </el-form-item>
    </el-form>

    <!-- 操作工具栏 -->
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
111
          v-hasPermi="['ecw:order:create']">{{$t('新增')}}</el-button>
ylpmty's avatar
ylpmty committed
112 113
      </el-col>
      <el-col :span="1.5">
dcy's avatar
dcy committed
114 115
<!--        <el-button type="primary" plain icon="el-icon-setting" size="mini" @click="handleEdit" :disabled="!batchWarehouseAdjustment">{{$t('批量调仓')}}-->
<!--        </el-button>-->
116
        <el-button type="primary" plain icon="el-icon-setting" size="mini" @click="showBatchPickup=true">{{$t('批量提货')}}</el-button>
117 118 119
      </el-col>
      <el-col :span="1.5">
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
120
          :loading="exportLoading" v-hasPermi="['ecw:order:export']">{{$t('导出')}}</el-button>
ylpmty's avatar
ylpmty committed
121 122 123 124 125
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <!-- 列表 -->
126 127
    <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
ylpmty's avatar
ylpmty committed
128

129
      <el-table-column :label="$t('订单编号')" width="120px" align="center" prop="orderNo" >
ylpmty's avatar
ylpmty committed
130 131 132 133
        <template slot-scope="scope">
          <router-link :to="{path: '/order/detail',query: {orderId: scope.row.orderId}}" class="link-type">
            <span>{{ scope.row.orderNo }}</span>
          </router-link>
dcy's avatar
dcy committed
134 135 136
          <div style="display: flex;flex-wrap: wrap;">
            <el-button @click="deleteSpecial(item.value,scope.row.orderId)" size="mini" style="margin-left: 20px" type="danger" circle v-for="(item,index) in specialRendering(scope.row.advanceType)" :key="index">{{item.label[0]}}</el-button>
          </div>
ylpmty's avatar
ylpmty committed
137 138
        </template>
      </el-table-column>
139 140
      <el-table-column :label="$t('唛头')" align="center" prop="marks" />
      <el-table-column :label="$t('总箱数/入仓箱数')" align="center" prop="sumNum">
dragondean@qq.com's avatar
dragondean@qq.com committed
141
        <template slot-scope="{row}">
dragondean@qq.com's avatar
dragondean@qq.com committed
142 143
          <div :style="{color:row.customsType != 1 ? 'red' : null}">{{row.totalNum}}{{$t('')}}/{{row.sumNum}}{{$t('')}}</div>
          <dict-tag v-if="row.customsType != 1" style="color:red" :type="DICT_TYPE.ECW_CUSTOMS_TYPE" :value="row.customsType"></dict-tag>
dragondean@qq.com's avatar
dragondean@qq.com committed
144
        </template>
145
      </el-table-column>
146
      <el-table-column :label="$t('体积/重量')" align="center" prop="sumWeight">
dragondean@qq.com's avatar
dragondean@qq.com committed
147 148
        <template slot-scope="{row}">
          <!--入仓前是填单数据,入仓后是入仓数据-->
149 150
          <template v-if="row.inWarehouseState <= 1">{{row.costVO.totalVolume}}m³ /{{row.costVO.totalWeight}}Kg</template>
          <template v-else>{{row.sumVolume}}m³ /{{row.sumWeight}}Kg</template>
dragondean@qq.com's avatar
dragondean@qq.com committed
151
        </template>
152
      </el-table-column>
153
      <el-table-column :label="$t('始发仓')" align="center" prop="startWarehouseName">
dragondean@qq.com's avatar
dragondean@qq.com committed
154
        <template slot-scope="{row}">
155
          {{row.startWarehouseName}}
156
          <span style="color:red" v-if="row.isExternalWarehouse">({{$t('外部仓')}})</span>
dragondean@qq.com's avatar
dragondean@qq.com committed
157 158
        </template>
      </el-table-column>
159
      <el-table-column :label="$t('运输方式/目的地')" align="center" prop="transportId">
160
        <template slot-scope="{row}">
161
          <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportId" /> / {{row.dstWarehouseName}}
162 163
        </template>
      </el-table-column>
164
      <el-table-column :label="$t('控货')" align="center" prop="transportId">
165 166
        <template slot-scope="{row}">
          <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="row.isCargoControl" />
ylpmty's avatar
ylpmty committed
167 168
        </template>
      </el-table-column>
169
      <el-table-column :label="$t('订单状态')" align="center" prop="status">
ylpmty's avatar
ylpmty committed
170
        <template slot-scope="scope">
dragondean@qq.com's avatar
dragondean@qq.com committed
171 172
          <!-- <dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="scope.row.status" /> -->
          {{scope.row.statusMsg}}
ylpmty's avatar
ylpmty committed
173 174
        </template>
      </el-table-column>
dcy's avatar
dcy committed
175

176
      <el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width actions" width="150px">
ylpmty's avatar
ylpmty committed
177
        <template slot-scope="scope">
dragondean@qq.com's avatar
dragondean@qq.com committed
178 179 180 181 182 183
          <!-- 已删除的订单只需要删除和查看 https://zentao.jdshangmen.com/bug-view-684.html -->
          <template v-if="scope.row.status == 88">
            <el-button type="text" @click.native="oprateOrder(scope.row.orderId, 'deleteOrder')" v-hasPermi="['ecw:order:delete']" >{{$t('删除')}}</el-button>
          </template>
          <template v-else>
            <!--操作相关的-->
dragondean@qq.com's avatar
dragondean@qq.com committed
184
            <el-dropdown>
dragondean@qq.com's avatar
dragondean@qq.com committed
185 186 187 188
              <el-button type="text">{{$t('操作')}}</el-button>
              <el-dropdown-menu slot="dropdown">
                <!-- 编辑 -->
                <template v-if="
dragondean@qq.com's avatar
dragondean@qq.com committed
189
                  ( scope.row.status < 12 || (scope.row.status == 12 && scope.row.shipmentState == 314) ) && !scope.row.abnormalState && exclude(scope.row.inWarehouseState, [204,205,206])
dragondean@qq.com's avatar
dragondean@qq.com committed
190 191 192
                  ">
                  <el-dropdown-item @click.native="handleUpdate(scope.row)" v-hasPermi="['ecw:order:update']" >{{$t('编辑')}}</el-dropdown-item>
                </template>
193

dragondean@qq.com's avatar
dragondean@qq.com committed
194
                <!-- 删除 -->
195
                <template v-if="include(scope.row.status, [0,2, 88])">
dragondean@qq.com's avatar
dragondean@qq.com committed
196 197
                  <el-dropdown-item @click.native="oprateOrder(scope.row.orderId, 'deleteOrder')" v-hasPermi="['ecw:order:delete']" >{{$t('删除')}}</el-dropdown-item>
                </template>
198

dragondean@qq.com's avatar
dragondean@qq.com committed
199 200 201 202
                <!-- 取消 -->
                <template v-if="include(scope.row.status, [2])">
                  <el-dropdown-item @click.native="oprateOrder(scope.row.orderId, 'cancelOrder')" >{{$t('取消订单')}}</el-dropdown-item>
                </template>
203

dragondean@qq.com's avatar
dragondean@qq.com committed
204 205
                <!-- 恢复 -->
                <!-- <el-dropdown-item @click.native="oprateOrder(scope.row.orderId, 'recoveryOrder')" >{{$t('恢复订单')}}</el-dropdown-item>-->
dcy's avatar
dcy committed
206

dragondean@qq.com's avatar
dragondean@qq.com committed
207 208
                <!-- 费用申请 -->
                <template v-if="
dragondean@qq.com's avatar
dragondean@qq.com committed
209
                  exclude(scope.row.status, [0, 88]) && !scope.row.abnormalState && exclude(scope.row.inWarehouseState, [204,205,206])
dragondean@qq.com's avatar
dragondean@qq.com committed
210 211 212
                  ">
                  <el-dropdown-item @click.native="feeApplicationBol = true; orderId = scope.row.orderId"  >{{$t('费用申请')}}</el-dropdown-item>
                </template>
213

dragondean@qq.com's avatar
dragondean@qq.com committed
214 215
                <!-- 特需,互斥,关联 -->
                <template v-if="
216
                  include(scope.row.status, [2,3,5,8,9,10]) &&
dragondean@qq.com's avatar
dragondean@qq.com committed
217 218 219 220 221 222 223
                  exclude(scope.row.abnormalState, [1 ,99 ,2 ,3 ,4 ,9 ,10 ,11 ,12 ,14]) &&
                  exclude(scope.row.inWarehouseState, [204])
                  ">
                  <el-dropdown-item @click.native="orderId = scope.row.orderId;orderNo = scope.row.orderNo;isShow = true" >{{$t('特需')}}</el-dropdown-item>
                  <el-dropdown-item @click.native="$router.push(`/order/associated-order/${scope.row.orderId}`)"          >{{$t('关联')}}</el-dropdown-item>
                  <el-dropdown-item @click.native="$router.push(`/order/mutex-order/${scope.row.orderId}`)"               >{{$t('互斥')}}</el-dropdown-item>
                </template>
224

dragondean@qq.com's avatar
dragondean@qq.com committed
225 226 227
                <!-- 特价 -->
                <template v-if="
                  exclude(scope.row.status, [0]) &&
dragondean@qq.com's avatar
dragondean@qq.com committed
228 229
                  exclude(scope.row.abnormalState, [1 ,99 ,2 ,3 ,4 ,9 ,10 ,11 ,12 ,14]) &&
                  exclude(scope.row.inWarehouseState, [204,205,206])
dragondean@qq.com's avatar
dragondean@qq.com committed
230 231 232
                  ">
                  <el-dropdown-item @click.native="$router.push('/order/special/' + scope.row.orderId)" v-hasPermi="['ecw:order:update']" >{{$t('特价')}}</el-dropdown-item>
                </template>
dcy's avatar
dcy committed
233

dragondean@qq.com's avatar
dragondean@qq.com committed
234 235
                <!-- 确认提货 -->
                <template v-if="
236
                  scope.row.status >= 5 &&
dragondean@qq.com's avatar
dragondean@qq.com committed
237 238
                  !scope.row.abnormalState &&
                  exclude(scope.row.inWarehouseState, [204,205,206])
dragondean@qq.com's avatar
dragondean@qq.com committed
239 240 241
                  ">
                  <el-dropdown-item @click.native="$router.push(`/order/release?orderId=${scope.row.orderId}`)" >{{$t('确认提货')}}</el-dropdown-item>
                </template>
242

dragondean@qq.com's avatar
dragondean@qq.com committed
243
                <!-- 合单,拆单 -->
dragondean@qq.com's avatar
dragondean@qq.com committed
244
                <template v-if=" (scope.row.status < 12 || (scope.row.status == 12 && scope.row.shipmentState == 314)) && !scope.row.abnormalState && scope.row.status > 3 && exclude(scope.row.inWarehouseState, [204,205,206])">
dragondean@qq.com's avatar
dragondean@qq.com committed
245 246 247
                  <el-dropdown-item @click.native="$router.push(`/order/singleApply?orderNo=${scope.row.orderNo}`)" >{{$t('合单申请')}}</el-dropdown-item>
                  <el-dropdown-item @click.native="$router.push(`/order/splitApply?orderId=${scope.row.orderId}`)"  >{{$t('拆单申请')}}</el-dropdown-item>
                </template>
248

dragondean@qq.com's avatar
dragondean@qq.com committed
249
                <!-- 合单日志,提货日志 -->
dragondean@qq.com's avatar
dragondean@qq.com committed
250 251 252 253 254
                <template v-if="(
                  scope.row.status > 2 &&
                  exclude(scope.row.status + '-' + scope.row.shipmentState, ['17-391', '18-392', '15-332', '15-330']) &&
                  exclude(scope.row.status + '-' + scope.row.inWarehouseState, ['16-202'])
                )">
dragondean@qq.com's avatar
dragondean@qq.com committed
255 256 257 258 259
                  <el-dropdown-item @click.native="showMergedLogOrderNo=scope.row.orderNo" >{{$t('合单日志')}}</el-dropdown-item>
                  <el-dropdown-item @click.native="showPickupLogOrderNo=scope.row.orderNo" >{{$t('提货日志')}}</el-dropdown-item>
                </template>
              </el-dropdown-menu>
            </el-dropdown>
260

261 262
            <template v-if="scope.row.status != 0 && [204,205,206].indexOf(scope.row.inWarehouseState) < 0">
              <!-- <el-divider direction="vertical"></el-divider> -->
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
              <!--仓库相关的-->
              <el-dropdown>
                <el-button type="text">{{$t('仓库')}}</el-button>
                <el-dropdown-menu slot="dropdown">
                  <!-- 入仓操作 -->
                  <template v-if="include(scope.row.status, [0,2]) || include(scope.row.abnormalState, [1]) || scope.row.inWarehouseState == 208">
                    <el-dropdown-item @click.native="$router.push('/order/warehousing?id=' + scope.row.orderId)" v-hasPermi="['ecw:order:update']">{{$t('入仓操作')}}</el-dropdown-item>
                  </template>
                  <!-- 入仓补充 -->
                  <template v-if="
                    include(scope.row.inWarehouseState, [201,202, 202, 210, 202, 211, 202, 213, 214, 215, 216]) &&
                    scope.row.abnormalState != 1 &&
                    include(scope.row.status, [2,3,5,10,9,8])
                    ">
                    <el-dropdown-item @click.native="$router.push('/order/warehousing-add?id=' + scope.row.orderId)" v-hasPermi="['ecw:order:update']">{{$t('入仓补充')}}</el-dropdown-item>
                  </template>
                  <!-- 入仓修改 -->
                  <template v-if="
                      include(scope.row.inWarehouseState, [202, 207, 202, 209, 210, 202, 211, 212, 202, 213, 214, 215, 216, 204, 205])
                    ">
                    <el-dropdown-item @click.native="$router.push('/order/warehousing-update?id=' + scope.row.orderId)"  v-hasPermi="['ecw:order:update']">{{$t('入仓修改')}}</el-dropdown-item>
                  </template>
285

286 287 288 289 290 291 292 293 294 295
                  <!-- 退仓 -->
                  <template v-if="
                      (
                        include(scope.row.inWarehouseState, [202, 210, 211, 213, 214, 215, 216]) &&
                        exclude(scope.row.abnormalState, [1])
                      ) ||
                      include(scope.row.status, [16])
                    ">
                    <el-dropdown-item @click.native="show = true;orderId = scope.row.orderId; " v-hasPermi="['ecw:order:update']">{{$t('退仓')}}</el-dropdown-item>
                  </template>
296 297


298 299 300 301 302 303 304
                  <!-- 调仓 -->
                  <template v-if="
                      include(scope.row.inWarehouseState, [202, 207, 209, 210, 202, 211, 212, 215, 216, 218]) ||
                      (include(scope.row.status, [16]) && exclude(scope.row.inWarehouseState, [213,214]))
                    ">
                    <el-dropdown-item @click.native="orderId = scope.row.orderId;warehouseBol=true;" >{{$t('调仓')}}</el-dropdown-item>
                  </template>
dcy's avatar
dcy committed
305

306 307 308 309 310 311
                  <!-- 取消调仓 -->
                  <!-- <template v-if="
                      include(scope.row.inWarehouseState, [212,213,214])
                    ">
                    <el-dropdown-item @click.native="$alert('// TODO')" >{{$t('取消调仓')}}</el-dropdown-item>
                  </template> -->
312

313 314 315 316 317 318
                  <!-- 调拨出仓 -->
                  <template v-if="
                      include(scope.row.inWarehouseState, [213])
                    ">
                    <el-dropdown-item @click.native="$router.push({path:'/order/transfer-warehousing/' + scope.row.orderId + '/'  + 1 })"  >{{$t('调拨出仓')}}</el-dropdown-item>
                  </template>
319

320 321 322 323 324 325
                  <!-- 调拨到仓 -->
                  <template v-if="
                      include(scope.row.inWarehouseState, [214])
                    ">
                    <el-dropdown-item @click.native="$router.push({path:'/order/transfer-to-warehouse/' + scope.row.orderId + '/'  + 2 })" >{{$t('调拨到仓')}}</el-dropdown-item>
                  </template>
326

327 328 329
                </el-dropdown-menu>
              </el-dropdown>
            </template>
330

331
            <!-- <el-divider direction="vertical" v-if="scope.row.status != 0"></el-divider> -->
dragondean@qq.com's avatar
dragondean@qq.com committed
332
            <!--打印相关的-->
333
            <el-dropdown v-if="scope.row.status != 0">
dragondean@qq.com's avatar
dragondean@qq.com committed
334 335 336 337 338 339 340 341 342 343
              <el-button type="text">{{$t('打印')}}</el-button>
              <el-dropdown-menu slot="dropdown">
                <!-- 打印标签 -->
                <template v-if="
                  exclude(scope.row.status, [0]) &&
                  exclude(scope.row.shipmentState, [320,322,323]) &&
                  exclude(scope.row.abnormalState, [5,6,7,8])
                ">
                  <el-dropdown-item @click.native="printTagOrderId=scope.row.orderId">{{$t('打印标签')}}</el-dropdown-item>
                </template>
dcy's avatar
dcy committed
344

dragondean@qq.com's avatar
dragondean@qq.com committed
345 346 347 348 349 350 351 352
                <!-- 打印入仓单 -->
                <template v-if="
                  exclude(scope.row.status, [0, 2]) &&
                  exclude(scope.row.shipmentState, [320,322,323]) &&
                  exclude(scope.row.abnormalState, [1, 5,6,7,8])
                ">
                  <el-dropdown-item @click.native="printWarehouseReceiptOrderId=scope.row.orderId">{{$t('打印入仓单')}}</el-dropdown-item>
                </template>
353

dragondean@qq.com's avatar
dragondean@qq.com committed
354 355 356 357 358
                <!-- 打印提单 -->
                <el-dropdown-item @click.native="printLadingBillOrderId=scope.row.orderId" :disabled="!scope.row.tidanNo">{{$t('打印提单')}}</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </template>
ylpmty's avatar
ylpmty committed
359
        </template>
dcy's avatar
dcy committed
360

ylpmty's avatar
ylpmty committed
361 362 363
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
364
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows"
365
      @pagination="getList" />
ylpmty's avatar
ylpmty committed
366

我在何方's avatar
我在何方 committed
367
    <special-needs :orderNo="orderNo" :show.sync="isShow" :currency="JSON.stringify(currencyList)" :order-id="orderId" @determine="getList" ></special-needs>
dragondean@qq.com's avatar
dragondean@qq.com committed
368
    <print-tag v-if="printTagOrderId !== null" :order-id="printTagOrderId" @close="printTagOrderId=null" />
dragondean@qq.com's avatar
dragondean@qq.com committed
369
    <print-warehouse-receipt v-if="printWarehouseReceiptOrderId !== null" :order-id="printWarehouseReceiptOrderId" @close="printWarehouseReceiptOrderId=null" />
370
    <print-lading-bill v-if="printLadingBillOrderId !== null" :order-id="printLadingBillOrderId" @close="printLadingBillOrderId=null" />
371
    <batch-pickup v-if="showBatchPickup" @close="onBatchClose" @success="onBatchClose"/>
372
    <withdrawal v-if="show" :dialog-visible="show"  :orderId="orderId" ></withdrawal>
373
    <batch-single-application :order-list="orderId" :dialog-visible.sync="warehouseBol"></batch-single-application>
我在何方's avatar
我在何方 committed
374
    <fee-application :order-id="orderId" :currencys="JSON.stringify(currencyList)" :dialog-visible.sync="feeApplicationBol"></fee-application>
dragondean@qq.com's avatar
dragondean@qq.com committed
375
    <merge-log :order-no="showMergedLogOrderNo" v-if="showMergedLogOrderNo !== null" @close="showMergedLogOrderNo=null" />
376
    <pickup-log v-if="showPickupLogOrderNo" :order-no="showPickupLogOrderNo" @close="showPickupLogOrderNo=null" @delete="getList" />
ylpmty's avatar
ylpmty committed
377 378 379 380
  </div>
</template>

<script>
381 382 383 384
import Selector from '@/components/Selector'
import ProductSelector from '@/components/ProductSelector'
import { getProductAttrList } from '@/api/ecw/productAttr'
import CustomerSelector from '@/components/CustomerSelector'
385
import specialNeeds from '@/views/ecw/order/components/specialNeeds';
386
import { getTradeCityList } from '@/api/ecw/region'
dcy's avatar
dcy committed
387 388 389 390 391 392 393
import {
  createOrder,
  updateOrder,
  deleteOrder,
  getOrder,
  getOrderPage,
  exportOrderExcel,
394 395
  orderSpecialNeed,
  cancelOrder,
396 397
  recoveryOrder,
  getMyOrderPage
dcy's avatar
dcy committed
398
} from "@/api/ecw/order";
399
/* import { getDictDatas, DICT_TYPE } from '@/utils/dict'; */
dragondean@qq.com's avatar
dragondean@qq.com committed
400
import PrintTag from './components/PrintTag'
dragondean@qq.com's avatar
dragondean@qq.com committed
401 402
import PrintWarehouseReceipt from './components/PrintWarehouseReceipt'
import PrintLadingBill from './components/PrintLadingBill'
dragondean@qq.com's avatar
dragondean@qq.com committed
403
import BatchPickup from './components/BatchPickup'
404
import withdrawal from "@/views/ecw/order/withdrawal";
405
import UserSelector from '@/components/UserSelector'
406 407
import BatchSingleApplication from "@/views/ecw/order/batchSingleApplication";
import FeeApplication from "@/views/ecw/order/feeApplication";
dragondean@qq.com's avatar
dragondean@qq.com committed
408
import MergeLog from '@/views/ecw/order/components/MergeLog'
dragondean@qq.com's avatar
dragondean@qq.com committed
409
import PickupLog from './components/PickupLog'
410
import {getWarehouseList} from '@/api/ecw/warehouse'
我在何方's avatar
我在何方 committed
411
import { getCurrencyPage } from "@/api/ecw/currency";
ylpmty's avatar
ylpmty committed
412
export default {
dragondean@qq.com's avatar
dragondean@qq.com committed
413
  name: "EcwOrderIndex",
ylpmty's avatar
ylpmty committed
414
  components: {
415
    UserSelector,
416 417
    FeeApplication,
    BatchSingleApplication,
dragondean@qq.com's avatar
dragondean@qq.com committed
418
    MergeLog,
dragondean@qq.com's avatar
dragondean@qq.com committed
419
    PickupLog,
420
    CustomerSelector, ProductSelector, Selector,specialNeeds,PrintTag, PrintWarehouseReceipt, PrintLadingBill, BatchPickup,withdrawal
ylpmty's avatar
ylpmty committed
421
  },
422 423 424
  props: {
    mine: Boolean
  },
ylpmty's avatar
ylpmty committed
425 426
  data() {
    return {
427 428 429 430 431 432
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
ylpmty's avatar
ylpmty committed
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 订单列表
      list: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
449 450
        page: 1,
        rows: 10
ylpmty's avatar
ylpmty committed
451
      },
452 453
      warehouseList:[],
      // tradeCityList: [],
454 455
      productAttrList: [],  // 商品属性
      molecule: '', //重货比分子
ylpmty's avatar
ylpmty committed
456 457 458
      denominator: '', //重货比分母
      dateFilterType: '', //日期筛选类别
      dateFilter: [], //筛选日期
dragondean@qq.com's avatar
dragondean@qq.com committed
459

dragondean@qq.com's avatar
dragondean@qq.com committed
460 461
      printTagOrderId: null, // 显示打印标签的订单ID
      printWarehouseReceiptOrderId: null, // 打印入仓单的订单ID
462
      printLadingBillOrderId: null, // 打印提单的订单ID
dragondean@qq.com's avatar
dragondean@qq.com committed
463
      showBatchPickup: false, // 是否显示批量提货弹窗
dragondean@qq.com's avatar
dragondean@qq.com committed
464
      showMergedLogOrderNo:null, // 显示合单日志订单号
dragondean@qq.com's avatar
dragondean@qq.com committed
465
      showPickupLogOrderNo: null, // 显示提货日志的订单号
466 467
      isShow:false,//特殊显示
      orderId:undefined,
468 469
      adjustmentList:[],
      show:false,
470 471
      warehouseBol:false,//调仓申请
      feeApplicationBol:false,//费用申请
dragondean@qq.com's avatar
dragondean@qq.com committed
472 473 474
      multipleSelection:[],

      transportId: null, // 指定运输方式
我在何方's avatar
我在何方 committed
475 476 477 478 479 480
      orderNo:'',
      params: {
        page: 1,
        rows: 20,
      },
      currencyList:[]
ylpmty's avatar
ylpmty committed
481 482
    };
  },
483
  computed: {
484 485 486 487 488 489 490 491
    exportWarehouseList(){
      /* tradeType 1 进口,2出口,3进出口 */
      return this.warehouseList.filter(item => item.tradeType == 2 || item.tradeType == 3)
    },
    importWarehouseList(){
      return this.warehouseList.filter(item => item.tradeType == 1 || item.tradeType == 3)
    },
    /* exportCityList() {
492 493 494 495
      return this.tradeCityList.filter(item => item.type == 2)
    },
    importCityList() {
      return this.tradeCityList.filter(item => item.type == 1)
496
    }, */
497 498 499 500 501 502
    combinedQueryParams(){
        let timeParams = {}
        if(this.dateFilterType && this.dateFilter){
          timeParams['begin' + this.dateFilterType] = this.dateFilter[0]
          timeParams['end' + this.dateFilterType] = this.dateFilter[1]
        }
dragondean@qq.com's avatar
dragondean@qq.com committed
503 504 505 506 507
        let queryParams = Object.assign({}, this.queryParams, timeParams)
        if(this.transportId){
          queryParams.transportId = this.transportId
        }
        return queryParams
508 509 510 511
    },
    batchWarehouseAdjustment(){
      return  this.multipleSelection.length > 0 && this.multipleSelection.every(e => e.status === 5)
    },
512 513 514 515 516 517 518 519 520 521
    include(){
      return (state, arr) => {
        return arr.indexOf(state) > -1
      }
    },
    exclude(){
      return (state, arr) => {
        return arr.indexOf(state) == -1
      }
    }
522
  },
dragondean@qq.com's avatar
dragondean@qq.com committed
523 524 525
  activated(){
    this.handleQuery()
  },
ylpmty's avatar
ylpmty committed
526
  created() {
dragondean@qq.com's avatar
dragondean@qq.com committed
527
    this.getTransportFromRoute()
ylpmty's avatar
ylpmty committed
528
    this.getList();
529
    getProductAttrList().then(res => this.productAttrList = res.data)
530 531
    // getTradeCityList().then(res => this.tradeCityList = res.data)
    getWarehouseList().then(res => this.warehouseList = res.data)
我在何方's avatar
我在何方 committed
532 533

    getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
ylpmty's avatar
ylpmty committed
534 535
  },
  methods: {
dragondean@qq.com's avatar
dragondean@qq.com committed
536 537 538 539 540 541
    // 提取路径中的运输方式
    getTransportFromRoute(){
        let match = this.$route.path.match(/transport_(\d)/)
        if(!match) return
        this.transportId = match[1]
    },
542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568
    oprateOrder(orderId, type){
      let actions = {
        cancelOrder: {
          callable: cancelOrder,
          confirm: '确定要取消此订单么?'
        },
        recoveryOrder: {
          callable: recoveryOrder,
          confirm: '确定要恢复此订单么?'
        },
        deleteOrder: {
          callable: deleteOrder,
          confirm: '确定要删除此订单么?'
        }
      }
      let action = actions[type]
      if(!action){
        return this.$alert('不支持此操作')
      }
      this.$confirm(action.confirm)
        .then(res => {
          return action.callable(orderId)
        })
        .then(res => {
          this.getList()
        })
    },
569

ylpmty's avatar
ylpmty committed
570 571 572
    /** 查询列表 */
    getList() {
      this.loading = true;
573
      console.log('this.combinedQueryParams', this.combinedQueryParams)
574 575 576 577 578 579 580
      if(this.mine){
        return getMyOrderPage(this.combinedQueryParams).then(response => {
          this.list = response.data.list;
          this.total = response.data.total;
          this.loading = false;
        });
      }
ylpmty's avatar
ylpmty committed
581
      // 执行查询
582
      getOrderPage(this.combinedQueryParams).then(response => {
ylpmty's avatar
ylpmty committed
583 584 585 586 587
        this.list = response.data.list;
        this.total = response.data.total;
        this.loading = false;
      });
    },
588

ylpmty's avatar
ylpmty committed
589 590
    /** 搜索按钮操作 */
    handleQuery() {
591
      this.queryParams.page = 1;
ylpmty's avatar
ylpmty committed
592 593 594 595
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
dragondean@qq.com's avatar
dragondean@qq.com committed
596 597 598 599
      this.queryParams = {
        page: 1,
        rows: 10
      }
ylpmty's avatar
ylpmty committed
600 601 602 603
      this.handleQuery();
    },
    /** 新增按钮操作 */
    handleAdd() {
604
      this.$router.push('create')
ylpmty's avatar
ylpmty committed
605 606 607
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
608
      this.$router.push('edit?id=' + row.orderId)
ylpmty's avatar
ylpmty committed
609
    },
610

ylpmty's avatar
ylpmty committed
611 612 613 614
    /** 导出按钮操作 */
    handleExport() {
      // 处理查询参数
      // 执行导出
615
      this.$modal.confirm(this.$t('是否确认导出所有订单数据项?')).then(() => {
616
        this.exportLoading = true;
617
        return exportOrderExcel(this.combinedQueryParams);
618 619 620 621 622 623 624
      }).then(response => {
        this.$download.excel(response, '${table.classComment}.xls');
        this.exportLoading = false;
      }).catch(() => { });
    },
    // 表格多选
    handleSelectionChange(selection) {
625
      this.multipleSelection = selection
dragondean@qq.com's avatar
dragondean@qq.com committed
626
      this.ids = selection.map(item => item.orderId)
627 628
      this.single = selection.length !== 1
      this.multiple = !selection.length
629 630
    },
    handleEdit() {
631 632
      this.warehouseBol = true
      this.orderId = this.ids.join(',')
633 634
    },
    moleculeChange() { },
dcy's avatar
dcy committed
635 636 637 638 639 640 641 642 643 644 645
    denominatorChange() { },
    specialRendering(val){
      if(val !== undefined){
        let i = val.split(',')
       let special = this.getDictDatas(this.DICT_TYPE.ORDER_SPECIAL_NEEDS).filter(e => {
           return i.indexOf(e.value) > -1
        })
        return special
      }
    },
    deleteSpecial(id,orderId){
646 647 648 649 650
      this.$confirm(this.$t('确定删除此特需么?')).then(res => {
        return orderSpecialNeed({orderId:orderId,advanceType:id})
      }).then(() => {
        this.getList()
      })
651
    },
652 653 654 655
    onBatchClose(){
      this.showBatchPickup = false
      this.handleQuery()
    }
ylpmty's avatar
ylpmty committed
656 657 658
  }
};
</script>
659 660 661 662 663 664 665 666 667 668
<style lang="scss" scoped>
::v-deep .actions{
    .el-dropdown{
      margin-right: 10px;
      &::last-child{
        margin-right: 0;
      }
    }
}
</style>