刘翔宇-旅管家 4 years ago
commit e65a156402

@ -1,22 +1,22 @@
<template>
<div style="padding: 0 20px">
<lx-header icon="md-apps" text="预算计划" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<lx-header icon="md-apps" style="margin-bottom: 10px; border: 0px; margin-top: 15px" text="预算计划">
<div slot="content"></div>
<slot>
<div>
<span style="padding: 0 6px;">年份</span>
<span>
<DatePicker placeholder="选择所属年份" type="year" placement="bottom" :value="select.year" style="width: 130px;"
@on-change="(e)=>select.year = e"></DatePicker>
<DatePicker :value="select.year" placeholder="选择所属年份" placement="bottom" style="width: 130px;" type="year"
@on-change="(e)=>select.year = e"></DatePicker>
</span>
<span style="padding: 0 6px;">
预算类型
</span>
<span>
<Select placeholder="选择预算类型" v-model="select.type" style="width:130px;" clearable>
<Option v-for="item in types" :value="item.id"
:key="item.id">{{ item.value }}</Option>
<Select v-model="select.type" clearable placeholder="选择预算类型" style="width:130px;">
<Option v-for="item in types" :key="item.id"
:value="item.id">{{ item.value }}</Option>
</Select>
</span>
@ -24,37 +24,40 @@
科室
</span>
<span>
<el-cascader placeholder="选择科室" size="small" :value="select.department" style="width: 160px;"
:options="departments" :props="{ checkStrictly: true, label: 'name', value: 'id' }" clearable
@change="e => select.department = e[e.length-1] || ''" />
<el-select placeholder="科室选择" clearable size="small" v-model="select.department" style="width: 160px;">
<el-option v-for="item in departments" :label="item.name" :value="item.id" :key="item.id">
</el-option>
</el-select>
</span>
<Button type="primary" style="margin-left: 10px" @click="isShowAdd = true,getDepartment()">新增</Button>
<Button type="primary" style="margin-left: 10px" @click="getBudgets"></Button>
<Button type="primary" style="margin-left: 10px"
@click="()=>select={page:1,year:'', type:'', department:''}">重置</Button>
<Button style="margin-left: 10px" type="primary" @click="isShowAdd = true,getDepartment()">新增</Button>
<Button style="margin-left: 10px" type="primary" @click="getBudgets"></Button>
<Button style="margin-left: 10px" type="primary"
@click="()=>select={page:1,year:'', type:'', department:''}">重置
</Button>
</div>
</slot>
</lx-header>
<xy-table ref="xyTable" :table-item="table" :list="list" @delete="deleteTable" @editor="showEditor" :show-summary="true"
:summary-method="summary">
<xy-table ref="xyTable" :list="list" :show-summary="true" :summary-method="summary" :table-item="table"
@delete="deleteTable"
@editor="showEditor">
</xy-table>
<div style="display: flex;justify-content: flex-end;">
<Page :total="total" show-elevator @on-change="pageChange" />
<Page :total="total" show-elevator @on-change="pageChange"/>
</div>
<!-- 新增-->
<xy-dialog :is-show.sync="isShowAdd" type="form" :form="form" title="新增计划" :rules="rules" @submit="submit"
ref="addBudget">
<xy-dialog ref="addBudget" :form="form" :is-show.sync="isShowAdd" :rules="rules" title="新增计划" type="form"
@submit="submit">
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>项目名称
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写项目名称" v-model="form.name" style="width: 300px;" />
<el-input v-model="form.name" clearable placeholder="请填写项目名称" style="width: 300px;"/>
</div>
</div>
</template>
@ -64,9 +67,9 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>预算类型
</div>
<div class="xy-table-item-content">
<el-select clearable placeholder="请选择预算类型" v-model="form.type" style="width: 300px;">
<el-select v-model="form.type" clearable placeholder="请选择预算类型" style="width: 300px;">
<el-option v-for="item in types" :label="item.value"
:value="item.id"></el-option>
:value="item.id"></el-option>
</el-select>
</div>
</div>
@ -77,8 +80,8 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>项目所属年份
</div>
<div class="xy-table-item-content">
<el-datePicker value-format="yyyy" clearable placeholder="请选择所属年份" type="year" placement="bottom"
v-model="form.year" style="width: 300px;"></el-datePicker>
<el-datePicker v-model="form.year" clearable placeholder="请选择所属年份" placement="bottom" style="width: 300px;"
type="year" value-format="yyyy"></el-datePicker>
</div>
</div>
</template>
@ -88,9 +91,10 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>科室
</div>
<div class="xy-table-item-content">
<el-cascader :value="form.department" style="width: 300px;" :options="departments"
:props="{ checkStrictly: true, label: 'name', value: 'id' }" clearable
@change="e => form.department = e[e.length-1] || ''" />
<el-select placeholder="科室选择" clearable size="small" v-model="form.department" style="width: 300px;">
<el-option v-for="item in departments" :label="item.name" :value="item.id" :key="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
@ -100,7 +104,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>内容
</div>
<div class="xy-table-item-content">
<el-input clearable type="textarea" placeholder="请填写内容" v-model="form.content" style="width: 300px;" />
<el-input v-model="form.content" clearable placeholder="请填写内容" style="width: 300px;" type="textarea"/>
</div>
</div>
</template>
@ -110,7 +114,8 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>金额
</div>
<div class="xy-table-item-content xy-table-item-price">
<el-input clearable placeholder="请填写金额" v-model="form.money" style="width: 300px;" @focus="moneyRecover" @blur="moneyFormat"/>
<el-input v-model="form.money" clearable placeholder="请填写金额" style="width: 300px;" @blur="moneyFormat"
@focus="moneyRecover"/>
</div>
</div>
</template>
@ -120,21 +125,21 @@
备注
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写备注" type="textarea" v-model="form.remark" style="width: 300px;" />
<el-input v-model="form.remark" clearable placeholder="请填写备注" style="width: 300px;" type="textarea"/>
</div>
</div>
</template>
</xy-dialog>
<!-- 编辑-->
<xy-dialog title="编辑" type="form" :is-show.sync="isShowEditor" :form="editorForm" :rules="rules" ref="editorDialog">
<xy-dialog ref="editorDialog" :form="editorForm" :is-show.sync="isShowEditor" :rules="rules" title="编辑" type="form">
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>项目名称
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写项目名称" v-model="editorForm.name" style="width: 300px;" />
<el-input v-model="editorForm.name" clearable placeholder="请填写项目名称" style="width: 300px;"/>
</div>
</div>
</template>
@ -144,9 +149,9 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>预算类型
</div>
<div class="xy-table-item-content">
<el-select placeholder="请选择预算类型" v-model="editorForm.type" style="width: 300px;" clearable>
<el-select v-model="editorForm.type" clearable placeholder="请选择预算类型" style="width: 300px;">
<el-option v-for="item in types" :label="item.value"
:value="item.id"></el-option>
:value="item.id"></el-option>
</el-select>
</div>
</div>
@ -157,8 +162,8 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>项目所属年份
</div>
<div class="xy-table-item-content">
<el-datePicker clearable value-format="yyyy" placeholder="请选择所属年份" type="year" placement="bottom"
v-model="editorForm.year" style="width: 300px;"></el-datePicker>
<el-datePicker v-model="editorForm.year" clearable placeholder="请选择所属年份" placement="bottom" style="width: 300px;"
type="year" value-format="yyyy"></el-datePicker>
</div>
</div>
</template>
@ -168,9 +173,9 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>科室
</div>
<div class="xy-table-item-content">
<el-cascader size="small" :value="editorForm.department" style="width: 300px;" :options="departments"
:props="{ checkStrictly: true, label: 'name', value: 'id' }" clearable
@change="e => editorForm.department = e[e.length-1] || ''" />
<el-cascader :options="departments" :props="{ checkStrictly: true, label: 'name', value: 'id' }" :value="editorForm.department" clearable
size="small" style="width: 300px;"
@change="e => editorForm.department = e[e.length-1] || ''"/>
</div>
</div>
</template>
@ -180,8 +185,8 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>内容
</div>
<div class="xy-table-item-content">
<el-input autosize clearable type="textarea" placeholder="请填写内容" v-model="editorForm.content"
style="width: 300px;" />
<el-input v-model="editorForm.content" autosize clearable placeholder="请填写内容" style="width: 300px;"
type="textarea"/>
</div>
</div>
</template>
@ -191,7 +196,8 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>金额
</div>
<div class="xy-table-item-content xy-table-item-price">
<el-input clearable placeholder="请填写金额" v-model="editorForm.money" style="width: 300px;" @focus="moneyRecoverEditor" @blur="moneyFormatEditor"/>
<el-input v-model="editorForm.money" clearable placeholder="请填写金额" style="width: 300px;"
@blur="moneyFormatEditor" @focus="moneyRecoverEditor"/>
</div>
</div>
</template>
@ -201,8 +207,8 @@
备注
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写备注" type="textarea" v-model="editorForm.remark" style="width: 300px;"
autosize />
<el-input v-model="editorForm.remark" autosize clearable placeholder="请填写备注" style="width: 300px;"
type="textarea"/>
</div>
</div>
</template>
@ -214,333 +220,334 @@
</template>
<script>
import {
addBudget,
getBudget,
delBudget,
editorBudget,
detailBudget
} from "@/api/budget/budget"
import {
listdeptNoAuth
} from "@/api/system/department"
import {
Message
} from "element-ui";
import {
parseTime,moneyFormatter,moneyRecovery
} from "@/utils"
import {getparameter} from "@/api/system/dictionary"
export default {
data() {
return {
isShowAdd: false,
types:[],
form: {
name: "",
type: "",
year: "",
department: "",
money: "",
content: "",
remark: ""
},
rules: {
name: [{
required: true,
message: "必填项"
}],
type: [{
required: true,
message: "必选项"
}],
year: [{
required: true,
message: "必选项"
}],
department: [{
required: true,
message: "必选项"
}],
money: [{
required: true,
message: "必填项"
},
{
pattern: /^\d{1,3}(,\d{3})*(\.\d+)/,
message: '必须为数字',
trigger: 'change'
}
],
content: [{
required: true,
message: "必填项"
}]
import {
addBudget,
getBudget,
delBudget,
editorBudget,
detailBudget
} from "@/api/budget/budget"
import {
listdeptNoAuth
} from "@/api/system/department"
import {
Message
} from "element-ui";
import {
parseTime, moneyFormatter, moneyRecovery
} from "@/utils"
import {getparameter} from "@/api/system/dictionary"
export default {
data() {
return {
isShowAdd: false,
types: [],
form: {
name: "",
type: "",
year: "",
department: "",
money: "",
content: "",
remark: ""
},
rules: {
name: [{
required: true,
message: "必填项"
}],
type: [{
required: true,
message: "必选项"
}],
year: [{
required: true,
message: "必选项"
}],
department: [{
required: true,
message: "必选项"
}],
money: [{
required: true,
message: "必填项"
},
list: [],
totalMoney: 0,
total: 0,
pageIndex: 1,
table: [{
label: "项目名称",
prop: 'name',
width: 200,
align: 'left',
sortable: false,
fixed: 'left'
},
{
label: "预算类型",
prop: 'type',
width: 115,
formatter: (cell, data, value) => {
let res = this.types.filter(item => {
return item.id === value
})
return res[0]?.value || '未知'
}
},
{
label: "所属年份",
prop: 'year',
width: 105
},
{
label: "相关科室",
prop: 'plan_department.name',
width: 110
},
{
label: '项目金额(元)',
prop: 'money',
align: 'right',
width: 160,
formatter:(cell,data,value)=>{
return moneyFormatter(value)
}
},
{
label: "创建信息",
prop: 'created_at',
width: 160,
formatter: (cell, data, value) => {
return parseTime(new Date(value), '{y}-{m}-{d}')
}
},
{
label: "描述",
minWidth: 300,
prop: 'content',
align: 'left',
sortable: false
},
pattern: /^\d{1,3}(,\d{3})*(\.\d+)/,
message: '必须为数字',
trigger: 'change'
}
],
select: {
page: 1,
year: "",
type: "",
department: ""
content: [{
required: true,
message: "必填项"
}]
},
list: [],
totalMoney: 0,
total: 0,
pageIndex: 1,
table: [{
label: "项目名称",
prop: 'name',
width: 200,
align: 'left',
sortable: false,
fixed: 'left'
},
{
label: "预算类型",
prop: 'type',
width: 115,
formatter: (cell, data, value) => {
let res = this.types.filter(item => {
return item.id === value
})
return res[0]?.value || '未知'
}
},
departments: [], //
{
label: "所属年份",
prop: 'year',
width: 105
},
{
label: "相关科室",
prop: 'plan_department.name',
width: 110
},
{
label: '项目金额(元)',
prop: 'money',
align: 'right',
width: 160,
formatter: (cell, data, value) => {
return moneyFormatter(value)
}
},
{
label: "创建信息",
prop: 'created_at',
width: 160,
formatter: (cell, data, value) => {
return parseTime(new Date(value), '{y}-{m}-{d}')
}
},
{
label: "描述",
minWidth: 300,
prop: 'content',
align: 'left',
sortable: false
},
],
select: {
page: 1,
year: "",
type: "",
department: ""
},
departments: [], //
//
isShowEditor: false,
editorForm: {},
}
//
isShowEditor: false,
editorForm: {},
}
},
methods: {
async getTypes() {
const res = await getparameter({number: 'money_way'})
this.types = res.detail
},
methods: {
async getTypes(){
const res = await getparameter({number:'money_way'})
this.types = res.detail
},
moneyRecoverEditor(){
if(!/^\d{1,3}(,\d{3})*(\.\d+)/.test(this.editorForm.money)){
return
}
this.editorForm.money = moneyRecovery(this.editorForm.money)
},
moneyFormatEditor(){
if(!/^\d+(\.\d+)?$/.test(this.editorForm.money)){
return
}
this.editorForm.money = moneyFormatter(this.editorForm.money)
},
moneyRecover(){
if(!/^\d{1,3}(,\d{3})*(\.\d+)/.test(this.form.money)){
moneyRecoverEditor() {
if (!/^\d{1,3}(,\d{3})*(\.\d+)/.test(this.editorForm.money)) {
return
}
this.editorForm.money = moneyRecovery(this.editorForm.money)
},
moneyFormatEditor() {
if (!/^\d+(\.\d+)?$/.test(this.editorForm.money)) {
return
}
this.editorForm.money = moneyFormatter(this.editorForm.money)
},
moneyRecover() {
if (!/^\d{1,3}(,\d{3})*(\.\d+)/.test(this.form.money)) {
return
}
this.form.money = moneyRecovery(this.form.money)
},
moneyFormat() {
if (!/^\d+(\.\d+)?$/.test(this.form.money)) {
return
}
this.form.money = moneyFormatter(this.form.money)
},
//
summary(param) {
this.$nextTick(() => {
this.$refs['xyTable'].$children[0].doLayout()
})
const {
columns,
data
} = param
const sums = []
columns.map((column, index) => {
if (index === 0) {
sums[index] = '总计'
return
}
this.form.money = moneyRecovery(this.form.money)
},
moneyFormat(){
if(!/^\d+(\.\d+)?$/.test(this.form.money)){
if (column.property === 'money') {
sums[index] = moneyFormatter(this.totalMoney)
return
}
this.form.money = moneyFormatter(this.form.money)
},
//
summary(param) {
this.$nextTick(() => {
this.$refs['xyTable'].$children[0].doLayout()
})
const {
columns,
data
} = param
const sums = []
columns.map((column, index) => {
if (index === 0) {
sums[index] = '总计'
return
}
if (column.property === 'money') {
sums[index] = moneyFormatter(this.totalMoney)
return
}
// const values = data.map(item => Number(item[column.property]));
// if (!values.every(value => isNaN(value)) && (column.property === 'money' || column.property === 'plan_price'|| column.property === 'fund_log_total')) {
//
// sums[index] = sums[index].toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
// } else {
// sums[index] = '';
// }
})
return sums
},
// const values = data.map(item => Number(item[column.property]));
// if (!values.every(value => isNaN(value)) && (column.property === 'money' || column.property === 'plan_price'|| column.property === 'fund_log_total')) {
//
// sums[index] = sums[index].toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
// } else {
// sums[index] = '';
// }
})
return sums
},
//
pageChange(e) {
this.pageIndex = e
this.getBudgets()
},
//
getDepartment() {
listdeptNoAuth().then(res => {
this.departments = res
})
},
//
getBudgets() {
getBudget({
page_size: 10,
page: this.pageIndex,
year: this.select.year,
type: this.select.type,
plan_department_id: this.select.department
}).then(res => {
this.list = res.list.data
this.total = res.list.total
this.totalMoney = res.total_money
//
pageChange(e) {
this.pageIndex = e
this.getBudgets()
},
//
getDepartment() {
listdeptNoAuth().then(res => {
this.departments = res
})
},
//
getBudgets() {
getBudget({
page_size: 10,
page: this.pageIndex,
year: this.select.year,
type: this.select.type,
plan_department_id: this.select.department
}).then(res => {
this.list = res.list.data
this.total = res.list.total
this.totalMoney = res.total_money
})
},
//
submit() {
addBudget({
name: this.form.name,
type: this.form.type,
year: this.form.year,
content: this.form.content,
money: moneyRecovery(this.form.money),
plan_department_id: this.form.department,
remark: this.form.remark
}).then(res => {
Message({
message: '操作成功',
type: 'success'
})
},
//
submit() {
addBudget({
name: this.form.name,
type: this.form.type,
year: this.form.year,
content: this.form.content,
money: moneyRecovery(this.form.money),
plan_department_id: this.form.department,
remark: this.form.remark
}).then(res => {
Message({
message: '操作成功',
type: 'success'
})
this.isShowAdd = false
this.$refs["addBudget"].reset()
this.getBudgets()
this.isShowAdd = false
this.$refs["addBudget"].reset()
this.getBudgets()
})
},
//
deleteTable(e) {
delBudget({
id: e.id
}).then(res => {
Message({
message: '操作成功',
type: 'success'
})
},
//
deleteTable(e) {
delBudget({
id: e.id
this.getBudgets()
})
},
//
editorTable() {
this.$refs['editorDialog'].$refs['elForm'].validate().then(res => {
editorBudget({
id: this.editorForm.id,
name: this.editorForm.name,
type: this.editorForm.type,
year: this.editorForm.year,
content: this.editorForm.content,
money: moneyRecovery(this.editorForm.money),
remark: this.editorForm.remark,
plan_department_id: this.editorForm.department
}).then(res => {
this.isShowEditor = false
Message({
message: '操作成功',
type: 'success'
})
this.getBudgets()
})
},
//
editorTable() {
this.$refs['editorDialog'].$refs['elForm'].validate().then(res => {
editorBudget({
id: this.editorForm.id,
name: this.editorForm.name,
type: this.editorForm.type,
year: this.editorForm.year,
content: this.editorForm.content,
money: moneyRecovery(this.editorForm.money),
remark: this.editorForm.remark,
plan_department_id: this.editorForm.department
}).then(res => {
this.isShowEditor = false
Message({
message: '操作成功',
type: 'success'
})
this.getBudgets()
})
}).catch(err => {
this.$message({
message: '请填写完整信息',
type: 'error'
})
})
},
showEditor(row) {
this.getDepartment()
detailBudget({
id: row.id
}).then(res => {
this.editorForm = {
id: res.id,
name: res.name,
type: res.type,
department: res.plan_department_id,
money: moneyFormatter(res.money),
year: res.year,
content: res.content,
remark: res.remark
}
this.isShowEditor = true
console.log(this.editorForm)
}).catch(err => {
this.$message({
message: '请填写完整信息',
type: 'error'
})
},
})
},
mounted() {
this.getTypes()
showEditor(row) {
this.getDepartment()
this.getBudgets()
}
detailBudget({
id: row.id
}).then(res => {
this.editorForm = {
id: res.id,
name: res.name,
type: res.type,
department: res.plan_department_id,
money: moneyFormatter(res.money),
year: res.year,
content: res.content,
remark: res.remark
}
this.isShowEditor = true
console.log(this.editorForm)
})
},
},
mounted() {
this.getTypes()
this.getDepartment()
this.getBudgets()
}
}
</script>
<style scoped lang="scss">
.xy-table-item-label {
width: 140px;
}
<style lang="scss" scoped>
.xy-table-item-label {
width: 140px;
}
.xy-table-item-price {
position: relative;
.xy-table-item-price {
position: relative;
&::after {
z-index: 1;
position: absolute;
right: 0;
top: 0;
content: '(元)'
}
&::after {
z-index: 1;
position: absolute;
right: 0;
top: 0;
content: '(元)'
}
::v-deep .el-input__clear {
position: relative;
right: 30px;
z-index: 2;
}
::v-deep .el-input__clear {
position: relative;
right: 30px;
z-index: 2;
}
}
</style>

@ -22,15 +22,10 @@
科室
</span>
<span>
<el-cascader
placeholder="选择科室"
size="small"
:value="select.department"
style="width: 160px;"
:options="departments"
:props="{ checkStrictly: true, label: 'name', value: 'id' }"
clearable
@change="e => select.department = e[e.length-1] || ''"/>
<el-select placeholder="科室选择" clearable size="small" v-model="select.department" style="width: 160px;">
<el-option v-for="item in departments" :label="item.name" :value="item.id" :key="item.id">
</el-option>
</el-select>
</span>
<Button type="primary" style="margin-left: 10px" @click="getBudgets"></Button>
<Button type="primary" style="margin-left: 10px" @click="()=>select={page:1,year:'', type:'', department:''}">重置</Button>

@ -15,6 +15,16 @@
<div class="payment-registration-row-title">合同金额</div>
<div class="payment-registration-row-content">{{priceFormat(contract.money)}} </div>
</div>
<div style="display: flex">
<div class="payment-registration-row">
<div class="payment-registration-row-title">已申请金额</div>
<div class="payment-registration-row-content">{{totalApplyMoney()}} </div>
</div>
<div class="payment-registration-row">
<div class="payment-registration-row-title">已申请笔数</div>
<div class="payment-registration-row-content">{{payment.length}}</div>
</div>
</div>
<div style="display: flex">
<div class="payment-registration-row">
<div class="payment-registration-row-title">已付金额</div>
@ -26,7 +36,7 @@
</div>
<div class="payment-registration-row">
<div class="payment-registration-row-title">已付笔数</div>
<div class="payment-registration-row-content">{{payment.length}}</div>
<div class="payment-registration-row-content">{{actNumsTotal()}}</div>
<div class="payment-registration-row-content" style="color: #ff0000;padding-left: 16px;cursor: pointer;">
<Poptip :transfer="true">
<div>点击查看列表</div>
@ -139,11 +149,17 @@ export default {
payment:[],//
payTable:[
{
label:'支付金额',
label:'申请金额',
prop:'apply_money',
sortable:false,
align:'right'
},
{
label:'已付金额',
prop:'act_money',
sortable: false,
align:'right'
},
{
label:'时间',
prop:'created_at',
@ -217,6 +233,14 @@ export default {
this.getBudgets()
},
//
totalApplyMoney(){
let total = 0.00
this.payment.map(item => {
total += Number(item.apply_money)
})
return total.toFixed(2)
},
//
totalMoney(){
let total = 0.00
@ -225,6 +249,16 @@ export default {
})
return total.toFixed(2)
},
//
actNumsTotal(){
let total = 0
this.payment.map(item => {
if(Number(item.act_money)){
total ++
}
})
return total
},
//
percentPay(){
let total = this.totalMoney()
@ -271,9 +305,9 @@ export default {
this.plans = res.list.data
this.planTotal = res.list.total
this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
return item.plan_id
}))
// this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
// return item.plan_id
// }))
},
planPageChange(e){
this.plansPageIndex = e

@ -31,15 +31,10 @@
<span style="padding: 0 6px;word-break: keep-all;">
业务科室
</span>
<el-cascader
placeholder="选择业务科室"
size="small"
:value="select.department"
style="width: 160px;"
:options="departments"
:props="{ checkStrictly: true, label: 'name', value: 'id' }"
clearable
@change="e => select.department = e[e.length-1] || ''"/>
<el-select placeholder="业务科室选择" clearable size="small" v-model="select.department" style="width: 160px;">
<el-option v-for="item in departments" :label="item.name" :value="item.id" :key="item.id">
</el-option>
</el-select>
</div>
<div>
@ -516,6 +511,18 @@ export default {
return Number(value).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
}
},
{
label:'支付占比',
width: 180,
customFn:(row)=>{
let per = ((((row.fund_log_total)/row.money)||0)*100)?.toFixed(2) || 0
return (
<div style={{'color':per > 110 ? 'red' : 'green'}}>
{per.padStart(5,'0')}%
</div>
)
}
},
{
label:"合同预算价(元)",
width: 180,

@ -31,15 +31,10 @@
<span style="padding: 0 6px;word-break: keep-all;">
业务科室
</span>
<el-cascader
placeholder="选择业务科室"
size="small"
:value="select.department"
style="width: 160px;"
:options="departments"
:props="{ checkStrictly: true, label: 'name', value: 'id' }"
clearable
@change="e => select.department = e[e.length-1] || ''"/>
<el-select placeholder="业务科室选择" clearable size="small" v-model="select.department" style="width: 160px;">
<el-option v-for="item in departments" :label="item.name" :value="item.id" :key="item.id">
</el-option>
</el-select>
</div>
<div>

@ -26,7 +26,7 @@
</div>
<div class="payment-registration-row">
<div class="payment-registration-row-title">已付笔数</div>
<div class="payment-registration-row-content">{{payment.length}}</div>
<div class="payment-registration-row-content">{{actNumsTotal()}}</div>
<div class="payment-registration-row-content" style="color: #ff0000;padding-left: 16px;cursor: pointer;">
<Poptip :transfer="true">
<div>点击查看列表</div>
@ -115,7 +115,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>资金列支渠道
</div>
<div class="xy-table-item-content">
<el-select multiple style="width: 300px;" v-model="paymentRegistrationForm.moneyWay" placeholder="请选择资金列支渠道">
<el-select multiple style="width: 300px;" v-model="paymentRegistrationForm.moneyWay" placeholder="请选择资金列支渠道" @change="moneyWayChange">
<el-option v-for="item in planTypes" :value="item.id" :label="item.value"></el-option>
</el-select>
</div>
@ -134,7 +134,7 @@
</xy-table>
<div style="display: flex;justify-content: flex-end;">
<Page :total="planTotal" show-elevator @on-change="pageChange"/>
<Page :total="planTotal" show-elevator @on-change="planPageChange"/>
</div>
</template>
</xy-dialog>
@ -187,7 +187,7 @@ export default {
//isLast:false,
plan:[],
actMoney:'',
moneyWay:'',//
moneyWay:[],//
},
paymentRegistrationRules:{
applyMoney:[
@ -209,6 +209,10 @@ export default {
{required:true,message:"必填"}
]
},
plansSelect:{
page:1,
page_size:10
},
planTable:[
{
sortable:false,
@ -239,6 +243,20 @@ export default {
}
},
methods: {
//
moneyWayChange(){
let page = this.plansSelect.page
let pageSize = this.plansSelect.page_size
this.plansSelect = {
page:page,
page_size:pageSize
}
this.paymentRegistrationForm.moneyWay.forEach((item,index)=>{
this.plansSelect[`type[${index}]`] = item
})
this.getBudgets()
},
inputMoney(e,row){
row.use_money = e
this.paymentRegistrationForm.plan.forEach(item => {
@ -265,6 +283,16 @@ export default {
})
return moneyFormatter(total)
},
//
actNumsTotal(){
let total = 0
this.payment.map(item => {
if(Number(item.act_money)){
total ++
}
})
return total
},
//
percentPay(){
let total = 0
@ -283,9 +311,11 @@ export default {
this.paymentRegistrationForm.applyMoney = res.apply_money
this.paymentRegistrationForm.plan = res.plan_link
this.paymentRegistrationForm.discountMoney = res.discount_money
this.paymentRegistrationForm.actMoney = res.apply_money - res.discount_money
this.paymentRegistrationForm.actMoney = (res.apply_money - res.discount_money)?.toFixed(2)
this.paymentRegistrationForm.moneyWay = res.money_way_id?.split(',').map(item=>Number(item))
await this.getContract(res.contract)
await this.moneyWayChange()
},
//
@ -302,6 +332,19 @@ export default {
//
editor(){
console.log(this.paymentRegistrationForm)
let total = 0
this.paymentRegistrationForm.plan.forEach(item => {
total += Number(item.use_money)
})
console.log(Number(this.paymentRegistrationForm.actMoney),total)
if(Number(this.paymentRegistrationForm.actMoney) !== total){
Message({
type:'warning',
message:'实际付款金额与计划总金额不符'
})
return
}
editorFundLog({
id:this.registrationId,
contract_id:this.contract.id,
@ -322,7 +365,7 @@ export default {
//
//
async getBudgets(){
let res = await getBudget({name:this.searchContent,page_size:10,page:this.plansPageIndex})
let res = await getBudget(this.plansSelect)
this.plans = res.list.data
this.planTotal = res.list.total
@ -381,7 +424,7 @@ export default {
}
},
async mounted() {
await this.getBudgets()
//await this.getBudgets()
await this.getPlanTypes()
}
}

@ -19,15 +19,10 @@
科室
</span>
<span>
<el-cascader
placeholder="选择科室"
size="small"
:value="select.department"
style="width: 160px;"
:options="departments"
:props="{ checkStrictly: true, label: 'name', value: 'id' }"
clearable
@change="e => select.department = e[e.length-1] || ''"/>
<el-select placeholder="科室选择" clearable size="small" v-model="select.department" style="width: 160px;">
<el-option v-for="item in departments" :label="item.name" :value="item.id" :key="item.id">
</el-option>
</el-select>
</span>
<Button type="primary" style="margin-left: 10px" ghost @click="select = {pageIndex:1,year:'',type:'',department:''}">重置</Button>
@ -35,7 +30,7 @@
</slot>
</lx-header>
<xy-table :table-item="table" :list="list">
<xy-table ref="xyTable" :table-item="table" :list="list" :show-summary="true" :summary-method="summary">
<template v-slot:btns>
<div></div>
</template>
@ -51,6 +46,7 @@
import {getProgress} from "@/api/budget/budget"
import {listdeptNoAuth} from "@/api/system/department";
import {getparameter} from "@/api/system/dictionary";
import {moneyFormatter} from "@/utils";
export default {
data() {
@ -63,6 +59,8 @@ export default {
type:'',
department:''
},
rateTotal:'0%',
moneyTotal:0,
total:0,
list:[],
table:[
@ -98,7 +96,7 @@ export default {
prop:'content',
label:'描述',
align:'left',
minWidth:250
minWidth:300
},
{
prop:'rate',
@ -107,11 +105,41 @@ export default {
formatter:(cell,data,value)=>{
return value + '%'
}
},
{
prop:'use_money_total',
label:'使用金额',
align:'right',
width: 180
}
]
}
},
methods: {
//
summary(param){
this.$nextTick(()=>{
this.$refs['xyTable'].$children[0].doLayout()
})
const { columns, data } = param
const sums = []
columns.map((column,index) => {
if(index === 0){
sums[index] = '总计'
return
}
if(column.property === 'rate'){
sums[index] = this.rateTotal+'%'
return
}
if(column.property === 'use_money_total'){
sums[index] = moneyFormatter(this.moneyTotal)
}
})
return sums
},
async getType(){
const res = await getparameter({number:'money_way'})
this.type = res.detail
@ -136,8 +164,10 @@ export default {
type:this.select.type,
plan_department_id:this.select.department
})
this.list = res.data
this.total = res.total
this.list = res.list.data
this.total = res.list.total
this.rateTotal = res.rate
this.moneyTotal = res.use_money_total
console.log(res)
}
},

Loading…
Cancel
Save