Commit 0b82f9e4 authored by 李苏's avatar 李苏 💬

预算申报表 部分/

parent 34e6920b
import request from 'common/src/utils/request'
/* query */
export function dpzsQuery(query) {
return request({
url: '/budgetms/dpzs/query',
method: 'post',
data: query||{}
})
}
import request from 'common/src/utils/request'
/* query */
export function doQuery(query) {
return request({
url: '/budgetms/yssqmxrep/query',
method: 'post',
data: query||{}
})
}
export function doAdd(query) {
return request({
url: '/budgetms/yssqmxrep/add',
method: 'post',
data: query||{}
})
}
export function doUpdate(query) {
return request({
url: '/budgetms/yssqmxrep/update',
method: 'post',
data: query||{}
})
}
export function doDelete(query) {
return request({
url: '/budgetms/yssqmxrep/delete',
method: 'post',
data: query||{}
})
}
export function title(query) {
return request({
url: '/budgetms/yssqsp/init/title',
method: 'post',
data: query||{}
})
}
...@@ -252,6 +252,32 @@ export const powerRoutes=[ ...@@ -252,6 +252,32 @@ export const powerRoutes=[
}, },
name:'xmznjh', name:'xmznjh',
path:"xmznjh" path:"xmznjh"
},
{
component:'hzcxbb/kshdp/index',
hidden:false,
meta:{
"title": "可视化大屏",
"icon": "",
"noCache": false,
"link": null,
"mkid":901020300,
},
name:'kshdp',
path:"kshdp"
},
{
component:'hzcxbb/ysspzl/index',
hidden:false,
meta:{
"title": "预算申报及下达总览",
"icon": "",
"noCache": false,
"link": null,
"mkid":901040100,
},
name:'ysspzl',
path:"ysspzl"
} }
] ]
}, },
...@@ -297,7 +323,7 @@ export const constantRoutes = [ ...@@ -297,7 +323,7 @@ export const constantRoutes = [
children: [ children: [
{ {
path: 'index', path: 'index',
component: () => import('@/views/erpxmmxzgl/xmmxcx/index'), component: () => import('@/views/hzcxbb/ysspzl/index'),
name: 'Index', name: 'Index',
// redirect: '/user/profile', // redirect: '/user/profile',
meta: { title: '首页', icon: 'dashboard', affix: true } meta: { title: '首页', icon: 'dashboard', affix: true }
......
This diff is collapsed.
<template>
<div class="min_full">
<!-- 查询条件-->
<div class="search" v-condition>
<SearchButton :app='app'></SearchButton>
<el-row :gutter="20" class="search-row-1">
<el-col :span="8" class="search-col">
<div class="search-item">
<span class="search-span">申请公司:</span>
<RelSelect @getAllData='getAlldata' collapse-tags multiple style="width: 100%;" src='budgetms/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 collapse-tags multiple linkage :linkParams="{sjbmids:queryParams.sjbmids.join()}"
style="width: 100%;" src='budgetms/common/bm/query' filterable clearable
:match="{value:'id',label:'bmmc'}" v-model='queryParams.chooseBmids'></RelSelect>
</div>
</el-col>
<el-col :span="8" class="search-col">
<div class="search-item">
<el-checkbox @change="gszs" true-label='Y' false-label='N' v-model="queryParams.showSjbm">按公司展示</el-checkbox>
</div>
</el-col>
</el-row>
</div>
<!-- 按钮操作-->
<el-row class="tool-bar" style="text-align: center;">
<!-- sapn-->
<span class="title">{{title}}</span>
<ToolButton :app='app'></ToolButton>
</el-row>
<!-- 表格-->
<div class="tablePagers">
<TablePager :beforePageQuery='apiTitle' :spanMethod='spanMethod' @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem' :operateButtons='false' :showPagination='false'
:multipleTrans="[
'sjbmids','chooseBmids'
]" @getRow='getRow'>
</TablePager>
</div>
<div v-html="remark" class="remark">
</div>
</div>
</template>
<script>
import {
doQuery,
doAdd,
doUpdate,
doDelete,
title as initIitle
} from '@/api/hzcxbb/ysspzl.js';
import {
tableMixin
} from 'common'
export default {
mixins: [tableMixin],
name: 'ysspzl',
/* 初始额外赋值*/
async mounted() {
this.$refs['TablePager'].pageQuery()
},
data() {
return {
title:'',
remark:'',
spanArr:[],
/*需要的额外参数 */
showDialog: false,
DialogName: '',
type: '',
DialogTitle: '',
/* 基础url*/
baseUrl: 'budgetms/yssqmxrep',
/* 查询参数*/
queryParams: {
sjbmids: [],
chooseBmids: [],
showSjbm: 'N'
},
/* 特殊格式表格*/
tableTitle: [{
label: "成本大类",
prop: "flname",
fieldType: "ftString",
width: 160
},
{
title: "成本预算科目",
field: "fyxmname",
fieldType: "ftString",
width: 160
},
{
title: "申报信息",
fieldType: "ftString",
field: "sbxx",
width: 160,
subtitle: [{
prop: "wsxqje",
label: "申报数",
width: "120"
},
{
prop: "ysnum",
label: "申报条数",
width: "120"
},
{
prop: "fwssdje",
label: "审批中",
width: "120"
},
{
prop: "cwsje",
label: "已完成",
width: "120"
}
]
},
{
title: "成本预算科目",
field: "sbxx",
width: "120",
subtitle: [{
prop: "wssdxqje",
label: "审定数",
width: "120"
},
{
prop: "fwssdje",
label: "审批中",
width: "120"
},
{
prop: "cwssdje",
label: "已完成",
width: "120"
},
]
},
{
title: "审减",
field: "wssjje",
fieldType: "float",
width: 120,
},
{
title: "当年支出",
field: "xhys",
fieldType: "float",
width: 120
},
{
title: "预算完成率",
field: "yswcl",
fieldType: "percent",
width: 120
},
{
title: "可用余额",
field: "kyye",
fieldType: "float"
}
]
}
},
watch:{
tabData:{
handler(newVal) {
this.getpan()
},
deep: true // 开启深度监听
},
},
methods: {
apiTitle(){
initIitle(this.queryParams).then(res=>{
if(res.success){
this.title=res.data.records.title
this.remark=res.data.records.remark
}
})
},
getpan(){
let redata=this.tabData.map(item=>{
return item.flname
})
/* 重置spanArr*/
this.spanArr=[]
let pos=0
redata.reduce((old, cur, i) => {
// old 上一个元素 cur 当前元素 i 索引
if (i === 0) {
// 第一次判断先增加一个 1 占位 ,索引为0
this.spanArr.push(1)
pos = 0
} else {
if (cur === old) {
this.spanArr[pos] += 1
this.spanArr.push(0)
} else {
this.spanArr.push(1)
pos = i
}
}
return cur
}, {})
},
spanMethod({ row, column, rowIndex, columnIndex }) {
if (column.property=='flname') {
const _row = this.spanArr[rowIndex]
const _col = _row > 0 ? 1 : 0
return {
rowspan: _row,
colspan: _col
}
}
},
/* 基础查询*/
query: doQuery,
/* 基础增*/
apiAdd: doAdd,
/* 基础更新*/
apiUpdate: doUpdate,
/* 删除操作*/
apiDelete: doDelete,
getAlldata(gsOption){
this.gsOptionMap={}
gsOption.forEach(item=>{
this.gsOptionMap[item.id]=item.bmmc
})
},
/* 初始化赋值操作*/
gszs(val){
/* 是否按公司展示*/
if(val=='Y'){
/* 拓展表格列头*/
/* 构建新表头*/
this.queryParams.sjbmids.forEach(id=>{
let obj={
label: this.gsOptionMap[id],
field: id,
width: 160,
subtitle:[
{
prop: id+'W',
label: "申报数",
width: "120"
},
{
prop: id+'S',
label: "审定数",
width: "120"
},
{
prop: id+'N',
label: "申报条数",
width: "120"
},
]
}
/* */
this.tableTitle.push(obj)
this.$refs['TablePager'].setGrid({
reload:false
})
this.$refs['TablePager'].pageQuery()
})
}else{
/* 删除表格列头*/
this.tableTitle.forEach((item,index)=>{
if(this.queryParams.sjbmids.indexOf(item.field)!=-1){
this.tableTitle.splice(index, 1);
}
})
this.$refs['TablePager'].setGrid(
{
reload:false
})
this.$refs['TablePager'].pageQuery()
}
}
},
components: {
}
}
</script>
<style scoped>
.title{
text-align: center;
font-size: 18px;
line-height: 30px;
color: #222;
font-weight: 800;
}
.remark{
text-align: right;
height: 40px;
line-height: 17px;
font-size: 12px;
color: #666;
padding-right: 20px;
white-space: pre-wrap;
}
</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