loulijun2021
2023-09-19 6208ba6872cc54ccbd2b2ff3b67a1a2f054af41d
src/views/scgl/sckbg.vue
@@ -1173,6 +1173,7 @@
import QRCode from 'qrcodejs2'
import { getCookie } from '@/utils/auth'
import { handleDatetime2 } from '@/utils/global'
import { LabelBarCode } from '@/api/xtsz'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -1266,6 +1267,8 @@
        reportuser: '', // 报工人员
        startqtySum: '', // 不能超过的数值
        inbarcode: '',
        operation: getCookie('navTabId'), // 报工人(收料人)
        remarks: ''// 备注
@@ -1699,7 +1702,7 @@
        this.dialogForm.startqty = obj.noreportqty
        this.dialogForm.nextstepname = obj.nextstepname
        this.dialogForm.nextstepcode = obj.nextstepcode ? obj.nextstepcode : obj.stepcode
        this.dialogForm.nextstepcode = obj.nextstepcode
        this.dialogForm.startqtySum = obj.noreportqty
      })
@@ -1760,7 +1763,7 @@
        this.dialogForm.stepcode = obj.stepcode
        this.dialogForm.nextstepname = obj.nextstepname
        this.dialogForm.nextstepcode = obj.nextstepcode ? obj.nextstepcode : obj.stepcode
        this.dialogForm.nextstepcode = obj.nextstepcode
        this.dialogForm.noputqty = obj.noputqty
        this.dialogForm.stepseq = obj.seq
@@ -1900,6 +1903,7 @@
    },
    // 对话框关闭事件
    handleClose() {
      this.dialogForm.inbarcode = ''
      this.judgeIsScanningArr = []
      this.form.orderstepqrcode = ''
      this.WXform.orderstepqrcode = ''
@@ -1953,7 +1957,7 @@
    },
    // 对话框确认
    dialogVisibleConfirm() {
      this.$refs.dialogForm.validate(valid => {
      this.$refs.dialogForm.validate(async valid => {
        if (valid) {
          // this.$store.state.app.buttonIsDisabled = true
          if (this.dialogTitle === '外协发料') {
@@ -1993,6 +1997,19 @@
                return this.$message.info('请选择不良原因!')
              }
            }
            this.dialogForm.inbarcode = ''
            if (this.dialogForm.nextstepcode === '') {
              const D = {
                rightcode: '1078',
                partcode: this.dialogForm.partcode,
                qty: this.dialogForm.sqty,
                onelabqty: this.dialogForm.sqty
              }
              const r = await LabelBarCode(D)
              this.dialogForm.inbarcode = r.data[0].labcode
              this.qrForm.partspec = this.dialogForm.partspec
            }
            const data = {
              mesordercode: this.dialogForm.wo_code, // 工单编号
@@ -2004,6 +2021,9 @@
              taskqty: this.dialogForm.planqty, // 任务数量
              sqty: this.dialogForm.sqty, // 收料数量
              remarks: this.dialogForm.remarks, // 备注
              inbarcode: this.dialogForm.inbarcode, // 生产入库条码
              ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // 不良数量
              badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// 不良原因
            }
@@ -2066,6 +2086,23 @@
            this.userTableData = this.userTableData.filter((currentValue, currentIndex, selfArr) => {
              return selfArr.findIndex(item => item.usercode === currentValue.usercode) === currentIndex
            })
            this.dialogForm.inbarcode = ''
            // 当为末道的时候
            if (this.dialogForm.nextstepcode === '') {
              const D = {
                rightcode: '1073',
                partcode: this.dialogForm.partcode,
                qty: this.dialogForm.startqty,
                onelabqty: this.dialogForm.startqty
              }
              const r = await LabelBarCode(D)
              this.dialogForm.inbarcode = r.data[0].labcode
              this.qrForm.partspec = this.dialogForm.partspec
            }
            // console.log(this.userTableData, 1)
            const reportuser = this.userTableData.map(item => item.usercode).join(';')
            const data = {
@@ -2082,6 +2119,9 @@
              // reportqty: this.dialogForm.reportqty, // 报工数量
              reportqty: this.dialogForm.startqty, // 报工数量
              remarks: this.dialogForm.remarks, // 备注
              inbarcode: this.dialogForm.inbarcode, // 生产入库条码
              ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // 不良数量
              badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// 不良原因
            }
@@ -2118,7 +2158,13 @@
      })
    },
    ZZprint2(username) {
      this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
      if (this.dialogForm.nextstepcode !== '') {
        this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
      } else {
        this.qrForm.qrvalue = this.dialogForm.inbarcode
      }
      // this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
      this.qrForm.startqty = this.dialogForm.startqty
      this.qrForm.wo_code = this.dialogForm.wo_code
      this.qrForm.partcode = this.dialogForm.partcode
@@ -2131,7 +2177,13 @@
      })
    },
    WXprint2(username) {
      this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
      if (this.dialogForm.nextstepcode !== '') {
        this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
      } else {
        this.qrForm.qrvalue = this.dialogForm.inbarcode
      }
      // this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
      this.qrForm.startqty = this.dialogForm.sqty
      this.qrForm.wo_code = this.dialogForm.wo_code
      this.qrForm.partcode = this.dialogForm.partcode