Commit 6ce17b42 authored by 李苏's avatar 李苏 💬

预算汇总 以及bmid字段取值修改

parent 7428ef53
import request from 'common/src/utils/request'
/* query */
export function doQuery(query) {
return request({
url: '/hafms/yssqmxhz/query',
method: 'post',
data: query||{}
})
}
export function queryDetail(query) {
return request({
url: '/hafms/yssqmxhz/queryFlDetail',
method: 'post',
data: query||{}
})
}
...@@ -176,32 +176,7 @@ export const powerRoutes=[ ...@@ -176,32 +176,7 @@ export const powerRoutes=[
redirect: 'yssbkfsz', redirect: 'yssbkfsz',
meta: {title: "预算申报及审批", icon: "fa-cog", noCache: false, link: null,mkid:901030000}, meta: {title: "预算申报及审批", icon: "fa-cog", noCache: false, link: null,mkid:901030000},
children: [ children: [
{
component:'sbysjsp/yssqtz/index',
hidden:false,
meta:{
"title": "预算申请调整",
"icon": "",
"noCache": false,
"link": null,
"mkid": 901030300,
},
name:'yssqtz',
path:"yssqtz"
},
// {
// component:'sbysjsp/yssbkfsz/index',
// hidden:false,
// meta:{
// "title": "预算申报开放设置",
// "icon": "",
// "noCache": false,
// "link": null,
// "mkid": 901030300,
// },
// name:'yssbkfsz',
// path:"yssbkfsz"
// },
{ {
component:'sbysjsp/yssq/index', component:'sbysjsp/yssq/index',
hidden:false, hidden:false,
...@@ -227,6 +202,32 @@ export const powerRoutes=[ ...@@ -227,6 +202,32 @@ export const powerRoutes=[
}, },
name:'mxsx', name:'mxsx',
path:"mxsx" path:"mxsx"
},
{
component:'sbysjsp/yssqtz/index',
hidden:false,
meta:{
"title": "预算申请调整",
"icon": "",
"noCache": false,
"link": null,
"mkid": 901030300,
},
name:'yssqtz',
path:"yssqtz"
},
{
component:'sbysjsp/yshz/index',
hidden:false,
meta:{
"title": "预算汇总查询",
"icon": "",
"noCache": false,
"link": null,
"mkid": 901030400,
},
name:'yshz',
path:"yshz"
} }
] ]
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
required:true, required:true,
rules:rules, rules:rules,
}" > }" >
<RelSelect linkage :linkParams="{pid:form.sjbmid}" :readonly="readonly" filterable style="width: 100%;" src='hafms/common/bm/query' :match="{value:'bmid',label:'bmmc'}" v-model='form.bmid' ></RelSelect> <RelSelect linkage :linkParams="{pid:form.sjbmid}" :readonly="readonly" filterable style="width: 100%;" src='hafms/common/bm/query' :match="{value:'id',label:'bmmc'}" v-model='form.bmid' ></RelSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
......
<template>
<DefaultDialog :app='app'>
<div slot="form" style="display: flex;height: 70vh;">
<div class="full">
<EditTable :allowEdit='false' :spanMethod='spanMethod' ref="editTable" :editTableData='newFormDetail'
:app='this'></EditTable>
</div>
</div>
<div slot="reFooter" class="refooter">
<span slot="footer" class="dialog-footer">
<el-button @click="app.showDialog=false">取 消</el-button>
<!-- <el-button type="primary" @click="save()">保 存</el-button> -->
</span>
</div>
</DefaultDialog>
</template>
<script>
import {
toFixed
} from 'common/src/utils/blur.js'
export default {
props: {
app: {
type: Object,
default: () => {
return {}
}
}
},
async mounted() {
},
computed: {
newFormDetail() {
/* 进行分类统计*/
let flArr = []
this.formDetail.forEach(item => {
flArr.push(item.bmjc)
})
/* 去重*/
flArr = [...new Set(flArr)]
/* 获取bmjc的所有值*/
/* 顺序构建数据组*/
/* 获取总金额*/
let jeobj = {}
let sxList = []
flArr.forEach(item => {
jeobj[item] = 0
/* 按顺序排列*/
this.formDetail.forEach(fitem => {
if (fitem.bmjc == item) {
jeobj[item] += Number(fitem.xqje || 0)
sxList.push(fitem)
}
})
})
/* 赋值总金额*/
sxList.forEach(item => {
item.lxzje = item.showname + "合计:" + jeobj[item.bmjc]
})
/* 构建redata*/
let redata = sxList.map(item => {
return item.bmjc
})
/* 重置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
}, {})
/* reduce开始控制row col*/
this.formDetail = sxList
return this.formDetail
}
},
data() {
/* 公司=》部门=》事项明细=》金额*/
return {
formDetail: [
],
spanArr: [],
baseUrl:'sbysjsp/yshz/edit',
editTableTitle: [
{
label: "部门",
prop: "bmjc",
fieldType: "ftString",
width: 150
},
{
label: "事项明细",
prop: "flname",
fieldType: "ftString",
width: 150
},
{
label: "预算数额",
prop: "xqje",
fieldType: "ftString",
width: 150,
type: 'inputNumber',
blur: toFixed(4),
},
{label: "调增金额", prop: "pje", fieldType: "money",width:200},
{label: "调减金额", prop: "mje", fieldType: "money",width:200},
{label: "调整后金额", prop: "tzhje", fieldType: "money"},
]
}
},
methods: {
spanMethod({
row,
column,
rowIndex,
columnIndex
}) {
if (column.property == 'bmjc') {
const _row = this.spanArr[rowIndex]
const _col = _row > 0 ? 1 : 0
return {
rowspan: _row,
colspan: _col
}
}
/* */
}
}
}
</script>
<style scoped>
</style>
<template>
<RelDialog width='70%' :type='type' :editApp='editApp' :app='app'
:buttonApp='buttonApp'>
<!-- 填写表单内容,slot=form必写-->
<el-form slot="form" ref="form" :model="form" label-width="80px" :rules="rules">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="申请公司" ref="sjbmid" prop="sjbmid" v-rule="{
required:true,
rules:rules,
}">
<RelSelect :readonly="readonly" filterable style="width: 100%;" src='hafms/common/sjbm/query'
:match="{value:'id',label:'bmmc'}" v-model='form.sjbmid'></RelSelect>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="申请部门" ref="bmid" prop="bmid" v-rule="{
required:true,
rules:rules,
}">
<RelSelect linkage :linkParams="{pid:form.sjbmid}" :readonly="readonly" filterable style="width: 100%;"
src='hafms/common/bm/query' :match="{value:'id',label:'bmmc'}" v-model='form.bmid'></RelSelect>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="填报日期" ref="tbrq" prop="tbrq" v-rule="{
required:true,
rules:rules,
}">
<el-date-picker :readonly="readonly" style="width: 100%;" value-format="timestamp"
v-model='form.tbrq'></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="年度" ref="year" prop="year">
<RelYearSelect :readonly="readonly" v-model="form.year" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="填报人" ref="tbr" prop="tbr">
<el-input :readonly="true" :value="form.tbr||localUser"></el-input>
</el-form-item>
</el-col>
</el-row>
<div class="">
<div class="edit_table">
<el-row class="tool-bar" style="padding-left: 0px;padding-bottom: 3px;" >
<el-button style="margin-right: 10px;" v-if="type!='view'" @click="add" size='mini' type="primary" >新增</el-button>
</el-row>
<div style="height: calc(100% - 40px);" >
<EditTable :delButton=" type!='view' " :allowEdit='type!="view"' ref="editTable" :editTableData='formDetail' :app='this'></EditTable>
</div>
</div>
<span class="jehj">合计总金额:{{jehj}}</span>
<!-- 可编辑表格组件 -->
</div>
<!-- 底部信息-->
</el-form>
</RelDialog>
</template>
<script>
/* 映入额外弹框 */
import {
editMixin
} from 'common'
import {
toFixed
} from 'common/src/utils/blur.js'
export default {
mixins: [editMixin],
/* 存放index页面传递的额外参数*/
mounted() {
this.localUser = localStorage.getItem('username')
if (this.form.tbr == '') {
this.form.tbr = this.localUser
}
/* 构建新的明细表数据*/
this.$post('hafms/xmfl/queryAllRoot', {}).then(res => {
this.editTableTitle[0].options=res.data.records.map(item=>{
let obj={
label:item.name,
value:item.id
}
return obj
})
})
},
computed: {
jehj() {
let hj = 0
this.formDetail.forEach(item => {
hj = hj + Number(item.xqje || 0)
})
return hj
},
newFormDetail() {
}
},
watch: {
},
/* 组件名称*/
data() {
return {
/* */
finalList: [],
spanArr: [],
baseUrl: 'hafms/ystz/edit',
localUser: '',
/* 弹框管理 */
/* 额外初始化,根据需求*/
/* editTableData: [{}], */
editTableTitle: [
/* */
// {label: "序号", prop: "xh",width:50,align:"center"},
{
label: "总事项",
prop: "fyxmid",
show: true,
width: 300,
type:'select',
options:[]
},
{
label: "预算数额",
prop: "xqje",
fieldType: "ftString",
width: 250,
type: 'inputNumber',
blur: toFixed(4),
},
{
label: "具体事由及测算依据",
prop: "csyj",
fieldType: "ftString",
width: 500,
type: 'inputText'
},
],
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form: {
yslx:'TZ',
year:new Date().getFullYear(),
table: "YSSQMX",
sjbmid: '',
bmid: '',
tbrq: '',
tbr: '',
lxfs1: '',
lxfs2: '',
ysflid: ''
},
/* form提交时的规则,具体规则参考官网*/
}
},
created() {
/* tag遍历 */
},
methods: {
add(){
this.formDetail.push({
fyxmid:'',
xqje:0,
csyj:''
})
}
},
components: {
}
}
</script>
<style scoped lang="scss">
.jehj {
line-height: 30px;
font-size: 14px;
}
.edit_table {
height: 350px;
overflow: auto;
}
</style>
<template>
<div class="min_full">
<Detail ref="detail" :app='this' v-if="showDialog" />
<!-- 查询条件-->
<div class="search" v-condition>
<SearchButton :app='app'></SearchButton>
<el-row :gutter="20" class="search-row-1">
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">开始日期:</span>
<el-date-picker value-format="timestamp" v-model='queryParams.start' ></el-date-picker>
</div>
</el-col>
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">截止日期:</span>
<el-date-picker value-format="timestamp" v-model='queryParams.end' ></el-date-picker>
</div>
</el-col>
<el-col :span="6" 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="6" 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-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>
<!-- 按钮操作-->
<el-row class="tool-bar">
<ToolButton :app='app'></ToolButton>
</el-row>
<!-- 表格-->
<div class="tablePagers">
<!-- 多选数组转 -->
<TablePager
:operateButtons="false"
@tpDbClick="tpDbClick"
:multipleTrans="[
'sjbmids','chooseBmids'
]"@getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem'
@getRow='getRow'>
</TablePager>
</div>
</div>
</template>
<script>
import {
doQuery,
queryDetail
} from '@/api/sbysjsp/yshz.js';
/* edit页面*/
import Edit from './edit'
import Detail from './detail.vue'
import {
tableMixin
} from 'common'
import cycle from 'common/src/mixin/cycle.js'
export default {
mixins: [tableMixin,cycle],
/* 初始额外赋值*/
async mounted() {
this.$refs['TablePager'].pageQuery()
},
data() {
return {
/*需要的额外参数 */
showDialog: false,
DialogName: '',
type: '',
DialogTitle: '',
/* 基础url*/
baseUrl: 'hafms/ystz',
/* 查询参数*/
queryParams: {
start:new Date().getTime()-1000*60*60*24*30,
end: new Date().getTime(),
flid:'',
zt:'',
djid:'',
sjbmids:[],
chooseBmids:[]
},
/* 表格标题对应参数*/
tableTitle: [
{title: "年度", field: "year", fieldType: "ftString",width:120},
{title: "事项", field: "flname", fieldType: "ftString",width:300},
{title: "需求金额", field: "xqje", fieldType: "money",width:229},
{title: "调增金额", field: "pje", fieldType: "money",width:220},
{title: "调减金额", field: "mje", fieldType: "money",width:220},
{title: "调整后金额", field: "tzhje", fieldType: "money"},
]
}
},
methods: {
tpDbClick(row){
queryDetail({
year:row.year,
flid:row.flid,
}).then(res=>{
if(res.success){
const {records} = res.data
if(records.length>0){
this.DialogTitle="查看详情"
this.DialogWidth="70vw"
this.showDialog=true
this.$nextTick(()=>{
this.$refs.detail.formDetail=records||[]
})
}else{
this.$warning('暂无数据')
}
}
})
},
yssqsp(){
if (this.app.selectOne || this.app.clickOne) {
submit(this.singleItem).then(res=>{
if(res.success){
this.$success('操作成功');
this.$refs['TablePager'].pageQuery()
}
})
} else {
this.$warning('请选中一行操作');
}
},
/* 基础查询*/
query: doQuery,
queryDetail:queryDetail
},
components: {
Edit,
Detail
}
}
</script>
<style scoped>
.search-col{
max-width: 350px;
}
</style>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
rules:rules, rules:rules,
}"> }">
<RelSelect linkage :linkParams="{pid:form.sjbmid}" :readonly="readonly" filterable style="width: 100%;" <RelSelect linkage :linkParams="{pid:form.sjbmid}" :readonly="readonly" filterable style="width: 100%;"
src='hafms/common/bm/query' :match="{value:'bmid',label:'bmmc'}" v-model='form.bmid'></RelSelect> src='hafms/common/bm/query' :match="{value:'id',label:'bmmc'}" v-model='form.bmid'></RelSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
rules:rules, rules:rules,
}"> }">
<RelSelect linkage :linkParams="{pid:form.sjbmid}" :readonly="readonly" filterable style="width: 100%;" <RelSelect linkage :linkParams="{pid:form.sjbmid}" :readonly="readonly" filterable style="width: 100%;"
src='hafms/common/bm/query' :match="{value:'bmid',label:'bmmc'}" v-model='form.bmid'></RelSelect> src='hafms/common/bm/query' :match="{value:'id',label:'bmmc'}" v-model='form.bmid'></RelSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
data() { data() {
return { return {
/* */ /* */
finalList: [], finalList: [],
spanArr: [], spanArr: [],
baseUrl: 'hafms/ystz/edit', baseUrl: 'hafms/ystz/edit',
......
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