From d46f3b348ab5f913cd15be977ce16137ee4343d0 Mon Sep 17 00:00:00 2001 From: 王震 <10952869+daywangzhen@user.noreply.gitee.com> Date: 星期四, 14 九月 2023 17:40:44 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/components/view/processInspectionUpdate.vue | 10 src/components/view/rawInsBox.vue | 1 src/components/view/technical.vue | 7 src/components/view/processInspection.vue | 8 src/assets/api/controller.js | 1 src/components/view/sale.vue | 1 src/components/view/standard-table/material.vue | 30 + src/components/view/standard-table/product.vue | 57 +- src/components/view/processInspectionLook.vue | 2 src/components/view/standard.vue | 105 +++++ src/components/view/standard-table/target.vue | 604 +------------------------------------ src/components/view/finishedProductInspectionUp.vue | 7 src/App.vue | 10 src/components/view/rawInsDetail.vue | 8 src/components/view/standard-table/technology.vue | 74 +++ 15 files changed, 272 insertions(+), 653 deletions(-) diff --git a/src/App.vue b/src/App.vue index 9459930..681e786 100644 --- a/src/App.vue +++ b/src/App.vue @@ -118,7 +118,15 @@ font-size: 18px; font-weight: bold; position: absolute; - right: -230px; + right: -240px; + top: 16px; + z-index: 999; + } + .el-table [class*="el-table__row--level-3"] .el-table__expand-icon { + font-size: 18px; + font-weight: bold; + position: absolute; + right: -440px; top: 16px; z-index: 999; } diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js index f4cdb13..3e2922d 100644 --- a/src/assets/api/controller.js +++ b/src/assets/api/controller.js @@ -7,6 +7,7 @@ selectTechnologyByMaterial: "technology/select", selectAll:"/material/selectAll",//鍙充晶鏁版嵁 technologyWrite:"/technology/write",//宸ヨ壓璺嚎锛岀Щ寮�淇濆瓨鐢熶骇瀹氶 + writeDevice:"/technology/writeDevice",//宸ヨ壓璺嚎锛岄�夋嫨璁惧缁�,绉诲紑淇濆瓨 productWrite:"/product/write",//鎶�鏈寚鏍囷紝绉诲紑淇濆瓨鍐呮帶鍊煎拰鏍囧噯鍊� chooseFather: "/technology/chooseFather",//鑾峰彇宸ュ簭鍒楄〃 chooseDevice: "/technology/chooseDevice",//鑾峰彇璁惧缁勫垪琛� diff --git a/src/components/view/finishedProductInspectionUp.vue b/src/components/view/finishedProductInspectionUp.vue index f40a66f..7c421b3 100644 --- a/src/components/view/finishedProductInspectionUp.vue +++ b/src/components/view/finishedProductInspectionUp.vue @@ -323,6 +323,13 @@ id: this.detailId }).then(res => { if (res.code == 200) { + if(res.message==='椤圭洰鏈楠屽畬!'){ + this.$message({ + message: res.message, + type: 'warning' + }); + return + } this.$message({ message: '涓婃姤鎴愬姛', type: 'success' diff --git a/src/components/view/processInspection.vue b/src/components/view/processInspection.vue index d352b24..da22a3b 100644 --- a/src/components/view/processInspection.vue +++ b/src/components/view/processInspection.vue @@ -81,7 +81,7 @@ <!-- 鐐瑰嚮杩斿洖锛屽綋鍓嶉〉闈㈠�间负false --> <el-button type="primary" size="mini" style="background: #004EA2; " icon="el-icon-circle-plus-outline">鏂板</el-button> - <el-button @click="showAddPage = false" type="primary" size="mini" icon="el-icon-back" + <el-button @click="combackIndex" type="primary" size="mini" icon="el-icon-back" style="background: #004EA2; ">杩斿洖</el-button> </el-col> </el-row> @@ -171,7 +171,7 @@ > --> </el-col> </el-row> - <el-table :data="inspectionItems" max-height="420" :span-method="handleSpanMethod" height="calc(100vh - 550px)" + <el-table border :data="inspectionItems" max-height="420" :span-method="handleSpanMethod" height="calc(100vh - 550px)" style="width: 100%"> <el-table-column type="index" label="搴忓彿" width="60"></el-table-column> <el-table-column label="椤圭洰" prop="father"></el-table-column> @@ -355,6 +355,10 @@ this.rowInfp=row this.showLook=true }, + combackIndex(){ + this.showAddPage=false + this.defaultInitializationTable() + }, updateInsInfo(row){ this.rowInfp=row this.showUp=true diff --git a/src/components/view/processInspectionLook.vue b/src/components/view/processInspectionLook.vue index 3022239..7784910 100644 --- a/src/components/view/processInspectionLook.vue +++ b/src/components/view/processInspectionLook.vue @@ -103,7 +103,7 @@ > --> </el-col> </el-row> - <el-table :data="inspectionItems" max-height="420" :span-method="handleSpanMethod" height="calc(100vh - 550px)" + <el-table border :data="inspectionItems" max-height="420" :span-method="handleSpanMethod" height="calc(100vh - 550px)" style="width: 100%"> <el-table-column type="index" label="搴忓彿" width="60"></el-table-column> <el-table-column label="椤圭洰" prop="father"></el-table-column> diff --git a/src/components/view/processInspectionUpdate.vue b/src/components/view/processInspectionUpdate.vue index 9b5f8f9..eb9627c 100644 --- a/src/components/view/processInspectionUpdate.vue +++ b/src/components/view/processInspectionUpdate.vue @@ -103,7 +103,7 @@ > --> </el-col> </el-row> - <el-table :data="inspectionItems" max-height="420" :span-method="handleSpanMethod" height="calc(100vh - 550px)" + <el-table border :data="inspectionItems" max-height="420" :span-method="handleSpanMethod" height="calc(100vh - 550px)" style="width: 100%"> <el-table-column type="index" label="搴忓彿" width="60"></el-table-column> <el-table-column label="椤圭洰" prop="father"></el-table-column> @@ -323,8 +323,14 @@ this.$axios.post(this.$api.url.processInspectUpdateProcessInspectsById, { id: this.detailId }).then(res => { - console.log(res); if (res.code == 200) { + if(res.message==='椤圭洰鏈楠屽畬!'){ + this.$message({ + message: res.message, + type: 'warning' + }); + return + } this.$message({ message: '涓婃姤鎴愬姛', type: 'success' diff --git a/src/components/view/rawInsBox.vue b/src/components/view/rawInsBox.vue index 57710f5..b0648e2 100644 --- a/src/components/view/rawInsBox.vue +++ b/src/components/view/rawInsBox.vue @@ -30,6 +30,7 @@ console.log(this.id) }, goBack() { + this.$parent.removeAllTab() this.showDetail = false } } diff --git a/src/components/view/rawInsDetail.vue b/src/components/view/rawInsDetail.vue index 7dea5b5..e9a9490 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(); @@ -350,6 +350,7 @@ </template> <script> +import { triggerRef } from "vue"; import RawIns from "./raw-ins.vue"; export default { components: { RawIns }, @@ -383,6 +384,7 @@ } else { conclusion.testState = 1; } + console.log([conclusion]); return [conclusion]; } }, @@ -467,6 +469,7 @@ this.detailId = res.data; this.getDetailInfo(); this.$message.success(res.message); + this.goBack(); }, // 淇敼椤圭洰鐨勬娴嬪�兼敼鍙樼粨璁� @@ -485,9 +488,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 +508,7 @@ name: "", required: "", textValue: "", + testState:null, testValueList: [], unit: "" }; diff --git a/src/components/view/sale.vue b/src/components/view/sale.vue index dc35e6b..d3e59a2 100644 --- a/src/components/view/sale.vue +++ b/src/components/view/sale.vue @@ -562,6 +562,7 @@ type: 1 }).then(res => { this.selectRawInspectsList() + this.$parent.removeAllTab() }) }).catch(e => { if (e == 'cancel') { diff --git a/src/components/view/standard-table/material.vue b/src/components/view/standard-table/material.vue index b317e40..f3f9eae 100644 --- a/src/components/view/standard-table/material.vue +++ b/src/components/view/standard-table/material.vue @@ -9,26 +9,25 @@ </el-table-column> <el-table-column type="index" width="60" label="搴忓彿"> </el-table-column> - <el-table-column prop="father" label="宸ュ簭" sortable width="200px"> + <el-table-column prop="father" label="宸ュ簭" width="200" :resizable="false"> <template slot-scope="scope"> - <el-tag v-if="scope.row.father != null" type="primary">01</el-tag> + <el-tag class="tag" v-if="scope.row.father != null" type="primary">01</el-tag> <span style="color: #000000"> {{ scope.row.father }} </span> </template> </el-table-column> - <el-table-column prop="tname" sortable label="宸ヨ壓鍚嶇О"> + <el-table-column prop="tname" label="宸ヨ壓鍚嶇О" width="200" :resizable="false"> <template slot-scope="scope"> - <el-tag type="success" v-if="scope.row.tname != null" - style="margin-left:20px;">02</el-tag> + <el-tag type="success" v-if="scope.row.tname != null" class="tag">02</el-tag> <span style="color: #000000"> {{ scope.row.tname }} </span> </template> </el-table-column> - <el-table-column prop="mname" label="鏉愭枡鍚嶇О"> + <el-table-column prop="mname" label="鏉愭枡鍚嶇О" width="200" :resizable="false"> <template slot-scope="scope"> - <el-tag type="info" color="#faf2ff" v-if="scope.row.mname != null"> + <el-tag type="info" class="tag" color="#faf2ff" v-if="scope.row.mname != null"> <span style="color: #e1affb">03</span> </el-tag> <span> @@ -36,11 +35,11 @@ </span> </template> </el-table-column> - <el-table-column prop="specifications" label="瑙勬牸"> + <el-table-column prop="specifications" label="瑙勬牸" :resizable="false"> </el-table-column> - <el-table-column prop="unit" label="鍗曚綅"> + <el-table-column prop="unit" label="鍗曚綅" :resizable="false"> </el-table-column> - <el-table-column prop="num" label="鏁伴噺"> + <el-table-column prop="num" label="鏁伴噺" :resizable="false"> <template slot-scope="scope"> <el-input v-model="scope.row.num" v-if="scope.row.mname != null" size="small" @@ -149,6 +148,17 @@ width: 100%; height: 100%; } + .tag{ + line-height:24px; + text-align:center; + width:36px; + height:24px; + + border-radius:12px; + } + .tag:nth-child(1){ + margin-left:20px; + } </style> <style> .standard * { diff --git a/src/components/view/standard-table/product.vue b/src/components/view/standard-table/product.vue index c3c13d2..64427a4 100644 --- a/src/components/view/standard-table/product.vue +++ b/src/components/view/standard-table/product.vue @@ -1,12 +1,14 @@ <style scoped> - .standard { - width: 100%; - height: 100%; - } .standard * { font-size: 14px; } - + + .standard { + width: 100%; + height: 100%; + overflow: auto; + } + .standard .has-gutter .el-table__cell { background-color: #F0F1F5 !important; color: #333; @@ -22,22 +24,17 @@ padding-left: 17px !important; } - .standard { - width: 100%; - height: 100%; - overflow: auto; + .tag{ + line-height:24px; + text-align:center; + width:36px; + height:24px; + + border-radius:12px; } - - /* .standard .el-table__body-wrapper { - height: 100%; - } */ - - /* .standard .el-table__body { - height: 100%; - } */ - /* .standard .el-table .el-table__row:not([class*="el-table__row--level-"]) td:nth-child(3){ - padding-left: 23px !important; - } */ + .tag:nth-child(1){ + margin-left:20px; + } </style> <template> <div class="standard"> @@ -47,34 +44,34 @@ :tree-props="{children: 'children', hasChildren: 'hasChildren'}"> <el-table-column type="selection" width="55"></el-table-column> <el-table-column type="index" width="60" label="搴忓彿"></el-table-column> - <el-table-column prop="father" label="宸ュ簭"> + <el-table-column prop="father" label="宸ュ簭" width="200" :resizable="false"> <template slot-scope="scope"> - <el-tag type="primary" v-if="scope.row.father != null">01</el-tag> + <el-tag type="primary" class="tag" v-if="scope.row.father != null">01</el-tag> <span>{{scope.row.father}}</span> </template> </el-table-column> - <el-table-column prop="name" label="宸ヨ壓鍚嶇О"> + <el-table-column prop="name" label="宸ヨ壓鍚嶇О" width="200" :resizable="false"> <template slot-scope="scope"> - <el-tag type="success" v-if="scope.row.name != null">02</el-tag> + <el-tag type="success" class="tag" v-if="scope.row.name != null">02</el-tag> <span>{{scope.row.name}}</span> </template> </el-table-column> - <el-table-column prop="device" label="璁惧鍚嶇О"> + <el-table-column prop="device" label="璁惧鍚嶇О" width="200" :resizable="false"> <template slot-scope="scope"> - <el-tag type="info" color="#faf2ff" v-if="scope.row.device != null"> + <el-tag type="info" class="tag" color="#faf2ff" v-if="scope.row.device != null"> <span style="color: #e1affb">03</span> </el-tag> <span>{{scope.row.device}}</span> </template> </el-table-column> - <el-table-column prop="productFather" label="椤圭洰"> + <el-table-column prop="productFather" label="椤圭洰" width="200" :resizable="false"> <template slot-scope="scope"> - <el-tag type="info" v-if="scope.row.productFather != null">04</el-tag> + <el-tag type="info" class="tag" v-if="scope.row.productFather != null">04</el-tag> <span>{{scope.row.productFather}}</span> </template> </el-table-column> - <el-table-column prop="unit" label="鍗曚綅"></el-table-column> - <el-table-column prop="product" label="鎸囨爣"></el-table-column> + <el-table-column prop="unit" label="鍗曚綅" :resizable="false"></el-table-column> + <el-table-column prop="product" label="鎸囨爣" :resizable="false"></el-table-column> </el-table> </div> </template> diff --git a/src/components/view/standard-table/target.vue b/src/components/view/standard-table/target.vue index c4d3139..30d27b7 100644 --- a/src/components/view/standard-table/target.vue +++ b/src/components/view/standard-table/target.vue @@ -1,47 +1,46 @@ <template> <div class="standard"> <div> - <el-table ref="multipleTable" :data="aa" row-key="rowId" border max-height="675" + <el-table ref="multipleTable" :data="tableData" row-key="rowId" border max-height="675" @select-all="selectAll" @select="selectTr" @selection-change="handleSelectionChange" default-expand-all :tree-props="{children: 'children', hasChildren: 'hasChildren'}"> <el-table-column type="selection" width="55"></el-table-column> <el-table-column type="index" width="60" label="搴忓彿"></el-table-column> - <el-table-column prop="tfather" label="宸ュ簭"> + <el-table-column prop="tfather" label="宸ュ簭" width="200" :resizable="false"> <template slot-scope="scope"> - <el-tag type="primary" v-if="scope.row.tfather != null">01</el-tag> + <el-tag class="tag" type="primary" v-if="scope.row.tfather != null">01</el-tag> <span>{{scope.row.tfather}}</span> </template> </el-table-column> - <el-table-column prop="tname" label="宸ヨ壓鍚嶇О"> + <el-table-column prop="tname" label="宸ヨ壓鍚嶇О" width="200" :resizable="false"> <template slot-scope="scope"> - <el-tag type="success" v-if="scope.row.tname != null" - style="line-height:24px;text-align:center;width:36px;height:24px;margin-left:20px;border-radius:12px">02</el-tag> + <el-tag type="success" v-if="scope.row.tname != null" class="tag">02</el-tag> <span>{{scope.row.tname}}</span> </template> </el-table-column> - <el-table-column prop="pfather" label="椤圭洰"> + <el-table-column prop="pfather" label="椤圭洰" width="200" :resizable="false"> <template slot-scope="scope"> - <el-tag type="info" color="#faf2ff" v-if="scope.row.pfather != null"> + <el-tag type="info" color="#faf2ff" v-if="scope.row.pfather != null" class="tag"> <span style="color: #e1affb">03</span> </el-tag> <span>{{scope.row.pfather}}</span> </template> </el-table-column> - <el-table-column prop="pname" label="鎸囨爣鍚嶇О"> + <el-table-column prop="pname" label="鎸囨爣鍚嶇О" width="200" :resizable="false"> <template slot-scope="scope"> <span>{{scope.row.pname}}</span> </template> </el-table-column> - <el-table-column prop="unit" label="鍗曚綅"></el-table-column> - <el-table-column prop="internal" label="鍐呮帶鍊�"> + <el-table-column prop="unit" label="鍗曚綅" :resizable="false"></el-table-column> + <el-table-column prop="internal" label="鍐呮帶鍊�" :resizable="false"> <template slot-scope="scope"> <el-input v-model="scope.row.internal" v-if="scope.row.pname != null" size="small" @blur="updateVal(scope.row)"></el-input> </template> </el-table-column> - <el-table-column prop="required" label="鏍囧噯鍊�"> + <el-table-column prop="required" label="鏍囧噯鍊�" :resizable="false"> <template slot-scope="scope"> <el-input v-model="scope.row.required" v-if="scope.row.pname != null" size="small" @@ -57,583 +56,20 @@ export default { data() { return { + tnameWidth:200, + pfatherWidth:200, selects: [], deleteList:[], isAllSelect:false, - aa: [ - { - "children": [ - { - "children": [ - { - "children": [ - { - "unit": "oo", - "pname": "闃垮彂", - "pid": 933, - "rowId": 0.15062765172836556, - "indents": 1 - }, - { - "unit": "km", - "pname": "鐢�2", - "pid": 934, - "rowId": 0.12313308041936621, - "indents": 1 - }, - { - "unit": "ll", - "pname": "鐢�3", - "pid": 935, - "rowId": 0.3959020806139848, - "indents": 1 - }, - { - "unit": "璁╂垜鍘�", - "pname": "杩樻槸鐨勪汉浼氬彈鍒�", - "pid": 941, - "rowId": 0.4501313017235842, - "indents": 1 - }, - { - "unit": "鍙戜簩鎵嬫埧", - "pname": "绂忓▋", - "pid": 942, - "rowId": 0.2570941856592921, - "indents": 1 - }, - { - "unit": "闃垮棷鍡�", - "pname": "1闃�", - "pid": 943, - "rowId": 0.3849246876222272, - "indents": 1 - }, - { - "unit": "sef", - "pname": "gsd", - "pid": 952, - "rowId": 0.3358017758829086, - "indents": 1 - } - ], - "pfather": "鐢垫皵鎬ц兘", - "rowId": 0.11597152206451145, - "indents": 1 - }, - { - "children": [ - { - "unit": "鍚�", - "pname": "鏈�1", - "pid": 936, - "rowId": 0.09276663783212125, - "indents": 1 - }, - { - "unit": "澶�", - "pname": "鏈�2", - "pid": 937, - "rowId": 0.30524372216363194, - "indents": 1 - } - ], - "pfather": "鏈烘", - "rowId": 0.7172228698155356, - "indents": 1 - }, - { - "children": [ - { - "unit": "t", - "pname": "鑰�1", - "pid": 938, - "rowId": 0.19975939946800714, - "indents": 1 - }, - { - "unit": "ml", - "pname": "鑰�2", - "pid": 939, - "rowId": 0.8998139964427834, - "indents": 1 - }, - { - "unit": "鍙�", - "pname": "鑰�3", - "pid": 940, - "rowId": 0.5675579627028025, - "indents": 1 - } - ], - "pfather": "鑰愮數鍘�", - "rowId": 0.21440785353613157, - "indents": 1 - }, - { - "children": [ - { - "unit": "鎸変笂娆$殑闈炲父", - "pname": "澶ф墜澶ц剼", - "pid": 944, - "rowId": 0.7181582304087455, - "indents": 1 - } - ], - "pfather": "浣犲ソ", - "rowId": 0.7769908541698349, - "indents": 1 - }, - { - "children": [ - { - "unit": "鐖卞浗VSv", - "pname": "闃胯惃", - "pid": 945, - "rowId": 0.17378991618309336, - "indents": 1 - } - ], - "pfather": "澶у濂�", - "rowId": 0.8772679053462382, - "indents": 1 - }, - { - "children": [ - { - "unit": "ww", - "pname": "ww", - "pid": 946, - "rowId": 0.05009672998084547, - "indents": 1 - } - ], - "pfather": "cao", - "rowId": 0.9565056824143869, - "indents": 1 - }, - { - "children": [ - { - "unit": "杈剧摝", - "pname": "鎴戠殑", - "pid": 947, - "rowId": 0.34581383239188046, - "indents": 1 - }, - { - "unit": "鎴戠殑", - "pname": "闈掕洐澶у叏", - "pid": 948, - "rowId": 0.5292322880840665, - "indents": 1 - }, - { - "unit": "鎴戠殑閽�", - "pname": "鍙栧緱瀹屽叏鐨�", - "pid": 949, - "rowId": 0.9125913254753026, - "indents": 1 - }, - { - "unit": "璇烽棶", - "pname": "褰撳墠", - "pid": 950, - "rowId": 0.7560056072797159, - "indents": 1 - }, - { - "unit": "sdv", - "pname": "澹ぇ澶�", - "pid": 951, - "rowId": 0.5833122419533638, - "indents": 1 - } - ], - "pfather": "浣犻敃", - "rowId": 0.9766279468505832, - "indents": 1 - }, - { - "children": [ - { - "unit": "闃胯揪", - "pname": "鎵撳晩路", - "pid": 953, - "rowId": 0.9092338815452841, - "indents": 1 - } - ], - "pfather": "闃胯开鐜�", - "rowId": 0.8799322497096753, - "indents": 1 - } - ], - "tname": "瑁佺紗", - "rowId": 0.4071356283291181, - "indents": 1 - }, - { - "children": [ - { - "children": [ - { - "unit": "kv", - "pname": "闀�1", - "pid": 954, - "rowId": 0.035463253161200026, - "indents": 1 - }, - { - "unit": "vv", - "pname": "闀�2", - "pid": 955, - "rowId": 0.23952996321663345, - "indents": 1 - }, - { - "unit": "mm", - "pname": "闀�3", - "pid": 956, - "rowId": 0.0009274727073673716, - "indents": 1 - } - ], - "pfather": "闀垮害", - "rowId": 0.7634749065969555, - "indents": 1 - }, - { - "children": [ - { - "unit": "鍚�", - "pname": "闈�", - "pid": 957, - "rowId": 0.18887461651501813, - "indents": 1 - } - ], - "pfather": "闈㈢Н", - "rowId": 0.1800874562308441, - "indents": 1 - }, - { - "children": [ - { - "unit": "c", - "pname": "婀�", - "pid": 958, - "rowId": 0.79648815170558, - "indents": 1 - } - ], - "pfather": "婀垮害", - "rowId": 0.10207617486870801, - "indents": 1 - } - ], - "tname": "鍓ョ紗", - "rowId": 0.6177353372974288, - "indents": 1 - }, - { - "children": [ - { - "children": [ - { - "unit": "mm", - "pname": "鐢�1", - "pid": 959, - "rowId": 0.14165010419857826, - "indents": 1 - }, - { - "unit": "km", - "pname": "鐢�2", - "pid": 960, - "rowId": 0.5001292363854433, - "indents": 1 - }, - { - "unit": "ll", - "pname": "鐢�3", - "pid": 961, - "rowId": 0.8459604367887481, - "indents": 1 - } - ], - "pfather": "鐢垫皵鎬ц兘", - "rowId": 0.7238366441537252, - "indents": 1 - }, - { - "children": [ - { - "unit": "鍚�", - "pname": "鏈�1", - "pid": 962, - "rowId": 0.5558158468437493, - "indents": 1 - }, - { - "unit": "澶�", - "pname": "鏈�2", - "pid": 963, - "rowId": 0.750487727539507, - "indents": 1 - } - ], - "pfather": "鏈烘", - "rowId": 0.08099595277723015, - "indents": 1 - } - ], - "tname": "鍓嚎", - "rowId": 0.6857832066163772, - "indents": 1 - }, - { - "children": [ - { - "children": [ - { - "unit": "t", - "pname": "鑰�1", - "pid": 964, - "rowId": 0.025681390736394416, - "indents": 1 - }, - { - "unit": "ml", - "pname": "鑰�2", - "pid": 965, - "rowId": 0.36284806597904873, - "indents": 1 - }, - { - "unit": "鍙�", - "pname": "鑰�3", - "pid": 966, - "rowId": 0.32910729115405535, - "indents": 1 - } - ], - "pfather": "鑰愮數鍘�", - "rowId": 0.41438839964145635, - "indents": 1 - }, - { - "children": [ - { - "unit": "kv", - "pname": "闀�1", - "pid": 967, - "rowId": 0.3918751838800807, - "indents": 1 - }, - { - "unit": "mm", - "pname": "闂棶", - "pid": 968, - "rowId": 0.5686737935255044, - "indents": 1 - } - ], - "pfather": "闀垮害", - "rowId": 0.4897629570966928, - "indents": 1 - } - ], - "tname": "绌跨嚎", - "rowId": 0.4459890408806282, - "indents": 1 - } - ], - "tfather": "涓嬫枡", - "rowId": 0.8390882975115925, - "indents": 1 - }, - { - "children": [ - { - "children": [ - { - "children": [ - { - "unit": "vv", - "pname": "闀�2", - "pid": 969, - "rowId": 0.16863376578504718, - "indents": 1 - }, - { - "unit": "mm", - "pname": "闀�3", - "pid": 970, - "rowId": 0.2900238044012753, - "indents": 1 - } - ], - "pfather": "闀垮害", - "rowId": 0.37669687690143516, - "indents": 1 - }, - { - "children": [ - { - "unit": "鍚�", - "pname": "闈�", - "pid": 971, - "rowId": 0.36760765245674576, - "indents": 1 - } - ], - "pfather": "闈㈢Н", - "rowId": 0.41655397960844853, - "indents": 1 - }, - { - "children": [ - { - "unit": "c", - "pname": "婀�", - "pid": 972, - "rowId": 0.8013524859108032, - "indents": 1 - } - ], - "pfather": "婀垮害", - "rowId": 0.30068963405418225, - "indents": 1 - } - ], - "tname": "鏀拺鍧楃幆姘�", - "rowId": 0.7725045227516729, - "indents": 1 - } - ], - "tfather": "鏀拺鍧楃幆姘�", - "rowId": 0.7921741302395957, - "indents": 1 - }, - { - "children": [ - { - "children": [ - { - "children": [ - { - "unit": "t", - "pname": "鑰�1", - "pid": 978, - "rowId": 0.7281043795556847, - "indents": 1 - }, - { - "unit": "ml", - "pname": "鑰�2", - "pid": 979, - "rowId": 0.015058429562420983, - "indents": 1 - }, - { - "unit": "鍙�", - "pname": "鑰�3", - "pid": 980, - "rowId": 0.5169165422760948, - "indents": 1 - } - ], - "pfather": "鑰愮數鍘�", - "rowId": 0.9785158882428673, - "indents": 1 - }, - { - "children": [ - { - "unit": "kv", - "pname": "闀�1", - "pid": 981, - "rowId": 0.9534130099287508, - "indents": 1 - } - ], - "pfather": "闀垮害", - "rowId": 0.4408411939308432, - "indents": 1 - } - ], - "tname": "澹充綋鍠风爞", - "rowId": 0.47569680349711807, - "indents": 1 - } - ], - "tfather": "鍠风爞", - "rowId": 0.7110660336124821, - "indents": 1 - }, - { - "children": [ - { - "children": [ - { - "children": [ - { - "unit": "vv", - "pname": "闀�2", - "pid": 982, - "rowId": 0.6503541323269595, - "indents": 1 - }, - { - "unit": "mm", - "pname": "闀�3", - "pid": 983, - "rowId": 0.32814600334581456, - "indents": 1 - } - ], - "pfather": "闀垮害", - "rowId": 0.7584791572708673, - "indents": 1 - }, - { - "children": [ - { - "unit": "鍚�", - "pname": "闈�", - "pid": 984, - "rowId": 0.37940516060114016, - "indents": 1 - } - ], - "pfather": "闈㈢Н", - "rowId": 0.12296115468577762, - "indents": 1 - } - ], - "tname": "鐢电紗鎵撶(", - "rowId": 0.5185983654517894, - "indents": 1 - } - ], - "tfather": "鐒婃帴", - "rowId": 0.08397884001890477, - "indents": 1 - } -] } }, - // props:['tableData','tableType'], + props:['tableData','tableType'], created() { }, mounted() { }, methods: { - bb(){ - console.log(this.aa); - }, // 琛ㄦ牸鏍戝叏閮ㄩ�変腑閰嶇疆 // 鍏ㄩ��/鍙栨秷閫夋搷浣� selectAll(val) { @@ -706,7 +142,6 @@ }).then(res=>{ this.$message.success(res.message); }).catch(error=>{ - this.$message.error(error.message); }) }, } @@ -722,6 +157,17 @@ width: 100%; height: 100%; } + .tag{ + line-height:24px; + text-align:center; + width:36px; + height:24px; + + border-radius:12px; + } + .tag:nth-child(1){ + margin-left:20px; + } </style> <style> .standard * { diff --git a/src/components/view/standard-table/technology.vue b/src/components/view/standard-table/technology.vue index f042c3a..d9cb1e6 100644 --- a/src/components/view/standard-table/technology.vue +++ b/src/components/view/standard-table/technology.vue @@ -8,31 +8,31 @@ :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> <el-table-column type="selection" width="55"> </el-table-column> - <el-table-column type="index" width="60" label="搴忓彿"> + <el-table-column type="index" width="60" label="搴忓彿" :resizable="false"> </el-table-column> - <el-table-column prop="father" label="宸ュ簭" sortable width="200px"> + <el-table-column prop="father" label="宸ュ簭" width="200" :resizable="false"> <template slot-scope="scope"> - <el-tag v-if="scope.row.children" type="primary">01</el-tag> + <el-tag class="tag" v-if="scope.row.children" type="primary">01</el-tag> <span style="color: black"> {{ scope.row.father }} </span> </template> </el-table-column> - <el-table-column sortable label="宸ヨ壓鍚嶇О" width="200px"> + <el-table-column label="宸ヨ壓鍚嶇О" width="200" :resizable="false"> <template slot-scope="scope"> - <el-tag type="success" v-if="!scope.row.children">02</el-tag> + <el-tag class="tag" type="success" v-if="!scope.row.children">02</el-tag> <span style="color: black">{{ scope.row.name }}</span> </template> </el-table-column> - <el-table-column prop="dg" label="璁惧缁�"> + <el-table-column prop="dg" label="璁惧缁�" width="200" :resizable="false"> <template slot-scope="scope"> <div class="showDiv"> <span>{{scope.row.dg}}</span> - <div @click="showDialog">閫夋嫨</div> + <div @click="showDialog(scope.row)">閫夋嫨</div> </div> </template> </el-table-column> - <el-table-column prop="pq" label="鐢熶骇瀹氶(涓�/澶�)"> + <el-table-column prop="pq" label="鐢熶骇瀹氶(涓�/澶�)" :resizable="false"> <template slot-scope="scope"> <el-input v-model="scope.row.pq" v-if="scope.row.dg != null" size="small" @@ -46,9 +46,18 @@ title="閫夋嫨璁惧缁�" :visible.sync="deviceGroupDialog" width="30%"> - <span>杩欐槸涓�娈典俊鎭�</span> + <el-form :model="formData"> + <el-form-item prop="deviceGroup" label="璁惧缁勶細" + :rules="{required:true,message:'璁惧缁勪笉鑳戒负绌�',trigger:'change'}"> + <el-select placeholder="璇烽�夋嫨璁惧缁�" size="small" + v-model="formData.deviceGroup"> + <el-option :value="item.father" + v-for="(item,index) in deviceList" :key="index" :label="item.father"></el-option> + </el-select> + </el-form-item> + </el-form> <span slot="footer" class="dialog-footer"> - <el-button type="primary" @click="deviceGroupDialog = false">纭� 瀹�</el-button> + <el-button type="primary" @click="confirmUpdate()">纭� 瀹�</el-button> <el-button @click="deviceGroupDialog = false">鍙� 娑�</el-button> </span> </el-dialog> @@ -60,7 +69,12 @@ data() { return { deviceGroupDialog:false, + formData:{ + deviceGroup:'' + }, + row:{}, selects: [], + deviceList:[], isAllSelect:false, } }, @@ -69,6 +83,32 @@ mounted() { }, methods: { + //宸ヨ壓璺嚎--鑾峰彇璁惧缁勫垪琛� + getDeviceList(){ + this.$axios.get(this.$api.url.chooseDevice).then(res=>{ + this.deviceList = res.data; + }).catch(error=>{ + this.$message.error(error.message); + }) + }, + showDialog(row){ + this.getDeviceList(); + this.formData.deviceGroup = row.dg; + this.row = row; + this.deviceGroupDialog = true + }, + confirmUpdate(){ + this.$axios.post(this.$api.url.writeDevice,{ + id : this.row.id, + deviceGroup : this.formData.deviceGroup + }).then(res=>{ + this.$emit("updateDevice",true); + this.$message.success(res.message); + this.deviceGroupDialog = false + }).catch(error=>{ + + }) + }, // 琛ㄦ牸鏍戝叏閮ㄩ�変腑閰嶇疆 // 鍏ㄩ��/鍙栨秷閫夋搷浣� //閫夋嫨鏌愯 @@ -133,9 +173,6 @@ } }, // 琛ㄦ牸鏍戝叏閮ㄩ�変腑閰嶇疆 缁撴潫 - showDialog(){ - this.deviceGroupDialog = true - }, updatePq(row){ this.$axios.post(this.$api.url.technologyWrite,{ id : row.id, @@ -155,6 +192,17 @@ width: 100%; height: 100%; } + .tag{ + line-height:24px; + text-align:center; + width:36px; + height:24px; + + border-radius:12px; + } + .tag:nth-child(1){ + margin-left:20px; + } .standard .showDiv{ cursor: pointer; } diff --git a/src/components/view/standard.vue b/src/components/view/standard.vue index 6a115b4..abef430 100644 --- a/src/components/view/standard.vue +++ b/src/components/view/standard.vue @@ -13,15 +13,16 @@ </div> <div class="thing"> <div class="left"> - <el-row :gutter="5"> + <el-row :gutter="5" style="position: fixed;top: 148px;z-index: 1;"> <el-col :span="21"> <el-input v-model="search" suffix-icon="el-icon-search" placeholder="璇疯緭鍏ユ悳绱㈠唴瀹�" size="small" clearable></el-input> </el-col> <el-col :span="2"> - <el-button size="small" icon="el-icon-plus" @click="bomLeftAdd=true"></el-button> + <el-button size="mini" icon="el-icon-plus" @click="bomLeftAdd=true"></el-button> </el-col> </el-row> - <el-tree :data="list" ref="tree" default-expand-all :props="{ children: 'children', label: 'name' }" + <el-row style="margin-top: 16px;"> + <el-tree :data="list" ref="tree" default-expand-all :props="{ children: 'children', label: 'name' }" node-key="id" :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current> <div class="custom-tree-node" slot-scope="{ node, data }"> <span><i :class="`node_i ${data.code != '[5]' ? 'el-icon-folder-opened' : 'el-icon-tickets'}`"></i> @@ -31,6 +32,7 @@ </el-button> </div> </el-tree> + </el-row> </div> <div class="right"> <div class="choose"> @@ -56,7 +58,7 @@ </div> <div class="contentTable" v-if="this.typeselect == 0"> - <technology @childData="getChildData" :tableType="tableType" :tableData="tableData"></technology> + <technology @childData="getChildData" @updateDevice="updateDevice" :tableType="tableType" :tableData="tableData"></technology> </div> <div class="contentTable" v-if="this.typeselect == 1"> <target @childData="getChildData" :tableType="tableType" :tableData="tableData"></target> @@ -391,6 +393,7 @@ return { //瀛愮粍浠朵紶鐨刬d鍒楄〃 childIds:[], + isUpdateDevice:false, //宸ュ簭鍒楄〃 fatherList:[], deviceList:[], @@ -505,6 +508,9 @@ this.selectVersion() }, methods: { + updateDevice(val){ + this.isUpdateDevice = val; + }, changeLeftAdd(){ if(this.leftAdd.type.length===2){ this.leftAdd.father=null @@ -526,7 +532,26 @@ this.$refs[formName].validate((valid) => { if (valid) { let obj=JSON.parse(JSON.stringify(this.leftAdd)) - console.log(obj); + if(obj.type.length===1){ + obj.type=this.getType(obj.type[0]) + this.$axios.post(this.$api.url.leftAddOneTwo,obj,{ + headers: { "Content-Type": "application/json" } + }).then(res=>{ + this.$message({ + message: res.message, + type: 'success' + }); + this.leftAdd.type=[] + this.leftAdd.father=null + this.leftAdd.standard=null + this.leftAdd.name=null + this.leftAdd.specifications=null + this.selectMaterialTree() + this.bomLeftAdd=false + this.selectVersion() + }) + return + } let one=this.list.filter(item=>{ return item.name===obj.type[0] })[0] @@ -544,7 +569,14 @@ message: res.message, type: 'success' }); - this.selectMaterialTree() + this.leftAdd.type=[] + this.leftAdd.father=null + this.leftAdd.standard=null + this.leftAdd.name=null + this.leftAdd.specifications=null + this.selectMaterialTree() + this.bomLeftAdd=false + this.selectVersion() }) }else{ let three=two.children.filter(item=>{ @@ -560,7 +592,14 @@ message: res.message, type: 'success' }); - this.selectMaterialTree() + this.leftAdd.type=[] + this.leftAdd.father=null + this.leftAdd.standard=null + this.leftAdd.name=null + this.leftAdd.specifications=null + this.selectMaterialTree() + this.bomLeftAdd=false + this.selectVersion() }) }else{ //鏂板鏍囧噯鍨嬪彿 @@ -580,7 +619,14 @@ message: res.message, type: 'success' }); - this.selectMaterialTree() + this.leftAdd.type=[] + this.leftAdd.father=null + this.leftAdd.standard=null + this.leftAdd.name=null + this.leftAdd.specifications=null + this.selectMaterialTree() + this.bomLeftAdd=false + this.selectVersion() }) }else{ let specificationsDto={ @@ -594,7 +640,13 @@ message: res.message, type: 'success' }); + this.leftAdd.type=[] + this.leftAdd.father=null + this.leftAdd.standard=null + this.leftAdd.name=null + this.leftAdd.specifications=null this.selectMaterialTree() + this.bomLeftAdd=false this.selectVersion() }) } @@ -730,6 +782,7 @@ this.materialVisible = false; this.productVisible = false; }, + //娓呯┖鏂板bom琛ㄥ崟 clearBomAddModel(){ if(this.typeselect == 0){ this.deviceList=[]; @@ -740,6 +793,7 @@ this.$refs["targetForm"].resetFields(); }else if(this.typeselect == 2){ this.mIdList = []; + this.materialForm.tableList = []; this.$refs["materialForm"].resetFields(); }else{ this.productDeviceList=[]; @@ -999,7 +1053,6 @@ let arr = res.data; this.formatData(arr) this.tableData = arr; - console.log("arr--",arr); }) }, formatData(data){ @@ -1034,6 +1087,29 @@ arr[idx].name = '鍗婃垚鍝�' } }) + if(res.data.length<1){ + let obj={ + name: '鎴愬搧', + } + let obj2={ + name: '鍗婃垚鍝�', + } + this.list.push(obj) + this.list.push(obj2) + } + if(res.data.length===1){ + if(res.data[0].name==='鎴愬搧'){ + this.list.push({ + name: '鍗婃垚鍝�', + }) + } + if(res.data[0].name==='鍗婃垚鍝�'){ + this.list.push({ + name: '鎴愬搧', + }) + } + } + console.log(this.list); this.selectDataList() // 榛樿绗竴涓簲绾ц妭鐐规悳绱紝鏂板閰嶇疆椤� const treeOptions = JSON.parse(JSON.stringify(this.list)); @@ -1119,6 +1195,11 @@ } }, watch:{ + isUpdateDevice(val){ + if(val){ + this.selectAll(); + } + }, search(val) { this.$refs.tree.filter(val); }, @@ -1126,12 +1207,16 @@ handler(newVal, oldVal) { if(this.isLeftAdd){ let tree=JSON.parse(JSON.stringify(this.list)) + console.log(tree); let father=null; if(newVal.father!=null&&newVal.father!=''&&newVal.type.length>0){ let one=tree.filter(item=>{ return item.name===newVal.type[0] })[0] console.log(one); + if(one.children===undefined){ + return + } let two=one.children.filter(item=>{ return item.name===newVal.father })[0] @@ -1206,7 +1291,7 @@ padding: 0 12px; } -.standard .right .contentTable{ + .contentTable{ width:98%; margin-left:1%; } diff --git a/src/components/view/technical.vue b/src/components/view/technical.vue index 488e2ad..aa90cdd 100644 --- a/src/components/view/technical.vue +++ b/src/components/view/technical.vue @@ -39,6 +39,7 @@ <div class="technical-table"> <div class="table-box"> <el-table + height="490" border style="width: 100%" :data="technicalTable" > @@ -98,7 +99,7 @@ <template slot-scope="scope"> <!-- <el-button type="text" size="small" @click="showDetails(scope.row)">鏌ョ湅璇︽儏</el-button> <el-button type="text" size="small">缂栬緫闄勪欢</el-button> --> - <el-button type="text" size="small" @click="authorizedstrength(scope.row)">缂栧埗</el-button> + <el-button v-if="scope.row.type===0" type="text" size="small" @click="authorizedstrength(scope.row)">缂栧埗</el-button> </template> </el-table-column> </el-table> @@ -261,8 +262,8 @@ id:this.compiledata.id }).then( res =>{ this.$message.success('缂栧埗瀹屾垚') - }) this.getTechnicalTableData() + }) }, async showDetails(row){ @@ -379,7 +380,7 @@ /* 鎶�鏈枃浠惰〃鏍兼牱寮� */ .technical-table{ margin-top: 11px; - height: calc(100% - 140px); + /* height: calc(100% - 140px); */ background: #fff; padding: 23px 21px ; font-size: 14px; -- Gitblit v1.9.3