| | |
| | | {field: 'thickness', width: 50, title: '厚度',}, |
| | | {field: 'type', width: 50, title: '类型',}, |
| | | {field: 'state', width: 50, title: '状态',}, |
| | | {field: 'temperingState', width: 50, title: '钢化模拟',filters: [{data: ''}], slots: {filter: 'num1_filter'}, |
| | | {field: 'temperingState', width: 50, title: '钢化模拟', filters: [{data: ''}], slots: {filter: 'select_filter1'}, |
| | | filterMethod:filterChanged, formatter: ({ cellValue }) => cellValue === 1 ? '是' : (cellValue === 0 ? '否' : cellValue)}, |
| | | {field: 'optimizeState', width: 50, title: '优化计算',filters: [{data: ''}], slots: {filter: 'num1_filter'}, |
| | | filterMethod:filterChanged,formatter: ({ cellValue }) => cellValue === 1 ? '是' : (cellValue === 0 ? '否' : cellValue)}, |
| | | {field: 'optimizeState', width: 50, title: '优化计算', filters: [{data: ''}], slots: {filter: 'select_filter1'}, |
| | | filterMethod:filterChanged, formatter: ({ cellValue }) => cellValue === 1 ? '是' : (cellValue === 0 ? '否' : cellValue)}, |
| | | {field: 'quantity', width: 50, title: '数量',}, |
| | | {field: 'area', width: 50, title: '面积',}, |
| | | {field: 'processCardQuantity', width: 100, title: '流程卡数量',}, |
| | |
| | | {field: 'effectiveCuttingRate', width: 100, title: '有效切裁率',}, |
| | | {field: 'residueGlassCuttingRate', width: 100, title: '尾片切裁率',}, |
| | | {field: 'amountOfOriginalGlassUsage1', width: 100, title: '原料使用数',}, |
| | | {field: 'averageCuttingRate1', width: 100, title: '平均切裁率',}, |
| | | // {field: 'averageCuttingRate1', width: 100, title: '平均切裁率',}, |
| | | {field: 'notes', width: 50, title: '备注',}, |
| | | {field: 'creator', width: 100, title: '创建人',}, |
| | | {field: 'createTime', width: 100, title: '创建时间',}, |
| | |
| | | {code: 'openProject', name: '打开工程', prefixIcon: 'vxe-icon-folder-open'}, |
| | | {code: 'compute', name: '模拟计算', prefixIcon: 'vxe-icon-subtable'}, |
| | | //{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: '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: 'production', |
| | | initialState: 1, |
| | | temperingState: 1, |
| | | // temperingState: 1, |
| | | optimizeState: 1, |
| | | targetState: 100, |
| | | targetStates: 0, |
| | |
| | | { |
| | | code: 'novisible', |
| | | initialState: 100, |
| | | temperingState: 1, |
| | | // temperingState: 1, |
| | | optimizeState: 1, |
| | | targetState: 1, |
| | | targetStates: 0, |
| | |
| | | targetState: null, |
| | | successMsg: '钢化版图已打开!', |
| | | failureMsg: '工程删除失败,请联系管理员!', |
| | | requiresRow: true, |
| | | }, |
| | | { |
| | | code: 'viewOptimize', |
| | |
| | | targetState: null, |
| | | successMsg: '优化版图已打开!', |
| | | failureMsg: '工程删除失败,请联系管理员!', |
| | | requiresRow: true, |
| | | } |
| | | ]; |
| | | |
| | |
| | | return; |
| | | } |
| | | if (config.code === 'compute') { |
| | | // 增加逻辑:检查钢化模拟列是否已经是"是" |
| | | if (row.temperingState === 1) { |
| | | ElMessage.warning('该项目已模拟计算'); |
| | | return; |
| | | } |
| | | if(row.state===1 && row.temperingState===0){ |
| | | config.actionFunction({row}); |
| | | }else{ |
| | |
| | | return; |
| | | } |
| | | if (config.code === 'viewOptimize') { |
| | | ElMessageBox.alert('当前点击的是查看钢化版图功能,目前暂时仅做提示,暂无实际查看操作!', '功能提示', { |
| | | confirmButtonText: '我知道了' |
| | | }); |
| | | (async () => { |
| | | if (!row) { |
| | | ElMessage.warning('请选择要查看的工程'); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | await router.push({ |
| | | name: 'optimizeInfo', |
| | | params: { |
| | | projectNo: row.projectNumber, |
| | | thickNess: row.thickness, |
| | | model: row.glassType, |
| | | quantity: row.quantity, |
| | | area: row.area, |
| | | optimizeState: row.optimizeState |
| | | }, |
| | | query: { |
| | | redirect: 'optimizeControl' // 添加跳转标识 |
| | | } |
| | | }); |
| | | |
| | | // 同时保存 projectNo 到 localStorage 供后续页面使用 |
| | | localStorage.setItem('projectNo', row.projectNumber); |
| | | console.log("projectNo:", row.projectNumber); |
| | | } catch (error) { |
| | | console.error('路由跳转失败:', error); |
| | | ElMessage.error('页面跳转失败'); |
| | | } |
| | | })(); |
| | | return; |
| | | } |
| | | if (config.code === 'delProject') { |
| | |
| | | xGrid.value.reloadData(produceList.value); |
| | | } |
| | | |
| | | // 显示成功消息 |
| | | ElMessage.success(config.successMsg); |
| | | }else{ |
| | | ElMessage.warning(config.checkMessage); |
| | | return; |
| | | } |
| | | } |
| | | else if(config.code === 'production'){ |
| | | if(row.temperingState==1&&row.optimizeState===1&&row.state===1){ |
| | | if(row.optimizeState===1&&row.state===1){ |
| | | row.state = config.targetState; |
| | | code=3 |
| | | }else{ |
| | |
| | | } |
| | | } |
| | | |
| | | function updateProjectStateAndHandleResponse(row, projectNumber, targetState,targetStates,code, successMsg) { |
| | | function updateProjectStateAndHandleResponse(row, projectNumber, targetState, targetStates, code, successMsg) { |
| | | const updateParams = { |
| | | projectNumber: projectNumber, |
| | | stateToUpdate: targetState, |
| | |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).then((res) => { |
| | | // 检查业务状态码,如果是201则抛出错误以在catch中处理 |
| | | if (Number(res.code) === 201) { |
| | | // 抛出自定义错误对象,包含后端返回的msg信息 |
| | | throw new Error(res.msg || '操作失败'); |
| | | } |
| | | if (Number(res.code) === 200 && (res.msg === "" || res.msg === null)) { |
| | | ElMessage.success(successMsg); |
| | | } else { |
| | |
| | | } |
| | | }).catch((error) => { |
| | | console.error('请求出错,操作未完成,详细错误信息:', error); |
| | | const errorMsg = (res.data && res.data.errorMessage) ? res.data.errorMessage : '操作失败,未获取到具体原因,请联系管理员'; |
| | | ElMessage.error(`请求出错,操作未完成,原因: ${errorMsg}`); |
| | | //const errorMsg = (res.data && res.data.errorMessage) ? res.data.errorMessage : '操作失败,未获取到具体原因,请联系管理员'; |
| | | ElMessage.error(`请求出错,操作未完成 `+error); |
| | | rollbackStateAndReloadGrid(row, targetState); // 调用回滚函数 |
| | | }); |
| | | } |
| | |
| | | </div> |
| | | </template> |
| | | |
| | | <template #select_filter1="{ 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="1" label="是"></vxe-option> |
| | | <vxe-option value="0" label="否"></vxe-option> |
| | | </vxe-select> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |