| | |
| | | placeholder="请选择车间" |
| | | @change="getMesOrderNewStepContent" |
| | | > |
| | | |
| | | <!-- @change="sourceType? getMesOrderNewStepContent():routecodeChange()"--> |
| | | <el-option |
| | | v-for="item in wkshopArr" |
| | | :key="item.torg_code" |
| | |
| | | </el-form-item> |
| | | <!-- :disabled="dialogForm.partcode===''"--> |
| | | |
| | | <el-form-item label="工艺路线" prop="wkshopcode"> |
| | | <el-form-item v-if="mesSetting.route" label="工艺路线" prop="wkshopcode"> |
| | | <el-select |
| | | v-model="dialogForm.routecode" |
| | | filterable |
| | |
| | | methods: { |
| | | // 工序来源切换 |
| | | sourceTypeChange(val) { |
| | | this.stepTableData = [] |
| | | if (val) { |
| | | this.getMesOrderNewStepContent() |
| | | } else { |
| | | if (this.mesSetting.route) { |
| | | this.routecodeChange() |
| | | } else { |
| | | this.getBasicProcessData() |
| | | } |
| | | } |
| | | }, |
| | | |
| | |
| | | |
| | | this.dialogForm.mesqtyinit = row.plan_qty |
| | | |
| | | // this.sourceTypeChange(false) |
| | | |
| | | if (!this.dialogForm.routecode) { |
| | | await this.getPartcodeChangeDialog() |
| | | } |
| | | |
| | | // if (row.status === 'NEW') { |
| | | // |
| | | // } |
| | | |
| | | const data = { |
| | | sourceid: this.dialogForm.sourceorderid, |
| | | sourcewo: this.dialogForm.sourceorder, |
| | |
| | | } |
| | | const { data: res } = await UpdateMesOrderStepSearch(data) |
| | | this.dialogForm.mesmaxqty = res.canupdate_qty |
| | | |
| | | if (this.mesSetting.route) { // 按工艺路线走模式 |
| | | if (!this.dialogForm.routecode) { |
| | | await this.getPartcodeChangeDialog() |
| | | } |
| | | |
| | | if (res.stepdata.length > 0) { |
| | | res.stepdata.forEach(i => { |
| | |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | } |
| | | } |
| | | } else { |
| | | if (res.stepdata.length > 0) { |
| | | res.stepdata.forEach(i => { |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i.step_code, |
| | | stepname: i.stepname, |
| | | stepprice: i.stepprice |
| | | } |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | } else { |
| | | await this.getBasicProcessData() |
| | | } |
| | | } |
| | | |
| | | this.dialogVisible = true |
| | | this.$nextTick(() => { |
| | | this.setSort() |
| | | }) |
| | | }, |
| | | // 按工序模式走的时候 引用基础资料 工艺 |
| | | async getBasicProcessData() { |
| | | const { data: res } = await PartSelectRpute({ partcode: this.dialogForm.partcode }) |
| | | res.sort((a, b) => a.step_seq - b.step_seq) |
| | | this.stepTableData = [] |
| | | res.forEach(i => { |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i.step_code, |
| | | stepname: i.step_name, |
| | | stepprice: i.unprice |
| | | } |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | }, |
| | | // 工单关闭事件 |
| | | orderClose() { |
| | |
| | | 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() |
| | | // } |
| | | |
| | | this.dialogForm.routecode = '' |
| | | |
| | | if (this.mesSetting.route) { |
| | | this.getPartcodeChangeDialog() |
| | | } else { |
| | | this.getBasicProcessData() |
| | | } |
| | | }, |
| | | |
| | | async getPartcodeChangeDialog() { |
| | | const { data: res } = await PartSelectRpute({ partcode: this.dialogForm.partcode }) |
| | | this.routecodeArr = res |
| | | |
| | | // if (this.mesSetting.route) { // 按工艺路线走模式 |
| | | this.dialogForm.routecode = this.partArr.find(item => item.partcode === this.dialogForm.partcode).default_route |
| | | |
| | | if (this.dialogForm.routecode && !this.sourceType) { |
| | | await this.routecodeChange() |
| | | } else { |
| | | await this.getMesOrderNewStepContent() |
| | | } |
| | | // } |
| | | // else { // 按工序走模式 |
| | | // await this.getMesOrderNewStepContent() |
| | | // } |
| | | }, |
| | | |
| | | // 工艺路线值改变 |
| | | async routecodeChange() { |
| | | const data = { |
| | | partcode: this.dialogForm.partcode, |
| | |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | } |
| | | }, |
| | | |
| | | async getMesOrderNewStepContent() { |
| | | // if (!this.mesSetting.route && this.operation === 'edit') { |
| | | // return |
| | | // } |
| | | |
| | | const data = { |
| | | routecode: this.dialogForm.routecode, |
| | | wkshopcode: this.dialogForm.wkshopcode, |