schangxiang@126.com
2025-09-10 3d43ffa3152110b7823f9fa6320c08a6ae02358a
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<template>
  <div 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>
  </div>
</template>
<script>
import baseLayout from "@/components/common/base-layout.vue";
 
export default {
  name: "api-internal-ems-order",
  components: {},
  mixins: [baseLayout],
  data() {
    return {};
  },
  methods: {
    // 列表页面按钮点击事件
    buttonClick(authNode) {
      switch (authNode) {
        case "btnHYPushOrder":
          // 宏远推送订单
          this.PushOrder_HY();
          break;
        case "btnGetRoute_HY":
          // 宏远获取路由
          this.GetRoute_HY();
          break;
      }
    },
    // 获国际取路由
    GetRoute_GuoJi() {
      const the = this;
      var orderIdList = "";
      orderIdList = the.dataListSelections
        .map((item, index, Array) => {
          return item.eMSOrder_Id;
        })
        .join(",");
      if (!orderIdList) {
        this.$message({
          message: "至少选择一条记录!",
          type: "warning"
        });
        return;
      }
      this.$confirm("确定要新获得快递单号吗?", "确认信息", {
        distinguishCancelAndClose: true,
        confirmButtonText: "确认",
        cancelButtonText: "取消"
      })
        .then(() => {
          var url = "/api/ExpressSF_Order/GetRoute_GuoJi";
          var parsms = {
            orderIdList: orderIdList
          };
          const ref = this.dataList;
          this.common.ajax(url, parsms, res => {
            this.common.showMsg(res);
            if (res.result) {
              ref.loadData();
            }
          });
        })
        .catch(action => {});
    },
    // 重新获取国际运单号
    GetTraceNumber_GuoJi() {
      const the = this;
      var orderIdList = "";
      orderIdList = the.dataListSelections
        .map((item, index, Array) => {
          return item.SFOrder_Id;
        })
        .join(",");
      if (!orderIdList) {
        this.$message({
          message: "至少选择一条记录!",
          type: "warning"
        });
        return;
      }
      this.$confirm("确定要新获得快递单号吗?", "确认信息", {
        distinguishCancelAndClose: true,
        confirmButtonText: "确认",
        cancelButtonText: "取消"
      })
        .then(() => {
          var url = "/api/ExpressSF_Order/GetTraceNumber_GuoJi";
          var parsms = {
            orderIdList: orderIdList
          };
          const ref = this.dataList;
          this.common.ajax(url, parsms, res => {
            this.common.showMsg(res);
            if (res.result) {
              ref.loadData();
            }
          });
        })
        .catch(action => {});
    },
    PushOrder_HY() {
      const the = this;
      var isOK = true;
      var orderCode = "";
      var orderIdList = "";
      orderIdList = the.dataListSelections
        .map((item, index, Array) => {
          if (item.interfaceStatusText !== "待推送") {
            orderCode = item.orderCode;
            isOK = false;
          }
          return item.eMSOrder_Id;
        })
        .join(",");
      if (!orderIdList) {
        this.$message({
          message: "至少选择一条记录!",
          type: "warning"
        });
        return;
      }
      if (!isOK) {
        this.$message({
          message: "选择订单只允许订单状态为“待推送”," + orderCode + "单号不允许选择推送。",
          type: "warning"
        });
        return;
      }
 
      this.$confirm("确定要推送选中的订单信息到EMS平台吗?", "确认信息", {
        distinguishCancelAndClose: true,
        confirmButtonText: "确认",
        cancelButtonText: "取消"
      })
        .then(() => {
          var url = "/api/api/expressEMSOrder/pushOrderByHY";
          var parsms = {
            orderIdList: orderIdList
          };
          const ref = this.dataList;
          this.common.ajax(url, parsms, res => {
            this.common.showMsg(res);
            if (res.result) {
              ref.loadData();
            }
          });
        })
        .catch(action => {});
    },
    // 从宏远取路由
    GetRoute_HY() {
      const the = this;
      var orderIdList = "";
      orderIdList = the.dataListSelections
        .map((item, index, Array) => {
          return item.eMSOrder_Id;
        })
        .join(",");
      if (!orderIdList) {
        this.$message({
          message: "至少选择一条记录!",
          type: "warning"
        });
        return;
      }
      this.$confirm("确定要新获得路由信息吗?", "确认信息", {
        distinguishCancelAndClose: true,
        confirmButtonText: "确认",
        cancelButtonText: "取消"
      })
        .then(() => {
          var url = "/api/api/expressEMSOrder/getRouteByHY";
          var parsms = {
            orderIdList: orderIdList
          };
          const ref = this.dataList;
          this.common.ajax(url, parsms, res => {
            this.common.showMsg(res);
            if (res.result) {
              ref.loadData();
            }
          });
        })
        .catch(action => {});
    }
  }
};
</script>