| | |
| | | component: () => import('../views/pp/processCard/PrintProcess.vue'), |
| | | }, |
| | | { |
| | | path: 'printLabel', |
| | | name: 'printLabel', |
| | | component: () => import('../views/pp/processCard/PrintLabel.vue'), |
| | | }, |
| | | { |
| | | path: 'productionScheduling', |
| | | name: 'productionScheduling', |
| | | component: () => import('../views/pp/processCard/ProductionScheduling.vue'), |
| | |
| | | import {VXETable} from "vxe-table"; |
| | | import {toolbarButtonClickEvent} from "@/hook/mouseMove"; |
| | | import PrintProcess from '@/views/pp/processCard/PrintProcess.vue' |
| | | import PrintLabel from '@/views/pp/processCard/PrintLabel.vue' |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | let router = useRouter() |
| | | const dialogTableVisible = ref(false) |
| | | const dialogTableVisibleLabel = ref(false) |
| | | let selectRecords = ref(null) |
| | | |
| | | //定义滚动条高度 |
| | |
| | | |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {code: 'print', name: '打印', status: 'primary'}, |
| | | {code: 'print', name: '打印流程卡', status: 'primary'}, |
| | | {code: 'printLabel', name: '打印标签', status: 'primary'}, |
| | | ], |
| | | // import: false, |
| | | // export: true, |
| | |
| | | } |
| | | router.push({path: '/main/processCard/printProcess', query: {printList: JSON.stringify(selectRecords)}}) |
| | | |
| | | // let routeData = router.resolve({path: '/main/processCard/printProcess', query: {printList: JSON.stringify(selectRecords)}}); |
| | | // window.open(routeData.href, '_blank'); |
| | | //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)}}) |
| | | |
| | | break |
| | | } |
| | | |
| | |
| | | <PrintProcess :printList="selectRecords" |
| | | style="width: 100%;height: 100%" /> |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | v-model="dialogTableVisibleLabel" |
| | | destroy-on-close |
| | | title="标签打印" |
| | | style="width: 80%;height:75% "> |
| | | <PrintLabel :printList="selectRecords" |
| | | style="width: 100%;height: 100%" /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | |
| | | </style> |
New file |
| | |
| | | <script setup> |
| | | import request from "@/utils/request" |
| | | import {ElDatePicker, ElMessage} from "element-plus" |
| | | import {nextTick, onMounted, onUnmounted, reactive, ref, watch} from "vue" |
| | | import {Search} from "@element-plus/icons-vue" |
| | | import {useRouter} from 'vue-router' |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | import {useI18n} from 'vue-i18n' |
| | | import deepClone from "@/utils/deepClone"; |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | let router = useRouter() |
| | | let produceList = ref([]) |
| | | let labelList = ref([]) |
| | | let list = ref() |
| | | const details = ref([]) |
| | | |
| | | |
| | | const data = ref({ |
| | | printList: [] |
| | | }) |
| | | |
| | | const {currentRoute} = useRouter() |
| | | const route = currentRoute.value |
| | | data.value.printList = JSON.parse(route.query.printList) |
| | | onMounted(() => { |
| | | |
| | | request.post(`/processCard/getSelectPrintLabel`, data.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | produceList.value = deepClone(res.data.data) |
| | | for (let i = 0; i < produceList.value.length; i++) { |
| | | let count= produceList.value[i].quantity |
| | | for (let j = 0; j < count; j++) { |
| | | labelList.value.push(produceList.value[i]) |
| | | |
| | | } |
| | | } |
| | | console.log(labelList.value) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | | } |
| | | |
| | | ) |
| | | |
| | | |
| | | |
| | | // 打印方法 |
| | | const printFlowCard = () => { |
| | | // 需要打印的局部区域赋予"print-wrap"的id |
| | | let el = document.getElementById("printFlowCard"); |
| | | let doc = document; |
| | | let body = doc.body || doc.getElementsByTagName("body")[0]; |
| | | let printId = "print-" + Date.now(); |
| | | |
| | | // 创建无副作用的打印容器(因不确定页面的打印元素有无其它样式) |
| | | let content = doc.createElement("div"); |
| | | content.id = printId; |
| | | |
| | | // 样式控制与打印无关的元素隐藏 |
| | | let style = doc.createElement("style"); |
| | | style.innerHTML = |
| | | "body>#" + |
| | | printId + |
| | | "{display:none}@media print{body>:not(#" + |
| | | printId + |
| | | "){display:none !important}body>#" + |
| | | printId + |
| | | "{display:block;padding-top:1px}}"; |
| | | // |
| | | content.innerHTML = el.outerHTML; |
| | | // // console.log("el.outerHTML", el.outerHTML); |
| | | body.appendChild(style); |
| | | |
| | | // 与style元素设置的样式相配合 |
| | | // 把打印内容的元素添加到body(作为body的子元素,可用body的子选择器 '>' 控制打印样式) |
| | | body.appendChild(content); |
| | | setTimeout(() => { |
| | | window.print(); |
| | | body.removeChild(content); |
| | | body.removeChild(style); |
| | | }, 20); |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <el-button id="printButton" @click="printFlowCard();">打印</el-button> |
| | | <div id="printFlowCard" > |
| | | <div id="entirety" v-for="(item,id) in labelList" > |
| | | <div class="row1">{{ item.customer_name }}</div> |
| | | <div class="row2">{{ item.order_id }} {{ item.type_name }}</div> |
| | | |
| | | <div class="row4">{{item.project}} {{ item.remarks }}</div> |
| | | <div class="row5">{{item.child_width}}*{{item.child_height}}={{item.quantity}}</div> |
| | | <div class="row6">{{item.glass_child}}</div> |
| | | </div> |
| | | </div> |
| | | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | * { |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | |
| | | #printButton { |
| | | margin-top: -30px; |
| | | width: 100px; |
| | | } |
| | | |
| | | #printFlowCard { |
| | | margin-left: 25px; |
| | | display: flex; |
| | | justify-content: left; |
| | | flex-wrap: wrap; |
| | | |
| | | //font-weight: bolder; height: 600px; |
| | | } |
| | | |
| | | #entirety{ |
| | | text-align: center; |
| | | width: 190px; |
| | | height: 90px; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | .row1 { |
| | | font-size: 9pt; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .row2 { |
| | | font-size: 9pt; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .row3 { |
| | | |
| | | font-size: 9pt; |
| | | font-weight: bolder; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .remarks{ |
| | | margin-right: 40px; |
| | | } |
| | | .type{ |
| | | margin-left: 40px; |
| | | } |
| | | |
| | | .row4 { |
| | | font-weight: bold; |
| | | font-size: 9pt; |
| | | } |
| | | .row5 { |
| | | font-weight: bold; |
| | | font-size: 9pt; |
| | | } |
| | | |
| | | .row6 { |
| | | font-weight: bold; |
| | | font-size: 9pt; |
| | | } |
| | | |
| | | |
| | | |
| | | @page { |
| | | size: auto; /* auto is the initial value */ |
| | | margin: 2mm 0mm 0mm 0mm /* this affects the margin in the printer settings */ |
| | | |
| | | } |
| | | |
| | | @media print { |
| | | |
| | | div { |
| | | display: table-footer-group; |
| | | page-break-inside: avoid; |
| | | text-align: center; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | </style> |
| | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElDatePicker, ElMessage} from "element-plus"; |
| | | import {useI18n} from 'vue-i18n' |
| | |
| | | import {ElDatePicker, ElMessage} from "element-plus"; |
| | | import {useI18n} from 'vue-i18n' |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | import exportExcel from "@/hook/exportExcel"; |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | let router = useRouter() |
| | |
| | | // buttons: [{ |
| | | // |
| | | // }], |
| | | import: false, |
| | | export: true, |
| | | print: true, |
| | | // import: false, |
| | | // export: true, |
| | | // print: true, |
| | | slots: { |
| | | tools: 'toolbar_buttons' |
| | | }, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input v-model="option.data" type="type" @input="changeFilterEvent($event, option, $panel)"/> |
| | | <input v-model="option.data" type="text" @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <template #toolbar_buttons> |
| | | <vxe-button style="margin-right: 0.5rem" |
| | | @click="exportExcel('/report/exportSplittingDetailsOutside', |
| | | '分架明细报表', |
| | | form.date1)"> |
| | | 导出</vxe-button> |
| | | </template> |
| | | |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | |
| | | return Result.seccess(flowCardService.getSelectPrintingSv(object)); |
| | | } |
| | | |
| | | @ApiOperation("打印标签数据查询接口") |
| | | @PostMapping("/getSelectPrintLabel") |
| | | public Result getSelectPrintLabel( @RequestBody Map<String,Object> object){ |
| | | return Result.seccess(flowCardService.getSelectPrintLabelSv(object)); |
| | | } |
| | | |
| | | @ApiOperation("复选框修改排版状态") |
| | | @SaCheckPermission("SelectProcessCard.review") |
| | | @PostMapping("/updateComposing") |
| | |
| | | //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | DownExcel.download(response, WorkInProgressDTO.class, reportService.exportWorkInProgressSv(dates), "WorkInProgress"); |
| | | } |
| | | |
| | | @ApiOperation("分架明细报表导出") |
| | | @PostMapping("/exportSplittingDetailsOutside") |
| | | public void exportSplittingDetailsOutside(HttpServletResponse response, @RequestBody List<LocalDate> dates) throws IOException, IllegalAccessException, InstantiationException { |
| | | //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | DownExcel.download(response, SplittingDetailsOutsideDTO.class, reportService.exportOrderPlanDecompositionSv(dates), "OrderPlanDecomposition"); |
| | | } |
| | | } |
| | |
| | | Boolean updateInventory(String processId, String orderNumber, String technologyNumber, int completedQuantity); |
| | | |
| | | Boolean updateComposing(String processId); |
| | | |
| | | List<Map<String, String>> getPrintLabel(String processId, Integer technologyNumber); |
| | | } |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | public Map<String, Object> getSelectPrintLabelSv(Map<String, Object> object) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("printList")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | for (FlowCard flowCard : flowCardList) { |
| | | Integer count=flowCard.getQuantity(); |
| | | for (int i = 0; i < count; i++) { |
| | | map.put("data", flowCardMapper.getPrintLabel(flowCard.getProcessId(), flowCard.getTechnologyNumber())); |
| | | //System.out.println(flowCardMapper.getPrintLabel(flowCard.getProcessId(), flowCard.getTechnologyNumber())); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | } |
| | |
| | | select * from sd.order where create_time between #{selectTime1} and #{selectTime2} and |
| | | position(#{orderId} in order_id ) and position(#{project} in project) |
| | | and processing_card=2 |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | <select id="selectPrintMp"> |
| | |
| | | o.project, |
| | | ogd.technology_number, |
| | | ogd.glass_address, |
| | | od.quantity, |
| | | ogd.total_area, |
| | | sum(od.quantity) as quantity, |
| | | sum(ogd.total_area) as total_area, |
| | | od.product_name, |
| | | ogd.glass_child, |
| | | fc.founder, |
| | |
| | | set fc.layout_status=1 |
| | | where fc.process_id = #{processId} |
| | | </update> |
| | | |
| | | <select id="getPrintLabel"> |
| | | select c.customer_name, |
| | | c.order_id, |
| | | e.type_name, |
| | | b.remarks, |
| | | c.project, |
| | | a.child_width, |
| | | a.child_height, |
| | | sum(b.quantity) as quantity, |
| | | a.glass_child, |
| | | b.processing_note |
| | | from sd.order_glass_detail as a |
| | | left join sd.order_detail as b |
| | | on a.order_id = b.order_id |
| | | and a.order_number = b.order_number |
| | | left join sd.`order` as c |
| | | on c.order_id = a.order_id |
| | | left join flow_card as d |
| | | on d.order_id = a.order_id and d.order_number = a.order_number and |
| | | d.technology_number = a.technology_number |
| | | left join sd.product e |
| | | on e.id = b.product_id |
| | | where d.process_id = #{processId} |
| | | and d.technology_number = #{technologyNumber} |
| | | group by a.glass_child, a.child_width, a.child_height |
| | | order by d.technology_number |
| | | </select> |
| | | </mapper> |