From 0b0da8c09c65ac43b501a9c2180081c6adc88caf Mon Sep 17 00:00:00 2001
From: XiaoRuby <3114200645@qq.com>
Date: 星期五, 18 八月 2023 17:50:23 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/components/view/technology.vue | 341 ++++++++++++++
src/components/view/mbom.vue | 307 +++++++++++++
src/components/view/self-inspection.vue | 369 ++++++++++++++++
src/components/view/record-content.vue | 339 ++++++++++----
src/App.vue | 1
src/view/index.vue | 8
6 files changed, 1,252 insertions(+), 113 deletions(-)
diff --git a/src/App.vue b/src/App.vue
index a5349ab..ed3b4f5 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -120,6 +120,7 @@
/**婊氬姩鏉$殑瀹藉害*/
::-webkit-scrollbar {
width: 8px;
+ height: 8px;
}
::-webkit-scrollbar-thumb {
background-color: #bdbfc4;
diff --git a/src/components/view/mbom.vue b/src/components/view/mbom.vue
new file mode 100644
index 0000000..21dfc73
--- /dev/null
+++ b/src/components/view/mbom.vue
@@ -0,0 +1,307 @@
+<style scoped>
+ .title .el-button {
+ height: 32px;
+ border: 1px solid rgba(190, 190, 190, 0.44);
+ box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
+ padding: 0 12px;
+ }
+
+ .title {
+ margin-bottom: 10px;
+ padding: 0 20px;
+ }
+
+ .title * {
+ font-size: 16px;
+ }
+
+ .choose {
+ padding: 21px 24px;
+ display: flex;
+ align-items: center;
+ background-color: #fff;
+ border-bottom: 3px solid rgb(245, 247, 251);
+ }
+
+ .choose * {
+ font-size: 14px;
+ }
+
+ .choose .el-button {
+ height: 32px;
+ border: 1px solid rgba(190, 190, 190, 0.44);
+ box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
+ padding: 0 12px;
+ }
+
+ .thing {
+ width: 100%;
+ height: calc(100% - 120px);
+ background-color: #fff;
+ display: flex;
+ }
+
+ .thing .left {
+ width: 295px;
+ height: calc(100% - 20px);
+ border-right: 3px solid rgb(245, 247, 251);
+ padding: 16px;
+ }
+
+ .thing .left .custom-tree-node span {
+ font-size: 14px;
+ }
+
+ .thing .left .custom-tree-node {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ font-size: 14px;
+ padding-right: 8px;
+ }
+
+ .node_i {
+ color: orange;
+ }
+
+ .el-icon-delete {
+ display: none;
+ color: #004EA2;
+ }
+
+ .custom-tree-node:hover .el-icon-delete {
+ display: inline;
+ }
+
+ .thing .right {
+ width: calc(100% - 305px);
+ height: calc(100% - 25px);
+ overflow: hidden;
+ padding: 10px;
+ }
+
+ .table_do {
+ color: #004ea0;
+ cursor: pointer;
+ }
+</style>
+<style>
+ .record_content .title .el-button * {
+ font-size: 14px;
+ }
+
+ .record_content .title .el-button--default {
+ color: #004EA2;
+ }
+
+ .record_content .thing .left .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
+ background: rgba(58, 124, 253, 0.2);
+ color: #004EA2;
+ }
+
+ .record_content .el-tree-node__content {
+ height: 30px;
+ border-radius: 2px;
+ }
+</style>
+
+<template>
+ <div class="record_content">
+ <div class="title">
+ <el-row>
+ <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;">鏂板</el-button>
+ <el-button icon="el-icon-edit-outline">淇敼</el-button>
+ <el-button icon="el-icon-delete" @click="dels">鍒犻櫎</el-button>
+ </el-col>
+ </el-row>
+ </div>
+ <div class="choose">
+ <span>绫诲瀷锛�</span>
+ <el-select v-model="search.type" size="small" 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-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
+ @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>
+ <div class="right">
+ <el-table :data="tableData" border style="width: 100%;overflow-y: auto;min-height: 100%" max-height="100%"
+ @selection-change="handleSelectionChange" default-expand-all>
+ <el-table-column type="selection" width="50">
+ </el-table-column>
+ <el-table-column type="index" label="搴忓彿" width="70">
+ </el-table-column>
+ <el-table-column prop="name" label="鍘熸潗鏂欏悕绉�">
+ </el-table-column>
+ <el-table-column prop="unit" label="鍗曚綅" width="150">
+ </el-table-column>
+ <el-table-column prop="num" label="鏁伴噺" width="300">
+ <template slot-scope="scope">
+ <el-input v-model="scope.row.num" size="medium" placeholder="璇疯緭鍏ュ崟浣�" clearable @change="(val)=>submitUpData(scope.row.id, val)"></el-input>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" width="100">
+ <template slot-scope="scope">
+ <span class="table_do" @click="deleteRow(scope.$index, tableData)">鍒犻櫎</span>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ </div>
+ </div>
+</template>
+
+<script>
+ export default {
+ data() {
+ return {
+ search: {
+ type: 0,
+ name: null
+ },
+ process: [],
+ product: [],
+ list: [{
+ id: 0,
+ name: "宸ヨ壓",
+ children: [{
+ id: 5,
+ name: "宸ュ簭"
+ }]
+ }, {
+ id: 1,
+ name: "鎴愬搧"
+ }, {
+ id: 2,
+ name: "鍗婃垚鍝�"
+ }],
+ checkTreeNode: {},
+ tableData: [{
+ id: 1,
+ name: "鍘熸潗鏂欏悕绉�",
+ unit: "鍗曚綅",
+ num: "鏁伴噺"
+ }, {
+ id: 2,
+ name: "浣滀笟浜哄憳",
+ unit: "dajskda",
+ num: "12348"
+ }, {
+ id: 3,
+ name: "瑙勬牸",
+ unit: "dajskda",
+ num: "12348"
+ }, {
+ id: 4,
+ name: "瑙勬牸",
+ unit: "dajskda",
+ num: "12348"
+ }, {
+ id: 5,
+ name: "瑙勬牸",
+ unit: "dajskda",
+ num: "12348"
+ }],
+ upIndex: 0,
+ selects: [],
+ upData: {
+ id: 0,
+ num: null
+ }
+ }
+ },
+ mounted() {
+ this.selectDataList()
+ },
+ methods: {
+ filterNode(value, data) {
+ if (!value) return true;
+ return data.name.indexOf(value) !== -1;
+ },
+ remove(node, data) {
+ this.$confirm("鏄惁鍒犻櫎", "璀﹀憡", {
+ type: "warning"
+ }).then(res => {
+ const parent = node.parent;
+ const children = parent.data.children || parent.data;
+ const index = children.findIndex(d => d.id === data.id);
+ children.splice(index, 1);
+ }).catch(e => {})
+ },
+ selectDataList() {
+ this.list.forEach(a => {
+ a.code = '[1]'
+ if (a.children != undefined) {
+ a.children.forEach(b => {
+ b.code = '[2]'
+ })
+ }
+ })
+ this.upIndex++
+ },
+ handleNodeClick(data) {
+ this.checkTreeNode = data
+ if (data.code == '[2]') {
+ console.log(data);
+ }
+ },
+ nodeOpen(data, node, el) {
+ $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder-opened')
+ },
+ nodeClose(data, node, el) {
+ $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder')
+ },
+ handleSelectionChange(val) {
+ this.selects = val;
+ },
+ dels() {
+ this.selects.forEach(a => {
+ for (var b = 0; b < this.tableData.length; b++) {
+ if (this.tableData[b].id == a.id) {
+ this.tableData.splice(b, 1)
+ b--
+ }
+ }
+ })
+ this.$message.success('鍒犻櫎瀹屾垚')
+ },
+ deleteRow(index, rows) {
+ rows.splice(index, 1);
+ },
+ submitUpData(id,val) {
+ this.tableData.forEach(a => {
+ if (a.id == id) {
+ a.num = val
+ }
+ })
+ this.$message.success('淇敼鎴愬姛')
+ this.upIndex++
+ }
+ }
+ }
+</script>
\ No newline at end of file
diff --git a/src/components/view/record-content.vue b/src/components/view/record-content.vue
index 88d9fb3..370c50e 100644
--- a/src/components/view/record-content.vue
+++ b/src/components/view/record-content.vue
@@ -35,11 +35,50 @@
}
.thing {
- width: calc(100% - 44px);
- height: calc(100% - 42px - 82px - 66px);
+ width: 100%;
+ height: calc(100% - 120px);
background-color: #fff;
- overflow: auto;
- padding: 33px 22px;
+ display: flex;
+ }
+
+ .thing .left {
+ width: 295px;
+ height: calc(100% - 20px);
+ border-right: 3px solid rgb(245, 247, 251);
+ padding: 16px;
+ }
+
+ .thing .left .custom-tree-node span {
+ font-size: 14px;
+ }
+
+ .thing .left .custom-tree-node {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ font-size: 14px;
+ padding-right: 8px;
+ }
+
+ .node_i {
+ color: orange;
+ }
+
+ .el-icon-delete {
+ display: none;
+ color: #004EA2;
+ }
+
+ .custom-tree-node:hover .el-icon-delete {
+ display: inline;
+ }
+
+ .thing .right {
+ width: calc(100% - 305px);
+ height: calc(100% - 25px);
+ overflow: hidden;
+ padding: 10px;
}
.table_do {
@@ -56,31 +95,14 @@
color: #004EA2;
}
- .record_content .thing * {
- font-size: 14px;
+ .record_content .thing .left .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
+ background: rgba(58, 124, 253, 0.2);
+ color: #004EA2;
}
- .record_content .has-gutter .el-table__cell {
- background-color: #F0F1F5 !important;
- color: #333;
- }
-
- .record_content .has-gutter .el-table__cell .cell {
- font-size: 16px;
- font-weight: 500;
- }
-
- .record_content .cell {
- color: #333;
- padding-left: 17px !important;
- }
-
- .record_content .el-table__body-wrapper {
- height: 100%;
- }
-
- .raw_ins .el-table__body {
- height: 100%;
+ .record_content .el-tree-node__content {
+ height: 30px;
+ border-radius: 2px;
}
</style>
@@ -92,7 +114,7 @@
<el-col :span="12" style="text-align: right;">
<el-button type="primary" icon="el-icon-plus" style="background: #004EA2;">鏂板</el-button>
<el-button icon="el-icon-edit-outline">淇敼</el-button>
- <el-button icon="el-icon-delete">鍒犻櫎</el-button>
+ <el-button icon="el-icon-delete" @click="dels">鍒犻櫎</el-button>
</el-col>
</el-row>
</div>
@@ -113,30 +135,68 @@
璇�</span></el-button>
</div>
<div class="thing">
- <el-table :data="tableData" border style="width: 100%;overflow-y: auto;min-height: calc(100% - 50px)"
- max-height="calc(100% - 50px)" @selection-change="handleSelectionChange" default-expand-all
- :tree-props="{children: 'children', hasChildren: 'hasChildren'}" row-key="id">
- <el-table-column type="selection" width="50">
- </el-table-column>
- <el-table-column type="index" label="搴忓彿" width="70">
- </el-table-column>
- <el-table-column prop="name" label="宸ュ簭">
- <template slot-scope="scope">
- <span>
- <font>{{scope.row.ids}}</font>{{scope.row.name}}
- </span>
- </template>
- </el-table-column>
- <el-table-column prop="address" label="澶囨敞">
- </el-table-column>
- <el-table-column label="鎿嶄綔" width="130">
- <template slot-scope="scope">
- <span class="table_do">缂栬緫 </span>
- <span class="table_do" @click="deleteRow(scope.$index, tableData)">鍒犻櫎</span>
- </template>
- </el-table-column>
- </el-table>
+ <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
+ @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 != '[3]'?'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>
+ <div class="right">
+ <el-table :data="tableData" border style="width: 100%;overflow-y: auto;min-height: 100%" max-height="100%"
+ @selection-change="handleSelectionChange" default-expand-all>
+ <el-table-column type="selection" width="50">
+ </el-table-column>
+ <el-table-column type="index" label="搴忓彿" width="70">
+ </el-table-column>
+ <el-table-column prop="name" label="鍚嶇О">
+ </el-table-column>
+ <el-table-column prop="unit" label="鍗曚綅">
+ </el-table-column>
+ <el-table-column prop="thing" label="澶囨敞">
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" width="130">
+ <template slot-scope="scope">
+ <span class="table_do" @click="upContent(scope.row)">缂栬緫 </span>
+ <span class="table_do" @click="deleteRow(scope.$index, tableData)">鍒犻櫎</span>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
</div>
+ <el-dialog title="缂栬緫璁板綍鍐呭" :visible.sync="upDia" width="500px">
+ <div class="body">
+ <el-row style="line-height: 46px;">
+ <el-col :span="4" style="font-size: 14px;text-align: right;">鍚嶇О:</el-col>
+ <el-col :span="16" :offset="1">
+ <el-input v-model="upData.name" size="small" clearable></el-input>
+ </el-col>
+ </el-row>
+ <el-row style="line-height: 46px;">
+ <el-col :span="4" style="font-size: 14px;text-align: right;">鍗曚綅:</el-col>
+ <el-col :span="16" :offset="1">
+ <el-input v-model="upData.unit" size="small" clearable></el-input>
+ </el-col>
+ </el-row>
+ <el-row style="line-height: 46px;">
+ <el-col :span="4" style="font-size: 14px;text-align: right;">澶囨敞:</el-col>
+ <el-col :span="16" :offset="1">
+ <el-input v-model="upData.thing" size="small" clearable></el-input>
+ </el-col>
+ </el-row>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button type="primary" @click="submitUpData">纭� 瀹�</el-button>
+ <el-button @click="upDia = false">鍙� 娑�</el-button>
+ </span>
+ </el-dialog>
</div>
</template>
@@ -146,91 +206,152 @@
return {
search: {
type: 0,
- name: null
+ name: null,
+ technology: null
},
process: [],
- tableData: [{
- id: 1,
- date: '2016-05-02',
- name: '鐜嬪皬铏�',
- address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1518 寮�'
- }, {
- id: 2,
- date: '2016-05-04',
- name: '鐜嬪皬铏�',
- address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1517 寮�'
- }, {
- id: 3,
- date: '2016-05-01',
- name: '鐜嬪皬铏�',
- address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�',
+ list: [{
+ id: 0,
+ name: "鍘熸潗鏂�",
children: [{
- id: 31,
- date: '2016-05-01',
- name: '鐜嬪皬铏�',
- address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�',
+ id: 3,
+ name: "宸ヨ壓",
children: [{
- id: 33,
- date: '2016-05-01',
- name: '鐜嬪皬铏�',
- address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�'
- }, {
- id: 34,
- date: '2016-05-01',
- name: '鐜嬪皬铏�',
- address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�'
+ id: 6,
+ name: "璁惧1"
}]
- }, {
- id: 32,
- date: '2016-05-01',
- name: '鐜嬪皬铏�',
- address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�'
}]
}, {
- id: 4,
- date: '2016-05-03',
- name: '鐜嬪皬铏�',
- address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1516 寮�'
+ id: 1,
+ name: "鎴愬搧",
+ children: [{
+ id: 4,
+ name: "宸ヨ壓"
+ }]
+ }, {
+ id: 2,
+ name: "鍗婃垚鍝�",
+ children: [{
+ id: 5,
+ name: "宸ヨ壓"
+ }]
}],
- selects: []
+ checkTreeNode: {},
+ tableData: [{
+ id: 1,
+ name: "璐ㄩ噺杩芥函鍙�",
+ unit: "鍗曚綅",
+ thing: "dajskda"
+ }, {
+ id: 2,
+ name: "浣滀笟浜哄憳",
+ unit: "鍗曚綅",
+ thing: "dajskda"
+ }, {
+ id: 3,
+ name: "瑙勬牸",
+ unit: "鍗曚綅",
+ thing: "dajskda"
+ }, {
+ id: 4,
+ name: "瑙勬牸",
+ unit: "鍗曚綅",
+ thing: "dajskda"
+ }, {
+ id: 5,
+ name: "瑙勬牸",
+ unit: "鍗曚綅",
+ thing: "dajskda"
+ }],
+ upIndex: 0,
+ selects: [],
+ upDia: false,
+ upData: {
+ id: 0,
+ name: null,
+ unit: null,
+ thing: null
+ }
}
},
mounted() {
this.selectDataList()
},
methods: {
- clean() {
- this.search = {
- type: null,
- name: null
- }
+ filterNode(value, data) {
+ if (!value) return true;
+ return data.name.indexOf(value) !== -1;
},
- selectDataList(){
- this.tableData.forEach(a=>{
- a.ids = '01'
- if(a.children!=undefined){
- a.children.forEach(b=>{
- b.ids = '02'
- if(b.children!=undefined){
- b.children.forEach(c=>{
- c.ids = '03'
+ remove(node, data) {
+ this.$confirm("鏄惁鍒犻櫎", "璀﹀憡", {
+ type: "warning"
+ }).then(res => {
+ const parent = node.parent;
+ const children = parent.data.children || parent.data;
+ const index = children.findIndex(d => d.id === data.id);
+ children.splice(index, 1);
+ }).catch(e => {})
+ },
+ 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++
+ },
+ handleNodeClick(data) {
+ this.checkTreeNode = data
+ if(data.code=='[3]'){
+ console.log(data);
+ }
+ },
+ nodeOpen(data, node, el) {
+ $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder-opened')
+ },
+ nodeClose(data, node, el) {
+ $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder')
},
handleSelectionChange(val) {
this.selects = val;
},
- del(ob) {
- console.log(ob)
+ dels() {
+ this.selects.forEach(a => {
+ for (var b = 0; b < this.tableData.length; b++) {
+ if (this.tableData[b].id == a.id) {
+ this.tableData.splice(b, 1)
+ b--
+ }
+ }
+ })
+ this.$message.success('鍒犻櫎瀹屾垚')
},
deleteRow(index, rows) {
- console.log(index);
- console.log(rows);
rows.splice(index, 1);
+ },
+ upContent(ob) {
+ this.upData = this.HaveJson(ob)
+ this.upDia = true
+ },
+ submitUpData() {
+ this.tableData.forEach(a => {
+ if (a.id == this.upData.id) {
+ a.name = this.upData.name
+ a.unit = this.upData.unit
+ a.thing = this.upData.thing
+ }
+ })
+ this.$message.success('淇敼鎴愬姛')
+ this.upDia = false
}
}
}
-</script>
\ No newline at end of file
+</script>
diff --git a/src/components/view/self-inspection.vue b/src/components/view/self-inspection.vue
new file mode 100644
index 0000000..f8d025d
--- /dev/null
+++ b/src/components/view/self-inspection.vue
@@ -0,0 +1,369 @@
+<style scoped>
+ .title .el-button {
+ height: 32px;
+ border: 1px solid rgba(190, 190, 190, 0.44);
+ box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
+ padding: 0 12px;
+ }
+
+ .title {
+ margin-bottom: 10px;
+ padding: 0 20px;
+ }
+
+ .title * {
+ font-size: 16px;
+ }
+
+ .choose {
+ padding: 21px 24px;
+ display: flex;
+ align-items: center;
+ background-color: #fff;
+ border-bottom: 3px solid rgb(245, 247, 251);
+ }
+
+ .choose * {
+ font-size: 14px;
+ }
+
+ .choose .el-button {
+ height: 32px;
+ border: 1px solid rgba(190, 190, 190, 0.44);
+ box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
+ padding: 0 12px;
+ }
+
+ .thing {
+ width: 100%;
+ height: calc(100% - 120px);
+ background-color: #fff;
+ display: flex;
+ }
+
+ .thing .left {
+ width: 295px;
+ height: calc(100% - 20px);
+ border-right: 3px solid rgb(245, 247, 251);
+ padding: 16px;
+ }
+
+ .thing .left .custom-tree-node span {
+ font-size: 14px;
+ }
+
+ .thing .left .custom-tree-node {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ font-size: 14px;
+ padding-right: 8px;
+ }
+
+ .node_i {
+ color: orange;
+ }
+
+ .el-icon-delete {
+ display: none;
+ color: #004EA2;
+ }
+
+ .custom-tree-node:hover .el-icon-delete {
+ display: inline;
+ }
+
+ .thing .right {
+ width: calc(100% - 305px);
+ height: calc(100% - 25px);
+ overflow: hidden;
+ padding: 10px;
+ }
+
+ .table_do {
+ color: #004ea0;
+ cursor: pointer;
+ }
+</style>
+<style>
+ .record_content .title .el-button * {
+ font-size: 14px;
+ }
+
+ .record_content .title .el-button--default {
+ color: #004EA2;
+ }
+
+ .record_content .thing .left .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
+ background: rgba(58, 124, 253, 0.2);
+ color: #004EA2;
+ }
+
+ .record_content .el-tree-node__content {
+ height: 30px;
+ border-radius: 2px;
+ }
+</style>
+
+<template>
+ <div class="record_content">
+ <div class="title">
+ <el-row>
+ <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;">鏂板</el-button>
+ <el-button icon="el-icon-edit-outline">淇敼</el-button>
+ <el-button icon="el-icon-delete" @click="dels">鍒犻櫎</el-button>
+ </el-col>
+ </el-row>
+ </div>
+ <div class="choose">
+ <span>绫诲瀷锛�</span>
+ <el-select v-model="search.type" size="small" 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-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
+ @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>
+ <div class="right">
+ <el-table :data="tableData" border style="width: 100%;overflow-y: auto;min-height: 100%" max-height="100%"
+ @selection-change="handleSelectionChange" default-expand-all>
+ <el-table-column type="selection" width="50">
+ </el-table-column>
+ <el-table-column type="index" label="搴忓彿" width="70">
+ </el-table-column>
+ <el-table-column prop="name" label="鍚嶇О">
+ </el-table-column>
+ <el-table-column prop="unit" label="鍗曚綅">
+ </el-table-column>
+ <el-table-column prop="stand" label="鏍囧噯鍊�">
+ </el-table-column>
+ <el-table-column prop="ask" label="鍐呮帶鍊�">
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" width="130">
+ <template slot-scope="scope">
+ <span class="table_do" @click="upContent(scope.row)">缂栬緫 </span>
+ <span class="table_do" @click="deleteRow(scope.$index, tableData)">鍒犻櫎</span>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ </div>
+ <el-dialog title="缂栬緫璁板綍鍐呭" :visible.sync="upDia" width="500px">
+ <div class="body">
+ <el-row style="line-height: 46px;">
+ <el-col :span="4" style="font-size: 14px;text-align: right;">鍚嶇О:</el-col>
+ <el-col :span="16" :offset="1">
+ <el-input v-model="upData.name" size="small" clearable></el-input>
+ </el-col>
+ </el-row>
+ <el-row style="line-height: 46px;">
+ <el-col :span="4" style="font-size: 14px;text-align: right;">鍗曚綅:</el-col>
+ <el-col :span="16" :offset="1">
+ <el-input v-model="upData.unit" size="small" clearable></el-input>
+ </el-col>
+ </el-row>
+ <el-row style="line-height: 46px;">
+ <el-col :span="4" style="font-size: 14px;text-align: right;">鏍囧噯鍊�:</el-col>
+ <el-col :span="16" :offset="1">
+ <el-input v-model="upData.stand" size="small" clearable></el-input>
+ </el-col>
+ </el-row>
+ <el-row style="line-height: 46px;">
+ <el-col :span="4" style="font-size: 14px;text-align: right;">鍐呮帶鍊�:</el-col>
+ <el-col :span="16" :offset="1">
+ <el-input v-model="upData.ask" size="small" clearable></el-input>
+ </el-col>
+ </el-row>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button type="primary" @click="submitUpData">纭� 瀹�</el-button>
+ <el-button @click="upDia = false">鍙� 娑�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+ export default {
+ data() {
+ return {
+ search: {
+ type: 0,
+ name: null,
+ technology: null
+ },
+ process: [],
+ product: [],
+ list: [{
+ id: 0,
+ name: "鍘熸潗鏂�",
+ children: [{
+ id: 3,
+ name: "宸ヨ壓"
+ }]
+ }, {
+ id: 1,
+ name: "鎴愬搧",
+ children: [{
+ id: 4,
+ name: "宸ヨ壓"
+ }]
+ }, {
+ id: 2,
+ name: "鍗婃垚鍝�",
+ children: [{
+ id: 5,
+ name: "宸ヨ壓"
+ }]
+ }],
+ checkTreeNode: {},
+ tableData: [{
+ id: 1,
+ name: "鐢电紗瑙勬牸",
+ unit: "dajskda",
+ stand: "12348",
+ ask: "564165"
+ }, {
+ id: 2,
+ name: "浣滀笟浜哄憳",
+ unit: "dajskda",
+ stand: "12348",
+ ask: "564165"
+ }, {
+ id: 3,
+ name: "瑙勬牸",
+ unit: "dajskda",
+ stand: "12348",
+ ask: "564165"
+ }, {
+ id: 4,
+ name: "瑙勬牸",
+ unit: "dajskda",
+ stand: "12348",
+ ask: "564165"
+ }, {
+ id: 5,
+ name: "瑙勬牸",
+ unit: "dajskda",
+ stand: "12348",
+ ask: "564165"
+ }],
+ upIndex: 0,
+ selects: [],
+ upDia: false,
+ upData: {
+ id: 0,
+ name: null,
+ unit: null,
+ stand: null,
+ ask: null
+ }
+ }
+ },
+ mounted() {
+ this.selectDataList()
+ },
+ methods: {
+ filterNode(value, data) {
+ if (!value) return true;
+ return data.name.indexOf(value) !== -1;
+ },
+ remove(node, data) {
+ this.$confirm("鏄惁鍒犻櫎", "璀﹀憡", {
+ type: "warning"
+ }).then(res => {
+ const parent = node.parent;
+ const children = parent.data.children || parent.data;
+ const index = children.findIndex(d => d.id === data.id);
+ children.splice(index, 1);
+ }).catch(e => {})
+ },
+ selectDataList() {
+ this.list.forEach(a => {
+ a.code = '[1]'
+ if (a.children != undefined) {
+ a.children.forEach(b => {
+ b.code = '[2]'
+ })
+ }
+ })
+ this.upIndex++
+ },
+ handleNodeClick(data) {
+ this.checkTreeNode = data
+ if(data.code=='[2]'){
+ console.log(data);
+ }
+ },
+ nodeOpen(data, node, el) {
+ $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder-opened')
+ },
+ nodeClose(data, node, el) {
+ $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder')
+ },
+ handleSelectionChange(val) {
+ this.selects = val;
+ },
+ dels() {
+ this.selects.forEach(a => {
+ for (var b = 0; b < this.tableData.length; b++) {
+ if (this.tableData[b].id == a.id) {
+ this.tableData.splice(b, 1)
+ b--
+ }
+ }
+ })
+ this.$message.success('鍒犻櫎瀹屾垚')
+ },
+ deleteRow(index, rows) {
+ rows.splice(index, 1);
+ },
+ upContent(ob) {
+ this.upData = this.HaveJson(ob)
+ this.upDia = true
+ },
+ submitUpData() {
+ this.tableData.forEach(a => {
+ if (a.id == this.upData.id) {
+ a.name = this.upData.name
+ a.unit = this.upData.unit
+ a.stand = this.upData.stand
+ a.ask = this.upData.ask
+ }
+ })
+ this.$message.success('淇敼鎴愬姛')
+ this.upIndex++
+ this.upDia = false
+ }
+ }
+ }
+</script>
\ No newline at end of file
diff --git a/src/components/view/technology.vue b/src/components/view/technology.vue
new file mode 100644
index 0000000..b69807f
--- /dev/null
+++ b/src/components/view/technology.vue
@@ -0,0 +1,341 @@
+<style scoped>
+ .title .el-button {
+ height: 32px;
+ border: 1px solid rgba(190, 190, 190, 0.44);
+ box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
+ padding: 0 12px;
+ }
+
+ .title {
+ margin-bottom: 10px;
+ padding: 0 20px;
+ }
+
+ .title * {
+ font-size: 16px;
+ }
+
+ .choose {
+ padding: 21px 24px;
+ display: flex;
+ align-items: center;
+ background-color: #fff;
+ border-bottom: 3px solid rgb(245, 247, 251);
+ }
+
+ .choose * {
+ font-size: 14px;
+ }
+
+ .choose .el-button {
+ height: 32px;
+ border: 1px solid rgba(190, 190, 190, 0.44);
+ box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
+ padding: 0 12px;
+ }
+
+ .thing {
+ width: 100%;
+ height: calc(100% - 120px);
+ background-color: #fff;
+ display: flex;
+ }
+
+ .thing .left {
+ width: 295px;
+ height: calc(100% - 20px);
+ border-right: 3px solid rgb(245, 247, 251);
+ padding: 16px;
+ }
+
+ .thing .left .custom-tree-node span {
+ font-size: 14px;
+ }
+
+ .thing .left .custom-tree-node {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ font-size: 14px;
+ padding-right: 8px;
+ }
+
+ .node_i {
+ color: orange;
+ }
+
+ .el-icon-delete {
+ display: none;
+ color: #004EA2;
+ }
+
+ .custom-tree-node:hover .el-icon-delete {
+ display: inline;
+ }
+
+ .thing .right {
+ width: calc(100% - 305px);
+ height: calc(100% - 25px);
+ overflow: hidden;
+ padding: 10px;
+ }
+
+ .table_do {
+ color: #004ea0;
+ cursor: pointer;
+ }
+</style>
+<style>
+ .record_content .title .el-button * {
+ font-size: 14px;
+ }
+
+ .record_content .title .el-button--default {
+ color: #004EA2;
+ }
+
+ .record_content .thing .left .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
+ background: rgba(58, 124, 253, 0.2);
+ color: #004EA2;
+ }
+
+ .record_content .el-tree-node__content {
+ height: 30px;
+ border-radius: 2px;
+ }
+</style>
+
+<template>
+ <div class="record_content">
+ <div class="title">
+ <el-row>
+ <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;">鏂板</el-button>
+ <el-button icon="el-icon-edit-outline">淇敼</el-button>
+ <el-button icon="el-icon-delete" @click="dels">鍒犻櫎</el-button>
+ </el-col>
+ </el-row>
+ </div>
+ <div class="choose">
+ <span>绫诲瀷锛�</span>
+ <el-select v-model="search.type" size="small" 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-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
+ @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>
+ <div class="right">
+ <el-table :data="tableData" border style="width: 100%;overflow-y: auto;min-height: 100%" max-height="100%"
+ @selection-change="handleSelectionChange" default-expand-all>
+ <el-table-column type="selection" width="50">
+ </el-table-column>
+ <el-table-column type="index" label="搴忓彿" width="70">
+ </el-table-column>
+ <el-table-column prop="name" label="宸ヨ壓鍚嶇О">
+ </el-table-column>
+ <el-table-column prop="ask" label="璁惧缁�">
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" width="130">
+ <template slot-scope="scope">
+ <span class="table_do" @click="upContent(scope.row)">缂栬緫 </span>
+ <span class="table_do" @click="deleteRow(scope.$index, tableData)">鍒犻櫎</span>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ </div>
+ <el-dialog title="缂栬緫璁板綍鍐呭" :visible.sync="upDia" width="500px">
+ <div class="body">
+ <el-row style="line-height: 46px;">
+ <el-col :span="4" style="font-size: 14px;text-align: right;">宸ヨ壓鍚嶇О:</el-col>
+ <el-col :span="16" :offset="1">
+ <el-input v-model="upData.name" size="small" clearable></el-input>
+ </el-col>
+ </el-row>
+ <el-row style="line-height: 46px;">
+ <el-col :span="4" style="font-size: 14px;text-align: right;">璁惧缁�:</el-col>
+ <el-col :span="16" :offset="1">
+ <el-input v-model="upData.ask" size="small" clearable></el-input>
+ </el-col>
+ </el-row>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button type="primary" @click="submitUpData">纭� 瀹�</el-button>
+ <el-button @click="upDia = false">鍙� 娑�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+ export default {
+ data() {
+ return {
+ search: {
+ type: 0,
+ name: null,
+ technology: null
+ },
+ process: [],
+ product: [],
+ list: [{
+ id: 0,
+ name: "鎻掑ご",
+ children: [{
+ id: 5,
+ name: "宸ヨ壓"
+ }]
+ }, {
+ id: 1,
+ name: "鎴愬搧"
+ }, {
+ id: 2,
+ name: "鍗婃垚鍝�"
+ }],
+ checkTreeNode: {},
+ tableData: [{
+ id: 1,
+ name: "宸ュ簭",
+ unit: "dajskda",
+ stand: "12348",
+ ask: "564165"
+ }, {
+ id: 2,
+ name: "浣滀笟浜哄憳",
+ unit: "dajskda",
+ stand: "12348",
+ ask: "564165"
+ }, {
+ id: 3,
+ name: "瑙勬牸",
+ unit: "dajskda",
+ stand: "12348",
+ ask: "564165"
+ }, {
+ id: 4,
+ name: "瑙勬牸",
+ unit: "dajskda",
+ stand: "12348",
+ ask: "564165"
+ }, {
+ id: 5,
+ name: "瑙勬牸",
+ unit: "dajskda",
+ stand: "12348",
+ ask: "564165"
+ }],
+ upIndex: 0,
+ selects: [],
+ upDia: false,
+ upData: {
+ id: 0,
+ name: null,
+ ask: null
+ }
+ }
+ },
+ mounted() {
+ this.selectDataList()
+ },
+ methods: {
+ filterNode(value, data) {
+ if (!value) return true;
+ return data.name.indexOf(value) !== -1;
+ },
+ remove(node, data) {
+ this.$confirm("鏄惁鍒犻櫎", "璀﹀憡", {
+ type: "warning"
+ }).then(res => {
+ const parent = node.parent;
+ const children = parent.data.children || parent.data;
+ const index = children.findIndex(d => d.id === data.id);
+ children.splice(index, 1);
+ }).catch(e => {})
+ },
+ selectDataList() {
+ this.list.forEach(a => {
+ a.code = '[1]'
+ if (a.children != undefined) {
+ a.children.forEach(b => {
+ b.code = '[2]'
+ })
+ }
+ })
+ this.upIndex++
+ },
+ handleNodeClick(data) {
+ this.checkTreeNode = data
+ if (data.code == '[2]') {
+ console.log(data);
+ }
+ },
+ nodeOpen(data, node, el) {
+ $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder-opened')
+ },
+ nodeClose(data, node, el) {
+ $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder')
+ },
+ handleSelectionChange(val) {
+ this.selects = val;
+ },
+ dels() {
+ this.selects.forEach(a => {
+ for (var b = 0; b < this.tableData.length; b++) {
+ if (this.tableData[b].id == a.id) {
+ this.tableData.splice(b, 1)
+ b--
+ }
+ }
+ })
+ this.$message.success('鍒犻櫎瀹屾垚')
+ },
+ deleteRow(index, rows) {
+ rows.splice(index, 1);
+ },
+ upContent(ob) {
+ this.upData = this.HaveJson(ob)
+ this.upDia = true
+ },
+ submitUpData() {
+ this.tableData.forEach(a => {
+ if (a.id == this.upData.id) {
+ a.name = this.upData.name
+ a.ask = this.upData.ask
+ }
+ })
+ this.$message.success('淇敼鎴愬姛')
+ this.upIndex++
+ this.upDia = false
+ }
+ }
+ }
+</script>
\ No newline at end of file
diff --git a/src/view/index.vue b/src/view/index.vue
index 9786b1c..11d1f7a 100644
--- a/src/view/index.vue
+++ b/src/view/index.vue
@@ -507,7 +507,7 @@
k: 24,
v: "鑷缁存姢",
i: "font icon-shouye",
- u: ""
+ u: "self-inspection"
},
{
k: 25,
@@ -519,19 +519,19 @@
k: 26,
v: "宸ヨ壓璺嚎缁存姢",
i: "font icon-shouye",
- u: ""
+ u: "technology"
},
{
k: 27,
v: "璁惧缁存姢",
i: "font icon-shouye",
- u: ""
+ u: "laboratoryManagement"
},
{
k: 28,
v: "鐗╂枡娓呭崟缁存姢",
i: "font icon-shouye",
- u: ""
+ u: "mbom"
}
]
}
--
Gitblit v1.9.3