| | |
| | | import PrintCustomLabel from '@/components/pp/PrintRepairCustomLabel.vue' |
| | | import PrintCustomLabelSemi from '@/components/pp/PrintRepairCustomLabelSemi.vue' |
| | | import footSum from "@/hook/footSum" |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {Search, View} from "@element-plus/icons-vue"; |
| | | import companyInfo from "@/stores/sd/companyInfo" |
| | | import {CircleCheck, Download, Printer} from "@element-plus/icons-vue/global"; |
| | | import SortDetail from "@/components/pp/SelectSortDetailProcessCard.vue"; |
| | | |
| | | import {hiprint} from "vue-plugin-hiprint"; |
| | | //import PrintCustomLabel from '@/components/pp/PrintCustomLabelDetails.vue' |
| | | import QueuePrinter from "@/hook/queue"; |
| | | import PrintCustomLabelProject from "@/components/pp/PrintCustomLabelProject.vue"; |
| | | const company = companyInfo() |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | |
| | | const xGrid = ref(null) |
| | | const xGridDetail =ref(null) |
| | | |
| | | const tags = ref([]) |
| | | |
| | | |
| | | const tag = ref({ |
| | | id: null, |
| | | name: null, |
| | | type: 1, |
| | | tagWidth: null, |
| | | tagHeight: null, |
| | | value: null, |
| | | size: null |
| | | }) |
| | | let lastList = ref([]) |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' : { |
| | |
| | | id: 'childLabelSemi', |
| | | }) |
| | | |
| | | onMounted(async () => { |
| | | await getTags(); |
| | | }) |
| | | |
| | | //打印类型 |
| | | const printType = ref('小片标签') |
| | |
| | | break |
| | | } |
| | | case 'customLabel': { |
| | | if(selectRecords===null ||selectRecords===''||selectRecords.length===0){ |
| | | ElMessage.warning(t('searchOrder.msgList.checkOrder')) |
| | | if (tag.value.name == null || tag.value.name == '') { |
| | | ElMessage.warning(t('请选择标签模板')) |
| | | return |
| | | } |
| | | if (type===null||type===''||type===undefined){ |
| | | ElMessage.warning(t('processCard.pleaseSelectCustomPrintLabelStyle')) |
| | | return |
| | | } |
| | | |
| | | let id = "" |
| | | for (let i = 0; i < selectRecords.length; i++) { |
| | | if (i + 1 === selectRecords.length) { |
| | | id += selectRecords[i].id |
| | | } else { |
| | | id += selectRecords[i].id + "|" |
| | | } |
| | | } |
| | | if (lableTypes==1){ |
| | | |
| | | labelRow.value.list=JSON.stringify(selectRecords) |
| | | labelRow.value.faceOrientation=faceOrientation |
| | | labelRow.value.type=type |
| | | labelRow.value.lableType= lableTypes |
| | | dialogTableVisibleLabel.value=true |
| | | //router.push({path: '/main/processCard/PrintCustomLabel', query: {type:type,faceOrientation:faceOrientation,lableType:lableTypes, printList: JSON.stringify(selectRecords)}}) |
| | | |
| | | } |
| | | else if (lableTypes==2) { |
| | | labelRow.value.list=JSON.stringify(selectRecords) |
| | | labelRow.value.faceOrientation=faceOrientation |
| | | labelRow.value.type=type |
| | | labelRow.value.lableType= lableTypes |
| | | dialogTableVisibleCustomLabel.value=true |
| | | //router.push({path: '/main/processCard/PrintCustomLabelSemi', query: {type:type,faceOrientation:faceOrientation,lableType:lableTypes, printList: JSON.stringify(selectRecords)}}) |
| | | |
| | | }else |
| | | if (lableTypes==3) { |
| | | router.push({path: '/main/processCard/PrintLabel1', query: {type:type,faceOrientation:faceOrientation,lableType:lableTypes, printList: JSON.stringify(selectRecords)}}) |
| | | |
| | | } |
| | | |
| | | |
| | | labelRow.value.list = JSON.stringify(selectRecords) |
| | | labelRow.value.type = tag.value.name |
| | | labelRow.value.dataType = 3 |
| | | labelRow.value.lableType = 2 |
| | | labelRow.value.switch = true |
| | | lastList.value = [] |
| | | dialogTableVisibleLabel.value = true |
| | | break |
| | | } |
| | | case 'printLike': { |
| | |
| | | }) |
| | | } |
| | | |
| | | const getTags = () => { |
| | | request.get('tagStyle/getTagList').then(res => { |
| | | tags.value = res.data |
| | | }) |
| | | } |
| | | let hiprintTemplate = ref() |
| | | const changeTag = () => { |
| | | hiprintTemplate.value = new hiprint.PrintTemplate({}); |
| | | const json = JSON.parse(tag.value.value) |
| | | hiprintTemplate.value.update(json) |
| | | } |
| | | |
| | | // 监听打印完成事件 |
| | | const printNumber = () =>{ |
| | | |
| | |
| | | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const printOrder = (type) => { |
| | | const list = hiprintTemplate.value.getJson() |
| | | list.panels[0].printElements.forEach(element => { |
| | | element.options.fontFamily = 'Arial' |
| | | }) |
| | | 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) |
| | | } |
| | | hiprintTemplate.value.print(object) |
| | | |
| | | } |
| | | |
| | | </script> |
| | |
| | | |
| | | </el-button> |
| | | |
| | | <!-- <el-input clearable :placeholder="$t('processCard.mergePrinting')" v-model="printMerge" style="width: 90px"></el-input>--> |
| | | <!-- --> |
| | | <label>{{$t('processCard.labelStyle')}}:</label> |
| | | <el-select v-model="printType" clearable default-value="default_city" :placeholder="$t('processCard.pleaseSelect')" style="width: 120px"> |
| | | <el-option |
| | | v-for="item in titleSelectJson['dataType']" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.name" |
| | | /> |
| | | </el-select> |
| | | |
| | | <el-select v-model="lableType" class="m-2" :placeholder="lableTypeOptions[0].label" style="width: 140px"> |
| | | <el-option |
| | | v-for="item in filteredOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | |
| | | <el-select v-model="stateValue" class="m-2" :placeholder="$t('processCard.pleaseSelect')" clearable allow-create filterable style="width: 140px"> |
| | | <el-option |
| | | v-for="item in stateOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | 标签模板: |
| | | <el-select v-model="tag" placeholder="标签模板列表" style="width: 140px" @change="changeTag"> |
| | | <el-option |
| | | v-for="(tag,index) in tags" |
| | | :key="index" |
| | | :label="tag.name" |
| | | :value="tag" |
| | | /> |
| | | </el-select> |
| | | |
| | | </div> |
| | | <div class="main-table"> |
| | | <vxe-grid |
| | |
| | | style="width: 100%;height: 100%" /> |
| | | </el-dialog> |
| | | |
| | | <!-- 成品标签--> |
| | | <el-dialog |
| | | id="sizeCustom" |
| | | v-model="dialogTableVisibleLabel" |
| | | destroy-on-close |
| | | :title="$t('processCard.printLabel')" |
| | | style="width: 80%;height:75% "> |
| | | <template #header="{ close, titleId, titleClass }"> |
| | | <el-button v-print="printContentLabel" :icon="Printer" circle /> |
| | | </template> |
| | | <print-custom-label id="childLabel" |
| | | :list="labelRow.list" |
| | | :faceOrientation="labelRow.faceOrientation" |
| | | :type="labelRow.type" |
| | | :lableType="labelRow.lableType" |
| | | style="width: 100%;height: 100%" /> |
| | | </el-dialog> |
| | | |
| | | <!-- 小片标签 --> |
| | | <el-dialog |
| | | id="sizeCustomSemi" |
| | |
| | | <sort-detail id="child" :processId="editRow.processId" :technologyNumber="editRow.technologyNumber" /> |
| | | </el-dialog> |
| | | |
| | | |
| | | <el-dialog |
| | | id="sizeCustom" |
| | | v-model="dialogTableVisibleLabel" |
| | | :title="$t('processCard.printLabel')" |
| | | destroy-on-close |
| | | style="width: 80%;height:75% "> |
| | | <template #header="{ close, titleId, titleClass }"> |
| | | <el-button :icon="Printer" circle @click="printOrder(1)"/> |
| | | </template> |
| | | <print-custom-label id="childLabel" |
| | | :detailType="labelRow.detailType" |
| | | :faceOrientation="labelRow.faceOrientation" |
| | | :lableType="labelRow.lableType" |
| | | :lastList='lastList' |
| | | :list="labelRow.list" |
| | | :switch="labelRow.switch" |
| | | :titleList="labelRow.titleList" |
| | | :type="labelRow.type" |
| | | style="width: 100%;height: 100%"/> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |