From e7f86b5ad64b224163c321c46b0f61c294578a2b Mon Sep 17 00:00:00 2001
From: 王震 <10952869+daywangzhen@user.noreply.gitee.com>
Date: 星期日, 24 九月 2023 16:53:53 +0800
Subject: [PATCH] 改bug

---
 src/components/view/self-inspection.vue |  112 ++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 80 insertions(+), 32 deletions(-)

diff --git a/src/components/view/self-inspection.vue b/src/components/view/self-inspection.vue
index e52bfac..8f23b85 100644
--- a/src/components/view/self-inspection.vue
+++ b/src/components/view/self-inspection.vue
@@ -113,7 +113,6 @@
 				<el-col :span="12" style="line-height: 32px;">鑷椤圭洰缁存姢</el-col>
 				<el-col :span="12" style="text-align: right;">
 					<el-button type="primary" icon="el-icon-plus" style="background: #004EA2;"  @click="addend">鏂板</el-button>
-					<!-- <el-button icon="el-icon-edit-outline"  @click="modify">淇敼</el-button> -->
 					<el-button icon="el-icon-delete" @click="dels">鍒犻櫎</el-button>
 				</el-col>
 			</el-row>
@@ -121,35 +120,19 @@
 		<div class="choose">
 			<span>绫诲瀷锛�</span>
 			<el-select v-model="search.type" size="small" @change="TYpe" placeholder="璇烽�夋嫨" style="width: 224px;margin-right: 30px;">
-				<el-option label="姗¤兌杩炴帴鍣�" :value="0"></el-option>
-				<el-option label="閲戝睘杩炴帴鍣�" :value="1"></el-option>
-				<el-option label="婀挎彃鎷旂數杩炴帴鍣�" :value="2"></el-option>
-				<el-option label="鍒嗘敮缁勪欢" :value="3"></el-option>
+				<el-option v-for="(a, ai) in bigType" :key="ai" :value="a">
+				</el-option>
 			</el-select>
-			<!-- <span>宸ュ簭锛�</span> -->
-			<!-- <el-select v-model="search.name" size="small" placeholder="璇烽�夋嫨" style="width: 224px;margin-right: 30px;">
-				<el-option v-for="(a, ai) in process" key="ai" :label="a.name" :value="a.id"></el-option>
-			</el-select>
-			<span>椤圭洰锛�</span>
-			<el-select v-model="search.name" size="small" placeholder="璇烽�夋嫨" style="width: 224px;margin-right: 30px;">
-				<el-option v-for="(a, ai) in product" key="ai" :label="a.name" :value="a.id"></el-option>
-			</el-select>
-			<el-button size="mini" @click="clean()"><span>閲� 缃�</span></el-button>
-			<el-button size="mini" type="primary" style="background: #004EA2;"><span>鏌�
-					璇�</span></el-button> -->
 		</div>
 		<div class="thing">
 			<div class="left">
 				<el-input v-model="search.technology" suffix-icon="el-icon-search" placeholder="璇疯緭鍏ユ悳绱㈠唴瀹�" size="small" clearable @input="(val)=>$refs.tree.filter(val)"></el-input>
-				<el-tree :data="list" ref="tree" :props="{children: 'children',label: 'name'}" node-key="id" default-expand-all
+				<el-tree :data="list" ref="tree" :props="{children: 'children',label: 'name'}" node-key="name" default-expand-all
 					@node-click="handleNodeClick" highlight-current @node-expand="nodeOpen" @node-collapse="nodeClose" :filter-node-method="filterNode"
 					:key="upIndex">
 					<div class="custom-tree-node" slot-scope="{ node, data }">
 						<span><i :class="`node_i ${data.code != '[2]'?'el-icon-folder-opened':'el-icon-tickets'}`"></i>
 							{{data.code}} {{ data.name }}</span>
-						<el-button type="text" size="mini" @click.stop="remove(node, data)">
-							<i class="el-icon-delete"></i>
-						</el-button>
 					</div>
 				</el-tree>
 			</div>
@@ -216,7 +199,7 @@
 				<el-form ref="form" :model="form" label-width="80px">
 				<el-form-item label="绫诲瀷">
 					<template>
-                        <el-select v-model="form.value" placeholder="璇烽�夋嫨绫诲瀷" style="width: 480px;">
+                        <el-select v-model="form.value" placeholder="璇烽�夋嫨" @change="edittype" style="width: 100%;">
 							<el-option label="姗¤兌杩炴帴鍣�" :value="0"></el-option>
 							<el-option label="閲戝睘杩炴帴鍣�" :value="1"></el-option>
 							<el-option label="婀挎彃鎷旂數杩炴帴鍣�" :value="2"></el-option>
@@ -228,7 +211,7 @@
 					<template>
                         <el-select v-model="form.procedure" 
 						@change="workevent"
-						placeholder="璇烽�夋嫨绫诲瀷" style="width: 480px;">
+						placeholder="璇烽�夋嫨" style="width: 100%;">
                             <el-option
                             v-for="item in process"
                             :key="item.name"
