From 49f3321fa839e0ff5fb4d2de75756096a6db7b92 Mon Sep 17 00:00:00 2001 From: Fixiaobai <fixiaobai@163.com> Date: 星期日, 24 九月 2023 10:50:08 +0800 Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/mom-before --- src/components/view/Technicalindex.vue | 285 ++++++++++++++++++++++++-------------------------------- 1 files changed, 124 insertions(+), 161 deletions(-) diff --git a/src/components/view/Technicalindex.vue b/src/components/view/Technicalindex.vue index 905643d..623d0eb 100644 --- a/src/components/view/Technicalindex.vue +++ b/src/components/view/Technicalindex.vue @@ -35,7 +35,6 @@ </el-form-item> </el-col> </el-row> - <el-row> <el-col :span="11"> <el-form-item label="椤圭洰缁�"> @@ -48,7 +47,6 @@ </el-form-item> </el-col> </el-row> - <el-form-item label="鍗曚綅"> <el-input v-model="form.name" placeholder="璇疯緭鍏ュ崟浣�" style="width: 220px;"></el-input> </el-form-item> @@ -63,17 +61,8 @@ <span>绫诲瀷锛�</span> <el-select v-model="search.type" size="small" placeholder="璇烽�夋嫨" @change="TYpe" 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> - <el-button size="mini"><span>閲� 缃�</span></el-button> - <el-button size="mini" type="primary" style="background: #004EA2;"><span>鏌ヨ</span></el-button> --> </div> <div class="thing"> <!-- 涓讳綋宸� --> @@ -85,21 +74,15 @@ <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" style="width: 100%;overflow-y: auto;min-height: 100%" - max-height="100%" row-key="name" border - @select-all="selectAll" - @select="selectTr" - ref="multipleTable" - @selection-change="handleSelectionChange" - default-expand-all :tree-props="{children: 'children', hasChildren: 'hasChildren'}"> + <el-table :data="tableData" style="width: 100%;overflow-y: auto;min-height: 100%" max-height="100%" + row-key="name" border @select-all="selectAll" @select="selectTr" ref="multipleTable" + @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="50"> @@ -129,17 +112,13 @@ <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"> <template> <el-select v-model="edit.type" disabled placeholder="璇烽�夋嫨" @change="TYpe" style="width: 306px;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> </template> </el-col> @@ -201,10 +180,7 @@ <template> <el-select v-model="form.type" size="small" placeholder="璇烽�夋嫨" @change="edittype" style="width: 98%;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> </template> </el-form-item> @@ -212,7 +188,7 @@ <el-col :span="11"> <el-form-item label="宸ュ簭"> <template> - <el-select v-model="form.work" placeholder="璇烽�夋嫨" allow-create filterable @change="workevent"> + <el-select v-model="form.work" placeholder="璇烽�夋嫨" @change="workevent"> <el-option v-for="(item,index) in process" :key="item.name" :label="item.name" :value="item.name"> </el-option> @@ -223,7 +199,7 @@ <el-col :span="11" :offset="2"> <el-form-item label="宸ヨ壓"> <template> - <el-select v-model="form.name" style="width: 95%;" placeholder="璇烽�夋嫨" @change="craftrow" allow-create filterable> + <el-select v-model="form.name" style="width: 95%;" placeholder="璇烽�夋嫨" @change="craftrow"> <el-option v-for="item in craftapi" :key="item.id" :label="item.name" :value="item.id"> </el-option> </el-select> @@ -231,7 +207,6 @@ </el-form-item> </el-col> </el-row> - <el-row> <el-col :span="11"> <el-form-item label="椤圭洰缁�"> @@ -240,23 +215,6 @@ <el-option v-for="item in higherlevel" :key="item" :label="item" :value="item"> </el-option> </el-select> - <!-- <el-autocomplete - popper-class="my-autocomplete" - v-model="form.father" - :fetch-suggestions="higherlevel" - placeholder="璇疯緭鍏ュ唴瀹�" - @select="electadd"> - <i - class="el-icon-edit el-input__icon" - slot="suffix" - @click="handleIconClick"> - </i> - <template slot-scope="{ item }"> - <div class="name">{{ item }}</div> - <span class="addr">{{ item}}</span> - </template> - </el-autocomplete> --> - </template> </el-form-item> </el-col> @@ -266,7 +224,6 @@ </el-form-item> </el-col> </el-row> - <el-form-item label="鍗曚綅"> <el-input v-model="form.unit" placeholder="璇疯緭鍏ュ崟浣�" style="width: 35.95%;"></el-input> </el-form-item> @@ -285,111 +242,117 @@ export default { data() { return { - search:{ - type:0, - technology:null, - }, - // handleClose:[], - checkTreeNode :{ - id:'', - }, - higherlevel:[], - value:{}, - options:[], - process:[], - filterNode:[], - list: [], - form:{ - father:'', - work:'', - name:'', - unit:'', - project:'', - }, - children:[], - modifyevent:false, - dialogVisible:false, - tableData: [], - crafval:'', - typeselect:0, - upData:{}, - upDia:false, - craftapi:[], - edit:{ - techFather:'', - techName:'', - father:'', - name:'', - unit:'', - id:'', - - }, - isAllSelect:false, - } - - }, - mounted() { - this.selectAllleft() - this.selectAllright() + search: { + type: 0, + technology: null, + }, + checkTreeNode: { + id: '', + }, + higherlevel: [], + value: {}, + options: [], + process: [], + filterNode: [], + list: [], + form: { + father: '', + work: '', + name: '', + unit: '', + project: '', + }, + children: [], + modifyevent: false, + dialogVisible: false, + tableData: [], + crafval: '', + typeselect: 0, + upData: {}, + upDia: false, + craftapi: [], + edit: { + techFather: '', + techName: '', + father: '', + name: '', + unit: '', + id: '', + }, + isAllSelect: false, + bigType: [] + } }, - methods:{ + mounted() { + this.chooseType() + }, + 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.selectAllleft() + this.selectAllright() + }) + }, handleSelectionChange(val) { this.selects = val; this.deleteList = []; - val.forEach((v) => { - if (v.id !== undefined) { - this.deleteList.push(v.id); - } - }); + val.forEach((v) => { + if (v.id !== undefined) { + this.deleteList.push(v.id); + } + }); }, - // 鍏ㄩ��/鍙栨秷閫夋搷浣� - selectAll(val) { - this.isAllSelect = !this.isAllSelect; - let data = this.tableData; - this.toggleSelect(data, this.isAllSelect, "all"); - }, - //閫夋嫨鏌愯 - selectTr(selection, row) { - this.$set(row, "isChecked", !row.isChecked); - this.$nextTick(() => { - this.isAllSelect = row.isChecked; - this.toggleSelect(row, row.isChecked, "tr"); - }); - }, + // 鍏ㄩ��/鍙栨秷閫夋搷浣� + selectAll(val) { + this.isAllSelect = !this.isAllSelect; + let data = this.tableData; + this.toggleSelect(data, this.isAllSelect, "all"); + }, + //閫夋嫨鏌愯 + selectTr(selection, row) { + this.$set(row, "isChecked", !row.isChecked); + this.$nextTick(() => { + this.isAllSelect = row.isChecked; + this.toggleSelect(row, row.isChecked, "tr"); + }); + }, toggleSelection(row, flag) { this.$set(row, "isChecked", flag); this.$nextTick(() => { - if (flag) { - this.$refs.multipleTable.toggleRowSelection(row, flag); - } else { - this.$refs.multipleTable.clearSelection(); - } + if (flag) { + this.$refs.multipleTable.toggleRowSelection(row, flag); + } else { + this.$refs.multipleTable.clearSelection(); + } }); }, - //閫掑綊瀛愮骇 - toggleSelect(data, flag, type) { + //閫掑綊瀛愮骇 + toggleSelect(data, flag, type) { // console.log('222'); - if (type === "all") { - if (data.length > 0) { - data.forEach((item) => { - this.toggleSelection(item, flag); - if (item.children && item.children.length > 0) { - this.toggleSelect(item.children, flag, type); - } - }); - } - } else { - if (data.children && data.children.length > 0) { - data.children.forEach((item) => { - item.isChecked = !item.isChecked; - this.$refs.multipleTable.toggleRowSelection(item, flag); - this.toggleSelect(item, flag, type); - }); - } - } - }, -//--------------------------------------------------------------------------------------------------------------------------------------- - handleClose(){}, + if (type === "all") { + if (data.length > 0) { + data.forEach((item) => { + this.toggleSelection(item, flag); + if (item.children && item.children.length > 0) { + this.toggleSelect(item.children, flag, type); + } + }); + } + } else { + if (data.children && data.children.length > 0) { + data.children.forEach((item) => { + item.isChecked = !item.isChecked; + this.$refs.multipleTable.toggleRowSelection(item, flag); + this.toggleSelect(item, flag, type); + }); + } + } + }, + //--------------------------------------------------------------------------------------------------------------------------------------- + handleClose() {}, selectDataList() { this.list.forEach(a => { a.code = '[1]' @@ -435,7 +398,7 @@ } }).then(res => { /* this.selectAllright() */ - this.$parent.removeAllTab() + this.$parent.removeAllTab() }) }, submitUpData() { //纭畾 @@ -450,7 +413,7 @@ }).then(res => { /* this.selectAllright() */ this.$message.success('鍒犻櫎瀹屾垚') - this.$parent.removeAllTab() + this.$parent.removeAllTab() }) }, deleteRow(index, rows) { @@ -465,20 +428,20 @@ ids: this.delete }).then(res => { /* this.selectAllright() */ - this.$parent.removeAllTab() + this.$parent.removeAllTab() }) }, dels() { - + let ee = [] - console.log(this.selects); - this.selects.forEach(el =>{ - if(el.children){ - el.children.forEach(ele =>{ - ee.push(ele.id) - }) - } - }) + console.log(this.selects); + this.selects.forEach(el => { + if (el.children) { + el.children.forEach(ele => { + ee.push(ele.id) + }) + } + }) // cc.splice(0,1) this.delete = ee.join(',') console.log(this.delete); @@ -571,7 +534,7 @@ console.log(this.tableData); }); }, - craftrow(val){ + craftrow(val) { this.crafval = val this.chooseProFath() }, @@ -580,7 +543,7 @@ console.log(this.checkTreeNode.id); this.$axios.get(this.$api.url.chooseProFath, { params: { - techTemId:this.crafval + techTemId: this.crafval } }).then(res => { this.higherlevel = res.data; @@ -756,4 +719,4 @@ height: 30px; border-radius: 2px; } -</style> +</style> \ No newline at end of file -- Gitblit v1.9.3