廖井涛
2024-10-12 611f1afd9836f49c35dd6f49f87db6599b830ea0
Merge branch 'master' of http://bore.pub:10439/r/ERP_override
7个文件已修改
1个文件已添加
164 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/components/pp/TagStyleDesigner.vue 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/hook/queue.js 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCardDetails.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectAddProcess.vue 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/report/CrossProcessBreaking.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/report/ProcessToBeCompleted.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/Report.xml 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/pp/TagStyleDesigner.vue
@@ -10,8 +10,9 @@
import companyInfo from "@/stores/sd/companyInfo"
import PrintCustomLabel from '@/components/pp/PrintCustomLabelDetails.vue'
import PrintCustomLabelSemi from '@/components/pp/PrintCustomLabelSemi.vue'
import {Printer} from "@element-plus/icons-vue/global";
import {View} from "@element-plus/icons-vue";
import {Printer} from "@element-plus/icons-vue/global"
import {View} from "@element-plus/icons-vue"
import QueuePrinter from "@/hook/queue"
const { t } = useI18n()
const company = companyInfo()
@@ -609,7 +610,6 @@
  await getTags()
  await  hiprint.init({
    //host: 'http://10.153.19.26:17521',
    providers: [new TagStyleSet(TgaStyleSet.value)]
  });
@@ -635,8 +635,10 @@
  // 构建一个设计模板,指定容器,是否开启网格展示
  hiprintTemplate.value.design("#hiprint-printTemplate",{grid:true});
  //document.querySelector(".hiprint-option-item-field .auto-submit").appendChild('<option value="Arial">Arial</option>')
  //未连接 则进行连接打印服务器
  if (!hiprint.hiwebSocket.opened) {
    hiprint.hiwebSocket.setHost("http://localhost:17521")
  }
};
@@ -669,7 +671,9 @@
  }).then(({ value }) => {
    tag.value.name = value
    let json = $ref(hiprintTemplate.value.getJson())
    if(json.panels[0].printElements[0].options.field==='table' && json.panels[0].printElements.length===1){
    const tableFlag = json.panels[0].printElements.filter(item => item.options.field==='table')
    if(tableFlag.length===1 && json.panels[0].printElements.length===1){
      let funct = "function(value,row,index,options){return `"
      json.panels[0].printElements[0].options.columns[0].forEach(item => {
          if(item.field){
@@ -678,7 +682,7 @@
      })
      funct+='`}'
      json.panels[0].printElements[0].options.columns[0][0].renderFormatter = funct
    }else{
    }else if(json.panels[0].printElements.length>1 && tableFlag.length>0){
      ElMessage.warning('保存失败,请检查是否只有一个表格')
      return
    }
@@ -776,17 +780,20 @@
const printOrder = (type) => {
  const list = hiprintTemplate.value.getJson()
  list.panels[0].printElements.forEach(element => {
    element.options.fontFamily = 'Arial'
  })
  let object =  lastList.value
  //判断是否为表格
  let columnsNum = null
  if(list.panels[0].printElements[0].options.field==='table'){
    object = {table:lastList.value}
    columnsNum = (list.panels[0].printElements[0].options.gridColumns || 1)
  }
  if(type===1){
    hiprintTemplate.value.print2(object)
    const queuePrinter = new QueuePrinter( object,hiprintTemplate,columnsNum)
    queuePrinter.tick
  }else{
    hiprintTemplate.value.print(object)
  }
@@ -883,8 +890,9 @@
      destroy-on-close
      style="width: 80%;height:75% ">
    <template #header="{ close, titleId, titleClass }">
      <el-button @click="printOrder(1)" :icon="Printer" circle/>
      <el-button @click="printOrder(2)" :icon="View" circle/>
      <el-button @click="printOrder(1)" :icon="Printer" circle/>
    </template>
    <print-custom-label id="childLabel"
                        destroy-on-close
north-glass-erp/northglass-erp/src/hook/queue.js
New file
@@ -0,0 +1,34 @@
/**
 * Queue hook
 * 打印队列方法
 */
export default function QueuePrinter(list,hiprintTemplate,columnsNum){
    const queue = JSON.parse(JSON.stringify(list));
    // 添加打印任务
    this.printJob = function(job) {
        queue.push(job);
    };
    // 模拟打印
    this.tick = setInterval(()=>{
                if(typeof queue === 'object' && Array.isArray(queue)){
                    if (queue.length > 0) {
                        hiprintTemplate.value.print2(queue[0])
                        queue.shift(); // 打印任务,并从队列中移除
                    }else{
                        clearInterval(this.tick)
                    }
                }else{
                    if (queue.table.length > 0) {
                        hiprintTemplate.value.print2({table:queue.table.slice(0, columnsNum)})
                        queue.table.splice(0, columnsNum);
                    }else{
                        clearInterval(this.tick)
                    }
                }
        },
        5000)
};
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue
@@ -304,7 +304,10 @@
    {field: 'glass_address', title: t('processCard.glassAddress'), width: 90},
    {field: 'quantity', title: t('order.quantity'), width: 90},
    {field: 'total_area', title: t('order.area'), width: 90},
    {field: 'product_name', title: t('order.product'), width: 120},
    {field: 'product_name', title: t('order.product'), width: 120,
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged},
    {
      field: 'glass_child',
      title: t('reportingWorks.glassChild'),
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCardDetails.vue
@@ -309,7 +309,11 @@
    },
    {field: 'quantity', title: t('order.quantity'), width: 90},
    {field: 'total_area', title: t('order.area'), width: 90},
    {field: 'product_name', title: t('order.product'), width: 120},
    {field: 'product_name', title: t('order.product'), width: 120,
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
    },
    {
      field: 'glass_child',
      title: t('reportingWorks.glassChild'),
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectAddProcess.vue
@@ -8,9 +8,11 @@
import {Search} from "@element-plus/icons-vue";
import { useI18n } from 'vue-i18n'
import  useUserInfoStore from '@/stores/userInfo'
import useOrderInfoStore from "@/stores/sd/order/orderInfo"
//语言获取
const { t } = useI18n()
const userStore = useUserInfoStore()
const orderInfo = useOrderInfoStore()
let router=useRouter()
const getTableRow = (row,type) =>{
  switch (type) {
@@ -93,10 +95,11 @@
//第一次加载获取近七天时间和默认状态
form.date1 = getNowTime()
let startTime = form.date1[0]
let endTime = form.date1[1]
if (orderInfo.workOrderDate[0]=="" && orderInfo.workOrderDate[1]==""){
  orderInfo.workOrderDate=getNowTime()
}
let startTime = orderInfo.workOrderDate[0]
let endTime = orderInfo.workOrderDate[1]
//第一次加载数据
request.post(`/processCard/selectAddProcess/${startTime}/${endTime}`, filterData.value).then((res) => {
@@ -114,8 +117,8 @@
//点击查询
const getWorkOrder = () => {
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  let startTime = orderInfo.workOrderDate[0]
  let endTime = orderInfo.workOrderDate[1]
  request.post(`/processCard/selectAddProcess/${startTime}/${endTime}`, filterData.value).then((res) => {
    if (res.code == 200) {
@@ -150,8 +153,8 @@
  }
//获取选中时间
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  let startTime = orderInfo.workOrderDate[0]
  let endTime = orderInfo.workOrderDate[1]
  request.post(`/processCard/selectAddProcess/${startTime}/${endTime}`, filterData.value).then((res) => {
    if (res.code == 200) {
@@ -259,14 +262,13 @@
    <div id="selectForm">
      <el-row :gutter="0">
        <el-date-picker
            v-model="form.date1"
            type="daterange"
            format="YYYY/MM/DD"
            value-format="YYYY-MM-DD"
            :start-placeholder="$t('basicData.startDate')"
            :end-placeholder="$t('basicData.endDate')"
            v-model="orderInfo.workOrderDate"
            :default-time="defaultTime"
            :end-placeholder="$t('basicData.endDate')"
            :start-placeholder="$t('basicData.startDate')"
            format="YYYY/MM/DD"
            type="daterange"
            value-format="YYYY-MM-DD"
        />
        &nbsp;&nbsp;
north-glass-erp/northglass-erp/src/views/pp/report/CrossProcessBreaking.vue
@@ -18,8 +18,8 @@
    {field: 'breakageReason', width: 100,title: t('reportingWorks.breakageReason'), sortable: true,showOverflow:"ellipsis"},
    {field: 'breakageQuantity', width: 100,title: t('reportingWorks.quantityBroken'), sortable: true},
    {field: 'area',width: 100, title: t('reportingWorks.wornArea'), sortable: true},
    {field: 'project', width: 120,title: t('order.project'), sortable: true},
    {field: 'orderId',width: 120, title: t('order.orderId'), sortable: true},
    {field: 'project', width: 120,title: t('order.project'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'orderId',width: 120, title: t('order.orderId'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'glassChild',width: 120, title: t('reportingWorks.glassChild'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
  ],//表格表头字段
  data:[],//表格数据
north-glass-erp/northglass-erp/src/views/pp/report/ProcessToBeCompleted.vue
@@ -20,7 +20,7 @@
})
//工序
const value = ref(t('machine.edgeGrinding'))
const value = ref()
//表尾求和
const sumNum = (list, field) => {
@@ -257,7 +257,9 @@
    },
    {field: 'order_number', width: 100, title: t('order.OrderNum')},
    {field: 'technology_number', width: 120, title: t('processCard.technologyNumber'), showOverflow: "ellipsis"},
    {field: 'glass_child', width: 100, title: t('reportingWorks.glassChild')},
    {field: 'glass_child', width: 100, title: t('reportingWorks.glassChild'), filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged},
    {field: 'child_width', width: 120, title: t('order.width')},
    {field: 'child_height', width: 120, title: t('order.height')},
    {field: 'quantity', width: 120, title: t('order.quantity')},
@@ -267,7 +269,9 @@
    {field: 'completeArea', width: 120, title: t('report.completedArea')},
    {field: 'incompleteNum', width: 120, title: t('report.unfinishedQuantity')},
    {field: 'incompleteArea', width: 120, title: t('report.unfinishedArea')},
    {field: 'product_name', width: 120, title: t('order.product')},
    {field: 'product_name', width: 120, title: t('order.product'), filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged},
  ],//表头按钮
  toolbarConfig: {
@@ -437,7 +441,7 @@
<style scoped>
.main-div-customer {
  width: 99%;
  height: 100%;
  height: 93%;
}
#selectForm {
north-glass-erp/src/main/resources/mapper/pp/Report.xml
@@ -257,6 +257,12 @@
        <if test="crossProcessBreakingDTO.breakageType != null and crossProcessBreakingDTO.breakageType != ''">
            and dd.breakage_type regexp #{crossProcessBreakingDTO.breakageType}
        </if>
        <if test="crossProcessBreakingDTO.project != null and crossProcessBreakingDTO.project != ''">
            and o.project regexp #{crossProcessBreakingDTO.project}
        </if>
        <if test="crossProcessBreakingDTO.orderId != null and crossProcessBreakingDTO.orderId != ''">
            and o.order_id regexp #{crossProcessBreakingDTO.orderId}
        </if>
        GROUP BY dd.id
        order by dd.id desc
        limit #{offset},#{pageSize}
@@ -279,6 +285,33 @@
          and dd.available = 0
          and reviewed_state != 2
          and rw.this_process != dd.responsible_process
        <if test="crossProcessBreakingDTO.code != null and crossProcessBreakingDTO.code != ''">
            and JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) regexp #{crossProcessBreakingDTO.code}
        </if>
        <if test="crossProcessBreakingDTO.processId != null and crossProcessBreakingDTO.processId != ''">
            and rw.process_id regexp #{crossProcessBreakingDTO.processId}
        </if>
        <if test="crossProcessBreakingDTO.thisProcess != null and crossProcessBreakingDTO.thisProcess != ''">
            and rw.this_process regexp #{crossProcessBreakingDTO.thisProcess}
        </if>
        <if test="crossProcessBreakingDTO.responsibleProcess != null and crossProcessBreakingDTO.responsibleProcess != ''">
            and dd.responsible_process regexp #{crossProcessBreakingDTO.responsibleProcess}
        </if>
        <if test="crossProcessBreakingDTO.responsibleTeam != null and crossProcessBreakingDTO.responsibleTeam != ''">
            and dd.responsible_team regexp #{crossProcessBreakingDTO.responsibleTeam}
        </if>
        <if test="crossProcessBreakingDTO.glassChild != null and crossProcessBreakingDTO.glassChild != ''">
            and ogd.glass_child regexp #{crossProcessBreakingDTO.glassChild}
        </if>
        <if test="crossProcessBreakingDTO.breakageType != null and crossProcessBreakingDTO.breakageType != ''">
            and dd.breakage_type regexp #{crossProcessBreakingDTO.breakageType}
        </if>
        <if test="crossProcessBreakingDTO.project != null and crossProcessBreakingDTO.project != ''">
            and o.project regexp #{crossProcessBreakingDTO.project}
        </if>
        <if test="crossProcessBreakingDTO.orderId != null and crossProcessBreakingDTO.orderId != ''">
            and o.order_id regexp #{crossProcessBreakingDTO.orderId}
        </if>
        order by dd.id desc
    </select>
@@ -451,14 +484,14 @@
               ogd.glass_child,
               ogd.child_width,
               ogd.child_height,
               od.quantity,
               fc.quantity,
               ROUND(ogd.child_width * ogd.child_height / 1000000, 2)               as childArea,
               ROUND(ogd.child_width * ogd.child_height * od.quantity / 1000000, 2) as actualArea,
               ROUND(ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2) as actualArea,
               odpd.reporting_work_num                                              as completeNum,
               ROUND(ogd.child_width * ogd.child_height * odpd.reporting_work_num / 1000000,
                     2)                                                             as completeArea,
               od.quantity - odpd.reporting_work_num                                as incompleteNum,
               ROUND(ogd.child_width * ogd.child_height * (od.quantity - odpd.reporting_work_num) / 1000000,
               fc.quantity - odpd.reporting_work_num                                as incompleteNum,
               ROUND(ogd.child_width * ogd.child_height * (fc.quantity - odpd.reporting_work_num) / 1000000,
                     2)                                                             as incompleteArea,
               od.product_name
@@ -483,7 +516,7 @@
          and o.create_time between #{selectTime1} and #{selectTime2}
          and position(#{orderId} in od.order_id)
          and position(#{inputProject} in o.project)
          and od.quantity > odpd.reporting_work_num
          and fc.quantity - odpd.reporting_work_num>0
        group by fc.process_id, fc.order_number, fc.technology_number
        order by fc.process_id, fc.order_number, fc.technology_number