index.vue 38.1 KB
Newer Older
wanglianghe's avatar
wanglianghe committed
1 2
<template>
  <div class="app-container">
3
    <div class="page-title">{{$route.query.product_id ? productTitle + '-' + $t('路线价格列表') : routeName}}</div>
wanglianghe's avatar
wanglianghe committed
4
    <!-- 搜索工作栏 -->
wanglianghe's avatar
wanglianghe committed
5
      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
dragondean@qq.com's avatar
dragondean@qq.com committed
6
        <el-form-item :label="$t('商品名称')" prop="titleZh" v-if="!$route.query.product_id">
7 8 9 10 11 12 13 14 15
          <el-input v-model="queryParams.titleZh" :placeholder="$t('请输入中英文名称、商品编码、海关编码')" clearable @keyup.enter.native="handleQuery">
            <template #prepend>
              <el-select v-model="queryParams.searchType" style="width: 100px">
                <el-option :value="1" :label="$t('包含')"></el-option>
                <el-option :value="2" :label="$t('不包含')"></el-option>
                <el-option :value="3" :label="$t('等于')"></el-option>
              </el-select>
            </template>
          </el-input>
16
        </el-form-item>
17

dragondean@qq.com's avatar
dragondean@qq.com committed
18 19
        <el-form-item :label="$t('商品类型')" prop="typeId" v-if="!$route.query.product_id">
          <el-select v-model="queryParams.typeId" :placeholder="$t('选择商品类型')" clearable>
20 21 22 23 24 25
            <el-option v-for="type in typeList" :key="type.id" :label="$l(type, 'titleZh')" :value="type.id"/>
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('商品属性')" prop="typeId" v-if="!$route.query.product_id">
          <el-select v-model="queryParams.attrId" :placeholder="$t('选择商品类型')" clearable>
            <el-option v-for="attr in attrList" :key="attr.id" :label="$l(attr, 'attrName')" :value="attr.id"/>
26 27
          </el-select>
        </el-form-item>
28
        <el-form-item :label="$t('运输方式')" prop="transportType" v-if="!transportType">
dragondean@qq.com's avatar
dragondean@qq.com committed
29
          <dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportType" formatter="number" clearable />
30
        </el-form-item>
31
        <!--海运不显示渠道-->
32 33 34 35 36
        <el-form-item :label="$t('出货渠道')" prop="shippingChannelId" v-if="type !== 'sea'">
          <el-select v-model="queryParams.shippingChannelId" clearable>
            <el-option v-for="item in channelList" :key="item.id" :label="$l(item, 'name')" :value="item.channelId" />
          </el-select>
        </el-form-item>
dragondean@qq.com's avatar
dragondean@qq.com committed
37
        <el-form-item :label="$t('始发地')" prop="startCityId">
wanglianghe's avatar
wanglianghe committed
38
          <el-select v-model="queryParams.startCityId" clearable>
39
            <el-option v-for="city in startCityList" :key="city.id" :label="$l(city, 'title')" :value="city.id" />
40
          </el-select>
41
        </el-form-item>
wanglianghe's avatar
wanglianghe committed
42

dragondean@qq.com's avatar
dragondean@qq.com committed
43
      <el-form-item :label="$t('目的地')" prop="destCityId">
wanglianghe's avatar
wanglianghe committed
44
        <el-select v-model="queryParams.destCityId" clearable>
45
          <el-option v-for="city in destCityList" :key="city.id" :label="$l(city, 'title')" :value="city.id" />
wanglianghe's avatar
wanglianghe committed
46
        </el-select>
47
      </el-form-item>
48 49 50 51 52 53
      <el-form-item :label="$t('是否预付')" prop="needPay">
        <el-select v-model="queryParams.needPay" :placeholder="$t('请选择')" clearable>
          <el-option :label="$t('是')" value="1"></el-option>
          <el-option :label="$t('否')" value="0"></el-option>
        </el-select>
      </el-form-item>
dragondean@qq.com's avatar
dragondean@qq.com committed
54
      <el-form-item :label="$t('上架状态')" prop="auditStatus">
dragondean@qq.com's avatar
dragondean@qq.com committed
55
          <dict-selector :type="DICT_TYPE.ECW_PRICE_AUDIT_STATUS" v-model="queryParams.auditStatus" clearable/>
56
      </el-form-item>
dragondean@qq.com's avatar
dragondean@qq.com committed
57
      <el-form-item :label="$t('状态')" prop="combStatus">
58 59
        <el-select v-model="queryParams.combStatus" :placeholder="$t('请选择状态')" clearable>
          <el-option :label="$t('未设置价格')" value="setPrice_1"></el-option>
60
            <el-option :label="$t('未过期')" value="setPrice_2"></el-option>
61
          <el-option :label="$t('黑名单')" value="blacklist_1"></el-option>
dragondean@qq.com's avatar
dragondean@qq.com committed
62
        </el-select>
63
      </el-form-item>
64 65 66 67 68 69
      <el-form-item :label="$t('是否单询')" prop="needOrderInquiry">
        <el-select v-model="queryParams.needOrderInquiry" :placeholder="$t('请选择')" clearable>
          <el-option :label="$t('是')" value="1"></el-option>
          <el-option :label="$t('否')" value="0"></el-option>
        </el-select>
      </el-form-item>
70 71 72 73 74 75
        <el-form-item :label="$t('单价模式')" prop="priceType">
          <el-select v-model="queryParams.priceType" :placeholder="$t('请选择')" clearable>
            <el-option :label="$t('运费+清关费')" value="0"></el-option>
            <el-option :label="$t('全包价')" value="1"></el-option>
          </el-select>
        </el-form-item>
wanglianghe's avatar
wanglianghe committed
76
      <el-form-item>
dragondean@qq.com's avatar
dragondean@qq.com committed
77 78
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
        <el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
wanglianghe's avatar
wanglianghe committed
79 80 81 82 83
      </el-form-item>
    </el-form>

    <!-- 操作工具栏 -->
    <el-row :gutter="10" class="mb8">
84 85
      <!--全部路线吗没有新增入口,指定商品的路线价格才有添加路线-->
      <el-col :span="1.5" v-if="$route.query.product_id">
