<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" :fixed-where="fixedWhere">
|
<template slot="button-tool2-slot">
|
<el-checkbox v-model="showAll" @change="onShowAll">显示全部</el-checkbox>
|
</template>
|
</yrt-data-list>
|
|
<position-group-barcode ref="position-group-barcode-dialog" :visible.sync="barcodeVisible"></position-group-barcode>
|
</div>
|
</template>
|
|
<script>
|
import baseLayout from "@/components/common/base-layout.vue";
|
import positionGroupBarcode from "./components/position-group-barcode.vue";
|
|
export default {
|
name: "storage-base-product-position-group",
|
components: {
|
positionGroupBarcode
|
},
|
mixins: [baseLayout],
|
data() {
|
return {
|
// 条码对话框是否显示
|
barcodeVisible: false,
|
// 显示全部
|
showAll: false,
|
fixedWhere: {
|
productStorage: {
|
operator: ">",
|
value: 0
|
}
|
}
|
};
|
},
|
created() {},
|
methods: {
|
buttonClick(authNode) {
|
switch (authNode) {
|
case "printBarcode":
|
// 锁定
|
this.printBarcode();
|
break;
|
case "exportProductInfo":
|
// 导出
|
this.exportProductInfo();
|
break;
|
}
|
},
|
printBarcode() {
|
this.barcodeVisible = true;
|
// 得到,明细选中项
|
var dataListSelections = this.dataListSelections;
|
if (!dataListSelections.length) {
|
this.$message.error("至少选择一项!");
|
return;
|
}
|
this.barcodeVisible = true;
|
var rows = JSON.parse(JSON.stringify(dataListSelections));
|
this.$refs["position-group-barcode-dialog"].showData(rows);
|
},
|
// 显示全部
|
onShowAll() {
|
if (this.showAll) {
|
this.fixedWhere = {};
|
} else {
|
this.fixedWhere.productStorage = {
|
operator: ">",
|
value: 0
|
};
|
}
|
this.$nextTick(() => {
|
this.dataList.loadData();
|
});
|
},
|
// 导出物料库存信息
|
exportProductInfo() {
|
var the = this;
|
var selectedIds = the.dataListSelections
|
.map((item, index, array) => {
|
return item.productPosition_Id;
|
})
|
.join(",");
|
if (!selectedIds.length) {
|
this.$message.error("请至少选择一行数据!");
|
return false;
|
}
|
var url = "/api/storage/productPosition/exportProductInfo";
|
const params = {
|
ids: selectedIds
|
};
|
var callback = res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
const url = this.common.domain + "/api/common/download?url=" + res.data.url;
|
window.open(url);
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
}
|
}
|
};
|
</script>
|