|
@@ -280,6 +280,7 @@
|
|
|
<el-link
|
|
|
class="mg-l-10"
|
|
|
type="primary"
|
|
|
+ @click="adjustExcel"
|
|
|
>调整表单</el-link>
|
|
|
<el-link
|
|
|
class="mg-l-10"
|
|
@@ -324,20 +325,19 @@
|
|
|
<el-input
|
|
|
style="width:400px;"
|
|
|
v-model.trim="GLExcelFrom.search"
|
|
|
- @input="searchInput"
|
|
|
placeholder="请输入需要选择的内容"
|
|
|
></el-input>
|
|
|
<el-tree
|
|
|
+ :filter-node-method="filterNode"
|
|
|
+ ref="tree"
|
|
|
+ class="filter-tree"
|
|
|
style="margin-top:10px;"
|
|
|
:props="GLExcelProps"
|
|
|
- :load="loadNodess"
|
|
|
- lazy
|
|
|
:data="exceldata"
|
|
|
node-key="id"
|
|
|
- :default-checked-keys="xuanzhong"
|
|
|
accordion
|
|
|
show-checkbox
|
|
|
- @check-change="checkchange"
|
|
|
+ @check="checkchange"
|
|
|
>
|
|
|
</el-tree>
|
|
|
</el-scrollbar>
|
|
@@ -1240,7 +1240,6 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-let setTimeout22
|
|
|
import {
|
|
|
saveFormAndElement, selectFormElements,
|
|
|
importWbsTree
|
|
@@ -1270,9 +1269,9 @@ export default {
|
|
|
GLExcelProps: {
|
|
|
label: 'name',
|
|
|
children: 'children',
|
|
|
- isLeaf: 'hasChildren',
|
|
|
+ disabled: 'hasChildren',
|
|
|
+ // isLeaf: !'hasChildren',
|
|
|
},
|
|
|
- xuanzhong: [],//选中值得ID
|
|
|
exceldata: [],//清表模板
|
|
|
//#endregion
|
|
|
|
|
@@ -1541,7 +1540,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
updateTreeNewNode () {
|
|
|
- getLazytree(this.id, this.nodeDetail.parentId,this.userInfo.tenant_id, this.projectid).then((res) => {
|
|
|
+ getLazytree(this.id, this.nodeDetail.parentId, this.userInfo.tenant_id, this.projectid).then((res) => {
|
|
|
this.$refs.tree.updateKeyChildren(this.nodeDetail.parentId, res.data.data)
|
|
|
})
|
|
|
},
|
|
@@ -1956,13 +1955,6 @@ export default {
|
|
|
})
|
|
|
console.log(res);
|
|
|
if (res.code === 200 && res.msg === '操作成功') {
|
|
|
- res.data.forEach(val => {
|
|
|
- if (val.hasChildren) {
|
|
|
- val.disabled = false
|
|
|
- } else {
|
|
|
- val.disabled = true
|
|
|
- }
|
|
|
- })
|
|
|
this.exceldata = res.data
|
|
|
}
|
|
|
},
|
|
@@ -1974,7 +1966,7 @@ export default {
|
|
|
size: 100000,
|
|
|
parentId: 0
|
|
|
})
|
|
|
- this.GLExcelFrom.id = scope.row.id
|
|
|
+ this.GLExcelFrom.id = scope.row.pkeyId
|
|
|
},
|
|
|
changetherr () {//清表类型选择框change事件
|
|
|
if (this.GLExcelFrom.name != "") {
|
|
@@ -1986,47 +1978,20 @@ export default {
|
|
|
this.GLExcelFrom.name = ""
|
|
|
this.GLExcelFrom.search = ''
|
|
|
this.GLExcelFrom.id
|
|
|
- this.xuanzhong = []
|
|
|
+ this.$refs.tree.setCheckedKeys([])
|
|
|
this.GLExcel = false
|
|
|
},
|
|
|
- async loadNodess (node, resolve) {//check事件
|
|
|
- console.log(node);
|
|
|
- if (this.GLExcelFrom.name) {
|
|
|
- console.log(node.data.id);
|
|
|
- console.log(resolve);
|
|
|
- const { data: res } = await tabLazytreeAll({
|
|
|
- modeId: node.data.id,
|
|
|
- name: '',
|
|
|
- })
|
|
|
- if (res.code === 200 && res.msg === '操作成功') {
|
|
|
- res.data.forEach(val => {
|
|
|
- if (val.hasChildren) {
|
|
|
- val.disabled = false
|
|
|
- } else {
|
|
|
- val.disabled = true
|
|
|
- }
|
|
|
- })
|
|
|
- resolve(res.data)
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- checkchange (data, checked,) {//节点选中回调
|
|
|
- if (checked) {
|
|
|
- this.xuanzhong = [data.id]
|
|
|
+ checkchange (data) {//节点选中回调
|
|
|
+ if (this.$refs.tree.getCheckedNodes().length == 0) {
|
|
|
+ this.$refs.tree.setCheckedKeys([])
|
|
|
} else {
|
|
|
- this.xuanzhong = []
|
|
|
+ this.$refs.tree.setCheckedKeys([data.id])
|
|
|
}
|
|
|
},
|
|
|
- searchInput () {//输入回调
|
|
|
- window.clearTimeout(setTimeout22)
|
|
|
- setTimeout22 = window.setTimeout(() => {
|
|
|
- this.tabLazytreeAll()
|
|
|
- }, 500)
|
|
|
- },
|
|
|
- async saveLinkTab () {
|
|
|
+ async saveLinkTab () {//保存按钮
|
|
|
const { data: res } = await saveLinkTab({
|
|
|
- exceTabId: this.GLExcelFrom.id,
|
|
|
- tabId: this.xuanzhong[0]
|
|
|
+ exceTabId: this.$refs.tree.getCheckedNodes()[0].id,
|
|
|
+ tabId: this.GLExcelFrom.id,
|
|
|
})
|
|
|
console.log(res);
|
|
|
if (res.code === 200) {
|
|
@@ -2035,11 +2000,25 @@ export default {
|
|
|
message: '关联清表成功',
|
|
|
})
|
|
|
this.GLExcel = false
|
|
|
+ this.GLExcelMD()
|
|
|
}
|
|
|
},
|
|
|
+ filterNode (value, data) {
|
|
|
+ console.log(value, data);
|
|
|
+ if (!value) return true;
|
|
|
+ return data.name.indexOf(value) !== -1;
|
|
|
+ },
|
|
|
//#endregion
|
|
|
+ adjustExcel () {//调整表单
|
|
|
+ this.$router.push('/ceshi/trees')
|
|
|
+ },
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ 'GLExcelFrom.search' (val) {
|
|
|
+ this.$refs.tree.filter(val);
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- }
|
|
|
};
|
|
|
</script>
|
|
|
|