86 87
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd('air')" v-hasPermi="['ecw:product-price:create']">{{$t('新建空运价格')}}</el-button>
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd('sea')" v-hasPermi="['ecw:product-price:create']">{{$t('新建海运价格')}}</el-button>
88 89
      </el-col>
      <el-col :span="1.5">
90
        <!--未指定商品-->
91 92 93 94
        <template v-if="!$route.query.product_id">
          <!--<el-button type="primary" v-hasPermi="['ecw:product-price:batch_update']" size="mini" @click="handleBatchEdit">{{$t('批量设置价格')}}</el-button>-->
          <el-button type="primary" v-hasPermi="['ecw:product-price:bartch_black']" size="mini" @click="batchBlock" :disabled="multiple">{{$t('批量加入黑名单')}}</el-button>
          <el-button type="primary" v-hasPermi="['ecw:product-price:batch_down']" size="mini" @click="batchOff" :disabled="multiple">{{$t('批量下架')}}</el-button>
95 96 97
          <el-button type="warning" v-hasPermi="['ecw:product-price:export']" size="mini"  @click="handleExport" :loading="exportLoading" >{{$t('导出')}}</el-button>
          <el-button type="primary" v-if="type != 'air'" v-hasPermi="['ecw:product-price:batch_update']" size="mini" @click="handleBatchEdit('sea')">{{$t('批量设置海运价格')}}</el-button>
          <el-button type="primary" v-if="type != 'sea'" v-hasPermi="['ecw:product-price:batch_update']" size="mini" @click="handleBatchEdit('air')">{{$t('批量设置空运价格')}}</el-button>
98
        </template>
wanglianghe's avatar
wanglianghe committed
99

100
        <!--指定商品-->
101 102 103 104
        <template v-else>
          <el-button type="primary" size="mini" v-hasPermi="['ecw:product-price:single_product']" @click="batchSetSingleProductPrice('sea')">{{$t('批量设置商品海运路线')}}</el-button>
          <el-button type="primary" size="mini" v-hasPermi="['ecw:product-price:single_product']" @click="batchSetSingleProductPrice('air')">{{$t('批量设置商品空运路线')}}</el-button>
        </template>
wanglianghe's avatar
wanglianghe committed
105
      </el-col>
106

wanglianghe's avatar
wanglianghe committed
107 108 109 110
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <!-- 列表 -->
111 112
    <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center"></el-table-column>
dragondean@qq.com's avatar
dragondean@qq.com committed
113
      <el-table-column :label="$t('序号')" prop="id" width="50" />
wanglianghe's avatar
wanglianghe committed
114

dragondean@qq.com's avatar
dragondean@qq.com committed
115
      <el-table-column :label="$t('商品编码')" align="center" prop="productCode" >
116
        <template slot-scope="{row}">
dragondean@qq.com's avatar
dragondean@qq.com committed
117
            <el-link type="primary" @click.native="handleUpdate(row)">
dragondean@qq.com's avatar
dragondean@qq.com committed
118
              {{ row.productDO ? row.productDO.productCode : $t('无productDO字段') }}
119
            </el-link>
120 121 122
        </template>
      </el-table-column>

dragondean@qq.com's avatar
dragondean@qq.com committed
123
      <el-table-column :label="$t('海关编码')" align="center" prop="customsCode">
124
        <template slot-scope="{row}">
125
            <div>
dragondean@qq.com's avatar
dragondean@qq.com committed
126
              {{ row.productDO ? row.productDO.customsCode : $t('无productDO字段') }}
127 128 129 130
            </div>
        </template>
      </el-table-column>

dragondean@qq.com's avatar
dragondean@qq.com committed
131
      <el-table-column :label="$t('商品类型')" align="center" prop="typeId">
132
        <template slot-scope="{row}">
dragondean@qq.com's avatar
dragondean@qq.com committed
133
          <span>{{ row.productDO ? getTypeName(row.productDO.typeId) : $t('无productDO字段') }}</span>
134 135 136
        </template>
      </el-table-column>

dragondean@qq.com's avatar
dragondean@qq.com committed
137
      <el-table-column :label="$t('商品名称')" align="center" prop="productName">
138
        <template slot-scope="{row}">
dragondean@qq.com's avatar
dragondean@qq.com committed
139
            <el-link type="primary" @click.native="handleUpdate(row)">
dragondean@qq.com's avatar
dragondean@qq.com committed
140
              {{ row.productDO ? row.productDO.titleZh + '/' + row.productDO.titleEn : $t('无productDO字段') }}
141
            </el-link>
142 143 144
        </template>
      </el-table-column>

dragondean@qq.com's avatar
dragondean@qq.com committed
145
      <el-table-column prop="tansportType" :label="$t('运输方式')" align="center" width="100">
wanglianghe's avatar
wanglianghe committed
146 147 148 149 150 151
          <template slot-scope="scope">
            <div>
              {{ transportName(scope.row.warehouseLineDO.transportType) }}
            </div>
          </template>
      </el-table-column>
dragondean@qq.com's avatar
dragondean@qq.com committed
152
      <el-table-column prop="tansportType" :label="$t('出货渠道')" align="center" width="100">
153 154 155 156 157 158
          <template slot-scope="{row}">
            <div>
              {{ channelName(row.shippingChannelId) }}
            </div>
          </template>
      </el-table-column>
dragondean@qq.com's avatar
dragondean@qq.com committed
159
      <el-table-column prop="startDestTitle" :label="$t('始发地') + '/' + $t('目的地')" align="center">
wanglianghe's avatar
wanglianghe committed
160 161 162 163 164 165 166 167 168
          <template slot-scope="scope">
            <div>
              {{ scope.row.warehouseLineDO.startTitleZh }}
              <br />
              {{ scope.row.warehouseLineDO.destTitleZh }}
            </div>
          </template>
      </el-table-column>

dragondean@qq.com's avatar
dragondean@qq.com committed
169
      <el-table-column prop="price" :label="$t('价格')" align="center">
wanglianghe's avatar
wanglianghe committed
170
          <template slot-scope="scope">
