pending.vue 29.2 KB
Newer Older
lanbaoming's avatar
lanbaoming committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
<template>
  <div class="app-container">
    <!-- 搜索工作栏 -->
    <el-card>
        <div slot="header" class="card-title">{{$t('查看')}}</div>
        <el-descriptions :column="4">
          <el-descriptions-item :label="$t('订单号')">
              {{orderData.orderNo||''}}
          </el-descriptions-item>
            <el-descriptions-item :label="$t('唛头')">
                {{orderData.marks?orderData.marks:$t('')}}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('已到箱数/总箱数')">
                {{orderData.sumNum||0}}/{{orderData.costVO?orderData.costVO.totalNum:0}}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('订单状态')">
              <dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="orderData.status" />
            </el-descriptions-item>
            <el-descriptions-item :label="$t('送货日期')">
               {{orderData.deliveryDate||$t('')}}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('运输方式')">
                <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="orderData.transportId" />
                 <!-- v2.0空运专线,显示出货渠道 -->
                <!-- <span v-if="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, orderData.transportId).cssClass == 'channel'" style="margin-left:10px">{{$t('出货渠道')}}:{{orderData.channelName}}</span> -->
              </el-descriptions-item>
            <!-- v2.0空运专线,显示出货渠道 -->
             <el-descriptions-item :label="$t('出货渠道')" v-if="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, orderData.transportId).cssClass == 'channel'">
                  {{orderData.channelName}}
              </el-descriptions-item>
            <el-descriptions-item :label="$t('始发地')">
                 {{orderData.logisticsInfoDto?orderData.logisticsInfoDto.startTitleZh:$t('')}}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('目的地')">
               {{orderData.logisticsInfoDto?orderData.logisticsInfoDto.destTitleZh:$t('')}}
            </el-descriptions-item>
        </el-descriptions>
        <el-descriptions :column="4">
            <el-descriptions-item :label="$t('发货人')">
                {{orderData.consignorVO?orderData.consignorVO.name||$t(''):$t('')}}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('发货公司')">
                {{orderData.consignorVO?orderData.consignorVO.company||$t(''):$t('')}}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('发货电话')">
                {{orderData.consignorVO?((orderData.consignorVO.countryCode?checkCode(orderData.consignorVO.countryCode):'')+orderData.consignorVO.phone)||$t(''):$t('')}}
            </el-descriptions-item>
          </el-descriptions>
          <el-descriptions :column="4">
            <el-descriptions-item :label="$t('收货人')">
                {{orderData.consigneeVO?orderData.consigneeVO.name||$t(''):$t('')}}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('收货公司')">
                {{orderData.consigneeVO?orderData.consigneeVO.company||$t(''):$t('')}}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('收货电话')">
                {{orderData.consigneeVO?((orderData.consigneeVO.countryCode?checkCode(orderData.consigneeVO.countryCode):'')+orderData.consigneeVO.phone)||$t(''):$t('')}}
            </el-descriptions-item>
        </el-descriptions>
    </el-card>
    <el-card class="card">
      <!-- 列表 -->
      <div slot="header" class="card-title">{{$t('问题详情')}}</div>
      <el-table v-loading="loading" border :data="list">
        <el-table-column :label="$t('序号')" align="center" prop="id" type="index">
          <template slot-scope="scope">
              <span>{{scope.$index + 1}}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('异常类型')" align="center" >
        <template slot-scope="scope">
            <dict-tag :type="DICT_TYPE.ORDER_ERROR_TYPE" :value="scope.row.orderExceptionType" />
          </template>
        </el-table-column>
        <el-table-column :label="$t('异常描述')" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.orderExceptionDescVO">{{$l(scope.row.orderExceptionDescVO, 'desc')}}</span>
            </template>
        </el-table-column>
        <el-table-column :label="$t('金额')" align="center" scope="orderExceptionAmount">
          <template slot-scope="{row}">
            {{row.orderExceptionAmount}}
            {{currencyMap[row.orderExceptionAmountCurrencyId]}}
            </template>
        </el-table-column>
        <el-table-column :label="$t('状态')" align="center">
          <template slot-scope="scope">
              <dict-tag :type="DICT_TYPE.ORDER_EXCEPTION_STATUS" :value="scope.row.orderExceptionStatus" />
            </template>
        </el-table-column>
        <el-table-column :label="$t('附件')" align="center">
          <template slot-scope="scope">
            <div class="filelist">
              <span v-for="(item,index) in scope.row.orderExceptionAttr" :key="index" @click="onClickOpenPreview(item,scope.$index)">{{'附件'+(index+1)}}</span>
            </div>
          </template>
        </el-table-column>
        <el-table-column :label="$t('备注')" align="center">
          <template slot-scope="{row}">
            <el-tooltip class="item" effect="dark" :content="row.orderExceptionNotes" placement="top-start">
              <div class="clamp3">{{row.orderExceptionNotes}}</div>
            </el-tooltip>
          </template>
        </el-table-column>
        <el-table-column :label="$t('处理人')" align="center" prop="userName" />
        <el-table-column :label="$t('处理备注')" align="center" prop="handlerRemark" />
        <el-table-column :label="$t('创建时间')" align="center">
          <template slot-scope="scope">
             <span>{{parseTime(scope.row.createTime)}}</span>
            </template>
          </el-table-column>
        <el-table-column :label="$t('处理时间')" align="center">
          <template slot-scope="scope">
             <span>{{parseTime(scope.row.handlerTime)}}</span>
            </template>
          </el-table-column>
        <el-table-column :label="$t('操作')" align="center">
          <template slot-scope="scope">
            <!-- <el-button v-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType!='order_no_quote_exception'" v-hasPermi="['ecw:exception:seeExceptionInfo']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button> -->
            <el-button v-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='order_superfluous_box_exception'" v-hasPermi="['ecw:exception:superfluousBox']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='order_lack_box_exception'" v-hasPermi="['ecw:exception:lackBox']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='order_pay_exception'" v-hasPermi="['ecw:exception:pay']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='order_miss_exception'" v-hasPermi="['ecw:exception:miss']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='order_superfluous_goods_exception'" v-hasPermi="['ecw:exception:superfluousGoods']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='order_in_water_exception'" v-hasPermi="['ecw:exception:inWater']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='order_damage_exception'" v-hasPermi="['ecw:exception:damaged']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='order_heavy_cargo_exception'" v-hasPermi="['ecw:exception:heavyCargo']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='order_doc_exception'" v-hasPermi="['ecw:exception:doc']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='order_consignor_exception'" v-hasPermi="['ecw:exception:consignor']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='order_other_exception'" v-hasPermi="['ecw:exception:other']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='order_cod_exception'" v-hasPermi="['ecw:exception:cod']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='order_bulky_cargo_exception'" v-hasPermi="['ecw:exception:bulkyCargo']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='order_pick_up_exception'" v-hasPermi="['ecw:exception:pickUp']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='not_customer_service_exception'" v-hasPermi="['ecw:exception:notCustomer']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='goods_add_exception'" v-hasPermi="['ecw:exception:goodsAddException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='fee_exception'" v-hasPermi="['ecw:exception:feeException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>

            <!-- v2.0 -->
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='line_loop_exception'" v-hasPermi="['ecw:exception:lineLoopException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='customs_fee_not_quote_exception'" v-hasPermi="['ecw:exception:notQuoteException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='overweight_exception'" v-hasPermi="['ecw:exception:overweightException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='not_shipping_channel_exception'" v-hasPermi="['ecw:exception:notChannelException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='goods_weight_exception'" v-hasPermi="['ecw:exception:goodsWeightException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='in_warehousing_diff_exception'" v-hasPermi="['ecw:exception:inWarehousingException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='stock_up_exception'" v-hasPermi="['ecw:exception:stockUpException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='channel_exception'" v-hasPermi="['ecw:exception:channelException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='channel_packaging_overweight_exception'" v-hasPermi="['ecw:exception:channelPackagingException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            <!-- v2.0.2 -->
            <el-button v-else-if="scope.row.orderExceptionStatus==2&&scope.row.orderExceptionType=='line_Weight_exception'" v-hasPermi="['ecw:exception:lineWeightException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('查看')}}</el-button>
            
            <el-tag style="margin-left:10px" v-if="scope.row.orderExceptionStatus==2">{{$t('已完成')}}</el-tag>
            <el-button v-else-if="scope.row.orderExceptionType=='order_superfluous_box_exception'" v-hasPermi="['ecw:exception:superfluousBox']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='order_lack_box_exception'" v-hasPermi="['ecw:exception:lackBox']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='order_pay_exception'" v-hasPermi="['ecw:exception:pay']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='order_miss_exception'" v-hasPermi="['ecw:exception:miss']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='order_superfluous_goods_exception'" v-hasPermi="['ecw:exception:superfluousGoods']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='order_in_water_exception'" v-hasPermi="['ecw:exception:inWater']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='order_damage_exception'" v-hasPermi="['ecw:exception:damaged']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='order_heavy_cargo_exception'" v-hasPermi="['ecw:exception:heavyCargo']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='order_doc_exception'" v-hasPermi="['ecw:exception:doc']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='order_consignor_exception'" v-hasPermi="['ecw:exception:consignor']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='order_other_exception'" v-hasPermi="['ecw:exception:other']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='order_cod_exception'" v-hasPermi="['ecw:exception:cod']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
lanbaoming's avatar
lanbaoming committed
164
            <!--处理为报价异常,lanbm 2024-05-28 添加注释-->
lanbaoming's avatar
lanbaoming committed
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
            <el-button v-else-if="scope.row.orderExceptionType=='order_no_quote_exception'" v-hasPermi="['ecw:exception:noQuote']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='order_bulky_cargo_exception'" v-hasPermi="['ecw:exception:bulkyCargo']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='order_pick_up_exception'" v-hasPermi="['ecw:exception:pickUp']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='not_customer_service_exception'" v-hasPermi="['ecw:exception:notCustomer']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='goods_add_exception'" v-hasPermi="['ecw:exception:goodsAddException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='fee_exception'" v-hasPermi="['ecw:exception:feeException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <!-- v2.0 -->
            <el-button v-else-if="scope.row.orderExceptionType=='line_loop_exception'" v-hasPermi="['ecw:exception:lineLoopException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='customs_fee_not_quote_exception'" v-hasPermi="['ecw:exception:notQuoteException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='overweight_exception'" v-hasPermi="['ecw:exception:overweightException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='not_shipping_channel_exception'" v-hasPermi="['ecw:exception:notChannelException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='goods_weight_exception'" v-hasPermi="['ecw:exception:goodsWeightException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='in_warehousing_diff_exception'" v-hasPermi="['ecw:exception:inWarehousingException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='stock_up_exception'" v-hasPermi="['ecw:exception:stockUpException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='channel_exception'" v-hasPermi="['ecw:exception:channelException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
            <el-button v-else-if="scope.row.orderExceptionType=='channel_packaging_overweight_exception'" v-hasPermi="['ecw:exception:channelPackagingException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
          <!-- v2.0.2 -->
          <el-button v-else-if="scope.row.orderExceptionType=='line_weight_exception'" v-hasPermi="['ecw:exception:lineWeightException']" size="mini" type="text" icon="el-icon-edit" @click="handEdit(scope.row)">{{$t('处理')}}</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
    <div class="preview" v-if="IsPreview">
      <file-preview :key="timers" :TragetPic="TragetPic" :FilePreAll="FilePreAll" @Close="onClickClosePreview"></file-preview>
    </div>
  </div>
</template>

<script>
lanbaoming's avatar
lanbaoming committed
194 195 196 197 198 199 200 201
import { getExceptionListByOrderId } from "@/api/ecw/orderException";
import { getCurrencyList } from "@/api/ecw/currency";
import { getOrder } from "@/api/ecw/order";
import FilePreview from "@/components/FilePreview";
import { getProduct } from "@/api/ecw/product";
import { getProductPriceGetPrice } from "@/api/ecw/productPrice";
import { getChannel } from "@/api/ecw/channel";
import { getDictData, getDictDatas } from "@/utils/dict";
lanbaoming's avatar
lanbaoming committed
202 203 204 205

export default {
  name: "Pending",
  components: {
lanbaoming's avatar
lanbaoming committed
206
    FilePreview,
lanbaoming's avatar
lanbaoming committed
207 208 209 210 211
  },
  data() {
    return {
      // 遮罩层
      loading: true,
lanbaoming's avatar
lanbaoming committed
212
      orderData: {},
lanbaoming's avatar
lanbaoming committed
213 214
      // 订单异常列表
      list: [],
lanbaoming's avatar
lanbaoming committed
215 216 217 218 219 220 221
      orderId: 0,
      IsPreview: false, // 控制预览弹窗字段
      timers: "", //时间戳
      FilePreAll: [], // 预览数组
      TragetPic: {},
      currencyList: [],
      channelName: "/",
lanbaoming's avatar
lanbaoming committed
222 223
    };
  },
lanbaoming's avatar
lanbaoming committed
224 225 226 227 228 229 230 231 232 233 234
  computed: {
    currencyMap() {
      let map = {};
      this.currencyList.forEach((item) => {
        map[item.id] = this.$l(item, "title");
      });
      return map;
    },
    getDictData() {
      return (type, value) => getDictData(type, value) || {};
    },
lanbaoming's avatar
lanbaoming committed
235 236
  },
  created() {
lanbaoming's avatar
lanbaoming committed
237 238 239 240 241
    getCurrencyList().then((res) => (this.currencyList = res.data));
    if (this.$route.query.id) {
      this.orderId = this.$route.query.id;
      this.getList();
      this.getOrders();
lanbaoming's avatar
lanbaoming committed
242 243
    }
  },
lanbaoming's avatar
lanbaoming committed
244 245 246 247
  watch: {
    "orderData.channelId"() {
      this.getChannel();
    },
lanbaoming's avatar
lanbaoming committed
248 249 250 251 252 253
  },
  methods: {
    /** 查询列表 */
    getList() {
      this.loading = true;
      // 执行查询
lanbaoming's avatar
lanbaoming committed
254
      getExceptionListByOrderId(this.orderId).then((response) => {
lanbaoming's avatar
lanbaoming committed
255
        this.list = response.data;
lanbaoming's avatar
lanbaoming committed
256 257 258 259 260
        this.list.forEach((item) => {
          if (item.orderExceptionAttr) {
            item.orderExceptionAttr = item.orderExceptionAttr.split(",");
          } else {
            item.orderExceptionAttr = [];
lanbaoming's avatar
lanbaoming committed
261
          }
lanbaoming's avatar
lanbaoming committed
262
        });
lanbaoming's avatar
lanbaoming committed
263 264 265
        this.loading = false;
      });
    },
lanbaoming's avatar
lanbaoming committed
266 267 268 269 270 271 272 273 274 275 276
    getChannel() {
      if (
        !this.order ||
        !this.order.channelId ||
        this.order.transportId == 1 ||
        this.order.transportId == 2
      )
        return;
      getChannel(this.order.channelId).then((res) => {
        this.channelName = res.data.nameZh;
      });
lanbaoming's avatar
lanbaoming committed
277
    },
lanbaoming's avatar
lanbaoming committed
278 279 280
    checkCode(data) {
      if (data.indexOf("+") == -1) {
        return "+" + data;
lanbaoming's avatar
lanbaoming committed
281
      }
lanbaoming's avatar
lanbaoming committed
282
      return data;
lanbaoming's avatar
lanbaoming committed
283
    },
lanbaoming's avatar
lanbaoming committed
284 285 286
    getOrders() {
      getOrder(this.orderId).then((response) => {
        this.orderData = response.data;
lanbaoming's avatar
lanbaoming committed
287 288 289
      });
    },

lanbaoming's avatar
lanbaoming committed
290
    handEdit(row) {
lanbaoming's avatar
lanbaoming committed
291
      // 未报价异常
lanbaoming's avatar
lanbaoming committed
292 293 294 295 296 297 298 299 300 301
      if (
        row.orderExceptionType == "order_no_quote_exception" ||
        row.orderExceptionType == "customs_fee_not_quote_exception"
      ) {
        //清关费未报价异常 customs_fee_not_quote_exception
        if (row.orderItemId) {
          var productData = this.orderData.orderItemVOList.find(
            (item) => item.orderItemId == row.orderItemId
          );
          if (productData) {
lanbaoming's avatar
lanbaoming committed
302 303 304 305
            // if(row.orderExceptionType=='customs_fee_not_quote_exception'&&productData.prodId){
            //   this.$router.push('/product/product-list?prodId=' + productData.prodId)
            //   return
            // }else{
lanbaoming's avatar
lanbaoming committed
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334
            getProduct(productData.prodId).then((res) => {
              let params = {
                product_id: productData.prodId,
                product_type: res.data.typeId,
                transportId: this.orderData.transportId,
                importCity: this.orderData.objectiveVO.objectiveId,
                exportCity: this.orderData.departureVO.departureId,
                startWarehouseId: this.orderData.departureVO.id,
                destWarehouseId: this.orderData.objectiveVO.id,
                lineId: this.orderData.logisticsInfoDto.lineId,
                channelId: this.orderData.logisticsInfoDto.channelId,
              };
              let queryParams = {
                productId: productData.prodId,
                lineId: this.orderData.logisticsInfoDto.lineId,
                channelId: this.orderData.logisticsInfoDto.channelId,
              };
              let url = "";
              if ([3, 4].indexOf(this.orderData.transportId) > -1) {
                //空运价格编辑 lanbm 2024-05-28  添加注释
                url =
                  "../../lineProject/product-price/edit-air?" +
                  new URLSearchParams(params).toString();
              } else {
                //海运价格编辑 lanbm 2024-05-28 添加注释
                url =
                  "../../lineProject/product-price/edit-sea?" +
                  new URLSearchParams(params).toString();
              }
lanbaoming's avatar
lanbaoming committed
335

lanbaoming's avatar
lanbaoming committed
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353
              getProductPriceGetPrice(queryParams).then((res) => {
                console.log(res);
                if (res.data) {
                  if ([3, 4].indexOf(+this.orderData.transportId) > -1) {
                    //空运
                    url =
                      "../../lineProject/product-price/edit-air?action=update&id=" +
                      res.data.id;
                  } else {
                    //海运
                    url =
                      "../../lineProject/product-price/edit-sea?action=update&id=" +
                      res.data.id;
                  }
                }
                return this.$router.push(url);
              });
              /* +productData.prodId
lanbaoming's avatar
lanbaoming committed
354 355 356
                +'&product_type='+res.data.typeId
                +'&transportId='+this.orderData.transportId
                +'&exportCity='+this.orderData.logisticsInfoDto.startCityId+'&importCity='+this.orderData.logisticsInfoDto.destCityId */
lanbaoming's avatar
lanbaoming committed
357 358
            });
            // }
lanbaoming's avatar
lanbaoming committed
359
          }
lanbaoming's avatar
lanbaoming committed
360 361 362 363 364 365 366 367 368 369 370 371
        } else {
          return this.$confirm(
            this.$t("数据缺少orderItemId参数,确定要跳转设置路线价格么?")
          ).then((res) => {
            let url = "";
            if ([3, 4].indexOf(this.orderData.transportId) > -1) {
              url = "../../lineProject/product-price/edit-air?";
            } else {
              url = "../../lineProject/product-price/edit-sea?";
            }
            this.$router.push(url);
          });
lanbaoming's avatar
lanbaoming committed
372 373 374
        }
      }
      // 重泡货异常
lanbaoming's avatar
lanbaoming committed
375 376 377 378
      else if (
        row.orderExceptionType == "order_heavy_cargo_exception" ||
        row.orderExceptionType == "order_bulky_cargo_exception"
      ) {
lanbaoming's avatar
lanbaoming committed
379
        this.$router.push({
lanbaoming's avatar
lanbaoming committed
380 381 382 383 384 385 386 387 388
          path:
            "/order/weightDeal?id=" +
            row.id +
            "&type=" +
            row.orderExceptionType,
        });
      }
      // 其他异常
      else {
lanbaoming's avatar
lanbaoming committed
389
        this.$router.push({
lanbaoming's avatar
lanbaoming committed
390 391 392
          path: "/order/prepayDeal?id=" + row.id,
        });
      }
lanbaoming's avatar
lanbaoming committed
393
    },
lanbaoming's avatar
lanbaoming committed
394 395 396
    getFileName(fileName) {
      var fileArr = fileName.split("/");
      return fileArr[fileArr.length - 1];
lanbaoming's avatar
lanbaoming committed
397
    },
lanbaoming's avatar
lanbaoming committed
398 399 400
    getFileFormat(fileName) {
      var fileArr = this.getFileName(fileName).split(".");
      return fileArr[fileArr.length - 1];
lanbaoming's avatar
lanbaoming committed
401
    },
lanbaoming's avatar
lanbaoming committed
402 403 404 405
    // 打开预览
    onClickOpenPreview(val, index) {
      this.TragetPic = {
        // 当前点击的文件
lanbaoming's avatar
lanbaoming committed
406 407
        FileName: this.getFileName(val), // 文件名称
        name: this.getFileName(val), // 文件名称(可以不传)
lanbaoming's avatar
lanbaoming committed
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426
        format: this.getFileFormat(val), // 文件格式
        url: val, // 预览地址
        downUrl: "", // 下载地址
      }; // 目标对象
      var fileArr = this.list[index].orderExceptionAttr;
      fileArr.forEach((item) => {
        // 需要预览的文件数组(可以传空数组就是单张预览)
        let obj = {
          FileName: this.getFileName(item),
          name: this.getFileName(item),
          format: this.getFileFormat(item),
          url: item,
          downUrl: "",
        };
        this.FilePreAll.push(obj);
      });
      console.log(this.fileArr);
      this.IsPreview = true; // 打开预览弹窗
      this.timers = new Date().getTime(); // 刷新预览地址
lanbaoming's avatar
lanbaoming committed
427
    },
lanbaoming's avatar
lanbaoming committed
428 429 430
    // 关闭预览
    onClickClosePreview(val) {
      this.IsPreview = val; // 由组件内部传入的关闭数据赋值关闭
lanbaoming's avatar
lanbaoming committed
431
    },
lanbaoming's avatar
lanbaoming committed
432 433
  },
};
lanbaoming's avatar
lanbaoming committed
434 435
</script>
<style scoped>
lanbaoming's avatar
lanbaoming committed
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458
.filelist {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  flex-direction: column;
}
.filelist span {
  color: #1e98d7;
}
.card-title {
  font-size: 18px;
  font-weight: bold;
  margin-top: 10px;
}
.card {
  margin-top: 20px;
}
.clamp3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
lanbaoming's avatar
lanbaoming committed
459
</style>