creatCollection.vue 72 KB
Newer Older
lanbaoming's avatar
lanbaoming committed
1 2 3
<template>
  <div class="app-container">
    <el-form
lanbaoming's avatar
lanbaoming committed
4 5 6 7 8 9
      ref="form"
      :model="form"
      label-width="120px"
      label-position="left"
      :inline="true"
    >
lanbaoming's avatar
lanbaoming committed
10
      <el-card>
lanbaoming's avatar
lanbaoming committed
11 12 13 14 15 16
        <div v-if="id" slot="header" class="card-title">
          {{ $t("修改收款单") }}
        </div>
        <div v-else slot="header" class="card-title">
          {{ $t("新增收款单") }}
        </div>
lanbaoming's avatar
lanbaoming committed
17
        <!-- <el-descriptions :column="3" border>-->
lanbaoming's avatar
lanbaoming committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
        <!-- <el-descriptions-item > -->
        <el-form-item
          style="margin-bottom: 0; margin-top: 20px"
          prop="customerId"
          :span="4"
        >
          <span style="margin-right: 20px"
            ><span style="color: #ff4949">*</span>{{ $t("客户") }}</span
          >
          <customer-selectorpay
            ref="customer"
            v-model="form.customerId"
            @change="customerChange"
          />
        </el-form-item>
        <!--        </el-descriptions-item>
lanbaoming's avatar
lanbaoming committed
34
          <el-descriptions-item > -->
lanbaoming's avatar
lanbaoming committed
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
        <el-form-item
          style="margin-bottom: 0; margin-top: 20px"
          prop="departmentId"
          :span="4"
        >
          <span style="margin-right: 20px"
            ><span style="color: #ff4949">*</span>{{ $t("部门") }}:</span
          >
          <el-select
            v-model="form.departmentId"
            style="width: 300px"
            :placeholder="$t('请选择部门')"
          >
            <el-option
              v-for="item in deptData"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
        <el-form-item
          style="margin-bottom: 0; margin-top: 20px"
          prop="salesmanId"
          :span="4"
        >
          <span style="margin-right: 20px"
            ><span style="color: #ff4949">*</span>{{ $t("业务员") }}:</span
          >
          <el-select
            v-model="form.salesmanId"
            filterable
            :placeholder="$t('请选择业务员')"
            @change="
              (v) =>
                (form.salesmanName = creatorData.find(
                  (t) => t.id === v
                ).nickname)
            "
          >
            <el-option
              v-for="item in creatorData"
              :key="item.id"
              :label="item.nickname"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
        <!-- </el-descriptions-item> -->
        <!-- <el-descriptions-item > -->
        <!--            <el-form-item
lanbaoming's avatar
lanbaoming committed
86 87 88 89 90 91 92 93 94 95
              :label="$t('手续费(RMB)')"
              style="margin-bottom: 0;margin-top: 20px;"
              prop="feeRate"
              :rules="{ required: true, trigger: ['blur', 'change'], message: $t('手续费不能为空') }"
            >
              <el-input
                v-model="form.feeRate"
                :placeholder="$t('请输入手续费')"
              ></el-input>
            </el-form-item> -->
lanbaoming's avatar
lanbaoming committed
96
        <!--          </el-descriptions-item>
lanbaoming's avatar
lanbaoming committed
97
          <el-descriptions-item > -->
lanbaoming's avatar
lanbaoming committed
98 99 100 101 102 103 104 105 106 107 108 109 110
        <el-form-item
          :label="$t('备注') + ':'"
          style="margin-bottom: 0; margin-top: 20px"
          label-width="55px"
          prop="remark"
        >
          <el-input
            style="display: inline-block"
            v-model="form.remark"
            :placeholder="$t('备注')"
          ></el-input>
        </el-form-item>
        <!-- </el-descriptions-item> -->
lanbaoming's avatar
lanbaoming committed
111 112 113
        <!-- </el-descriptions> -->
      </el-card>
      <el-card class="card amountCard">
lanbaoming's avatar
lanbaoming committed
114
        <div slot="header" class="card-title">{{ $t("应收明细") }}</div>
lanbaoming's avatar
lanbaoming committed
115 116 117 118 119 120 121 122 123
        <el-col :span="1.5">
          <el-button
            type="primary"
            plain
            icon="el-icon-plus"
            size="mini"
            @click="handleAdd"
            v-hasPermi="['ecw:voucher:create:add']"
            style="padding: 10px; margin-bottom: 10px"
lanbaoming's avatar
lanbaoming committed
124
            >{{ $t("添加未收客户款项") }}</el-button
lanbaoming's avatar
lanbaoming committed
125 126 127
          >
        </el-col>
        <el-table v-loading="loadings" :data="list" border :key="isUpdate">
lanbaoming's avatar
lanbaoming committed
128 129 130 131 132 133 134 135 136 137
          <el-table-column
            :label="$t('订单号')"
            align="center"
            prop="orderNo"
          />
          <el-table-column
            :label="$t('提单号')"
            align="center"
            prop="tidanNo"
          />
lanbaoming's avatar
lanbaoming committed
138 139 140
          <el-table-column :label="$t('唛头')" align="center" prop="marks" />
          <el-table-column :label="$t('品名')" align="center" prop="title">
            <template slot-scope="scope">
lanbaoming's avatar
lanbaoming committed
141 142 143 144 145
              {{
                scope.row.titleZh
                  ? scope.row.titleZh + "(" + scope.row.titleEn + ")"
                  : ""
              }}
lanbaoming's avatar
lanbaoming committed
146 147 148
            </template>
          </el-table-column>
          <el-table-column :label="$t('箱数')" align="center" prop="num" />
lanbaoming's avatar
lanbaoming committed
149 150 151 152 153 154 155 156 157 158 159 160 161 162
          <el-table-column
            :label="$t('体积/重量')"
            align="center"
            prop="weight"
          >
            <template slot-scope="scope">
              {{ scope.row.volume }}/{{ scope.row.weight }}
            </template>
          </el-table-column>
          <el-table-column
            :label="$t('收入类型')"
            align="center"
            prop="feeType"
          >
lanbaoming's avatar
lanbaoming committed
163 164 165 166 167 168 169
            <template slot-scope="scope">
              <dict-tag
                :type="DICT_TYPE.FEE_TYPE"
                :value="scope.row.feeType"
              ></dict-tag>
            </template>
          </el-table-column>
lanbaoming's avatar
lanbaoming committed
170 171 172 173 174
          <el-table-column
            :label="$t('单价金额')"
            align="center"
            prop="unitPrice"
          >
lanbaoming's avatar
lanbaoming committed
175
            <template slot-scope="scope">
lanbaoming's avatar
lanbaoming committed
176 177 178 179
              <span
                >{{ scope.row.unitPrice
                }}{{ getCurrencyLabel(scope.row.currencyId) }}</span
              >
lanbaoming's avatar
lanbaoming committed
180 181 182
              <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
            </template>
          </el-table-column>
lanbaoming's avatar
lanbaoming committed
183 184 185 186 187
          <el-table-column
            :label="$t('税率%')"
            align="center"
            prop="totalAmount"
          >
lanbaoming's avatar
lanbaoming committed
188
            <template slot-scope="scope">
lanbaoming's avatar
lanbaoming committed
189 190 191 192 193
              <el-input
                type="text"
                v-model="scope.row.taxPoint"
                @input="changeTaxRate(scope.row, scope.$index)"
              ></el-input>
lanbaoming's avatar
lanbaoming committed
194 195
            </template>
          </el-table-column>
lanbaoming's avatar
lanbaoming committed
196 197 198 199 200
          <el-table-column
            :label="$t('不含税金额')"
            align="center"
            prop="totalAmount"
          >
lanbaoming's avatar
lanbaoming committed
201
            <template slot-scope="scope">
lanbaoming's avatar
lanbaoming committed
202 203 204 205
              <span
                >{{ scope.row.totalAmount
                }}{{ getCurrencyLabel(scope.row.currencyId) }}</span
              >
lanbaoming's avatar
lanbaoming committed
206 207
            </template>
          </el-table-column>
lanbaoming's avatar
lanbaoming committed
208 209 210 211 212
          <el-table-column
            :label="$t('含税金额')"
            align="center"
            prop="taxAmount"
          >
lanbaoming's avatar
lanbaoming committed
213
            <template slot-scope="scope">
lanbaoming's avatar
lanbaoming committed
214 215 216 217
              <span
                >{{ scope.row.taxAmount
                }}{{ getCurrencyLabel(scope.row.currencyId) }}</span
              >
lanbaoming's avatar
lanbaoming committed
218 219 220

              <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
            </template>
lanbaoming's avatar
lanbaoming committed
221
          </el-table-column>
lanbaoming's avatar
lanbaoming committed
222 223
          <el-table-column :label="$t('优惠金额')" align="center">
            <template slot-scope="scope">
lanbaoming's avatar
lanbaoming committed
224 225 226 227 228 229 230 231 232 233 234 235
              <span>
                {{
                  scope.row.discountTotal ? `${scope.row.discountTotal}` : 0
                }}</span
              >
              {{ getCurrencyLabel(scope.row.currencyId) }}
              <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
              <span v-if="scope.row.discountTotal">{{
                scope.row.discountRemark
                  ? "(" + scope.row.discountRemark + ")"
                  : ""
              }}</span>
lanbaoming's avatar
lanbaoming committed
236 237 238 239
            </template>
          </el-table-column>
          <el-table-column :label="$t('操作')" align="center">
            <template slot-scope="scope">
lanbaoming's avatar
lanbaoming committed
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
              <el-button
                v-if="scope.row.type !== 'total'"
                type="text"
                v-hasPermi="['ecw:voucher:create:editdiscount']"
                @click="addDiscount(scope.row, scope.$index)"
                >{{
                  scope.row.discountTotal ? $t("修改优惠") : $t("新增优惠")
                }}</el-button
              >
              <el-button
                v-if="scope.row.type !== 'total'"
                type="text"
                v-hasPermi="['ecw:voucher:create:deldiscount']"
                @click="deleteListRow(scope.$index)"
                >{{ $t("删除") }}</el-button
              >
lanbaoming's avatar
lanbaoming committed
256 257 258
            </template>
          </el-table-column>
        </el-table>
lanbaoming's avatar
lanbaoming committed
259
        <!--        <el-descriptions :column="2" border class="card">
lanbaoming's avatar
lanbaoming committed
260
          <el-descriptions-item > -->
lanbaoming's avatar
lanbaoming committed
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
        <el-form-item
          style="margin-bottom: 0; margin-top: 20px"
          prop="openInvoice"
        >
          <span style="margin-right: 20px"
            ><span style="color: #ff4949">*</span
            >{{ $t("是否需要开票") }}:</span
          >
          <el-select
            v-model="form.openInvoice"
            :placeholder="$t('请选择是否需要开票')"
          >
            <el-option :value="1" :label="$t('是')"></el-option>
            <el-option :value="0" :label="$t('否')"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item
          :label="$t('核销基准币种') + ':'"
          style="margin-bottom: 0; margin-top: 20px"
        >
          {{ getCurrencyLabel(showCurrencyId) }}
          <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" /> -->
        </el-form-item>
        <!--          </el-descriptions-item>
lanbaoming's avatar
lanbaoming committed
285 286 287 288 289 290 291
          <el-descriptions-item :label="$t('核销基准币种')">

          </el-descriptions-item>
        </el-descriptions> -->
      </el-card>

      <el-card v-if="showInvoice" class="card">
lanbaoming's avatar
lanbaoming committed
292
        <div slot="header" class="card-title">{{ $t("开票资料") }}</div>
