chenlu
2024-09-04 fb3d04bf352d0a54156ee9577abe138d7c494046
标签打印添加新样式,报工查询添加审核人
10个文件已修改
1个文件已添加
408 ■■■■■ 已修改文件
north-glass-erp/northglass-erp/src/components/pp/PrintCustomLabelDetails.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/pp/PrintCustomLabelSemi.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/pp/PrintCustomLabelTwo.vue 270 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/pp/TagStyleDesigner.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCardDetails.vue 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/SelectReportingWorks.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/pp/PrintCustomLabelDetails.vue
@@ -31,7 +31,8 @@
  faceOrientation:null,//内外面
  type:null,//标签模板
  lableType:null,//标签类型
  titleList:null//标题
  titleList:null,//标题
  switch:null//判断是否为新打印
})
const {currentRoute} = useRouter()
@@ -45,7 +46,7 @@
  faceOrientation='OUTSIDE'
}
let lableType = props.lableType
console.log(props.titleList)
let switchType = props.switch
data.value.printList = JSON.parse(props.list)
onMounted(() => {
      request.post(`/processCard/getSelectPrintCustomLabelDetails/${type}/${lableType}`, data.value).then((res) => {
@@ -55,8 +56,11 @@
          list.value = deepClone(res.data.data)
          const data = produceList.value[0].value
          dataList = JSON.parse(`[${data}]`);
          labelList = dataList[0]
          console.log(labelList)
          if (switchType===true){
            labelList = props.titleList
          }else {
            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++) {
north-glass-erp/northglass-erp/src/components/pp/PrintCustomLabelSemi.vue
@@ -30,7 +30,9 @@
  list:null,//勾选的数据
  faceOrientation:null,//内外面
  type:null,//标签模板
  lableType:null//标签类型
  lableType:null,//标签类型
  titleList:null,//标题
  switch:null//判断是否为新打印
})
const {currentRoute} = useRouter()
@@ -38,8 +40,8 @@
let type = props.type
let faceOrientation = props.faceOrientation
let lableType = props.lableType
let switchType = props.switch
data.value.printList = JSON.parse(props.list)
onMounted(() => {
      request.post(`/processCard/getSelectPrintCustomLabel/${type}/${lableType}`, data.value).then((res) => {
        if (res.code == 200) {
@@ -48,7 +50,11 @@
          list.value = deepClone(res.data.data)
          const data = produceList.value[0].value
          dataList = JSON.parse(`[${data}]`);
          labelList = dataList[0]
          if (switchType===true){
            labelList = props.titleList
          }else {
            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++) {
@@ -59,7 +65,6 @@
          }
        } else {
          ElMessage.warning(res.msg)
          router.push("/login")
        }
      })
north-glass-erp/northglass-erp/src/components/pp/PrintCustomLabelTwo.vue
New file
@@ -0,0 +1,270 @@
<script setup>
import request from "@/utils/request"
import {ElDatePicker, ElMessage} from "element-plus"
import {nextTick, onMounted, onUnmounted, reactive, ref, watch} from "vue"
import {Search} from "@element-plus/icons-vue"
import {useRouter} from 'vue-router'
import {changeFilterEvent, filterChanged} from "@/hook"
import {useI18n} from 'vue-i18n'
import deepClone from "@/utils/deepClone";
import companyInfo from "@/stores/sd/companyInfo"
const company = companyInfo()
//语言获取
const {t} = useI18n()
let router = useRouter()
let produceList = ref([])
let labelList = ref([])
let titleList = ref([])
let dataList = ref([])
let list = ref([])
let lastList = ref([])
let filterData = ref({})
const data = ref({
  printList: []
})
let props = defineProps({
  list:null,//勾选的数据
  faceOrientation:null,//内外面
  type:null,//标签模板
  lableType:null,//标签类型
  switch:null//判断是否为新打印
})
const {currentRoute} = useRouter()
const route = currentRoute.value
let type = props.type
let faceOrientation = props.faceOrientation
if (type.indexOf("英文")>-1 && faceOrientation==="此面为室内面"){
  faceOrientation='INSIDE'
}
else if (type.indexOf("英文")>-1 && faceOrientation==="此面为室外面"){
  faceOrientation='OUTSIDE'
}
let lableType = props.lableType
data.value.printList = JSON.parse(props.list)
let switchType = props.switch
onMounted(() => {
      request.post(`/processCard/getSelectPrintCustomLabel/${type}/${lableType}`, data.value).then((res) => {
        if (res.code == 200) {
          produceList.value = deepClone(res.data.title)
          list.value = deepClone(res.data.data)
          const data = produceList.value[0].value
          dataList = JSON.parse(`[${data}]`);
          if (switchType===true){
            labelList = props.titleList
          }else {
            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 k = 0; k < list.value[i].data[j].quantity; k++) {
                lastList.value.push(list.value[i].data[j])
              }
            }
          }
        } else {
          ElMessage.warning(res.msg)
        }
      })
    }
)
//修改相同产品名称标签
const updateProductName = (event, index,id) => {
  // 创建映射对象
  const propertyMapping = {};
  labelList.forEach(item => {
    propertyMapping[item.name] = item.title;
  });
  // 输入的值
  const newValue = event.target.innerText;
  const parts = newValue.split(':');
  const result = parts[1]; // 获取冒号后的部分
  // 获取映射中所有的键
  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 = lastList.value[index].processId.substring(0, 11);
    const orderId = obj.orderId;
    const glassNumber=lastList.value[index].glassNumber
    // 根据 propertyName 更新属性
    if (propertyName === 'productAbbreviation' && prefix === obj.processId.substring(0, 11)) {
      obj.productAbbreviation = result;
    }
    if (propertyName === 'project' && orderId === obj.orderId) {
      obj.project = result;
    }
    if (propertyName === 'productName' && prefix === obj.processId.substring(0, 11)){
      obj.productName = result;
    }
    if (propertyName === 'customerName' && orderId === obj.orderId){
      obj.customerName = result;
    }
  });
}
</script>
<template>
  <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 contenteditable="true" v-if="item1[item.name] != null && item1[item.name] !== ''" class="row1" @input="updateProductName($event, id,index)">{{ item.title }}:{{ item1[item.name] }}</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>
  </div>
</template>
<style scoped>
* {
  margin: 0;
  padding: 0;
}
body{
  overflow: hidden;
  font-family: Arial;
}
#printButton {
  margin-top: -20px;
  width: 100px;
}
/*半*/
.printFlowCard_semi {
  flex-wrap: wrap;
  font-size: 10px;
  display: flex;
  justify-content:space-between;
}
/*半*/
.entirety_semi {
  width: 45%;
  display: flex;
  text-align: center;
  flex-direction:column;
  margin: 8px;
}
.row3{
  text-align: center;
}
.contentRow{
  display: flex;
  text-align: center;
}
label{
  font-weight: bolder;
}
.contentRow .row1{
  width: 100%;
}
.entirety_semi .row4{
  text-align: right;
}
.contentRow .row1,.contentRow .row2{
  text-align: left;
}
@media print {
  @page {
    size: auto;  /* auto is the initial value */
    margin: 13mm 5mm 0mm 7mm;  /* this affects the margin in the printer settings */
  }
  div {
    page-break-inside: avoid;
  }
  .pagebreak {
    page-break-after: always;
  }
}
.printFlowCard_semi1 {
  flex-wrap: wrap;
  font-size: 8pt;
  display: flex;
}
/*成*/
.entirety_semi1 {
  width: 50%;
  display: flex;
  text-align: center;
  flex-direction: column;
  margin-left: -10px;
  height: 80px;
}
.contentRow1 {
  font-weight: bolder;
  display: flex;
  text-align: center;
  width: 100%;
}
.contentRow1 .row1 {
  width: 30%;
  font-weight: bolder;
}
.entirety_finished1 .row4 {
  font-weight: bolder;
  text-align: right;
  margin-right: 10px;
}
.contentRow1 .row1, .contentRow1 .row2 {
  text-align: left;
  font-weight: bolder;
}
</style>
north-glass-erp/northglass-erp/src/components/pp/TagStyleDesigner.vue
@@ -39,7 +39,8 @@
  faceOrientation: null,//内外面
  type: null,//标签模板
  lableType: null,//标签类型
  titleList:null//标题列表
  titleList:null,//标题列表
  switch:null//判断是否为新打印
})
//室内室外面
@@ -111,7 +112,13 @@
  lableType:null//标签类型
})
const printContentLabel = ref({
  id: 'childLabel',
})
const printContentLabelSemi = ref({
  id: 'childLabelSemi',
})
const {currentRoute} = useRouter()
const route = currentRoute.value
@@ -564,6 +571,7 @@
  labelRow.value.faceOrientation = faceOrientation
  labelRow.value.type = type
  labelRow.value.lableType = lableType.value
  labelRow.value.switch=true
  if (lableTypes == 1) {
    if (company.label === 1) {
@@ -630,8 +638,8 @@
            </el-popover>
          </el-button-group>
        </el-col>
        <el-col :span="6">
            <el-select v-model="tag" @change="changeTag" placeholder="标签模板列表"  >
        <el-col :span="5">
            <el-select v-model="tag" @change="changeTag" placeholder="标签模板列表" style="width: 140px" >
              <el-option
                  v-for="(tag,index) in tags"
                  :key="index"
@@ -640,7 +648,7 @@
              />
            </el-select>
          <el-select v-model="lableType" :placeholder="lableTypeOptions[0].label" class="m-2" style="width: 140px">
          <el-select v-model="lableType" :placeholder="lableTypeOptions[0].label" class="m-2" style="width: 120px">
            <el-option
                v-for="item in filteredOptions"
                :key="item.value"
@@ -649,7 +657,7 @@
            />
          </el-select>
        </el-col>
        <el-col :span="1">
        <el-col :span="2">
          <el-select v-model="stateValue" :placeholder="$t('processCard.pleaseSelect')" allow-create class="m-2" clearable
                     filterable style="width: 140px">
            <el-option
@@ -670,7 +678,7 @@
          <el-button :disabled="!tag.id" type="danger" @click="deleteTag">删除</el-button>
        </el-col>
        <el-col :span="1">
          <el-button type="danger" @click="htmlPrint">打印</el-button>
          <el-button type="danger" @click="htmlPrint">预览</el-button>
        </el-col>
      </el-row>
@@ -705,6 +713,7 @@
                        :list="labelRow.list"
                        :type="labelRow.type"
                        :titleList="labelRow.titleList"
                        :switch="labelRow.switch"
                        style="width: 100%;height: 100%"/>
  </el-dialog>
@@ -723,11 +732,23 @@
                             :lableType="labelRow.lableType"
                             :list="labelRow.list"
                             :type="labelRow.type"
                             :titleList="labelRow.titleList"
                             :switch="labelRow.switch"
                             style="width: 100%;height: 100%"/>
  </el-dialog>
</template>
<style scoped>
:deep(#sizeCustom .el-dialog__body) {
  height: 85%;
  width: 100%;
  overflow-y: auto;
}
:deep(#sizeCustomSemi .el-dialog__body) {
  height: 85%;
  width: 100%;
  overflow-y: auto;
}
</style>
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue
@@ -202,9 +202,7 @@
    titleSelectJson.value.dataType = res.data.type
    xGrid.value.reloadData(newDataCollection)
    gridOptions.loading = false
    if (userId!='admin'){
      gridOptions.toolbarConfig.buttons[5].visible=false
    }
    hideButton()
  } else {
@@ -763,7 +761,7 @@
                          style="width: 100%;height: 100%"/>
    </el-dialog>
    <!--    成品标签新疆-->
    <!--    成品标签两列-->
    <el-dialog
        id="sizeCustom"
        v-model="dialogTableVisibleLabelXJ"
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCardDetails.vue
@@ -13,6 +13,7 @@
import PrintLabel from '@/views/pp/processCard/PrintLabel.vue'
import PrintCustomLabel from '@/components/pp/PrintCustomLabelDetails.vue'
import PrintCustomLabelSemi from '@/components/pp/PrintCustomLabelSemi.vue'
import PrintCustomLabelXJ from '@/components/pp/PrintCustomLabelTwo.vue'
import SortDetail from '@/components/pp/SelectSortDetailProcessCard.vue'
import footSum from "@/hook/footSum"
import companyInfo from "@/stores/sd/companyInfo"
@@ -28,6 +29,7 @@
const dialogTableVisible = ref(false)
const dialogTableVisibleLabel = ref(false)
const dialogTableVisibleCustomLabel = ref(false)
const dialogTableVisibleLabelXJ = ref(false)
const printVisible = ref(false)
let selectRecords = ref(null)
let titleStyleVisible = ref(false)
@@ -317,7 +319,8 @@
      {code: 'customLabel', name: t('processCard.customLabelPrinting'), status: 'primary'},
      {code: 'printLabel', name: t('processCard.labelPrinting'), status: 'primary'},
      {code: 'printLabel2', name: t('processCard.labelPrinting2'), status: 'primary'},
      // {code: 'printTest', name: "测试打印", status: 'primary'},
      {code: 'printLabel3', name: '标签打印2', status: 'primary'},
      {code: 'printTest', name: "测试打印", status: 'primary'},
      // {code: 'printLike', name: "同配置打印", status: 'primary'},
    ],
    // import: false,
@@ -571,6 +574,32 @@
          titleStyleVisible.value = true
          break
        }
        case 'printLabel3': {
          if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) {
            ElMessage.warning(t('searchOrder.msgList.checkOrder'))
            return
          }
          if (type === null || type === '' || type === undefined) {
            ElMessage.warning(t('processCard.pleaseSelectCustomPrintLabelStyle'))
            return
          }
          let id = ""
          for (let i = 0; i < selectRecords.length; i++) {
            if (i + 1 === selectRecords.length) {
              id += selectRecords[i].id
            } else {
              id += selectRecords[i].id + "|"
            }
          }
          labelRow.value.list = JSON.stringify(selectRecords)
          labelRow.value.faceOrientation = faceOrientation
          labelRow.value.type = type
          labelRow.value.lableType = lableTypes
          dialogTableVisibleLabelXJ.value = true
          break
        }
      }
    }
  },
