| | |
| | | $t('hellow.stopproject') |
| | | }} |
| | | </el-button> |
| | | <el-button style="margin-left: 10px;" :disabled="listFlow.length > 0 ? false : true" id="searchButton" type="warning" @click="handleBinde">{{ |
| | | $t('searchOrder.printlabels') |
| | | }} |
| | | </el-button> |
| | | </div> |
| | | |
| | | <div id="dotClass"> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- 打印标签 --> |
| | | <el-dialog v-model="blinde" top="30vh" width="25%" :title="$t('searchOrder.printlabels')"> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-select v-model="tag" filterable clearable :placeholder="$t('hellow.projectMsg2')" @change="changeTag" |
| | | style="width: 220px" @input="handleInputChange"> |
| | | <el-option v-for="(tag, index) in tags" :key="index" :label="tag.name" :value="tag" /> |
| | | </el-select> |
| | | <el-select v-model="stateValue" filterable clearable :placeholder="$t('screendisplay.pchoice')" |
| | | style="width: 220px" @input="handleInputChange"> |
| | | <el-option v-for="item in stateOptions" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | | <el-button type="primary" @click="labelPrint = true"> |
| | | {{ $t('processCard.printing') }} |
| | | </el-button> |
| | | <el-button @click="blinde = false">{{ $t('basicData.cancel') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="labelPrint" style="width: 80%; " destroy-on-close> |
| | | <el-button :icon="Printer" circle @click="printOrder(1)">{{ $t('processCard.printing') }}</el-button> |
| | | <print-custom-label-x-j id="childLabel" :faceOrientation="stateValue" :lableType="1" :list="listFlow" |
| | | :lastList='lastList' :type="tag.name" style="width: 100%;height: 100%" /> |
| | | </el-dialog> |
| | | <!-- 删除任务 --> |
| | | <el-dialog v-model="blindd" top="30vh" width="25%" :title="$t('hellow.hollowtaskdet')"> |
| | | <template #footer> |
| | |
| | | v-model="selectedProjectNo" |
| | | filterable |
| | | clearable |
| | | :placeholder="$t('basicData.plselectproject')" |
| | | :placeholder="$t('hellow.plselectproject')" |
| | | style="width: 260px" |
| | | > |
| | | <el-option |
| | |
| | | // 预览 |
| | | const handleup = async () => { |
| | | if (!selectedProjectNo.value) { |
| | | ElMessage.error(t('basicData.plselectproject')) |
| | | ElMessage.error(t('hellow.plselectproject')) |
| | | return |
| | | } |
| | | try { |
| | |
| | | dialogFormVisiblee.value = false |
| | | selectedProjectNo.value = '' |
| | | closeWebSocket(socket); |
| | | const summary = response.data.reduce((map, item) => { |
| | | const key = `${item.hollowSequence}`; |
| | | if (!map[key]) { |
| | | map[key] = { |
| | | printQuantity: 1, |
| | | order_number: item.glassType, |
| | | processId: item.flowCardId, |
| | | orderId:item.flowCardId.slice(0, 10) |
| | | }; |
| | | } |
| | | return map; |
| | | }, {}); |
| | | listFlow.value = Object.values(summary); |
| | | } else { |
| | | } |
| | | } catch (error) { |
| | |
| | | onBeforeUnmount(() => { |
| | | closeWebSocket(); |
| | | }); |
| | | |
| | | import requestErp from "@/utils/requestErp"; |
| | | import { hiprint } from "vue-plugin-hiprint"; |
| | | import PrintCustomLabelXJ from './PrintCustomLabelTwo.vue' |
| | | const listFlow = ref([]) |
| | | let hiprintTemplate = ref() |
| | | const stateValue = ref('') |
| | | const stateOptions = [ |
| | | { |
| | | value: t('processCard.thisIsTheIndoorSurface'), |
| | | label: t('processCard.thisIsTheIndoorSurface'), |
| | | }, |
| | | { |
| | | value: t('processCard.thisSideIsOutsideTheRoom'), |
| | | label: t('processCard.thisSideIsOutsideTheRoom'), |
| | | }, |
| | | ] |
| | | const blinde = ref(false) |
| | | const labelPrint = ref(false); |
| | | const handleBinde = (row) => { |
| | | blinde.value = true; |
| | | getTags(); |
| | | hiprint.init(); |
| | | }; |
| | | const changeTag = () => { |
| | | hiprintTemplate.value = new hiprint.PrintTemplate({}); |
| | | const json = JSON.parse(tag.value.value) |
| | | hiprintTemplate.value.update(json) |
| | | } |
| | | |
| | | const getTags = async () => { |
| | | try { |
| | | const response = await requestErp.get('tagStyle/getTagList') |
| | | if (response.code == 200) { |
| | | tags.value = response.data |
| | | ElMessage.success(response.message); |
| | | } |
| | | } catch (error) { |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | const printOrder = (type) => { |
| | | const list = hiprintTemplate.value.getJson() |
| | | list.panels[0].printElements.forEach(element => { |
| | | element.options.fontFamily = 'Arial' |
| | | }) |
| | | console.log(lastList.value) |
| | | 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) |
| | | |
| | | } |
| | | let lastList = ref([]) |
| | | const tags = ref([]) |
| | | |
| | | const tag = ref({ |
| | | id: null, |
| | | name: null, |
| | | type: 1, |
| | | tagWidth: null, |
| | | tagHeight: null, |
| | | value: null, |
| | | size: null |
| | | }) |
| | | </script> |
| | | <style scoped> |
| | | #dt { display:block; float:left;line-height: 20px;margin-left: 100px;} |