Merge branch 'master' of http://bore.pub:10439/r/ERP_override
| | |
| | | |
| | | const processId = produceList.value[i].detail[0].process_id; |
| | | const url = `${processId}/${technologyNumber}`; |
| | | console.log(url) |
| | | // 生成 QR Code 并存储到数组中 |
| | | const qrcodeData = await QRCode.toDataURL(url); |
| | | produceList.value[i].detail[0]["qrcodeList"].push({ |
| | |
| | | } |
| | | |
| | | |
| | | produceList.value.forEach(item => { |
| | | let technologyNumberMerge = printMerge.split('').join(','); |
| | | item.detail[0].technologyNumberMerge = technologyNumberMerge |
| | | }) |
| | | // produceList.value.forEach(item => { |
| | | // let technologyNumberMerge = printMerge.split('').join(','); |
| | | // item.detail[0].technologyNumberMerge = technologyNumberMerge |
| | | // }) |
| | | //处理编号列 |
| | | //定义存放编号数组 |
| | | const s01Values = []; |
| | |
| | | import ComputeCard from "@/views/pp/glassOptimize/page/ComputeCard.vue"; |
| | | import ComputeDetail from "@/views/pp/glassOptimize/page/ComputeDetail.vue"; |
| | | import Compute from "@/views/pp/glassOptimize/page/Compute.vue"; |
| | | import {ref, watch} from 'vue'; |
| | | import {onMounted, ref} from 'vue'; |
| | | import {ElMessage} from "element-plus"; |
| | | import request from "@/utils/request"; |
| | | |
| | | const props = defineProps({ |
| | | projectNo : String |
| | | }); |
| | | |
| | | onMounted(() => { |
| | | if (props.projectNo) { |
| | | handleFetchData(props.projectNo); |
| | | } |
| | | }); |
| | | |
| | | // 用于存储从后端获取到的数据,初始化为空数组 |
| | | const receivedData = ref([]); |
| | |
| | | } |
| | | }; |
| | | |
| | | // 用于从获取到的数据中提取流程卡号(processId) |
| | | const extractProcessCardNumbers = (data) => { |
| | | if (typeof data === 'string') { |
| | | console.log('流程卡号为字符串类型,直接返回该字符串:', data); |
| | | return data; |
| | | } |
| | | if (Array.isArray(data)) { |
| | | const processCardNumbers = data.map(item => item.process_id); |
| | | console.log('提取到的流程卡号数组:', processCardNumbers); |
| | | return processCardNumbers; |
| | | } |
| | | console.log('传入的数据类型不符合要求,无法提取流程卡号'); |
| | | return []; |
| | | //接受子组件ComputeCard的流程卡号 |
| | | let projectRow = ref({ |
| | | processId:null, |
| | | }) |
| | | const handleUpdateProcessId = newProcessId => { |
| | | projectRow.value.processId = newProcessId; |
| | | console.log('接收到子组件获取的流程卡号为',projectRow.value.processId) |
| | | }; |
| | | |
| | | const props = defineProps({ |
| | | projectNo : String |
| | | }); |
| | | |
| | | </script> |
| | | |
| | |
| | | </div> |
| | | |
| | | <div id="computeCard"> |
| | | <compute-card :table-data="receivedData" /> |
| | | <compute-card :table-data="receivedData" |
| | | :process-id="projectRow.processId===null?null:projectRow.processId" |
| | | @upProcessId="handleUpdateProcessId" |
| | | /> |
| | | </div> |
| | | |
| | | <div id="computeDetail"> |
| | | <compute-detail :process-card-numbers="extractProcessCardNumbers(receivedData)" /> |
| | | <compute-detail :process-id="projectRow.processId===null?null:projectRow.processId" /> |
| | | </div> |
| | | |
| | | </div> |
| | |
| | | height: 40%; |
| | | } |
| | | #computeCard{ |
| | | margin-top: 100px; |
| | | margin-top: 90px; |
| | | width: 64%; |
| | | height: 40%; |
| | | float: left; |
| | |
| | | [ |
| | | {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'}, |
| | |
| | | actionFunction: async ({row}) => { |
| | | const projectNumber = row.projectNumber; |
| | | emit('switch-dialog', projectNumber); |
| | | } |
| | | }, |
| | | { |
| | | code: 'optimizeTypography', |
| | | initialState: ['10', '20','100'], // |
| | | targetState: null, |
| | | successMsg: '优化排版已启动!', |
| | | checkMessage: '当前工程状态不符合优化排版条件,请确认工程状态后再操作!', |
| | | requiresRow: true, |
| | | Typography: 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 |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | { |
| | |
| | | }); |
| | | } else if (config.code === 'compute') { |
| | | config.actionFunction({row}); |
| | | } else { |
| | | } 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) { |
| | |
| | | <script setup> |
| | | import {reactive, ref} from "vue"; |
| | | import {reactive, ref, watch} from "vue"; |
| | | import {useI18n} from "vue-i18n"; |
| | | import {Platform, Search, SuccessFilled} from "@element-plus/icons-vue"; |
| | | |
| | |
| | | projectNo : String |
| | | }); |
| | | // 定义响应式数据,用于绑定工程号输入框的值 |
| | | const projectNumber = ref(props.projectNo); |
| | | const inputValue = ref(props.projectNo); |
| | | |
| | | let emit = defineEmits(['fetch-data']); |
| | | |
| | | const handleSearchClick = () => { |
| | | // 通过 $emit 触发自定义事件,将工程号传递给父组件,由父组件去调用接口获取数据 |
| | | emit('fetch-data', projectNumber.value); |
| | | emit('fetch-data', inputValue.value); |
| | | }; |
| | | |
| | | |
| | |
| | | <div id="title" style="margin-top: -10px"> |
| | | <span> |
| | | 工程编号 |
| | | <el-input style="width:150px;margin-left: 30px" clearable v-model="projectNumber" placeholder="请输入工程号"></el-input> |
| | | <el-input style="width:150px;margin-left: 30px" clearable v-model="inputValue" placeholder="请输入工程号"></el-input> |
| | | <el-button |
| | | type="primary" |
| | | :icon="Search" |
| | |
| | | |
| | | }) |
| | | let emit = defineEmits([ |
| | | 'changeDialog' |
| | | 'changeDialog','upProcessId' |
| | | ]); |
| | | |
| | | const props = defineProps({ |
| | | tableData: Array |
| | | }); |
| | | |
| | | onMounted(() => { |
| | | if (xGrid.value) { |
| | | const grid = xGrid.value; |
| | | if (typeof grid.setDirty === 'function') { |
| | | grid.setDirty(true); |
| | | } |
| | | } else { |
| | | console.error('vxe-grid 组件实例未获取到,可能挂载出现问题'); |
| | | } |
| | | tableData: Array, |
| | | processId: null, |
| | | }); |
| | | |
| | | watch(() => props.tableData, async (newData) => { |
| | |
| | | console.error('传递给表格的数据格式不符合要求,期望是数组格式'); |
| | | } |
| | | }); |
| | | |
| | | let process_id = ref() |
| | | //获取流程卡号详情 |
| | | let rowClickIndex = ref(null) |
| | | const gridEvents = { |
| | | cellClick({row}) { |
| | | rowClickIndex.value = row |
| | | // Emit 事件将更新后的值传递给父组件 |
| | | emit('upProcessId', rowClickIndex.value.process_id); |
| | | } |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | > |
| | | <template #num2_filter="{ column, $panel }"> |
| | | <div> |
| | |
| | | <script setup> |
| | | import {reactive, ref} from "vue"; |
| | | import {onMounted, reactive, ref, watch} from "vue"; |
| | | import {useI18n} from "vue-i18n"; |
| | | import request from "@/utils/request"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {Minus, Plus, Search} from "@element-plus/icons-vue"; |
| | | const { t } = useI18n() |
| | | |
| | | // 接收父组件传递过来的流程卡号(processId) |
| | | let props = defineProps({ |
| | | processId:null, |
| | | }); |
| | | |
| | | const xGrid = ref() |
| | | |
| | |
| | | |
| | | }) |
| | | |
| | | // 通过props接收父组件传递过来的流程卡号(processId) |
| | | const props = defineProps({ |
| | | processCardNumbers: String |
| | | }); |
| | | |
| | | // 用于记录当前显示的流程卡号在数组中的索引位置,初始值为0,即显示第一个元素 |
| | | const currentIndex = ref(0); |
| | | |
| | | const selectComputeDetail = async () => { |
| | | let processId; |
| | | if (typeof props.processCardNumbers === 'string') { |
| | | processId = props.processCardNumbers; |
| | | } else if (Array.isArray(props.processCardNumbers)) { |
| | | if (props.processCardNumbers.length > 0) { |
| | | processId = props.processCardNumbers[currentIndex.value]; |
| | | } else { |
| | | console.error('流程卡号数组不符合预期或者索引超出范围,无法发起请求'); |
| | | ElMessage.error('没有有效的流程卡号数据,请检查数据来源'); |
| | | return; |
| | | } |
| | | } else { |
| | | console.error('接收到的流程卡号数据类型不符合预期,无法进行后续操作'); |
| | | ElMessage.error('接收到的流程卡号数据格式不正确,请检查数据来源'); |
| | | return; |
| | | } |
| | | try { |
| | | const res = await request.post(`/glassOptimize/selectComputeDetail/${processId}`); |
| | | if ((Number(res.code) === 200)) { |
| | | xGrid.value.loadData(res.data.data); |
| | | } else { |
| | | ElMessage.warning(res.msg); |
| | | console.error('请求获取流程卡详情失败,状态码:', res.code, ',错误信息:', res.msg); |
| | | } |
| | | } catch (error) { |
| | | console.error('调用loadData方法加载数据时出现错误:', error); |
| | | ElMessage.error('加载表格数据时发生错误,请检查相关代码或联系开发人员'); |
| | | } |
| | | }; |
| | | |
| | | // 新增函数用于点击按钮时更新当前显示的流程卡号索引位置,实现切换显示下一个或上一个流程卡号 |
| | | const handleChangeProcessCard = (step) => { |
| | | if (Array.isArray(props.processCardNumbers)) { |
| | | if (step > 0 && currentIndex.value < props.processCardNumbers.length - 1) { |
| | | currentIndex.value++; |
| | | } else if (step < 0 && currentIndex.value > 0) { |
| | | currentIndex.value--; |
| | | } else { |
| | | if (step > 0) { |
| | | ElMessage.warning('已经是最后一个流程卡号'); |
| | | } else { |
| | | ElMessage.warning('已经是第一个流程卡号'); |
| | | watch( |
| | | () => props.processId, |
| | | (newValue, oldValue) => { |
| | | if (props.processId!=null){ |
| | | selectComputeDetail() |
| | | } |
| | | } |
| | | ); |
| | | |
| | | const selectComputeDetail = () => { |
| | | if (props.processId!=null || props.processId!=""){ |
| | | request.post(`/glassOptimize/selectComputeDetail/${props.processId}`).then((res) => { |
| | | if(Number(res.code) === 200){ |
| | | xGrid.value.loadData(res.data.data) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | }; |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div style="width: 100%;height: 100%"> |
| | | <span>流程卡详情 |
| | | <el-input style="width: 180px" :value="props.processCardNumbers[currentIndex]"></el-input> |
| | | <el-button type="primary" style="margin-left: 10px" @click="handleChangeProcessCard(-1)" :icon="Minus"></el-button> |
| | | <el-button type="primary" style="margin-left: 10px" @click="handleChangeProcessCard(1)" :icon="Plus"></el-button> |
| | | <el-button type="primary" style="margin-left: 10px;" @click="selectComputeDetail" :icon="Search">查看</el-button> |
| | | </span> |
| | | <span>流程卡详情</span> |
| | | <vxe-grid |
| | | size="small" |
| | | @filter-change="filterChanged" |
| | |
| | | |
| | | List<Map<String,String>> SelectTechnologicalNumMp(String processIdStr, String technologyStr, String process, String reportType); |
| | | |
| | | List<Map<String,String>> SelectReworlDetailMp(String processIdStr, String technologyStr, String process, String previousProcess); |
| | | List<Map<String,String>> SelectReworlDetailMp(String processIdStr, String technologyStr, String process, String previousProcess, String laminating); |
| | | |
| | | List<Map<String,String>> SelectProcessMp(); |
| | | |
| | |
| | | |
| | | List<Map<String,String>> getSelectProcessDuoqu(); |
| | | |
| | | List<Map<String, String>> SelectReworlDetailMpReview(String processIdStr, String technologyStr, String process, String previousProcess); |
| | | List<Map<String, String>> SelectReworlDetailMpReview(String processIdStr, String technologyStr, String process, String previousProcess, String laminating); |
| | | |
| | | String getProcessLaminating(String process); |
| | | } |
| | |
| | | |
| | | public Map<String, Object> AddSelectLastWorkSv(String processIdStr, String technologyStr, String process, String reportType) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //获取报工工序是否为复合工程 |
| | | String laminating = reportingWorkMapper.getProcessLaminating(process); |
| | | //查询流程卡工艺流程 |
| | | String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(processIdStr,technologyStr); |
| | | |
| | |
| | | if (retrievedData!=null){ |
| | | Integer reviewedState = retrievedData.getReviewedState(); |
| | | //根据审核状态查询未审核数据 |
| | | System.out.println(laminating); |
| | | if (reviewedState==1){//已审核 |
| | | //不是第一道工序,查询报工数据 |
| | | List<Map<String,String>> details = reportingWorkMapper.SelectReworlDetailMp(processIdStr, technologyStr, process,previousProcess); |
| | | List<Map<String,String>> details = reportingWorkMapper.SelectReworlDetailMp(processIdStr, technologyStr, process,previousProcess,laminating); |
| | | if(process.equals("中空")){ |
| | | String orderId = processIdStr.substring(0,10); |
| | | details.forEach( detail -> { |
| | |
| | | map.put("Detail",details ); |
| | | }else { |
| | | //不是第一道工序,查询报工数据 |
| | | List<Map<String,String>> details = reportingWorkMapper.SelectReworlDetailMpReview(processIdStr, technologyStr, process,previousProcess); |
| | | List<Map<String,String>> details = reportingWorkMapper.SelectReworlDetailMpReview(processIdStr, technologyStr, process,previousProcess,laminating); |
| | | if(process.equals("中空")){ |
| | | String orderId = processIdStr.substring(0,10); |
| | | details.forEach( detail -> { |
| | |
| | | |
| | | WHERE |
| | | fc.process_id = #{processIdStr} |
| | | <if test="process != '中空' and process != '夹胶' and process != '包装' and process != '打胶和粘框' "> |
| | | <if test="laminating != 'laminating'"> |
| | | AND POSITION(fc.technology_number in #{technologyStr}) |
| | | </if> |
| | | AND odpd.process = #{process} |
| | |
| | | on rws.process_id = fc.process_id and rws.order_number=fc.order_number and rws.technology_number=fc.technology_number |
| | | WHERE |
| | | fc.process_id = #{processIdStr} |
| | | <if test="process != '中空' and process != '夹胶' and process != '包装' and process != '打胶和粘框' "> |
| | | <if test="laminating != 'laminating' "> |
| | | AND POSITION(fc.technology_number in #{technologyStr}) |
| | | </if> |
| | | AND odpd.process = #{process} |
| | | and rws.reviewed_state=0 |
| | | order by fc.order_number |
| | | </select> |
| | | |
| | | <select id="getProcessLaminating"> |
| | | select IFNULL(nickname,'') from sd.basic_data where basic_category='process' and basic_name=#{process} |
| | | </select> |
| | | </mapper> |