selfNoReportDetail.vue 14.8 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 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 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 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377
<template>
  <div class="app-container">
    <!-- 搜索 -->
    <el-card>
      <div slot="header">
        <div class="card-title">{{$route.query.containerNumber}} - {{ $t('订单费用报表') }}</div>
      </div>
      <el-form
        :model="queryParams"
        ref="queryForm"
        size="small"
        inline
        class="card"
      >
          <el-form-item :label="$t('编号')">
            <el-input v-model="queryParams.numberKey" clearable :placeholder="$t('订单号、唛头、提单号')"></el-input>
          </el-form-item>
          <el-form-item :label="$t('发货人')">
            <el-input v-model="queryParams.consignorKey" :placeholder="$t('发货人名称、手机号')"></el-input>
          </el-form-item>
          <el-form-item :label="$t('收货人')">
            <el-input v-model="queryParams.consigneeKey" :placeholder="$t('收货人名称、手机号')"></el-input>
          </el-form-item>

          <el-form-item>
            <dict-selector :type="DICT_TYPE.ECW_BEGINTIME_TYPE_ENDTIME" :filter="(item) => item.value != 'PickTime'" v-model="dateFilterType" defaultable style="width: 150px; margin-right: 5px" />
            <el-date-picker v-model="dateFilter" type="datetimerange"  range-separator="-"
                :start-placeholder="$t('开始日期')"
                :end-placeholder="$t('结束日期')"
                value-format="yyyy-MM-dd HH:mm:ss"
                @change="handleQuery"
            >
            </el-date-picker>
          </el-form-item>
          <!--<el-form-item :label="$t('运输方式')" prop="transportId">
            <dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model.number="queryParams.transportId" clearable @change="handleQuery"/>
          </el-form-item>-->
          <el-form-item :label="$t('始发仓')">
            <el-select v-model="queryParams.startWarehouseId" :placeholder="$t('请选择')" clearable>
              <el-option
                v-for="item in exportWarehouseList"
                :key="item.id"
                :label="$l(item, 'title')"
                :value="item.id"
              />
            </el-select>
          </el-form-item>
          <el-form-item :label="$t('目的仓')">
            <el-select v-model="queryParams.destWarehouseId" :placeholder="$t('请选择')" clearable>
              <el-option
                v-for="item in importWarehouseList"
                :key="item.id"
                :label="$l(item, 'title')"
                :value="item.id"
              />
            </el-select>
          </el-form-item>
          <el-form-item :label="$t('客户经理')" >
            <user-selector manage v-model="queryParams.salesmanId" clearable @change="handleQuery" :placeholder="$t('请选择')"/>
          </el-form-item>
          <el-form-item :label="$t('订单状态')" prop="status">
            <dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status"
                           @keyup.enter.native="handleQuery" clearable />
          </el-form-item>

          <el-form-item>
            <el-button
              type="primary"
              icon="el-icon-search"
              @click="handleQuery"
            >{{$t('查询')}}</el-button>
            <el-button type="primary" icon="el-icon-plus" @click="handleExport" :loading="exporting">{{$t('导出搜索')}}</el-button>
          </el-form-item>
      </el-form>
    </el-card>
    <el-table v-loading="loading" :data="list" border class="card" :element-loading-text="$t('汇总计算中...')">
      <el-table-column :label="$t('序号')" width="50">
        <template slot-scope="{row, $index}">
          {{startNo + $index}}
        </template>
      </el-table-column>
      <el-table-column :label="$t('订单号')" prop="orderNo" />
      <el-table-column :label="$t('唛头')" prop="marks" />
      <el-table-column :label="$t('始发仓')" prop="startWarehouseName" />
      <el-table-column :label="$t('运输方式') + '/' + $t('目的地')">
        <template slot-scope="{row}">
            <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportId"></dict-tag>
            /{{row.dstWarehouseName}}
        </template>
      </el-table-column>
      <el-table-column :label="$t('仓库实测')">
        <template slot-scope="{row}">
          {{row.sumNum}}{{$t('')}},{{row.sumVolume}}m³,{{row.sumWeight}}kg
        </template>
      </el-table-column>
      <el-table-column :label="$t('是否重泡货')">
        <template slot-scope="{row}">
          <el-tooltip v-if="row.orderType !== 1" effect="dark" :content="row.orderType == 3 ? `${row.vweight}kg` : `${row.wvolume}m³`" placement="top-start">
            <dict-tag :type="DICT_TYPE.ECW_YESNO" :value="row.orderType !== 1 ? '1' : '0'"></dict-tag>
          </el-tooltip>
          <template v-else>{{$t('')}}</template>
        </template>
      </el-table-column>
      <el-table-column :label="$t('收费数据')">
        <template slot-scope="{row}">
          <el-tooltip v-if="row.orderType !== 1" effect="dark" :content="row.orderType == 3 ? `${row.vweight}kg` : `${row.wvolume}m³`" placement="top-start">
            <span>{{row.realityChargeNum}}{{$t('')}},{{row.realityChargeVolume}}m³,{{row.realityChargeWeight}}kg</span>
          </el-tooltip>
          <template v-else>{{row.realityChargeNum}}{{$t('')}},{{row.realityChargeVolume}}m³,{{row.realityChargeWeight}}kg</template>
        </template>
      </el-table-column>
      <el-table-column :label="$t('订单状态')" prop="statusMsg"></el-table-column>
      <el-table-column :label="$t('应收总金额')">
        <template slot-scope="{row}">
          <div v-for="item in row.receivableTotalFeeGroupDtoList || []" :key="item.currencyId">
            {{item.amount}}{{item.currencyName}}
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('订单优惠金额')" width="150">
        <template slot-scope="{row}">
          <div v-for="item in row.discountTotalFeeGroupDtoList || []" :key="item.currencyId">
            {{item.amount}}{{item.currencyName}}
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('实收总金额')" width="150">
        <template slot-scope="{row}">
          <div v-for="item in row.netReceiptsTotalFeeGroupDtoList || []" :key="item.currencyId">
            {{item.amount}}{{item.currencyName}}
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('已收总金额')" width="150">
        <template slot-scope="{row}">
          <div v-for="item in row.writeOffTotalFeeGroupDtoList || []" :key="item.currencyId">
            {{item.amount}}{{item.currencyName}}
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('应收运费')" width="150">
        <template slot-scope="{row}">
          <div v-for="item in row.receivableFreightFeeGroupDtoList || []" :key="item.currencyId">
            {{item.amount}}{{item.currencyName}}
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('运费优惠金额')" width="150">
        <template slot-scope="{row}">
          <div v-for="item in row.discountFreightFeeGroupDtoList || []" :key="item.currencyId">
            {{item.amount}}{{item.currencyName}}
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('实收运费')" width="150">
        <template slot-scope="{row}">
          <div v-for="item in row.netReceiptsFreightFeeGroupDtoList || []" :key="item.currencyId">
            {{item.amount}}{{item.currencyName}}
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('已收运费')" width="150">
        <template slot-scope="{row}">
          <div v-for="item in row.writeOffFreightFeeGroupDtoList || []" :key="item.currencyId">
            {{item.amount}}{{item.currencyName}}
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('应收清关费')" width="150">
        <template slot-scope="{row}">
          <div v-for="item in row.receivableClearanceFeeGroupDtoList || []" :key="item.currencyId">
            {{item.amount}}{{item.currencyName}}
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('实收清关费')" width="150">
        <template slot-scope="{row}">
          <div v-for="item in row.netReceiptsClearanceFeeGroupDtoList || []" :key="item.currencyId">
            {{item.amount}}{{item.currencyName}}
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('清关费优惠金额')" width="150">
        <template slot-scope="{row}">
          <div v-for="item in row.discountClearanceFeeGroupDtoList || []" :key="item.currencyId">
            {{item.amount}}{{item.currencyName}}
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('已收清关费')" width="150">
        <template slot-scope="{row}">
          <div v-for="item in row.writeOffClearanceFeeGroupDtoList || []" :key="item.currencyId">
            {{item.amount}}{{item.currencyName}}
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('应收额外费用')" width="150">
        <template slot-scope="{row}">
          <div v-for="item in row.receivableOtherFeeGroupDtoList || []" :key="item.currencyId">
            {{item.amount}}{{item.currencyName}}
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('实收额外费用')" width="150">
        <template slot-scope="{row}">
          <div v-for="item in row.netReceiptsOtherFeeGroupDtoList || []" :key="item.currencyId">
            {{item.amount}}{{item.currencyName}}
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('额外费用优惠金额')" width="150">
        <template slot-scope="{row}">
          <div v-for="item in row.discountOtherFeeGroupDtoList || []" :key="item.currencyId">
            {{item.amount}}{{item.currencyName}}
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('已收额外费用')" width="150">
        <template slot-scope="{row}">
          <div v-for="item in row.writeOffOtherFeeGroupDtoList || []" :key="item.currencyId">
            {{item.amount}}{{item.currencyName}}
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('是否全部核销')" width="150">
        <template slot-scope="{row}">
          <span v-if="row.writeOffRatio >= 100">{{$t('全部核销')}}</span>
          <span v-else-if="row.writeOffRatio > 0">{{$t('部分核销')}}</span>
          <span v-else>{{$t('未核销')}}</span>
        </template>
      </el-table-column>
      <el-table-column :label="$t('客户经理')" prop="salesmanName"></el-table-column>
      <el-table-column :label="$t('订单入仓时间')" width="150">
        <template slot-scope="{row}">
          {{ row.inTime|parseTime }}
        </template>
      </el-table-column>
      <el-table-column :label="$t('订单装柜时间')" width="150">
        <template slot-scope="{row}">
          {{row.loadTime|parseTime}}
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
    <pagination
      :total="total"
      :page.sync="queryParams.page"
      :limit.sync="queryParams.rows"
      @pagination="getList"
    />
  </div>