lanbaoming's avatar
lanbaoming committed
293 294 295 296 297 298 299
        <el-descriptions :column="3" border>
          <el-descriptions-item :label="$t('发票抬头')">
            <el-form-item
              label=""
              label-width="0"
              style="margin-bottom: 0"
              prop="invoice"
lanbaoming's avatar
lanbaoming committed
300 301 302 303 304
              :rules="{
                required: true,
                trigger: ['blur', 'change'],
                message: $t('请输入发票抬头'),
              }"
lanbaoming's avatar
lanbaoming committed
305 306 307 308 309 310 311 312 313 314
            >
              <el-input v-model="form.invoice"></el-input>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item :label="$t('纳税人识别号')">
            <el-form-item
              label=""
              label-width="0"
              style="margin-bottom: 0"
              prop="taxpayer"
lanbaoming's avatar
lanbaoming committed
315 316 317 318 319
              :rules="{
                required: true,
                trigger: ['blur', 'change'],
                message: $t('请输入纳税人识别号'),
              }"
lanbaoming's avatar
lanbaoming committed
320 321 322 323 324 325 326 327 328 329
            >
              <el-input v-model="form.taxpayer"></el-input>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item :label="$t('开户行')">
            <el-form-item
              label=""
              label-width="0"
              style="margin-bottom: 0"
              prop="accountBank"
lanbaoming's avatar
lanbaoming committed
330 331 332 333 334
              :rules="{
                required: true,
                trigger: ['blur', 'change'],
                message: $t('请输入开户行'),
              }"
lanbaoming's avatar
lanbaoming committed
335 336 337 338 339 340 341 342 343 344
            >
              <el-input v-model="form.accountBank"></el-input>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item :label="$t('账号')">
            <el-form-item
              label=""
              label-width="0"
              style="margin-bottom: 0"
              prop="accountName"
lanbaoming's avatar
lanbaoming committed
345 346 347 348 349
              :rules="{
                required: true,
                trigger: ['blur', 'change'],
                message: $t('请输入账号'),
              }"
lanbaoming's avatar
lanbaoming committed
350 351 352 353 354 355 356 357 358 359
            >
              <el-input v-model="form.accountName"></el-input>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item :label="$t('项目')">
            <el-form-item
              label=""
              label-width="0"
              style="margin-bottom: 0"
              prop="projectName"
lanbaoming's avatar
lanbaoming committed
360 361 362 363 364
              :rules="{
                required: true,
                trigger: ['blur', 'change'],
                message: $t('请输入项目'),
              }"
lanbaoming's avatar
lanbaoming committed
365 366 367 368 369 370 371 372 373 374
            >
              <el-input v-model="form.projectName"></el-input>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item :label="$t('税率%')">
            <el-form-item
              label=""
              label-width="0"
              style="margin-bottom: 0"
              prop="taxRate"
lanbaoming's avatar
lanbaoming committed
375 376 377 378 379
              :rules="{
                required: true,
                trigger: ['blur', 'change'],
                message: $t('请输入税率'),
              }"
lanbaoming's avatar
lanbaoming committed
380 381 382 383 384 385 386 387 388 389
            >
              <el-input v-model="form.taxRate"></el-input>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item :label="$t('开票地址/电话')">
            <el-form-item
              label=""
              label-width="0"
              style="margin-bottom: 0"
              prop="addressPhone"
lanbaoming's avatar
lanbaoming committed
390 391 392 393 394
              :rules="{
                required: true,
                trigger: ['blur', 'change'],
                message: $t('请输入开票地址/电话'),
              }"
lanbaoming's avatar
lanbaoming committed
395 396 397 398 399 400 401
            >
              <el-input v-model="form.addressPhone"></el-input>
            </el-form-item>
          </el-descriptions-item>
        </el-descriptions>
      </el-card>
      <el-card class="card">
lanbaoming's avatar
lanbaoming committed
402 403 404 405 406 407
        <div slot="header" class="card-title">{{ $t("收款信息") }}</div>
        <el-table
          :data="form.receiptAccountList"
          border
          :key="form.receiptAccountList.length"
        >
lanbaoming's avatar
lanbaoming committed
408 409
          <el-table-column :label="$t('应收币种')" align="center">
            <template slot-scope="scope">
lanbaoming's avatar
lanbaoming committed
410
              {{ getCurrencyLabel(scope.row.currencyId) }}
lanbaoming's avatar
lanbaoming committed
411 412
            </template>
          </el-table-column>
lanbaoming's avatar
lanbaoming committed
413 414 415 416 417
          <el-table-column
            :label="$t('应收金额')"
            align="center"
            prop="receivableAmount"
          >
lanbaoming's avatar
lanbaoming committed
418
            <template slot-scope="scope" v-if="scope.row.type !== 'total'">
lanbaoming's avatar
lanbaoming committed
419 420 421 422 423 424 425 426 427 428
              {{
                `${NP.minus(
                  scope.row.receivableAmount,
                  scope.row.discountTotal || 0
                )}${
                  scope.row.discountTotal > 0
                    ? `(${scope.row.receivableAmount} - ${scope.row.discountTotal})`
                    : ""
                }`
              }}
lanbaoming's avatar
lanbaoming committed
429 430 431 432
            </template>
          </el-table-column>
          <el-table-column align="center">
            <template #header>
lanbaoming's avatar
lanbaoming committed
433 434 435 436 437 438 439
              {{
                $t("核销基准币种") +
                "" +
                getCurrencyLabel(showCurrencyId) +
                "" +
                $t("汇率")
              }}
lanbaoming's avatar
lanbaoming committed
440 441 442
            </template>
            <template slot-scope="scope">
              <template v-if="scope.row.type !== 'total'">
lanbaoming's avatar
lanbaoming committed
443 444 445
                <span v-if="showCurrencyId === scope.row.currencyId">{{
                  scope.row.writeOffRate
                }}</span>
lanbaoming's avatar
lanbaoming committed
446 447 448 449 450 451 452
                <el-form-item
                  v-else
                  label=""
                  label-width="0"
                  style="margin-bottom: 0"
                  :prop="`receiptAccountList.${scope.$index}.writeOffRate`"
                >
lanbaoming's avatar
lanbaoming committed
453 454 455 456
                  <el-input
                    v-model="scope.row.writeOffRate"
                    @input="() => writeOffRateChange(scope.row, scope.$index)"
                  ></el-input>
lanbaoming's avatar
lanbaoming committed
457 458 459
                </el-form-item>
              </template>
              <template v-else>
lanbaoming's avatar
lanbaoming committed
460 461 462 463 464 465
                {{
                  $t("应核销总金额") +
                  "" +
                  getCurrencyLabel(showCurrencyId) +
                  ""
                }}
lanbaoming's avatar
lanbaoming committed
466 467 468 469 470
              </template>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="writeOffAmount">
            <template #header>
lanbaoming's avatar
lanbaoming committed
471 472 473 474 475 476
              {{
                $t("核销基准金额") +
                "" +
                getCurrencyLabel(showCurrencyId) +
                ""
              }}
lanbaoming's avatar
lanbaoming committed
477 478 479 480 481 482 483 484 485 486 487
            </template>
          </el-table-column>
          <el-table-column :label="$t('期望收款账户')" align="center">
            <template slot-scope="scope">
              <el-form-item
                v-if="scope.row.type !== 'total'"
                label=""
                label-width="0"
                style="margin-bottom: 0"
                :prop="`receiptAccountList.${scope.$index}.platformAccountId`"
              >
lanbaoming's avatar
lanbaoming committed
488
                <!--                <el-select
lanbaoming's avatar
lanbaoming committed
489 490 491 492 493 494 495 496 497 498 499 500
                  v-model="scope.row.platformAccountId"
                  :placeholder="$t('请选择收款账户')"
                  @change="(platformAccountId)=>changePlatformAccountId(platformAccountId,scope.$index)"
                >
                  <el-option
                    v-for="item in bankData"
                    :key="item.id"
                    :label="item.baAccountName + '(' + item.baAccountNum + ')'"
                    :value="item.id"
                  />
                </el-select> -->
                <el-select
lanbaoming's avatar
lanbaoming committed
501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517
                  filterable
                  clear
                  v-model="scope.row.platformAccountId"
                  :placeholder="$t('请选择收款账户')"
                  @change="
                    (platformAccountId) =>
                      changePlatformAccountId(platformAccountId, scope.$index)
                  "
                  v-el-select-loadmore="loadmore"
                  :loading="codeLoading"
                >
                  <el-option
                    v-for="(item, i) in bankData"
                    :key="'opt-code' + i"
                    :label="item.baAccountName + '(' + item.baAccountNum + ')'"
                    :value="item.id"
                  ></el-option>
lanbaoming's avatar
lanbaoming committed
518 519 520 521 522 523 524 525 526 527 528 529 530
                </el-select>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column :label="$t('期望收款币种')" align="center">
            <template slot-scope="scope">
              <el-form-item
                v-if="scope.row.type !== 'total'"
                label=""
                label-width="0"
                style="margin-bottom: 0"
                :prop="`receiptAccountList.${scope.$index}.collectionCurrencyId`"
              >
lanbaoming's avatar
lanbaoming committed
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546
                <el-select
                  v-model="scope.row.collectionCurrencyId"
                  :placeholder="$t('请选择')"
                  @change="
                    (val) => currencyIdChange(val, scope.row, scope.$index)
                  "
                >
                  <el-option
                    v-for="item in currencyList"
                    :key="item.id"
                    :label="
                      $i18n.locale == 'zh_CN' ? item.titleZh : item.titleEn
                    "
                    :value="item.id"
                  />
                </el-select>
lanbaoming's avatar
lanbaoming committed
547 548 549 550
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column :label="$t('期望收款汇率')" align="center">
lanbaoming's avatar
lanbaoming committed
551
            <!--lanbm 2024-05-06 汇率保留小数增加到6位,为了方便显示,加宽此列的显示-->
lanbaoming's avatar
lanbaoming committed
552
            <template slot-scope="scope" style="width: 200px">
lanbaoming's avatar
lanbaoming committed
553 554 555 556 557 558 559
              <el-form-item
                v-if="scope.row.type !== 'total'"
                label=""
                label-width="0"
                style="margin-bottom: 0"
                :prop="`receiptAccountList.${scope.$index}.collectionRate`"
              >
lanbaoming's avatar
lanbaoming committed
560 561 562 563
                <el-input
                  v-model="scope.row.collectionRate"
                  @input="() => rateChange(scope.row, scope.$index)"
                ></el-input>
lanbaoming's avatar
lanbaoming committed
564
              </el-form-item>
lanbaoming's avatar
lanbaoming committed
565
              <span v-else>{{ $t("期望收费金额") }}</span>
lanbaoming's avatar
lanbaoming committed
566 567
            </template>
          </el-table-column>
lanbaoming's avatar
lanbaoming committed
568 569 570 571 572
          <el-table-column
            :label="$t('期望收款金额')"
            align="center"
            prop="collectionAmount"
          >
lanbaoming's avatar
lanbaoming committed
573
            <template slot-scope="scope">
lanbaoming's avatar
lanbaoming committed
574 575 576
              <span v-if="scope.row.type !== 'total'">{{
                scope.row.collectionAmount
              }}</span>
lanbaoming's avatar
lanbaoming committed
577
              <div v-else>
lanbaoming's avatar
lanbaoming committed
578 579 580 581 582 583 584 585 586 587 588 589 590
                <div v-for="itemAmount in scope.row.collectionAmount">
                  {{
                    $i18n.locale == "zh_CN"
                      ? itemAmount
                        ? itemAmount.currencyNameZh
                        : ""
                      : itemAmount
                      ? itemAmount.currencyNameEn
                      : ""
                  }}:
                  {{ itemAmount && itemAmount.amount ? itemAmount.amount : 0 }}
                </div>
                <!--                <div v-if="scope.row.collectionAmount[1]">{{ $t('人民币') }}: {{ scope.row.collectionAmount[1].toFixed(6) }}</div>
