Ver Fonte

5号工单

逆水行舟 há 2 meses atrás
pai
commit
9b9d415844
4 ficheiros alterados com 54 adições e 31 exclusões
  1. 9 9
      src/api/omsOrder.ts
  2. 9 0
      src/api/shop.ts
  3. 1 1
      src/benyun/utils/auth.ts
  4. 35 21
      src/views/waterShop/waterShop/index.vue

+ 9 - 9
src/api/omsOrder.ts

@@ -336,19 +336,19 @@ export function autoAudit(data: any) {
   });
 }
 
+//获得聚水潭店铺列表
+export function waterShop() {
+  return request({
+    url: "/omsOrder/waterShop/list",
+    method: "GET",
+  });
+}
+
 export interface IResponeData<T> {
   msg: string;
   code: number;
-  data: T;
+  rows: T;
   total: number;
-  size: number;
-  current: number;
-  orders?: any;
-  optimizeCountSql: boolean;
-  searchCount: boolean;
-  maxLimit?: number;
-  countId?: string;
-  pages: number;
 }
 
 export interface ICallbackLog {

+ 9 - 0
src/api/shop.ts

@@ -81,6 +81,15 @@ export function shopAdd(data: any) {
   });
 }
 
+//同步聚水潭店铺
+export function uploadWaterShop(data: { pageIndex: number; pageSize: number }) {
+  return request({
+    url: "/omsOrder/waterShop/uploadWaterShop",
+    method: "POST",
+    data,
+  });
+}
+
 export interface IShopResponse<T> {
   code: number;
   data: {

+ 1 - 1
src/benyun/utils/auth.ts

@@ -6,7 +6,7 @@ const ExpiresInKey = "AdminOMS-Expires-In";
 
 export function getToken() {
   if (process.env.NODE_ENV === "development") {
-    return "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6IjkwNDA5YmQ5LThjN2UtNGIxMC04NTI1LTQzMWYxOGI5MTQyMiIsInVzZXJuYW1lIjoiYWRtaW4ifQ.9_oWqO4d79ffCaD99YHKLBViGA-x64DxyQAzKR3TAvaqO_ioD8mf4tw9aSMhaS9l3wyETxhOYs1WLQvF2c8BNg";
+    return "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6IjAzZThjZDY0LWJiMjYtNDRmNS1iNGFmLTdiODY4ZDhjMDllNiIsInVzZXJuYW1lIjoiYWRtaW4ifQ.BWVusjGlCLpDZm16pYdY1FLGJjIfDmQCUS-MNLSMlOrncySsn3oXOAUg1fWhWOa6CeB3uIdlIK8AYLwScsCPkg";
   } else {
     return Cookies.get(TokenKey);
   }

+ 35 - 21
src/views/waterShop/waterShop/index.vue

@@ -1,8 +1,9 @@
 <template>
     <div class="view" id="labelPage" v-loading="load">
-        <by-tool :propConfig="tool" v-if="userInfo && userInfo.userName == 'admin'" class="tool"
-            @clickHandle="clickHandle" id="configTool" />
+        <!-- <by-tool :propConfig="tool" v-if="userInfo && userInfo.userName == 'admin'" class="tool"
+            @clickHandle="clickHandle" id="configTool" /> -->
         <!-- <module-view :propConfig="config" ref="view" @pagination="getList" @onRefresh="getList" /> -->
+        <el-button type="default" @click="uploadWaterShop" size="small" style="margin-bottom: 10px;">同步店铺</el-button>
         <by-table :propConfig="tableConfig" ref="table">
             <template v-slot:ordered="{ row }">
                 <vxe-input v-if="userInfo && userInfo.userName == 'admin'" v-model="row.ordered" size="small"
@@ -16,10 +17,12 @@
 
 <script lang="ts">
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
-import { query, IShopResponse } from '@/api/shop'
+import { query, IShopResponse, uploadWaterShop } from '@/api/shop'
+import { IResponeData, waterShop } from "@/api/omsOrder";
 @Component({ components: {} })
 export default class OrderConfig extends Vue {
     isHasOne = false;//是否有一条数据
+    shopIds: string[] = [];
     userInfo: any = {};
     tool = {
         tools: {
@@ -31,15 +34,20 @@ export default class OrderConfig extends Vue {
     tableConfig: any = {
         attr: {
             size: 'mini',
-            align: 'center',
+            align: 'left',
             seq: true
         },
         columns: [{
+            width: 150,
             title: '店铺编号',
             field: 'shopId'
         }, {
             title: '店铺名称',
             field: 'shopName'
+        }, {
+            title: '平台',
+            field: 'shopSite',
+            width: 150,
         }, {
             title: '创建于',
             field: 'createTime',
@@ -52,26 +60,32 @@ export default class OrderConfig extends Vue {
     load = false;
 
 
-    async getMyList() {
-        // this.load = true;
-        // const res = await query({ pageSize: 2000, pageNum: 1 }) as IShopResponse<any>;
-        // this.load = false;
-        // if (res.code != 200) {
-        //     return;
-        // }
-        // this.isHasOne = res.rows.length > 0;
-        // (this.$refs.table as any).setValue(res.rows);
+    //同步聚水潭店铺
+    async uploadWaterShop() {
+        this.$confirm('确认同步聚水潭店铺吗?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+        }).then(async () => {
+            const res = await uploadWaterShop({ pageIndex: 1, pageSize: 20 }) as unknown as IShopResponse<any>;
+            if (res.code != 200) {
+                return;
+            }
+            this.$message.success('同步成功');
+            this.getList();
+        }).catch((err: any) => {
+            console.info("取消")
+        })
     }
 
     async getList() {
-        // this.load = true;
-        // const res = await queryOrderTimeConfig({ pageSize: 20, pageNum: 1 }) as IOrderTimeResponse<IOrderTimeConfigItem[]>;
-        // this.load = false;
-        // if (res.code != 200) {
-        //     return;
-        // }
-        // this.isHasOne = res.rows.length > 0;
-        // (this.$refs.table as any).setValue(res.rows);
+        this.load = true;
+        const res = await waterShop() as unknown as IResponeData<any>;
+        this.load = false;
+        if (res.code != 200) {
+            return;
+        }
+        (this.$refs.table as any).setValue(res.rows);
     }
     clickHandle(e: string) {
         if (e == 'onAdd') {