171 172 173 174 175 176 177 178 179 180 181 182 183 184
            <template v-if="scope.row.stepPrice == 1">
              <!--全包价-->
              <div v-if="scope.row.priceType">
                <div v-if="!scope.row.fullPriceStepList || !scope.row.fullPriceStepList.length">{{$t('未设置全包价阶梯价')}}</div>
                <div v-else>
                  {{$t("第{no}阶梯({start}~{end}{weightUnit}", {
                    no: 1,
                    start: scope.row.fullPriceStepList[0].startNum,
                    end: scope.row.fullPriceStepList[0].endNum,
                    weightUnit:  getUnitTitle(scope.row.fullPriceStepList[0].weightUnit),
                  })}}<br/>
                  {{$t('全包价')}}:{{ getCurrencySymbol(scope.row.fullPriceStepList[0].allPriceUnit) + scope.row.fullPriceStepList[0].allPrice}}&nbsp;
                  {{ getCurrencyTitle(scope.row.fullPriceStepList[0].allPriceUnit) + '/' + getUnitTitle(scope.row.fullPriceStepList[0].allVolumeUnit)}}
                </div>
dragondean@qq.com's avatar
dragondean@qq.com committed
185
              </div>
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
              <template v-else>
                <div v-if="!scope.row.freightPriceStepList || !scope.row.freightPriceStepList.length">{{$t('未设置运费阶梯价')}}</div>
                <div v-else>
                  {{$t("第{no}阶梯({start}~{end}{weightUnit}", {
                    no: 1,
                    start: scope.row.freightPriceStepList[0].startNum,
                    end: scope.row.freightPriceStepList[0].endNum,
                    weightUnit:  getUnitTitle(scope.row.freightPriceStepList[0].weightUnit),
                  })}}<br/>

                  <div>
                    {{$t('运费')}}:{{ getCurrencySymbol(scope.row.freightPriceStepList[0].transportPriceUnit) + scope.row.freightPriceStepList[0].transportPrice}}&nbsp;
                    {{ getCurrencyTitle(scope.row.freightPriceStepList[0].transportPriceUnit) + '/' + getUnitTitle(scope.row.freightPriceStepList[0].transportVolumeUnit)}}
                  </div>
                </div>
              </template>
202
              <el-button type="text" @click="showMoreStepPriceItem=scope.row">{{$t('查看更多')}}</el-button>
dragondean@qq.com's avatar
dragondean@qq.com committed
203
            </template>
204

dragondean@qq.com's avatar
dragondean@qq.com committed
205 206
            <template v-else>
              <div v-if="scope.row.priceType == 0">
207
                {{$t('运费')}}:{{ getCurrencySymbol(scope.row.transportPriceUnit) + scope.row.transportPrice}}&nbsp;
dragondean@qq.com's avatar
dragondean@qq.com committed
208 209
                {{ getCurrencyTitle(scope.row.transportPriceUnit) + '/' + getUnitTitle(scope.row.transportVolumeUnit)}}
                <br />
210
                {{$t('清关费')}}:{{ getCurrencySymbol(scope.row.clearancePriceUnit) + scope.row.clearancePrice}}&nbsp;
dragondean@qq.com's avatar
dragondean@qq.com committed
211 212 213
                {{ getCurrencyTitle(scope.row.clearancePriceUnit) + '/' + getUnitTitle(scope.row.clearanceVolumeUnit)}}
              </div>
              <div v-if="scope.row.priceType == 1">
214
                {{$t('全包价')}}:{{ getCurrencySymbol(scope.row.allPriceUnit) + scope.row.allPrice}}&nbsp;
dragondean@qq.com's avatar
dragondean@qq.com committed
215 216 217
                {{ getCurrencyTitle(scope.row.allPriceUnit) + '/' + getUnitTitle(scope.row.allVolumeUnit)}}
              </div>
            </template>
218

wanglianghe's avatar
wanglianghe committed
219 220 221
          </template>
      </el-table-column>

dragondean@qq.com's avatar
dragondean@qq.com committed
222
      <el-table-column prop="auditStatus" align="center" :label="$t('状态')" width="120">
wanglianghe's avatar
wanglianghe committed
223
        <template slot-scope="scope">
224 225
          <div>
              {{ statusName(scope.row) }}
dragondean@qq.com's avatar
dragondean@qq.com committed
226
              <span style="color:red" v-if="(scope.row.validateStartDate && scope.row.validateStartDate > Date.now()) || (scope.row.validateEndDate && scope.row.validateEndDate < Date.now())">(已过期)</span>
227
          </div>
wanglianghe's avatar
wanglianghe committed
228 229
        </template>
      </el-table-column>
Dragon Dean's avatar
Dragon Dean committed
230
      <el-table-column prop="advanceStatus" :label="$t('单询')" align="center" width="80">
231 232 233 234
        <template slot-scope="scope">
          <dict-tag :type="DICT_TYPE.NEED_ORDER_INQUIRY" :value="scope.row.needOrderInquiry"></dict-tag>
        </template>
      </el-table-column>
dragondean@qq.com's avatar
dragondean@qq.com committed
235
      <el-table-column prop="advanceStatus" :label="$t('预付')" align="center" width="80">
wanglianghe's avatar
wanglianghe committed
236 237
          <template slot-scope="scope">
            <div>
238
              <!-- {{ getAdvanceStatuTitle(scope.row.advanceStatus) }} -->
239
              <dict-tag :type="DICT_TYPE.ECW_PAY_ADVANCE" :value="scope.row.needPay"></dict-tag>
wanglianghe's avatar
wanglianghe committed
240 241 242
            </div>
          </template>
      </el-table-column>
243 244 245 246 247 248 249
      <el-table-column :label="$t('最后修改时间')">
        <template slot-scope="{row}">
          <div>
              {{ row.updateTime|parseTime }}
          </div>
        </template>
      </el-table-column>
dragondean@qq.com's avatar
dragondean@qq.com committed
250
      <el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width" width="140">
wanglianghe's avatar
wanglianghe committed
251
        <template slot-scope="scope">
dragondean@qq.com's avatar
dragondean@qq.com committed
252
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row, true)"
253
                     v-hasPermi="['ecw:product-price:show']">{{$t('查看')}}</el-button>
wanglianghe's avatar
wanglianghe committed
254
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
dragondean@qq.com's avatar
dragondean@qq.com committed
255
                     v-hasPermi="['ecw:product-price:update']">{{$t('编辑')}}</el-button>
