|
@@ -39,7 +39,7 @@
|
|
|
popTitle : any = ''
|
|
|
radio : any = 0
|
|
|
dialogFormVisible : boolean = false
|
|
|
- parentIds: any = '';
|
|
|
+ parentId : any = '';
|
|
|
treeConfig = {
|
|
|
attr: {
|
|
|
retConfig: {
|
|
@@ -120,13 +120,13 @@
|
|
|
width: 300,
|
|
|
title: '备注',
|
|
|
field: 'remark',
|
|
|
- },
|
|
|
+ },
|
|
|
{
|
|
|
width: 80,
|
|
|
title: '状态',
|
|
|
field: 'status',
|
|
|
component: Assembly,
|
|
|
- },
|
|
|
+ },
|
|
|
{
|
|
|
width: 120,
|
|
|
title: '操作',
|
|
@@ -151,6 +151,9 @@
|
|
|
attr: {
|
|
|
size: 'small',
|
|
|
rules: {
|
|
|
+ parentName: [{
|
|
|
+ required: true, message: '请输入父级', trigger: 'blur'
|
|
|
+ }],
|
|
|
name: [{
|
|
|
required: true, message: '请输入名称', trigger: 'blur'
|
|
|
}],
|
|
@@ -158,6 +161,27 @@
|
|
|
},
|
|
|
columns: [
|
|
|
[
|
|
|
+ {
|
|
|
+ span: 23,
|
|
|
+ label: '父级',
|
|
|
+ labelWidth: '70px',
|
|
|
+ prop: 'parentName',
|
|
|
+ component: 'select-tree',
|
|
|
+ compConfig: {
|
|
|
+ attr: {
|
|
|
+ label: 'name',
|
|
|
+ clearable: true,
|
|
|
+ retConfig: {
|
|
|
+ parentId: 'id',
|
|
|
+ parentName: 'name',
|
|
|
+ },
|
|
|
+ defaultExpandAll: true
|
|
|
+ },
|
|
|
+ request: {
|
|
|
+ url: '/maindata/maindataOrganizationCategory/treeUseList'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
{
|
|
|
span: 23,
|
|
|
labelWidth: '70px',
|
|
@@ -205,6 +229,7 @@
|
|
|
} else {
|
|
|
data.parentId = e.id;
|
|
|
};
|
|
|
+ this.parentId = e.id;
|
|
|
api.childrenTreeList(data, 'maindataOrganizationCategory').then((res : any) => {
|
|
|
if (res.code === 200) {
|
|
|
(this.$refs.moduleView as any).setTableValue(res.data.records);
|
|
@@ -254,6 +279,10 @@
|
|
|
}
|
|
|
clearInterval(this.timer)
|
|
|
let query = (this.$refs.moduleView as any).getQuery();
|
|
|
+ if (this.parentId) query.parentId = this.parentId;
|
|
|
+ this.getPageList(query)
|
|
|
+ }
|
|
|
+ getPageList(query : any) {
|
|
|
api.pageList(query, 'maindataOrganizationCategory').then((res : any) => {
|
|
|
if (res.code === 200) {
|
|
|
(this.$refs.moduleView as any).setTableValue(res.data.records);
|
|
@@ -283,13 +312,24 @@
|
|
|
}
|
|
|
// 打开编辑
|
|
|
openEdit(e : any) {
|
|
|
- console.log(e);
|
|
|
this.popTitle = '编辑'
|
|
|
- this.dialogFormVisible = true;
|
|
|
- this.radio = e.status
|
|
|
- setTimeout(() => {
|
|
|
- if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue(e);
|
|
|
- }, 0)
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
|
+ api.single({ id: e.id }, 'maindataOrganizationCategory').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ let data = res.data;
|
|
|
+ this.radio = res.data.status;
|
|
|
+ api.single({ id: res.data.parentId }, 'maindataOrganizationCategory').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ data.parentName = res.data.name;
|
|
|
+ loading.close();
|
|
|
+ this.dialogFormVisible = true;
|
|
|
+ setTimeout(() => {
|
|
|
+ if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue(data);
|
|
|
+ }, 0)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
// 工具栏删除
|
|
|
onDelete() {
|
|
@@ -337,20 +377,12 @@
|
|
|
}
|
|
|
// 刷新
|
|
|
onRefresh() {
|
|
|
- this.loading = this.$loading({ target: '.main-container' });
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
|
(this as any).$refs.moduleView.clearSearch();
|
|
|
- api.pageList({}, 'maindataOrganizationCategory').then((res : any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- (this.$refs.moduleView as any).setTableValue(res.data.records);
|
|
|
- let page = {
|
|
|
- pageNo: res.data.current, //当前页
|
|
|
- pageSize: res.data.size, //每页条数
|
|
|
- total: res.data.total //总条数
|
|
|
- };
|
|
|
- (this.$refs.moduleView as any).setPage(page);
|
|
|
- this.loading.close();
|
|
|
- } else this.$message.error(res.msg);
|
|
|
- })
|
|
|
+ this.parentId = '';
|
|
|
+ (this as any).$refs.sideTree.request();
|
|
|
+ this.getPageList({});
|
|
|
+ loading.close();
|
|
|
}
|
|
|
//导出
|
|
|
onExport() {
|