loulijun2021
2022-08-24 8be895639f0250ced67a4437e7ebf6854d054749
1.修改小标签打印
已修改2个文件
133 ■■■■■ 文件已修改
src/views/scgl/gd.vue 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scgl/sckbg.vue 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scgl/gd.vue
@@ -596,7 +596,7 @@
      </span>
    </el-dialog>
    <!--        打印预览对话框-->
    <!--打印预览对话框  大标签-->
    <el-dialog
      title=""
      :visible.sync="dialogVisibleApprove"
@@ -741,50 +741,61 @@
      title="预览"
      :visible.sync="dialogVisible2"
      width="1140"
      top="10vh"
      :close-on-click-modal="false"
      @close="dialogVisible2Close"
    >
      <!-- 要打印的区域 -->
      <div id="printMe2" style="padding: 30px;">
        <div
          style="display: flex;width: 250px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;"
          style="display: flex;width: 280px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;"
        >
          <div style="width: 60px;display: flex;flex-direction: column;border-right: 1px solid #000">
          <div style="width: 90px;display: flex;flex-direction: column;border-right: 1px solid #000">
            <div
              style="display: flex;height: 75%;border-bottom:1px solid #000;
              style="display: flex;height: 90px;border-bottom:1px solid #000;
              justify-content: center;align-items: center;position: relative"
            >
              <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height: 50px;position: absolute;left: 4px" />
              <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />
            </div>
            <div style="display: flex;height: 25%;justify-content: flex-start;align-items: center">
              <div style="margin-left: 5px;width: 40px">数量:</div>
            <div style="display: flex;height: 30px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center">
              <div style="margin-left: 5px;width: 28px">数量:</div>
              {{ qrForm.startqty }}
            </div>
            <div style="display: flex;height: 30px;justify-content: flex-start;align-items: center">
              <div style="margin-left: 5px;width: 42px">处理人:</div>
              {{ qrForm.operator }}
            </div>
          </div>
          <div style="width:190px;display: flex;flex-direction: column">
            <div
              style="display: flex;height: 25%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left"
              style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left"
            >
              <div style="width: 60px;margin-left: 5px;">工单编号:</div>
              <div>{{ qrForm.wo_code }}</div>
            </div>
            <div
              style="display: flex;height: 25%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left"
              style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left"
            >
              <div style="width: 60px;margin-left: 5px;">产品编码:</div>
              <div>{{ qrForm.partcode }}</div>
            </div>
            <div
              style="display: flex;height: 25%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
              style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
            >
              <div style="width:60px;margin-left: 5px;">产品名称:</div>
              <div>{{ qrForm.partname }}</div>
            </div>
            <div style="display: flex;height: 25%;justify-content: flex-start;align-items: center;text-align: left">
              <div style="width: 60px;margin-left: 5px;">下道工序:</div>
            <div
              style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
            >
              <div style="width:60px;margin-left: 5px;">下道工序:</div>
              <div>{{ qrForm.nextstepname }}</div>
            </div>
            <div style="display: flex;height: 20%;justify-content: flex-start;align-items: center;text-align: left">
              <div style="width: 60px;margin-left: 5px;">处理时间:</div>
              <div>{{ qrForm.operatorTime }}</div>
            </div>
          </div>
@@ -812,7 +823,7 @@
  SelectRouteStep
} from '@/api/scgl'
import { PartSelect } from '@/api/zzmx'
import { handleDatetime } from '@/utils/global'
import { handleDatetime, handleDatetime2 } from '@/utils/global'
import { getCookie } from '@/utils/auth'
import { MesOrderPrintSearch1, PrintOrder } from '@/api/utils'
import { urlAddRandomNo, webapp_ws_ajax_run, webapp_ws_autoupdate } from '@/utils/grwebapp'
@@ -990,7 +1001,9 @@
        wo_code: '',
        partcode: '',
        partname: '',
        nextstepname: ''
        nextstepname: '',
        operator: '', // 操作人
        operatorTime: ''// 操作时间
      }
    }
  },