256

257
          <el-button size="mini" type="text" icon="el-icon-edit" @click="updateStatus(scope.row, 'blacklist')"
258
            v-hasPermi="['ecw:product-price:black']">{{ scope.row.blacklist == 0 ? $t('加入黑名单') : $t('移除黑名单') }}</el-button>
259
          <el-button size="mini" type="text" icon="el-icon-edit" @click="updateStatus(scope.row, 'auditStatus')"
260
            v-hasPermi="['ecw:product-price:down']">{{scope.row.auditStatus == AuditStatusEnum.PASS ? $t('下架') : $t('上架')}}</el-button>
261
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
262
            v-hasPermi="['ecw:product-price:delete']">{{$t('删除')}}</el-button>
263 264 265
          <el-button @click="copyTemplate(scope.row)" size="mini" type="text">{{$t('复制模板')}}</el-button>
          <el-button @click="setOrderInquiry(scope.row, 0)" v-if="scope.row.needOrderInquiry" size="mini" type="text">{{$t('取消单询')}}</el-button>
          <el-button @click="setOrderInquiry(scope.row, 1)" v-else size="mini" type="text">{{$t('单询异常')}}</el-button>
wanglianghe's avatar
wanglianghe committed
266 267 268 269 270 271 272
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
                @pagination="getList"/>

273 274 275 276
    <el-dialog :visible="!!showMoreStepPriceItem" :before-close="closeMoreStepPrice" :title="$t('查看阶梯价')">

      <el-row :gutter="20" v-if="showMoreStepPriceItem">
        <el-col :span="12">
dragondean@qq.com's avatar
dragondean@qq.com committed
277 278 279 280 281 282 283 284 285 286
          <!--全包价-->
          <template v-if="showMoreStepPriceItem.priceType">
            <div v-for="(item, index) in showMoreStepPriceItem.fullPriceStepList">
              <show-step-price-item
                :value="item"
                :unit-map="unitMap"
                :currency-map="currencyMap"
                :index="index"
                field-prefix="all"
                :price-name="$t('全包价')"></show-step-price-item>
287
            </div>
dragondean@qq.com's avatar
dragondean@qq.com committed
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312
          </template>
          <template v-else>
            <template v-if="showMoreStepPriceItem.freightPriceStepList">
              <div v-for="(item, index) in showMoreStepPriceItem.freightPriceStepList">
                <show-step-price-item
                  :value="item"
                  :unit-map="unitMap"
                  :currency-map="currencyMap"
                  :index="index"
                  field-prefix="transport"
                  :price-name="$t('运费')"></show-step-price-item>
              </div>
            </template>
            <template v-if="showMoreStepPriceItem.clearancePriceStepList">
              <div v-for="(item, index) in showMoreStepPriceItem.clearancePriceStepList">
                <show-step-price-item
                  :value="item"
                  :unit-map="unitMap"
                  :currency-map="currencyMap"
                  :index="index"
                  field-prefix="clearance"
                  :price-name="$t('清关费')"></show-step-price-item>
              </div>
            </template>
          </template>
313 314
        </el-col>
        <!--空运的清关费单独显示-->
315 316 317 318
        <!--
        甲方要求不显示清关费 https://zentao.test.jdshangmen.com/bug-view-5298.html
        -->
<!--        <el-col :span="12" v-if="[3,4].indexOf(+showMoreStepPriceItem.warehouseLineDO.transportType) > -1">
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333
          <template v-if="showMoreStepPriceItem.clearPriceStepList.length">
            <div v-for="(item, index) in showMoreStepPriceItem.clearPriceStepList">
              <div  class="page-title">
                {{$t("第{no}阶梯({start}~{end}{weightUnit}", {
                no: index + 1,
                start: item.startNum,
                end: item.endNum,
                weightUnit:  getUnitTitle(item.weightUnit),
                })}}
              </div>
              {{$t('清关费')}}:{{ getCurrencySymbol(item.clearancePriceUnit) + item.clearancePrice}}&nbsp;
              {{ getCurrencyTitle(item.clearancePriceUnit) + '/' + getUnitTitle(item.clearanceVolumeUnit)}}
            </div>
          </template>
          <template v-else>{{$t('暂无清关费设置')}}</template>
334
        </el-col>-->
335 336 337
      </el-row>
    </el-dialog>

wanglianghe's avatar
wanglianghe committed
338 339 340 341
  </div>
</template>

