页面修改

main
wanglei 5 months ago
parent a61f54f681
commit e73a76a266

@ -18,7 +18,7 @@ export function getGather(id) {
} }
// 新增生成汇总 // 新增生成汇总
export function addGather(data) { export function addGather1(data) {
return request({ return request({
url: '/kaohe/gather', url: '/kaohe/gather',
method: 'post', method: 'post',
@ -26,6 +26,15 @@ export function addGather(data) {
}) })
} }
// 新增生成汇总
export function addGather(data) {
return request({
url: '/kaohe/gather/generateSum',
method: 'post',
data: data
})
}
// 修改生成汇总 // 修改生成汇总
export function updateGather(data) { export function updateGather(data) {
return request({ return request({

@ -2,23 +2,23 @@
<div class="tree-node"> <div class="tree-node">
<div class="node-content"> <div class="node-content">
<el-input v-model="nodeData.title" placeholder="请输入标题名称" style="width: 250px;" v-if="isRoot"/> <el-input v-model="nodeData.title" placeholder="请输入标题名称" style="width: 250px;" v-if="isRoot"/>
<el-input v-model="nodeData.title" placeholder="请输入标题名称" style="width: 250px;" v-if="nodeData.type===0"/> <el-input v-model="nodeData.title" placeholder="请输入标题名称" style="width: 250px;" v-if="nodeData.type1==='0'"/>
<el-input placeholder="请选择引用考核任务" readonly v-if="nodeData.type===1||nodeData.type===2" style="width: 250px;" <el-input placeholder="请选择引用考核任务" readonly v-if="nodeData.type1==='1'||nodeData.type1==='2'" style="width: 250px;"
v-model="nodeData.pcTitle" @focus.stop="changeKaohe"> v-model="nodeData.pcTitle" @focus.stop="changeKaohe">
<i slot="suffix" class="el-input__icon el-icon-search" style="color: #1890ff; font-weight: bolder"></i> <i slot="suffix" class="el-input__icon el-icon-search" style="color: #1890ff; font-weight: bolder"></i>
</el-input> </el-input>
<!--评分占比--> <!--评分占比-->
<el-input-number style="margin-left: 5px;" v-model="nodeData.zb" :precision="2" :step="0.01" :min="0.01" <el-input-number style="margin-left: 5px;" v-model="nodeData.zb" :precision="2" :step="0.01" :min="0.01"
:max="1" v-if="nodeData.type===1||nodeData.type===0"></el-input-number> :max="1" v-if="nodeData.type1==='1'||nodeData.type1==='0'"></el-input-number>
<el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addChild(0)" <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addChild('0')"
v-if="isRoot||nodeData.type===0">标题</el-button> v-if="isRoot||nodeData.type1==='0'">标题</el-button>
<el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addChild(1)" <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addChild('1')"
v-if="isRoot||nodeData.type===0">占比引用</el-button> v-if="isRoot||nodeData.type1==='0'">占比引用</el-button>
<el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addChild(2)" <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addChild('2')"
v-if="isRoot||nodeData.type===0">不占比引用</el-button> v-if="isRoot||nodeData.type1==='0'">不占比引用</el-button>
<el-button type="danger" icon="el-icon-delete" size="mini" @click.stop="removeNode" v-if="!isRoot"></el-button> <el-button type="danger" icon="el-icon-delete" size="mini" @click.stop="removeNode" v-if="!isRoot"></el-button>
</div> </div>
<div class="children" v-if="nodeData.data && nodeData.data.length"> <div class="children" v-if="nodeData.data && nodeData.data.length">
@ -57,14 +57,14 @@ export default {
onChangeKaohe(parentNode){ onChangeKaohe(parentNode){
this.$emit('change-kaohe', parentNode) this.$emit('change-kaohe', parentNode)
}, },
addChild(type) { addChild(type1) {
this.$emit('add-child', this.nodeData, type) this.$emit('add-child', this.nodeData, type1)
}, },
removeNode() { removeNode() {
this.$emit('remove-node', this.nodeData) this.$emit('remove-node', this.nodeData)
}, },
onAddChild(parentNode, type) { onAddChild(parentNode, type1) {
this.$emit('add-child', parentNode, type) this.$emit('add-child', parentNode, type1)
}, },
onRemoveNode(nodeToRemove) { onRemoveNode(nodeToRemove) {
this.$emit('remove-node', nodeToRemove) this.$emit('remove-node', nodeToRemove)

@ -26,7 +26,7 @@
v-hasPermi="['kaohe:gather:add']" v-hasPermi="['kaohe:gather:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="success" type="success"
plain plain
@ -36,7 +36,7 @@
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['kaohe:gather:edit']" v-hasPermi="['kaohe:gather:edit']"
>修改</el-button> >修改</el-button>
</el-col> </el-col>-->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="danger" type="danger"
@ -64,19 +64,27 @@
<el-table v-loading="loading" :data="gatherList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="gatherList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" /> <el-table-column label="主键" align="center" prop="id" />
<el-table-column label="一级标题" align="center" prop="hzName" /> <el-table-column label="一级标题" align="center" prop="hzName" min-width="200" :show-overflow-tooltip="true"/>
<el-table-column label="表头" align="center" prop="tableHeader" /> <el-table-column label="表头" align="center" prop="tableHeader" min-width="200" :show-overflow-tooltip="true"/>
<el-table-column label="表数据" align="center" prop="tableData" /> <el-table-column label="表数据" align="center" prop="tableData" min-width="200" :show-overflow-tooltip="true"/>
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" min-width="200" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <!-- <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['kaohe:gather:edit']" v-hasPermi="['kaohe:gather:edit']"
>修改</el-button> >修改</el-button>-->
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="viewKaoHeScore(scope.row)"
v-hasPermi="['kaohe:gather:query']"
>查看生成汇总
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -150,6 +158,20 @@
</div> </div>
</el-dialog> </el-dialog>
<!--查看生成汇总-->
<el-dialog title="查看生成汇总" :visible.sync="khdf.open" width="90%" top="20px !important">
<el-table border :data="khdf.list" height="650px">
<template v-for="column in khdf.tableHeader">
<table-column :key="column.label" :column="column" />
</template>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="khdf.open=false"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -164,6 +186,12 @@ export default {
components: { TableColumn, RecursiveTree }, components: { TableColumn, RecursiveTree },
data() { data() {
return { return {
//
khdf:{
open: false,
list: [],
tableHeader: []
},
// //
loading: true, loading: true,
// //
@ -271,7 +299,11 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
console.log(this.treeData); addGather(JSON.stringify(this.treeData)).then(response => {
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList();
})
/*this.$refs["form"].validate(valid => { /*this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
@ -306,18 +338,41 @@ export default {
...this.queryParams ...this.queryParams
}, `gather_${new Date().getTime()}.xlsx`) }, `gather_${new Date().getTime()}.xlsx`)
}, },
handleAddChild(parentNode,type) { handleAddChild(parentNode,type1) {
if (!parentNode.data) { if (!parentNode.data) {
this.$set(parentNode, 'data', []) this.$set(parentNode, 'data', [])
} }
parentNode.data.push({ if(type1==='0'){
type: type, parentNode.data.push({
title: null, type1: type1,
id: null, type: '0',
zb: null, title: null,
pcTitle: null, id: null,
data: [] zb: null,
}) pcTitle: null,
data: []
})
}
if(type1==='1'){
parentNode.data.push({
type1: type1,
type: '1',
title: null,
id: null,
zb: null,
pcTitle: null
})
}
if(type1==='2'){
parentNode.data.push({
type1: type1,
type: '1',
title: null,
id: null,
pcTitle: null
})
}
}, },
handleRemoveNode(nodeToRemove) { handleRemoveNode(nodeToRemove) {
const removeNode = (parent, node) => { const removeNode = (parent, node) => {
@ -354,9 +409,43 @@ export default {
// //
khrwRowChange(row) { khrwRowChange(row) {
this.khrw.parentNode.id = row.id; this.khrw.parentNode.id = row.id;
this.khrw.parentNode.title = row.pcTitle;
this.khrw.parentNode.pcTitle = row.pcTitle; this.khrw.parentNode.pcTitle = row.pcTitle;
this.khrw.open = false; this.khrw.open = false;
}, },
//
viewKaoHeScore(row){
this.khdf.list = [];
this.khdf.tableHeader = [];
this.khdf.open = true;
this.reset()
getGather(row.id).then(response => {
this.khdf.list = JSON.parse(response.data.tableData);
let btTabelTree = JSON.parse(response.data.tableHeader);
btTabelTree.forEach(item => {
item.prop = item.name;
if(item.children && item.children.length>0){
this.setProp(item.children, item.prop)
}
})
this.khdf.tableHeader = btTabelTree;
console.log(this.khdf.tableHeader, this.khdf.list);
})
},
// prop
setProp(list, prop){
list.forEach(item=>{
if(prop){
item.prop = prop+'.'+item.name;
}else {
item.prop = item.name;
}
if(item.children && item.children.length>0){
this.setProp(item.children, item.prop)
}
})
},
} }
} }
</script> </script>

Loading…
Cancel
Save