north-glass-erp/northglass-erp/src/components/pp/PrintProcess.vue
@@ -183,7 +183,7 @@ <thead> <tr v-for="(itemFlow,index) in item.detail" :key="index"> <td colspan="24"> <div style="float: left;"><input style="border: none;font-size: 28px;width: 40px "/></div> <div style="float: left;"><input style="border: none;font-size: 28px;width: 70px "/></div> <div id="bj" style="float: right;font-size: 28px">{{ id + 1 }}</div> <div>{{company.companyName}}</div> <div>生产流程卡</div> north-glass-erp/northglass-erp/src/components/pp/PrintProcessReplenish.vue
New file @@ -0,0 +1,444 @@ <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"; import QRCode from "qrcode"; import companyInfo from "@/stores/sd/companyInfo"; //语言获取 const company = companyInfo() const {t} = useI18n() let router = useRouter() let produceList = ref([]) let list = ref() const details = ref([]) const data = ref({ printList: [] }) let props = defineProps({ printList:null, printMerge:null }) const {currentRoute} = useRouter() const route = currentRoute.value const printMerge = props.printMerge let merge=props.printMerge if (merge == '') { merge = null } data.value.printList = JSON.parse(props.printList) let flowCardCount = data.value.printList.length onMounted(() => { request.post(`/processCard/getSelectPrinting/${merge}`, data.value).then((res) => { if (res.code == 200) { produceList.value = deepClone(res.data.data) //处理单片厚度 for (let j = 0; j < produceList.value.length; j++) { let sumWeight = 0 produceList.value[j].detailList.forEach((item, index) => { // 解析 separation 字段的 JSON 字符串 let separationObj = JSON.parse(item.separation); // 获取 thickness 的原始值 let thicknessValue = separationObj.thickness; // 去除 'mm' 单位 let thicknessWithoutUnit = thicknessValue.replace('mm', ''); item.separation=thicknessWithoutUnit sumWeight += item.width*item.height*item.quantity/1000000*item.separation*2.5*1; }); produceList.value[j].detail[0].weight=sumWeight } //处理合并打印 if (printMerge !== null && printMerge !== undefined && printMerge !== "") { produceList.value.forEach(item => { item.detail[0].technologyNumber = printMerge; }); //合并打印工艺流程处理 let process = produceList.value[0].detail[0].process let indexOfJiaJiao = process.indexOf('夹胶'); if (indexOfJiaJiao !== -1) { // 使用 substring 截取 "夹胶" 后面的部分,包括 "夹胶" 本身 let afterJiaJiao = process.substring(indexOfJiaJiao).trim(); produceList.value.forEach(item =>{ item.detail[0].process = afterJiaJiao }) } let indexOfProceList=produceList.value[0].processList let getProceList = indexOfProceList.findIndex(item => item.process === '夹胶'); if (getProceList !== -1) { // 使用 filter 方法过滤出 "夹胶" 及其之后的对象 produceList.value[0].processList = indexOfProceList.filter((item, index) => index >= getProceList); } } produceList.value.forEach(item =>{ let technologyNumberMerge = printMerge.split('').join(','); item.detail[0].technologyNumberMerge = technologyNumberMerge }) //处理编号列 //定义存放编号数组 const s01Values = []; for (let i = 0; i < produceList.value.length; i++) { const s01Values = []; // 遍历 detailList 数组,提取 S01 值到 s01Values 数组 if (produceList.value[i].detailList[0].other_columns!=null || produceList.value[i].detailList[0].other_columns!=undefined){ produceList.value[i].detailList.forEach(element => { const otherColumnsObject = JSON.parse(element.other_columns); const s01Value = otherColumnsObject.S01; s01Values.push(s01Value || ''); // 如果 S01 值为空,添加空字符串或者其他默认值 }); // 将 s01Values 中的值赋给每个订单详情对象的 s01Value 属性 produceList.value[i].detailList.forEach((detail, index) => { detail.s01Value = index < s01Values.length ? s01Values[index] : ''; // 赋值给 s01Value 属性 }); } } handleGetQRCode() } else { ElMessage.warning(res.msg) router.push("/login") } }) } ) const handleGetQRCode = async () => { for (let i = 0; i < produceList.value.length; i++) { const technologyNumber = produceList.value[i].detail[0].technologyNumber.toString(); // 转换为字符串以便处理每个字符 produceList.value[i].detail[0]["qrcodeList"] = []; // 初始化一个空数组用来存储 QR Code for (let j = 0; j < technologyNumber.length; j++) { const processId = produceList.value[i].detail[0].process_id; const url = `${processId}/${technologyNumber[j]}`; // 生成 QR Code 并存储到数组中 const qrcodeData = await QRCode.toDataURL(url); produceList.value[i].detail[0]["qrcodeList"].push({ qrcode: qrcodeData, technologyNumber: technologyNumber[j] }); } } }; //根据输入的数量重新汇总 const handleSummary = () => { for (let i = 0; i < produceList.value.length; i++) { //数量 let totalQuantity = 0; //面积 let totalArea = 0; //重量 let totalWeight = 0; // 对每个集合中的 detailList 进行计算 produceList.value[i].detailList.forEach(collection => { totalQuantity += collection.quantity*1; //每个序号面积 collection.total_area=parseFloat((collection.width*collection.height*collection.quantity/1000000).toFixed(2)) totalArea += collection.total_area*1; totalWeight += collection.width*collection.height*collection.quantity/1000000*collection.separation*2.5*1; //每个序号周长 collection.perimeter= (collection.width*2+collection.height*2)*collection.quantity/1000 }); // 输出每个集合中的总数量 produceList.value[i].detail[0].quantity=totalQuantity produceList.value[i].detail[0].gross_area=totalArea produceList.value[i].detail[0].weight=totalWeight } } </script> <template> <!-- <el-button id="printButton" @click="printFlowCard();">{{ $t('basicData.print') }}</el-button>--> <div id="printFlowCard"> <table v-for="(item,id) in produceList" id="contentTable" :key="id"> <thead> <tr v-for="(itemFlow,index) in item.detail" :key="index"> <td colspan="24"> <div style="float: left;"><input style="border: none;font-size: 28px;width: 70px "/></div> <div id="bj" style="float: right;font-size: 28px">补 {{ id + 1 }}</div> <div>{{company.companyName}}</div> <div>生产流程卡</div> <div v-if="itemFlow.technologyNumberMerge!=''" style="text-align: right;font-weight: bolder">流程卡号: {{ itemFlow.process_id }}/{{ itemFlow.technologyNumberMerge }} 共 {{ flowCardCount }} 架 </div> <div v-else style="text-align: right;font-weight: bolder">流程卡号: {{ itemFlow.process_id }}/{{ itemFlow.technologyNumber }} 共 {{ flowCardCount }} 架 </div> </td> </tr> <tr v-for="(items,index) in item.detail" :key="index"> <td class="tdNowrap">客户名称:</td> <td colspan="2">{{ items.customer_name }}</td> <td class="tdNowrap">项目名称:</td> <td colspan="2">{{ items.project }}</td> <td class="tdNowrap">工艺流程:</td> <td colspan="17" style="width: 500px">{{ items.process }}</td> </tr> <tr v-for="(itemTr,index) in item.detail" :key="index"> <td class="tdNowrap">磨边类型:</td> <td colspan="2">{{ itemTr.edging_type }}</td> <td class="tdNowrap">单片名称:</td> <td colspan="2">{{ itemTr.glass_child }}</td> <td class="tdNowrap">产品名称:</td> <td colspan="17">{{ itemTr.product_name }}</td> </tr> <tr> <td rowspan='2'>序号</td> <td rowspan='2'>编号</td> <td rowspan='2'>宽*高</td> <td rowspan='2'>数量</td> <td rowspan='2'>面积</td> <td rowspan='2'>周长</td> <td rowspan='2'>半径</td> <td rowspan='2'>备注</td> <td v-for="(itemPr,index) in item.processList" :key="index" colspan="2">{{ itemPr.process }}</td> </tr> <tr> <td>{{company.printLabel.printFlowCard.patch}}</td> <td>{{company.printLabel.printFlowCard.lackOf}}</td> <td>{{company.printLabel.printFlowCard.patch}}</td> <td>{{company.printLabel.printFlowCard.lackOf}}</td> <td>{{company.printLabel.printFlowCard.patch}}</td> <td>{{company.printLabel.printFlowCard.lackOf}}</td> <td>{{company.printLabel.printFlowCard.patch}}</td> <td>{{company.printLabel.printFlowCard.lackOf}}</td> <td>{{company.printLabel.printFlowCard.patch}}</td> <td>{{company.printLabel.printFlowCard.lackOf}}</td> <td>{{company.printLabel.printFlowCard.patch}}</td> <td>{{company.printLabel.printFlowCard.lackOf}}</td> <td>{{company.printLabel.printFlowCard.patch}}</td> <td>{{company.printLabel.printFlowCard.lackOf}}</td> <td>{{company.printLabel.printFlowCard.patch}}</td> <td>{{company.printLabel.printFlowCard.lackOf}}</td> </tr> </thead> <tbody> <tr v-for="(itemDatile,index) in item.detailList" :key="index"> <td>{{ itemDatile.order_number }}</td> <td>{{itemDatile.s01Value}}</td> <td>{{ itemDatile.child_width }}</td> <td class="item" style="width: 5%;height: 100%;"><el-input @keyup="handleSummary()" style="border: none" v-model="itemDatile.quantity"></el-input></td> <td>{{ itemDatile.total_area }}</td> <td>{{ itemDatile.perimeter }}</td> <td>{{ itemDatile.bend_radius }}</td> <td>{{ itemDatile.remarks }}</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </tbody> <tfoot> <tr style="height: 14px"> <td v-for="(itemsum,index) in item.detail" :key="index" colspan="24"> 数量: <label>{{ itemsum.quantity }}</label> 面积: <label>{{ parseFloat(itemsum.gross_area.toFixed(2)) }}</label> 重量: <label>{{ parseFloat(itemsum.weight.toFixed(2)) }}</label> </td> </tr> <tr v-for="(itemtextarea,index) in item.detail" :key="index"> <td colspan="6" rowspan="6" style="width: 480px;height: 100px "> <!-- <div style="width: 100%;height: 100%"><textarea style="height: 99%;width: 99%;font-size: 11px">{{ itemtextarea.processing_note }}</textarea>--> <!-- </div>--> <div style="width: 100%;height: 100%;"><textarea style="height: 99%;width: 99%;border: none;;font-size: 11px">{{company.printLabel.printFlowCard.processingNote(itemtextarea)}}</textarea> </div> </td> <td>完工签名</td> <td></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> </tr> <tr> <td>生产日期</td> <td></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> </tr> <tr> <td>质检签名</td> <td></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> </tr> <tr v-for="(qrCodeItem,index) in item.detail" :key="index"> <td colspan="19"> <span style="display: flex;"> <span v-for="(qrCodeItems,index) in qrCodeItem.qrcodeList" :key="index" style="display: flex;width: 35%"> <div class='qrCode' style="width: 80px;height: 80px;"> <img :src=qrCodeItems.qrcode> </div> <span style="float: left;font-weight: bolder">{{ qrCodeItem.process_id + "/" + qrCodeItems.technologyNumber }}</span> </span> </span> </td> </tr> </tfoot> </table> </div> </template> <style scoped> * { margin: 0; padding: 0; text-align: center; } #printButton { margin-top: -40px; width: 100px; } #printFlowCard { text-align: center; //font-weight: bolder; height: 600px; } #contentTable { border-collapse: collapse; border: 1px solid black; width: 100%; } #contentTable thead { font-size: 13px; font-weight: bolder; } #contentTable thead div { font-size: 15px; font-weight: bolder; } #contentTable tr td { border: 1px solid black; height: 18px; font-weight: bolder; } #contentTable tbody { white-space: nowrap; } .tdNowrap { white-space: nowrap; } #contentTable tfoot { font-size: 12px; font-weight: bolder; } @page { size: auto; /* auto is the initial value */ margin: 2mm 0mm 0mm 1mm /* this affects the margin in the printer settings */ } @media print { tbody { display: table-row-group; } table { page-break-before: always; } table { page-break-inside: auto; } thead { display: table-header-group; } tfoot { display: table-footer-group; page-break-inside: avoid; } } .qrCode img { width: 100%; height: 100%; } </style> north-glass-erp/northglass-erp/src/views/pp/Replenish/PrintReplenishFlowCard.vue
@@ -9,7 +9,7 @@ import {changeFilterEvent, filterChanged} from "@/hook" import {VXETable} from "vxe-table"; import {addListener, toolbarButtonClickEvent} from "@/hook/mouseMove"; import PrintProcess from '@/components/pp/PrintProcess.vue' import PrintProcess from '@/components/pp/PrintProcessReplenish.vue' import PrintLabel from '@/views/pp/processCard/PrintLabel.vue' import PrintCustomLabel from '@/views/pp/processCard/PrintCustomLabel.vue' import footSum from "@/hook/footSum" north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue
@@ -20,27 +20,6 @@ let router = useRouter() const userStore = useUserInfoStore() const username = userStore.user.userName const getTableRow = (row, type) => { switch (type) { case 'edit' : { router.push({path: '/main/processCard/PrintFlowCard', query: {id: row.id}}) break } case 'delete': { request.post(`/processCard/deleteFlowCard/${row.orderId}/${row.processId}`).then((res) => { if (res.code == 200) { ElMessage.success(t('workOrder.deleteOk')) location.reload(); } else { ElMessage.warning(res.msg) // router.push("/login") } }) break } } } let flag = $ref(true) function intoCreateProduct() { @@ -92,6 +71,8 @@ let orderId = route.query.orderId let productionId = route.query.productionId const orderOtherMoney = ref(null) //第一次加载数据 @@ -99,6 +80,19 @@ if (res.code == 200) { pageTotal.value = res.data.total orderOtherMoney.value = res.data.orderOtherMoney orderOtherMoney.value.forEach(item => { let column = { field: `${item.column}`, width: 60, title: item.alias, } //columns.push(column) console.log(column) gridOptions.columns.push(column) }) produceList = produceList.value.concat(deepClone(res.data.data)) xGrid.value.reloadData(produceList) gridOptions.loading = false @@ -154,13 +148,13 @@ useKey: true }, filterConfig: { //筛选配置项 //remote: true //remote: true }, customConfig: { storage: true }, sortConfig:{ multiple:true sortConfig: { multiple: true }, editConfig: { trigger: 'click', @@ -168,13 +162,14 @@ showStatus: true },//表头参数 columns: [ {type: 'checkbox', fixed: "left", title: t('basicData.check')}, {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: '80px'}, { field: 'orderNumber', title: t('order.OrderNum'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, filterMethod: filterChanged filterMethod: filterChanged, width: '100px' }, { field: 'shape', @@ -182,7 +177,8 @@ showOverflow: "ellipsis", filters: [{data: ''}], slots: {filter: 'num1_filter'}, filterMethod: filterChanged filterMethod: filterChanged, width: '70px' }, { field: 'width', @@ -191,7 +187,7 @@ filters: [{data: ''}], slots: {filter: 'num1_filter'}, filterMethod: filterChanged, width: '60px' width: '78px' }, { field: 'height', @@ -200,13 +196,13 @@ filters: [{data: ''}], slots: {filter: 'num1_filter'}, filterMethod: filterChanged, width: '60px' width: '78px' }, {field: 'baiscQuantity', title: t('processCard.quantityToDivided'), showOverflow: "ellipsis", width: '60px'}, {field: 'computeGrossArea', title: t('processCard.areaToDivided'), width: '60px'}, {field: 'baiscQuantity', title: t('processCard.quantityToDivided'), showOverflow: "ellipsis", width: '80px'}, {field: 'computeGrossArea', title: t('processCard.areaToDivided'), width: '80px'}, {field: 'totalThickness', title: t('processCard.totalThickness'), width: '80px'}, {field: 'thickness', title: t('processCard.glassThickness'), width: '60px'}, {field: 'weight', title: t('processCard.weight'),slots:{default:'weight_sum'}} {field: 'thickness', title: t('processCard.glassThickness'), width: '80px'}, {field: 'weight', title: t('processCard.weight'), slots: {default: 'weight_sum'}, width: '85px'} ],//表头按钮 toolbarConfig: { @@ -222,23 +218,23 @@ data: [],//table body实际数据 //脚部求和 footerMethod ({ columns, data }) {//页脚函数 footerMethod({columns, data}) {//页脚函数 let count = 0 return[ return [ columns.map((column, columnIndex) => { if (columnIndex === 0) { return t('basicData.total') } const List = ["baiscQuantity",'computeGrossArea'] const List = ["baiscQuantity", 'computeGrossArea'] if (List.includes(column.field)) { return footSum(data, column.field) } if (column.field === 'weight'){ if (column.field === 'weight') { data.forEach(row => { count += weightSum(row) }) return parseFloat(count.toFixed(2)) return parseFloat(count.toFixed(2)) } return '' @@ -268,7 +264,7 @@ useKey: true }, filterConfig: { //筛选配置项 //remote: true //remote: true }, customConfig: { storage: true @@ -279,14 +275,14 @@ showStatus: true },//表头参数 columns: [ {type: 'checkbox', fixed: "left", title: t('basicData.check')}, {type: 'checkbox', fixed: "left", title: t('basicData.check'),width: 78}, { field: 'processId', title: t('processCard.processId'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 100, filterMethod: filterChanged width: 135, filterMethod: filterChanged, }, { field: 'orderNumber', @@ -294,26 +290,29 @@ showOverflow: "ellipsis", filters: [{data: ''}], slots: {filter: 'num1_filter'} , filterMethod: filterChanged , filterMethod: filterChanged, width: 98 }, { field: 'landingSequence', title: t('processCard.landingSequence'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, filterMethod: filterChanged filterMethod: filterChanged, width: 99 }, { field: 'shape', title: t('order.shape'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, filterMethod: filterChanged filterMethod: filterChanged, width:70 }, {field: 'width', title: t('order.width'), showOverflow: "ellipsis"}, {field: 'height', title: t('order.height')}, {field: 'quantity', title: t('order.quantity')}, {field: 'totalThickness', title: t('processCard.totalThickness')}, {field: 'width', title: t('order.width'), showOverflow: "ellipsis",width:70}, {field: 'height', title: t('order.height'),width:70}, {field: 'quantity', title: t('order.quantity'),width:70}, {field: 'totalThickness', title: t('processCard.totalThickness'),width:70}, ],//表头按钮 toolbarConfig: { @@ -328,13 +327,13 @@ }, data: [],//table body实际数据 //脚部求和 footerMethod ({ columns, data }) {//页脚函数 return[ footerMethod({columns, data}) {//页脚函数 return [ columns.map((column, columnIndex) => { if (columnIndex === 0) { return t('basicData.total') } const List = ["quantity",'goodsQuantity','area'] const List = ["quantity", 'goodsQuantity', 'area'] if (List.includes(column.field)) { return footSum(data, column.field) } @@ -439,11 +438,11 @@ //对选中的左边表格数据进行循环 checkedList.forEach((item) => { //判断可用数量是否大于等于输入的数量,不满足则抛出异常 // if (item.quantity < checkedNum.value*1) throw new Error(t('processCard.schedulingQuantity')); if (item.quantity < checkedNum.value*1){ // if (item.quantity < checkedNum.value*1) throw new Error(t('processCard.schedulingQuantity')); if (item.quantity < checkedNum.value * 1) { ElMessage.warning(t('processCard.schedulingQuantity')) } //左边表格可用数量减去输入的数量 //左边表格可用数量减去输入的数量 item.quantity = item.quantity - checkedNum.value //右边表格数据 let rightData = $grid.getTableData().fullData @@ -454,7 +453,7 @@ //数量 rightData[filterIndex].baiscQuantity = rightData[filterIndex].baiscQuantity * 1 + checkedNum.value * 1 //面积 rightData[filterIndex].computeGrossArea=(rightData[filterIndex].width*rightData[filterIndex].height*rightData[filterIndex].baiscQuantity/1000000).toFixed(2) rightData[filterIndex].computeGrossArea = (rightData[filterIndex].width * rightData[filterIndex].height * rightData[filterIndex].baiscQuantity / 1000000).toFixed(2) //如果左边数量为0时删除此条数据 //删除key let key = item._X_ROW_KEY @@ -466,7 +465,7 @@ } else { //右边表格没有此条数据则往右边表格插入数据 item.baiscQuantity = checkedNum.value item.computeGrossArea=(item.width*item.height*checkedNum.value/1000000).toFixed(2) item.computeGrossArea = (item.width * item.height * checkedNum.value / 1000000).toFixed(2) if (item.quantity === 0) { $gridLeft.remove(item) } @@ -489,7 +488,7 @@ if (filterIndex > -1) { rightData[filterIndex].baiscQuantity = rightData[filterIndex].baiscQuantity * 1 + item.quantity * 1 //面积 rightData[filterIndex].computeGrossArea=(rightData[filterIndex].width*rightData[filterIndex].height*rightData[filterIndex].baiscQuantity/1000000).toFixed(2) rightData[filterIndex].computeGrossArea = (rightData[filterIndex].width * rightData[filterIndex].height * rightData[filterIndex].baiscQuantity / 1000000).toFixed(2) } else { @@ -505,8 +504,8 @@ // } // } delete item._X_ROW_KEY $grid.insert(item) delete item._X_ROW_KEY $grid.insert(item) } @@ -554,7 +553,7 @@ //判断可用数量是否大于等于输入的数量,不满足则抛出异常 if (item.baiscQuantity * 1 < checkedNum.value * 1) throw new Error("请输入小于等于待分数量的数字"); item.baiscQuantity = item.baiscQuantity - checkedNum.value item.computeGrossArea=(item.computeGrossArea-item.width*item.height*checkedNum.value/1000000).toFixed(2) item.computeGrossArea = (item.computeGrossArea - item.width * item.height * checkedNum.value / 1000000).toFixed(2) //定义key值保持 let key = item._X_ROW_KEY //左边表格数据 @@ -567,7 +566,7 @@ //如果右边表格数据中存在当前数据则数量相加 if (filterIndex >= 0) { leftData[filterIndex].quantity = leftData[filterIndex].quantity * 1 + checkedNum.value * 1 leftData[filterIndex].computeGrossArea=(leftData[filterIndex].computeGrossArea-leftData[filterIndex].width*leftData[filterIndex].height*leftData[filterIndex].baiscQuantity/1000000).toFixed(2) leftData[filterIndex].computeGrossArea = (leftData[filterIndex].computeGrossArea - leftData[filterIndex].width * leftData[filterIndex].height * leftData[filterIndex].baiscQuantity / 1000000).toFixed(2) if (item.baiscQuantity === 0) { $grid.remove(item) @@ -577,7 +576,7 @@ item.quantity = checkedNum.value item.processId = checkedListLeft[0].processId item.landingSequence = checkedListLeft[0].landingSequence item.computeGrossArea=(item.computeGrossArea-checkedListLeft[0].width*checkedListLeft[0].height*checkedNum.value/1000000).toFixed(2) item.computeGrossArea = (item.computeGrossArea - checkedListLeft[0].width * checkedListLeft[0].height * checkedNum.value / 1000000).toFixed(2) delete item._X_ROW_KEY $gridLeft.insert(item) item._X_ROW_KEY = key @@ -596,7 +595,7 @@ for (let i = 0; i < leftData.length; i++) { if (leftData[i].orderNumber === item.orderNumber && leftData[i].processId === item.processId) { leftData[i].quantity = leftData[i].quantity * 1 + checkedNum.value * 1 leftData[i].computeGrossArea=(leftData[i].computeGrossArea-leftData[i].width*leftData[i].height*leftData[i].baiscQuantity/1000000).toFixed(2) leftData[i].computeGrossArea = (leftData[i].computeGrossArea - leftData[i].width * leftData[i].height * leftData[i].baiscQuantity / 1000000).toFixed(2) break } else if (leftData[i].orderNumber === item.orderNumber && leftData[i].processId !== item.processId) { delete item._X_ROW_KEY @@ -608,7 +607,7 @@ $gridLeft.insert(item) item._X_ROW_KEY = key break }else if (leftData[i].orderNumber !== item.orderNumber && leftData[i].processId == item.processId) { } else if (leftData[i].orderNumber !== item.orderNumber && leftData[i].processId == item.processId) { delete item._X_ROW_KEY $gridLeft.insert(item) item._X_ROW_KEY = key @@ -624,7 +623,7 @@ item.processId = checkedListLeft[0].processId item.landingSequence = checkedListLeft[0].landingSequence item.quantity = checkedListLeft[0].baiscQuantity item.computeGrossArea=(item.computeGrossArea-checkedListLeft[0].width*checkedListLeft[0].height*checkedListLeft[0].baiscQuantity/1000000).toFixed(2) item.computeGrossArea = (item.computeGrossArea - checkedListLeft[0].width * checkedListLeft[0].height * checkedListLeft[0].baiscQuantity / 1000000).toFixed(2) delete item._X_ROW_KEY }) @@ -696,18 +695,18 @@ }, } const weightSum = (row) =>{ return parseFloat((row.baiscQuantity*row.thickness*row.width*row.height*2.5/1000000).toFixed(2)) const weightSum = (row) => { return parseFloat((row.baiscQuantity * row.thickness * row.width * row.height * 2.5 / 1000000).toFixed(2)) } let quantit = ref('') let weight = ref('') const handleCheckboxChange=({ row}) =>{ const handleCheckboxChange = ({row}) => { const $grid = xGrid.value //获取右边表格checkbox选中的数据 const checkedList = $grid.getCheckboxRecords() let quantitySum = 0; let weightsum=0; let weightsum = 0; checkedList.forEach(item => { quantitySum += item.baiscQuantity; weightsum += weightSum(item); @@ -718,36 +717,31 @@ </script> <template> <div style="width: 100%;height: 100%"> <div style="width: 75%;height: 90%"> <div class="common-layout" style="width: 100%;height: 100%"> <div class="header" style="height: 5%;width: 100%"> <el-button id="searchButton1" :icon="ArrowLeftBold" round style="float: left" type="primary" @click="intoCreateProduct"> {{ flag ? t('processCard.return') : t('processCard.return') }} </el-button> <!-- <el-button type="primary">保存分架</el-button>--> <!-- <el-button type="primary" :hidden="true">分架汇总</el-button>--> <div style="width: 100px;"> <el-button id="searchButton1" :icon="ArrowLeftBold" round style="float: left" type="primary" @click="intoCreateProduct"> {{ flag ? t('processCard.return') : t('processCard.return') }} </el-button> <!-- <el-button type="primary">保存分架</el-button>--> <!-- <el-button type="primary" :hidden="true">分架汇总</el-button>--> </div> </div> <el-container style="height: 100%;width: 100%"> <el-aside style="width: 44%;height: 100%"> <el-aside style="width: 52%;height: 100%"> <vxe-grid ref="xGridLeft" checkbox-config="{ reserve: true, strict: true }" class="mytable-scrollbar" height="650px" max-height="100%" height="100%" v-bind="gridLeftOptions" v-on="gridEvents" checkbox-config="{ reserve: true, strict: true }" > <!-- @toolbar-button-click="toolbarButtonClickEvent"--> <!-- 下拉显示所有信息插槽--> @@ -771,25 +765,22 @@ </div> </div> </template> </vxe-grid> </el-aside> <div width="12%"> <div height="100%" style="margin: 5px" width="11%"> <el-main style=""> <div> <span><el-input v-model="quantit" style="width: 80px;"/></span> <span><el-input v-model="weight" style="width: 80px;"/></span> <span><el-input v-model="quantit" style="width: 80px;"/></span> <span><el-input v-model="weight" style="width: 80px;"/></span> </div> <span>{{ $t('processCard.selectedQuantity') }}:<el-input v-model="checkedNum" clearable type="number"></el-input></span><br> <el-button type="primary" @click="addRight"> →</el-button> <el-button style="width: 40px;" type="primary" @click="addRight"> →</el-button> <br> <br> <el-button type="primary" @click="addLeft"> ←</el-button> <el-button style="width: 40px;" type="primary" @click="addLeft"> ←</el-button> <br> <br> <el-button type="primary" @click="createProcessCard">{{ $t('processCard.establishProcessCards') }} @@ -799,17 +790,16 @@ <!-- 右侧--> <div style="height: 100%;width: 100%"> <div style="height: 100%;width: 70%"> <el-aside style="width: 100%;height: 100%"> <vxe-grid id="rightTable" ref="xGrid" class="mytable-scrollbar" height="650px" max-height="100%" v-bind="gridOptions" checkbox-config="{ reserve: true, strict: true }" class="mytable-scrollbar" height="100%" v-bind="gridOptions" @checkbox-change="handleCheckboxChange" > <!-- @toolbar-button-click="toolbarButtonClickEvent"--> @@ -847,6 +837,11 @@ </template> <style scoped> * { margin: 0; padding: 0; } .common-layout { height: 100%; } @@ -867,4 +862,5 @@ } </style> north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
@@ -202,12 +202,12 @@ isChecked: true }, editConfig: { trigger: 'click', trigger: 'dblclick', mode: 'row', showStatus: true }, menuConfig: { /*body: { body: { //右键菜单 options: [ [ @@ -234,7 +234,7 @@ }, ] ] }*/ } }, //表头参数 columns: [ @@ -519,6 +519,7 @@ showStatus: true },//表头参数 columns: [ {type: 'checkbox', fixed: "left", title: t('basicData.check'),width: 78}, {type: 'seq',fixed:"left", title: t('basicData.Number'), width: 80 }, // { // field: 'order_number', @@ -634,9 +635,10 @@ break } case 'removeRow': { let result = toolbarButtonClickEvent() if(result){ $grid.remove(result.row) const $grid = brokenGrid.value const checkedList = $grid.getCheckboxRecords() if(checkedList){ $grid.remove(checkedList) } break } @@ -645,7 +647,7 @@ } } const openedBrokenTable = () => { addListener(brokenGrid.value,brokenGridOptions) //addListener(brokenGrid.value,brokenGridOptions) let damage =ref(brokenRow.value.damageDetails) brokenGrid.value.reloadData(damage.value) } @@ -1120,7 +1122,7 @@ } onMounted(() => { window.addEventListener('keypress', qrcodeScanner); //addListener(xGrid.value, gridOptions) addListener(xGrid.value, gridOptions) }) // 在组件卸载时移除键盘事件监听 north-glass-erp/northglass-erp/src/views/pp/rework/Rework.vue
@@ -25,7 +25,7 @@ <el-breadcrumb :separator-icon="ArrowRight"> <el-breadcrumb-item @click="changeRouter(1)" :class="indexFlag===1?'indexTag':''" :to="{ path: '/main/rework/SelectRework' }">{{$t('rework.reworkManagement')}}</el-breadcrumb-item> <el-breadcrumb-item @click="changeRouter(2)" :class="indexFlag===2?'indexTag':''" :to="{ path: '/main/rework/AddRework' }">{{$t('rework.addRework')}}</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: '/main/processCard/SelectPrintFlowCard' }" style="display: none">{{$t('rework.printRework')}}</el-breadcrumb-item> <!-- <el-breadcrumb-item @click="changeRouter(3)" :class="indexFlag===3?'indexTag':''" :to="{ path: '/main/processCard/SelectPrintFlowCard' }" >{{$t('rework.printRework')}}</el-breadcrumb-item>--> <el-breadcrumb-item v-show="false" :to="{ path: '/main/order/orderReport' }">{{$t('productStock.reportForms')}}</el-breadcrumb-item> </el-breadcrumb> </div> north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java
@@ -113,4 +113,6 @@ Boolean printOrderSortMp(String processId, Integer orderNumber, Integer technologyNumber, Integer sort); List<Map<String, String>> getPrimaryListMerge(String processId, String technologyNumber); List<Map<String, String>> selectorderOtherMoney(); } north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
@@ -101,6 +101,7 @@ public Map<String, Object> selectNoCardSv(String orderId, String productionId, FlowCard flowCard) { Map<String, Object> map = new HashMap<>(); map.put("data", flowCardMapper.selectNoCardMp(orderId, productionId, flowCard)); map.put("orderOtherMoney", flowCardMapper.selectorderOtherMoney()); return map; } north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -246,11 +246,31 @@ od.compute_gross_area as 'computeGrossArea', p.total_thickness AS 'totalThickness', p.thickness, od.weight od.weight, od.weight, ods.S01, ods.S02, ods.S03, ods.S04, ods.S05 from sd.order_detail as od left join sd.order_glass_detail as ogd on od.order_id = ogd.order_id and od.order_number = ogd.order_number left join sd.product as p on od.product_name = p.product_name left join ( SELECT order_id, order_number, JSON_UNQUOTE( JSON_EXTRACT( other_columns, '$.S01' )) AS S01, JSON_UNQUOTE( JSON_EXTRACT( other_columns, '$.S02' )) AS S02, JSON_UNQUOTE( JSON_EXTRACT( other_columns, '$.S03' )) AS S03, JSON_UNQUOTE( JSON_EXTRACT( other_columns, '$.S04' )) AS S04, JSON_UNQUOTE( JSON_EXTRACT( other_columns, '$.S05' )) AS S05 FROM sd.order_detail WHERE order_id = #{orderId} ) as ods on ods.order_id=od.order_id and ods.order_number=od.order_number where od.order_id = #{orderId} and ogd.production_id = #{productionId} and ogd.splitting_status = 0 @@ -875,4 +895,8 @@ and position(fc.technology_number in #{technologyNumber}) and ogdc.concatenated_glass_child is NOT null group by fc.process_id, fc.technology_number </select> <select id="selectorderOtherMoney"> select * from sd.basic_other_money where (id=21 or id>31) </select> </mapper>