guoyuji
2024-06-17 5ba0c74d42abf5362643f17fed33723674378321
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintFlowCard.vue
@@ -11,12 +11,14 @@
import {addListener, toolbarButtonClickEvent} from "@/hook/mouseMove";
import PrintProcess from '@/views/pp/processCard/PrintProcess.vue'
import PrintLabel from '@/views/pp/processCard/PrintLabel.vue'
import PrintCustomLabel from '@/views/pp/processCard/PrintCustomLabel.vue'
import footSum from "@/hook/footSum"
//语言获取
const {t} = useI18n()
let router = useRouter()
const dialogTableVisible = ref(false)
const dialogTableVisibleLabel = ref(false)
const dialogTableVisibleCustomLabel = ref(false)
const printVisible= ref(false)
let selectRecords = ref(null)
@@ -71,6 +73,28 @@
let pageNum = $ref(1)
let pageState = null
//室内室外面
const stateValue = ref('此面为室内面')
const stateOptions = [
  {
    value: '此面为室内面',
    label: '此面为室内面',
  },
  {
    value: '此面为室外面',
    label: '此面为室外面',
  },
]
//打印类型
const printType = ref()
//定义接收加载表头下拉数据
const titleSelectJson = ref({
  dataType: [],
})
const {currentRoute} = useRouter()
const route = currentRoute.value
@@ -81,6 +105,7 @@
  if (res.code == 200) {
    produceList = produceList.value.concat(deepClone(res.data.data))
    titleSelectJson.value.dataType = res.data.type
    xGrid.value.reloadData(produceList)
    gridOptions.loading = false
  } else {
@@ -156,6 +181,14 @@
      filterMethod: filterChanged
    },
    {
      field: 'order_number',
      title: '序号',
      showOverflow: "ellipsis",
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
    },
    {
      field: 'customer_name',
      title: t('customer.customerName'),
      filters: [{data: ''}],
@@ -183,6 +216,7 @@
    buttons: [
      {code: 'print', name: t('processCard.print'), status: 'primary'},
      {code: 'printLabel', name: t('processCard.printLabel'), status: 'primary'},
      // {code: 'customLabel', name: '自定义标签打印', status: 'primary'},
    ],
    // import: false,
@@ -213,6 +247,8 @@
  toolbarButtonClick ({ code}) {
    const $grid = xGrid.value
    selectRecords = $grid.getCheckboxRecords()
    let type=printType.value
    let faceOrientation=stateValue.value
    if ($grid) {
      switch (code) {
        case 'print': {
@@ -272,6 +308,29 @@
              ElMessage.warning(res.msg)
            }
          })
          break
        }
        case 'customLabel': {
          if(selectRecords===null ||selectRecords===''||selectRecords.length===0){
            ElMessage.warning(t('searchOrder.msgList.checkOrder'))
            return
          }
          if (type===null||type===''||type===undefined){
            ElMessage.warning('请选择自定义打印标签样式')
            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 + "|"
            }
          }
          router.push({path: '/main/processCard/PrintCustomLabel', query: {type:type,faceOrientation:faceOrientation,  printList: JSON.stringify(selectRecords)}})
          break
        }
      }
@@ -415,6 +474,23 @@
<template>
  <div class="main-div-customer">
<!--    <label>标签样式:</label>-->
<!--    <el-select v-model="printType" clearable default-value="default_city" style="width: 120px">-->
<!--      <el-option-->
<!--          v-for="item in titleSelectJson['dataType']"-->
<!--          :key="item.id"-->
<!--          :label="item.name"-->
<!--          :value="item.name"-->
<!--      />-->
<!--    </el-select>-->
<!--    <el-select v-model="stateValue" class="m-2" placeholder="室内外面" style="width: 140px">-->
<!--      <el-option-->
<!--          v-for="item in stateOptions"-->
<!--          :key="item.value"-->
<!--          :label="item.label"-->
<!--          :value="item.value"-->
<!--      />-->
<!--    </el-select>-->
    <vxe-grid
        ref="xGrid"
        class="mytable-scrollbar"
@@ -481,6 +557,15 @@
    </el-dialog>
    <el-dialog
        v-model="dialogTableVisibleCustomLabel"
        destroy-on-close
        title="自定义标签"
        style="width: 80%;height:75% ">
      <PrintLabel :printList="selectRecords"
                  style="width: 100%;height: 100%" />
    </el-dialog>
    <el-dialog
        @opened="openedTable"
        v-model="printVisible"
        title="流程卡明细"