From 45792b3776cda2e1ada31755ffc226a663f90b48 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期三, 19 三月 2025 15:32:23 +0800
Subject: [PATCH] 锁屏功能
---
src/views/business/inspectionOrder/fiberoptic-config.vue | 914 ++++++++++++++++----------------------------------------
1 files changed, 261 insertions(+), 653 deletions(-)
diff --git a/src/views/business/inspectionOrder/fiberoptic-config.vue b/src/views/business/inspectionOrder/fiberoptic-config.vue
index eeeb0dc..b88a619 100644
--- a/src/views/business/inspectionOrder/fiberoptic-config.vue
+++ b/src/views/business/inspectionOrder/fiberoptic-config.vue
@@ -119,8 +119,8 @@
<el-option
v-for="(color, i) in colors"
:key="i"
- :label="color.lable"
- :value="color.value"
+ :label="color.dictLable"
+ :value="color.dictValue"
></el-option>
</el-select>
</template>
@@ -551,8 +551,8 @@
<el-option
v-for="(color, i) in colors"
:key="i"
- :label="color.lable"
- :value="color.value"
+ :label="color.dictLable"
+ :value="color.dictValue"
></el-option>
</el-select>
</template>
@@ -796,6 +796,15 @@
</template>
<script>
+import { getDicts } from "@/api/system/dict/data";
+import {
+ getStandTreeBySampleType,
+ selectStandardTreeList2,
+ selectStandardMethodEnum,
+ selectsStandardMethodByFLSSM,
+ selectStandardProductList,
+} from "@/api/standard/standardLibrary";
+import { permute } from "@/api/business/inspectionOrder";
export default {
props: {
active: {
@@ -999,8 +1008,8 @@
let color = this.colors[i];
for (let j = 0; j < newFiberList.length; j++) {
let newColor = newFiberList[j];
- if (color.value == newColor[0]) {
- newFiberList[j].push(color.orderNum);
+ if (color.dictValue == newColor[0]) {
+ newFiberList[j].push(color.dictSort);
}
}
}
@@ -1279,12 +1288,14 @@
this.$parent.configShow = false;
},
getTypeDicts1() {
- this.$axios
- .post(this.$api.enums.selectEnumByCategory, {
- category: "鑹叉爣",
- })
+ getDicts("fiber_color_type")
.then((res) => {
- this.colors = res.data;
+ if (res.code === 200) {
+ this.colors = res.data;
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
// 濂楃鏁扮洰鐢熸垚琛ㄦ牸鏁版嵁
@@ -1293,7 +1304,7 @@
for (let i = 0; i < this.packageInfo.num1; i++) {
let bushing = {
ident: this.bushing.length + 1,
- color: this.colors[i].label,
+ color: this.colors[i].dictLabel,
standNum: null,
testNum: null,
fibers: [],
@@ -1366,11 +1377,6 @@
this.multiFiberList = this.fibersList;
// 榛樿鍕鹃��
setTimeout(() => {
- // this.selectBushing.forEach(item =>{
- // let rowToSelect = this.bushing.find(a => a.ident == item.ident)
- // this.$refs.table0.toggleRowSelection(rowToSelect, true)
- // })
-
this.multiFiberList.forEach((item) => {
let rowToSelect = this.fibersList.find(
(a) => a.ident == item.ident
@@ -1401,10 +1407,6 @@
this.addFiber(1);
// 榛樿鍕鹃��
setTimeout(() => {
- // this.selectBushing.forEach(item =>{
- // let rowToSelect = this.bushing.find(a => a.ident == item.ident)
- // this.$refs.table0.toggleRowSelection(rowToSelect, true)
- // })
this.fiberList.forEach((item) => {
this.$refs.table3.toggleRowSelection(item, true);
});
@@ -1446,7 +1448,7 @@
this.bushing = [];
for (var i = 0; i < this.packageInfo.num1; i++) {
let bushing = {
- color: colors2[i].label,
+ color: colors2[i].dictLabel,
standNum: this.packageInfo.standNum,
testNum: this.packageInfo.testNum,
fibers: [],
@@ -1486,83 +1488,76 @@
}
},
getStandTreeBySampleType() {
- this.$axios
- .post(this.$api.standardTree.getStandTreeBySampleType, {
- laboratory: "閫氫俊浜у搧瀹為獙瀹�",
- sampleType: "鍏夌氦",
- })
+ getStandTreeBySampleType({
+ laboratory: "閫氫俊浜у搧瀹為獙瀹�",
+ sampleType: "鍏夌氦",
+ })
.then((res) => {
- this.mireModels = [];
- res.data.forEach((a) => {
- this.mireModels.push({
- label: a.model,
- value: a.sample + " - " + a.model,
+ if (res.code === 200) {
+ this.mireModels = [];
+ res.data.forEach((a) => {
+ this.mireModels.push({
+ label: a.model,
+ value: a.sample + " - " + a.model,
+ });
});
- });
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
getStandTreeBySampleType2() {
- this.$axios
- .post(this.$api.standardTree.getStandTreeBySampleType, {
- laboratory: "閫氫俊浜у搧瀹為獙瀹�",
- sampleType: "鍏夌氦甯�",
- })
+ getStandTreeBySampleType({
+ laboratory: "閫氫俊浜у搧瀹為獙瀹�",
+ sampleType: "鍏夌氦甯�",
+ })
.then((res) => {
- this.miresModels = [];
- res.data.forEach((a) => {
- this.miresModels.push({
- label: a.model,
- value: a.model,
+ if (res.code === 200) {
+ this.miresModels = [];
+ res.data.forEach((a) => {
+ this.miresModels.push({
+ label: a.model,
+ value: a.model,
+ });
});
- });
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
selectsStandardMethodByFLSSM() {
this.mireStandards = [];
this.mireStandardLoading = true;
- this.$axios
- .post(this.$api.standardTree.selectsStandardMethodByFLSSM, {
- tree: "涓ぉ绉戞妧妫�娴嬩腑蹇� - 閫氫俊浜у搧瀹為獙瀹� - 鍏夌氦 - " + this.mireModel,
- })
+ selectsStandardMethodByFLSSM({
+ tree: "涓ぉ绉戞妧妫�娴嬩腑蹇� - 閫氫俊浜у搧瀹為獙瀹� - 鍏夌氦 - " + this.mireModel,
+ })
.then((res) => {
- this.mireStandardLoading = false;
- this.mireStandards = res.data.standardMethodList;
+ if (res.code === 200) {
+ this.mireStandardLoading = false;
+ this.mireStandards = res.data.standardMethodList;
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
selectsStandardMethodByFLSSM2() {
this.miresStandards = [];
- this.$axios
- .post(this.$api.standardTree.selectsStandardMethodByFLSSM, {
- tree:
- "涓ぉ绉戞妧妫�娴嬩腑蹇� - 閫氫俊浜у搧瀹為獙瀹� - 鍏夌氦甯� - " + this.miresModel,
- })
+ selectsStandardMethodByFLSSM({
+ tree: "涓ぉ绉戞妧妫�娴嬩腑蹇� - 閫氫俊浜у搧瀹為獙瀹� - 鍏夌氦甯� - " + this.miresModel,
+ })
.then((res) => {
- this.miresStandards = res.data.standardMethodList;
+ if (res.code === 200) {
+ this.miresStandards = res.data.standardMethodList;
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
methodChange(val) {
- // if (val === null || val === '') return
- // this.$axios.post(this.$api.standardTree.selectStandardProductList, {
- // model: this.mireModel.split(' - ')[1],
- // standardMethodListId: val,
- // factory: ''
- // }, {
- // headers: {
- // 'Content-Type': 'application/json'
- // }
- // }).then(res => {
- // res.data.forEach(a => {
- // a.state = 0
- // })
- // this.productList = res.data
- // setTimeout(() => {
- // this.productList.forEach(a => {
- // if (a.state == 1) this.toggleSelection(a)
- // })
- // this.addFiber()
- // }, 200)
- // })
-
// 灏嗕笅鎷夋鍊艰祴鍊肩粰鍏夌氦 鐩戝惉鍘婚櫎
if (this.selectFiberList.length == 0) {
this.$message.error("璇烽�夋嫨鏁版嵁");
@@ -1571,135 +1566,91 @@
if (val === null || val === "") return;
if (this.mireStandards == null) return;
- this.$axios
- .post(
- this.$api.standardTree.selectStandardProductList,
- {
- model: this.mireModel.split(" - ")[1],
- standardMethodListId: val,
- factory: "",
- },
- {
- headers: {
- "Content-Type": "application/json",
- },
- }
- )
+ selectStandardProductList({
+ model: this.mireModel.split(" - ")[1],
+ standardMethodListId: val,
+ factory: "",
+ })
.then((res) => {
- this.detectionItems = [];
- if (res.data != null && res.data.length != 0) {
- res.data.forEach((a) => {
- a.state = 0;
- });
- this.detectionItems = res.data;
- this.detectionType = 0;
- this.$set(this.detectionItems, "type", 0);
- }
- this.mireStandards.find((a) => a.id == val).code == "濮旀墭瑕佹眰"
- ? (this.isAskOnlyRead = false)
- : (this.isAskOnlyRead = true);
- this.selectFiberList.forEach((item) => {
- this.fiberList.forEach((a) => {
- if (a.ident == item.ident) {
- a.model = this.mireModel.split(" - ")[1]; // 鍏夌氦瑙勬牸
- a.noSplitModel = this.mireModel; // 鍏夌氦瑙勬牸
- if (this.mireStandards != null) {
- a.standard = this.mireStandards.find(
- (a) => a.id == this.mireStandard
- ).code; // 鍙傝�冩爣鍑�
+ if (res.code === 200) {
+ this.detectionItems = [];
+ if (res.data != null && res.data.length != 0) {
+ res.data.forEach((a) => {
+ a.state = 0;
+ });
+ this.detectionItems = res.data;
+ this.detectionType = 0;
+ this.$set(this.detectionItems, "type", 0);
+ }
+ this.mireStandards.find((a) => a.id == val).code == "濮旀墭瑕佹眰"
+ ? (this.isAskOnlyRead = false)
+ : (this.isAskOnlyRead = true);
+ this.selectFiberList.forEach((item) => {
+ this.fiberList.forEach((a) => {
+ if (a.ident == item.ident) {
+ a.model = this.mireModel.split(" - ")[1]; // 鍏夌氦瑙勬牸
+ a.noSplitModel = this.mireModel; // 鍏夌氦瑙勬牸
+ if (this.mireStandards != null) {
+ a.standard = this.mireStandards.find(
+ (a) => a.id == this.mireStandard
+ ).code; // 鍙傝�冩爣鍑�
+ }
}
- }
+ });
});
- });
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
methodChange2(val) {
- // if (val === null || val === '') return
- // this.$axios.post(this.$api.standardTree.selectStandardProductList, {
- // model: '',
- // standardMethodListId: val,
- // factory: '涓ぉ绉戞妧妫�娴嬩腑蹇� - 閫氫俊浜у搧瀹為獙瀹� - 鍏夌氦甯� - ' + this.miresModel + ' - ',
- // }, {
- // headers: {
- // 'Content-Type': 'application/json'
- // }
- // }).then(res => {
- // res.data.forEach(a => {
- // a.state = 0
- // })
- // this.productList2 = res.data
- // setTimeout(() => {
- // this.productList2.forEach(a => {
- // if (a.state == 1) this.toggleSelection(a)
- // })
- // this.addFibers()
- // }, 200)
- // })
if (this.multiFiberList.length == 0) {
this.$message.error("璇烽�夋嫨闇�瑕佹洿鏀圭殑鏁版嵁");
return;
}
if (val === null || val === "") return;
- this.$axios
- .post(
- this.$api.standardTree.selectStandardProductList,
- {
- model: "",
- standardMethodListId: val,
- factory:
- "涓ぉ绉戞妧妫�娴嬩腑蹇� - 閫氫俊浜у搧瀹為獙瀹� - 鍏夌氦甯� - " +
- this.miresModel +
- " - ",
- },
- {
- headers: {
- "Content-Type": "application/json",
- },
- }
- )
+ selectStandardProductList({
+ model: "",
+ standardMethodListId: val,
+ factory:
+ "涓ぉ绉戞妧妫�娴嬩腑蹇� - 閫氫俊浜у搧瀹為獙瀹� - 鍏夌氦甯� - " +
+ this.miresModel +
+ " - ",
+ })
.then((res) => {
- // 灏嗚幏鍙栫殑妫�娴嬮」淇℃伅璧嬪��
- this.detectionItems = [];
- if (res.data != null && res.data.length != 0) {
- res.data.forEach((a) => {
- a.state = 0;
- });
- this.detectionItems = res.data;
- this.detectionType = 1;
- this.$set(this.detectionItems, "type", 1);
- // 鍒ゆ柇鏄惁涓哄鎵樿姹�
- this.miresStandards.find((a) => a.id == val).code == "濮旀墭瑕佹眰"
- ? (this.isAskOnlyRead = false)
- : (this.isAskOnlyRead = true);
- }
- // 缁欓�変腑鐨勫厜绾ゅ甫璧嬪��
- // for(let i= 0; i < this.fibersList.length; i++){
- // this.multiFiberList.forEach(item => {
- // if(this.fibersList[i].ident == item.ident){
- // this.fibersList[i].model = this.miresModel // 绾ゅ甫瑙勬牸
- // this.fibersList[i].num = this.miresModel.replace('鑺�','') // 鍏夌氦妫�娴嬮噺
- // this.fibersList[i].productList = this.detectionItems // 妫�娴嬮」
- // this.miresStandards.forEach(a => {
- // if(a.id == this.miresStandard) {
- // this.fibersList[i].standard = a.code // 鍙傝�冩爣鍑�
- // }
- // })
- // }
- // })
- // }
- for (let i = 0; i < this.multiFiberList.length; i++) {
- for (let j = 0; j < this.fibersList.length; j++) {
- if (this.multiFiberList[i].ident == this.fibersList[j].ident) {
- this.fibersList[j].model = this.miresModel; // 绾ゅ甫瑙勬牸
- this.fibersList[j].num = this.miresModel.replace("鑺�", ""); // 鍏夌氦妫�娴嬮噺
- this.miresStandards.forEach((a) => {
- if (a.id == this.miresStandard) {
- this.fibersList[j].standard = a.code; // 鍙傝�冩爣鍑�
- }
- });
+ if (res.code === 200) {
+ // 灏嗚幏鍙栫殑妫�娴嬮」淇℃伅璧嬪��
+ this.detectionItems = [];
+ if (res.data != null && res.data.length != 0) {
+ res.data.forEach((a) => {
+ a.state = 0;
+ });
+ this.detectionItems = res.data;
+ this.detectionType = 1;
+ this.$set(this.detectionItems, "type", 1);
+ // 鍒ゆ柇鏄惁涓哄鎵樿姹�
+ this.miresStandards.find((a) => a.id == val).code == "濮旀墭瑕佹眰"
+ ? (this.isAskOnlyRead = false)
+ : (this.isAskOnlyRead = true);
+ }
+ for (let i = 0; i < this.multiFiberList.length; i++) {
+ for (let j = 0; j < this.fibersList.length; j++) {
+ if (this.multiFiberList[i].ident == this.fibersList[j].ident) {
+ this.fibersList[j].model = this.miresModel; // 绾ゅ甫瑙勬牸
+ this.fibersList[j].num = this.miresModel.replace("鑺�", ""); // 鍏夌氦妫�娴嬮噺
+ this.miresStandards.forEach((a) => {
+ if (a.id == this.miresStandard) {
+ this.fibersList[j].standard = a.code; // 鍙傝�冩爣鍑�
+ }
+ });
+ }
}
}
}
+ })
+ .catch((error) => {
+ console.error(error);
});
},
addFiber(isInspection) {
@@ -1762,7 +1713,7 @@
let fiber = {
ident: this.fiberList.length + 1,
bushColor: item.color,
- color: colors3[count].label,
+ color: colors3[count].dictLabel,
model: null,
noSplitModel: null,
standard: null,
@@ -1775,65 +1726,6 @@
}
}
});
- // this.multiFiberList.forEach((a, index) => {
- // a.fiber = [];
- // if (index > 0 && index < this.multiFiberList.length) {
- // if (
- // this.multiFiberList[index].color ==
- // this.multiFiberList[index - 1].color
- // ) {
- // // 鏍规嵁姣忔牴绠℃娊妫�鏍囧噯閲� 纭畾 棰滆壊寰幆
- // //let colors3 = colors2.slice(0,this.packageInfo.standNum)
- // for (var i = 0; i < parseInt(a.num); i++) {
- // let fiber = {
- // ident: this.fiberList.length + 1,
- // bushColor: a.color,
- // // color: colors2[(i+(parseInt(a.num)*index))>colors2.length?0:i+(parseInt(a.num)*index)*index].label,
- // color: colors2[count].label,
- // model: null,
- // noSplitModel: null,
- // standard: null,
- // fibersIdent: a.ident,
- // productList: [],
- // };
- // this.fiberList.push(fiber);
- // count++;
- // }
- // } else {
- // // 鏍规嵁姣忔牴绠℃娊妫�鏍囧噯閲� 纭畾 棰滆壊寰幆
- // let colors3 = colors2.slice(0, this.packageInfo.standNum);
- // for (var i = 0; i < parseInt(a.num); i++) {
- // let fiber = {
- // ident: this.fiberList.length + 1,
- // bushColor: a.color,
- // // color: colors2[(i+(parseInt(a.num)*index))>colors2.length?0:i+(parseInt(a.num)*index)*index].label,
- // color: colors3[i].label,
- // model: null,
- // noSplitModel: null,
- // standard: null,
- // fibersIdent: a.ident,
- // productList: [],
- // };
- // this.fiberList.push(fiber);
- // }
- // }
- // } else {
- // for (var i = 0; i < parseInt(a.num); i++) {
- // let fiber = {
- // ident: this.fiberList.length + 1,
- // bushColor: a.color,
- // // color: colors2[(i+(parseInt(a.num)*index))>colors2.length?0:i+(parseInt(a.num)*index)*index].label,
- // color: colors2[i].label,
- // model: null,
- // noSplitModel: null,
- // standard: null,
- // fibersIdent: a.ident,
- // productList: [],
- // };
- // this.fiberList.push(fiber);
- // }
- // }
- // });
} else {
let count = 0;
let colors3 = colors2.slice(0, this.packageInfo.standNum);
@@ -1844,7 +1736,7 @@
let fiber = {
ident: this.fiberList.length + 1,
bushColor: item.color,
- color: colors3[count].label,
+ color: colors3[count].dictLabel,
model: null,
standard: null,
productList: [],
@@ -1880,7 +1772,7 @@
let fiber = {
ident: this.fiberList.length + 1,
bushColor: item.color,
- color: colors3[count].label,
+ color: colors3[count].dictLabel,
model: null,
standard: null,
productList: [],
@@ -1889,24 +1781,6 @@
count++;
count = count % item.standNum;
}
- // else {
- // for (let i = 0; i < parseInt(item.testNum); i++) {
- // let fiber = {
- // ident: this.fiberList.length + 1,
- // bushColor: item.color,
- // color:
- // colors2[
- // i + parseInt(item.testNum) * index > colors2.length
- // ? 0
- // : i + parseInt(item.testNum) * index * index
- // ].label,
- // model: null,
- // standard: null,
- // productList: [],
- // };
- // this.fiberList.push(fiber);
- // }
- // }
} else {
flag = false;
}
@@ -1917,125 +1791,8 @@
return;
}
}
- // 浜屼唬
- // // 鏄惁閫夋嫨濂楃
- // if(this.selectBushing.length == 0) {
- // this.$message.error('鏈�夋嫨濂楃')
- // return
- // }
- // this.fiberList = []
- // let flag = true
- // // 鎸夌収椤哄簭鐢熸垚鍏夌氦鑹叉爣
- // let colors2 = []
- // if (this.packageInfo.num1 / this.colors.length > 1) {
- // let num = this.packageInfo.num1 / this.colors.length
- // if (this.packageInfo.num1 % this.colors.length > 0) num += 1
- // for (var i = 0; i < num; i++) {
- // colors2 = colors2.concat(this.colors)
- // }
- // } else {
- // colors2 = colors2.concat(this.colors)
- // }
- // // 鏍规嵁濂楃鐨勬祴璇曢噺鐢熸垚瀵瑰簲鐨勬暟閲忕殑鍏夌氦鏁版嵁
- // this.selectBushing.forEach((item,index) =>{
- // if(item.testNum != null && item.testNum != ''){
- // for(let i =0; i < parseInt(item.testNum); i++){
- // let fiber = {
- // ident: this.fiberList.length + 1,
- // bushColor: item.color,
- // color: colors2[(i+(parseInt(item.testNum)*index))>colors2.length?0:i+(parseInt(item.testNum)*index)*index].label,
- // model: null,
- // standard: null,
- // productList: []
- // }
- // this.fiberList.push(fiber)
- // }
- // }else {
- // flag = false
- // }
- // })
- // if(!flag){
- // this.$message.error('璇峰~鍐欏厜绾ゆ娴嬮噺')
- // return
- // }
-
- // 鏈�鍒�
- // let colors2 = []
- // if (this.packageInfo.num1 / this.colors.length > 1) {
- // let num = this.packageInfo.num1 / this.colors.length
- // if (this.packageInfo.num1 % this.colors.length > 0) num += 1
- // for (var i = 0; i < num; i++) {
- // colors2 = colors2.concat(this.colors)
- // }
- // } else {
- // colors2 = colors2.concat(this.colors)
- // }
- // this.fiberList = []
- // let model = this.mireModel.split(' - ')[1]
- // let standard = this.mireStandards.find(a => a.id == this.mireStandard).code
- // if (this.packageInfo.ismiers) {
- // if(this.selectFibers.length === 0){
- // this.$message.error('鏈�夋嫨鍏夌氦甯�')
- // return
- // }
- // this.selectFibers.forEach((a,index) => {
- // a.fiber = []
- // for (var i = 0; i < parseInt(a.num); i++) {
- // let fiber = {
- // bushColor: a.color,
- // color: colors2[(i+(parseInt(a.num)*index))>colors2.length?0:i+(parseInt(a.num)*index)*index].label,
- // model: model,
- // standard: standard,
- // productList: this.HaveJson(this.productList)
- // }
- // a.fiber.push(fiber)
- // this.fiberList.push(fiber)
- // }
- // })
- // } else {
- // this.selectBushing.forEach((a,index) => {
- // a.fiber = []
- // for (var i = 0; i < parseInt(a.testNum); i++) {
- // let fiber = {
- // bushColor: a.color,
- // color: colors2[(i+(parseInt(a.testNum))*index)>colors2.length?0:i+(parseInt(a.testNum))*index].label,
- // model: model,
- // standard: standard,
- // productList: this.HaveJson(this.productList)
- // }
- // a.fiber.push(fiber)
- // this.fiberList.push(fiber)
- // }
- // })
- // }
},
addFibers() {
- // if(this.selectBushing.length===0){
- // this.$message.error('鏈�夋嫨濂楃')
- // return
- // }
- // this.fibersList = []
- // let standard = this.miresStandards.find(a => a.id == this.miresStandard).code
- // this.packageInfo.ismiers = true
- // this.fiberList = []
- // this.selectBushing.forEach(a => {
- // a.fiber = []
- // a.fibers = []
- // for (var i = 0; i < parseInt(a.testNum); i++) {
- // let fibers = {
- // code: null,
- // color: a.color,
- // model: this.miresModel,
- // standard: standard,
- // num: a.testNum,
- // productList: this.HaveJson(this.productList2),
- // fiber: []
- // }
- // a.fibers.push(fibers)
- // this.fibersList.push(fibers)
- // }
- // })
-
if (this.selectBushing.length == 0) {
this.$message.error("鏈�夋嫨濂楃");
return;
@@ -2058,7 +1815,7 @@
let fibers = {
ident: this.fibersList.length + 1,
color: item.color,
- colorShow: item.color + "-" + colors2[i].label,
+ colorShow: item.color + "-" + colors2[i].dictLabel,
code: null,
model: null,
standard: null,
@@ -2071,45 +1828,6 @@
});
},
rowClickFiber(row, column, event, type) {
- // console.log("row", row);
- // this.type = type
- // if(this.active===1){
- // if(type==0){
- // let standard = null;
- // try{
- // standard = this.miresStandards.find(a => a.id == this.miresStandards)
- // }catch(e){}
- // if(standard&&standard.code=='濮旀墭瑕佹眰'){
- // this.isAskOnlyRead = false;
- // }else{
- // this.isAskOnlyRead = true;
- // }
- // }else{
- // let standard = null;
- // try{
- // standard = this.mireStandards.find(a => a.id == this.mireStandard)
- // }catch(e){}
- // if(standard&&standard.code=='濮旀墭瑕佹眰'){
- // this.isAskOnlyRead = false;
- // }else{
- // this.isAskOnlyRead = true;
- // }
- // }
- // }
- // if(this.type==1){
- // if (this.active !== 1) {
- // this.sampleIds = []
- // this.sampleIds.push(row.id)
- // }
- // }
- // this.currentDetectionItems = row
- // this.detectionItems = row.productList
- // if(this.detectionItems === null) return
- // setTimeout(() => {
- // this.detectionItems.forEach(a => {
- // if (a.state == 1) this.toggleSelection(a)
- // })
- // }, 200)
if (type == 1) {
this.fiberList = row.fiber;
if (
@@ -2129,64 +1847,60 @@
(a) => a.code == row.standard
).id;
}
- this.$axios
- .post(
- this.$api.standardTree.selectStandardProductList,
- {
- model: "",
- standardMethodListId: this.miresStandard,
- factory:
- "涓ぉ绉戞妧妫�娴嬩腑蹇� - 閫氫俊浜у搧瀹為獙瀹� - 鍏夌氦甯� - " +
- this.miresModel +
- " - ",
- },
- {
- headers: {
- "Content-Type": "application/json",
- },
- }
- )
+ selectStandardProductList({
+ model: "",
+ standardMethodListId: this.miresStandard,
+ factory:
+ "涓ぉ绉戞妧妫�娴嬩腑蹇� - 閫氫俊浜у搧瀹為獙瀹� - 鍏夌氦甯� - " +
+ this.miresModel +
+ " - ",
+ })
.then((res) => {
- // 灏嗚幏鍙栫殑妫�娴嬮」淇℃伅璧嬪��
- this.detectionItems = [];
- if (res.data != null && res.data.length != 0) {
- res.data.forEach((a) => {
- a.state = 0;
- this.$set(a, "isFibers", 1);
- });
- // 鍒ゆ柇鏄惁涓哄鎵樿姹�
- this.miresStandards.find((a) => a.id == this.miresStandard)
- .code == "濮旀墭瑕佹眰"
- ? (this.isAskOnlyRead = false)
- : (this.isAskOnlyRead = true);
- if (!this.isAskOnlyRead) {
- row.productList.forEach((a) => {
- res.data.forEach((b) => {
- if (a.id == b.id) {
- b.ask = a.ask;
- b.tell = a.tell;
- }
- });
+ if (res.code === 200) {
+ // 灏嗚幏鍙栫殑妫�娴嬮」淇℃伅璧嬪��
+ this.detectionItems = [];
+ if (res.data != null && res.data.length != 0) {
+ res.data.forEach((a) => {
+ a.state = 0;
+ this.$set(a, "isFibers", 1);
});
- }
- this.detectionItems = res.data;
- this.detectionType = 1;
- this.$set(this.detectionItems, "type", 1);
-
- if (row.productList != null && row.productList.length > 0) {
- let product = JSON.parse(JSON.stringify(row.productList));
- setTimeout(() => {
- product.forEach((p) => {
- let rowToSelect = this.detectionItems.find(
- (item) => item.id === p.id
- );
- if (rowToSelect) {
- this.toggleSelection(rowToSelect);
- }
+ // 鍒ゆ柇鏄惁涓哄鎵樿姹�
+ this.miresStandards.find((a) => a.id == this.miresStandard)
+ .code == "濮旀墭瑕佹眰"
+ ? (this.isAskOnlyRead = false)
+ : (this.isAskOnlyRead = true);
+ if (!this.isAskOnlyRead) {
+ row.productList.forEach((a) => {
+ res.data.forEach((b) => {
+ if (a.id == b.id) {
+ b.ask = a.ask;
+ b.tell = a.tell;
+ }
+ });
});
- }, 200);
+ }
+ this.detectionItems = res.data;
+ this.detectionType = 1;
+ this.$set(this.detectionItems, "type", 1);
+
+ if (row.productList != null && row.productList.length > 0) {
+ let product = JSON.parse(JSON.stringify(row.productList));
+ setTimeout(() => {
+ product.forEach((p) => {
+ let rowToSelect = this.detectionItems.find(
+ (item) => item.id === p.id
+ );
+ if (rowToSelect) {
+ this.toggleSelection(rowToSelect);
+ }
+ });
+ }, 200);
+ }
}
}
+ })
+ .catch((error) => {
+ console.error(error);
});
}, 500);
} else if (type == 0) {
@@ -2207,60 +1921,56 @@
(a) => a.code == row.standard
).id;
}
- this.$axios
- .post(
- this.$api.standardTree.selectStandardProductList,
- {
- model: this.mireModel.split(" - ")[1],
- standardMethodListId: this.mireStandard,
- factory: "",
- },
- {
- headers: {
- "Content-Type": "application/json",
- },
- }
- )
+ selectStandardProductList({
+ model: this.mireModel.split(" - ")[1],
+ standardMethodListId: this.mireStandard,
+ factory: "",
+ })
.then((res) => {
- this.detectionItems = [];
- if (res.data != null && res.data.length != 0) {
- res.data.forEach((a) => {
- a.state = 0;
- this.$set(a, "isFibers", 0);
- });
- // 鍒ゆ柇鏄惁涓哄鎵樿姹�
- this.mireStandards.find((a) => a.id == this.mireStandard)
- .code == "濮旀墭瑕佹眰"
- ? (this.isAskOnlyRead = false)
- : (this.isAskOnlyRead = true);
- if (!this.isAskOnlyRead) {
- row.productList.forEach((a) => {
- res.data.forEach((b) => {
- if (a.id == b.id) {
- b.ask = a.ask;
- b.tell = a.tell;
- }
- });
+ if (res.code === 200) {
+ this.detectionItems = [];
+ if (res.data != null && res.data.length != 0) {
+ res.data.forEach((a) => {
+ a.state = 0;
+ this.$set(a, "isFibers", 0);
});
- }
- this.detectionItems = res.data;
- this.detectionType = 0;
- this.$set(this.detectionItems, "type", 0);
-
- if (row.productList != null && row.productList.length > 0) {
- let product = JSON.parse(JSON.stringify(row.productList));
- setTimeout(() => {
- product.forEach((p) => {
- let rowToSelect = this.detectionItems.find(
- (item) => item.id === p.id
- );
- if (rowToSelect) {
- this.toggleSelection(rowToSelect);
- }
+ // 鍒ゆ柇鏄惁涓哄鎵樿姹�
+ this.mireStandards.find((a) => a.id == this.mireStandard)
+ .code == "濮旀墭瑕佹眰"
+ ? (this.isAskOnlyRead = false)
+ : (this.isAskOnlyRead = true);
+ if (!this.isAskOnlyRead) {
+ row.productList.forEach((a) => {
+ res.data.forEach((b) => {
+ if (a.id == b.id) {
+ b.ask = a.ask;
+ b.tell = a.tell;
+ }
+ });
});
- }, 200);
+ }
+ this.detectionItems = res.data;
+ this.detectionType = 0;
+ this.$set(this.detectionItems, "type", 0);
+
+ if (row.productList != null && row.productList.length > 0) {
+ let product = JSON.parse(JSON.stringify(row.productList));
+ setTimeout(() => {
+ product.forEach((p) => {
+ let rowToSelect = this.detectionItems.find(
+ (item) => item.id === p.id
+ );
+ if (rowToSelect) {
+ this.toggleSelection(rowToSelect);
+ }
+ });
+ }, 200);
+ }
}
}
+ })
+ .catch((error) => {
+ console.error(error);
});
}, 500);
}
@@ -2298,12 +2008,6 @@
return item;
});
}
- // else {
- // this.currentDetectionItems.productList.map((m) => {
- // m.state = 1;
- // return m;
- // });
- // }
} else {
if (this.multiFiberList.length > 0) {
this.multiFiberList.map((item) => {
@@ -2314,12 +2018,6 @@
return item;
});
}
- // else {
- // this.currentDetectionItems.productList.map((m) => {
- // m.state = 0;
- // return m;
- // });
- // }
}
this.bsmRow3 = [];
this.detectionItems.forEach((p) => {
@@ -2372,12 +2070,6 @@
this.bsm2 = false;
}
}
- // if (p.ask.includes('RTS')&&p.state === 1) {
- // p.rts = ''
- // this.bsm3Val = ''
- // this.bsm3Dia = true
- // this.bsmRow3.push(p)
- // }
});
if (e.length > 0) {
@@ -2423,28 +2115,8 @@
this.$message.error("鍏宠仈椤圭洰涓嶈兘閲嶅");
return;
}
- // set.add(JSON.stringify(tempList[i].reverse()))
- // let num2 = set.size
- // if (num1 == num2) {
- // console.log(111,set);
- // console.log(111,tempList);
- // this.$message.error('鍏宠仈椤圭洰涓嶈兘閲嶅')
- // return
- // }
}
- //杞崲鐔旀帴閰嶅鐨勭紪鍙�
- // let transformList = []
- // for(let i=0;i<this.bsm2Val2.length;i++){
- // let colorIndex1 = Number(this.bsm2Val2[i][0]-1)
- // let colorIndex2 = Number(this.bsm2Val2[i][1]-1)
- // let code1 = this.sampleList[0].sampleCode + '-' + this.fiberList[colorIndex1].bushColor + '-' + this.fiberList[colorIndex1].color
- // let code2 = this.sampleList[1].sampleCode + '-' + this.fiberList[colorIndex2].bushColor + '-' + this.fiberList[colorIndex2].color
- // transformList.push([code1,code2])
- // }
this.isBsm2Val2 = true;
- // console.log(this.bsm2Val2);
- // console.log(transformList);
- // this.$parent.fiberPairing = JSON.stringify(this.bsm2Val2)
}
this.bsm1Dia = false;
this.isBsm2Val2 = false;
@@ -2465,9 +2137,6 @@
);
}
let arr = [...new Set(this.fiberLoss)];
- console.log("list", list);
- console.log("this.fiberLoss", this.fiberLoss);
- console.log("arr", arr);
row.state = row.state == 1 ? 0 : 1;
if (this.selectFiberList.length > 0) {
this.selectFiberList.map((item) => {
@@ -2527,23 +2196,6 @@
console.log("arr", arr);
if (this.bsm2) {
this.computationalPairing(this.selectFiberList.length);
- // 榛樿灞曠ず涓�瀵逛竴
- // this.bsm2Up(this.selectFiberList.length);
- // if (this.bsm2Val2.length === 0) {
- // this.bsm2Val = this.selectFiberList.length;
- // this.bsm2Val2 = this.HaveJson(this.bsm2Val3);
- // console.log(222, this.bsm2Val2);
- // } else {
- // this.bsm2Val = this.selectFiberList.length;
- // }
- // if (this.bsm2Val2.length === 0) {
- // this.bsm2Val =
- // ((this.fiberList.length + 1) * this.fiberList.length) / 2;
- // this.bsm2Val2 = this.HaveJson(this.bsm2Val3);
- // console.log(222, this.bsm2Val2);
- // } else {
- // this.bsm2Val = this.fiberPairing.length;
- // }
}
}
} else if (
@@ -2556,15 +2208,6 @@
} else {
this.bsm1Dia = false;
}
- // if (row.ask.includes('RTS')&&row.state === 1) {
- // this.bsmRow3 = null;
- // row.rts = ''
- // this.bsm3Val = ''
- // this.bsm3Dia = true
- // this.bsmRow3 = row
- // }else{
- // this.bsm3Dia = false
- // }
},
checkSampleCodeHasNull() {
const emptyCodeArr = this.sampleList.filter(
@@ -2575,25 +2218,26 @@
computationalPairing(n, isValue = false) {
this.bsm1Dia = true;
this.isLoading = true;
- this.$axios
- .get(this.$api.insOrder.permute + "?num=" + n + "&isValue=" + isValue)
+ permute({
+ num: n,
+ isValue: isValue,
+ })
.then((res) => {
- this.bsm2Val3Length = this.HaveJson(res.data.resultData);
- if (this.bsm2Val2.length === 0) {
- this.bsm2Val = this.selectFiberList.length;
- this.bsm2Val2 = this.HaveJson(this.bsm2Val3);
- console.log(222, this.bsm2Val2);
- } else {
- this.bsm2Val = this.selectFiberList.length;
+ if (res.code === 200) {
+ this.bsm2Val3Length = this.HaveJson(res.data.resultData);
+ if (this.bsm2Val2.length === 0) {
+ this.bsm2Val = this.selectFiberList.length;
+ this.bsm2Val2 = this.HaveJson(this.bsm2Val3);
+ } else {
+ this.bsm2Val = this.selectFiberList.length;
+ }
+ this.bsm2Up(this.selectFiberList.length);
+ this.isLoading = false;
}
- this.bsm2Up(this.selectFiberList.length);
- this.isLoading = false;
+ })
+ .catch((error) => {
+ console.error(error);
});
- // const nums = [];
- // for (let i = 1; i <= n; i++) {
- // nums.push(i);
- // }
- // this.bsm2Val3 = this.HaveJson(this.permute(nums));
},
permute(nums) {
const result = [];
@@ -2632,30 +2276,6 @@
});
},
save() {
- // if(this.bushing.length === 0){
- // this.$message.error('缂哄皯閰嶇疆鏃犳硶淇濆瓨')
- // return
- // }
- // for(let a in this.bushing){
- // if(this.bushing[a].fibers.length===0&&this.bushing[a].fiber.length===0){
- // this.$message.error(this.bushing[a].color+'绠¤壊鏍囧绠$己灏戦厤缃棤娉曚繚瀛�')
- // return
- // }
- // }
- // this.sample.forEach(a=>{
- // a.bushing = this.bushing
- // })
- // this.$message.success('宸蹭繚瀛�')
- // this.$emit('saveFiberopticConfig')
- // if(this.inspectionItemST == 1) {
- // this.$message.success('宸蹭繚瀛�')
- // this.sample.forEach(a=>{
- // a.bushing = this.bushing
- // })
- // this.$emit('saveFiberopticConfig')
- // return
- // }
-
let flag = true;
let flags = true;
@@ -3268,8 +2888,8 @@
let color = this.colors[i];
for (let j = 0; j < newFiberList.length; j++) {
let newColor = newFiberList[j];
- if (color.value == newColor[0]) {
- newFiberList[j].push(color.orderNum);
+ if (color.dictValue == newColor[0]) {
+ newFiberList[j].push(color.dictSort);
}
}
}
@@ -3297,19 +2917,6 @@
this.bsm2Val2 = resultList;
console.log("this.bsm2Val2", this.bsm2Val2);
} else {
- // if (val == this.bsm2Val3.length) {
- // this.bsm2Val2 = [];
- // this.computationalPairing(this.selectFiberList.length,true);
- // if (this.bsm2Val2.length === 0) {
- // this.bsm2Val =
- // ((this.selectFiberList.length + 1) * this.selectFiberList.length) / 2;
- // this.bsm2Val2 = this.HaveJson(this.bsm2Val3);
- // } else {
- // this.bsm2Val = this.selectFiberList.length;
- // }
- // this.bsm1DiaLoading = false;
- // console.log('loading',this,this.bsm1DiaLoading);
- // } else {
// 涓�瀵逛竴
this.bsm1DiaLoading = true;
let list = [];
@@ -3352,6 +2959,7 @@
height: 100%;
overflow-y: auto;
overflow-x: hidden;
+ padding: 10px 15px;
}
.models {
font-size: 14px;
--
Gitblit v1.9.3