master
xy 2 years ago
parent 76b5cb86e3
commit 8840e8c2ff

@ -276,7 +276,12 @@
style="margin-bottom: 10px; border: 0px; margin-top: 25px" style="margin-bottom: 10px; border: 0px; margin-top: 25px"
> >
<div slot="content"> <div slot="content">
<xy-table :cell-style="nopayCellStyle" :height="300" :list="nopay" :table-item="nopayTable"> <xy-table
:cell-style="nopayCellStyle"
:height="300"
:list="nopay"
:table-item="nopayTable"
>
<template v-slot:btns> </template> <template v-slot:btns> </template>
</xy-table> </xy-table>
</div> </div>
@ -314,7 +319,7 @@ export default {
prop: "name", prop: "name",
label: "合同名称", label: "合同名称",
width: 280, width: 280,
align:"left" align: "left",
}, },
{ {
prop: "money", prop: "money",
@ -338,7 +343,7 @@ export default {
prop: "supply", prop: "supply",
label: "承包商/供货商", label: "承包商/供货商",
minWidth: 160, minWidth: 160,
align:"left" align: "left",
}, },
{ {
label: "服务时间", label: "服务时间",
@ -352,6 +357,11 @@ export default {
); );
}, },
}, },
{
label: "部门",
prop: "department.name",
width: 160,
},
], ],
departmentTotal: [], departmentTotal: [],
departmentTotalTable: [ departmentTotalTable: [
@ -389,7 +399,7 @@ export default {
prop: "name", prop: "name",
label: "合同名称", label: "合同名称",
width: 180, width: 180,
align:"left" align: "left",
}, },
{ {
prop: "money", prop: "money",
@ -449,7 +459,7 @@ export default {
prop: "name", prop: "name",
label: "合同名称", label: "合同名称",
width: 180, width: 180,
align:"left" align: "left",
}, },
{ {
prop: "money", prop: "money",
@ -467,7 +477,7 @@ export default {
prop: "supply", prop: "supply",
label: "承包商/供货商", label: "承包商/供货商",
width: 160, width: 160,
align:"left" align: "left",
}, },
{ {
label: "服务时间", label: "服务时间",
@ -527,7 +537,7 @@ export default {
prop: "supply", prop: "supply",
label: "承包商/供货商", label: "承包商/供货商",
width: 160, width: 160,
align:"left" align: "left",
}, },
{ {
label: "服务时间", label: "服务时间",
@ -576,7 +586,7 @@ export default {
prop: "name", prop: "name",
label: "合同名称", label: "合同名称",
width: 180, width: 180,
align:"left" align: "left",
}, },
{ {
prop: "money", prop: "money",
@ -594,7 +604,7 @@ export default {
prop: "supply", prop: "supply",
label: "承包商/供货商", label: "承包商/供货商",
width: 160, width: 160,
align:"left" align: "left",
}, },
{ {
label: "服务时间", label: "服务时间",
@ -637,7 +647,7 @@ export default {
prop: "name", prop: "name",
label: "合同名称", label: "合同名称",
width: 180, width: 180,
align:"left" align: "left",
}, },
{ {
prop: "money", prop: "money",
@ -655,7 +665,7 @@ export default {
prop: "supply", prop: "supply",
label: "承包商/供货商", label: "承包商/供货商",
width: 160, width: 160,
align:"left" align: "left",
}, },
{ {
label: "服务时间", label: "服务时间",
@ -698,7 +708,7 @@ export default {
prop: "name", prop: "name",
label: "合同名称", label: "合同名称",
width: 180, width: 180,
align:"left" align: "left",
}, },
{ {
prop: "money", prop: "money",
@ -716,7 +726,7 @@ export default {
prop: "supply", prop: "supply",
label: "承包商/供货商", label: "承包商/供货商",
width: 160, width: 160,
align:"left" align: "left",
}, },
{ {
label: "服务时间", label: "服务时间",
@ -761,7 +771,7 @@ export default {
prop: "name", prop: "name",
label: "合同名称", label: "合同名称",
width: 180, width: 180,
align:"left" align: "left",
}, },
{ {
prop: "money", prop: "money",
@ -779,7 +789,7 @@ export default {
prop: "supply", prop: "supply",
label: "承包商/供货商", label: "承包商/供货商",
width: 160, width: 160,
align:"left" align: "left",
}, },
{ {
label: "服务时间", label: "服务时间",
@ -822,7 +832,7 @@ export default {
prop: "name", prop: "name",
label: "合同名称", label: "合同名称",
width: 180, width: 180,
align:"left" align: "left",
}, },
{ {
prop: "money", prop: "money",
@ -1032,27 +1042,35 @@ export default {
}, },
methods: { methods: {
nopayCellStyle({ row }) { nopayCellStyle({ row }) {
let per = ((((row.fund_log_total) / row.money) || 0) * 100)?.toFixed(2) || 0 let per = ((row.fund_log_total / row.money || 0) * 100)?.toFixed(2) || 0;
let endDay = this.$moment(new Date()).diff(this.$moment(new Date(row.end_date)),'months') let endDay = this.$moment(new Date()).diff(
this.$moment(new Date(row.end_date)),
"months"
);
if (per < 100 && endDay >= 6) { if (per < 100 && endDay >= 6) {
return { return {
'background': '#ef6256ee', background: "#ef625688",
'color': '#fff' color: "#fff",
} };
} }
}, },
async getNopay() { async getNopay() {
const res = await nopayTotal({ const res = await nopayTotal({
is_auth: 1, is_auth: 1,
//year: this.select.year //year: this.select.year
}); });
this.nopay = res.filter(i => i.momey != 0); this.nopay = res
.filter((i) => i.momey != 0)
.sort((a, b) => {
return (
new Date(a.end_date).getTime() - new Date(b.end_date).getTime()
);
});
}, },
async getDepartmnetTotal() { async getDepartmnetTotal() {
const res = await departmentTotal({ const res = await departmentTotal({
is_auth: 1, is_auth: 1,
year: this.select.year year: this.select.year,
}); });
this.departmentTotal = res; this.departmentTotal = res;
}, },
@ -1061,7 +1079,7 @@ export default {
this.select.year = e; this.select.year = e;
this.getStatistic(); this.getStatistic();
this.getNopay(); this.getNopay();
this.getDepartmnetTotal() this.getDepartmnetTotal();
}, },
async getStatistic() { async getStatistic() {
const res = await statistic(this.select); const res = await statistic(this.select);

@ -38,8 +38,14 @@ export default {
title: "文件", title: "文件",
width: 200, width: 200,
render: (h, { row }) => { render: (h, { row }) => {
return h('a',{ attrs: { download: row.file.original_name, href: row.file.url } },row.file.original_name) return h(
} "a",
{
attrs: { download: row.file.original_name, href: row.file.url },
},
row.file.original_name
);
},
}, },
{ {
key: "content", key: "content",
@ -81,15 +87,15 @@ export default {
}, },
on: { on: {
["on-ok"]: (_) => { ["on-ok"]: (_) => {
let attachments = this.detail.attachment.filter( let attachments = this.detail.attachment
(i) => i.id !== row.id .filter((i) => i.id !== row.id)
).map(i => { .map((i) => {
return { return {
file: i.file.id, file: i.file.id,
date: i.date, date: i.date,
content: i.content content: i.content,
} };
}) });
save({ save({
...this.detail, ...this.detail,
attachment_list: attachments, attachment_list: attachments,
@ -195,12 +201,13 @@ export default {
"file-list": this.fileList, "file-list": this.fileList,
limit: 1, limit: 1,
headers: { headers: {
Authorization: "Bearer " + getToken() Authorization: "Bearer " + getToken(),
}, },
accept: ".rar,.zip,.doc,.docx,.pdf,.jpg,.png,.gif,.mp4,.xls,.xlsx", accept:
".rar,.zip,.doc,.docx,.pdf,.jpg,.png,.gif,.mp4,.xls,.xlsx",
"on-success": (response, file, fileList) => { "on-success": (response, file, fileList) => {
this.fileList = fileList this.fileList = fileList;
form.file = response?.id form.file = response?.id;
}, },
"before-upload": (file) => { "before-upload": (file) => {
if (file.size / 1000 > 5 * 1024) { if (file.size / 1000 > 5 * 1024) {
@ -212,8 +219,8 @@ export default {
} }
}, },
"on-remove": (file, fileList) => { "on-remove": (file, fileList) => {
this.fileList = fileList this.fileList = fileList;
} },
}, },
}, },
[ [

@ -47,53 +47,59 @@ export default {
width: 160, width: 160,
}, },
{ {
key: 'operate', key: "operate",
title: '操作', title: "操作",
width: 100, width: 100,
align: 'left', align: "left",
render: (h, { row }) => { render: (h, { row }) => {
return h('Poptip',{ return h("Poptip", {
props: { props: {
transfer: true, transfer: true,
confirm: true, confirm: true,
title: "确认要删除吗" title: "确认要删除吗",
}, },
scopedSlots: { scopedSlots: {
default: () => { default: () => {
return h('Button',{ return h(
"Button",
{
props: { props: {
ghost: true, ghost: true,
size: 'small', size: "small",
type: 'error' type: "error",
} },
},'删除') },
} "删除"
);
},
}, },
on: { on: {
['on-ok']:_ =>{ ["on-ok"]: (_) => {
let contents = this.detail.content.filter(i => i.id !== row.id) let contents = this.detail.content.filter(
(i) => i.id !== row.id
);
save({ save({
...this.detail, ...this.detail,
content_list: contents, content_list: contents,
attachment_list: this.detail.attachment.map(i => { attachment_list: this.detail.attachment.map((i) => {
return { return {
date: i.date, date: i.date,
content: i.content, content: i.content,
file: i.file.id file: i.file.id,
} };
}) }),
}).then(_ => { }).then((_) => {
this.$message({ this.$message({
type: 'success', type: "success",
message: '删除成功' message: "删除成功",
}) });
this.getDetail() this.getDetail();
}) });
} },
} },
}) });
} },
} },
], ],
}; };
}, },
@ -218,7 +224,7 @@ export default {
}); });
instance.confirmButtonLoading = false; instance.confirmButtonLoading = false;
done(); done();
this.getDetail() this.getDetail();
}) })
.catch((_) => { .catch((_) => {
instance.confirmButtonLoading = false; instance.confirmButtonLoading = false;

Loading…
Cancel
Save