Просмотр исходного кода

feat:增加一个售后模块旧版本

chenjiaxin 2 месяцев назад
Родитель
Сommit
5d91330fb4

+ 7 - 7
src/router/modules/refund-old.js

@@ -5,43 +5,43 @@ import Layout from "@/layout";
 const refundRouter = {
   path: "/refund-old",
   component: Layout,
-  redirect: "/refund/refundList",
+  redirect: "/refund-old/refundList",
   name: "afterSales-Old",
   meta: { title: "afterSales-Old", icon: "refund" },
   children: [
     {
       path: "refundList",
-      component: () => import("@/views/oms/refund/refundList"),
+      component: () => import("@/views/oms/refund-old/refundList"),
       name: "refundList",
       meta: { title: "refundManagement" }
     },
     {
       path: "refundCwList",
-      component: () => import("@/views/oms/refund/refundCwList"),
+      component: () => import("@/views/oms/refund-old/refundCwList"),
       name: "refundCwList",
       meta: { title: "financialAudit" }
     },
     {
       path: "returnList",
-      component: () => import("@/views/oms/refund/returnDetailList.vue"),
+      component: () => import("@/views/oms/refund-old/returnDetailList.vue"),
       name: "returnList",
       meta: { title: "returnManagement" }
     },
     {
       path: "refundReason",
-      component: () => import("@/views/oms/refund/refundReason.vue"),
+      component: () => import("@/views/oms/refund-old/refundReason.vue"),
       name: "refundReason",
       meta: { title: "refundReasons" }
     },
     {
       path: "autoRefund",
-      component: () => import("@/views/oms/refund/autoRefund.vue"),
+      component: () => import("@/views/oms/refund-old/autoRefund.vue"),
       name: "autoRefund",
       meta: { title: "自动退款配置" }
     },
     {
       path: "shippingFeeRule",
-      component: () => import("@/views/oms/refund/shippingFeeRule.vue"),
+      component: () => import("@/views/oms/refund-old/shippingFeeRule.vue"),
       name: "shippingFeeRule",
       meta: { title: "slFreightRules" }
     }

+ 1269 - 0
src/views/oms/refund-old/abnormalRefundList.vue

@@ -0,0 +1,1269 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <el-select
+        :placeholder="$t('place.afterSalesType')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.refundType"
+        @change="queryRefundReason"
+      >
+        <el-option
+          v-for="afterSaleType in afterSaleTypes"
+          :key="afterSaleType.value"
+          :label="$t(afterSaleType.label)"
+          :value="afterSaleType.value"
+        >
+        </el-option>
+      </el-select>
+      <el-select
+        :placeholder="$t('place.afterSalesStatus')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.status"
+      >
+        <el-option
+          v-for="status in afterSaleStatus"
+          :key="status.value"
+          :label="$t(status.label)"
+          :value="status.value"
+        >
+        </el-option>
+      </el-select>
+
+      <el-select
+        v-model="listQuery.exchangeFlag"
+        :clearable="true"
+        class="filter-item"
+        style="width: 200px;"
+        :placeholder="$t('exchangeFlag')"
+      >
+        <el-option key="1" :label="$t('label.yes')" value="1"></el-option>
+        <el-option key="0" :label="$t('label.no')" value="0"></el-option>
+      </el-select>
+
+      <el-select
+        v-model="listQuery.channelCode"
+        :clearable="true"
+        class="filter-item"
+        style="width: 200px;"
+        :placeholder="$t('place.channel')"
+        @change="getStore"
+      >
+        <el-option
+          v-for="item in channel"
+          :key="item.code"
+          :label="item.name"
+          :value="item.code"
+        >
+        </el-option>
+      </el-select>
+      <el-select
+        v-model="listQuery.storeId"
+        :clearable="true"
+        class="filter-item"
+        style="width: 200px;"
+        :placeholder="$t('place.shopName')"
+        @change="getChannel"
+      >
+        <el-option
+          v-for="item in store"
+          :key="item.storeId"
+          :label="item.storeName"
+          :value="item.storeId"
+        >
+        </el-option>
+      </el-select>
+      <el-input
+        :placeholder="$t('place.refundNumber')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.refundNo"
+      />
+      <el-input
+        :placeholder="$t('place.onlineRefundNumber')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.ormRefundId"
+      />
+      <el-input
+        :placeholder="$t('place.shopifyNumber')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.shopify"
+      />
+
+      <el-input
+        :placeholder="$t('place.onlineShopNumber')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.ormorder"
+      />
+
+      <el-select
+        :placeholder="$t('place.afterSalesInitiator')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.originatorFlag"
+      >
+        <el-option
+          value="1"
+          :label="$t('label.customerService')"
+          key="1"
+        ></el-option>
+        <el-option value="2" :label="$t('label.buyer')" key="2"></el-option>
+      </el-select>
+
+      <el-date-picker
+        class="filter-item"
+        style="display: inline-flex;"
+        v-model="createTimePicker"
+        type="datetimerange"
+        :range-separator="$t('to')"
+        :start-placeholder="$t('place.refundCreationStart')"
+        :end-placeholder="$t('place.refundCreationEnd')"
+        value-format="yyyy-MM-dd HH:mm:ss"
+      >
+      </el-date-picker>
+
+      <el-select
+        :placeholder="$t('place.refundMethod')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.refundMethod"
+      >
+        <el-option
+          value="system"
+          :label="$t('label.systemRefund')"
+          key="system"
+        ></el-option>
+        <el-option
+          value="manual"
+          :label="$t('label.manualRefund')"
+          key="manual"
+        ></el-option>
+      </el-select>
+
+      <el-input
+        :placeholder="$t('place.refundAccount')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.refundAccount"
+      />
+
+      <el-select
+        v-model="refundReasonList"
+        :clearable="true"
+        class="filter-item"
+        style="width: 200px;"
+        :placeholder="$t('place.refundReason')"
+        multiple
+        filterable
+        @change="queryRefundType"
+      >
+        <el-option
+          v-for="item in this.refundReason"
+          :key="item.reasonContentChinese"
+          :label="item.reasonContentChinese"
+          :value="item.reasonContentChinese"
+        >
+        </el-option>
+      </el-select>
+    </div>
+    <div class="filter-container">
+      <el-button
+        v-waves
+        class="filter-item"
+        type="success"
+        icon="el-icon-search"
+        @click="handleFilter"
+        >{{ $t("view.search") }}</el-button
+      >
+      <el-button class="filter-item" @click="exportExcel" type="primary">
+        {{ $t("exportRep") }}
+      </el-button>
+    </div>
+
+    <el-table
+      style="width: 100%;"
+      v-loading="listLoading"
+      :key="tableKey"
+      :data="list"
+      row-key="id"
+      stripe
+      border
+      fit
+      highlight-current-row
+      :cell-style="tableRowStyleName"
+      tooltip-effect="dark"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column
+        align="center"
+        type="selection"
+        :selectable="selectEnable"
+      >
+      </el-table-column>
+      <el-table-column align="center" type="index"> </el-table-column>
+      <el-table-column
+        :label="$t('label.refundNumber')"
+        width="200"
+        align="center"
+        prop="refundNo"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.onlineRefundNumber')"
+        width="250"
+        align="center"
+        prop="ormRefundId"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.shopifyNumber')"
+        width="200"
+        align="center"
+        prop="cutUser"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.onlineShopOrder')"
+        width="150"
+        align="center"
+        prop="ormorder"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('storeName')"
+        align="center"
+        min-width="180"
+        prop="storeName"
+      ></el-table-column>
+      <el-table-column
+        :label="$t('label.afterSalesType')"
+        width="100"
+        align="center"
+        prop="refundType"
+      >
+        <template slot-scope="scope">
+          {{ scope.row.refundType | refundTypeFilter(that) }}
+        </template>
+      </el-table-column>
+
+      <!-- <el-table-column :label="$t('label.exchangeGoods')" prop="exchangeFlag" width = "100" >
+        <template slot-scope="scope" >
+          {{scope.row.exchangeFlag==="1"?'是':'否'}}
+        </template>
+      </el-table-column> -->
+
+      <el-table-column
+        :label="$t('label.afterSalesInitiation')"
+        width="110"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <div v-if="scope.row.originatorFlag == '1'">
+            {{ $t("label.customerService") }}
+          </div>
+          <div v-if="scope.row.originatorFlag == '2'">
+            {{ $t("label.buyer") }}
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.afterSalesStatus')"
+        width="120"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <el-tag effect="dark" type="warning" v-if="scope.row.status == '4'">
+            {{ scope.row.status | statusFilter(that) }}
+          </el-tag>
+          <el-tag effect="dark" type="info" v-else-if="scope.row.status == '7'">
+            {{ scope.row.status | statusFilter(that) }}
+          </el-tag>
+          <el-tag effect="dark" type="success" v-else>
+            {{ scope.row.status | statusFilter(that) }}
+          </el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.applicationTime')"
+        width="160"
+        align="center"
+        prop="timeplaced"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.applicant')"
+        width="120"
+        align="center"
+        prop="userName"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.refundAmount')"
+        width="100"
+        align="center"
+        prop="refundAmount"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.shippingRefund')"
+        width="100"
+        align="center"
+        prop="refundPostageAmount"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.currency')"
+        width="100"
+        align="center"
+        prop="currency"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.serviceNote')"
+        width="150"
+        align="center"
+        prop="notes"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.buyerReasonNote')"
+        width="150"
+        align="center"
+        prop="buyNotes"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.refundMethod')"
+        width="150"
+        align="center"
+        prop="refundMethod"
+      >
+        <template slot-scope="scope">
+          {{ scope.row.refundMethod | refundMethodFilter(that) }}
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.accountType')"
+        width="150"
+        align="center"
+        prop="refundAccountType"
+      >
+        <template slot-scope="scope">
+          {{ scope.row.refundAccountType | refundAccountTypeFilter(that) }}
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.refundAccount')"
+        width="150"
+        align="center"
+        prop="refundAccount"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.channelID')"
+        width="120"
+        align="center"
+        prop="channelCode"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.channelName')"
+        width="140"
+        align="center"
+        prop="channelName"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.updateTime')"
+        width="160"
+        align="center"
+        prop="lastupdate"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.updater')"
+        width="120"
+        align="center"
+        prop="lastUserName"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.operation')"
+        fixed="right"
+        width="360"
+        align="left"
+      >
+        <template slot-scope="scope">
+          <el-button
+            type="primary"
+            size="mini"
+            @click="handleInfo(scope.row.id, 'view')"
+            >{{ $t("view.details") }}</el-button
+          >
+          <el-button
+            v-has="'ordersRefund:checkKf'"
+            v-if="scope.row.status == '1'"
+            size="mini"
+            type="warning"
+            @click="handleAddNote(scope.row)"
+            >{{ $t("view.modifyRemarks") }}
+          </el-button>
+
+           <el-button v-has="'ordersRefund:checkKf'" v-if="scope.row.abnormalFlag=='1' "  size="mini"-->
+                      type="success" @click="releaseEx(scope.row)">解除异常
+           </el-button>
+          <el-button
+            v-if="
+              scope.row.status == '0' ||
+                scope.row.status == '4' ||
+                scope.row.status == '1' ||
+                scope.row.status == '2'
+            "
+            type="danger"
+            size="mini"
+            @click="cancelInfo(scope.row)"
+            >{{ $t("view.cancel") }}
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 分页 -->
+    <swPage
+      v-if="total > 0"
+      key="2"
+      :listQuery="listQuery"
+      :total="total"
+      pos="btmRight"
+      @retPage="retPage"
+    />
+    <!-- 售后详情-->
+    <el-drawer
+      :title="$t('title.afterSalesDetails')"
+      :visible.sync="refundInfoVisible"
+      v-if="refundInfoVisible"
+      :direction="direction"
+      :size="dialogSize"
+    >
+      <refundInfoDialog
+        @refresh="refresh"
+        :refundId="currentRefundId"
+        :action="action"
+      ></refundInfoDialog>
+    </el-drawer>
+
+    <el-dialog
+      :title="$t('title.returnLogisticsInfo')"
+      :visible.sync="dialogShippFormVisible"
+      v-if="dialogShippFormVisible"
+      :close-on-click-modal="false"
+    >
+      <el-form :model="editShipp">
+        <el-form-item :label="$t('label.returnWarehouse')" label-width="150px">
+          <el-select
+            :placeholder="$t('place.pleaseSelect')"
+            clearable
+            style="width: 200px;"
+            class="filter-item"
+            v-model="editShipp.warehouseCode"
+            @change="shippingLabelOption"
+          >
+            <el-option
+              v-for="item in warehouseItems"
+              :key="item.key"
+              :label="item.key"
+              :value="item.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item
+          :label="$t('label.useSL')"
+          label-width="150px"
+          v-if="editShipp.slUseable == '1'"
+        >
+          <el-radio-group v-model="slFlag" @input="changeSL">
+            <el-radio label="0">{{ $t("view.notUsed") }}</el-radio>
+            <el-radio label="1">{{ $t("view.use") }}</el-radio>
+          </el-radio-group>
+        </el-form-item>
+
+        <el-form-item
+          :label="$t('label.returnLogisticsCompany')"
+          label-width="150px"
+        >
+          <el-input
+            v-if="slFlag == '0'"
+            size="mini"
+            v-model="editShipp.shipmodeId"
+            :placeholder="$t('place.pleaseFillIn')"
+            class="normal-input"
+          ></el-input>
+          <el-input
+            v-if="slFlag == '1'"
+            size="mini"
+            v-model="editShipp.shipmodeId"
+            :placeholder="$t('place.pleaseFillIn')"
+            class="normal-input"
+            disabled
+          ></el-input>
+        </el-form-item>
+        <el-form-item
+          :label="$t('label.returnExpressNumber')"
+          label-width="150px"
+        >
+          <el-input
+            v-if="slFlag == '0'"
+            size="mini"
+            v-model="editShipp.shippingNo"
+            :placeholder="$t('place.pleaseFillIn')"
+            class="normal-input"
+          ></el-input>
+          <el-input
+            v-if="slFlag == '1'"
+            size="mini"
+            v-model="editShipp.shippingNo"
+            :placeholder="$t('place.pleaseFillIn')"
+            class="normal-input"
+            disabled
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogShippFormVisible = false">{{
+          $t("view.cancel")
+        }}</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog
+      :title="$t('title.nullify')"
+      :visible.sync="dialogFormCancelVisible"
+      v-if="dialogFormCancelVisible"
+      :close-on-click-modal="false"
+    >
+      <el-form :model="cancelForm">
+        <el-form-item :label="$t('label.cancellationNote')" label-width="120px">
+          <el-input
+            type="textarea"
+            :placeholder="$t('place.enterContent')"
+            v-model="cancelForm.zfnotes"
+            maxlength="150"
+            show-word-limit
+          >
+          </el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormCancelVisible = false">{{
+          $t("view.cancel")
+        }}</el-button>
+        <el-button
+          type="primary"
+          @click="cancelSubmit"
+          v-loading="btnLoading"
+          >{{ $t("view.confirm") }}</el-button
+        >
+      </div>
+    </el-dialog>
+    <!--售后-->
+    <el-dialog
+      :title="$t('orderRefund')"
+      :fullscreen="true"
+      v-if="orderRefundVisible"
+      :visible.sync="orderRefundVisible"
+    >
+      <orderRefundDialog
+        :refundId="currentRefundId"
+      ></orderRefundDialog>
+      <el-button type="danger" style="float:right" @click="backTable">{{
+        $t("back")
+      }}</el-button>
+    </el-dialog>
+
+    <el-dialog
+      :title="$t('orderRefund')"
+      :fullscreen="true"
+      v-if="orderRefundNewVisible"
+      :visible.sync="orderRefundNewVisible"
+    >
+      <orderRefundNewDialog
+        :refundId="currentRefundId"
+      ></orderRefundNewDialog>
+      <el-button type="danger" style="float:right" @click="backTable">{{
+        $t("back")
+      }}</el-button>
+    </el-dialog>
+
+    <el-dialog
+      :title="$t('title.createRefundOrder')"
+      :fullscreen="true"
+      v-if="createRefundVisible"
+      :visible.sync="createRefundVisible"
+    >
+      <createRefundDialog></createRefundDialog>
+      <el-button type="danger" style="float:right" @click="backTable">{{
+        $t("back")
+      }}</el-button>
+    </el-dialog>
+
+    <el-dialog
+      :title="$t('title.importRefund')"
+      :visible.sync="dialogFormUploadVisible"
+      width="38%"
+      :destroy-on-close="destroyOnClose"
+    >
+      <el-form>
+        <el-form-item :label="$t('label.exportTemplate')">
+          <el-button class="filter-item" @click="downloadMould" type="primary">
+            {{ $t("exportTemplate") }}
+          </el-button>
+        </el-form-item>
+
+        <el-form-item :label="$t('label.importData')">
+          <el-upload
+            ref="upload"
+            :limit="2"
+            accept=".xlsx"
+            :headers="headers"
+            :action="upload.url + '?updateSupport=' + upload.updateSupport"
+            :disabled="upload.isUploading"
+            :on-progress="handleFileUploadProgress"
+            :on-success="handleFileSuccess"
+            :auto-upload="false"
+            drag
+          >
+            <i class="el-icon-upload"></i>
+            <div class="el-upload__text">
+              {{ $t("view.uploadFile") }}<em>{{ $t("view.clickUp") }}</em>
+            </div>
+            <div class="el-upload__tip" slot="tip">
+              {{ $t("view.xlsxFormatOnly") }}
+            </div>
+          </el-upload>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormUploadVisible = false">{{
+          $t("view.cancel")
+        }}</el-button>
+        <el-button type="primary" @click="submitUploadList">{{
+          $t("view.confirm")
+        }}</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog
+      :title="$t('addNote')"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :visible.sync="addNoteVisible"
+      width="40%"
+      v-loading="listLoading"
+    >
+      <el-form ref="addNoteForm" :model="addNoteForm" label-width="auto">
+        <el-form-item :label="$t('label.refundNumber')" prop="orderRefundId">
+          <el-input
+            disabled
+            v-model="addNoteForm.orderRefundId"
+            placeholder
+            class="normal-input"
+            style="width: 400px"
+          ></el-input>
+        </el-form-item>
+        <el-form-item :label="$t('label.serviceNote')" prop="note">
+          <el-input
+            type="textarea"
+            v-model="addNoteForm.note"
+            :placeholder="$t('setOrderNote')"
+            class="normal-input"
+          ></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="submit">{{ $t("save") }}</el-button>
+          <el-button type="danger" @click="addNoteVisible = false">{{
+            $t("back")
+          }}</el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import waves from "@/directive/waves";
+import swPage from "@/views/common/swPage";
+import global from "@/views/oms/global";
+import refundInfoDialog from "./refundDetail";
+import { getToken } from "@/utils/auth";
+import {
+  fetchList,
+  updateshipping,
+  cancel,
+  warehouseList,
+  rejectRefund,
+  addNote,
+  manualRefundSuccess,
+  batchReview,
+  getRefundType,
+  getRefundReason,
+  verifyExport
+} from "@/api/oms/refund/refund";
+import { dcmAdd } from "@/utils/toolUtil";
+import { fetchList as orderFetchList } from "@/api/oms/order/order";
+import orderRefundDialog from "@/views/oms/refund/components/orderRefundDialog";
+import orderRefundNewDialog from "@/views/oms/refund/components/orderRefundNewDialog";
+import createRefundDialog from "@/views/oms/refund/components/createRefundDialog";
+import log from "@/router/modules/log";
+import { queryChannelStore, queryChannel } from "@/api/oms/inventory/inventory";
+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: "refundList",
+  directives: {
+    waves
+  },
+  components: {
+    swPage,
+    refundInfoDialog,
+    global,
+    orderRefundDialog,
+    orderRefundNewDialog,
+    createRefundDialog
+  },
+  filters: {
+    refundAccountTypeFilter(key, that) {
+      return that.$t(refundAccountTypeKeyValue[key]);
+    },
+    refundMethodFilter(key, that) {
+      return that.$t(refundMethodKeyValue[key]);
+    },
+    statusFilter(key, that) {
+      var value = "";
+      global.afterSaleStatus.forEach(status => {
+        if (status.value == key) {
+          value = that.$t(status.label);
+        }
+      });
+      return value;
+    },
+    refundTypeFilter(key, that) {
+      var value = "";
+      global.afterSaleType.forEach(refundType => {
+        if (refundType.value == key) {
+          value = that.$t(refundType.label);
+        }
+      });
+      return value;
+    }
+  },
+  data() {
+    return {
+      that: this,
+      dialogSize: "40%",
+      direction: "rtl",
+      fileList: [],
+      tableKey: 0,
+      list: [],
+      total: 0,
+      listLoading: false,
+      destroyOnClose: true,
+      addNoteForm: {
+        id: null,
+        orderRefundId: "",
+        note: ""
+      },
+      addNoteVisible: false,
+      channel: [],
+      store: [],
+      //查询条件
+      listQuery: {
+        page: 1,
+        limit: 10,
+        storeId: "",
+        channelCode: "",
+        refundType: "",
+        reasonContentChinese: "",
+        shopify: "",
+        status: "",
+        exchangeFlag: "",
+        ordersNo: "",
+        ormRefundId: "",
+        ormorder: "",
+        originatorFlag: "",
+        refundNo: "",
+        timeplacedLaggerThanEqual: null,
+        timeplacedLessThanEqual: null,
+        abnormalFlag:'1'
+      },
+      dialogFormUploadVisible: false,
+      formLabelWidth: "120px",
+      createTimePicker: null,
+      multipleSelection: [],
+      selectionList: [],
+      channelCodes: global.channelCodes, //渠道编码
+      afterSaleStatus: global.afterSaleStatus, //售后状态
+      afterSaleTypes: global.afterSaleType, //售后类型
+      applyTypes: global.applyType, //售后来源
+      refundReason: [],
+      refundReasonList: [],
+      stores: [],
+      refundInfoVisible: false,
+      currentRefundId: "",
+      upload: {
+        // 是否显示弹出层(导入)
+        open: false,
+        // 弹出层标题(导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        // 上传的地址(后台接口)
+        url: process.env.VUE_APP_OMS_API + "/ordersRefund/uploadExcel"
+      },
+      editShipp: {
+        id: null,
+        shipmodeId: "",
+        shippingNo: "",
+        warehouseCode: "",
+        slUseable: "",
+        slFlag: ""
+      },
+      dialogShippFormVisible: false,
+      dialogFormCancelVisible: false,
+      cancelForm: {
+        refundNo: "",
+        zfnotes: ""
+      },
+      baseURL: process.env.VUE_APP_OMS_API,
+      warehouseItems: [],
+      btnLoading: false,
+      orderRefundVisible: false,
+      orderRefundNewVisible: false,
+      createRefundVisible: false,
+      currentOrdersId: "",
+      action: "", //  view  cus_check  t_check
+      slFlag: "0",
+      staging: {
+        shipmodeId: "",
+        shippingNo: ""
+      }
+    };
+  },
+  created() {
+    //获取店铺列表
+    this.getStores();
+    this.getList();
+    this.getChannel();
+    this.getStore();
+    this.queryRefundReason();
+  },
+  activated() {
+    this.getList();
+  },
+  computed: {
+    // 计算属性的 getter
+    headers: function() {
+      return {
+        "X-Token": getToken()
+      };
+    }
+  },
+  methods: {
+    //获取stores
+    getStores() {},
+
+    getList() {
+      this.listLoading = true;
+      fetchList(this.listQuery).then(res => {
+        if (200 == res.code) {
+          this.total = res.data.total;
+          this.list = res.data.list;
+        }
+        this.listLoading = false;
+      });
+    },
+    retPage() {
+      //分页
+      this.getList();
+    },
+    getChannel() {
+      queryChannel({ storeId: this.listQuery.storeId }).then(res => {
+        if (200 == res.code) {
+          this.channel = res.data;
+        }
+      });
+    },
+    getStore() {
+      queryChannelStore({ channelCode: this.listQuery.channelCode }).then(
+        res => {
+          if (200 == res.code) {
+            this.store = res.data;
+          }
+        }
+      );
+    },
+    submitUploadList() {
+      this.$refs.upload.submit();
+    },
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    //文件上传成功返回
+    handleFileSuccess(response, file, fileList) {
+      if (file.response.code === 200) {
+        this.$message({
+          message: "导入成功",
+          type: "success"
+        });
+        this.dialogFormUploadVisible = false;
+      } else {
+        this.$message.error(file.response.msg + ",请重新上传");
+        //删除上传列表中,失败的文件
+        let index = 0;
+        for (const i in fileList) {
+          if (fileList[i] == file) {
+            index = i;
+            break;
+          }
+        }
+        //移出当前文件对象
+        fileList.splice(index, 1);
+      }
+      this.upload.open = false;
+      this.upload.isUploading = false;
+    },
+    //导出模板
+    downloadMould() {
+      var url = this.baseURL + "ordersRefund/downloadMould";
+      window.location.href = url;
+    },
+    handleFilter() {
+      this.listQuery.page = 1;
+      if (this.createTimePicker == null) {
+        this.listQuery.timeplacedLaggerThanEqual = "";
+        this.listQuery.timeplacedLessThanEqual = "";
+      } else {
+        this.listQuery.timeplacedLaggerThanEqual = this.createTimePicker[0];
+        this.listQuery.timeplacedLessThanEqual = this.createTimePicker[1];
+      }
+      this.getList();
+    },
+
+    exportExcel() {
+      this.listQuery.page = 1;
+      this.listLoading = true;
+      if (this.createTimePicker == null) {
+        this.listQuery.timeplacedLaggerThanEqual = "";
+        this.listQuery.timeplacedLessThanEqual = "";
+      } else {
+        this.listQuery.timeplacedLaggerThanEqual = this.createTimePicker[0];
+        this.listQuery.timeplacedLessThanEqual = this.createTimePicker[1];
+      }
+
+      verifyExport(this.listQuery)
+        .then(res => {
+          if (200 == res.code) {
+            var url =
+              this.baseURL +
+              "ordersRefund/export?storeId=" +
+              this.listQuery.storeId +
+              "&refundType=" +
+              this.listQuery.refundType +
+              "&status=" +
+              this.listQuery.status +
+              "&ormRefundId=" +
+              this.listQuery.ormRefundId +
+              "&ormorder=" +
+              this.listQuery.ormorder +
+              "&refundNo=" +
+              this.listQuery.refundNo +
+              "&channelCode=" +
+              this.listQuery.channelCode +
+              "&shopify=" +
+              encodeURIComponent(this.listQuery.shopify) +
+              "&timeplacedLaggerThanEqual=" +
+              this.listQuery.timeplacedLaggerThanEqual +
+              "&timeplacedLessThanEqual=" +
+              this.listQuery.timeplacedLessThanEqual +
+              "&abnormalFlag=" +
+              this.listQuery.abnormalFlag;
+
+            window.location.href = url;
+          }
+          this.listLoading = false;
+        })
+        .catch(err => {
+          console.log(err);
+          this.listLoading = false;
+        });
+    },
+
+    //查看退款单详情
+    /**
+     *
+     * @param refundId 退款单号
+     * @param action 动作: view 查看 , cus_check 客服审核 f_check 财务审核
+     */
+    handleInfo(refundId, action) {
+      //进入退款单详情查看
+      this.currentRefundId = refundId;
+      this.action = action;
+      this.refundInfoVisible = true;
+    },
+    editInfo(row) {
+      //进入退款单详情查看
+      this.editShipp.id = row.id;
+      this.editShipp.shipmodeId = row.shipmodeId;
+      this.editShipp.shippingNo = row.shippingNo;
+      this.editShipp.warehouseCode = row.warehouseCode;
+      this.editShipp.slUseable = row.slUseable;
+      this.staging.shipmodeId = row.shipmodeId;
+      this.staging.shippingNo = row.shippingNo;
+      warehouseList().then(res => {
+        if (200 == res.code) {
+          this.warehouseItems = res.data;
+          this.shippingLabelOption();
+          this.dialogShippFormVisible = true;
+        }
+      });
+    },
+    cancelInfo(row) {
+      this.cancelForm = {
+        refundNo: "",
+        zfnotes: ""
+      };
+      this.cancelForm.refundNo = row.refundNo;
+      this.dialogFormCancelVisible = true;
+    },
+    cancelSubmit() {
+      this.$confirm("确认作废/撤销, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          this.btnLoading = true;
+          cancel(this.cancelForm).then(
+            res => {
+              if (200 == res.code) {
+                this.$message({
+                  type: "success",
+                  message: "作废成功!"
+                });
+                this.cancelForm = {
+                  refundNo: "",
+                  zfnotes: ""
+                };
+                this.btnLoading = false;
+                this.dialogFormCancelVisible = false;
+                this.getList();
+              }
+            },
+            error => {
+              this.btnLoading = false;
+            }
+          );
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: this.$t("view.canceled")
+          });
+        });
+    },
+    refresh() {
+      this.getList();
+    },
+
+    //新建退款信息
+    createRefund(currentRefundId) {
+      this.currentRefundId = currentRefundId;
+      // this.currentOrdersId = ordersId;
+      this.orderRefundNewVisible = true;
+    },
+
+    reject(id, refundNo) {
+      rejectRefund(id, refundNo).then(res => {
+        if (res.code == 200) {
+          if (res.msg == "success") {
+            this.$message({
+              type: "success",
+              message: this.$t("view.rejectionSuccess")
+            });
+          } else {
+            this.$message({
+              message: res.msg,
+              type: "warning"
+            });
+          }
+          this.getList();
+        }
+      });
+    },
+    backTable() {
+      this.orderRefundVisible = false;
+      this.orderRefundNewVisible = false;
+      this.createRefundVisible = false;
+      this.getList();
+    },
+    handleAddNote(order) {
+      this.addNoteVisible = true;
+      this.addNoteForm.orderRefundId = order.refundNo;
+      this.addNoteForm.note = order.notes;
+      this.addNoteForm.id = order.id;
+    },
+    submit() {
+      this.listLoading = true;
+      addNote(this.addNoteForm).then(res => {
+        if (200 == res.code) {
+          this.$message({
+            message: this.$t("optSuccess"),
+            type: "success"
+          });
+          this.getList();
+          this.listLoading = false;
+          this.addNoteVisible = false;
+        }
+      });
+    },
+    // 展示红色背景
+    tableRowStyleName({ row }) {
+      if (row.totalCount) {
+        return "color: red !important;";
+      }
+    },
+    selectEnable(row, index) {
+      if (row.refundType === "2" && row.status === "0") {
+        return 1;
+      } else if (row.refundType === "3" && row.status === "0") {
+        return 1;
+      } else {
+        return 0;
+      }
+    },
+    //获取多选选中数据
+    handleSelectionChange(val) {
+      // val拿到的是选中行的全部数据,而this.multipleSelection是把val以对象装在数组中
+      this.multipleSelection = val;
+      // 每次都清空存储的数据,并装入新数据
+      this.selectionList = [];
+      for (const val of this.multipleSelection) {
+        this.selectionList.push(val);
+      }
+    },
+
+    batchCheck() {
+      this.$confirm("确定批量审核?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          this.listLoading = true;
+          batchReview(this.selectionList)
+            .then(res => {
+              if (200 == res.code) {
+                this.$message({
+                  message: this.$t("optSuccess"),
+                  type: "success"
+                });
+              }
+              this.getList();
+              this.listLoading = false;
+            })
+            .catch(err => {
+              this.getList();
+              this.listLoading = false;
+            });
+        })
+        .catch(() => {
+          this.btnLoading = false;
+          this.btndisabled = true;
+          this.$message({
+            type: "info",
+            message: "已取消操作"
+          });
+        });
+    },
+    queryRefundType(value) {
+      console.log(value);
+      this.listQuery.reasonContentChinese = value.join(",");
+    },
+
+    queryRefundReason() {
+      getRefundReason({ reasonType: this.listQuery.refundType }).then(res => {
+        if (200 == res.code) {
+          this.refundReason = res.data;
+        }
+      });
+    },
+    // releaseEx(row){
+    //   console.log(row)
+    //   releaseExceptions(row.id).then(res => {
+    //     if(200 == res.code){
+    //       this.$message({
+    //         message: "操作成功",
+    //         type: "success"
+    //       });
+    //       this.getList();
+    //     }
+    //   })
+    // },
+    shippingLabelOption() {
+      this.changeSL();
+    },
+    changeSL() {
+      if (this.slFlag == "1") {
+        this.editShipp.shipmodeId = "/";
+        this.editShipp.shippingNo = "/";
+      } else {
+        this.editShipp.shipmodeId = this.staging.shipmodeId;
+        this.editShipp.shippingNo = this.staging.shippingNo;
+      }
+    }
+  }
+};
+</script>
+
+<style scoped>
+.cell > span {
+  white-space: nowrap !important;
+}
+</style>

+ 868 - 0
src/views/oms/refund-old/autoRefund.vue

@@ -0,0 +1,868 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <el-input
+        placeholder="配置名称"
+        style="width: 200px;"
+        :clearable="true"
+        class="filter-item"
+        v-model="listQuery.name"
+      />
+      <el-date-picker
+        class="filter-item"
+        style="display: inline-flex;"
+        v-model="createTimePicker"
+        type="datetimerange"
+        :range-separator="$t('to')"
+        start-placeholder="生效开始时间"
+        end-placeholder="生效结束时间"
+        value-format="yyyy-MM-dd HH:mm:ss"
+        :default-time="['00:00:00', '23:59:59']"
+      >
+      </el-date-picker>
+      <el-button
+        class="filter-item"
+        type="primary"
+        icon="el-icon-search"
+        @click="handleFilter"
+      >{{ $t("view.search") }}</el-button
+      >
+      <el-button
+        class="filter-item"
+        style="margin-left: 10px;"
+        type="primary"
+        icon="el-icon-circle-plus"
+        @click="handleCreate"
+      >{{ $t("view.create") }}</el-button
+      >
+    </div>
+
+    <el-table
+      style="width: 100%;"
+      v-loading="listLoading"
+      :key="tableKey"
+      :data="list"
+      row-key="id"
+      stripe
+      border
+      fit
+      highlight-current-row
+    >
+      <el-table-column align="center" type="index"> </el-table-column>
+
+      <el-table-column
+        label="自动退款配置名称"
+        width="300"
+        align="center"
+        prop="name"
+      >
+      </el-table-column>
+
+<!--      <el-table-column-->
+<!--        :label="$t('label.code')"-->
+<!--        width="200"-->
+<!--        align="center"-->
+<!--        prop="giftSkuCode"-->
+<!--      >-->
+<!--      </el-table-column>-->
+
+<!--      <el-table-column-->
+<!--        :label="$t('label.applicableShops')"-->
+<!--        width="150"-->
+<!--        align="center"-->
+<!--        prop="storeId"-->
+<!--      >-->
+<!--        <template slot-scope="scope">-->
+<!--          {{ scope.row.storeId | storeIdFilter }}-->
+<!--        </template>-->
+<!--      </el-table-column>-->
+
+      <el-table-column
+        :label="$t('label.effectivePeriodStart')"
+        width="300"
+        align="center"
+        prop="effectiveStartTime"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.effectivePeriodEnd')"
+        width="300"
+        align="center"
+        prop="effectiveEndTime"
+      >
+      </el-table-column>
+
+      <el-table-column
+        width="250"
+        :label="$t('label.enabled')"
+        min-width="100"
+        align="center"
+        prop="status"
+      >
+        <template slot-scope="scope">
+          {{ scope.row.isEnable | statusFilter }}
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.operation')"
+        fixed="right"
+        width="480"
+        align="left"
+      >
+        <template slot-scope="scope">
+          <el-button
+            v-if="scope.row.isEnable === '1'"
+            type="success"
+            class="line_button"
+            size="mini"
+            v-waves
+            @click="refresh(scope.row)"
+          >{{ "明细" }}</el-button
+          >
+          <el-button
+            v-if="scope.row.isEnable === '1'"
+            type="warning"
+            class="line_button"
+            size="mini"
+            v-waves
+            @click="enableInfo(scope.row)"
+          >{{ "禁用" }}</el-button
+          >
+
+          <el-button
+            v-if="scope.row.isEnable === '0'"
+            type="warning"
+            class="line_button"
+            size="mini"
+            v-waves
+            @click="enableInfo(scope.row)"
+          >{{ "启用" }}</el-button
+          >
+
+          <el-button
+            type="primary"
+            class="line_button"
+            size="mini"
+            v-waves
+            @click="modifyConfig(scope.row)"
+          >{{ "修改" }}</el-button
+          >
+
+          <el-button
+            type="danger"
+            class="line_button"
+            size="mini"
+            v-waves
+            @click="deleteConfig(scope.row.id)"
+          >
+            {{ "删除" }}
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 分页 -->
+    <swPage
+      v-if="total > 0"
+      key="2"
+      :listQuery="listQuery"
+      :total="total"
+      pos="btmRight"
+      @retPage="retPage"
+    />
+
+    <el-dialog
+      title="新建自动退款配置"
+      v-if="addConfig"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :visible.sync="addConfig"
+      v-loading="dialogLoading"
+    >
+      <el-form label-width="auto" :rules="rules">
+        <el-form-item label="自动退款配置名称">
+          <el-input v-model="autoConfig.name" placeholder="请输入" style="width: 400px;" />
+        </el-form-item>
+        <el-form-item :label="$t('label.validTime')" prop="dateTime">
+          <el-date-picker
+            v-model="autoConfig.dateTime"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            type="datetimerange"
+            :range-separator="$t('place.to')"
+            :start-placeholder="$t('place.startTime')"
+            :end-placeholder="$t('place.endTime')"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item :label="$t('label.enabled')" prop="note">
+          <el-select
+            clearable
+            v-model="autoConfig.isEnable"
+            :placeholder="$t('place.selectWhetherEnabled')"
+            class="normal-input"
+          >
+            <el-option key="1" :label="$t('label.yes')" value="1"></el-option>
+            <el-option
+              key="0"
+              :label="$t('label.no')"
+              value="0"
+              selected
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="addConfig = false">{{
+            $t("view.cancel")
+          }}</el-button>
+        <el-button type="primary" @click="handleSave">{{
+            $t("view.confirm")
+          }}</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog
+      title="详情"
+      v-highlight
+      :modal-append-to-body="false"
+      :append-to-body="true"
+      :visible.sync="relationshipVisible"
+      v-loading="dialogLoading"
+      width="70%"
+    >
+      <el-button
+        @click.native.prevent="addDetail()"
+        type="primary"
+        size="large"
+      >
+        {{ $t("view.add") }}
+      </el-button>
+
+      <el-table
+        :data="relationshipList"
+        ref="tableDemand"
+        style="width: 98%;"
+        highlight-current-row
+        class="table-style"
+        stripe
+      >
+        <el-table-column
+          prop="configId"
+          label="配置id"
+          align="center"
+          min-width="10%"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          prop="name"
+          label="配置内容"
+          align="center"
+          min-width="10%"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="configType"
+          label="配置类型"
+          align="center"
+          min-width="20%"
+          show-overflow-tooltip
+        >
+          <template slot-scope="scope">
+            {{ scope.row.configType | configTypeFilter }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="supportDefective"
+          label="是否支持次品"
+          align="center"
+          min-width="20%"
+          show-overflow-tooltip
+        >
+          <template slot-scope="scope">
+            {{ scope.row.supportDefective | supportDefectiveFilter }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="supportGift"
+          label="是否支持赠品"
+          align="center"
+          min-width="20%"
+          show-overflow-tooltip
+        >
+          <template slot-scope="scope">
+            {{ scope.row.supportGift | supportDefectiveFilter }}
+          </template>
+        </el-table-column>
+
+
+        <el-table-column
+          fixed="right"
+          :label="$t('label.operation')"
+          width="240"
+        >
+          <template slot-scope="scope">
+            <el-button
+              @click.native.prevent="exchangeGoods(scope.row)"
+              type="primary"
+              size="large"
+            >
+              {{ $t("view.modify") }}
+            </el-button>
+            <el-button
+              @click.native.prevent="deleteDetails(scope.row)"
+              type="danger"
+              size="large"
+            >
+              {{ $t("view.delete") }}
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <swPage
+        v-if="detailTotal > 0"
+        key="2"
+        :listQuery="listQuery"
+        :total="detailTotal"
+        pos="btmRight"
+        @retPage="retPage"
+      />
+      <br />
+    </el-dialog>
+
+    <el-dialog
+      title="详情配置"
+      v-if="addDetailDialog"
+      width="40%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :visible.sync="addDetailDialog"
+    >
+      <el-form :model="this.autoRefundConfigDetail" label-width="auto">
+        <el-form-item label="id">
+          <el-input
+            v-model="autoRefundConfigDetail.configId"
+            disabled
+            style="width: 200px;"
+          />
+        </el-form-item>
+
+        <el-form-item label="配置类型" prop="note">
+          <el-select
+            clearable
+            v-model="autoRefundConfigDetail.configType"
+            :placeholder="$t('place.selectWhetherEnabled')"
+            class="normal-input"
+            @change="changeType"
+          >
+            <el-option key="store" label="店铺" value="store"></el-option>
+            <el-option
+              key="warehouse"
+              label="仓库"
+              value="warehouse"
+              selected
+            ></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="配置内容" v-if="autoRefundConfigDetail.configType === 'store'">
+          <el-select
+            filterable
+            v-model="autoRefundConfigDetail.configContent"
+            :clearable="true"
+            class="filter-item"
+            style="width: 200px;"
+            placeholder="请选择"
+          >
+            <el-option
+              v-for="item in store"
+              :key="item.storeId"
+              :label="item.storeName"
+              :value="item.storeId"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="配置内容" v-if="autoRefundConfigDetail.configType === 'warehouse'">
+          <el-select
+            filterable
+            v-model="autoRefundConfigDetail.configContent"
+            :clearable="true"
+            class="filter-item"
+            style="width: 200px;"
+            placeholder="请选择"
+          >
+            <el-option
+              v-for="item in warehouses"
+              :key="item.returnWarehouseCode"
+              :label="item.returnWarehouseName"
+              :value="item.returnWarehouseCode"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="是否支持次品" >
+          <el-select
+            clearable
+            v-model="autoRefundConfigDetail.supportDefective"
+            placeholder="请选择"
+            class="normal-input"
+          >
+            <el-option key="1" :label="$t('label.yes')" value="1"></el-option>
+            <el-option
+              key="0"
+              :label="$t('label.no')"
+              value="0"
+              selected
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="是否支持赠品" >
+          <el-select
+            clearable
+            v-model="autoRefundConfigDetail.supportGift"
+            placeholder="请选择"
+            class="normal-input"
+          >
+            <el-option key="1" :label="$t('label.yes')" value="1"></el-option>
+            <el-option
+              key="0"
+              :label="$t('label.no')"
+              value="0"
+              selected
+            ></el-option>
+          </el-select>
+        </el-form-item>
+
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="addDetailDialog = false">{{
+            $t("view.cancel")
+          }}</el-button>
+        <el-button type="primary" @click="addDetailSave">{{
+            $t("view.confirm")
+          }}</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog
+      title="修改配置"
+      v-if="modifyEditVisible"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :visible.sync="modifyEditVisible"
+      v-loading="dialogLoading"
+    >
+      <el-form label-width="auto" :rules="rules">
+        <el-form-item label="id">
+          <el-input
+            v-model="autoRefundConfig.id"
+            disabled
+            style="width: 400px;"
+          />
+        </el-form-item>
+        <el-form-item label="配置名称">
+          <el-input v-model="autoRefundConfig.name" style="width: 400px;" />
+        </el-form-item>
+        <el-form-item label="有效时间" prop="dateTime">
+          <el-date-picker
+            v-model="autoRefundConfig.dateTime"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            type="datetimerange"
+            :range-separator="$t('place.to')"
+            :start-placeholder="$t('place.startTime')"
+            :end-placeholder="$t('place.endTime')"
+          >
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="modifyEditVisible = false">{{
+            $t("view.cancel")
+          }}</el-button>
+        <el-button type="primary" @click="handleModify()">{{
+            $t("view.confirm")
+          }}</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import swPage from "@/views/common/swPage.vue";
+import {
+  queryChannelStore,
+} from "@/api/oms/inventory/inventory";
+import {fetchList as warehouseList, returnWarehouseList} from "@/api/oms/inventory/warehouse";
+import {
+  deleteDetail,
+} from "@/api/oms/order/virtualGoods";
+import orderInfoDialog from "@/views/oms/order/components/orderInfoDialog.vue";
+import {
+  deleteConfig, deleteConfigDetail,
+  getConfigDetailList,
+  getConfigList,
+  saveConfig, saveConfigDetail,
+  updateConfig, updateConfigDetail,
+  updateConfigList
+} from "@/api/oms/refund/autoRefund";
+
+export default {
+  name: "virtualGoodsList",
+  components: {
+    orderInfoDialog,
+    swPage
+  },
+  filters: {
+    statusFilter(key) {
+      if (key === "0") {
+        return "未启用";
+      } else if (key === "1") {
+        return "已启用";
+      }
+    },
+    supportDefectiveFilter(key) {
+      if (key === 0) {
+        return "不支持";
+      } else if (key === 1) {
+        return "支持";
+      }
+    },
+    configTypeFilter(key) {
+      if (key === "store") {
+        return "店铺";
+      } else if (key === "warehouse") {
+        return "仓库";
+      }
+    },
+  },
+
+  data() {
+    return {
+      tableKey: 0,
+      list: [],
+      total: 0,
+      detailTotal: 0,
+      listLoading: false,
+      addConfig: false,
+      modifyEditVisible: false,
+      dialogLoading: false,
+      relationshipVisible: false,
+      createTimePicker: [],
+      addDetailDialog: false,
+      virtualGiftId: "",
+      storeId: "",
+      relationshipList: [],
+      params: {},
+      rules: {
+        name: [
+          { required: true, message: "请填写配置名称", trigger: "blur" }
+        ]
+      },
+      listQuery: {
+        page: 1,
+        limit: 10,
+        name: "",
+        effectiveStartTime: "",
+        effectiveEndTime: "",
+      },
+      store: [],
+      activitySkuList: [],
+      detail: {
+        id: "",
+        warehouseCode: "",
+        skuCode: ""
+      },
+      autoConfig: {
+        id: null,
+        name: "",
+        dateTime: [],
+        effectiveStartTime: "",
+        effectiveEndTime: "",
+        isEnable: ""
+      },
+      autoRefundConfig: {
+        id: "",
+        name: "",
+        isEnable:"",
+        beginTime: "",
+        endTime: "",
+        dateTime: []
+      },
+      autoRefundConfigDetail: {
+        id:"",
+        configId:"",
+        configType:"",
+        configContent:"",
+        supportDefective:"0",
+        supportGift:"0"
+      },
+      warehouses: []
+    };
+  },
+  created() {
+    this.getList();
+    this.getStore();
+    this.getWarehouse();
+    // this.getActivitySkuList();
+  },
+  activated() {
+    this.getList();
+  },
+  methods: {
+    getList() {
+      this.listLoading = true;
+      this.listQuery.effectiveStartTime=this.createTimePicker[0];
+      this.listQuery.effectiveEndTime=this.createTimePicker[1];
+      getConfigList(this.listQuery).then(res => {
+        if (200 === res.code) {
+          this.total = res.data.total;
+          this.list = res.data.list;
+        }
+        this.listLoading = false;
+      });
+    },
+    retPage() {
+      //分页
+      this.getList();
+    },
+    getStore() {
+      queryChannelStore().then(res => {
+        if (200 === res.code) {
+          this.store = res.data;
+        }
+      });
+    },
+    enableInfo(refundConfig) {
+      if (refundConfig.isEnable == 0) {
+        refundConfig.isEnable = 1;
+      } else {
+        refundConfig.isEnable = 0;
+      }
+      this.listLoading = true;
+      updateConfigList(refundConfig).then(async res => {
+        if (200 === res.code) {
+          this.$message({
+            message: this.$t("optSuccess"),
+            type: "success"
+          });
+          await this.getList();
+        }
+      });
+    },
+
+    handleCreate() {
+      this.clean();
+      this.addConfig = true;
+    },
+    handleFilter() {
+      this.listQuery.page = 1;
+      this.getList();
+    },
+    handleSave() {
+      var date = this.autoConfig.dateTime;
+      this.dialogLoading = true;
+
+      this.autoConfig.effectiveStartTime = date[0];
+      this.autoConfig.effectiveEndTime = date[1];
+
+      saveConfig(this.autoConfig)
+        .then(res => {
+          if (200 === res.code) {
+            this.$message({
+              message: "操作成功",
+              type: "success"
+            });
+
+            this.dialogLoading = false;
+            this.addConfig = false;
+            this.clean();
+            this.getList();
+          }
+        })
+        .catch(() => {
+          this.dialogLoading = false;
+        });
+    },
+    modifyConfig(row) {
+      this.autoRefundConfig.id = row.id;
+      this.autoRefundConfig.name = row.name;
+      this.autoRefundConfig.isEnable = row.isEnable;
+      this.autoRefundConfig.dateTime[0] = row.effectiveStartTime;
+      this.autoRefundConfig.dateTime[1] = row.effectiveEndTime;
+      this.modifyEditVisible = true;
+    },
+    handleModify() {
+      var date = this.autoRefundConfig.dateTime;
+      this.dialogLoading = true;
+
+      this.autoRefundConfig.effectiveStartTime = date[0];
+      this.autoRefundConfig.effectiveEndTime = date[1];
+
+      updateConfig(this.autoRefundConfig)
+        .then(res => {
+          if (200 === res.code) {
+            this.$message({
+              message: "操作成功",
+              type: "success"
+            });
+
+            this.dialogLoading = false;
+            this.modifyEditVisible = false;
+            this.getList();
+          }
+        })
+        .catch(() => {
+          this.dialogLoading = false;
+        });
+    },
+    clean() {
+      this.autoConfig.id = "";
+      this.autoConfig.name = "";
+      this.autoConfig.dateTime = [];
+      this.autoConfig.isEnable = "";
+    },
+    deleteConfig(id) {
+      this.$confirm("是否确认删除自动退款配置?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        deleteConfig(id).then(res => {
+          if (200 === res.code) {
+            this.$message({
+              message: this.$t("optSuccess"),
+              type: "success"
+            });
+            this.getList();
+          }
+        });
+      });
+    },
+    refresh(params) {
+      this.params = params;
+      this.handleEdit();
+    },
+    handleEdit() {
+      this.virtualGiftId = this.params.id;
+      this.storeId = this.params.storeId;
+      this.dialogLoading = true;
+      getConfigDetailList(this.params.id).then(res => {
+        if (200 === res.code) {
+          this.relationshipList = res.data.list;
+          this.detailTotal = res.data.total;
+          this.dialogLoading = false;
+        }
+      });
+      this.relationshipVisible = true;
+    },
+    addDetail() {
+      this.cleanDetail();
+      this.autoRefundConfigDetail.configId = this.virtualGiftId;
+      this.addDetailDialog = true;
+    },
+    getWarehouse() {
+      returnWarehouseList({
+        page: 1,
+        limit: 1000,
+      }).then(res => {
+        if (200 === res.code) {
+          this.warehouses = res.data.list;
+        }
+      });
+    },
+    async addDetailSave() {
+
+      if(this.autoRefundConfigDetail.id!=null&&this.autoRefundConfigDetail.id!==""){
+        await updateConfigDetail(this.autoRefundConfigDetail).then(res => {
+          if (200 === res.code) {
+            this.$message({
+              message: "操作成功",
+              type: "success"
+            });
+          }
+        });
+      }else {
+        for (let item in this.relationshipList) {
+          if (
+            this.autoRefundConfigDetail.configContent ===
+            this.relationshipList[item].configContent
+          ) {
+            this.$message({
+              message: "此配置已有该明细",
+              type: "error"
+            });
+            return;
+          }
+        }
+        if (this.autoRefundConfigDetail.configType === "") {
+          this.$message.error("请选择配置类型");
+          return;
+        }
+        if (this.autoRefundConfigDetail.configContent === "") {
+          this.$message.error("请选择配置内容");
+          return;
+        }
+
+        await saveConfigDetail(this.autoRefundConfigDetail).then(res => {
+          if (200 === res.code) {
+            this.$message({
+              message: "操作成功",
+              type: "success"
+            });
+          }
+        });
+      }
+
+      this.addDetailDialog = false;
+      await this.handleEdit();
+    },
+    cleanDetail() {
+      this.autoRefundConfigDetail.id = "";
+      this.autoRefundConfigDetail.configId = "";
+      this.autoRefundConfigDetail.configContent = "";
+      this.autoRefundConfigDetail.configType = "";
+      this.autoRefundConfigDetail.supportDefective = "0";
+      this.autoRefundConfigDetail.supportGift = "0";
+    },
+    changeType(){
+      this.autoRefundConfigDetail.configContent=null;
+    },
+    exchangeGoods(row) {
+      this.addDetailDialog = true;
+      this.autoRefundConfigDetail.id = row.id;
+      this.autoRefundConfigDetail.configType = row.configType;
+      if(row.configType === "store"){
+        this.autoRefundConfigDetail.configContent = parseInt(row.configContent);
+      }else{
+        this.autoRefundConfigDetail.configContent = row.configContent;
+      }
+      this.autoRefundConfigDetail.configId = row.configId;
+      this.autoRefundConfigDetail.supportDefective = row.supportDefective.toString();
+      this.autoRefundConfigDetail.supportGift = row.supportGift.toString();
+    },
+    deleteDetails(data) {
+      this.$confirm("是否确认删除自动退款配置详情?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.dialogLoading = true;
+        deleteConfigDetail(data).then(res => {
+          if (200 === res.code) {
+            this.$message({
+              message: "删除成功",
+              type: "success"
+            });
+          }
+          this.dialogLoading = false;
+          this.handleEdit();
+        });
+      });
+    }
+  }
+};
+</script>

+ 68 - 0
src/views/oms/refund-old/components/cargoTrackDialog.vue

@@ -0,0 +1,68 @@
+<template>
+  <div v-loading="listLoading">
+      <el-button style="margin: 0 0 20px 40px;" v-waves class="filter-item" type="primary" size="small" @click="updateCargoTrack">
+          {{ $t("view.updateCargoTrack") }}
+      </el-button>
+
+    <el-timeline reverse='true'>
+      <el-timeline-item
+        type="primary"
+        v-for="(cargoTrack, index) in cargoTracks"
+        :key="index"
+        :timestamp="cargoTrack.occurDate">
+        {{ cargoTrack.trackArea }} : {{ cargoTrack.comment }}
+      </el-timeline-item>
+    </el-timeline>
+  </div>
+</template>
+
+<script>
+import { cargoTrackList,updateCargoTrack } from "@/api/oms/refund/refund";
+import swPage from "@/views/common/swPage.vue";
+import i18n from "@/lang";
+
+export default {
+  components: {swPage},
+  props: ["refundNo"],
+  data() {
+    return {
+      cargoTracks:[],
+      listLoading:false
+    };
+  },
+  created() {
+    this.getCargoTrackList();
+  },
+  methods: {
+    getCargoTrackList(){
+      this.listLoading = true;
+      cargoTrackList({"refundNo":this.refundNo}).then(res => {
+        this.cargoTracks = res.data;
+        this.listLoading = false;
+      })
+    },
+    updateCargoTrack(){
+      this.$confirm("确认刷新轨迹吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+          this.listLoading = true;
+          updateCargoTrack({"refundNo":this.refundNo}).then(res => {
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.listLoading = false;
+            this.getCargoTrackList();
+          })
+      }).catch(() => {});
+
+    }
+  },
+  filters: {
+
+  },
+};
+</script>
+

+ 1402 - 0
src/views/oms/refund-old/components/createRefundDialog.vue

@@ -0,0 +1,1402 @@
+<template>
+  <div v-loading.fullscreen.lock="detailLoading">
+    <div class="head"></div>
+    <div class="app-container">
+      <div class="filter-container">
+        <el-input
+          :placeholder="$t('place.onlineShopNumber')"
+          clearable
+          style="width: 200px;"
+          class="filter-item"
+          v-model="listQuery.ormorder"
+          @change="validateParams"
+        />
+        <el-input
+          :placeholder="$t('place.shopifyNumber')"
+          clearable
+          style="width: 200px;"
+          class="filter-item"
+          v-model="listQuery.shopify"
+          @change="validateParams"
+        />
+        <el-select
+          :placeholder="$t('place.afterSalesType')"
+          clearable
+          style="width: 200px;"
+          class="filter-item"
+          v-model="listQuery.refundType"
+          @change="validateParams"
+        >
+          <el-option
+            v-for="afterSaleType in afterSaleTypes"
+            :key="afterSaleType.value"
+            :label="$t(afterSaleType.label)"
+            :value="afterSaleType.value"
+          >
+          </el-option>
+        </el-select>
+        <el-button
+          v-waves
+          class="filter-item"
+          type="success"
+          icon="el-icon-search"
+          @click="getDetail(null)"
+          >{{ $t("view.search") }}</el-button
+        >
+      </div>
+    </div>
+    <div class="main" v-if="show">
+      <div class="box" style="margin-top: 15px;">
+        <div class="item_title">
+          <span>{{ $t("view.shippingInfo") }}</span>
+        </div>
+        <div class="ptitle">
+          <template>
+            <el-descriptions
+              class="margin-top"
+              :title="$t('title.addressInfo')"
+              :column="4"
+              direction="horizontal"
+              v-if="addressInfo.length == 1"
+            >
+              <el-descriptions-item :label="$t('country')">{{
+                addressInfo[0].receiverCountryCode
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('label.postalCode')">{{
+                addressInfo[0].receiverZip
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('state')">{{
+                addressInfo[0].receiverState
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('city')">{{
+                addressInfo[0].receiverCity
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('suburb')">{{
+                addressInfo[0].receiverDistrict
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('street')">{{
+                addressInfo[0].receiverStreet
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('address')">{{
+                addressInfo[0].receiverAddress
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('dooeNo')">{{
+                addressInfo[0].receiverAddress2
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('recipient')">{{
+                addressInfo[0].receiverName
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('telephone')">{{
+                addressInfo[0].receiverPhone
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('moPhone')">{{
+                addressInfo[0].receiverMobile
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('post')">{{
+                addressInfo[0].email
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('label.shippingFee')">{{
+                addressInfo[0].freight
+              }}</el-descriptions-item>
+            </el-descriptions>
+            <div class="container" width="500px" v-if="addressInfo.length > 1">
+              <div
+                v-for="(item, index) in addressInfo"
+                :key="index"
+                width="100px"
+                margin-right="50px"
+              >
+                <el-popover
+                  placement="top"
+                  :title="$t('title.addressInfo')"
+                  width="300"
+                  offset="300"
+                  trigger="hover"
+                >
+                  <el-descriptions
+                    class="margin-top"
+                    title=""
+                    :column="1"
+                    direction="horizontal"
+                  >
+                    <el-descriptions-item :label="$t('country')">{{
+                      item.receiverCountryCode
+                    }}</el-descriptions-item>
+                    <el-descriptions-item :label="$t('address')">{{
+                      item.receiverAddress
+                    }}</el-descriptions-item>
+                    <el-descriptions-item :label="$t('recipient')">{{
+                      item.receiverName
+                    }}</el-descriptions-item>
+                    <el-descriptions-item :label="$t('post')">{{
+                      item.email
+                    }}</el-descriptions-item>
+                    <el-descriptions-item :label="$t('label.shippingFee')">{{
+                      item.freight
+                    }}</el-descriptions-item>
+                  </el-descriptions>
+                  <el-button
+                    slot="reference"
+                    @click="chooseClick(item.idList)"
+                    >{{ item.receiverCountryCode }}</el-button
+                  >
+                </el-popover>
+              </div>
+            </div>
+            <!-- <el-descriptions class="margin-top" :title="'地址信息-' + (index + 1)" :column="4" direction="horizontal" v-for="(item, index) in addressInfo" :key="index"> -->
+            <!-- <el-descriptions-item :label="$t('country')">{{item.receiverCountryCode}}</el-descriptions-item> -->
+            <!-- <el-descriptions-item :label="$t('label.postalCode')">{{item.receiverZip}}</el-descriptions-item>
+                            <el-descriptions-item :label="$t('state')">{{item.receiverState}}</el-descriptions-item>
+                            <el-descriptions-item :label="$t('city')" >{{item.receiverCity}}</el-descriptions-item>
+                            <el-descriptions-item :label="$t('suburb')" >{{item.receiverDistrict}}</el-descriptions-item> -->
+            <!-- <el-descriptions-item :label="$t('street')" >{{item.receiverStreet}}</el-descriptions-item> -->
+            <!-- <el-descriptions-item :label="$t('address')" >{{item.receiverAddress}}</el-descriptions-item> -->
+            <!-- <el-descriptions-item :label="$t('dooeNo')" >{{item.receiverAddress2}}</el-descriptions-item> -->
+            <!-- <el-descriptions-item :label="$t('recipient')" >{{item.receiverName}}</el-descriptions-item> -->
+            <!-- <el-descriptions-item :label="$t('telephone')" >{{item.receiverPhone}}</el-descriptions-item>
+                            <el-descriptions-item :label="$t('moPhone')" >{{item.receiverMobile}}</el-descriptions-item> -->
+            <!-- <el-descriptions-item :label="$t('post')" >{{item.email}}</el-descriptions-item> -->
+            <!-- <el-descriptions-item :label="$t('label.shippingFee')" >{{item.freight}}</el-descriptions-item> -->
+            <!-- <el-descriptions-item v-if=" addressInfo.length !=0 && addressInfo.length !=1 " :label="$t('actions')">
+                                <el-button
+                                type="success"
+                                @click="chooseClick(item.idList)"
+                                v-loading="btnLoading"
+                                >选择</el-button
+                                >
+                            </el-descriptions-item> -->
+            <!-- </el-descriptions> -->
+          </template>
+        </div>
+      </div>
+      <div
+        class="box"
+        style="margin-top: 15px;padding-bottom: 10px;"
+        v-loading="fromLoading"
+        v-if="
+          (this.listQuery.ormorder || this.listQuery.shopify) &&
+            this.listQuery.refundType
+        "
+      >
+        <div class="item_title">
+          <span>{{ $t("view.refundInfo") }}</span>
+        </div>
+        <div class="ptitle">
+          <el-form
+            ref="addRefundForm"
+            :model="addRefundForm"
+            label-width="auto"
+          >
+            <el-form-item :label="$t('currency')">
+              <el-input
+                disabled
+                v-model="addRefundForm.currency"
+                placeholder
+                class="normal-input"
+              ></el-input>
+            </el-form-item>
+            <el-form-item :label="$t('label.expectedRefundAmount')" required>
+              <el-input
+                v-model="addRefundForm.refundTotalAmount"
+                :disabled="true"
+              />
+            </el-form-item>
+
+            <el-form-item :label="$t('label.refundMethod')" required>
+              <el-radio-group v-model="addRefundForm.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="addRefundForm.refundMethod == 'manual'"
+              :label="$t('label.accountType')"
+              required
+            >
+              <el-radio-group v-model="addRefundForm.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
+              :label="$t('label.receivingAccount')"
+              v-if="
+                addRefundForm.refundMethod == 'manual' &&
+                  addRefundForm.refundAccountType == 'PayPal'
+              "
+              required
+            >
+              <el-input
+                v-model="addRefundForm.refundAccount"
+                :placeholder="$t('place.pleaseFillIn')"
+                class="normal-input"
+              ></el-input>
+            </el-form-item>
+            <el-form-item :label="$t('label.taxRefund')">
+              <el-radio-group
+                v-model="addRefundForm.refundTaxAble"
+                @change="calculateRefundAmount"
+              >
+                <el-radio label="0">{{ $t("view.noTaxRefund") }}</el-radio>
+                <el-radio label="1">{{ $t("view.taxRefund") }}</el-radio>
+              </el-radio-group>
+            </el-form-item>
+            <el-form-item
+              v-if="addRefundForm.refundTaxAble == 1"
+              :label="$t('label.taxRefundAmount')"
+            >
+              <el-input-number
+                v-model="addRefundForm.refundTaxAmount"
+                :min="0.0"
+                :step="0.01"
+                step-strictly
+                @change="calculateRefundAmount"
+              ></el-input-number>
+            </el-form-item>
+            <!-- 选择是否退运费-->
+            <el-form-item :label="$t('label.shippingFee')">
+              <el-radio-group
+                v-model="addRefundForm.refundPostage"
+                @change="calculateRefundAmount"
+              >
+                <el-radio label="0">{{ $t("view.noRefund") }}</el-radio>
+                <el-radio label="1">{{
+                  $t("view.refundShippingFee")
+                }}</el-radio>
+              </el-radio-group>
+            </el-form-item>
+            <el-form-item
+              v-if="addRefundForm.refundPostage == 1"
+              :label="$t('label.returnShippingFeeAmount')"
+            >
+              <el-input-number
+                v-model="addRefundForm.refundPostageAmount"
+                :min="0.0"
+                :step="0.01"
+                step-strictly
+                @change="calculateRefundAmount"
+              ></el-input-number>
+            </el-form-item>
+
+            <el-form-item
+              v-if="this.queryRefundType == 3"
+              :label="$t('label.receivingReturnWarehouse')"
+            >
+              <el-select
+                :placeholder="$t('place.pleaseSelect')"
+                clearable
+                style="width: 200px;"
+                class="filter-item"
+                v-model="addRefundForm.warehouseCode"
+                @change="ShippingLabelOption"
+              >
+                <el-option
+                  v-for="item in warehouseItems"
+                  :key="item.key"
+                  :label="item.key"
+                  :value="item.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+
+            <el-form-item
+              v-if="addRefundForm.warehouseCode=='PSJ-G001001' ||
+              addRefundForm.warehouseCode=='PSJ-G001003' ||
+              addRefundForm.warehouseCode=='PSJ-H0000024'||
+              addRefundForm.warehouseCode=='PSJ-H0000019'||
+              addRefundForm.warehouseCode=='PSJ-H0000011'||
+              addRefundForm.warehouseCode=='PSJ-G001004'"
+              label="ShippingLabel">
+              <el-radio-group
+                v-model="addRefundForm.slUseable"
+                @change="changeSlradio()"
+              >
+                <el-radio label="0" value="0">{{
+                  $t("view.notEnabled")
+                }}</el-radio>
+                <el-radio label="1" value="1">{{
+                  $t("view.enabled")
+                }}</el-radio>
+              </el-radio-group>
+            </el-form-item>
+
+            <el-form-item
+              v-if="
+                this.queryRefundType == 3 && this.addRefundForm.slUseable == 0
+              "
+              :label="$t('label.returnLogisticsCompanyCode')"
+            >
+              <el-input
+                v-model="addRefundForm.shipmodeId"
+                :placeholder="$t('place.pleaseFillIn')"
+                class="normal-input"
+              ></el-input>
+            </el-form-item>
+            <el-form-item
+              v-if="
+                this.queryRefundType == 3 && this.addRefundForm.slUseable == 0
+              "
+              :label="$t('label.returnLogisticsNumber')"
+            >
+              <el-input
+                v-model="addRefundForm.shippingNo"
+                :placeholder="$t('place.pleaseFillIn')"
+                class="normal-input"
+              ></el-input>
+            </el-form-item>
+
+            <el-form-item :label="$t('label.afterSalesInstructions')">
+              <el-input
+                type="textarea"
+                :placeholder="$t('place.enterContent')"
+                v-model="addRefundForm.notes"
+                maxlength="150"
+                show-word-limit
+              >
+              </el-input>
+            </el-form-item>
+
+            <el-form-item :label="$t('label.uploadVoucher')">
+              <el-upload
+                class="avatar-uploader"
+                :action="uploadPhotos"
+                :show-file-list="false"
+                :on-success="handleAvatarSuccess"
+                :before-upload="beforeAvatarUpload"
+                :headers="headers"
+              >
+                <img v-if="imageUrl" :src="imageUrl" class="avatar" />
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+              </el-upload>
+            </el-form-item>
+          </el-form>
+        </div>
+
+        <!-- 因为要多选的问题 不考虑分页 -->
+        <div class="box" style="margin-top: 15px;">
+          <div class="item_title">
+            <span>{{ $t("view.selectItems") }}</span>
+            <el-select
+              v-if="this.multipleSelection && this.multipleSelection.length > 0"
+              v-model="refundReasonAss"
+              :placeholder="$t('place.selectCheckedRefundReasons')"
+              clearable
+              @change="chooseReason(refundReasonAss, reasonListAll)"
+            >
+              <el-option
+                v-for="status in reasonListAll"
+                :key="status.id"
+                :label="status.reasonContentChinese"
+                :value="String(status.id)"
+              >
+              </el-option>
+            </el-select>
+            <el-input
+              v-if="otherReasonFlag == '1'"
+              :placeholder="$t('place.enterReason')"
+              clearable
+              style="width: 200px;"
+              class="filter-item"
+              v-model="refundOtherReasonAss"
+              @change="writeReason(refundOtherReasonAss)"
+            />
+          </div>
+          <div>
+            <el-table
+              ref="multipleTable"
+              @selection-change="handleSelectionChange"
+              style="width: 100%;"
+              v-loading="listLoading"
+              :key="tableKey"
+              :data="tableOrderDeatils"
+              row-key="id"
+              stripe
+              border
+              fit
+              highlight-current-row
+            >
+              <el-table-column
+                type="selection"
+                width="55"
+                :selectable="checkSelectable"
+              >
+              </el-table-column>
+
+              <el-table-column
+                :label="$t('label.orderNumber')"
+                width="150"
+                align="center"
+                prop="ordersId"
+              >
+              </el-table-column>
+
+              <el-table-column
+                :label="$t('goodsCode')"
+                width="150"
+                align="center"
+                prop="skuCode"
+              >
+              </el-table-column>
+
+              <el-table-column
+                :label="$t('onlyCode')"
+                min-width="180"
+                align="center"
+                prop=""
+              >
+                <template slot-scope="scope">
+                  <div v-if="scope.row.uniqueCode">
+                    <div
+                      v-for="(item, index) in scope.row.uniqueCode"
+                      :key="index"
+                    >
+                      {{ item }}
+                    </div>
+                  </div>
+                </template>
+              </el-table-column>
+
+              <el-table-column
+                :label="$t('goodsName')"
+                width="300"
+                align="center"
+                prop="productName"
+              ></el-table-column>
+
+              <el-table-column
+                :label="$t('bagSkuCode')"
+                width="180"
+                align="center"
+                prop="bagSkuCode"
+              ></el-table-column>
+
+              <el-table-column
+                :label="$t('label.originalQuantity')"
+                width="80"
+                align="center"
+                prop="oldQuantity"
+              ></el-table-column>
+
+              <el-table-column
+                :label="$t('goodsPrice')"
+                width="80"
+                align="center"
+                prop="price"
+              ></el-table-column>
+
+              <el-table-column
+                :label="$t('offerAmount')"
+                width="80"
+                align="center"
+                prop="discountFee"
+              ></el-table-column>
+
+              <el-table-column
+                :label="$t('payAmount')"
+                width="80"
+                align="center"
+                prop="totalFee"
+              ></el-table-column>
+
+              <el-table-column
+                :label="$t('label.refundPercentage')"
+                width="150"
+                align="center"
+              >
+                <template slot-scope="scope">
+                  <div v-if="multipleSelection.indexOf(scope.row) == -1">
+                    <div>{{ scope.row.refundSales }}</div>
+                  </div>
+                  <div v-else>
+                    <el-input-number
+                      v-model="scope.row.refundSales"
+                      @change="changeQuantity(scope.row)"
+                      size="mini"
+                      :min="0"
+                      :max="1"
+                      :step="0.01"
+                      step-strictly
+                    ></el-input-number>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column
+                :label="$t('label.eligibleQuantity')"
+                width="150"
+                align="center"
+              >
+                <template slot-scope="scope">
+                  <div v-if="multipleSelection.indexOf(scope.row) == -1">
+                    <div>{{ scope.row | quantityFilter }}</div>
+                  </div>
+                  <div v-else>
+                    <!-- <tableEdit :row.sync="scope.row"></tableEdit> -->
+                    <el-input-number
+                      v-model="scope.row.quantity"
+                      @change="changeQuantity(scope.row)"
+                      size="mini"
+                      :min="0"
+                      :max="scope.row.maxq"
+                      :step="1"
+                      step-strictly
+                    ></el-input-number>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column
+                :label="$t('label.refundedAmount')"
+                width="150"
+                align="center"
+              >
+                <template slot-scope="scope">
+                  <div v-if="multipleSelection.indexOf(scope.row) == -1">
+                    <div>0</div>
+                  </div>
+                  <div v-else>
+                    <el-input-number
+                      v-model="scope.row.refundAmount"
+                      size="mini"
+                      @change="refundAmountChange"
+                      :min="0.0"
+                      :max="scope.row.totalFee"
+                    ></el-input-number>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column
+                :label="$t('label.refundReason')"
+                width="150"
+                align="center"
+              >
+                <template slot-scope="scope">
+                  <div v-if="multipleSelection.indexOf(scope.row) == -1"></div>
+                  <div v-else>
+                    <el-select
+                      v-model="scope.row.refundReason"
+                      :placeholder="$t('place.pleaseSelect')"
+                      clearable
+                      @change="refundChange(scope.row.refundReason, scope.row)"
+                    >
+                      <el-option
+                        v-for="status in scope.row.refundReasonList"
+                        :key="status.id"
+                        :label="status.reasonContentChinese"
+                        :value="String(status.id)"
+                      >
+                      </el-option>
+                    </el-select>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column
+                :label="$t('label.reasonExplanation')"
+                width="150"
+                align="center"
+              >
+                <template slot-scope="scope">
+                  <div v-if="multipleSelection.indexOf(scope.row) == -1"></div>
+                  <div v-else>
+                    <el-input
+                      v-if="scope.row.customOpen == '1'"
+                      :placeholder="$t('place.enterReason')"
+                      clearable
+                      style="width: 200px;"
+                      class="filter-item"
+                      v-model="scope.row.otherReason"
+                    />
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column width="55" :label="$t('label.flashPurchase')" align="center">
+                <template slot-scope="scope">
+                  <el-checkbox v-model="scope.row.flashPurchaseFlag == 1"></el-checkbox>
+                </template>
+              </el-table-column>
+              <el-table-column width="55" :label="$t('label.exchangePurchase')" align="center">
+                <template slot-scope="scope">
+                  <el-checkbox v-model="scope.row.exchangePurchaseFlag == 1"></el-checkbox>
+                </template>
+              </el-table-column>
+
+              <el-table-column
+                :label="$t('label.refundedQuantity')"
+                width="80"
+                align="center"
+                prop="refundQuantity"
+              ></el-table-column>
+              <el-table-column
+                :label="$t('status')"
+                width="80"
+                align="center"
+                prop="status"
+              >
+                <template slot-scope="scope">
+                  {{ scope.row.status | statusFilter }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                :label="$t('label.signedForTheReturn')"
+                width="80"
+                align="center"
+                prop="matchStatus"
+              >
+                <template slot-scope="scope">
+                  <span v-if="scope.row.matchStatus == 'unmatch'">
+                    {{ $t("label.notMatched") }}
+                  </span>
+                  <span
+                    v-if="
+                      scope.row.matchStatus == 'order_matched' ||
+                        scope.row.matchStatus == 'matched'
+                    "
+                  >
+                    {{ $t("label.matchedSuccess") }}
+                  </span>
+                  <span v-if="scope.row.matchStatus == null">
+                    {{ $t("label.not") }}
+                  </span>
+                </template>
+              </el-table-column>
+            </el-table>
+
+            <div class="box" style="width:50%;margin-top: 15px;float:left">
+              {{ $t("view.totalRefund") }}:{{
+                addRefundForm.refundTotalAmount
+              }}
+            </div>
+            <div class="box" style="width:50%; margin-top: 10px;float:left">
+              <el-button
+                :style="btnStyle"
+                type="primary"
+                @click="submit(this)"
+                v-loading="btnLoading"
+                >{{ $t("save") }}</el-button
+              >
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+// import {getRefundReason} from '@/api/oms/refund/refund'
+import global from "@/views/oms/global";
+import waves from "@/directive/waves";
+import { getToken } from "@/utils/auth";
+import { dcmSub } from "@/utils/toolUtil";
+import { getDetailListForRefund, statusKeyValue } from "@/api/oms/order/order";
+import {
+  saveRefundNew,
+  validPromotionReq,
+  warehouseList
+} from "@/api/oms/refund/refund";
+import { BigNumber } from "bignumber.js";
+import { write } from "xlsx";
+
+import tableEdit from './tableEdit'
+
+export default {
+  name: "createRefundDialog",
+  directives: {
+    waves
+  },
+  components: {
+    global,
+    tableEdit
+  },
+  filters: {
+    statusFilter(key) {
+      return statusKeyValue[key];
+    },
+    quantityFilter(row) {
+      if (row.refundQuantity > 0) {
+        return dcmSub(row.oldQuantity, row.refundQuantity);
+      }
+      return row.oldQuantity;
+    }
+  },
+  data() {
+    return {
+      matchStatus: null,
+      listLoading: false,
+      detailLoading: false,
+      fromLoading: false,
+      btnLoading: false,
+      addressInfo: [],
+      listQuery: {
+        ormorder: null,
+        shopify: null,
+        refundType: null,
+        idList: null
+      },
+      show: false,
+      tableOrderDeatils: [],
+      multipleSelection: [],
+      addRefundForm: {
+        refundMethod: "system",
+        refundAccountType: "PayPal",
+        refundAccount: "",
+        refundType: "",
+        refundPostage: "0",
+        refundAmount: 0.0, //商品退款金额
+        refundPostageAmount: 0.0,
+        warehouseCode: "",
+        annexPath: "",
+        items: [],
+        oldQuantity: 0,
+        refundTaxAble: "0", //是否退税
+        refundTaxAmount: 0.0, //退税金额
+        refundTotalAmount: 0.0, //总计退款金额 = 商品退款金额 + 退运费金额 + 退税金额 。 实际执行时,refundAmount=商品退款金额 + 退税金额;退运费金额单独计算
+        // refundReason:'', // 退款原因
+        // otherReason:'', // 其他退款理由
+        slUseable: "0", //是否开启ShippingLabel选项
+        currency: "", //币种
+        shipmodeId: "", //退货物流公司编号
+        shippingNo: "", //退货物流单号
+        notes: ""
+      },
+      afterSaleTypes: global.afterSaleType, //售后类型
+      warehouseItems: [],
+      queryRefundType: "",
+      queryOrmorder: "",
+      queryShopify: "",
+      btnStyle: "",
+      imageUrl: "",
+      uploadPhotos: process.env.VUE_APP_OMS_API + "ordersRefund/uploadPhotos",
+      reasonListAll: [],
+      refundReasonAss: "",
+      refundOtherReasonAss: "",
+      otherReasonFlag: "",
+      tableKey: Math.random(),
+    };
+  },
+  created() {
+    //情况清空数据
+    this.getWarehouseList();
+  },
+  computed: {
+    // 计算属性的 getter
+    headers: function() {
+      return {
+        "X-Token": getToken()
+      };
+    }
+  },
+  methods: {
+    getDetail(idList) {
+      this.ShippingLabelOption();
+      //非空判断
+      if (!this.listQuery.ormorder && !this.listQuery.shopify) {
+        this.$message.error("网店单号和shopify单号不能同时为空");
+        return;
+      }
+      if (!this.listQuery.refundType) {
+        this.$message.error("请选择售后类型");
+        return;
+      }
+      //初始化数据
+      this.addRefundForm.refundAmount = 0.0;
+      this.addRefundForm.refundPostage = "0";
+      this.addRefundForm.refundPostageAmount = 0.0;
+      this.addRefundForm.warehouseCode = "";
+      this.addRefundForm.annexPath = "";
+      this.addRefundForm.items = [];
+      this.addRefundForm.oldQuantity = 0.0;
+      this.addRefundForm.refundTaxAble = "0"; //是否退税
+      this.addRefundForm.refundTaxAmount = 0.0; //退税金额
+      this.addRefundForm.refundTotalAmount = 0.0;
+      this.addRefundForm.shipmodeId = "";
+      this.addRefundForm.shippingNo = "";
+      this.addRefundForm.refundMethod = "system";
+      this.addRefundForm.refundAccountType = "PayPal";
+      this.addRefundForm.refundAccount = "";
+      this.addRefundForm.notes = "";
+      this.addressInfo = [];
+      this.listQuery.idList = null;
+      // this.listQuery.addressId = addressId;
+      if (idList) {
+        var addressIds = "";
+        for (let id in idList) {
+          addressIds = addressIds + idList[id] + ",";
+        }
+        this.listQuery.idList = addressIds.slice(0, addressIds.length - 1);
+      }
+      this.reasonListAll = [];
+      this.refundReasonAss = "";
+      this.refundOtherReasonAss = "";
+      this.otherReasonFlag = "";
+
+      //查询满足条件的所有订单项
+      this.listLoading = true;
+      getDetailListForRefund(this.listQuery).then(res => {
+        if (200 == res.code) {
+          this.show = true;
+          //第一次查询的退款类型
+          this.queryRefundType = res.data.refundType;
+          this.queryOrmorder = res.data.ormorder;
+          this.queryShopify = res.data.shopify;
+          this.tableOrderDeatils = res.data.list;
+          this.addRefundForm.currency = res.data.currency;
+          this.addressInfo = res.data.addressList;
+
+          this.reasonListAll = res.data.refundReasonList;
+
+          let goodsRefundAmount = BigNumber(0);
+
+          if (this.tableOrderDeatils) {
+            for (let ind in this.tableOrderDeatils) {
+              if (this.tableOrderDeatils[ind].refundFlag == "0") {
+                this.tableOrderDeatils[ind].refundQuantity = 0;
+              }
+              this.tableOrderDeatils[ind].oldQuantity = this.tableOrderDeatils[
+                ind
+              ].quantity;
+            }
+
+            //退商品金额计算
+            this.refundAmount = goodsRefundAmount.toFixed(2);
+            this.$nextTick(() => {
+              this.tableOrderDeatils.forEach(row => {
+                if (row.selectedRow == 1) {
+                  this.$refs.multipleTable.toggleRowSelection(row, true);
+                }
+              });
+            });
+          }
+        } else {
+          this.$message.error(res.msg);
+          this.show = false;
+        }
+        this.listLoading = false;
+      });
+    },
+    //获取退货仓库信息
+    getWarehouseList() {
+      warehouseList().then(res => {
+        if (200 == res.code) {
+          this.warehouseItems = res.data;
+        }
+      });
+    },
+    //计算退款总额 商品退款金额 + 退运费金额 +退税金额
+    calculateRefundAmount() {
+      //如果没选择退税
+      if (this.addRefundForm.refundTaxAble != "1") {
+        this.addRefundForm.refundTaxAmount = BigNumber(0)
+          .toNumber()
+          .toFixed(2);
+      }
+      //如果没选择退运费
+      if (this.addRefundForm.refundPostage != "1") {
+        this.addRefundForm.refundPostageAmount = BigNumber(0)
+          .toNumber()
+          .toFixed(2);
+      }
+
+      var taxAndShippingAmount = BigNumber(this.addRefundForm.refundTaxAmount)
+        .plus(BigNumber(this.addRefundForm.refundPostageAmount))
+        .toNumber()
+        .toFixed(2);
+      this.addRefundForm.refundTotalAmount = BigNumber(taxAndShippingAmount)
+        .plus(BigNumber(this.addRefundForm.refundAmount))
+        .toNumber()
+        .toFixed(2);
+    },
+    handleSelectionChange(val) {
+      console.log('handleSelectionChange',val)
+      this.refundAmount = 0;
+      this.multipleSelection = val;
+      if (this.multipleSelection && this.multipleSelection.length > 0) {
+        for (let uy in this.multipleSelection) {
+          var row = this.multipleSelection[uy];
+          row.refundAmount = BigNumber(row.totalFee)
+            .div(BigNumber(row.oldQuantity))
+            .multipliedBy(BigNumber(row.quantity))
+            .multipliedBy(BigNumber(row.refundSales))
+            .toNumber()
+            .toFixed(2);
+        }
+      } else {
+        this.refundAmount = 0;
+        this.addRefundForm.refundAmount = this.refundAmount;
+      }
+      this.jisuan();
+    },
+    refundAmountChange() {
+      this.jisuan();
+    },
+    jisuan() {
+      this.taxAndShippingAmount = BigNumber(this.addRefundForm.refundTaxAmount)
+        .plus(BigNumber(this.addRefundForm.refundPostageAmount))
+        .toNumber();
+
+      var refundAmount = BigNumber(0);
+      if (this.multipleSelection && this.multipleSelection.length > 0) {
+        for (let uy in this.multipleSelection) {
+          var row = this.multipleSelection[uy];
+          refundAmount = refundAmount.plus(BigNumber(row.refundAmount));
+        }
+        this.refundAmount = refundAmount.toNumber().toFixed(2);
+      }
+      this.$set(this.addRefundForm, "refundAmount", this.refundAmount);
+      this.$set(
+        this.addRefundForm,
+        "refundTotalAmount",
+        refundAmount
+          .plus(BigNumber(this.taxAndShippingAmount))
+          .toNumber()
+          .toFixed(2)
+      );
+      console.log(this.addRefundForm.refundTotalAmount, "总退款金额");
+    },
+    checkSelectable(row) {
+      console.log('----')
+      if (row.refundQuantity > 0) {
+        var refcount = dcmSub(row.oldQuantity, row.refundQuantity);
+        //发生退款
+        if (refcount <= 0 && this.queryRefundType != "1") {
+          return false; //不可选择
+        }
+        row["maxq"] = refcount;
+      } else {
+        row["maxq"] = row.oldQuantity;
+      }
+      // if( row.status == "delivery" && (row.exchangePurchaseFlag == 1)){
+      //   return false; //不可选择
+      // }
+      // if (row.quantity != 0) {
+      //   row.quantity = row["maxq"];
+      // }
+      //未发货
+      if (
+        this.queryRefundType == "2" &&
+        (row.status == "delivery" ||
+          row.status == "off" ||
+          row.status == "partdelivery")
+      ) {
+        return false; //不可选择
+      }
+      //退货退款
+      else if (
+        this.queryRefundType == "3" &&
+        (row.status == "unchecked" ||
+          row.status == "check" ||
+          row.status == "undelivery")
+      ) {
+        return false; //不可选择
+      }
+      // 促销赠品
+      // if (row.isGift === "1" && row.isPromotion === 1) {
+      //   return false; //不可选择
+      // }
+      return true;
+    },
+    refundChange(id, arr) {
+      if (id) {
+        arr.refundReasonList.forEach(item => {
+          if (item.id == id) {
+            arr.customOpen = item.custom;
+            if (arr.customOpen && arr.customOpen != 1) {
+              arr.otherReason = "";
+            }
+          }
+        });
+      } else {
+        arr.customOpen = "";
+      }
+    },
+    writeReason(otherReason) {
+      if (this.multipleSelection && this.multipleSelection.length > 0) {
+        for (let uy in this.multipleSelection) {
+          var row = this.multipleSelection[uy];
+          if (row.customOpen == 1) {
+            row.otherReason = otherReason;
+          }
+        }
+      }
+    },
+    chooseReason(id, arr) {
+      if (id) {
+        arr.forEach(item => {
+          if (item.id == id) {
+            this.otherReasonFlag = item.custom;
+          }
+        });
+      } else {
+        this.otherReasonFlag = "";
+      }
+
+      if (this.multipleSelection && this.multipleSelection.length > 0) {
+        for (let uy in this.multipleSelection) {
+          var row = this.multipleSelection[uy];
+          row.refundReason = String(id);
+          row.customOpen = this.otherReasonFlag;
+          if (row.customOpen != 1) {
+            row.otherReason = "";
+          }
+        }
+      }
+    },
+    changeQuantity(row) {
+      //当前行的退款金额
+      row.refundAmount = BigNumber(row.totalFee)
+        .div(BigNumber(row.oldQuantity))
+        .multipliedBy(BigNumber(row.quantity))
+        .multipliedBy(BigNumber(row.refundSales))
+        .toNumber()
+        .toFixed(2);
+      console.log("当前行可退金额", row.refundAmount);
+      this.jisuan();
+    },
+
+    handleAvatarSuccess(res, file) {
+      console.log("图片上传结果", res);
+      this.imageUrl = res.accessUrl;
+      if (this.imageUrl) {
+        this.addRefundForm.annexPath = this.imageUrl;
+      }
+    },
+    beforeAvatarUpload(file) {
+      const isJPG = file.type === "image/jpeg";
+      const isLt2M = file.size / 1024 / 1024 < 2;
+
+      if (!isJPG) {
+        this.$message.error("上传头像图片只能是 JPG 格式!");
+      }
+      if (!isLt2M) {
+        this.$message.error("上传头像图片大小不能超过 2MB!");
+      }
+      return isJPG && isLt2M;
+    },
+    chooseClick(idList) {
+      this.getDetail(idList);
+    },
+    //创建退款单
+    submit() {
+      if (this.multipleSelection.some(it => it.matchStatus == "unmatch")) {
+        this.$message.error("已签收退货状态匹配错误,请匹配成功后重试!");
+        return false;
+      }
+
+      var flag = false;
+      var str = "";
+      if (this.addressInfo.length != 1) {
+        this.$message.error("请确保地址信息为1!");
+        return false;
+      }
+      //验证 ormorder refundType
+      if (!this.listQuery.ormorder && !this.listQuery.shopify) {
+        str = str + "网店单号shopify单号不能同时为空。";
+        flag = true;
+      }
+      if (this.queryRefundType != this.listQuery.refundType) {
+        str = str + "退款类型不匹配。";
+        flag = true;
+      }
+      if (
+        this.listQuery.ormorder &&
+        this.listQuery.ormorder != this.queryOrmorder
+      ) {
+        str = str + "网店单号不匹配";
+        flag = true;
+      }
+      if (
+        this.listQuery.shopify &&
+        this.listQuery.shopify != this.queryShopify
+      ) {
+        str = str + "shopify单号不匹配";
+        flag = true;
+      }
+      if (flag) {
+        this.$message.error(str + ",请点击查询后继续此操作");
+        return false;
+      }
+
+      //验证通过 保存逻辑
+      this.addRefundForm.ormorder = this.queryOrmorder;
+      this.addRefundForm.refundType = this.queryRefundType;
+      //退货退款仓库验证
+      if (
+        this.addRefundForm.refundType == 3 &&
+        !this.addRefundForm.warehouseCode
+      ) {
+        this.$message.error("请选择收退货仓库!");
+        return false;
+      }
+
+      if (this.multipleSelection.length == 0) {
+        this.$message.error("请选择要退的货品!");
+        return false;
+      }
+
+      var items = [];
+      this.btnLoading = true;
+      this.$confirm(
+        "退款总计:" + this.addRefundForm.refundTotalAmount + ",是否确认?",
+        "提示",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }
+      )
+        .then(async () => {
+          for (let ind in this.multipleSelection) {
+            var obj = this.multipleSelection[ind];
+            if (!obj.refundReason) {
+              this.$alert(obj.ordersId + ":请选择退款原因");
+              this.btnLoading = false;
+              return;
+            }
+            var newobj = {
+              productName: obj.productName,
+              quantity: obj.quantity,
+              orderitemId: obj.orderitemId,
+              skuCode: obj.skuCode,
+              refundAmount: obj.refundAmount,
+              refundReason: obj.refundReason,
+              otherReason: obj.otherReason,
+              soOrdersId: obj.ordersId,
+              isGift: obj.isGift,
+              isPromotion: obj.isPromotion
+            };
+            items.push(newobj);
+          }
+          this.addRefundForm.items = items;
+          //这里默认客服发起
+          this.addRefundForm.originatorFlag = 1;
+          console.log(this.addRefundForm, "newobj");
+          const saveRefund = () => {
+            saveRefundNew(this.addRefundForm).then(
+              res => {
+                if (200 == res.code) {
+                  this.$message({
+                    message: this.$t("optSuccess"),
+                    type: "success"
+                  });
+                  items = [];
+                  this.btnStyle = "display:none";
+                }
+              },
+              error => {
+                this.btnLoading = false;
+              }
+            );
+          };
+          const validPromotion = async () => {
+            // 校验是否包含促销赠品,不包含直接返回true
+            if (
+              !this.tableOrderDeatils.some(
+                item => item.isGift === "1" && item.isPromotion === 1
+              )
+            ) {
+              return true;
+            }
+            // TODO 解开注释请求校验
+            // 校验是否满足促销条件 满足返回true(不提示)
+            const { code, data } = await validPromotionReq(this.addRefundForm);
+            if (code === 200) {
+              return data.valid;
+            }
+            return false;
+          };
+          // TODO 存在赠品的订单,在客服创建未发货退款售后单时,需判断扣除已退款明细之后是否还满足促销条件,若不满足,需弹窗提示客服,由客服判断是否继续执行退款。
+          if (await validPromotion()) {
+            saveRefund();
+          } else {
+            const res = await this.$confirm(
+              "退款后订单将不满足促销条件,是否确认?",
+              "提示",
+              {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+              }
+            );
+            if (res === "confirm") {
+              saveRefund();
+            }
+          }
+        })
+        .catch(() => {
+          this.btnLoading = false;
+          this.$message({
+            type: "info",
+            message: "已取消操作"
+          });
+        });
+    },
+    //TODO 暂时关闭SL
+    ShippingLabelOption() {
+      this.addRefundForm.slUseable = "0";
+
+     if (
+       this.listQuery.refundType == 3 &&
+       this.queryRefundType == 3 &&
+       this.addressInfo&&
+       this.addressInfo.length>0&&
+       this.addressInfo[0].receiverCountryCode == "US" &&
+       (this.addRefundForm.warehouseCode == "PSJ-H0000024"
+       || this.addRefundForm.warehouseCode == "PSJ-H0000019"
+       || this.addRefundForm.warehouseCode == "PSJ-H0000011"
+       || this.addRefundForm.warehouseCode == "PSJ-G001001"
+       || this.addRefundForm.warehouseCode == "PSJ-G001003"
+       || this.addRefundForm.warehouseCode=='PSJ-G001004')
+     ) {
+       this.addRefundForm.slUseable = "1";
+     } else {
+       this.addRefundForm.slUseable = "0";
+     }
+    },
+    changeSlradio() {
+      if (this.addRefundForm.slUseable == "0") {
+        this.addRefundForm.shipmodeId = "";
+        this.addRefundForm.shippingNo = "";
+      }
+    },
+    //查询条件等发生变化时触发的方法
+    validateParams() {
+      //如果退款类型,单号都有
+      if (
+        (this.listQuery.ormorder || this.listQuery.shopify) &&
+        this.listQuery.refundType
+      ) {
+        //直接触发一次重新查询
+        this.getDetail();
+      } else {
+        //参数不完整的情况,清空之前的选项 初始化数据
+        this.ShippingLabelOption();
+        //初始化数据
+        this.addRefundForm.refundAmount = 0.0;
+        this.addRefundForm.refundPostage = "0";
+        this.addRefundForm.refundPostageAmount = 0.0;
+        this.addRefundForm.warehouseCode = "";
+        this.addRefundForm.annexPath = "";
+        this.addRefundForm.items = [];
+        this.addRefundForm.oldQuantity = 0.0;
+        this.addRefundForm.refundTaxAble = "0"; //是否退税
+        this.addRefundForm.refundTaxAmount = 0.0; //退税金额
+        this.addRefundForm.refundTotalAmount = 0.0;
+        this.addRefundForm.shipmodeId = "";
+        this.addRefundForm.shippingNo = "";
+        this.addRefundForm.refundMethod = "system";
+        this.addRefundForm.refundAccountType = "PayPal";
+        this.addRefundForm.refundAccount = "";
+        this.addRefundForm.notes = "";
+        this.addressInfo = [];
+        this.listQuery.idList = null;
+        this.reasonListAll = [];
+        this.refundReasonAss = "";
+        this.refundOtherReasonAss = "";
+        this.otherReasonFlag = "";
+      }
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.head {
+  padding: 0 20px;
+  height: 25px;
+  box-shadow: 0px 7px 6px -6px #f8eeee;
+  display: flex;
+  justify-content: space-between;
+  span:nth-child(1) {
+    font-size: 15px;
+    line-height: 25px;
+    color: #909399;
+    font-weight: 600;
+  }
+  span:nth-child(2) {
+    line-height: 25px;
+    cursor: pointer;
+    color: #ae8878;
+    font-size: 13px;
+  }
+}
+
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+
+.avatar-uploader .el-upload:hover {
+  border-color: #409eff;
+}
+
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 178px;
+  height: 178px;
+  line-height: 178px;
+  text-align: center;
+}
+.avatar {
+  width: 178px;
+  height: 178px;
+  display: block;
+}
+
+.main {
+  margin-top: 15px;
+  .box {
+    text-align: center;
+    position: relative;
+    .box_item {
+      padding: 0 20px;
+      display: flex;
+      .item_title {
+        line-height: 40px;
+        font-size: 18px;
+        text-align: left;
+        font-weight: 600;
+      }
+      .item_list {
+        text-align: left;
+        font-size: 14px;
+        color: #606266;
+        display: flex;
+        p {
+          margin: 10px 0;
+        }
+        div:nth-child(2) {
+          margin-left: 30px;
+        }
+      }
+    }
+    .item_title {
+      padding-left: 20px;
+      line-height: 40px;
+      font-size: 18px;
+      text-align: left;
+      font-weight: 600;
+    }
+  }
+}
+
+.ptitle {
+  display: flex;
+  justify-content: space-between;
+  margin: 20px;
+  color: #1f2d3d;
+  text-align: left;
+  font-weight: bold;
+}
+
+.container {
+  display: flex; /* 使用 Flexbox 布局 */
+  justify-content: space-between; /* 将盒子平均分布在容器中 */
+}
+</style>

+ 816 - 0
src/views/oms/refund-old/components/orderRefundDialog.vue

@@ -0,0 +1,816 @@
+<template>
+  <div v-loading.fullscreen.lock="detailLoading">
+    <div class="head">
+      <!--		<span>销售单详情</span>
+ 			<span>返回</span>
+ -->
+    </div>
+    <div class="main">
+      <!-- <div class="box" style="margin-top: 15px;">
+				<div class="item_title">
+					<span>基本信息</span>
+				</div>
+				<div class="ptitle">
+					<baseInfoTab :orderInfo="orderInfo"></baseInfoTab>
+				</div>
+			</div> -->
+
+      <div class="box" style="margin-top: 15px;">
+        <div class="item_title">
+          <span>{{ $t("view.shippingInfo") }}</span>
+        </div>
+        <div class="ptitle">
+          <!-- <receivingInfoTab :addressInfo="addressInfo" :orderInfo="orderInfo"></receivingInfoTab> -->
+          <el-descriptions
+            class="margin-top"
+            :title="$t('title.addressInfo')"
+            :column="4"
+            direction="horizontal"
+          >
+            <el-descriptions-item :label="$t('country')">{{
+              addressInfo.receiverCountryCode
+            }}</el-descriptions-item>
+            <el-descriptions-item :label="$t('label.postalCode')">{{
+              addressInfo.receiverZip
+            }}</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
+            }}</el-descriptions-item>
+            <el-descriptions-item :label="$t('moPhone')">{{
+              addressInfo.receiverMobile
+            }}</el-descriptions-item>
+            <el-descriptions-item :label="$t('post')">{{
+              addressInfo.email
+            }}</el-descriptions-item>
+            <el-descriptions-item :label="$t('label.shippingFee')">{{
+              addressInfo.freight
+            }}</el-descriptions-item>
+          </el-descriptions>
+        </div>
+      </div>
+
+      <div
+        class="box"
+        style="margin-top: 15px;padding-bottom: 10px;"
+        v-if="invoiceInfo != null"
+      >
+        <div class="item_title">
+          <span>{{ $t("view.invoiceDetails") }}</span>
+        </div>
+        <div class="ptitle">
+          <invoiceInfoTab :invoiceInfo="invoiceInfo"></invoiceInfoTab>
+        </div>
+      </div>
+
+      <div
+        class="box"
+        style="margin-top: 15px;padding-bottom: 10px;"
+        v-loading="fromLoading"
+      >
+        <div class="item_title">
+          <span>{{ $t("view.refundInfo") }}</span>
+        </div>
+        <div class="ptitle">
+          <el-form
+            ref="addRefundForm"
+            :model="addRefundForm"
+            label-width="auto"
+          >
+            <el-form-item :label="$t('currency')">
+              <el-input
+                disabled
+                v-model="addRefundForm.currency"
+                placeholder
+                class="normal-input"
+              ></el-input>
+            </el-form-item>
+            <el-form-item :label="$t('label.afterSalesType')" required>
+              <el-select
+                :disabled="editIs"
+                :placeholder="$t('place.pleaseSelect')"
+                clearable
+                style="width: 200px;"
+                class="filter-item"
+                v-model="addRefundForm.refundType"
+              >
+                <el-option
+                  v-for="afterSaleType in afterSaleTypes"
+                  disabled
+                  :key="afterSaleType.value"
+                  :label="$t(afterSaleType.label)"
+                  :value="afterSaleType.value"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item :label="$t('label.expectedRefundAmount')" required>
+              <el-input
+                v-model="addRefundForm.refundTotalAmount"
+                :disabled="true"
+              />
+            </el-form-item>
+            <el-form-item :label="$t('label.refundMethod')" required>
+              <!-- <el-input  v-model="addRefundForm.refundMethod" :placeholder="$t('place.pleaseFillIn')" class="normal-input"></el-input> -->
+              <el-radio-group v-model="addRefundForm.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="addRefundForm.refundMethod == 'manual'"
+              :label="$t('label.accountType')"
+              required=""
+            >
+              <el-radio-group v-model="addRefundForm.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
+              :label="$t('label.receivingAccount')"
+              v-if="
+                addRefundForm.refundMethod == 'manual' &&
+                  addRefundForm.refundAccountType == 'PayPal'
+              "
+              required
+            >
+              <el-input
+                v-model="addRefundForm.refundAccount"
+                :placeholder="$t('place.pleaseFillIn')"
+                class="normal-input"
+              ></el-input>
+            </el-form-item>
+            <!-- 选择是否退税-->
+            <el-form-item
+              v-if="addRefundForm.refundType"
+              :label="$t('label.taxRefund')"
+            >
+              <el-radio-group
+                v-model="addRefundForm.refundTaxAble"
+                @change="calculateRefundAmount"
+              >
+                <el-radio label="0">{{ $t("view.noTaxRefund") }}</el-radio>
+                <el-radio label="1">{{ $t("view.taxRefund") }}</el-radio>
+              </el-radio-group>
+            </el-form-item>
+            <el-form-item
+              v-if="addRefundForm.refundTaxAble == 1"
+              :label="$t('label.taxRefundAmount')"
+            >
+              <el-input-number
+                v-model="addRefundForm.refundTaxAmount"
+                :min="0.0"
+                :step="0.01"
+                step-strictly
+                @change="calculateRefundAmount"
+              ></el-input-number>
+            </el-form-item>
+            <!-- 选择是否退运费-->
+            <el-form-item
+              v-if="addRefundForm.refundType"
+              :label="$t('label.shippingFee')"
+            >
+              <el-radio-group
+                v-model="addRefundForm.refundPostage"
+                @change="calculateRefundAmount"
+              >
+                <el-radio label="0">{{ $t("view.noRefund") }}</el-radio>
+                <el-radio label="1">{{
+                  $t("view.refundShippingFee")
+                }}</el-radio>
+              </el-radio-group>
+            </el-form-item>
+            <el-form-item
+              v-if="addRefundForm.refundPostage == 1"
+              :label="$t('label.returnShippingFeeAmount')"
+            >
+              <el-input-number
+                v-model="addRefundForm.refundPostageAmount"
+                :min="0.0"
+                :step="0.01"
+                step-strictly
+                @change="calculateRefundAmount"
+              ></el-input-number>
+            </el-form-item>
+            <el-form-item
+              v-if="addRefundForm.refundType == 3"
+              :label="$t('label.receivingReturnWarehouse')"
+            >
+              <el-select
+                :placeholder="$t('place.pleaseSelect')"
+                clearable
+                style="width: 200px;"
+                class="filter-item"
+                v-model="addRefundForm.warehouseCode"
+                @change="ShippingLabelOption"
+              >
+                <el-option
+                  v-for="item in warehouseItems"
+                  :key="item.key"
+                  :label="item.key"
+                  :value="item.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+            <!-- TODO 暂时关闭SL -->
+            <el-form-item
+              v-if="addRefundForm.warehouseCode"
+              label="ShippingLabel" hidden
+            >
+              <el-radio-group v-model="addRefundForm.slUseable">
+                <el-radio label="0" value="0">{{
+                  $t("view.notEnabled")
+                }}</el-radio>
+                <el-radio label="1" value="1">{{
+                  $t("view.enabled")
+                }}</el-radio>
+              </el-radio-group>
+            </el-form-item>
+
+            <el-form-item
+              v-if="
+                addRefundForm.refundType == 3 && addRefundForm.slUseable == '1'
+              "
+              :label="$t('label.returnLogisticsCompanyCode')"
+            >
+              <el-input
+                v-model="addRefundForm.shipmodeId"
+                disabled
+                :placeholder="$t('place.pleaseFillIn')"
+                class="normal-input"
+              ></el-input>
+            </el-form-item>
+            <el-form-item
+              v-if="
+                addRefundForm.refundType == 3 && addRefundForm.slUseable == '1'
+              "
+              :label="$t('label.returnLogisticsNumber')"
+            >
+              <el-input
+                v-model="addRefundForm.shippingNo"
+                disabled
+                :placeholder="$t('place.pleaseFillIn')"
+                class="normal-input"
+              ></el-input>
+            </el-form-item>
+
+            <el-form-item
+              v-if="
+                addRefundForm.refundType == 3 && addRefundForm.slUseable == '0'
+              "
+              :label="$t('label.returnLogisticsCompanyCode')"
+            >
+              <el-input
+                v-model="addRefundForm.shipmodeId"
+                :placeholder="$t('place.pleaseFillIn')"
+                class="normal-input"
+              ></el-input>
+            </el-form-item>
+            <el-form-item
+              v-if="
+                addRefundForm.refundType == 3 && addRefundForm.slUseable == '0'
+              "
+              :label="$t('label.returnLogisticsNumber')"
+            >
+              <el-input
+                v-model="addRefundForm.shippingNo"
+                :placeholder="$t('place.pleaseFillIn')"
+                class="normal-input"
+              ></el-input>
+            </el-form-item>
+            <!-- <el-form-item v-if="addRefundForm.refundType==1" clearable :label="$t('label.refundReason')">
+              <el-select  :placeholder="$t('place.pleaseSelect')" clearable v-model="addRefundForm.refundReason" class="filter-item"  @change="refundChange(allReason,addRefundForm.refundReason)">
+                <el-option v-for="status in allReason"
+                           v-if="status.reasonType=='1'"
+                           :key="status.id"
+                           :label="status.reasonContentChinese"
+                           :value="status.id">
+                </el-option>
+              </el-select>
+            </el-form-item> -->
+            <!-- <el-form-item v-if="addRefundForm.refundType==2" clearable :label="$t('label.refundReason')" >
+              <el-select  :placeholder="$t('place.pleaseSelect')" clearable v-model="addRefundForm.refundReason" class="filter-item"  @change="refundChange(allReason,addRefundForm.refundReason)">
+                <el-option v-for="status in allReason"
+                           v-if="status.reasonType=='2'"
+                           :key="status.id"
+                           :label="status.reasonContentChinese"
+                           :value="status.id">
+                </el-option>
+              </el-select>
+            </el-form-item> -->
+            <!-- <el-form-item v-if="addRefundForm.refundType==3" clearable :label="$t('label.refundReason')">
+              <el-select  :placeholder="$t('place.pleaseSelect')" clearable v-model="addRefundForm.refundReason" class="filter-item" @change="refundChange(allReason,addRefundForm.refundReason)">
+                <el-option v-for="status in allReason"
+                           v-if="status.reasonType=='3'"
+                           :key="status.id"
+                           :label="status.reasonContentChinese"
+                           :value="status.id">
+                </el-option>
+              </el-select>
+            </el-form-item> -->
+            <!-- <el-form-item v-if="customOpen=='1'" :label="$t('label.reasonExplanation')">
+              <el-input type="textarea" :placeholder="$t('place.enterReason')" v-model="addRefundForm.otherReason" style="width: 200px;" :rows="3"></el-input>
+            </el-form-item> -->
+
+            <el-form-item :label="$t('label.afterSalesInstructions')">
+              <el-input
+                type="textarea"
+                :placeholder="$t('place.enterContent')"
+                v-model="addRefundForm.notes"
+                maxlength="150"
+                show-word-limit
+              >
+              </el-input>
+            </el-form-item>
+            <el-form-item :label="$t('label.uploadVoucher')">
+              <el-upload
+                class="avatar-uploader"
+                :action="uploadPhotos"
+                :show-file-list="false"
+                :on-success="handleAvatarSuccess"
+                :before-upload="beforeAvatarUpload"
+                :headers="headers"
+              >
+                <img v-if="imageUrl" :src="imageUrl" class="avatar" />
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+              </el-upload>
+            </el-form-item>
+          </el-form>
+        </div>
+      </div>
+
+      <div class="box" style="margin-top: 15px;" v-if="refundType">
+        <div class="item_title">
+          <span>{{ $t("view.selectItems") }}</span>
+        </div>
+        <div class="ptitle">
+          <!-- <orderRefundItemListTab v-if="refundType" :addRefundForm="addRefundForm" :refundType="addRefundForm.refundType" :orderDeatils="orderDeatils" :orderInfo="orderInfo"></orderRefundItemListTab> -->
+          <orderRefundItemListTab
+            v-if="refundType"
+            :addRefundForm="addRefundForm"
+            :refundType="addRefundForm.refundType"
+          ></orderRefundItemListTab>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import {
+  getById,
+  queryOrderDetails,
+  getAllReason
+} from "@/api/oms/order/order";
+import { queryByOrdersId as getAddress } from "@/api/oms/order/address";
+import { getById as getInvoice } from "@/api/oms/order/invoice";
+import global from "@/views/oms/global";
+import baseInfoTab from "@/views/oms/order/components/baseInfoTab";
+import invoiceInfoTab from "@/views/oms/order/components/invoiceInfoTab";
+import optLogTab from "@/views/oms/order/components/optLogTab";
+import orderRefundItemListTab from "./orderRefundItemListTab";
+import receivingInfoTab from "@/views/oms/order/components/receivingInfoTab";
+import {
+  warehouseList,
+  getRefundInfo,
+  getDetailListByRefundId
+} from "@/api/oms/refund/refund";
+import { getToken } from "@/utils/auth";
+import { dcmAdd, dcmSub, accDiv, accMul } from "@/utils/toolUtil";
+import { BigNumber } from "bignumber.js";
+export default {
+  name: "orderRefundDialog",
+  props: ["refundId"],
+  components: {
+    baseInfoTab,
+    invoiceInfoTab,
+    optLogTab,
+    orderRefundItemListTab,
+    receivingInfoTab
+  },
+  data() {
+    return {
+      orderInfo: {},
+      addressInfo: {},
+      orderDeatils: [],
+      invoiceInfo: null,
+      detailLoading: false,
+      imageUrl: "",
+      allReason: {},
+      customOpen: "",
+      addRefundForm: {
+        refundMethod: "system",
+        refundPostage: "0",
+        refundAmount: 0.0, //商品退款金额
+        refundPostageAmount: 0.0,
+        warehouseCode: "",
+        annexPath: "",
+        items: [],
+        oldQuantity: 0,
+        refundTaxAble: "0", //是否退税
+        refundTaxAmount: 0.0, //退税金额
+        refundTotalAmount: 0.0, //总计退款金额 = 商品退款金额 + 退运费金额 + 退税金额 。 实际执行时,refundAmount=商品退款金额 + 退税金额;退运费金额单独计算
+        refundReason: "", // 退款原因
+        otherReason: "", // 其他退款理由
+        refundAccount: "",
+        refundAccountType: "",
+        ormorder: "",
+        slUseable: "0" //是否开启ShippingLabel选项
+      },
+      afterSaleTypes: "",
+      warehouseItems: [],
+      fromLoading: false,
+      uploadPhotos: process.env.VUE_APP_OMS_API + "ordersRefund/uploadPhotos",
+      editIs: true,
+      refundType: false
+    };
+  },
+  created() {
+    // if(!this.refundId) {
+    // 	this.editIs = false;
+    // }
+    // this.getOrderInfo();
+    //这里只考虑编辑的情况
+    this.getDetailListByRefundId(this.refundId);
+  },
+  computed: {
+    // 计算属性的 getter
+    headers: function() {
+      return {
+        "X-Token": getToken()
+      };
+    }
+  },
+  methods: {
+    //计算退款总额 商品退款金额 + 退运费金额 +退税金额
+    calculateRefundAmount() {
+      //如果没选择退税
+      if (this.addRefundForm.refundTaxAble != "1") {
+        this.addRefundForm.refundTaxAmount = BigNumber(0)
+          .toNumber()
+          .toFixed(2);
+      }
+      //如果没选择退运费
+      if (this.addRefundForm.refundPostage != "1") {
+        this.addRefundForm.refundPostageAmount = BigNumber(0)
+          .toNumber()
+          .toFixed(2);
+      }
+
+      var taxAndShippingAmount = BigNumber(this.addRefundForm.refundTaxAmount)
+        .plus(BigNumber(this.addRefundForm.refundPostageAmount))
+        .toNumber()
+        .toFixed(2);
+      console.log(taxAndShippingAmount, this.addRefundForm.refundAmount);
+      this.addRefundForm.refundTotalAmount = BigNumber(taxAndShippingAmount)
+        .plus(BigNumber(this.addRefundForm.refundAmount))
+        .toNumber()
+        .toFixed(2);
+    },
+    getDetailListByRefundId(refundId) {
+      //初始化数据
+      this.addRefundForm.refundAmount = 0.0;
+      this.addRefundForm.refundPostage = "0";
+      this.addRefundForm.refundPostageAmount = 0.0;
+      this.addRefundForm.warehouseCode = "";
+      this.addRefundForm.annexPath = "";
+      this.addRefundForm.items = [];
+      this.addRefundForm.oldQuantity = 0.0;
+      this.addRefundForm.refundTaxAble = "0"; //是否退税
+      this.addRefundForm.refundTaxAmount = 0.0; //退税金额
+      this.addRefundForm.refundTotalAmount = 0.0;
+      this.addRefundForm.shipmodeId = "";
+      this.addRefundForm.shippingNo = "";
+      this.addRefundForm.refundMethod = "system";
+      this.addRefundForm.refundAccountType = "PayPal";
+      this.addRefundForm.refundAccount = "";
+      this.addRefundForm.notes = "";
+      this.addressInfo = [];
+      this.reasonListAll = [];
+      this.refundReasonAss = "";
+      this.refundOtherReasonAss = "";
+      this.otherReasonFlag = "";
+      //查询该退款单的数据
+      this.detailLoading = true;
+      let _this = this;
+      getDetailListByRefundId(refundId).then(res => {
+        if (200 == res.code) {
+          this.addRefundForm = res.data;
+          this.addressInfo = res.data.address;
+          this.afterSaleTypes = global.afterSaleType; //售后类型
+          //循环订单项信息
+          let refundGoodsAmount = BigNumber(0);
+          if (this.addRefundForm.items) {
+            for (let ind in this.addRefundForm.items) {
+              refundGoodsAmount = refundGoodsAmount.plus(
+                BigNumber(this.addRefundForm.items[ind].refundAmount)
+              );
+            }
+          }
+          _this.$set(
+            this.addRefundForm,
+            "refundAmount",
+            BigNumber(refundGoodsAmount.toFixed(2))
+          ); //this.addRefundForm.refundAmount= refundGoodsAmount.toFixed(2);
+          //原单的退税金额 = 原单的退款总金额 - 退商品金额 - 退运费金额
+          let oldRefundTaxAmount = BigNumber(
+            this.addRefundForm.refundTotalAmount
+          )
+            .plus(BigNumber(-this.addRefundForm.refundPostageAmount))
+            .plus(BigNumber(-this.addRefundForm.refundAmount))
+            .toFixed(2);
+
+          if (oldRefundTaxAmount > 0) {
+            _this.$set(this.addRefundForm, "refundTaxAble", "1"); //是否退税
+          } else {
+            oldRefundTaxAmount = 0;
+            _this.$set(this.addRefundForm, "refundTaxAble", "0"); //是否退税
+          }
+          _this.$set(this.addRefundForm, "refundTaxAmount", oldRefundTaxAmount); //是否退税 this.addRefundForm.refundTaxAmount=oldRefundTaxAmount;
+          this.refundType = true;
+
+          this.detailLoading = false;
+
+          //退货退款场景
+          if (this.addRefundForm.refundType == 3) {
+            warehouseList().then(res => {
+              if (200 == res.code) {
+                this.warehouseItems = res.data;
+              }
+            });
+          }
+        } else {
+          this.$message.error(res.msg);
+        }
+      });
+    },
+    handleAvatarSuccess(res, file) {
+      console.log("图片上传结果", res);
+      this.imageUrl = res.accessUrl;
+      if (this.imageUrl) {
+        this.addRefundForm.annexPath = this.imageUrl;
+      }
+    },
+    beforeAvatarUpload(file) {
+      const isJPG = file.type === "image/jpeg" || file.type === "image/png";
+      const isLt2M = file.size / 1024 / 1024 < 2;
+
+      if (!isJPG) {
+        this.$message.error("上传图片只能是 JPG 格式或者PNG格式!");
+      }
+      if (!isLt2M) {
+        this.$message.error("上传头像图片大小不能超过 2MB!");
+      }
+      return isJPG && isLt2M;
+    },
+
+    refundChange(arr, id) {
+      console.log(arr, id);
+      arr.forEach(item => {
+        if (item.id == id) {
+          this.customOpen = item.custom;
+        }
+      });
+    },
+    // changeRefund() {
+    // 	this.fromLoading = true;
+    // 	this.refundType=false;
+    // 	this.orderDeatils = [];
+    // 	this.addRefundForm.refundAmount = 0.00;
+    // 	this.addRefundForm.refundPostage = '0';
+    // 	this.addRefundForm.refundPostageAmount = 0.00;
+    // 	this.addRefundForm.refundTaxAble='0';//是否退税
+    // 	this.addRefundForm.refundTaxAmount=0.00;//退税金额
+    // 	this.addRefundForm.refundTotalAmount=0.00; //总计退款金额 = 退款金额 + 退运费金额 + 退税金额 。 实际执行时,refundAmount=商品退款金额 + 退税金额;退运费金额单独计算
+    // 	this.addRefundForm.warehouseCode = '';
+    // 	this.addRefundForm.annexPath = '';
+    // 	this.addRefundForm.items = [];
+    // 	this.addRefundForm.oldQuantity = 0;
+    // 	this.warehouseItems = [];
+    // 	this.addRefundForm.refundReason='';
+    // 	this.addRefundForm.otherReason='';
+    // 	//退货退款场景
+    // 	if(this.addRefundForm.refundType == 3) {
+    // 		warehouseList().then(res => {
+    // 			if(200 == res.code) {
+    // 				this.warehouseItems = res.data;
+    // 			}
+    // 		})
+    // 	}
+    // queryOrderDetails(this.orderInfo.ordersId).then(res => {
+    // 		if(200 == res.code) {
+
+    // 			this.orderDeatils = res.data;
+    // 			if(this.orderDeatils) {
+    // 				for(let ind in this.orderDeatils) {
+    // 					this.orderDeatils[ind].oldQuantity = this.orderDeatils[ind].quantity;
+    //     if(this.addRefundForm.refundType==1){
+    //       this.orderDeatils[ind].quantity=0;
+    //     }
+    // 					var fee=this.orderDeatils[ind].totalFee;
+    // 					if(fee==null||fee==""){
+    // 						fee=0.00;
+    // 					}
+    // 					this.$set(this.orderDeatils[ind], "refundAmount", fee)
+    // 					if(this.orderDeatils[ind].refundQuantity == null) {
+    // 						this.orderDeatils[ind].refundQuantity = 0;
+    // 					}
+    // 				}
+    // 				this.refundType=true;
+    // 			}
+
+    // 		}
+    // 		this.fromLoading = false;
+    // 		console.log("this.orderDeatils",this.orderDeatils)
+    // 	})
+
+    // },
+    ShippingLabelOption() {
+      // if (
+      //   this.addRefundForm.refundType == 3 &&
+      //   this.addressInfo.receiverCountryCode == "US" &&
+      //     this.addRefundForm.warehouseCode == "USNY-C1"
+      // ) {
+      //   this.addRefundForm.slUseable = "1";
+      // } else {
+      //   this.addRefundForm.slUseable = "0";
+      // }
+      //暂时关闭SL
+      this.addRefundForm.slUseable = "0";
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.head {
+  padding: 0 20px;
+  height: 25px;
+  box-shadow: 0px 7px 6px -6px #f8eeee;
+  display: flex;
+  justify-content: space-between;
+  span:nth-child(1) {
+    font-size: 15px;
+    line-height: 25px;
+    color: #909399;
+    font-weight: 600;
+  }
+  span:nth-child(2) {
+    line-height: 25px;
+    cursor: pointer;
+    color: #ae8878;
+    font-size: 13px;
+  }
+}
+
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+
+.avatar-uploader .el-upload:hover {
+  border-color: #409eff;
+}
+
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 178px;
+  height: 178px;
+  line-height: 178px;
+  text-align: center;
+}
+
+.avatar {
+  width: 178px;
+  height: 178px;
+  display: block;
+}
+
+.big_box {
+  min-width: 650px;
+  border: 1px solid #e4e7ed;
+  border-bottom: none;
+}
+
+.big_box div {
+  border-bottom: 1px solid #e4e7ed;
+  display: flex;
+}
+
+.big_box p {
+  margin: 0;
+  height: 30px;
+  line-height: 30px;
+  font-size: 13px;
+  font-weight: bold;
+  border-right: 1px solid #e4e7ed;
+  padding: 0 5px;
+  text-align: center;
+  color: #909399;
+  min-width: 100px;
+}
+
+.w {
+  font-weight: 500 !important;
+  color: #606266 !important;
+  text-align: left !important;
+  padding-left: 20px !important;
+}
+
+.main {
+  margin-top: 15px;
+  .box {
+    text-align: center;
+    position: relative;
+    .box_item {
+      padding: 0 20px;
+      display: flex;
+      .item_title {
+        line-height: 40px;
+        font-size: 18px;
+        text-align: left;
+        font-weight: 600;
+      }
+      .item_list {
+        text-align: left;
+        font-size: 14px;
+        color: #606266;
+        display: flex;
+        p {
+          margin: 10px 0;
+        }
+        div:nth-child(2) {
+          margin-left: 30px;
+        }
+      }
+    }
+    .item_title {
+      padding-left: 20px;
+      line-height: 40px;
+      font-size: 18px;
+      text-align: left;
+      font-weight: 600;
+    }
+  }
+}
+
+.ptitle {
+  display: flex;
+  justify-content: space-between;
+  margin: 20px;
+  color: #1f2d3d;
+  text-align: left;
+  font-weight: bold;
+}
+
+.pcode {
+  color: #8f5842;
+  font-weight: 500;
+}
+
+.demo-table-expand {
+  font-size: 0;
+}
+
+.demo-table-expand label {
+  width: 90px;
+  color: #99a9bf;
+}
+
+.demo-table-expand .el-form-item {
+  margin-right: 0;
+  margin-bottom: 0;
+  width: 50%;
+}
+</style>

+ 747 - 0
src/views/oms/refund-old/components/orderRefundItemListNewTab.vue

@@ -0,0 +1,747 @@
+<template>
+  <div>
+    <el-select
+      v-if="this.multipleSelection && this.multipleSelection.length > 0"
+      v-model="refundReasonAss"
+      :placeholder="$t('place.selectCheckedRefundReasons')"
+      clearable
+      @change="chooseReason(refundReasonAss, refundReasonList)"
+    >
+      <el-option
+        v-for="status in this.refundReasonList"
+        :key="status.id"
+        :label="status.reasonContentChinese"
+        :value="String(status.id)"
+      >
+      </el-option>
+    </el-select>
+    <el-input
+      v-if="otherReasonFlag == '1'"
+      :placeholder="$t('place.enterReason')"
+      clearable
+      style="width: 200px;"
+      class="filter-item"
+      v-model="refundOtherReasonAss"
+      @change="writeReason(refundOtherReasonAss)"
+    />
+    <el-table
+      ref="multipleTable"
+      @selection-change="handleSelectionChange"
+      style="width: 100%;"
+      v-loading="listLoading"
+      key="0"
+      :data="tableOrderDeatils"
+      row-key="id"
+      stripe
+      border
+      fit
+      highlight-current-row
+    >
+      <el-table-column
+        type="selection"
+        width="55"
+        :selectable="checkSelectable"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('goodsCode')"
+        width="150"
+        align="center"
+        prop="skuCode"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('onlyCode')"
+        min-width="180"
+        align="center"
+        prop=""
+      >
+        <template slot-scope="scope">
+          <div
+            v-if="scope.row.uniqueCode"
+            v-for="(item, index) in scope.row.uniqueCode"
+          >
+            {{ item }}
+          </div>
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('goodsName')"
+        width="300"
+        align="center"
+        prop="productName"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.originalQuantity')"
+        width="160"
+        align="center"
+        prop="oldQuantity"
+      ></el-table-column>
+      <el-table-column
+        :label="$t('goodsPrice')"
+        width="80"
+        align="center"
+        prop="price"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('offerAmount')"
+        width="80"
+        align="center"
+        prop="discountFee"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('payAmount')"
+        width="80"
+        align="center"
+        prop="totalFee"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.refundPercentage')"
+        width="160"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <div v-if="multipleSelection.indexOf(scope.row) == -1">
+            <div>{{ scope.row.refundSales }}</div>
+          </div>
+          <div v-else>
+            <el-input-number
+              v-model="scope.row.refundSales"
+              @change="changeQuantity(scope.row)"
+              size="mini"
+              :min="0"
+              :max="1"
+              :step="0.01"
+              step-strictly
+            ></el-input-number>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.eligibleQuantity')"
+        width="160"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <div v-if="multipleSelection.indexOf(scope.row) == -1">
+            <div>{{ scope.row | quantityFilter }}</div>
+          </div>
+          <div v-else>
+            <el-input-number
+              v-model="scope.row.quantity"
+              @change="changeQuantity(scope.row)"
+              size="mini"
+              :min="0"
+              :max="scope.row.maxq"
+              :step="1"
+              step-strictly
+            ></el-input-number>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.refundedAmount')"
+        width="160"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <div v-if="multipleSelection.indexOf(scope.row) == -1">
+            <div>0</div>
+          </div>
+          <div v-else>
+            <el-input-number
+              v-model="scope.row.refundAmount"
+              size="mini"
+              @change="refundAmountChange"
+              :min="0.0"
+              :max="scope.row.totalFee"
+            ></el-input-number>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.refundReason')"
+        width="150"
+        align="center"
+      >
+        <template slot-scope="scope">
+<!--          <div v-if="multipleSelection.indexOf(scope.row) == -1">{{multipleSelection}}</div>-->
+          <div>
+            <el-select
+              v-model="scope.row.refundReason"
+              :placeholder="$t('place.pleaseSelect')"
+              clearable
+              @change="refundChange(scope.row.refundReason, scope.row)"
+            >
+              <el-option
+                v-for="status in scope.row.refundReasonList"
+                :key="status.id"
+                :label="status.reasonContentChinese"
+                :value="String(status.id)"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.reasonExplanation')"
+        width="150"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <div v-if="multipleSelection.indexOf(scope.row) == -1"></div>
+          <div v-else>
+            <el-input
+              v-if="scope.row.customOpen == '1'"
+              :placeholder="$t('place.enterReason')"
+              clearable
+              style="width: 200px;"
+              class="filter-item"
+              v-model="scope.row.otherReason"
+            />
+          </div>
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.refundedQuantity')"
+        width="160"
+        align="center"
+        prop="refundQuantity"
+      ></el-table-column>
+
+      <el-table-column
+        :label="$t('status')"
+        width="80"
+        align="center"
+        prop="status"
+      >
+        <template slot-scope="scope">
+          {{ scope.row.status | statusFilter }}
+        </template>
+      </el-table-column>
+
+      <!--<el-table-column :label="$t('gifts')"  width="80" align="center" prop="">
+          </el-table-column>-->
+    </el-table>
+    <div class="box" style="width:100%;margin-top: 15px;float:right">
+      退款总计:{{ addRefundForm.refundTotalAmount }}
+    </div>
+    <div class="box" style="margin-top: 15px;float:right">
+      <el-button
+        :style="btnStyle"
+        v-if="addRefundForm.id"
+        type="primary"
+        @click="submit(this)"
+        v-loading="btnLoading"
+        >{{ $t("save") }}</el-button
+      >
+      <!-- <el-button
+          :style="btnStyle"
+          v-if="addRefundForm.id"
+          type="primary"
+          @click="submitUpdate(this)"
+          v-loading="btnLoading"
+          >{{ $t("save") }}</el-button
+        > -->
+    </div>
+  </div>
+</template>
+
+<script>
+import {
+  statusKeyValue,
+  queryOrderDetails,
+  queryOrderDetailsByOrmorder
+} from "@/api/oms/order/order";
+import {
+  saveRefund,
+  updateRefund,
+  saveRefundNew, validPromotionReq
+} from "@/api/oms/refund/refund";
+import { dcmAdd, dcmSub, accDiv, accMul } from "@/utils/toolUtil";
+import { BigNumber } from "bignumber.js";
+export default {
+  name: "orderRefundItemListNewTab",
+  props: ["refundType", "addRefundForm"],
+  filters: {
+    statusFilter(key) {
+      return statusKeyValue[key];
+    },
+    quantityFilter(row) {
+      if (row.refundQuantity > 0) {
+        return dcmSub(row.oldQuantity, row.refundQuantity);
+      }
+      return row.oldQuantity;
+    }
+  },
+  data() {
+    return {
+      listLoading: false,
+      btnLoading: false,
+      multipleSelection: [],
+      btnStyle: "",
+      refundAmount: 0,
+      editOrderDeatils: [],
+      tableOrderDeatils: [],
+      taxAndShippingAmount: 0, //退税和退运费金额
+      refundReasonList: [],
+      refundReasonAss: "",
+      refundOtherReasonAss: "",
+      otherReasonFlag: ""
+    };
+  },
+  created() {
+    this.init();
+  },
+  methods: {
+    //加载
+    init() {
+      let _this = this;
+      _this.editOrderDeatils = [];
+      //查询订单详情
+      var params = {
+        ormorder: _this.addRefundForm.ormorder,
+        refundType: _this.addRefundForm.refundType,
+        storeId: _this.addRefundForm.storeId,
+      };
+      this.listLoading = true;
+      queryOrderDetailsByOrmorder(params).then(res2 => {
+        if (200 == res2.code) {
+          //修改退款申请,订单项列表
+          _this.tableOrderDeatils = res2.data;
+          let goodsRefundAmount = BigNumber(0);
+          this.refundReasonList = _this.addRefundForm.refundReasonList;
+          if (_this.tableOrderDeatils) {
+            for (let ind in _this.tableOrderDeatils) {
+              _this.tableOrderDeatils[ind].oldQuantity =
+                _this.tableOrderDeatils[ind].quantity;
+
+              for (let ind2 in _this.addRefundForm.items) {
+                //明细属于当前退款单
+                _this.$set(
+                  _this.tableOrderDeatils[ind],
+                  "refundReasonList",
+                  _this.addRefundForm.items[ind2].refundReasonList
+                );
+
+                if (
+                  _this.addRefundForm.items[ind2].orderitemId ==
+                  _this.tableOrderDeatils[ind].orderitemId
+                ) {
+                  //退款金额
+                  //_this.tableOrderDeatils[ind].refundAmount=_this.addRefundForm.items[ind2].refundAmount;
+
+                  _this.$set(
+                    _this.tableOrderDeatils[ind],
+                    "refundAmount",
+                    _this.addRefundForm.items[ind2].refundAmount
+                  );
+
+                  //退款原因
+                  _this.$set(
+                    _this.tableOrderDeatils[ind],
+                    "refundReason",
+                    String(_this.addRefundForm.items[ind2].refundReason)
+                  );
+
+                  _this.$set(
+                    _this.tableOrderDeatils[ind],
+                    "customOpen",
+                    this.getCustopen(
+                      _this.tableOrderDeatils[ind].refundReason,
+                      _this.addRefundForm.items[ind2].refundReasonList
+                    )
+                  );
+
+                  _this.$set(
+                      _this.tableOrderDeatils[ind],
+                      "quantity",
+                      _this.addRefundForm.items[ind2].quantity
+                    );
+
+                  //其他原因
+                  _this.$set(
+                    _this.tableOrderDeatils[ind],
+                    "otherReason",
+                    _this.addRefundForm.items[ind2].otherReason
+                  );
+
+                  _this.$set(
+                    _this.tableOrderDeatils[ind],
+                    "refundReasonList",
+                    _this.addRefundForm.items[ind2].refundReasonList
+                  );
+
+                  goodsRefundAmount = goodsRefundAmount.plus(
+                    BigNumber(_this.addRefundForm.items[ind2].refundAmount)
+                  );
+                  //已退数量 = 总退数量-当前单的数量
+                  //_this.tableOrderDeatils[ind].refundQuantity = dcmSub(_this.tableOrderDeatils[ind].refundQuantity, _this.addRefundForm.items[ind2].quantity);
+
+                  _this.$set(
+                    _this.tableOrderDeatils[ind],
+                    "refundQuantity",
+                    dcmSub(
+                      _this.tableOrderDeatils[ind].refundQuantity,
+                      _this.addRefundForm.items[ind2].quantity
+                    )
+                  );
+
+                  _this.$set(_this.tableOrderDeatils[ind], "selectedRow", 1);
+
+                  _this.$set(
+                    _this.tableOrderDeatils[ind],
+                    "refundItemId",
+                    _this.addRefundForm.items[ind2].id
+                  );
+                  break;
+                }
+              }
+            }
+            //退商品金额计算一下
+            this.refundAmount = goodsRefundAmount.toFixed(2);
+
+            this.$nextTick(() => {
+              this.tableOrderDeatils.forEach(row => {
+                if (row.selectedRow == 1) {
+                  this.$refs.multipleTable.toggleRowSelection(row, true);
+                } else {
+                  //											row.oldQuantity = row.quantity;
+                  //											var fee=row.totalFee;
+                  //											if(fee==null||fee==""){
+                  //												fee=0;
+                  //											}
+                  //											this.$set(row, "refundAmount", fee)
+                  //											if(row.refundQuantity == null) {
+                  //												row.refundQuantity = 0;
+                  //											}
+                }
+              });
+            });
+          }
+          this.listLoading = false;
+        }
+      });
+    },
+    getCustopen(id, arr) {
+      let customOpen = "";
+      if (id) {
+        arr.forEach(item => {
+          if (item.id == id) {
+            customOpen = item.custom;
+          }
+        });
+      }
+      return customOpen;
+    },
+    refundChange(id, arr) {
+      if (id) {
+        arr.refundReasonList.forEach(item => {
+          if (item.id == id) {
+            arr.customOpen = item.custom;
+            if (arr.customOpen && arr.customOpen != 1) {
+              arr.otherReason = "";
+            }
+          }
+        });
+      } else {
+        arr.customOpen = "";
+      }
+    },
+    chooseReason(id, arr) {
+      if (id) {
+        arr.forEach(item => {
+          if (item.id == id) {
+            this.otherReasonFlag = item.custom;
+          }
+        });
+      } else {
+        this.otherReasonFlag = "";
+      }
+
+      if (this.multipleSelection && this.multipleSelection.length > 0) {
+        for (let uy in this.multipleSelection) {
+          var row = this.multipleSelection[uy];
+          row.refundReason = String(id);
+          row.customOpen = this.otherReasonFlag;
+          if (row.customOpen != 1) {
+            row.otherReason = "";
+          }
+        }
+      }
+    },
+
+    writeReason(otherReason) {
+      if (this.multipleSelection && this.multipleSelection.length > 0) {
+        for (let uy in this.multipleSelection) {
+          var row = this.multipleSelection[uy];
+          if (row.customOpen == 1) {
+            row.otherReason = otherReason;
+          }
+        }
+      }
+    },
+    handleSelectionChange(val) {
+      this.refundAmount = 0;
+      this.multipleSelection = val;
+      if (this.multipleSelection && this.multipleSelection.length > 0) {
+        for (let uy in this.multipleSelection) {
+          var row = this.multipleSelection[uy];
+          if(!row.refundAmount){
+            row.refundAmount = BigNumber(row.totalFee)
+            .div(BigNumber(row.oldQuantity))
+            .multipliedBy(BigNumber(row.quantity))
+            .multipliedBy(BigNumber(row.refundSales))
+            .toNumber()
+            .toFixed(2);
+          }
+        }
+      } else {
+        this.refundAmount = 0;
+        this.addRefundForm.refundAmount = this.refundAmount;
+      }
+      this.jisuan();
+    },
+    checkSelectable(row) {
+      //编辑场景,都不可选
+      // if (this.addRefundForm.id) {
+      //   return false;
+      // }
+
+      if (row.refundQuantity > 0) {
+        var refcount = dcmSub(row.oldQuantity, row.refundQuantity);
+        //发生退款
+        if (refcount <= 0 && this.refundType != "1") {
+          return false; //不可选择
+        }
+        row["maxq"] = refcount;
+      } else {
+        row["maxq"] = row.oldQuantity;
+      }
+
+      //未发货
+      if (
+        this.refundType == "2" &&
+        (row.status == "delivery" ||
+          row.status == "off" ||
+          row.status == "partdelivery")
+      ) {
+        return false; //不可选择
+      }
+      //退货退款
+      else if (
+        this.refundType == "3" &&
+        (row.status == "unchecked" ||
+          row.status == "check" ||
+          row.status == "undelivery")
+      ) {
+        return false; //不可选择
+      }
+      //仅退款
+      // else if (
+      //   this.refundType == "1" &&
+      //   (row.status == "unchecked" ||
+      //     row.status == "check" ||
+      //     row.status == "undelivery")
+      // ) {
+      //   return false; //不可选择
+      // }
+
+      return true;
+    },
+    //结算
+    jisuan() {
+      this.taxAndShippingAmount = BigNumber(this.addRefundForm.refundTaxAmount)
+        .plus(BigNumber(this.addRefundForm.refundPostageAmount))
+        .toNumber();
+      console.log(this.taxAndShippingAmount, "退运费和退税金额之和");
+
+      var refundAmount = BigNumber(0);
+      if (this.multipleSelection && this.multipleSelection.length > 0) {
+        for (let uy in this.multipleSelection) {
+          var row = this.multipleSelection[uy];
+          refundAmount = refundAmount.plus(BigNumber(row.refundAmount));
+        }
+        this.refundAmount = refundAmount.toNumber().toFixed(2);
+      }
+      console.log(this.refundAmount, "商品退款金额");
+      this.$set(this.addRefundForm, "refundAmount", this.refundAmount);
+      this.$set(
+        this.addRefundForm,
+        "refundTotalAmount",
+        refundAmount
+          .plus(BigNumber(this.taxAndShippingAmount))
+          .toNumber()
+          .toFixed(2)
+      );
+      console.log(this.addRefundForm.refundTotalAmount, "总退款金额");
+    },
+    //改变退款金额
+    refundAmountChange() {
+      //			  alert('点击触发');
+      this.jisuan();
+    },
+    //改变数量 当前行的价格按照选中的数量计算
+    changeQuantity(row) {
+      //当前行的退款金额
+      row.refundAmount = BigNumber(row.totalFee)
+        .div(BigNumber(row.oldQuantity))
+        .multipliedBy(BigNumber(row.quantity))
+        .multipliedBy(BigNumber(row.refundSales))
+        .toNumber()
+        .toFixed(2);
+      console.log("当前行可退金额", row.refundAmount);
+      this.jisuan();
+    },
+    submit() {
+      // this.addRefundForm.ormorder = this.orderInfo.ormorder;
+      // this.addRefundForm.ordersNo = this.orderInfo.ordersId;
+      var items = [];
+      if (!this.addRefundForm.refundType) {
+        this.$message.error("请选择售后类型!");
+        return false;
+      }
+      //    	if(!this.addRefundForm.refundAmount){
+      //    		 this.$message.error('请填写期望退款金额!');
+      //    		 return false;
+      //    	}
+      //    	if(!this.addRefundForm.refundMethod){
+      //    		 this.$message.error('请填写退款方式!');
+      //    		 return false;
+      //    	}
+      //    	if(!this.addRefundForm.buyerAlipayNo){
+      //    		 this.$message.error('请填写收款账户!');
+      //    		 return false;
+      //    	}
+      if (
+        this.addRefundForm.refundType == 3 &&
+        !this.addRefundForm.warehouseCode
+      ) {
+        this.$message.error("请选择收退货仓库!");
+        return false;
+      }
+      //    	if(this.addRefundForm.refundType==3&&!this.addRefundForm.shipmodeId){
+      //    		 this.$message.error('请填写退货物流公司编号!');
+      //    		 return false;
+      //    	}if(this.addRefundForm.refundType==3&&!this.addRefundForm.shippingNo){
+      //    		 this.$message.error('请填写退货物流单号!');
+      //    		 return false;
+      //    	}
+      //      console.log(this.refundType);
+      if (this.multipleSelection.length == 0) {
+        this.$message.error("请选择要退的货品!");
+        return false;
+      }
+      this.btnLoading = true;
+      this.$confirm(
+        "退款总计:" + this.addRefundForm.refundTotalAmount + ",是否确认?",
+        "提示",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }
+      )
+        .then(async () => {
+          for (let ind in this.multipleSelection) {
+            var obj = this.multipleSelection[ind];
+            if (!obj.refundReason) {
+              this.$alert(obj.ordersId + ":请选择退款原因");
+              this.btnLoading = false;
+              return;
+            }
+            var newobj = {
+              productName: obj.productName,
+              quantity: obj.quantity,
+              orderitemId: obj.orderitemId,
+              skuCode: obj.skuCode,
+              refundAmount: obj.refundAmount,
+              refundReason: obj.refundReason,
+              otherReason: obj.otherReason,
+              soOrdersId: obj.ordersId,
+              isGift: obj.isGift,
+              isPromotion: obj.isPromotion
+            };
+            items.push(newobj);
+          }
+
+          this.addRefundForm.items = items;
+          //这里默认客服发起
+          this.addRefundForm.originatorFlag = 1;
+          const saveRefund = () => {
+            saveRefundNew(this.addRefundForm).then(
+              res => {
+                if (200 == res.code) {
+                  this.$message({
+                    message: this.$t("optSuccess"),
+                    type: "success"
+                  });
+                  items = [];
+                  this.btnStyle = "display:none";
+                }
+              },
+              error => {
+                this.btnLoading = false;
+              }
+            );
+          };
+          const validPromotion = async () => {
+            // 校验是否包含促销赠品,不包含直接返回true
+            if (
+              !this.tableOrderDeatils.some(
+                item => item.isGift === "1" && item.isPromotion === 1
+              )
+            ) {
+              return true;
+            }
+            // TODO 解开注释请求校验
+            // 校验是否满足促销条件 满足返回true(不提示)
+            const {code, data} = await validPromotionReq(this.addRefundForm);
+            if (code === 200) {
+              return data.valid;
+            }
+            return false;
+          };
+          // TODO 存在赠品的订单,在客服创建未发货退款售后单时,需判断扣除已退款明细之后是否还满足促销条件,若不满足,需弹窗提示客服,由客服判断是否继续执行退款。
+          if (await validPromotion()) {
+            saveRefund();
+          } else {
+            const res = await this.$confirm(
+              "退款后订单将不满足促销条件,是否确认?",
+              "提示",
+              {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+              }
+            );
+            if (res === "confirm") {
+              saveRefund();
+            }
+          }
+        })
+        .catch(() => {
+          this.btnLoading = false;
+          this.$message({
+            type: "info",
+            message: "已取消操作"
+          });
+        });
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 806 - 0
src/views/oms/refund-old/components/orderRefundItemListTab.vue

@@ -0,0 +1,806 @@
+<template>
+  <div>
+    <div>
+      <el-select
+        v-if="this.multipleSelection && this.multipleSelection.length > 0"
+        v-model="refundReasonAss"
+        :placeholder="$t('place.selectCheckedRefundReasons')"
+        clearable
+        @change="chooseReason(refundReasonAss, refundReasonList)"
+      >
+        <el-option
+          v-for="status in this.refundReasonList"
+          :key="status.id"
+          :label="status.reasonContentChinese"
+          :value="String(status.id)"
+        >
+        </el-option>
+      </el-select>
+      <el-input
+        v-if="otherReasonFlag == '1'"
+        :placeholder="$t('place.enterReason')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="refundOtherReasonAss"
+        @change="writeReason(refundOtherReasonAss)"
+      />
+    </div>
+    <el-table
+      ref="multipleTable"
+      @selection-change="handleSelectionChange"
+      style="width: 100%;"
+      v-loading="listLoading"
+      key="0"
+      :data="tableOrderDeatils"
+      row-key="id"
+      stripe
+      border
+      fit
+      highlight-current-row
+    >
+      <el-table-column
+        type="selection"
+        width="55"
+        :selectable="checkSelectable"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('goodsCode')"
+        width="150"
+        align="center"
+        prop="skuCode"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('onlyCode')"
+        min-width="180"
+        align="center"
+        prop=""
+      >
+        <template slot-scope="scope">
+          <div
+            v-if="scope.row.uniqueCode"
+            v-for="(item, index) in scope.row.uniqueCode"
+          >
+            {{ item }}
+          </div>
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('goodsName')"
+        width="300"
+        align="center"
+        prop="productName"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.originalQuantity')"
+        width="160"
+        align="center"
+        prop="oldQuantity"
+      ></el-table-column>
+      <el-table-column
+        :label="$t('goodsPrice')"
+        width="80"
+        align="center"
+        prop="price"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('offerAmount')"
+        width="80"
+        align="center"
+        prop="discountFee"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('payAmount')"
+        width="80"
+        align="center"
+        prop="totalFee"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.refundPercentage')"
+        width="160"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <div v-if="multipleSelection.indexOf(scope.row) == -1">
+            <div>{{ scope.row.refundSales }}</div>
+          </div>
+          <div v-else>
+            <el-input-number
+              v-model="scope.row.refundSales"
+              @change="changeQuantity(scope.row)"
+              size="mini"
+              :min="0"
+              :max="1"
+              :step="0.01"
+              step-strictly
+            ></el-input-number>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.eligibleQuantity')"
+        width="160"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <div v-if="multipleSelection.indexOf(scope.row) == -1">
+            <div>{{ scope.row | quantityFilter }}</div>
+          </div>
+          <div v-else>
+            <el-input-number
+              :disabled="scope.row.selectedRow == 1 ? true : false"
+              v-model="scope.row.quantity"
+              @change="changeQuantity(scope.row)"
+              size="mini"
+              :min="0"
+              :max="scope.row.maxq"
+              :step="1"
+              step-strictly
+            ></el-input-number>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.refundedAmount')"
+        width="160"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <div v-if="multipleSelection.indexOf(scope.row) == -1">
+            <div>0</div>
+          </div>
+          <div v-else>
+            <el-input-number
+              v-model="scope.row.refundAmount"
+              size="mini"
+              @change="refundAmountChange"
+              :min="0.0"
+              :max="scope.row.totalFee"
+            ></el-input-number>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.refundReason')"
+        width="150"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <div v-if="multipleSelection.indexOf(scope.row) == -1"></div>
+          <div v-else>
+            <el-select
+              v-model="scope.row.refundReason"
+              :placeholder="$t('place.pleaseSelect')"
+              clearable
+              @change="refundChange(scope.row.refundReason, scope.row)"
+            >
+              <el-option
+                v-for="status in scope.row.refundReasonList"
+                :key="status.id"
+                :label="status.reasonContentChinese"
+                :value="String(status.id)"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.reasonExplanation')"
+        width="150"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <div v-if="multipleSelection.indexOf(scope.row) == -1"></div>
+          <div v-else>
+            <el-input
+              v-if="scope.row.customOpen == '1'"
+              :placeholder="$t('place.enterReason')"
+              clearable
+              style="width: 200px;"
+              class="filter-item"
+              v-model="scope.row.otherReason"
+            />
+          </div>
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.refundedQuantity')"
+        width="160"
+        align="center"
+        prop="refundQuantity"
+      ></el-table-column>
+
+      <el-table-column
+        :label="$t('status')"
+        width="80"
+        align="center"
+        prop="status"
+      >
+        <template slot-scope="scope">
+          {{ scope.row.status | statusFilter }}
+        </template>
+      </el-table-column>
+
+      <!--<el-table-column :label="$t('gifts')"  width="80" align="center" prop="">
+        </el-table-column>-->
+    </el-table>
+    <div class="box" style="width:100%;margin-top: 15px;float:right">
+      退款总计:{{ addRefundForm.refundTotalAmount }}
+    </div>
+    <div class="box" style="margin-top: 15px;float:right">
+      <!-- <el-button
+        :style="btnStyle"
+        v-if="!addRefundForm.id"
+        type="primary"
+        @click="submit(this)"
+        v-loading="btnLoading"
+        >{{ $t("save") }}</el-button
+      > -->
+      <el-button
+        :style="btnStyle"
+        v-if="addRefundForm.id"
+        type="primary"
+        @click="submitUpdate(this)"
+        v-loading="btnLoading"
+        >{{ $t("save") }}</el-button
+      >
+    </div>
+  </div>
+</template>
+
+<script>
+import {
+  statusKeyValue,
+  queryOrderDetails,
+  queryOrderDetailsByOrmorder
+} from "@/api/oms/order/order";
+import {
+  saveRefund,
+  getRefundInfo,
+  updateRefund
+} from "@/api/oms/refund/refund";
+import { dcmAdd, dcmSub, accDiv, accMul } from "@/utils/toolUtil";
+import { BigNumber } from "bignumber.js";
+export default {
+  name: "orderRefundItemListTab",
+  props: ["refundType", "addRefundForm"],
+  // props: ["orderDeatils", "orderInfo", "refundType", "addRefundForm"],
+  filters: {
+    statusFilter(key) {
+      return statusKeyValue[key];
+    },
+    quantityFilter(row) {
+      if (row.refundQuantity > 0) {
+        return dcmSub(row.oldQuantity, row.refundQuantity);
+      }
+      return row.oldQuantity;
+    }
+  },
+  data() {
+    return {
+      listLoading: false,
+      btnLoading: false,
+      multipleSelection: [],
+      btnStyle: "",
+      refundAmount: 0,
+      editOrderDeatils: [],
+      tableOrderDeatils: [],
+      taxAndShippingAmount: 0, //退税和退运费金额
+      refundReasonList: [],
+      refundReasonAss: "",
+      refundOtherReasonAss: "",
+      otherReasonFlag: ""
+    };
+  },
+  created() {
+    this.init();
+  },
+  methods: {
+    //加载
+    init() {
+      let _this = this;
+      //如果是修改的
+      this.refundReasonAss = "";
+      this.refundOtherReasonAss = "";
+      if (this.addRefundForm.id) {
+        _this.editOrderDeatils = [];
+        //查询订单详情
+        var params = {
+          ormorder: _this.addRefundForm.ormorder,
+          refundType: _this.addRefundForm.refundType,
+          storeId: _this.addRefundForm.storeId,
+        };
+        this.listLoading = true;
+        queryOrderDetailsByOrmorder(params).then(res2 => {
+          if (200 == res2.code) {
+            //修改退款申请,订单项列表
+            _this.tableOrderDeatils = res2.data;
+            console.log(JSON.stringify(res2.data), "查询到的订单明细");
+
+            let goodsRefundAmount = BigNumber(0);
+            this.refundReasonList = _this.addRefundForm.refundReasonList;
+            if (_this.tableOrderDeatils) {
+              for (let ind in _this.tableOrderDeatils) {
+                _this.tableOrderDeatils[ind].oldQuantity =
+                  _this.tableOrderDeatils[ind].quantity;
+
+                for (let ind2 in _this.addRefundForm.items) {
+                  //明细属于当前退款单
+                  if (
+                    _this.addRefundForm.items[ind2].orderitemId ==
+                    _this.tableOrderDeatils[ind].orderitemId
+                  ) {
+                    //退款金额
+                    //_this.tableOrderDeatils[ind].refundAmount=_this.addRefundForm.items[ind2].refundAmount;
+
+                    _this.$set(
+                      _this.tableOrderDeatils[ind],
+                      "refundAmount",
+                      _this.addRefundForm.items[ind2].refundAmount
+                    );
+                    
+                    //退款原因
+                    _this.$set(
+                      _this.tableOrderDeatils[ind],
+                      "refundReason",
+                      _this.addRefundForm.items[ind2].refundReason
+                    );
+
+                    _this.$set(
+                      _this.tableOrderDeatils[ind],
+                      "customOpen",
+                      this.getCustopen(
+                        _this.tableOrderDeatils[ind].refundReason,
+                        _this.addRefundForm.items[ind2].refundReasonList
+                      )
+                    );
+                    //其他原因
+                    _this.$set(
+                      _this.tableOrderDeatils[ind],
+                      "otherReason",
+                      _this.addRefundForm.items[ind2].otherReason
+                    );
+
+                    //计算
+
+                    _this.$set(
+                      _this.tableOrderDeatils[ind],
+                      "refundReasonList",
+                      _this.addRefundForm.items[ind2].refundReasonList
+                    );
+
+                    goodsRefundAmount = goodsRefundAmount.plus(
+                      BigNumber(_this.addRefundForm.items[ind2].refundAmount)
+                    );
+                    //已退数量 = 总退数量-当前单的数量
+                    // _this.tableOrderDeatils[ind].refundQuantity = dcmSub(_this.tableOrderDeatils[ind].refundQuantity, _this.addRefundForm.items[ind2].quantity);
+
+                    _this.$set(
+                      _this.tableOrderDeatils[ind],
+                      "quantity",
+                      _this.addRefundForm.items[ind2].quantity
+                    );
+
+                    _this.$set(
+                      _this.tableOrderDeatils[ind],
+                      "refundQuantity",
+                      dcmSub(
+                        _this.tableOrderDeatils[ind].refundQuantity,
+                        _this.addRefundForm.items[ind2].quantity
+                      )
+                    );
+
+                    _this.$set(_this.tableOrderDeatils[ind], "selectedRow", 1);
+
+                    _this.$set(
+                      _this.tableOrderDeatils[ind],
+                      "refundItemId",
+                      _this.addRefundForm.items[ind2].id
+                    );
+                    break;
+                  }
+                }
+              }
+              //退商品金额计算一下
+              this.refundAmount = goodsRefundAmount.toFixed(2);
+
+              this.$nextTick(() => {
+                this.tableOrderDeatils.forEach(row => {
+                  if (row.selectedRow == 1) {
+                    this.$refs.multipleTable.toggleRowSelection(row, true);
+
+                    console.log(row, "回显的明细");
+                  } else {
+                    //											row.oldQuantity = row.quantity;
+                    //											var fee=row.totalFee;
+                    //											if(fee==null||fee==""){
+                    //												fee=0;
+                    //											}
+                    //											this.$set(row, "refundAmount", fee)
+                    //											if(row.refundQuantity == null) {
+                    //												row.refundQuantity = 0;
+                    //											}
+                  }
+                });
+              });
+            }
+          }
+          this.listLoading = false;
+        });
+      } else {
+        this.tableOrderDeatils = this.orderDeatils;
+      }
+    },
+    getCustopen(id, arr) {
+      let customOpen = "";
+      if (id) {
+        arr.forEach(item => {
+          if (item.id == id) {
+            customOpen = item.custom;
+          }
+        });
+      }
+      return customOpen;
+    },
+    refundChange(id, arr) {
+      if (id) {
+        arr.refundReasonList.forEach(item => {
+          if (item.id == id) {
+            arr.customOpen = item.custom;
+            if (arr.customOpen && arr.customOpen != 1) {
+              arr.otherReason = "";
+            }
+          }
+        });
+      } else {
+        arr.customOpen = "";
+      }
+    },
+    chooseReason(id, arr) {
+      if (id) {
+        arr.forEach(item => {
+          if (item.id == id) {
+            this.otherReasonFlag = item.custom;
+          }
+        });
+      } else {
+        this.otherReasonFlag = "";
+      }
+
+      if (this.multipleSelection && this.multipleSelection.length > 0) {
+        for (let uy in this.multipleSelection) {
+          var row = this.multipleSelection[uy];
+          row.refundReason = String(id);
+          row.customOpen = this.otherReasonFlag;
+          if (row.customOpen != 1) {
+            row.otherReason = "";
+          }
+        }
+      }
+    },
+
+    writeReason(otherReason) {
+      if (this.multipleSelection && this.multipleSelection.length > 0) {
+        for (let uy in this.multipleSelection) {
+          var row = this.multipleSelection[uy];
+          if (row.customOpen == 1) {
+            row.otherReason = otherReason;
+          }
+        }
+      }
+    },
+    handleSelectionChange(val) {
+      this.refundAmount = 0;
+      this.multipleSelection = val;
+      if (this.multipleSelection && this.multipleSelection.length > 0) {
+        for (let uy in this.multipleSelection) {
+          var row = this.multipleSelection[uy];
+          if(!row.refundAmount){
+            row.refundAmount = BigNumber(row.totalFee)
+            .div(BigNumber(row.oldQuantity))
+            .multipliedBy(BigNumber(row.quantity))
+            .multipliedBy(BigNumber(row.refundSales))
+            .toNumber()
+            .toFixed(2);
+          }
+          
+        }
+      } else {
+        this.refundAmount = 0;
+        this.addRefundForm.refundAmount = this.refundAmount;
+      }
+      this.jisuan();
+    },
+    checkSelectable(row) {
+      //编辑场景,都不可选
+      if (this.addRefundForm.id) {
+        return false;
+      }
+
+      if (row.refundQuantity > 0) {
+        var refcount = dcmSub(row.oldQuantity, row.refundQuantity);
+        //发生退款
+        if (refcount <= 0 && this.refundType != "1") {
+          return false; //不可选择
+        }
+        row["maxq"] = refcount;
+      } else {
+        row["maxq"] = row.oldQuantity;
+      }
+
+      //未发货
+      if (
+        this.refundType == "2" &&
+        (row.status == "delivery" ||
+          row.status == "off" ||
+          row.status == "partdelivery")
+      ) {
+        return false; //不可选择
+      }
+      //退货退款
+      else if (
+        this.refundType == "3" &&
+        (row.status == "unchecked" ||
+          row.status == "check" ||
+          row.status == "undelivery")
+      ) {
+        return false; //不可选择
+      }
+      //仅退款
+      // else if (
+      //   this.refundType == "1" &&
+      //   (row.status == "unchecked" ||
+      //     row.status == "check" ||
+      //     row.status == "undelivery")
+      // ) {
+      //   return false; //不可选择
+      // }
+
+      return true;
+    },
+    //结算
+    jisuan() {
+      this.taxAndShippingAmount = BigNumber(this.addRefundForm.refundTaxAmount)
+        .plus(BigNumber(this.addRefundForm.refundPostageAmount))
+        .toNumber();
+      console.log(this.taxAndShippingAmount, "退运费和退税金额之和");
+
+      var refundAmount = BigNumber(0);
+      if (this.multipleSelection && this.multipleSelection.length > 0) {
+        for (let uy in this.multipleSelection) {
+          var row = this.multipleSelection[uy];
+          refundAmount = refundAmount.plus(BigNumber(row.refundAmount));
+        }
+        this.refundAmount = refundAmount.toNumber().toFixed(2);
+      }
+      console.log(this.refundAmount, "商品退款金额");
+      this.$set(this.addRefundForm, "refundAmount", this.refundAmount);
+      this.$set(
+        this.addRefundForm,
+        "refundTotalAmount",
+        refundAmount
+          .plus(BigNumber(this.taxAndShippingAmount))
+          .toNumber()
+          .toFixed(2)
+      );
+      console.log(this.addRefundForm.refundTotalAmount, "总退款金额");
+    },
+    //改变退款金额
+    refundAmountChange() {
+      //			  alert('点击触发');
+      this.jisuan();
+    },
+    //改变数量 当前行的价格按照选中的数量计算
+    changeQuantity(row) {
+      //当前行的退款金额
+      row.refundAmount = BigNumber(row.totalFee)
+        .div(BigNumber(row.oldQuantity))
+        .multipliedBy(BigNumber(row.quantity))
+        .multipliedBy(BigNumber(row.refundSales))
+        .toNumber()
+        .toFixed(2);
+      console.log("当前行可退金额", row.refundAmount);
+      this.jisuan();
+    },
+    //     submit() {
+    //       this.addRefundForm.ormorder = this.orderInfo.ormorder;
+    //       this.addRefundForm.ordersNo = this.orderInfo.ordersId;
+    //       var items = [];
+    //       if (!this.addRefundForm.refundType) {
+    //         this.$message.error("请选择售后类型!");
+    //         return false;
+    //       }
+    //       //    	if(!this.addRefundForm.refundAmount){
+    //       //    		 this.$message.error('请填写期望退款金额!');
+    //       //    		 return false;
+    //       //    	}
+    //       //    	if(!this.addRefundForm.refundMethod){
+    //       //    		 this.$message.error('请填写退款方式!');
+    //       //    		 return false;
+    //       //    	}
+    //       //    	if(!this.addRefundForm.buyerAlipayNo){
+    //       //    		 this.$message.error('请填写收款账户!');
+    //       //    		 return false;
+    //       //    	}
+    //       if (
+    //         this.addRefundForm.refundType == 3 &&
+    //         !this.addRefundForm.warehouseCode
+    //       ) {
+    //         this.$message.error("请选择收退货仓库!");
+    //         return false;
+    //       }
+    //       //    	if(this.addRefundForm.refundType==3&&!this.addRefundForm.shipmodeId){
+    //       //    		 this.$message.error('请填写退货物流公司编号!');
+    //       //    		 return false;
+    //       //    	}if(this.addRefundForm.refundType==3&&!this.addRefundForm.shippingNo){
+    //       //    		 this.$message.error('请填写退货物流单号!');
+    //       //    		 return false;
+    //       //    	}
+    // //      console.log(this.refundType);
+    //       if (this.multipleSelection.length == 0) {
+    //         this.$message.error("请选择要退的货品!");
+    //         return false;
+    //       }
+    //       this.btnLoading = true;
+    //       this.$confirm(
+    //         "退款总计:" + this.addRefundForm.refundTotalAmount + ",是否确认?",
+    //         "提示",
+    //         {
+    //           confirmButtonText: "确定",
+    //           cancelButtonText: "取消",
+    //           type: "warning"
+    //         }
+    //       )
+    //         .then(() => {
+    //           for (let ind in this.multipleSelection) {
+    //             var obj = this.multipleSelection[ind];
+    //             var newobj = {
+    //               productName: obj.productName,
+    //               quantity: obj.quantity,
+    //               orderitemId: obj.orderitemId,
+    //               skuCode: obj.skuCode,
+    //               refundAmount: obj.refundAmount,
+    //               refundReason: obj.refundReason,
+    //               otherReason: obj.otherReason
+    //             };
+    //             items.push(newobj);
+    //           }
+    //           this.addRefundForm.items = items;
+    //           saveRefund(this.addRefundForm).then(
+    //             res => {
+    //               if (200 == res.code) {
+    //                 this.$message({
+    //                   message: this.$t("optSuccess"),
+    //                   type: "success"
+    //                 });
+    //                 items = [];
+    //                 this.btnStyle = "display:none";
+    //               }
+    //             },
+    //             error => {
+    //               this.btnLoading = false;
+    //             }
+    //           );
+    //         })
+    //         .catch(() => {
+    //           this.btnLoading = false;
+    //           this.$message({
+    //             type: "info",
+    //             message: "已取消操作"
+    //           });
+    //         });
+    //     },
+
+    submitUpdate() {
+      // this.addRefundForm.ormorder = this.orderInfo.ormorder;
+      // this.addRefundForm.ordersNo = this.orderInfo.ordersId;
+      var items = [];
+      if (!this.addRefundForm.refundType) {
+        this.$message.error("请选择售后类型!");
+        return false;
+      }
+      //    	if(!this.addRefundForm.refundAmount){
+      //    		 this.$message.error('请填写期望退款金额!');
+      //    		 return false;
+      //    	}
+      //    	if(!this.addRefundForm.refundMethod){
+      //    		 this.$message.error('请填写退款方式!');
+      //    		 return false;
+      //    	}
+      //    	if(!this.addRefundForm.buyerAlipayNo){
+      //    		 this.$message.error('请填写收款账户!');
+      //    		 return false;
+      //    	}
+      if (
+        this.addRefundForm.refundType == 3 &&
+        !this.addRefundForm.warehouseCode
+      ) {
+        this.$message.error("请选择收退货仓库!");
+        return false;
+      }
+      //    	if(this.addRefundForm.refundType==3&&!this.addRefundForm.shipmodeId){
+      //    		 this.$message.error('请填写退货物流公司编号!');
+      //    		 return false;
+      //    	}if(this.addRefundForm.refundType==3&&!this.addRefundForm.shippingNo){
+      //    		 this.$message.error('请填写退货物流单号!');
+      //    		 return false;
+      //    	}
+      if (this.refundType != 1 && this.multipleSelection.length == 0) {
+        this.$message.error("请选择要退的货品!");
+        return false;
+      }
+      this.btnLoading = true;
+      this.$confirm(
+        "退款总计:" + this.addRefundForm.refundTotalAmount + ",是否确认?",
+        "提示",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }
+      )
+        .then(() => {
+          for (let ind in this.multipleSelection) {
+            var obj = this.multipleSelection[ind];
+            if(!obj.refundReason){
+              this.$alert(obj.ordersId+":请选择退款原因");
+              this.btnLoading = false;
+              return;
+            }
+            var newobj = {
+              productName: obj.productName,
+              quantity: obj.quantity,
+              orderitemId: obj.orderitemId,
+              skuCode: obj.skuCode,
+              refundAmount: obj.refundAmount,
+              id: obj.refundItemId,
+              refundReason: obj.refundReason,
+              otherReason: obj.otherReason,
+              soOrdersId: obj.ordersId
+            };
+            items.push(newobj);
+          }
+          this.addRefundForm.items = items;
+          updateRefund(this.addRefundForm).then(
+            res => {
+              if (200 == res.code) {
+                this.$message({
+                  message: this.$t("optSuccess"),
+                  type: "success"
+                });
+                items = [];
+                this.btnStyle = "display:none";
+              }
+            },
+            error => {
+              this.btnLoading = false;
+            }
+          );
+        })
+        .catch(() => {
+          this.btnLoading = false;
+          this.$message({
+            type: "info",
+            message: "已取消操作"
+          });
+        });
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 915 - 0
src/views/oms/refund-old/components/orderRefundNewDialog.vue

@@ -0,0 +1,915 @@
+<template>
+  <div v-loading.fullscreen.lock="detailLoading">
+    <div class="head">
+      <!--		<span>销售单详情</span>
+ 			<span>返回</span>
+ -->
+    </div>
+    <div class="main">
+      <!-- <div class="box" style="margin-top: 15px;">
+				<div class="item_title">
+					<span>基本信息</span>
+				</div>
+				<div class="ptitle">
+					<baseInfoTab :orderInfo="orderInfo"></baseInfoTab>
+				</div>
+			</div> -->
+
+      <div class="box" style="margin-top: 15px;">
+        <div class="item_title">
+          <span>{{ $t("view.shippingInfo") }}</span>
+        </div>
+        <div class="ptitle">
+          <!-- <receivingInfoTab :addressInfo="addressInfo" :orderInfo="orderInfo"></receivingInfoTab> -->
+          <template>
+            <el-descriptions
+              class="margin-top"
+              :title="$t('title.addressInfo')"
+              :column="4"
+              direction="horizontal"
+              v-if="addressInfo.length == 1"
+            >
+              <el-descriptions-item :label="$t('country')">{{
+                addressInfo[0].receiverCountryCode
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('label.postalCode')">{{
+                addressInfo[0].receiverZip
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('state')">{{
+                addressInfo[0].receiverState
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('city')">{{
+                addressInfo[0].receiverCity
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('suburb')">{{
+                addressInfo[0].receiverDistrict
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('street')">{{
+                addressInfo[0].receiverStreet
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('address')">{{
+                addressInfo[0].receiverAddress
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('dooeNo')">{{
+                addressInfo[0].receiverAddress2
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('recipient')">{{
+                addressInfo[0].receiverName
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('telephone')">{{
+                addressInfo[0].receiverPhone
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('moPhone')">{{
+                addressInfo[0].receiverMobile
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('post')">{{
+                addressInfo[0].email
+              }}</el-descriptions-item>
+              <el-descriptions-item :label="$t('label.shippingFee')">{{
+                addressInfo[0].freight
+              }}</el-descriptions-item>
+            </el-descriptions>
+
+            <div class="container" width="500px" v-if="addressInfo.length > 1">
+              <div
+                v-for="(item, index) in addressInfo"
+                :key="index"
+                width="100px"
+                margin-right="50px"
+              >
+                <el-popover
+                  placement="top"
+                  :title="$t('title.addressInfo')"
+                  width="300"
+                  offset="300"
+                  trigger="hover"
+                >
+                  <el-descriptions
+                    class="margin-top"
+                    title=""
+                    :column="1"
+                    direction="horizontal"
+                  >
+                    <el-descriptions-item :label="$t('country')">{{
+                      item.receiverCountryCode
+                    }}</el-descriptions-item>
+                    <el-descriptions-item :label="$t('address')">{{
+                      item.receiverAddress
+                    }}</el-descriptions-item>
+                    <el-descriptions-item :label="$t('recipient')">{{
+                      item.receiverName
+                    }}</el-descriptions-item>
+                    <el-descriptions-item :label="$t('post')">{{
+                      item.email
+                    }}</el-descriptions-item>
+                    <el-descriptions-item :label="$t('label.shippingFee')">{{
+                      item.freight
+                    }}</el-descriptions-item>
+                  </el-descriptions>
+                  <el-button
+                    slot="reference"
+                    @click="changeRefund(item.idList)"
+                    >{{ item.receiverCountryCode }}</el-button
+                  >
+                </el-popover>
+              </div>
+            </div>
+          </template>
+        </div>
+      </div>
+
+      <div
+        class="box"
+        style="margin-top: 15px;padding-bottom: 10px;"
+        v-if="invoiceInfo != null"
+      >
+        <div class="item_title">
+          <span>{{ $t("view.invoiceDetails") }}</span>
+        </div>
+        <div class="ptitle">
+          <invoiceInfoTab :invoiceInfo="invoiceInfo"></invoiceInfoTab>
+        </div>
+      </div>
+
+      <div
+        class="box"
+        style="margin-top: 15px;padding-bottom: 10px;"
+        v-loading="fromLoading"
+      >
+        <div class="item_title">
+          <span>{{ $t("view.refundInfo") }}</span>
+        </div>
+        <div class="ptitle">
+          <el-form
+            ref="addRefundForm"
+            :model="addRefundForm"
+            label-width="auto"
+          >
+            <el-form-item :label="$t('currency')">
+              <el-input
+                disabled
+                v-model="addRefundForm.currency"
+                placeholder
+                class="normal-input"
+              ></el-input>
+            </el-form-item>
+            <el-form-item :label="$t('label.afterSalesType')" required>
+              <el-select
+                :placeholder="$t('place.pleaseSelect')"
+                @change="changeRefund(null)"
+                clearable
+                style="width: 200px;"
+                class="filter-item"
+                v-model="addRefundForm.refundType"
+              >
+                <el-option
+                  v-for="afterSaleType in afterSaleTypes"
+                  :disabled="afterSaleType.disabled"
+                  :key="afterSaleType.value"
+                  :label="$t(afterSaleType.label)"
+                  :value="afterSaleType.value"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item :label="$t('label.expectedRefundAmount')" required>
+              <el-input
+                v-model="addRefundForm.refundTotalAmount"
+                :disabled="true"
+              />
+            </el-form-item>
+            <el-form-item :label="$t('label.refundMethod')" required="">
+              <!-- <el-input  v-model="addRefundForm.refundMethod" :placeholder="$t('place.pleaseFillIn')" class="normal-input"></el-input> -->
+              <el-radio-group v-model="addRefundForm.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="addRefundForm.refundMethod == 'manual'"
+              :label="$t('label.accountType')"
+              required=""
+            >
+              <el-radio-group v-model="addRefundForm.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
+              :label="$t('label.receivingAccount')"
+              v-if="
+                addRefundForm.refundMethod == 'manual' &&
+                  addRefundForm.refundAccountType == 'PayPal'
+              "
+              required
+            >
+              <el-input
+                v-model="addRefundForm.refundAccount"
+                :placeholder="$t('place.pleaseFillIn')"
+                class="normal-input"
+              ></el-input>
+            </el-form-item>
+            <!-- 选择是否退税-->
+            <el-form-item
+              v-if="addRefundForm.refundType"
+              :label="$t('label.taxRefund')"
+            >
+              <el-radio-group
+                v-model="addRefundForm.refundTaxAble"
+                @change="calculateRefundAmount"
+              >
+                <el-radio label="0">{{ $t("view.noTaxRefund") }}</el-radio>
+                <el-radio label="1">{{ $t("view.taxRefund") }}</el-radio>
+              </el-radio-group>
+            </el-form-item>
+            <el-form-item
+              v-if="addRefundForm.refundTaxAble == 1"
+              :label="$t('label.taxRefundAmount')"
+            >
+              <el-input-number
+                v-model="addRefundForm.refundTaxAmount"
+                :min="0.0"
+                :step="0.01"
+                step-strictly
+                @change="calculateRefundAmount"
+              ></el-input-number>
+            </el-form-item>
+            <!-- 选择是否退运费-->
+            <el-form-item
+              v-if="addRefundForm.refundType"
+              :label="$t('label.shippingFee')"
+            >
+              <el-radio-group
+                v-model="addRefundForm.refundPostage"
+                @change="calculateRefundAmount"
+              >
+                <el-radio label="0">{{ $t("view.noRefund") }}</el-radio>
+                <el-radio label="1">{{
+                  $t("view.refundShippingFee")
+                }}</el-radio>
+              </el-radio-group>
+            </el-form-item>
+            <el-form-item
+              v-if="addRefundForm.refundPostage == 1"
+              :label="$t('label.returnShippingFeeAmount')"
+            >
+              <el-input-number
+                v-model="addRefundForm.refundPostageAmount"
+                :min="0.0"
+                :step="0.01"
+                step-strictly
+                @change="calculateRefundAmount"
+              ></el-input-number>
+            </el-form-item>
+            <!-- <el-form-item v-if="addRefundForm.refundType==3" :label="$t('label.receivingReturnWarehouse')"> -->
+            <!-- <el-select :placeholder="$t('place.pleaseSelect')" clearable style="width: 200px;" class="filter-item" v-model="addRefundForm.warehouseCode"> -->
+            <!-- <el-option v-for="item in warehouseItems" :key="item.key" :label="item.key" :value="item.value"></el-option> -->
+            <!-- </el-select> -->
+            <!-- </el-form-item> -->
+            <el-form-item
+              v-if="addRefundForm.refundType == 3"
+              :label="$t('label.receivingReturnWarehouse')"
+            >
+              <el-select
+                :placeholder="$t('place.pleaseSelect')"
+                clearable
+                style="width: 200px;"
+                class="filter-item"
+                v-model="addRefundForm.warehouseCode"
+                @change="ShippingLabelOption"
+              >
+                <el-option
+                  v-for="item in warehouseItems"
+                  :key="item.key"
+                  :label="item.key"
+                  :value="item.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+
+            <!-- TODO 暂时关闭SL -->
+            <el-form-item
+              v-if="addRefundForm.warehouseCode=='PSJ-G001001' ||
+              addRefundForm.warehouseCode=='PSJ-G001003' ||
+              addRefundForm.warehouseCode=='PSJ-H0000019'||
+              addRefundForm.warehouseCode=='PSJ-H0000011'||
+              addRefundForm.warehouseCode=='PSJ-H0000024'||
+              addRefundForm.warehouseCode=='PSJ-G001004'"
+              label="ShippingLabel"
+            >
+              <el-radio-group v-model="addRefundForm.slUseable" @change="changeSlradio()">
+                <el-radio label="0" value="0">{{
+                  $t("view.notEnabled")
+                }}</el-radio>
+                <el-radio label="1" value="1">{{
+                  $t("view.enabled")
+                }}</el-radio>
+              </el-radio-group>
+            </el-form-item>
+
+            <el-form-item
+              v-if="
+                addRefundForm.refundType == 3 && addRefundForm.slUseable == '1'
+              "
+              :label="$t('label.returnLogisticsCompanyCode')"
+            >
+              <el-input
+                v-model="addRefundForm.shipmodeId"
+                disabled
+                :placeholder="$t('place.pleaseFillIn')"
+                class="normal-input"
+              ></el-input>
+            </el-form-item>
+            <el-form-item
+              v-if="
+                addRefundForm.refundType == 3 && addRefundForm.slUseable == '1'
+              "
+              :label="$t('label.returnLogisticsNumber')"
+            >
+              <el-input
+                v-model="addRefundForm.shippingNo"
+                disabled
+                :placeholder="$t('place.pleaseFillIn')"
+                class="normal-input"
+              ></el-input>
+            </el-form-item>
+
+            <el-form-item
+              v-if="
+                addRefundForm.refundType == 3 && addRefundForm.slUseable == '0'
+              "
+              :label="$t('label.returnLogisticsCompanyCode')"
+            >
+              <el-input
+                v-model="addRefundForm.shipmodeId"
+                :placeholder="$t('place.pleaseFillIn')"
+                class="normal-input"
+              ></el-input>
+            </el-form-item>
+            <el-form-item
+              v-if="
+                addRefundForm.refundType == 3 && addRefundForm.slUseable == '0'
+              "
+              :label="$t('label.returnLogisticsNumber')"
+            >
+              <el-input
+                v-model="addRefundForm.shippingNo"
+                :placeholder="$t('place.pleaseFillIn')"
+                class="normal-input"
+              ></el-input>
+            </el-form-item>
+            <!-- <el-form-item v-if="addRefundForm.refundType==1" clearable :label="$t('label.refundReason')">
+              <el-select  :placeholder="$t('place.pleaseSelect')" clearable v-model="addRefundForm.refundReason" class="filter-item"  @change="refundChange(allReason,addRefundForm.refundReason)">
+                <el-option v-for="status in allReason"
+                           v-if="status.reasonType=='1'"
+                           :key="status.id"
+                           :label="status.reasonContentChinese"
+                           :value="status.id">
+                </el-option>
+              </el-select>
+            </el-form-item> -->
+            <!-- <el-form-item v-if="addRefundForm.refundType==2" clearable :label="$t('label.refundReason')" >
+              <el-select  :placeholder="$t('place.pleaseSelect')" clearable v-model="addRefundForm.refundReason" class="filter-item"  @change="refundChange(allReason,addRefundForm.refundReason)">
+                <el-option v-for="status in allReason"
+                           v-if="status.reasonType=='2'"
+                           :key="status.id"
+                           :label="status.reasonContentChinese"
+                           :value="status.id">
+                </el-option>
+              </el-select>
+            </el-form-item> -->
+            <!-- <el-form-item v-if="addRefundForm.refundType==3" clearable :label="$t('label.refundReason')">
+              <el-select  :placeholder="$t('place.pleaseSelect')" clearable v-model="addRefundForm.refundReason" class="filter-item" @change="refundChange(allReason,addRefundForm.refundReason)">
+                <el-option v-for="status in allReason"
+                           v-if="status.reasonType=='3'"
+                           :key="status.id"
+                           :label="status.reasonContentChinese"
+                           :value="status.id">
+                </el-option>
+              </el-select>
+            </el-form-item> -->
+            <!-- <el-form-item v-if="customOpen=='1'" :label="$t('label.reasonExplanation')">
+              <el-input type="textarea" :placeholder="$t('place.enterReason')" v-model="addRefundForm.otherReason" style="width: 200px;" :rows="3"></el-input>
+            </el-form-item> -->
+
+            <el-form-item :label="$t('label.afterSalesInstructions')">
+              <el-input
+                type="textarea"
+                :placeholder="$t('place.enterContent')"
+                v-model="addRefundForm.notes"
+                maxlength="150"
+                show-word-limit
+              >
+              </el-input>
+            </el-form-item>
+            <el-form-item :label="$t('label.uploadVoucher')">
+              <el-upload
+                class="avatar-uploader"
+                :action="uploadPhotos"
+                :show-file-list="false"
+                :on-success="handleAvatarSuccess"
+                :before-upload="beforeAvatarUpload"
+                :headers="headers"
+              >
+                <img v-if="imageUrl" :src="imageUrl" class="avatar" />
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+              </el-upload>
+            </el-form-item>
+          </el-form>
+        </div>
+      </div>
+
+      <div class="box" style="margin-top: 15px;" v-if="refundType">
+        <div class="item_title">
+          <span>{{ $t("view.selectItems") }}</span>
+        </div>
+        <div class="ptitle">
+          <orderRefundItemListNewTab
+            v-if="refundType"
+            :addRefundForm="addRefundForm"
+            :refundType="addRefundForm.refundType"
+          ></orderRefundItemListNewTab>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import {
+  getById,
+  queryOrderDetails,
+  getAllReason,
+  getDetailListForRefund
+} from "@/api/oms/order/order";
+import { queryByOrdersId as getAddress } from "@/api/oms/order/address";
+import { getById as getInvoice } from "@/api/oms/order/invoice";
+import global from "@/views/oms/global";
+import baseInfoTab from "@/views/oms/order/components/baseInfoTab";
+import invoiceInfoTab from "@/views/oms/order/components/invoiceInfoTab";
+import optLogTab from "@/views/oms/order/components/optLogTab";
+import orderRefundItemListNewTab from "./orderRefundItemListNewTab";
+import receivingInfoTab from "@/views/oms/order/components/receivingInfoTab";
+import {
+  warehouseList,
+  getNewRefundInfo,
+  getDetailListByRefundId
+} from "@/api/oms/refund/refund";
+import { getToken } from "@/utils/auth";
+import { dcmAdd, dcmSub, accDiv, accMul } from "@/utils/toolUtil";
+import { BigNumber } from "bignumber.js";
+export default {
+  name: "orderRefundNewDialog",
+  props: ["refundId"],
+  components: {
+    baseInfoTab,
+    invoiceInfoTab,
+    optLogTab,
+    orderRefundItemListNewTab,
+    receivingInfoTab
+  },
+  data() {
+    return {
+      orderInfo: {},
+      addressInfo: {},
+      orderDeatils: [],
+      invoiceInfo: null,
+      detailLoading: false,
+      imageUrl: "",
+      allReason: {},
+      customOpen: "",
+      listQuery: {
+        ormorder: null,
+        shopify: null,
+        refundType: null,
+        idList: null
+      },
+      addRefundForm: {
+        refundMethod: "system",
+        refundPostage: "0",
+        refundAmount: 0.0, //商品退款金额
+        refundPostageAmount: 0.0,
+        warehouseCode: "",
+        annexPath: "",
+        items: [],
+        oldQuantity: 0,
+        refundTaxAble: "0", //是否退税
+        refundTaxAmount: 0.0, //退税金额
+        refundTotalAmount: 0.0, //总计退款金额 = 商品退款金额 + 退运费金额 + 退税金额 。 实际执行时,refundAmount=商品退款金额 + 退税金额;退运费金额单独计算
+        refundReason: "", // 退款原因
+        otherReason: "", // 其他退款理由
+        slUseable: "0", //是否开启ShippingLabel选项
+        refundAccount: "",
+        refundAccountType: "",
+        ormorder: "",
+        refundReasonList: ""
+      },
+      afterSaleTypes: "",
+      warehouseItems: [],
+      fromLoading: false,
+      uploadPhotos: process.env.VUE_APP_OMS_API + "ordersRefund/uploadPhotos",
+      refundType: false
+    };
+  },
+  created() {
+    // this.getOrderInfo();
+    this.getDetailListByRefundId(this.refundId);
+  },
+  computed: {
+    // 计算属性的 getter
+    headers: function() {
+      return {
+        "X-Token": getToken()
+      };
+    }
+  },
+  methods: {
+    //计算退款总额 商品退款金额 + 退运费金额 +退税金额
+    calculateRefundAmount() {
+      //如果没选择退税
+      if (this.addRefundForm.refundTaxAble != "1") {
+        this.addRefundForm.refundTaxAmount = BigNumber(0)
+          .toNumber()
+          .toFixed(2);
+      }
+      //如果没选择退运费
+      if (this.addRefundForm.refundPostage != "1") {
+        this.addRefundForm.refundPostageAmount = BigNumber(0)
+          .toNumber()
+          .toFixed(2);
+      }
+
+      var taxAndShippingAmount = BigNumber(this.addRefundForm.refundTaxAmount)
+        .plus(BigNumber(this.addRefundForm.refundPostageAmount))
+        .toNumber()
+        .toFixed(2);
+      console.log(taxAndShippingAmount, this.addRefundForm.refundAmount);
+      this.addRefundForm.refundTotalAmount = BigNumber(taxAndShippingAmount)
+        .plus(BigNumber(this.addRefundForm.refundAmount))
+        .toNumber()
+        .toFixed(2);
+    },
+    getDetailListByRefundId(refundId) {
+      //初始化数据
+      this.addRefundForm.refundAmount = 0.0;
+      this.addRefundForm.refundPostage = "0";
+      this.addRefundForm.refundPostageAmount = 0.0;
+      this.addRefundForm.warehouseCode = "";
+      this.addRefundForm.annexPath = "";
+      this.addRefundForm.items = [];
+      this.addRefundForm.oldQuantity = 0.0;
+      this.addRefundForm.refundTaxAble = "0"; //是否退税
+      this.addRefundForm.refundTaxAmount = 0.0; //退税金额
+      this.addRefundForm.refundTotalAmount = 0.0;
+      this.addRefundForm.shipmodeId = "";
+      this.addRefundForm.shippingNo = "";
+      this.addRefundForm.refundMethod = "system";
+      this.addRefundForm.refundAccountType = "PayPal";
+      this.addRefundForm.refundAccount = "";
+      this.addRefundForm.notes = "";
+      this.addressInfo = [];
+      this.reasonListAll = [];
+      this.refundReasonAss = "";
+      this.refundOtherReasonAss = "";
+      this.otherReasonFlag = "";
+      //查询该退款单的数据
+      this.detailLoading = true;
+      let _this = this;
+      getDetailListByRefundId(refundId).then(res => {
+        if (200 == res.code) {
+          this.addRefundForm = res.data;
+          this.addressInfo = res.data.addressList;
+          this.afterSaleTypes = global.afterSaleType; //售后类型
+
+          //循环订单项信息
+          let refundGoodsAmount = BigNumber(0);
+          if (this.addRefundForm.items) {
+            for (let ind in this.addRefundForm.items) {
+              refundGoodsAmount = refundGoodsAmount.plus(
+                BigNumber(this.addRefundForm.items[ind].refundAmount)
+              );
+            }
+          }
+          _this.$set(
+            this.addRefundForm,
+            "refundAmount",
+            BigNumber(refundGoodsAmount.toFixed(2))
+          ); //this.addRefundForm.refundAmount= refundGoodsAmount.toFixed(2);
+          //原单的退税金额 = 原单的退款总金额 - 退商品金额 - 退运费金额
+          let oldRefundTaxAmount = BigNumber(
+            this.addRefundForm.refundTotalAmount
+          )
+            .plus(BigNumber(-this.addRefundForm.refundPostageAmount))
+            .plus(BigNumber(-this.addRefundForm.refundAmount))
+            .toFixed(2);
+
+          if (oldRefundTaxAmount > 0) {
+            _this.$set(this.addRefundForm, "refundTaxAble", "1"); //是否退税
+          } else {
+            oldRefundTaxAmount = 0;
+            _this.$set(this.addRefundForm, "refundTaxAble", "0"); //是否退税
+          }
+          _this.$set(this.addRefundForm, "refundTaxAmount", oldRefundTaxAmount); //是否退税 this.addRefundForm.refundTaxAmount=oldRefundTaxAmount;
+          this.refundType = true;
+
+          this.detailLoading = false;
+
+          //退货退款场景
+          if (this.addRefundForm.refundType == 3) {
+            warehouseList().then(res => {
+              if (200 == res.code) {
+                this.warehouseItems = res.data;
+              }
+            });
+          }
+        } else {
+          this.$message.error(res.msg);
+        }
+      });
+    },
+    handleAvatarSuccess(res, file) {
+      console.log("图片上传结果", res);
+      this.imageUrl = res.accessUrl;
+      if (this.imageUrl) {
+        this.addRefundForm.annexPath = this.imageUrl;
+      }
+    },
+    beforeAvatarUpload(file) {
+      const isJPG = file.type === "image/jpeg" || file.type === "image/png";
+      const isLt2M = file.size / 1024 / 1024 < 2;
+
+      if (!isJPG) {
+        this.$message.error("上传图片只能是 JPG 格式或者PNG格式!");
+      }
+      if (!isLt2M) {
+        this.$message.error("上传头像图片大小不能超过 2MB!");
+      }
+      return isJPG && isLt2M;
+    },
+
+    refundChange(arr, id) {
+      console.log(arr, id);
+      arr.forEach(item => {
+        if (item.id == id) {
+          this.customOpen = item.custom;
+        }
+      });
+    },
+    changeRefund(idList) {
+      this.fromLoading = true;
+      this.refundType = false;
+      this.orderDeatils = [];
+      this.addRefundForm.refundAmount = 0.0;
+      this.addRefundForm.refundPostage = "0";
+      this.addRefundForm.refundPostageAmount = 0.0;
+      this.addRefundForm.refundTaxAble = "0"; //是否退税
+      this.addRefundForm.refundTaxAmount = 0.0; //退税金额
+      this.addRefundForm.refundTotalAmount = 0.0; //总计退款金额 = 退款金额 + 退运费金额 + 退税金额 。 实际执行时,refundAmount=商品退款金额 + 退税金额;退运费金额单独计算
+      this.addRefundForm.warehouseCode = "";
+      this.addRefundForm.annexPath = "";
+      this.addRefundForm.items = [];
+      this.addRefundForm.oldQuantity = 0;
+      this.warehouseItems = [];
+      this.addRefundForm.refundReason = "";
+      this.addRefundForm.otherReason = "";
+      //退货退款场景
+      if (this.addRefundForm.refundType == 3) {
+        warehouseList().then(res => {
+          if (200 == res.code) {
+            this.warehouseItems = res.data;
+          }
+        });
+      }
+      this.listQuery.refundType = this.addRefundForm.refundType;
+      this.listQuery.ormorder = this.addRefundForm.ormorder;
+      if (idList) {
+        var addressIds = "";
+        for (let id in idList) {
+          addressIds = addressIds + idList[id] + ",";
+        }
+        this.listQuery.idList = addressIds.slice(0, addressIds.length - 1);
+      }
+      getDetailListForRefund(this.listQuery).then(res => {
+        console.log("调用log中接口getDetailListForRefund")
+        if (200 == res.code) {
+          // this.queryRefundType = res.data.refundType;
+          // this.queryShopify = res.data.shopify;
+          // this.tableOrderDeatils = res.data.list;
+          this.addRefundForm.currency = res.data.currency;
+          this.addressInfo = res.data.addressList;
+          this.addRefundForm.ormorder = res.data.ormorder;
+          this.addRefundForm.refundReasonList = res.data.refundReasonList;
+          // this.reasonListAll = res.data.refundReasonList;
+
+          this.orderDeatils = res.data.list;
+          if (this.orderDeatils) {
+            this.addRefundForm.items = this.orderDeatils;
+            for (let ind in this.orderDeatils) {
+              this.orderDeatils[ind].oldQuantity = this.orderDeatils[
+                ind
+              ].quantity;
+              if (this.addRefundForm.refundType == 1) {
+                this.orderDeatils[ind].quantity = 0;
+              }
+              var fee = this.orderDeatils[ind].totalFee;
+              if (fee == null || fee == "") {
+                fee = 0.0;
+              }
+              this.$set(this.orderDeatils[ind], "refundAmount", fee);
+              if (this.orderDeatils[ind].refundQuantity == null) {
+                this.orderDeatils[ind].refundQuantity = 0;
+              }
+              this.orderDeatils[ind].refundReason = "";
+            }
+            this.refundType = true;
+          }
+        } else {
+          this.fromLoading = false;
+          this.$message.error(res.msg);
+        }
+        this.fromLoading = false;
+      });
+      this.fromLoading = false;
+    },
+    ShippingLabelOption() {
+      this.addRefundForm.slUseable = "0";
+
+     if (
+       this.listQuery.refundType == 3 &&
+       this.queryRefundType == 3 &&
+       this.addressInfo&&
+       this.addressInfo.length>0&&
+       this.addressInfo[0].receiverCountryCode == "US" &&
+       (this.addRefundForm.warehouseCode == "PSJ-H0000024"
+       || this.addRefundForm.warehouseCode == "PSJ-H0000019"
+       || this.addRefundForm.warehouseCode == "PSJ-H0000011"
+       || this.addRefundForm.warehouseCode == "PSJ-G001001"
+       || this.addRefundForm.warehouseCode == "PSJ-G001003"
+       || this.addRefundForm.warehouseCode=='PSJ-G001004')
+     ) {
+       this.addRefundForm.slUseable = "1";
+     } else {
+       this.addRefundForm.slUseable = "0";
+     }
+
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.head {
+  padding: 0 20px;
+  height: 25px;
+  box-shadow: 0px 7px 6px -6px #f8eeee;
+  display: flex;
+  justify-content: space-between;
+  span:nth-child(1) {
+    font-size: 15px;
+    line-height: 25px;
+    color: #909399;
+    font-weight: 600;
+  }
+  span:nth-child(2) {
+    line-height: 25px;
+    cursor: pointer;
+    color: #ae8878;
+    font-size: 13px;
+  }
+}
+
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+
+.avatar-uploader .el-upload:hover {
+  border-color: #409eff;
+}
+
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 178px;
+  height: 178px;
+  line-height: 178px;
+  text-align: center;
+}
+
+.avatar {
+  width: 178px;
+  height: 178px;
+  display: block;
+}
+
+.big_box {
+  min-width: 650px;
+  border: 1px solid #e4e7ed;
+  border-bottom: none;
+}
+
+.big_box div {
+  border-bottom: 1px solid #e4e7ed;
+  display: flex;
+}
+
+.big_box p {
+  margin: 0;
+  height: 30px;
+  line-height: 30px;
+  font-size: 13px;
+  font-weight: bold;
+  border-right: 1px solid #e4e7ed;
+  padding: 0 5px;
+  text-align: center;
+  color: #909399;
+  min-width: 100px;
+}
+
+.w {
+  font-weight: 500 !important;
+  color: #606266 !important;
+  text-align: left !important;
+  padding-left: 20px !important;
+}
+
+.main {
+  margin-top: 15px;
+  .box {
+    text-align: center;
+    position: relative;
+    .box_item {
+      padding: 0 20px;
+      display: flex;
+      .item_title {
+        line-height: 40px;
+        font-size: 18px;
+        text-align: left;
+        font-weight: 600;
+      }
+      .item_list {
+        text-align: left;
+        font-size: 14px;
+        color: #606266;
+        display: flex;
+        p {
+          margin: 10px 0;
+        }
+        div:nth-child(2) {
+          margin-left: 30px;
+        }
+      }
+    }
+    .item_title {
+      padding-left: 20px;
+      line-height: 40px;
+      font-size: 18px;
+      text-align: left;
+      font-weight: 600;
+    }
+  }
+}
+
+.ptitle {
+  display: flex;
+  justify-content: space-between;
+  margin: 20px;
+  color: #1f2d3d;
+  text-align: left;
+  font-weight: bold;
+}
+
+.pcode {
+  color: #8f5842;
+  font-weight: 500;
+}
+
+.demo-table-expand {
+  font-size: 0;
+}
+
+.demo-table-expand label {
+  width: 90px;
+  color: #99a9bf;
+}
+
+.demo-table-expand .el-form-item {
+  margin-right: 0;
+  margin-bottom: 0;
+  width: 50%;
+}
+
+.container {
+  display: flex; /* 使用 Flexbox 布局 */
+  justify-content: space-between; /* 将盒子平均分布在容器中 */
+}
+</style>

+ 152 - 0
src/views/oms/refund-old/components/returnOrderList.vue

@@ -0,0 +1,152 @@
+<template>
+  <div>
+    <el-form :model="listQuery">
+      <el-form-item :label="$t('label.orderInfo')" >
+        <el-input v-model="listQuery.ormorderOrorderId" clearable style="width: 300px" autocomplete="off"></el-input>
+<!--        <el-button v-waves type="primary" icon="el-icon-search" @click="queryOrderDetails()">{{ $t("table.search") }}</el-button>-->
+        <el-button
+          class="filter-item"
+          type="primary"
+          icon="el-icon-search"
+          @click="queryOrderDetails"
+        >{{ $t("table.search") }}</el-button
+        >
+      </el-form-item>
+          <el-table  :data="gridData" v-loading="listLoading" style="width: 100%; margin-top: 10px;"  @row-click="singleElection" highlight-current-row>
+            <el-table-column fixed="left" align="center" min-width="55" label="选择">
+              <template slot-scope="scope">
+                <el-radio class="radio" v-model="templateSelection" :label="scope.row.orderitemId">&nbsp;</el-radio>
+              </template>
+            </el-table-column>
+            <el-table-column prop="ordersId" align="center" :label="$t('label.orderNumber')" width="200"></el-table-column>
+            <el-table-column prop="skuCode" align="center" :label="$t('label.skuCode')" width="150"></el-table-column>
+            <el-table-column
+              :label="$t('orderStatus')"
+              min-width="100"
+              align="center"
+              prop="status"
+            >
+              <template slot-scope="scope">{{
+                  scope.row.status | statusFilter
+                }}</template>
+            </el-table-column>
+            <el-table-column prop="quantity" align="center" :label="$t('label.quantity')" width="150"></el-table-column>
+            <el-table-column prop="totalFee" align="center" :label="$t('label.paymentAmount')" width="150"></el-table-column>
+            <el-table-column prop="lastCreate" fixed="right" align="center" :label="$t('label.createTime')" width="150"></el-table-column>
+          </el-table>
+    </el-form>
+    <!-- 分页 -->
+    <swPage
+      v-if="total > 0"
+      key="2"
+      :listQuery="listQuery"
+      :total="total"
+      pos="btmRight"
+      @retPage="queryOrderDetails"
+    />
+    <div class="dialog-footer" style="text-align: right; margin-top: 20px;">
+      <el-button @click="closeZi">{{ $t("table.cancel") }}</el-button>
+      <el-button type="primary" :loading="butLoading" @click="matchingOrder()">{{ $t("table.confirm") }}</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import {matchingOrders} from "@/api/oms/return/return";
+import {
+  getDetailListByOrderId, getDetailListByOrderInfo,
+  orderTypeKeyValue,
+  ormstatusKeyValue,
+  statusKeyValue,
+  typeSaleKeyValue
+} from "@/api/oms/order/order";
+import swPage from "@/views/common/swPage.vue";
+import i18n from "@/lang";
+
+export default {
+  components: {swPage},
+  props: ["detailsId"],
+  data() {
+    return {
+      butLoading: false,
+      listLoading: false,
+      gridData: [],
+      total: 0,
+      delivery: false,
+      templateSelection: "",
+      checkList: [],
+      //查询条件
+      listQuery: {
+        page: 1,
+        limit: 10,
+        ormorderOrorderId: ""
+      },
+      formLabelWidth: '100px'
+    };
+  },
+  methods: {
+    queryOrderDetails(){
+      if(this.listQuery.ormorderOrorderId === ""){
+        return
+      }
+      this.$emit("clearInput");
+      this.listLoading = true;
+      getDetailListByOrderInfo(this.listQuery).then(res=>{
+        this.gridData = res.data.list;
+        this.total = res.data.total;
+        this.listLoading = false;
+        }
+      )
+    },
+    closeZi(){
+      this.$emit('close'); // 触发父组件的 close 事件
+    },
+    closeDialog() {
+      this.gridData = [];
+      this.listQuery.ordersId = "";
+      this.listQuery.ormorderOrorderId = "";
+    },
+    matchingOrder(){
+      this.butLoading = true;
+      if(this.templateSelection == ''){
+        this.$message.error("请选择数据进行匹配");
+        this.butLoading = false;
+        return;
+      }
+      matchingOrders(this.templateSelection, this.detailsId).then(res => {
+        console.log(res.code)
+        if(res.code === 200){
+          this.$message({
+            message: "匹配成功",
+            type: "success"
+          });
+          this.closeZi();
+        }
+        this.butLoading = false;
+      }).catch(err => {
+        this.butLoading = false;
+      })
+    },
+    singleElection(row) {
+      console.log(row)
+      this.templateSelection = row.orderitemId;
+      this.checkList = this.gridData.filter((item) => item.orderitemId === row.orderitemId);
+    }
+  },
+  filters: {
+    orderTypeFilter(key) {
+      return orderTypeKeyValue[key];
+    },
+    statusFilter(key) {
+      return i18n.t(statusKeyValue[key]);
+    },
+    ormstatusFilter(key) {
+      return ormstatusKeyValue[key];
+    },
+    typeSaleFilter(key) {
+      return typeSaleKeyValue[key];
+    }
+  },
+};
+</script>
+

+ 37 - 0
src/views/oms/refund-old/components/tableEdit.vue

@@ -0,0 +1,37 @@
+<template>
+  <div>
+    <el-input-number
+      v-model="row.quantity"
+      size="mini"
+      :min="0"
+      :max="row.maxq"
+      :step="1"
+      step-strictly
+      @change="handleChangeQuantity"
+    ></el-input-number>
+  </div>
+</template>
+
+<script>
+  export default{
+    props:{
+      row:{
+        type: Object,
+        default:{}
+      }
+    },
+    data(){
+      return{
+        quantity:0
+      }
+    },
+    methods:{
+      handleChangeQuantity(e){
+        this.row.quantity = e
+      }
+    }
+  }
+</script>
+
+<style>
+</style>

+ 881 - 0
src/views/oms/refund-old/refundCwList.vue

@@ -0,0 +1,881 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <el-select
+        :placeholder="$t('place.afterSalesType')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.refundType"
+      >
+        <el-option
+          v-for="afterSaleType in afterSaleTypes"
+          :key="afterSaleType.value"
+          :label="$t(afterSaleType.label)"
+          :value="afterSaleType.value"
+        >
+        </el-option>
+      </el-select>
+      <el-select
+        :placeholder="$t('label.returnWarehouse')"
+        style="width: 200px;"
+        class="filter-item"
+        clearable
+        filterable
+        v-model="listQuery.warehouseCode"
+      >
+        <el-option
+          v-for="item in warehouse"
+          :key="item.returnWarehouseCode"
+          :label="item.returnWarehouseName"
+          :value="item.returnWarehouseCode"
+        />
+      </el-select>
+
+      <el-select
+        v-model="listQuery.exchangeFlag"
+        :clearable="true"
+        class="filter-item"
+        style="width: 200px;"
+        :placeholder="$t('exchangeFlag')"
+      >
+        <el-option key="1" :label="$t('label.yes')" value="1"></el-option>
+        <el-option key="0" :label="$t('label.no')" value="0"></el-option>
+      </el-select>
+
+      <el-select
+        v-model="listQuery.channelCode"
+        :clearable="true"
+        filterable
+        class="filter-item"
+        style="width: 200px;"
+        :placeholder="$t('place.channel')"
+        @change="getStore"
+      >
+        <el-option
+          v-for="item in channel"
+          :key="item.code"
+          :label="item.name"
+          :value="item.code"
+        >
+        </el-option>
+      </el-select>
+      <el-select
+        v-model="listQuery.storeId"
+        :clearable="true"
+        filterable
+        class="filter-item"
+        style="width: 200px;"
+        :placeholder="$t('place.shopName')"
+        @change="getChannel"
+      >
+        <el-option
+          v-for="item in store"
+          :key="item.storeId"
+          :label="item.storeName"
+          :value="item.storeId"
+        >
+        </el-option>
+      </el-select>
+
+      <el-input
+        :placeholder="$t('place.refundNumber')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.refundNo"
+      />
+      <el-input
+        :placeholder="$t('place.onlineRefundNumber')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.ormRefundId"
+      />
+      <el-input
+        :placeholder="$t('place.shopifyNumber')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.shopify"
+      />
+
+      <el-input
+        :placeholder="$t('place.onlineShopNumber')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.ormorder"
+      />
+
+      <el-date-picker
+        class="filter-item"
+        style="display: inline-flex;"
+        v-model="createTimePicker"
+        type="datetimerange"
+        :range-separator="$t('to')"
+        :start-placeholder="$t('place.refundCreationStart')"
+        :end-placeholder="$t('place.refundCreationEnd')"
+        value-format="yyyy-MM-dd HH:mm:ss"
+        :default-time="['00:00:00', '23:59:59']"
+      >
+      </el-date-picker>
+
+      <el-select
+        :placeholder="$t('place.inboundStatus')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.inboundStatus"
+      >
+        <el-option value="success" :label="$t('label.normalReturn')" />
+        <el-option value="returning" :label="$t('label.inReturnTransit')" />
+        <el-option value="shipLost" :label="$t('label.shipmentLost')" />
+        <el-option value="returnLost" :label="$t('label.returnLost')" />
+      </el-select>
+      <!--<el-input placeholder="收件人电话" style="width: 200px;"
+        	class="filter-item"	v-model="listQuery.receiverMobile"/>-->
+
+      <el-button
+        v-waves
+        class="filter-item"
+        type="primary"
+        icon="el-icon-search"
+        @click="handleFilter"
+        >{{ $t("view.search") }}</el-button
+      >
+    </div>
+
+    <!--<div class="filter-container">
+			<el-button v-waves class="filter-item" type="primary" @click="orderExport('orderItem')">退款明细导出</el-button>
+		</div>-->
+    <!--      展示红色背景-->
+    <el-table
+      style="width: 100%;"
+      v-loading="listLoading"
+      :key="tableKey"
+      :data="list"
+      row-key="id"
+      stripe
+      border
+      fit
+      highlight-current-row
+      :cell-style="tableRowStyleName"
+      @sort-change="sortMethod"
+    >
+      <el-table-column align="center" type="index"> </el-table-column>
+      <el-table-column
+        :label="$t('label.refundNumber')"
+        width="200"
+        align="center"
+        prop="refundNo"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.onlineRefundNumber')"
+        width="250"
+        align="center"
+        prop="ormRefundId"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.shopifyNumber')"
+        width="200"
+        align="center"
+        prop="cutUser"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('storeName')"
+        align="center"
+        min-width="180"
+        prop="storeName"
+      ></el-table-column>
+      <el-table-column
+        :label="$t('label.onlineShopOrder')"
+        width="150"
+        align="center"
+        prop="ormorder"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.onlineShopStatus')"
+        width="150"
+        align="center"
+        prop="channelStatus"
+      >
+          <template slot-scope="scope">
+            {{ scope.row.channelStatus | channelStatusFilter(that) }}
+          </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.afterSalesType')"
+        width="100"
+        align="center"
+        prop="refundType"
+      >
+        <template slot-scope="scope">
+          {{ scope.row.refundType | refundTypeFilter(that) }}
+        </template>
+      </el-table-column>
+
+      <!-- <el-table-column :label="$t('label.exchangeGoods')" prop="exchangeFlag" width = "100" >
+        <template slot-scope="scope" >
+         	{{ scope.row.exchangeFlag === "1" ? $t('label.yes') : $t('label.no') }}
+        </template>
+      </el-table-column> -->
+
+      <el-table-column
+        :label="$t('label.afterSalesInitiation')"
+        width="110"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <div v-if="scope.row.originatorFlag == '1'">
+            {{ $t("label.customerService") }}
+          </div>
+          <div v-if="scope.row.originatorFlag == '2'">
+            {{ $t("label.buyer") }}
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.afterSalesStatus')"
+        width="120"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <el-tag effect="dark" type="warning" v-if="scope.row.status == '4'">
+            {{ scope.row.status | statusFilte(that) }}
+          </el-tag>
+          <el-tag effect="dark" type="info" v-else-if="scope.row.status == '7'">
+            {{ scope.row.status | statusFilter(that) }}
+          </el-tag>
+          <el-tag effect="dark" type="success" v-else>
+            {{ scope.row.status | statusFilter(that) }}
+          </el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.applicationTime')"
+        width="160"
+        align="center"
+        prop="timeplaced"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.applicant')"
+        width="120"
+        align="center"
+        prop="userName"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.returnWarehouse')"
+        width="120"
+        align="center"
+        prop="warehouseName"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.refundAmount')"
+        width="100"
+        align="center"
+        prop="refundAmount"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.shippingRefund')"
+        width="100"
+        align="center"
+        prop="refundPostageAmount"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.serviceNote')"
+        width="150"
+        align="center"
+        prop="notes"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.buyerReasonNote')"
+        width="150"
+        align="center"
+        prop="buyNotes"
+      >
+      </el-table-column>
+
+     <el-table-column
+        label="自动退款失败原因"
+        width="150"
+        align="center"
+        :show-overflow-tooltip="true"
+        prop="autoRefundFailureReason"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.channelID')"
+        width="120"
+        align="center"
+        prop="channelCode"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.channelName')"
+        width="140"
+        align="center"
+        prop="channelName"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.updateTime')"
+        width="160"
+        align="center"
+        prop="lastupdate"
+        :sortable="'custom'"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.updater')"
+        width="120"
+        align="center"
+        prop="lastUserName"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.operation')"
+        fixed="right"
+        width="300"
+        align="left"
+      >
+        <template slot-scope="scope">
+          <!--          <el-button type="primary" size="mini" @click="handleInfo(scope.row.id,'view')">详情</el-button>-->
+          <el-button
+            v-has="'ordersRefund:checkKf'"
+            v-if="
+              scope.row.refundType == '3' &&
+                (scope.row.status == '0' || scope.row.status == '4')
+            "
+            type="success"
+            size="mini"
+            @click="editInfo(scope.row)"
+            >{{ $t("view.logistics") }}</el-button
+          >
+          <!--
+					<el-button v-has="'ordersRefund:checkKf'" v-if="scope.row.status=='0' " type="success" size="mini" @click="handleInfo(scope.row.id,'cus_check')">审核</el-button>
+-->
+          <!--
+					<el-button v-has="'ordersRefund:checkKf'" v-if="scope.row.status=='0' " type="success" size="mini" @click="handleRefund(scope.row.id,scope.row.ordersId)">编辑</el-button>
+-->
+          <el-button
+            v-has="'ordersRefund:checkCw'"
+            v-if="scope.row.status == '5'"
+            type="success"
+            size="mini"
+            @click="handleInfo(scope.row.id, 'f_check')"
+            >{{ $t("view.financialReview") }}</el-button
+          >
+          <!--	<el-button v-has="'ordersRefund:checkCw'" v-if="scope.row.status=='5' "  size="mini" type="success" @click="handleSuccess(scope.row)">退款成功
+					</el-button>-->
+          <el-button
+            v-if="scope.row.status == '0' || scope.row.status == '4'"
+            type="danger"
+            size="mini"
+            @click="cancelInfo(scope.row)"
+            >{{ $t("view.cancel") }}</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 分页 -->
+    <swPage
+      v-if="total > 0"
+      key="2"
+      :listQuery="listQuery"
+      :total="total"
+      pos="btmRight"
+      @retPage="retPage"
+    />
+    <el-drawer
+      :title="$t('title.afterSalesDetails')"
+      :visible.sync="refundInfoVisible"
+      v-if="refundInfoVisible"
+      :direction="direction"
+      :size="dialogSize"
+    >
+      <refundInfoDialog
+        @refresh="refresh"
+        :refundId="currentRefundId"
+        :action="action"
+      ></refundInfoDialog>
+    </el-drawer>
+    <el-dialog
+      :title="$t('title.returnLogisticsInfo')"
+      :visible.sync="dialogShippFormVisible"
+      v-if="dialogShippFormVisible"
+      :close-on-click-modal="false"
+    >
+      <el-form :model="editShipp">
+        <el-form-item :label="$t('label.returnWarehouse')" label-width="150px">
+          <el-select
+            :placeholder="$t('place.pleaseSelect')"
+            clearable
+            style="width: 200px;"
+            class="filter-item"
+            v-model="editShipp.warehouseCode"
+          >
+            <el-option
+              v-for="item in warehouseItems"
+              :key="item.key"
+              :label="item.key"
+              :value="item.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item
+          :label="$t('label.returnLogisticsCompany')"
+          label-width="150px"
+        >
+          <el-input
+            size="mini"
+            v-model="editShipp.shipmodeId"
+            :placeholder="$t('place.pleaseFillIn')"
+            class="normal-input"
+          ></el-input>
+        </el-form-item>
+        <el-form-item
+          :label="$t('label.returnExpressNumber')"
+          label-width="150px"
+        >
+          <el-input
+            size="mini"
+            v-model="editShipp.shippingNo"
+            :placeholder="$t('place.pleaseFillIn')"
+            class="normal-input"
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogShippFormVisible = false">{{
+          $t("view.cancel")
+        }}</el-button>
+        <!--        <el-button-->
+        <!--          type="primary"-->
+        <!--          @click="editShippSub(1)"-->
+        <!--          v-loading="btnLoading"-->
+        <!--          >暂存</el-button-->
+        <!--        >-->
+        <el-button
+          type="primary"
+          @click="editShippSub(1)"
+          v-loading="btnLoading"
+          >{{ $t("view.save") }}</el-button
+        >
+        <el-button
+          type="primary"
+          @click="editShippSub('')"
+          v-loading="btnLoading"
+          >{{ $t("view.confirm") }}</el-button
+        >
+      </div>
+    </el-dialog>
+
+    <el-dialog
+      :title="$t('title.nullify')"
+      :visible.sync="dialogFormCancelVisible"
+      v-if="dialogFormCancelVisible"
+      :close-on-click-modal="false"
+    >
+      <el-form :model="cancelForm">
+        <el-form-item :label="$t('label.cancellationNote')" label-width="120px">
+          <el-input
+            type="textarea"
+            :placeholder="$t('place.enterContent')"
+            v-model="cancelForm.zfnotes"
+            maxlength="150"
+            show-word-limit
+          >
+          </el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormCancelVisible = false">{{
+          $t("view.cancel")
+        }}</el-button>
+        <el-button
+          type="primary"
+          @click="cancelSubmit"
+          v-loading="btnLoading"
+          >{{ $t("view.confirm") }}</el-button
+        >
+      </div>
+    </el-dialog>
+    <!--售后-->
+    <el-dialog
+      :title="$t('orderRefund')"
+      :fullscreen="true"
+      v-if="orderRefundVisible"
+      :visible.sync="orderRefundVisible"
+    >
+      <orderRefundDialog
+        :refundId="currentRefundId"
+        :ordersId="currentOrdersId"
+      ></orderRefundDialog>
+      <el-button type="danger" style="float:right" @click="backTable">{{
+        $t("back")
+      }}</el-button>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import waves from "@/directive/waves";
+import swPage from "@/views/common/swPage";
+import global from "@/views/oms/global";
+import refundInfoDialog from "./refundDetail";
+import { getToken } from "@/utils/auth";
+import {
+  fetchList,
+  updateshipping,
+  cancel,
+  warehouseList,
+  queryTWarehouseNameALL,
+  manualRefundSuccess
+} from "@/api/oms/refund/refund";
+import { dcmAdd } from "@/utils/toolUtil";
+import orderRefundDialog from "@/views/oms/refund/components/orderRefundDialog";
+import { queryChannelStore, queryChannel } from "@/api/oms/inventory/inventory";
+export default {
+  name: "refundList",
+  directives: {
+    waves
+  },
+  components: {
+    swPage,
+    refundInfoDialog,
+    global,
+    orderRefundDialog
+  },
+  filters: {
+    statusFilter(key, that) {
+      var value = "";
+      global.afterSaleStatus.forEach(status => {
+        if (status.value == key) {
+          value = that.$t(status.label);
+        }
+      });
+      return value;
+    },
+    refundTypeFilter(key, that) {
+      var value = "";
+      global.afterSaleType.forEach(refundType => {
+        if (refundType.value == key) {
+          value = that.$t(refundType.label);
+        }
+      });
+      return value;
+    },
+    channelStatusFilter(key, that) {
+      var value = "";
+      global.channelStatus.forEach(status => {
+        if (status.value == key) {
+          value = that.$t(status.label);
+        }
+      });
+      return value;
+    }
+  },
+  data() {
+    return {
+      that: this,
+      dialogSize: "40%",
+      direction: "rtl",
+      fileList: [],
+      tableKey: 0,
+      list: [],
+      total: 0,
+      listLoading: false,
+      store: [],
+      channel: [],
+      //查询条件
+      listQuery: {
+        page: 1,
+        limit: 20,
+        storeId: "",
+        channelCode: "",
+        refundType: "",
+        shopify: "",
+        status: "5",
+        cutUser: "",
+        ormRefundId: "",
+        ormorder: "",
+        refundNo: "",
+        timeplacedLaggerThanEqual: "",
+        timeplacedLessThanEqual: "",
+        warehouseCode: "",
+        sort: "",
+        inboundStatus: null
+      },
+      warehouse: [],
+      returnStatusList: global.returnStatus,
+      createTimePicker: null,
+      channelCodes: global.channelCodes, //渠道编码
+      afterSaleStatus: global.afterSaleStatus, //售后状态
+      afterSaleTypes: global.afterSaleType, //售后类型
+      applyTypes: global.applyType, //售后来源
+      stores: [],
+      refundInfoVisible: false,
+      currentRefundId: "",
+      editShipp: {
+        id: null,
+        shipmodeId: "",
+        shippingNo: "",
+        warehouseCode: ""
+      },
+      dialogShippFormVisible: false,
+      dialogFormCancelVisible: false,
+      cancelForm: {
+        refundNo: "",
+        zfnotes: ""
+      },
+      warehouseItems: [],
+      btnLoading: false,
+      orderRefundVisible: false,
+      currentOrdersId: "",
+      action: "" //  view  cus_check  t_check
+    };
+  },
+  created() {
+    //获取店铺列表
+    this.getList();
+    this.getChannel();
+    this.getStore();
+    this.queryWarehouseName();
+  },
+  activated() {
+    this.getList();
+  },
+  computed: {
+    // 计算属性的 getter
+    headers: function() {
+      return {
+        "X-Token": getToken()
+      };
+    }
+  },
+  methods: {
+    handleSuccess(e) {
+      this.$confirm("确认退款成功吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          var params = { id: e.id };
+
+          manualRefundSuccess(params).then(res => {
+            if (200 == res.code) {
+              this.$message({
+                type: "success",
+                message: "操作成功!"
+              });
+              this.getList();
+            }
+          });
+        })
+        .catch(() => {});
+    },
+    queryWarehouseName() {
+      queryTWarehouseNameALL().then(response => {
+        this.warehouse = response.data;
+      });
+    },
+    getList() {
+      this.listLoading = true;
+      fetchList(this.listQuery).then(res => {
+        if (200 == res.code) {
+          this.total = res.data.total;
+          this.list = res.data.list;
+        }
+        this.listLoading = false;
+      });
+    },
+    getChannel() {
+      queryChannel({ storeId: this.listQuery.storeId }).then(res => {
+        if (200 == res.code) {
+          this.channel = res.data;
+        }
+      });
+    },
+    getStore() {
+      queryChannelStore({ channelCode: this.listQuery.channelCode }).then(
+        res => {
+          if (200 == res.code) {
+            this.store = res.data;
+          }
+        }
+      );
+    },
+    // 展示红色背景
+    tableRowStyleName({ row }) {
+      if (row.totalCount) {
+        return "color: red !important;";
+      }
+    },
+    retPage() {
+      //分页
+      this.getList();
+    },
+
+    handleFilter() {
+      this.listQuery.page = 1;
+      if (this.createTimePicker == null) {
+        this.listQuery.timeplacedLaggerThanEqual = "";
+        this.listQuery.timeplacedLessThanEqual = "";
+      } else {
+        this.listQuery.timeplacedLaggerThanEqual = this.createTimePicker[0];
+        this.listQuery.timeplacedLessThanEqual = this.createTimePicker[1];
+      }
+      this.getList();
+    },
+    //查看退款单详情
+    handleInfo(refundId, action) {
+      //进入退款单详情查看
+      this.action = action;
+      this.currentRefundId = refundId;
+      this.refundInfoVisible = true;
+    },
+    editInfo(row) {
+      //进入退款单详情查看
+      this.editShipp.id = row.id;
+      this.editShipp.shipmodeId = row.shipmodeId;
+      this.editShipp.shippingNo = row.shippingNo;
+      this.editShipp.warehouseCode = row.warehouseCode;
+      warehouseList().then(res => {
+        if (200 == res.code) {
+          this.warehouseItems = res.data;
+          this.dialogShippFormVisible = true;
+        }
+      });
+    },
+    editShippSub(flag) {
+      if (!this.editShipp.warehouseCode) {
+        this.$message.error("请选择收退仓库!");
+        return false;
+      }
+      if (!this.editShipp.shipmodeId) {
+        this.$message.error("请填写退货物流公司!");
+        return false;
+      }
+      if (!this.editShipp.shippingNo) {
+        this.$message.error("请填写退货快递单号!");
+        return false;
+      }
+      this.btnLoading = true;
+      updateshipping(this.editShipp).then(
+        res => {
+          if (200 == res.code) {
+            this.$message({
+              message: this.$t("optSuccess"),
+              type: "success"
+            });
+            this.editShipp = {
+              id: null,
+              shipmodeId: "",
+              shippingNo: "",
+              warehouseCode: "",
+              flag: flag
+            };
+            this.btnLoading = false;
+            this.dialogShippFormVisible = false;
+            this.getList();
+          }
+        },
+        error => {
+          this.btnLoading = false;
+        }
+      );
+    },
+    cancelInfo(row) {
+      this.cancelForm = {
+        refundNo: "",
+        zfnotes: ""
+      };
+      this.cancelForm.refundNo = row.refundNo;
+      this.dialogFormCancelVisible = true;
+    },
+    cancelSubmit() {
+      this.$confirm("确认作废/撤销, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          this.btnLoading = true;
+          cancel(this.cancelForm).then(
+            res => {
+              if (200 == res.code) {
+                this.$message({
+                  type: "success",
+                  message: "作废成功!"
+                });
+                this.cancelForm = {
+                  refundNo: "",
+                  zfnotes: ""
+                };
+                this.btnLoading = false;
+                this.dialogFormCancelVisible = false;
+                this.getList();
+              }
+            },
+            error => {
+              this.btnLoading = false;
+            }
+          );
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消操作"
+          });
+        });
+    },
+    refresh() {
+      // 财务审核后关闭组件
+      this.refundInfoVisible = false;
+      this.getList();
+    },
+    handleRefund(currentRefundId, ordersId) {
+      this.currentRefundId = currentRefundId;
+      this.currentOrdersId = ordersId;
+      this.orderRefundVisible = true;
+    },
+    backTable() {
+      this.orderRefundVisible = false;
+      this.getList();
+    },
+
+    sortMethod(column) {
+      if (column.order === "ascending") {
+        this.listQuery.sort = "asc";
+      } else if (column.order === "descending") {
+        this.listQuery.sort = "desc";
+      } else {
+        this.listQuery.sort = "";
+      }
+      this.getList();
+    }
+  }
+};
+</script>
+
+<style scoped lang="scss">
+.cell > span {
+  white-space: nowrap !important;
+}
+//::v-deep .el-icon-d-caret:hover
+//{color: #ffc400 !important;}
+</style>

+ 1115 - 0
src/views/oms/refund-old/refundDetail.vue

@@ -0,0 +1,1115 @@
+<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>

+ 1540 - 0
src/views/oms/refund-old/refundList.vue

@@ -0,0 +1,1540 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <el-select
+        :placeholder="$t('place.afterSalesType')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.refundType"
+        @change="queryRefundReason"
+      >
+        <el-option
+          v-for="afterSaleType in afterSaleTypes"
+          :key="afterSaleType.value"
+          :label="$t(afterSaleType.label)"
+          :value="afterSaleType.value"
+        >
+        </el-option>
+      </el-select>
+      <el-select
+        :placeholder="$t('place.afterSalesStatus')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.status"
+      >
+        <el-option
+          v-for="status in afterSaleStatus"
+          :key="status.value"
+          :label="$t(status.label)"
+          :value="status.value"
+        >
+        </el-option>
+      </el-select>
+
+      <el-select
+        v-model="listQuery.exchangeFlag"
+        :clearable="true"
+        class="filter-item"
+        style="width: 200px;"
+        :placeholder="$t('exchangeFlag')"
+      >
+        <el-option key="1" :label="$t('label.yes')" value="1"></el-option>
+        <el-option key="0" :label="$t('label.no')" value="0"></el-option>
+      </el-select>
+
+      <el-select
+        v-model="listQuery.channelCode"
+        :clearable="true"
+        filterable
+        class="filter-item"
+        style="width: 200px;"
+        :placeholder="$t('place.channel')"
+        @change="getStore"
+      >
+        <el-option
+          v-for="item in channel"
+          :key="item.code"
+          :label="item.name"
+          :value="item.code"
+        >
+        </el-option>
+      </el-select>
+      <el-select
+        v-model="listQuery.storeId"
+        :clearable="true"
+        filterable
+        class="filter-item"
+        style="width: 200px;"
+        :placeholder="$t('place.shopName')"
+        @change="getChannel"
+      >
+        <el-option
+          v-for="item in store"
+          :key="item.storeId"
+          :label="item.storeName"
+          :value="item.storeId"
+        >
+        </el-option>
+      </el-select>
+      <el-input
+        :placeholder="$t('place.refundNumber')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.refundNo"
+      />
+      <el-input
+        :placeholder="$t('place.onlineRefundNumber')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.ormRefundId"
+      />
+      <el-input
+        :placeholder="$t('place.shopifyNumber')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.shopify"
+      />
+
+      <el-input
+        :placeholder="$t('place.onlineShopNumber')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.ormorder"
+      />
+
+      <el-select
+        :placeholder="$t('place.afterSalesInitiator')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.originatorFlag"
+      >
+        <el-option
+          value="1"
+          :label="$t('label.customerService')"
+          key="1"
+        ></el-option>
+        <el-option value="2" :label="$t('label.buyer')" key="2"></el-option>
+      </el-select>
+
+      <el-date-picker
+        class="filter-item"
+        style="display: inline-flex;"
+        v-model="createTimePicker"
+        type="datetimerange"
+        :range-separator="$t('to')"
+        :start-placeholder="$t('place.refundCreationStart')"
+        :end-placeholder="$t('place.refundCreationEnd')"
+        value-format="yyyy-MM-dd HH:mm:ss"
+        :default-time="['00:00:00', '23:59:59']"
+      >
+      </el-date-picker>
+
+      <el-select
+        :placeholder="$t('place.refundMethod')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.refundMethod"
+      >
+        <el-option
+          value="system"
+          :label="$t('label.systemRefund')"
+          key="system"
+        ></el-option>
+        <el-option
+          value="manual"
+          :label="$t('label.manualRefund')"
+          key="manual"
+        ></el-option>
+      </el-select>
+
+      <el-input
+        :placeholder="$t('place.refundAccount')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.refundAccount"
+      />
+
+      <el-select
+        v-model="refundReasonList"
+        :clearable="true"
+        class="filter-item"
+        style="width: 200px;"
+        :placeholder="$t('place.refundReason')"
+        multiple
+        filterable
+        @change="queryRefundType"
+      >
+        <el-option
+          v-for="item in this.refundReason"
+          :key="item.reasonContentChinese"
+          :label="item.reasonContentChinese"
+          :value="item.reasonContentChinese"
+        >
+        </el-option>
+      </el-select>
+
+      <el-select
+        v-model="listQuery.sendEmailFlag"
+        :clearable="true"
+        class="filter-item"
+        style="width: 200px;"
+        placeholder="是否成功发送邮件"
+      >
+        <el-option key="1" :label="$t('label.yes')" value="1"></el-option>
+        <el-option key="0" :label="$t('label.no')" value="0"></el-option>
+      </el-select>
+      <el-select
+        :placeholder="$t('place.signInStatus')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.signInStatus"
+      >
+        <el-option
+          v-for="re in signInStatus"
+          :key="re.value"
+          :label="re.label"
+          :value="re.value"
+        >
+        </el-option>
+      </el-select>
+    </div>
+    <div class="filter-container">
+      <!--<el-input placeholder="收件人电话" style="width: 200px;"
+          class="filter-item"	v-model="listQuery.receiverMobile"/>-->
+
+      <el-button
+        v-waves
+        class="filter-item"
+        type="success"
+        icon="el-icon-search"
+        @click="handleFilter"
+        >{{ $t("view.search") }}</el-button
+      >
+      <el-button class="filter-item" @click="exportExcel" type="primary">
+        {{ $t("exportRep") }}
+      </el-button>
+      <!-- <el-button v-waves class="filter-item" type="primary" icon="el-icon-upload"
+                 @click="dialogFormUploadVisible = true">{{ $t("view.importData") }}
+      </el-button> -->
+      <el-button v-waves class="filter-item" type="warning" @click="batchCheck"
+        >{{ $t("view.batchAudit") }}
+      </el-button>
+
+      <!--新创建退款单  -->
+      <el-button
+        v-waves
+        class="filter-item"
+        type="success"
+        @click="createNewRefund"
+        >{{ $t("view.createRefundOrder") }}
+      </el-button>
+    </div>
+
+    <!--<div class="filter-container">
+      <el-button v-waves class="filter-item" type="primary" @click="orderExport('orderItem')">退款明细导出</el-button>
+    </div>-->
+
+    <el-table
+      style="width: 100%;"
+      v-loading="listLoading"
+      :key="tableKey"
+      :data="list"
+      row-key="id"
+      stripe
+      border
+      fit
+      highlight-current-row
+      :cell-style="tableRowStyleName"
+      tooltip-effect="dark"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column
+        align="center"
+        type="selection"
+        :selectable="selectEnable"
+      >
+      </el-table-column>
+      <el-table-column align="center" type="index"> </el-table-column>
+      <el-table-column
+        :label="$t('label.refundNumber')"
+        width="200"
+        align="center"
+        prop="refundNo"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.onlineRefundNumber')"
+        width="250"
+        align="center"
+        prop="ormRefundId"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.shopifyNumber')"
+        width="200"
+        align="center"
+        prop="cutUser"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.onlineShopOrder')"
+        width="150"
+        align="center"
+        prop="ormorder"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('storeName')"
+        align="center"
+        min-width="180"
+        prop="storeName"
+      ></el-table-column>
+      <el-table-column
+        :label="$t('label.afterSalesType')"
+        width="100"
+        align="center"
+        prop="refundType"
+      >
+        <template slot-scope="scope">
+          {{ scope.row.refundType | refundTypeFilter(that) }}
+        </template>
+      </el-table-column>
+
+      <!-- <el-table-column :label="$t('label.exchangeGoods')" prop="exchangeFlag" width = "100" >
+        <template slot-scope="scope" >
+          {{scope.row.exchangeFlag==="1"?'是':'否'}}
+        </template>
+      </el-table-column> -->
+
+      <el-table-column
+        :label="$t('label.afterSalesInitiation')"
+        width="110"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <div v-if="scope.row.originatorFlag == '1'">
+            {{ $t("label.customerService") }}
+          </div>
+          <div v-if="scope.row.originatorFlag == '2'">
+            {{ $t("label.buyer") }}
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.afterSalesStatus')"
+        width="120"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <el-tag effect="dark" type="warning" v-if="scope.row.status == '4'">
+            {{ scope.row.status | statusFilter(that) }}
+          </el-tag>
+          <el-tag effect="dark" type="info" v-else-if="scope.row.status == '7'">
+            {{ scope.row.status | statusFilter(that) }}
+          </el-tag>
+          <el-tag effect="dark" type="success" v-else>
+            {{ scope.row.status | statusFilter(that) }}
+          </el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="自动退款"
+        align="center"
+        prop="autoRefund"
+        width="120"
+      >
+        <template slot-scope="scope">
+          {{
+            scope.row.autoRefund === "1" ? $t("label.yes") : $t("label.no")
+          }}
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        label="是否成功发送邮件"
+        align="center"
+        prop="sendEmailFlag"
+        width="140"
+      >
+        <template slot-scope="scope">
+          {{
+            scope.row.sendEmailFlag === "1" ? $t("label.yes") : $t("label.no")
+          }}
+        </template>
+      </el-table-column>
+
+
+
+      <el-table-column
+        :label="$t('label.applicationTime')"
+        width="160"
+        align="center"
+        prop="timeplaced"
+      >
+      </el-table-column>
+      <el-table-column
+        label="财务审核通过时间"
+        width="160"
+        align="center"
+        prop="financialApprovalTime"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.applicant')"
+        width="120"
+        align="center"
+        prop="userName"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.refundAmount')"
+        width="100"
+        align="center"
+        prop="refundAmount"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.shippingRefund')"
+        width="100"
+        align="center"
+        prop="refundPostageAmount"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.currency')"
+        width="100"
+        align="center"
+        prop="currency"
+      >
+      </el-table-column>
+      <!-- <el-table-column label="退款原因(中文)" width="150" align="center" prop="reasonContentChinese">
+      </el-table-column> -->
+      <!-- <el-table-column label="退款原因(English)" width="150" align="center" prop="reasonContentEnglish">
+      </el-table-column> -->
+      <!-- <el-table-column label="其他原因说明" width="100" align="center" prop="otherReason">
+      </el-table-column> -->
+      <el-table-column
+        :label="$t('label.serviceNote')"
+        width="150"
+        align="center"
+        prop="notes"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.buyerReasonNote')"
+        width="150"
+        align="center"
+        prop="buyNotes"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.refundMethod')"
+        width="150"
+        align="center"
+        prop="refundMethod"
+      >
+        <template slot-scope="scope">
+          {{ scope.row.refundMethod | refundMethodFilter(that) }}
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.accountType')"
+        width="150"
+        align="center"
+        prop="refundAccountType"
+      >
+        <template slot-scope="scope">
+          {{ scope.row.refundAccountType | refundAccountTypeFilter(that) }}
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.refundAccount')"
+        width="150"
+        align="center"
+        prop="refundAccount"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.channelID')"
+        width="120"
+        align="center"
+        prop="channelCode"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.channelName')"
+        width="140"
+        align="center"
+        prop="channelName"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.updateTime')"
+        width="160"
+        align="center"
+        prop="lastupdate"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.updater')"
+        width="120"
+        align="center"
+        prop="lastUserName"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.operation')"
+        fixed="right"
+        min-width="360"
+        align="left"
+      >
+        <template slot-scope="scope">
+          <el-button
+            type="primary"
+            size="mini"
+            @click="handleInfo(scope.row.id, 'view')"
+            >{{ $t("view.details") }}</el-button
+          >
+          <el-button
+            v-has="'ordersRefund:checkKf'"
+            v-if="
+              scope.row.refundType == '3' &&
+                (scope.row.status == '0' || scope.row.status == '4')
+            "
+            type="success"
+            size="mini"
+            @click="editInfo(scope.row)"
+            >{{ $t("view.logistics") }}
+          </el-button>
+          <el-button
+            v-has="'ordersRefund:checkKf'"
+            v-if="scope.row.status == '0'"
+            type="success"
+            size="mini"
+            @click="handleInfo(scope.row.id, 'cus_check')"
+            >{{ $t("view.audit") }}
+          </el-button>
+          <el-button
+            v-has="'ordersRefund:checkKf'"
+            v-if="
+              scope.row.status == '0' ||
+                (scope.row.status == '2' && scope.row.channelCode == 'SHOPIFY')
+            "
+            type="success"
+            size="mini"
+            @click="handleRefund(scope.row.id)"
+            >{{ $t("view.edit") }}
+          </el-button>
+          <el-button
+            v-has="'ordersRefund:checkKf'"
+            v-if="scope.row.status == '7'"
+            type="success"
+            size="mini"
+            @click="createRefund(scope.row.id)"
+            >{{ $t("view.create") }}
+          </el-button>
+          <!--          <el-button-->
+          <!--            v-has="'ordersRefund:checkKf'"-->
+          <!--            v-if="scope.row.status == '1'"-->
+          <!--            size="mini"-->
+          <!--            type="danger"-->
+          <!--            @click="reject(scope.row.id, scope.row.refundNo)"-->
+          <!--            >{{ $t("view.reject") }}-->
+          <!--          </el-button>-->
+          <el-button
+            v-has="'ordersRefund:checkKf'"
+            v-if="scope.row.status == '1'"
+            size="mini"
+            type="danger"
+            @click="reject(scope.row.id, scope.row.refundNo)"
+            >{{ $t("view.unaudit") }}
+          </el-button>
+          <el-button
+            v-has="'ordersRefund:checkKf'"
+            v-if="scope.row.status == '1'"
+            size="mini"
+            type="warning"
+            @click="handleAddNote(scope.row)"
+            >{{ $t("view.modifyRemarks") }}
+          </el-button>
+          <el-button
+            v-has="'ordersRefund:checkKf'"
+            v-if="scope.row.status == '6'"
+            size="mini"
+            type="success"
+            @click="handleSuccess(scope.row)"
+            >{{ $t("view.refundSuccess") }}
+          </el-button>
+          <!--          <el-button v-has="'ordersRefund:checkKf'" v-if="scope.row.abnormalFlag=='1' "  size="mini"-->
+          <!--                     type="success" @click="releaseEx(scope.row)">解除异常-->
+          <!--          </el-button>-->
+          <!--
+                    <el-button v-has="'ordersRefund:checkCw'" v-if="scope.row.status=='5' " type="success" size="mini" @click="handleInfo(scope.row.id,'f_check')">财务审核</el-button>
+          -->
+          <!--          在在客服审批通过环节客服也可以操作取消-->
+          <el-button
+            v-if="
+              scope.row.status == '0' ||
+                scope.row.status == '4' ||
+                scope.row.status == '1' ||
+                scope.row.status == '2'
+            "
+            type="danger"
+            size="mini"
+            @click="cancelInfo(scope.row)"
+            >{{ $t("view.cancel") }}
+          </el-button>
+          <el-button
+            v-if="scope.row.slFlag == '1'"
+            size="mini"
+            type="primary"
+            @click="handleCargoTrack(scope.row)"
+            >{{ $t("view.cargoTrack") }}
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 分页 -->
+    <swPage
+      v-if="total > 0"
+      key="2"
+      :listQuery="listQuery"
+      :total="total"
+      pos="btmRight"
+      @retPage="retPage"
+    />
+    <!-- 售后详情-->
+    <el-drawer
+      :title="$t('title.afterSalesDetails')"
+      :visible.sync="refundInfoVisible"
+      v-if="refundInfoVisible"
+      :direction="direction"
+      :size="dialogSize"
+    >
+      <refundInfoDialog
+        @refresh="refresh"
+        :refundId="currentRefundId"
+        :action="action"
+      ></refundInfoDialog>
+    </el-drawer>
+
+    <el-dialog
+      :title="$t('title.returnLogisticsInfo')"
+      :visible.sync="dialogShippFormVisible"
+      v-if="dialogShippFormVisible"
+      :close-on-click-modal="false"
+    >
+      <el-form :model="editShipp">
+        <el-form-item :label="$t('label.returnWarehouse')" label-width="150px">
+          <el-select
+            :placeholder="$t('place.pleaseSelect')"
+            clearable
+            style="width: 200px;"
+            class="filter-item"
+            v-model="editShipp.warehouseCode"
+            @change="shippingLabelOption"
+          >
+            <el-option
+              v-for="item in warehouseItems"
+              :key="item.key"
+              :label="item.key"
+              :value="item.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item
+          :label="$t('label.useSL')"
+          label-width="150px"
+          v-if="editShipp.slUseable == '1'"
+        >
+          <el-radio-group v-model="slFlag" @input="changeSL">
+            <el-radio label="0">{{ $t("view.notUsed") }}</el-radio>
+            <el-radio label="1">{{ $t("view.use") }}</el-radio>
+          </el-radio-group>
+        </el-form-item>
+
+        <el-form-item
+          :label="$t('label.returnLogisticsCompany')"
+          label-width="150px"
+        >
+          <el-input
+            v-if="slFlag == '0'"
+            size="mini"
+            v-model="editShipp.shipmodeId"
+            :placeholder="$t('place.pleaseFillIn')"
+            class="normal-input"
+          ></el-input>
+          <el-input
+            v-if="slFlag == '1'"
+            size="mini"
+            v-model="editShipp.shipmodeId"
+            :placeholder="$t('place.pleaseFillIn')"
+            class="normal-input"
+            disabled
+          ></el-input>
+        </el-form-item>
+        <el-form-item
+          :label="$t('label.returnExpressNumber')"
+          label-width="150px"
+        >
+          <el-input
+            v-if="slFlag == '0'"
+            size="mini"
+            v-model="editShipp.shippingNo"
+            :placeholder="$t('place.pleaseFillIn')"
+            class="normal-input"
+          ></el-input>
+          <el-input
+            v-if="slFlag == '1'"
+            size="mini"
+            v-model="editShipp.shippingNo"
+            :placeholder="$t('place.pleaseFillIn')"
+            class="normal-input"
+            disabled
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogShippFormVisible = false">{{
+          $t("view.cancel")
+        }}</el-button>
+        <!--        <el-button-->
+        <!--          type="primary"-->
+        <!--          @click="editShippSub(1)"-->
+        <!--          v-loading="btnLoading"-->
+        <!--          >{{ $t("view.save") }}</el-button-->
+        <!--        >-->
+        <el-button
+          type="primary"
+          @click="editShippSub('')"
+          v-loading="btnLoading"
+          >{{ $t("view.confirm") }}</el-button
+        >
+      </div>
+    </el-dialog>
+
+    <el-dialog
+      :title="$t('title.nullify')"
+      :visible.sync="dialogFormCancelVisible"
+      v-if="dialogFormCancelVisible"
+      :close-on-click-modal="false"
+    >
+      <el-form :model="cancelForm">
+        <el-form-item :label="$t('label.cancellationNote')" label-width="120px">
+          <el-input
+            type="textarea"
+            :placeholder="$t('place.enterContent')"
+            v-model="cancelForm.zfnotes"
+            maxlength="150"
+            show-word-limit
+          >
+          </el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormCancelVisible = false">{{
+          $t("view.cancel")
+        }}</el-button>
+        <el-button
+          type="primary"
+          @click="cancelSubmit"
+          v-loading="btnLoading"
+          >{{ $t("view.confirm") }}</el-button
+        >
+      </div>
+    </el-dialog>
+    <!--售后-->
+    <el-dialog
+      :title="$t('orderRefund')"
+      :fullscreen="true"
+      v-if="orderRefundVisible"
+      :visible.sync="orderRefundVisible"
+    >
+      <orderRefundDialog
+        :refundId="currentRefundId"
+      ></orderRefundDialog>
+      <el-button type="danger" style="float:right" @click="backTable">{{
+        $t("back")
+      }}</el-button>
+    </el-dialog>
+
+    <el-dialog
+      :title="$t('orderRefund')"
+      :fullscreen="true"
+      v-if="orderRefundNewVisible"
+      :visible.sync="orderRefundNewVisible"
+    >
+      <orderRefundNewDialog
+        :refundId="currentRefundId"
+      ></orderRefundNewDialog>
+      <el-button type="danger" style="float:right" @click="backTable">{{
+        $t("back")
+      }}</el-button>
+    </el-dialog>
+
+    <el-dialog
+      :title="$t('title.createRefundOrder')"
+      :fullscreen="true"
+      v-if="createRefundVisible"
+      :visible.sync="createRefundVisible"
+    >
+      <createRefundDialog></createRefundDialog>
+      <el-button type="danger" style="float:right" @click="backTable">{{
+        $t("back")
+      }}</el-button>
+    </el-dialog>
+
+    <el-dialog
+      :title="$t('title.importRefund')"
+      :visible.sync="dialogFormUploadVisible"
+      width="38%"
+      :destroy-on-close="destroyOnClose"
+    >
+      <el-form>
+        <el-form-item :label="$t('label.exportTemplate')">
+          <el-button class="filter-item" @click="downloadMould" type="primary">
+            {{ $t("exportTemplate") }}
+          </el-button>
+        </el-form-item>
+
+        <el-form-item :label="$t('label.importData')">
+          <el-upload
+            ref="upload"
+            :limit="2"
+            accept=".xlsx"
+            :headers="headers"
+            :action="upload.url + '?updateSupport=' + upload.updateSupport"
+            :disabled="upload.isUploading"
+            :on-progress="handleFileUploadProgress"
+            :on-success="handleFileSuccess"
+            :auto-upload="false"
+            drag
+          >
+            <i class="el-icon-upload"></i>
+            <div class="el-upload__text">
+              {{ $t("view.uploadFile") }}<em>{{ $t("view.clickUp") }}</em>
+            </div>
+            <div class="el-upload__tip" slot="tip">
+              {{ $t("view.xlsxFormatOnly") }}
+            </div>
+          </el-upload>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormUploadVisible = false">{{
+          $t("view.cancel")
+        }}</el-button>
+        <el-button type="primary" @click="submitUploadList">{{
+          $t("view.confirm")
+        }}</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog
+      :title="$t('addNote')"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :visible.sync="addNoteVisible"
+      width="40%"
+      v-loading="listLoading"
+    >
+      <el-form ref="addNoteForm" :model="addNoteForm" label-width="auto">
+        <el-form-item :label="$t('label.refundNumber')" prop="orderRefundId">
+          <el-input
+            disabled
+            v-model="addNoteForm.orderRefundId"
+            placeholder
+            class="normal-input"
+            style="width: 400px"
+          ></el-input>
+        </el-form-item>
+        <el-form-item :label="$t('label.serviceNote')" prop="note">
+          <el-input
+            type="textarea"
+            v-model="addNoteForm.note"
+            :placeholder="$t('setOrderNote')"
+            class="normal-input"
+          ></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="submit">{{ $t("save") }}</el-button>
+          <el-button type="danger" @click="addNoteVisible = false">{{
+            $t("back")
+          }}</el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+
+    <el-dialog
+      :title="$t('cargoTrack')"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :visible.sync="cargoTrackVisible"
+      width="40%"
+      v-loading="listLoading">
+      <cargoTrackDialog :refundNo='selectedRefundNo'></cargoTrackDialog>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import waves from "@/directive/waves";
+import swPage from "@/views/common/swPage";
+import global from "@/views/oms/global";
+import refundInfoDialog from "./refundDetail";
+import { getToken } from "@/utils/auth";
+import {
+  fetchList,
+  updateshipping,
+  cancel,
+  warehouseList,
+  rejectRefund,
+  addNote,
+  manualRefundSuccess,
+  batchReview,
+  getRefundType,
+  getRefundReason,
+  verifyExport
+} from "@/api/oms/refund/refund";
+import { dcmAdd } from "@/utils/toolUtil";
+import { fetchList as orderFetchList } from "@/api/oms/order/order";
+import orderRefundDialog from "@/views/oms/refund/components/orderRefundDialog";
+import orderRefundNewDialog from "@/views/oms/refund/components/orderRefundNewDialog";
+import createRefundDialog from "@/views/oms/refund/components/createRefundDialog";
+import cargoTrackDialog from "@/views/oms/refund/components/cargoTrackDialog";
+import log from "@/router/modules/log";
+import { queryChannelStore, queryChannel } from "@/api/oms/inventory/inventory";
+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: "refundList",
+  directives: {
+    waves
+  },
+  components: {
+    swPage,
+    refundInfoDialog,
+    global,
+    orderRefundDialog,
+    orderRefundNewDialog,
+    createRefundDialog,
+    cargoTrackDialog
+  },
+  filters: {
+    refundAccountTypeFilter(key, that) {
+      return that.$t(refundAccountTypeKeyValue[key]);
+    },
+    refundMethodFilter(key, that) {
+      return that.$t(refundMethodKeyValue[key]);
+    },
+    statusFilter(key, that) {
+      var value = "";
+      global.afterSaleStatus.forEach(status => {
+        if (status.value == key) {
+          value = that.$t(status.label);
+        }
+      });
+      return value;
+    },
+    refundTypeFilter(key, that) {
+      var value = "";
+      global.afterSaleType.forEach(refundType => {
+        if (refundType.value == key) {
+          value = that.$t(refundType.label);
+        }
+      });
+      return value;
+    }
+  },
+  data() {
+    return {
+      that: this,
+      dialogSize: "40%",
+      direction: "rtl",
+      fileList: [],
+      tableKey: 0,
+      list: [],
+      total: 0,
+      listLoading: false,
+      destroyOnClose: true,
+      addNoteForm: {
+        id: null,
+        orderRefundId: "",
+        note: ""
+      },
+      addNoteVisible: false,
+      channel: [],
+      store: [],
+      //查询条件
+      listQuery: {
+        page: 1,
+        limit: 10,
+        storeId: "",
+        channelCode: "",
+        refundType: "",
+        reasonContentChinese: "",
+        shopify: "",
+        status: "",
+        exchangeFlag: "",
+        ordersNo: "",
+        ormRefundId: "",
+        ormorder: "",
+        originatorFlag: "",
+        refundNo: "",
+        timeplacedLaggerThanEqual: null,
+        timeplacedLessThanEqual: null,
+        sendEmailFlag:"",
+        signInStatus: null,
+      },
+      dialogFormUploadVisible: false,
+      formLabelWidth: "120px",
+      createTimePicker: null,
+      multipleSelection: [],
+      selectionList: [],
+      channelCodes: global.channelCodes, //渠道编码
+      afterSaleStatus: global.afterSaleStatus, //售后状态
+      afterSaleTypes: global.afterSaleType, //售后类型
+      applyTypes: global.applyType, //售后来源
+      signInStatus: global.signInStatusType,
+      refundReason: [],
+      refundReasonList: [],
+      stores: [],
+      refundInfoVisible: false,
+      currentRefundId: "",
+      upload: {
+        // 是否显示弹出层(导入)
+        open: false,
+        // 弹出层标题(导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        // 上传的地址(后台接口)
+        url: process.env.VUE_APP_OMS_API + "/ordersRefund/uploadExcel"
+      },
+      editShipp: {
+        id: null,
+        shipmodeId: "",
+        shippingNo: "",
+        warehouseCode: "",
+        slUseable: "",
+        slFlag: ""
+      },
+      dialogShippFormVisible: false,
+      dialogFormCancelVisible: false,
+      cancelForm: {
+        refundNo: "",
+        zfnotes: ""
+      },
+      baseURL: process.env.VUE_APP_OMS_API,
+      warehouseItems: [],
+      btnLoading: false,
+      orderRefundVisible: false,
+      orderRefundNewVisible: false,
+      createRefundVisible: false,
+      currentOrdersId: "",
+      action: "", //  view  cus_check  t_check
+      slFlag: "0",
+      staging: {
+        shipmodeId: "",
+        shippingNo: ""
+      },
+      cargoTrackVisible:false,
+      selectedRefundNo:'',
+    };
+  },
+  created() {
+    //获取店铺列表
+    this.getStores();
+    this.getList();
+    this.getChannel();
+    this.getStore();
+    this.queryRefundReason();
+  },
+  activated() {
+    this.getList();
+  },
+  computed: {
+    // 计算属性的 getter
+    headers: function() {
+      return {
+        "X-Token": getToken()
+      };
+    }
+  },
+  methods: {
+    handleCargoTrack(e){
+      this.cargoTrackVisible = true;
+      this.selectedRefundNo = e.refundNo;
+    },
+    handleSuccess(e) {
+      this.$confirm("确认退款成功吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          var params = { id: e.id };
+
+          manualRefundSuccess(params).then(res => {
+            if (200 == res.code) {
+              this.$message({
+                type: "success",
+                message: "操作成功!"
+              });
+              this.getList();
+            }
+          });
+        })
+        .catch(() => {});
+    },
+    //获取stores
+    getStores() {},
+
+    getList() {
+      this.listLoading = true;
+      fetchList(this.listQuery).then(res => {
+        if (200 == res.code) {
+          this.total = res.data.total;
+          this.list = res.data.list;
+        }
+        this.listLoading = false;
+      });
+    },
+    retPage() {
+      //分页
+      this.getList();
+    },
+    getChannel() {
+      queryChannel({ storeId: this.listQuery.storeId }).then(res => {
+        if (200 == res.code) {
+          this.channel = res.data;
+        }
+      });
+    },
+    getStore() {
+      queryChannelStore({ channelCode: this.listQuery.channelCode }).then(
+        res => {
+          if (200 == res.code) {
+            this.store = res.data;
+          }
+        }
+      );
+    },
+    submitUploadList() {
+      this.$refs.upload.submit();
+    },
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    //文件上传成功返回
+    handleFileSuccess(response, file, fileList) {
+      if (file.response.code === 200) {
+        this.$message({
+          message: "导入成功",
+          type: "success"
+        });
+        this.dialogFormUploadVisible = false;
+      } else {
+        this.$message.error(file.response.msg + ",请重新上传");
+        //删除上传列表中,失败的文件
+        let index = 0;
+        for (const i in fileList) {
+          if (fileList[i] == file) {
+            index = i;
+            break;
+          }
+        }
+        //移出当前文件对象
+        fileList.splice(index, 1);
+      }
+      this.upload.open = false;
+      this.upload.isUploading = false;
+    },
+    //导出模板
+    downloadMould() {
+      var url = this.baseURL + "ordersRefund/downloadMould";
+      window.location.href = url;
+    },
+    handleFilter() {
+      this.listQuery.page = 1;
+      if (this.createTimePicker == null) {
+        this.listQuery.timeplacedLaggerThanEqual = "";
+        this.listQuery.timeplacedLessThanEqual = "";
+      } else {
+        this.listQuery.timeplacedLaggerThanEqual = this.createTimePicker[0];
+        this.listQuery.timeplacedLessThanEqual = this.createTimePicker[1];
+      }
+      this.getList();
+    },
+
+    exportExcel() {
+      this.listQuery.page = 1;
+      this.listLoading = true;
+      if (this.createTimePicker == null) {
+        this.listQuery.timeplacedLaggerThanEqual = "";
+        this.listQuery.timeplacedLessThanEqual = "";
+      } else {
+        this.listQuery.timeplacedLaggerThanEqual = this.createTimePicker[0];
+        this.listQuery.timeplacedLessThanEqual = this.createTimePicker[1];
+      }
+
+      verifyExport(this.listQuery)
+        .then(res => {
+          if (200 == res.code) {
+            var url =
+              this.baseURL +
+              "ordersRefund/export?storeId=" +
+              this.listQuery.storeId +
+              "&refundType=" +
+              this.listQuery.refundType +
+              "&status=" +
+              this.listQuery.status +
+              "&ormRefundId=" +
+              this.listQuery.ormRefundId +
+              "&ormorder=" +
+              this.listQuery.ormorder +
+              "&refundNo=" +
+              this.listQuery.refundNo +
+              "&channelCode=" +
+              this.listQuery.channelCode +
+              "&shopify=" +
+              encodeURIComponent(this.listQuery.shopify) +
+              "&timeplacedLaggerThanEqual=" +
+              this.listQuery.timeplacedLaggerThanEqual +
+              "&timeplacedLessThanEqual=" +
+              this.listQuery.timeplacedLessThanEqual;
+
+            window.location.href = url;
+          }
+          this.listLoading = false;
+        })
+        .catch(err => {
+          console.log(err);
+          this.listLoading = false;
+        });
+    },
+
+    //查看退款单详情
+    /**
+     *
+     * @param refundId 退款单号
+     * @param action 动作: view 查看 , cus_check 客服审核 f_check 财务审核
+     */
+    handleInfo(refundId, action) {
+      //进入退款单详情查看
+      this.currentRefundId = refundId;
+      this.action = action;
+      this.refundInfoVisible = true;
+    },
+    editInfo(row) {
+      //进入退款单详情查看
+      this.editShipp.id = row.id;
+      this.editShipp.shipmodeId = row.shipmodeId;
+      this.editShipp.shippingNo = row.shippingNo;
+      this.editShipp.warehouseCode = row.warehouseCode;
+      this.editShipp.slUseable = row.slUseable;
+      this.staging.shipmodeId = row.shipmodeId;
+      this.staging.shippingNo = row.shippingNo;
+      warehouseList().then(res => {
+        if (200 == res.code) {
+          this.warehouseItems = res.data;
+          this.shippingLabelOption();
+          this.dialogShippFormVisible = true;
+        }
+      });
+    },
+    editShippSub(flag) {
+      if (!this.editShipp.warehouseCode) {
+        this.$message.error("请选择收退仓库!");
+        return false;
+      }
+      if (!this.editShipp.shipmodeId) {
+        this.$message.error("请填写退货物流公司!");
+        return false;
+      }
+      if (!this.editShipp.shippingNo) {
+        this.$message.error("请填写退货快递单号!");
+        return false;
+      }
+      this.btnLoading = true;
+      this.editShipp.slFlag = this.slFlag;
+      updateshipping(this.editShipp).then(
+        res => {
+          if (200 == res.code) {
+            this.$message({
+              message: this.$t("optSuccess"),
+              type: "success"
+            });
+            this.editShipp = {
+              id: null,
+              shipmodeId: "",
+              shippingNo: "",
+              warehouseCode: "",
+              flag: flag
+            };
+            this.btnLoading = false;
+            this.dialogShippFormVisible = false;
+            this.getList();
+          }
+        },
+        error => {
+          this.btnLoading = false;
+        }
+      );
+    },
+    cancelInfo(row) {
+      this.cancelForm = {
+        refundNo: "",
+        zfnotes: ""
+      };
+      this.cancelForm.refundNo = row.refundNo;
+      this.dialogFormCancelVisible = true;
+    },
+    cancelSubmit() {
+      this.$confirm("确认作废/撤销, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          this.btnLoading = true;
+          cancel(this.cancelForm).then(
+            res => {
+              if (200 == res.code) {
+                this.$message({
+                  type: "success",
+                  message: "作废成功!"
+                });
+                this.cancelForm = {
+                  refundNo: "",
+                  zfnotes: ""
+                };
+                this.btnLoading = false;
+                this.dialogFormCancelVisible = false;
+                this.getList();
+              }
+            },
+            error => {
+              this.btnLoading = false;
+            }
+          );
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: this.$t("view.canceled")
+          });
+        });
+    },
+    refresh() {
+      this.getList();
+    },
+
+    //编辑退款申请
+    handleRefund(currentRefundId) {
+      this.currentRefundId = currentRefundId;
+      // this.currentOrdersId = ordersId;
+      this.orderRefundVisible = true;
+    },
+
+    //新建退款信息
+    createRefund(currentRefundId) {
+      this.currentRefundId = currentRefundId;
+      // this.currentOrdersId = ordersId;
+      this.orderRefundNewVisible = true;
+    },
+
+    //创建退款单(新逻辑)
+    createNewRefund() {
+      this.createRefundVisible = true;
+    },
+
+    reject(id, refundNo) {
+      rejectRefund(id, refundNo).then(res => {
+        if (res.code == 200) {
+          if (res.msg == "success") {
+            this.$message({
+              type: "success",
+              message: this.$t("view.rejectionSuccess")
+            });
+          } else {
+            this.$message({
+              message: res.msg,
+              type: "warning"
+            });
+          }
+          this.getList();
+        }
+      });
+    },
+    backTable() {
+      this.orderRefundVisible = false;
+      this.orderRefundNewVisible = false;
+      this.createRefundVisible = false;
+      this.getList();
+    },
+    handleAddNote(order) {
+      this.addNoteVisible = true;
+      this.addNoteForm.orderRefundId = order.refundNo;
+      this.addNoteForm.note = order.notes;
+      this.addNoteForm.id = order.id;
+    },
+    submit() {
+      this.listLoading = true;
+      addNote(this.addNoteForm).then(res => {
+        if (200 == res.code) {
+          this.$message({
+            message: this.$t("optSuccess"),
+            type: "success"
+          });
+          this.getList();
+          this.listLoading = false;
+          this.addNoteVisible = false;
+        }
+      });
+    },
+    // 展示红色背景
+    tableRowStyleName({ row }) {
+      if (row.totalCount) {
+        return "color: red !important;";
+      }
+    },
+    selectEnable(row, index) {
+      if (row.refundType === "2" && row.status === "0") {
+        return 1;
+      } else if (row.refundType === "3" && row.status === "0") {
+        return 1;
+      } else {
+        return 0;
+      }
+    },
+    //获取多选选中数据
+    handleSelectionChange(val) {
+      // val拿到的是选中行的全部数据,而this.multipleSelection是把val以对象装在数组中
+      this.multipleSelection = val;
+      // 每次都清空存储的数据,并装入新数据
+      this.selectionList = [];
+      for (const val of this.multipleSelection) {
+        this.selectionList.push(val);
+      }
+    },
+
+    batchCheck() {
+      this.$confirm("确定批量审核?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          this.listLoading = true;
+          batchReview(this.selectionList)
+            .then(res => {
+              if (200 == res.code) {
+                this.$message({
+                  message: this.$t("optSuccess"),
+                  type: "success"
+                });
+              }
+              this.getList();
+              this.listLoading = false;
+            })
+            .catch(err => {
+              this.getList();
+              this.listLoading = false;
+            });
+        })
+        .catch(() => {
+          this.btnLoading = false;
+          this.btndisabled = true;
+          this.$message({
+            type: "info",
+            message: "已取消操作"
+          });
+        });
+    },
+    queryRefundType(value) {
+      console.log(value);
+      this.listQuery.reasonContentChinese = value.join(",");
+    },
+
+    queryRefundReason() {
+      getRefundReason({ reasonType: this.listQuery.refundType }).then(res => {
+        if (200 == res.code) {
+          this.refundReason = res.data;
+        }
+      });
+    },
+    // releaseEx(row){
+    //   console.log(row)
+    //   releaseExceptions(row.id).then(res => {
+    //     if(200 == res.code){
+    //       this.$message({
+    //         message: "操作成功",
+    //         type: "success"
+    //       });
+    //       this.getList();
+    //     }
+    //   })
+    // },
+    shippingLabelOption() {
+      this.changeSL();
+    },
+    changeSL() {
+      if (this.slFlag == "1") {
+        this.editShipp.shipmodeId = "/";
+        this.editShipp.shippingNo = "/";
+      } else {
+        this.editShipp.shipmodeId = this.staging.shipmodeId;
+        this.editShipp.shippingNo = this.staging.shippingNo;
+      }
+    }
+  }
+};
+</script>
+
+<style scoped>
+.cell > span {
+  white-space: nowrap !important;
+}
+.el-button+.el-button {
+    margin-left: 10px;
+    margin-top: 10px;
+}
+</style>

+ 456 - 0
src/views/oms/refund-old/refundReason.vue

@@ -0,0 +1,456 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <el-select
+        v-model="listQuery.reasonType"
+        :clearable="true"
+        class="filter-item"
+        style="width: 200px;"
+        :placeholder="$t('place.refundType')"
+      >
+        <el-option
+          v-for="item in statuses"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value"
+        >
+        </el-option>
+      </el-select>
+
+      <el-input
+        :placeholder="$t('place.refundReasonContent')"
+        style="width: 200px;"
+        :clearable="true"
+        class="filter-item"
+        v-model="listQuery.reasonContent"
+      />
+
+      <el-button
+        class="filter-item"
+        type="primary"
+        icon="el-icon-search"
+        @click="handleFilter"
+        >{{ $t("view.search") }}</el-button
+      >
+      <el-button
+        class="filter-item"
+        style="margin-left: 10px;"
+        type="primary"
+        icon="el-icon-circle-plus"
+        @click="handleCreate"
+        >{{ $t("view.create") }}</el-button
+      >
+    </div>
+
+    <el-table
+      style="width: 100%;"
+      v-loading="listLoading"
+      :key="tableKey"
+      :data="list"
+      row-key="id"
+      stripe
+      border
+      fit
+      highlight-current-row
+    >
+      <el-table-column align="center" type="index"> </el-table-column>
+
+      <el-table-column
+        :label="$t('label.refundType')"
+        width="150"
+        align="center"
+        prop="reasonType"
+      >
+        <template slot-scope="scope">
+          {{ scope.row.reasonType | typeFilter(that) }}
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.refundContentChinese')"
+        width="250"
+        align="center"
+        prop="reasonContentChinese"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.refundContentEnglish')"
+        width="250"
+        align="center"
+        prop="reasonContentEnglish"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.order')"
+        width="50"
+        align="center"
+        prop="sorts"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.adder')"
+        width="150"
+        align="center"
+        prop="createUser"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.addTime')"
+        width="200"
+        align="center"
+        prop="createTime"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.modifier')"
+        width="150"
+        align="center"
+        prop="updateUser"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.modifyTime')"
+        width="200"
+        align="center"
+        prop="updateTime"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.operation')"
+        fixed="right"
+        width="z0"
+        align="left"
+      >
+        <template slot-scope="scope">
+          <el-button
+            v-if="scope.row.status == '1'"
+            type="success"
+            class="line_button"
+            size="mini"
+            v-waves
+            @click="handleEdit(scope.row)"
+            >{{ $t("view.modify") }}</el-button
+          >
+          <el-button
+            v-if="scope.row.status == '1'"
+            type="danger"
+            class="line_button"
+            size="mini"
+            v-waves
+            @click="enableInfo(scope.row)"
+            >{{ $t("view.disable") }}</el-button
+          >
+
+          <el-button
+            v-if="scope.row.status == '0'"
+            type="danger"
+            class="line_button"
+            size="mini"
+            v-waves
+            @click="enableInfo(scope.row)"
+            >{{ $t("view.enable") }}</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 分页 -->
+    <swPage
+      v-if="total > 0"
+      key="2"
+      :listQuery="listQuery"
+      :total="total"
+      pos="btmRight"
+      @retPage="retPage"
+    />
+    <!-- 退款理由编辑-->
+    <el-dialog
+      :title="$t('title.editRefundReason')"
+      v-if="refundReasonEditVisible"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :visible.sync="refundReasonEditVisible"
+      width="30%"
+    >
+      <el-form ref="warehouseForm" :model="refundReasonForm" label-width="auto">
+        <el-form-item :label="$t('label.refundType')" v-if="stepFlag == 'save'">
+          <el-select
+            clearable
+            v-model="refundReasonForm.reasonType"
+            :placeholder="$t('place.refundType')"
+            class="normal-input"
+          >
+            <el-option
+              key="1"
+              :label="$t('label.refundOnly')"
+              value="1"
+            ></el-option>
+            <el-option
+              key="2"
+              :label="$t('label.unshippedRefund')"
+              value="2"
+              selected
+            ></el-option>
+            <el-option
+              key="3"
+              :label="$t('label.returnRefund')"
+              value="3"
+              selected
+            ></el-option>
+            <el-option
+              key="4"
+              :label="$t('label.other')"
+              value="4"
+              selected
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item
+          :label="$t('label.refundContentChinese')"
+          prop="note"
+          v-if="stepFlag == 'save'"
+        >
+          <el-input
+            type="textarea"
+            :placeholder="$t('place.enterContent')"
+            v-model="refundReasonForm.reasonContentChinese"
+            maxlength="150"
+            show-word-limit
+          >
+          </el-input>
+        </el-form-item>
+        <el-form-item
+          :label="$t('label.refundContentEnglish')"
+          prop="note"
+          v-if="stepFlag == 'save'"
+        >
+          <el-input
+            type="textarea"
+            :placeholder="$t('place.enterContent')"
+            v-model="refundReasonForm.reasonContentEnglish"
+            maxlength="150"
+            show-word-limit
+          >
+          </el-input>
+        </el-form-item>
+
+        <el-form-item :label="$t('label.customSwitch')" prop="note">
+          <el-select
+            clearable
+            v-model="refundReasonForm.custom"
+            :placeholder="$t('place.selectCustomSwitch')"
+            class="normal-input"
+          >
+            <el-option key="1" :label="$t('label.on')" value="1"></el-option>
+            <el-option
+              key="0"
+              :label="$t('label.off')"
+              value="0"
+              selected
+            ></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item :label="$t('label.order')" prop="sorts">
+          <el-input
+            :placeholder="$t('place.smallerNumberEarlier')"
+            style="width: 200px;"
+            :clearable="true"
+            class="filter-item"
+            type="number"
+            v-model="refundReasonForm.sorts"
+          />
+        </el-form-item>
+
+        <el-form-item>
+          <el-button type="primary" @click="editRefundReasonSubmit">{{
+            $t("determine")
+          }}</el-button>
+          <el-button type="danger" @click="editRefundReasonCancel">{{
+            $t("back")
+          }}</el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  fetchList,
+  editReason,
+  updateStatus,
+  update
+} from "@/api/oms/inventory/refundReason";
+import global from "@/views/oms/global.vue";
+import swPage from "@/views/common/swPage.vue";
+import { editWarehouse } from "@/api/oms/inventory/warehouse";
+export default {
+  name: "refundReason",
+  components: {
+    swPage
+  },
+  filters: {
+    typeFilter(key, that) {
+      var value = "";
+      global.afterSaleType.forEach(refundType => {
+        if (refundType.value == key) {
+          value = that.$t(refundType.label);
+        }
+      });
+      return value;
+    }
+  },
+  data() {
+    return {
+      that: this,
+      tableKey: 0,
+      list: [],
+      total: 0,
+      def: "0",
+      listLoading: false,
+      destroy: true,
+      listQuery: {
+        page: 1,
+        limit: 10,
+        reasonType: "",
+        reasonContent: ""
+      },
+      stepFlag: "",
+      refundReasonForm: {
+        id: "",
+        reasonType: "",
+        reasonContentEnglish: "",
+        reasonContentChinese: "",
+        custom: "0",
+        status: "",
+        sorts: ""
+      },
+      statuses: [
+        { value: "1", label: "仅退款" },
+        { value: "2", label: "未发货退款" },
+        { value: "3", label: "退货退款" },
+        { value: "4", label: "其他" }
+      ],
+      flag: false,
+      refundReasonEditVisible: false
+    };
+  },
+  created() {
+    this.getList();
+  },
+  activated() {
+    this.getList();
+  },
+  methods: {
+    getList() {
+      this.listLoading = true;
+      fetchList(this.listQuery).then(res => {
+        if (200 == res.code) {
+          this.total = res.data.total;
+          this.list = res.data.list;
+        }
+        this.listLoading = false;
+      });
+    },
+    retPage() {
+      //分页
+      this.getList();
+    },
+    handleEdit(refundReasonForm) {
+      this.stepFlag = "update";
+      (this.refundReasonForm.id = refundReasonForm.id),
+        (this.refundReasonForm.reasonType = refundReasonForm.reasonType),
+        (this.refundReasonForm.reasonContentEnglish =
+          refundReasonForm.reasonContentEnglish),
+        (this.refundReasonForm.reasonContentChinese =
+          refundReasonForm.reasonContentChinese),
+        (this.refundReasonForm.custom = refundReasonForm.custom),
+        (this.refundReasonForm.status = refundReasonForm.status),
+        (this.refundReasonForm.sorts = refundReasonForm.sorts),
+        (this.refundReasonEditVisible = true);
+    },
+    editRefundReasonSubmit() {
+      var refundReason = {
+        id: this.refundReasonForm.id,
+        reasonType: this.refundReasonForm.reasonType,
+        reasonContentChinese: this.refundReasonForm.reasonContentChinese,
+        reasonContentEnglish: this.refundReasonForm.reasonContentEnglish,
+        custom: this.refundReasonForm.custom,
+        sorts: this.refundReasonForm.sorts
+      };
+      if (this.stepFlag == "save") {
+        if (refundReason.reasonType == "") {
+          alert("请选择退款类型");
+          return;
+        }
+        if (
+          refundReason.reasonContentChinese == "" &&
+          refundReason.reasonContentEnglish == ""
+        ) {
+          alert("请输入退款原因");
+          return;
+        }
+        editReason(refundReason).then(res => {
+          if (200 == res.code) {
+            this.$message({
+              message: this.$t("optSuccess"),
+              type: "success"
+            });
+            this.getList();
+          }
+        });
+      } else if (this.stepFlag == "update") {
+        update(refundReason).then(res => {
+          if (200 == res.code) {
+            this.$message({
+              message: this.$t("optSuccess"),
+              type: "success"
+            });
+            this.getList();
+          }
+        });
+      }
+
+      this.refundReasonEditVisible = false;
+    },
+    enableInfo(refundReason) {
+      updateStatus(refundReason).then(res => {
+        if (200 == res.code) {
+          this.$message({
+            message: this.$t("optSuccess"),
+            type: "success"
+          });
+          this.getList();
+        }
+      });
+    },
+    clean() {
+      this.refundReasonForm.reasonType = "";
+      this.refundReasonForm.reasonContentEnglish = "";
+      this.refundReasonForm.reasonContentChinese = "";
+      this.refundReasonForm.custom = "0";
+      this.refundReasonForm.sorts = "";
+    },
+    editRefundReasonCancel() {
+      this.refundReasonEditVisible = false;
+    },
+    handleCreate() {
+      this.clean();
+      this.stepFlag = "save";
+      this.refundReasonEditVisible = true;
+    },
+    handleFilter() {
+      this.listQuery.page = 1;
+      this.getList();
+    }
+  }
+};
+</script>

+ 399 - 0
src/views/oms/refund-old/returnDetail.vue

@@ -0,0 +1,399 @@
+<template>
+  <div>
+    <el-card class="box-card">
+      <!-- 基本信息-->
+      <el-descriptions
+        :title="$t('title.basicInformation')"
+        :colon="false"
+        border
+      >
+        <el-descriptions-item :label="$t('label.shopName')"
+          >{{ returnInfo.storeName }}
+          <i
+            style="color:blue;"
+            class="el-icon-document-copy"
+            :title="$t('title.copy')"
+            :copy-value="returnInfo.storeName"
+            v-on:click="copy"
+          ></i
+        ></el-descriptions-item>
+        <el-descriptions-item :label="$t('label.onlineShopOrder')">{{
+          returnInfo.ormorder
+        }}</el-descriptions-item>
+        <el-descriptions-item :label="$t('label.documentStatus')">{{
+          returnInfo.status | statusFilter
+        }}</el-descriptions-item>
+        <el-descriptions-item :label="$t('label.creator')">{{
+          returnInfo.createBy
+        }}</el-descriptions-item>
+        <el-descriptions-item :label="$t('label.createTime')" span="2">{{
+          returnInfo.createTime
+        }}</el-descriptions-item>
+        <el-descriptions-item label="退件目的仓">{{
+          returnInfo.warehouseName
+        }}</el-descriptions-item>
+        <el-descriptions-item label="退件目的仓编码"
+          >{{ returnInfo.warehouseCode }}
+          <i
+            style="color:blue;"
+            class="el-icon-document-copy"
+            :title="$t('title.copy')"
+            :copy-value="returnInfo.ormorder"
+            v-on:click="copy"
+          ></i
+        ></el-descriptions-item>
+        <el-descriptions-item label="退件物流单号"
+          >{{ returnInfo.shippingNo }}
+          <i
+            style="color:blue;"
+            class="el-icon-document-copy"
+            :title="$t('title.copy')"
+            :copy-value="returnInfo.ordersNo"
+            v-on:click="copy"
+          ></i
+        ></el-descriptions-item>
+        <el-descriptions-item :label="$t('noheadFlag')" span="1"
+        >
+          <div style="color: red" v-if="
+          returnInfo.noheadFlag == 1
+          "
+          >
+            {{ $t("yes") }}
+          </div>
+          <div style="color: red"
+            v-if="
+              returnInfo.noheadFlag == 0
+            "
+          >
+            {{ $t("no") }}
+          </div>
+
+        </el-descriptions-item>
+        <el-descriptions-item  :label="$t('label.isSelfPickupOrder')" span="1">
+          <span v-if="returnInfo.isSelfPickupOrder === false">{{ $t("no") }}</span>
+          <span v-else>{{ $t("yes") }}</span>
+        </el-descriptions-item>
+
+        <el-descriptions-item :label="$t('label.shopifyNumber')" span="1"
+        >{{ returnInfo.cutUser }}
+        </el-descriptions-item>
+      </el-descriptions>
+    </el-card>
+    <el-card class="box-card">
+      <!-- 基本信息-->
+      <el-descriptions :title="$t('sender')" :colon="false" border>
+        <el-descriptions-item :label="$t('country')" span="3">{{
+          returnInfo.orderReceiverCountry
+        }}</el-descriptions-item>
+        <el-descriptions-item :label="$t('state')">{{
+          returnInfo.orderReceiverState
+        }}</el-descriptions-item>
+        <el-descriptions-item :label="$t('city')">{{
+          returnInfo.orderReceiverCity
+        }}</el-descriptions-item>
+        <el-descriptions-item :label="$t('suburb')">{{
+          returnInfo.orderReceiverDistrict
+        }}</el-descriptions-item>
+        <el-descriptions-item :label="$t('street')" span="3">{{
+          returnInfo.orderReceiverStreet
+        }}</el-descriptions-item>
+        <el-descriptions-item :label="$t('address')" span="3">{{
+          returnInfo.orderReceiverAddress1
+        }}</el-descriptions-item>
+        <el-descriptions-item :label="$t('dooeNo')" span="2">{{
+          returnInfo.orderReceiverAddress2
+        }}</el-descriptions-item>
+        <el-descriptions-item :label="$t('senders')">{{
+          returnInfo.orderReceiverName
+        }}</el-descriptions-item>
+      </el-descriptions>
+    </el-card>
+
+    <el-card class="box-card">
+      <el-descriptions
+        :title="$t('returnItem') + '-' + (index + 1)"
+        v-for="(item, index) in returnOrderItemInfo"
+        :key="index"
+        :colon="false"
+        border
+      >
+        <el-descriptions-item
+          :label="$t('onlyCode')"
+          span="3"
+          v-if="item.uniqueCode"
+          >{{ item.uniqueCode }}
+          <!--          <el-input-->
+          <!--            style="width: 450px;"-->
+          <!--            class="filter-item"-->
+          <!--            v-model="item.uniqueCode"-->
+          <!--          />-->
+        </el-descriptions-item>
+        <el-descriptions-item :label="$t('sku')"
+          >{{ 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('goodsName')" span="2">{{
+          item.tittle
+        }}</el-descriptions-item>
+        <el-descriptions-item :label="$t('status')"
+          >{{ item.status | statusFiltr2 }}
+        </el-descriptions-item>
+        <el-descriptions-item :label="$t('update')" span="2">{{
+          item.updateTime
+        }}</el-descriptions-item>
+        <el-descriptions-item
+          v-if="confirmSh == 2"
+          :label="$t('returngoodsType')"
+          span="1"
+        >
+          {{ item.receiveType | receiveTypeFilter }}
+        </el-descriptions-item>
+        <el-descriptions-item
+          v-if="confirmSh == 2"
+          :label="$t('inboundStatus')"
+          span="2"
+        >
+          {{ item.inboundStatusShow | inboundStatusFilter }}
+        </el-descriptions-item>
+        <el-descriptions-item :label="$t('appAmount')"
+          >{{ item.applyQuantity }}
+        </el-descriptions-item>
+        <el-descriptions-item :label="$t('recAmount')" span="2"
+          >{{ item.receiveQuantity }}
+        </el-descriptions-item>
+
+        <el-descriptions-item
+          v-if="confirmSh == 1"
+          :label="$t('returngoodsType')"
+        >
+          <el-select
+            :placeholder="$t('place.pleaseSelect')"
+            clearable
+            size="mini"
+            style="width: 100px;"
+            class="filter-item"
+            v-model="item.receiveType"
+          >
+            <el-option
+              v-for="re in receiveTypeList"
+              :key="re.value"
+              :label="re.label"
+              :value="re.value"
+            >
+            </el-option>
+          </el-select>
+        </el-descriptions-item>
+        <el-descriptions-item
+          v-if="confirmSh == 1"
+          :label="$t('enterAmount')"
+          span="2"
+        >
+          <el-input-number
+            v-model="item.confirmShNum"
+            size="mini"
+            :min="1"
+            :max="item.applyQuantity + item.receiveQuantity"
+          ></el-input-number>
+        </el-descriptions-item>
+
+        <el-descriptions-item
+          v-if="confirmSh == 1"
+          :label="$t('inboundStatus')"
+        >
+          <el-select
+            size="mini"
+            style="width: 100px;"
+            class="filter-item"
+            v-model="item.inboundStatus"
+          >
+            <el-option value="success_manual" :label="$t('label.manualReturn')" />
+            <el-option value="returning" :label="$t('label.inReturnTransit')" />
+            <el-option value="shipLost" :label="$t('label.shipmentLost')" />
+            <el-option value="returnLost" :label="$t('label.returnLost')" />
+          </el-select>
+        </el-descriptions-item>
+        <el-descriptions-item v-if="confirmSh == 1" :label="$t('actions')">
+          <!-- <template slot="label"> -->
+          <el-button
+            type="success"
+            @click="confirmShClick(item)"
+            v-if="item.status != '01'"
+            v-loading="btnLoading"
+            >{{ $t("receives") }}</el-button
+          >
+          <!-- </template> -->
+        </el-descriptions-item>
+      </el-descriptions>
+    </el-card>
+
+    <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.createTime"
+        >
+          {{ log.operator }} :{{ log.statusNotes }}
+        </el-timeline-item>
+      </el-timeline>
+    </el-card>
+  </div>
+</template>
+
+<script>
+import { handleClipboard } from "@/api/oms/copy";
+import { getReturnInfo, updateConfirmSh } from "@/api/oms/return/return";
+import global from "@/views/oms/global";
+import { queryByOrdersId } from "@/api/oms/order/address";
+import { dcmAdd, dcmSub, accDiv, accMul } from "@/utils/toolUtil";
+export default {
+  name: "returnInfoDialog",
+  props: ["returnId", "confirmSh"],
+  components: {},
+  data() {
+    return {
+      afterSaleStatusSuccess: global.afterSaleStatusSuccess,
+      returnInfo: {},
+      returnOrderItemInfo: {},
+      checkData: {},
+      btndisabled: true,
+      receiveTypeList: global.receiveType,
+      btnLoading: false,
+      logs: []
+    };
+  },
+  filters: {
+    statusFilter(key) {
+      var value = "";
+      global.returnStatus.forEach(status => {
+        if (status.value == key) {
+          console.log(status.label);
+          value = status.label;
+        }
+      });
+      return value;
+    },
+    statusFiltr2(key) {
+      var value = "";
+      global.returnDeatilStatus.forEach(status => {
+        if (status.value == key) {
+          console.log(status.label);
+          value = status.label;
+        }
+      });
+      return value;
+    },
+    receiveTypeFilter(key) {
+      var value = "";
+      global.receiveType.forEach(type => {
+        if (type.value == key) {
+          // console.log(type.label);
+          value = type.label;
+        }
+      });
+      return value;
+    },
+    inboundStatusFilter(key) {
+      var value = "";
+      global.inboundStatus.forEach(type => {
+        if (type.value == key) {
+          // console.log(type.label);
+          value = type.label;
+        }
+      });
+      return value;
+    }
+  },
+  created() {
+    this.getReturnInfo();
+  },
+  methods: {
+    getReturnInfo() {
+      getReturnInfo(this.returnId).then(res => {
+        if (200 == res.code) {
+          this.returnInfo = res.data;
+          this.returnOrderItemInfo = res.data.items;
+          this.logs = res.data.logItems;
+        }
+      });
+    },
+    //复制
+    copy(event) {
+      console.log(event.target.attributes["copy-value"].value);
+      var text = event.target.attributes["copy-value"].value;
+      handleClipboard(text, event);
+    },
+    confirmShClick(row) {
+      this.btnLoading = true;
+      if (!row.receiveType) {
+        this.$message.error("请选择签收货品类型!");
+        this.btnLoading = false;
+        return false;
+      }
+      if (!row.confirmShNum) {
+        this.$message.error("请输入收货数量!");
+        this.btnLoading = false;
+        return false;
+      }
+      if (!row.inboundStatus) {
+        this.$message.error("请选择入库状态!");
+        this.btnLoading = false;
+        return false;
+      }
+      // if (!row.uniqueCode) {
+      //   this.$message.error("请输入唯一码!");
+      //   this.btnLoading = false;
+      //   return false;
+      // }
+
+      this.$confirm("是否确认收货?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          updateConfirmSh(row).then(
+            res => {
+              if (200 == res.code) {
+                this.$message({
+                  message: "操作成功",
+                  type: "success"
+                });
+                if (row.receiveQuantity > 0) {
+                  row.receiveQuantity = dcmAdd(
+                    row.receiveQuantity,
+                    row.confirmShNum
+                  );
+                } else {
+                  row.receiveQuantity = row.confirmShNum;
+                }
+
+                this.btnLoading = false;
+              }
+            },
+            error => {
+              this.btnLoading = false;
+            }
+          );
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消操作"
+          });
+          this.btnLoading = false;
+        });
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 980 - 0
src/views/oms/refund-old/returnDetailList.vue

@@ -0,0 +1,980 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <el-select
+        :placeholder="$t('ordersStatus')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.status"
+      >
+        <el-option
+          v-for="it in returnStatusList"
+          :key="it.value"
+          :label="it.label"
+          :value="it.value"
+        >
+        </el-option>
+      </el-select>
+      <el-select
+        :placeholder="$t('returngoodsType')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.receiveType"
+      >
+        <el-option
+          v-for="re in receiveTypeList"
+          :key="re.value"
+          :label="re.label"
+          :value="re.value"
+        >
+        </el-option>
+      </el-select>
+
+<!--      <el-select-->
+<!--        v-model="listQuery.channelCode"-->
+<!--        :clearable="true"-->
+<!--        class="filter-item"-->
+<!--        style="width: 200px;"-->
+<!--        :placeholder="$t('place.channel')"-->
+<!--        @change="getStore"-->
+<!--      >-->
+<!--        <el-option-->
+<!--          v-for="item in channel"-->
+<!--          :key="item.code"-->
+<!--          :label="item.name"-->
+<!--          :value="item.code"-->
+<!--        >-->
+<!--        </el-option>-->
+<!--      </el-select>-->
+      <el-select
+        v-model="listQuery.storeId"
+        :clearable="true"
+        filterable
+        class="filter-item"
+        style="width: 200px;"
+        :placeholder="$t('place.shopName')"
+        @change="getChannel"
+      >
+        <el-option
+          v-for="item in store"
+          :key="item.storeId"
+          :label="item.storeName"
+          :value="item.storeId"
+        >
+        </el-option>
+      </el-select>
+      <el-input
+        :placeholder="$t('label.returnNoCode')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.returnId"
+      />
+      <el-input
+        :placeholder="$t('returnorderNo')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.refundId"
+      />
+      <el-input
+        :placeholder="$t('onlineSaleNo')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.ormorder"
+      />
+      <el-input
+      :placeholder="$t('label.shopifyNumber')"
+      clearable
+      style="width: 200px;"
+      class="filter-item"
+      v-model="listQuery.shopify"
+      />
+      <el-input
+        :placeholder="$t('label.externalBillNo')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.externalBillNo"
+      />
+      <el-input
+        :placeholder="$t('returnShipNo')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.shippingNo"
+      />
+
+      <el-select
+        :placeholder="$t('returnTo')"
+        style="width: 200px;"
+        class="filter-item"
+        clearable
+        filterable
+        v-model="listQuery.warehouseCode"
+      >
+        <el-option
+          v-for="item in warehouse"
+          :key="item.returnWarehouseCode"
+          :label="item.returnWarehouseName"
+          :value="item.returnWarehouseCode"
+        />
+      </el-select>
+
+      <el-date-picker
+        class="filter-item"
+        style="display: inline-flex;"
+        v-model="createTimePicker"
+        type="datetimerange"
+        :range-separator="$t('to')"
+        :start-placeholder="$t('buildEndTime')"
+        :end-placeholder="$t('buildStartTime')"
+        value-format="yyyy-MM-dd HH:mm:ss"
+        :default-time="['00:00:00', '23:59:59']"
+      >
+      </el-date-picker>
+
+      <!-- 这里新加异常单的查询 -->
+      <el-select
+        :placeholder="$t('place.abnormalReturnOrder')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.exceptionFlag"
+      >
+        <el-option
+          v-for="re in exceptionFlagList"
+          :key="re.value"
+          :label="re.label"
+          :value="re.value"
+        >
+        </el-option>
+      </el-select>
+      <el-select
+        :placeholder="$t('place.noheadFlag')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.noheadFlag"
+      >
+        <el-option
+          v-for="re in noHeadFlag"
+          :key="re.value"
+          :label="re.label"
+          :value="re.value"
+        >
+        </el-option>
+      </el-select>
+      <el-select
+        :placeholder="$t('place.matchStatus')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.matchStatus"
+      >
+        <el-option
+          v-for="re in matchStatus"
+          :key="re.value"
+          :label="re.label"
+          :value="re.value"
+        >
+        </el-option>
+      </el-select>
+      <el-select
+        :placeholder="$t('place.signInStatus')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.signInStatus"
+      >
+        <el-option
+          v-for="re in signInStatus"
+          :key="re.value"
+          :label="re.label"
+          :value="re.value"
+        >
+        </el-option>
+      </el-select>
+<!--      <el-select-->
+<!--        :placeholder="$t('place.inboundStatus')"-->
+<!--        clearable-->
+<!--        style="width: 200px;"-->
+<!--        class="filter-item"-->
+<!--        v-model="listQuery.inboundStatus"-->
+<!--      >-->
+<!--        <el-option value="success" :label="$t('label.normalReturn')" />-->
+<!--        <el-option value="returning" :label="$t('label.inReturnTransit')" />-->
+<!--        <el-option value="shipLost" :label="$t('label.shipmentLost')" />-->
+<!--        <el-option value="returnLost" :label="$t('label.returnLost')" />-->
+<!--      </el-select>-->
+
+      <!--<el-input placeholder="收件人电话" style="width: 200px;"
+        	class="filter-item"	v-model="listQuery.receiverMobile"/>-->
+      <el-button
+        v-waves
+        class="filter-item"
+        type="primary"
+        icon="el-icon-search"
+        @click="handleFilter"
+      >{{ $t("table.search") }}</el-button
+      >
+
+      <el-button class="filter-item" @click="exportExcel" type="primary">
+        {{ $t("exportRep") }}
+      </el-button>
+    </div>
+
+    <el-table
+      style="width: 100%;"
+      v-loading="listLoading"
+      :key="tableKey"
+      :data="list"
+      row-key="id"
+      stripe
+      border
+      fit
+      highlight-current-row
+      :cell-style="tableRowStyleName"
+      :row-class-name="tableRowClassName"
+    >
+      <el-table-column align="center" type="index"> </el-table-column>
+      <el-table-column
+        label="退货单号"
+        width="120"
+        align="center"
+        prop="returnId"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.skuCode')"
+        width="160"
+        align="center"
+        prop="skuCode"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('returnorderNo')"
+        width="180"
+        align="center"
+        prop="refundNo"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('orderCode')"
+        width="180"
+        align="center"
+        prop="ordersId"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.shopifyNumber')"
+        width="180"
+        align="center"
+        prop="cutUser"
+      ></el-table-column>
+      <el-table-column
+        :label="$t('label.externalBillNo')"
+        width="180"
+        align="center"
+        prop="externalBillNo"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('storeName')"
+        align="center"
+        min-width="180"
+        prop="storeName"
+      ></el-table-column>
+
+      <el-table-column :label="$t('goodsType')" width="110" align="center">
+        <template slot-scope="scope">
+          <span v-if="scope.row.receiveType">
+            <el-tag effect="warning" v-if="scope.row.receiveType == '2'">
+              {{ scope.row.receiveType | receiveTypeFilter }}
+            </el-tag>
+            <el-tag effect="dark" v-else>
+              {{ scope.row.receiveType | receiveTypeFilter }}
+            </el-tag>
+          </span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('returnTo')"
+        width="100"
+        align="center"
+        prop="warehouseName"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('onlineSaleNo')"
+        width="120"
+        align="center"
+        prop="ormorder"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('returnShoppNo')"
+        width="110"
+        align="center"
+        prop="shippingNo"
+      >
+      </el-table-column>
+      <el-table-column :label="$t('ordersStatus')" width="120" align="center">
+        <template slot-scope="scope">
+          <el-tag
+            effect="warning"
+            v-if="
+              scope.row.status == '00' ||
+                scope.row.status == '01' ||
+                scope.row.status == '02'
+            "
+          >
+            {{ scope.row.status | statusFilter }}
+          </el-tag>
+          <el-tag
+            effect="info"
+            v-else-if="scope.row.status == '04' || scope.row.status == '05'"
+          >
+            {{ scope.row.status | statusFilter }}
+          </el-tag>
+          <el-tag effect="dark" v-else>
+            {{ scope.row.status | statusFilter }}
+          </el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('matchStatus')"
+        width="210"
+        align="center"
+        prop="matchStatus"
+      >
+        <template slot-scope="scope">
+          <el-tag effect="dark" v-if="scope.row.matchStatus != null">
+            {{ scope.row.matchStatus | matchStatusFilter }}
+          </el-tag>
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('noheadFlag')"
+        width="120"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <el-tag
+            effect="warning"
+            v-if="
+              scope.row.noheadFlag == '1'
+            "
+          >
+            是
+          </el-tag>
+          <el-tag
+            effect="warning"
+            v-if="
+              scope.row.noheadFlag == '0'
+            "
+          >
+            否
+          </el-tag>
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        label="是否手工签收"
+        width="120"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <el-tag
+            effect="warning"
+            v-if="
+              scope.row.isManual == '1'
+            "
+          >
+            是
+          </el-tag>
+          <el-tag
+            effect="warning"
+            v-if="
+              scope.row.isManual == '0'
+            "
+          >
+            否
+          </el-tag>
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('orderReceiverRemark')"
+        width="160"
+        align="center"
+        prop="orderReceiverRemark"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('orderReceiverEmail')"
+        width="160"
+        align="center"
+        prop="orderReceiverEmail"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('orderReceiverPhone')"
+        width="160"
+        align="center"
+        prop="orderReceiverPhone"
+      >
+      </el-table-column>
+
+
+      <el-table-column
+        :label="$t('appAmount')"
+        width="160"
+        align="center"
+        prop="applyQuantity"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('recAmount')"
+        width="160"
+        align="center"
+        prop="receiveQuantity"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.updateTime')"
+        width="160"
+        align="center"
+        prop="updateTime"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.updater')"
+        width="120"
+        align="center"
+        prop="operator"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('opt')"
+        fixed="right"
+        width="300"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <el-button
+            type="primary"
+            size="mini"
+            @click="handleInfo(scope.row.returnId, 2)"
+          >{{ $t("details") }}</el-button
+          >
+          <el-button
+            type="danger"
+            v-if="scope.row.exceptionFlag == 'Y'"
+            size="mini"
+            @click="handleException(scope.row.returnId)"
+          >{{ $t("view.processException") }}</el-button
+          >
+
+          <el-button
+            type="success"
+            v-if="(scope.row.status == '01' || scope.row.status == '02') && scope.row.detailStatus != '01'"
+            size="mini"
+            @click="handleInfo(scope.row.returnId, 1)"
+          >{{ $t("receiveStock") }}</el-button
+          >
+          <el-button
+            type="success"
+            v-if="scope.row.matchStatus === 'order_matched' && scope.row.status !== '05'"
+            size="mini"
+            @click="antiMatchingOrder(scope.row.id)"
+          >{{ $t("antiMatchingOrder") }}</el-button
+          >
+          <el-button
+            type="danger"
+            size="mini"
+            @click="matchingOrder(scope.row.id)"
+            v-if="scope.row.matchStatus === 'unmatch' && scope.row.status !== '05'">
+            {{ $t("matchingOrder") }}
+          </el-button>
+<!--          <el-button-->
+<!--            type="danger"-->
+<!--            v-if="scope.row.exceptionFlag == 'Y'"-->
+<!--            size="mini"-->
+<!--            @click="handleException(scope.row.returnId)"-->
+<!--          >{{ $t("view.processException") }}</el-button-->
+<!--          >-->
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 分页 -->
+    <swPage
+      v-if="total > 0"
+      key="2"
+      :listQuery="listQuery"
+      :total="total"
+      pos="btmRight"
+      @retPage="retPage"
+    />
+
+    <el-dialog
+      :title="$t('title.abnormalReturnOrderProcessing')"
+      v-if="returnExceptionVisible"
+      :close-on-click-modal="false"
+      :visible.sync="returnExceptionVisible"
+    >
+      <el-form ref="warehouseForm" :model="returnOrderForm" label-width="auto">
+        <el-form-item :label="$t('label.returnNoticeNumber')" prop="note">
+          <el-input
+            v-model="returnOrderForm.returnId"
+            placeholder
+            class="normal-input"
+            :disabled="true"
+          ></el-input>
+        </el-form-item>
+
+        <div
+          v-for="detail in returnOrderForm.details"
+          :key="detail.orderItemId"
+        >
+          <el-form-item :label="$t('label.abnormalOrderItemId')" prop="note">
+            <el-input
+              v-model="detail.orderItemId"
+              placeholder
+              class="normal-input"
+              :disabled="true"
+            ></el-input>
+          </el-form-item>
+
+          <el-form-item :label="$t('label.returnQuantity')" prop="note">
+            <el-input
+              v-model="detail.returnQuantity"
+              placeholder
+              class="normal-input"
+              :disabled="true"
+            ></el-input>
+          </el-form-item>
+
+          <el-form-item :label="$t('label.abnormalSkuCode')" prop="note">
+            <el-input
+              v-model="detail.skuCode"
+              placeholder
+              class="normal-input"
+              :disabled="true"
+            ></el-input>
+          </el-form-item>
+
+          <el-form-item
+            :label="$t('label.chooseCorrectUniqueCode')"
+            prop="note"
+          >
+            <el-checkbox-group v-model="detail.uniqueCodes">
+              <div v-for="de in uniqueCodes" :key="de.orderItemId">
+                <div v-if="de.orderItemId == detail.orderItemId">
+                  <el-checkbox
+                    v-for="uniqueCode in de.uniqueCodeList"
+                    :key="uniqueCode"
+                    :label="uniqueCode"
+                  >
+                    {{ uniqueCode }}
+                  </el-checkbox>
+                </div>
+              </div>
+            </el-checkbox-group>
+          </el-form-item>
+        </div>
+        <el-form-item>
+          <el-button type="primary" @click="submit">{{
+              $t("determine")
+            }}</el-button>
+          <el-button type="danger" @click="cancel">{{ $t("back") }}</el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+
+    <el-drawer
+      :title="titleData"
+      :visible.sync="returnInfoVisible"
+      v-if="returnInfoVisible"
+      :direction="direction"
+      :size="dialogSize"
+    >
+      <returnInfoDialog
+        :returnId="currentReturnId"
+        :confirmSh="confirmSh"
+      ></returnInfoDialog>
+    </el-drawer>
+
+    <el-dialog :title="$t('queryOrder')" :visible.sync="showDialog" @close="returnOrderClose">
+      <return-order-list :details-id="detailsId" @close="returnOrderClose" ref="childComponent"/>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import waves from "@/directive/waves";
+import swPage from "@/views/common/swPage";
+import global from "@/views/oms/global";
+import returnInfoDialog from "./returnDetail";
+import { getToken } from "@/utils/auth";
+import {
+  fetchList,
+  getExceptionUniqueCode,
+  dealReturnException,
+  verifyExport, antiMatchingOrders
+} from "@/api/oms/return/return";
+import { dcmAdd } from "@/utils/toolUtil";
+import i18n from "@/lang";
+import { queryTWarehouseNameALL } from "@/api/oms/refund/refund";
+import { queryWarehouseNameALL } from "@/api/oms/order/order";
+import { queryChannelStore, queryChannel } from "@/api/oms/inventory/inventory";
+import ReturnOrderList from "@/views/oms/refund/components/returnOrderList.vue";
+
+export default {
+  name: "returnList",
+  directives: {
+    waves
+  },
+  components: {
+    ReturnOrderList,
+    swPage,
+    returnInfoDialog,
+    global,
+  },
+  filters: {
+    matchStatusFilter(matchStatus){
+      let value = "";
+     global.matchStatusType.forEach(status => {
+       if (status.value == matchStatus) {
+         value = status.label;
+       }
+     })
+      return value;
+    },
+    statusFilter(key) {
+      var value = "";
+      global.returnStatus.forEach(status => {
+        if (status.value == key) {
+          value = status.label;
+        }
+      });
+      return value;
+    },
+    receiveTypeFilter(key) {
+      var value = "";
+      global.receiveType.forEach(obj => {
+        if (obj.value == key) {
+          value = i18n.t("receiveType." + [obj.value]);
+        }
+      });
+      return value;
+    }
+  },
+  data() {
+    return {
+      detailsId: null,
+      showDialog: false,
+      dialogSize: "40%",
+      direction: "rtl",
+      fileList: [],
+      tableKey: 0,
+      list: [],
+      warehouse: [],
+      total: 0,
+      listLoading: false,
+      channel: [],
+      store: [],
+      //查询条件
+      listQuery: {
+        page: 1,
+        limit: 10,
+        storeId: "",
+        channelCode: "",
+        refundType: "",
+        shopify: "",
+        receiveType: "",
+        refundId: "",
+        shippingNo: "",
+        status: "",
+        ordersNo: "",
+        ormorder: "",
+        warehouseCode: "",
+        returnNo: "",
+        timeplacedLaggerThanEqual: "",
+        timeplacedLessThanEqual: "",
+        exceptionFlag: "",
+        inboundStatus: "",
+        noheadFlag: null,
+        matchStatus: null,
+        externalBillNo: "",
+        signInStatus: null,
+      },
+      createTimePicker: null,
+      returnStatusList: global.returnStatus, //售后状态
+      receiveTypeList: global.receiveType,
+      exceptionFlagList: global.exceptionFlag,
+      noHeadFlag: global.noHeadFlag,
+      matchStatus: global.matchStatusType,
+      signInStatus: global.signInStatusType,
+      stores: [],
+      returnInfoVisible: false,
+      currentReturnId: "",
+      baseURL: process.env.VUE_APP_OMS_API, //把url前面的域名拿出来
+      editShipp: {
+        id: null,
+        shipmodeId: "",
+        shippingNo: "",
+        warehouseCode: ""
+      },
+      dialogShippFormVisible: false,
+      dialogFormCancelVisible: false,
+      cancelForm: {
+        id: null,
+        zfnotes: ""
+      },
+      warehouseItems: [],
+      btnLoading: false,
+      confirmSh: 0,
+      titleData: "",
+      returnOrderForm: [],
+      returnExceptionVisible: false,
+      uniqueCodes: []
+    };
+  },
+  created() {
+    //获取店铺列表
+    this.getStores();
+    this.getList();
+    this.queryWarehouseName();
+    this.getChannel();
+    this.getStore();
+  },
+  activated() {
+    this.getList();
+  },
+  computed: {
+    // 计算属性的 getter
+    headers: function() {
+      return {
+        "X-Token": getToken()
+      };
+    }
+  },
+  methods: {
+    //获取stores
+    getStores() {},
+    // 展示红色背景
+    tableRowStyleName({ row }) {
+      if (row.exceptionFlag == "Y") {
+        return "color: red !important;";
+      }
+    },
+    getList() {
+      this.listLoading = true;
+
+      fetchList(this.listQuery).then(res => {
+        console.log(this.listQuery, "数据");
+        if (200 == res.code) {
+          this.total = res.data.total;
+          this.list = res.data.list;
+        }
+        this.listLoading = false;
+      });
+    },
+    queryWarehouseName() {
+      queryTWarehouseNameALL().then(response => {
+        this.warehouse = response.data;
+      });
+    },
+    getChannel() {
+      queryChannel({ storeId: this.listQuery.storeId }).then(res => {
+        if (200 == res.code) {
+          this.channel = res.data;
+        }
+      });
+    },
+    getStore() {
+      queryChannelStore({ channelCode: this.listQuery.channelCode }).then(
+        res => {
+          if (200 == res.code) {
+            this.store = res.data;
+          }
+        }
+      );
+    },
+    submit() {
+      var arr = this.returnOrderForm.details;
+      var flag = true;
+      //验证所选唯一码数量是否等于退货数量
+      Object.keys(arr).forEach(function(i) {
+        var sum = 0;
+        arr[i].uniqueCodes.forEach(obj => {
+          sum++;
+        });
+        if (arr[i].returnQuantity != sum) {
+          alert(
+            "订单项Id:" +
+            arr[i].orderItemId +
+            ",所选唯一码数量与退货数量不匹配,请选择" +
+            arr[i].returnQuantity +
+            "个唯一码"
+          );
+          flag = false;
+        }
+      });
+
+      if (flag) {
+        dealReturnException(this.returnOrderForm).then(res => {
+          if (200 == res.code) {
+            this.$message({
+              message: "操作成功",
+              type: "success"
+            });
+            this.returnExceptionVisible = false;
+            this.getList();
+          }
+        });
+      }
+    },
+    cancel() {
+      this.returnExceptionVisible = false;
+    },
+    retPage() {
+      //分页
+      this.getList();
+    },
+
+    // 导出Excel
+    exportExcel() {
+      this.listQuery.page = 1;
+      this.listLoading = true;
+      if (this.createTimePicker == null) {
+        this.listQuery.timeplacedLaggerThanEqual = "";
+        this.listQuery.timeplacedLessThanEqual = "";
+      } else {
+        this.listQuery.timeplacedLaggerThanEqual = this.createTimePicker[0];
+        this.listQuery.timeplacedLessThanEqual = this.createTimePicker[1];
+      }
+
+      //url 加入验证判断
+      verifyExport(this.listQuery)
+        .then(res => {
+          if (200 == res.code) {
+            var url =
+              this.baseURL +
+              "tReturnOrders/export?storeId=" +
+              this.listQuery.storeId +
+              "&status=" +
+              this.listQuery.status +
+              "&receiveType=" +
+              this.listQuery.receiveType +
+              "&refundId=" +
+              this.listQuery.refundId +
+              "&ormorder=" +
+              this.listQuery.ormorder +
+              "&shippingNo=" +
+              this.listQuery.shippingNo +
+              "&shopify=" +
+              encodeURIComponent(this.listQuery.shopify) +
+              "&timeplacedLaggerThanEqual=" +
+              this.listQuery.timeplacedLaggerThanEqual +
+              "&timeplacedLessThanEqual=" +
+              this.listQuery.timeplacedLessThanEqual +
+              "&channelCode=" +
+              this.listQuery.channelCode +
+              "&exceptionFlag=" +
+              this.listQuery.exceptionFlag;
+            window.location.href = url;
+          }
+          this.listLoading = false;
+        })
+        .catch(err => {
+          console.log(err);
+          this.listLoading = false;
+        });
+    },
+
+    handleFilter() {
+      this.listQuery.page = 1;
+      if (this.createTimePicker == null) {
+        this.listQuery.timeplacedLaggerThanEqual = "";
+        this.listQuery.timeplacedLessThanEqual = "";
+      } else {
+        this.listQuery.timeplacedLaggerThanEqual = this.createTimePicker[0];
+        this.listQuery.timeplacedLessThanEqual = this.createTimePicker[1];
+      }
+      this.getList();
+    },
+    //查看退款单详情
+    handleInfo(returnId, t) {
+      //进入退款单详情查看
+      if (t == 2) {
+        this.titleData = this.$t("view.returnShoppNo");
+      } else {
+        this.titleData = this.$t("receiveStock");
+      }
+      this.currentReturnId = returnId;
+      this.returnInfoVisible = true;
+      this.confirmSh = t;
+    },
+    // 处理异常发货单
+    handleException(returnId) {
+      //通过收退货通知单Id获取唯一码信息
+      getExceptionUniqueCode(returnId).then(res => {
+        if (200 == res.code) {
+          this.returnOrderForm = res.data;
+          this.uniqueCodes = res.data.details;
+          this.returnExceptionVisible = true;
+        }
+      });
+    },
+    // 客服匹配订单
+    matchingOrder(id){
+      this.detailsId = id;
+      this.showDialog = true;
+    },
+    // 反匹配
+    antiMatchingOrder(id){
+      antiMatchingOrders(id).then(res=>{
+        if(res.code === 200){
+          this.$message({
+            message: "反匹配成功",
+            type: "success"
+          });
+        }
+        this.getList();
+      });
+    },
+    // 关闭页面刷新列表
+    returnOrderClose(){
+      this.showDialog = false;
+      // 调用子组件的清除值方法
+      this.$refs.childComponent.closeDialog();
+      // 清空子组件中的搜索框的值
+      this.getList();
+    },
+    tableRowClassName({row}) {
+      if(row.matchStatus == 'unmatch'){
+        return 'highlighted-row';
+      }
+      return '';
+    }
+  }
+};
+</script>
+
+<style scoped>
+.cell > span {
+  white-space: nowrap !important;
+}
+::v-deep .highlighted-row {
+  color: red; /* 浅红色背景 */
+}
+</style>

+ 732 - 0
src/views/oms/refund-old/returnList.vue

@@ -0,0 +1,732 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <el-select
+        :placeholder="$t('ordersStatus')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.status"
+      >
+        <el-option
+          v-for="it in returnStatusList"
+          :key="it.value"
+          :label="it.label"
+          :value="it.value"
+        >
+        </el-option>
+      </el-select>
+      <el-select
+        :placeholder="$t('returngoodsType')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.receiveType"
+      >
+        <el-option
+          v-for="re in receiveTypeList"
+          :key="re.value"
+          :label="re.label"
+          :value="re.value"
+        >
+        </el-option>
+      </el-select>
+
+      <el-select
+        v-model="listQuery.channelCode"
+        :clearable="true"
+        filterable
+        class="filter-item"
+        style="width: 200px;"
+        :placeholder="$t('place.channel')"
+        @change="getStore"
+      >
+        <el-option
+          v-for="item in channel"
+          :key="item.code"
+          :label="item.name"
+          :value="item.code"
+        >
+        </el-option>
+      </el-select>
+      <el-select
+        v-model="listQuery.storeId"
+        :clearable="true"
+        filterable
+        class="filter-item"
+        style="width: 200px;"
+        :placeholder="$t('place.shopName')"
+        @change="getChannel"
+      >
+        <el-option
+          v-for="item in store"
+          :key="item.storeId"
+          :label="item.storeName"
+          :value="item.storeId"
+        >
+        </el-option>
+      </el-select>
+
+      <el-input
+        :placeholder="$t('returnorderNo')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.refundId"
+      />
+      <el-input
+        :placeholder="$t('onlineSaleNo')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.ormorder"
+      />
+      <el-input
+        :placeholder="$t('shopifyNo')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.shopify"
+      />
+
+      <el-input
+        :placeholder="$t('returnShipNo')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.shippingNo"
+      />
+
+      <el-select
+        :placeholder="$t('returnTo')"
+        style="width: 200px;"
+        class="filter-item"
+        clearable
+        filterable
+        v-model="listQuery.warehouseCode"
+      >
+        <el-option
+          v-for="item in warehouse"
+          :key="item.returnWarehouseCode"
+          :label="item.returnWarehouseName"
+          :value="item.returnWarehouseCode"
+        />
+      </el-select>
+
+      <el-date-picker
+        class="filter-item"
+        style="display: inline-flex;"
+        v-model="createTimePicker"
+        type="datetimerange"
+        :range-separator="$t('to')"
+        :start-placeholder="$t('buildEndTime')"
+        :end-placeholder="$t('buildStartTime')"
+        value-format="yyyy-MM-dd HH:mm:ss"
+        :default-time="['00:00:00', '23:59:59']"
+      >
+      </el-date-picker>
+
+      <!-- 这里新加异常单的查询 -->
+      <el-select
+        :placeholder="$t('place.abnormalReturnOrder')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.exceptionFlag"
+      >
+        <el-option
+          v-for="re in exceptionFlagList"
+          :key="re.value"
+          :label="re.label"
+          :value="re.value"
+        >
+        </el-option>
+      </el-select>
+
+      <el-select
+        :placeholder="$t('place.inboundStatus')"
+        clearable
+        style="width: 200px;"
+        class="filter-item"
+        v-model="listQuery.inboundStatus"
+      >
+        <el-option value="success_manual" :label="$t('label.normalReturn')" />
+        <el-option value="returning" :label="$t('label.inReturnTransit')" />
+        <el-option value="shipLost" :label="$t('label.shipmentLost')" />
+        <el-option value="returnLost" :label="$t('label.returnLost')" />
+      </el-select>
+
+      <!--<el-input placeholder="收件人电话" style="width: 200px;"
+        	class="filter-item"	v-model="listQuery.receiverMobile"/>-->
+      <el-button
+        v-waves
+        class="filter-item"
+        type="primary"
+        icon="el-icon-search"
+        @click="handleFilter"
+      >{{ $t("table.search") }}</el-button
+      >
+
+      <el-button class="filter-item" @click="exportExcel" type="primary">
+        {{ $t("exportRep") }}
+      </el-button>
+    </div>
+
+    <el-table
+      style="width: 100%;"
+      v-loading="listLoading"
+      :key="tableKey"
+      :data="list"
+      row-key="id"
+      stripe
+      border
+      fit
+      highlight-current-row
+      :cell-style="tableRowStyleName"
+    >
+      <el-table-column align="center" type="index"> </el-table-column>
+      <el-table-column
+        :label="$t('returnorderNo')"
+        width="180"
+        align="center"
+        prop="refundNo"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('onlineSaleNo')"
+        width="180"
+        align="center"
+        prop="ormorder"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('ordername')"
+        width="180"
+        align="center"
+        prop="cutUser"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('storeName')"
+        align="center"
+        min-width="180"
+        prop="storeName"
+      ></el-table-column>
+
+      <el-table-column :label="$t('goodsType')" width="110" align="center">
+        <template slot-scope="scope">
+          <span v-if="scope.row.receiveType">
+            <el-tag effect="warning" v-if="scope.row.receiveType == '2'">
+              {{ scope.row.receiveType | receiveTypeFilter }}
+            </el-tag>
+            <el-tag effect="dark" v-else>
+              {{ scope.row.receiveType | receiveTypeFilter }}
+            </el-tag>
+          </span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('returnTo')"
+        width="100"
+        align="center"
+        prop="warehouseName"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('returnShoppNo')"
+        width="110"
+        align="center"
+        prop="shippingNo"
+      >
+      </el-table-column>
+      <el-table-column :label="$t('ordersStatus')" width="120" align="center">
+        <template slot-scope="scope">
+          <el-tag
+            effect="warning"
+            v-if="
+              scope.row.status == '00' ||
+                scope.row.status == '01' ||
+                scope.row.status == '02'
+            "
+          >
+            {{ scope.row.status | statusFilter }}
+          </el-tag>
+          <el-tag
+            effect="info"
+            v-else-if="scope.row.status == '04' || scope.row.status == '05'"
+          >
+            {{ scope.row.status | statusFilter }}
+          </el-tag>
+          <el-tag effect="dark" v-else>
+            {{ scope.row.status | statusFilter }}
+          </el-tag>
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.createTime')"
+        width="160"
+        align="center"
+        prop="createTime"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.creator')"
+        width="120"
+        align="center"
+        prop="createBy"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.updateTime')"
+        width="160"
+        align="center"
+        prop="operatTime"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('label.updater')"
+        width="120"
+        align="center"
+        prop="operator"
+      >
+      </el-table-column>
+      <el-table-column
+        :label="$t('opt')"
+        fixed="right"
+        width="300"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <el-button
+            type="primary"
+            size="mini"
+            @click="handleInfo(scope.row.returnId, 2)"
+          >{{ $t("details") }}</el-button
+          >
+          <el-button
+            type="danger"
+            v-if="scope.row.exceptionFlag == 'Y'"
+            size="mini"
+            @click="handleException(scope.row.returnId)"
+          >{{ $t("view.processException") }}</el-button
+          >
+
+          <el-button
+            type="success"
+            v-if="scope.row.status == '01' || scope.row.status == '02'"
+            size="mini"
+            @click="handleInfo(scope.row.returnId, 1)"
+          >{{ $t("receiveStock") }}</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 分页 -->
+    <swPage
+      v-if="total > 0"
+      key="2"
+      :listQuery="listQuery"
+      :total="total"
+      pos="btmRight"
+      @retPage="retPage"
+    />
+
+    <el-dialog
+      :title="$t('title.abnormalReturnOrderProcessing')"
+      v-if="returnExceptionVisible"
+      :close-on-click-modal="false"
+      :visible.sync="returnExceptionVisible"
+    >
+      <el-form ref="warehouseForm" :model="returnOrderForm" label-width="auto">
+        <el-form-item :label="$t('label.returnNoticeNumber')" prop="note">
+          <el-input
+            v-model="returnOrderForm.returnId"
+            placeholder
+            class="normal-input"
+            :disabled="true"
+          ></el-input>
+        </el-form-item>
+
+        <div
+          v-for="detail in returnOrderForm.details"
+          :key="detail.orderItemId"
+        >
+          <el-form-item :label="$t('label.abnormalOrderItemId')" prop="note">
+            <el-input
+              v-model="detail.orderItemId"
+              placeholder
+              class="normal-input"
+              :disabled="true"
+            ></el-input>
+          </el-form-item>
+
+          <el-form-item :label="$t('label.returnQuantity')" prop="note">
+            <el-input
+              v-model="detail.returnQuantity"
+              placeholder
+              class="normal-input"
+              :disabled="true"
+            ></el-input>
+          </el-form-item>
+
+          <el-form-item :label="$t('label.abnormalSkuCode')" prop="note">
+            <el-input
+              v-model="detail.skuCode"
+              placeholder
+              class="normal-input"
+              :disabled="true"
+            ></el-input>
+          </el-form-item>
+
+          <el-form-item
+            :label="$t('label.chooseCorrectUniqueCode')"
+            prop="note"
+          >
+            <el-checkbox-group v-model="detail.uniqueCodes">
+              <div v-for="de in uniqueCodes" :key="de.orderItemId">
+                <div v-if="de.orderItemId == detail.orderItemId">
+                  <el-checkbox
+                    v-for="uniqueCode in de.uniqueCodeList"
+                    :key="uniqueCode"
+                    :label="uniqueCode"
+                  >
+                    {{ uniqueCode }}
+                  </el-checkbox>
+                </div>
+              </div>
+            </el-checkbox-group>
+          </el-form-item>
+        </div>
+        <el-form-item>
+          <el-button type="primary" @click="submit">{{
+              $t("determine")
+            }}</el-button>
+          <el-button type="danger" @click="cancel">{{ $t("back") }}</el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+
+    <el-drawer
+      :title="titleData"
+      :visible.sync="returnInfoVisible"
+      v-if="returnInfoVisible"
+      :direction="direction"
+      :size="dialogSize"
+    >
+      <returnInfoDialog
+        :returnId="currentReturnId"
+        :confirmSh="confirmSh"
+      ></returnInfoDialog>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import waves from "@/directive/waves";
+import swPage from "@/views/common/swPage";
+import global from "@/views/oms/global";
+import returnInfoDialog from "./returnDetail";
+import { getToken } from "@/utils/auth";
+import {
+  fetchList,
+  getExceptionUniqueCode,
+  dealReturnException,
+  verifyExport
+} from "@/api/oms/return/return";
+import { dcmAdd } from "@/utils/toolUtil";
+import i18n from "@/lang";
+import { queryTWarehouseNameALL } from "@/api/oms/refund/refund";
+import { queryWarehouseNameALL } from "@/api/oms/order/order";
+import { queryChannelStore, queryChannel } from "@/api/oms/inventory/inventory";
+
+export default {
+  name: "returnList",
+  directives: {
+    waves
+  },
+  components: {
+    swPage,
+    returnInfoDialog,
+    global
+  },
+  filters: {
+    statusFilter(key) {
+      var value = "";
+      global.returnStatus.forEach(status => {
+        if (status.value == key) {
+          value = status.label;
+        }
+      });
+      return value;
+    },
+    receiveTypeFilter(key) {
+      var value = "";
+      global.receiveType.forEach(obj => {
+        if (obj.value == key) {
+          value = i18n.t("receiveType." + [obj.value]);
+        }
+      });
+      return value;
+    }
+  },
+  data() {
+    return {
+      dialogSize: "40%",
+      direction: "rtl",
+      fileList: [],
+      tableKey: 0,
+      list: [],
+      warehouse: [],
+      total: 0,
+      listLoading: false,
+      channel: [],
+      store: [],
+      //查询条件
+      listQuery: {
+        page: 1,
+        limit: 20,
+        storeId: "",
+        channelCode: "",
+        refundType: "",
+        shopify: "",
+        receiveType: "",
+        refundId: "",
+        shippingNo: "",
+        status: "",
+        ordersNo: "",
+        ormorder: "",
+        warehouseCode: "",
+        returnNo: "",
+        timeplacedLaggerThanEqual: "",
+        timeplacedLessThanEqual: "",
+        exceptionFlag: "",
+        inboundStatus: ""
+      },
+      createTimePicker: null,
+      returnStatusList: global.returnStatus, //售后状态
+      receiveTypeList: global.receiveType,
+      exceptionFlagList: global.exceptionFlag,
+      stores: [],
+      returnInfoVisible: false,
+      currentReturnId: "",
+      baseURL: process.env.VUE_APP_OMS_API, //把url前面的域名拿出来
+      editShipp: {
+        id: null,
+        shipmodeId: "",
+        shippingNo: "",
+        warehouseCode: ""
+      },
+      dialogShippFormVisible: false,
+      dialogFormCancelVisible: false,
+      cancelForm: {
+        id: null,
+        zfnotes: ""
+      },
+      warehouseItems: [],
+      btnLoading: false,
+      confirmSh: 0,
+      titleData: "",
+      returnOrderForm: [],
+      returnExceptionVisible: false,
+      uniqueCodes: []
+    };
+  },
+  created() {
+    //获取店铺列表
+    this.getStores();
+    this.getList();
+    this.queryWarehouseName();
+    this.getChannel();
+    this.getStore();
+  },
+  activated() {
+    this.getList();
+  },
+  computed: {
+    // 计算属性的 getter
+    headers: function() {
+      return {
+        "X-Token": getToken()
+      };
+    }
+  },
+  methods: {
+    //获取stores
+    getStores() {},
+    // 展示红色背景
+    tableRowStyleName({ row }) {
+      if (row.exceptionFlag == "Y") {
+        return "color: red !important;";
+      }
+    },
+    getList() {
+      this.listLoading = true;
+
+      fetchList(this.listQuery).then(res => {
+        console.log(this.listQuery, "数据");
+        if (200 == res.code) {
+          this.total = res.data.total;
+          this.list = res.data.list;
+        }
+        this.listLoading = false;
+      });
+    },
+    queryWarehouseName() {
+      queryTWarehouseNameALL().then(response => {
+        this.warehouse = response.data;
+      });
+    },
+    getChannel() {
+      queryChannel({ storeId: this.listQuery.storeId }).then(res => {
+        if (200 == res.code) {
+          this.channel = res.data;
+        }
+      });
+    },
+    getStore() {
+      queryChannelStore({ channelCode: this.listQuery.channelCode }).then(
+        res => {
+          if (200 == res.code) {
+            this.store = res.data;
+          }
+        }
+      );
+    },
+    submit() {
+      var arr = this.returnOrderForm.details;
+      var flag = true;
+      //验证所选唯一码数量是否等于退货数量
+      Object.keys(arr).forEach(function(i) {
+        var sum = 0;
+        arr[i].uniqueCodes.forEach(obj => {
+          sum++;
+        });
+        if (arr[i].returnQuantity != sum) {
+          alert(
+            "订单项Id:" +
+            arr[i].orderItemId +
+            ",所选唯一码数量与退货数量不匹配,请选择" +
+            arr[i].returnQuantity +
+            "个唯一码"
+          );
+          flag = false;
+        }
+      });
+
+      if (flag) {
+        dealReturnException(this.returnOrderForm).then(res => {
+          if (200 == res.code) {
+            this.$message({
+              message: "操作成功",
+              type: "success"
+            });
+            this.returnExceptionVisible = false;
+            this.getList();
+          }
+        });
+      }
+    },
+    cancel() {
+      this.returnExceptionVisible = false;
+    },
+    retPage() {
+      //分页
+      this.getList();
+    },
+
+    // 导出Excel
+    exportExcel() {
+      this.listQuery.page = 1;
+      this.listLoading = true;
+      if (this.createTimePicker == null) {
+        this.listQuery.timeplacedLaggerThanEqual = "";
+        this.listQuery.timeplacedLessThanEqual = "";
+      } else {
+        this.listQuery.timeplacedLaggerThanEqual = this.createTimePicker[0];
+        this.listQuery.timeplacedLessThanEqual = this.createTimePicker[1];
+      }
+
+      //url 加入验证判断
+      verifyExport(this.listQuery)
+        .then(res => {
+          if (200 == res.code) {
+            var url =
+              this.baseURL +
+              "tReturnOrders/export?storeId=" +
+              this.listQuery.storeId +
+              "&status=" +
+              this.listQuery.status +
+              "&receiveType=" +
+              this.listQuery.receiveType +
+              "&refundId=" +
+              this.listQuery.refundId +
+              "&ormorder=" +
+              this.listQuery.ormorder +
+              "&shippingNo=" +
+              this.listQuery.shippingNo +
+              "&shopify=" +
+              encodeURIComponent(this.listQuery.shopify) +
+              "&timeplacedLaggerThanEqual=" +
+              this.listQuery.timeplacedLaggerThanEqual +
+              "&timeplacedLessThanEqual=" +
+              this.listQuery.timeplacedLessThanEqual +
+              "&channelCode=" +
+              this.listQuery.channelCode +
+              "&exceptionFlag=" +
+              this.listQuery.exceptionFlag;
+            window.location.href = url;
+          }
+          this.listLoading = false;
+        })
+        .catch(err => {
+          console.log(err);
+          this.listLoading = false;
+        });
+    },
+
+    handleFilter() {
+      this.listQuery.page = 1;
+      if (this.createTimePicker == null) {
+        this.listQuery.timeplacedLaggerThanEqual = "";
+        this.listQuery.timeplacedLessThanEqual = "";
+      } else {
+        this.listQuery.timeplacedLaggerThanEqual = this.createTimePicker[0];
+        this.listQuery.timeplacedLessThanEqual = this.createTimePicker[1];
+      }
+      this.getList();
+    },
+    //查看退款单详情
+    handleInfo(returnId, t) {
+      //进入退款单详情查看
+      if (t == 2) {
+        this.titleData = this.$t("view.returnShoppNo");
+      } else {
+        this.titleData = this.$t("receiveStock");
+      }
+      this.currentReturnId = returnId;
+      this.returnInfoVisible = true;
+      this.confirmSh = t;
+    },
+    // 处理异常发货单
+    handleException(returnId) {
+      //通过收退货通知单Id获取唯一码信息
+      getExceptionUniqueCode(returnId).then(res => {
+        if (200 == res.code) {
+          this.returnOrderForm = res.data;
+          this.uniqueCodes = res.data.details;
+          this.returnExceptionVisible = true;
+        }
+      });
+    }
+  }
+};
+</script>
+
+<style scoped>
+.cell > span {
+  white-space: nowrap !important;
+}
+</style>

+ 354 - 0
src/views/oms/refund-old/shippingFeeRule.vue

@@ -0,0 +1,354 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <el-select
+        v-model="listQuery.returnWarehouseId"
+        :clearable="true"
+        class="filter-item"
+        style="width: 200px;"
+        :placeholder="$t('place.returnWarehouse')"
+      >
+        <el-option
+          v-for="item in warehouseList"
+          :key="item.id"
+          :label="item.returnWarehouseName"
+          :value="item.id"
+        />
+      </el-select>
+      <el-input
+        :placeholder="$t('place.enterCurrency')"
+        style="width: 200px;"
+        class="filter-item"
+        clearable
+        v-model="listQuery.currency"
+      />
+      <el-button
+        class="filter-item"
+        type="primary"
+        icon="el-icon-search"
+        @click="handleFilter"
+        >{{ $t("view.search") }}</el-button
+      >
+      <el-button
+        class="filter-item"
+        style="margin-left: 10px;"
+        type="primary"
+        icon="el-icon-circle-plus"
+        @click="handleCreate"
+        >{{ $t("view.create") }}</el-button
+      >
+    </div>
+
+    <el-table
+      style="width: 100%;"
+      v-loading="listLoading"
+      :key="tableKey"
+      :data="list"
+      row-key="id"
+      stripe
+      border
+      fit
+      highlight-current-row
+    >
+      <el-table-column align="center" type="index"> </el-table-column>
+
+      <el-table-column
+        :label="$t('label.minQuantity')"
+        width="150"
+        align="center"
+        prop="quantityMin"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.maxQuantity')"
+        width="150"
+        align="center"
+        prop="quantityMax"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.returnWarehouse')"
+        width="150"
+        align="center"
+        prop="returnWarehouseName"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.amount')"
+        width="250"
+        align="center"
+        prop="amount"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.currency')"
+        width="150"
+        align="center"
+        prop="currency"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.creator')"
+        width="200"
+        align="center"
+        prop="createUser"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.createTime')"
+        width="150"
+        align="center"
+        prop="createTime"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.modifier')"
+        width="150"
+        align="center"
+        prop="updateUser"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.modifyTime')"
+        width="150"
+        align="center"
+        prop="updateTime"
+      >
+      </el-table-column>
+
+      <el-table-column
+        :label="$t('label.operation')"
+        fixed="right"
+        width="180"
+        align="left"
+      >
+        <template slot-scope="scope">
+          <el-button
+            type="success"
+            class="line_button"
+            size="mini"
+            @click="handleEdit(scope.row)"
+            >{{ $t("view.modify") }}</el-button
+          >
+          <el-button
+            type="danger"
+            class="line_button"
+            size="mini"
+            @click="deleteInfo(scope.row)"
+            >{{ $t("view.delete") }}</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 分页 -->
+    <swPage
+      v-if="total > 0"
+      key="2"
+      :listQuery="listQuery"
+      :total="total"
+      pos="btmRight"
+      @retPage="retPage"
+    />
+    <!-- 退款理由编辑-->
+    <el-dialog
+      :title="$t('title.editSlFreightRules')"
+      v-if="shippingFeeEditVisible"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :visible.sync="shippingFeeEditVisible"
+      width="40%"
+    >
+      <el-form
+        ref="shippingFeeForm"
+        :model="shippingFeeForm"
+        label-width="auto"
+      >
+        <el-form-item :label="$t('label.maxQuantity')">
+          <el-input-number
+            v-model="shippingFeeForm.quantityMax"
+            :min="shippingFeeForm.quantityMin"
+            class="filter-item"
+          >
+          </el-input-number>
+        </el-form-item>
+        <el-form-item :label="$t('label.minQuantity')">
+          <el-input-number
+            v-model="shippingFeeForm.quantityMin"
+            :min="0"
+            :max="shippingFeeForm.quantityMax"
+            class="filter-item"
+          >
+          </el-input-number>
+        </el-form-item>
+        <el-form-item :label="$t('label.receivingReturnWarehouse')">
+          <el-select
+            clearable
+            v-model="shippingFeeForm.returnWarehouseId"
+            :placeholder="$t('place.selectReturnWarehouse')"
+            class="normal-input"
+          >
+            <el-option
+              v-for="item in warehouseList"
+              :key="item.id"
+              :label="item.returnWarehouseName"
+              :value="item.id"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item :label="$t('label.amount')">
+          <el-input
+            :placeholder="$t('place.enterAmount')"
+            style="width: 200px;"
+            class="filter-item"
+            type="number"
+            v-model="shippingFeeForm.amount"
+          />
+        </el-form-item>
+        <el-form-item :label="$t('label.currency')">
+          <el-input
+            :placeholder="$t('place.enterCurrency')"
+            style="width: 200px;"
+            class="filter-item"
+            v-model="shippingFeeForm.currency"
+          />
+        </el-form-item>
+
+        <el-form-item>
+          <el-button type="primary" @click="editSubmit">{{
+            $t("determine")
+          }}</el-button>
+          <el-button type="danger" @click="shippingFeeEditVisible = false">{{
+            $t("back")
+          }}</el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import swPage from "@/views/common/swPage.vue";
+import { queryTWarehouseNameALL } from "@/api/oms/refund/refund";
+import { deleteSL, getShippingFeeList, saveSL } from "@/api/oms/return/return";
+export default {
+  name: "shippingFeeRule",
+  components: {
+    swPage
+  },
+  filters: {},
+  data() {
+    return {
+      tableKey: 0,
+      list: [],
+      total: 0,
+      def: "0",
+      listLoading: false,
+      destroy: true,
+      shippingFeeEditVisible: false,
+      listQuery: {
+        page: 1,
+        limit: 10,
+        returnWarehouseId: "",
+        currency: ""
+      },
+      shippingFeeForm: {
+        id: "",
+        quantityMin: 0,
+        quantityMax: 0,
+        amount: "",
+        currency: "",
+        returnWarehouseId: ""
+      },
+      warehouseList: []
+    };
+  },
+  created() {
+    this.getList();
+    this.getWarehouseList();
+  },
+  activated() {
+    this.getList();
+  },
+  methods: {
+    getList() {
+      this.listLoading = true;
+      getShippingFeeList(this.listQuery).then(res => {
+        if (200 == res.code) {
+          this.total = res.data.total;
+          this.list = res.data.list;
+        }
+        this.listLoading = false;
+      });
+    },
+    retPage() {
+      //分页
+      this.getList();
+    },
+    handleFilter() {
+      this.listQuery.page = 1;
+      this.getList();
+    },
+    getWarehouseList() {
+      queryTWarehouseNameALL().then(res => {
+        if (200 == res.code) {
+          this.warehouseList = res.data;
+        }
+      });
+    },
+    handleCreate() {
+      this.shippingFeeEditVisible = true;
+    },
+    editSubmit() {
+      saveSL(this.shippingFeeForm).then(res => {
+        if (200 == res.code) {
+          this.$message({
+            message: "操作成功",
+            type: "success"
+          });
+          this.clean();
+        }
+      });
+    },
+    clean() {
+      this.shippingFeeEditVisible = false;
+      this.shippingFeeForm.id = "";
+      this.shippingFeeForm.quantityMin = 0;
+      this.shippingFeeForm.quantityMax = 0;
+      this.shippingFeeForm.amount = "";
+      this.shippingFeeForm.currency = "";
+      this.shippingFeeForm.returnWarehouseId = "";
+
+      this.getList();
+    },
+    deleteInfo(row) {
+      deleteSL(row).then(res => {
+        if (200 == res.code) {
+          this.$message({
+            message: "删除成功",
+            type: "success"
+          });
+          this.getList();
+        }
+      });
+    },
+    handleEdit(row) {
+      this.shippingFeeForm.id = row.id;
+      this.shippingFeeForm.quantityMin = row.quantityMin;
+      this.shippingFeeForm.quantityMax = row.quantityMax;
+      this.shippingFeeForm.amount = row.amount;
+      this.shippingFeeForm.currency = row.currency;
+      this.shippingFeeForm.returnWarehouseId = row.returnWarehouseId;
+      this.shippingFeeEditVisible = true;
+    }
+  }
+};
+</script>

+ 27 - 27
vue.config.js

@@ -27,34 +27,34 @@ module.exports = {
     },
     public: "0.0.0.0:9527", //可以实现热部署
     proxy: {
-      // [process.env.VUE_APP_OAUTH_API]: {
-      //   target: `http://localhost:19090/sso`,
-      //   changeOrigin: true,
-      //   // logLevel: 'debug', //打印日志
-      //   pathRewrite: {
-      //     ['^' + process.env.VUE_APP_OAUTH_API]: ''
-      //   }
-      // },
-      // [process.env.VUE_APP_PIM_API]: {
-      //   target: `http://localhost:18080/pim`,
-      //   changeOrigin: true,
-      //   // logLevel: 'debug', //打印日志
-      //   pathRewrite: {
-      //     ['^' + process.env.VUE_APP_PIM_API]: ''
-      //   }
-      // },
-      // [process.env.VUE_APP_OMS_API]: {
-      //   target: `http://localhost:18081/oms`,
-      //   changeOrigin: true,
-      //   // logLevel: 'debug', //打印日志
-      //   pathRewrite: {
-      //     ['^' + process.env.VUE_APP_OMS_API]: ''
-      //   }
-      // }
-      "/": {
-        target: "https://testfoms.gloria.com.cn",
-        changeOrigin: true
+      [process.env.VUE_APP_OAUTH_API]: {
+        target: `http://localhost:19090/sso`,
+        changeOrigin: true,
+        // logLevel: 'debug', //打印日志
+        pathRewrite: {
+          ['^' + process.env.VUE_APP_OAUTH_API]: ''
+        }
+      },
+      [process.env.VUE_APP_PIM_API]: {
+        target: `http://localhost:18080/pim`,
+        changeOrigin: true,
+        // logLevel: 'debug', //打印日志
+        pathRewrite: {
+          ['^' + process.env.VUE_APP_PIM_API]: ''
+        }
       },
+      [process.env.VUE_APP_OMS_API]: {
+        target: `http://localhost:18081/oms`,
+        changeOrigin: true,
+        // logLevel: 'debug', //打印日志
+        pathRewrite: {
+          ['^' + process.env.VUE_APP_OMS_API]: ''
+        }
+      }
+      // "/": {
+      //   target: "https://testfoms.gloria.com.cn",
+      //   changeOrigin: true
+      // },
       //http://10.41.3.152:18081  http://10.41.3.65:19090
       // [process.env.VUE_APP_OAUTH_API]: {
       //   target: `http://10.41.3.65:19090/sso`,