From 56e5c4574c47189adb81aa9cb0d162b55d0ddbef Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期五, 07 六月 2024 13:58:01 +0800
Subject: [PATCH] 1.工艺SOP开发完成
---
src/views/workOrder/workOrderList.vue | 124 ++++++++++++++++++++++++++++-------------
1 files changed, 84 insertions(+), 40 deletions(-)
diff --git a/src/views/workOrder/workOrderList.vue b/src/views/workOrder/workOrderList.vue
index 7d4fab9..4bde2c9 100644
--- a/src/views/workOrder/workOrderList.vue
+++ b/src/views/workOrder/workOrderList.vue
@@ -629,7 +629,7 @@
placeholder="璇烽�夋嫨杞﹂棿"
@change="getMesOrderNewStepContent"
>
-
+ <!-- @change="sourceType? getMesOrderNewStepContent():routecodeChange()"-->
<el-option
v-for="item in wkshopArr"
:key="item.torg_code"
@@ -671,7 +671,7 @@
</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
@@ -2355,10 +2355,15 @@
methods: {
// 宸ュ簭鏉ユ簮鍒囨崲
sourceTypeChange(val) {
+ this.stepTableData = []
if (val) {
this.getMesOrderNewStepContent()
} else {
- this.routecodeChange()
+ if (this.mesSetting.route) {
+ this.routecodeChange()
+ } else {
+ this.getBasicProcessData()
+ }
}
},
@@ -2606,16 +2611,6 @@
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,
@@ -2625,34 +2620,55 @@
const { data: res } = await UpdateMesOrderStepSearch(data)
this.dialogForm.mesmaxqty = res.canupdate_qty
- 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 {
- const data2 = {
- wkshopcode: this.dialogForm.wkshopcode,
- partcode: this.dialogForm.partcode
+ if (this.mesSetting.route) { // 鎸夊伐鑹鸿矾绾胯蛋妯″紡
+ if (!this.dialogForm.routecode) {
+ await this.getPartcodeChangeDialog()
}
- const { data: res2 } = await MesOrderNewStepContent(data2)
- if (res2.length > 0) {
- res2.forEach(i => {
+
+ if (res.stepdata.length > 0) {
+ res.stepdata.forEach(i => {
this.stepTableData.push(
{
stepcode: i.step_code,
- // stepname: i.stepname,
+ stepname: i.stepname,
stepprice: i.stepprice
}
)
})
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)
+ }
+ }
+ } 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()
}
}
@@ -2660,6 +2676,22 @@
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() {
@@ -2671,26 +2703,33 @@
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 = ''
- this.getPartcodeChangeDialog()
+
+ 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,
@@ -2714,7 +2753,12 @@
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,
@@ -2824,11 +2868,11 @@
if (res.code === '200') {
this.dialogVisible = false
// this.handlePrint()
- this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '娲惧彂鎴愬姛锛�')
+ this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇濆瓨鎴愬姛锛�')
this.getMesOrderSearch()
this.$store.state.app.buttonIsDisabled = false
} else {
- this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '娲惧彂澶辫触锛�')
+ this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇濆瓨澶辫触锛�')
}
})
}
--
Gitblit v1.9.3