From f7a2fcdda7f1120498c5c5f75c5a99955fc54b43 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期二, 16 十二月 2025 16:54:09 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/ERP_override
---
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ComputeCard.vue | 226 +++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 181 insertions(+), 45 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ComputeCard.vue b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ComputeCard.vue
index 495a968..f2aa11a 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ComputeCard.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ComputeCard.vue
@@ -1,9 +1,23 @@
<script setup>
-import {reactive, ref} from "vue";
+import {nextTick, onMounted, reactive, ref, watch} from "vue";
+import request from "@/utils/request";
import {useI18n} from "vue-i18n";
+import {ElMessage} from "element-plus";
+import deepClone from "@/utils/deepClone";
+import {addListener, toolbarButtonClickEvent} from "@/hook/mouseMove";
const { t } = useI18n()
const xGrid = ref()
+
+const checkboxCellRender = reactive({
+ name: 'VxeCheckboxGroup',
+ options: [
+ { label: '骞曞妯″紡', value: '1' },
+ { label: '鍏佽妯帓', value: '2' },
+ { label: '閽㈠寲', value: '3' },
+
+ ]
+})
const gridOptions = reactive({
@@ -14,10 +28,20 @@
align: 'center',//鏂囧瓧灞呬腑
stripe:true,//鏂戦┈绾�
rowConfig: {isCurrent: true, isHover: true,height: 30, useKey: true},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
- id: 'ProcessCard',
+ id: 'ComputeCard',
scrollX:{enabled: true},
scrollY:{ enabled: true ,gt:0},//寮�鍚櫄鎷熸粴鍔�
showOverflow:true,
+ menuConfig: {
+ body: {
+ options: [
+ [
+ { code: 'copyChecked', name: t('basicData.selectSame'), prefixIcon: 'vxe-icon-copy', visible: true, disabled: false },
+ { code: 'copyAll', name: t('basicData.sameAfterwards'), prefixIcon: 'vxe-icon-feedback', visible: true, disabled: false },
+ ]
+ ]
+ }
+ },
columnConfig: {
resizable: true,
useKey: true
@@ -33,61 +57,150 @@
mode: 'row',
showStatus: true
},
- /*formConfig: {
- data: {
- width: '',
- height: '',
- quantity: ''
- },
- items: [
- { field: 'width', title: t('order.width')+':', itemRender: { name: 'VxeInput' } },
- { field: 'height', title: t('order.height')+':', itemRender: { name: 'VxeInput' } },
- { field: 'quantity', title: t('order.quantity')+':', itemRender: { name: 'VxeInput' } },
- {
- itemRender: {
- name: 'VxeButtonGroup',
- options: [
- { type: 'submit', content: t('craft.sure'), status: 'primary' },
- { type: 'reset', content: t('product.msg.reset') }
- ]
- }
- }
- ]
- },*/
+
columns:[
- {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
- {field: 'checkbox', title: '鍏佽妯帓', width: 100},
- {field: 'checkbox', title: '閽㈠寲', width: 70},
- {field: 'processId',width: 150, title: t('processCard.processId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
- {field: 'id',width: 70, title: '灞�',filters:[{ data: '' }], slots: { default: 'state',filter: 'num2_filter' }},
- {field: 'id',width: 150, title: '鎬诲眰鏁�',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
- {field: 'id',width: 100, title: '瑙勬牸',filters:[{ data: '' }], slots: { default: 'state',filter: 'num2_filter' }},
- {field: 'quantity',width: 150, title: t('order.quantity'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
- {field: 'orderDetail.productName',width: 150, title: t('order.product'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
- {field: 'orderDetail.computeGrossArea',width: 150, title: t('order.area'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
- {field: '',width: 70, title: 'merge'}
+ {type: 'seq', title: t('basicData.Number'), width: 80},
+ {field: 'curtain_wall',title: '骞曞妯″紡',width: 80, slots: { default: 'state1' }},
+ {field: "allow_rotate", title: '鍏佽妯帓', width: 80, slots: { default: 'state2' }},
+ {field: "tempering", title: '閽㈠寲', width: 80, slots: { default: 'state3' }},
+
+ {field: 'processId',width: 150, title: t('processCard.processId'), sortable: true},
+ {field: 'technologyNumber',width: 70, title: '灞�', sortable: true},
+ {field: 'total_layers',width: 150, title: '鎬诲眰鏁�', sortable: true},
+ {field: 'TotalNumber',width: 150, title: '瑙勬牸', sortable: true},
+ {field: 'total_num',width: 150, title: t('order.quantity'), sortable: true},
+ {field: 'glass_child',width: 150, title: t('order.product'), sortable: true},
+ {field: 'project', width:150, title: t('order.project'), showOverflow: "ellipsis"},
+ {field: 'total_area',width: 150, title: t('order.area'), sortable: true},
+
],//琛ㄥご鍙傛暟
data:null,//琛ㄦ牸鏁版嵁
toolbarConfig: {
buttons: [],
- slots:{
- buttons: "toolbar_buttons"
- },
+ zoom: true,
+ custom: true
},
})
-let emit = defineEmits([
- 'changeDialog'
-])
-let Membrane = ref('閫夋嫨鑶滅郴')
-const changeOrderType = async ()=>{
- await emit('changeDialog',Membrane.value)
- Membrane.value = null
+let emit = defineEmits([
+ 'changeDialog','upProcessId', 'sendData'
+]);
+
+
+const selectFullData = () => {
+ return xGrid.value.getTableData().fullData
}
+
+const props = defineProps({
+ tableData: Array,
+ processId: null,
+ technologyNumber: null,
+ patchState: null,
+ glassThickness: String, // 娣诲姞鐜荤拑鍘氬害灞炴��
+ glassType: String // 娣诲姞鐜荤拑绫诲瀷灞炴��
+});
+
+
+
+
+watch(() => props.tableData, async (newData) => {
+ if (Array.isArray(newData)) {
+ addListener(xGrid.value,gridOptions)
+ console.log(newData)
+ xGrid.value.loadData(deepClone(newData))
+ const data = xGrid.value.getTableData().fullData
+ data.forEach(item => {
+ item.tempering = item.tempering === 1;
+ item.allow_rotate = item.allow_rotate === 1;
+ item.curtain_wall = item.curtain_wall === 1;
+ })
+ }
+});
+
+
+
+
+let process_id = ref()
+//鑾峰彇娴佺▼鍗″彿璇︽儏
+let rowClickIndex = ref(null)
+const gridEvents = {
+ cellClick({row}) {
+ rowClickIndex.value = row
+ // Emit 浜嬩欢灏嗘洿鏂板悗鐨勫�间紶閫掔粰鐖剁粍浠�
+ emit('upProcessId', rowClickIndex.value.processId,rowClickIndex.value.patch_state,rowClickIndex.value.technologyNumber);
+ emit('updateTechnologyNumber', rowClickIndex.value.processId,rowClickIndex.value.patch_state,rowClickIndex.value.technologyNumber);
+ },
+ menuClick ({ menu, row, column }) {
+ const $grid = xGrid.value
+ if ($grid) {
+ switch (menu.code) {
+
+ case 'copyChecked' :{
+ let result = toolbarButtonClickEvent()
+ if(result){
+ const dataList = xGrid.value.getTableData().visibleData
+ let firstVal=null;
+ if(result.cell.indexOf('.')>-1){
+ firstVal = eval("dataList["+result.start +"]."+result.cell)
+ }else {
+ firstVal=dataList[result.start][result.cell];
+ }
+ dataList.forEach((item,index) =>{
+ if(index>=result.start && index<=result.end){
+ //鍙栨秷閫変腑
+ if(parseInt(firstVal)<=0){
+ xGrid.value.setCheckboxRow(item, false);
+ }
+ if(result.cell.indexOf('.')>-1){
+ const columnArr = result.cell.split('.')
+ item[columnArr[0]][columnArr[1]] = firstVal
+ }else{
+ item[result.cell] = firstVal
+ }
+
+ }
+ })
+ }
+ break
+ }
+ case 'copyAll' :{
+ let result = toolbarButtonClickEvent()
+ if(result){
+ const dataList = xGrid.value.getTableData().visibleData
+ let firstVal=null;
+ if(result.cell.indexOf('.')>-1){
+ firstVal = eval("dataList["+result.start +"]."+result.cell)
+ }else {
+ firstVal=dataList[result.start][result.cell];
+ }
+ dataList.forEach((item,index) =>{
+ if(index>=result.start){
+ //鍙栨秷閫変腑
+ if(parseInt(firstVal)<=0){
+ xGrid.value.setCheckboxRow(item, false);
+ }
+ if(result.cell.indexOf('.')>-1){
+ const columnArr = result.cell.split('.')
+ item[columnArr[0]][columnArr[1]] = firstVal
+ }else{
+ item[result.cell] = firstVal
+ }
+
+ }
+ })
+ }
+ break
+ }
+ }
+ }
+ }
+}
+
+defineExpose({selectFullData})
</script>
<template>
@@ -95,7 +208,6 @@
<span>娴佺▼鍗�</span>
<vxe-grid
size="small"
- @filter-change="filterChanged"
height="100%"
class="mytable-scrollbar"
ref="xGrid"
@@ -125,10 +237,34 @@
</div>
</div>
</template>
+
+ <template #state1="{ row,column}">
+ <el-checkbox
+ v-model="row.curtain_wall"/>
+ </template>
+ <template #state2="{ row,column}">
+ <el-checkbox
+ v-model="row.allow_rotate"/>
+ </template>
+ <template #state3="{ row,column}">
+ <el-checkbox
+ v-model="row.tempering"/>
+ </template>
</vxe-grid>
</div>
</template>
<style scoped>
+:deep(.vxe-tools--operate){
+ height: 20px;
+ margin-top: -20px;
+}
+.vxe-grid {
+ /* 绂佺敤娴忚鍣ㄩ粯璁ら�変腑 */
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
</style>
\ No newline at end of file
--
Gitblit v1.8.0