lanbaoming's avatar
lanbaoming committed
591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609
                <div v-if="scope.row.collectionAmount[2]">{{ $t('奈拉') }}: {{ scope.row.collectionAmount[2].toFixed(6) }}</div>
                <div v-if="scope.row.collectionAmount[3]">{{ $t('西非法郎') }}: {{ scope.row.collectionAmount[3].toFixed(6) }}</div> -->
              </div>
              <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
            </template>
          </el-table-column>
        </el-table>
        <el-descriptions :column="2" border class="card">
          <el-descriptions-item :label="$t('账单汇率有效期')">
            <el-form-item
              label=""
              label-width="0"
              style="margin-bottom: 0"
              prop="rateValidateDate"
            >
              <el-date-picker
                v-model="form.rateValidateDate"
                type="datetime"
                value-format="yyyy-MM-dd HH:mm:ss"
lanbaoming's avatar
lanbaoming committed
610 611
                :placeholder="$t('选择日期时间')"
              >
lanbaoming's avatar
lanbaoming committed
612 613 614 615 616 617
              </el-date-picker>
            </el-form-item>
          </el-descriptions-item>
        </el-descriptions>
      </el-card>
    </el-form>
lanbaoming's avatar
lanbaoming committed
618
    <!--    <div slot="footer" style="margin: 20px 0">
lanbaoming's avatar
lanbaoming committed
619 620 621 622
      <el-button v-if="id==0||form.state==0" type="primary" :loading="saveBtnLoading" @click="submitForm(1)">{{ $t('保存草稿') }}</el-button>
      <el-button v-else type="primary" :loading="saveBtnLoading" @click="$store.dispatch('tagsView/delCurrentView')">{{ $t('返回') }}</el-button>
      <el-button type="primary" :loading="saveBtnLoading" @click="submitForm(0)">{{ id&&form.state!=0 ? $t('修改') : $t('新增收款单') }}</el-button>
    </div> -->
lanbaoming's avatar
lanbaoming committed
623 624
    <div slot="header" class="bpm-title">{{ $t("审核流程") }}</div>
    <work-flow xmlkey="merge_order" v-model="form.copyUserList"></work-flow>
lanbaoming's avatar
lanbaoming committed
625 626

    <div slot="footer" style="margin: 20px 0">
lanbaoming's avatar
lanbaoming committed
627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652
      <el-button
        type="primary"
        @click="submitForm(0)"
        v-hasPermi="['ecw:voucher:create:sumbit']"
        >{{ $t("提交申请") }}</el-button
      >
      <el-button
        v-if="id == 0 || form.state == 0"
        type="primary"
        :loading="saveBtnLoading"
        v-hasPermi="['ecw:voucher:create:save']"
        @click="submitForm(1)"
        >{{ $t("保存草稿") }}</el-button
      >
      <el-button
        v-if="orderData.inWarehouseState == 207"
        type="primary"
        v-hasPermi="['ecw:voucher:create:see']"
        @click="
          $router.push(
            `/bpm/process-instance/detail?id=` +
              orderApprovalBackVO.applyingFormId
          )
        "
        >{{ $t("审核中") }}</el-button
      >
lanbaoming's avatar
lanbaoming committed
653
      <!-- <el-button v-if="orderData.inWarehouseState==207" plain type="primary" @click="dialogVisible = true">{{$t('取消审核')}}</el-button> -->
lanbaoming's avatar
lanbaoming committed
654 655 656 657 658 659
      <el-button
        plain
        type="primary"
        @click="$store.dispatch('tagsView/delCurrentView')"
        >{{ $t("返回") }}</el-button
      >
lanbaoming's avatar
lanbaoming committed
660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766
      <!-- <el-button type="primary" :loading="saveBtnLoading" @click="submitForm(0)">{{ id&&form.state!=0 ? $t('修改') : $t('新增收款单') }}</el-button> -->
    </div>
    <el-dialog
      :visible.sync="open"
      :title="$t('添加未收客户款项')"
      width="80%"
      append-to-body
      @open="getList"
    >
      <div>
        <!-- <div slot="header" class="card-title">{{ $t('添加未收客户款项') }}</div> -->
        <!-- 搜索工作栏 -->
        <el-form
          v-if="open"
          :model="queryParams"
          ref="queryForm"
          size="small"
          :inline="true"
          label-width="80px"
        >
          <el-row>
            <el-form-item :label="$t('始发仓')">
              <el-select
                v-model="queryParams.departureId"
                :placeholder="$t('请选择始发地')"
              >
                <el-option
                  v-for="item in expoerCityList"
                  :label="item.titleZh"
                  :value="item.id"
                  :key="item.id"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item :label="$t('目的仓')">
              <el-select
                v-model="queryParams.objectiveId"
                :placeholder="$t('请选择始发地')"
              >
                <el-option
                  v-for="item in importCityList"
                  :label="item.titleZh"
                  :value="item.id"
                  :key="item.id"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item :label="$t('运输方式')">
              <dict-selector
                :type="DICT_TYPE.ECW_TRANSPORT_TYPE"
                v-model="queryParams.transportId"
                formatter="number"
              />
            </el-form-item>
            <el-form-item :label="$t('出货渠道')">
              <el-select
                v-model="queryParams.channelId"
                :placeholder="$t('请选择出货渠道')"
              >
                <el-option
                  v-for="item in channelList"
                  :label="item.nameZh"
                  :value="item.channelId"
                  :key="item.channelId"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-row>
          <el-row>
            <el-form-item :label="$t('报关方式')">
              <dict-selector
                :type="DICT_TYPE.ECW_CUSTOMS_TYPE"
                v-model="queryParams.customsType"
              />
            </el-form-item>
            <el-form-item :label="$t('控货')">
              <dict-selector
                :type="DICT_TYPE.INFRA_BOOLEAN_STRING"
                v-model="queryParams.control"
              />
            </el-form-item>
            <el-form-item :label="$t('客户名称')">
              <customer-selector
                v-model="queryParams.customerId"
                @change="consignor = $event"
              />
            </el-form-item>
          </el-row>
          <el-form-item :label="$t('订单编号')" prop="orderNo">
            <el-input
              v-model="queryParams.orderNo"
              :placeholder="$t('请输入订单编号')"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>

          <el-form-item :label="$t('提单号')" prop="tidanNo">
            <el-input
              v-model="queryParams.tidanNo"
              :placeholder="$t('请输入提单号')"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>

          <el-form-item>
lanbaoming's avatar
lanbaoming committed
767 768 769 770 771
            <el-button
              type="primary"
              icon="el-icon-search"
              @click="handleQuery"
              >{{ $t("查询") }}</el-button
lanbaoming's avatar
lanbaoming committed
772 773 774 775 776 777 778 779 780 781 782 783
            >
          </el-form-item>
        </el-form>
        <el-table
          ref="multipleTable"
          v-loading="loading1"
          :data="orderData"
          border
          @selection-change="handleSelectionChange"
          row-key="id"
          height="calc(100vh - 480px)"
        >
lanbaoming's avatar
lanbaoming committed
784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799
          <el-table-column
            type="selection"
            width="55"
            :reserve-selection="true"
          >
          </el-table-column>
          <el-table-column
            :label="$t('订单号')"
            align="center"
            prop="orderNo"
          />
          <el-table-column
            :label="$t('提单号')"
            align="center"
            prop="tidanNo"
          />
lanbaoming's avatar
lanbaoming committed
800 801 802
          <el-table-column :label="$t('唛头')" align="center" prop="marks" />
          <el-table-column :label="$t('品名')" align="center" prop="title">
            <template slot-scope="scope">
lanbaoming's avatar
lanbaoming committed
803 804 805 806 807
              {{
                scope.row.titleZh
                  ? scope.row.titleZh + "(" + scope.row.titleEn + ")"
                  : ""
              }}
lanbaoming's avatar
lanbaoming committed
808 809 810
            </template>
          </el-table-column>
          <el-table-column :label="$t('箱数')" align="center" prop="num" />
lanbaoming's avatar
lanbaoming committed
811 812 813 814 815
          <el-table-column
            :label="$t('体积/重量')"
            align="center"
            prop="weight"
          >
lanbaoming's avatar
lanbaoming committed
816
            <template slot-scope="scope">
lanbaoming's avatar
lanbaoming committed
817 818 819 820 821 822 823 824 825 826 827 828 829
              {{ scope.row.volume }}/{{ scope.row.weight }}
            </template>
          </el-table-column>
          <el-table-column
            :label="$t('发货人')"
            align="center"
            prop="consignorName"
          />
          <el-table-column
            :label="$t('收货人')"
            align="center"
            prop="consigneeName"
          />
lanbaoming's avatar
lanbaoming committed
830 831 832 833 834 835 836 837
          <el-table-column :label="$t('订单状态')" align="center" prop="status">
            <template slot-scope="scope">
              <dict-tag
                :type="DICT_TYPE.ORDER_STATUS"
                :value="scope.row.status"
              />
            </template>
          </el-table-column>
lanbaoming's avatar
lanbaoming committed
838 839 840 841 842
          <el-table-column
            :label="$t('收入类型')"
            align="center"
            prop="feeType"
          >
lanbaoming's avatar
lanbaoming committed
843 844 845 846 847 848 849 850 851 852
            <template slot-scope="scope">
              <dict-tag
                :type="DICT_TYPE.FEE_TYPE"
                :value="scope.row.feeType"
              ></dict-tag>
            </template>
          </el-table-column>
          <!-- <el-table-column :label="$t('单价美元')" align="center" prop="unitPrice" /> -->
          <el-table-column :label="$t('单价')" align="center" prop="unitPrice">
            <template slot-scope="scope">
lanbaoming's avatar
lanbaoming committed
853 854 855 856
              <span
                >{{ scope.row.unitPrice
                }}{{ getCurrencyLabel(scope.row.currencyId) }}</span
              >
lanbaoming's avatar
lanbaoming committed
857 858 859
              <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
            </template>
          </el-table-column>
lanbaoming's avatar
lanbaoming committed
860 861 862 863 864
          <el-table-column
            :label="$t('总金额')"
            align="center"
            prop="totalAmount"
          >
lanbaoming's avatar
lanbaoming committed
865
            <template slot-scope="scope">
lanbaoming's avatar
lanbaoming committed
866 867 868 869
              <span
                >{{ scope.row.totalAmount
                }}{{ getCurrencyLabel(scope.row.currencyId) }}</span
              >
lanbaoming's avatar
lanbaoming committed
870 871 872 873 874 875 876 877 878 879 880 881 882
              <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
            </template>
          </el-table-column>
        </el-table>
        <pagination
          v-show="total > 0"
          :total="total"
          :page.sync="queryParams.page"
          :limit.sync="queryParams.rows"
          @pagination="getList"
        />
        <!-- </el-card> -->
        <div slot="footer" class="dialog-footer">
lanbaoming's avatar
lanbaoming committed
883 884 885 886
          <el-button type="primary" @click="saveSelectList">{{
            $t("确认添加")
          }}</el-button>
          <el-button @click="hiddenDialog">{{ $t("取消") }}</el-button>
lanbaoming's avatar
lanbaoming committed
887 888 889
        </div>
      </div>
    </el-dialog>
lanbaoming's avatar
lanbaoming committed
890 891 892 893 894 895 896
    <el-dialog
      v-if="discountVisible"
      :visible.sync="discountVisible"
      :title="$t('优惠信息确认')"
      width="60%"
      append-to-body
    >
