222
schangxiang@126.com
2025-06-13 6a8393408d8cefcea02b7a598967de8dc1e565c2
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
<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>
    <el-dialog :visible.sync="dialogFormVisible" width="500px" title="收货地址">
      <el-alert :closable="false" title="提示:填写需要获得号段数。" type="warning">
      </el-alert>
      <el-form :model="form" class="el-alter-form">
        <el-form-item :label-width="formLabelWidth" label="号段数">
          <el-input v-model="form.txtLen" autocomplete="off"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="onConfirm()">确 定</el-button>
      </div>
    </el-dialog>
  </div>
 
</template>
<script>
import baseLayout from "@/components/common/base-layout.vue";
 
export default {
  name: "api-internal-spare-code-st",
  components: {},
  mixins: [baseLayout],
  data() {
    return {
      dialogFormVisible: false,
      form: {
        txtLen: ""
      },
      formLabelWidth: "80px"
    };
  },
  methods: {
    // 列表页面按钮点击事件
    buttonClick(authNode) {
      switch (authNode) {
        case "btnStoGetCode":
          // 获取申通号段
          this.getStoCode();
          break;
      }
    },
    // 获取申通号段
    getStoCode() {
      this.dialogFormVisible = true;
    },
    onConfirm() {
      this.dialogFormVisible = false;
      var len = this.form.txtLen;
      if (!len) {
        this.$message({
          message: "请输入号段数量!",
          type: "warning"
        });
        return;
      }
 
      var url = "/api/Base_ExpressSpareCode/GetStoCode";
      var parsms = {
        len: len
      };
      const ref = this.dataList;
      this.common.ajax(url, parsms, res => {
        this.common.showMsg(res);
        if (res.result) {
          ref.loadData();
        }
      });
    }
  }
};
</script>
<style lang="scss" scoped>
.el-form {
  margin-top: 20px;
}
</style>