detail.vue 36.2 KB
Newer Older
我在何方's avatar
我在何方 committed
1 2 3
<template>
  <div class="app-container">
        <el-card>
我在何方's avatar
我在何方 committed
4
            <div slot="header" class="card-title">{{$t('报价单详情')}}</div>
我在何方's avatar
我在何方 committed
5 6
          <!-- 列表 -->
          <div class="offer-header">
我在何方's avatar
我在何方 committed
7
              <span style="font-size: 15px;">{{$t('报价单号')}}{{list.number}}</span>
我在何方's avatar
我在何方 committed
8
              <div class="btns">
9
                <el-button v-hasPermi="['ecw:offer:update']" size="mini" type="primary" v-if="[4,5,6].indexOf(list.status) == -1"  @click="$router.push('edit?id=' + offerId)">{{$t('编辑')}}</el-button>
10 11 12 13
                <el-button v-hasPermi="['ecw:offer:loglist']" type="primary" v-if="[1,3,7].indexOf(list.status) > -1"  size="mini" @click="handleAdd">{{$t('跟进')}}</el-button>
                <el-button v-hasPermi="['ecw:offer:result']" type="primary"  v-if="[3,7].indexOf(list.status) > -1" size="mini" @click="toResult">{{$t('结果')}}</el-button>
                <el-button v-hasPermi="['ecw:offer:discount','ecw:offer:commission']" size="mini" v-if="[1,3,7].indexOf(list.status) > -1" type="primary" @click.native="$router.push('/offer/special?offerId=' + offerId)" >{{$t('特价')}}</el-button>
                <el-button v-hasPermi="['ecw:offer:delete']" type="danger" size="mini" @click="handleDelete">{{$t('删除')}}</el-button>
我在何方's avatar
我在何方 committed
14 15 16 17
              </div>
          </div>
          <div>
            <div class="title-font">
我在何方's avatar
我在何方 committed
18
              <label>{{$t('报价单所属')}}{{list.relation?list.relation==1?$t('发货人'):$t('收货人'):$t('发货人')}}</label>
我在何方's avatar
我在何方 committed
19
            </div>
20
                <el-descriptions :column="3" border class="card" v-if="list.consignorId">
我在何方's avatar
我在何方 committed
21
                    <el-descriptions-item :label="$t('发货人')+':'">
我在何方's avatar
我在何方 committed
22
                        {{consignorData.contactsName||$t('')}}
我在何方's avatar
我在何方 committed
23
                    </el-descriptions-item>
我在何方's avatar
我在何方 committed
24
                    <el-descriptions-item :label="$t('手机号')+':'">
25
                      {{consignorData && consignorData.phoneNew ? (checkCode(consignorData.areaCode) + consignorData.phoneNew)||$t(''):$t('')}}
我在何方's avatar
我在何方 committed
26
                    </el-descriptions-item>
我在何方's avatar
我在何方 committed
27
                    <el-descriptions-item :label="$t('联系地址')+':'">
我在何方's avatar
我在何方 committed
28
                      {{consignorData.address||$t('')}}
我在何方's avatar
我在何方 committed
29
                    </el-descriptions-item>
我在何方's avatar
我在何方 committed
30
                    <el-descriptions-item :label="$t('客户来源')+':'">
我在何方's avatar
我在何方 committed
31
                          {{consignorData.source||$t('')}}
我在何方's avatar
我在何方 committed
32
                    </el-descriptions-item>
我在何方's avatar
我在何方 committed
33
                    <el-descriptions-item :label="$t('发货人公司名称')+':'">
我在何方's avatar
我在何方 committed
34
                      {{consignorData.company||$t('')}}
我在何方's avatar
我在何方 committed
35
                    </el-descriptions-item>
我在何方's avatar
我在何方 committed
36
                    <el-descriptions-item :label="$t('社交软件')+':'">
我在何方's avatar
我在何方 committed
37 38
                       <dict-tag :type="DICT_TYPE.SOCIAL" :value="consignorData.social" />
                       {{consignorData.socialNumber?('('+consignorData.socialNumber+')'):''}}
我在何方's avatar
我在何方 committed
39 40 41
                    </el-descriptions-item>
                </el-descriptions>

42
               <el-descriptions :column="3" border class="card" v-if="list.consigneeId">
我在何方's avatar
我在何方 committed
43
                   <el-descriptions-item :label="$t('收货人')+':'">
我在何方's avatar
我在何方 committed
44 45
                    {{consigneeData.contactsName||$t('')}}
                    </el-descriptions-item>
我在何方's avatar
我在何方 committed
46
                    <el-descriptions-item :label="$t('手机号')+':'">
47
                      {{consigneeData && consigneeData.phoneNew ?(checkCode(consigneeData.areaCode)+consigneeData.phoneNew)||$t(''):$t('')}}
我在何方's avatar
我在何方 committed
48
                    </el-descriptions-item>
我在何方's avatar
我在何方 committed
49
                    <el-descriptions-item :label="$t('联系地址')+':'">
我在何方's avatar
我在何方 committed
50 51
                      {{consigneeData.address||$t('')}}
                    </el-descriptions-item>
我在何方's avatar
我在何方 committed
52
                    <el-descriptions-item :label="$t('客户来源')+':'">
我在何方's avatar
我在何方 committed
53 54
                          {{consigneeData.source||$t('')}}
                    </el-descriptions-item>
我在何方's avatar
我在何方 committed
55
                    <el-descriptions-item :label="$t('发货人公司名称')+':'">
我在何方's avatar
我在何方 committed
56 57
                      {{consigneeData.company||$t('')}}
                    </el-descriptions-item>
我在何方's avatar
我在何方 committed
58
                    <el-descriptions-item :label="$t('社交软件')+':'">
我在何方's avatar
我在何方 committed
59 60
                       <dict-tag :type="DICT_TYPE.SOCIAL" :value="consigneeData.social" />
                       {{consigneeData.socialNumber?('('+consigneeData.socialNumber+')'):''}}
我在何方's avatar
我在何方 committed
61
                    </el-descriptions-item>
我在何方's avatar
我在何方 committed
62
               </el-descriptions>
