生成汇总页面修改

main
wanglei 5 months ago
parent cef8e61bb9
commit eec581f332

@ -3,16 +3,15 @@
<div class="node-content"> <div class="node-content">
<el-input v-model="nodeData.hz_name" placeholder="请输入标题名称" style="width: 250px;" v-if="isRoot"/> <el-input v-model="nodeData.hz_name" 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.type===0"/>
<el-select v-model="nodeData.id" placeholder="请选择引用考核任务" v-if="nodeData.type===1">
<el-option <el-input placeholder="请选择引用考核任务" readonly v-if="nodeData.type===1" style="width: 250px;"
v-for="itemOpt in []" v-model="nodeData.pcTitle" @focus.stop="changeKaohe">
:key="itemOpt.value" <i slot="suffix" class="el-input__icon el-icon-search" style="color: #1890ff; font-weight: bolder"></i>
:label="itemOpt.label" </el-input>
:value="itemOpt.value">
</el-option>
</el-select>
<!--评分占比--> <!--评分占比-->
<el-input-number v-model="nodeData.zb" :precision="2" :step="0.01" :max="1" v-if="nodeData.type||nodeData.type===0"></el-input-number> <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||nodeData.type===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.type===0">子级标题</el-button>
@ -27,8 +26,10 @@
:node-data="child" :node-data="child"
@add-child="onAddChild" @add-child="onAddChild"
@remove-node="onRemoveNode" @remove-node="onRemoveNode"
@change-kaohe="onChangeKaohe"
></recursive-tree> ></recursive-tree>
</div> </div>
</div> </div>
</template> </template>
@ -46,6 +47,14 @@ export default {
} }
}, },
methods: { methods: {
//
changeKaohe(){
this.$emit('change-kaohe', this.nodeData)
},
//
onChangeKaohe(parentNode){
this.$emit('change-kaohe', parentNode)
},
addChild(type) { addChild(type) {
this.$emit('add-child', this.nodeData, type) this.$emit('add-child', this.nodeData, type)
}, },
@ -57,7 +66,7 @@ export default {
}, },
onRemoveNode(nodeToRemove) { onRemoveNode(nodeToRemove) {
this.$emit('remove-node', nodeToRemove) this.$emit('remove-node', nodeToRemove)
} },
} }
} }
</script> </script>

