From d3a7b64c6855523c1d4b4978df09eda788c0064c Mon Sep 17 00:00:00 2001
From: value <z1292839451@163.com>
Date: 星期三, 24 四月 2024 18:20:41 +0800
Subject: [PATCH] 检验模板调整

---
 src/components/view/b2-standard.vue |   63 +++++++++++++++++++++++++------
 1 files changed, 50 insertions(+), 13 deletions(-)

diff --git a/src/components/view/b2-standard.vue b/src/components/view/b2-standard.vue
index 8d611f3..080f0f7 100644
--- a/src/components/view/b2-standard.vue
+++ b/src/components/view/b2-standard.vue
@@ -60,6 +60,10 @@
 	.product_table .el-table {
 		height: 100%;
 	}
+  .sort{
+    width: 80% !important;
+    overflow: hidden;
+  }
 </style>
 <style>
 	.standard .el-tree-node__content {
@@ -105,10 +109,11 @@
 			<el-tree :data="list" ref="tree" :props="{ children: 'children', label: 'label' }" node-key="label"
 				:filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current @node-expand="nodeOpen"
 				@node-collapse="nodeClose" v-loading="treeLoad" :expand-on-click-node="false"
-				:default-expanded-keys="expandedKeys">
+				:default-expanded-keys="expandedKeys"
+        style="height:calc(100% - 30px);overflow-y: scroll;scrollbar-width: none;">
 				<div class="custom-tree-node" slot-scope="{ node, data }">
-					<el-row>
-						<el-col :span="21">
+					<el-row style="width: 100%;">
+						<el-col :span="21" :class="{sort:node.level>3}">
 							<span><i
 									:class="`node_i ${data.children != undefined ? 'el-icon-folder-opened' : 'el-icon-tickets'}`"></i>
 								{{ data.code }} {{ data.label }}</span>
@@ -124,8 +129,8 @@
 		</div>
 		<div class="right">
 			<el-row class="title">
-				<el-col :span="10" style="font-size: 14px;color: #999;">{{selectTree}}</el-col>
-				<el-col :span="selectTree==''?24:14" style="text-align: right;" v-if="selectTree!=''">
+				<el-col :span="24" style="font-size: 14px;color: #999;">{{selectTree}}</el-col>
+				<!-- <el-col :span="selectTree==''?24:14" style="text-align: right;" v-if="selectTree!=''"> -->
 					<!-- <el-button size="small" type="primary" @click="addStandardDia = true"
 						v-if="addStandardMethod">鏂板鏍囧噯</el-button>
 					<el-button size="small" type="primary" @click="addProductDia = true" v-if="addStandardProduct">鏂板椤圭洰</el-button>
@@ -133,11 +138,11 @@
 						<i class="el-icon-delete" style="color: #3A7BFA;"></i>
 						<span style="color: #3A7BFA;">鍒犻櫎</span>
 					</el-button> -->
-				</el-col>
+				<!-- </el-col> -->
 			</el-row>
 			<el-row class="standard_table" v-loading="tableLoad">
 				<el-table class="el-table" :data="standardList" style="width: 100%;" height="220px" tooltip-effect="dark"
-					highlight-current-row @row-click="rowClick">
+					highlight-current-row @row-click="rowClick" ref="standard">
 					<el-table-column prop="code" label="鏍囧噯缂栧彿" show-overflow-tooltip>
 						<template slot-scope="scope">
 							<span style="color: red;font-size: 14px;">{{scope.row['code']}}</span>
@@ -155,9 +160,11 @@
 				</el-table>
 			</el-row>
 			<el-row class="product_table" v-loading="tableLoad2">
-				<el-table :data="productList" ref="productTable" style="width: 100%;" height="100%" tooltip-effect="dark" stripe :fit="true" border
-					@selection-change="handleSelectionChange" :row-class-name="tableRowClassName" @select="upProductSelect">
-					<el-table-column type="selection" width="65"></el-table-column>
+				<el-table :data="productList" ref="productTable" style="width: 100%;" height="100%" tooltip-effect="dark" stripe
+					:fit="true" border @selection-change="handleSelectionChange" :row-class-name="tableRowClassName"
+					@select="upProductSelect">
+					<el-table-column type="selection" width="65">
+					</el-table-column>
 					<el-table-column prop="inspectionItem" label="妫�楠岄」" min-width="140" show-overflow-tooltip></el-table-column>
 					<!-- <el-table-column prop="inspectionItemClassify" label="妫�楠岄」绫诲瀷" width="120" show-overflow-tooltip></el-table-column> -->
 					<el-table-column prop="inspectionItemSubclass" label="妫�楠岄」瀛愰」" min-width="140"
@@ -174,12 +181,20 @@
 					<el-table-column prop="tell" label="瑕佹眰鎻忚堪" min-width="220px">
 						<template slot-scope="scope">
 							<el-input size="small" placeholder="瑕佹眰鎻忚堪" v-model="scope.row.tell" clearable
-								@change="(value)=>upStandardProductListOfTell(value,scope.row.id)" v-if="upStandardProduct" type="textarea"
-								:autosize="{ minRows: 1, maxRows: 3}"></el-input>
+								@change="(value)=>upStandardProductListOfTell(value,scope.row.id)" v-if="upStandardProduct"
+								type="textarea" :autosize="{ minRows: 1, maxRows: 3}"></el-input>
 							<span v-else>{{scope.row.ask}}</span>
 						</template>
 					</el-table-column>
-					<el-table-column prop="method" label="璇曢獙鏂规硶" width="100" show-overflow-tooltip></el-table-column>
+					<el-table-column prop="method" label="璇曢獙鏂规硶" width="200">
+            <template slot-scope="scope">
+              <el-select v-model="scope.row.methodS" size="small" placeholder="璇曢獙鏂规硶"
+               @change="(value)=>upStandardProductListOfMethodS(value,scope.row.id)" v-if="upStandardProduct">
+                <el-option v-for="(a,i) in JSON.parse(scope.row.method)" :key="i" :label="a" :value="a"></el-option>
+              </el-select>
+              <span v-else>{{scope.row.methodS}}</span>
+            </template>
+          </el-table-column>
 					<el-table-column prop="unit" label="璁¢噺鍗曚綅" width="100" show-overflow-tooltip></el-table-column>
 					<el-table-column prop="price" label="鍗曚环(鍏�)" width="90" show-overflow-tooltip></el-table-column>
 					<el-table-column prop="manHour" label="宸ユ椂(H)" width="90" show-overflow-tooltip></el-table-column>
@@ -590,6 +605,12 @@
 				}).then(res => {
 					this.tableLoad = false
 					this.standardList = res.data.standardMethodList
+          if(this.standardList&&this.standardList.length>0){
+            this.$refs.standard.setCurrentRow(this.standardList[0])
+            this.rowClick(this.standardList[0])
+          }else{
+            this.productList = [];
+          }
 				})
 			},
 			getPower() {
@@ -664,6 +685,22 @@
 					this.$message.success('宸蹭繚瀛�')
 				})
 			},
+      upStandardProductListOfMethodS(value, index) {
+      	this.$axios.post(this.$api.standardTree.upStandardProductList, {
+      		id: index,
+      		methodS: value
+      	}, {
+      		headers: {
+      			'Content-Type': 'application/json'
+      		}
+      	}).then(res => {
+      		if (res.code == 201) {
+      			this.$message.error('鏈繚瀛�')
+      			return
+      		}
+      		this.$message.success('宸蹭繚瀛�')
+      	})
+      },
 			delStandardMethodByFLSSM(id) {
 				this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', "璀﹀憡", {
 					confirmButtonText: "纭畾",

--
Gitblit v1.9.3