| | |
| | | <!--新增派发对话框--> |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | :title="operation==='add'?'新增':'修改'" |
| | | :title="operation==='add'?'新增':(operation==='edit'?'修改':'详情')" |
| | | :visible.sync="dialogVisible" |
| | | width="1200px" |
| | | top="8vh" |
| | |
| | | :popper-append-to-body="false" |
| | | style="width: 200px;" |
| | | placeholder="请选择车间" |
| | | @change="getMesOrderNewStepContent" |
| | | > |
| | | <el-option |
| | | v-for="item in wkshopArr" |
| | |
| | | import { |
| | | AddMesOrderCodeSearch, |
| | | AddUpdateMesOrder, DeleteMesOrder, |
| | | MesBadOrderSearch, MesOrderDistribution, |
| | | MesBadOrderSearch, MesOrderDistribution, MesOrderNewStepContent, |
| | | MesOrderSearch, |
| | | UpdateMesOrderStepSearch |
| | | } from '@/api/WorkOrder' |
| | |
| | | const { data: res } = await UpdateMesOrderStepSearch(data) |
| | | this.dialogForm.mesmaxqty = res.canupdate_qty |
| | | |
| | | if (res.stepdata.length > 0) { |
| | | res.stepdata.forEach(i => { |
| | | this.stepTableData.push( |
| | | { |
| | |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | } else { |
| | | const data2 = { |
| | | wkshopcode: this.dialogForm.wkshopcode, |
| | | partcode: this.dialogForm.partcode |
| | | } |
| | | const { data: res2 } = await MesOrderNewStepContent(data2) |
| | | if (res2.length > 0) { |
| | | res2.forEach(i => { |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i.step_code, |
| | | // stepname: i.stepname, |
| | | stepprice: i.stepprice |
| | | } |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | } |
| | | } |
| | | |
| | | this.dialogVisible = true |
| | | }, |
| | |
| | | this.dialogForm.partname = this.partArr.find(item => item.partcode === val).partname |
| | | this.dialogForm.partcode = this.partArr.find(item => item.partcode === val).partcode |
| | | this.dialogForm.partspec = this.partArr.find(item => item.partcode === val).partspec |
| | | if (this.dialogForm.wkshopcode) { |
| | | this.getMesOrderNewStepContent() |
| | | } |
| | | }, |
| | | async getMesOrderNewStepContent() { |
| | | const data = { |
| | | wkshopcode: this.dialogForm.wkshopcode, |
| | | partcode: this.dialogForm.partcode |
| | | } |
| | | const { data: res } = await MesOrderNewStepContent(data) |
| | | // console.log(res) |
| | | this.stepSelectedValue = [] |
| | | this.stepTableData = [] |
| | | if (res.length > 0) { |
| | | res.forEach(i => { |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i.step_code, |
| | | // stepname: i.stepname, |
| | | stepprice: i.stepprice |
| | | } |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | } |
| | | }, |
| | | |
| | | // 对话框关闭事件 |
| | | handleClose() { |
| | | this.dialogForm = { |