@@ -772,6 +801,24 @@
                          :list="labelRow.list"
                          :type="labelRow.type"/>
    </el-dialog>
    <!--    成品标签两列-->
    <el-dialog
        id="sizeCustom"
        v-model="dialogTableVisibleLabelXJ"
        :title="$t('processCard.printLabel')"
        destroy-on-close
        style="width: 80%;height:75% ">
      <template #header="{ close, titleId, titleClass }">
        <el-button v-print="printContentLabel" :icon="Printer" circle/>
      </template>
      <print-custom-label-x-j id="childLabel"
                              :faceOrientation="labelRow.faceOrientation"
                              :lableType="labelRow.lableType"
                              :list="labelRow.list"
                              :type="labelRow.type"
                              style="width: 100%;height: 100%"/>
    </el-dialog>
  </div>
</template>
@@ -805,4 +852,10 @@
  overflow-y: auto;
}
:deep(#titleStyle .el-dialog__body) {
  height: 95%;
  width: 100%;
  overflow-y: auto;
}
</style>
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
@@ -1010,7 +1010,8 @@
    process: titleUploadData.value.previousProcess,
    processId:processId,
    thisProcess:titleUploadData.value.thisProcess,
    technologyStr:technologyStr
    technologyStr:technologyStr,
    userName:user.user.userName
  }
  loadingFlag.value= true
  request.post("/reportingWork/reviewReportingWork",reportWork).then((res) =>{
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/SelectReportingWorks.vue
@@ -89,7 +89,7 @@
//获取七天前到当前时间
function getNowTime() {
  const start = new Date(new Date().getTime()- 3600 * 1000 * 24 * 7)
  const start = new Date(new Date().getTime()- 3600 * 1000 * 24 * 3)
      .toISOString()
      .replace('T', ' ')
      .slice(0,10) //默认开始时间7天前
@@ -337,6 +337,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: 'reviewed',width: 120, title: '审核人', },
    {field: 'notes',width: 120, title: t('basicData.remarks'), },
  ],//表头按钮
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java
@@ -77,7 +77,7 @@
    Integer selectLayerByReportingWorkId(String reportingWorkId);
    Boolean ReviewReportingWorkMp(String substring, String process, String result);
    Boolean ReviewReportingWorkMp(String substring, String process, String result, String userName);
    String getPatchConditionMp(String reportingWorkId);
}
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
@@ -335,6 +335,7 @@
        String processId = reportingWork.get("processId");
        String thisProcess = reportingWork.get("thisProcess");
        String userName=reportingWork.get("userName");
        int index = processId.lastIndexOf("/") + 1;
        String result = processId.substring(index);
        String technologyStr = reportingWork.get("technologyStr");
