<template>
|
<div ref="container" 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>
|
|
<!--打印条码弹出页面-->
|
<order-barcodes ref="barcode-dialogs" :visible.sync="barcodeVisible"></order-barcodes>
|
</div>
|
</template>
|
<script>
|
import baseLayout from "@/components/common/base-layout.vue";
|
import orderBarcodes from "@/views/storage/base/components/order-barcodes.vue";
|
|
export default {
|
name: "storage-base-position-print",
|
components: { orderBarcodes },
|
mixins: [baseLayout],
|
data() {
|
return { barcodeVisible: false };
|
},
|
methods: {
|
// 列表页面按钮点击事件
|
buttonClick(authNode) {
|
switch (authNode) {
|
case "productPrint":
|
this.printBarcode();
|
return false;
|
}
|
},
|
// 打印条码
|
printBarcode() {
|
debugger;
|
// 得到,明细选中项
|
var detailSelections = this.dataListSelections;
|
if (!detailSelections.length) {
|
this.$message.error("至少选择一项!");
|
return;
|
}
|
|
var rows = JSON.parse(JSON.stringify(detailSelections));
|
var my_arr=new Array();
|
rows.forEach(item => {
|
my_arr.push(item.extendField06)
|
});
|
|
this.$confirm('确定要重新打印标签吗?', '确认', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
})
|
.then(() => {
|
const url = '/api/task/RePrintBarCode'
|
const params = {
|
barCode:my_arr
|
}
|
//debugger
|
const ref = this.dataList
|
var callback = res => {
|
//this.common.showMsg(res)
|
if (res.result) {
|
//this.$refs.table.clearSelection()
|
|
return this.$message.success('重新打印标签成功')
|
} else {
|
//this.$refs.table.clearSelection()
|
return this.$message.error(res.msg)
|
}
|
}
|
this.common.ajax(url, params, callback, ref)
|
})
|
.catch(() => {
|
this.$message({
|
type: 'info',
|
message: '已取消'
|
})
|
})
|
}
|
}
|
};
|
</script>
|