<script>
342 343 344 345 346 347 348 349 350 351 352
import {
  createProductPrice,
  updateProductPrice,
  deleteProductPrice,
  getProductPrice,
  getProductPricePage,
  exportProductPriceExcel,
  batchBlock,
  batchOff,
  updateOrderInquiry
} from "@/api/ecw/productPrice";
wanglianghe's avatar
wanglianghe committed
353
import { openedRouterList } from "@/api/ecw/warehouse";
354
import { getTradeCityList } from "@/api/ecw/region";
wanglianghe's avatar
wanglianghe committed
355
import { getProductTypeList } from "@/api/ecw/productType";
356 357
import { getProductAttrList } from "@/api/ecw/productAttr";
import { getDictDatas, DICT_TYPE } from '@/utils/dict'
wanglianghe's avatar
wanglianghe committed
358 359 360
import { getCurrencyList } from '@/api/ecw/currency';
import { getUnitList } from '@/api/ecw/unit';
import { AuditStatusEnum} from '@/utils/constants'
361 362 363
import { getChannelList } from '@/api/ecw/channel';
import DictTag from '@/components/DictTag'
import {arrryToKeyedObjectBy} from '@/utils/index'
364
import { getProduct } from '@/api/ecw/product';
365
import {parseTime} from '@/utils/ruoyi'
366
import Template from "@/views/cms/template";
367
import {getStatusName} from "./util";
dragondean@qq.com's avatar
dragondean@qq.com committed
368
import ShowStepPriceItem from "@/views/ecw/productPrice/components/ShowStepPriceItem.vue";
wanglianghe's avatar
wanglianghe committed
369
export default {
370
  name: "EcwProductpriceIndex",
371
  filters: {parseTime},
wanglianghe's avatar
wanglianghe committed
372
  components: {
dragondean@qq.com's avatar
dragondean@qq.com committed
373
    ShowStepPriceItem,
374
    Template,
375
    DictTag
wanglianghe's avatar
wanglianghe committed
376 377 378
  },
  data() {
    return {
379 380 381 382 383 384
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
385 386
      //特性列表
      attrList:[],
wanglianghe's avatar
wanglianghe committed
387 388
      typeList: [],
      product: null,
389 390 391
      cityList: [],
      /* startCityList: [],  //始发地城市
      destCityList: [],   //目的地城市 */
wanglianghe's avatar
wanglianghe committed
392
      routedList: [],     //已开头路线列表
dragondean@qq.com's avatar
dragondean@qq.com committed
393
      currencyList: [],    //货币列表
wanglianghe's avatar
wanglianghe committed
394
      unitList: [],       //单位列表
395
      channelList:[] , // 渠道
wanglianghe's avatar
wanglianghe committed
396 397 398
      routeParams:{},    //路线搜索条件
      isUpdate: false,   //更新操作

wanglianghe's avatar
wanglianghe committed
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 产品价格列表
      list: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      dateRangeCreateTime: [],
      // 查询参数
      queryParams: {
416
        searchType: 1,
wanglianghe's avatar
wanglianghe committed
417 418 419 420
        pageNo: 1,
        pageSize: 10,
        productId: null,
        warehouseLineId: null,
421
        transportType: null,
wanglianghe's avatar
wanglianghe committed
422 423 424 425 426 427
        transportPrice: null,
        transportPriceUnit: null,
        transportVolumeUnit: null,
        clearancePrice: null,
        clearancePriceUnit: null,
        clearanceVolumeUnit: null,
428
        shippingChannelId: null,
wanglianghe's avatar
wanglianghe committed
429 430 431
        status: null,
      },
      // 表单参数
wanglianghe's avatar
wanglianghe committed
432 433 434 435
      form: {
        typeId: null,
        titleZh: null
      },
wanglianghe's avatar
wanglianghe committed
436 437
      // 表单校验
      rules: {
dragondean@qq.com's avatar
dragondean@qq.com committed
438 439 440 441 442 443 444 445 446
        typeId: [{ required: true, message: this.$t("产品类型不能为空"), trigger: "blur" }],
        titleZh: [{ required: true, message: this.$t("产品名称不能为空"), trigger: "blur" }],
        titleEn: [{ required: true, message: this.$t("英文名称不能为空"), trigger: "blur" }],
        transportPrice: [{ required: true, message: this.$t("海运费不能为空"), trigger: "blur" }],
        clearancePrice: [{ required: true, message: this.$t("清关费不能为空"), trigger: "blur" }],
        advanceStatus: [{ required: true, message: this.$t("是否预付不能为空"), trigger: "blur" }],
        containerLocation:[{ required: true, message: this.$t("货柜位置不能为空"), trigger: "blur" }],
        square:[{ required: true, message: this.$t("方数不能为空"), trigger: "blur" }],
        needBook:[{ required: true, message: this.$t("预约入仓不能为空"), trigger: "blur" }],
wanglianghe's avatar
wanglianghe committed
447 448
      },

449
      lineList: [],
wanglianghe's avatar
wanglianghe committed
450
      transportDatas: getDictDatas(DICT_TYPE.ECW_TRANSPORT_TYPE),
451
      /* advanceStatusDictDatas: getDictDatas(DICT_TYPE.ADVANCE_STATUS), */
wanglianghe's avatar
wanglianghe committed
452
      AuditStatusEnum: AuditStatusEnum,
453
      locationList: getDictDatas(DICT_TYPE.ECW_CONTAINER_LOCATION),
454
      // 查看更多阶梯价
455 456
      showMoreStepPriceItem: null,
      entryPath: null
wanglianghe's avatar
wanglianghe committed
457 458
    };
  },
wanglianghe's avatar
wanglianghe committed
459 460

  computed: {
461 462
    // 路径中的运输方式参数
    transportType() {
463 464
      // product-price-1_2的格式,如果没有三段则最后一段不是运输方式
      return this.$route.path.split('-')[2] || '';
465 466 467 468 469 470 471 472 473 474 475 476 477
    },
    // 路由中的标题
    routeName(){
      return this.$route.name
    },
    // 类型,transportType是1和2(1_2用一个表示)表示海运,3和4表示空运
    type(){
      // 如果没有则表示商品路线价格
      if(!this.transportType){
        return null
      }
      return ['3','4'].indexOf(this.transportType) > -1 ? 'air' : 'sea'
    },
478 479 480 481 482 483 484 485
    // 商品名称
    productTitle(){
      if(!this.product){
        return ''
      }
      return this.product.titleZh
    },
    // 渠道用id做键值
486 487 488
    keyedChannel(){
      return arrryToKeyedObjectBy(this.channelList, 'channelId')
    },
489
    // 根据渠道id获取渠道名
490 491 492 493 494
    channelName(){
      return id => {
        return this.keyedChannel[id] ? this.keyedChannel[id].nameZh : null
      }
    },
495
    // 根据类型获取类型名称
496 497 498 499 500
    getTypeName() {
      return typeId => {
        for(let index in this.typeList) {
          let typeItem = this.typeList[index];
          if(typeItem.id == typeId) {
501
            return this.$l(typeItem, 'title');
502 503 504 505
          }
        }
      }
    },
506
    // 根据状态获取状态名称 ,这个应该可以改成字典,目前接口缺少相关数据,待定
507
    statusName() {
508
      return getStatusName
509 510
    },

511
    // 根据运输方式获取名称
wanglianghe's avatar
wanglianghe committed
512 513
    transportName() {
      return transportType => {
514
        return this.getDictDataLabel(this.DICT_TYPE.ECW_TRANSPORT_TYPE, transportType)
wanglianghe's avatar
wanglianghe committed
515 516
      }
    },
517
    // 显示币种符号
wanglianghe's avatar
wanglianghe committed
518 519
    getCurrencySymbol() {
      return currencyId => {
dragondean@qq.com's avatar
dragondean@qq.com committed
520 521
        for(let index in this.currencyList) {
          let currecyItem = this.currencyList[index];
wanglianghe's avatar
wanglianghe committed
522 523 524 525 526 527
          if(currecyItem.id == currencyId) {
            return currecyItem.fuhao;
          }
        }
      }
    },
528
    // 显示币种名称
wanglianghe's avatar
wanglianghe committed
529 530
    getCurrencyTitle() {
      return currencyId => {
dragondean@qq.com's avatar
dragondean@qq.com committed
531 532
        for(let index in this.currencyList) {
          let currecyItem = this.currencyList[index];
wanglianghe's avatar
wanglianghe committed
533
          if(currecyItem.id == currencyId) {
534
            return this.$l(currecyItem, 'title');
wanglianghe's avatar
wanglianghe committed
535 536 537 538 539 540 541 542 543 544
          }
        }
      }
    },

    getUnitTitle() {
      return unitId => {
        for(let index in this.unitList) {
          let unitItem = this.unitList[index];
          if(unitItem.id == unitId) {
545
            return this.$l(unitItem, 'title');
wanglianghe's avatar
wanglianghe committed
546 547 548 549 550
          }
        }
      }
    },

551 552 553 554 555 556
    startCityList(){
      return this.cityList.filter(item => item.type == 2 || item.type == 3)
    },
    destCityList(){
      return this.cityList.filter(item => item.type == 1 || item.type == 3)
    },
dragondean@qq.com's avatar
dragondean@qq.com committed
557 558 559 560 561 562 563 564 565 566 567 568 569 570
    currencyMap(){
      let map = {}
      this.currencyList.forEach(item => {
        map[item.id] = this.$l(item, 'title')
      })
      return map
    },
    unitMap(){
      let map = {}
      this.unitList.forEach(item => {
        map[item.id] = this.$l(item, 'title')
      })
      return map
    },
wanglianghe's avatar
wanglianghe committed
571
  },
wanglianghe's avatar
wanglianghe committed
572
  activated() {
573
    // console.log('activated', Object.assign({}, this.$route.query))
574
    /* this.$set(this.queryParams, 'typeId', +this.$route.query.product_type || null)
575

576 577 578 579 580 581 582 583
    let productId = this.product?.id
    console.log(this.$route.query.product_id, productId, this.$route.query.product_id != productId)
    if(this.$route.query.product_id != productId){
      this.queryParams = {
        pageNo: 1,
        pageSize: 10
      }
    }
584 585
    this.handleQuery()
     */
586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606
    if(this.$route.query.product_type){
      this.$set(this.queryParams, 'typeId', +this.$route.query.product_type);
    }
    if(this.$route.query.transportType){
      this.$set(this.queryParams, 'transportType', +this.$route.query.transportType);
    }
    // 指定产品获取产品信息
    if(this.$route.query.product_id){
      this.$set(this.queryParams, 'productId', +this.$route.query.product_id);
      getProduct(this.$route.query.product_id).then(res => {
        this.product = res.data
      })

    }else {
      if (this.transportType) {
        // 如果指定了单个的运输方式则赋值
        if (this.transportType.split('_').length == 1) {
          this.$set(this.queryParams, 'transportType', +this.transportType)
        }
      }
    }
wanglianghe's avatar
wanglianghe committed
607
  },
608 609
  watch:{
    '$route.query.product_id'(){
610 611 612
      // if(!this.$route.query.product_id){
      //   return this.product = null
      // }
613 614
      // 价格列表 跟 商品的价格列表,有时候商品价格列表的路由变动会导致价格列表也执行此处代码,所以做一个判断排除
      // https://zentao.test.jdshangmen.com/bug-view-4928.html
615
      if(this.$route.path != this.entryPath) return
616

617
      let productId = this.product?.id
618 619 620 621 622 623
      if(this.$route.name === 'ProductPrice'){
        if(this.$route.query.product_id != productId){
          this.queryParams = {
            pageNo: 1,
            pageSize: 10,
            productId: this.$route.query.product_id,
624 625 626
            typeId: this.$route.query.product_type,
            transportType:this.$route.query.transportType

627
          }
628
        }
629 630 631
        getProduct(this.$route.query.product_id).then(res => {
          this.product = res.data
        })
632
        this.getList();
633 634 635
      }
    }
  },
636
  created() {
637
    this.entryPath = this.$route.path
638 639
    if(this.$route.query.product_type){
      this.$set(this.queryParams, 'typeId', +this.$route.query.product_type);
wanglianghe's avatar
wanglianghe committed
640
    }
641 642 643
    if(this.$route.query.transportType){
      this.$set(this.queryParams, 'transportType', +this.$route.query.transportType);
    }
644 645
    // 指定产品获取产品信息
    if(this.$route.query.product_id){
dragondean@qq.com's avatar
dragondean@qq.com committed
646
      this.$set(this.queryParams, 'productId', +this.$route.query.product_id);
647 648 649
      getProduct(this.$route.query.product_id).then(res => {
        this.product = res.data
      })
650
    }else{
651 652 653 654 655
      if(this.transportType) {
        // 如果指定了单个的运输方式则赋值
        if (this.transportType.split('_').length == 1) {
          this.$set(this.queryParams, 'transportType', +this.transportType)
        }
656
      }
657 658
      this.getAttrList();
    }
659

660
    //获取城市列表
dragondean@qq.com's avatar
dragondean@qq.com committed
661
    this.getAllCityList()
662
    this.getChannelList()
dragondean@qq.com's avatar
dragondean@qq.com committed
663
    this.getTypeList()
664

665 666
    this.getAttrList();

wanglianghe's avatar
wanglianghe committed
667 668 669 670
    //获取货币列表
    this.requestCurrencyList();
    //获取单位列表
    this.requestUnitList();
671 672 673 674

    this.$nextTick(() => {
      this.getList();
    })
wanglianghe's avatar
wanglianghe committed
675
  },
wanglianghe's avatar
wanglianghe committed
676 677 678



wanglianghe's avatar
wanglianghe committed
679
  methods: {
680 681 682
    getChannelList(){
      getChannelList().then(res => this.channelList = res.data)
    },
683 684 685 686 687 688 689
    /** 获取产品属性列表 */
    getAttrList() {
      getProductAttrList().then(response => {
          this.attrList = response.data;
      })
    },

wanglianghe's avatar
wanglianghe committed
690 691 692 693 694 695 696 697 698
     /** 获取产品类型列表 */
    getTypeList() {
      getProductTypeList().then(response => {
        this.typeList = response.data;
      })
    },

    /**获取所有城市列表 */
    getAllCityList() {
699 700
      getTradeCityList({}).then(response => {
          this.cityList = response.data;
wanglianghe's avatar
wanglianghe committed
701 702 703 704 705 706 707 708 709 710 711 712 713 714
      })
    },

    /**获取已开通路线列表 */
    getOpenedRouterList() {
        openedRouterList(this.routeParams).then(response => {
            this.routedList = response.data;
            this.setDefaultSelect();
        })
    },

    /**获取所有货币列表 */
    requestCurrencyList() {
      getCurrencyList().then(response => {
dragondean@qq.com's avatar
dragondean@qq.com committed
715
        this.currencyList = response.data;
716
      })
wanglianghe's avatar
wanglianghe committed
717 718 719 720 721 722 723 724 725
    },

    /**获取所有单位列表 */
    requestUnitList() {
      getUnitList().then(response => {
        this.unitList = response.data;
      })
    },

726
    /*handleSelectionChange(val) {
wanglianghe's avatar
wanglianghe committed
727
        this.lineList = val;
728
    },*/
wanglianghe's avatar
wanglianghe committed
729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749

    /**运输线路改变 */
    transportTypeChange(newVal) {
      this.routeParams.transportType = this.form.transportType;
      this.getOpenedRouterList();
    },

    /**始发地改变 */
    startCityChange(newVal) {
      this.routeParams.startCityId = this.form.startCityId;
      this.getOpenedRouterList();
    },

    /**目的地改变 */
    destCityChange(newVal) {
      this.routeParams.destCityId = this.form.destCityId;
      this.getOpenedRouterList();
    },

     handleStatusChange(row) {
      updateProductPrice(row).then(() => {
dragondean@qq.com's avatar
dragondean@qq.com committed
750
        this.$modal.msgSuccess(this.$t("修改成功"));
wanglianghe's avatar
wanglianghe committed
751 752 753 754 755
      }).catch(function() {
        row.auditStatus = row.auditStatus === AuditStatusEnum.PASS ? AuditStatusEnum.NOT_PASS : AuditStatusEnum.PASS;
      });
    },

wanglianghe's avatar
wanglianghe committed
756 757 758
    /** 查询列表 */
    getList() {
      this.loading = true;
759
      console.log(this.queryParams,'this.queryParams')
wanglianghe's avatar
wanglianghe committed
760 761
      // 处理查询参数
      let params = {...this.queryParams};
762 763 764 765 766 767
      if(this.type == 'sea'){
        params.transportType = 1
      }
      if(this.type == 'air'){
        params.transportType = 3
      }
wanglianghe's avatar
wanglianghe committed
768 769
      this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
      // 执行查询
770
      console.log(params,'params')
wanglianghe's avatar
wanglianghe committed
771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800
      getProductPricePage(params).then(response => {
        this.list = response.data.list;
        this.total = response.data.total;
        this.loading = false;
      });
    },
    /** 取消按钮 */
    cancel() {
      this.open = false;
      this.reset();
    },
    /** 表单重置 */
    reset() {
      this.form = {
        id: undefined,
        productId: undefined,
        warehouseLineId: undefined,
        transportPrice: undefined,
        transportPriceUnit: undefined,
        transportVolumeUnit: undefined,
        clearancePrice: undefined,
        clearancePriceUnit: undefined,
        clearanceVolumeUnit: undefined,
        status: undefined,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNo = 1;
dragondean@qq.com's avatar
dragondean@qq.com committed
801 802 803 804 805 806
      this.queryParams.setPrice = undefined
      this.queryParams.blacklist = undefined
      if(this.queryParams.combStatus){
        let tmp = this.queryParams.combStatus.split('_')
        this.queryParams[tmp[0]] = tmp[1]
      }
wanglianghe's avatar
wanglianghe committed
807 808 809 810 811 812 813 814 815
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRangeCreateTime = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
    /** 新增按钮操作 */
816 817
    handleAdd(type) {
      return this.$router.push(`../../lineProject/product-price/edit-${type}?` + (new URLSearchParams(this.$route.query)).toString())
818

wanglianghe's avatar
wanglianghe committed
819
    },
820
    // 批量修改单个商品的价格(一条或者多条,后者全部路线)
821
    batchSetSingleProductPrice(type){
822
        this.$router.push(`../../lineProject/product-price/edit-${type}?action=batchUpdate&type=${type}&product_id=${this.$route.query.product_id}&ids=${this.ids}`)
823
    },
824
    // 批量设置路线
825 826
    handleBatchEdit(type) {
      this.$router.push('../../lineProject/batch-edit-' + type)
827
    },
wanglianghe's avatar
wanglianghe committed
828
    /** 修改按钮操作 */
dragondean@qq.com's avatar
dragondean@qq.com committed
829
    handleUpdate(row, readonly) {
830 831 832
      let transportType = row.warehouseLineDO.transportType
      let type = transportType == 3 || transportType == 4 ? 'air' : 'sea'
      let url = `../../lineProject/product-price/edit-${type}?action=update&id=${row.id}`
dragondean@qq.com's avatar
dragondean@qq.com committed
833 834
      if(readonly)url += '&readonly=1'
      return this.$router.push(url)
wanglianghe's avatar
wanglianghe committed
835
    },
wanglianghe's avatar
wanglianghe committed
836

837 838 839 840 841 842 843
    updateStatus(row, type) {
      if(type == 'blacklist') {
        row.blacklist=row.blacklist == 0 ? 1 : 0;
      } else if(type == 'auditStatus') {
        row.auditStatus=row.auditStatus === AuditStatusEnum.PASS ? AuditStatusEnum.NOT_PASS : AuditStatusEnum.PASS;
      }
      updateProductPrice(row).then(() => {
dragondean@qq.com's avatar
dragondean@qq.com committed
844
        this.$modal.msgSuccess(this.$t("修改成功"));
845 846 847 848 849 850
      }).catch(function() {
        if(statusType == 'blacklist') {
          row.blacklist = row.blacklist === 1 ? 0 : 1;
        } else {
          row.auditStatus = row.auditStatus === AuditStatusEnum.PASS ? AuditStatusEnum.NOT_PASS : AuditStatusEnum.PASS;
        }
851

852 853 854
      });
    },

855

wanglianghe's avatar
wanglianghe committed
856 857 858 859 860 861 862 863 864 865 866 867 868 869 870
    checkSelectable() {
      return !this.isUpdate;
    },


    setDefaultSelect() {
      let vm = this;
      setTimeout(() => {
         // 修改线路价格,选中已经选择的
        if(vm.isUpdate && vm.routedList && vm.routedList.length) {
            vm.$refs.routeTable.toggleRowSelection(vm.routedList[0]);
        }
      }, 300);
    },

wanglianghe's avatar
wanglianghe committed
871
    /** 提交按钮 */
872
    /*submitForm() {
wanglianghe's avatar
wanglianghe committed
873 874 875 876
      this.$refs["form"].validate(valid => {
        if (!valid) {
          return;
        }
wanglianghe's avatar
wanglianghe committed
877 878

        if(!this.lineList || !this.lineList.length) {
dragondean@qq.com's avatar
dragondean@qq.com committed
879
            this.$message.error(this.$t('请选择线路'));
wanglianghe's avatar
wanglianghe committed
880 881
            return;
        }
882 883
        let lineChannelList = [];
        //TODO  ,lineChannelList实体空运的时候需要传出货渠道ID--shippingChannelId
wanglianghe's avatar
wanglianghe committed
884
        this.lineList.map((item) => {
885
            lineChannelList.push({lineId: item.id});
wanglianghe's avatar
wanglianghe committed
886 887
            return item;
        });
888
        this.form.lineChannelList = lineChannelList;
wanglianghe's avatar
wanglianghe committed
889

wanglianghe's avatar
wanglianghe committed
890 891 892
        // 修改的提交
        if (this.form.id != null) {
          updateProductPrice(this.form).then(response => {
dragondean@qq.com's avatar
dragondean@qq.com committed
893
            this.$modal.msgSuccess(this.$t("修改成功"));
wanglianghe's avatar
wanglianghe committed
894 895 896 897 898 899
            this.open = false;
            this.getList();
          });
          return;
        }
        // 添加的提交
wanglianghe's avatar
wanglianghe committed
900
        this.form.productId = this.product.id;
wanglianghe's avatar
wanglianghe committed
901
        createProductPrice(this.form).then(response => {
dragondean@qq.com's avatar
dragondean@qq.com committed
902
          this.$modal.msgSuccess(this.$t("请求成功"));
wanglianghe's avatar
wanglianghe committed
903 904 905 906
          this.open = false;
          this.getList();
        });
      });
907
    },*/
wanglianghe's avatar
wanglianghe committed
908 909 910
    /** 删除按钮操作 */
    handleDelete(row) {
      const id = row.id;
dragondean@qq.com's avatar
dragondean@qq.com committed
911
      this.$modal.confirm(this.$t('是否确认删除产品价格编号为{id}的数据项?', {id})).then(function() {
wanglianghe's avatar
wanglianghe committed
912 913 914
          return deleteProductPrice(id);
        }).then(() => {
          this.getList();
dragondean@qq.com's avatar
dragondean@qq.com committed
915
          this.$modal.msgSuccess(this.$t("删除成功"));
wanglianghe's avatar
wanglianghe committed
916 917 918 919 920 921 922 923
        }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      // 处理查询参数
      let params = {...this.queryParams};
      params.pageNo = undefined;
      params.pageSize = undefined;
924 925 926 927 928 929 930
      if(this.type == 'sea'){
        params.transportType = 1
      }
      if(this.type == 'air'){
        params.transportType = 3
      }

wanglianghe's avatar
wanglianghe committed
931
      this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
wanglianghe's avatar
wanglianghe committed
932
      this.$modal.confirm(this.$t('是否确认导出所有数据项?')).then(() => {
wanglianghe's avatar
wanglianghe committed
933 934 935
          this.exportLoading = true;
          return exportProductPriceExcel(params);
        }).then(response => {
936
          // this.$download.excel(response, '路线价格.xlsx');
wanglianghe's avatar
wanglianghe committed
937
          this.exportLoading = false;
938
          this.$message.success(this.$t('已加入导出队列,请稍后在下载日志中下载'))
wanglianghe's avatar
wanglianghe committed
939 940 941
        }).catch(() => {
          this.exportLoading = false;
        });
942 943 944 945 946 947
    },
    // 表格多选
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
948 949 950
    },
    batchBlock(){
      batchBlock({ids: this.ids.join(',')}).then(res => {
dragondean@qq.com's avatar
dragondean@qq.com committed
951
        this.$message.success(res.msg || this.$t('操作成功'))
952
        this.getList()
953 954 955 956
      })
    },
    batchOff(){
      batchOff({ids: this.ids.join(',')}).then(res => {
dragondean@qq.com's avatar
dragondean@qq.com committed
957
        this.$message.success(res.msg || this.$t('操作成功'))
958
        this.getList()
959 960
      })
    },
961

962 963 964 965 966 967 968 969 970 971
    // 设置,取消単询
    setOrderInquiry(row, needOrderInquiry){
      row.needOrderInquiry = needOrderInquiry
      updateOrderInquiry(row).then(res => {
        this.$message.success(res.msg || this.$t('操作成功'))
        this.getList()
      })
    },
    // 复制模板
    copyTemplate(row){
972
      // 跳转到批量设置页面,并填充数据
dragondean@qq.com's avatar
dragondean@qq.com committed
973 974
      let transportType = row.warehouseLineDO.transportType
      this.$router.push(`../../lineProject/batch-edit-${transportType == 3 || transportType == 4 ? 'air' : 'sea'}?templateId=${row.id}`)
975 976 977 978
    },
    // 关闭更多阶梯价格窗口
    closeMoreStepPrice(){
      this.showMoreStepPriceItem=null
979 980
    }

wanglianghe's avatar
wanglianghe committed
981 982 983
  }
};
</script>
wanglianghe's avatar
wanglianghe committed
984