|
<template>
|
<el-dialog :visible.sync="currentVisible" title="打印条码">
|
<el-alert title="提示:下面可改变需要打印的实际数量" type="success"></el-alert>
|
<el-table :data="tableData" stripe style="width: 100%">
|
<el-table-column prop="productModel" label="条码" width="180">
|
</el-table-column>
|
<el-table-column prop="quantity" label="打印数量" width="180">
|
<template slot-scope="{$idnex, row}">
|
<el-input-number v-model.number="row.quantity" controls-position="right" class="w-100"></el-input-number>
|
</template>
|
</el-table-column>
|
<el-table-column prop="productSpec" label="规格">
|
</el-table-column>
|
</el-table>
|
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="currentVisible = false">取 消</el-button>
|
<el-button type="primary" @click="printBarcode">确 定</el-button>
|
</div>
|
</el-dialog>
|
</template>
|
|
<script>
|
export default {
|
name: "order-barcode",
|
components: {},
|
props: {
|
visible: {
|
type: Boolean,
|
default: false,
|
required: true
|
}
|
},
|
data() {
|
return {
|
id: "",
|
tableData: [],
|
formLabelWidth: "80px"
|
};
|
},
|
computed: {
|
currentVisible: {
|
get: function() {
|
return this.visible;
|
},
|
set: function(val) {
|
this.$emit("update:visible", val);
|
}
|
}
|
},
|
methods: {
|
showData(rows, keyValues) {
|
localStorage.setItem("keyValues", JSON.stringify(keyValues));
|
this.tableData = rows;
|
},
|
printBarcode() {
|
if (!this.tableData.length) {
|
this.$message.error("执行选择一项");
|
return;
|
}
|
localStorage.setItem("tableData", JSON.stringify(this.tableData));
|
localStorage.setItem("printType", "物料条码打印");
|
|
var url = "/#/inbound/purchase/print-barcode";
|
window.open(url);
|
}
|
}
|
};
|
</script>
|
<style lang="less" scoped>
|
@deep: ~">>>";
|
@{deep} .el-dialog__body {
|
padding: 0px 10px;
|
}
|
</style>
|