@@ -1465,7 +1478,9 @@
            wo_code: item.wo_code,
            partcode: item.partcode,
            partname: item.partname,
            nextstepname: item.seq === this.taskTableData.length ? item.stepname : this.taskTableData[item.seq].stepname
            nextstepname: item.seq === this.taskTableData.length ? item.stepname : this.taskTableData[item.seq].stepname,
            operator: getCookie('username'),
            operatorTime: handleDatetime2(new Date())
          }
          this.$nextTick(() => {
            console.log(this.qrForm.qrvalue, 3333)
@@ -1485,14 +1500,16 @@
      this.qrForm.partcode = ''
      this.qrForm.partname = ''
      this.qrForm.nextstepname = ''
      this.qrForm.operator = ''
      this.qrForm.operatorTime = ''
      // this.$refs.qrCodeDiv2 = ''
    },
    // 生成二维码
    bindQRCode2(text) {
      new QRCode(this.$refs.qrCodeDiv2, {
        text: text,
        width: 50,
        height: 50,
        width: 60,
        height: 60,
        colorDark: '#000', // 二维码颜色
        colorLight: '#ffffff', // 二维码背景色
        correctLevel: QRCode.CorrectLevel.L// 容错率,L/M/H
src/views/scgl/sckbg.vue
@@ -835,7 +835,7 @@
      </span>
    </el-dialog>
    <!--打印预览页面-->
    <!--打印预览页面  小标签-->
    <el-dialog
      title="预览"
      :visible.sync="dialogVisible2"
@@ -847,52 +847,60 @@
      <!-- 要打印的区域 -->
      <div id="printMe2" style="padding: 30px;">
        <div
          style="display: flex;width: 300px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;"
          style="display: flex;width: 280px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;"
        >
          <div style="width: 80px;display: flex;flex-direction: column;border-right: 1px solid #000">
          <div style="width: 90px;display: flex;flex-direction: column;border-right: 1px solid #000">
            <div
              style="display: flex;height: 120px;border-bottom:1px solid #000;justify-content: center;align-items: center "
              style="display: flex;height: 90px;border-bottom:1px solid #000;
              justify-content: center;align-items: center;position: relative"
            >
              <div id="qrCode2" ref="qrCodeDiv2" />
              <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />
            </div>
            <div style="display: flex;height: 30px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center">
              <div style="margin-left: 5px;width: 28px">数量:</div>
              {{ qrForm.startqty }}
            </div>
            <div style="display: flex;height: 30px;justify-content: flex-start;align-items: center">
              <div style="margin-left: 5px;width: 30px">数量:</div>
              10000
              <!--              {{ qrForm.startqty }}-->
              <div style="margin-left: 5px;width: 42px">处理人:</div>
              {{ qrForm.operator }}
            </div>
          </div>
          <div style="width:220px;display: flex;flex-direction: column">
          <div style="width:190px;display: flex;flex-direction: column">
            <div
              style="display: flex;height: 25%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left"
              style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left"
            >
              <div style="width: 60px;margin-left: 5px;">工单编号:</div>
              <div>{{ qrForm.wo_code }}</div>
            </div>
            <div
              style="display: flex;height: 25%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left"
              style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left"
            >
              <div style="width: 60px;margin-left: 5px;">产品编码:</div>
              <div>{{ qrForm.partcode }}</div>
            </div>
            <div
              style="display: flex;height: 25%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
              style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
            >
              <div style="width:60px;margin-left: 5px;">产品名称:</div>
              <div>{{ qrForm.partname }}</div>
            </div>
            <div style="display: flex;height: 25%;justify-content: flex-start;align-items: center;text-align: left">
              <div style="width: 60px;margin-left: 5px;">下道工序:</div>
            <div
              style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
            >
              <div style="width:60px;margin-left: 5px;">下道工序:</div>
              <div>{{ qrForm.nextstepname }}</div>
            </div>
            <div style="display: flex;height: 20%;justify-content: flex-start;align-items: center;text-align: left">
              <div style="width: 60px;margin-left: 5px;">处理时间:</div>
              <div>{{ qrForm.operatorTime }}</div>
            </div>
            <!--            {{ qrForm.operator }}-->
            <!--            {{ qrForm.operatorTime }}-->
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button @click="dialogVisible2 = false">取 消</el-button>
@@ -1872,8 +1880,10 @@
    bindQRCode(text) {
      new QRCode(this.$refs.qrCodeDiv2, {
        text: text,
        width: 50,
        height: 50,
        // width: 50,
        width: 60,
        // height: 50,
        height: 60,
        colorDark: '#000', // 二维码颜色
        colorLight: '#ffffff', // 二维码背景色
        correctLevel: QRCode.CorrectLevel.L// 容错率,L/M/H
@@ -1886,12 +1896,10 @@
      this.qrForm.partcode = this.dialogForm.partcode
      this.qrForm.partname = this.dialogForm.partname
      this.qrForm.nextstepname = this.dialogForm.nextstepname
      this.qrForm.operator = getCookie('username')
      this.qrForm.operatorTime = handleDatetime2(new Date())
      this.$nextTick(() => {
        this.bindQRCode(this.qrForm.qrvalue)
        console.log(this.$refs.qrCodeDiv2, 123)
        // console.log(this.$refs.qrCodeDiv2.querySelectorAll('#qrCode2>img'), 1)
        // console.log(this.$refs.qrCodeDiv2.querySelectorAll('#qrCode2>canvas'), 2)
      })
    },
    WXprint2() {
@@ -1901,6 +1909,8 @@
      this.qrForm.partcode = this.dialogForm.partcode
      this.qrForm.partname = this.dialogForm.partname
      this.qrForm.nextstepname = this.dialogForm.nextstepname
      this.qrForm.operator = getCookie('username')
      this.qrForm.operatorTime = handleDatetime2(new Date())
      this.$nextTick(() => {
        this.bindQRCode(this.qrForm.qrvalue)
      })
@@ -1912,7 +1922,9 @@
      this.qrForm.partcode = ''
      this.qrForm.partname = ''
      this.qrForm.nextstepname = ''
      this.$refs.qrCodeDiv2 = ''
      this.qrForm.operator = ''
      this.qrForm.operatorTime = ''
      // this.$refs.qrCodeDiv2 = ''
    },
    // 获取页面高度
@@ -1943,18 +1955,18 @@
      // console.log(JSON.stringify(data), 1)
      // console.log(this.badDialogForm.operation, 1)
      // this.badPrintOperator =
      this.badPrint(this.badOperationArr.find(item => item.usercode === this.badDialogForm.operation).username)
      this.dialogVisible2 = true
      // this.badPrint(this.badOperationArr.find(item => item.usercode === this.badDialogForm.operation).username)
      // this.dialogVisible2 = true
      // EditOrderNgStepSeave(data, this.badDialogForm.operation).then(res => {
      //   if (res.code === '200' || res.code === '301') {
      //     this.getBadList()
      //     this.badDialogVisible = false
      //     this.badPrint(this.badOperationArr.find(item => item.usercode === this.badDialogForm.operation).username)
      //     this.dialogVisible2 = true
      //     return this.$message.success('保存成功!')
      //   }
      // })
      EditOrderNgStepSeave(data, this.badDialogForm.operation).then(res => {
        if (res.code === '200' || res.code === '301') {
          this.getBadList()
          this.badDialogVisible = false
          this.badPrint(this.badOperationArr.find(item => item.usercode === this.badDialogForm.operation).username)
          this.dialogVisible2 = true
          return this.$message.success('保存成功!')
        }
      })
    },
    badPrint(username) {
      this.qrForm.qrvalue = this.badDialogForm.wo_code + ';' + this.badDialogForm.nextstepcode