123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206 |
- <template>
- <div class="detail">
- <!-- 收退货仓库信息-->
- <el-card class="box-card" v-if="refundInfo.refundType == '3'">
- <el-select
- @change="handelChangeReturnWarehouse"
- v-model="selectedWarehouseCode"
- style="width: 60%"
- placeholder="The warehouse to receive return goods"
- :disabled="action != 'cus_check'"
- >
- <el-option
- v-for="warehouse in wareHouses"
- :key="warehouse.returnWarehouseCode"
- :label="warehouse.returnWarehouseName"
- :value="warehouse.returnWarehouseCode"
- >
- </el-option>
- </el-select>
- <el-divider></el-divider>
- <div>
- AddressInfo: {{ returnWarehouseAddress
- }}<i
- style="color:blue;"
- class="el-icon-document-copy"
- :title="$t('title.copy')"
- :copy-value="returnWarehouseAddress"
- v-on:click="copy"
- ></i>
- </div>
- </el-card>
- <el-card
- class="box-card"
- v-if="refundInfo.status == 0"
- v-loading="btnLoading"
- >
- <!-- TODO 暂时关闭SL -->
- <el-form
- v-if="
- refundInfo.refundType == '3' &&
- this.isShopifyLabel == true &&
- addressInfo.receiverCountryName == 'US'
- "
- label-width="120px"
- >
- <el-form-item label="ShippingLabel">
- <el-radio-group v-model="slUseAble">
- <el-radio label="0">{{ $t("view.notEnabled") }}</el-radio>
- <el-radio label="1">{{ $t("view.enabled") }}</el-radio>
- </el-radio-group>
- <el-tag
- type="danger"
- v-if="this.slUseAble === '1' && this.shippingLabelMessage"
- >{{ this.shippingLabelMessage }}</el-tag
- >
- </el-form-item>
- </el-form>
- <!-- 审核-->
- <el-input
- type="textarea"
- :placeholder="$t('place.customerServiceRemarks')"
- v-model="checkData.notes"
- maxlength="150"
- :disabled="action != 'cus_check'"
- show-word-limit
- ></el-input>
- <!-- <el-select
- :placeholder="$t('place.rejectionReason')"
- clearable
- style="width: 530px;margin-top:20px;"
- class="filter-item"
- :disabled="action != 'cus_check'"
- v-model="checkData.rejectReason"
- >
- <el-option
- v-for="item in refundReasons"
- :key="item.id"
- :label="item.reasonContentChinese"
- :value="item.id"
- >
- </el-option>
- </el-select> -->
- <div
- style="float:right;margin-top:20px;margin-bottom:20px;"
- :style="hideStyleBtn"
- v-if="action == 'cus_check'"
- >
- <el-button type="primary" size="mini" @click="handleKfCheck(1)">{{
- $t("view.approved")
- }}</el-button>
- <el-button type="primary" size="mini" @click="handleKfCheck(2)">{{
- $t("view.rejected")
- }}</el-button>
- </div>
- </el-card>
- <el-card
- class="box-card"
- v-if="refundInfo.status == 5"
- v-loading="btnLoading"
- >
- <!-- 审核-->
- <el-form
- v-if="action == 'f_check'"
- ref="cwForm"
- :model="refundInfo"
- label-width="80px"
- >
- <el-form-item :label="$t('label.refundMethod')">
- <el-radio-group v-model="refundInfo.refundMethod">
- <el-radio label="system">{{ $t("view.systemRefund") }}</el-radio>
- <el-radio label="manual">{{ $t("view.manualRefund") }}</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item
- v-if="refundInfo.refundMethod == 'manual'"
- :label="$t('label.accountType')"
- >
- <el-radio-group v-model="refundInfo.refundAccountType">
- <el-radio label="PayPal">PayPal</el-radio>
- <el-radio label="bankCard">银行卡</el-radio>
- <el-radio label="Gift Card">Gift Card</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item
- v-if="
- refundInfo.refundMethod == 'manual' &&
- refundInfo.refundAccountType == 'PayPal'
- "
- :label="$t('label.refundAccount')"
- >
- <el-input
- v-model="refundInfo.refundAccount"
- :placeholder="$t('place.pleaseEnterRefundAccount')"
- >
- </el-input>
- </el-form-item>
- <!-- <el-form-item
- v-if="refundInfo.refundMethod == 'system'"
- :label="$t('label.rejectionOfReturns')"
- >
- <el-radio-group v-model="refundInfo.rejectedGoods">
- <el-radio label="false">{{ $t("label.no") }}</el-radio>
- <el-radio label="true">{{ $t("label.yes") }}</el-radio>
- </el-radio-group>
- </el-form-item> -->
- <el-form-item
- v-if="
- refundInfo.refundMethod == 'system' &&
- refundInfo.rejectedGoods == 'true'
- "
- :label="$t('label.rejectionReason')"
- >
- <el-select
- :placeholder="$t('place.rejectionReason')"
- clearable
- style="width: 200px;"
- class="filter-item"
- :disabled="action != 'f_check'"
- v-model="refundInfo.rejectReason"
- >
- <el-option
- v-for="item in refundReasons"
- :key="item.id"
- :label="item.reasonContentChinese"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <el-input
- v-if="action == 'f_check'"
- type="textarea"
- :placeholder="$t('place.financeAuditRemarks')"
- v-model="checkData.cwnotes"
- maxlength="150"
- :disabled="btndisableed"
- show-word-limit
- ></el-input>
- <div
- style="float:right;margin-top:20px;margin-bottom:20px;"
- :style="hideStyleBtn"
- v-if="action == 'f_check'"
- >
- <el-button
- type="success"
- size="mini"
- v-if="
- refundInfo.channelCode == 'SHOPIFY' &&
- refundInfo.refundMethod == 'system'
- "
- @click="handleCalculatesCheck"
- style="margin-right:20px;"
- >{{ $t("view.verification") }}</el-button
- >
- <el-button
- type="primary"
- size="mini"
- :disabled="
- refundInfo.channelCode == 'SHOPIFY' &&
- btndisabled &&
- refundInfo.refundMethod == 'system'
- "
- @click="handleCheck(6)"
- >{{ $t("view.approved") }}</el-button
- >
- <el-button type="primary" size="mini" @click="handleCheck(0)">{{
- $t("view.rejected")
- }}</el-button>
- </div>
- </el-card>
- <el-card class="box-card">
- <!-- 基本信息-->
- <el-descriptions
- :title="$t('title.basicInformation')"
- :colon="false"
- :column="6"
- border
- >
- <el-descriptions-item :label="$t('label.refundOrderNumber')"
- >{{ refundInfo.refundNo }}
- <i
- style="color:blue;"
- class="el-icon-document-copy"
- :title="$t('title.copy')"
- :copy-value="refundInfo.refundNo"
- v-on:click="copy"
- ></i
- ></el-descriptions-item>
- <el-descriptions-item :label="$t('label.totalRefundAmount')">{{
- refundInfo.refundAmount
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('label.SLFee')">
- {{ refundInfo.slFee || "0.00" }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.onlineShopOrder')"
- >{{ refundInfo.ormorder }}
- <i
- style="color:blue;"
- class="el-icon-document-copy"
- :title="$t('title.copy')"
- :copy-value="refundInfo.ormorder"
- v-on:click="copy"
- ></i
- ></el-descriptions-item>
- <!-- 添加shopify单号-->
- <el-descriptions-item label="实际退款金额">{{
- refundInfo.actualRefundAmount
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('label.shopifyNumber')"
- >{{ refundInfo.cutUser }}
- <i
- style="color:blue;"
- class="el-icon-document-copy"
- :title="$t('title.copy')"
- :copy-value="refundInfo.cutUser"
- v-on:click="copy"
- ></i
- ></el-descriptions-item>
- <el-descriptions-item :label="$t('label.afterSalesType')">{{
- refundInfo.refundType | refundTypeFilter(that)
- }}</el-descriptions-item>
- <!-- <el-descriptions-item label="退款原因(中文)">{{
- refundInfo.reasonContentChinese
- }}</el-descriptions-item>
- <el-descriptions-item label="退款原因(English)">{{
- refundInfo.reasonContentEnglish
- }}</el-descriptions-item>
- <el-descriptions-item
- v-if="refundInfo.otherReason"
- label="其他原因说明"
- >{{
- refundInfo.otherReason
- }}</el-descriptions-item> -->
- <el-descriptions-item
- :label="$t('label.receivingReturnWarehouse')"
- v-if="refundInfo.warehouseName"
- >
- {{ refundInfo.warehouseName }}
- </el-descriptions-item>
- <el-descriptions-item
- :label="$t('label.warehouseReceivingStatus')"
- v-if="refundInfo.warehouseName"
- >
- {{ refundInfo.warehouseReceivingStatus }}
- </el-descriptions-item>
- <el-descriptions-item
- :label="$t('label.returnLogisticsCompany')"
- v-if="refundInfo.shipmodeId"
- >{{ refundInfo.shipmodeId }}</el-descriptions-item
- >
- <el-descriptions-item
- :label="$t('label.returnExpressNumber')"
- v-if="refundInfo.shippingNo"
- >{{ refundInfo.shippingNo
- }}<i
- style="color:blue;"
- v-if="refundInfo.shippingNo"
- class="el-icon-document-copy"
- :title="$t('title.copy')"
- :copy-value="refundInfo.shippingNo"
- v-on:click="copy"
- ></i
- ></el-descriptions-item>
- <el-descriptions-item :label="$t('label.buyersNote')">{{
- refundInfo.buyNotes
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('label.customerReturnCountry')">{{
- addressInfo.receiverCountryName
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('label.refundMethod')">
- {{ refundInfo.refundMethod | refundMethodFilter(that) }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.accountType')">
- {{ refundInfo.refundAccountType | refundAccountTypeFilter(that) }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.refundAccount')">
- {{ refundInfo.refundAccount }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.isSelfPickupOrder')">
- <span v-if="refundInfo.isSelfPickupOrder === false">{{
- $t("no")
- }}</span>
- <span v-else>{{ $t("yes") }}</span>
- </el-descriptions-item>
- <!-- TODO 暂时关闭SL -->
- <el-descriptions-item :label="$t('label.openShippingLabel')">
- {{ refundInfo.slUseable | SlstatusFilter }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.useShippingLabel')">
- {{ refundInfo.slFlag | SlstatusFilter }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.shippingRefundAmount')">
- {{ refundInfo.refundPostageAmount }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.sumGiftCardRefundAmount')">
- {{ refundInfo.sumGiftCardRefundAmount }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.sumAiGiftCardRefundAmount')">
- {{ refundInfo.sumAiGiftCardRefundAmount }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.customerServiceNote')">{{
- refundInfo.notes
- }}</el-descriptions-item>
- </el-descriptions>
- </el-card>
- <!--
- <el-divider><i class="el-icon-magic-stick"></i></el-divider>
- -->
- <el-card class="box-card">
- <el-descriptions
- :title="$t('title.returnProducts') + '-' + (index + 1)"
- v-for="(item, index) in orderItemInfo"
- :key="index"
- :colon="false"
- :column="6"
- :style="titleColor(item)"
- border
- >
- <el-descriptions-item :label="$t('label.isNoHeadFlag')">
- <span v-if="item.isHeadFlag == 1">
- 是
- </span>
- <span v-if="item.isHeadFlag == 0">
- 否
- </span>
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.noHeadFlag')">
- <span v-if="item.isHeadFlag == 1">
- {{ item.ordersIdS }}
- </span>
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.uniqueCode')">{{
- item.uniqueCode
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('label.skuCode')"
- >{{ item.skuCode }}
- <i
- style="color:blue;"
- class="el-icon-document-copy"
- :title="$t('title.copy')"
- :copy-value="item.skuCode"
- v-on:click="copy"
- ></i
- ></el-descriptions-item>
- <el-descriptions-item :label="$t('label.shopifyNumber')"
- >{{ item.orderOnId }}
- <i
- style="color:blue;"
- class="el-icon-document-copy"
- :title="$t('title.copy')"
- :copy-value="item.orderOnId"
- v-on:click="copy"
- ></i
- ></el-descriptions-item>
- <el-descriptions-item :label="$t('label.orderStatus')"
- >{{ item.orderStatus | statusFilterStatus }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.orderItemStatus')"
- >{{ item.itemStatus | statusFilterStatus }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.exchangeGoods')">
- {{ item.exchangeFlag === "1" ? $t("label.yes") : $t("label.no") }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.originalSKU')">
- {{ item.oldSku }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.productName')">{{
- item.productName
- }}</el-descriptions-item>
- <el-descriptions-item
- :label="$t('label.quantity')"
- labelStyle="color: red;"
- contentStyle="color: red;"
- v-if="item.quantity > 1"
- >{{ item.quantity }}
- </el-descriptions-item>
- <el-descriptions-item
- :label="$t('label.quantity')"
- v-if="item.quantity <= 1"
- >{{ item.quantity }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.refundSubtotal')">{{
- item.refundAmount
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('label.salePrice')">{{
- item.price
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('label.paymentAmount')"
- >{{ item.totalFee }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.discountAmount')">{{
- item.discountFee
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('label.sellerDiscount')">{{
- item.sellerDiscount
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('label.platformDiscount')">{{
- item.platformDiscount
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('label.loanAmount')">{{
- item.loanAmount
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('label.status')"
- >{{ item.returnStatus | statusFiltr2 }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('inboundStatus')">
- {{ item.inboundStatus | inboundStatusFilter }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.receivedGoodsType')">{{
- item.receiveType | receiveTypeFilter
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('label.currencyInformation')">{{
- refundInfo.currency
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('label.refundReason')">{{
- item.refundReason | reasonFilter(item.refundReasonList)
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('label.otherReasons')">{{
- item.otherReason
- }}</el-descriptions-item>
- </el-descriptions>
- </el-card>
- <!--
- <el-divider><i class="el-icon-magic-stick"></i></el-divider>
- -->
- <!-- 多件多折信息 -->
- <el-card class="box-card" v-has="'priceRule:list'">
- <el-descriptions
- :column="6"
- :title="$t('discountInfo')"
- :colon="false"
- border
- >
- <el-descriptions-item
- :label="$t('multipleDiscountInfo.OriginalDiscount')"
- >2件9折</el-descriptions-item
- >
- <el-descriptions-item
- :label="$t('multipleDiscountInfo.OriginalMoneny')"
- >{{ addressInfo.receiverState }}</el-descriptions-item
- >
- <el-descriptions-item
- :label="$t('multipleDiscountInfo.afterReturnDiscount')"
- >{{ addressInfo.receiverCity }}</el-descriptions-item
- >
- <el-descriptions-item
- :label="$t('multipleDiscountInfo.afterReturnMoney')"
- >{{ addressInfo.receiverCity }}</el-descriptions-item
- >
- <el-descriptions-item :label="$t('multipleDiscountInfo.returnMoney')">{{
- addressInfo.receiverCity
- }}</el-descriptions-item>
- <el-descriptions-item
- :label="$t('multipleDiscountInfo.needPayMoney')"
- >{{ addressInfo.receiverCity }}</el-descriptions-item
- >
- </el-descriptions>
- </el-card>
- <el-card class="box-card">
- <el-descriptions
- :title="$t('title.buyerInformation')"
- :colon="false"
- border
- >
- <el-descriptions-item :label="$t('country')">{{
- addressInfo.receiverCountryName
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('state')">{{
- addressInfo.receiverState
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('city')">{{
- addressInfo.receiverCity
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('suburb')">{{
- addressInfo.receiverDistrict
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('street')">{{
- addressInfo.receiverStreet
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('address')">{{
- addressInfo.receiverAddress
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('dooeNo')">{{
- addressInfo.receiverAddress2
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('recipient')">{{
- addressInfo.receiverName
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('telephone')"
- >{{ addressInfo.receiverPhone
- }}<i
- style="color:blue;"
- v-if="addressInfo.receiverPhone"
- class="el-icon-document-copy"
- :title="$t('title.copy')"
- :copy-value="addressInfo.receiverPhone"
- v-on:click="copy"
- ></i
- ></el-descriptions-item>
- <el-descriptions-item :label="$t('moPhone')"
- >{{ addressInfo.receiverMobile
- }}<i
- style="color:blue;"
- v-if="addressInfo.receiverMobile"
- class="el-icon-document-copy"
- :title="$t('title.copy')"
- :copy-value="addressInfo.receiverMobile"
- v-on:click="copy"
- ></i
- ></el-descriptions-item>
- <el-descriptions-item :label="$t('post')"
- >{{ addressInfo.email
- }}<i
- style="color:blue;"
- v-if="addressInfo.email"
- class="el-icon-document-copy"
- :title="$t('title.copy')"
- :copy-value="addressInfo.email"
- v-on:click="copy"
- ></i
- ></el-descriptions-item>
- <el-descriptions-item :label="$t('refundImg')">
- <el-image
- style="width: 40px; height: 40px"
- :src="refundInfo.annexPath"
- :preview-src-list="[refundInfo.annexPath]"
- >
- <div slot="error" class="image-slot">
- <i class="el-icon-picture-outline"></i>
- </div>
- </el-image>
- </el-descriptions-item>
- </el-descriptions>
- </el-card>
- <!--
- <el-divider><i class="el-icon-magic-stick"></i></el-divider>
- -->
- <el-card class="box-card">
- <el-descriptions :title="$t('title.operationLog')"> </el-descriptions>
- <el-timeline>
- <el-timeline-item
- type="primary"
- v-for="(log, index) in logs"
- :key="index"
- :timestamp="log.timeplaced"
- >
- {{ log.userName }} : {{ log.statusNotes }}
- </el-timeline-item>
- </el-timeline>
- </el-card>
- </div>
- </template>
- <script>
- import { handleClipboard } from "@/api/oms/copy";
- import {
- getRefundInfo,
- checkRefundCalculates,
- checkCw,
- checkKf,
- queryShippingAmount
- } from "@/api/oms/refund/refund";
- import { fetchList as reasonList } from "@/api/oms/refund/refundReason";
- import global from "@/views/oms/global";
- import { queryByOrdersId, queryByOrmorder } from "@/api/oms/order/address";
- import { returnWarehouseList } from "@/api/oms/inventory/warehouse";
- import { statusKeyValue } from "@/api/oms/order/order";
- import i18n from "@/lang";
- import { red } from "stylus/lib/functions";
- const refundMethodOptions = [
- { key: "system", display_name: "view.systemRefund" },
- { key: "manual", display_name: "view.manualRefund" }
- ];
- const refundMethodKeyValue = refundMethodOptions.reduce((acc, cur) => {
- acc[cur.key] = cur.display_name;
- return acc;
- }, {});
- const refundAccountTypeOptions = [
- { key: "PayPal", display_name: "PayPal" },
- { key: "bankCard", display_name: "view.bankCard" },
- { key: "other", display_name: "view.other" }
- ];
- const refundAccountTypeKeyValue = refundAccountTypeOptions.reduce(
- (acc, cur) => {
- acc[cur.key] = cur.display_name;
- return acc;
- },
- {}
- );
- export default {
- name: "refundInfoDialog",
- props: ["refundId", "action"],
- components: {},
- data() {
- return {
- that: this,
- active: 1,
- isShopifyLabel: false,
- activeName: "orderItemList",
- afterSaleStatusSuccess: global.afterSaleStatusSuccess,
- discountInfo: [],
- refundInfo: {},
- orderItemInfo: {},
- addressInfo: {},
- logs: [],
- checkData: {
- refundMethod: "system",
- rejectReason: "",
- notes: ""
- },
- btndisabled: true,
- btnLoading: false,
- successbtndisabled: false,
- hideStyleBtn: "",
- btndisableed: false,
- wareHouses: [], //收退货仓库列表
- selectedWarehouseCode: "",
- returnWarehouseAddress: "", //收退货的地址
- returnWcodeAndAddress: {},
- refundPriority: "",
- refundReasons: [],
- slUseAble: "0",
- shippingLabelMessage: "",
- showSlChooseLabel: 0 //是否展示选择使用sl标签 0 否 1 是
- };
- },
- filters: {
- refundAccountTypeFilter(key, that) {
- return that.$t(refundAccountTypeKeyValue[key]);
- },
- refundMethodFilter(key, that) {
- return that.$t(refundMethodKeyValue[key]);
- },
- statusFilterStatus(key) {
- return i18n.t(statusKeyValue[key]);
- },
- statusFilter(key) {
- var value = "";
- global.afterSaleStatus.forEach(status => {
- if (status.value == key) {
- value = status.label;
- }
- });
- return value;
- },
- refundTypeFilter(key, that) {
- var value = "";
- global.afterSaleType.forEach(refundType => {
- if (refundType.value == key) {
- value = that.$t(refundType.label);
- }
- });
- return value;
- },
- statusFiltr2(key) {
- var value = "";
- if (key != null) {
- var keys = key.split(",");
- global.returnDeatilStatus.forEach(status => {
- for (var i = 0; i < keys.length; i++) {
- if (status.value == keys[i]) {
- value += status.label + ",";
- }
- }
- });
- }
- return value;
- },
- inboundStatusFilter(key) {
- var value = "";
- if (key != null) {
- var keys = key.split(",");
- global.inboundStatus.forEach(type => {
- for (var i = 0; i < keys.length; i++) {
- if (type.value == keys[i]) {
- value += type.label + ",";
- }
- }
- });
- }
- return value;
- },
- reasonFilter(key, refundReasonList) {
- var value = "";
- refundReasonList.forEach(type => {
- if (type.id == key) {
- value = type.reasonContentChinese;
- }
- });
- return value;
- },
- receiveTypeFilter(key) {
- var value = "";
- if (key != null) {
- var keys = key.split(",");
- global.receiveType.forEach(type => {
- for (var i = 0; i < keys.length; i++) {
- if (type.value == keys[i]) {
- value += type.label + ",";
- }
- }
- });
- }
- return value;
- },
- SlstatusFilter(key) {
- if (key == "1") {
- return "YES";
- } else if (key == "0") {
- return "NO";
- }
- }
- },
- created() {
- //获取退货详情信息
- this.initialization();
- //获取仓库列表
- // this.getReturnWarehouseList();
- },
- methods: {
- getRefundReasonList(type) {
- reasonList({ reasonType: type, limit: 1000 }).then(res => {
- if (200 == res.code) {
- this.refundReasons = res.data.list;
- }
- });
- },
- //选择物流公司编码,带出地址
- handelChangeReturnWarehouse() {
- if (
- this.selectedWarehouseCode !== "PSJ-H0000024" &&
- this.selectedWarehouseCode !== "PSJ-H0000019" &&
- this.selectedWarehouseCode !== "PSJ-H0000011" &&
- this.selectedWarehouseCode !== "PSJ-G001001" &&
- this.selectedWarehouseCode !== "PSJ-G001003" &&
- this.selectedWarehouseCode !== "PSJ-G001004"
- ) {
- this.slUseAble = "0";
- this.showSlChooseLabel = 0; //展示sl的选择标签
- // 触发预估运费查询,目前只有一个仓库使用,可暂时不添加查询逻辑,后续若多仓库支持,则需要增加实时查询预估运费逻辑
- } else {
- this.slUseAble = "1";
- this.showSlChooseLabel = 1; //展示sl的选择标签
- }
- //TODO 暂时关闭SL
- this.slUseAble = "0";
- this.showSlChooseLabel = 1; //展示sl的选择标签
- this.returnWarehouseAddress = this.returnWcodeAndAddress[
- this.selectedWarehouseCode
- ];
- this.checkPSJWarehouse(
- this.returnWarehouseAddress,
- this.selectedWarehouseCode
- );
- },
- //获取退货仓库列表
- getReturnWarehouseList() {
- this.wareHouses = [];
- this.returnWcodeAndAddress = {};
- returnWarehouseList({ limit: 1000 }).then(res => {
- if (200 == res.code) {
- if (res.data.list != null && res.data.list.length > 0) {
- res.data.list.forEach(item1 => {
- var addressInfo =
- item1.contacts +
- " " +
- item1.countryCode +
- " " +
- item1.province +
- " " +
- item1.city +
- " " +
- item1.district +
- " " +
- item1.street +
- " " +
- item1.address1 +
- " " +
- item1.address2 +
- " " +
- item1.phoneNo +
- " " +
- item1.mobileNo +
- " " +
- item1.email;
- this.wareHouses.push(item1);
- this.returnWcodeAndAddress[
- item1.returnWarehouseCode
- ] = addressInfo;
- if (item1.returnWarehouseCode == this.refundInfo.warehouseCode) {
- this.selectedWarehouseCode = this.refundInfo.warehouseCode;
- this.returnWarehouseAddress = this.returnWcodeAndAddress[
- this.selectedWarehouseCode
- ];
- }
- });
- }
- //展示sl的选择标签
- this.checkPSJWarehouse(
- this.returnWarehouseAddress,
- this.selectedWarehouseCode
- );
- // TODO 暂时关闭SL
- // if (this.selectedWarehouseCode == "PSJ-H0000024") {
- // this.slUseAble = "1";
- // this.showSlChooseLabel = 1; //展示sl的选择标签
- // }
- }
- this.listLoading = false;
- });
- },
- //获取售后详情
- initialization() {
- getRefundInfo(this.refundId)
- .then(res => {
- if (200 == res.code) {
- this.refundInfo = res.data;
- this.orderItemInfo = res.data.items;
- this.logs = res.data.logItems;
- //获取收退货仓库列表
- this.getShippingLabelAmount(this.refundInfo, "");
- // this.getRefundReasonList(res.data.refundType);
- return Promise.resolve(res.data.ordersNo);
- }
- return Promise.reject();
- })
- .then(ordersId => {
- return queryByOrdersId(ordersId);
- })
- .then(res => {
- if (200 == res.code) {
- this.addressInfo = res.data;
- this.getReturnWarehouseList();
- if (this.addressInfo.receiverCountryCode == "GB") {
- this.refundInfo.warehouseCode = "PSJ-H0000044";
- this.selectedWarehouseCode = "PSJ-H0000044";
- }
- if (this.addressInfo.receiverCountryCode == "JP") {
- this.refundInfo.warehouseCode = "JPNW01";
- this.selectedWarehouseCode = "JPNW01";
- }
- if (this.addressInfo.receiverCountryCode == "TW") {
- this.refundInfo.warehouseCode = "G00886001";
- this.selectedWarehouseCode = "G00886001";
- }
- if (this.addressInfo.receiverCountryCode == "HK") {
- this.refundInfo.warehouseCode = "HKW002";
- this.selectedWarehouseCode = "HKW002";
- }
- var esCountries = ['ES','AT','BE','BG','HR',
- 'CZ','DK','EE','FI','FR',
- 'DE','GR','HU','IE','IT',
- 'LV','LT','LU','NL','PL',
- 'PT','RO','SK','SI','SE'];
- if (esCountries.includes(this.addressInfo.receiverCountryCode)) {
- this.refundInfo.warehouseCode = 'ESPW03';
- this.selectedWarehouseCode = 'ESPW03';
- }
- }
- });
- },
- //复制
- copy(event) {
- var text = event.target.attributes["copy-value"].value;
- handleClipboard(text, event);
- },
- handleCheck(status) {
- this.btnLoading = true;
- this.btndisabled = true;
- let msg = "";
- if (status === 6) {
- msg = "确认审核通过?";
- } else {
- msg = "确认审核驳回?";
- }
- this.$confirm(msg, "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- var params = {
- id: this.refundInfo.id,
- status: status,
- cwnotes: this.checkData.cwnotes,
- refundMethod: this.refundInfo.refundMethod,
- refundAccountType: this.refundInfo.refundAccountType,
- refundAccount: this.refundInfo.refundAccount,
- refundPriority: this.refundPriority
- };
- checkCw(params).then(
- res => {
- if (200 == res.code) {
- this.$message({
- message: "操作成功",
- type: "success"
- });
- this.hideStyleBtn = "display:none";
- this.btndisabled = false;
- this.btndisableed = true;
- this.btnLoading = false;
- this.$emit("refresh");
- }
- },
- error => {
- this.btnLoading = false;
- this.btndisabled = true;
- }
- );
- })
- .catch(() => {
- this.btnLoading = false;
- this.btndisabled = true;
- this.$message({
- type: "info",
- message: "已取消操作"
- });
- });
- },
- // 审核是否是派速捷仓库 美国地址
- checkPSJWarehouse(house, code) {
- let shu = house.split(" ");
- if (
- this.addressInfo.receiverCountryCode == "US" &&
- (code == "PSJ-G001003" ||
- code == "PSJ-G001001" ||
- code == "PSJ-H0000024" ||
- code == "PSJ-H0000019" ||
- code == "PSJ-H0000011" ||
- code == "PSJ-G001004")
- ) {
- this.isShopifyLabel = true;
- this.refundInfo.warehouseCode = code;
- this.slUseAble = "1";
- this.getShippingLabelAmount(this.refundInfo);
- } else {
- this.isShopifyLabel = false;
- }
- },
- //客服审核
- handleKfCheck(status) {
- this.btnLoading = true;
- this.btndisabled = true;
- let msg = "";
- if (status === 1) {
- msg = "确认审核通过?";
- } else {
- msg = "确认审核驳回?";
- }
- // if (this.slUseAble == "1") {
- // if (
- // this.refundInfo.shippingNo &&
- // this.refundInfo.shippingNo != "/" &&
- // (this.refundInfo.shipmodeId && this.refundInfo.shipmodeId != "/")
- // ) {
- // this.$message.error("当前退货物流信息已维护,无法使用SL渠道");
- // this.btnLoading = false;
- // this.btndisabled = false;
- // return;
- // }
- // }
- this.$confirm(msg, "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- //如果是退货退款 客服审核且当前的仓库编码是空的提示让客服选择一个收退货仓库编码
- if (
- this.refundInfo.refundType == "3" &&
- !this.selectedWarehouseCode
- ) {
- this.$message({
- type: "info",
- message: "Please choose a warehouse to receive return goods"
- });
- return false;
- }
- var params = {
- id: this.refundInfo.id,
- status: status,
- rejectReason: this.checkData.rejectReason,
- notes: this.checkData.notes,
- warehouseCode: this.selectedWarehouseCode, //选择的收退货仓库编码
- // slUseable: this.slUseAble //是否使用SL
- slUseable: this.slUseAble //TODO 暂时关闭SL
- };
- checkKf(params).then(
- res => {
- if (200 == res.code) {
- this.$message({
- message: "操作成功",
- type: "success"
- });
- this.hideStyleBtn = "display:none";
- this.btndisabled = false;
- this.btndisableed = true;
- this.btnLoading = false;
- this.$emit("refresh");
- }
- },
- error => {
- this.btnLoading = false;
- this.btndisabled = true;
- }
- );
- })
- .catch(() => {
- this.btnLoading = false;
- this.btndisabled = true;
- this.$message({
- type: "info",
- message: "已取消操作"
- });
- });
- },
- handleCalculatesCheck() {
- this.btnLoading = true;
- var params = {
- id: this.refundInfo.id
- };
- checkRefundCalculates(params)
- .then(
- res => {
- if (200 === res.code) {
- if (res.msg === "exist") {
- this.refundPriority = "gift";
- this.$confirm(
- "当前订单存在礼品卡支付,执行退款将优先退还礼品卡金额",
- "温馨提示",
- {
- confirmButtonText: "确认",
- cancelButtonText: "关闭",
- showCancelButton: false,
- cancelButtonClass: "btnCancel",
- type: "warning",
- showClose: false
- }
- );
- } else if (res.msg === "none") {
- this.refundPriority = "";
- this.$confirm(
- "当前售后没有可退款的支付流水,请您选择手工退款方式",
- "温馨提示",
- {
- confirmButtonText: "确认",
- cancelButtonText: "关闭",
- showCancelButton: false,
- cancelButtonClass: "btnCancel",
- type: "warning",
- showClose: false
- }
- );
- } else {
- this.refundPriority = "";
- }
- this.$message({
- message: "验证通过",
- type: "success"
- });
- this.btnLoading = false;
- this.btndisabled = false;
- }
- },
- error => {
- this.btnLoading = false;
- this.btndisabled = true;
- }
- )
- .catch(() => {
- this.btnLoading = false;
- this.btndisabled = true;
- });
- },
- titleColor(item) {
- if (item.quantity > 1) {
- return "color: red !important;";
- }
- },
- getShippingLabelAmount(refundInfo) {
- if (refundInfo.refundType == "3" && this.selectedWarehouseCode) {
- queryShippingAmount(refundInfo).then(res => {
- if (201 == res.errorKey) {
- this.shippingLabelMessage = res.msg;
- } else if (200 == res.code) {
- this.shippingLabelMessage =
- "当前退款金额为" +
- refundInfo.refundAmount +
- ",开启后退款金额为" +
- res.shippingLabelAmount;
- }
- });
- }
- }
- }
- };
- </script>
- <style lang="scss">
- .detail {
- .el-descriptions__title {
- color: #606266;
- font-size: 16px !important;
- line-height: 16px;
- position: relative;
- padding-left: 8px !important;
- &:before {
- position: absolute;
- left: 0px;
- top: 0px;
- content: "";
- display: inline-block;
- width: 3px;
- height: 13px;
- background: #ae8877;
- border-radius: 0px 0px 0px 0px;
- }
- }
- .box-card {
- box-shadow: none;
- border: none;
- }
- .el-descriptions {
- margin-bottom: 40px;
- &:last-child {
- margin-bottom: 0px;
- }
- }
- .el-descriptions__body {
- width: 100%;
- overflow: auto;
- }
- .el-descriptions__table {
- table-layout: fixed;
- }
- }
- </style>
|