north-glass-erp/northglass-erp/src/components/pp/PrintCustomLabelProject.vue
@@ -30,35 +30,63 @@ list:null,//勾选的数据 faceOrientation:null,//内外面 type:null,//标签模板 lableType:null//标签类型 lableType:null,//标签类型 titleList:null,//标题 switch:null,//判断是否为新打印, lastList:[], detailType:null }) const {currentRoute} = useRouter() const route = currentRoute.value let type = props.type let faceOrientation = props.faceOrientation if (type.indexOf("英文")>-1 && faceOrientation==="此面为室内面"){ faceOrientation='INSIDE' } else if (type.indexOf("英文")>-1 && faceOrientation==="此面为室外面"){ faceOrientation='OUTSIDE' } let lableType = props.lableType let switchType = props.switch let detailType= props.detailType data.value.printList = JSON.parse(props.list) onMounted(() => { request.post(`/processCard/getPrintCustomDataProjectNoDetail/${type}`, data.value).then((res) => { request.post(`/processCard/getPrintCustomDataProjectNoDetail/${type}/${detailType}`, data.value).then((res) => { if (res.code == 200) { console.log(res.data.data) produceList.value = deepClone(res.data.title) list.value = deepClone(res.data.data) const data = produceList.value[0].value dataList = JSON.parse(`[${data}]`); labelList = dataList[0] const printElements = dataList[0].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 }) } }) labelList = a for (let i = 0; i < list.value.length; i++) { let count = list.value[i].data.length for (let j = 0; j < count; j++) { lastList.value.push(list.value[i].data[j]) if (detailType==0){ for (let k = 0; k < list.value[i].data[j].quantity; k++) { props.lastList.push(list.value[i].data[j]) } } else { //for (let k = 0; k < list.value[i].data[j].quantity; k++) { props.lastList.push(list.value[i].data[j]) //} } } } } else { @@ -127,17 +155,20 @@ </script> <template> <div id="print" :class="company.printLabel.className.custom.printFlowCardName()"> <div v-for="(item1,index) in lastList" :class="company.printLabel.className.custom.entiretyName()"> <div class="row4">{{ faceOrientation }}</div> <div v-for="(item,id) in labelList" :class="company.printLabel.className.custom.contentRowName()"> <div v-if="item1[item.name] != null && item1[item.name] !== ''" class="row1" contenteditable="true" @input="updateProductName($event, id,index)" v-text="item.title+':'+item1[item.name]"></div> <!-- <div class="row2" style="width: 100%;"><input class="contentRow2" v-model="item1[item.name]" @keyup="updataProductName()" style="border: none;"/></div>--> <!-- <div v-if="item1[item.name] != null && item1[item.name] !== ''" class="row2" style="width: 100%;" contenteditable="true" @input="updateProductName($event, id)" v-text="item1[item.name]"></div>--> </div> <div v-html="company.printLabel.custom(item1)"></div> <div id="print" :class="company.printLabel.className.semi.printFlowCardName()"> <div v-for="(item1,index) in props.lastList" :class="company.printLabel.className.semi.entiretyName()"> <div class="row4">{{ faceOrientation }}</div> <div v-for="(item,id) in labelList" :class="company.printLabel.className.semi.contentRowName()"> <div v-if="item1[item.name] != null && item1[item.name] !== ''" class="row1" contenteditable="true" @input="updateProductName($event, id,index)" v-text="item.title+':'+item1[item.name]"></div> <!-- <div class="row2" style="width: 100%;"><input class="contentRow2" v-model="item1[item.name]" @keyup="updataProductName()" style="border: none;"/></div>--> <!-- <div v-if="item1[item.name] != null && item1[item.name] !== ''" class="row2" style="width: 100%;" contenteditable="true" @input="updateProductName($event, id)" v-text="item1[item.name]"></div>--> </div> <!-- <div v-html="company.printLabel.custom(item1)"></div>--> <div v-if="(id + 1) % 2 === 0" class="pagebreak"></div> </div> </div> @@ -150,25 +181,10 @@ padding: 0; } textarea { border: none; /* 取消默认边框 */ padding: 0; /* 取消默认内边距 */ margin: 0; /* 取消默认外边距 */ resize: none; /* 禁用调整大小功能 */ font-family: Arial; /* 设置自定义字体 */ font-size: 12px; /* 设置自定义字体大小 */ line-height: 1; /* 设置行高 */ width: 100%; /* 设置宽度为100% */ height: auto; /* 高度根据内容自动调整 */ box-sizing: border-box; /* 使宽高包括内边距和边框 */ overflow-y: hidden; } body { body{ overflow: hidden; font-family: Arial; font-size: 7px; } #printButton { @@ -176,109 +192,87 @@ width: 100px; } .print{ width: 100%; height: 100%; } /*成*/ .printFlowCard_finished { /* font-family: 'Microsoft YaHei', '微软雅黑', sans-serif; */ flex-wrap: nowrap; /*半*/ .printFlowCard_semi { flex-wrap: wrap; font-size: 10px; display: flex; flex-direction: column; justify-content:space-between; } /*成*/ .entirety_finished { /*半*/ .entirety_semi { width: 45%; display: flex; text-align: center; flex-direction: column; margin-left: 10px; width: 100%; height: 100%; flex-direction:column; margin: 8px; } /*div{ font-family: 'Microsoft YaHei', '微软雅黑', sans-serif; }*/ .row3 { .row3{ text-align: center; /*display: flex; justify-content:space-evenly;*/ } .row3 label { margin-top: 28px; .contentRow{ display: flex; text-align: center; } .contentRow { label{ font-weight: bolder; display: flex; text-align: center; } .contentRow .row1{ width: 100%; } label { /*font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;*/ } .contentRow .row1 { width: 100%; } .entirety_finished .row4 { font-weight: bolder; .entirety_semi .row4{ text-align: right; margin-right: 20px; } .contentRow .row1, .contentRow .row2 { .contentRow .row1,.contentRow .row2{ text-align: left; } input{ width: 100%; border: none; } @page { size: auto; /* auto is the initial value */ margin: 13mm 5mm 0mm 7mm; /* this affects the margin in the printer settings */ } @media print { @page { size: auto; /* auto is the initial value */ margin: 13mm 5mm 0mm 7mm; /* this affects the margin in the printer settings */ } div { page-break-inside: avoid; } .entirety_finished { page-break-before: always; .pagebreak { page-break-after: always; } } .printFlowCard_finished1 { .printFlowCard_semi1 { flex-wrap: wrap; font-size: 8pt; display: flex; flex-direction: column; } /*成*/ .entirety_finished1 { .entirety_semi1 { width: 50%; display: flex; text-align: center; flex-direction: column; margin-left: 10px; width: 337px; height: 120px; margin-left: -10px; height: 80px; } north-glass-erp/northglass-erp/src/components/pp/PrintCustomLabelTwo.vue
@@ -46,20 +46,34 @@ } let lableType = props.lableType data.value.printList = JSON.parse(props.list) let switchType = props.switch onMounted(() => { request.post(`/processCard/getSelectPrintCustomLabel/${type}/${lableType}`, data.value).then((res) => { if (res.code == 200) { produceList.value = deepClone(res.data.title) list.value = deepClone(res.data.data) const data = produceList.value[0].value dataList = JSON.parse(`[${data}]`); if (switchType===true){ labelList = props.titleList }else { labelList = dataList[0] } const printElements = dataList[0].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 }) } }) labelList = a for (let i = 0; i < list.value.length; i++) { let count = list.value[i].data.length for (let j = 0; j < count; j++) { north-glass-erp/northglass-erp/src/components/pp/PrintProcess.vue
@@ -33,6 +33,14 @@ const {currentRoute} = useRouter() const route = currentRoute.value const printMerge = props.printMerge //打印时间 const currentTime = new Date(); const formattedTime = currentTime.getFullYear() + '-' + (currentTime.getMonth() + 1) + '-' + currentTime.getDate() + ' ' + currentTime.getHours() + ':' + currentTime.getMinutes();formattedTime let merge = props.printMerge if (merge == '') { merge = null @@ -211,7 +219,7 @@ <div>{{ company.companyName }}</div> <div>生产流程卡</div> <div style="font-weight: bolder;display: flex;justify-content:space-between"> <div>打印人:{{user.user.userName}}</div> <div>打印人:{{user.user.userName}} 时间:{{formattedTime}}</div> <div> <span v-if="name!='金华福喜天成玻璃有限公司'" style="font-size: 10px">{{itemFlow.otherRemarks}}</span> 流程卡号: {{ north-glass-erp/northglass-erp/src/components/pp/TagStyleDesigner.vue
@@ -499,6 +499,42 @@ } }, { 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: 'custom1', title: '自定义1', data: '', type: 'text', options: { field: 'custom1', north-glass-erp/northglass-erp/src/views/pp/processCard/PrintProjectDetails.vue
@@ -21,6 +21,9 @@ import companyInfo from "@/stores/sd/companyInfo" import {CircleCheck, Download, Printer} from "@element-plus/icons-vue/global"; import TagStyleDesigner from "@/components/pp/TagStyleDesigner.vue"; import {hiprint} from "vue-plugin-hiprint"; import QueuePrinter from "@/hook/queue" import TagStyleSet from "@/hook/tagStyleSet"; const company = companyInfo() @@ -45,11 +48,15 @@ const xGrid = ref(null) const xGridDetail = ref(null) const tags = ref([]) const tagType = ref() //排序 let editRow = ref({ processId: null, technologyNumber: null, process:null process: null }) //打印 @@ -65,107 +72,48 @@ faceOrientation: null,//内外面 type: null,//标签模板 lableType: null,//标签类型 dataType: null//标签类型 dataType: null,//标签类型 detailType: 0//是否是工程明细打印 }) const getTableRow = (row, type) => { switch (type) { case 'edit' : { editRow.value.processId = row.process_id editRow.value.technologyNumber = row.technology_number editRow.value.process = row.process printVisible.value = true onMounted(async () => { await getTags(); await hiprint.init(); }) let hiprintTemplate = ref() // router.push({path: '/sort-detail', query: {processId: row.process_id,technologyNumber:row.technology_number}}) break } } const changeTag = () => { hiprintTemplate.value = new hiprint.PrintTemplate({}); const json = JSON.parse(tag.value.value) hiprintTemplate.value.update(json) } //筛选条件,有外键需要先定义明细里面的数据 let filterData = ref({ orderGlassDetail: { productionId: '', }, orderDetail: { orderId: '', productId: '', productName: '', } const tag = ref({ id: null, name: null, type: 1, tagWidth: null, tagHeight: null, value: null, size: null }) //定义页面总页数 let pageTotal = ref('') //定义数据返回结果 let produceList = ref([]) //定义数据返回结果 let produceDetailList = ref([]) //定义当前页数 let pageNum = $ref(1) let pageState = null //室内室外面 const stateValue = ref('') const stateOptions = [ { value: t('processCard.thisIsTheIndoorSurface'), label: t('processCard.thisIsTheIndoorSurface'), }, { value: t('processCard.thisSideIsOutsideTheRoom'), label: t('processCard.thisSideIsOutsideTheRoom'), }, ] //标签类型 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 printMerge = ref('') const printMergeOptions = [{}] const printContent = ref({ id: 'child', }) const printContentLabel = ref({ id: 'childLabel', }) const printContentLabelSemi = ref({ id: 'childLabelSemi', }) //打印类型 const printType = ref() @@ -179,6 +127,12 @@ printList: [] }) const getTags = () => { request.get('tagStyle/getTagList').then(res => { tags.value = res.data }) } const {currentRoute} = useRouter() const route = currentRoute.value @@ -190,7 +144,6 @@ if (res.code == 200) { xGrid.value.loadData(res.data.data) gridOptions.loading = false hideButton() } else { ElMessage.warning(res.msg) } @@ -233,7 +186,7 @@ useKey: true }, filterConfig: { //筛选配置项 // remote: true // remote: true }, customConfig: { storage: true @@ -272,13 +225,8 @@ toolbarConfig: { buttons: [ {code: 'printLabel3', name: t('processCard.finishedProductPrinting2'), status: 'primary'}, // {code: 'printLike', name: "同配置打印", status: 'primary'}, {code: 'printLabel3', name: t('basicData.print'), status: 'primary'}, ], // import: false, // export: true, //print: true, zoom: true, custom: true }, @@ -298,273 +246,41 @@ }) ] }, }) const gridEvents = { toolbarButtonClick({code}) { const $grid = xGrid.value selectRecords = $grid.getCheckboxRecords() // selectRecords.forEach(obj => { // delete obj.print_status; // }); let type = printType.value let faceOrientation = stateValue.value let faceOrientation = '' let lableTypes = lableType.value let lableTitle = lableType.text if ($grid) { switch (code) { case 'print': { if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) { ElMessage.warning(t('searchOrder.msgList.checkOrder')) 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 + "|" } } printRow.value.list = JSON.stringify(selectRecords) printRow.value.printMergeVal = printMerge.value printRow.value.like = null // router.push({path: '/main/processCard/printProcess', query: {printList: JSON.stringify(selectRecords),printMerge:printMergeVal}}) dialogTableVisible.value = true break } case 'printLabel': { if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) { ElMessage.warning(t('searchOrder.msgList.checkOrder')) 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 + "|" } } router.push({ path: '/main/processCard/PrintLabel', query: {printList: JSON.stringify(selectRecords),printType:2} }) break } case 'printLabel2': { if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) { ElMessage.warning(t('searchOrder.msgList.checkOrder')) 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 + "|" } } router.push({ path: '/main/processCard/PrintCustomLabelSemi2', query: {printList: JSON.stringify(selectRecords),printType:2} }) break } case 'sort': { const $table = xGridDetail.value let data = $table.getTableData().fullData let flowCardData = ref({ flowCard: data, }) for (let i = 0; i < flowCardData.value.flowCard.length; i++) { const regex = /^[1-9]\d*$/ if (!regex.test(flowCardData.value.flowCard[i].sort)) { ElMessage.warning(t('basicData.msg.greater0')) return; // 如果有一个不是整数 } } request.post("/processCard/printSort", flowCardData.value).then((res) => { if (res.code == 200) { ElMessage.success(t('processCard.sortingSuccessful')) router.push({ path: '/main/processCard/PrintFlowCard', query: {orderId: orderId, random: Math.random()} }) //location.reload(); } else { ElMessage.warning(res.msg) } }) break } case 'customLabel': { if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) { ElMessage.warning(t('searchOrder.msgList.checkOrder')) 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 lastList.value = [] if (company.label === 1) { dialogTableVisibleLabel.value = true } else if (company.label === 2) { router.push({ path: '/main/processCard/PrintCustomLabelCZ', query: { type: type, faceOrientation: faceOrientation, lableType: lableTypes, printList: JSON.stringify(selectRecords), printType:2 } }) } } else if (lableTypes == 2) { labelRow.value.list = JSON.stringify(selectRecords) labelRow.value.faceOrientation = faceOrientation labelRow.value.type = type labelRow.value.lableType = lableTypes lastList.value = [] if (company.label === 1) { dialogTableVisibleCustomLabel.value = true } else if (company.label === 2) { router.push({ path: '/main/processCard/PrintCustomLabelSemiCZ', query: { type: type, faceOrientation: faceOrientation, lableType: lableTypes, printList: JSON.stringify(selectRecords), printType:2 } }) } } else if (lableTypes == 3) { router.push({ path: '/main/processCard/PrintLabel1', query: { type: type, faceOrientation: faceOrientation, lableType: lableTypes, printList: JSON.stringify(selectRecords), printType:2 } }) } break } case 'printLike': { if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) { ElMessage.warning(t('searchOrder.msgList.checkOrder')) return } if (printMerge.value === null || printMerge.value === '') { ElMessage.warning('请填入需要合并的层') 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 + "|" } } printRow.value.list = JSON.stringify(selectRecords) printRow.value.printMergeVal = printMerge.value printRow.value.like = "1" // router.push({path: '/main/processCard/printProcess', query: {printList: JSON.stringify(selectRecords),printMerge:printMergeVal}}) dialogTableVisible.value = true break } case 'printTest': { if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) { ElMessage.warning(t('searchOrder.msgList.checkOrder')) 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 + "|" } } labelRow.value.list = JSON.stringify(selectRecords) labelRow.value.faceOrientation = faceOrientation labelRow.value.type = type labelRow.value.lableType = lableTypes titleStyleVisible.value = true break } case 'printLabel3': { if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) { ElMessage.warning(t('请选择工程对应的版图号')) 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 (tag.value.name == null || tag.value.name == '') { ElMessage.warning(t('请选择标签模板')) return } let name=company.companyName let name = company.companyName labelRow.value.list = JSON.stringify(selectRecords) if (name == '金华福喜天成玻璃有限公司'){ labelRow.value.type = '成品标签' labelRow.value.dataType=3 if (name == '新疆恒鑫玻璃科技有限公司') { labelRow.value.type = '恒鑫带数量' labelRow.value.dataType = 3 dialogTableVisibleLabelXJTwo.value = true } else { labelRow.value.type = tag.value.name labelRow.value.dataType = 3 labelRow.value.lableType = lableTypes labelRow.value.switch = true lastList.value = [] dialogTableVisibleLabelProject.value = true } else { labelRow.value.type = '恒鑫带数量' labelRow.value.dataType=3 dialogTableVisibleLabelXJTwo.value = true } break } } @@ -573,44 +289,25 @@ } const openedTable = () => { let detail = ref(produceDetailList.value) xGridDetail.value.reloadData(detail.value) addListener(xGridDetail.value, detailGridOptions) } const hideButton = () => { // 根据条件值 hidePrintLabels 过滤按钮数组 gridOptions.toolbarConfig.buttons = gridOptions.toolbarConfig.buttons.filter(button => { // 这里根据 hidePrintLabels 的值决定是否隐藏 printLabel 和 printLabel2 if (hidePrintLabels == 'true') { return button.code !== 'printLabel' && button.code !== 'printLabel2'; } else { return true && button.code !== 'printLike' && button.code !== 'printLabel3'&& button.code !== 'printTest'; // 显示该按钮 } }) } // 监听打印完成事件 const printNumber = () => { selectRecordsData.value.printList = selectRecords let printState = 0 request.post(`/processCard/updatePrintState/${printState}`, selectRecordsData.value).then((res) => { if (res.code == 200 && res.data === true) { } else { ElMessage.warning(t('basicData.msg.saveFail')) } }) const printObjectProcess = () => { hiprintTemplate.value.print(lastList.value) } </script> <template> <div class="main-div-customer"> <div> 标签模板: <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> <vxe-grid ref="xGrid" class="mytable-scrollbar" @@ -633,130 +330,19 @@ </ul> </template> <!--左边固定显示的插槽--> <!-- v-if="userStore.user.permissions.indexOf('SelectProductionBasicData.edit') > -1"--> <template #button_slot="{ row }"> <el-button link size="small" type="primary" @click="getTableRow(row,'edit')"> {{ $t('basicData.edit') }} </el-button> </template> <template #num1_filter="{ column, $panel }"> <div> <div v-for="(option, index) in column.filters" :key="index"> <input v-model="option.data" type="text" @keyup.enter.native="$panel.confirmFilter()" @input="changeFilterEvent($event, option, $panel)"/> @input="changeFilterEvent($event, option, $panel)" @keyup.enter.native="$panel.confirmFilter()"/> </div> </div> </template> </vxe-grid> <!-- 流程卡打印 --> <el-dialog id="sizePrintCalrd" v-model="dialogTableVisible" :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 @click="printNumber"/> </template> <print-process id="child" :printLike="printRow.like" :printList="printRow.list" :printMerge="printRow.printMergeVal" style="width: 100%;height: 100%"/> </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 v-print="printContentLabel" :icon="Printer" circle/> </template> <print-custom-label id="childLabel" :lastList = 'lastList' :faceOrientation="labelRow.faceOrientation" :lableType="labelRow.lableType" :list="labelRow.list" :type="labelRow.type" 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" :faceOrientation="labelRow.faceOrientation" :lableType="labelRow.lableType" :list="labelRow.list" :type="labelRow.type" style="width: 100%;height: 100%"/> </el-dialog> <!-- 排序--> <el-dialog id="sizeCheck" v-model="printVisible" :title="$t('processCard.processCardDetails')" destroy-on-close style="width: 80%;height:75% "> <sort-detail id="child" :processId="editRow.processId" :technologyNumber="editRow.technologyNumber" :process="editRow.process"/> </el-dialog> <!-- 标签样式 --> <el-dialog id="titleStyle" :title="$t('processCard.labelStyle')" style="width: 90%;height:93%;margin-top: 3vh " :close-on-click-modal="false" :close-on-press-escape="false" destroy-on-close v-model="titleStyleVisible"> <!-- <tag-style style="width: 100%;height: 100%"/>--> <tag-style-designer style="width: 100%;height: 100%" :faceOrientation="labelRow.faceOrientation" :lableType="labelRow.lableType" :list="labelRow.list" :type="labelRow.type"/> </el-dialog> <!-- 成品标签两列--> <el-dialog id="sizeCustom" v-model="dialogTableVisibleLabelXJ" :title="$t('processCard.printLabel')" destroy-on-close style="width: 80%;height:75% "> <template #header="{ close, titleId, titleClass }"> <el-button v-print="printContentLabel" :icon="Printer" circle/> </template> <print-custom-label-x-j id="childLabel" :faceOrientation="labelRow.faceOrientation" :lableType="labelRow.lableType" :list="labelRow.list" :type="labelRow.type" style="width: 100%;height: 100%"/> </el-dialog> <!-- 成品标签两列新疆--> <el-dialog @@ -769,12 +355,12 @@ <el-button v-print="printContentLabel" :icon="Printer" circle/> </template> <print-custom-label-x-j-two id="childLabel" :faceOrientation="labelRow.faceOrientation" :lableType="labelRow.lableType" :list="labelRow.list" :type="labelRow.type" :dataType="labelRow.dataType" style="width: 100%;height: 100%"/> :dataType="labelRow.dataType" :faceOrientation="labelRow.faceOrientation" :lableType="labelRow.lableType" :list="labelRow.list" :type="labelRow.type" style="width: 100%;height: 100%"/> </el-dialog> <!-- 成品标签工程打印--> @@ -785,14 +371,20 @@ destroy-on-close style="width: 80%;height:75% "> <template #header="{ close, titleId, titleClass }"> <el-button v-print="printContentLabel" :icon="Printer" circle/> <el-button :icon="Printer" circle @click="printObjectProcess"/> </template> <print-custom-label-project id="childLabel" :faceOrientation="labelRow.faceOrientation" :lableType="labelRow.lableType" :list="labelRow.list" :type="labelRow.type" style="width: 100%;height: 100%"/> :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> north-glass-erp/northglass-erp/src/views/pp/processCard/SelectPrintProject.vue
@@ -1,5 +1,5 @@ <script lang="ts" setup> import {reactive, ref} from "vue"; import {onMounted, reactive, ref} from "vue"; import {useRouter} from 'vue-router' import request from "@/utils/request"; import deepClone from "@/utils/deepClone"; @@ -13,19 +13,26 @@ import {Printer} from "@element-plus/icons-vue/global"; import companyInfo from "@/stores/sd/companyInfo" import {remove} from "xe-utils"; import PrintCustomLabelProject from "@/components/pp/PrintCustomLabelProject.vue"; //语言获取 const {t} = useI18n() let router = useRouter() const dialogTableVisibleLabelXJTwo = ref(false) const dialogTableVisibleLabelProject = ref(false) let rowClickIndex = ref(null) let lastList = ref([]) const tags = ref([]) const tagType=ref() //定义数据返回结果 let produceList = ref([]) let titleStyleVisible = ref(false) let print = ref("1") //标签 let labelRow = ref({ @@ -34,9 +41,11 @@ type: "",//标签模板 lableType: null,//标签类型 dataType: 0,//标签类型 projectNo:null projectNo:null, detailType:0//是否是工程明细打印 }) const company = companyInfo() let name=company.companyName let hidePrintLabels = company.printLabel.hideButton; const form = reactive({ @@ -44,11 +53,60 @@ orderId: '', project: '' }) const tag = ref({ id:null, name:null, type:1, tagWidth:null, tagHeight:null, value:null, size:null }) onMounted(async () => { await getTags(); await hiprint.init(); }) let hiprintTemplate = ref() const changeTag = () => { hiprintTemplate.value = new hiprint.PrintTemplate({}); const json = JSON.parse(tag.value.value) hiprintTemplate.value.update(json) } const getTableRow = (row, type) => { switch (type) { case 'edit' :{ if(parseInt(print.value)==1){ router.push({path: '/main/processCard/PrintLabel', query: { projectNo: row.project_no,type:1 }}) if (name.indexOf('吉利玻璃')!=-1){ router.push({path: '/main/processCard/PrintLabel', query: { projectNo: row.project_no,type:1 }}) } else { if (tag.value.name==null || tag.value.name==''){ ElMessage.warning(t('请选择标签模板')) return } let name=company.companyName labelRow.value.list = JSON.stringify([row]) if (name == '金华福喜天成玻璃有限公司'){ labelRow.value.type = tag.value.name labelRow.value.dataType=3 labelRow.value.lableType = 1 labelRow.value.switch=true labelRow.value.detailType=1 lastList.value = [] dialogTableVisibleLabelProject.value = true } else { labelRow.value.type = '恒鑫带数量' labelRow.value.dataType=3 dialogTableVisibleLabelXJTwo.value = true } } return }else{ router.push({path: '/main/processCard/PrintCustomLabelSemi2', query: { projectNo: row.project_no,type:1 }}) } @@ -100,6 +158,12 @@ let endTime = form.date1[1] let orderId=form.orderId let project=form.project const getTags = () => { request.get('tagStyle/getTagList').then(res => { tags.value = res.data }) } //第一次加载数据 @@ -281,15 +345,8 @@ id: 'childLabel', }) const hideButton = () => { let name=company.companyName // 根据条件值 hidePrintLabels 过滤按钮数组 gridOptions.toolbarConfig.buttons = gridOptions.toolbarConfig.buttons.filter(button => { // 这里根据 hidePrintLabels 的值决定是否隐藏 printLabel 和 printLabel2 if (name == '金华福喜天成玻璃有限公司') { return button.code !== 'printLabel'; } }) const printObjectProcess = () => { hiprintTemplate.value.print(lastList.value) } </script> @@ -313,7 +370,26 @@ :icon="Search" type="primary" @click="getWorkOrder">{{ $t('basicData.search') }} </el-button> <el-row v-if="name.indexOf('吉利玻璃')==-1"> 标签模板: <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-row> </el-row> <el-row> </el-row> <div> </div> </div> <vxe-grid ref="xGrid" @@ -336,8 +412,9 @@ </template> <!--左边固定显示的插槽--> <template #button_slot="{ row }"> <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('machine.cutting')}}</el-button> <el-button @click="getTableRow(row,'edit1')" link type="primary" size="small">{{$t('machine.tempering')}}</el-button> <el-button v-if="name.indexOf('吉利玻璃')!=-1" @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('machine.cutting')}}</el-button> <el-button v-else @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('machine.tempering')}}</el-button> <el-button v-if="name.indexOf('吉利玻璃')!=-1" @click="getTableRow(row,'edit1')" link type="primary" size="small">{{$t('machine.tempering')}}</el-button> </template> <template #num1_filter="{ column, $panel }"> @@ -387,6 +464,30 @@ :projectNo="labelRow.projectNo" style="width: 100%;height: 100%"/> </el-dialog> <!-- 成品标签工程打印--> <el-dialog id="sizeCustom" v-model="dialogTableVisibleLabelProject" :title="$t('processCard.printLabel')" destroy-on-close style="width: 80%;height:75% "> <template #header="{ close, titleId, titleClass }"> <el-button @click="printObjectProcess" :icon="Printer" circle/> </template> <print-custom-label-project id="childLabel" :lastList = 'lastList' :faceOrientation="labelRow.faceOrientation" :lableType="labelRow.lableType" :list="labelRow.list" :type="labelRow.type" :titleList="labelRow.titleList" :switch="labelRow.switch" :detailType="labelRow.detailType" style="width: 100%;height: 100%"/> </el-dialog> </div> </template> @@ -398,7 +499,7 @@ height: 93%; } #selectForm { width: 60%; width: 50%; } :deep(#titleStyle .el-dialog__body){ height: 90%; north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java
@@ -376,11 +376,12 @@ } @ApiOperation("工程明细打印标签查询") @PostMapping("/getPrintCustomDataProjectNoDetail/{type}") @PostMapping("/getPrintCustomDataProjectNoDetail/{type}/{detailType}") public Result getPrintCustomDataProjectNoDetail( @PathVariable String type, @PathVariable Integer detailType, @RequestBody Map<String, Object> object) { return Result.seccess(flowCardService.getPrintCustomDataProjectNoDetailSv(type,object)); return Result.seccess(flowCardService.getPrintCustomDataProjectNoDetailSv(type,detailType,object)); } north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java
@@ -186,4 +186,6 @@ List<Map<String, Object>> getPrintProjectDetailsMp(String projectNo); List<Map<String, Object>> getPrintCustomDataProjectDetail(String projectNo, String stockId); List<Map<String, Object>> getPrintCustomDataProject(String projectNo); } north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
@@ -823,7 +823,7 @@ return map; } public Map<String, Object> getPrintCustomDataProjectNoDetailSv(String type, Map<String, Object> object) { public Map<String, Object> getPrintCustomDataProjectNoDetailSv(String type, Integer detailType, Map<String, Object> object) { Map<String, Object> map = new HashMap<>(); List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();//最终结果 List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("printList")), FlowCard.class); @@ -831,7 +831,18 @@ Set<String> processedProcessIds = new HashSet<>(); // 用来存放已处理过的 processId for (FlowCard flowCard : flowCardList) { Map<String, Object> itemmap = new HashMap<>(); itemmap.put("data", flowCardMapper.getPrintCustomDataProjectDetail(flowCard.getProjectNo(),flowCard.getStockId())); if (detailType==0){ itemmap.put("data", flowCardMapper.getPrintCustomDataProjectDetail(flowCard.getProjectNo(),flowCard.getStockId())); } else if (detailType==1) { itemmap.put("data", flowCardMapper.getPrintCustomDataProject(flowCard.getProjectNo())); } else { itemmap.put("data", flowCardMapper.getPrintCustomDataProject(flowCard.getProjectNo())); } list.add(itemmap); } } north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -478,7 +478,7 @@ </select> <select id="selectPrintFlowCard"> select * select project_no,glass_total,glass_total_area from pp.optimize_project where date(create_time)>=#{selectTime1} and date(create_time) <= #{selectTime2} and state >= 20 @@ -2162,7 +2162,7 @@ od.processing_note as processingNote, od.width, od.height, fc.quantity, fc.quantity as flowQuantity, od.order_number as orderNumber, fc.technology_number as technologyNumber, od.building_number as buildingNumber, @@ -2310,7 +2310,7 @@ od.processing_note as processingNote, od.width, od.height, fc.quantity, fc.quantity as flowQuantity, od.order_number as orderNumber, fc.technology_number as technologyNumber, od.building_number as buildingNumber, @@ -2351,4 +2351,84 @@ order by opt.stock_id,opt.polys_id </select> <select id="getPrintCustomDataProject"> select o.order_id as orderId, project, customer_id as customerId, o.customer_name as customerName, order_type as orderType, order_classify as orderClassify, batch, o.icon, pack_type as packType, delivery_date as deliveryDate, al_type as alType, money, contract_id as contractId, customer_batch customerBatch, contacts, delivery_address as deliveryAddress, od.processing_note as processingNote, od.width, od.height, fc.quantity as flowQuantity, od.order_number as orderNumber, fc.technology_number as technologyNumber, od.building_number as buildingNumber, od.product_name as productName, od.edging_type as edgingType, od.remarks, c.customer_abbreviation as customerAbbreviation, p.product_abbreviation as productAbbreviation, fc.process_id as processId, o.create_time as createTime, JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')) AS glassNumber, JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S02')) AS figureNumber, JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S03')) AS colourCeramicGlaze, JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')) AS remarks1, JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S05')) AS remarks2, JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S06')) AS remarks3, JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S07')) AS remarks4, JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S08')) AS remarks5, p.remarks as filmNumber, od.bend_radius as bendRadius, od.other_columns, JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.color')) AS color, '文本' as custom1, '文本' as custom2, '文本' as custom3, '文本' as custom4, '文本' as custom5, od.quantity, o.order_id, c.customer_abbreviation as customer_name, od.building_number, od.processing_note, ogd.child_width as childWidth, ogd.child_height as childHeight, ogd.glass_child as glassChild, ogd.process, e.type_name, opt.stock_id, od.bend_radius, a.id as flow_card_sort, concat(opt.heat_layout_id,'') as heat_layout_id , opt.heat_layout_sort from optimize_detail as opt left join flow_card as fc on opt.project_no=fc.project_no and opt.process_id=fc.process_id and opt.layer=fc.technology_number and opt.order_sort=fc.order_number left join sd.order as o on o.order_id=fc.order_id left join sd.order_detail as od on fc.order_id = od.order_id and od.order_number = fc.order_number left join sd.order_glass_detail as ogd on ogd.order_id=o.order_id and ogd.order_number=od.order_number and ogd.technology_number=fc.technology_number left join sd.product as p on p.id = od.product_id left join sd.basic_glass_type e on e.type_id = p.type_id left join sd.customer as c on c.id = o.customer_id left join sd.product_detail as pd on pd.prod_id = p.id and pd.sort_num = od.order_number and pd.glass_sort = fc.technology_number left join (select (@row_number := @row_number + 1) as id,process_id as process_id from (select process_id from pp.optimize_detail tt where project_no =#{projectNo} group by process_id) tt,(select @row_number := 0) as t) a on a.process_id=opt.process_id where opt.project_no=#{projectNo} order by opt.heat_layout_id, opt.heat_layout_sort desc </select> </mapper>