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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<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" :action-field="actionField" :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" :top.sync="editorOptions.top" :visible.sync="editorOptions.config.visible" :detail-button-click="detailButtonClick" :auth-nodes="authNodes" :btn-read-only="btnReadOnly" @on-change="onChange">
    </yrt-editor>
  </div>
</template>
<script>
import baseLayout from "@/components/common/base-layout.vue";
 
export default {
  name: "tms-way-bill-temp",
  components: {},
  mixins: [baseLayout],
  data() {
    return {
      authNodes: {
        export: true
      },
      actionField: {
        prop: "_action",
        label: "操作",
        width: "100",
        headerAlign: "center",
        align: "center",
        action: [
          {
            type: "button",
            action: "edit",
            label: "编辑"
          }
        ],
        hidden: false
      }
    };
  },
  methods: {
    // 列表页面按钮点击事件
    buttonClick(authNode) {
      switch (authNode) {
        case "batchConfirm":
          // 批量审核
          this.multiAuditing();
          break;
      }
    },
    // 审核
    multiAuditing() {
      const the = this;
      this.$confirm("确定要批量进行审核操作吗?", "批量审核", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          // 获得已选中的ID
          var IsExpressCorpName = true; // 判断国内快递是否选择
          var IsPortName = true; // 判断清关口岸是否选择
          const selectIDs = the.dataListSelections
            .map((item, index, Array) => {
              if (!item.ExpressCorpName) {
                IsExpressCorpName = false;
              }
              if (!item.portName) {
                IsPortName = false;
              }
              return item.WayBill_Id;
            })
            .join(",");
          if (selectIDs === "") {
            this.$message({
              message: "至少选中一行!",
              type: "warning"
            });
            return;
          }
          if (IsExpressCorpName !== true) {
            this.$message({
              message: "未选择国内快递!",
              type: "warning"
            });
            return;
          }
          if (IsPortName !== true) {
            this.$message({
              message: "未选择清关口岸!",
              type: "warning"
            });
            return;
          }
          const url = "/api/TMS_WayBill/MultiConfirm";
          const params = {
            IDs: selectIDs
          };
          const ref = the.dataList;
          var callback = res => {
            the.common.showMsg(res);
            if (res.result) {
              ref.loadData();
            }
          };
          the.common.ajax(url, params, callback, ref);
        })
        .catch(() => {
          the.$message({
            type: "info",
            message: "已取消"
          });
        });
    },
    onChange(ref, val, field, formData) {
      var editor = this.editor;
      if (field.options.prop === "PortName") {
        var url = "/api/TMS_WayBill/getGoodsRegion";
        var parsms = {
          PortName: formData.Port_Id
        };
        this.common.ajax(url, parsms, res => {
          if (res.result) {
            editor.formData.PlanDropOffPort = res.data.RegionName; // 落口名称
          }
        });
      }
    }
  }
};
</script>