loulijun2021
2022-09-13 c51d546e918abc6bebfc8460d9fe1cdbdd6e5007
src/views/scgl/gd.vue
@@ -215,6 +215,7 @@
            label="产品规格"
            sortable="custom"
            width="110"
            show-tooltip-when-overflow
          >
            <template slot-scope="{row}">
              <div v-if="row.partspec">{{ row.partspec }}</div>
@@ -376,19 +377,23 @@
          <el-table-column
            prop="partcode"
            label="产品编码"
            width="150"
          />
          <el-table-column
            prop="partname"
            label="产品名称"
            width="200"
          />
          <el-table-column
            label="工序编码"
            prop="stepcode"
            width="150"
          />
          <el-table-column
            label="工序名称"
            prop="stepname"
            width="150"
          />
          <el-table-column
            label="任务数量"
@@ -1217,63 +1222,200 @@
      :close-on-click-modal="false"
      @close="dialogVisible2Close"
    >
      <!-- 要打印的区域 -->
      <div id="printMe2" style="padding: 0px;">
        <div
          style="display: flex;width: 280px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;"
        >
      <div style="height: 300px">
        <!--      下拉框选择打印尺寸-->
        <div style="display: flex;align-items: center;margin: 0 0 20px 0">
          <div>选择打印尺寸:</div>
          <el-select
            v-model="printSize"
            :popper-append-to-body="false"
            style="width: 200px"
            placeholder="请选择"
            @change="printSizeChange"
          >
          <div style="width: 90px;display: flex;flex-direction: column;border-right: 1px solid #000">
            <div
              style="display: flex;height: 90px;border-bottom:1px solid #000;
            <el-option
              v-for="item in printSizeSelectArr"
              :key="item.code"
              :label="item.name"
              :value="item.code"
            />
          </el-select>
        </div>
        <!-- 要打印的区域 -->
        <!--      <div id="printMe2" :style="{paddingLeft:'10px',paddingTop: '5px'}">-->
        <div id="printMe2" :style="printMe2StylePadding(printSize)">
          <div
            v-if="printSize===0"
            style="display: flex;width: 280px;height: 160px;border: 1px solid #000;text-align: center;font-size: 10px;"
          >
            <div style="width: 90px;display: flex;flex-direction: column;border-right: 1px solid #000">
              <div
                style="display: flex;height: 96px;border-bottom:1px solid #000;
              justify-content: center;align-items: center;position: relative"
            >
              <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />
              >
                <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />
              </div>
              <div
                style="display: flex;height: 32px;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: 32px;justify-content: flex-start;align-items: center">
                <div style="margin-left: 5px;width: 42px">处理人:</div>
                {{ qrForm.operator }}
              </div>
            </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: 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: 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: 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: 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 style="width:190px;display: flex;flex-direction: column">
              <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.wo_code }}</div>
              </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.partcode }}</div>
              </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.partname }}</div>
              </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>
          </div>
          <div
            v-if="printSize===1"
            style="display: flex;width: 280px;height: 160px;border: 1px solid #000;text-align: center;font-size: 10px;"
          >
            <div style="width: 90px;display: flex;flex-direction: column;border-right: 1px solid #000">
              <div
                style="display: flex;height: 96px;border-bottom:1px solid #000;
              justify-content: center;align-items: center;position: relative"
              >
                <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />
              </div>
              <div
                style="display: flex;height: 32px;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: 32px;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: 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: 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: 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: 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>
          </div>
          <div
            v-if="printSize===5"
            style="display: flex;width: 140px;height: 80px;border: 1px solid #000;text-align: center;font-size: 10px;"
          >
            <div v-if="false" style="width: 45px;display: flex;flex-direction: column;border-right: 1px solid #000">
              <div
                style="display: flex;height: 60px;border-bottom:1px solid #000;
              justify-content: center;align-items: center;position: relative"
              >
                <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />
              </div>
              <div
                style="display: flex;height: 20px;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: 20px;justify-content: flex-start;align-items: center">
                <div style="margin-left: 5px;width: 42px">处理人:</div>
                {{ qrForm.operator }}
              </div>
            </div>
            <div style="width:100%;display: flex;flex-direction: column;">
              <div
                style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: center;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: 20%;border-bottom:1px solid #000;justify-content: center;align-items: center ;text-align: left"
              >
                <!--              <div style="width: 60px;margin-left: 5px;">产品编码:</div>-->
                <div>{{ qrForm.partcode }}</div>
              </div>
              <div
                style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: center;align-items: center;text-align: left"
              >
                <!--              <div style="width:60px;margin-left: 5px;">产品名称:</div>-->
                <div>{{ qrForm.partname }}</div>
              </div>
              <div
                style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: center;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: center;align-items: center;text-align: left">
                <!--              <div style="width: 60px;margin-left: 5px;">处理时间:</div>-->
                <div>{{ qrForm.operatorTime }}</div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
@@ -1571,7 +1713,7 @@
        closeCallback(vue) { // 关闭打印的回调事件(无法确定点击的是确认还是取消)
          console.log('11212', vue)
          // vue.dialogVisible = false
          vue.dialogVisible2 = false
          // vue.dialogVisible2 = false
          // vue.dialogVisible = false
        },
        beforeOpenCallback(vue) {
@@ -1625,7 +1767,16 @@
      defaultroute_codeArr: '', // 默认工艺路线数组
      projectTableData: [], // 设备列表
      isExpandForm: false, // 表单是否展开,默认不展开
      tableDataDetail: []// 点击工单表的行 显示详细信息
      tableDataDetail: [], // 点击工单表的行 显示详细信息
      printSize: 1,
      printSizeSelectArr: [// 宽*高
        { code: 0, name: '80*50' },
        { code: 1, name: '78*60' },
        { code: 2, name: '50*60' },
        { code: 3, name: '50*40' },
        { code: 4, name: '50*80' },
        { code: 5, name: '40*30' }
      ]
    }
  },
  created() {
@@ -2076,7 +2227,7 @@
    //     }
    //   })
    // },
    // 生成二维码
    // 生成二维码    工单报表二维码
    bindQRCode(seq, text, size) {
      if (size === 'big') {
        console.log(text, 1)
@@ -2165,7 +2316,7 @@
      this.qrForm.operatorTime = ''
      // this.$refs.qrCodeDiv2 = ''
    },
    // 生成二维码
    // 生成二维码    工序标签二维码
    bindQRCode2(text) {
      new QRCode(this.$refs.qrCodeDiv2, {
        text: text,
@@ -2370,6 +2521,20 @@
    // 打印工单
    printOrder() {
    },
    //  选择打印尺寸的大小值改变
    printSizeChange(val) {
      this.$nextTick(() => {
        this.bindQRCode2(this.qrForm.qrvalue)
      })
    },
    printMe2StylePadding(val) {
      if (val === 0) {
        return { paddingLeft: '10px', paddingTop: '5px' }
      }
      if (val === 5) {
        return { paddingLeft: '15px', paddingTop: '7px' }
      }
    }
  }
}
@@ -2669,6 +2834,12 @@
  //}
}
::v-deep .el-select__caret{
  display: flex;
  align-items: center;
  justify-content: center;
}
</style>
<style>