我在何方's avatar
我在何方 committed
63
                <el-descriptions :column="4" class="card">
我在何方's avatar
我在何方 committed
64
                    <el-descriptions-item :label="$t('运输方式')">
我在何方's avatar
我在何方 committed
65 66
                         <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="list.transportId" />
                    </el-descriptions-item>
我在何方's avatar
我在何方 committed
67
                    <el-descriptions-item :label="$t('出货渠道')" v-if="[3,4].indexOf(list.transportId) > -1">
我在何方's avatar
我在何方 committed
68 69 70 71
                      {{channelName}}
                    </el-descriptions-item>
                 </el-descriptions>
                 <el-descriptions :column="4" class="card">
我在何方's avatar
我在何方 committed
72
                     <el-descriptions-item :label="$t('始发城市')">
我在何方's avatar
我在何方 committed
73 74
                        {{getCity(list.departureId)}}
                     </el-descriptions-item>
我在何方's avatar
我在何方 committed
75
                     <el-descriptions-item :label="$t('目的城市')">
我在何方's avatar
我在何方 committed
76 77 78 79
                        {{getCity(list.objectiveId)}}
                     </el-descriptions-item>
                  </el-descriptions>
                <el-descriptions :column="4" class="card">
我在何方's avatar
我在何方 committed
80
                    <el-descriptions-item :label="$t('线路')">
我在何方's avatar
我在何方 committed
81 82 83
                      {{getRouterNameById(list.lineId)}}
                    </el-descriptions-item>
                 </el-descriptions>
84 85 86 87 88 89 90 91 92 93 94
                 <el-descriptions :column="4" class="card">
                     <el-descriptions-item :label="$t('报价单状态')">
                       <dict-tag :type="DICT_TYPE.ECW_OFFER_STATUS" :value="list.status" />
                     </el-descriptions-item>
                  </el-descriptions>
                  <el-descriptions :column="4" class="card" v-if="list.status==5">
                      <el-descriptions-item :label="$t('输单原因')">
                        {{list.reason}}
                      </el-descriptions-item>
                   </el-descriptions>

我在何方's avatar
我在何方 committed
95 96 97 98
          </div>
        </el-card>

        <el-card class="card">
我在何方's avatar
我在何方 committed
99
          <div slot="header" class="card-title">{{$t('商品信息')}}</div>
我在何方's avatar
我在何方 committed
100 101
          <div style="overflow: auto;">
          <el-table v-loading="loading" border :data="list.offerProdRespVOList">
我在何方's avatar
我在何方 committed
102
                <el-table-column :label="$t('序号')" width="60px" fixed>
我在何方's avatar
我在何方 committed
103 104 105 106
                  <template slot-scope="scope">
                      {{scope.$index + 1}}
                  </template>
                </el-table-column>
我在何方's avatar
我在何方 committed
107 108 109 110
<!--                <el-table-column :label="商品类型" align="center" prop="goodsType" /> -->
                <el-table-column :label="$t('中文品名')" align="center" prop="prodTitleZh" />
                <el-table-column :label="$t('英文品名')" align="center" prop="prodTitleEn" />
                <el-table-column :label="$t('品牌')" width="100px">
我在何方's avatar
我在何方 committed
111
                  <template slot-scope="scope">
我在何方's avatar
我在何方 committed
112
                      <dict-tag :value="scope.row.brand" :type="DICT_TYPE.ECW_IS_BRAND" defaultable />
我在何方's avatar
我在何方 committed
113 114
                  </template>
                </el-table-column>
我在何方's avatar
我在何方 committed
115 116
                <el-table-column :label="$t('件数')" width="90px" prop="num" />
                <el-table-column :label="$t('包装单位')">
我在何方's avatar
我在何方 committed
117
                  <template slot-scope="scope">
118
                      <dict-tag :value="scope.row.unit" :type="DICT_TYPE.ECW_PACKAGING_TYPE" defaultable />
我在何方's avatar
我在何方 committed
119 120
                  </template>
                </el-table-column>
我在何方's avatar
我在何方 committed
121
                <!-- <el-table-column :label="$t('箱规') + '(m)'" width="120px" prop="boxGauge" /> -->
dragondean@qq.com's avatar
dragondean@qq.com committed
122
                <el-table-column :label="$t('体积') + '(m³)'" width="100px" prop="volume" />
我在何方's avatar
我在何方 committed
123
                <el-table-column :label="$t('数量')" width="100px" prop="quantity" />
dragondean@qq.com's avatar
dragondean@qq.com committed
124 125
                <el-table-column :label="$t('重量') + '(kg)'" width="100px" prop="weight" />
                <el-table-column :label="$t('货值') + '(RMB)'" width="100px" prop="worth" />
我在何方's avatar
我在何方 committed
126 127
                <el-table-column :label="$t('商品特性')" width="200px" prop="prodAttrName" />
                 <el-table-column :label="$t('是否预付')">
我在何方's avatar
我在何方 committed
128
                   <template slot-scope="scope">
我在何方's avatar
我在何方 committed
129
                      {{scope.row.isPayAdvance==1?$t('预付'):$t('到付')}}
我在何方's avatar
我在何方 committed
130 131 132
                   </template>
                 </el-table-column>

我在何方's avatar
我在何方 committed
133
                <el-table-column :label="$t('成交价')" width="200px">
134 135
                  <template slot-scope="{row}">
                    <template v-if="row.charging ==1">
Marcus's avatar
Marcus committed
136
                      <template v-if="!row.seaFreight">{{ $t('未报价') }}</template>
137 138
                      <template>{{$t('全包价')}} {{row.oneSeaFreight}} {{currentcyMap[row.seaFreightCurrency]}} / {{unitMap[row.seaFreightVolume]}}</template>
                    </template>
Marcus's avatar
Marcus committed
139
                    <template v-else-if="!row.seaFreight && !row.clearanceFreight">{{ $t('未报价') }}</template>
