| | |
| | | |
| | | </div> |
| | | |
| | | <!-- 开报工、外协、不良处理--> |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | :title="dialogTitle" |
| | |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 流转小标签打印--> |
| | | <!--打印预览页面 小标签--> |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | 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: 280px;height: 150px;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: 90px;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: 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;">{{ qrForm.nextstepname?'下道工序':'产品规格' }}:</div> |
| | | <div>{{ qrForm.nextstepname?qrForm.nextstepname:qrForm.partspec?qrForm.partspec:'/' }}</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> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisible2 = false">取 消</el-button> |
| | | <el-button v-waves v-print="printObj2" type="primary">确 定</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { nanoid } from 'nanoid' |
| | | import { LabelBarCode } from '@/api/systemSetting' |
| | | import { getCookie } from '@/utils/auth' |
| | | |
| | | import { handleDatetime2 } from '@/utils/global' |
| | | import QRCode from 'qrcodejs2' |
| | | export default { |
| | | name: 'SCKBG', |
| | | components: { |
| | |
| | | |
| | | defectTableData: [], |
| | | badTableData: [], |
| | | workOrderCurrentValue: '' |
| | | workOrderCurrentValue: '', |
| | | |
| | | dialogVisible2: false, // |
| | | qrForm: { // 打印内容 |
| | | qrvalue: '', |
| | | startqty: '', |
| | | wo_code: '', |
| | | partcode: '', |
| | | partname: '', |
| | | partspec: '', |
| | | nextstepname: '', |
| | | operator: '', // 操作人 |
| | | operatorTime: ''// 操作时间 |
| | | }, |
| | | printObj2: { |
| | | id: 'printMe2', |
| | | popTitle: '打印模板', |
| | | preview: false, |
| | | extraHead: '<meta http-equiv="Content-Language" content="zh-cn"/>', |
| | | closeCallback(vue) { // 关闭打印的回调事件(无法确定点击的是确认还是取消) |
| | | console.log('11212', vue) |
| | | // vue.dialogVisible = false |
| | | vue.dialogVisible2 = false |
| | | vue.dialogVisible = false |
| | | }, |
| | | beforeOpenCallback(vue) { |
| | | vue.printLoading = true |
| | | console.log('打开之前') |
| | | }, |
| | | openCallback(vue) { |
| | | vue.printLoading = false |
| | | console.log('执行了打印') |
| | | } |
| | | }, |
| | | xx: '' |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.getAllSelectArr() |
| | | }, |
| | | methods: { |
| | | |
| | | async getAllSelectArr() { |
| | | const { data: res1 } = await GroupsPermissions()// 班组 |
| | | this.usergroupArr = res1 |
| | |
| | | await this.tabClick() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.dialogVisible = false |
| | | |
| | | // 自制报工打印标签口子已开好 |
| | | // if (JSON.parse(localStorage.getItem('mesSetting')).every) { |
| | | // this.dialogVisible2 = true |
| | | // this.ZZprint2(localStorage.getItem('username')) |
| | | // } |
| | | } else { |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.$notify.error('报工失败!') |
| | |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | dialogVisible2Close() { |
| | | this.qrForm.qrvalue = '' |
| | | this.qrForm.startqty = '' |
| | | this.qrForm.wo_code = '' |
| | | this.qrForm.partcode = '' |
| | | this.qrForm.partname = '' |
| | | this.qrForm.partspec = '' |
| | | this.qrForm.nextstepname = '' |
| | | this.qrForm.operator = '' |
| | | this.qrForm.operatorTime = '' |
| | | // this.$refs.qrCodeDiv2 = '' |
| | | }, |
| | | |
| | | ZZprint2(username) { |
| | | if (this.dialogForm.nextstepcode !== '') { |
| | | this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode |
| | | } else { |
| | | this.qrForm.qrvalue = this.dialogForm.inbarcode |
| | | } |
| | | |
| | | this.qrForm.startqty = this.dialogForm.startqty |
| | | this.qrForm.wo_code = this.dialogForm.wo_code |
| | | this.qrForm.partcode = this.dialogForm.partnumber |
| | | this.qrForm.partname = this.dialogForm.partname |
| | | this.qrForm.nextstepname = this.dialogForm.nextstepname |
| | | this.qrForm.operator = username |
| | | this.qrForm.operatorTime = handleDatetime2(new Date()) |
| | | this.$nextTick(() => { |
| | | this.bindQRCode(this.qrForm.qrvalue) |
| | | }) |
| | | }, |
| | | // 生成二维码 |
| | | bindQRCode(text) { |
| | | new QRCode(this.$refs.qrCodeDiv2, { |
| | | text: text, |
| | | // width: 50, |
| | | width: 60, |
| | | // height: 50, |
| | | height: 60, |
| | | colorDark: '#000', // 二维码颜色 |
| | | colorLight: '#ffffff', // 二维码背景色 |
| | | correctLevel: QRCode.CorrectLevel.L// 容错率,L/M/H |
| | | }) |
| | | }, |
| | | // 缺陷新增 |
| | | addDefect() { |
| | | if (this.defectTableData.find(i => i.code.length === 0)) { |