廖井涛
2024-09-05 8b2c74fb6842e8af60f70e7df6eef8837d74be07
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")
        }
      })
@@ -109,10 +114,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 contenteditable="true" v-if="item1[item.name] != null && item1[item.name] !== ''" class="row1" >{{ 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>
@@ -128,7 +132,7 @@
body{
  overflow: hidden;
  font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
  font-family: Arial;
}
@@ -173,27 +177,26 @@
}
.contentRow .row1{
  width: 30%;
  font-weight: bolder;
  width: 100%;
}
.entirety_semi .row4{
  font-weight: bolder;
  text-align: right;
}
.contentRow .row1,.contentRow .row2{
  text-align: left;
  font-weight: bolder;
}
@page {
  size: auto;
  margin: 0mm 0mm 0mm 4mm;
}
@media print {
  @page {
    size: auto;
    margin: 0mm 0mm 0mm 4mm;
  }
  div {
    page-break-inside: avoid;
  }