140 141 142 143 144 145 146 147
                    <template v-else>
                      <div>
                          {{$t('运费')}}{{row.oneSeaFreight}} {{currentcyMap[row.seaFreightCurrency]}} / {{unitMap[row.seaFreightVolume]}}
                      </div>
                      <div>
                          {{$t('清关费')}}{{row.oneClearanceFreight}} {{currentcyMap[row.clearanceFreightCurrency]}} / {{unitMap[row.clearanceFreightVolume]}}
                      </div>
                    </template>
我在何方's avatar
我在何方 committed
148 149 150 151 152 153
                  </template>
                </el-table-column>
              </el-table>
              </div>
        </el-card>
        <el-card class="card">
我在何方's avatar
我在何方 committed
154
          <div slot="header" class="card-title">{{$t('费用小计')}}</div>
我在何方's avatar
我在何方 committed
155
            <el-descriptions border class="card" :column="5">
我在何方's avatar
我在何方 committed
156
              <el-descriptions-item :label="$t('总件数')+':'">
157
                  {{list.estCostVO?list.estCostVO.totalNum||'0':0}}
我在何方's avatar
我在何方 committed
158
              </el-descriptions-item>
我在何方's avatar
我在何方 committed
159
              <el-descriptions-item :label="$t('总体积')+':'">
我在何方's avatar
我在何方 committed
160 161
                {{list.estCostVO?(list.estCostVO.totalVolume+'m³')||'0':0}}
              </el-descriptions-item>
我在何方's avatar
我在何方 committed
162
              <el-descriptions-item :label="$t('总重量')+':'">
我在何方's avatar
我在何方 committed
163 164
                {{list.estCostVO?(list.estCostVO.totalWeight+'kg')||'0':0}}
              </el-descriptions-item>
我在何方's avatar
我在何方 committed
165
              <el-descriptions-item :label="$t('总数量')+':'">
我在何方's avatar
我在何方 committed
166 167
                {{list.estCostVO?list.estCostVO.totalQuantity||'0':0}}
              </el-descriptions-item>
我在何方's avatar
我在何方 committed
168
              <el-descriptions-item :label="$t('总货值(RMB)')+':'">
169
                  {{list.estCostVO?list.estCostVO.totalWorth||'0':0}}
我在何方's avatar
我在何方 committed
170
              </el-descriptions-item>
我在何方's avatar
我在何方 committed
171
<!--              <el-descriptions-item :label="报价费:">
172
                {{list.estCostVO?list.estCostVO.insuranceFee||'0':0}}
我在何方's avatar
我在何方 committed
173
              </el-descriptions-item> -->
我在何方's avatar
我在何方 committed
174 175
          </el-descriptions>
<!--          <el-descriptions border class="card">
我在何方's avatar
我在何方 committed
176
            <el-descriptions-item :label="佣金类型" :span="2" class="card">
我在何方's avatar
我在何方 committed
177 178 179 180
                <dict-selector :type="DICT_TYPE.COMMISSION_TYPE" form-type="radio" fomtter="number"  :value="list.commissionType" defaultable />
            </el-descriptions-item>
          </el-descriptions> -->
        </el-card>
我在何方's avatar
我在何方 committed
181 182 183 184 185
        <el-card class="mt-10">
            <div class="card-title" slot="header">{{$t('预计费用')}}</div>

            <el-descriptions :column="5" border>
                <el-descriptions-item :label="$t('保价费')">
我在何方's avatar
我在何方 committed
186
                    {{list.estCostVO?list.estCostVO.insuranceFee: 0}} {{ selectedRouter ? currentcyMap[selectedRouter.currencyUnit || 1] : '' }}
我在何方's avatar
我在何方 committed
187 188
                </el-descriptions-item>
                <el-descriptions-item :label="$t('总运费')">
我在何方's avatar
我在何方 committed
189
                    <template v-if="freightFeeList.length>0" v-for="item in freightFeeList">
我在何方's avatar
我在何方 committed
190 191 192
                        <div :key="item.currencyId">{{item.amount || 0}}{{currentcyMap[item.currencyId]}}</div>
                    </template>
                </el-descriptions-item>
我在何方's avatar
我在何方 committed
193 194 195
                <template v-if="freightFeeList.length==0">
                    0
                </template>
我在何方's avatar
我在何方 committed
196 197
                <!--代收货款,只有非控货订单、并且线路开通了代收货款后,才显示是否代收货款选项-->
                <el-descriptions-item :label="$t('总清关费')">
我在何方's avatar
我在何方 committed
198
                    <template v-if="clearanceFeeList.length>0" v-for="item in clearanceFeeList">
我在何方's avatar
我在何方 committed
199 200
                        <div :key="item.currencyId">{{item.amount || 0}}{{currentcyMap[item.currencyId]}}</div>
                    </template>
我在何方's avatar
我在何方 committed
201 202 203
                    <template v-if="clearanceFeeList.length==0">
                        0
                    </template>
我在何方's avatar
我在何方 committed
204 205
                </el-descriptions-item>
                <el-descriptions-item :label="$t('其他费用')">
我在何方's avatar
我在何方 committed
206
                   <template v-if="otherFeeList.length>0" v-for="item in otherFeeList">
我在何方's avatar
我在何方 committed
207 208
                       <div :key="item.currencyId">{{item.amount || 0}}{{currentcyMap[item.currencyId]}}</div>
                   </template>
我在何方's avatar
我在何方 committed
209 210 211
                   <template v-if="otherFeeList.length==0">
                       0
                   </template>
我在何方's avatar
我在何方 committed
212 213
                </el-descriptions-item>
                <el-descriptions-item :label="$t('原价')" :span="2">
我在何方's avatar
我在何方 committed
214
                    <template v-if="originalFeeList.length>0" v-for="item in originalFeeList">
我在何方's avatar
我在何方 committed
215 216
                        <div :key="item.currencyId">{{item.amount || 0}}{{currentcyMap[item.currencyId]}}</div>
                    </template>
我在何方's avatar
我在何方 committed
217 218 219
                    <template v-if="originalFeeList.length==0">
                        0
                    </template>
