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
<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: "tms-panel-panel",
  components: {},
  mixins: [baseLayout],
  data() {
    return {};
  },
  methods: {
    // 列表工具栏点击事件
    buttonClick(authNode) {
      switch (authNode) {
        case "printWayBill":
          // 打印快递面单
          this.printWayBill();
          break;
      }
    },
    updateWayBill() {
      var url = "/api/tms/wayBill/updatePrintNum";
      const selectIDs = this.dataListSelections.map((item, index, Array) => {
        return item.WayBill_Id;
      });
      if (selectIDs === "") {
        this.$message({
          message: "至少选中一行!",
          type: "warning"
        });
        return;
      }
      var params = {
        ids: selectIDs
      };
      this.common.ajax(url, params, res => {});
    },
    // 打印快递面单
    printWayBill() {
      if (!this.dataListSelections.length) {
        this.$message.show("至少选择一行");
        return;
      }
      const url = "/api/tms/portTemplate/getTemplateInfo";
      const params = {
        portName: this.dataListSelections[0].portName,
        expressCorp_Id: this.dataListSelections[0].expressCorp_Id
      };
      this.common.ajax(url, params, res => {
        this.common.showMsg(res);
        if (res.result) {
          this.updateWayBill();
          var menu_id = res.data.menu_Id;
          var ids = [];
          this.dataListSelections.forEach(item => {
            ids.push(item[this.dataOptions.idField]);
          });
          window.open(`/#/print/base/${menu_id}/${ids}`);
        }
      });
    }
  }
};
</script>