guoyuji
2024-12-23 c672718058ad0559b4811ccb4797fa322a3c35af
Merge branch 'master' of http://bore.pub:10439/r/ERP_override
9个文件已修改
227 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/components/pp/PrintProcess.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/GlassComputed.vue 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/ProjectMange.vue 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/Compute.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ComputeCard.vue 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ComputeDetail.vue 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/pp/PrintProcess.vue
@@ -95,6 +95,7 @@
    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({
@@ -197,10 +198,10 @@
  }
  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 = [];
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/GlassComputed.vue
@@ -2,10 +2,19 @@
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([]);
@@ -30,24 +39,14 @@
  }
};
// 用于从获取到的数据中提取流程卡号(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>
@@ -59,11 +58,14 @@
    </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>
@@ -78,7 +80,7 @@
  height: 40%;
}
#computeCard{
  margin-top: 100px;
  margin-top: 90px;
  width: 64%;
  height: 40%;
  float: left;
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/ProjectMange.vue
@@ -81,7 +81,7 @@
        [
          {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'},
@@ -139,6 +139,27 @@
    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
        }
      });
    }
  },
  {
@@ -293,7 +314,15 @@
              });
            } 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) {
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/Compute.vue
@@ -1,5 +1,5 @@
<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";
@@ -90,13 +90,13 @@
  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);
};
@@ -108,7 +108,7 @@
    <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"
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ComputeCard.vue
@@ -69,22 +69,12 @@
})
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) => {
@@ -101,6 +91,18 @@
    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>
@@ -113,6 +115,7 @@
        class="mytable-scrollbar"
        ref="xGrid"
        v-bind="gridOptions"
        v-on="gridEvents"
    >
      <template #num2_filter="{ column, $panel }">
        <div>
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ComputeDetail.vue
@@ -1,10 +1,15 @@
<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()
@@ -56,72 +61,32 @@
})
// 通过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"
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java
@@ -24,7 +24,7 @@
    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();
@@ -95,5 +95,7 @@
    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);
}
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
@@ -81,6 +81,8 @@
    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);
@@ -142,9 +144,10 @@
                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 -> {
@@ -161,7 +164,7 @@
                        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 -> {
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -255,7 +255,7 @@
        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}
@@ -993,11 +993,15 @@
        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>