|
@@ -298,14 +298,16 @@
|
|
<!-- 关联清表 -->
|
|
<!-- 关联清表 -->
|
|
<el-dialog
|
|
<el-dialog
|
|
title="关联清表"
|
|
title="关联清表"
|
|
|
|
+ class="excelBox"
|
|
:visible.sync="GLExcel"
|
|
:visible.sync="GLExcel"
|
|
- width="30%"
|
|
|
|
|
|
+ width="500px"
|
|
modal-append-to-body
|
|
modal-append-to-body
|
|
append-to-body
|
|
append-to-body
|
|
:before-close="GLExcelMD"
|
|
:before-close="GLExcelMD"
|
|
>
|
|
>
|
|
<div>
|
|
<div>
|
|
<el-select
|
|
<el-select
|
|
|
|
+ style="width:400px;"
|
|
v-model="GLExcelFrom.name"
|
|
v-model="GLExcelFrom.name"
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
@change="changetherr()"
|
|
@change="changetherr()"
|
|
@@ -318,17 +320,24 @@
|
|
>
|
|
>
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
- <el-scrollbar>
|
|
|
|
|
|
+ <el-scrollbar style="margin-top:20px;height:50vh;">
|
|
<el-input
|
|
<el-input
|
|
- v-model="GLExcelFrom.search"
|
|
|
|
|
|
+ style="width:400px;"
|
|
|
|
+ v-model.trim="GLExcelFrom.search"
|
|
|
|
+ @input="searchInput"
|
|
placeholder="请输入需要选择的内容"
|
|
placeholder="请输入需要选择的内容"
|
|
></el-input>
|
|
></el-input>
|
|
<el-tree
|
|
<el-tree
|
|
|
|
+ style="margin-top:10px;"
|
|
:props="GLExcelProps"
|
|
:props="GLExcelProps"
|
|
:load="loadNodess"
|
|
:load="loadNodess"
|
|
lazy
|
|
lazy
|
|
:data="exceldata"
|
|
:data="exceldata"
|
|
|
|
+ node-key="id"
|
|
|
|
+ :default-checked-keys="xuanzhong"
|
|
|
|
+ accordion
|
|
show-checkbox
|
|
show-checkbox
|
|
|
|
+ @check-change="checkchange"
|
|
>
|
|
>
|
|
</el-tree>
|
|
</el-tree>
|
|
</el-scrollbar>
|
|
</el-scrollbar>
|
|
@@ -336,11 +345,13 @@
|
|
<span
|
|
<span
|
|
slot="footer"
|
|
slot="footer"
|
|
class="dialog-footer"
|
|
class="dialog-footer"
|
|
|
|
+ style="display: flex;justify-content: center;align-items: center;"
|
|
>
|
|
>
|
|
- <el-button @click="GLExcel = false">取 消</el-button>
|
|
|
|
|
|
+ <el-button @click="GLExcelMD()">取 消</el-button>
|
|
<el-button
|
|
<el-button
|
|
|
|
+ style="margin-left:30px;"
|
|
type="primary"
|
|
type="primary"
|
|
- @click="GLExcel = false"
|
|
|
|
|
|
+ @click="saveLinkTab"
|
|
>确 定</el-button>
|
|
>确 定</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -1243,7 +1254,7 @@ import { findProjectTree as getAlltree } from "@/api/manager/projectinfo";
|
|
import { getList as getAttchFromOriginalName } from "@/api/resource/attach";
|
|
import { getList as getAttchFromOriginalName } from "@/api/resource/attach";
|
|
import { getDictionary } from "@/api/system/dict";
|
|
import { getDictionary } from "@/api/system/dict";
|
|
import { mapGetters } from "vuex";
|
|
import { mapGetters } from "vuex";
|
|
-import { getList, tabLazytreeAll } from '@/api/exctab/excelmodel'
|
|
|
|
|
|
+import { getList, tabLazytreeAll, saveLinkTab } from '@/api/exctab/excelmodel'
|
|
export default {
|
|
export default {
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
@@ -1251,6 +1262,7 @@ export default {
|
|
loading: false,
|
|
loading: false,
|
|
GLExcel: false,
|
|
GLExcel: false,
|
|
GLExcelFrom: {
|
|
GLExcelFrom: {
|
|
|
|
+ id: "",
|
|
name: '',
|
|
name: '',
|
|
search: '',//搜素框舒服的值
|
|
search: '',//搜素框舒服的值
|
|
},
|
|
},
|
|
@@ -1258,8 +1270,9 @@ export default {
|
|
GLExcelProps: {
|
|
GLExcelProps: {
|
|
label: 'name',
|
|
label: 'name',
|
|
children: 'children',
|
|
children: 'children',
|
|
- isLeaf: 'childrenlength'
|
|
|
|
|
|
+ isLeaf: 'hasChildren',
|
|
},
|
|
},
|
|
|
|
+ xuanzhong: [],//选中值得ID
|
|
exceldata: [],//清表模板
|
|
exceldata: [],//清表模板
|
|
//#endregion
|
|
//#endregion
|
|
|
|
|
|
@@ -1388,7 +1401,7 @@ export default {
|
|
}
|
|
}
|
|
this.curTreeData = data;
|
|
this.curTreeData = data;
|
|
this.curTreeData.parentName = parentName;
|
|
this.curTreeData.parentName = parentName;
|
|
- getDetail(data.id,this.id,this.projectid).then((res) => {
|
|
|
|
|
|
+ getDetail(data.id, this.id, this.projectid).then((res) => {
|
|
res.data.data.parentName = parentName;
|
|
res.data.data.parentName = parentName;
|
|
this.tableData = [res.data.data];
|
|
this.tableData = [res.data.data];
|
|
this.nodeDetail = Object.assign({}, res.data.data);
|
|
this.nodeDetail = Object.assign({}, res.data.data);
|
|
@@ -1447,7 +1460,7 @@ export default {
|
|
this.editType = type;
|
|
this.editType = type;
|
|
}
|
|
}
|
|
|
|
|
|
- getDetail(data.id,this.id,this.projectid).then((res) => {
|
|
|
|
|
|
+ getDetail(data.id, this.id, this.projectid).then((res) => {
|
|
let parentName = '';
|
|
let parentName = '';
|
|
if (node.parent.data) {
|
|
if (node.parent.data) {
|
|
parentName = node.parent.data.title;
|
|
parentName = node.parent.data.title;
|
|
@@ -1458,7 +1471,7 @@ export default {
|
|
this.nodeDetail = {
|
|
this.nodeDetail = {
|
|
parentId: res.data.data.id,
|
|
parentId: res.data.data.id,
|
|
parentName: parentName,
|
|
parentName: parentName,
|
|
- projectId:res.data.data.projectId
|
|
|
|
|
|
+ projectId: res.data.data.projectId
|
|
};
|
|
};
|
|
} else {
|
|
} else {
|
|
this.nodeDetail = Object.assign({}, res.data.data);
|
|
this.nodeDetail = Object.assign({}, res.data.data);
|
|
@@ -1943,28 +1956,86 @@ export default {
|
|
})
|
|
})
|
|
console.log(res);
|
|
console.log(res);
|
|
if (res.code === 200 && res.msg === '操作成功') {
|
|
if (res.code === 200 && res.msg === '操作成功') {
|
|
|
|
+ res.data.forEach(val => {
|
|
|
|
+ if (val.hasChildren) {
|
|
|
|
+ val.disabled = false
|
|
|
|
+ } else {
|
|
|
|
+ val.disabled = true
|
|
|
|
+ }
|
|
|
|
+ })
|
|
this.exceldata = res.data
|
|
this.exceldata = res.data
|
|
}
|
|
}
|
|
},
|
|
},
|
|
Associationlist (scope) {//关联清表点击事件
|
|
Associationlist (scope) {//关联清表点击事件
|
|
|
|
+ console.log(scope.row);
|
|
this.GLExcel = true
|
|
this.GLExcel = true
|
|
this.getList({
|
|
this.getList({
|
|
current: 1,
|
|
current: 1,
|
|
size: 100000,
|
|
size: 100000,
|
|
parentId: 0
|
|
parentId: 0
|
|
})
|
|
})
|
|
|
|
+ this.GLExcelFrom.id = scope.row.id
|
|
},
|
|
},
|
|
changetherr () {//清表类型选择框change事件
|
|
changetherr () {//清表类型选择框change事件
|
|
- if (this.GLExcelFrom.name) {
|
|
|
|
|
|
+ if (this.GLExcelFrom.name != "") {
|
|
this.GLExcelFrom.search = ''
|
|
this.GLExcelFrom.search = ''
|
|
this.tabLazytreeAll()
|
|
this.tabLazytreeAll()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
GLExcelMD () {//弹框关闭事件
|
|
GLExcelMD () {//弹框关闭事件
|
|
-
|
|
|
|
|
|
+ this.GLExcelFrom.name = ""
|
|
|
|
+ this.GLExcelFrom.search = ''
|
|
|
|
+ this.GLExcelFrom.id
|
|
|
|
+ this.xuanzhong = []
|
|
|
|
+ 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)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- loadNodess (node, resolve) {//check事件
|
|
|
|
- console.log(node, resolve);
|
|
|
|
|
|
+ checkchange (data, checked,) {//节点选中回调
|
|
|
|
+ if (checked) {
|
|
|
|
+ this.xuanzhong = [data.id]
|
|
|
|
+ } else {
|
|
|
|
+ this.xuanzhong = []
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ searchInput () {//输入回调
|
|
|
|
+ window.clearTimeout(setTimeout22)
|
|
|
|
+ setTimeout22 = window.setTimeout(() => {
|
|
|
|
+ this.tabLazytreeAll()
|
|
|
|
+ }, 500)
|
|
|
|
+ },
|
|
|
|
+ async saveLinkTab () {
|
|
|
|
+ const { data: res } = await saveLinkTab({
|
|
|
|
+ exceTabId: this.GLExcelFrom.id,
|
|
|
|
+ tabId: this.xuanzhong[0]
|
|
|
|
+ })
|
|
|
|
+ console.log(res);
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: '关联清表成功',
|
|
|
|
+ })
|
|
|
|
+ this.GLExcel = false
|
|
|
|
+ }
|
|
},
|
|
},
|
|
//#endregion
|
|
//#endregion
|
|
|
|
|
|
@@ -1998,4 +2069,9 @@ export default {
|
|
display: block;
|
|
display: block;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+.excelBox {
|
|
|
|
+ /deep/.el-dialog__body {
|
|
|
|
+ padding: 20px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|