From 42bc535c947bcf999c706a753635d35ef73f91e6 Mon Sep 17 00:00:00 2001 From: 廖井涛 <2265517004@qq.com> Date: 星期一, 22 四月 2024 09:11:16 +0800 Subject: [PATCH] Merge branch 'master' of https://gitee.com/a1536384743/erp_-override --- north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue | 342 ++++++++++++++++++++++++++++++-------------------------- 1 files changed, 183 insertions(+), 159 deletions(-) diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue index 993c41f..5b09c92 100644 --- a/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue +++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue @@ -1,25 +1,70 @@ <script setup> -import {reactive} from "vue"; -import {useRouter} from 'vue-router' -let router=useRouter() -const getTableRow = (row,type) =>{ - switch (type) { - case 'edit' :{ - //alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑缂栬緫淇℃伅') - router.push({path: '/main/processCard/PrintFlowCard', query: { id: row.id }}) - break - } - case 'delete':{ - alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅') - break - } - case 'setType':{ - alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鎺掔増鐘舵��') - break - } - } +import request from "@/utils/request" +import deepClone from "@/utils/deepClone" +import {ElDatePicker, ElMessage} from "element-plus" +import {nextTick, onMounted, onUnmounted, reactive, ref, watch} from "vue" +import {useRouter} from 'vue-router' +import {useI18n} from 'vue-i18n' +import {changeFilterEvent, filterChanged} from "@/hook" +import {VXETable} from "vxe-table"; +import {toolbarButtonClickEvent} from "@/hook/mouseMove"; +import PrintProcess from '@/views/pp/processCard/PrintProcess.vue' +//璇█鑾峰彇 +const {t} = useI18n() +let router = useRouter() +const dialogTableVisible = ref(false) +let selectRecords = ref(null) + +//瀹氫箟婊氬姩鏉¢珮搴� +let scrollTop = ref(null) +let scrollHeight = ref(null) +let clientHeight = ref(null) +const scrollEvnt = (row) => { + // 鍐呭楂樺害 + scrollTop.value = row.$event.target.scrollTop + scrollHeight.value = row.$event.target.scrollHeight + clientHeight.value = row.$event.target.clientHeight } + +//绛涢�夋潯浠讹紝鏈夊閿渶瑕佸厛瀹氫箟鏄庣粏閲岄潰鐨勬暟鎹� +let filterData = ref({ + + orderGlassDetail: { + productionId: '', + }, + orderDetail: { + orderId: '', + productId: '', + productName: '', + } + + +}) +//瀹氫箟椤甸潰鎬婚〉鏁� +let pageTotal = ref('') +//瀹氫箟鏁版嵁杩斿洖缁撴灉 +let produceList = ref([]) +//瀹氫箟褰撳墠椤垫暟 +let pageNum = $ref(1) +let pageState = null + +const {currentRoute} = useRouter() +const route = currentRoute.value + +let orderId = route.query.orderId + +// 绗竴娆″姞杞芥煡璇� +request.post(`/processCard/selectPrint/${orderId}`, filterData.value).then((res) => { + + if (res.code == 200) { + produceList = produceList.value.concat(deepClone(res.data.data)) + xGrid.value.reloadData(produceList) + gridOptions.loading = false + } else { + ElMessage.warning(res.msg) + } +}) //琛ㄥ熬姹傚拰 const sumNum = (list, field) => { @@ -30,27 +75,35 @@ return count.toFixed(2) } -//瀛愮粍浠舵帴鏀跺弬鏁� +const hasDecimal = (value) => { + const regex = /\./; // 瀹氫箟姝e垯琛ㄨ揪寮忥紝鏌ユ壘灏忔暟鐐� + return regex.test(value); // 杩斿洖true/false +} + +//瀛愮粍浠舵帴鏀跺弬鏁� +const xGrid = ref() const gridOptions = reactive({ - border: "full",//琛ㄦ牸鍔犺竟妗� + loading: true, + border: "full",//琛ㄦ牸鍔犺竟妗� keepSource: true,//淇濇寔婧愭暟鎹� align: 'center',//鏂囧瓧灞呬腑 - stripe:true,//鏂戦┈绾� - rowConfig: {isCurrent: true, isHover: true,height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒 - id: 'CustomerList', + stripe: true,//鏂戦┈绾� + rowConfig: {isCurrent: true, isHover: true, height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒 + id: 'demo_1', showFooter: true,//鏄剧ず鑴� printConfig: {}, importConfig: {}, exportConfig: {}, - scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔� - showOverflow:true, + scrollX: {enabled: true}, + scrollY: {enabled: true, gt: 0},//寮�鍚櫄鎷熸粴鍔� + showOverflow: true, columnConfig: { resizable: true, useKey: true }, filterConfig: { //绛涢�夐厤缃」 - remote: true + // remote: true }, customConfig: { storage: true @@ -60,128 +113,67 @@ mode: 'row', showStatus: true },//琛ㄥご鍙傛暟 - columns:[ - {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, - { type: 'seq',fixed:"left", title: '鑷簭', width: 50 }, - {field: '閿�鍞崟鍙�',width: 120, title: '閿�鍞崟鍙�',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, - {field: '鐢熶骇璁㈠崟鍙�',width: 140, title: '鐢熶骇璁㈠崟鍙�', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, - {field: '娴佺▼鍗″彿',width: 120, title: '娴佺▼鍗″彿', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, - {field: '瀹㈡埛鍚嶇О',width: 120, title: '瀹㈡埛鍚嶇О', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, - {field: '椤圭洰鍚嶇О',width: 120, title: '椤圭洰鍚嶇О',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, - {field: '鐗囨爣璁�',width: 90, title: '鐗囨爣璁�', sortable: true,showOverflow:"ellipsis"}, - {field: '鏍囪',width: 80, title: '鏍囪', sortable: true}, - {field: '鐗囨暟',width: 80, title: '鐗囨暟', sortable: true}, - {field: '闈㈢Н',width: 80, title: '闈㈢Н', sortable: true,showOverflow:"ellipsis"}, - {field: '浜у搧鍚嶇О',width: 120, title: '浜у搧鍚嶇О', sortable: true}, - {field: '鍗曠墖鍚嶇О',width: 120, title: '鍗曠墖鍚嶇О', sortable: true}, - {field: '妤煎眰缂栧彿',width: 120, title: '妤煎眰缂栧彿', sortable: true}, - {field: '鍒嗘灦鍛�', width: 120,title: '鍒嗘灦鍛�', sortable: true}, - {field: '鍒嗘灦鏃堕棿',width: 120, title: '鍒嗘灦鏃堕棿', sortable: true}, - {field: '澶囨敞',width: 120, title: '澶囨敞', sortable: true} + columns: [ + {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50}, + {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80}, + {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50}, + { + field: 'order_id', + title: t('order.orderId'), + filters: [{data: ''}], + slots: {filter: 'num1_filter'}, + filterMethod: filterChanged + }, + { + field: 'process_id', + title: '娴佺▼鍗″彿', + showOverflow: "ellipsis", + filters: [{data: ''}], + slots: {filter: 'num1_filter'}, + filterMethod: filterChanged + }, + { + field: 'customer_name', + title: '瀹㈡埛鍚嶇О', + filters: [{data: ''}], + slots: {filter: 'num1_filter'}, + filterMethod: filterChanged + }, + { + field: 'project', + title: '椤圭洰鍚嶇О', + filters: [{data: ''}], + slots: {filter: 'num1_filter'}, + filterMethod: filterChanged + }, + {field: 'technology_number', title: '灏忕墖椤哄簭', showOverflow: "ellipsis"}, + {field: 'glass_address', title: '灏忕墖鏍囪',}, + {field: 'quantity', title: '鏁伴噺',}, + {field: 'total_area', title: '闈㈢Н',}, + {field: 'product_name', title: '浜у搧鍚嶇О',}, + {field: 'glass_child', title: '鍗曠墖鍚嶇О',}, + {field: 'founder', title: '鍒嗘灦鍛�',}, + {field: 'splitFrame_time', title: '鍒嗘灦鏃堕棿',}, ],//琛ㄥご鎸夐挳 toolbarConfig: { buttons: [ - { - name:'瀹ゅ唴闈�', - dropdowns: [ - { code: 'other1', name: '瀹ゅ唴闈�', type: 'text', }, - { code: 'other2', name: '瀹ゅ闈�', type: 'text', }, - ] - }, - { - name:'鎴愬搧鏍囩', - dropdowns: [ - { code: 'other1', name: '鎴愬搧鏍囩', type: 'text', }, - { code: 'other2', name: '鍗曠墖鏍囩', type: 'text',}, - ] - }, - {code: 'print_lck', name: '鎵撳嵃娴佺▼鍗�',status:'primary' }, - {code: 'print_bq', name: '鎵撳嵃鏍囩',status:'primary' } + {code: 'print', name: '鎵撳嵃', status: 'primary'}, ], // import: false, // export: true, - // print: true, + //print: true, zoom: true, custom: true }, - data: [ - { - 閿�鍞崟鍙�: 'NG231201', - 鐢熶骇璁㈠崟鍙�:'NG231201A', - 娴佺▼鍗″彿: 'NG231201A01', - 瀹㈡埛鍚嶇О:'瑗垮畨楂樼骞曞闂ㄧ獥鏈夐檺鍏徃', - 椤圭洰鍚嶇О:'閾堕殕骞垮満', - 鐗囨爣璁�:'(澶�)', - 鏍囪:'1', - 鐗囨暟:'16', - 闈㈢Н:'24.14', - 浜у搧鍚嶇О: '10mm瓒呯櫧UD60骞抽挗(澶�)+12Ar(缁�)+10mm瓒呯櫧骞抽挗(鍐�)', - 鍗曠墖鍚嶇О: '10mm瓒呯櫧UD60骞抽挗(澶�)', - 妤煎眰缂栧彿: '16-BSGB05', - 鍒嗘灦鍛�: '寮犱笁', - 鍒嗘灦鏃堕棿: '2023-01-11', - 澶囨敞: '', - }, - { - 閿�鍞崟鍙�: 'NG231201', - 鐢熶骇璁㈠崟鍙�:'NG231201A', - 娴佺▼鍗″彿: 'NG231201A01', - 瀹㈡埛鍚嶇О:'瑗垮畨楂樼骞曞闂ㄧ獥鏈夐檺鍏徃', - 椤圭洰鍚嶇О:'閾堕殕骞垮満', - 鐗囨爣璁�:'(澶�)', - 鏍囪:'1', - 鐗囨暟:'16', - 闈㈢Н:'24.14', - 浜у搧鍚嶇О: '10mm瓒呯櫧UD60骞抽挗(澶�)+12Ar(缁�)+10mm瓒呯櫧骞抽挗(鍐�)', - 鍗曠墖鍚嶇О: '10mm瓒呯櫧UD60骞抽挗(澶�)', - 妤煎眰缂栧彿: '16-BSGB05', - 鍒嗘灦鍛�: '寮犱笁', - 鍒嗘灦鏃堕棿: '2023-01-11', - 澶囨敞: '', - }, - { - 閿�鍞崟鍙�: 'NG231201', - 鐢熶骇璁㈠崟鍙�:'NG231201A', - 娴佺▼鍗″彿: 'NG231201A01', - 瀹㈡埛鍚嶇О:'瑗垮畨楂樼骞曞闂ㄧ獥鏈夐檺鍏徃', - 椤圭洰鍚嶇О:'閾堕殕骞垮満', - 鐗囨爣璁�:'(澶�)', - 鏍囪:'1', - 鐗囨暟:'16', - 闈㈢Н:'24.14', - 浜у搧鍚嶇О: '10mm瓒呯櫧UD60骞抽挗(澶�)+12Ar(缁�)+10mm瓒呯櫧骞抽挗(鍐�)', - 鍗曠墖鍚嶇О: '10mm瓒呯櫧UD60骞抽挗(澶�)', - 妤煎眰缂栧彿: '16-BSGB05', - 鍒嗘灦鍛�: '寮犱笁', - 鍒嗘灦鏃堕棿: '2023-01-11', - 澶囨敞: '', - }, - { - 閿�鍞崟鍙�: 'NG231201', - 鐢熶骇璁㈠崟鍙�:'NG231201A', - 娴佺▼鍗″彿: 'NG231201A01', - 瀹㈡埛鍚嶇О:'瑗垮畨楂樼骞曞闂ㄧ獥鏈夐檺鍏徃', - 椤圭洰鍚嶇О:'閾堕殕骞垮満', - 鐗囨爣璁�:'(澶�)', - 鏍囪:'1', - 鐗囨暟:'16', - 闈㈢Н:'24.14', - 浜у搧鍚嶇О: '10mm瓒呯櫧UD60骞抽挗(澶�)+12Ar(缁�)+10mm瓒呯櫧骞抽挗(鍐�)', - 鍗曠墖鍚嶇О: '10mm瓒呯櫧UD60骞抽挗(澶�)', - 妤煎眰缂栧彿: '16-BSGB05', - 鍒嗘灦鍛�: '寮犱笁', - 鍒嗘灦鏃堕棿: '2023-01-11', - 澶囨敞: '', - }, - ],//table body瀹為檯鏁版嵁 + data: null,//琛ㄦ牸鏁版嵁 //鑴氶儴姹傚拰 - footerMethod ({ columns, data }) {//椤佃剼鍑芥暟 - let footList=['鐗囨暟','闈㈢Н'] - return[ + footerMethod({columns, data}) {//椤佃剼鍑芥暟 + let footList = ['data.orderDetail.quantity', 'data.orderDetail.computeGrossArea'] + return [ columns.map((column, columnIndex) => { if (columnIndex === 0) { - return '鍚堣:' + return t('basicData.total') } if (footList.includes(column.field)) { return sumNum(data, column.field) @@ -190,67 +182,99 @@ }) ] } - }) +const gridEvents = { + toolbarButtonClick ({ code}) { + const $grid = xGrid.value + selectRecords = $grid.getCheckboxRecords() + if ($grid) { + switch (code) { + case 'print': { + if(selectRecords.value===null){ + 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/printProcess', query: {printList: JSON.stringify(selectRecords)}}) + //dialogTableVisible.value = true + break + } + + } + } + }, +} </script> <template> <div class="main-div-customer"> - <vxe-grid - max-height="100%" - @filter-change="filterChanged" - class="mytable-scrollbar" ref="xGrid" + class="mytable-scrollbar" + height="600px" + max-height="100%" v-bind="gridOptions" + v-on="gridEvents" + > <!-- @toolbar-button-click="toolbarButtonClickEvent"--> <!-- 涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�--> - <template #content="{ row}"> + <template #content="{ row }"> <ul class="expand-wrapper"> - <li v-for="(item,key,index) in row"> - <span style="font-weight: bold">{{key+': '}}</span> - <span>{{ item }}</span> + <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> + <span style="font-weight: bold">{{ item.title + ': ' }}</span> + <span v-if="hasDecimal(item.field)">{{ row[item.field.split('.')[0]][item.field.split('.')[1]] }}</span> + <span v-else>{{ row[item.field] }}</span> + </li> </ul> </template> <!--宸﹁竟鍥哄畾鏄剧ず鐨勬彃妲�--> <template #button_slot="{ row }"> - <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">鎵撳嵃</el-button> - <el-button @click="getTableRow(row,'setType')" link type="primary" size="small">鎺掔増</el-button> - <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">鍒犻櫎</el-button> + <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 type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/> + <input type="text" + v-model="option.data" + @input="changeFilterEvent($event, option, $panel)"/> </div> </div> </template> </vxe-grid> + <el-dialog + v-model="dialogTableVisible" + destroy-on-close + title="娴佺▼鍗℃墦鍗�" + style="width: 80%;height:75% "> + <PrintProcess :printList="selectRecords" + style="width: 100%;height: 100%" /> + </el-dialog> </div> </template> <style scoped> -.main-div-customer{ +.main-div-customer { width: 99%; height: 100%; -} - -.stnw{ - height: 33px; - width: 80px; - background-color: #409eff; - color: white; - border: none; - border-radius: 5px; } </style> \ No newline at end of file -- Gitblit v1.8.0