chenlu
2024-06-26 d51849adc8c0ec04bc2384a230e007f5ba562140
合并流程卡打印功能,修改报表部分语言显示错误和问题
12个文件已修改
238 ■■■■■ 已修改文件
north-glass-erp/northglass-erp/src/router/index.js 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/Replenish/PrintRepairFlowCard.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/Replenish/PrintRepairProcess.vue 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/Replenish/PrintReplenishFlowCard.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/Replenish/Replenish.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/Replenish/SelectPrintRepairFlowCard.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintProcess.vue 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/report/RawMaterialRequisition.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/ReplenishController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReplenishService.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/Report.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/router/index.js
@@ -461,6 +461,26 @@
              component: () => import('../views/pp/Replenish/SelectReplenish.vue'),
            },
            {
              path: 'selectPrintRepairFlowCard',
              name: 'selectPrintRepairFlowCard',
              component: () => import('../views/pp/Replenish/SelectPrintRepairFlowCard.vue'),
            },
            {
              path: 'printRepairFlowCard',
              name: 'printRepairFlowCard',
              component: () => import('../views/pp/Replenish/PrintRepairFlowCard.vue'),
            },
            {
              path: 'printRepairProcess',
              name: 'printRepairProcess',
              component: () => import('../views/pp/Replenish/PrintRepairProcess.vue'),
            },
            {
              path: 'printReplenishFlowCard',
              name: 'printReplenishFlowCard',
              component: () => import('../views/pp/Replenish/PrintReplenishFlowCard.vue'),
            },
            {
              path: '',
              redirect:'/main/Replenish/SelectReplenish'
            }
north-glass-erp/northglass-erp/src/views/pp/Replenish/PrintRepairFlowCard.vue
@@ -99,6 +99,10 @@
  },
]
//合片流程卡打印下拉选项
const printMerge = ref('')
const printMergeOptions=[{}]
//打印类型
const printType = ref()
@@ -163,7 +167,7 @@
    useKey: true
  },
  filterConfig: {   //筛选配置项
                    // remote: true
    // remote: true
  },
  customConfig: {
    storage: true
@@ -220,7 +224,6 @@
  toolbarConfig: {
    buttons: [
      {code: 'print', name: t('processCard.print'), status: 'primary'},
      {code: 'printLabel', name: t('processCard.printLabel'), status: 'primary'},
      {code: 'customLabel', name: t('processCard.customLabelPrinting'), status: 'primary'},
    ],
@@ -271,7 +274,7 @@
              id += selectRecords[i].id + "|"
            }
          }
          router.push({path: '/main/processCard/printProcess', query: {printList: JSON.stringify(selectRecords)}})
          router.push({path: '/main/processCard/printProcess', query: {printList: JSON.stringify(selectRecords),printMerge:printMerge.value}})
          break
        }
@@ -373,7 +376,7 @@
    useKey: true
  },
  filterConfig: {   //筛选配置项
                    // remote: true
    // remote: true
  },
  customConfig: {
    storage: true
@@ -488,6 +491,8 @@
<template>
  <div class="main-div-customer">
    <el-input clearable placeholder="合并打印" v-model="printMerge" style="width: 90px"></el-input>
    &nbsp;
    <label>{{$t('processCard.labelStyle')}}:</label>
    <el-select v-model="printType" clearable default-value="default_city" :placeholder="$t('processCard.pleaseSelect')" style="width: 120px">
      <el-option
@@ -539,7 +544,7 @@
      </template>
      <!--左边固定显示的插槽-->
<!--      v-if="userStore.user.permissions.indexOf('SelectProductionBasicData.edit') > -1"-->
      <!--      v-if="userStore.user.permissions.indexOf('SelectProductionBasicData.edit') > -1"-->
      <template #button_slot="{ row }">
        <el-button @click="getTableRow(row,'edit')"
                   link
north-glass-erp/northglass-erp/src/views/pp/Replenish/PrintRepairProcess.vue
@@ -22,6 +22,7 @@
const {currentRoute} = useRouter()
const route = currentRoute.value
const printMerge = route.query.printMerge
data.value.printList = JSON.parse(route.query.printList)
let flowCardCount = data.value.printList.length
onMounted(() => {
@@ -33,7 +34,12 @@
        if (res.code == 200) {
          produceList.value = deepClone(res.data.data)
          console.log(produceList.value)
          if (printMerge!==null && printMerge!==undefined && printMerge!==""){
            produceList.value.forEach(item => {
              item.detail[0].technologyNumber = printMerge;
            });
          }
          handleGetQRCode()
        } else {
          ElMessage.warning(res.msg)
@@ -48,12 +54,21 @@
const handleGetQRCode = async () => {
  for (let i = 0; i < produceList.value.length; i++) {
    list= produceList.value[i].detail[0].processIdNumber;
    const url = `${list}`;
    // 生成 QR Code 并存储到变量中
    const qrcode = ref('');
    qrcode.value =  await QRCode.toDataURL(url);
    produceList.value[i].detail[0]["qrcode"]=qrcode.value
    const technologyNumber = produceList.value[i].detail[0].technologyNumber.toString(); // 转换为字符串以便处理每个字符
    produceList.value[i].detail[0]["qrcodeList"] = []; // 初始化一个空数组用来存储 QR Code
    for (let j = 0; j < technologyNumber.length; j++) {
      const processId = produceList.value[i].detail[0].process_id;
      const url = `${processId}/${technologyNumber[j]}`;
      // 生成 QR Code 并存储到数组中
      const qrcodeData = await QRCode.toDataURL(url);
      produceList.value[i].detail[0]["qrcodeList"].push({
        qrcode: qrcodeData,
        technologyNumber: technologyNumber[j]
      });
    }
  }
};
@@ -61,41 +76,41 @@
// 打印方法
  const printFlowCard = () => {
    // 需要打印的局部区域赋予"print-wrap"的id
    let el = document.getElementById("printFlowCard");
    let doc = document;
    let body = doc.body || doc.getElementsByTagName("body")[0];
    let printId = "print-" + Date.now();
const printFlowCard = () => {
  // 需要打印的局部区域赋予"print-wrap"的id
  let el = document.getElementById("printFlowCard");
  let doc = document;
  let body = doc.body || doc.getElementsByTagName("body")[0];
  let printId = "print-" + Date.now();
    // 创建无副作用的打印容器(因不确定页面的打印元素有无其它样式)
    let content = doc.createElement("div");
    content.id = printId;
  // 创建无副作用的打印容器(因不确定页面的打印元素有无其它样式)
  let content = doc.createElement("div");
  content.id = printId;
    // 样式控制与打印无关的元素隐藏
    let style = doc.createElement("style");
    style.innerHTML =
        "body>#" +
        printId +
        "{display:none}@media print{body>:not(#" +
        printId +
        "){display:none !important}body>#" +
        printId +
        "{display:block;padding-top:1px}}";
    //
    content.innerHTML = el.outerHTML;
    // // console.log("el.outerHTML", el.outerHTML);
    body.appendChild(style);
  // 样式控制与打印无关的元素隐藏
  let style = doc.createElement("style");
  style.innerHTML =
      "body>#" +
      printId +
      "{display:none}@media print{body>:not(#" +
      printId +
      "){display:none !important}body>#" +
      printId +
      "{display:block;padding-top:1px}}";
  //
  content.innerHTML = el.outerHTML;
  // // console.log("el.outerHTML", el.outerHTML);
  body.appendChild(style);
    // 与style元素设置的样式相配合
    // 把打印内容的元素添加到body(作为body的子元素,可用body的子选择器 '>' 控制打印样式)
    body.appendChild(content);
    setTimeout(() => {
      window.print();
      body.removeChild(content);
      body.removeChild(style);
    }, 20);
  }
  // 与style元素设置的样式相配合
  // 把打印内容的元素添加到body(作为body的子元素,可用body的子选择器 '>' 控制打印样式)
  body.appendChild(content);
  setTimeout(() => {
    window.print();
    body.removeChild(content);
    body.removeChild(style);
  }, 20);
}
</script>
<template>
@@ -267,14 +282,15 @@
        <td></td>
      </tr>
      <tr v-for="(qrCodeItem,index) in item.detail" :key="index">
        <td rowspan="2">
          <div class='qrCode' style="width: 80px;height: 80px;">
            <img :src= qrCodeItem.qrcode>
        <td colspan="19" >
          <span style="display: flex;">
            <span style="display: flex;width: 25%" v-for="(qrCodeItems,index) in qrCodeItem.qrcodeList" :key="index">
            <div class='qrCode' style="width: 80px;height: 80px;">
            <img :src= qrCodeItems.qrcode>
          </div>
        </td>
        <td colspan="16">
          <span style="float: left;font-weight: bolder">{{ qrCodeItem.processIdNumber }}</span>
          <span style="float: left;font-weight: bolder">{{ qrCodeItem.process_id+"/"+qrCodeItems.technologyNumber }}</span>
          </span>
          </span>
        </td>
      </tr>
north-glass-erp/northglass-erp/src/views/pp/Replenish/PrintReplenishFlowCard.vue
@@ -7,7 +7,7 @@
  switch (type) {
    case 'edit' :{
      //alert('我接收到子组件传送的编辑信息')
      router.push({path: '/main/processCard/PrintFlowCard', query: { id: row.id }})
      router.push({path: '/main/processCard/PrintRepairFlowCard', query: { id: row.id }})
      break
    }
    case 'delete':{
north-glass-erp/northglass-erp/src/views/pp/Replenish/Replenish.vue
@@ -26,7 +26,7 @@
      <el-breadcrumb :separator-icon="ArrowRight">
        <el-breadcrumb-item @click="changeRouter(1)" :class="indexFlag===1?'indexTag':''" :to="{ path: '/main/Replenish/SelectReplenish' }">{{$t('replenish.patchManagement')}}</el-breadcrumb-item>
        <el-breadcrumb-item @click="changeRouter(2)" :class="indexFlag===2?'indexTag':''" :to="{ path: '/main/Replenish/AddReplenish' }">{{$t('replenish.addPatches')}}</el-breadcrumb-item>
<!--        <el-breadcrumb-item @click="changeRouter(3)" :class="indexFlag===3?'indexTag':''" :to="{ path: '/main/Replenish/PrintReplenishFlowCard' }">{{$t('replenish.printPatches')}}</el-breadcrumb-item>-->
<!--        <el-breadcrumb-item @click="changeRouter(3)" :class="indexFlag===3?'indexTag':''" :to="{ path: '/main/Replenish/SelectPrintRepairFlowCard' }">{{$t('replenish.printPatches')}}</el-breadcrumb-item>-->
        <el-breadcrumb-item v-show="false" :to="{ path: '/main/order/orderReport' }">{{$t('productStock.reportForms')}}</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
north-glass-erp/northglass-erp/src/views/pp/Replenish/SelectPrintRepairFlowCard.vue
@@ -29,7 +29,7 @@
const getTableRow = (row, type) => {
  switch (type) {
    case 'edit' :{
      router.push({path: '/main/processCard/PrintFlowCard', query: { orderId: row.order_id }})
      router.push({path: '/main/processCard/PrintRepairFlowCard', query: { orderId: row.order_id }})
      break
    }
  }
@@ -82,7 +82,7 @@
}
//第一次加载数据
request.post(`/processCard/selectPrintFlowCard/${startTime}/${endTime}/${orderId}/${project}`, filterData.value).then((res) => {
request.post(`/Replenish/selectReplenishPrintFlowCard/${startTime}/${endTime}/${orderId}/${project}`, filterData.value).then((res) => {
  if (res.code == 200) {
    produceList = produceList.value.concat(deepClone(res.data.data))
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue
@@ -99,6 +99,10 @@
  },
]
//合片流程卡打印下拉选项
const printMerge = ref('')
const printMergeOptions=[{}]
//打印类型
const printType = ref()
@@ -270,7 +274,7 @@
              id += selectRecords[i].id + "|"
            }
          }
          router.push({path: '/main/processCard/printProcess', query: {printList: JSON.stringify(selectRecords)}})
          router.push({path: '/main/processCard/printProcess', query: {printList: JSON.stringify(selectRecords),printMerge:printMerge.value}})
          break
        }
@@ -487,6 +491,8 @@
<template>
  <div class="main-div-customer">
    <el-input clearable placeholder="合并打印" v-model="printMerge" style="width: 90px"></el-input>
    &nbsp;
    <label>{{$t('processCard.labelStyle')}}:</label>
    <el-select v-model="printType" clearable default-value="default_city" :placeholder="$t('processCard.pleaseSelect')" style="width: 120px">
      <el-option
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintProcess.vue
@@ -22,6 +22,7 @@
const {currentRoute} = useRouter()
const route = currentRoute.value
const printMerge = route.query.printMerge
data.value.printList = JSON.parse(route.query.printList)
let flowCardCount = data.value.printList.length
onMounted(() => {
@@ -33,7 +34,12 @@
        if (res.code == 200) {
          produceList.value = deepClone(res.data.data)
          console.log(produceList.value)
          if (printMerge!==null && printMerge!==undefined && printMerge!==""){
            produceList.value.forEach(item => {
              item.detail[0].technologyNumber = printMerge;
            });
          }
          handleGetQRCode()
        } else {
          ElMessage.warning(res.msg)
@@ -48,12 +54,21 @@
const handleGetQRCode = async () => {
  for (let i = 0; i < produceList.value.length; i++) {
    list= produceList.value[i].detail[0].processIdNumber;
    const url = `${list}`;
    // 生成 QR Code 并存储到变量中
    const qrcode = ref('');
    qrcode.value =  await QRCode.toDataURL(url);
    produceList.value[i].detail[0]["qrcode"]=qrcode.value
    const technologyNumber = produceList.value[i].detail[0].technologyNumber.toString(); // 转换为字符串以便处理每个字符
    produceList.value[i].detail[0]["qrcodeList"] = []; // 初始化一个空数组用来存储 QR Code
    for (let j = 0; j < technologyNumber.length; j++) {
      const processId = produceList.value[i].detail[0].process_id;
      const url = `${processId}/${technologyNumber[j]}`;
      // 生成 QR Code 并存储到数组中
      const qrcodeData = await QRCode.toDataURL(url);
      produceList.value[i].detail[0]["qrcodeList"].push({
        qrcode: qrcodeData,
        technologyNumber: technologyNumber[j]
      });
    }
  }
};
@@ -267,14 +282,15 @@
        <td></td>
      </tr>
      <tr v-for="(qrCodeItem,index) in item.detail" :key="index">
        <td rowspan="2">
          <div class='qrCode' style="width: 80px;height: 80px;">
            <img :src= qrCodeItem.qrcode>
        <td colspan="19" >
          <span style="display: flex;">
            <span style="display: flex;width: 25%" v-for="(qrCodeItems,index) in qrCodeItem.qrcodeList" :key="index">
            <div class='qrCode' style="width: 80px;height: 80px;">
            <img :src= qrCodeItems.qrcode>
          </div>
        </td>
        <td colspan="16">
          <span style="float: left;font-weight: bolder">{{ qrCodeItem.processIdNumber }}</span>
          <span style="float: left;font-weight: bolder">{{ qrCodeItem.process_id+"/"+qrCodeItems.technologyNumber }}</span>
          </span>
          </span>
        </td>
      </tr>
north-glass-erp/northglass-erp/src/views/pp/report/RawMaterialRequisition.vue
@@ -214,12 +214,12 @@
      filterMethod: filterChanged
    },
    {
      field: 'material_name', width: 120, title: t('mainIngredient.materialName'), filters: [{data: ''}],
      field: 'material_name', width: 120, title: t('mainIngredientStock.materialName'), filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
    },
    {
      field: 'producer',title: t('mainIngredient.producer'), filters: [{data: ''}],
      field: 'producer',title: t('mainIngredientStock.producer'), filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
    },
@@ -232,7 +232,7 @@
    {field: 'height',  title: t('order.height'), showOverflow: "ellipsis"},
    {field: 'quantity', title: t('report.quantityClaimed')},
    {field: 'area', title: t('report.areaClaimed')},
    {field: 'date_of_manufacture',  title: t('mainIngredient.dateOfManufacture')},
    {field: 'date_of_manufacture',  title: t('mainIngredientStock.dateOfManufacture')},
    {field: 'date',  title: t('report.dateClaimed')},
  ],//表头按钮
north-glass-erp/src/main/java/com/example/erp/controller/pp/ReplenishController.java
@@ -3,6 +3,7 @@
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.example.erp.common.Constants;
import com.example.erp.common.Result;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.pp.PatchLog;
import com.example.erp.entity.pp.Rework;
import com.example.erp.exception.ServiceException;
@@ -13,6 +14,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.sql.Date;
import java.util.List;
import java.util.Map;
@@ -55,4 +57,15 @@
    public Result updateReplenish( @RequestBody Map<String,Object> object){
        return Result.seccess(replenishService.updateReplenish(object));
    }
    @ApiOperation("流程卡补片打印查询接口")
    @PostMapping("/selectReplenishPrintFlowCard/{selectTime1}/{selectTime2}/{orderId}/{project}")
    public Result selectReplenishPrintFlowCard(
            @PathVariable Date selectTime1,
            @PathVariable Date selectTime2,
            @PathVariable String orderId,
            @PathVariable String project,
            @RequestBody FlowCard flowCard) {
        return Result.seccess(replenishService.selectReplenishPrintFlowCardSv(selectTime1, selectTime2, orderId, project, flowCard));
    }
}
north-glass-erp/src/main/java/com/example/erp/service/pp/ReplenishService.java
@@ -4,6 +4,7 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.pp.PatchLog;
import com.example.erp.entity.pp.ReportingWork;
import com.example.erp.entity.userInfo.SysError;
@@ -165,7 +166,16 @@
    }
    public Object selectReplenishPrintFlowCardSv(java.sql.Date selectTime1, java.sql.Date selectTime2, String orderId, String project, FlowCard flowCard) {
        if ("null".equals(orderId)) {
            orderId = "";
        }
        if ("null".equals(project)) {
            project = "";
        }
        Map<String, Object> map = new HashMap<>();
       // map.put("data", flowCardMapper.selectPrintFlowCardMp(selectTime1, selectTime2, orderId, project, flowCard));
        return map;
    }
}
north-glass-erp/src/main/resources/mapper/pp/Report.xml
@@ -614,7 +614,7 @@
    <select id="productionScheduleMp">
        select
            a.order_number,
            if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape,
            if(a.shape=1,'普形',if(a.shape=2,'异形','')) as shape,
            a.product_name,
            b.child_width,
            b.child_height,