| | |
| | | //import PrintCustomLabel from '@/components/pp/PrintCustomLabelDetails.vue' |
| | | import QueuePrinter from "@/hook/queue"; |
| | | import PrintCustomLabelProject from "@/components/pp/PrintCustomLabelProject.vue"; |
| | | import PrintProcessConsolidated from '@/components/pp/PrintConsolidatedReplenish.vue' |
| | | import {createTemplate} from "@/hook/createTemplateTag"; |
| | | const company = companyInfo() |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | let router = useRouter() |
| | | const dialogTableVisible = ref(false) |
| | | const dialogTableConsolidated = ref(false) |
| | | const dialogTableVisibleLabel = ref(false) |
| | | const dialogTableVisibleCustomLabel = ref(false) |
| | | const printVisible= ref(false) |
| | |
| | | value: null, |
| | | size: null |
| | | }) |
| | | let hiprintTemplate = ref(null) |
| | | let lastList = ref([]) |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | |
| | | |
| | | onMounted(async () => { |
| | | await getTags(); |
| | | await hiprint.init(); |
| | | }) |
| | | |
| | | //打印类型 |
| | | const printType = ref('小片标签') |
| | | const printType = ref(t('replenish.label')) |
| | | |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | |
| | | const getWorkOrder = () => { |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | gridOptions.loading=true |
| | | // 第一次加载查询 |
| | | request.post(`/Replenish/selectPrint/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | |
| | |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns: [ |
| | | {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50}, |
| | | // {title: t('basicData.operate'), width: 55, slots: { default: 'button_slot' },fixed:"left"}, |
| | | {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80}, |
| | | {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50}, |
| | |
| | | filterMethod: filterChanged, |
| | | width:110 |
| | | }, |
| | | {field: 'batch', width: 90, title: t('order.batch')}, |
| | | { |
| | | field: 'order_number', |
| | | title: t('order.OrderNum'), |
| | |
| | | }, |
| | | {field: 'technology_number', title: t('processCard.technologyNumber'), showOverflow: "ellipsis", |
| | | width:90}, |
| | | {field: 'child_width', title: t('order.width'), width:90,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged,}, |
| | | {field: 'child_height', title: t('order.height'), width:90,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged,}, |
| | | { |
| | | field: 'glassNumber', |
| | | title: t('reportingWorks.glassNumber'), |
| | |
| | | width:100 |
| | | }, |
| | | {field: 'glass_address', title: t('processCard.glassAddress'), |
| | | width:110}, |
| | | width:110,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged}, |
| | | {field: 'patch_num', title: t('order.quantity'), |
| | | width:70}, |
| | | {field: 'patch_area', title: t('order.area'),width:80}, |
| | | {field: 'responsible_team', title: t('reportingWorks.responsibleTeam'),width:110}, |
| | | {field: 'responsible_equipment', title: t('reportingWorks.responsibleEquipment'),width:110}, |
| | | {field: 'responsible_personnel', title: '责任信息',width:110}, |
| | | {field: 'patch_type', title: t('reportingWorks.breakageType'),width:110}, |
| | | {field: 'patch_reason', title: t('reportingWorks.breakageReason'),width:110}, |
| | | {field: 'patch_processes', title: t('reportingWorks.responsibleProcess'),width:110}, |
| | | {field: 'product_name', title: t('order.product'),width:110}, |
| | | {field: 'glass_child', title: t('reportingWorks.glassChild'),width:110}, |
| | | {field: 'reporting_work_id', title: t('reportingWorks.reportingWorkId'),width:120}, |
| | | width:70,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged}, |
| | | {field: 'patch_area', title: t('order.area'),width:80,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged}, |
| | | {field: 'responsible_team', title: t('reportingWorks.responsibleTeam'),width:110,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged}, |
| | | {field: 'responsible_equipment', title: t('reportingWorks.responsibleEquipment'),width:110,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged}, |
| | | {field: 'responsible_personnel', title: t('rework.responsibilityInformation'),width:110,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged}, |
| | | {field: 'patch_type', title: t('reportingWorks.breakageType'),width:110,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged}, |
| | | {field: 'patch_reason', title: t('reportingWorks.breakageReason'),width:110,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged}, |
| | | {field: 'patch_processes', title: t('reportingWorks.responsibleProcess'),width:110,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged}, |
| | | {field: 'product_name', title: t('order.product'),width:110,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged}, |
| | | {field: 'glass_child', title: t('reportingWorks.glassChild'),width:110,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged}, |
| | | {field: 'reporting_work_id', title: t('reportingWorks.reportingWorkId'),width:120,filters: [{data: ''}],slots: {filter: 'num1_filter'}, filterMethod: filterChanged}, |
| | | {field: 'create_time', title: t('basicData.reportData'),width:120}, |
| | | { |
| | | field: 'print_num', |
| | | title: t('processCard.printStatus'), |
| | | width: 120 |
| | | }, |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {code: 'print', name: t('processCard.print'), status: 'primary'}, |
| | | {code: 'printConsolidated', name: t('processCard.mergePrinting'), status: 'primary'}, |
| | | {code: 'customLabel', name: t('processCard.customLabelPrinting'), status: 'primary'}, |
| | | {code: 'printLabel', name: t('processCard.labelPrinting'), status: 'primary'}, |
| | | {code: 'printLabel2', name: t('processCard.labelPrinting2'), status: 'primary'}, |
| | |
| | | technologyNumber+=selectRecords[i].technology_number |
| | | } |
| | | } |
| | | |
| | | printRow.value.list = JSON.stringify(selectRecords) |
| | | printRow.value.printMergeVal=printMerge.value |
| | | printRow.value.mergeTechnologyNumber=technologyNumber |
| | | // router.push({path: '/main/processCard/printProcess', query: {printList: JSON.stringify(selectRecords),printMerge:printMergeVal}}) |
| | | dialogTableVisible.value=true |
| | | break |
| | | } |
| | | case 'printConsolidated': { |
| | | if(selectRecords===null ||selectRecords===''||selectRecords.length===0){ |
| | | ElMessage.warning(t('searchOrder.msgList.checkOrder')) |
| | | return |
| | | } |
| | | |
| | | let id = "" |
| | | let technologyNumber = "" |
| | | for (let i = 0; i < selectRecords.length; i++) { |
| | | if (i + 1 === selectRecords.length) { |
| | | id += selectRecords[i].id |
| | | technologyNumber+=selectRecords[i].technology_number |
| | | } else { |
| | | id += selectRecords[i].id + "|" |
| | | technologyNumber+=selectRecords[i].technology_number |
| | | } |
| | | } |
| | | |
| | | printRow.value.list = JSON.stringify(selectRecords) |
| | | printRow.value.printMergeVal=printMerge.value |
| | | printRow.value.mergeTechnologyNumber=technologyNumber |
| | | // router.push({path: '/main/processCard/printProcess', query: {printList: JSON.stringify(selectRecords),printMerge:printMergeVal}}) |
| | | dialogTableConsolidated.value=true |
| | | break |
| | | } |
| | | |
| | |
| | | } |
| | | case 'customLabel': { |
| | | if (tag.value.name == null || tag.value.name == '') { |
| | | ElMessage.warning(t('请选择标签模板')) |
| | | ElMessage.warning(t('replenish.printPatchesMsg1')) |
| | | return |
| | | } |
| | | labelRow.value.list = JSON.stringify(selectRecords) |
| | | labelRow.value.type = tag.value.name |
| | | labelRow.value.dataType = 3 |
| | | labelRow.value.lableType = lableTypes |
| | | labelRow.value.lableType = 2 |
| | | labelRow.value.switch = true |
| | | lastList.value = [] |
| | | dialogTableVisibleLabel.value = true |
| | |
| | | return |
| | | } |
| | | if(printMerge.value===null ||printMerge.value===''){ |
| | | ElMessage.warning('请填入需要合并的层') |
| | | ElMessage.warning(t('rework.msg1')) |
| | | return |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | 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.design("#hiprint-printTemplate1",{grid:true}); |
| | | const json = tag.value.value |
| | | hiprintTemplate.value.update(json) |
| | | } |
| | | |
| | | const getTags = () => { |
| | | request.get('tagStyle/getTagList').then(res => { |
| | | res.data.forEach(item => { |
| | | item.value = JSON.parse(item.value) |
| | | }) |
| | | tags.value = res.data |
| | | }) |
| | | } |
| | | |
| | | // 监听打印完成事件 |
| | | const printNumber = () =>{ |
| | | |
| | | selectRecordsData.value.printList=selectRecords |
| | | let printState=0 |
| | | request.post(`/processCard/updatePrintState/${printState}`, selectRecordsData.value).then((res) => { |
| | | const $grid = xGrid.value |
| | | selectRecords = $grid.getCheckboxRecords() |
| | | request.post(`/Replenish/updatePrintNum`, selectRecords).then((res) => { |
| | | if (res.code == 200 && res.data === true) { |
| | | } else { |
| | | |
| | |
| | | } |
| | | |
| | | const printOrder = (type) => { |
| | | const list = hiprintTemplate.value.getJson() |
| | | const list = tag.value.value |
| | | list.panels[0].printElements.forEach(element => { |
| | | element.options.fontFamily = 'Arial' |
| | | if( element.options.field !== undefined){ |
| | | if(type===3 ){ |
| | | element.options.hideTitle = true |
| | | } |
| | | } |
| | | if(type!==3){ |
| | | element.options.hideTitle = false |
| | | if( element.options.field === undefined){ |
| | | element.options.hideTitle = true |
| | | } |
| | | } |
| | | }) |
| | | let object = lastList.value |
| | | |
| | | //hiprintTemplate.value.update(list) |
| | | let object = JSON.parse(JSON.stringify(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) |
| | | } |
| | | //判断是否有 嵌套自定义纸张 |
| | | if(tag.value.tagHeight && tag.value.tagWidth){ |
| | | const print =createTemplate(list,object,tag.value.tagWidth,tag.value.tagHeight) |
| | | hiprintTemplate.value.update(print.template) |
| | | object = print.printData |
| | | } |
| | | hiprintTemplate.value.print(object) |
| | | |
| | |
| | | |
| | | </el-button> |
| | | |
| | | 标签模板: |
| | | <el-select v-model="tag" placeholder="标签模板列表" style="width: 140px" @change="changeTag"> |
| | | {{ $t('replenish.labelTemplate') }} |
| | | <el-select v-model="tag" :placeholder="$t('replenish.listLabelTemplates')" style="width: 140px" @change="changeTag"> |
| | | <el-option |
| | | v-for="(tag,index) in tags" |
| | | :key="index" |
| | |
| | | destroy-on-close |
| | | style="width: 75%;height:75% "> |
| | | <template #header="{ close, titleId, titleClass }"> |
| | | <el-button v-print="printContent" :icon="Printer" circle /> |
| | | <el-button v-print="printContent" :icon="Printer" circle @click="printNumber"/> |
| | | </template> |
| | | <print-process id="child" :printList="printRow.list" :printMerge="printRow.printMergeVal" :printLike="printRow.like" |
| | | :mergeTechnologyNumber="printRow.mergeTechnologyNumber" |
| | | style="width: 100%;height: 100%" /> |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | id="sizePrintCalrd" |
| | | v-model="dialogTableConsolidated" |
| | | :title="$t('processCard.print')" |
| | | destroy-on-close |
| | | style="width: 75%;height:75% "> |
| | | <template #header="{ close, titleId, titleClass }"> |
| | | <el-button v-print="printContent" :icon="Printer" circle /> |
| | | </template> |
| | | <print-process-consolidated id="child" :printList="printRow.list" :printMerge="printRow.printMergeVal" :printLike="printRow.like" |
| | | :mergeTechnologyNumber="printRow.mergeTechnologyNumber" |
| | | style="width: 100%;height: 100%" /> |
| | | </el-dialog> |
| | |
| | | destroy-on-close |
| | | style="width: 80%;height:75% "> |
| | | <template #header="{ close, titleId, titleClass }"> |
| | | <el-tooltip |
| | | class="box-item" |
| | | effect="dark" |
| | | :content="$t('processCard.yesTitle')" |
| | | placement="top" |
| | | > |
| | | <el-button :icon="Printer" circle @click="printOrder(1)"/> |
| | | </el-tooltip> |
| | | <el-tooltip |
| | | class="box-item" |
| | | effect="dark" |
| | | :content="$t('processCard.noTitle')" |
| | | placement="top" |
| | | > |
| | | <el-button @click="printOrder(3)"> |
| | | <i class="vxe-icon-print"></i> |
| | | </el-button> |
| | | </el-tooltip> |
| | | </template> |
| | | <print-custom-label id="childLabel" |
| | | :detailType="labelRow.detailType" |