master
271556543@qq.com 4 years ago
parent 1a0c1a1c2f
commit 27dc2fffcd

@ -2,8 +2,8 @@
ENV = 'development' ENV = 'development'
# base api # base api
VUE_APP_DOMIAN=http://192.168.60.99:9003/ #VUE_APP_DOMIAN=http://192.168.60.99:9003/
#VUE_APP_DOMIAN=http://hdcontract.ali251.langye.net/ VUE_APP_DOMIAN=http://hdcontract.ali251.langye.net/
VUE_APP_BASE_API = '' VUE_APP_BASE_API = ''

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

@ -22,15 +22,10 @@
科室 科室
</span> </span>
<span> <span>
<el-cascader <el-select placeholder="科室选择" clearable size="small" v-model="select.department" style="width: 160px;">
placeholder="选择科室" <el-option v-for="item in departments" :label="item.name" :value="item.id" :key="item.id">
size="small" </el-option>
:value="select.department" </el-select>
style="width: 160px;"
:options="departments"
:props="{ checkStrictly: true, label: 'name', value: 'id' }"
clearable
@change="e => select.department = e[e.length-1] || ''"/>
</span> </span>
<Button type="primary" style="margin-left: 10px" @click="getBudgets"></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 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-title">合同金额</div>
<div class="payment-registration-row-content">{{priceFormat(contract.money)}} </div> <div class="payment-registration-row-content">{{priceFormat(contract.money)}} </div>
</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 style="display: flex">
<div class="payment-registration-row"> <div class="payment-registration-row">
<div class="payment-registration-row-title">已付金额</div> <div class="payment-registration-row-title">已付金额</div>
@ -26,7 +36,7 @@
</div> </div>
<div class="payment-registration-row"> <div class="payment-registration-row">
<div class="payment-registration-row-title">已付笔数</div> <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;"> <div class="payment-registration-row-content" style="color: #ff0000;padding-left: 16px;cursor: pointer;">
<Poptip :transfer="true"> <Poptip :transfer="true">
<div>点击查看列表</div> <div>点击查看列表</div>
@ -139,11 +149,17 @@ export default {
payment:[],// payment:[],//
payTable:[ payTable:[
{ {
label:'支付金额', label:'申请金额',
prop:'apply_money', prop:'apply_money',
sortable:false, sortable:false,
align:'right' align:'right'
}, },
{
label:'已付金额',
prop:'act_money',
sortable: false,
align:'right'
},
{ {
label:'时间', label:'时间',
prop:'created_at', prop:'created_at',
@ -217,6 +233,14 @@ export default {
this.getBudgets() this.getBudgets()
}, },
//
totalApplyMoney(){
let total = 0.00
this.payment.map(item => {
total += Number(item.apply_money)
})
return total.toFixed(2)
},
// //
totalMoney(){ totalMoney(){
let total = 0.00 let total = 0.00
@ -225,6 +249,16 @@ export default {
}) })
return total.toFixed(2) return total.toFixed(2)
}, },
//
actNumsTotal(){
let total = 0
this.payment.map(item => {
if(Number(item.act_money)){
total ++
}
})
return total
},
// //
percentPay(){ percentPay(){
let total = this.totalMoney() let total = this.totalMoney()
@ -271,9 +305,9 @@ export default {
this.plans = res.list.data this.plans = res.list.data
this.planTotal = res.list.total this.planTotal = res.list.total
this.toggleSelection(this.paymentRegistrationForm.plan.map(item => { // this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
return item.plan_id // return item.plan_id
})) // }))
}, },
planPageChange(e){ planPageChange(e){
this.plansPageIndex = e this.plansPageIndex = e

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

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

@ -26,7 +26,7 @@
</div> </div>
<div class="payment-registration-row"> <div class="payment-registration-row">
<div class="payment-registration-row-title">已付笔数</div> <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;"> <div class="payment-registration-row-content" style="color: #ff0000;padding-left: 16px;cursor: pointer;">
<Poptip :transfer="true"> <Poptip :transfer="true">
<div>点击查看列表</div> <div>点击查看列表</div>
@ -115,7 +115,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>资金列支渠道 <span style="color: red;font-weight: 600;padding-right: 4px;">*</span>资金列支渠道
</div> </div>
<div class="xy-table-item-content"> <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-option v-for="item in planTypes" :value="item.id" :label="item.value"></el-option>
</el-select> </el-select>
</div> </div>
@ -134,7 +134,7 @@
</xy-table> </xy-table>
<div style="display: flex;justify-content: flex-end;"> <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> </div>
</template> </template>
</xy-dialog> </xy-dialog>
@ -187,7 +187,7 @@ export default {
//isLast:false, //isLast:false,
plan:[], plan:[],
actMoney:'', actMoney:'',
moneyWay:'',// moneyWay:[],//
}, },
paymentRegistrationRules:{ paymentRegistrationRules:{
applyMoney:[ applyMoney:[
@ -209,6 +209,10 @@ export default {
{required:true,message:"必填"} {required:true,message:"必填"}
] ]
}, },
plansSelect:{
page:1,
page_size:10
},
planTable:[ planTable:[
{ {
sortable:false, sortable:false,
@ -239,6 +243,20 @@ export default {
} }
}, },
methods: { 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){ inputMoney(e,row){
row.use_money = e row.use_money = e
this.paymentRegistrationForm.plan.forEach(item => { this.paymentRegistrationForm.plan.forEach(item => {
@ -265,6 +283,16 @@ export default {
}) })
return moneyFormatter(total) return moneyFormatter(total)
}, },
//
actNumsTotal(){
let total = 0
this.payment.map(item => {
if(Number(item.act_money)){
total ++
}
})
return total
},
// //
percentPay(){ percentPay(){
let total = 0 let total = 0
@ -283,9 +311,11 @@ export default {
this.paymentRegistrationForm.applyMoney = res.apply_money this.paymentRegistrationForm.applyMoney = res.apply_money
this.paymentRegistrationForm.plan = res.plan_link this.paymentRegistrationForm.plan = res.plan_link
this.paymentRegistrationForm.discountMoney = res.discount_money 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.getContract(res.contract)
await this.moneyWayChange()
}, },
// //
@ -302,6 +332,19 @@ export default {
// //
editor(){ 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({ editorFundLog({
id:this.registrationId, id:this.registrationId,
contract_id:this.contract.id, contract_id:this.contract.id,
@ -322,7 +365,7 @@ export default {
// //
// //
async getBudgets(){ 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.plans = res.list.data
this.planTotal = res.list.total this.planTotal = res.list.total
@ -381,7 +424,7 @@ export default {
} }
}, },
async mounted() { async mounted() {
await this.getBudgets() //await this.getBudgets()
await this.getPlanTypes() await this.getPlanTypes()
} }
} }

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

Loading…
Cancel
Save