@@ -242,7 +225,7 @@
 				<el-col :span="10">
 				<el-form-item label="宸ヨ壓鍚嶇О">
 					<template>
-                        <el-select v-model="form.name" placeholder="璇烽�夋嫨绫诲瀷"  style="width: 180px;">
+                        <el-select v-model="form.name" placeholder="璇烽�夋嫨"  style="width: 180px;">
                             <el-option
                             v-for="item in craftapi"
                             :key="item.id"
@@ -253,9 +236,9 @@
                         </template>
 				</el-form-item>
 			</el-col>
-				<el-col :span="10" :offset="3">
+				<el-col :span="10" :offset="4">
 				<el-form-item label="鑷椤圭洰">
-					<el-input v-model="form.project" style="width: 180px;"></el-input>
+					<el-input v-model="form.project" style="width: 100%;"></el-input>
 				</el-form-item>
 			</el-col>
 			</el-row>
@@ -265,9 +248,9 @@
 					<el-input v-model="form.unit" style="width: 180px;"></el-input>
 				</el-form-item>
 				</el-col>
-				<el-col :span="10" :offset="3">
+				<el-col :span="10" :offset="4">
 				<el-form-item label="鏍囧噯鍊�">
-					<el-input v-model="form.standard" style="width: 180px;"></el-input>
+					<el-input v-model="form.standard" style="width: 100%;"></el-input>
 				</el-form-item>
 				</el-col>
 			</el-row>
@@ -382,8 +365,9 @@
 				product: [],
 				list: [],
 				checkTreeNode: {
-					id:2,
+					id:'',
 				},
+				bigType: [],
 				tableData: [],
 				upIndex: 0,
 				selects: [],
@@ -402,10 +386,36 @@
 			}
 		},
 		mounted() {
+			this.chooseType()
 			this.selectAllleft()
 			this.selectAllSelf()
 		},
 		methods: {
+			chooseType() {
+				this.$axios.get(this.$api.url.chooseType).then(res => {
+					this.bigType = res.data
+					this.typeselect = res.data[0]
+					this.search.type = res.data[0]
+					this.selectAllTechTem();
+					this.selectAllTechNam();
+				})
+			},
+			 selectDataList() {
+				this.list.forEach(a => {
+					a.code = '[1]'
+					if (a.children != undefined) {
+						a.children.forEach(b => {
+							b.code = '[2]'
+							if (b.children != undefined) {
+								b.children.forEach(c => {
+									c.code = '[3]'
+								})
+							}
+						})
+					}
+				})
+				this.upIndex++
+			},
 			//鍒犻櫎
 			delSelfcheck() {
 				console.log(this.upData.id);
@@ -426,13 +436,21 @@
 					ids:this.delete
 				})
 			},
+			//缂栬緫
+			writeRecordById() {
 
-
-
+			},
 			//鏂板
 			add() {
-				this.dialogVisible = false
+				if (this.form.standard[0] !== "<" && this.form.standard[0] !== "<=" && this.form.standard[0] !== ">"){
+				this.$message({
+						message: '杈撳叆鐨勭涓�涓瓧绗﹀繀椤绘槸 '<' 鎴� '<='锛�',
+						type: 'warning'
+					});
+					return;
+				}
 				this.addSelfcheck()
+				this.dialogVisible = false
 			},
 			addSelfcheck() {
                 this.$axios.post(this.$api.url.addSelfcheck,{
@@ -473,6 +491,11 @@
                 console.log(this.typeselect);
                 this.selectAllleft()
             },
+			edittype(val) {
+				// this.typeselect = ''
+				this.typeselect = val
+				this.chooseTechFath()
+			},
             //涓讳綋宸�
             selectAllleft() {
 			this.$axios.get(this.$api.url.selectAllleft,{
@@ -480,9 +503,34 @@
 			}).then(res => {
 				this.list = res.data;
                 console.log(this.list);
+				this.selectDataList()
+				this.$nextTick(() => {
+				this.$refs.tree.setCurrentKey(this.list[0].children[0].name) // 榛樿閫変腑鑺傜偣绗竴涓�
+			})
+			console.log("===========");
+			console.log(this.list);
+			let one=this.list.filter(item=>{
+			return item.children.length>0
+			})[0]
+			console.log(one);
+			let id =one.children[0].id
+			this.checkTreeNode.id = id
+			console.log(id);
+			this.selectAllSelfStart(id)
+			this.selectDataList();
+			console.log("===========");
 			})
 			},
-			//selectAllSelf   checkTreeNode
+			//榛樿
+			selectAllSelfStart(id) {
+			this.$axios.get(this.$api.url.selectAllSelf,{
+				params:{id:id}
+			}).then(res => {
+				this.tableData = res.data;
+                console.log(this.tableData);
+			})
+			},
+			//鍙�
 			selectAllSelf() {
 			this.$axios.get(this.$api.url.selectAllSelf,{
 				params:{id:this.checkTreeNode.id}

--
Gitblit v1.9.3