schangxiang@126.com
2025-09-19 9be9c3784b2881a3fa25e93ae2033dc2803c0ed0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<template>
  <div ref="container" class="page-list-container">
    <!--数据Table-->
    <yrt-data-list :ref="dataListRef" :editor-ref="editorRef" :data-options="dataOptions" :fields.sync="dataListOptions.fields" :buttons="dataListOptions.buttons" :button-click="buttonClick" :data-list-selections.sync="dataListSelections" :auth-nodes="authNodes">
    </yrt-data-list>
 
    <!--数据编辑器Editor-->
    <yrt-editor :ref="editorRef" :data-list-ref="dataListRef" v-bind="editorOptions" :data-options="dataOptions" :action.sync="editorOptions.action" :visible.sync="editorOptions.
    config.visible" :detail-button-click="detailButtonClick" :auth-nodes="authNodes">
    </yrt-editor>
 
    <el-dialog :visible.sync="dialogVisible" title="获取订单信息" width="700px">
      <el-form ref="form" :model="form" label-width="120px">
        点击确定按钮开始获取最近两天的订单
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="getOrder">开始获取</el-button>
      </span>
    </el-dialog>
 
    <el-dialog :visible.sync="searchdialogVisible" title="获取订单信息" width="700px">
      <el-form ref="form" :model="form" label-width="120px">
        <el-form-item label="微店订单ID">
          <el-input v-model="form.order_id" class="w-300"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="getOrderQuery">开始获取</el-button>
      </span>
    </el-dialog>
 
  </div>
</template>
 
<script>
import baseLayout from "@/components/common/base-layout.vue";
 
export default {
  name: "interface-weidian-order",
  components: {},
  mixins: [baseLayout],
  data() {
    return {
      // 显示拉取弹出窗口
      dialogVisible: false,
      searchdialogVisible: false,
      form: {
        order_id: null // 搜索关键词
      }
    };
  },
  methods: {
    // 列表页面按钮点击事件
    buttonClick(authNode) {
      switch (authNode) {
        case "getOrder":
          // 显示对话框
          this.dialogVisible = true;
          return true;
        case "getOrderQuery":
          // 显示对话框
          this.searchdialogVisible = true;
          return true;
      }
    },
    // 获取accessToken
    getOrder() {
      const url = "/api/interface/weidian/basicInfo/getOrder";
      const params = {};
      this.common.ajax(
        url,
        params,
        res => {
          this.common.showMsg(res);
          if (res.result) {
            this.dataList.reload();
            this.dialogVisible = false;
          }
        },
        true
      );
    },
 
    // 获取订单查询
    getOrderQuery() {
      if (!this.form.order_id) {
        this.$message.error("请输入关键词");
        return;
      }
 
      const url = "/api/interface/weidian/basicInfo/getOrderQuery";
      const params = {
        order_id: this.form.order_id
      };
      this.common.ajax(
        url,
        params,
        res => {
          this.common.showMsg(res);
          if (res.result) {
            this.dataList.reload();
            this.searchdialogVisible = false;
          }
        },
        true
      );
    }
  }
};
</script>