From 9b8bf30791469a5e498862439e2f5b87e5463c40 Mon Sep 17 00:00:00 2001
From: guoyujie <guoyujie@ng.com>
Date: 星期三, 09 七月 2025 15:02:43 +0800
Subject: [PATCH] 清除
---
/dev/null | 1217 ---------------------------------------------------------
1 files changed, 0 insertions(+), 1,217 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/components/pp/TagStyleDesigner.vue b/north-glass-erp/northglass-erp/src/components/pp/TagStyleDesigner.vue
deleted file mode 100644
index 6cca927..0000000
--- a/north-glass-erp/northglass-erp/src/components/pp/TagStyleDesigner.vue
+++ /dev/null
@@ -1,1217 +0,0 @@
-<script setup>
-import { hiprint } from "vue-plugin-hiprint"
-import {onMounted, ref} from "vue"
-import TagStyleSet from "@/hook/tagStyleSet"
-import {ElMessage, ElMessageBox} from "element-plus";
-import request from "@/utils/request"
-import {useI18n} from "vue-i18n"
-import {useRouter} from "vue-router";
-import deepClone from "@/utils/deepClone";
-import companyInfo from "@/stores/sd/companyInfo"
-import PrintCustomLabel from '@/components/pp/PrintCustomLabelDetails.vue'
-import PrintCustomLabelSemi from '@/components/pp/PrintCustomLabelSemi.vue'
-import {Printer} from "@element-plus/icons-vue/global"
-import {View} from "@element-plus/icons-vue"
-import QueuePrinter from "@/hook/queue"
-
-const { t } = useI18n()
-const company = companyInfo()
-const dialogTableVisibleLabel = ref(false)
-const dialogTableVisibleCustomLabel = ref(false)
-let produceList = ref([])
-let labelList = ref([])
-let dataList = ref([])
-let lastList = ref([])
-let list = ref([])
-//鎵撳嵃鏈�
-const printerData = ref()
-const printerList = ref()
-// 绾稿紶绫诲瀷
-const paperTypes = {
- '鎴愬搧鏍囩': {
- width: 110,
- height: 110
- },
- '灏忕墖鏍囩': {
- width: 112,
- height: 45
- },
-}
-
-//鏍囩
-let labelRow = ref({
- list: null,//鍕鹃�夌殑鏁版嵁
- faceOrientation: null,//鍐呭闈�
- type: null,//鏍囩妯℃澘
- lableType: null,//鏍囩绫诲瀷
- titleList:null,//鏍囬鍒楄〃
- switch:null//鍒ゆ柇鏄惁涓烘柊鎵撳嵃
-})
-
-//瀹ゅ唴瀹ゅ闈�
-const stateValue = ref('')
-const stateOptions = [
- {
- value: t('processCard.thisIsTheIndoorSurface'),
- label: t('processCard.thisIsTheIndoorSurface'),
- },
- {
- value: t('processCard.thisSideIsOutsideTheRoom'),
- label: t('processCard.thisSideIsOutsideTheRoom'),
- },
-]
-
-const autoPaper = ref({
- width:null,
- height:null
-})
-const tag = ref({
- id:null,
- name:null,
- type:1,
- tagWidth:null,
- tagHeight:null,
- value:null,
- size:null
-
-})
-
-
-//鏍囩绫诲瀷
-let filteredOptions = []
-const lableType = ref('1')
-const lableTypeOptions = [
- {
- value: '1',
- label: t('processCard.finishedProductLabel'),
- },
- /* {
- value: '2',
- label: t('processCard.halfProductLabel'),
- },*/
- {
- value: `${company.printLabel.labelValue}`,
- label: `${company.printLabel.labelType}`,
- },
- {
- value: `${company.printLabel.labelValue3}`,
- label: `${company.printLabel.labelType3}`,
- },
-]
-let hidePrintLabels = company.printLabel.hideButton;
-
-if (hidePrintLabels == 'true') {
- filteredOptions = lableTypeOptions.filter((option, index) => index !== 2);
-} else {
- filteredOptions = lableTypeOptions;
-}
-
-const data = ref({
- printList: []
-})
-
-let props = defineProps({
- list:null,//鍕鹃�夌殑鏁版嵁
- faceOrientation:null,//鍐呭闈�
- type:null,//鏍囩妯℃澘
- lableType:null//鏍囩绫诲瀷
-})
-
-const printContentLabel = ref({
- id: 'childLabel',
-})
-
-const printContentLabelSemi = ref({
- id: 'childLabelSemi',
-})
-
-const {currentRoute} = useRouter()
-const route = currentRoute.value
-let type = props.type
-let lableTypes = props.lableType
-data.value.printList = JSON.parse(props.list)
-
-
-const TgaStyleSet = ref([
- {
- tid: '娓呯┖', title: '', data: '', type: 'text',
- options: {
- field: '',
- testData: '',
- width:100,
- height: 16,
- fontSize: 11.25,
- textAlign: "center",
- textContentVerticalAlign: "middle",
- type:'custom'
- }
- },
- {
- tid: '姝ら潰涓哄鍐呴潰', title: '姝ら潰涓哄鍐呴潰', data: '', type: 'text',
- options: {
- title: '姝ら潰涓哄鍐呴潰',
- testData: '',
- width:100,
- height: 16,
- fontSize: 11.25,
- textAlign: "center",
- textContentVerticalAlign: "middle",
- type:'custom'
- }
- },
- {
- tid: '姝ら潰涓哄澶栭潰', title: '姝ら潰涓哄澶栭潰', data: '', type: 'text',
- options: {
- title: '姝ら潰涓哄澶栭潰',
- testData: '',
- width:100,
- height: 16,
- fontSize: 11.25,
- textAlign: "center",
- textContentVerticalAlign: "middle",
- type:'custom'
- }
- },
- {
- tid: 'orderId', title: '璁㈠崟鍙�', data: '', type: 'text',
- options: {
- field: 'orderId',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'project', title: '椤圭洰鍚嶇О', data: '', type: 'text',
- options: {
- field: 'project',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'batch', title: '鎵规', data: '', type: 'text',
- options: {
- field: 'batch',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'icon', title: '鍟嗘爣', data: '', type: 'text',
- options: {
- field: 'icon',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'orderType', title: '璁㈠崟绫诲瀷', data: '', type: 'text',
- options: {
- field: 'orderType',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'customerName', title: '瀹㈡埛', data: '', type: 'text',
- options: {
- field: 'customerName',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'productName', title: '浜у搧', data: '', type: 'text',
- options: {
- field: 'productName',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'processingNote', title: '鍔犲伐瑕佹眰', data: '', type: 'text',
- options: {
- field: 'processingNote',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'edgingType', title: '纾ㄨ竟绫诲瀷', data: '', type: 'text',
- options: {
- field: 'edgingType',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'buildingNumber', title: '妤煎眰缂栧彿', data: '', type: 'text',
- options: {
- field: 'buildingNumber',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'customerAbbreviation', title: '瀹㈡埛绠�绉�', data: '', type: 'text',
- options: {
- field: 'customerAbbreviation',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'productAbbreviation', title: '浜у搧绠�绉�', data: '', type: 'text',
- options: {
- field: 'productAbbreviation',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'processId', title: '娴佺▼鍗″彿', data: '', type: 'text',
- options: {
- field: 'processId',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'processIdAD', title: '绠�鏄撴祦绋嬪崱', data: '', type: 'text',
- options: {
- field: 'processIdAD',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'quantity', title: '璁㈠崟鏁伴噺', data: '', type: 'text',
- options: {
- field: 'quantity',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'size', title: '灏哄鏁伴噺', data: '', type: 'text',
- options: {
- field: 'size',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'numberSize', title: '搴忓昂鏁�', data: '', type: 'text',
- options: {
- field: 'numberSize',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'numberSizeQuantity', title: '搴忓彿灏哄', data: '', type: 'text',
- options: {
- field: 'numberSizeQuantity',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'orderNumber', title: '璁㈠崟搴忓彿', data: '', type: 'text',
- options: {
- field: 'orderNumber',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'technologyNumber', title: '灏忕墖椤哄簭', data: '', type: 'text',
- options: {
- field: 'technologyNumber',
- testData: '',
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'process', title: '宸ヨ壓娴佺▼', data: '', type: 'text',
- options: {
- field: 'process',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'color', title: '鑶滅郴', data: '', type: 'text',
- options: {
- field: 'color',
- testData: '',
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'figureNumber', title: '鍥惧彿', data: '', type: 'text',
- options: {
- field: 'figureNumber',
- testData: '',
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'colourCeramicGlaze', title: '褰╅噳鍥惧彿', data: '', type: 'text',
- options: {
- field: 'colourCeramicGlaze',
- testData: '',
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'glassNumber', title: '缂栧彿', data: '', type: 'text',
- options: {
- field: 'glassNumber',
- testData: '',
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'remarks', title: '璁㈠崟澶囨敞', data: '', type: 'text',
- options: {
- field: 'remarks',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'remarks1', title: '澶囨敞1', data: '', type: 'text',
- options: {
- field: 'remarks1',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'remarks2', title: '澶囨敞2', data: '', type: 'text',
- options: {
- field: 'remarks2',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'remarks3', title: '澶囨敞3', data: '', type: 'text',
- options: {
- field: 'remarks3',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'remarks4', title: '澶囨敞4', data: '', type: 'text',
- options: {
- field: 'remarks4',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'filmNumber', title: '浜у搧澶囨敞', data: '', type: 'text',
- options: {
- field: 'filmNumber',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'bendRadius', title: '鍗婂緞', data: '', type: 'text',
- options: {
- field: 'bendRadius',
- testData: '',
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'glassChild', title: '鍗曠墖鍚嶇О', data: '', type: 'text',
- options: {
- field: 'glassChild',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'glassAddress', title: '鐗囨爣璁�', data: '', type: 'text',
- options: {
- field: 'glassAddress',
- testData: '',
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'width', title: '瀹�', data: '', type: 'text',
- options: {
- field: 'width',
- testData: '',
- width:100,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'height', title: '楂�', data: '', type: 'text',
- options: {
- field: 'height',
- testData: '',
- width:100,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'flow_card_sort', title: '宸ョ▼娴佺▼鍗$紪鍙�', data: '', type: 'text',
- options: {
- field: 'flow_card_sort',
- testData: '',
- width:100,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'heat_layout_id', title: '鐐夊彿', data: '', type: 'text',
- options: {
- field: 'heat_layout_id',
- testData: '',
- width:100,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'heat_layout_sort', title: '鐐夊唴搴忓彿', data: '', type: 'text',
- options: {
- field: 'heat_layout_sort',
- testData: '',
- width:100,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'sumQuantity', title: '璁㈠崟鎬绘暟', data: '', type: 'text',
- options: {
- field: 'sumQuantity',
- testData: '',
- width:100,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle"
- }
- },
- {
- tid: 'custom1', title: '鑷畾涔�1', data: '', type: 'text',
- options: {
- title: '鑷畾涔�1',
- field: 'custom1',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle",
- type:'custom'
- }
- },
- {
- tid: 'custom2', title: '鑷畾涔�2', data: '', type: 'text',
- options: {
- title: '鑷畾涔�2',
- field: 'custom2',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle",
- type:'custom'
- }
- },
- {
- tid: 'custom3', title: '鑷畾涔�3', data: '', type: 'text',
- options: {
- title: '鑷畾涔�3',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle",
- type:'custom'
- }
- },
- {
- tid: 'custom4', title: '鑷畾涔�4', data: '', type: 'text',
- options: {
- title: '鑷畾涔�4',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle",
- type:'custom'
- }
- },
- {
- tid: 'custom5', title: '鑷畾涔�5', data: '', type: 'text',
- options: {
- title: '鑷畾涔�5',
- testData: '',
- width:270,
- height: 16,
- fontSize: 11.25,
- textAlign: "left",
- textContentVerticalAlign: "middle",
- type:'custom'
- }
- },
-
- /*{
- tid: 'table',
- field: 'table',
- title: '鑷畾涔夎〃鏍�',
- type: 'table',
- //columns:[[null,null,null,null,null,null]],
- "options": {
- "left": 20,
- "top": 20,
- "height": 56,
- "width": 555,
- "field": "table",
- "tableHeaderRepeat": "none",
- "tableBorder": "noBorder",
- "tableBodyRowBorder": "noBorder",
- "tableBodyCellBorder": "noBorder",
- "fields": [
- {
- "text": "鍟嗗搧鍚嶇О",
- "field": "orderId"
- },
- {
- "text": "鍟嗗搧缂栫爜",
- "field": "orderNumber"
- }
- ],
-
- },
- "columns": [
- [
- {
- "width": 138.75,
- "title": "鍟嗗搧鍚嶇О",
- "field": "orderId",
- "checked": true,
- "columnId": "orderId",
- "fixed": false,
- "rowspan": 1,
- "colspan": 1,
- "renderFormatter": "function(value,row,index,options){return `璁㈠崟鍙凤細${row.orderId || '娴嬭瘯鍟嗗搧鍚�'}<br>鏉$爜锛�${row.barcode || '123456'}`}"
- },
- ]
- ]
- }*/
-
-])
-
-const tags = ref([])
-const activeName = ref(null)
-
-
-
-
-
-// 蹇呴』鍦� dom 鍔犺浇瀹屾垚涔嬪悗缁欏垰鍒氱粦瀹氫笂鐨勫厓绱犳坊鍔犱笂鎷栨嫿浜嬩欢
-onMounted(async () => {
- let table = {
- tid: 'table',
- field: 'table',
- title: '鑷畾涔夎〃鏍�',
- type: 'table',
- "options": {
- "left": 20,
- "top": 20,
- "height": 56,
- "width": 555,
- "field": "table",
- "tableHeaderRepeat": "none",
- "tableBorder": "noBorder",
- "tableBodyRowBorder": "noBorder",
- "tableBodyCellBorder": "noBorder",
- "gridColumnsGutter": 3,
- "fields": [
- ],
-
- },
- columns:[[null,null,null,null,null,null,null,null]]
-
- }
- let list = []
- TgaStyleSet.value.forEach(item => {
- let para = {
- text: item.title,
- field: item.options.field || item.options.title,
- }
- if(item.options.type){
- para.type = item.options.type
- }
- list.push(para)
- })
- table.options.fields = list
- TgaStyleSet.value.push(table)
- await getTags()
-
- await hiprint.init({
- providers: [new TagStyleSet(TgaStyleSet.value)]
- });
-
-
- // 娉ㄥ唽榛樿闈㈡澘
-
- await buildDesigner()
-})
-
-
-let hiprintTemplate = ref()
-const buildDesigner = () => {
- document.querySelector('#hiprint-printTemplate').innerHTML = ''
- document.querySelector('.hiprintEpContainer').innerHTML = ''
- // 缁戝畾鎷栨嫿浜嬩欢
- hiprint.PrintElementTypeManager.build('.hiprintEpContainer', 'defaultModule')
- // new hiprint.PrintTemplate 鐨勮繑鍥炲�兼槸涓�涓ā鏉跨殑瀹炰緥
- // 浼犲叆鐨勫弬鏁板悇绉嶇殑閰嶇疆椤�
- // settingContainer锛氬睘鎬ф爮闈㈡澘
- hiprintTemplate.value = new hiprint.PrintTemplate({
- settingContainer: "#PrintElementOptionSetting"
- });
-
- // 鏋勫缓涓�涓璁℃ā鏉匡紝鎸囧畾瀹瑰櫒锛屾槸鍚﹀紑鍚綉鏍煎睍绀�
- hiprintTemplate.value.design("#hiprint-printTemplate",{grid:true});
- //鏈繛鎺� 鍒欒繘琛岃繛鎺ユ墦鍗版湇鍔″櫒
- if (!hiprint.hiwebSocket.opened) {
- hiprint.hiwebSocket.setHost("http://localhost:17521")
- }
- //鑾峰彇鎵撳嵃鏈哄垪琛�
- hiprint.refreshPrinterList((list) => {
- // console.log('refreshPrinterList')
- // console.log(list)
- printerList.value=list
- });
-};
-
-
-
-const changePaperSize = (size,type) => {
- try{
- if(type==='list'){
- hiprintTemplate.value.setPaper(size.width, size.height)
- }else{
- if (autoPaper.value.width==null ||autoPaper.value.width=='' || autoPaper.value.height==null || autoPaper.value.height==''){
- ElMessage.warning("璇疯緭鍏ュ畬鏁村楂�")
- }
- else {
- hiprintTemplate.value.setPaper(autoPaper.value.width, autoPaper.value.height)
- }
-
- }
- }catch (e){
-
- }
-}
-
-const save = (type) => {
- ElMessageBox.prompt( t('components.addNewSignature')+':', {
- confirmButtonText: t('basicData.save'),
- cancelButtonText: t('basicData.cancelButtonText'),
- inputPattern:/^.{1,20}$/,
- inputErrorMessage: t('components.message'),
- inputValue:tag.value.name
- }).then(({ value }) => {
- tag.value.name = value
- let json = $ref(hiprintTemplate.value.getJson())
- const tableFlag = json.panels[0].printElements.filter(item => item.options.field==='table')
- json.panels[0].printElements.forEach((item,index) => {
- if (item.options.field === 'table') {
- const fields = json.panels[0].printElements[index].options.fields.filter(item => item.type)
- const result = Object.fromEntries(
- fields.map(item => [item.field, true]) // 杞崲鎴� [key, value] 鏁扮粍
- )
- let funct = "function(value,row,index,options){return `"
- json.panels[0].printElements[index].options.columns[0].forEach(item => {
- if(item.field && !result[item.field ]){
- if (company.printShowTitle){
- funct += item.title+':${row.'+item.field+' || "" } <br>'
- }else{
- funct += '${row.'+item.field+' || "" } <br>'
- }
- }else if(item.field && result[item.field]){
- funct += item.title+'<br>'
- }
- })
- funct+='<br><br>`}'
- json.panels[0].printElements[index].options.columns[0][0].renderFormatter = funct
- }
- })
-
-
-
-
-
- if(type === 'save'){
- tag.value.value = JSON.stringify(json)
- request.post('tagStyle/saveTag',tag.value).then(res => {
- if(res.code === '200' && res.data===true){
- ElMessage.success(t('basicData.msg.saveSuccess'))
- getTags()
- }
- })
- }else{
- request.post('tagStyle/addTag',tag.value).then(res => {
- if(res.code === '200' && res.data===true){
- ElMessage.success(t('basicData.msg.saveSuccess'))
- getTags()
- }
- })
- }
- hiprintTemplate.value.update(json)
- })
-}
-
-
-const getTags = () => {
- request.get('tagStyle/getTagList').then(res => {
- tags.value = res.data
- })
-}
-const changeTag = () => {
- const json = JSON.parse(tag.value.value)
- //json.panels[0].printElements[0].options.fields.push({text: '鍟嗘爣', field: 'icon'})
-
- hiprintTemplate.value.setPaper(json.panels[0].width, json.panels[0].height)
- hiprintTemplate.value.update(json)
-}
-
-const clear = () => {
- hiprintTemplate.value.clear()
-}
-
-const deleteTag = () => {
- request.post(`tagStyle/deleteTag/${tag.value.id}`).then(res => {
- if(res.code === '200' && res.data===true){
- ElMessage.success(t('basicData.msg.deleteSuccess'))
- getTags()
- close()
- }
- })
-}
-
-const htmlPrint = () => {
- let lableTypes= lableType.value
- let faceOrientation = stateValue.value
- type=tag.value.name
- if (type === null || type === '' || type === undefined) {
- ElMessage.warning(t('processCard.pleaseSelectCustomPrintLabelStyle'))
- return
- }
- const titleList = ref({})
- titleList.value=JSON.parse(JSON.stringify(hiprintTemplate.value.getJson()))
- const printElements = titleList.value.panels[0].printElements;
- let a = []
- printElements.forEach(element => {
- if(element.options.field==='table'){
- element.options.columns[0].forEach(elements => {
- if(elements.field){
- a.push({
- title: elements.title,
- name: elements.field
- }
- )
- }
- })
- }else{
- a.push({
- title: element.options.title,
- name: element.options.field
- })
- }
- })
- labelRow.value.titleList = a
-
- labelRow.value.list =props.list
- labelRow.value.faceOrientation = faceOrientation
- labelRow.value.type = type
- labelRow.value.lableType = lableType.value
- labelRow.value.switch=true
- lastList.value = []
- if (lableTypes == 1) {
-
- if (company.label === 1) {
- dialogTableVisibleLabel.value = true
- }
-
- } else if (lableTypes == 2) {
- if (company.label === 1) {
- dialogTableVisibleCustomLabel.value = true
- }
- }
-
-
-
-}
-
-
-const printOrder = (type) => {
- const list = hiprintTemplate.value.getJson()
-
- list.panels[0].printElements.forEach(element => {
- element.options.fontFamily = 'Arial'
- if(element.printElementType.title!==''){
- element.printElementType.title1=element.printElementType.title
- element.options.title1 = element.options.title
- }
-
- if(type===3 && element.options.field!==''){
- element.printElementType.title=''
- element.options.title=''
- }else{
- element.printElementType.title=element.options.title1
- element.options.title=element.options.title1
- }
-
- })
- hiprintTemplate.value.update(list)
-
- let object = lastList.value
- //鍒ゆ柇鏄惁涓鸿〃鏍�
- let columnsNum = null
- if(list.panels[0].printElements[0].options.field==='table'){
- object = {table:lastList.value}
- columnsNum = (list.panels[0].printElements[0].options.gridColumns || 1)
- }
- let printer=printerData.value
- if(type===1){
- const queuePrinter = new QueuePrinter( object,hiprintTemplate,columnsNum,printer)
- queuePrinter.tick
- }else{
- hiprintTemplate.value.print(object)
- }
-
-}
-const closeDialog = () => {
- const list = hiprintTemplate.value.getJson()
- list.panels[0].printElements.forEach(element => {
- element.options.fontFamily = 'Arial'
- if (element.printElementType.title === '') {
- element.printElementType.title = element.printElementType.title1
- element.options.title = element.options.title1
- }
- })
- hiprintTemplate.value.update(list)
-}
-
-const selectRecordsData = ref({
- printList: []
-})
-// 鐩戝惉鎵撳嵃娆℃暟浜嬩欢
-const printNumber = () => {
- selectRecordsData.value.printList = JSON.parse(props.list)
- request.post(`/tagStyle/updatePrintNumber`, selectRecordsData.value).then((res) => {
- if (res.code == 200 && res.data === true) {
- } else {
-
- ElMessage.warning(t('basicData.msg.saveFail'))
-
- }
- })
-}
-</script>
-
-<template>
- <div style="height: 100%;width: 100%">
- <div style="height: 10%;width: 100%;float: left" @change="changePaperSize">
- <el-row>
- <el-col :span="6" >
- <el-button-group >
- <el-button v-for="(item,key) in paperTypes" @click="changePaperSize(item,'list')" >{{key}}</el-button>
- <el-popover placement="right" :width="250" trigger="click">
- <template #reference>
- <el-button >鑷畾涔夊昂瀵�</el-button>
- </template>
- <el-input v-model="autoPaper.width" type="number" >
- <template #prepend>瀹�</template>
- <template #append>mm</template>
- </el-input>
- <el-input v-model="autoPaper.height" type="number" >
- <template #prepend>楂�</template>
- <template #append>mm</template>
- </el-input>
- <el-button
- @click="changePaperSize(null,'other')"
- style="float: right;margin-top: 0.5rem"
- type="primary"
- >纭畾</el-button>
- </el-popover>
- </el-button-group>
- </el-col>
- <el-col :span="6">
- <el-select v-model="tag" @change="changeTag" placeholder="鏍囩妯℃澘鍒楄〃" style="width: 140px" >
- <el-option
- v-for="(tag,index) in tags"
- :key="index"
- :label="tag.name"
- :value="tag"
- />
- </el-select>
-
- <el-select v-model="lableType" :placeholder="lableTypeOptions[0].label" class="m-2" style="width: 120px">
- <el-option
- v-for="item in filteredOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-col>
- <el-col :span="3">
- <el-select v-model="printerData" :placeholder="$t('processCard.pleaseSelect')" clearable default-value="default_city"
- style="width: 160px">
- <el-option
- v-for="item in printerList"
- :key="item.displayName"
- :label="item.name"
- :value="item.name"
- />
- </el-select>
- </el-col>
- <el-col :span="6">
- <el-button type="primary" @click="save('save')">淇濆瓨</el-button>
- <el-button type="primary" @click="save('copy')">澶嶅埗</el-button>
- <el-button type="warning" @click="clear">娓呯┖</el-button>
- <el-button :disabled="!tag.id" type="danger" @click="deleteTag">鍒犻櫎</el-button>
- <el-button type="primary" @click="htmlPrint">棰勮</el-button>
- </el-col>
- </el-row>
-
-
-
- </div>
- <div style="height: 90%;width: 10%;float: left;overflow-y: auto" class="hiprintEpContainer"/>
- <div style="height: 90%;width: 60%;overflow: auto;float: left">
- <div id="hiprint-printTemplate" class="hiprint-printTemplate" style="margin-left: 20px;margin-top: 20px"></div>
- </div>
- <div style="height: 90%;width: 30%;float: left;overflow: auto;">
- <div id="PrintElementOptionSetting" class="PrintElementOptionSetting"></div>
- </div>
-
-
-
- </div>
-
- <!-- 鎴愬搧鏍囩-->
- <el-dialog
- id="sizeCustom"
- v-model="dialogTableVisibleLabel"
- :title="$t('processCard.printLabel')"
- destroy-on-close
- @close="closeDialog"
- style="width: 80%;height:75% ">
- <template #header="{ close, titleId, titleClass }">
- <el-button @click="printOrder(2);printNumber()" :icon="View" circle/>
- <el-button @click="printOrder(1);printNumber()" :icon="Printer" circle/>
- <el-button @click="printOrder(3);printNumber()" >鏃犳爣棰�</el-button>
-
- </template>
- <print-custom-label id="childLabel"
- destroy-on-close
- :lastList = 'lastList'
- :faceOrientation="labelRow.faceOrientation"
- :lableType="labelRow.lableType"
- :list="labelRow.list"
- :type="labelRow.type"
- :titleList="labelRow.titleList"
- :switch="labelRow.switch"
- style="width: 100%;height: 100%"/>
- </el-dialog>
-
- <!-- 灏忕墖鏍囩 -->
- <el-dialog
- id="sizeCustomSemi"
- v-model="dialogTableVisibleCustomLabel"
- :title="$t('processCard.labelStyle')"
- destroy-on-close
- style="width: 80%;height:75% ">
- <template #header="{ close, titleId, titleClass }">
- <el-button v-print="printContentLabelSemi" :icon="Printer" circle/>
- </template>
- <print-custom-label-semi id="childLabelSemi"
- destroy-on-close
- :faceOrientation="labelRow.faceOrientation"
- :lableType="labelRow.lableType"
- :list="labelRow.list"
- :type="labelRow.type"
- :titleList="labelRow.titleList"
- :switch="labelRow.switch"
- style="width: 100%;height: 100%"/>
- </el-dialog>
-
-</template>
-
-<style scoped>
-:deep(#sizeCustom .el-dialog__body) {
- height: 85%;
- width: 100%;
- overflow-y: auto;
-}
-
-:deep(#sizeCustomSemi .el-dialog__body) {
- height: 85%;
- width: 100%;
- overflow-y: auto;
-}
-</style>
\ No newline at end of file
--
Gitblit v1.8.0