| | |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | if (props.project.projectNumber) { |
| | | if (props.project) { |
| | | handleFetchData(props.project.projectNumber); |
| | | //handleTableData(data); |
| | | //handleDataReceive(data); |
| | |
| | | style="width: 90%;height:90%;margin-top: 3vh" |
| | | z-index="100" |
| | | > |
| | | <project-create v-if="detailPage===1" /> |
| | | <project-create v-if="detailPage===1" @switch-dialog="switchDialog"/> |
| | | <project-mange v-if="detailPage===2" @switch-dialog="switchDialog" @closeDetailPage="handlePopupClose"/> |
| | | <glass-computed v-if="detailPage===3" :project="projectNumber"/> |
| | | <div v-else></div> |
| | |
| | | import ProcessCardDetail from "@/views/pp/glassOptimize/page/ProcessCardDetail.vue"; |
| | | import ProjectList from "@/views/pp/glassOptimize/page/ProjectList.vue"; |
| | | |
| | | import {ref} from "vue"; |
| | | import {defineEmits, nextTick, onMounted, reactive, ref} from "vue"; |
| | | import {useI18n} from "vue-i18n"; |
| | | import GlassComputed from "@/views/pp/glassOptimize/GlassComputed.vue"; |
| | | import ProjectMange from "@/views/pp/glassOptimize/ProjectMange.vue"; |
| | | import request from "@/utils/request"; |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | |
| | | let projectRow = ref({ |
| | | processId:null, |
| | | technologyNumber:null |
| | | }) |
| | | |
| | | |
| | | const processCardRef=ref(null) |
| | | |
| | | const handleProcessIdUpdate = newProcessId => { |
| | | projectRow.value.processId = newProcessId; |
| | | |
| | | }; |
| | | |
| | | const handleTechnologyNumberUpdate = newTechnologyNumber => { |
| | | projectRow.value.technologyNumber = newTechnologyNumber; |
| | | }; |
| | | |
| | | const updateState = state => { |
| | | getProject(); |
| | | |
| | | }; |
| | | |
| | | |
| | | const { t } = useI18n() |
| | | |
| | | const xGrid = ref() |
| | | |
| | | |
| | | const gridOptions = reactive({ |
| | | height:'100%', |
| | | loading: false, |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30, useKey: true},//鼠标移动或选择高亮 |
| | | id: 'ProjectList', |
| | | scrollX:{enabled: true}, |
| | | scrollY:{ enabled: true ,gt:0},//开启虚拟滚动 |
| | | showOverflow:true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | }, |
| | | columns:[ |
| | | {field: 'id',width: 150, title: 'ID',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'projectNumber',width: 150, title: '工程号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'project_name',width: 150, title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'glass_type',width: 150, title: '膜系',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'glass_thickness',width: 150, title: '厚度',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'type',width: 150, title: '类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'state',width: 150, title: '状态',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'quantity',width: 150, title: t('order.quantity'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'glass_total_area',width: 150, title: t('order.grossArea'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'process_qty',width: 150, title: '流程数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'process_cards',width: 150, title: '流程卡号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | |
| | | ],//表头参数 |
| | | data:null,//表格数据 |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | ], |
| | | import: false, |
| | | // export: true, |
| | | // print: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | //右键菜单选项 |
| | | menuConfig: { |
| | | body: { |
| | | options: [ |
| | | [ |
| | | {code: 'openProject', name: '打开工程', prefixIcon: 'vxe-icon-folder-open'}, |
| | | {code: 'compute', name: '模拟计算', prefixIcon: 'vxe-icon-subtable'}, |
| | | {code: 'delProject', name: '删除工程', prefixIcon: 'vxe-icon-delete'}, |
| | | ], |
| | | [] |
| | | ] |
| | | } |
| | | } |
| | | |
| | | }) |
| | | |
| | | // 定义操作配置对象数组,集中管理不同操作选项对应的参数 |
| | | const operationConfigs = [ |
| | | { |
| | | code: 'openProject', // 打开工程 |
| | | initialState: ['10', '20', '100', '200'], // |
| | | targetState: null, |
| | | successMsg: '已打开!', |
| | | checkMessage: '当前工程状态不符合条件,请确认工程状态后再操作!', |
| | | requiresRow: true, |
| | | openFile: async ({row}) => { |
| | | const projectNumber = row.projectNumber; |
| | | const thickness = row.thickness; |
| | | const glassType = row.glassType; |
| | | await router.push({ |
| | | name: 'optimizeInfo', |
| | | params: { |
| | | projectNo: projectNumber, |
| | | thickNess: thickness, |
| | | model: glassType |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | { |
| | | code: 'compute', // 打开模拟计算操作 |
| | | initialState: ['1'], // |
| | | targetState: null, |
| | | successMsg: '模拟计算已启动!', |
| | | checkMessage: '当前工程状态不符合模拟计算条件,请确认工程状态后再操作!', |
| | | requiresRow: true, |
| | | actionFunction: async ({row}) => { |
| | | const projectNo = row.projectNumber; |
| | | emit('switch-dialog', row); |
| | | } |
| | | }, |
| | | { |
| | | code: 'delProject', |
| | | initialState: ['1'], |
| | | targetState: null, |
| | | successMsg: '工程删除成功!', |
| | | checkMessage: '当前工程状态不符合删除条件,请确认工程状态后再操作!', |
| | | } |
| | | |
| | | ]; |
| | | |
| | | //定义切换模拟计算弹窗 |
| | | const emit = defineEmits(['switch-dialog']); |
| | | |
| | | onMounted(async () => { |
| | | getProject(); |
| | | }) |
| | | |
| | | // 定义数据返回结果,使用ref创建响应式数据,初始化为空数组 |
| | | let produceList = ref([]) |
| | | |
| | | const getProject = ()=>{ |
| | | request.post(`/glassOptimize/getProjectList`).then((res) => { |
| | | if(res.code==200){ |
| | | produceList.value = deepClone(res.data.data); |
| | | xGrid.value.loadData(produceList.value) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const gridEvents = { |
| | | menuClick({menu, row}) { |
| | | const $grid = xGrid.value; |
| | | if ($grid) { |
| | | const config = operationConfigs.find(c => c.code === menu.code); |
| | | if (config) { |
| | | if (config.requiresRow && !row) { |
| | | ElMessage.warning('未选中工程,请选中工程后再进行当前操作!'); |
| | | return; |
| | | } |
| | | if (config.code === 'compute') { |
| | | config.actionFunction({row}); |
| | | return; |
| | | } |
| | | // 添加确认提示弹窗,询问用户是否进行当前操作 |
| | | ElMessageBox.confirm('是否进行当前操作?', '确认操作', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | if (config.code === 'delProject') { |
| | | if (!row) { |
| | | ElMessage.warning(config.checkMessage); |
| | | return; |
| | | } |
| | | const isInitialStateMatched = config.initialState.includes(String(row.state)); |
| | | if (!isInitialStateMatched) { |
| | | ElMessage.warning(config.checkMessage); |
| | | return; |
| | | } |
| | | deleteProject(row.projectNumber, config); |
| | | } |
| | | }).catch(() => { |
| | | // 用户点击取消后执行的逻辑 |
| | | ElMessage.info('已取消操作'); |
| | | }); |
| | | } else { |
| | | console.error(`未找到操作选项 ${menu.code} 对应的配置,请检查配置项`); |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | | function deleteProject(projectNumber, config) { |
| | | request.post(`/glassOptimize/deleteProject/${projectNumber}`, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).then((res) => { |
| | | if (res.code==200 && res.data===true) { |
| | | ElMessage.success(config.successMsg); |
| | | // 从列表中移除已删除的工程数据 |
| | | const index = produceList.value.findIndex(item => item.projectNumber === projectNumber); |
| | | if (index !== -1) { |
| | | produceList.value.splice(index, 1); |
| | | xGrid.value.reloadData(produceList.value); |
| | | } |
| | | //刷新工程号 |
| | | processCardRef.value.getProjectId(); |
| | | processCardRef.value.selectFlowCardList(); |
| | | processCardRef.value.selectGlassType(); |
| | | } 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; |
| | | ElMessage.error(`操作失败,原因: ${errorMsg}`); |
| | | } |
| | | }).catch((error) => { |
| | | console.error('请求出错,工程删除未完成,详细错误信息:', error); |
| | | ElMessage.error(`请求出错,工程删除未完成,原因: ${errorMsg}`); |
| | | }); |
| | | } |
| | | |
| | | </script> |
| | | |
| | |
| | | <div style="width: 100%; height: 100%;"> |
| | | |
| | | <div id="processCard"> |
| | | <process-card :process-id="projectRow.processId===null?null:projectRow.processId" |
| | | <process-card ref="processCardRef" :process-id="projectRow.processId===null?null:projectRow.processId" |
| | | :technology-number="projectRow.technologyNumber===null?null:projectRow.technologyNumber" |
| | | @updateProcessId="handleProcessIdUpdate" |
| | | @updateTechnologyNumber="handleTechnologyNumberUpdate" |
| | | @updateState="updateState" |
| | | /> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | |
| | | <div id="project-list"> |
| | | <project-list /> |
| | | <div style="width: 100%;height: 100%"> |
| | | <h1>工程列表</h1> |
| | | <vxe-grid |
| | | size="small" |
| | | @filter-change="filterChanged" |
| | | height="100%" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | > |
| | | |
| | | <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> |
| | | </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> |
| | | </template> |
| | | </vxe-grid> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | }, |
| | | { |
| | | code: 'InitializeProject', |
| | | initialState: ['2', '10', '20'], |
| | | initialState: '2', |
| | | targetState: 1, |
| | | successMsg: '初始化工程成功!', |
| | | checkMessage: '当前工程状态不符合初始化条件,请确认工程状态后再操作!', |
| | |
| | | } |
| | | else { |
| | | row.state = config.targetState; |
| | | let code=0 |
| | | 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); |
| | | if(config.code === 'undoCompute'){ |
| | | code=1 |
| | | }else if(config.code === 'undoOptimize'){ |
| | | code=2 |
| | | } |
| | | else if(config.code === 'production'){ |
| | | code=3 |
| | | } |
| | | else if(config.code === 'novisible'){ |
| | | code=4 |
| | | } |
| | | else if(config.code === 'InitializeProject'){ |
| | | code=5 |
| | | } |
| | | updateProjectStateAndHandleResponse(row, row.projectNumber, config.targetState,code, config.successMsg); |
| | | } |
| | | } |
| | | }).catch(() => { |
| | |
| | | } |
| | | } |
| | | |
| | | function updateProjectStateAndHandleResponse(row, projectNumber, targetState, successMsg) { |
| | | function updateProjectStateAndHandleResponse(row, projectNumber, targetState,code, successMsg) { |
| | | const updateParams = { |
| | | projectNumber: projectNumber, |
| | | stateToUpdate: targetState |
| | | }; |
| | | request.post(`/glassOptimize/updateProjectState/${projectNumber}/${targetState}`, updateParams, { |
| | | request.post(`/glassOptimize/updateProjectState/${projectNumber}/${targetState}/${code}`, updateParams, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | |
| | | default: () => [] |
| | | } |
| | | }); |
| | | // 定义响应式数据,用于绑定工程号输入框的值 |
| | | const inputValue = ref(props.project.projectNumber); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | const spacingLong = ref('') // 长轴间隔 |
| | | const spacingWidth = ref('') // 宽轴间隔 |
| | | const quantity = ref('') // 工程片数 |
| | | |
| | | // 定义响应式数据,用于绑定工程号输入框的值 |
| | | let inputValue=ref(null) |
| | | if(props.project!==undefined){ |
| | | inputValue= ref(props.project.projectNumber); |
| | | quantity.value=props.project.quantity |
| | | } |
| | | |
| | | |
| | | const gridOptions = reactive({ |
| | |
| | | spacingLong.value=formattedData[0].x_space |
| | | spacingWidth.value=formattedData[0].y_space |
| | | heatingTime.value=formattedData[0].tempering_time |
| | | quantity.value=props.project.quantity |
| | | |
| | | } |
| | | } else { |
| | |
| | | :step="1"/> |
| | | <span style="margin-left: 20px ; width: 35px;">{{ percentage1 }}%</span> |
| | | <span style="float: right ; margin-left: 150px;"> |
| | | 工程片数 <vxe-input size="small" disabled class="input" clearable v-model="quantity"></vxe-input> |
| | | 工程片数 <vxe-input size="small" disabled class="input" v-model="quantity"></vxe-input> |
| | | 宽轴间隔 <vxe-input size="small" class="input" clearable v-model="spacingWidth"></vxe-input> |
| | | 炉宽(mm) <vxe-input size="small" class="input" clearable v-model="furnaceWidth"></vxe-input> |
| | | </span> |
| | |
| | | emit('updateTechnologyNumber', rowClickIndex.value.technology_number); |
| | | } |
| | | } |
| | | const emit = defineEmits(['updateProcessId', 'updateTechnologyNumber']); |
| | | const emit = defineEmits(['updateProcessId', 'updateTechnologyNumber', 'updateState']); |
| | | |
| | | |
| | | //小圆点单选框 |
| | |
| | | } |
| | | request.post(`/glassOptimize/addProject/${optionVal.value}/${oddNumbers.value}/${inputProject}`, projectData.value).then((res) => { |
| | | if (res.code == 200 && res.data === true) { |
| | | emit('updateState', 1); |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | selectFlowCardList() |
| | | getProjectId(); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | //抛出方法到父界面 |
| | | defineExpose({getProjectId,selectFlowCardList,selectGlassType}) |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | <script setup> |
| | | import {onMounted, reactive, ref, watch} from "vue"; |
| | | import {nextTick, onMounted, reactive, ref, watch} from "vue"; |
| | | import {useI18n} from "vue-i18n"; |
| | | import request from "@/utils/request"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {hiprint} from "vue-plugin-hiprint"; |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import {defineEmits} from 'vue'; |
| | | const { t } = useI18n() |
| | | |
| | | const xGrid = ref() |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | //右键菜单选项 |
| | | menuConfig: { |
| | | body: { |
| | | options: [ |
| | | [ |
| | | {code: 'openProject', name: '打开工程', prefixIcon: 'vxe-icon-folder-open'}, |
| | | {code: 'compute', name: '模拟计算', prefixIcon: 'vxe-icon-subtable'}, |
| | | {code: 'delProject', name: '删除工程', prefixIcon: 'vxe-icon-delete'}, |
| | | ], |
| | | [] |
| | | ] |
| | | } |
| | | } |
| | | |
| | | }) |
| | | |
| | | // 定义操作配置对象数组,集中管理不同操作选项对应的参数 |
| | | const operationConfigs = [ |
| | | { |
| | | code: 'openProject', // 打开工程 |
| | | initialState: ['10', '20', '100', '200'], // |
| | | targetState: null, |
| | | successMsg: '已打开!', |
| | | checkMessage: '当前工程状态不符合条件,请确认工程状态后再操作!', |
| | | requiresRow: true, |
| | | openFile: async ({row}) => { |
| | | const projectNumber = row.projectNumber; |
| | | const thickness = row.thickness; |
| | | const glassType = row.glassType; |
| | | await router.push({ |
| | | name: 'optimizeInfo', |
| | | params: { |
| | | projectNo: projectNumber, |
| | | thickNess: thickness, |
| | | model: glassType |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | { |
| | | code: 'compute', // 打开模拟计算操作 |
| | | initialState: ['1', '2'], // |
| | | targetState: null, |
| | | successMsg: '模拟计算已启动!', |
| | | checkMessage: '当前工程状态不符合模拟计算条件,请确认工程状态后再操作!', |
| | | requiresRow: true, |
| | | actionFunction: async ({row}) => { |
| | | const projectNo = row.projectNumber; |
| | | emit('switch-dialog', row); |
| | | } |
| | | }, |
| | | { |
| | | code: 'delProject', |
| | | initialState: ['1', '2', '10', '20', '100'], |
| | | targetState: null, |
| | | successMsg: '工程删除成功!', |
| | | checkMessage: '当前工程状态不符合删除条件,请确认工程状态后再操作!', |
| | | } |
| | | |
| | | ]; |
| | | |
| | | //定义切换模拟计算弹窗 |
| | | const emit = defineEmits(['switch-dialog']); |
| | | |
| | | onMounted(async () => { |
| | | getProject(); |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const gridEvents = { |
| | | menuClick({menu, row}) { |
| | | const $grid = xGrid.value; |
| | | if ($grid) { |
| | | const config = operationConfigs.find(c => c.code === menu.code); |
| | | if (config) { |
| | | if (config.requiresRow && !row) { |
| | | ElMessage.warning('未选中工程,请选中工程后再进行当前操作!'); |
| | | return; |
| | | } |
| | | if (config.code === 'compute') { |
| | | config.actionFunction({row}); |
| | | return; |
| | | } |
| | | // 添加确认提示弹窗,询问用户是否进行当前操作 |
| | | ElMessageBox.confirm('是否进行当前操作?', '确认操作', { |
| | | confirmButtonText: '确定', |
| | | 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); |
| | | return; |
| | | } |
| | | 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') { |
| | | handleSameDataOperation(row).then(({isRoutesEqual}) => { |
| | | if (!isRoutesEqual) { |
| | | config.openFile({row}); |
| | | ElMessage.success(config.successMsg); |
| | | } |
| | | }); |
| | | } else if (config.code === 'compute') { |
| | | config.actionFunction({row}); |
| | | } else if (config.code === 'optimizeTypography') { |
| | | handleSameDataOperation(row).then(({isRoutesEqual}) => { |
| | | if (!isRoutesEqual) { |
| | | config.Typography({row}); |
| | | ElMessage.success(config.successMsg); |
| | | } |
| | | }); |
| | | } |
| | | 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('已取消操作'); |
| | | }); |
| | | } else { |
| | | console.error(`未找到操作选项 ${menu.code} 对应的配置,请检查配置项`); |
| | | } |
| | | } |
| | | }, |
| | | cellDblclick: ({row}) => { |
| | | const menu = {code: 'openProject'}; |
| | | nextTick(() => { |
| | | handleSameDataOperation(row).then(({isRoutesEqual}) => { |
| | | if (!isRoutesEqual) { |
| | | gridEvents.menuClick({menu, row}); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | |
| | | //修改工程状态 |
| | | @ApiOperation("修改工程状态接口") |
| | | @PostMapping("/updateProjectState/{projectNumber}/{state}") |
| | | @PostMapping("/updateProjectState/{projectNumber}/{state}/{code}") |
| | | public Result updateProjectState( |
| | | @PathVariable String projectNumber, |
| | | @PathVariable Integer state |
| | | @PathVariable Integer state, |
| | | @PathVariable Integer code |
| | | ) { |
| | | if (glassOptimizeService.updateProjectState(projectNumber, state)) { |
| | | if (glassOptimizeService.updateProjectState(projectNumber, state,code)) { |
| | | return Result.seccess(); |
| | | } else { |
| | | throw new ServiceException(Constants.Code_500, "修改失败"); |
| | |
| | | } |
| | | |
| | | //修改排版状态 |
| | | public Boolean updateProjectState(String projectNumber, Integer state) { |
| | | public Boolean updateProjectState(String projectNumber, Integer state, Integer code) { |
| | | if (!projectNumber.isEmpty()) { |
| | | glassOptimizeMapper.updateProjectStateMp(projectNumber, state); |
| | | //撤销模拟计算 |
| | | if(code==1){ |
| | | glassOptimizeMapper.deleteOptimizeHeatDetail(projectNumber); |
| | | glassOptimizeMapper.deleteOptimizeHeatLayout(projectNumber); |
| | | glassOptimizeMapper.updateProjectStateMp(projectNumber, state); |
| | | } |
| | | //撤销优化排版 |
| | | else if(code==2){ |
| | | glassOptimizeMapper.deleteOptimizeHeatDetail(projectNumber); |
| | | glassOptimizeMapper.deleteOptimizeHeatDetail(projectNumber); |
| | | glassOptimizeMapper.deleteOptimizeHeatLayout(projectNumber); |
| | | glassOptimizeMapper.updateProjectStateMp(projectNumber, state); |
| | | } |
| | | //允许生产 |
| | | else if(code==3){ |
| | | glassOptimizeMapper.updateProjectStateMp(projectNumber, state); |
| | | } |
| | | //生产不可见 |
| | | else if(code==4){ |
| | | glassOptimizeMapper.updateProjectStateMp(projectNumber, state); |
| | | } |
| | | //初始化工程 |
| | | else if(code==5){ |
| | | glassOptimizeMapper.updateProjectStateMp(projectNumber, state); |
| | | } |
| | | return true; |
| | | } else { |
| | | return false; |
| | |
| | | <select id="getProjectListMp"> |
| | | SELECT |
| | | p.id, |
| | | p.project_no, |
| | | p.project_no as projectNumber, |
| | | p.project_name, |
| | | p.glass_type, |
| | | p.glass_thickness, |
| | | p.type, |
| | | p.state, |
| | | p.glass_total, |
| | | p.glass_total as quantity, |
| | | p.glass_total_area, |
| | | p.process_qty, |
| | | p.process_cards, |