@ -97,34 +97,71 @@
/> />
<!-- 添加或修改生成汇总对话框 --> <!-- 添加或修改生成汇总对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="99%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <div style="min-height: 400px">
<el-form-item label="一级标题" prop="hzName"> <recursive-tree
<el-input v-model="form.hzName" placeholder="请输入一级标题" /> style="margin-left: 0px"
</el-form-item> :node-data="treeData"
<el-form-item label="表头" prop="tableHeader"> :is-root="true"
<el-input v-model="form.tableHeader" type="textarea" placeholder="请输入内容" /> @add-child="handleAddChild"
</el-form-item> @remove-node="handleRemoveNode"
<el-form-item label="表数据" prop="tableData"> @change-kaohe="changeKaoHe"
<el-input v-model="form.tableData" type="textarea" placeholder="请输入内容" /> ></recursive-tree>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 选择引用考核任务信息 -->
<el-dialog title="引用考核任务选择" :visible.sync="khrw.open" width="900px">
<div>
<el-form :model="khrw.queryParams" :inline="true" label-width="100px">
<el-form-item label="考核任务名称" prop="pcTitle" style="margin-bottom: 10px">
<el-input
v-model="khrw.queryParams.pcTitle"
placeholder="请输入考核任务名称"
clearable
@keyup.enter.native="khrwQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item style="margin-bottom: 10px">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-button type="primary" icon="el-icon-search" size="small" @click="khrwQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table border v-loading="khrw.loading" :data="khrw.list" @row-dblclick="khrwRowChange">
<el-table-column label="主键" align="center" prop="id" width="60px"/>
<el-table-column label="考核任务名称" align="center" prop="pcTitle" min-width="150" :show-overflow-tooltip="true"/>
<el-table-column label="考核任务描述" align="center" prop="pcDescription" min-width="150" :show-overflow-tooltip="true"/>
<el-table-column label="模板名称" align="center" prop="templateName" min-width="120" :show-overflow-tooltip="true"/>
<el-table-column label="考核任务备注" align="center" prop="remark" min-width="150" :show-overflow-tooltip="true"/>
</el-table>
<pagination
v-show="khrw.total>0"
:total="khrw.total"
:page.sync="khrw.queryParams.pageNum"
:limit.sync="khrw.queryParams.pageSize"
@pagination="khrwQuery"
/>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button @click="khrwCancel"> </el-button>
<el-button @click="cancel"> </el-button> </div>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listGather, getGather, delGather, addGather, updateGather } from "@/api/kaohe/gather" import { listGather, getGather, delGather, addGather, updateGather } from "@/api/kaohe/gather"
import { listPingce } from "@/api/kaohe/pingce"
import TableColumn from '@/components/TableColumn'
import RecursiveTree from '@/components/RecursiveTree'
export default { export default {
name: "Gather", name: "Gather",
components: { TableColumn, RecursiveTree },
data() { data() {
return { return {
// //
@ -145,19 +182,34 @@ export default {
title: "", title: "",
// //
open: false, open: false,
treeData: {
hz_name: '',
data: []
},
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
hzName: null, hzName: null
tableHeader: null, },
tableData: null, /** 选择引用考核任务*/
khrw: {
parentNode: null,
//
open: false,
//
loading: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
pcTitle: null,
},
//
list: [],
//
total: 0,
}, },
//
form: {},
//
rules: {
}
} }
}, },
created() { created() {
@ -180,18 +232,10 @@ export default {
}, },
// //
reset() { reset() {
this.form = { this.treeData = {
id: null, hz_name: '',
hzName: null, data: []
tableHeader: null,
tableData: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
} }
this.resetForm("form")
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
@ -211,7 +255,7 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset() this.reset();
this.open = true this.open = true
this.title = "添加生成汇总" this.title = "添加生成汇总"
}, },
@ -227,7 +271,8 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { console.log(this.treeData);
/*this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
updateGather(this.form).then(response => { updateGather(this.form).then(response => {
@ -243,7 +288,7 @@ export default {
}) })
} }
} }
}) })*/
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
@ -260,7 +305,58 @@ export default {
this.download('kaohe/gather/export', { this.download('kaohe/gather/export', {
...this.queryParams ...this.queryParams
}, `gather_${new Date().getTime()}.xlsx`) }, `gather_${new Date().getTime()}.xlsx`)
},
handleAddChild(parentNode,type) {
if (!parentNode.data) {
this.$set(parentNode, 'data', [])
} }
parentNode.data.push({
type: type,
title: null,
id: null,
zb: null,
pcTitle: null,
data: []
})
},
handleRemoveNode(nodeToRemove) {
const removeNode = (parent, node) => {
if (parent.data) {
const index = parent.data.indexOf(node)
if (index !== -1) {
parent.data.splice(index, 1)
} else {
parent.data.forEach(child => removeNode(child, node))
}
}
}
removeNode(this.treeData, nodeToRemove)
},
changeKaoHe(parentNode){
this.khrw.parentNode = parentNode;
this.khrw.open = true;
this.khrw.queryParams.pageNum = 1;
this.khrwQuery();
},
/** 引用考核任务信息列表查询 */
khrwQuery() {
this.khrw.loading = true;
listPingce(this.khrw.queryParams).then(response => {
this.khrw.list = response.rows;
this.khrw.total = response.total;
this.khrw.loading = false;
});
},
/** 引用考核任务信息选择弹出框关闭*/
khrwCancel() {
this.khrw.open = false
},
//
khrwRowChange(row) {
this.khrw.parentNode.id = row.id;
this.khrw.parentNode.pcTitle = row.pcTitle;
this.khrw.open = false;
},
} }
} }
</script> </script>

@ -1,6 +1,5 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<recursive-tree <recursive-tree
style="margin-left: 0px" style="margin-left: 0px"
:node-data="treeData" :node-data="treeData"
@ -8,7 +7,6 @@
@add-child="handleAddChild" @add-child="handleAddChild"
@remove-node="handleRemoveNode" @remove-node="handleRemoveNode"
></recursive-tree> ></recursive-tree>
<div style="padding: 20px 0;"> <div style="padding: 20px 0;">
<el-button type="primary" @click="schzbgFun"></el-button> <el-button type="primary" @click="schzbgFun"></el-button>
</div> </div>

Loading…
Cancel
Save