Merge branch 'master' of http://bore.pub:10439/r/ERP_override
| | |
| | | component: () => import('../views/pp/glassOptimize/OptimizePrint.vue'), |
| | | }, |
| | | { |
| | | path: '/projectDetail/:projectNo', |
| | | name: 'projectDetail', |
| | | component: () => import('../views/pp/glassOptimize/OptimizeProject.vue'), |
| | | }, |
| | | { |
| | | path: '', |
| | | redirect:'/main/glassOptimize/optimizeProject' |
| | | } |
| | |
| | | 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"> |
| | |
| | | dialogVisible.value = true |
| | | detailPage.value = value |
| | | } |
| | | |
| | | //从工程管理获取工程号,并跳转 |
| | | const projectNumber = ref(''); |
| | | const switchDialog = (number) => { |
| | | projectNumber.value = number; |
| | | detailPage.value = 3; |
| | | }; |
| | | |
| | | </script> |
| | | |
| | | <template > |
| | |
| | | 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> |
| | |
| | | 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({ |
| | |
| | | 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}, |
| | |
| | | // 定义操作配置对象数组,集中管理不同操作选项对应的参数 |
| | | 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, |
| | |
| | | checkMessage: '当前工程状态不符合模拟计算条件,请确认工程状态后再操作!', |
| | | requiresRow: true, |
| | | actionFunction: async ({row}) => { |
| | | console.log('获取的行数据', row); |
| | | try { |
| | | // 使用浏览器原生Clipboard API复制工程号 |
| | | await navigator.clipboard.writeText(row.projectNumber); |
| | | console.log('工程号已复制到剪贴板'); |
| | | ElMessage.success('工程号已成功复制'); |
| | | } catch (error) { |
| | | console.error('复制工程号时出错:', error); |
| | | ElMessage.error('复制工程号失败,请稍后重试'); |
| | | } |
| | | optimizeCompute.value = true; |
| | | Mange.value = false; |
| | | const projectNumber = row.projectNumber; |
| | | emit('switch-dialog', projectNumber); |
| | | } |
| | | }, |
| | | { |
| | | code: 'undocompute', |
| | | code: 'undoCompute', |
| | | initialState: '10', |
| | | targetState: 2, |
| | | successMsg: '撤销模拟计算成功,数据已更新!', |
| | |
| | | requiresRow: true, |
| | | }, |
| | | { |
| | | code: 'undooptimize', |
| | | code: 'undoOptimize', |
| | | initialState: '20', |
| | | targetState: 10, |
| | | successMsg: '撤销优化成功,数据已更新!', |
| | |
| | | requiresRow: true, |
| | | }, |
| | | { |
| | | code: 'Initializeproject', |
| | | code: 'InitializeProject', |
| | | initialState: ['2', '10', '20'], |
| | | targetState: 1, |
| | | successMsg: '初始化工程成功!', |
| | |
| | | requiresRow: true, |
| | | }, |
| | | { |
| | | code: 'delproject', |
| | | code: 'delProject', |
| | | initialState: ['1', '2', '10', '20', '100'], |
| | | targetState: null, |
| | | successMsg: '工程删除成功!', |
| | |
| | | failureMsg: '工程删除失败,请联系管理员!', |
| | | } |
| | | ]; |
| | | |
| | | function getOriginalState(targetState) { |
| | | // 根据工程状态返回对应的原始状态 |
| | | const stateMapping = { |
| | |
| | | }; |
| | | return stateMapping[targetState] || targetState; |
| | | } |
| | | |
| | | //右键菜单条件判断 |
| | | function checkOperationCondition(config, row) { |
| | | if (!config.requiresRow ||!row) { |
| | |
| | | } |
| | | return config.initialState === String(row.state); |
| | | } |
| | | |
| | | // 右键菜单点击事件 |
| | | const gridEvents = { |
| | | menuClick({ menu, row }) { |
| | |
| | | }); |
| | | return; |
| | | } |
| | | if (config.code === 'delproject') { |
| | | if (config.code === 'delProject') { |
| | | if (!row) { |
| | | ElMessage.warning(config.checkMessage); |
| | | return; |
| | |
| | | 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 { |
| | | } |
| | | else { |
| | | row.state = config.targetState; |
| | | const index = produceList.value.findIndex(item => item === row); |
| | | if (index!== -1) { |
| | |
| | | console.error(`未找到操作选项 ${menu.code} 对应的配置,请检查配置项`); |
| | | } |
| | | } |
| | | }, |
| | | cellDblclick: ({ row }) => { |
| | | const menu = { code: 'openProject' }; |
| | | gridEvents.menuClick({ menu, row }); // 直接通过gridEvents对象调用menuClick |
| | | } |
| | | }; |
| | | |
| | | // 封装发送右键菜单请求、处理响应以及错误回滚等逻辑的函数 |
| | | function rollbackStateAndReloadGrid(row, targetState) { |
| | | row.state = getOriginalState(targetState); |
| | |
| | | xGrid.value.reloadData(produceList.value); |
| | | } |
| | | } |
| | | |
| | | function updateProjectStateAndHandleResponse(row, projectNumber, targetState, successMsg) { |
| | | const updateParams = { |
| | | projectNumber: projectNumber, |
| | |
| | | }); |
| | | } |
| | | |
| | | //定义模拟计算弹窗默认隐藏 |
| | | const optimizeCompute = ref(false) |
| | | const Mange = ref(true) |
| | | //定义切换模拟计算弹窗 |
| | | const emit = defineEmits(['switch-dialog']); |
| | | |
| | | //定义工程状态 |
| | | const optionVal = ref('all') |
| | |
| | | |
| | | <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 |
| | |
| | | <el-input class="input" disabled v-model="originalPieceQuantityInput"></el-input> |
| | | 原片面积 |
| | | <el-input class="input" disabled v-model="originalPieceAreaInput"></el-input> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | }, |
| | | ] |
| | | |
| | | //获取工程号 |
| | | const props = defineProps({ |
| | | projectNo : String |
| | | }); |
| | | // 定义响应式数据,用于绑定工程号输入框的值 |
| | | const projectNumber = ref(''); |
| | | const projectNumber = ref(props.projectNo); |
| | | |
| | | let emit = defineEmits(['fetch-data']); |
| | | |
| | |
| | | <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() |
| | | |
| | |
| | | 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, |
| | |
| | | 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 |
| | |
| | | }, |
| | | |
| | | { |
| | | field: '', |
| | | field: 'shelf_number', |
| | | width: 150, |
| | | title: '架号', |
| | | filters: [{data: ''}], |
| | |
| | | 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(() => { |
| | | if (projectNo.value) { |
| | | fetchData(); |
| | | } |
| | | }); |
| | | |
| | | |
| | |
| | | <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]" |
| | |
| | | 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)))) |