chenlu
2024-07-30 5aa2082f62e3ef936f4126a62ffba77983081a4c
修改标签打印内容编辑方法,报工查询添加备注字段
11个文件已修改
151 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/components/pp/PrintCustomLabel.vue 116 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/pp/PrintCustomLabelSemi.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/pp/PrintRepairCustomLabel.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/pp/PrintRepairCustomLabelSemi.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/SelectReportingWorks.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkDetailMapper.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ReportingWorkDetail.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/pp/PrintCustomLabel.vue
@@ -50,7 +50,7 @@
          labelList = dataList[0]
          for (let i = 0; i < list.value.length; i++) {
            let count = list.value[i].data.length
            for (let j = 0; j < count; j++) {
            for (let j = 0; j < 2; j++) {
              for (let k = 0; k < list.value[i].data[j].quantity; k++) {
                lastList.value.push(list.value[i].data[j])
              }
@@ -69,59 +69,48 @@
// 打印方法
const printFlowCard = () => {
  // 需要打印的局部区域赋予"print-wrap"的id
  let el = document.getElementById("print");
  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 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;
  body.appendChild(style);
  // 与style元素设置的样式相配合
  // 把打印内容的元素添加到body(作为body的子元素,可用body的子选择器 '>' 控制打印样式)
  body.appendChild(content);
  setTimeout(() => {
    window.print();
    body.removeChild(content);
    body.removeChild(style);
  }, 20);
}
//修改相同产品名称标签
const updataProductName = () => {
  for (let i = 0; i < lastList.value.length; i++) {
    let prefix = lastList.value[i].processId.substring(0, 11);
    let orderId= lastList.value[i].orderId
    let enName= lastList.value[i].productAbbreviation
    let project=lastList.value[i].project
    lastList.value.forEach(obj => {
      if (prefix === obj.processId.substring(0, 11)){
        obj.productAbbreviation = enName
      }
      if (orderId === obj.orderId){
        obj.project=project
      }
    })
const updateProductName = (event, index) => {
  // 创建映射对象
  const propertyMapping = {};
  labelList.forEach(item => {
    propertyMapping[item.name] = item.title;
  });
  // 输入的值
  const newValue = event.target.innerText;
  // 获取映射中所有的键
  const keys = Object.keys(propertyMapping);
  // 根据 index 获取对应的属性名
  const propertyName = keys[index];
  // 如果映射中没有该 index,直接返回
  if (!propertyName) {
    console.warn('Unsupported index:', index);
    return;
  }
  // 遍历 lastList 并更新对应的属性
  lastList.value.forEach(obj => {
    // 获取前缀和 orderId
    const prefix = obj.processId.substring(0, 11);
    const orderId = obj.orderId;
    // 根据 propertyName 更新属性
    if (propertyName === 'productAbbreviation' && prefix === obj.processId.substring(0, 11)) {
      obj.productAbbreviation = newValue;
    }
    if (propertyName === 'project' && orderId === obj.orderId) {
      obj.project = newValue;
    }
  });
}
</script>
<template>
@@ -129,9 +118,9 @@
      <div v-for="(item1,id) in lastList" :class="company.printLabel.className.custom.entiretyName()">
        <div class="row4">{{ faceOrientation }}</div>
        <div v-for="(item,id) in labelList" :class="company.printLabel.className.custom.contentRowName()">
          <div v-if="item.title==null" class="row1">{{ item.title }}</div>
          <div v-else class="row1">{{ item.title }}:</div>
          <div class="row2" style="width: 100%;"><input v-model="item1[item.name]"  @keyup="updataProductName()" style="border: none;"/></div>
          <div v-if="item1[item.name] != null && item1[item.name] !== ''" class="row1">{{ item.title }}</div>
<!--          <div class="row2" style="width: 100%;"><input class="contentRow2" v-model="item1[item.name]"  @keyup="updataProductName()" style="border: none;"/></div>-->
          <div v-if="item1[item.name] != null && item1[item.name] !== ''" class="row2" style="width: 100%;" contenteditable="true" @input="updateProductName($event, id)" v-text="item1[item.name]"></div>
        </div>
        <div v-html="company.printLabel.custom(item1)"></div>
      </div>
@@ -148,9 +137,24 @@
  padding: 0;
}
textarea {
  border: none; /* 取消默认边框 */
  padding: 0; /* 取消默认内边距 */
  margin: 0; /* 取消默认外边距 */
  resize: none; /* 禁用调整大小功能 */
  font-family: Arial; /* 设置自定义字体 */
  font-size: 12px; /* 设置自定义字体大小 */
  line-height: 1; /* 设置行高 */
  width: 100%; /* 设置宽度为100% */
  height: auto; /* 高度根据内容自动调整 */
  box-sizing: border-box; /* 使宽高包括内边距和边框 */
  overflow-y: hidden;
}
body {
  overflow: hidden;
  font-family: Arial, sans-serif;
  font-family: Arial;
  font-size: 10px;
}
@@ -212,7 +216,7 @@
}
.contentRow .row1 {
  width: 30%;
  width: 20%;
  font-weight: bolder;
}
@@ -234,7 +238,7 @@
@page {
  size: auto;  /* auto is the initial value */
  margin: 13mm 4mm 0mm 6mm;  /* this affects the margin in the printer settings */
  margin: 20mm 1mm 0mm 1mm;  /* this affects the margin in the printer settings */
}
@media print {
north-glass-erp/northglass-erp/src/components/pp/PrintCustomLabelSemi.vue
@@ -109,10 +109,9 @@
  <div id="print" :class="company.printLabel.className.semi.printFlowCardName()">
    <div v-for="(item1,id) in lastList" :class="company.printLabel.className.semi.entiretyName()">
      <div class="row4">{{ faceOrientation }}</div>
      <div v-for="(item,id) in labelList" :class="company.printLabel.className.semi.contentRowName()">
        <div v-if="item.title==null" class="row1">{{ item.title }}</div>
        <div v-else class="row1">{{ item.title }}:</div>
        <div class="row2">{{ item1[item.name] }}</div>
      <div  v-for="(item,id) in labelList" :class="company.printLabel.className.semi.contentRowName()">
        <div v-if="item1[item.name] != null && item1[item.name] !== ''" class="row1" >{{ item.title }}</div>
        <div v-if="item1[item.name] != null && item1[item.name] !== ''" class="row2">{{ item1[item.name] }}</div>
      </div>
      <div v-html="company.printLabel.customSemi(item1)"></div>
    </div>
north-glass-erp/northglass-erp/src/components/pp/PrintRepairCustomLabel.vue
@@ -107,8 +107,8 @@
    <div v-for="(item1,id) in lastList"   class="entirety_finished">
        <div class="row4">{{faceOrientation}}</div>
        <div v-for="(item,id) in labelList"  class="contentRow">
          <div class="row1">{{ item.title }}:</div>
          <div class="row2">{{ item1[item.name] }}</div>
          <div class="row1" v-if="item1[item.name] != null && item1[item.name] !== ''">{{ item.title }}:</div>
          <div class="row2" v-if="item1[item.name] != null && item1[item.name] !== ''">{{ item1[item.name] }}</div>
        </div>
        <div class="row3">
north-glass-erp/northglass-erp/src/components/pp/PrintRepairCustomLabelSemi.vue
@@ -110,8 +110,8 @@
    <div v-for="(item1,id) in lastList"   class="entirety_semi">
        <div class="row4">{{faceOrientation}}</div>
        <div v-for="(item,id) in labelList"  class="contentRow">
          <div class="row1">{{ item.title }}:</div>
          <div class="row2">{{ item1[item.name] }}</div>
          <div class="row1" v-if="item1[item.name] != null && item1[item.name] !== ''">{{ item.title }}:</div>
          <div class="row2" v-if="item1[item.name] != null && item1[item.name] !== ''">{{ item1[item.name] }}</div>
        </div>
        <div class="row3">
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/SelectReportingWorks.vue
@@ -327,7 +327,6 @@
    {field: 'processId', width: 130,title: t('processCard.processId') ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'order.project',width: 120, title: t('order.project'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, },
    {field: 'order.batch', width: 100,title: t('order.batch') ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'thisProcess',width: 100, title: t('reportingWorks.thisProcess'),filters:[{ data: '' }],slots: { filter: 'num1_filter' } },
    {field: 'thisCompletedQuantity',width: 120, title: t('reportingWorks.thisCompletedQuantity') },
    {field: 'completedArea', width: 120,title: t('reportingWorks.completedArea'), },
@@ -336,6 +335,7 @@
    {field: 'deviceName', width: 100,title: t('reportingWorks.deviceType'),filters:[{ data: '' }],slots: { filter: 'num1_filter' } },
    {field: 'teamsGroupsName',width: 120, title: t('reportingWorks.teamsType'),filters:[{ data: '' }],slots: { filter: 'num1_filter' } },
    {field: 'reviewedState',width: 120, title: t('processCard.reviewedState'), },
    {field: 'notes',width: 120, title: t('basicData.remarks'), },
  ],//表头按钮
north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java
@@ -78,7 +78,7 @@
    List<Map<String, Object>> getProcessList(String processId, Integer technologyNumber);
    Boolean updateInventory(String processId, String orderNumber, String technologyNumber, int completedQuantity);
    Boolean updateInventory(String processId, String orderNumber, String technologyNumber, Integer completedQuantity);
    Boolean updateComposing(String processId);
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkDetailMapper.java
@@ -3,14 +3,10 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.erp.entity.pp.ReportingWorkDetail;
import com.example.erp.entity.pp.Rework;
import com.example.erp.entity.sd.OrderProcessDetail;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@Mapper
public interface ReportingWorkDetailMapper extends BaseMapper<ReportingWorkDetail> {
@@ -29,5 +25,5 @@
                                               @Param("sDate") String startTime,@Param("eDate") String endTime,ReportingWorkDetail reportingWorkDetail);
    Integer selectInventory(@Param("processId") String processId, @Param("orderNumber") Integer orderNumber, @Param("technologyNumber") Integer technologyNumber);
    Integer selectInventory(@Param("processId") String processId, @Param("orderNumber") Integer orderNumber, @Param("technologyNumber") Integer technologyNumber, String thisProcess);
}
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
@@ -449,7 +449,7 @@
            //修改包装时修改库存数量
            if (reportingWork.getNextProcess()==null || reportingWork.getNextProcess().isEmpty()){
                //获取该报工修改后的可入库数量
                Integer  inventory = reportingWorkDetailMapper.selectInventory(reportingWork.getProcessId(),Integer.parseInt(reportingWorkDetail.getOrderNumber()),Integer.parseInt(reportingWorkDetail.getTechnologyNumber()));
                Integer  inventory = reportingWorkDetailMapper.selectInventory(reportingWork.getProcessId(),Integer.parseInt(reportingWorkDetail.getOrderNumber()),Integer.parseInt(reportingWorkDetail.getTechnologyNumber()),reportingWork.getThisProcess());
                //修改流程卡表库存数量
                flowCardMapper.updateInventory(reportingWork.getProcessId(),reportingWorkDetail.getOrderNumber(),reportingWorkDetail.getTechnologyNumber(),inventory);
            }
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -1399,7 +1399,7 @@
               p.remarks,
               c.customer_abbreviation as customerAbbreviation,
               p.product_abbreviation as productAbbreviation,
               fc.process_id as processId,
               CONCAT(fc.process_id,'/',fc.technology_number) as processId,
               o.create_time as createTime,
               JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS glassNumber,
               JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S02' )) AS figureNumber,
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -23,6 +23,7 @@
        <result property="wornArea" column="wornArea"/>
        <result property="qualityInspector" column="quality_inspector"/>
        <result property="qualityInsTime" column="quality_ins_time"/>
        <result property="notes" column="notes"/>
        <association property="order" javaType="com.example.erp.entity.sd.Order">
            <result property="customerId" column="customer_id"/>
@@ -507,7 +508,8 @@
               round(ogd.area * rw.this_worn_quantity,2)      as wornArea,
               rw.device_name,
               rw.teams_groups_name,
               rw.reviewed_state
               rw.reviewed_state,
               rw.notes
        # (IF(rw.reviewed_state = 0, '未审核', IF(rw.reviewed_state = 1, '审核通过', '审核不通过'))) as reviewed_state
        from sd.order as o
                 left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id
north-glass-erp/src/main/resources/mapper/pp/ReportingWorkDetail.xml
@@ -170,7 +170,7 @@
        where opd.process_id = #{processId}
          and opd.order_number = #{orderNumber}
          and opd.technology_number = #{technologyNumber}
          and opd.process = '包装'
          and opd.process = #{thisProcess}
    </select>
    <!--<where>