From 768e16999a8ce4bb500490ee76c659aa61ea1783 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期二, 25 三月 2025 10:08:13 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override
---
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ProjectDetail.vue | 332 +++++++++++++++++++++++++++++++++++++------------------
1 files changed, 222 insertions(+), 110 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ProjectDetail.vue b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ProjectDetail.vue
index 39c30f8..97cb04b 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ProjectDetail.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ProjectDetail.vue
@@ -1,5 +1,5 @@
<script setup>
-import {nextTick, onMounted, reactive, ref} from "vue";
+import {nextTick, onMounted, reactive, ref, watch,onBeforeUnmount } from "vue";
import {useI18n} from "vue-i18n";
import {Folder, Plus, Setting, Operation,} from "@element-plus/icons-vue";
import OptimizeCompute from "@/views/pp/glassOptimize/page/OptimizeCompute.vue";
@@ -43,14 +43,18 @@
},
columns: [
+ {type: 'seq', fixed: "left", title: ' ', slots: {content: 'content'}, width: 50},
{field: 'order_number', title: '璁㈠簭', width: 70},
- {field: 'child_width', width: 100, title: t('order.width'), filters: [{data: ''}], slots: {filter: 'num2_filter'}},
+ {field: 'child_width',
+ width: 100,
+ title: t('order.width'),
+ sortable: true
+ },
{
field: 'child_height',
width: 100,
title: t('order.height'),
- filters: [{data: ''}],
- slots: {filter: 'num2_filter'}
+ sortable: true
},
{
field: 'quantity',
@@ -112,6 +116,14 @@
field: 'product_name',
width: 150,
title: t('order.product'),
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ sortable: true
+ },
+ {
+ field: 'price',
+ width: 150,
+ title: t('鍗曚环'),
filters: [{data: ''}],
slots: {filter: 'num1_filter'},
sortable: true
@@ -183,6 +195,15 @@
},
],//琛ㄥご鍙傛暟
data: null,//琛ㄦ牸鏁版嵁
+ toolbarConfig: {
+ buttons: [
+ ],
+ import: false,
+ // export: true,
+ // print: true,
+ zoom: true,
+ custom: true
+ },
//鍙抽敭鑿滃崟
menuConfig: {
body: {
@@ -193,22 +214,33 @@
{code: 'hideProcessCard', name: '闅愯棌娴佺▼鍗�',},
{code: 'setShape', name: '璁剧疆鍥惧舰',},
{code: 'Export', name: '鏁版嵁瀵煎嚭', prefixIcon: 'vxe-icon-download', visible: true, disabled: false},
- {code: '', name: '鍥惧舰鍙﹀瓨涓篋XF',},
- {code: '', name: '瀵煎嚭鏁版嵁鍒癘PTIMA',},
+ {code: 'safeDXF', name: '鍥惧舰鍙﹀瓨涓篋XF',},
+ {code: 'exportOPTIMA', name: '瀵煎嚭鏁版嵁鍒癘PTIMA',},
],
[]
]
},
},
+})
+const processCardColumns = reactive({
+ columns:[
+ {field: 'process_id', title: '娴佺▼鍗�', width: 200, align: 'center'},
+ {field: 'project', title: '椤圭洰鍚�', width: 150, align: 'center'},
+ {field: 'order_number', title: '璁㈠簭', width: 100, align: 'center'},
+ {field: 'sizes', title: '灏哄', width: 200, align: 'center'},
+ {field: 'layer', title: '灞�', width: 100, align: 'center'},
+ {field: 'quantity', title: '鏁伴噺', width: 100, align: 'center'}
+],
toolbarConfig: {
- buttons: [],
- slots: {
- buttons: "toolbar"
- },
+ buttons: [
+ ],
+ import: false,
+ // export: true,
+ // print: true,
},
+});
-})
// 鍙抽敭鑿滃崟
const operationConfigs = [
{
@@ -225,24 +257,55 @@
successMsg: '鎿嶄綔鎴愬姛锛�',
gridRef: xGrid,
requiresRow: false,
+ displayProcess: () => {
+ getProcessCard();
+ // 鏄剧ず娴佺▼鍗℃椂锛屽皢 left-table 瀹藉害鏀逛负 50%
+ leftTableWidth.value = 60;
+ showProcessCardTable.value = true;
+ }
},
{
code: 'hideProcessCard',
successMsg: '鎿嶄綔鎴愬姛锛�',
gridRef: xGrid,
requiresRow: false,
+ hideProcess: () => {
+ leftTableWidth.value = 100;
+ showProcessCardTable.value = false;
+ }
},
{
code: 'setShape',
successMsg: '鎿嶄綔鎴愬姛锛�',
gridRef: xGrid,
requiresRow: false,
+ showMessage: () => {
+ ElMessage.info('姝ゅ姛鑳芥殏鏈畬鍠勶紝鏆傛椂鏃犳硶鎵ц璁剧疆鍥惧舰鎿嶄綔銆�');
+ }
},
{
code: 'Export', // 瀵煎嚭鏂囦欢鎿嶄綔鐨勯厤缃�
successMsg: '鏂囦欢瀵煎嚭鎴愬姛锛�',
gridRef: xGrid,
requiresRow: false,
+ },
+ {
+ code: 'safeDXF',
+ successMsg: '鎿嶄綔鎴愬姛锛�',
+ gridRef: xGrid,
+ requiresRow: false,
+ showMessage: () => {
+ ElMessage.info('姝ゅ姛鑳芥殏鏈畬鍠勶紝鏆傛椂鏃犳硶鎵ц鍥惧舰鍙﹀瓨涓篋XF鎿嶄綔銆�');
+ }
+ },
+ {
+ code: 'exportOPTIMA',
+ successMsg: '鎿嶄綔鎴愬姛锛�',
+ gridRef: xGrid,
+ requiresRow: false,
+ showMessage: () => {
+ ElMessage.info('姝ゅ姛鑳芥殏鏈畬鍠勶紝鏆傛椂鏃犳硶鎵ц瀵煎嚭鏁版嵁鍒癘PTIMA鎿嶄綔銆�');
+ }
},
]
@@ -267,6 +330,14 @@
if (config.code === 'setAmount') {
config.openAmount();
ElMessage.success(config.successMsg);
+ } else if (config.code === 'displayProcessCard') {
+ config.displayProcess();
+ ElMessage.success(config.successMsg);
+ } else if (config.code === 'hideProcessCard') {
+ config.hideProcess();
+ ElMessage.success(config.successMsg);
+ } else if (['setShape', 'safeDXF', 'exportOPTIMA'].includes(config.code)) {
+ config.showMessage();
}
}).catch(() => {
// 鐢ㄦ埛鐐瑰嚮鍙栨秷鍚庢墽琛岀殑閫昏緫
@@ -288,15 +359,28 @@
const openDialog = (index) => {
dialogVisible.value[index] = true;
};
-
+//鍏抽棴寮圭獥
const closeDialog = (index) => {
dialogVisible.value[index] = false;
};
+
+//鍙抽敭鑿滃崟缁熶竴淇竟
+const props = defineProps({
+ TrimmingDialogVisible: Boolean
+});
+watch(() => props.TrimmingDialogVisible, (newValue) => {
+ if (newValue === true) {
+ dialogVisible.value[3] = newValue;
+ }
+});
const route = useRoute();
//宸ョ▼鍙�
const projectNo = ref(route.params.projectNo);
const projectName = ref('');
+onBeforeUnmount(() => {
+ localStorage.setItem('projectNo', projectNo.value);
+});
const fetchData = () => {
request.post(`/glassOptimize/projectInfo/${projectNo.value}`).then((res) => {
@@ -324,6 +408,23 @@
fetchData();
}
});
+
+// 娴佺▼鍗� 瀹藉害
+const leftTableWidth = ref(100);
+const showProcessCardTable = ref(false);
+// 鐢ㄤ簬瀛樺偍娴佺▼鍗℃暟鎹�
+const processCardData = ref(null);
+//娴佺▼鍗�
+const getProcessCard = () => {
+ request.post(`/glassOptimize/getProcessCard/${projectNo.value}`).then((res) => {
+ if (Number(res.code) === 200) {
+ processCardData.value = res.data.data;
+ } else {
+ ElMessage.warning(res.msg);
+ }
+ });
+};
+
// 浠庡瓙缁勪欢SetAmount鑾峰彇纾ㄩ噺鍊硷紝骞舵洿鏂拌〃鏍兼暟鎹�
const Amount = (amountData) => {
@@ -375,119 +476,130 @@
</script>
<template>
- <div style="width: 100%;height: 100%">
- <vxe-grid
- @filter-change="filterChanged"
- height="100%"
- class="mytable-scrollbar"
- ref="xGrid"
- v-bind="gridOptions"
- v-on="gridEvents"
- >
+ <div style="width: 100%;height: 85%;">
+ <!-- 澶撮儴 -->
+ <div id="header" >
+ <!--宸ョ▼鏂囦欢鑿滃崟-->
+ <el-dropdown @command="handleCommand">
+ <el-button type="primary" :icon="Folder" style="margin-top: 8px; margin-left: 5px">
+ 宸ョ▼鏂囦欢
+ </el-button>
+ <template #dropdown>
+ <el-dropdown-menu>
+ <el-dropdown-item :command="1" :icon="Plus">鍒涘缓宸ョ▼</el-dropdown-item>
+ <el-dropdown-item :command="2" :icon="Setting">宸ョ▼绠$悊</el-dropdown-item>
+ <el-dropdown-item :command="3" :icon="Operation">妯℃嫙璁$畻</el-dropdown-item>
+ </el-dropdown-menu>
+ </template>
+ </el-dropdown>
- <template #num2_filter="{ column, $panel }">
- <div>
- <div v-for="(option, index) in column.filters" :key="index">
- <vxe-select v-model="option.data" :placeholder="$t('processCard.pleaseSelect')"
- @change="changeFilterEvent($event, option, $panel)">
- <vxe-option value="0" :label="$t('basicData.unchecked')"></vxe-option>
- <vxe-option value="1" :label="$t('basicData.selected')"></vxe-option>
- </vxe-select>
+ <div id="title">
+ <span>宸ョ▼缂栧彿锛�</span>
+ <el-input readonly placeholder="" style="width: 150px" v-model="projectNo"></el-input>
+ <span>宸ョ▼鍚嶇О锛�</span>
+ <el-input readonly placeholder="" style="width: 150px; margin-right: 340px;" v-model="projectName" ></el-input>
+ <el-button id="checkinventory" type="primary" @click="openDialog(1)">鏌ヨ搴撳瓨</el-button>
+ <el-dialog v-model="dialogVisible[1]" title="鏌ヨ搴撳瓨" destroy-on-close style="width: 35%;height:35%;">
+ <check-inventory :closeDialog="closeDialog" @send-data-inventory="handleInventory"/>
+ </el-dialog>
+ <el-button id="button" type="primary" @click="openDialog(2)">璁剧疆纾ㄩ噺</el-button>
+ <el-dialog v-model="dialogVisible[2]" title="璁剧疆纾ㄩ噺锛坢m锛�" destroy-on-close
+ style="width: 35%;height:80%;margin-top: 3vh;">
+ <set-amount :closeDialog="closeDialog" @set-amount="Amount"/>
+ </el-dialog>
+ <el-button id="button" type="primary" @click="openDialog(3)">璁剧疆淇竟</el-button>
+ <el-dialog v-model="dialogVisible[3]" title="璁剧疆淇竟锛坢m锛�" destroy-on-close
+ style="width: 35%;height:80%;margin-top: 3vh;">
+ <set-trimming :closeDialog="closeDialog" @send-data-event="handleTrimmingData"/>
+ </el-dialog>
+ <el-button id="button" type="primary">淇濆瓨</el-button>
+ <el-button id="button" type="primary" @click="openDialog(4)">浼樺寲</el-button>
+ <el-dialog v-model="dialogVisible[4]" title="浼樺寲璁$畻" destroy-on-close
+ style="width: 75%;height:90%;margin-top: 3vh;">
+ <optimize-compute/>
+ </el-dialog>
+ </div>
+ </div>
+
+ <!-- 琛ㄦ牸瀹瑰櫒 -->
+ <div class="table-container">
+ <vxe-grid
+ class="left-table"
+ @filter-change="filterChanged"
+ height="100%"
+ ref="xGrid"
+ v-bind="gridOptions"
+ v-on="gridEvents"
+ v-bind:style="{ width: leftTableWidth + '%' }"
+ >
+ <template #num2_filter="{ column, $panel }">
+ <div>
+ <div v-for="(option, index) in column.filters" :key="index">
+ <vxe-select v-model="option.data" :placeholder="$t('processCard.pleaseSelect')"
+ @change="changeFilterEvent($event, option, $panel)">
+ <vxe-option value="0" :label="$t('basicData.unchecked')"></vxe-option>
+ <vxe-option value="1" :label="$t('basicData.selected')"></vxe-option>
+ </vxe-select>
+ </div>
</div>
- </div>
- </template>
-
- <template #num1_filter="{ column, $panel }">
- <div>
- <div v-for="(option, index) in column.filters" :key="index">
- <input
- type="type"
- v-model="option.data"
- @keyup.enter.native="$panel.confirmFilter()"
- @input="changeFilterEvent($event, option, $panel)"/>
+ </template>
+ <template #num1_filter="{ column, $panel }">
+ <div>
+ <div v-for="(option, index) in column.filters" :key="index">
+ <input
+ type="type"
+ v-model="option.data"
+ @keyup.enter.native="$panel.confirmFilter()"
+ @input="changeFilterEvent($event, option, $panel)"/>
+ </div>
</div>
- </div>
- </template>
+ </template>
+ </vxe-grid>
- <template #toolbar>
- <div id="header">
- <div id="title">
- <span>宸ョ▼缂栧彿锛�</span>
- <el-input disabled placeholder="" style="width: 150px" v-model="projectNo"></el-input>
- <span>宸ョ▼鍚嶇О锛�</span>
- <el-input disabled placeholder="" style="width: 150px; margin-right: 350px"
- v-model="projectName"></el-input>
- <el-button id="checkinventory" type="primary" @click="openDialog(1)">鏌ヨ搴撳瓨</el-button>
- <el-dialog
- v-model="dialogVisible[1]"
- title="鏌ヨ搴撳瓨"
- destroy-on-close
- style="width: 35%;height:35%;">
- <check-inventory :closeDialog="closeDialog" @send-data-inventory="handleInventory"/>
- </el-dialog>
+ <!-- 娴佺▼鍗¤〃鏍� -->
+ <vxe-grid
+ height="100%"
+ class="right-table"
+ :data="processCardData"
+ v-bind="processCardColumns"
+ v-if="showProcessCardTable"
+ :header-cell-style="{'height': '51.9px'}"
+ >
+ </vxe-grid>
- <el-button id="button" type="primary" @click="openDialog(2)">璁剧疆纾ㄩ噺</el-button>
- <el-dialog
- v-model="dialogVisible[2]"
- title="璁剧疆纾ㄩ噺"
- destroy-on-close
- style="width: 35%;height:80%;margin-top: 3vh;">
- <set-amount :closeDialog="closeDialog" @set-amount="Amount"/>
- </el-dialog>
-
- <el-button id="button" type="primary" @click="openDialog(3)">璁剧疆淇竟</el-button>
- <el-dialog
- v-model="dialogVisible[3]"
- title="璁剧疆淇竟"
- destroy-on-close
- style="width: 35%;height:80%;margin-top: 3vh;">
- <set-trimming :closeDialog="closeDialog" @send-data-event="handleTrimmingData"/>
- </el-dialog>
-
- <el-button id="button" type="primary">淇濆瓨</el-button>
-
- <el-button id="button" type="primary" @click="openDialog(4)">浼樺寲</el-button>
- <el-dialog
- v-model="dialogVisible[4]"
- title="浼樺寲璁$畻"
- destroy-on-close
- style="width: 75%;height:90%;margin-top: 3vh;"
- >
- <optimize-compute/>
- </el-dialog>
- </div>
- <!--宸ョ▼鏂囦欢鑿滃崟-->
- <el-dropdown @command="handleCommand">
- <el-button type="primary" :icon="Folder" style="margin-top: 8px">
- 宸ョ▼鏂囦欢
- </el-button>
- <template #dropdown>
- <el-dropdown-menu>
- <el-dropdown-item :command="1" :icon="Plus">鍒涘缓宸ョ▼</el-dropdown-item>
- <el-dropdown-item :command="2" :icon="Setting">宸ョ▼绠$悊</el-dropdown-item>
- <el-dropdown-item :command="3" :icon="Operation">妯℃嫙璁$畻</el-dropdown-item>
- <!-- <el-dropdown-item command="4">鏂囦欢瀵煎嚭</el-dropdown-item>
- <el-dropdown-item command="5">鏂囦欢瀵煎叆</el-dropdown-item>-->
- </el-dropdown-menu>
- </template>
- </el-dropdown>
- </div>
- </template>
- </vxe-grid>
-
+ </div>
</div>
</template>
<style scoped>
+.table-container {
+ width: 100%;
+ height: 100%;
+ flex: 1;
+ display: flex;
+}
+
+.left-table {
+ float: left;
+}
+
+.right-table {
+ width: 40%;
+}
+
+:deep(.vxe-toolbar){
+ height: 40px;
+}
#header {
height: 50px;
+ display: flex;
+
}
#title {
- position: absolute;
- right: 10px;
- margin-top: 8px;
+ margin: 8px 5px;
+ width: 1240px;
}
#button {
--
Gitblit v1.8.0