12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115 |
- <template>
- <div>
- <!-- 收退货仓库信息-->
- <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"
- 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')" span="1">
- {{ 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')" span="2"
- >{{ 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="退款原因(中文)" span="2">{{
- refundInfo.reasonContentChinese
- }}</el-descriptions-item>
- <el-descriptions-item label="退款原因(English)" span="1">{{
- refundInfo.reasonContentEnglish
- }}</el-descriptions-item>
- <el-descriptions-item
- v-if="refundInfo.otherReason"
- label="其他原因说明"
- span="3">{{
- refundInfo.otherReason
- }}</el-descriptions-item> -->
- <el-descriptions-item
- :label="$t('label.receivingReturnWarehouse')"
- span="1"
- v-if="refundInfo.warehouseName"
- >
- {{ refundInfo.warehouseName }}
- </el-descriptions-item>
- <el-descriptions-item
- :label="$t('label.warehouseReceivingStatus')"
- span="1"
- 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.customerServiceNote')"
- span="3"
- >{{ refundInfo.notes }}</el-descriptions-item
- >
- <el-descriptions-item :label="$t('label.buyersNote')" span="1">{{
- refundInfo.buyNotes
- }}</el-descriptions-item>
- <el-descriptions-item
- :label="$t('label.customerReturnCountry')"
- span="2"
- >{{ addressInfo.receiverCountryName }}</el-descriptions-item
- >
- <el-descriptions-item :label="$t('label.refundMethod')" span="1">
- {{ refundInfo.refundMethod | refundMethodFilter(that) }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.accountType')" span="2">
- {{ refundInfo.refundAccountType | refundAccountTypeFilter(that) }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.refundAccount')" span="2">
- {{ refundInfo.refundAccount }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.isSelfPickupOrder')" span="1">
- <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')" span="1">
- {{ refundInfo.slUseable | SlstatusFilter }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.useShippingLabel')" span="2">
- {{ refundInfo.slFlag | SlstatusFilter }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.shippingRefundAmount')" span="1">
- {{refundInfo.refundPostageAmount}}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.sumGiftCardRefundAmount')" span="1">
- {{refundInfo.sumGiftCardRefundAmount}}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.sumAiGiftCardRefundAmount')" span="1">
- {{refundInfo.sumAiGiftCardRefundAmount}}
- </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"
- :style="titleColor(item)"
- border
- >
- <el-descriptions-item :label="$t('label.isNoHeadFlag')" span="1">
- <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="2">
- <span v-if="item.isHeadFlag == 1 ">
- {{item.ordersIdS}}
- </span>
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.uniqueCode')" span="3">{{
- 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')" span="2"
- >{{ 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')" span="2"
- >{{ item.itemStatus | statusFilterStatus }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.exchangeGoods')" span="1">
- {{ item.exchangeFlag === "1" ? $t("label.yes") : $t("label.no") }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.originalSKU')" span="2">
- {{ item.oldSku }}
- </el-descriptions-item>
- <el-descriptions-item :label="$t('label.productName')" span="2">{{
- 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')" span="2">{{
- 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">
- <el-descriptions
- :title="$t('title.buyerInformation')"
- :colon="false"
- border
- >
- <el-descriptions-item :label="$t('country')" span="3">{{
- 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')" span="3">{{
- addressInfo.receiverStreet
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('address')" span="3">{{
- addressInfo.receiverAddress
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('dooeNo')" span="2">{{
- addressInfo.receiverAddress2
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('recipient')">{{
- addressInfo.receiverName
- }}</el-descriptions-item>
- <el-descriptions-item :label="$t('telephone')" span="3"
- >{{ 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')" span="3"
- >{{ 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')" span="3"
- >{{ 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')" span="3">
- <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,
- 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';
- }
- }
- });
- },
- //复制
- 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">
- //.btnCancel{
- // float: right;
- // margin-left: 10px;
- // color: #fff !important;
- // background-color: #AE8877 !important;
- // border-color: #AE8877 !important;
- //}
- //.btnCancel:hover, .btnCancel:focus {
- // background: #bea092 !important;
- // border-color: #bea092 !important;
- // color: #fff !important;
- //}
- </style>
|