工序打印
This commit is contained in:
parent
c5601abdc6
commit
4ccb836593
|
|
@ -22,12 +22,18 @@
|
||||||
<vxe-toolbar ref="xToolbar" custom>
|
<vxe-toolbar ref="xToolbar" custom>
|
||||||
<template #buttons>
|
<template #buttons>
|
||||||
<a-button type="primary" icon="delete" @click="pageDelete()">批量删除</a-button>
|
<a-button type="primary" icon="delete" @click="pageDelete()">批量删除</a-button>
|
||||||
|
<a-button type="primary" style="margin-left: 5px;" icon="print" v-if="options.enabledPrint"
|
||||||
|
@click="pagePrint()">打印</a-button>
|
||||||
|
|
||||||
<a-button type="primary" style="margin-left: 5px;" icon="export" v-if="options.enabledExport"
|
<a-button type="primary" style="margin-left: 5px;" icon="export" v-if="options.enabledExport"
|
||||||
@click="pageExport()">导出</a-button>
|
@click="pageExport()">导出</a-button>
|
||||||
<a-button type="primary" style="margin-left: 5px;" icon="import" v-if="options.enabledImport"
|
<a-button type="primary" style="margin-left: 5px;" icon="import" v-if="options.enabledImport"
|
||||||
@click="pageImport()">导入</a-button>
|
@click="pageImport()">导入</a-button>
|
||||||
<a-button type="default" style="margin-left: 5px;" v-if="options.enabledImportTemplate"
|
<a-button type="default" style="margin-left: 5px;" v-if="options.enabledImportTemplate"
|
||||||
@click="pageImportTemplate()">下载导入模板</a-button>
|
@click="pageImportTemplate()">下载导入模板</a-button>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</vxe-toolbar>
|
</vxe-toolbar>
|
||||||
<!-- 表格区 -->
|
<!-- 表格区 -->
|
||||||
|
|
@ -155,6 +161,11 @@ export default {
|
||||||
// 动作
|
// 动作
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
pagePrint(){
|
||||||
|
let tableData = JSON.parse(JSON.stringify(this.$refs.xGrid.getTableData().fullData));
|
||||||
|
this.$emit("print",{tableData:tableData});
|
||||||
|
|
||||||
|
},
|
||||||
pageExport() {
|
pageExport() {
|
||||||
let jsonRows = [];
|
let jsonRows = [];
|
||||||
let headerCells = [];
|
let headerCells = [];
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
|
|
||||||
<basic-page-list ref="listPage" :desc="desc" @importData="pageImport" :options="pageOptions">
|
<basic-page-list ref="listPage" :desc="desc" @importData="pageImport" @print="pagePrint" :options="pageOptions">
|
||||||
<template v-slot:column2="{ row }">
|
<template v-slot:column2="{ row }">
|
||||||
<vue-qr class="qr-code" :text="row.qr_code" :size="120" />
|
<vue-qr class="qr-code" :text="row.qr_code" :size="120" />
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -122,6 +122,21 @@ export default {
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
},
|
},
|
||||||
|
pagePrint({ tableData }) {
|
||||||
|
|
||||||
|
let hiprint = this.$hiPrint; // 获取打印组件
|
||||||
|
let tdata = {};
|
||||||
|
tdata.table = JSON.parse(JSON.stringify(tableData));
|
||||||
|
tdata.table.forEach(item => {
|
||||||
|
item.qrcode = item.qr_code;
|
||||||
|
})
|
||||||
|
console.log(tdata);
|
||||||
|
hiprint.init(); // 初始化打印组件
|
||||||
|
var hiprintTemplate = new hiprint.PrintTemplate({ // 创建打印模板
|
||||||
|
template: settings.printTemplate_processes // 模板内容
|
||||||
|
});
|
||||||
|
hiprintTemplate.print(tdata, { printer: '', title: '工序' }); // 打印
|
||||||
|
},
|
||||||
pageImport({ data }) {
|
pageImport({ data }) {
|
||||||
let rows = [];
|
let rows = [];
|
||||||
data.forEach(item => {
|
data.forEach(item => {
|
||||||
|
|
@ -169,6 +184,7 @@ export default {
|
||||||
enabledExport: true,
|
enabledExport: true,
|
||||||
enabledImport: true,
|
enabledImport: true,
|
||||||
enabledImportTemplate: true,
|
enabledImportTemplate: true,
|
||||||
|
enabledPrint: true,
|
||||||
exportColumns: [
|
exportColumns: [
|
||||||
{ title: '编码', field: "code" },
|
{ title: '编码', field: "code" },
|
||||||
{ title: '工序名称', field: "name" },
|
{ title: '工序名称', field: "name" },
|
||||||
|
|
|
||||||
|
|
@ -1,77 +1,81 @@
|
||||||
var config = {
|
var config = {
|
||||||
|
|
||||||
schemeType_main : "1",
|
schemeType_main: "1",
|
||||||
|
|
||||||
enum_ids:{
|
enum_ids: {
|
||||||
"成型方式" :"139924075643408384",
|
"成型方式": "139924075643408384",
|
||||||
"布产类型" :"139924804936404992",
|
"布产类型": "139924804936404992",
|
||||||
"花面" :"149639114486976512",
|
"花面": "149639114486976512",
|
||||||
"土质" :"149639177091158016",
|
"土质": "149639177091158016",
|
||||||
"查坯方式" :"149639114486976512",
|
"查坯方式": "149639114486976512",
|
||||||
"工艺类型":"149639114486976512",
|
"工艺类型": "149639114486976512",
|
||||||
|
|
||||||
},
|
},
|
||||||
options_status_staff: [
|
options_status_staff: [
|
||||||
{value:1,label:'入职'},
|
{ value: 1, label: '入职' },
|
||||||
{value:2,label:'离职'}
|
{ value: 2, label: '离职' }
|
||||||
],
|
],
|
||||||
options_status_process: [
|
options_status_process: [
|
||||||
{value:1,label:'开启'},
|
{ value: 1, label: '开启' },
|
||||||
{value:2,label:'暂停'}
|
{ value: 2, label: '暂停' }
|
||||||
],
|
],
|
||||||
|
|
||||||
options_is_open:[
|
options_is_open: [
|
||||||
{value:0,label:'不开启'},
|
{ value: 0, label: '不开启' },
|
||||||
{value:1,label:'开启'}
|
{ value: 1, label: '开启' }
|
||||||
],
|
],
|
||||||
options_work_type:[
|
options_work_type: [
|
||||||
{value:'默认计件',label:'默认计件'},
|
{ value: '默认计件', label: '默认计件' },
|
||||||
{value:'计时',label:'计时'}
|
{ value: '计时', label: '计时' }
|
||||||
],
|
],
|
||||||
|
|
||||||
//:0.禁用,1.启用
|
//:0.禁用,1.启用
|
||||||
options_is_enabled:[
|
options_is_enabled: [
|
||||||
{value:0,label:'禁用'},
|
{ value: 0, label: '禁用' },
|
||||||
{value:1,label:'启用'}
|
{ value: 1, label: '启用' }
|
||||||
],
|
],
|
||||||
|
|
||||||
options_yesorno:[
|
options_yesorno: [
|
||||||
{value:0,label:'是'},
|
{ value: 0, label: '是' },
|
||||||
{value:1,label:'否'}
|
{ value: 1, label: '否' }
|
||||||
],
|
],
|
||||||
|
|
||||||
options_warehouse_type:[
|
options_warehouse_type: [
|
||||||
{value:1,label:'普通仓库'},
|
{ value: 1, label: '普通仓库' },
|
||||||
{value:2,label:'现场仓库'},
|
{ value: 2, label: '现场仓库' },
|
||||||
{value:3,label:'委外仓库'}
|
{ value: 3, label: '委外仓库' }
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
||||||
options_warehouse_negative_stock:[
|
options_warehouse_negative_stock: [
|
||||||
{value:0,label:'不允许'},
|
{ value: 0, label: '不允许' },
|
||||||
{value:1,label:'允许'}
|
{ value: 1, label: '允许' }
|
||||||
],
|
],
|
||||||
|
|
||||||
//1.可用,2.待检,3.在检,4.不合格,5.报废,6.待返工
|
//1.可用,2.待检,3.在检,4.不合格,5.报废,6.待返工
|
||||||
options_warehouse_storage_type:[
|
options_warehouse_storage_type: [
|
||||||
{value:1,label:'可用'},
|
{ value: 1, label: '可用' },
|
||||||
{value:2,label:'待检'} ,
|
{ value: 2, label: '待检' },
|
||||||
{value:3,label:'在检'} ,
|
{ value: 3, label: '在检' },
|
||||||
{value:4,label:'不合格'} ,
|
{ value: 4, label: '不合格' },
|
||||||
{value:5,label:'报废'} ,
|
{ value: 5, label: '报废' },
|
||||||
{value:6,label:'待返工'}
|
{ value: 6, label: '待返工' }
|
||||||
],
|
],
|
||||||
|
|
||||||
//属性类型:1.文本,2.数字,3.日期,4.时间,5.日期时间,6.单选,7.布尔
|
//属性类型:1.文本,2.数字,3.日期,4.时间,5.日期时间,6.单选,7.布尔
|
||||||
options_attribute_types:[
|
options_attribute_types: [
|
||||||
{value:"1",label:'文本'} ,
|
{ value: "1", label: '文本' },
|
||||||
{value:"2",label:'数字'} ,
|
{ value: "2", label: '数字' },
|
||||||
{value:"3",label:'日期'} ,
|
{ value: "3", label: '日期' },
|
||||||
{value:"4",label:'时间'} ,
|
{ value: "4", label: '时间' },
|
||||||
{value:"5",label:'日期时间'} ,
|
{ value: "5", label: '日期时间' },
|
||||||
{value:"6",label:'单选'} ,
|
{ value: "6", label: '单选' },
|
||||||
{value:"7",label:'布尔'} ,
|
{ value: "7", label: '布尔' },
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
||||||
|
printTemplate_processes: {"panels":[{"index":0,"name":1,"height":296.6,"width":210,"paperHeader":30,"paperFooter":804,"printElements":[{"options":{"left":18,"top":21,"height":135,"width":550,"tableFooterRepeat":"last","field":"table","tableHeaderRepeat":"first","fields":[{"field":"name","text":"名称"},{"field":"code","text":"编码"},{"field":"qrcode","text":"扫码"}],"right":568,"bottom":57,"vCenter":293,"hCenter":39,"coordinateSync":false,"widthHeightSync":false,"tableBodyRowHeight":28.5,"styler":"function(){ return { padding: \"40px\" } }","columns":[[{"width":150,"title":"名称","field":"name","checked":true,"columnId":"name","fixed":false,"rowspan":1,"colspan":1,"align":"center","tableColumnHeight":30,"tableTextType":"text","tableBarcodeMode":"CODE128A","tableQRCodeLevel":0},{"width":150,"title":"编码","field":"code","checked":true,"columnId":"code","fixed":false,"rowspan":1,"colspan":1,"align":"center","tableColumnHeight":30,"tableTextType":"text","tableBarcodeMode":"CODE128A","tableQRCodeLevel":0},{"width":150,"title":"扫码","field":"qrcode","checked":true,"columnId":"qrcode","fixed":false,"rowspan":1,"colspan":1,"align":"center","tableColumnHeight":"300","tableTextType":"qrcode","tableBarcodeMode":"CODE128A","tableQRCodeLevel":0,"tableSummaryTitle":true,"tableSummary":""}]]},"printElementType":{"title":"通用表格","type":"table","editable":true,"columnDisplayEditable":true,"columnDisplayIndexEditable":true,"columnTitleEditable":true,"columnResizable":true,"columnAlignEditable":true,"isEnableEditField":true,"isEnableContextMenu":true,"isEnableInsertRow":true,"isEnableDeleteRow":true,"isEnableInsertColumn":true,"isEnableDeleteColumn":true,"isEnableMergeCell":true}}],"paperNumberLeft":571.5,"paperNumberTop":817.5,"watermarkOptions":{}}]}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = config
|
module.exports = config
|
||||||
Loading…
Reference in New Issue