weightDeal.vue 13.9 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 164
<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('送货日期')">
              <span>{{orderData.deliveryDate||$t('')}}</span>
            </el-descriptions-item>
            <el-descriptions-item :label="$t('运输方式')" :span="2">
                <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="orderData.transportId" />
                <span v-if="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, orderData.transportId).cssClass == 'channel'" style="margin-left:10px">{{$t('出货渠道')}}:{{orderData.channelName}}</span>
              </el-descriptions-item>
             <el-descriptions-item :label="$t('始发地')" :span="2">
                 {{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-descriptions :column="4">
            <el-descriptions-item :label="$t('仓库实测')">
              <span style="margin-right:10px">{{(orderData.sumNum||0)+$t('')}}</span>
              <span style="margin-right:10px">{{(orderData.sumVolume||0)+''}}</span>
              <span style="margin-right:10px">{{(orderData.sumWeight||0)+'kg  '}}</span>
              <span>{{(orderData.sumQuantity||0) +$t('')}}</span>
            </el-descriptions-item>
            <el-descriptions-item :label="$t('收费数据')">
              <span style="margin-right:10px">{{(orderData.sumNum||0)+$t('')}}</span>
              <span style="margin-right:10px">{{(orderData.wvolume||0)+''}}</span>
              <span style="margin-right:10px">{{(orderData.vweight||0)+'kg  '}}</span>
              <span>{{(orderData.sumQuantity||0) +$t('')}}</span>
            </el-descriptions-item>
            <el-descriptions-item :label="$t('重货标准')" v-if="type=='order_heavy_cargo_exception'">
              <!--24-02-06 根据浩哥要求该用useWeightUnit字段-->
              {{orderData.useWeightUnit||$t('')}}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('泡货标准')" v-else>
                {{orderData.orgVolumeUnit||$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="orderData.orderItemVOList" :summary-method="getSummaries" show-summary>
        <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('品名')">
          <template slot-scope="scope">
            <p>{{scope.row.prodTitleEn||''}}</p>
            <p>{{scope.row.prodTitleZh||''}}</p>
          </template>
          </el-table-column>
          <el-table-column :label="$t('填单货物信息')">
            <template slot-scope="scope">
              <p>{{$t('品牌')}}<dict-tag :value="scope.row.brandType" :type="DICT_TYPE.ECW_IS_BRAND" /></p>
              <p>{{$t('箱数')}}{{scope.row.num||0}}</p>
              <p>{{$t('体积')}}{{scope.row.volume||0}}CBM</p>
              <p>{{$t('重量')}}{{scope.row.weight||0}}KG</p>
            </template>
            </el-table-column>
            <el-table-column :label="$t('入库货物属性')">
              <template slot-scope="scope">
                 <p>{{$t('箱规')}}{{scope.row.warehouseInInfoVO?scope.row.warehouseInInfoVO.boxGauge:0}}</p>
                 <p>{{$t('品牌')}}
                   <span v-if="scope.row.brandName">{{scope.row.brandName}}</span>
                   <dict-tag v-else :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.feeType" />
                  </p>
                <!-- <p>{{$t('品牌')}}<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.feeType" /></p> -->
                  <p>{{$t('箱数')}}{{scope.row.warehouseInInfoVO?scope.row.warehouseInInfoVO.cartonsNum:0}}&nbsp;&nbsp;</p>
                  <p>{{$t('体积')}}{{scope.row.warehouseInInfoVO?scope.row.warehouseInInfoVO.volume:0}}CBM&nbsp;&nbsp;</p>
                  <p>{{$t('重量')}}{{scope.row.warehouseInInfoVO?scope.row.warehouseInInfoVO.weight:0}}KG
                </p>
              </template>
         </el-table-column>
        <el-table-column :label="$t('重货方数')"  v-if="type=='order_heavy_cargo_exception'">
          <template slot-scope="scope">
            <span>{{scope.row.chargeVolume||0}}CBM</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('泡货方数')" v-if="type!='order_heavy_cargo_exception'">
          <template slot-scope="scope">
            <span>{{scope.row.chargeVolume||0}}CBM</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('重货重量')"  v-if="type=='order_heavy_cargo_exception'">
          <template slot-scope="scope">
            <span>{{scope.row.chargeWeight ||0}}KG</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('泡货重量')" v-if="type!='order_heavy_cargo_exception'" >
          <template slot-scope="scope">
            <span>{{scope.row.chargeWeight ||0}}KG</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('最后操作时间')" scope="handlerTime" />
      </el-table>

    </el-card>
    <el-card v-if="list.orderExceptionStatus==2">
      <div slot="header" class="card-title">{{$t('处理结果')}}</div>
      <el-descriptions :column="1">
          <el-descriptions-item :label="$t('处理时间')">
              {{parseTime(handlerParams.handlerTime)}}
          </el-descriptions-item>
          <el-descriptions-item :label="$t('处理结果')" v-if="type=='order_heavy_cargo_exception'">
              <span v-if="handlerParams.handlerResult=='general_cargo'">{{$t('设为普货')}}</span>
              <span v-else-if="handlerParams.handlerResult=='process'">{{$t('设为已处理')}}</span>
          </el-descriptions-item>
          <el-descriptions-item :label="$t('处理结果')" v-if="type!='order_heavy_cargo_exception'">
              <span v-if="handlerParams.handlerResult=='general_cargo'">{{$t('设为免泡')}}</span>
              <span v-else-if="handlerParams.handlerResult=='process'">{{$t('设为全泡')}}</span>
              <span v-else>{{$t('设为半抛')}}</span>
          </el-descriptions-item>
          <el-descriptions-item :label="$t('备注')">
            {{handlerParams.handlerRemark||"无"}}
          </el-descriptions-item>
      </el-descriptions>
    </el-card>
      <div slot="footer" class="dialog-footer">
        <div v-if="list.orderExceptionStatus!=2">
          <div v-if="type=='order_heavy_cargo_exception'">
            <el-button  type="primary" @click="submit('general_cargo')">{{$t('设为普货')}}</el-button>
            <el-button plain type="primary" @click="submit('process')">{{$t('设为已处理')}}</el-button>
          </div>
          <div v-else>
165 166 167 168 169
            <!---
              240808 按要求隐藏 https://czxy.cpolar.cn/task-view-199.html
              -->
            <!--<el-button  type="primary" @click="submit('general_cargo')">{{$t('设为免泡')}}</el-button>-->

lanbaoming's avatar
lanbaoming committed
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 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 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330
            <el-button plain type="primary" @click="submit('process')">{{$t('设为全泡')}}</el-button>
            <el-button  plain type="primary" @click="submit('half_throw')">{{$t('设为半抛')}}</el-button>
          </div>

        </div>
        <div v-else>
          <el-button plain type="primary" @click="$store.dispatch('tagsView/delCurrentView')">{{$t('返回')}}</el-button>
        </div>
      </div>
      <el-form v-if="list.orderExceptionStatus!=2"  :model="handlerParams" ref="queryForms" size="small" label-width="50px" class="card">
        <el-form-item :label="$t('备注')+':'" size="medium">
          <el-input style="width: 500px;"  type="textarea" v-model="handlerParams.orderExceptionHandlerRemark"  />
        </el-form-item>
      </el-form>

  </div>
</template>

<script>
import {getExceptionById,handlerExceptionByExceptionId,getOrderExcptionResult} from "@/api/ecw/orderException"
import {DICT_TYPE} from  '@/utils/dict'
import {getOrder} from '@/api/ecw/order'
import {getProductBrankPage} from '@/api/ecw/productBrank'
import {getDictData, getDictDatas} from  '@/utils/dict'

export default {
  name: "WeightDeal",
  components: {

  },
  data() {
    return {
      // 遮罩层
      loading: false,
      orderData:{},
      list: {},
      orderId:0,
      type:'',
      branklist:[],
      handlerParams:{
        orderExceptionHandlerRemark:''
      }
    };
  },
  created() {
    if(this.$route.query.id){
      this.id = this.$route.query.id
      this.getList()
    }
    if(this.$route.query.type){
      this.type = this.$route.query.type
    }
    getProductBrankPage({pageNo:1,pageSize:500}).then((data)=>{
      this.branklist=data.data.list
    })
  },
  computed:{
      getDictData(){
          return (type, value) => getDictData(type, value) || {}
      },
  },
  methods: {
    /** 查询列表 */
    getList() {
      this.loading = true;
      // 执行查询
      getExceptionById(this.id).then(response => {
        this.list = response.data;
        this.loading = false;
        if(this.list.orderExceptionStatus==2){
          this.getOrderExcptionResult()
        }
        this.getOrders()
      });
    },
    getBrand(id){
      var brank = this.branklist.find(item=>item.id==id)
      return brank.titleZh||''
    },
    //获取异常结果
    getOrderExcptionResult(){
      getOrderExcptionResult({orderExceptionId:this.id}).then(res=>{
        this.handlerParams = res.data.list[0]
        console.log(this.handlerParams)
      })

    },
    checkCode(data){
      if(data.indexOf('+')==-1){
      	return '+'+data
      }
      return data
    },
    getOrders(){
      getOrder(this.list.orderId).then(response => {
        this.orderData = response.data
      });
    },
    getSummaries(){
      const sums = [];
      if(!this.orderData || !this.orderData.list ||ths.orderData.length==0){
        return sums
      }
      sums[0] = this.$t('小计')
      var orderSum = 0
      var orderV = 0
      var orderW = 0
      var leviteSum = 0
      var leviteV = 0
      var leviteW = 0
      this.orderData.list.forEach((column, index) => {
          orderSum += column.orderSum
          orderV += column.volume
          orderW += column.weight
          leviteSum += column.orderSum
          leviteV += column.volume
          leviteW += column.weight
      });
      sums[1] = ''
      sums[2] = this.$t('下单统计:')+ orderSum+this.$t('')+ orderV +'' + orderW + ' kg'
      sums[3] = this.$t('入仓统计:')+ leviteSum+this.$t('')+ leviteV +'' + leviteW + ' kg'
      sums[4] = ''
      sums[5] = ''
      return sums;
    },
    submit(result){
      handlerExceptionByExceptionId({orderExceptionId:this.list.id,orderExceptionHandlerResult:result,orderExceptionHandlerRemark:this.handlerParams.orderExceptionHandlerRemark}).then(res=>{
          this.$modal.msgSuccess(this.$t("提交成功"));
          this.$store.dispatch('tagsView/delCurrentView')
      })
    }
  }
}
</script>
<style scoped>
  .dialog-footer{
      margin-top: 10px;
  }
  .filelist{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }
  .filelist span{
    width: 48%;
    margin-right: 2%;
    color: #1E98D7;
  }
  .card-title{
      font-size: 18px;
      font-weight: bold;
      margin-top: 10px;
  }
  .card{
    margin-top: 20px;
  }
  p{
    text-align: left;
     margin: 0 !important;
  }
</style>