| | |
| | | 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 { |
| | |
| | | reportuser: '', // 报工人员 |
| | | |
| | | startqtySum: '', // 不能超过的数值 |
| | | |
| | | inbarcode: '', |
| | | |
| | | operation: getCookie('navTabId'), // 报工人(收料人) |
| | | remarks: ''// 备注 |
| | |
| | | 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 |
| | | }) |
| | |
| | | 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 |
| | |
| | | }, |
| | | // 对话框关闭事件 |
| | | handleClose() { |
| | | this.dialogForm.inbarcode = '' |
| | | this.judgeIsScanningArr = [] |
| | | this.form.orderstepqrcode = '' |
| | | this.WXform.orderstepqrcode = '' |
| | |
| | | }, |
| | | // 对话框确认 |
| | | dialogVisibleConfirm() { |
| | | this.$refs.dialogForm.validate(valid => { |
| | | this.$refs.dialogForm.validate(async valid => { |
| | | if (valid) { |
| | | // this.$store.state.app.buttonIsDisabled = true |
| | | if (this.dialogTitle === '外协发料') { |
| | |
| | | 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, // 工单编号 |
| | |
| | | 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(';')// 不良原因 |
| | | } |
| | |
| | | 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 = { |
| | |
| | | // 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(';')// 不良原因 |
| | | } |
| | |
| | | }) |
| | | }, |
| | | 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 |
| | |
| | | }) |
| | | }, |
| | | 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 |