| | |
| | | v-waves |
| | | icon="el-icon-thumb" |
| | | type="primary" |
| | | :disabled="radioSelected===''" |
| | | @click="report()" |
| | | >报工 |
| | | </el-button> |
| | |
| | | v-waves |
| | | type="primary" |
| | | icon="el-icon-thumb" |
| | | @click="sendOut" |
| | | :disabled="radioSelected===''" |
| | | @click="sendOut()" |
| | | >发料 |
| | | </el-button> |
| | | <el-button |
| | |
| | | v-waves |
| | | type="primary" |
| | | icon="el-icon-thumb" |
| | | @click="takeIn" |
| | | :disabled="radioSelected===''" |
| | | @click="takeIn()" |
| | | >收料 |
| | | </el-button> |
| | | <el-button |
| | |
| | | v-waves |
| | | type="primary" |
| | | icon="el-icon-thumb" |
| | | @click="handleBad" |
| | | :disabled="radioSelected===''" |
| | | @click="handleBad()" |
| | | >处理 |
| | | </el-button> |
| | | </div> |
| | |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="产品编码" style=" display: flex;"> |
| | | <el-input v-model="form.partcode" placeholder="请输入" style="width: 200px" /> |
| | | <el-input |
| | | v-model="form.partcode" |
| | | placeholder="请输入" |
| | | style="width: 200px" |
| | | @keyup.enter.native="val=>enterNative(val,'produceCode' + item.code)" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="产品名称" style=" display: flex;"> |
| | | <el-input v-model="form.partname" placeholder="请输入" style="width: 200px" /> |
| | | <el-input |
| | | v-model="form.partname" |
| | | placeholder="请输入" |
| | | style="width: 200px" |
| | | @keyup.enter.native="val=>enterNative(val,'produceCode' + item.code)" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="车间名称" style=" display: flex;"> |
| | | <el-select |
| | | v-model="form.wkshopcode" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in wkshopcodeArr" |
| | | :key="item.torg_code" |
| | | :label="item.torg_name" |
| | | :value="item.torg_code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <!-- <el-form-item label="规格型号" style=" display: flex;">--> |
| | | <!-- <el-input v-model="form.partspec" placeholder="请输入" style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | |
| | | <el-table-column |
| | | prop="wo_code" |
| | | label="工单号" |
| | | width="160" |
| | | min-width="160" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | /> |
| | |
| | | {{ row.partspec ? row.partspec : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="wkshp_name" |
| | | min-width="110" |
| | | show-tooltip-when-overflow |
| | | label="车间名称" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="stepname" |
| | | label="工序名称" |
| | |
| | | @close="handleClose" |
| | | > |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="110px"> |
| | | <el-divider v-if="activeName==='生产列表'||activeName==='外协收料'||activeName==='不良待处理'" content-position="left">基本信息</el-divider> |
| | | <!-- <el-divider v-if="activeName==='生产列表'||activeName==='外协收料'||activeName==='不良待处理'" content-position="left">基本信息</el-divider>--> |
| | | <el-divider v-if="activeName==='生产列表'" content-position="left">报工信息</el-divider> |
| | | <el-divider v-if="activeName==='外协收料'" content-position="left">收料信息</el-divider> |
| | | <el-divider v-if="activeName==='不良待处理'" content-position="left">待处理信息</el-divider> |
| | | <el-form-item label="工单编号" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.wo_code }}</div> |
| | | </el-form-item> |
| | |
| | | <div class="dialogFormItemDiv">{{ dialogForm.partname }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="规格型号" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.partspec }}</div> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.partspec ? dialogForm.partspec : '/' }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="当前工序" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.stepname }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="下道工序" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.nextstepname }}</div> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.nextstepname ? dialogForm.nextstepname : '/' }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="任务数量" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.planqty }}</div> |
| | |
| | | <div class="dialogFormItemDiv" style="color:red;">{{ dialogForm.noputqty }}</div> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="activeName==='生产列表'" prop="eqpcode" label="报工设备" class="dialogFormItem"> |
| | | <el-form-item v-if="activeName==='生产列表'" label="报工设备" class="dialogFormItem"> |
| | | <el-select |
| | | v-model="dialogForm.eqpcode" |
| | | style="width:200px" |
| | | placeholder="请选择" |
| | | filterable |
| | | clearable |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | |
| | | <el-input v-model="dialogForm.sqty" oninput="value=value.replace(/[^\d]/g,'')" style="width: 200px" /> |
| | | </el-form-item> |
| | | |
| | | <el-divider v-if="activeName==='生产列表'||activeName==='外协收料'" content-position="left">不良明细</el-divider> |
| | | <el-divider v-if="activeName==='生产列表'||activeName==='外协收料'" content-position="left">不良明细信息</el-divider> |
| | | <el-button |
| | | v-if="activeName==='生产列表'||activeName==='外协收料'" |
| | | v-waves |
| | |
| | | <el-table |
| | | v-if="activeName==='生产列表'||activeName==='外协收料'" |
| | | ref="defectTableDataRef" |
| | | key="defectTableDataKey" |
| | | :data="defectTableData" |
| | | border |
| | | row-class-name="custom-row" |
| | |
| | | /> |
| | | <el-table-column |
| | | prop="stepcode" |
| | | show-tooltip-when-overflow |
| | | label="缺陷编码/名称" |
| | | align="center" |
| | | min-width="450" |
| | |
| | | <el-table-column |
| | | prop="badqty" |
| | | label="不良数量" |
| | | show-tooltip-when-overflow |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | |
| | | <div |
| | | style="color: #fff;width: 22px;height: 22px;display: flex;justify-content: center;align-items: center;border-radius: 50%" |
| | | :style="{backgroundColor:$store.state.settings.theme}" |
| | | >{{ index+1 }}</div> |
| | | >{{ index + 1 }} |
| | | </div> |
| | | <div style="margin-left:30px;width: 160px;" class="ellipsis"> |
| | | {{ item.tp }} |
| | | </div> |
| | | <div style="margin-left:30px;"> |
| | | 可收数量:{{ item.fqty }} |
| | | 可收数量:{{ item.acceptQty }} |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <el-table |
| | | v-if="activeName==='不良待处理'" |
| | | ref="badTableDataDataRef" |
| | | key="badTableDataDataKey" |
| | | :data="badTableData" |
| | | border |
| | | row-class-name="custom-row" |
| | |
| | | <el-table-column |
| | | prop="repair_qty" |
| | | label="维修合格数量" |
| | | show-tooltip-when-overflow |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | |
| | | <el-table-column |
| | | prop="laborbad_qty" |
| | | label="工废数量" |
| | | show-tooltip-when-overflow |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | |
| | | <el-table-column |
| | | prop="materielbad_qty" |
| | | label="料废数量" |
| | | show-tooltip-when-overflow |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import waves from '@/directive/waves' |
| | | import { |
| | | EditOrderNgStepSeave, |
| | | MesOrderNgStepSearch, |
| | | MesOrderNgSubStepSearch, |
| | | MesOrderStepSearch, MesOrderStepStart, |
| | |
| | | EqpPermissions, |
| | | GroupsPermissions, |
| | | GroupsPersonPermissions, |
| | | PersonPermissions |
| | | PersonPermissions, PrentOrganizationNoCompany |
| | | } from '@/api/GeneralBasicData' |
| | | import { nanoid } from 'nanoid' |
| | | import { LabelBarCode } from '@/api/systemSetting' |
| | |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | form: { |
| | | wkshopcode: '', |
| | | wocode: '', // 工单号 |
| | | partcode: '', // 产品编码 |
| | | partname: '', // 产品名称 |
| | |
| | | page: 1, // 第几页 |
| | | rows: 20 // 每页多少条 |
| | | }, |
| | | wkshopcodeArr: [], |
| | | total: 10, |
| | | tableData: [], |
| | | activeName: '生产列表', |
| | |
| | | { code: 'IN', name: '外协收料' }, |
| | | { code: 'BAD', name: '不良待处理' } |
| | | ], |
| | | |
| | | radioSelected: '', // 多选框选中值 |
| | | |
| | | dialogVisible: false, |
| | |
| | | |
| | | const { data: res5 } = await CustomerPermissions() // 往来单位 |
| | | this.wxArr = res5 |
| | | |
| | | const { data: res6 } = await PrentOrganizationNoCompany()// 无公司的组织下拉 |
| | | this.wkshopcodeArr = res6 |
| | | }, |
| | | tabClick() { |
| | | let belong |
| | |
| | | break |
| | | } |
| | | this.enterNative(this.form.wocode, belong) |
| | | this.search() |
| | | // this.search() |
| | | this.radioSelected = '' |
| | | }, |
| | | enterNative(val, belong) { |
| | |
| | | $('input[name=\'produceCodeBAD\']')[0].focus() |
| | | }) |
| | | } |
| | | this.search() |
| | | }, |
| | | // 排序改变时 |
| | | sortChange({ column, prop, order }) { |
| | |
| | | // 不良处理 生产开报工扫码获取工单对应工序任务(不良明细) |
| | | async handleBad(row) { |
| | | const data = { |
| | | wocode: row.wo_code, |
| | | stepcode: row.stepcode |
| | | wocode: row ? row.wo_code : this.tableData.find(i => i.id === this.radioSelected).wo_code, |
| | | stepcode: row ? row.stepcode : this.tableData.find(i => i.id === this.radioSelected).stepcode |
| | | } |
| | | let res = await MesOrderNgSubStepSearch(data) |
| | | if (res.code === '200') { |
| | |
| | | this.dialogForm.eqpcode = res.data1.eqpcode |
| | | this.dialogForm.eqpname = res.data1.eqpname |
| | | |
| | | this.badTableData = res.data2 |
| | | |
| | | // 下周回来写不良处理保存接口 |
| | | this.badTableData.forEach(item => { |
| | | res.data2.forEach(item => { |
| | | item.repair_qty = 0 |
| | | item.bad_qty = 0 |
| | | item.laborbad_qty = 0 |
| | | item.materielbad_qty = 0 |
| | | }) |
| | | |
| | | this.badTableData = res.data2 |
| | | |
| | | this.dialogVisible = true |
| | | } |
| | |
| | | this.dialogForm.eqpcode = res.eqpcode |
| | | this.dialogForm.eqpname = res.eqpname |
| | | |
| | | this.dialogForm.list = res.list |
| | | if (this.activeName === '外协收料') { |
| | | this.dialogForm.list = [] |
| | | res.list.forEach(i => { |
| | | i.acceptQty = parseFloat(i.fqty) - parseFloat(i.sqty) - parseFloat(i.ng_qty) - parseFloat(i.laborbad_qty) - parseFloat(i.materielbad_qty) |
| | | if (i.acceptQty > 0) { |
| | | this.dialogForm.list.push(i) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // this.dialogForm.list = res.list |
| | | |
| | | this.dialogVisible = true |
| | | } |
| | |
| | | const res = await SavaMesOrderStepReport(data) |
| | | if (res.code === '200') { |
| | | this.$notify.success('报工成功!') |
| | | await this.search() |
| | | // await this.search() |
| | | await this.tabClick() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.dialogVisible = false |
| | | } else { |
| | |
| | | if (this.activeName === '外协发料') { |
| | | if (parseFloat(this.dialogForm.fqty) < 1) { |
| | | return this.$message.info('发料数量不能为零!') |
| | | } |
| | | if (parseFloat(this.dialogForm.fqty) > parseFloat(this.dialogForm.noreportqty)) { |
| | | return this.$message.info('发料数量不能大于未发数量!') |
| | | } |
| | | const data = { |
| | | mesordercode: this.dialogForm.wo_code, |
| | |
| | | const res = await SavaMesOrderStepOut(data) |
| | | if (res.code === '200') { |
| | | this.$notify.success('发料成功!') |
| | | await this.search() |
| | | // await this.search() |
| | | await this.tabClick() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.dialogVisible = false |
| | | } else { |
| | |
| | | return this.$message.info('收料数量加不良数量不能大于了可收数量!') |
| | | } |
| | | |
| | | if (this.dialogForm.list.find(i => i.name === this.dialogForm.wxcode)) { |
| | | if (this.dialogForm.list.find(i => i.name === this.dialogForm.wxcode).fqty < parseFloat(this.dialogForm.sqty) + parseFloat(this.dialogForm.noputqty)) { |
| | | if (this.dialogForm.list.find(i => i.Name === this.dialogForm.wxcode)) { |
| | | if (this.dialogForm.list.find(i => i.Name === this.dialogForm.wxcode).acceptQty < parseFloat(this.dialogForm.sqty) + parseFloat(this.dialogForm.noputqty)) { |
| | | return this.$message.info('收料数量加不良数量不能大于该供应商可收数量!') |
| | | } |
| | | } else { |
| | |
| | | const res = await SavaMesOrderStepIn(data) |
| | | if (res.code === '200') { |
| | | this.$notify.success('收料成功!') |
| | | await this.search() |
| | | // await this.search() |
| | | await this.tabClick() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.dialogVisible = false |
| | | } else { |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.$notify.error('收料失败!') |
| | | } |
| | | } |
| | | |
| | | if (this.activeName === '不良待处理') { |
| | | let flag = false |
| | | this.badTableData.forEach(i => { |
| | | if (parseFloat(i.repair_qty) + parseFloat(i.laborbad_qty) + parseFloat(i.materielbad_qty) > parseFloat(i.ng_qty)) { |
| | | flag = true |
| | | } |
| | | }) |
| | | if (flag) { |
| | | return this.$message.info('维修合格数量+工废数量+料废数量不能大于不良数量!') |
| | | } |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | const res = await EditOrderNgStepSeave({ Data: this.badTableData }) |
| | | if (res.code === '200') { |
| | | this.$notify.success('提交成功!') |
| | | // await this.search() |
| | | await this.tabClick() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.dialogVisible = false |
| | | } else { |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.$notify.error('提交失败!') |
| | | } |
| | | } |
| | | } |
| | |
| | | }) |
| | | }, |
| | | reset() { |
| | | this.form.wkshopcode = '' |
| | | this.form.wocode = '' |
| | | this.form.partcode = '' |
| | | this.form.partname = '' |
| | | this.form.partspec = '' |
| | | this.search() |
| | | }, |
| | | |
| | | headerCellStyle() { |
| | |
| | | width: 200px; |
| | | } |
| | | |
| | | ::v-deep .el-select__caret { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | ::v-deep .el-dialog .el-form-item__label { |
| | | font-weight: lighter !important; |
| | | } |
| | | |
| | | ::v-deep .el-dialog .el-divider__text { |
| | | font-weight: bolder !important; |
| | | } |
| | | |
| | | </style> |