我在何方's avatar
我在何方 committed
220 221 222 223 224 225 226 227 228
                </el-descriptions-item>
            </el-descriptions>


            <div class="card-title" style="padding:20px 0;">{{$t('优惠信息')}}</div>
            <el-table :data="couponList" :show-header="false">
                <el-table-column label="">
                    <template slot-scope="scope">
                        {{scope.$index+1}}.
dragondean@qq.com's avatar
dragondean@qq.com committed
229 230 231 232 233 234
                        {{getProductName(scope.row.prodId)}}
                    </template>
                </el-table-column>
                <el-table-column label="">
                    <template slot-scope="{row}">
                      <dict-tag :type="DICT_TYPE.ECW_COUPON_TYPE" :value="row.type" />
我在何方's avatar
我在何方 committed
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
                    </template>
                </el-table-column>
                <el-table-column label="">
                    <template slot-scope="{row}">
                        {{$l(row, 'title')}}
                    </template>
                </el-table-column>
                <el-table-column label="">
                    <template slot-scope="{row}">
                        -{{row.reduceAmount}}
                        {{currentcyMap[row.reduceCurrencyId]}}
                    </template>
                </el-table-column>
                <el-table-column label="">
                    <template slot-scope="{row}">
                        {{$t('有效期至')}}{{row.endTime ? row.endTime : $t('永久有效')}}
                    </template>
                </el-table-column>
            </el-table>

            <el-descriptions :column="1" class="mt-20">
我在何方's avatar
我在何方 committed
256
                <el-descriptions-item :label="$t('优惠费用')"  v-if="couponTotalAmountList && couponTotalAmountList.length>0">
我在何方's avatar
我在何方 committed
257 258 259 260 261
                    <div v-for="(item, discountIndex) in couponTotalAmountList" :key="discountIndex">
                        {{item.totalAmount}} {{currentcyMap[item.currencyId]}}
                    </div>
                </el-descriptions-item>
                <el-descriptions-item :label="$t('预计费用')">
我在何方's avatar
我在何方 committed
262
                    <template >
我在何方's avatar
我在何方 committed
263 264 265 266 267
                      <div style="display:flex;flex-direction:column">
                        <div v-for="item in estimatedCosts" :key="item.currencyId">
                          <span>{{item.amount || 0}}{{currentcyMap[item.currencyId]}}</span>
                          </div>
                          </div>
我在何方's avatar
我在何方 committed
268 269 270 271
                    </template>
                </el-descriptions-item>
            </el-descriptions>
        </el-card>
我在何方's avatar
我在何方 committed
272
        <el-card class="card">
我在何方's avatar
我在何方 committed
273 274 275
          <div slot="header" class="card-title">{{$t('通用信息')}}</div>
            <el-descriptions :column="4">
              <el-descriptions-item :label="$t('唛头')">
我在何方's avatar
我在何方 committed
276
                  {{list.marks||'/'}}
我在何方's avatar
我在何方 committed
277 278 279 280 281 282 283
              </el-descriptions-item>
              <el-descriptions-item :label="$t('报关方式')">
                  <dict-tag :type="DICT_TYPE.ECW_CUSTOMS_TYPE" :value="list.customsType"></dict-tag>
              </el-descriptions-item>
              </el-descriptions>
            <el-descriptions :column="4">
             <el-descriptions-item :label="$t('预计结束时间')">
我在何方's avatar
我在何方 committed
284
                  {{list.stopTime||'/'}}
我在何方's avatar
我在何方 committed
285 286 287 288 289
              </el-descriptions-item>
              <el-descriptions-item :label="$t('控货')">
                   {{list.control?$t('是'):$t('否')}}
               </el-descriptions-item>
               <el-descriptions-item :label="$t('竞争对手')">
我在何方's avatar
我在何方 committed
290
                  {{list.competitor||'/'}}
我在何方's avatar
我在何方 committed
291 292
                </el-descriptions-item>
                <el-descriptions-item :label="$t('重要程度')">
293
                    <el-rate v-model="list.importance" disabled></el-rate>
我在何方's avatar
我在何方 committed
294 295 296 297 298 299 300 301 302 303 304 305 306
                 </el-descriptions-item>
          </el-descriptions>
          <el-descriptions :column="4">
             <el-descriptions-item :label="$t('价格有效期')">
                 {{list.startTime+$t('至')}}{{list.endTime}}
              </el-descriptions-item>
              <el-descriptions-item :label="$t('交货方式')">
                <dict-tag :type="DICT_TYPE.ECW_TRADE_TYPE" :value="list.tradeType"></dict-tag>
                   <span style="margin-left: 10px;">{{list.tradeAdress}}</span>
               </el-descriptions-item>
          </el-descriptions>
          <el-descriptions >
              <el-descriptions-item :label="$t('备注')">
我在何方's avatar
我在何方 committed
307
                   {{list.remarks||'/'}}
我在何方's avatar
我在何方 committed
308 309 310 311
               </el-descriptions-item>
          </el-descriptions>
        </el-card>
        <el-card class="card" v-if='list.transportVO'>
我在何方's avatar
我在何方 committed
312
          <div slot="header" class="card-title">
我在何方's avatar
我在何方 committed
313
            <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="list.transportId"></dict-tag>
我在何方's avatar
我在何方 committed
314 315
          </div>
          <div class="line">
我在何方's avatar
我在何方 committed
316
            <el-descriptions>
我在何方's avatar
我在何方 committed
317
                <el-descriptions-item :label="[3,4].indexOf(list.transportId)>-1?$t('空运路线'):$t('海运路线')">
我在何方's avatar
我在何方 committed
318
                    {{getRouterNameById(list.lineId)||'/'}}
我在何方's avatar
我在何方 committed
319 320
                </el-descriptions-item>
            </el-descriptions>
我在何方's avatar
我在何方 committed
321
            <el-descriptions v-if="[3,4].indexOf(list.transportId) > -1">
我在何方's avatar
我在何方 committed
322
               <el-descriptions-item :label="$t('出货渠道')">
我在何方's avatar
我在何方 committed
323
                   {{channelName||'/'}}
我在何方's avatar
我在何方 committed
324 325 326
                </el-descriptions-item>
            </el-descriptions>
          </div>
我在何方's avatar
我在何方 committed
327
          <el-descriptions class="card" v-if="[2,3,4].indexOf(list.transportId) > -1">
我在何方's avatar
我在何方 committed
328 329
              <el-descriptions-item :label="$t('是否双清')">
                  <dict-tag :type="DICT_TYPE.ECW_DOUBLE_CLEAR" :value="list.transportVO.doubleClear"></dict-tag>
我在何方's avatar
我在何方 committed
330 331
              </el-descriptions-item>
          </el-descriptions>
我在何方's avatar
我在何方 committed
332
          <el-descriptions v-if="[3,4].indexOf(list.transportId) > -1">
我在何方's avatar
我在何方 committed
333
              <el-descriptions-item :label="$t('航空公司')">
334
                 {{airlineCompany ? $l(airlineCompany, 'company') : '/'}}
我在何方's avatar
我在何方 committed
335 336
              </el-descriptions-item>
          </el-descriptions>
我在何方's avatar
我在何方 committed
337
          <el-descriptions v-if="list.transportId==2">
我在何方's avatar
我在何方 committed
338
              <el-descriptions-item :label="$t('船公司')">
339
                {{shippingCompany ? $l(shippingCompany, 'company') : '/'}}
我在何方's avatar
我在何方 committed
340 341
              </el-descriptions-item>
          </el-descriptions>
我在何方's avatar
我在何方 committed
342
          <el-descriptions v-if="[2,3,4].indexOf(list.transportId) > -1">
我在何方's avatar
我在何方 committed
343 344
              <el-descriptions-item :label="$t('清关证书')">
                 <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="list.transportVO.customsClearCert"></dict-tag>
我在何方's avatar
我在何方 committed
345 346
              </el-descriptions-item>
          </el-descriptions>
我在何方's avatar
我在何方 committed
347
          <el-descriptions v-if="[2,3,4].indexOf(list.transportId) > -1">
我在何方's avatar
我在何方 committed
348
              <el-descriptions-item :label="$t('清关证书备注')">
我在何方's avatar
我在何方 committed
349
                 {{list.transportVO.remarks||'/'}}
我在何方's avatar
我在何方 committed
350 351
              </el-descriptions-item>
          </el-descriptions>
我在何方's avatar
我在何方 committed
352
          <el-descriptions class="card" v-if="[3,4].indexOf(list.transportId) > -1">
我在何方's avatar
我在何方 committed
353 354
              <el-descriptions-item :label="$t('是否拆包')">
                 <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="list.transportVO.isUnpack"></dict-tag>
我在何方's avatar
我在何方 committed
355 356
              </el-descriptions-item>
          </el-descriptions>
我在何方's avatar
我在何方 committed
357
          <el-descriptions v-if="[3,4].indexOf(list.transportId) > -1">
我在何方's avatar
我在何方 committed
358 359
              <el-descriptions-item :label="$t('单票立刻转运')">
                <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="list.transportVO.isSingleTicketTransport"></dict-tag>
我在何方's avatar
我在何方 committed
360

我在何方's avatar
我在何方 committed
361
                   <span style="margin-left:10px;color: #0000FF;">{{$t('注:若只有一件,货到仓库立即发,选“是”,多件需仓库集运待发,选“否”')}}</span>
我在何方's avatar
我在何方 committed
362 363 364
              </el-descriptions-item>

          </el-descriptions>
我在何方's avatar
我在何方 committed
365
          <el-descriptions>
我在何方's avatar
我在何方 committed
366 367
              <el-descriptions-item :label="$t('特殊要求')">
                 <dict-selector  form-type="checkbox"  :type="DICT_TYPE.ORDER_SPECIAL_NEEDS" multiple  v-model="list.transportVO.packageType" :disabled="true" />
我在何方's avatar
我在何方 committed
368 369
              </el-descriptions-item>
          </el-descriptions>
我在何方's avatar
我在何方 committed
370
          <el-descriptions>
我在何方's avatar
我在何方 committed
371
              <el-descriptions-item :label="$t('特殊要求备注')">
我在何方's avatar
我在何方 committed
372
                {{list.transportVO.packageRemarks||'/'}}
我在何方's avatar
我在何方 committed
373 374 375
              </el-descriptions-item>
          </el-descriptions>
        </el-card>
我在何方's avatar
我在何方 committed
376

我在何方's avatar
我在何方 committed
377 378 379 380
  </div>
</template>

<script>
我在何方's avatar
我在何方 committed
381
  import {DICT_TYPE,getDictDatas} from  '@/utils/dict'
我在何方's avatar
我在何方 committed
382 383 384
  import {getOffer,deleteOffer} from '@/api/ecw/offer'
  import {getProductAttrList} from '@/api/ecw/productAttr'
  import {getCustomerList,getCustomer} from '@/api/ecw/customer'
385
   import {getChannelList,getChannel} from '@/api/ecw/channel'
我在何方's avatar
我在何方 committed
386 387 388 389 390
   import {getTradeCityList} from '@/api/ecw/region'
   import {getUnitList} from '@/api/ecw/unit'
   import { getOrder } from '@/api/ecw/order'
   import {getCurrencyList} from '@/api/ecw/currency'
   import {getCustomerContactsSelect} from '@/api/ecw/customerContacts'
391
   import {openedRouterList as getOpenedRouterList} from '@/api/ecw/warehouse'
我在何方's avatar
我在何方 committed
392 393
   import {calculationPrice} from '@/api/ecw/product'
   import {getSupplier, getSupplierPage} from '@/api/ecw/supplier'
我在何方's avatar
我在何方 committed
394 395 396
   import Decimal from 'decimal.js'
   window.Decimal=  Decimal

