Commit 31d2ffd8 authored by 李苏's avatar 李苏 💬

执行进度,图标

parent 62781892
import request from 'common/src/utils/request'
/* query */
export function doQuery(query) {
return request({
url: 'hafms/yszxjdlog/query',
method: 'post',
data: query||{}
})
}
export function doDelete(query) {
return request({
url: '/hafms/yszxjdlog/delete',
method: 'post',
data: query||{}
})
}
export function doQueryDetail(query){
return request({
url:'hafms/yszxjdlog/queryDetail',
method: 'post',
data: query||{}
})
}
......@@ -253,6 +253,19 @@ export const powerRoutes=[
},
name:'hyha',
path:"hyha"
},
{
component:'sbysjsp/yszxjd/index',
hidden:false,
meta:{
"title": "预算执行进度",
"icon": "",
"noCache": false,
"link": null,
"mkid": 901030520,
},
name:'yszxjd',
path:"yszxjd"
}
......@@ -332,6 +345,19 @@ export const powerRoutes=[
path:"szkb"
},
// {
// component:'hzcxbb/render/index',
// hidden:false,
// meta:{
// "title": "render",
// "icon": "",
// "noCache": false,
// "link": null,
// "mkid":'test',
// },
// name:'render',
// path:"render"
// },
// {
// component:'hzcxbb/ysspzl/index',
// hidden:false,
// meta:{
......
<script>
import Templage from './template.js';
export default{
mounted() {
/* 函数式编程*/
},
data() {
return{
isdo:true
}
},
methods:{
doSave(){
}
},
render(h){
let render=new Templage('div')
render.$addAttr('do','isdo').$addEvent('save','doSave').addTag('span').addAttr('class','spanclass')
let vd=render.get()
return vd
}
}
</script>
<style>
</style>
/* string 模板编写函数 */
export default class templage {
constructor(tag) {
let tagObg = {
tagName: tag,
children: [],
attr: [],
$attr: [],
event: [],
$event: []
}
this.getTagObg = function() {
return tagObg;
};
}
/* 静态属性*/
addAttr(name, value) {
let attr = {
name: name,
value: value
}
this.getTagObg().attr.push(attr)
return this
}
/* 动态属性*/
$addAttr(name, value) {
let attr = {
name: name,
value: value
}
this.getTagObg().$attr.push(attr)
return this
}
/* 非绑定函数*/
addEvent(name, value) {
let attr = {
name: name,
value: value
}
this.getTagObg().event.push(attr)
return this
}
/* 实例方法*/
$addEvent(name, value) {
let attr = {
name: name,
value: value
}
this.getTagObg().$event.push(attr)
return this
}
addTag(name) {
let tagobj = new templage(name)
this.getTagObg().children.push(tagobj)
return tagobj
}
getJs() {
return this.getTagObg()
}
get() {
let obj = this.getTagObg()
let template = '';
template += `<${obj.tagName}`;
// 渲染静态属性
if (obj.attr.length > 0) {
obj.attr.forEach(attr => {
template += ` ${attr.name}="${attr.value}"`;
});
}
// 渲染动态属性
if (obj.$attr.length > 0) {
obj.$attr.forEach(attr => {
template += ` :${attr.name}="${attr.value}"`;
});
}
if (obj.event.length > 0) {
obj.event.forEach(attr => {
template += ` @${attr.name}="${attr.value}"`;
});
}
if (obj.$event.length > 0) {
obj.$event.forEach(attr => {
template += ` @${attr.name}="${attr.value}"`;
});
}
template += '>';
// 渲染子节点
if (obj.children.length > 0) {
obj.children.forEach(child => {
template += child.get();
});
}
template += `</${obj.tagName}>`;
return template;
}
}
\ No newline at end of file
......@@ -2,66 +2,6 @@
<DefaultDialog :appendToBody='false' :app='app'>
<div slot="form" class="min_full" style="display: flex;height: 80vh;">
<Detail ref="detail" :app='this' v-if="showDialog" />
<!-- <div class="search" v-condition>
<SearchButton :app='this'></SearchButton>
<el-row :gutter="20" class="search-row-1">
<el-col :span="5" class="search-col">
<div class="search-item">
<span class="search-span">开始日期:</span>
<el-date-picker :popper-append-to-body="false" value-format="timestamp" v-model='queryParams.start'></el-date-picker>
</div>
</el-col>
<el-col :span="5" class="search-col">
<div class="search-item">
<span class="search-span">截止日期:</span>
<el-date-picker :popper-append-to-body="false" value-format="timestamp" v-model='queryParams.end'></el-date-picker>
</div>
</el-col>
<el-col :span="5" class="search-col">
<div class="search-item">
<span class="search-span">预算任务:</span>
<RelSelect style="width: 100%;" src='hafms/ysfl/query' filterable clearable
:match="{value:'id',label:'name'}" v-model='queryParams.flid'></RelSelect>
</div>
</el-col>
<el-col :span="5" class="search-col">
<div class="search-item">
<span class="search-span">状态:</span>
<RelSelect style="width: 100%;" src='hafms/yssq/init/zt' filterable clearable
:match="{value:'id',label:'name'}" v-model='queryParams.zt'></RelSelect>
</div>
</el-col>
<el-col :span="4" class="search-col">
<el-checkbox @change="tzxx" true-label='Y' false-label='N' v-model="queryParams.xsystz">显示调整信息</el-checkbox>
</el-col>
</el-row>
<el-row :gutter="20" class="search-row-1">
<el-col :span="8" class="search-col">
<div class="search-item">
<span class="search-span">申请订单:</span>
<el-input v-model="queryParams.djid"></el-input>
</div>
</el-col>
<el-col :span="8" class="search-col">
<div class="search-item">
<span class="search-span">申请公司:</span>
<RelSelect collapse-tags multiple style="width: 100%;" src='hafms/common/sjbm/query' filterable clearable
:match="{value:'id',label:'bmmc'}" v-model='queryParams.sjbmids'></RelSelect>
</div>
</el-col>
<el-col :span="8" class="search-col">
<div class="search-item">
<span class="search-span">申请部门:</span>
<RelSelect linkage :linkParams="{sjbmids:queryParams.sjbmids}" :params="{
pids:queryParams.sjbmids.join()
}" collapse-tags multiple style="width: 100%;" src='hafms/common/bm/query' filterable clearable
:match="{value:'id',label:'bmmc'}" v-model='queryParams.chooseBmids'></RelSelect>
</div>
</el-col>
</el-row>
</div> -->
<!-- 按钮操作-->
<!-- 表格-->
......
This diff is collapsed.
<template>
<DefaultDialog :appendToBody='false' :app='app'>
<div slot="form" class="min_full" style="display: flex;height: 80vh;">
<Detail ref="detail" :app='this' v-if="showDialog" />
<div class="tablePagers">
<!-- 多选数组转 -->
<TablePager :operateButtons="false" :ref="'TablePager'" :app='this' :query='query' @selectItem='selectItem' @getRow='getRow'>
</TablePager>
</div>
</div>
</DefaultDialog>
</template>
<script>
import Detail from './detail.vue'
import {
doQuery,
doDelete,
doQueryDetail
} from '@/api/sbysjsp/yszxjd.js';
import {
tableMixin_noapp
} from 'common'
import cycle from 'common/src/mixin/cycle.js'
export default {
mixins: [tableMixin_noapp, cycle],
props: {
app: {
type: Object,
default: ()=>{
return {}
}
}
},
mounted() {
this.$nextTick(()=>{
this.queryParams.bmid=this.app.bmid
this.$refs['TablePager'].pageQuery()
})
},
components: {
Detail
},
data() {
return {
/*需要的额外参数 */
showDialog: false,
DialogName: '',
type: '',
DialogTitle: '',
/* 基础url*/
baseUrl: 'hafms/yszxjdlog',
/* 查询参数*/
queryParams: {
bmid:''
},
/* 表格标题对应参数*/
tableTitle: [
{
title: "项目类别",
field: "xmflname",
fieldType: "ftString",
width: 150
},
{
title: "完成率",
field: "wcl",
fieldType: "ftString",
width: 200
},
{
title: "排名",
field: "pm",
}
]
}
},
methods: {
yssqsp() {
if (this.selectOne || this.clickOne) {
submit(this.singleItem).then(res => {
if (res.success) {
this.$success('操作成功');
this.$refs['TablePager'].pageQuery()
}
})
} else {
this.$warning('请选中一行操作');
}
},
/* 基础查询*/
query: doQueryDetail,
},
}
</script>
<style scoped>
/deep/.el-dialog{
background: url(./static/bg.png);
background-size: 100% 100%;
opacity: 1;
}
/deep/.el-dialog__title{
color: #fff;
}
.search-span{
color: #fff!important;
}
.min_full{
border: 0px solid!important;
}
.search{
border: 0px solid!important;
}
/deep/.el-table th.el-table__cell {
background-color:rgba(0,0,0,.2)!important;
color: #25c2da!important;
font-size: 13px!important;
font-weight: 500!important;
}
/deep/.el-table tr {
background-color: rgba(0,0,0,.2)!important;
color: #25c2da!important;
font-size: 13px!important;
font-weight: 500!important;
}
/deep/.el-table{
background-color: rgba(0,0,0,.2)!important;
}
</style>
<template>
<div class=" flex">
<el-tabs @tab-click="handleClick" v-model="activeName" :tab-position="'left'" >
<el-tab-pane style="font-size: 12px;" v-for="(item,index) in paneList" :key="item.id" :name="item.id"
:label="item.title"></el-tab-pane>
</el-tabs>
<div style="flex: 1;overflow: hidden;">
<div class="min_full" style="border-left: 0px;">
<!-- right-->
<el-row class="tool-bar">
<!-- <ToolButton :app='app'></ToolButton> -->
<ImportTempButton @success='success' url="hafms/yszxjdlog//excel/import" :params="{
sjlx: 'HJ'
}" />
<!-- 导入-->
<el-button @click="del" size="mini" type="danger">删除当前报表</el-button>
</el-row>
<!-- 表格-->
<div class="tablePagers">
<TablePager :operateButtons='false' disableQuery @getData='getData' :ref="'TablePager'" :app='app' :query='query'
@selectItem='selectItem' @getRow='getRow'>
</TablePager>
</div>
</div>
</div>
</div>
</template>
<script>
import {
doQuery,
doDelete,
doQueryDetail
} from '@/api/sbysjsp/yszxjd.js';
import {
tableMixin
} from 'common'
export default {
mixins: [tableMixin],
/* 初始额外赋值*/
async mounted() {
/* 查询数值*/
this.init()
// this.$refs['TablePager'].pageQuery()
},
data() {
return {
activeName: '',
paneList: [],
baseUrl: 'hafms/yszhcxlog',
/* 查询参数*/
queryParams: {
lx: 'B',
},
/* 表格标题对应参数*/
tableTitle: [
{
title: "项目类别",
field: "xmflname0",
fieldType: "ftString",
width: 160
},
{
title: "省平均完成率",
field: "spjwcl0",
fieldType: "ftString",
width: 160
},
{
title: "供电公司平均完成率",
field: "gdgswcl0",
fieldType: "ftString",
width: 160
},
{
title: "直属单位平均完成率",
field: "zsdwwcl0",
fieldType: "ftString",
width: 160
},
{
title: "淮安",
fieldType: "ftString",
field: "title",
width: 160,
subtitle: [
{
prop: "wcl0",
label: "完成率",
width: "120"
},
{
prop: "pm0",
label: "供电公司排名",
width: "120"
}
]
},
{
title: "淮安供电公司本部",
fieldType: "ftString",
field: "title",
width: 160,
subtitle: [
{
prop: "wcl",
label: "完成率",
width: "120"
},
{
prop: "pm",
label: "供电公司排名",
width: "120"
}
]
},
{
title: "金湖县供电公司",
fieldType: "ftString",
field: "title",
width: 160,
subtitle: [
{
prop: "wcl2",
label: "完成率",
width: "120"
},
{
prop: "pm2",
label: "供电公司排名",
width: "120"
}
]
},
{
title: "盱眙县供电公司",
fieldType: "ftString",
field: "title",
width: 160,
subtitle: [
{
prop: "wcl3",
label: "完成率",
width: "120"
},
{
prop: "pm3",
label: "供电公司排名",
width: "120"
}
]
},
{
title: "洪泽县供电公司",
fieldType: "ftString",
field: "title",
width: 160,
subtitle: [
{
prop: "wcl4",
label: "完成率",
width: "120"
},
{
prop: "pm4",
label: "供电公司排名",
width: "120"
}
]
},
{
title: "涟水县供电公司",
fieldType: "ftString",
field: "title",
width: 160,
subtitle: [
{
prop: "wcl5",
label: "完成率",
width: "120"
},
{
prop: "pm5",
label: "供电公司排名",
width: "120"
}
]
},
]
}
},
methods: {
del(){
if(this.paneList.length>0&&this.activeName){
this.$confirm('是否删除当前报表, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res=>{
doDelete({
id:this.activeName
}).then(e=>{
if(e.success){
this.$success('操作成功')
/* 初始化list*/
this.init()
}
})
})
}else{
this.$warning('当前无数据,请刷新或者导入后进行操作')
}
},
init(){
doQuery({
lx: 'B'
}).then(res => {
if (res.success) {
if (res.data && res.data.records && res.data.records.length != 0) {
this.paneList = res.data.records || []
if (this.paneList[0]) {
this.activeName = this.paneList[0].id
this.showTabData(this.paneList[0].id)
/* 查询第一个list*/
}
}
}
})
},
/* 导入成功回调*/
success(){
this.init()
},
/*数据处理*/
showTabData(id) {
/* 控制查询loading */
this.$refs.TablePager.loading=true
doQueryDetail({
mid: id
}).then(res => {
if (res.success) {
let records = res.data.records || []
let lxh0 = records.filter(item => {
if (item.lxh == '0') {
return true
}
})
let lxh1 = records.filter(item => {
if (item.lxh == '1') {
return true
}
})
let lxh2 = records.filter(item => {
if (item.lxh == '2') {
return true
}
})
let lxh3 = records.filter(item => {
if (item.lxh == '3') {
return true
}
})
let lxh4 = records.filter(item => {
if (item.lxh == '4') {
return true
}
})
let lxh5 = records.filter(item => {
if (item.lxh == '5') {
return true
}
})
/* 根据xh合并*/
let newList = lxh1.map(item1 => {
let newItem = {}
lxh2.forEach(item2 => {
if (item1.xh == item2.xh) {
Object.keys(item2).forEach(key => {
let keyName = key + '2'
newItem[keyName] = item2[key]
})
}
})
lxh3.forEach(item3 => {
if (item1.xh == item3.xh) {
Object.keys(item3).forEach(key => {
let keyName = key + '3'
newItem[keyName] = item3[key]
})
}
})
lxh4.forEach(item4 => {
if (item1.xh == item4.xh) {
Object.keys(item4).forEach(key => {
let keyName = key + '4'
newItem[keyName] = item4[key]
})
}
})
lxh5.forEach(item5 => {
if (item1.xh == item5.xh) {
Object.keys(item5).forEach(key => {
let keyName = key + '5'
newItem[keyName] = item5[key]
})
}
})
lxh0.forEach(item0 => {
if (item1.xh == item0.xh) {
Object.keys(item0).forEach(key => {
let keyName = key + '0'
newItem[keyName] = item0[key]
})
}
})
/* 最终合并*/
newItem = {
...newItem,
...item1
}
return newItem
})
/* 手动操作表格*/
/* 替换数据*/
this.$refs.TablePager['tableData'] = newList
console.log(newList,'newlist')
}
}).finally(e=>{
this.$refs.TablePager.loading=false
})
},
handleClick(item) {
this.showTabData(item.name)
},
/* 基础查询*/
query: doQuery,
apiDelete: doDelete,
queryDetail: doQueryDetail
},
components: {
}
}
</script>
<style scoped>
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment