|
<template>
|
<el-dialog :visible.sync="currentVisible" title="打印物料标签" append-to-body width="1000px">
|
<el-alert title="提示:下面可改变打印标签的数量" type="success"></el-alert>
|
<el-table :data="tableData" stripe style="width: 100%">
|
<el-table-column prop="productCode" label="物料编号" width="160">
|
</el-table-column>
|
<el-table-column prop="productName" label="物料名称" width="160">
|
</el-table-column>
|
<el-table-column prop="productStorage" label="未打印数量" width="100">
|
</el-table-column>
|
|
<el-table-column prop="quantity" label="打印数量" width="120">
|
<template slot-scope="{$idnex, row}">
|
<el-input-number v-model.number="row.quantity" controls-position="right" class="w-100" @change="quantityJudge"></el-input-number>
|
</template>
|
</el-table-column>
|
<el-table-column prop="quantity" label="打印重量" width="120">
|
<template slot-scope="{$idnex, row}">
|
<el-input-number v-model.number="row.totalWeight" controls-position="right" class="w-100"></el-input-number>
|
</template>
|
</el-table-column>
|
<el-table-column prop="poCode" label="采购单号" width="135">
|
</el-table-column>
|
<el-table-column prop="itemNumber" label="采购项号" width="120">
|
</el-table-column>
|
<el-table-column prop="saleCode" label="销售单号" width="120">
|
</el-table-column>
|
<el-table-column prop="extendField08" label="销售项号" width="120">
|
</el-table-column>
|
<el-table-column prop="extendField04" label="跟踪号" width="120">
|
</el-table-column>
|
<el-table-column prop="limitDate" label="限用日期" width="160">
|
</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-barcodes",
|
components: {},
|
props: {
|
visible: {
|
type: Boolean,
|
default: false,
|
required: true
|
}
|
},
|
data() {
|
return {
|
id: "",
|
tableData: [],
|
formLabelWidth: "80px",
|
// 管理列表dataOptions参数
|
dataOptions: {
|
type: Object,
|
default: () => {
|
return {};
|
}
|
}
|
};
|
},
|
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() {
|
// const idField = this.dataOptions.idField;
|
// var ids = this.$parent.dataListSelections.map(item => item[idField]);
|
|
if (!this.tableData.length) {
|
this.$message.error("执行选择一项");
|
return;
|
}
|
var params = Object.assign({}, this.$parent.dataOptions);
|
const quantity = this.tableData[0].quantity;
|
const totalWeight = this.tableData[0].totalWeight;
|
// 将数量传入到打印页面
|
params.quantity = quantity;
|
params.totalWeight = totalWeight;
|
|
// 明细参数处理
|
var ref = this.findRef(this.$parent.editorRef);
|
params.detailList = ref.detailFields.map(item => {
|
const newItem = {
|
tableName: item.subTableView,
|
pageIndex: item.options.pageIndex,
|
pageSize: item.options.pageSize,
|
idField: item.options.idField,
|
orderBy: item.options.orderBy,
|
quantity: item.quantity
|
};
|
if (item.options.showSumField) {
|
newItem.sumColumnNames = item.options.sumColumnNames;
|
}
|
return newItem;
|
});
|
debugger;
|
const key = this.common.getGUID();
|
sessionStorage[key] = JSON.stringify(params);
|
this.updateData();
|
this.tableData.forEach(item => {
|
window.open("/#/print/base-template-id/" + 20002 + "/" + 1616 + "/" + item.position_Id + "?key=" + key);
|
});
|
},
|
// 打印标签更改数量
|
updateData() {
|
const url = "/api/storage/check/updatePrintCount";
|
debugger;
|
const params = {
|
position_Id: this.tableData[0].position_Id
|
};
|
var callback = res => {
|
if (res.result) {
|
res.data;
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
}
|
}
|
};
|
</script>
|
<style lang="less" scoped>
|
@deep: ~">>>";
|
@{deep} .el-dialog__body {
|
padding: 0px 10px;
|
}
|
</style>
|