master
xy 3 years ago
parent 0f2b5c897e
commit 97134ed096

File diff suppressed because it is too large Load Diff

@ -0,0 +1,163 @@
<template>
<div style="padding: 0 20px">
<lx-header
icon="md-apps"
text="资金申请记录"
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
>
<div slot="content"></div>
<slot>
<span style="padding: 0 6px; word-break: keep-all">关键字</span>
<span>
<Input
v-model="select.keyword"
placeholder="请输入关键字"
style="width: 180px"
></Input>
</span>
<Button type="primary" style="margin-left: 10px" ghost @click=""
>重置</Button
>
<Button type="primary" style="margin-left: 10px" @click="getList"
>查询</Button
>
</slot>
</lx-header>
<xy-table
:list="list"
:table-item="table"
>
<template #btns> </template>
</xy-table>
<div style="display: flex; justify-content: flex-end; margin-top: 10px">
<Page
:total="total"
show-elevator
@on-change="
(e) => {
select.page = e;
getList();
}
"
/>
</div>
</div>
</template>
<script>
import { index, destroy } from "@/api/govPlane";
export default {
data() {
return {
select: {
page: 1,
page_size: 10,
keyword: "",
},
total: 0,
list: [],
table: [
{
prop: "department.name",
label: "责任科室",
width: 160,
},
{
prop: "name",
label: "项目名称",
width: 180,
},
{
prop: "content",
label: "项目内容",
minWidth: 220,
align: "left",
},
{
prop: "plan_money",
label: "采购预算",
width: 160,
align: "right",
formatter: (cell, data, value) => {
return `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
},
},
{
prop: "public_plane_date",
label: "采购意向公开计划时间",
width: 190,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
},
},
{
prop: "public_act_date",
label: "采购意向公开实际时间",
width: 190,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
},
},
{
prop: "invite_plane_date",
label: "招标文件挂网计划时间",
width: 190,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
},
},
{
prop: "invite_act_date",
label: "招标文件挂网实际时间",
width: 190,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
},
},
{
prop: "open_plane_date",
label: "项目开标计划时间",
width: 180,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
},
},
{
prop: "open_act_date",
label: "项目开标实际时间",
width: 180,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
},
},
],
};
},
methods: {
async getList() {
const res = await index(this.select);
this.total = res.total;
this.list = res.data;
},
destroy (row) {
destroy({ id: row.id }).then(res => {
this.$message({
type: 'success',
message: '删除成功'
})
this.getList()
})
}
},
computed: {},
created() {
this.getList();
},
};
</script>
<style scoped lang="scss"></style>

@ -1,346 +1,349 @@
<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" text="预算计划" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<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 placeholder="选择所属年份" type="year" placement="bottom" :value="select.year" style="width: 130px;"
@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 placeholder="选择预算类型" v-model="select.type" style="width:130px;" clearable>
<Option v-for="item in types" :value="item.id" :key="item.id">{{ item.value }}</Option> <Option v-for="item in types" :value="item.id" :key="item.id">{{ item.value }}</Option>
</Select> </Select>
</span> </span>
<span style="padding: 0 6px;"> <span style="padding: 0 6px;">
科室 科室
</span> </span>
<span> <span>
<el-select placeholder="科室选择" clearable size="small" v-model="select.department" style="width: 160px;"> <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 v-for="item in departments" :label="item.name" :value="item.id" :key="item.id">
</el-option> </el-option>
</el-select> </el-select>
</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" <Button type="primary" style="margin-left: 10px"
@click="()=>select={page:1,year:'', type:'', department:''}">重置</Button> @click="()=>select={page:1,year:'', type:'', department:''}">重置</Button>
</div> <Button class="slot-btns-item" size="small" type="primary" @click="">
</slot> 资金申请
</lx-header> </Button>
</div>
<xy-table ref="xyTable" :objectSpanMethod="objectSpanMethod" :table-item="table" :list="list" :show-summary="true" </slot>
:summary-method="summary"> </lx-header>
<template v-slot:btns>
<div></div> <xy-table ref="xyTable" :objectSpanMethod="objectSpanMethod" :table-item="table" :list="list" :show-summary="true"
</template> :summary-method="summary">
</xy-table> <template v-slot:btns>
<div></div>
<div style="display: flex;justify-content: flex-end;"> </template>
<Page :total="total" show-elevator @on-change="pageChange" show-sizer @on-page-size-change="pageSizeChange" /> </xy-table>
</div>
</div> <div style="display: flex;justify-content: flex-end;">
</template> <Page :total="total" show-elevator @on-change="pageChange" show-sizer @on-page-size-change="pageSizeChange" />
</div>
<script> </div>
import { </template>
getBudget,
detailBudget <script>
} from "@/api/budget/budget" import {
import { getBudget,
listdeptNoAuth detailBudget
} from "@/api/system/department" } from "@/api/budget/budget"
import { import {
getparameter listdeptNoAuth
} from '@/api/system/dictionary' } from "@/api/system/department"
import { import {
moneyFormatter, getparameter
parseTime } from '@/api/system/dictionary'
} from "@/utils" import {
import { moneyFormatter,
mergeTableRow parseTime
} from "@/utils/mergeTableRow" } from "@/utils"
export default { import {
data() { mergeTableRow
return { } from "@/utils/mergeTableRow"
isShowAdd: false, export default {
types: [], data() {
form: { return {
name: "", isShowAdd: false,
type: "", types: [],
year: "", form: {
department: "", name: "",
money: "", type: "",
content: "", year: "",
remark: "" department: "",
}, money: "",
rules: { content: "",
name: [{ remark: ""
required: true, },
message: "必填项" rules: {
}], name: [{
type: [{ required: true,
required: true, message: "必填项"
message: "必选项" }],
}], type: [{
year: [{ required: true,
required: true, message: "必选项"
message: "必选项" }],
}], year: [{
department: [{ required: true,
required: true, message: "必选项"
message: "必选项" }],
}], department: [{
money: [{ required: true,
required: true, message: "必选项"
message: "必填项" }],
}, money: [{
{ required: true,
pattern: /^\d+(\.\d+)?$/, message: "必填项"
message: '必须为数字' },
} {
], pattern: /^\d+(\.\d+)?$/,
content: [{ message: '必须为数字'
required: true, }
message: "必填项" ],
}] content: [{
}, required: true,
list: [], message: "必填项"
totalMoney: 0, }]
total: 0, },
pageIndex: 1, list: [],
pageSize: 10, totalMoney: 0,
table: [{ total: 0,
label: "隶属项目", pageIndex: 1,
prop: 'pid_info_name', pageSize: 10,
width: 200, table: [{
align: 'left', label: "隶属项目",
sortable: false, prop: 'pid_info_name',
fixed: 'left' width: 200,
}, align: 'left',
{ sortable: false,
label: "项目名称", fixed: 'left'
prop: 'name', },
width: 200, {
align: 'left', label: "项目名称",
sortable: false, prop: 'name',
fixed: 'left' width: 200,
}, align: 'left',
{ sortable: false,
label: "预算类型", fixed: 'left'
prop: 'type', },
width: 115, {
formatter: (cell, data, value) => { label: "预算类型",
let res = this.types.filter(item => { prop: 'type',
return item.id === value width: 115,
}) formatter: (cell, data, value) => {
return res[0]?.value || '未知' let res = this.types.filter(item => {
} return item.id === value
}, })
{ return res[0]?.value || '未知'
label: "所属年份", }
prop: 'year', },
width: 105 {
}, label: "所属年份",
{ prop: 'year',
label: "相关科室", width: 105
prop: 'plan_department.name', },
width: 110 {
}, label: "相关科室",
{ prop: 'plan_department.name',
label: '年初预算金额(元)', width: 110
prop: 'money', },
align: 'right', {
width: 180, label: '年初预算金额(元)',
formatter: (cell, data, value) => { prop: 'money',
return moneyFormatter(value) align: 'right',
} width: 180,
}, formatter: (cell, data, value) => {
{ return moneyFormatter(value)
label: '调整后预算金额(元)', }
prop: 'update_money', },
align: 'right', {
width: 200, label: '调整后预算金额(元)',
formatter: (cell, data, value) => { prop: 'update_money',
return moneyFormatter(value) align: 'right',
} width: 200,
}, formatter: (cell, data, value) => {
{ return moneyFormatter(value)
label: "创建信息", }
prop: 'created_at', },
width: 160, {
formatter: (cell, data, value) => { label: "创建信息",
return parseTime(new Date(value), '{y}-{m}-{d}') prop: 'created_at',
} width: 160,
}, formatter: (cell, data, value) => {
{ return parseTime(new Date(value), '{y}-{m}-{d}')
label: "描述", }
minWidth: 300, },
prop: 'content', {
align: 'left', label: "描述",
sortable: false minWidth: 300,
}, prop: 'content',
], align: 'left',
select: { sortable: false
page: 1, },
year: "", ],
type: "", select: {
department: "" page: 1,
}, year: "",
departments: [], // type: "",
department: ""
// },
isShowEditor: false, departments: [], //
editorForm: {},
} //
}, isShowEditor: false,
methods: { editorForm: {},
async getTypes() { }
const res = await getparameter({ },
number: 'money_way' methods: {
}) async getTypes() {
this.types = res.detail const res = await getparameter({
}, // number: 'money_way'
objectSpanMethod({ })
row, this.types = res.detail
column, }, //
rowIndex, objectSpanMethod({
columnIndex row,
}) { column,
const span = column['property'] + '-span' rowIndex,
if (row[span]) { columnIndex
return row[span] }) {
} const span = column['property'] + '-span'
}, if (row[span]) {
return row[span]
// }
summary(param) { },
this.$nextTick(() => {
this.$refs['xyTable'].$children[0].doLayout() //
}) summary(param) {
const { this.$nextTick(() => {
columns, this.$refs['xyTable'].$children[0].doLayout()
data })
} = param const {
const sums = [] columns,
columns.map((column, index) => { data
if (index === 0) { } = param
sums[index] = '总计' const sums = []
return columns.map((column, index) => {
} if (index === 0) {
if (column.property === 'money') { sums[index] = '总计'
sums[index] = moneyFormatter(this.totalMoney) return
return }
} if (column.property === 'money') {
// const values = data.map(item => Number(item[column.property])); sums[index] = moneyFormatter(this.totalMoney)
// if (!values.every(value => isNaN(value)) && (column.property === 'money' || column.property === 'plan_price'|| column.property === 'fund_log_total')) { return
// }
// sums[index] = sums[index].toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,') // const values = data.map(item => Number(item[column.property]));
// } else { // if (!values.every(value => isNaN(value)) && (column.property === 'money' || column.property === 'plan_price'|| column.property === 'fund_log_total')) {
// sums[index] = ''; //
// } // sums[index] = sums[index].toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
}) // } else {
return sums // sums[index] = '';
}, // }
pageSizeChange(e) { })
this.pageIndex = 1; return sums
this.pageSize = e; },
this.getBudgets() pageSizeChange(e) {
}, this.pageIndex = 1;
// this.pageSize = e;
pageChange(e) { this.getBudgets()
this.pageIndex = e },
this.getBudgets() //
}, pageChange(e) {
// this.pageIndex = e
getDepartment() { this.getBudgets()
listdeptNoAuth().then(res => { },
this.departments = res //
}) getDepartment() {
}, listdeptNoAuth().then(res => {
// this.departments = res
getBudgets() { })
getBudget({ },
page_size: this.pageSize, //
page: this.pageIndex, getBudgets() {
year: this.select.year, getBudget({
type: this.select.type, page_size: this.pageSize,
plan_department_id: this.select.department, page: this.pageIndex,
top_pid: 1 year: this.select.year,
}).then(res => { type: this.select.type,
plan_department_id: this.select.department,
for (var m of res.list.data) { top_pid: 1
m.pid_info_name = m.pid_info?.name }).then(res => {
}
this.list = for (var m of res.list.data) {
mergeTableRow({ m.pid_info_name = m.pid_info?.name
data: res.list.data, }
mergeColNames: ["pid_info_name"], // this.list =
firstMergeColNames: ["pid_info_name"], // firstMerge mergeTableRow({
firstMerge: 'pid_info_name' // data: res.list.data,
}) mergeColNames: ["pid_info_name"], //
this.total = res.list.total firstMergeColNames: ["pid_info_name"], // firstMerge
this.totalMoney = res.total_money firstMerge: 'pid_info_name' //
}) })
}, this.total = res.list.total
showEditor(row) { this.totalMoney = res.total_money
this.getDepartment() })
detailBudget({ },
id: row.id showEditor(row) {
}).then(res => { this.getDepartment()
this.editorForm = { detailBudget({
id: res.id, id: row.id
name: res.name, }).then(res => {
type: res.type, this.editorForm = {
department: res.plan_department_id, id: res.id,
money: res.money, name: res.name,
year: res.year, type: res.type,
content: res.content, department: res.plan_department_id,
remark: res.remark money: res.money,
} year: res.year,
this.isShowEditor = true content: res.content,
console.log(this.editorForm) remark: res.remark
}) }
}, this.isShowEditor = true
}, console.log(this.editorForm)
created() { })
},
this.select.year = this.$moment().format('YYYY'); },
}, created() {
mounted() {
this.getTypes() this.select.year = this.$moment().format('YYYY');
this.getDepartment() },
this.getBudgets() mounted() {
} this.getTypes()
} this.getDepartment()
</script> this.getBudgets()
}
<style scoped lang="scss"> }
.xy-table-item-label { </script>
width: 140px;
} <style scoped lang="scss">
.xy-table-item-label {
.xy-table-item-price { width: 140px;
position: relative; }
&::after { .xy-table-item-price {
z-index: 1; position: relative;
position: absolute;
right: 0; &::after {
top: 0; z-index: 1;
content: '(元)' position: absolute;
} right: 0;
top: 0;
::v-deep .el-input__clear { content: '(元)'
position: relative; }
right: 30px;
z-index: 2; ::v-deep .el-input__clear {
} position: relative;
} right: 30px;
z-index: 2;
}
}
</style> </style>

@ -184,6 +184,23 @@
</div> </div>
</div> </div>
</template> </template>
<template #gov_plane_id v-if="detail.methods === 1">
<div class="xy-table-item">
<div class="xy-table-item-label">
政府采购项目
</div>
<div class="xy-table-item-content">
<div class="contract-add-plan" style="width: 300px;" @click="$refs['govPlane'].setSelected(detail.gov_plane_id),$refs['govPlane'].show()">
<template v-if="detail.gov_plane_id">
<Tag closable color="primary" @on-close="detail.gov_plane_id = ''">{{ detail.gov_plane_id ? (detail.gov_plane.name || $refs['govPlane'].selected.name) : '' }}</Tag>
</template>
<template v-else>
<div class="contract-add-plan-no-plan">请选择政府采购项目</div>
</template>
</div>
</div>
</div>
</template>
</xy-dialog> </xy-dialog>
@ -213,6 +230,8 @@
<Button type="primary" @click="isShowPlan = false">确定</Button> <Button type="primary" @click="isShowPlan = false">确定</Button>
</template> </template>
</xy-dialog> </xy-dialog>
<govPlane ref="govPlane" @selected="row => detail.gov_plane_id = row.id"></govPlane>
</div> </div>
</template> </template>
@ -232,7 +251,9 @@
import { import {
Message Message
} from 'element-ui' } from 'element-ui'
import govPlane from "@/views/contract/components/govPlane.vue";
export default { export default {
components: {govPlane},
props: { props: {
purchaseType: Array, purchaseType: Array,
moneyWay: Array, moneyWay: Array,
@ -567,7 +588,9 @@
new_money: item.money new_money: item.money
} }
} }
}) }),
gov_plane_id: res.gov_plane_id,
gov_plane: res.gov_plane
} }
this.plan = this.detail.plan this.plan = this.detail.plan
}, },

@ -132,6 +132,9 @@ export default {
hide() { hide() {
this.dialogVisible = false this.dialogVisible = false
}, },
setSelected (gov_plane_id) {
this.selected = this.data.find(i => i.id === gov_plane_id)
},
unique (arr) { unique (arr) {
const res= new Map() const res= new Map()

Loading…
Cancel
Save