| | |
| | | // 监听子组件ComputeCard的数据 |
| | | |
| | | |
| | | |
| | | const computeCardRef=ref(null) |
| | | |
| | | |
| | | const handleCardData = (data) => { |
| | |
| | | } |
| | | |
| | | const handleSimulation = async () => { |
| | | const data=computeCardRef.value.selectFullData(); |
| | | console.log(data) |
| | | const loading = ElLoading.service({ |
| | | lock: true, |
| | | text: '正在计算中,请稍候...', |
| | |
| | | </div> |
| | | |
| | | <div id="computeCard"> |
| | | <compute-card :table-data="receivedData" |
| | | <compute-card ref="computeCardRef" :table-data="receivedData" |
| | | :process-id="projectRow.processId===null?null:projectRow.processId" |
| | | :technology-number="projectRow.technologyNumber===null?null:projectRow.technologyNumber" |
| | | @upProcessId="handleUpdateProcessId" @updateTechnologyNumber="handleTechnologyNumberUpdate" @sendData="handleCardData" |
| | |
| | | import {nextTick, onMounted, reactive, ref, watch} from "vue"; |
| | | import request from "@/utils/request"; |
| | | import {useI18n} from "vue-i18n"; |
| | | import {ElMessage} from "element-plus"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | const { t } = useI18n() |
| | | |
| | | const xGrid = ref() |
| | |
| | | |
| | | columns:[ |
| | | {type: 'seq', title: t('basicData.Number'), width: 80}, |
| | | {field: "mq", title: '幕墙模式', width: 80, slots: { default: 'state' }}, |
| | | {field: "hp", title: '允许横排', width: 80, slots: { default: 'state' }}, |
| | | {field: "tempering", title: '钢化', width: 80, slots: { default: 'state' }}, |
| | | {field: 'curtain_wall',type:'checkbox',title: '幕墙模式', width: 80}, |
| | | {field: 'allow_rotate',type:'checkbox',title: '允许横排', width: 80}, |
| | | {field: 'tempering',type:'checkbox',title: '钢化', width: 80}, |
| | | /*{field: "allow_rotate", title: '允许横排', width: 80, slots: { default: 'state' }}, |
| | | {field: "tempering", title: '钢化', width: 80, slots: { default: 'state' }},*/ |
| | | |
| | | {field: 'process_id',width: 150, title: t('processCard.processId'), sortable: true}, |
| | | {field: 'technology_number',width: 70, title: '层', sortable: true}, |
| | | {field: 'TotalFloors',width: 150, title: '总层数', sortable: true}, |
| | | {field: 'processId',width: 150, title: t('processCard.processId'), sortable: true}, |
| | | {field: 'technologyNumber',width: 70, title: '层', sortable: true}, |
| | | {field: 'total_layers',width: 150, title: '总层数', sortable: true}, |
| | | {field: 'TotalNumber',width: 150, title: '规格', sortable: true}, |
| | | {field: 'quantity',width: 150, title: t('order.quantity'), sortable: true}, |
| | | {field: 'total_num',width: 150, title: t('order.quantity'), sortable: true}, |
| | | {field: 'glass_child',width: 150, title: t('order.product'), sortable: true}, |
| | | {field: 'project', width:150, title: t('order.project'), showOverflow: "ellipsis"}, |
| | | {field: 'area',width: 150, title: t('order.area'), sortable: true}, |
| | | {field: 'total_area',width: 150, title: t('order.area'), sortable: true}, |
| | | |
| | | |
| | | ],//表头参数 |
| | |
| | | ]); |
| | | |
| | | |
| | | |
| | | const selectFullData = () => { |
| | | return xGrid.value.getTableData().fullData |
| | | } |
| | | |
| | | |
| | | const props = defineProps({ |
| | |
| | | technologyNumber: null, |
| | | patchState: null, |
| | | }); |
| | | const handleCheckChange=({ column, records })=> { |
| | | if (column.field === 'tempering') { |
| | | console.log(records) |
| | | } |
| | | } |
| | | |
| | | watch(() => props.tableData, async (newData) => { |
| | | if (Array.isArray(newData)) { |
| | | gridOptions.data = newData; |
| | | await nextTick(); |
| | | console.log(newData) |
| | | xGrid.value.loadData(deepClone(newData)) |
| | | const data=xGrid.value.getTableData().fullData |
| | | data.forEach(item => { |
| | | item.tempering = item.tempering === 1; |
| | | item.allow_rotate = item.allow_rotate === 1; |
| | | item.curtain_wall = item.curtain_wall === 1; |
| | | }) |
| | | xGrid.value.reloadData(data); |
| | | /*await nextTick(); |
| | | if (xGrid.value) { |
| | | const grid = xGrid.value; |
| | | if (typeof grid.refresh === 'function') { |
| | |
| | | // 提取所有唯一的process_id |
| | | const processIds = Array.from(new Set(newData.map(item => item.process_id))); |
| | | |
| | | /*const requests = newData.map(item => |
| | | /!*const requests = newData.map(item => |
| | | request.post(`/glassOptimize/selectComputeDetail/${item.process_id}/${item.technologyNumber}/${item.patchState}`) |
| | | );*/ |
| | | );*!/ |
| | | |
| | | /*try { |
| | | /!*try { |
| | | const responses = await Promise.all(requests); |
| | | |
| | | // 整合数据 |
| | |
| | | emit('sendData', processData); |
| | | } catch (error) { |
| | | console.error('请求失败:', error); |
| | | }*/ |
| | | } |
| | | }*!/ |
| | | }*/ |
| | | } else { |
| | | console.error('传递给表格的数据格式不符合要求,期望是数组格式'); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | defineExpose({selectFullData}) |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | @checkbox-change="handleCheckChange" |
| | | > |
| | | <template #num2_filter="{ column, $panel }"> |
| | | <div> |
| | |
| | | return Result.seccess(glassOptimizeService.selectProjectComputeSv(projectNumber)); |
| | | } |
| | | |
| | | //模拟计算工程号查询 |
| | | @ApiOperation("模拟计算工程数据查询") |
| | | @PostMapping ("/selectProjectComputeAll/{projectNumber}") |
| | | public Result selectProjectComputeAll( |
| | | @PathVariable String projectNumber){ |
| | | return Result.seccess(glassOptimizeService.selectProjectComputeAll(projectNumber)); |
| | | } |
| | | |
| | | //模拟计算流程卡详情 |
| | | @ApiOperation("模拟计算流程卡详情") |
| | | @PostMapping ("/selectComputeDetail/{processId}/{technologyNumber}/{patchState}") |
| | |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object>selectProjectComputeAll(String projectNumber) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<Map<String, Object>> projectComputeMpList=glassOptimizeMapper.selectProjectComputeMp(projectNumber); |
| | | for (Map<String, Object> stringObjectMap : projectComputeMpList) { |
| | | stringObjectMap.get("process_id"); |
| | | stringObjectMap.get("technology_number"); |
| | | } |
| | | map.put("data", glassOptimizeMapper.selectProjectComputeMp(projectNumber)); |
| | | //map.put("project", glassOptimizeMapper.selectProjectCount(projectNumber)); |
| | | return map; |
| | | } |
| | | |
| | | //模拟计算流程卡详情 |
| | | public Map<String, Object>selectComputeDetailSv(String processId,Integer technologyNumber,String patchState) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | <!--模拟计算查询流程卡--> |
| | | <select id="selectProjectComputeMp"> |
| | | select |
| | | 流程卡号 as process_id, |
| | | 层 as technology_number, |
| | | 总层数 as TotalFloors, |
| | | 流程卡号 as processId, |
| | | 层 as technologyNumber, |
| | | 总层数 as total_layers, |
| | | 规格 as TotalNumber, |
| | | 数量 as quantity, |
| | | 数量 as total_num, |
| | | 项目 as project, |
| | | 产品名称 as glass_child, |
| | | 面积 as area, |
| | | 面积 as total_area, |
| | | tempering as tempering, |
| | | merge as merge, |
| | | patch_state as patch_state |
| | | patch_state as patch_state, |
| | | 0 as allow_rotate, |
| | | 0 as curtain_wall, |
| | | 0 as priority_level, |
| | | 1 as is_must |
| | | from pp.v_optimize_init_project_process_summary where project_no = #{projectNo} |
| | | </select> |
| | | |