lanbaoming's avatar
lanbaoming committed
897 898 899 900 901
      <el-form label-width="120px">
        <el-form-item v-if="form.receiptNo" :label="$t('收款单号')">
          {{ form.receiptNo }}
        </el-form-item>
        <el-table :data="[selectListRow]" border style="margin-bottom: 22px">
lanbaoming's avatar
lanbaoming committed
902 903 904 905 906
          <el-table-column
            :label="$t('订单号')"
            align="center"
            prop="orderNo"
          />
lanbaoming's avatar
lanbaoming committed
907 908 909
          <el-table-column :label="$t('唛头')" align="center" prop="marks" />
          <el-table-column :label="$t('品名')" align="center" prop="title">
            <template slot-scope="scope">
lanbaoming's avatar
lanbaoming committed
910 911 912 913 914
              {{
                scope.row.titleZh
                  ? scope.row.titleZh + "(" + scope.row.titleEn + ")"
                  : ""
              }}
lanbaoming's avatar
lanbaoming committed
915 916 917
            </template>
          </el-table-column>
          <el-table-column :label="$t('箱数')" align="center" prop="num" />
lanbaoming's avatar
lanbaoming committed
918 919 920 921 922
          <el-table-column
            :label="$t('体积/重量')"
            align="center"
            prop="weight"
          >
lanbaoming's avatar
lanbaoming committed
923
            <template slot-scope="scope">
lanbaoming's avatar
lanbaoming committed
924 925 926 927 928 929 930 931
              {{ scope.row.volume }}/{{ scope.row.weight }}
            </template>
          </el-table-column>
          <el-table-column
            :label="$t('收入类型')"
            align="center"
            prop="feeType"
          >
lanbaoming's avatar
lanbaoming committed
932 933 934 935 936 937 938
            <template slot-scope="scope">
              <dict-tag
                :type="DICT_TYPE.FEE_TYPE"
                :value="scope.row.feeType"
              ></dict-tag>
            </template>
          </el-table-column>
lanbaoming's avatar
lanbaoming committed
939 940 941 942 943
          <el-table-column
            :label="$t('单价金额')"
            align="center"
            prop="unitPrice"
          >
lanbaoming's avatar
lanbaoming committed
944
            <template slot-scope="scope">
lanbaoming's avatar
lanbaoming committed
945 946 947 948
              <span
                >{{ scope.row.unitPrice
                }}{{ getCurrencyLabel(scope.row.currencyId) }}</span
              >
lanbaoming's avatar
lanbaoming committed
949 950 951
              <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
            </template>
          </el-table-column>
lanbaoming's avatar
lanbaoming committed
952 953 954 955 956
          <el-table-column
            :label="$t('总金额')"
            align="center"
            prop="totalAmount"
          >
lanbaoming's avatar
lanbaoming committed
957
            <template slot-scope="scope">
lanbaoming's avatar
lanbaoming committed
958 959 960 961
              <span
                >{{ scope.row.taxAmount
                }}{{ getCurrencyLabel(scope.row.currencyId) }}</span
              >
lanbaoming's avatar
lanbaoming committed
962 963 964 965 966
              <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
            </template>
          </el-table-column>
        </el-table>
        <el-form-item :label="$t('总金额')">
lanbaoming's avatar
lanbaoming committed
967 968
          {{ selectListRow.taxAmount
          }}{{ getCurrencyLabel(selectListRow.currencyId) }}
lanbaoming's avatar
lanbaoming committed
969 970
        </el-form-item>
        <el-form-item :label="$t('优惠金额')">
lanbaoming's avatar
lanbaoming committed
971 972 973 974 975 976 977 978 979
          <el-input
            v-model="discountForm.discountTotal"
            type="number"
            min="0"
            :max="selectListRow.totalAmount"
            @input="checkDiscount"
            style="width: 300px"
          ></el-input>
          &nbsp;&nbsp;{{ getCurrencyLabel(selectListRow.currencyId) }}
lanbaoming's avatar
lanbaoming committed
980 981
        </el-form-item>
        <el-form-item :label="$t('优惠原因')">
lanbaoming's avatar
lanbaoming committed
982 983 984 985 986
          <el-input
            v-model="discountForm.discountRemark"
            type="textarea"
            style="width: 300px"
          ></el-input>
lanbaoming's avatar
lanbaoming committed
987 988
        </el-form-item>
        <el-form-item :label="$t('优惠后')">
lanbaoming's avatar
lanbaoming committed
989 990 991 992 993 994
          {{
            (
              selectListRow.taxAmount - (discountForm.discountTotal || 0)
            ).toFixed(2)
          }}
          {{ getCurrencyLabel(selectListRow.currencyId) }}
lanbaoming's avatar
lanbaoming committed
995 996 997 998 999 1000 1001 1002 1003
        </el-form-item>
        <el-form-item v-if="opnotice" :label="$t('操作人')">
          {{ discountForm.author }}
        </el-form-item>
        <el-form-item v-if="opnotice" :label="$t('操作时间')">
          {{ discountForm.time }}
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
lanbaoming's avatar
lanbaoming committed
1004 1005 1006 1007
        <el-button type="primary" @click="saveDiscount">{{
          $t("提交")
        }}</el-button>
        <el-button @click="cancelDiscount">{{ $t("取消") }}</el-button>
lanbaoming's avatar
lanbaoming committed
1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listSimpleUsers } from "@/api/system/user";
import { DICT_TYPE } from "@/utils/dict";
import { getToken } from "@/utils/auth";
import CustomerSelector from "@/components/CustomerSelector";
import CustomerSelectorpay from "@/components/CustomerSelectorpay";
import { getBankAccountPage } from "@/api/ecw/bankAccount";
import { listSimpleDepts } from "@/api/system/dept";
import { getChannelList } from "@/api/ecw/channel";
import { getTradeCityList } from "@/api/ecw/region";
lanbaoming's avatar
lanbaoming committed
1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037
import {
  createReceipt,
  getReceivableByOrderId,
  getReceivableList,
  getReceivableItemDetail,
  getReceiptInfoByIds,
  getReceiptAccountList,
  getInvoicingItem,
  updateReceipt,
  updateReceivableDiscountById,
  getReceivableDiscountLogById,
} from "@/api/ecw/financial";
import { getCustomer } from "@/api/ecw/customer";
import NP from "number-precision";
import { getOrder, getDestCountryByOrderId } from "@/api/ecw/order";
lanbaoming's avatar
lanbaoming committed
1038 1039 1040 1041 1042
import { getCurrencyPage } from "@/api/ecw/currency";
import { getExchangeRatePage } from "@/api/ecw/exchangeRate";
import ret from "bluebird/js/release/util";
import dayjs from "dayjs";
import { getUserProfile } from "@/api/system/user";
lanbaoming's avatar
lanbaoming committed
1043 1044
import { getWarehouseList } from "@/api/ecw/warehouse";
import WorkFlow from "@/components/WorkFlow/";
lanbaoming's avatar
lanbaoming committed
1045 1046 1047 1048