</template>

<script>
import { getTradeCityList } from "@/api/ecw/region";
import { getCurrencyPage } from "@/api/ecw/currency";
import {getWarehouseList} from '@/api/ecw/warehouse'
import store from "@/store";
import UserSelector from "@/components/UserSelector/index.vue";
import {exportOrderSummaryByContainerNumber, orderSummaryByContainerNumber} from "@/api/ecw/order";
import {DICT_TYPE} from "@/utils/dict";
import {parseTime} from "@/utils/ruoyi";

export default {
  filters: {parseTime},
  components: {UserSelector},
  name: 'EcwFinancialSelfnoreportdetail',
  data() {
    return {
      loading: false, // 加载中
      dateFilterType: '', //日期筛选类别
      dateFilter: [], //筛选日期
      list: [],
      total: 0,
      queryParams: {
        page: 1,
        rows: 10,
      },
      tradeCityList: [],
      currencyList:[],
      warehouseList:[],
      countryList: [],
      // 导出中状态
      exporting: false
    };
  },
  activated(){
    this.getList();
  },
  created() {
    getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
    getTradeCityList().then((res) => (this.tradeCityList = res.data));
    this.getList();
    getWarehouseList().then(res => this.warehouseList = res.data)
  },
  computed: {
    DICT_TYPE() {
      return DICT_TYPE
    },
    permissions(){
      return store.getters.permissions
    },
    exportCityList() {
      return this.tradeCityList.filter((item) => item.type === 2);
    },
    importCityList() {
      return this.tradeCityList.filter((item) => item.type === 1);
    },
    exportWarehouseList(){
      /* tradeType 1 进口,2出口,3进出口 */
      return this.warehouseList.filter(item => +item.tradeType === 2 || +item.tradeType === 3)
    },
    importWarehouseList(){
      return this.warehouseList.filter(item => +item.tradeType === 1 || +item.tradeType === 3)
    },
    // 序号起始
    startNo(){
      return (this.queryParams.page - 1) * this.queryParams.rows + 1
    }
  },
  methods: {
    getCurrencyLabel(id){
      const item = this.currencyList.find(item => item.id === id);
      if(!item)return ''
      return this.$l(item, 'title')
    },
    /** 查询列表 */
    getList() {
      this.loading = true;
      let params = {...this.queryParams, containerNumber: this.$route.query.containerNumber}
      this.addBeginAndEndTime(params, this.dateFilter, this.dateFilterType, false);
      // 执行查询
      orderSummaryByContainerNumber(params).then((response) => {
        this.list = response.data.list;
        this.total = response.data.total;
        this.loading = false;
      });
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.page = 1;
      this.getList();
    },
    handleReset(){
      this.$refs['queryForm'].resetFields()
      this.dateFilter = []
      this.dateFilterType = ''
      this.handleQuery()
    },
    // 导出搜索
    handleExport(){
      this.exporting = true
      let params = {...this.queryParams, containerNumber: this.$route.query.containerNumber}
      this.addBeginAndEndTime(params, this.dateFilter, this.dateFilterType, false);
      exportOrderSummaryByContainerNumber(params).then(res => {
        this.$download.excel(res, params.containerNumber + '.xls');
      }).finally(() => {
        this.exporting = false
      })
    }
  },
};
</script>

<style scoped>
.card {
  margin-top: 20px;
}
.dialog-footer {
  padding: 40px;
}
.card-title {
  font-size: 18px;
  font-weight: bold;
  display: inline-block;
}
</style>