@@ -346,10 +347,11 @@
                .eq(ReportingWork::getProcessId, processId.substring(0, 14))
                .eq(ReportingWork::getThisProcess, reportingWork.get("process"))
                .eq(ReportingWork::getReviewedState, 0)
                .eq(ReportingWork::getReviewed, userName)
                .setSql("reviewed_state =1");
        reportingWorkMapper.update(null, updateWrapper);
}else {
    reportingWorkMapper.ReviewReportingWorkMp(processId.substring(0, 14),reportingWork.get("process"),technologyStr);
    reportingWorkMapper.ReviewReportingWorkMp(processId.substring(0, 14),reportingWork.get("process"),technologyStr,userName);
}
        return true;
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -16,7 +16,6 @@
        <result property="thisWornQuantity" column="this_worn_quantity"/>
        <result property="deviceName" column="device_name"/>
        <result property="teamsGroupsName" column="teams_groups_name"/>
        <result property="reviewedState" column="reviewed_state"/>
        <result property="reportingWorkId" column="reporting_work_id"/>
        <result property="processId" column="process_id"/>
        <result property="completedArea" column="completedArea"/>
@@ -24,6 +23,7 @@
        <result property="qualityInspector" column="quality_inspector"/>
        <result property="qualityInsTime" column="quality_ins_time"/>
        <result property="notes" column="notes"/>
        <result property="reviewed" column="reviewed"/>
        <association property="order" javaType="com.example.erp.entity.sd.Order">
            <result property="customerId" column="customer_id"/>
@@ -518,7 +518,8 @@
               rw.device_name,
               rw.teams_groups_name,
               rw.reviewed_state,
               rw.notes
               rw.notes,
               rw.reviewed
        # (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
@@ -802,7 +803,7 @@
    <update id="ReviewReportingWorkMp">
        update reporting_work as rw
            left join reporting_work_detail as rwd on rw.reporting_work_id = rwd.reporting_work_id
        set rw.reviewed_state = 1
        set rw.reviewed_state = 1 ,rw.reviewed=#{userName}
        where rw.process_id = #{substring} and rw.this_process=#{process}
          and POSITION(rwd.technology_number in #{result}) and reviewed_state=0
    </update>