From 650340695f626f5d141639458afaa89205e4c015 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 08 四月 2025 15:38:09 +0800
Subject: [PATCH] 成品下单修改
---
src/views/standard/standardLibrary/index.vue | 6 +-
src/views/business/productOrder/components/add.vue | 89 +++++++++++++++++++++++++++++++-------------
2 files changed, 66 insertions(+), 29 deletions(-)
diff --git a/src/views/business/productOrder/components/add.vue b/src/views/business/productOrder/components/add.vue
index cc5da0b..b6afc93 100644
--- a/src/views/business/productOrder/components/add.vue
+++ b/src/views/business/productOrder/components/add.vue
@@ -226,7 +226,7 @@
</el-form-item>
<el-form-item label="妫�楠屾爣鍑�:" style="margin-bottom: 6px;margin-top: 6px">
<el-select v-model="standardMethodListId" :loading="methodLoad" :placeholder="active > 1 ? '' : '璇疯緭鍏�'"
- clearable size="small" @change="changeStandardMethodListId" @focus="methodFocus">
+ clearable size="small" @change="changeStandardMethodListId" @focus="methodFocus" multiple>
<el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id">
</el-option>
</el-select>
@@ -287,7 +287,7 @@
<el-select v-model="scope.row.standardMethodListId" :disabled="scope.row.model == null || active > 1"
:loading="methodLoad" :readonly="active > 1" clearable placeholder="妫�楠屾爣鍑�" size="small"
style="width: 100%;" @change="(value) => methodChange(value, scope.row)" @clear="productList = []"
- @focus="methodFocus">
+ @focus="methodFocus" multiple>
<el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id">
</el-option>
</el-select>
@@ -766,7 +766,7 @@
totalArr: [],
addObj1: {},
model: null,
- standardMethodListId: null,
+ standardMethodListId: [],
symbolList: ['RTS'],
inspectionItem: null,
inspectionItemSubclass: null,
@@ -812,11 +812,11 @@
},
'addObj.sample'(val) {
this.model = null
- this.standardMethodListId = null
+ this.standardMethodListId = []
},
'addObj.sampleNum'(val) {
this.model = null
- this.standardMethodListId = null
+ this.standardMethodListId = []
},
tabIndex(val) {
if (val == 4 && this.active == 2) {
@@ -1079,9 +1079,18 @@
save() {
this.$refs['addObj'].validate((valid) => {
if (valid) {
+ // 閫夋嫨澶氫釜鏍囧噯
+ let isHaveStandardMethodListId = false
this.sampleList.forEach(item => {
+ // 璧嬪�肩壒娈婃爣鍑�
item.specialStandardMethod = this.specialStandardMethod
+ if (!item.standardMethodListId || item.standardMethodListId.length == 0) {
+ isHaveStandardMethodListId = true
+ }
})
+ if (isHaveStandardMethodListId) {
+ return this.$message.error('璇烽�夋嫨鏍囧噯')
+ }
try {
this.sampleList.forEach(item => {
if (item.insulating) {
@@ -1106,6 +1115,32 @@
if (e === true) throw e
}
let sampleList = this.HaveJson(this.sampleList)
+ // 澶氶�夋楠屾爣鍑嗘椂锛屾楠岄」涓嶈兘閲嶅閫夋嫨
+ for (let i = 0; i < sampleList.length; i++) {
+ if (sampleList[i].insProduct.length > 0) {
+ let set = new Set();
+ for (let j = 0; j < sampleList[i].insProduct.length; j++) {
+ if (sampleList[i].insProduct[j].state == 1) {
+ let num0 = set.size;
+ set.add(
+ sampleList[i].insProduct[j].inspectionItem +
+ "-" +
+ sampleList[i].insProduct[j].inspectionItemSubclass
+ );
+ let num1 = set.size;
+ if (num0 == num1) {
+ this.$message.error(
+ sampleList[i].insProduct[j].inspectionItem +
+ "-" +
+ sampleList[i].insProduct[j].inspectionItemSubclass +
+ "閲嶅"
+ );
+ return;
+ }
+ }
+ }
+ }
+ }
sampleList.forEach(a => {
if (a.insProduct.length > 0) {
a.insProduct.forEach(c => {
@@ -1452,7 +1487,7 @@
this.sample.sample = this.addObj.sample
this.sample.model = this.addObj.model
this.sample.unit = this.addObj.unit
- this.sample.standardMethodListId = null
+ this.sample.standardMethodListId = []
this.sample.insProduct = []
this.sample.id = this.count
this.sample.childSampleList = []
@@ -1497,7 +1532,7 @@
this.sample.sample = this.addObj.sample
this.sample.model = this.addObj.model
this.sample.unit = this.addObj.unit
- this.sample.standardMethodListId = null
+ this.sample.standardMethodListId = []
this.sample.insProduct = []
this.sample.id = parseInt(i + 1)
this.sample.childSampleList = []
@@ -1522,12 +1557,12 @@
},
rowClick(row, column, event) {
this.currentMethod = row
- let obj = this.methods.find(a => a.id == this.currentMethod.standardMethodListId)
- if (obj && obj.code == '鎶�鏈姹�') {
- this.isAskOnlyRead = true
- } else {
- this.isAskOnlyRead = false
- }
+ // let obj = this.methods.find(a => a.id == this.currentMethod.standardMethodListId)
+ // if (obj && obj.code == '鎶�鏈姹�') {
+ // this.isAskOnlyRead = true
+ // } else {
+ // this.isAskOnlyRead = false
+ // }
this.sampleId = row.id
if (this.active !== 1) {
this.sampleIds = []
@@ -1721,7 +1756,8 @@
selectStandardProductList({
model: this.addObj.model ? this.addObj.model : row.model,
modelNum: row.modelNum,
- standardMethodListId: val,
+ standardMethodListIds: val,
+ state: 1,
factory: selectTreeList.join(" - "),
cores: row.cores,
conductorMaterial: row.conductorMaterial,
@@ -1771,21 +1807,22 @@
}
}
}
- if (val === null || val === '') return
+ if (!val || val.length == 0) return
this.currentMethod = row
- let obj = this.methods.find(a => a.id == this.currentMethod.standardMethodListId)
- if (obj && obj.code == '鎶�鏈姹�') {
- this.isAskOnlyRead = true
- } else {
- this.isAskOnlyRead = false
- }
+ // let obj = this.methods.find(a => a.id == this.currentMethod.standardMethodListId)
+ // if (obj && obj.code == '鎶�鏈姹�') {
+ // this.isAskOnlyRead = true
+ // } else {
+ // this.isAskOnlyRead = false
+ // }
this.getProductLoad = true
let selectTreeList = this.selectTree.split(" - ")
this.addObj.model && (selectTreeList[selectTreeList.length - 1] = this.addObj.model)
selectStandardProductList({
model: this.addObj.model ? this.addObj.model : row.model,
modelNum: row.modelNum,
- standardMethodListId: val,
+ standardMethodListIds: val,
+ state: 1,
cores: row.cores,
factory: selectTreeList.join(" - "),
}).then(res => {
@@ -1985,14 +2022,14 @@
if (this.sampleIds.length === 0) {
this.$message.error("鏈�夋嫨鏍峰搧")
} else if (this.sampleIds.length === 1) {
- if (!this.sampleSelectionList[0].standardMethodListId) {
+ if (!this.sampleSelectionList[0].standardMethodListId || this.sampleSelectionList[0].standardMethodListId.length == 0) {
this.$message.error("鏍峰搧鏈�夋嫨妫�楠屾爣鍑�")
return
}
this.auxiliaryShow = true
} else {
// 鍚屾椂閰嶇疆澶氫釜鏍峰搧鐨勭數缂嗛厤缃椂蹇呴』閫夋嫨鐩稿悓鐨勬楠屾爣鍑�
- if (!this.sampleSelectionList.every(value => value.standardMethodListId)) {
+ if (!this.sampleSelectionList.every(value => value.standardMethodListId && value.standardMethodListId.length > 0)) {
this.$message.error("鏍峰搧鏈�夋嫨妫�楠屾爣鍑�")
} else {
if (!this.areObjectsValuesEqual(this.sampleSelectionList, 'standardMethodListId')) {
@@ -2013,14 +2050,14 @@
if (this.sampleIds.length === 0) {
this.$message.error("鏈�夋嫨鏍峰搧")
} else if (this.sampleIds.length === 1) {
- if (!this.sampleSelectionList[0].standardMethodListId) {
+ if (!this.sampleSelectionList[0].standardMethodListId || this.sampleSelectionList[0].standardMethodListId.length == 0) {
this.$message.error("鏍峰搧鏈�夋嫨妫�楠屾爣鍑�")
return
}
this.cableConfigShow = true
} else {
// 鍚屾椂閰嶇疆澶氫釜鏍峰搧鐨勭數缂嗛厤缃椂蹇呴』閫夋嫨鐩稿悓鐨勬楠屾爣鍑�
- if (!this.sampleSelectionList.every(value => value.standardMethodListId)) {
+ if (!this.sampleSelectionList.every(value => value.standardMethodListId && value.standardMethodListId.length > 0)) {
this.$message.error("鏍峰搧鏈�夋嫨妫�楠屾爣鍑�")
} else {
if (!this.areObjectsValuesEqual(this.sampleSelectionList, 'standardMethodListId')) {
diff --git a/src/views/standard/standardLibrary/index.vue b/src/views/standard/standardLibrary/index.vue
index 9d2d1b7..7f94c3a 100644
--- a/src/views/standard/standardLibrary/index.vue
+++ b/src/views/standard/standardLibrary/index.vue
@@ -56,7 +56,7 @@
<el-row class="title" style="width: 100%">
<el-col :span="19" style="font-size: 14px; color: #999"><span>{{
selectTree
- }} </span></el-col>
+ }} </span></el-col>
<el-col :span="5" style="position: absolute;top: -3px;right: -25px;" v-if="!auditId && !standardCkeck">
<el-button size="small" type="primary" @click="submitReview" :loading="submitReviewLoad">鎻愪氦鍙樻洿</el-button>
<el-button v-if="isShowCopy" size="small" type="primary" @click="openCopyDia">鎵归噺澶嶅埗</el-button>
@@ -133,11 +133,11 @@
<span v-else>{{ scope.row.methodS }}</span>
</template>
</el-table-column> -->
- <el-table-column label="鏉′欢" min-width="140" prop="radius" show-overflow-tooltip>
+ <el-table-column label="璇曢獙鏉′欢" min-width="140" prop="radius" show-overflow-tooltip>
<template slot-scope="scope">
<el-select v-if="
checkPermi(['standard:standardLibrary:upStandardProduct'])
- " v-model="scope.row.radius" clearable placeholder="鏉′欢" size="small" @change="(value) => upStandardProductListOfRadius(value, scope.row.id)
+ " v-model="scope.row.radius" clearable placeholder="璇曢獙鏉′欢" size="small" @change="(value) => upStandardProductListOfRadius(value, scope.row.id)
" :disabled="!!auditId || standardCkeck">
<el-option v-for="(a, i) in scope.row.radiusList &&
JSON.parse(scope.row.radiusList)" :key="i" :label="a" :value="a"></el-option>
--
Gitblit v1.9.3