master
xy 2 years ago
parent 2234ed73b6
commit 4dda3f007b

@ -2,9 +2,10 @@
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 = ''
VUE_APP_UPLOAD=http://hdcontract.ali251.langye.net/api/admin/upload-file VUE_APP_UPLOAD=http://hdcontract.ali251.langye.net/api/admin/upload-file
#VUE_APP_UPLOAD=http://192.168.60.99:9003/api/admin/upload-file
VUE_APP_OUT_URL = http://192.168.60.18:2021 VUE_APP_OUT_URL = http://192.168.60.18:2021

@ -104,6 +104,9 @@ export default {
selectClick(selection, row){ selectClick(selection, row){
this.$emit('select',selection, row) this.$emit('select',selection, row)
}, },
selectAll (selection) {
this.$emit('select-all',selection)
},
rowClick(selection, row){ rowClick(selection, row){
this.$emit('rowClick',selection, row) this.$emit('rowClick',selection, row)
}, },
@ -126,6 +129,9 @@ export default {
}, },
setCurrentRow (row) { setCurrentRow (row) {
this.$refs.table.setCurrentRow(row) this.$refs.table.setCurrentRow(row)
},
doLayout () {
this.$refs.table.doLayout()
} }
}, },
created() { created() {
@ -159,7 +165,7 @@ export default {
default-expand-all={defaultExpandAll} default-expand-all={defaultExpandAll}
tree-props={treeProps} tree-props={treeProps}
fit={true} fit={true}
on={{['select']:selectClick,['cell-click']:cellClick,['row-click']:rowClick}}> on={{['select']:selectClick,['cell-click']:cellClick,['row-click']:rowClick,['select-all']:this.selectAll}}>
{ {
// //
showIndex ? createIndexRow() : '' showIndex ? createIndexRow() : ''
@ -245,6 +251,7 @@ export default {
label-class-name={item.labelClassName} label-class-name={item.labelClassName}
sortable={item.sortable ?? true} sortable={item.sortable ?? true}
type={item.type} type={item.type}
reserve-selection={item.reserveSelection}
selectable={item.selectable} selectable={item.selectable}
scopedSlots={{ scopedSlots={{
header(scope){ header(scope){

@ -80,7 +80,12 @@
</slot> </slot>
</lx-header> </lx-header>
<xy-table :list="list" :table-item="table"> <xy-table :list="list"
ref="xyTable"
:table-item="table"
:show-summary="true"
:summary-method="summaryMethod"
@select="tableSelect" @select-all="tableSelect">
<template v-slot:btns> <template v-slot:btns>
<el-table-column <el-table-column
label="操作" label="操作"
@ -223,6 +228,7 @@ export default {
}, },
data() { data() {
return { return {
selections: [],
select: { select: {
plan_id: "", plan_id: "",
plan_name: "", plan_name: "",
@ -278,6 +284,13 @@ export default {
is_auth: 1, is_auth: 1,
status: "", status: "",
table: [ table: [
{
prop: 'summary',
type: 'selection',
width: 55,
fixed: 'left',
reserveSelection: true
},
{ {
label: "项目名称", label: "项目名称",
minWidth: 250, minWidth: 250,
@ -308,9 +321,10 @@ export default {
}, },
}, },
{ {
label: "款项类型", label: "备注",
prop: "type", minWidth: 460,
width: 120, prop: "remark",
align: "left",
}, },
{ {
label: "预算计划", label: "预算计划",
@ -333,22 +347,35 @@ export default {
}, },
}, },
{ {
prop: "status", label: "业务科室",
label: "状态", minWidth: 160,
width: 120, prop: "department.name",
formatter: (cell, data, value) => { align: "center",
if (value === 0) return "待审核";
else return "已审核";
}, },
{
label: "经办人",
minWidth: 160,
prop: "admin.name",
align: "center",
}, },
{ {
label: "次数", label: '付款日期',
prop: "pay_count", prop: 'act_date',
width: 95, width: 120,
},
{
label: "创建信息",
prop: "created_at",
width: 160,
formatter: (cell, data, value) => { formatter: (cell, data, value) => {
return value + 1; return parseTime(new Date(value), "{y}-{m}-{d}");
}, },
}, },
{
label: "款项类型",
prop: "type",
width: 120,
},
{ {
label: "是否为最后一笔", label: "是否为最后一笔",
prop: "is_end", prop: "is_end",
@ -358,35 +385,51 @@ export default {
}, },
}, },
{ {
label: "经办人", label: "次数",
minWidth: 160, prop: "pay_count",
prop: "admin.name", width: 95,
align: "center", formatter: (cell, data, value) => {
return value + 1;
}, },
{
label: "业务科室",
minWidth: 160,
prop: "department.name",
align: "center",
}, },
{ {
label: "备注", prop: "status",
minWidth: 460, label: "状态",
prop: "remark", width: 120,
align: "left",
},
{
label: "创建信息",
prop: "created_at",
width: 160,
formatter: (cell, data, value) => { formatter: (cell, data, value) => {
return parseTime(new Date(value), "{y}-{m}-{d}"); if (value === 0) return "待审核";
else return "已审核";
}, },
}, },
], ],
}; };
}, },
methods: { methods: {
summaryMethod ({columns,data}) {
const fn = (prop) => this.selections.reduce((pre,cur) => pre + Number(cur[prop]),0).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,");
return columns.map((column, index) => {
if (index === 0) {
return '统计'
}
else if (column.property === 'apply_money') {
return fn(column.property)
}
else if (column.property === 'act_money') {
return fn(column.property)
}
else if (column.property === 'pay_count') {
return this.selections.reduce((pre,cur) => pre + Number(cur[column.property]),0) + this.selections.length
} else {
return '';
}
})
},
tableSelect (selections) {
console.log(selections)
this.selections = selections;
this.list = [...this.list]
},
toExport() { toExport() {
this.is_export = 1; this.is_export = 1;
this.getFundLogs(true); this.getFundLogs(true);

@ -43,9 +43,14 @@
return h( return h(
"a", { "a", {
attrs: { attrs: {
download: row.file.original_name, //download: row.file.original_name,
href: row.file.url //href: row.file.url
}, },
on: {
['click']:e => {
window.open(row.file.url)
}
}
}, },
row.file.original_name row.file.original_name
); );

@ -277,6 +277,12 @@ export default {
.replace(/(\d)(?=(\d{3})+\.)/g, "$1,"); .replace(/(\d)(?=(\d{3})+\.)/g, "$1,");
}, },
}, },
{
label: "备注",
minWidth: 360,
prop: "remark",
align: "left",
},
{ {
label: "预算计划", label: "预算计划",
width: 320, width: 320,
@ -298,28 +304,35 @@ export default {
}, },
}, },
{ {
label: "款项类型", label: "业务科室",
prop: "type", minWidth: 140,
width: 120, prop: "department.name",
align: "center",
}, },
{ {
prop: "status", label: "经办人",
label: "状态", minWidth: 120,
width: 100, prop: "admin.name",
formatter: (cell, data, value) => { align: "center",
if (value === 0) return "待审核";
else return "已审核";
}, },
{
label: '付款日期',
prop: 'act_date',
width: 120,
}, },
{ {
label: "次数", label: "创建信息",
prop: "pay_count", prop: "created_at",
width: 95, width: 160,
formatter: (cell, data, value) => { formatter: (cell, data, value) => {
return value + 1; return parseTime(new Date(value), "{y}-{m}-{d}");
}, },
}, },
{
label: "款项类型",
prop: "type",
width: 120,
},
{ {
label: "最后一笔", label: "最后一笔",
prop: "is_end", prop: "is_end",
@ -329,29 +342,20 @@ export default {
}, },
}, },
{ {
label: "经办人", label: "次数",
minWidth: 120, prop: "pay_count",
prop: "admin.name", width: 95,
align: "center", formatter: (cell, data, value) => {
}, return value + 1;
{
label: "业务科室",
minWidth: 140,
prop: "department.name",
align: "center",
}, },
{
label: "备注",
minWidth: 360,
prop: "remark",
align: "left",
}, },
{ {
label: "创建信息", prop: "status",
prop: "created_at", label: "状态",
width: 160, width: 100,
formatter: (cell, data, value) => { formatter: (cell, data, value) => {
return parseTime(new Date(value), "{y}-{m}-{d}"); if (value === 0) return "待审核";
else return "已审核";
}, },
}, },
], ],

Loading…
Cancel
Save