| | |
| | | <el-input v-model="dialogForm.startqty" oninput="value=value.replace(/[^\d]/g,'')" style="width: 200px" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | v-if="(activeName==='生产列表'||activeName==='外协收料')&&rowData.isend === 'Y'" |
| | | prop="stockcode" |
| | | label="入库仓库" |
| | | class="dialogFormItem" |
| | | > |
| | | <el-select |
| | | v-model="dialogForm.stockcode" |
| | | style="width:200px" |
| | | placeholder="请选择" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in WareHouseArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="activeName==='外协发料'||activeName==='外协收料'" prop="wxcode" label="外协供方" class="dialogFormItem"> |
| | | <el-select |
| | | v-model="dialogForm.wxcode" |
| | |
| | | EditOrderNgStepSeave, |
| | | MesOrderNgStepSearch, |
| | | MesOrderNgSubStepSearch, |
| | | MesOrderStepSearch, MesOrderStepStart, |
| | | MesOrderWxStepSearch, SavaMesOrderStepIn, SavaMesOrderStepOut, SavaMesOrderStepReport |
| | | MesOrderStepSearch, |
| | | MesOrderStepStart, |
| | | MesOrderWxStepSearch, |
| | | ProductInHouseOrderCodeSearch, |
| | | SavaMesOrderStepIn, |
| | | SavaMesOrderStepOut, |
| | | SavaMesOrderStepReport, |
| | | TProductInHouseOrderSpSeave |
| | | } from '@/api/WorkOrder' |
| | | import { |
| | | CustomerPermissions, |
| | |
| | | EqpPermissions, |
| | | GroupsPermissions, |
| | | GroupsPersonPermissions, |
| | | PersonPermissions, PrentOrganizationNoCompany |
| | | PersonPermissions, PrentOrganizationNoCompany, WareHouse |
| | | } from '@/api/GeneralBasicData' |
| | | import { nanoid } from 'nanoid' |
| | | import { LabelBarCode } from '@/api/systemSetting' |
| | | import { getCookie } from '@/utils/auth' |
| | | import { handleDatetime2 } from '@/utils/global' |
| | | import { handleDatetime, handleDatetime2 } from '@/utils/global' |
| | | import QRCode from 'qrcodejs2' |
| | | export default { |
| | | name: 'StepReport2', |
| | |
| | | 'eqpcode': '', |
| | | 'eqpname': '', |
| | | |
| | | stockcode: '', |
| | | |
| | | remarks: '', // 备注 |
| | | inbarcode: '', // 入库条码 |
| | | defectlist: '', // 不良汇总 |
| | |
| | | ], |
| | | reportuser: [ |
| | | { required: true, message: '请选择报工人员', trigger: ['blur', 'change'] } |
| | | ], |
| | | stockcode: [ |
| | | { required: true, message: '请选择入库仓库', trigger: ['blur', 'change'] } |
| | | ], |
| | | startqty: [ |
| | | { required: true, message: '请输入合格数量', trigger: ['blur', 'change'] } |
| | |
| | | console.log('执行了打印') |
| | | } |
| | | }, |
| | | xx: '' |
| | | rowData: {}, |
| | | WareHouseArr: [] |
| | | } |
| | | }, |
| | | activated() { |
| | |
| | | this.tabClick() |
| | | |
| | | this.getAllSelectArr() |
| | | |
| | | this.getWareHouse() |
| | | }, |
| | | methods: { |
| | | async getWareHouse() { |
| | | const { data: res } = await WareHouse() |
| | | this.WareHouseArr = res |
| | | }, |
| | | |
| | | async getAllSelectArr() { |
| | | const { data: res1 } = await GroupsPermissions()// 班组 |
| | |
| | | // 报工 |
| | | report(row) { |
| | | if (row) { |
| | | this.rowData = row |
| | | this.dialogForm.stockcode = this.rowData.stockcode |
| | | this.getMesOrderStepStart('ZZ', '', row.wo_code, row.stepcode) |
| | | } else { |
| | | const temp = this.tableData.find(i => i.id === this.radioSelected) |
| | | this.rowData = temp |
| | | this.dialogForm.stockcode = this.rowData.stockcode |
| | | this.getMesOrderStepStart('ZZ', '', temp.wo_code, temp.stepcode) |
| | | } |
| | | }, |
| | |
| | | // 收料 |
| | | takeIn(row) { |
| | | if (row) { |
| | | this.rowData = row |
| | | this.dialogForm.stockcode = this.rowData.stockcode |
| | | this.getMesOrderStepStart('WX', 'IN', row.wo_code, row.stepcode) |
| | | } else { |
| | | const temp = this.tableData.find(i => i.id === this.radioSelected) |
| | | this.rowData = temp |
| | | this.dialogForm.stockcode = this.rowData.stockcode |
| | | this.getMesOrderStepStart('WX', 'IN', temp.wo_code, temp.stepcode) |
| | | } |
| | | }, |
| | |
| | | 'eqpcode': '', |
| | | 'eqpname': '', |
| | | |
| | | stockcode: '', |
| | | |
| | | wxcode: '', |
| | | outuser: '', |
| | | fqty: '', |
| | |
| | | if (res.code === '200') { |
| | | this.$notify.success('报工成功!') |
| | | // await this.search() |
| | | |
| | | if (this.rowData.isend === 'Y') { |
| | | await this.handleProductInHouseOrderSeave('B', inbarcode) |
| | | } |
| | | |
| | | await this.tabClick() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.dialogVisible = false |
| | |
| | | const res = await SavaMesOrderStepIn(data) |
| | | if (res.code === '200') { |
| | | this.$notify.success('收料成功!') |
| | | |
| | | if (this.rowData.isend === 'Y') { |
| | | await this.handleProductInHouseOrderSeave('S', inbarcode) |
| | | } |
| | | |
| | | // await this.search() |
| | | await this.tabClick() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | |
| | | // this.$refs.qrCodeDiv2 = '' |
| | | }, |
| | | |
| | | async handleProductInHouseOrderSeave(type, inbarcode) { |
| | | const { data: res2 } = await ProductInHouseOrderCodeSearch({ rightcode: '0605' }) |
| | | const TableDetailData = [] |
| | | |
| | | TableDetailData.push({ |
| | | hbillno: res2[0], // --入库单号 |
| | | wocode: this.rowData.wo_code, // --工单号 |
| | | rownumber: this.rowData.sbid.toString(), // --行号 |
| | | sourceVoucherId: this.rowData.mpoid.toString(), // --来源单据id |
| | | sourceVoucherCode: this.rowData.m_po.toString(), // --来源单据编号 |
| | | SourceVoucherDetailId: this.rowData.sbid.toString(), // --来源单据明细id |
| | | |
| | | inbarcode: inbarcode, // --入库条码 |
| | | idinventory: this.rowData.materiel_id.toString(), // --存货id |
| | | inventorycode: this.rowData.partcode, // --存货编码 |
| | | idunit: this.rowData.unitid.toString(), // --计量单位id |
| | | unitcode: this.rowData.unitcode, // --计量单位编码 |
| | | idwarehouse: this.WareHouseArr.find(i => i.code === this.dialogForm.stockcode).noid.toString(), // --仓库id |
| | | warehousecode: this.dialogForm.stockcode, // --仓库编码 |
| | | |
| | | saleOrderId: this.rowData.saleOrderid.toString(), // --销售单id |
| | | saleOrderCode: this.rowData.saleOrderCode, // --销售单号 |
| | | saleOrderDetailId: this.rowData.saleOrderDetailId.toString(), // --销售单明细id |
| | | |
| | | qty: type === 'B' ? this.dialogForm.startqty.toString() : this.dialogForm.sqty.toString(), // 入库数量 |
| | | stepcode: this.rowData.stepcode, // --工序编码 |
| | | style: type, // --报工类型 |
| | | status: '0' // --单据状态 |
| | | }) |
| | | |
| | | const data = { |
| | | 'rightcode': '0605', // 功能编号 |
| | | 'incbit': res2[1], // 流水号 |
| | | 'TableData': [ |
| | | [ |
| | | { |
| | | 'hbillno': res2[0], // 入库单号 |
| | | 'madedate': handleDatetime(new Date()) + ' 00:00:00', // 制单日期(年月日 00:00:00) |
| | | 'hbdate': this.rowData.voucherdate, |
| | | |
| | | sourceVoucherId: this.rowData.mpoid.toString(), |
| | | sourceVoucherCode: this.rowData.m_po.toString(), |
| | | saleOrderCode: this.rowData.saleOrderCode.toString(), |
| | | |
| | | 'iddepartment': this.rowData.dept_id.toString(), // 部门id |
| | | 'departmentcode': this.rowData.wkshp_code, // 部门编码 |
| | | |
| | | 'idwarehouse': this.WareHouseArr.find(i => i.code === this.dialogForm.stockcode).noid.toString(), // 仓库id |
| | | 'warehousecode': this.dialogForm.stockcode, // 仓库编码 |
| | | 'status': '0', // 入库单状态:0(未审核) 1(已审核) |
| | | PurchaseOrderCode: '', // 采购订单号 |
| | | 'remark': '', // 备注 |
| | | 'create_user': localStorage.getItem('username'), // 创建人员 |
| | | 'create_date': handleDatetime2(new Date()), |
| | | 'check_user': '', // 审核人员 |
| | | 'check_date': ''// 审核时间 |
| | | } |
| | | ], |
| | | TableDetailData// 表体 |
| | | ] |
| | | } |
| | | |
| | | // console.log(JSON.parse(JSON.stringify(data))) |
| | | await TProductInHouseOrderSpSeave(data) |
| | | }, |
| | | |
| | | ZZprint2(username) { |
| | | if (this.dialogForm.nextstepcode !== '') { |
| | | this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode |