From 1dfc2a03837375e220b1afd00f352aa82273d223 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期四, 05 十二月 2024 16:39:03 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override
---
north-glass-erp/northglass-erp/src/router/index.js | 5
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/GlassComputed.vue | 6
north-glass-erp/src/main/resources/mapper/pp/GlassOptimize.xml | 3
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/OptimizeProject.vue | 12 +
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/ProjectMange.vue | 311 +++++++++++++++++++++++--------------------
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/Compute.vue | 6
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ProjectDetail.vue | 74 ++++------
7 files changed, 225 insertions(+), 192 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/router/index.js b/north-glass-erp/northglass-erp/src/router/index.js
index 6831dfd..6aed531 100644
--- a/north-glass-erp/northglass-erp/src/router/index.js
+++ b/north-glass-erp/northglass-erp/src/router/index.js
@@ -337,6 +337,11 @@
component: () => import('../views/pp/glassOptimize/OptimizePrint.vue'),
},
{
+ path: '/projectDetail/:projectNo',
+ name: 'projectDetail',
+ component: () => import('../views/pp/glassOptimize/OptimizeProject.vue'),
+ },
+ {
path: '',
redirect:'/main/glassOptimize/optimizeProject'
}
diff --git a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/GlassComputed.vue b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/GlassComputed.vue
index 09b91f8..73f5a31 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/GlassComputed.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/GlassComputed.vue
@@ -45,13 +45,17 @@
return [];
};
+const props = defineProps({
+ projectNo : String
+});
+
</script>
<template>
<div style="width: 100%; height: 100%;">
<div id="compute">
- <compute @fetch-data="handleFetchData" />
+ <compute @fetch-data="handleFetchData" :project-no="props.projectNo"/>
</div>
<div id="computeCard">
diff --git a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/OptimizeProject.vue b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/OptimizeProject.vue
index 04d1c20..31ef343 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/OptimizeProject.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/OptimizeProject.vue
@@ -12,6 +12,14 @@
dialogVisible.value = true
detailPage.value = value
}
+
+//浠庡伐绋嬬鐞嗚幏鍙栧伐绋嬪彿锛屽苟璺宠浆
+const projectNumber = ref('');
+const switchDialog = (number) => {
+ projectNumber.value = number;
+ detailPage.value = 3;
+};
+
</script>
<template >
@@ -32,8 +40,8 @@
z-index="100"
>
<project-create v-if="detailPage===1" />
- <project-mange v-if="detailPage===2" />
- <glass-computed v-if="detailPage===3" />
+ <project-mange v-if="detailPage===2" @switch-dialog="switchDialog"/>
+ <glass-computed v-if="detailPage===3" :project-no="projectNumber"/>
</el-dialog>
</div>
diff --git a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/ProjectMange.vue b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/ProjectMange.vue
index 8321845..8eefd9f 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/ProjectMange.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/ProjectMange.vue
@@ -8,12 +8,16 @@
import useOrderInfoStore from "@/stores/sd/order/orderInfo";
import useUserInfoStore from "@/stores/userInfo";
import userInfo from "@/stores/userInfo";
-import GlassComputed from "@/views/pp/glassOptimize/GlassComputed.vue";
+import {useRouter} from 'vue-router';
+import {defineEmits} from 'vue';
+
const {t} = useI18n()
const userStore = useUserInfoStore()
const user = userInfo()
const orderInfo = useOrderInfoStore()
+
+const router = useRouter();
const xGrid = ref()
const gridOptions = reactive({
@@ -75,16 +79,16 @@
body: {
options: [
[
- {code: 'openproject', name: '鎵撳紑宸ョ▼', prefixIcon: 'vxe-icon-folder-open'},
+ {code: 'openProject', name: '鎵撳紑宸ョ▼', prefixIcon: 'vxe-icon-folder-open'},
{code: 'compute', name: '妯℃嫙璁$畻', prefixIcon: 'vxe-icon-subtable'},
- {code: 'optimizetypography', name: '浼樺寲鎺掔増', prefixIcon: 'vxe-icon-menu'},
+ {code: 'optimizetyPography', name: '浼樺寲鎺掔増', prefixIcon: 'vxe-icon-menu'},
{code: 'production', name: '鍏佽鐢熶骇', prefixIcon: 'vxe-icon-square-checked'},
{code: 'novisible', name: '鐢熶骇涓嶅彲瑙�', prefixIcon: 'vxe-icon-eye-fill-close'},
{code: 'copyproject', name: '澶嶅埢宸ョ▼', prefixIcon: 'vxe-icon-copy'},
- {code: 'undooptimize', name: '鎾ら攢浼樺寲', prefixIcon: 'vxe-icon-error-circle-fill'},
- {code: 'undocompute', name: '鎾ら攢妯℃嫙璁$畻', prefixIcon: 'vxe-icon-error-circle-fill'},
- {code: 'Initializeproject', name: '鍒濆鍖栧伐绋�', prefixIcon: 'vxe-icon-undo'},
- {code: 'delproject', name: '鍒犻櫎宸ョ▼', prefixIcon: 'vxe-icon-delete'},
+ {code: 'undoOptimize', name: '鎾ら攢浼樺寲', prefixIcon: 'vxe-icon-error-circle-fill'},
+ {code: 'undoCompute', name: '鎾ら攢妯℃嫙璁$畻', prefixIcon: 'vxe-icon-error-circle-fill'},
+ {code: 'InitializeProject', name: '鍒濆鍖栧伐绋�', prefixIcon: 'vxe-icon-undo'},
+ {code: 'delProject', name: '鍒犻櫎宸ョ▼', prefixIcon: 'vxe-icon-delete'},
{code: 'viewTempered', name: '鏌ョ湅閽㈠寲鐗堝浘', prefixIcon: 'vxe-icon-custom-column'},
{code: 'viewOptimize', name: '鏌ョ湅浼樺寲鐗堝浘', prefixIcon: 'vxe-icon-layout'},
{code: 'Export', name: '鏁版嵁瀵煎嚭', prefixIcon: 'vxe-icon-download', visible: true, disabled: false},
@@ -105,6 +109,23 @@
// 瀹氫箟鎿嶄綔閰嶇疆瀵硅薄鏁扮粍锛岄泦涓鐞嗕笉鍚屾搷浣滈�夐」瀵瑰簲鐨勫弬鏁�
const operationConfigs = [
{
+ code: 'openProject', // 鎵撳紑宸ョ▼
+ initialState: ['10', '20', '100', '200'], //
+ targetState: null,
+ successMsg: '宸叉墦寮�宸ョ▼锛�',
+ checkMessage: '褰撳墠宸ョ▼鐘舵�佷笉绗﹀悎鏉′欢锛岃纭宸ョ▼鐘舵�佸悗鍐嶆搷浣滐紒',
+ requiresRow: true,
+ openFile: async ({row}) => {
+ const projectNumber = row.projectNumber;
+ await router.replace({
+ name: 'projectDetail',
+ params: {
+ projectNo: projectNumber
+ }
+ });
+ }
+ },
+ {
code: 'compute', // 鎵撳紑妯℃嫙璁$畻鎿嶄綔
initialState: ['1', '2'], //
targetState: null,
@@ -112,22 +133,12 @@
checkMessage: '褰撳墠宸ョ▼鐘舵�佷笉绗﹀悎妯℃嫙璁$畻鏉′欢锛岃纭宸ョ▼鐘舵�佸悗鍐嶆搷浣滐紒',
requiresRow: true,
actionFunction: async ({row}) => {
- console.log('鑾峰彇鐨勮鏁版嵁', row);
- try {
- // 浣跨敤娴忚鍣ㄥ師鐢烠lipboard API澶嶅埗宸ョ▼鍙�
- await navigator.clipboard.writeText(row.projectNumber);
- console.log('宸ョ▼鍙峰凡澶嶅埗鍒板壀璐存澘');
- ElMessage.success('宸ョ▼鍙峰凡鎴愬姛澶嶅埗');
- } catch (error) {
- console.error('澶嶅埗宸ョ▼鍙锋椂鍑洪敊:', error);
- ElMessage.error('澶嶅埗宸ョ▼鍙峰け璐ワ紝璇风◢鍚庨噸璇�');
+ const projectNumber = row.projectNumber;
+ emit('switch-dialog', projectNumber);
}
- optimizeCompute.value = true;
- Mange.value = false;
- }
},
{
- code: 'undocompute',
+ code: 'undoCompute',
initialState: '10',
targetState: 2,
successMsg: '鎾ら攢妯℃嫙璁$畻鎴愬姛锛屾暟鎹凡鏇存柊锛�',
@@ -135,7 +146,7 @@
requiresRow: true,
},
{
- code: 'undooptimize',
+ code: 'undoOptimize',
initialState: '20',
targetState: 10,
successMsg: '鎾ら攢浼樺寲鎴愬姛锛屾暟鎹凡鏇存柊锛�',
@@ -159,7 +170,7 @@
requiresRow: true,
},
{
- code: 'Initializeproject',
+ code: 'InitializeProject',
initialState: ['2', '10', '20'],
targetState: 1,
successMsg: '鍒濆鍖栧伐绋嬫垚鍔燂紒',
@@ -167,7 +178,7 @@
requiresRow: true,
},
{
- code: 'delproject',
+ code: 'delProject',
initialState: ['1', '2', '10', '20', '100'],
targetState: null,
successMsg: '宸ョ▼鍒犻櫎鎴愬姛锛�',
@@ -196,6 +207,7 @@
failureMsg: '宸ョ▼鍒犻櫎澶辫触锛岃鑱旂郴绠$悊鍛橈紒',
}
];
+
function getOriginalState(targetState) {
// 鏍规嵁宸ョ▼鐘舵�佽繑鍥炲搴旂殑鍘熷鐘舵��
const stateMapping = {
@@ -203,13 +215,14 @@
10: '20',
100: '200',
200: '100',
- 1:['2', '10', '20'],
+ 1: ['2', '10', '20'],
};
return stateMapping[targetState] || targetState;
}
+
//鍙抽敭鑿滃崟鏉′欢鍒ゆ柇
function checkOperationCondition(config, row) {
- if (!config.requiresRow ||!row) {
+ if (!config.requiresRow || !row) {
return false;
}
if (Array.isArray(config.initialState)) {
@@ -217,14 +230,15 @@
}
return config.initialState === String(row.state);
}
+
// 鍙抽敭鑿滃崟鐐瑰嚮浜嬩欢
const gridEvents = {
- menuClick({ menu, row }) {
+ menuClick({menu, row}) {
const $grid = xGrid.value;
if ($grid) {
const config = operationConfigs.find(c => c.code === menu.code);
if (config) {
- if (config.requiresRow &&!row) {
+ if (config.requiresRow && !row) {
ElMessage.warning('鏈�変腑宸ョ▼锛岃閫変腑宸ョ▼鍚庡啀杩涜褰撳墠鎿嶄綔锛�');
return;
}
@@ -239,45 +253,50 @@
cancelButtonText: '鍙栨秷',
type: 'warning'
}).then(() => {
- if (config.code === 'viewTempered'){
- ElMessageBox.alert('褰撳墠鐐瑰嚮鐨勬槸鏌ョ湅閽㈠寲鐗堝浘鍔熻兘锛岀洰鍓嶆殏鏃朵粎鍋氭彁绀猴紝鏆傛棤瀹為檯鏌ョ湅鎿嶄綔!', '鍔熻兘鎻愮ず', {
- confirmButtonText: '鎴戠煡閬撲簡'
- });
- return;
- }
- if (config.code === 'viewOptimize'){
- ElMessageBox.alert('褰撳墠鐐瑰嚮鐨勬槸鏌ョ湅閽㈠寲鐗堝浘鍔熻兘锛岀洰鍓嶆殏鏃朵粎鍋氭彁绀猴紝鏆傛棤瀹為檯鏌ョ湅鎿嶄綔!', '鍔熻兘鎻愮ず', {
- confirmButtonText: '鎴戠煡閬撲簡'
- });
- return;
- }
- if (config.code === 'delproject') {
- if (!row) {
- ElMessage.warning(config.checkMessage);
+ if (config.code === 'viewTempered') {
+ ElMessageBox.alert('褰撳墠鐐瑰嚮鐨勬槸鏌ョ湅閽㈠寲鐗堝浘鍔熻兘锛岀洰鍓嶆殏鏃朵粎鍋氭彁绀猴紝鏆傛棤瀹為檯鏌ョ湅鎿嶄綔!', '鍔熻兘鎻愮ず', {
+ confirmButtonText: '鎴戠煡閬撲簡'
+ });
return;
}
- const isInitialStateMatched = config.initialState.includes(String(row.state));
- if (!isInitialStateMatched) {
- ElMessage.warning(config.checkMessage);
+ if (config.code === 'viewOptimize') {
+ ElMessageBox.alert('褰撳墠鐐瑰嚮鐨勬槸鏌ョ湅閽㈠寲鐗堝浘鍔熻兘锛岀洰鍓嶆殏鏃朵粎鍋氭彁绀猴紝鏆傛棤瀹為檯鏌ョ湅鎿嶄綔!', '鍔熻兘鎻愮ず', {
+ confirmButtonText: '鎴戠煡閬撲簡'
+ });
return;
}
- deleteProject(row.projectNumber, config);
- } else if (!checkOperationCondition(config, row)) {
- ElMessage.warning(config.checkMessage);
- return;
- } else {
- if (config.code === 'compute') {
- config.actionFunction({ row });
- } else {
- row.state = config.targetState;
- const index = produceList.value.findIndex(item => item === row);
- if (index!== -1) {
- produceList.value.splice(index, 1, {...row });
- xGrid.value.reloadData(produceList.value);
+ if (config.code === 'delProject') {
+ if (!row) {
+ ElMessage.warning(config.checkMessage);
+ return;
}
- updateProjectStateAndHandleResponse(row, row.projectNumber, config.targetState, config.successMsg);
+ const isInitialStateMatched = config.initialState.includes(String(row.state));
+ if (!isInitialStateMatched) {
+ ElMessage.warning(config.checkMessage);
+ return;
+ }
+ deleteProject(row.projectNumber, config);
+ } else if (!checkOperationCondition(config, row)) {
+ ElMessage.warning(config.checkMessage);
+ return;
+ } else {
+ if (config.code === 'openProject') {
+ config.openFile({row});
+ ElMessage.success(config.successMsg);
+ }else
+ if (config.code === 'compute') {
+ config.actionFunction({row});
+ }
+ else {
+ row.state = config.targetState;
+ const index = produceList.value.findIndex(item => item === row);
+ if (index !== -1) {
+ produceList.value.splice(index, 1, {...row});
+ xGrid.value.reloadData(produceList.value);
+ }
+ updateProjectStateAndHandleResponse(row, row.projectNumber, config.targetState, config.successMsg);
+ }
}
- }
}).catch(() => {
// 鐢ㄦ埛鐐瑰嚮鍙栨秷鍚庢墽琛岀殑閫昏緫
ElMessage.info('宸插彇娑堟搷浣�');
@@ -286,17 +305,23 @@
console.error(`鏈壘鍒版搷浣滈�夐」 ${menu.code} 瀵瑰簲鐨勯厤缃紝璇锋鏌ラ厤缃」`);
}
}
+ },
+ cellDblclick: ({ row }) => {
+ const menu = { code: 'openProject' };
+ gridEvents.menuClick({ menu, row }); // 鐩存帴閫氳繃gridEvents瀵硅薄璋冪敤menuClick
}
};
+
// 灏佽鍙戦�佸彸閿彍鍗曡姹傘�佸鐞嗗搷搴斾互鍙婇敊璇洖婊氱瓑閫昏緫鐨勫嚱鏁�
function rollbackStateAndReloadGrid(row, targetState) {
row.state = getOriginalState(targetState);
const rollbackIndex = produceList.value.findIndex(item => item === row);
- if (rollbackIndex!== -1) {
+ if (rollbackIndex !== -1) {
produceList.value.splice(rollbackIndex, 1, {...row});
xGrid.value.reloadData(produceList.value);
}
}
+
function updateProjectStateAndHandleResponse(row, projectNumber, targetState, successMsg) {
const updateParams = {
projectNumber: projectNumber,
@@ -312,13 +337,13 @@
} else {
console.log('res.code 鐨勫��:', res.code, ', 绫诲瀷:', typeof res.code);
console.log('res.msg 鐨勫��:', res.msg, ', 绫诲瀷:', typeof res.msg);
- const errorMsg = res.data? res.data.errorMessage : '鎿嶄綔澶辫触锛屾湭鑾峰彇鍒板叿浣撳師鍥狅紝璇疯仈绯荤鐞嗗憳';
+ const errorMsg = res.data ? res.data.errorMessage : '鎿嶄綔澶辫触锛屾湭鑾峰彇鍒板叿浣撳師鍥狅紝璇疯仈绯荤鐞嗗憳';
ElMessage.error(`鎿嶄綔澶辫触锛屽師鍥�: ${errorMsg}`);
rollbackStateAndReloadGrid(row, targetState); // 璋冪敤鍥炴粴鍑芥暟
}
}).catch((error) => {
console.error('璇锋眰鍑洪敊锛屾搷浣滄湭瀹屾垚锛岃缁嗛敊璇俊鎭�:', error);
- const errorMsg = (res.data && res.data.errorMessage)? res.data.errorMessage : '鎿嶄綔澶辫触锛屾湭鑾峰彇鍒板叿浣撳師鍥狅紝璇疯仈绯荤鐞嗗憳';
+ const errorMsg = (res.data && res.data.errorMessage) ? res.data.errorMessage : '鎿嶄綔澶辫触锛屾湭鑾峰彇鍒板叿浣撳師鍥狅紝璇疯仈绯荤鐞嗗憳';
ElMessage.error(`璇锋眰鍑洪敊锛屾搷浣滄湭瀹屾垚锛屽師鍥�: ${errorMsg}`);
rollbackStateAndReloadGrid(row, targetState); // 璋冪敤鍥炴粴鍑芥暟
});
@@ -335,26 +360,25 @@
ElMessage.success(config.successMsg);
// 浠庡垪琛ㄤ腑绉婚櫎宸插垹闄ょ殑宸ョ▼鏁版嵁
const index = produceList.value.findIndex(item => item.projectNumber === projectNumber);
- if (index!== -1) {
+ if (index !== -1) {
produceList.value.splice(index, 1);
xGrid.value.reloadData(produceList.value);
}
} else {
console.log('res.code 鐨勫��:', res.code, ', 绫诲瀷:', typeof res.code);
console.log('res.msg 鐨勫��:', res.msg, ', 绫诲瀷:', typeof res.msg);
- const errorMsg = res.data? res.data.errorMessage : config.failureMsg;
+ const errorMsg = res.data ? res.data.errorMessage : config.failureMsg;
ElMessage.error(`鎿嶄綔澶辫触锛屽師鍥�: ${errorMsg}`);
}
}).catch((error) => {
console.error('璇锋眰鍑洪敊锛屽伐绋嬪垹闄ゆ湭瀹屾垚锛岃缁嗛敊璇俊鎭�:', error);
- const errorMsg = (res.data && res.data.errorMessage)? res.data.errorMessage : config.failureMsg;
+ const errorMsg = (res.data && res.data.errorMessage) ? res.data.errorMessage : config.failureMsg;
ElMessage.error(`璇锋眰鍑洪敊锛屽伐绋嬪垹闄ゆ湭瀹屾垚锛屽師鍥�: ${errorMsg}`);
});
}
-//瀹氫箟妯℃嫙璁$畻寮圭獥榛樿闅愯棌
-const optimizeCompute = ref(false)
-const Mange = ref(true)
+//瀹氫箟鍒囨崲妯℃嫙璁$畻寮圭獥
+const emit = defineEmits(['switch-dialog']);
//瀹氫箟宸ョ▼鐘舵��
const optionVal = ref('all')
@@ -531,85 +555,82 @@
<template>
<div id="mange">
- <glass-computed v-if="optimizeCompute"/>
- <div style="height: 100%; width: 100%" v-if="Mange">
- <div id="select">
- <span>浼樺寲鏃ユ湡</span>
- <el-date-picker
- style="margin-left:10px; margin-top: -5px; "
- v-model="orderInfo.workOrderDate"
- :default-time="defaultTime"
- :start-placeholder="$t('basicData.startDate')"
- :end-placeholder="$t('basicData.endDate')"
- type="daterange"
- format="YYYY/MM/DD"
- value-format="YYYY-MM-DD"
- />
- <span class="input">宸ョ▼鐘舵��</span>
- <el-select
- style="margin-left:10px; margin-top: -5px; width: 150px"
- :default-first-option="true"
- ref="getSelect"
- v-model="optionVal"
- clearable
- class="m-2"
- @change="handleOptionChange"
- >
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- <!--鏌ヨ-->
- <el-button
- style="margin-left:10px;margin-top: -5px"
- :icon="Search"
- type="primary"
- @click="getWorkOrder">{{ $t('basicData.search') }}
- </el-button>
- </div>
-
- <vxe-grid
- height="100%"
- class="mytable-scrollbar"
- ref="xGrid"
- v-bind="gridOptions"
- v-on="gridEvents"
- @filter-change="filterChanged"
+ <div id="select">
+ <span>浼樺寲鏃ユ湡</span>
+ <el-date-picker
+ style="margin-left:10px; margin-top: -5px; "
+ v-model="orderInfo.workOrderDate"
+ :default-time="defaultTime"
+ :start-placeholder="$t('basicData.startDate')"
+ :end-placeholder="$t('basicData.endDate')"
+ type="daterange"
+ format="YYYY/MM/DD"
+ value-format="YYYY-MM-DD"
+ />
+ <span class="input">宸ョ▼鐘舵��</span>
+ <el-select
+ style="margin-left:10px; margin-top: -5px; width: 150px"
+ :default-first-option="true"
+ ref="getSelect"
+ v-model="optionVal"
+ clearable
+ class="m-2"
+ @change="handleOptionChange"
>
- <template #select_filter="{ column, $panel }">
- <div>
- <div v-for="(option, index) in column.filters" :key="index">
- <vxe-select v-model="option.data" @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>
- </template>
+ <el-option
+ v-for="item in options"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ />
+ </el-select>
+ <!--鏌ヨ-->
+ <el-button
+ style="margin-left:10px;margin-top: -5px"
+ :icon="Search"
+ type="primary"
+ @click="getWorkOrder">{{ $t('basicData.search') }}
+ </el-button>
+ </div>
- <template #num1_filter="{ column, $panel }">
- <div>
- <div v-for="(option, index) in column.filters" :key="index">
- <input v-model="option.data" type="text"
- @keyup.enter.native="$panel.confirmFilter()"
- @input="changeFilterEvent($event, option, $panel)"/>
- </div>
+ <vxe-grid
+ height="100%"
+ class="mytable-scrollbar"
+ ref="xGrid"
+ v-bind="gridOptions"
+ v-on="gridEvents"
+ @filter-change="filterChanged"
+ >
+ <template #select_filter="{ column, $panel }">
+ <div>
+ <div v-for="(option, index) in column.filters" :key="index">
+ <vxe-select v-model="option.data" @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>
- </template>
- </vxe-grid>
- <div id="last">
- 灏忕墖鏁伴噺
- <el-input class="input" disabled v-model="smallPieceQuantityInput"></el-input>
- 灏忕墖闈㈢Н
- <el-input class="input" disabled v-model="smallPieceAreaInput"></el-input>
- 鍘熺墖鏁伴噺
- <el-input class="input" disabled v-model="originalPieceQuantityInput"></el-input>
- 鍘熺墖闈㈢Н
- <el-input class="input" disabled v-model="originalPieceAreaInput"></el-input>
- </div>
+ </div>
+ </template>
+
+ <template #num1_filter="{ column, $panel }">
+ <div>
+ <div v-for="(option, index) in column.filters" :key="index">
+ <input v-model="option.data" type="text"
+ @keyup.enter.native="$panel.confirmFilter()"
+ @input="changeFilterEvent($event, option, $panel)"/>
+ </div>
+ </div>
+ </template>
+ </vxe-grid>
+ <div id="last">
+ 灏忕墖鏁伴噺
+ <el-input class="input" disabled v-model="smallPieceQuantityInput"></el-input>
+ 灏忕墖闈㈢Н
+ <el-input class="input" disabled v-model="smallPieceAreaInput"></el-input>
+ 鍘熺墖鏁伴噺
+ <el-input class="input" disabled v-model="originalPieceQuantityInput"></el-input>
+ 鍘熺墖闈㈢Н
+ <el-input class="input" disabled v-model="originalPieceAreaInput"></el-input>
</div>
</div>
</template>
diff --git a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/Compute.vue b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/Compute.vue
index 01dfdb5..f05b595 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/Compute.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/Compute.vue
@@ -105,8 +105,12 @@
},
]
+//鑾峰彇宸ョ▼鍙�
+const props = defineProps({
+ projectNo : String
+});
// 瀹氫箟鍝嶅簲寮忔暟鎹紝鐢ㄤ簬缁戝畾宸ョ▼鍙疯緭鍏ユ鐨勫��
-const projectNumber = ref('');
+const projectNumber = ref(props.projectNo);
let emit = defineEmits(['fetch-data']);
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 feb8583..89fd57b 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,18 +1,15 @@
<script setup>
import {onMounted, reactive, ref} from "vue";
import {useI18n} from "vue-i18n";
-import {
- Folder,
- Plus,
- Setting,
- Operation,
-} from "@element-plus/icons-vue";
+import {Folder, Plus, Setting, Operation,} from "@element-plus/icons-vue";
import OptimizeCompute from "@/views/pp/glassOptimize/page/OptimizeCompute.vue";
import SetAmount from "@/views/pp/glassOptimize/page/SetAmount.vue";
import SetTrimming from "@/views/pp/glassOptimize/page/SetTrimming.vue";
import CheckInventory from "@/views/pp/glassOptimize/page/CheckInventory.vue";
import request from "@/utils/request";
import {ElMessage} from "element-plus";
+import { useRoute } from 'vue-router';
+
const {t} = useI18n()
@@ -44,37 +41,16 @@
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: [
- {field: 'seq', title: '', width: 70},
{field: 'order_number', title: '璁㈠簭', width: 70},
{field: 'child_width', width: 100, title: t('order.width'), filters: [{data: ''}], slots: {filter: 'num2_filter'}},
{field: 'child_height', width: 100, title: t('order.height'),filters: [{data: ''}],slots: {filter: 'num2_filter'}},
{field: 'quantity', width: 150, title: t('order.quantity'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
- {field: '', width: 150, title: '闀跨(1', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
- {field: '', width: 150, title: '闀跨(2', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
- {field: '', width: 150, title: '鐭(1', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
- {field: '', width: 150, title: '鐭(1', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+ {field: 'longGrind1', width: 150, title: '闀跨(1', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+ {field: 'longGrind2', width: 150, title: '闀跨(2', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+ {field: 'shortGrind1', width: 150, title: '鐭(1', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+ {field: 'shortGrind2', width: 150, title: '鐭(2', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
{
field: 'shape',
width: 150,
@@ -93,17 +69,17 @@
sortable: true
},
{
- field: 'building_number',
+ field: 'remark',
width: 150,
- title: t('order.buildingNumber'),
+ title: t('basicData.remarks'),
filters: [{data: ''}],
slots: {filter: 'num1_filter'},
sortable: true
},
{
- field: 'remark',
+ field: 'building_number',
width: 150,
- title: t('basicData.remarks'),
+ title: '妤煎眰鍙�',
filters: [{data: ''}],
slots: {filter: 'num1_filter'},
sortable: true
@@ -126,7 +102,7 @@
},
{
- field: '',
+ field: 'shelf_number',
width: 150,
title: '鏋跺彿',
filters: [{data: ''}],
@@ -179,23 +155,37 @@
const openDialog = (index) => {
dialogVisible.value[index] = true;
};
+
+const route = useRoute();
//宸ョ▼鍙�
-const projectNo = ref('P24120301');
+const projectNo = ref(route.params.projectNo);
+const projectName = ref('');
+console.log(projectNo.value);
const fetchData = () => {
request.post(`/glassOptimize/projectInfo/${projectNo.value}`).then((res) => {
if ((Number(res.code) === 200)) {
+ const data = res.data.data;
+ data.forEach(item => {
+ item.longGrind1 = 0;
+ item.longGrind2 = 0;
+ item.shortGrind1 = 0;
+ item.shortGrind2 = 0;
+ item.shelf_number = 0;
+ });
xGrid.value.loadData(res.data.data);
+ projectName.value = res.data.data[0].project_name;
} else {
ElMessage.warning(res.msg);
}
}).catch((error) => {
console.error("鑾峰彇鏁版嵁鍑洪敊:", error);
- ElMessage.error('鑾峰彇鏁版嵁鏃跺嚭鐜伴敊璇紝璇风◢鍚庡啀璇�');
});
};
onMounted(() => {
- fetchData();
+ if (projectNo.value) {
+ fetchData();
+ }
});
@@ -240,9 +230,9 @@
<div id="header">
<div id="title">
<span>宸ョ▼缂栧彿锛�</span>
- <vxe-input disabled placeholder=""></vxe-input>
+ <el-input disabled placeholder="" style="width: 150px" v-model="projectNo"></el-input>
<span>宸ョ▼鍚嶇О锛�</span>
- <vxe-input placeholder="" style="margin-right: 270px"></vxe-input>
+ <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]"
diff --git a/north-glass-erp/src/main/resources/mapper/pp/GlassOptimize.xml b/north-glass-erp/src/main/resources/mapper/pp/GlassOptimize.xml
index 753a1c4..9c02619 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/GlassOptimize.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/GlassOptimize.xml
@@ -74,7 +74,8 @@
round((`g`.`area` * `f`.`quantity`),4) AS area,
f.technology_number ,
g.glass_child ,
- g.icon
+ g.icon,
+ op.project_name
FROM
((pp.flow_card AS f
LEFT JOIN sd.order_detail AS d ON (((f.order_id = d.order_id) AND (f.order_number = d.order_number))))
--
Gitblit v1.8.0