<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>
|