我在何方's avatar
我在何方 committed
397 398 399 400 401 402 403 404 405 406
  export default {
    name: "detail",
    data() {
      return {
        // 遮罩层
        loading: false,
        list: [],
        types:'package,bag',
        importance:1,
        productAttrList:[],
407
        offerId:0,
我在何方's avatar
我在何方 committed
408
        //发货/收货人信息
我在何方's avatar
我在何方 committed
409
        consigneeData:{},
我在何方's avatar
我在何方 committed
410
        routerList:[],
我在何方's avatar
我在何方 committed
411
        fee:{},
我在何方's avatar
我在何方 committed
412 413
        channelName:'/',
        tradeCityList:[],
我在何方's avatar
我在何方 committed
414
        productNames: {},
我在何方's avatar
我在何方 committed
415 416
        currencyList:[],
        unitList:[],
我在何方's avatar
我在何方 committed
417
        orderData:[],
我在何方's avatar
我在何方 committed
418 419
        consignorData:{},
        customerSource: getDictDatas(DICT_TYPE.CUSTOMER_SOURCE),
我在何方's avatar
我在何方 committed
420 421
        couponAvailableGroupDtoList: [], // 可用优惠
        couponTotalAmountList: [], // 优惠总额
422 423 424 425
        // 航空公司
        airlineCompany: null,
        // 船公司
        shippingCompany: null,
我在何方's avatar
我在何方 committed
426 427
      };
    },
我在何方's avatar
我在何方 committed
428
    computed:{
dragondean@qq.com's avatar
dragondean@qq.com committed
429 430 431 432 433 434 435 436 437
      // 根据id获取商品名称(显示优惠列表的时候用)
      getProductName(){
        return prodId => {
          if(!this.list) return this.$t('未知')
          let row = this.list.offerProdRespVOList.find(item => item.prodId == prodId)
          if(!row) return this.$t('未知')
          return this.$l(row, 'prodTitle')
        }
      },
我在何方's avatar
我在何方 committed
438 439 440 441 442
      selectedRouter(){
          // otherService 1 送货上门,2非控货订单代收货款
          if(!this.list.lineId) return null
          return this.routerList.find(item => item.id == this.list.lineId)
      },
我在何方's avatar
我在何方 committed
443 444 445
      currentcyMap(){
          let map = {}
          this.currencyList.forEach(item => {
446
              map[item.id] = this.$i18n.locale=='zh_CN'?item.titleZh:item.titleEn
我在何方's avatar
我在何方 committed
447 448 449 450 451 452
          })
          return map
      },
      unitMap(){
          let map = {}
          this.unitList.forEach(item => {
453
              map[item.id] = this.$i18n.locale=='zh_CN'?item.titleZh:item.titleEn
我在何方's avatar
我在何方 committed
454 455
          })
          return map
我在何方's avatar
我在何方 committed
456 457
      },
      // 总有优惠金额
我在何方's avatar
我在何方 committed
458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478
    // 总有优惠金额
   // 总有优惠金额
    couponList(){
        let arr = []
        this.couponAvailableGroupDtoList.forEach(item => {
            if(item.couponAvailableDtoList && item.couponAvailableDtoList.length){
                // 只取第一个
                let it = item.couponAvailableDtoList[0]
                arr.push({
                        prodId: item.prodId,
                        type: it.type,
                        titleZh: it.titleZh,
                        titleEn: it.titleEn,
                        endTime: it.endTime,
                        reduceAmount: it.reduceAmount,
                        reduceCurrencyId: it.reduceCurrencyId
                    })
            }
        })
        return arr
    },
我在何方's avatar
我在何方 committed
479 480
      // 计算返回的费用清单
      feeDtoList(){
我在何方's avatar
我在何方 committed
481 482 483 484 485
          if(this.list&&this.list.estCostVO){
            return this.list.estCostVO.feeDtoList || []
          }else{
            return []
          }
我在何方's avatar
我在何方 committed
486 487 488 489 490 491 492 493 494 495 496
      },
      // 清关费
      clearanceFeeList(){
          return this.feeDtoList.filter(item => item.feeType == 2)
      },
      // 运费
      freightFeeList(){
          return this.feeDtoList.filter(item => item.feeType == 1)
      },
      // 其他费用
      otherFeeList(){
我在何方's avatar
我在何方 committed
497
          return this.feeDtoList.filter(item => item.feeType == 3)
我在何方's avatar
我在何方 committed
498 499 500 501 502
      },
      // 原价(清关费 + 运费)
      originalFeeList(){
          let arr = []
          this.clearanceFeeList.forEach(item => {
我在何方's avatar
我在何方 committed
503 504 505 506 507
              let it = {
                  src: this.$t('清关费'),
                  currencyId: item.currencyId,
                  amount: Decimal(item.amount)
              }
我在何方's avatar
我在何方 committed
508 509
              let freight = this.freightFeeList.find(fee => fee.currencyId == item.currencyId)
              if(freight){
我在何方's avatar
我在何方 committed
510
                  it.amount = it.amount.plus(freight.amount)
我在何方's avatar
我在何方 committed
511 512 513
              }
              arr.push(it)
          })
我在何方's avatar
我在何方 committed
514
          // 判断是否有运费单位不在清关费里的
我在何方's avatar
我在何方 committed
515
          this.freightFeeList.forEach(item => {
我在何方's avatar
我在何方 committed
516 517 518 519 520 521
              if(!arr.find(arrItem => arrItem.currencyId == item.currencyId)){
                  arr.push({
                      src: this.$t('未计算的运费'),
                      currencyId: item.currencyId,
                      amount: Decimal(item.amount)
                  })
我在何方's avatar
我在何方 committed
522 523
              }
          })
我在何方's avatar
我在何方 committed
524 525 526 527 528 529
          return arr
      },
      // 预计费用(原价 - 优惠金额)
      estimatedCosts(){
          let arr = []
          this.originalFeeList.forEach(item => {
我在何方's avatar
我在何方 committed
530 531 532 533
              let it = {
                  currencyId: item.currencyId,
                  amount: Decimal(item.amount)
              }
我在何方's avatar
我在何方 committed
534 535
              let coupon = this.couponList.find(coupon => coupon.reduceCurrencyId == item.currencyId)
              if(coupon){
我在何方's avatar
我在何方 committed
536 537
                  it.amount = it.amount.minus(coupon.reduceAmount)
              }
我在何方's avatar
我在何方 committed
538 539
              arr.push(it)
          })
我在何方's avatar
我在何方 committed
540 541 542 543 544 545 546 547 548 549 550
          // 累加保价费
          const insuranceFeeIndex = arr.findIndex(item => item.currencyId == this.insuranceFeeCurrency)
          const insuranceFee = this.list&&this.list.estCostVO&&this.list.estCostVO.insuranceFee
          if(insuranceFeeIndex > -1){
              arr[insuranceFeeIndex].amount = arr[insuranceFeeIndex].amount.plus(insuranceFee || 0)
          }else{
              arr.push({
                  currencyId: this.insuranceFeeCurrency,
                  amount: Decimal(insuranceFee || 0)
              })
          }
我在何方's avatar
我在何方 committed
551

我在何方's avatar
我在何方 committed
552 553 554
          // 累加其他费用
          const otherFeeIndex = arr.findIndex(item => item.currencyId == this.list.otherFeeCurrencyId)
          if(otherFeeIndex > -1){
我在何方's avatar
我在何方 committed
555
              arr[otherFeeIndex].amount = arr[otherFeeIndex].amount.plus(this.list.otherFee || 0)
我在何方's avatar
我在何方 committed
556 557
          }else{
              if(this.list.otherFee>0){
我在何方's avatar
我在何方 committed
558
                arr.push({
我在何方's avatar
我在何方 committed
559 560
                    currencyId: this.list.otherFeeCurrencyId,
                    amount: Decimal(this.list.otherFee || 0)
我在何方's avatar
我在何方 committed
561
                })
我在何方's avatar
我在何方 committed
562 563 564 565 566 567 568 569
              }
          }
          return arr
      },
      // 保价费单位(路线里设置,默认美元)
      insuranceFeeCurrency() {
          return this.selectedRouter?.currencyUnit || 1;
      },
我在何方's avatar
我在何方 committed
570
    },
我在何方's avatar
我在何方 committed
571
    created() {
我在何方's avatar
我在何方 committed
572 573 574
      getCurrencyList().then(res => this.currencyList = res.data)
      getUnitList().then(res => this.unitList = res.data)
      getTradeCityList().then(res => this.tradeCityList = res.data)
我在何方's avatar
我在何方 committed
575 576 577 578 579 580 581
      getProductAttrList().then(res => this.productAttrList = res.data)
      if(this.$route.query.offerId){
        this.offerId = this.$route.query.offerId
        this.getList();
      }
    },
    methods: {
我在何方's avatar
我在何方 committed
582 583 584
      sourceLabel(data){
        let label=''
        var source = this.customerSource.find(item=>item.value==data)
585
        if(source) label = this.$i18n.locale=='zh_CN'?source.label:source.labelEn
我在何方's avatar
我在何方 committed
586 587
        return label
      },
我在何方's avatar
我在何方 committed
588
      checkCode(data){
我在何方's avatar
我在何方 committed
589 590 591
        if(!data){
          return ''
        }
我在何方's avatar
我在何方 committed
592 593 594 595 596
        if(data.indexOf('+')==-1){
        	return '+'+data
        }
        return data
      },
我在何方's avatar
我在何方 committed
597 598 599 600 601
      getOrderData(id) {
        let that = this
        that.loading = true;
        // 执行查询
        getOrder(id).then(response => {
我在何方's avatar
我在何方 committed
602
          that.orderData = response.data;
我在何方's avatar
我在何方 committed
603 604
        });
      },
我在何方's avatar
我在何方 committed
605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623
      getProductListWithDefaultValue(){
          let arr = []
          this.list.offerProdRespVOList.forEach(item => {
              let tmp = {
                "brand":item.brand,
                "unit":item.unit,
                "prodId":item.prodId,
                "num":item.num,
                "quantity":item.quantity,
                "volume":item.volume,
                "weight":item.weight,
                "worth":item.worth,
                "brandType":item.brandType||0,
                "prodAttrIds":item.prodAttrIds
              }
              arr.push(tmp)
          })
          return arr
      },
我在何方's avatar
我在何方 committed
624 625 626 627 628 629
      // 计算商品运费
      calculationPrice(){
          calculationPrice({
              lineId: this.list.lineId,
              transportId: this.list.transportId,
              channelId: this.list.channelId,
我在何方's avatar
我在何方 committed
630
              prodConditionParamList: this.getProductListWithDefaultValue(),
我在何方's avatar
我在何方 committed
631 632 633 634 635 636
              consigneeCustomerContactsId: this.list.consigneeCustomerContactsId,
              consignorCustomerContactsId: this.list.consignorCustomerContactsId,
              customsType: this.list.customsType,
              isCargoControl: this.list.control,
              orderType: this.list.orderType,
          }).then(res => {
我在何方's avatar
我在何方 committed
637 638 639 640 641
              this.$set(this, 'fee', res.data.costDto)
              if(res.data.availableDto){
                this.$set(this, 'couponTotalAmountList', res.data.availableDto.couponTotalAmountList)
                this.$set(this, 'couponAvailableGroupDtoList', res.data.availableDto.couponAvailableGroupDtoList)
              }
我在何方's avatar
我在何方 committed
642 643 644 645
          }).finally(() => {
              this.calculating = false
          })
      },
我在何方's avatar
我在何方 committed
646 647 648 649 650 651 652
      /** 查询列表 */
      getList() {
        let that = this
        that.loading = true;
        // 执行查询
        getOffer(that.offerId).then(response => {
          that.list = response.data;
我在何方's avatar
我在何方 committed
653 654 655
          if(that.list.channelId){
            that.getChannelData()
          }
我在何方's avatar
我在何方 committed
656
          that.calculationPrice()
我在何方's avatar
我在何方 committed
657 658 659
          // if(that.list.orderId){
          //   that.getOrderData(that.list.orderId)
          // }
我在何方's avatar
我在何方 committed
660 661 662 663 664
          getCustomerContactsSelect({ids: [that.list.consignorId, that.list.consigneeId].join(',')}).then((res) => {
               let consignor = res.data.list.find(item => item.customerContactsId == that.list.consignorId)
               if(consignor) that.consignorData=consignor
               let consignee = res.data.list.find(item => item.customerContactsId == that.list.consigneeId)
               if(consignee) that.consigneeData=consignee
我在何方's avatar
我在何方 committed
665
               that.getCnsigneeData()
我在何方's avatar
我在何方 committed
666 667 668 669 670 671 672
          })
          that.list.offerProdRespVOList.forEach((item)=>{
            var arr = item.prodAttrIds.split(',')
            var prodAttrName = []
            arr.forEach((itemValue)=>{
                 var prodAttrCenter = this.productAttrList.filter(items=>items.id==itemValue)
                 if(prodAttrCenter.length>0){
673
                   prodAttrName.push(this.$i18n.locale=='zh_CN'?prodAttrCenter[0].attrName:prodAttrCenter[0].attrNameEn)
我在何方's avatar
我在何方 committed
674 675
                 }
            })
我在何方's avatar
我在何方 committed
676 677 678 679 680 681 682
            if(prodAttrName.length>1){
              item.prodAttrName = prodAttrName.join(',')
            }else if(prodAttrName.length==1){
              item.prodAttrName = prodAttrName[0]
            }else{
              item.prodAttrName = ''
            }
我在何方's avatar
我在何方 committed
683 684 685
          })

          that.loading = false;
我在何方's avatar
我在何方 committed
686

687
          that.getOpenedRouterList()
688 689 690 691 692 693 694 695 696 697 698 699 700 701 702

          if(this.list.transportVO.airlineCompany){
            getSupplier(this.list.transportVO.airlineCompany).then(res=>{
              if(res.data){
                this.airlineCompany = res.data.companyZh
              }
            })
          }
          if(this.list.transportVO.shippingCompany){
            getSupplier(this.list.transportVO.shippingCompany).then(res=>{
              if(res.data){
                this.shippingCompany = res.data.companyZh
              }
            })
          }
我在何方's avatar
我在何方 committed
703 704
        });
      },
我在何方's avatar
我在何方 committed
705 706 707 708
      getCity(id){
        var city = ''
        this.tradeCityList.forEach((item)=>{
          if(item.id == id){
709
            city = this.$i18n.locale=='zh_CN'?item.titleZh:item.titleEn
我在何方's avatar
我在何方 committed
710 711 712 713 714 715 716 717 718
          }
        })
        return city
      },
      getChannelData(){
        getChannel(this.list.channelId).then(res=>{
          this.channelName = res.data.nameZh
        })
      },
719 720 721 722 723 724 725 726 727 728 729 730 731
      // 获取路线
      getOpenedRouterList(){
          let params = {}
          if(this.list.departureId){
              params.startCityId = this.list.departureId
          }
          if(this.list.objectiveId){
              params.destCityId = this.list.objectiveId
          }
          getOpenedRouterList(params).then(res => this.routerList = res.data)
      },
      // 根据线路id显示线路名称
      getRouterNameById(routerId){
我在何方's avatar
我在何方 committed
732 733
            let router = this.routerList.find(item => item.id == routerId)
            if(router){
734
                return this.$i18n.locale=='zh_CN'?router.startTitleZh:router.startTitleEn + ' >>>' + this.$i18n.locale=='zh_CN'?router.destTitleZh:router.destTitleEn
我在何方's avatar
我在何方 committed
735 736
            }
            return '-'
737
      },
我在何方's avatar
我在何方 committed
738 739 740
      // 获取发货/收货人
      getCnsigneeData(){
        let that = this
我在何方's avatar
我在何方 committed
741 742 743 744 745 746
         if(that.consigneeData&&that.consigneeData.customerId){
            getCustomer(that.consigneeData.customerId).then(result=>{
                result.data.source = this.sourceLabel(result.data.source)
                that.$set(that.consigneeData,'source',result.data.source)
                that.$set(that.consigneeData,'address',result.data.address)

我在何方's avatar
我在何方 committed
747
            })
我在何方's avatar
我在何方 committed
748 749 750 751 752 753
        }
        if(that.consignorData&&that.consignorData.customerId){
            getCustomer(that.consignorData.customerId).then(ress=>{
              ress.data.source = this.sourceLabel(ress.data.source)
                that.$set(that.consignorData,'source',ress.data.source)
                that.$set(that.consignorData,'address',ress.data.address)
我在何方's avatar
我在何方 committed
754 755
            })
          }
我在何方's avatar
我在何方 committed
756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778
      },
      /** 跟进按钮操作 */
      handleAdd() {
        this.$router.push({
          path: "/offer/logList",
          query:{
            offerId:this.offerId,
            relationId:this.list.consignorId
          }
        });
      },
      toResult(){
        this.$router.push({
          path: "/offer/result",
          query:{
            offerId:this.offerId,
            number:this.list.number
          }
        });
      },
      /** 删除按钮操作 */
      handleDelete() {
        const offerId = this.offerId;
dragondean@qq.com's avatar
dragondean@qq.com committed
779
        this.$confirm(this.$t('是否确认删除报价单管理编号为')+'"' + offerId + '"'+this.$t('的数据项')+'?').then(function() {
我在何方's avatar
我在何方 committed
780 781 782 783 784
            return deleteOffer(offerId);
          }).then(() => {
            this.$router.push({
              path: "/offer/result"
            });
dragondean@qq.com's avatar
dragondean@qq.com committed
785
            this.$message.success(this.$t("删除成功"));
我在何方's avatar
我在何方 committed
786 787 788
          }).catch(() => {});
      },
    }
我在何方's avatar
我在何方 committed
789
  }
我在何方's avatar
我在何方 committed
790 791
</script>

我在何方's avatar
我在何方 committed
792
<style scoped>
我在何方's avatar
我在何方 committed
793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828
  .card-title{
      font-size: 18px;
      font-weight: bold;
       margin-top: 10px;
  }
  .offer-header{
    padding-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .line{
    display: flex;
    align-items: center;
  }
  .line el-descriptions{
    flex: 1;
  }
  .btn{
    width: 60%;
    display: flex;
    align-items: center;
    justify-content: space-around;
  }
  .title-font{
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
  }
  .title-font label{
    margin-right: 20px;
  }
  .card{
    margin-top: 20px;
  }
</style>