|
|
|
|
@ -105,7 +105,7 @@
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改生成汇总对话框 -->
|
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="99%" append-to-body>
|
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="99%" append-to-body top="15px !important">
|
|
|
|
|
<div style="min-height: 400px">
|
|
|
|
|
<recursive-tree
|
|
|
|
|
style="margin-left: 0px"
|
|
|
|
|
@ -211,8 +211,9 @@ export default {
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
treeData: {
|
|
|
|
|
hz_name: '',
|
|
|
|
|
data: []
|
|
|
|
|
title: '',
|
|
|
|
|
data: [],
|
|
|
|
|
code: '根',
|
|
|
|
|
},
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
@ -262,7 +263,8 @@ export default {
|
|
|
|
|
reset() {
|
|
|
|
|
this.treeData = {
|
|
|
|
|
title: '',
|
|
|
|
|
data: []
|
|
|
|
|
data: [],
|
|
|
|
|
code: '根',
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
@ -299,28 +301,105 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitForm() {
|
|
|
|
|
let obj={flag: true}
|
|
|
|
|
if(this.treeData.title===''||this.treeData.title===null){
|
|
|
|
|
obj.flag = false;
|
|
|
|
|
this.$alert(`【根】标题不能为空!`, `提示`, {
|
|
|
|
|
type: 'Danger'
|
|
|
|
|
})
|
|
|
|
|
} else if(this.treeData.data && this.treeData.data.length<1 ){
|
|
|
|
|
obj.flag = false;
|
|
|
|
|
this.$alert(`【根】级节点的子级不能为空,请添加子级节点!`, `提示`, {
|
|
|
|
|
type: 'Danger'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if(this.treeData.data && this.treeData.data.length>0){
|
|
|
|
|
let list = this.treeData.data;
|
|
|
|
|
let sumZb = 0
|
|
|
|
|
for (let i=0; i<list.length; i++){
|
|
|
|
|
if(list[i].zb){
|
|
|
|
|
sumZb += list[i].zb
|
|
|
|
|
}
|
|
|
|
|
if(list[i].type1==='0' && (list[i].title==='' || list[i].title===null) ){
|
|
|
|
|
this.$alert(`【${list[i].code}】标题不能为空`, `提示`, {
|
|
|
|
|
type: 'Danger'
|
|
|
|
|
})
|
|
|
|
|
obj.flag = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if(list[i].type1!=='0' && (list[i].title==='' || list[i].title===null) ){
|
|
|
|
|
this.$alert(`【${list[i].code}】引用考核任务不能为空`, `提示`, {
|
|
|
|
|
type: 'Danger'
|
|
|
|
|
})
|
|
|
|
|
obj.flag = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if(list[i].data && list[i].data.length < 1){
|
|
|
|
|
this.$alert(`【${list[i].code}】的子级不能为空,请添加子级节点!`, `提示`, {
|
|
|
|
|
type: 'Danger'
|
|
|
|
|
})
|
|
|
|
|
obj.flag = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if(i===(list.length-1) && sumZb!==1){
|
|
|
|
|
this.$alert(`【根】评分占比合计不等于1,请检查修改!`, `提示`, {
|
|
|
|
|
type: 'Danger'
|
|
|
|
|
})
|
|
|
|
|
obj.flag = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if(list[i].data && list[i].data.length > 0){
|
|
|
|
|
this.msgFun(list[i].data,list[i].code,obj);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(obj.flag){
|
|
|
|
|
addGather(JSON.stringify(this.treeData)).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功")
|
|
|
|
|
this.open = false
|
|
|
|
|
this.getList();
|
|
|
|
|
})
|
|
|
|
|
/*this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.form.id != null) {
|
|
|
|
|
updateGather(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功")
|
|
|
|
|
this.open = false
|
|
|
|
|
this.getList()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
msgFun(children, pNodeName, objFlag){
|
|
|
|
|
let list = children;
|
|
|
|
|
let sumZb = 0
|
|
|
|
|
for (let i=0; i<list.length; i++) {
|
|
|
|
|
if (list[i].zb) {
|
|
|
|
|
sumZb += list[i].zb
|
|
|
|
|
}
|
|
|
|
|
if (list[i].type1 === '0' && (list[i].title === '' || list[i].title === null)) {
|
|
|
|
|
this.$alert(`【${list[i].code}】标题不能为空`, `提示`, {
|
|
|
|
|
type: 'Danger'
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
addGather(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功")
|
|
|
|
|
this.open = false
|
|
|
|
|
this.getList()
|
|
|
|
|
objFlag.flag = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (list[i].type1 !== '0' && (list[i].title === '' || list[i].title === null)) {
|
|
|
|
|
this.$alert(`【${list[i].code}】引用考核任务不能为空`, `提示`, {
|
|
|
|
|
type: 'Danger'
|
|
|
|
|
})
|
|
|
|
|
objFlag.flag = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (list[i].data && list[i].data.length < 1) {
|
|
|
|
|
this.$alert(`【${list[i].code}】的子级不能为空,请添加子级节点!`, `提示`, {
|
|
|
|
|
type: 'Danger'
|
|
|
|
|
})
|
|
|
|
|
objFlag.flag = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (i === (list.length - 1) && sumZb !== 1) {
|
|
|
|
|
this.$alert(`【${ pNodeName }】评分占比合计不等于1,请检查修改!`, `提示`, {
|
|
|
|
|
type: 'Danger'
|
|
|
|
|
})
|
|
|
|
|
objFlag.flag = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if(list[i].data && list[i].data.length > 0){
|
|
|
|
|
this.msgFun(list[i].data,list[i].code, objFlag);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})*/
|
|
|
|
|
},
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
@ -342,8 +421,11 @@ export default {
|
|
|
|
|
if (!parentNode.data) {
|
|
|
|
|
this.$set(parentNode, 'data', [])
|
|
|
|
|
}
|
|
|
|
|
let code = 'N' + new Date().getTime();
|
|
|
|
|
|
|
|
|
|
if(type1==='0'){
|
|
|
|
|
parentNode.data.push({
|
|
|
|
|
code: code,
|
|
|
|
|
type1: type1,
|
|
|
|
|
type: '0',
|
|
|
|
|
title: null,
|
|
|
|
|
@ -355,6 +437,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
if(type1==='1'){
|
|
|
|
|
parentNode.data.push({
|
|
|
|
|
code: code,
|
|
|
|
|
type1: type1,
|
|
|
|
|
type: '1',
|
|
|
|
|
title: null,
|
|
|
|
|
@ -365,6 +448,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
if(type1==='2'){
|
|
|
|
|
parentNode.data.push({
|
|
|
|
|
code: code,
|
|
|
|
|
type1: type1,
|
|
|
|
|
type: '1',
|
|
|
|
|
title: null,
|
|
|
|
|
@ -435,8 +519,6 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.khdf.tableHeader = btTabelTree;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 递归函数 设置prop参数
|
|
|
|
|
|