From 039d01c3ee6217e18ef3bcaec263fd2ad59e6f68 Mon Sep 17 00:00:00 2001
From: Fixiaobai <fixiaobai@163.com>
Date: 星期三, 20 九月 2023 16:19:51 +0800
Subject: [PATCH] modified: src/components/view/equipmentmaintain.vue modified: src/components/view/standard-table/material.vue modified: src/components/view/standard-table/product.vue modified: src/components/view/standard-table/target.vue modified: src/components/view/standard-table/technology.vue
---
src/components/view/rawInsDetail.vue | 69 ++++++++++++++++++++++++++++++----
1 files changed, 60 insertions(+), 9 deletions(-)
diff --git a/src/components/view/rawInsDetail.vue b/src/components/view/rawInsDetail.vue
index 7dea5b5..c2b201f 100644
--- a/src/components/view/rawInsDetail.vue
+++ b/src/components/view/rawInsDetail.vue
@@ -12,7 +12,7 @@
>鎻� 浜�</el-button
>
<el-button
- icon="el-icon-download"
+ icon="el-icon-back"
@click="
() => {
goBack();
@@ -194,6 +194,7 @@
<template slot-scope="scope">
<el-input
:disabled="detailId != null"
+ @blur="assertTest(scope.row)"
v-model="scope.row.required"
placeholder="璇疯緭鍏ユ爣鍑嗗��"
></el-input>
@@ -202,6 +203,7 @@
<el-table-column prop="internal" label="鍐呮帶鍊�" min-width="150">
<template slot-scope="scope">
<el-input
+ @blur="assertTest(scope.row)"
:disabled="detailId != null"
v-model="scope.row.internal"
placeholder="璇疯緭鍏ュ唴鎺у��"
@@ -350,6 +352,7 @@
</template>
<script>
+import { triggerRef } from "vue";
import RawIns from "./raw-ins.vue";
export default {
components: { RawIns },
@@ -362,7 +365,9 @@
}
this.getOptions();
},
- mounted() {},
+ mounted() {
+
+ },
computed: {
conclusionTable() {
const conclusion = {};
@@ -372,7 +377,7 @@
...new Set(this.projectTable.map(item => item.uName))
];
if (
- this.projectTable.filter(item => item.testState === null).length ===
+ this.projectTable.filter(item => item.testState === undefined).length ===
this.projectTable.length
) {
conclusion.testState = null;
@@ -383,6 +388,7 @@
} else {
conclusion.testState = 1;
}
+ console.log([conclusion]);
return [conclusion];
}
},
@@ -422,6 +428,23 @@
}
},
methods: {
+ assertTest(row){
+ // let fuArr=['>', '<', '=']
+ // if(!fuArr.includes(row.required[0])){
+ // this.$message({
+ // message: "鏍囧噯鍊糩"+row.required+"]鏍煎紡棣栦綅搴斿寘鍚�>,<鎴栬��=",
+ // type: 'warning'
+ // });
+ // return
+ // }
+ // if(!fuArr.includes(row.internal[0])){
+ // this.$message({
+ // message: "鍐呮帶鍊糩"+row.internal+"]鏍煎紡棣栦綅搴斿寘鍚�>,<鎴栬��=",
+ // type: 'warning'
+ // });
+ // return
+ // }
+ },
// 璁惧鏍戣繃婊ゆ悳绱�
filterNode(value, data) {
if (!value) return true;
@@ -435,6 +458,7 @@
params: { id: this.detailId }
})
.then(res => {
+ console.log(res);
this.detailInfo = res.data;
this.projectTable = res.data.children;
this.projectTable.forEach(i => {
@@ -454,19 +478,45 @@
},
// 鏂板妫�楠屽崟
async addNewRawInspect() {
+ //TODO:
+ console.log(this.projectTable);
+ if(this.projectTable.length>0){
+ let filterTable= this.projectTable.filter(item=>{
+ return item.required===''||item.internal===''||
+ item.required===null||item.internal===null||item.name===''
+ })
+ if(filterTable.length>0) {
+ this.$message({
+ message: "椤圭洰鍚嶇О锛屾爣鍑嗗�煎拰鍐呮帶鍊间笉鑳戒负绌猴紒",
+ type: 'warning'
+ });
+ return
+ }
+ }
this.projectTable.forEach(i => {
// 灏嗗垪琛ㄨ浆鎹负瀛楃涓�
i.testValue = i.testValueList.join(",");
});
this.detailInfo.rawInsProducts = this.projectTable;
- const res = await this.$axios.post(
+ this.$axios.post(
this.$api.url.addRawInspects,
{ ...this.detailInfo },
{ headers: { "Content-Type": "application/json" } }
- );
- this.detailId = res.data;
- this.getDetailInfo();
- this.$message.success(res.message);
+ ).then(res=>{
+ console.log(res);
+ if(res.code=="201"){
+ this.$message({
+ message: res.message,
+ type: 'warning'
+ });
+ return
+ }else{
+ // this.detailId = res.data;
+ // this.getDetailInfo();
+ // // this.$message.success(res.message);
+ // this.goBack();
+ }
+ });
},
// 淇敼椤圭洰鐨勬娴嬪�兼敼鍙樼粨璁�
@@ -485,9 +535,9 @@
const res = await this.$axios.post(
this.$api.url.updateRawInspectsById + `${this.detailId}`
).then(res=>{
-聽 聽 聽 聽 this.$parent.removeAllTab()
this.$message.success("鎻愪氦鎴愬姛");
this.getDetailInfo();
+ this.goBack()
聽 聽 聽 });
},
// 鑾峰彇璁惧鏍戝唴瀹�
@@ -505,6 +555,7 @@
name: "",
required: "",
textValue: "",
+ testState:null,
testValueList: [],
unit: ""
};
--
Gitblit v1.9.3