export default {
  name: "EcwFinancialCreatcollection",
  components: {
lanbaoming's avatar
lanbaoming committed
1049 1050 1051
    CustomerSelector,
    WorkFlow,
    CustomerSelectorpay,
lanbaoming's avatar
lanbaoming committed
1052 1053 1054 1055 1056 1057 1058 1059 1060
  },
  data() {
    return {
      NP,
      loadings: false,
      loading1: false,
      uploadFileUrl: process.env.VUE_APP_BASE_API + "/app-api/file/upload", // 上传的图片服务器地址
      form: {
        receiptAccountList: [],
lanbaoming's avatar
lanbaoming committed
1061 1062 1063
        departmentId: "",
        salesmanId: "",
        salesmanName: "",
lanbaoming's avatar
lanbaoming committed
1064 1065 1066 1067 1068
      },
      creatorData: [],
      list: [],
      // fileList: [],
      orderData: [],
lanbaoming's avatar
lanbaoming committed
1069
      opnotice: false,
lanbaoming's avatar
lanbaoming committed
1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097
      dialogTableKey: 0,
      total: 0,
      headers: {
        Authorization: "Bearer " + getToken(),
      },
      loading: "",
      open: false,
      bankData: [],
      params: {
        page: 1,
        rows: 100,
      },
      deptData: [],
      deptArr: [],
      oadings: false,
      channelList: [],
      queryParams: {
        page: 1,
        rows: 20,
      },
      multipleSelection: [],
      tradeCityList: [],
      id: 0,
      receiptId: 0,
      currencyList: [],
      saveBtnLoading: false,
      discountVisible: false,
      discountForm: {
lanbaoming's avatar
lanbaoming committed
1098
        author: "",
lanbaoming's avatar
lanbaoming committed
1099 1100 1101 1102
      },
      selectListRow: {},
      selectListIndex: 0,
      flag: false,
lanbaoming's avatar
lanbaoming committed
1103 1104 1105 1106
      warehouseList: [],
      selectedUsers: [],
      dialogVisible: false,
      isUpdate: false,
lanbaoming's avatar
lanbaoming committed
1107 1108
      codeLoading: false,
      codePage: {
lanbaoming's avatar
lanbaoming committed
1109 1110
        pageNo: 1,
        pageSize: 100,
lanbaoming's avatar
lanbaoming committed
1111
      },
lanbaoming's avatar
lanbaoming committed
1112 1113 1114 1115 1116
      pages: 1,
      rateList: [],
      userInfo: null,
      //订单编号 lanbm 2024-05-20 add
      orderId: undefined,
lanbaoming's avatar
lanbaoming committed
1117 1118
    };
  },
lanbaoming's avatar
lanbaoming committed
1119
  async activated() {
lanbaoming's avatar
lanbaoming committed
1120
    let that = this;
lanbaoming's avatar
lanbaoming committed
1121
    await getUserProfile().then((res) => (that.userInfo = res.data));
lanbaoming's avatar
lanbaoming committed
1122
    if (that.$route.query.id) {
lanbaoming's avatar
lanbaoming committed
1123
      that.flag = true;
lanbaoming's avatar
lanbaoming committed
1124
      that.id = that.$route.query.id;
lanbaoming's avatar
lanbaoming committed
1125 1126 1127 1128 1129 1130 1131
      that.getReceivableData();
    } else {
      that.removeData();
      that.$set(that.form, "departmentId", that.userInfo.deptId);
      that.$set(that.discountForm, "author", that.userInfo.nickname);
      that.$set(that.form, "salesmanId", that.userInfo.id);
      that.$set(that.form, "salesmanName", that.userInfo.nickname);
lanbaoming's avatar
lanbaoming committed
1132 1133 1134
    }
    if (that.$route.query.receiptId && that.$route.query.receiptId != 0) {
      that.receiptId = that.$route.query.receiptId;
lanbaoming's avatar
lanbaoming committed
1135 1136
      that.getReceivableInfo();
    } else {
lanbaoming's avatar
lanbaoming committed
1137 1138 1139
      // that.removeData()
    }
    if (that.$route.query.orderId) {
lanbaoming's avatar
lanbaoming committed
1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182
      getReceivableByOrderId({ orderId: that.$route.query.orderId }).then(
        (response) => {
          that.list = [...response.data];
          that.list.map((v) => {
            if (!v.taxPoint) {
              v.taxAmount = v.totalAmount;
            }
          });
          that.calculation();
          getOrder(that.$route.query.orderId).then((response) => {
            // console.log(response.data)
            if (response.data.customerId) {
              that.$set(that.form, "customerId", response.data.customerId);
            } else {
              if (response.data.drawee == 1) {
                that.$set(
                  that.form,
                  "customerId",
                  response.data.consignorVO.customerId
                );
              } else if (response.data.drawee == 2) {
                that.$set(
                  that.form,
                  "customerId",
                  response.data.consigneeVO.customerId
                );
              } else {
                if (response.data.customDraweeVOList) {
                  response.data.customDraweeVOList.map((v) => {
                    if (v.name == "freight") {
                      if (v.value == 1) {
                        that.$set(
                          that.form,
                          "customerId",
                          response.data.consignorVO.customerId
                        );
                      } else {
                        that.$set(
                          that.form,
                          "customerId",
                          response.data.consigneeVO.customerId
                        );
                      }
lanbaoming's avatar
lanbaoming committed
1183
                    }
lanbaoming's avatar
lanbaoming committed
1184 1185
                  });
                }
lanbaoming's avatar
lanbaoming committed
1186 1187
              }
            }
lanbaoming's avatar
lanbaoming committed
1188 1189 1190 1191 1192 1193 1194 1195 1196 1197
          });
          getDestCountryByOrderId({ orderId: that.$route.query.orderId }).then(
            (response) => {
              // console.log(response.data)
              if (response.data)
                that.$set(that.queryParams, "destCountry", response.data);
            }
          );
        }
      );
lanbaoming's avatar
lanbaoming committed
1198 1199 1200
    }
  },
  directives: {
lanbaoming's avatar
lanbaoming committed
1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213
    "el-select-loadmore": {
      bind(el, binding) {
        const SELECTWRAP_DOM = el.querySelector(
          ".el-select-dropdown .el-select-dropdown__wrap"
        );
        SELECTWRAP_DOM.addEventListener("scroll", function () {
          const condition =
            this.scrollHeight - this.scrollTop <= this.clientHeight;
          if (condition) {
            binding.value();
          }
        });
      },
lanbaoming's avatar
lanbaoming committed
1214
    },
lanbaoming's avatar
lanbaoming committed
1215
  },
lanbaoming's avatar
lanbaoming committed
1216
  async created() {
lanbaoming's avatar
lanbaoming committed
1217
    await getUserProfile().then((res) => (this.userInfo = res.data));
lanbaoming's avatar
lanbaoming committed
1218
    // 获取汇率
lanbaoming's avatar
lanbaoming committed
1219 1220 1221 1222 1223 1224 1225
    await getCurrencyPage(this.params).then(
      (res) => (this.currencyList = res.data.list)
    );
    await getExchangeRatePage(this.params).then(
      (res) => (this.rateList = res.data.list)
    );
    getWarehouseList().then((res) => (this.warehouseList = res.data));
lanbaoming's avatar
lanbaoming committed
1226 1227
    let that = this;
    if (that.$route.query.orderId) {
lanbaoming's avatar
lanbaoming committed
1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271
      //lanbm 2024-05-20 添加订单ID
      this.orderId = that.$route.query.orderId;
      await getReceivableByOrderId({ orderId: that.$route.query.orderId }).then(
        (response) => {
          this.list = [...response.data];
          this.list.map((v) => {
            if (!v.taxPoint) {
              v.taxAmount = v.totalAmount;
            }
          });
          this.calculation();
          getOrder(that.$route.query.orderId).then((response) => {
            if (response.data.customerId) {
              that.$set(that.form, "customerId", response.data.customerId);
            } else {
              if (response.data.drawee == 1) {
                that.$set(
                  that.form,
                  "customerId",
                  response.data.consignorVO.customerId
                );
              } else if (response.data.drawee == 2) {
                that.$set(
                  that.form,
                  "customerId",
                  response.data.consigneeVO.customerId
                );
              } else {
                if (response.data.customDraweeVOList) {
                  response.data.customDraweeVOList.map((v) => {
                    if (v.name == "freight") {
                      if (v.value == 1) {
                        that.$set(
                          that.form,
                          "customerId",
                          response.data.consignorVO.customerId
                        );
                      } else {
                        that.$set(
                          that.form,
                          "customerId",
                          response.data.consigneeVO.customerId
                        );
                      }
lanbaoming's avatar
lanbaoming committed
1272
                    }
lanbaoming's avatar
lanbaoming committed
1273 1274
                  });
                }
lanbaoming's avatar
lanbaoming committed
1275 1276
              }
            }
lanbaoming's avatar
lanbaoming committed
1277 1278 1279 1280 1281 1282 1283 1284 1285
          });
        }
      );
      getDestCountryByOrderId({ orderId: this.$route.query.orderId }).then(
        (response) => {
          if (response.data)
            this.$set(this.queryParams, "destCountry", response.data);
        }
      );
lanbaoming's avatar
lanbaoming committed
1286 1287
    }
    if (that.$route.query.id) {
lanbaoming's avatar
lanbaoming committed
1288
      this.flag = true;
lanbaoming's avatar
lanbaoming committed
1289
      this.id = this.$route.query.id;
lanbaoming's avatar
lanbaoming committed
1290 1291 1292 1293 1294 1295
      this.getReceivableData();
    } else {
      this.discountForm.author = this.userInfo.nickname;
      this.form.departmentId = this.userInfo.deptId;
      this.form.salesmanId = this.userInfo.id;
      this.$set(this.form, "salesmanName", this.userInfo.nickname);
lanbaoming's avatar
lanbaoming committed
1296
    }
lanbaoming's avatar
lanbaoming committed
1297
    if (that.$route.query.receiptId && that.$route.query.receiptId !== "0") {
lanbaoming's avatar
lanbaoming committed
1298
      this.receiptId = this.$route.query.receiptId;
lanbaoming's avatar
lanbaoming committed
1299
      this.getReceivableInfo();
lanbaoming's avatar
lanbaoming committed
1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311
    }

    // this.getList();
    // if(that.$route.query.consignorId){
    //   this.queryParams.consignorId = this.$route.query.consignorId
    // }
    // if(that.$route.query.writeOffName){
    //   this.form.writeOffName = this.$route.query.writeOffName
    // }
    listSimpleUsers().then((res) => (that.creatorData = res.data));
    getChannelList().then((res) => (that.channelList = res.data));
    getTradeCityList().then((res) => (that.tradeCityList = res.data));
lanbaoming's avatar
lanbaoming committed
1312
    this.getCodeList();
lanbaoming's avatar
lanbaoming committed
1313
    listSimpleDepts().then((res) => {
lanbaoming's avatar
lanbaoming committed
1314
      that.deptData = res.data;
lanbaoming's avatar
lanbaoming committed
1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333
      // res.data.forEach((item) => {
      //   if (item.parentId == 0) {
      //     that.deptArr.push(item);
      //   } else {
      //     that.deptData.push(item);
      //   }
      // });

      // that.deptData.forEach((value) => {
      //   var dept = res.data.filter((itt) => itt.id == value.parentId);
      //   if (dept.length > 0) {
      //     value.name = dept[0].name + " | " + value.name;
      //   }
      // });
    });
  },
  computed: {
    expoerCityList() {
      // return this.tradeCityList.filter((item) => item.type == 2);
lanbaoming's avatar
lanbaoming committed
1334 1335 1336
      return this.warehouseList.filter(
        (item) => item.tradeType == 2 || item.tradeType == 3
      );
lanbaoming's avatar
lanbaoming committed
1337 1338 1339
    },
    importCityList() {
      // return this.tradeCityList.filter((item) => item.type == 1);
lanbaoming's avatar
lanbaoming committed
1340 1341 1342
      return this.warehouseList.filter(
        (item) => item.tradeType == 1 || item.tradeType == 3
      );
lanbaoming's avatar
lanbaoming committed
1343 1344 1345
    },
    showCurrencyId() {
      let fieldList = [];
lanbaoming's avatar
lanbaoming committed
1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359
      let groupList = [];
      this.list.map((element) => {
        if (fieldList.indexOf(element["currencyId"]) === -1) {
          fieldList.push(element["currencyId"]);
        }
      });
      for (let i = 0; i < fieldList.length; i++) {
        let arr = this.list.filter((element) => {
          return element["currencyId"] === fieldList[i];
        });
        groupList.push({
          currencyId: arr[0].currencyId,
          list: arr,
        });
lanbaoming's avatar
lanbaoming committed
1360
      }
lanbaoming's avatar
lanbaoming committed
1361 1362
      if (groupList.length === 1) return groupList[0].currencyId;
      else return 1;
lanbaoming's avatar
lanbaoming committed
1363 1364
    },
    showInvoice() {
lanbaoming's avatar
lanbaoming committed
1365 1366
      return this.form.openInvoice == 1;
    },
lanbaoming's avatar
lanbaoming committed
1367 1368 1369
  },
  methods: {
    // 懒加载
lanbaoming's avatar
lanbaoming committed
1370 1371
    loadmore() {
      this.codePage.pageNo++;
lanbaoming's avatar
lanbaoming committed
1372
      // 大于页码不请求了
lanbaoming's avatar
lanbaoming committed
1373
      console.log(111);
lanbaoming's avatar
lanbaoming committed
1374
      if (this.codePage.pageNo > this.pages) {
lanbaoming's avatar
lanbaoming committed
1375
        return;
lanbaoming's avatar
lanbaoming committed
1376
      }
lanbaoming's avatar
lanbaoming committed
1377
      this.getCodeList();
lanbaoming's avatar
lanbaoming committed
1378
    },
lanbaoming's avatar
lanbaoming committed
1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390
    getCodeList(flag) {
      if (flag) {
        this.bankData = [];
        this.codeLoading = true;
      }
      setTimeout(() => {
        getBankAccountPage(this.codePage).then((res) => {
          this.codeLoading = false;
          this.bankData = this.bankData.concat(res.data.list);
          this.pages = res.data.total / this.codePage.pageSize + 1;
        });
      }, 200);
lanbaoming's avatar
lanbaoming committed
1391
    },
lanbaoming's avatar
lanbaoming committed
1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410
    getReceivableData() {
      getReceiptInfoByIds({ id: this.id }).then((res) => {
        if (res.data.rateValidateDate)
          res.data.rateValidateDate = dayjs(res.data.rateValidateDate).format(
            "YYYY-MM-DD HH:mm:ss"
          );
        this.form = Object.assign({}, this.form, res.data);
        this.discountForm.author = this.userInfo.nickname;
        if (!this.form.departmentId)
          this.form.departmentId = this.userInfo.deptId;
        if (!this.form.salesmanId) this.form.salesmanId = this.userInfo.id;
        if (!this.form.salesmanName)
          this.$set(this.form, "salesmanName", this.userInfo.nickname);
      });
      getInvoicingItem({ id: this.id }).then((res) => {
        this.list = [...res.data];
        this.list.map((v) => {
          if (!v.taxPoint) {
            v.taxAmount = v.totalAmount;
lanbaoming's avatar
lanbaoming committed
1411
          }
lanbaoming's avatar
lanbaoming committed
1412 1413 1414
        });
      });
      getReceiptAccountList({ id: this.id }).then((res) => {
lanbaoming's avatar
lanbaoming committed
1415 1416
        if (res.data.length > 0) {
          // totalAmount
lanbaoming's avatar
lanbaoming committed
1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430
          res.data = [
            ...res.data,
            {
              type: "total",
              writeOffAmount: res.data
                .reduce(
                  (total, currentValue) =>
                    NP.plus(total, currentValue.writeOffAmount || 0),
                  0
                )
                .toFixed(2),
              collectionAmount: [],
            },
          ];
lanbaoming's avatar
lanbaoming committed
1431
        }
lanbaoming's avatar
lanbaoming committed
1432
        this.$set(this.form, "receiptAccountList", res.data);
lanbaoming's avatar
lanbaoming committed
1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453

        this.$nextTick(() => {
          // const dollarList = this.list.filter(v => v.currencyId === 1)
          // const discountDollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
          // const d = this.form.receiptAccountList.find(v => v.currencyId == 1)
          // d && (d.discountTotal = discountDollar)

          // const rmbList = this.list.filter(v => v.currencyId === 2)
          // const discountRmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
          // const r = this.form.receiptAccountList.find(v => v.currencyId == 2)
          // r && (r.discountTotal = discountRmb)

          // const nairaList = this.list.filter(v => v.currencyId === 3)
          // const discountNaira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
          // const n = this.form.receiptAccountList.find(v => v.currencyId == 3)
          // n && (n.discountTotal = discountNaira)

          // this.form.receiptAccountList.forEach((item, index) => {
          //   this.rateChange(item, index)

          // });
lanbaoming's avatar
lanbaoming committed
1454 1455 1456
          console.log(111);
          if (this.form.receiptAccountList.length > 0) {
            this.editReceiptAccountList();
lanbaoming's avatar
lanbaoming committed
1457 1458
          }
          // this.calculation()
lanbaoming's avatar
lanbaoming committed
1459 1460
        });
      });
lanbaoming's avatar
lanbaoming committed
1461
    },
lanbaoming's avatar
lanbaoming committed
1462 1463 1464 1465 1466 1467
    getReceivableInfo() {
      getReceivableItemDetail({ id: this.receiptId }).then((res) => {
        this.list = res.data;
        this.list.map((v) => {
          if (!v.taxPoint) {
            v.taxAmount = v.totalAmount;
lanbaoming's avatar
lanbaoming committed
1468
          }
lanbaoming's avatar
lanbaoming committed
1469 1470
        });
        this.calculation();
lanbaoming's avatar
lanbaoming committed
1471

lanbaoming's avatar
lanbaoming committed
1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485
        getOrder(res.data.orderId).then((response) => {
          // console.log(response.data)
          if (response.data.customerId)
            this.$set(this.form, "customerId", response.data.customerId);
        });
      });
    },
    getCurrencyLabel(id) {
      var label = this.currencyList.filter((item) => item.id == id);
      if (label.length > 0)
        return this.$i18n.locale == "zh_CN"
          ? label[0].titleZh
          : label[0].titleEn;
      return "";
lanbaoming's avatar
lanbaoming committed
1486
    },
lanbaoming's avatar
lanbaoming committed
1487 1488 1489
    checkDiscount(e) {
      if (e > this.selectListRow.totalAmount) {
        this.discountForm.discountTotal = this.selectListRow.totalAmount;
lanbaoming's avatar
lanbaoming committed
1490 1491 1492
      }
    },
    currencyIdChange(val, row, index) {
lanbaoming's avatar
lanbaoming committed
1493 1494
      row.collectionCurrencyId = val;
      if (val == row.currencyId) row.collectionRate = 1;
lanbaoming's avatar
lanbaoming committed
1495 1496 1497 1498 1499 1500 1501
      else {
        // if (row.currencyId == 1 && val == 3) row.collectionRate = this.UStoRMB()
        // if (row.currencyId == 1 && val == 2) row.collectionRate = this.UStoNAN()
        // if (row.currencyId == 3 && val == 1) row.collectionRate = this.RMBtoUS()
        // if (row.currencyId == 3 && val == 2) row.collectionRate = this.RMBtoNAN()
        // if (row.currencyId == 2 && val == 1) row.collectionRate = this.NANtoUS()
        // if (row.currencyId == 2 && val == 3) row.collectionRate = this.NANtoRMB()
lanbaoming's avatar
lanbaoming committed
1502 1503
        // row.collectionRate = NP.times(this.currencyList.find(v => v.id === row.currencyId).huilv/100, this.currencyList.find(v => v.id === val).exchangeToFc/100).toFixed(6)
        row.collectionRate = this.getRate(row.currencyId, val);
lanbaoming's avatar
lanbaoming committed
1504 1505
      }

lanbaoming's avatar
lanbaoming committed
1506
      this.rateChange(row, index);
lanbaoming's avatar
lanbaoming committed
1507 1508
    },
    //获取汇率
lanbaoming's avatar
lanbaoming committed
1509 1510 1511 1512 1513 1514 1515 1516
    getRate(sourceCurrencyId, targetCurrencyId) {
      var rate = this.rateList.find(
        (v) =>
          v.sourceCurrencyId === sourceCurrencyId &&
          v.targetCurrencyId === targetCurrencyId
      );
      if (rate) return rate.currencyRate;
      return "";
lanbaoming's avatar
lanbaoming committed
1517 1518
    },
    writeOffRateChange(row, index) {
lanbaoming's avatar
lanbaoming committed
1519 1520
      if (row.writeOffRate == 0 && parseInt(row.writeOffRate) === 0) {
        this.$modal.msgError(this.$t("汇率不能为0,请输入正确的汇率"));
lanbaoming's avatar
lanbaoming committed
1521
      }
lanbaoming's avatar
lanbaoming committed
1522 1523 1524 1525 1526 1527 1528
      if (row.writeOffRate) {
        row.writeOffAmount = NP.times(
          row.writeOffRate || 0,
          NP.minus(row.receivableAmount, row.discountTotal || 0)
        ).toFixed(2);
      } else {
        row.writeOffAmount = "";
lanbaoming's avatar
lanbaoming committed
1529 1530
      }

lanbaoming's avatar
lanbaoming committed
1531 1532 1533 1534 1535 1536 1537 1538 1539 1540
      const writeOffAmountTotal = this.form.receiptAccountList
        .filter((v) => v.type !== "total")
        .reduce(
          (total, currentValue) =>
            NP.plus(total, currentValue.writeOffAmount || 0),
          0
        );
      this.form.receiptAccountList[
        this.form.receiptAccountList.length - 1
      ].writeOffAmount = writeOffAmountTotal;
lanbaoming's avatar
lanbaoming committed
1541 1542
    },
    rateChange(row, index) {
lanbaoming's avatar
lanbaoming committed
1543 1544
      if (row.collectionRate == 0 && parseInt(row.collectionRate) === 0) {
        this.$modal.msgError(this.$t("汇率不能为0,请输入正确的汇率"));
lanbaoming's avatar
lanbaoming committed
1545
      }
lanbaoming's avatar
lanbaoming committed
1546 1547 1548 1549 1550 1551 1552 1553
      if (row.collectionRate) {
        row.receivableAmount &&
          (row.collectionAmount = NP.times(
            row.collectionRate || 0,
            NP.minus(row.receivableAmount, row.discountTotal || 0)
          ).toFixed(2));
      } else {
        row.collectionAmount = "";
lanbaoming's avatar
lanbaoming committed
1554
      }
lanbaoming's avatar
lanbaoming committed
1555
      this.form.receiptAccountList[index] = { ...row };
lanbaoming's avatar
lanbaoming committed
1556 1557 1558

      setTimeout(() => {
        // 收款总计
lanbaoming's avatar
lanbaoming committed
1559 1560
        this.editReceiptAccountList();
      }, 100);
lanbaoming's avatar
lanbaoming committed
1561
    },
lanbaoming's avatar
lanbaoming committed
1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579
    editReceiptAccountList() {
      var amountList = [];
      this.currencyList.forEach((item, index) => {
        var dollarList = this.form.receiptAccountList.filter(
          (v) => v.collectionCurrencyId == item.id
        );
        if (dollarList.length > 0) {
          var dollar = dollarList.reduce(
            (total, currentValue) =>
              NP.plus(total, currentValue.collectionAmount),
            0
          );
          amountList.push({
            currencyId: item.id,
            currencyNameEn: item.titleEn,
            currencyNameZh: item.titleZh,
            amount: dollar.toFixed(2),
          });
lanbaoming's avatar
lanbaoming committed
1580
        }
lanbaoming's avatar
lanbaoming committed
1581 1582 1583 1584 1585 1586 1587
      });
      this.form.receiptAccountList[
        this.form.receiptAccountList.length - 1
      ].collectionAmount = amountList;
      this.$set(this.form, "receiptAccountList", [
        ...this.form.receiptAccountList,
      ]);
lanbaoming's avatar
lanbaoming committed
1588 1589
    },
    //明细改变税率
lanbaoming's avatar
lanbaoming committed
1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600
    changeTaxRate(row, index) {
      var pointArr = [];
      var regs = /^[0-9]+\d*(\.\d*)?$|^0?\.\d*[0-9]\d*$/;
      if (row.taxPoint && !regs.test(row.taxPoint)) {
        row.taxPoint = "";
        this.$modal.msgError(this.$t("输入税率格式不对"));
      } else {
        pointArr = row.taxPoint.split(".");
        if (pointArr.length > 1 && pointArr[1]) {
          row.taxPoint = Math.round(row.taxPoint * 100) / 100;
        }
lanbaoming's avatar
lanbaoming committed
1601
      }
lanbaoming's avatar
lanbaoming committed
1602 1603 1604 1605 1606
      if (row.taxPoint) {
        var amout = NP.times(NP.divide(row.taxPoint, 100), row.totalAmount);
        row.taxAmount = NP.plus(row.totalAmount, amout);
      } else {
        row.taxAmount = row.totalAmount;
lanbaoming's avatar
lanbaoming committed
1607 1608
      }

lanbaoming's avatar
lanbaoming committed
1609
      this.list[index] = { ...row };
lanbaoming's avatar
lanbaoming committed
1610
      let dataArrTemp = JSON.stringify(this.list);
lanbaoming's avatar
lanbaoming committed
1611 1612 1613 1614 1615
      this.list = JSON.parse(dataArrTemp);
      if (pointArr.length > 1 && !pointArr[1]) {
        return;
      } else {
        this.calculation();
lanbaoming's avatar
lanbaoming committed
1616 1617 1618
      }
    },
    calculation() {
lanbaoming's avatar
lanbaoming committed
1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649
      const copyList = this.form.receiptAccountList;
      this.form.receiptAccountList = [];
      this.currencyList.forEach((item, index) => {
        var dollarList = this.list.filter((v) => v.currencyId === item.id);
        if (dollarList.length > 0) {
          let dollar, discountDollar;
          dollar = dollarList.reduce(
            (total, currentValue) =>
              NP.plus(total, currentValue.taxAmount || 0),
            0
          );
          discountDollar = dollarList.reduce(
            (total, currentValue) =>
              NP.plus(total, currentValue.discountTotal || 0),
            0
          );
          var t = copyList.find((v) => v.currencyId == item.id);
          console.log(discountDollar);
          this.form.receiptAccountList.push({
            discountTotal: discountDollar,
            currencyId: item.id,
            receivableAmount: Math.round(dollar),
            writeOffRate:
              item.id == this.showCurrencyId
                ? 1
                : this.getRate(item.id, this.showCurrencyId),
            platformAccountId: t?.platformAccountId || "",
            collectionCurrencyId: item.id,
            collectionRate: 1,
          });
          this.calculationCount(NP.minus(dollar, discountDollar), item.id);
lanbaoming's avatar
lanbaoming committed
1650
        }
lanbaoming's avatar
lanbaoming committed
1651
      });
lanbaoming's avatar
lanbaoming committed
1652 1653 1654

      if (this.form.receiptAccountList.length > 0) {
        // totalAmount
lanbaoming's avatar
lanbaoming committed
1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667
        const totalt = this.form.receiptAccountList.reduce(
          (total, currentValue) =>
            NP.plus(total, currentValue.writeOffAmount || 0),
          0
        );
        this.form.receiptAccountList = [
          ...this.form.receiptAccountList,
          {
            type: "total",
            writeOffAmount: totalt.toFixed(2),
            collectionAmount: [],
          },
        ];
lanbaoming's avatar
lanbaoming committed
1668

lanbaoming's avatar
lanbaoming committed
1669
        this.form.receivableTotalAmount = totalt.toFixed(2);
lanbaoming's avatar
lanbaoming committed
1670 1671
      }
      // receiptAccountList: [
lanbaoming's avatar
lanbaoming committed
1672 1673 1674 1675
      // { currencyId: 1, receivableAmount: 0, writeOffRate: 1, writeOffAmount: 999, platformAccountId: '', currencyId: '', rate: 1, collectionAmount: 0 },
      // { currencyId: 2, receivableAmount: 0, writeOffRate: 1, writeOffAmount: 999, platformAccountId: '', currencyId: '', rate: 1, collectionAmount: 0 },
      // { currencyId: 3, receivableAmount: 0, writeOffRate: 1, writeOffAmount: 999, platformAccountId: '', currencyId: '', rate: 1, collectionAmount: 0 },
      // ]
lanbaoming's avatar
lanbaoming committed
1676

lanbaoming's avatar
lanbaoming committed
1677 1678
      if (this.showCurrencyId === 1) {
        // 美元
lanbaoming's avatar
lanbaoming committed
1679 1680 1681 1682 1683 1684 1685
        // const usCount = NP.plus(dollar, NP.times(this.RMBtoUS(), rmb),  NP.times(this.NANtoUS(), naira))
        // this.form.receivableDetailList[0].rate = 1
        // this.form.receivableDetailList[0].amount = usCount
        // this.form.receivableDetailList[1].rate || (this.form.receivableDetailList[1].rate = this.UStoRMB())
        // this.form.receivableDetailList[2].rate || (this.form.receivableDetailList[2].rate = this.UStoNAN())
        // this.form.receivableTotalAmount = usCount
        // this.calculationCount(usCount)
lanbaoming's avatar
lanbaoming committed
1686 1687
      } else if (this.showCurrencyId === 2) {
        // 人民币
lanbaoming's avatar
lanbaoming committed
1688 1689 1690 1691 1692 1693 1694
        // const rmbCount = NP.plus(rmb, NP.times(this.UStoRMB(), dollar),  NP.times(this.NANtoRMB(), naira))
        // this.form.receivableDetailList[1].rate = 1
        // this.form.receivableDetailList[1].amount = usCount
        // this.form.receivableDetailList[0].rate || (this.form.receivableDetailList[0].rate = this.RMBtoUS())
        // this.form.receivableDetailList[2].rate || (this.form.receivableDetailList[2].rate = this.RMBtoNAN())
        // this.form.receivableTotalAmount = rmbCount
        // this.calculationCount(rmbCount)
lanbaoming's avatar
lanbaoming committed
1695 1696
      } else if (this.showCurrencyId === 3) {
        // 奈拉
lanbaoming's avatar
lanbaoming committed
1697 1698 1699 1700 1701 1702 1703 1704 1705
        // const nairaCount = NP.plus(naira, NP.times(this.UStoNAN(), dollar),  NP.times(this.RMBtoNAN(), rmb))
        // this.form.receivableDetailList[2].rate = 1
        // this.form.receivableDetailList[2].amount = nairaCount
        // this.form.receivableDetailList[0].rate || (this.form.receivableDetailList[0].rate = this.NANtoUS())
        // this.form.receivableDetailList[1].rate || (this.form.receivableDetailList[1].rate = this.NANtoRMB())
        // this.form.receivableTotalAmount = nairaCount
        // this.calculationCount(nairaCount)
      }

lanbaoming's avatar
lanbaoming committed
1706 1707 1708
      this.$set(this.form, "receiptAccountList", [
        ...this.form.receiptAccountList,
      ]);
lanbaoming's avatar
lanbaoming committed
1709 1710
    },
    calculationCount(usCount, type) {
lanbaoming's avatar
lanbaoming committed
1711 1712 1713 1714
      const index = this.form.receiptAccountList.findIndex(
        (v) => v.currencyId == type
      );
      const t = this.form.receiptAccountList[index];
lanbaoming's avatar
lanbaoming committed
1715
      if (t) {
lanbaoming's avatar
lanbaoming committed
1716 1717
        t.writeOffAmount = NP.times(t.writeOffRate || 0, usCount).toFixed(2);
        this.rateChange(t, index);
lanbaoming's avatar
lanbaoming committed
1718 1719 1720
      }
    },
    RMBtoUS() {
lanbaoming's avatar
lanbaoming committed
1721 1722 1723 1724
      return NP.divide(
        100,
        this.currencyList.find((v) => v.titleEn === "USD").huilv
      ).toFixed(6);
lanbaoming's avatar
lanbaoming committed
1725 1726
    },
    NANtoUS() {
lanbaoming's avatar
lanbaoming committed
1727
      return NP.times(this.RMBtoUS(), this.NANtoRMB()).toFixed(6);
lanbaoming's avatar
lanbaoming committed
1728 1729
    },
    UStoRMB() {
lanbaoming's avatar
lanbaoming committed
1730 1731 1732 1733
      return NP.divide(
        this.currencyList.find((v) => v.titleEn === "USD").huilv,
        100
      ).toFixed(6);
lanbaoming's avatar
lanbaoming committed
1734 1735
    },
    UStoNAN() {
lanbaoming's avatar
lanbaoming committed
1736
      return NP.times(this.RMBtoNAN(), this.UStoRMB()).toFixed(6);
lanbaoming's avatar
lanbaoming committed
1737 1738
    },
    RMBtoNAN() {
lanbaoming's avatar
lanbaoming committed
1739 1740 1741 1742
      return NP.divide(
        100,
        this.currencyList.find((v) => v.titleEn === "NGN").huilv
      ).toFixed(6);
lanbaoming's avatar
lanbaoming committed
1743 1744
    },
    NANtoRMB() {
lanbaoming's avatar
lanbaoming committed
1745 1746 1747 1748
      return NP.divide(
        this.currencyList.find((v) => v.titleEn === "NGN").huilv,
        100
      ).toFixed(6);
lanbaoming's avatar
lanbaoming committed
1749 1750
    },
    customerChange(value) {
lanbaoming's avatar
lanbaoming committed
1751 1752 1753
      if (this.flag || !value) {
        this.flag = false;
        return;
lanbaoming's avatar
lanbaoming committed
1754
      }
lanbaoming's avatar
lanbaoming committed
1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770
      this.form.customerName = value.payerName ? value.payerName : value.name;
      this.form.customerId &&
        getCustomer(this.form.customerId).then((res) => {
          this.form = {
            ...this.form,
            invoice: res.data.invoiceTitle,
            taxpayer: res.data.licenseNumber,
            accountBank: res.data.bank,
            accountName: res.data.bankNumber,
            projectName: res.data.project,
            taxRate: res.data.taxRate,
            addressPhone: `${res.data.billingAddress || ""}/${
              res.data.billingTell || ""
            }`,
          };
        });
lanbaoming's avatar
lanbaoming committed
1771 1772
    },
    cancelDiscount() {
lanbaoming's avatar
lanbaoming committed
1773 1774 1775
      this.discountVisible = false;
      this.discountForm = {};
      this.selectListRow = {};
lanbaoming's avatar
lanbaoming committed
1776 1777
    },
    addDiscount(row, index) {
lanbaoming's avatar
lanbaoming committed
1778 1779 1780 1781 1782 1783 1784 1785 1786 1787
      this.discountVisible = true;
      this.selectListRow = { ...row };
      console.log(this.selectListRow);
      this.selectListIndex = index;
      this.$set(
        this.discountForm,
        "time",
        dayjs().format("YYYY-MM-DD HH:mm:ss")
      );
      getReceivableDiscountLogById({ id: row.id }).then((res) => {
lanbaoming's avatar
lanbaoming committed
1788
        if (res.data?.creatorName) {
lanbaoming's avatar
lanbaoming committed
1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806
          this.$set(
            this.discountForm,
            "time",
            dayjs(res.data.createTime).format("YYYY-MM-DD HH:mm:ss")
          );
          this.$set(this.discountForm, "discountTotal", res.data.discountTotal);
          this.$set(
            this.discountForm,
            "discountRemark",
            res.data.discountRemark
          );
          this.$set(this.discountForm, "author", res.data.creatorName);
          this.opnotice = true;
        } else {
          this.opnotice = false;
          this.$set(this.discountForm, "discountTotal", "");
          this.$set(this.discountForm, "discountRemark", "");
          this.$set(this.discountForm, "author", "");
lanbaoming's avatar
lanbaoming committed
1807
        }
lanbaoming's avatar
lanbaoming committed
1808
      });
lanbaoming's avatar
lanbaoming committed
1809 1810
    },
    saveDiscount() {
lanbaoming's avatar
lanbaoming committed
1811
      console.log(this.discountForm);
lanbaoming's avatar
lanbaoming committed
1812
      // this.selectListRow.id
lanbaoming's avatar
lanbaoming committed
1813 1814 1815 1816 1817 1818
      if (
        this.discountForm.discountTotal === 0 ||
        !this.discountForm.discountTotal
      ) {
        this.$modal.msgError(this.$t("优惠金额不能为空"));
        return;
lanbaoming's avatar
lanbaoming committed
1819
      }
lanbaoming's avatar
lanbaoming committed
1820 1821 1822 1823 1824 1825
      if (
        this.discountForm.discountRemark === 0 ||
        !this.discountForm.discountRemark
      ) {
        this.$modal.msgError(this.$t("优惠原因不能为空"));
        return;
lanbaoming's avatar
lanbaoming committed
1826 1827 1828 1829 1830 1831 1832
      }
      const params = {
        id: this.selectListRow.id,
        discountTotal: this.discountForm.discountTotal,
        discountRemark: this.discountForm.discountRemark,
        orderNo: this.selectListRow.orderNo,
        orderId: this.selectListRow.orderId,
lanbaoming's avatar
lanbaoming committed
1833 1834 1835 1836
        taxPoint: this.selectListRow.taxPoint,
        taxAmount: this.selectListRow.taxAmount,
      };
      updateReceivableDiscountById(params).then((res) => {
lanbaoming's avatar
lanbaoming committed
1837
        if (this.selectListRow.discountTotal) {
lanbaoming's avatar
lanbaoming committed
1838
          this.$modal.msgSuccess(this.$t("修改成功"));
lanbaoming's avatar
lanbaoming committed
1839
        } else {
lanbaoming's avatar
lanbaoming committed
1840
          this.$modal.msgSuccess(this.$t("新增成功"));
lanbaoming's avatar
lanbaoming committed
1841 1842 1843 1844 1845 1846 1847 1848
        }
        // if(this.id>0){
        //    getInvoicingItem({ id: this.id }).then(res => {
        //     this.list = [...res.data]
        //     this.cancelDiscount()
        //     this.calculation()
        //   })
        // }else{
lanbaoming's avatar
lanbaoming committed
1849 1850 1851 1852 1853 1854 1855 1856 1857 1858
        var discount = this.list[this.selectListIndex];
        discount["discountTotal"] = this.discountForm.discountTotal;
        discount["discountRemark"] = this.discountForm.discountRemark;
        setTimeout(() => {
          // getReceivableInfoByIds({ id: this.selectListRow.id }).then(res => {
          this.$set(this.list, this.selectListIndex, { ...discount });
          this.cancelDiscount();
          this.calculation();
          // })
        }, 1000);
lanbaoming's avatar
lanbaoming committed
1859 1860

        // }
lanbaoming's avatar
lanbaoming committed
1861
      });
lanbaoming's avatar
lanbaoming committed
1862 1863 1864 1865 1866 1867 1868 1869 1870
    },
    getList() {
      this.loading1 = true;
      // 处理查询参数
      let params = { ...this.queryParams };
      this.addBeginAndEndTime(params, this.dateType, "createTime");
      // 执行查询
      getReceivableList(params).then((response) => {
        this.orderData = response.data.list;
lanbaoming's avatar
lanbaoming committed
1871
        this.dialogTableKey++;
lanbaoming's avatar
lanbaoming committed
1872 1873 1874
        this.total = response.data.total;
        this.loading1 = false;
        this.$nextTick(() => {
lanbaoming's avatar
lanbaoming committed
1875 1876 1877 1878 1879
          this.list.forEach((itm) => {
            const t = this.orderData.find((v) => v.id == itm.id);
            t && this.$refs.multipleTable.toggleRowSelection(t, true);
          });
        });
lanbaoming's avatar
lanbaoming committed
1880 1881 1882 1883
      });
    },
    /** 新增按钮操作 */
    handleAdd() {
lanbaoming's avatar
lanbaoming committed
1884 1885
      this.queryParams.customerId = this.form.customerId;
      this.multipleSelection = this.list;
lanbaoming's avatar
lanbaoming committed
1886 1887 1888 1889
      this.open = true;
    },
    hiddenDialog() {
      this.open = false;
lanbaoming's avatar
lanbaoming committed
1890
      this.queryParams.customerId = "";
lanbaoming's avatar
lanbaoming committed
1891
    },
lanbaoming's avatar
lanbaoming committed
1892 1893
    changePlatformAccountId(platformAccountId, index) {
      this.form.receiptAccountList[index].platformAccountId = platformAccountId;
lanbaoming's avatar
lanbaoming committed
1894 1895 1896
    },
    submitForm(addType) {
      // const params = {...this.form}
lanbaoming's avatar
lanbaoming committed
1897 1898
      const params = JSON.parse(JSON.stringify(this.form));
      params.addType = addType;
lanbaoming's avatar
lanbaoming committed
1899
      // params.receiptAccountList = params.receiptAccountList.map(v => Object.assign(v, {  }))
lanbaoming's avatar
lanbaoming committed
1900 1901 1902 1903
      if (!params.customerId) {
        this.saveBtnLoading = false;
        this.$modal.msgError(this.$t("客户不能为空"));
        return;
lanbaoming's avatar
lanbaoming committed
1904
      }
lanbaoming's avatar
lanbaoming committed
1905 1906 1907 1908
      if (!params.departmentId) {
        this.saveBtnLoading = false;
        this.$modal.msgError(this.$t("部门不能为空"));
        return;
lanbaoming's avatar
lanbaoming committed
1909
      }
lanbaoming's avatar
lanbaoming committed
1910 1911 1912 1913
      if (!params.salesmanId) {
        this.saveBtnLoading = false;
        this.$modal.msgError(this.$t("业务员不能为空"));
        return;
lanbaoming's avatar
lanbaoming committed
1914
      }
lanbaoming's avatar
lanbaoming committed
1915 1916 1917 1918 1919
      if (params.openInvoice != 0 && params.openInvoice != 1) {
        console.log(params.openInvoice);
        this.saveBtnLoading = false;
        this.$modal.msgError(this.$t("请选择是否需要开票"));
        return;
lanbaoming's avatar
lanbaoming committed
1920 1921
      }
      if (this.list && this.list.length > 0) {
lanbaoming's avatar
lanbaoming committed
1922 1923 1924 1925 1926
        params.receivableVOList = this.list;
      } else {
        this.saveBtnLoading = false;
        this.$modal.msgError(this.$t("请添加未收客户款项"));
        return;
lanbaoming's avatar
lanbaoming committed
1927 1928 1929 1930
      }

      // params.receiptAccountList.length = params.receiptAccountList.length - 1

lanbaoming's avatar
lanbaoming committed
1931 1932 1933 1934 1935 1936 1937
      var saveStatus = true;
      var writeStatus = true;
      var reatStatus = true;
      params.receiptAccountList.forEach((v) => {
        if (v.type != "total") {
          if (!v.platformAccountId) {
            saveStatus = false;
lanbaoming's avatar
lanbaoming committed
1938
          }
lanbaoming's avatar
lanbaoming committed
1939 1940
          if (!v.writeOffRate) {
            writeStatus = false;
lanbaoming's avatar
lanbaoming committed
1941
          }
lanbaoming's avatar
lanbaoming committed
1942 1943
          if (!v.collectionRate) {
            reatStatus = false;
lanbaoming's avatar
lanbaoming committed
1944
          }
lanbaoming's avatar
lanbaoming committed
1945 1946 1947 1948 1949 1950 1951
          var bankname = this.bankData.filter(
            (item) => item.id == v.platformAccountId
          );
          if (bankname.length > 0) {
            v.platformAccountName = bankname[0].baAccountName;
            v.platformAccountNo = bankname[0].baAccountNum;
            v.platformAccountBlankName = bankname[0].baBankName;
lanbaoming's avatar
lanbaoming committed
1952
          }
lanbaoming's avatar
lanbaoming committed
1953 1954
          delete v.discountTotal;
          v.writeOffRate = Number(v.writeOffRate);
lanbaoming's avatar
lanbaoming committed
1955
        }
lanbaoming's avatar
lanbaoming committed
1956 1957 1958 1959 1960 1961
      });
      if (!writeStatus) {
        this.$modal.msgError(
          this.$t("核销基准币种汇率不能为0,请输入正确的汇率")
        );
        return;
lanbaoming's avatar
lanbaoming committed
1962 1963
      }

lanbaoming's avatar
lanbaoming committed
1964 1965 1966
      if (!saveStatus) {
        this.$modal.msgError(this.$t("请添加收款账户"));
        return;
lanbaoming's avatar
lanbaoming committed
1967
      }
lanbaoming's avatar
lanbaoming committed
1968 1969 1970
      if (!reatStatus) {
        this.$modal.msgError(this.$t("期望收款汇率不能为0,请输入正确的汇率"));
        return;
lanbaoming's avatar
lanbaoming committed
1971
      }
lanbaoming's avatar
lanbaoming committed
1972
      delete params.receivableDetail;
lanbaoming's avatar
lanbaoming committed
1973 1974

      if (addType === 1) {
lanbaoming's avatar
lanbaoming committed
1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001
        this.saveBtnLoading = true;
        params.receiptAccountList.splice(
          params.receiptAccountList.length - 1,
          1
        );
        if (this.id && this.id != 0) {
          params.updateType = 0;
          updateReceipt(params)
            .then((res) => {
              this.$modal.msgSuccess(this.$t("提交成功"));
              this.$store.dispatch("tagsView/delCurrentView");
            })
            .finally(() => {
              this.saveBtnLoading = false;
            });
        } else {
          params.currencyId = this.showCurrencyId;
          createReceipt(params)
            .then((res) => {
              this.$modal.msgSuccess(this.$t("保存成功"));
              this.$store.dispatch("tagsView/delCurrentView");
            })
            .finally(() => {
              this.saveBtnLoading = false;
            });
        }
        return;
lanbaoming's avatar
lanbaoming committed
2002
      }
lanbaoming's avatar
lanbaoming committed
2003 2004
      this.saveBtnLoading = true;
      params.receiptAccountList.splice(params.receiptAccountList.length - 1, 1);
lanbaoming's avatar
lanbaoming committed
2005

lanbaoming's avatar
lanbaoming committed
2006 2007 2008 2009 2010 2011 2012 2013 2014
      if (this.id && this.id != 0) {
        // if(params.state==0) params.state = 1
        params.updateType = 1;
        //lanbm 2024-05-20 添加订单ID
        params.orderId = this.orderId;
        updateReceipt(params)
          .then((res) => {
            this.$modal.msgSuccess(this.$t("修改成功"));
            this.$store.dispatch("tagsView/delCurrentView");
lanbaoming's avatar
lanbaoming committed
2015
          })
lanbaoming's avatar
lanbaoming committed
2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
          .finally(() => {
            this.saveBtnLoading = false;
          });
      } else {
        params.currencyId = this.showCurrencyId;
        //lanbm 2024-05-20 添加订单ID
        params.orderId = this.orderId;
        createReceipt(params)
          .then((res) => {
            this.$modal.msgSuccess(this.$t("新增成功"));
            this.$store.dispatch("tagsView/delCurrentView");
lanbaoming's avatar
lanbaoming committed
2027
          })
lanbaoming's avatar
lanbaoming committed
2028 2029 2030 2031
          .finally(() => {
            this.saveBtnLoading = false;
          });
      }
lanbaoming's avatar
lanbaoming committed
2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    removedup(arr, batch) {
      if (!Array.isArray(arr)) {
        return arr;
      }
      if (arr.length == 0) {
        return [];
      }
      let obj = {};
      let uniqueArr = arr.reduce(function (total, item) {
lanbaoming's avatar
lanbaoming committed
2045
        obj[item[batch]] ? "" : (obj[item[batch]] = true && total.push(item));
lanbaoming's avatar
lanbaoming committed
2046 2047 2048 2049 2050
        return total;
      }, []);
      return uniqueArr;
    },
    saveSelectList() {
lanbaoming's avatar
lanbaoming committed
2051 2052 2053
      this.multipleSelection.map((v) => {
        if (!v.taxPoint) {
          v.taxAmount = v.totalAmount;
lanbaoming's avatar
lanbaoming committed
2054
        }
lanbaoming's avatar
lanbaoming committed
2055 2056 2057 2058 2059 2060
      });
      if (this.list.length > 0) {
        this.list = this.list.concat(this.multipleSelection);
        this.list = this.removedup(this.list, "id");
      } else {
        this.list = this.multipleSelection;
lanbaoming's avatar
lanbaoming committed
2061 2062 2063
      }

      this.open = false;
lanbaoming's avatar
lanbaoming committed
2064
      this.calculation();
lanbaoming's avatar
lanbaoming committed
2065 2066
    },
    deleteListRow(index) {
lanbaoming's avatar
lanbaoming committed
2067 2068 2069 2070
      const list = [...this.list];
      delete list[index];
      this.list = list.filter((v) => v);
      this.calculation();
lanbaoming's avatar
lanbaoming committed
2071 2072 2073 2074
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.page = 1;
lanbaoming's avatar
lanbaoming committed
2075
      this.getList();
lanbaoming's avatar
lanbaoming committed
2076 2077
    },
    //清空数据
lanbaoming's avatar
lanbaoming committed
2078 2079 2080
    removeData() {
      this.id = 0;
      this.flag = false;
lanbaoming's avatar
lanbaoming committed
2081
      this.discountForm = {
lanbaoming's avatar
lanbaoming committed
2082 2083 2084 2085 2086 2087 2088 2089 2090
        author: "",
      };
      this.$refs.customer.reset();
      this.list = [];
      for (var i in this.form) {
        if (i == "receiptAccountList") {
          this.$set(this.form, i, []);
        } else {
          this.$set(this.form, i, "");
lanbaoming's avatar
lanbaoming committed
2091 2092
        }
      }
lanbaoming's avatar
lanbaoming committed
2093
    },
lanbaoming's avatar
lanbaoming committed
2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120
  },
};
</script>

<style scoped lang="scss">
.card {
  margin-top: 20px;
}
.dialog-footer {
  // padding: 40px;
  text-align: left;
}
.card-title {
  font-size: 18px;
  font-weight: bold;
}
::v-deep .el-descriptions-item__label {
  width: 200px;
}
.amountCard {
  ::v-deep .el-descriptions-item__label {
    width: 20%;
  }
  ::v-deep .el-descriptions-item__content {
    width: 30%;
  }
}
lanbaoming's avatar
lanbaoming committed
2121 2122 2123 2124 2125 2126
.bpm-title {
  font-size: 20px;
  font-weight: bold;
  color: #666;
  margin: 20px 0;
}
lanbaoming's avatar
lanbaoming committed
2127
</style>