lxf 1 year ago
parent
commit
13706eb8ed
1 changed files with 22 additions and 1 deletions
  1. 22 1
      src/views/group/order/after-sale/index.vue

+ 22 - 1
src/views/group/order/after-sale/index.vue

@@ -7,6 +7,13 @@
       :loading="loading"
       :searchConfig="searchConfig"
       highlight-current-row
+      :action-list="[
+        {
+          text: '同步万里牛售后单',
+          action: () => clickSynchronousOrder(),
+          loading: btnLoading,
+        },
+      ]"
       @get-list="getList"
       @clickReset="clickReset"
       :spanMethod="spanMethod"
@@ -47,7 +54,6 @@
 <script setup>
 import byTable from "/src/components/byTable/index";
 import { ElMessage } from "element-plus";
-import { get } from "@vueuse/core";
 
 const { proxy } = getCurrentInstance();
 const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
@@ -352,6 +358,21 @@ const clickSubmit = () => {
     }
   });
 };
+const btnLoading = ref(false);
+const clickSynchronousOrder = () => {
+  btnLoading.value = true;
+  proxy.post("/orderHandle/resynchronizationReturnOrder", {}).then(
+    () => {
+      ElMessage.success("同步完成成功");
+      btnLoading.value = false;
+      getList();
+    },
+    (err) => {
+      ElMessage.error(`同步失败: ${err} !`);
+      btnLoading.value = false;
+    }
+  );
+};
 </script>
 
 <style lang="scss" scoped>