diff --git a/src/views/budget/budgetList.vue b/src/views/budget/budgetList.vue index 58f9e17..ad4d5d0 100644 --- a/src/views/budget/budgetList.vue +++ b/src/views/budget/budgetList.vue @@ -125,8 +125,8 @@ *金额
- +
@@ -217,11 +217,22 @@ + @@ -280,7 +291,8 @@ content: "", remark: "", plan_department_link_id: [], - plan_department_links: [] + plan_department_links: [], + update_money: "" }, rules: { name: [{ @@ -348,10 +360,19 @@ width: 110 }, { - label: '项目金额(元)', + label: '年初预算金额(元)', prop: 'money', align: 'right', - width: 160, + width: 180, + formatter: (cell, data, value) => { + return moneyFormatter(value) + } + }, + { + label: '调整后预算金额(元)', + prop: 'update_money', + align: 'right', + width: 200, formatter: (cell, data, value) => { return moneyFormatter(value) } @@ -399,29 +420,29 @@ this.types = res.detail }, - moneyRecoverEditor() { - if (!/^\d{1,3}(,\d{3})*(\.\d+)/.test(this.editorForm.money)) { + moneyRecoverEditor(key) { + if (!/^\d{1,3}(,\d{3})*(\.\d+)/.test(this.editorForm[key])) { return } - this.editorForm.money = moneyRecovery(this.editorForm.money) + this.editorForm[key] = moneyRecovery(this.editorForm[key]) }, - moneyFormatEditor() { - if (!/^\d+(\.\d+)?$/.test(this.editorForm.money)) { + moneyFormatEditor(key) { + if (!/^\d+(\.\d+)?$/.test(this.editorForm[key])) { return } - this.editorForm.money = moneyFormatter(this.editorForm.money) + this.editorForm[key] = moneyFormatter(this.editorForm[key]) }, - moneyRecover() { - if (!/^\d{1,3}(,\d{3})*(\.\d+)/.test(this.form.money)) { + moneyRecover(key) { + if (!/^\d{1,3}(,\d{3})*(\.\d+)/.test(this.form[key])) { return } - this.form.money = moneyRecovery(this.form.money) + this.form[key] = moneyRecovery(this.form[key]) }, - moneyFormat() { - if (!/^\d+(\.\d+)?$/.test(this.form.money)) { + moneyFormat(key) { + if (!/^\d+(\.\d+)?$/.test(this.form[key])) { return } - this.form.money = moneyFormatter(this.form.money) + this.form[key] = moneyFormatter(this.form[key]) }, //合计 summary(param) { @@ -553,6 +574,7 @@ year: this.editorForm.year, content: this.editorForm.content, money: moneyRecovery(this.editorForm.money), + update_money: moneyRecovery(this.editorForm.update_money), remark: this.editorForm.remark, plan_department_id: this.editorForm.department, plan_department_links: plan_department_links @@ -581,7 +603,8 @@ name: res.name, type: res.type, department: res.plan_department_id, - money: moneyFormatter(res.money), + money: moneyFormatter(res.money), + update_money: moneyFormatter(res.update_money), year: res.year, content: res.content, remark: res.remark, @@ -592,8 +615,8 @@ ids.push(item.department_id); }) //this.editorForm.plan_department_link_id = ids; - this.$set(this.editorForm, "plan_department_link_id", ids); - + this.$set(this.editorForm, "plan_department_link_id", ids); + this.isShowEditor = true console.log(this.editorForm) }) @@ -613,7 +636,7 @@ diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index df8b693..b85cea7 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -12,8 +12,12 @@
-
{{moneyFormat(statistic.progress.money_total)}}
-
预算合计金额
+
{{moneyFormat(statistic.progress.money_total_1)}}
+
年初预算合计金额
+
+
+
{{moneyFormat(statistic.progress.money_total_2)}}
+
调整后预算合计金额
{{moneyFormat(statistic.progress.use_money_total)}}
@@ -21,7 +25,8 @@
- {{((statistic.progress.use_money_total/statistic.progress.money_total)*100).toFixed(2)}}%
+ {{toper(statistic.progress.money_total_1,statistic.progress.money_total_2,statistic.progress.use_money_total)}}% +
进展率
@@ -171,16 +176,27 @@ departmentProgress: [], departmentTable: [{ label: '科室', - width: 120, + width: 80, prop: 'plan_department.name', - sortable: false + sortable: false, + fixed:"left" }, { - label: '合计金额(元)', - width: 120, + label: '年初预算合计金额(元)', + width: 160, align: 'right', sortable: false, - prop: 'money_total', + prop: 'money_total_1', + formatter: (cell, data, value) => { + return moneyFormatter(value) + } + }, + { + label: '调整后预算合计金额(元)', + width: 160, + align: 'right', + sortable: false, + prop: 'money_total_2', formatter: (cell, data, value) => { return moneyFormatter(value) } @@ -199,18 +215,53 @@ label: '进展情况', sortable: false, align: 'left', - customFn: (row) => { - return (
-
+ width: 320, + fixed:"right", + customFn: (row) => { + let m2=row.money_total_2; + let m1=row.money_total_1; + let m3=row.use_money_total; + let per =0 ; + + if (m2 != 0) { + per= ((m3 / m2) * 100).toFixed(2); + } else if (m1 != 0) { + per= ((m3 / m1) * 100).toFixed(2); + } + return ( < div > + ) } } ], typeTable: [{ label: '预算类别', - width: 140, + width: 100, prop: 'type_text', - sortable: false + sortable: false, + fixed:"left", + }, + { + label: '年初预算合计金额(元)', + width: 160, + align: 'right', + sortable: false, + prop: 'money_total_1', + formatter: (cell, data, value) => { + return moneyFormatter(value) + } + }, + { + label: '调整后预算合计金额(元)', + width: 160, + align: 'right', + sortable: false, + prop: 'money_total_2', + formatter: (cell, data, value) => { + return moneyFormatter(value) + } }, { label: '合计金额(元)', @@ -236,10 +287,23 @@ label: '进展情况', sortable: false, minWidth: 220, - align: 'left', + align: 'left', + fixed:"right", customFn: (row) => { - return (
-
+ let m2=row.money_total_2; + let m1=row.money_total_1; + let m3=row.use_money_total; + let per =0 ; + + if (m2 != 0) { + per= ((m3 / m2) * 100).toFixed(2); + } else if (m1 != 0) { + per= ((m3 / m1) * 100).toFixed(2); + } + return ( < div > + ) } } @@ -285,7 +349,14 @@ typeFormatter(cell, data, value) { return value === 1 ? '合同类型' : '付款类型' }, - + toper(m1, m2, m3) { + if (m2 != 0) { + return ((m3 / m2) * 100).toFixed(2); + } else if (m1 != 0) { + return ((m3 / m1) * 100).toFixed(2); + } else + return 0 + }, async getNotices() { const res = await getNotice({ page_size: 10, diff --git a/src/views/finance/paymentRegistrationList.vue b/src/views/finance/paymentRegistrationList.vue index cfe7888..246b4a3 100644 --- a/src/views/finance/paymentRegistrationList.vue +++ b/src/views/finance/paymentRegistrationList.vue @@ -30,6 +30,7 @@ + @@ -93,6 +94,9 @@ delFundLog, editorFundLog } from "@/api/paymentRegistration/fundLog" + import { + getToken + } from '@/utils/auth' import { parseTime } from "@/utils" @@ -122,14 +126,14 @@ return item.id === value }) return res[0]?.value || '未知' - }, - width:120 + }, + width: 120 }, { label: "年份", prop: 'year', - align: 'center', - width:90 + align: 'center', + width: 90 }, { label: "名称", @@ -139,8 +143,8 @@ { label: "计划金额", prop: 'money', - align: 'right', - width:160 + align: 'right', + width: 160 } ], plans: [], //预算数据 @@ -308,19 +312,23 @@ }, //获取预算计划 async getBudgets() { - let res = await getBudget({ + await getBudget({ name: this.planSearch.name, page_size: 10, page: this.plansPageIndex, plan_department_id: this.planSearch.plan_department_id - }) - this.plans = res.list.data + }).then(res => { + + + this.plans = res.list.data - this.planTotal = res.list.total; + this.planTotal = res.list.total; + + this.toggleSelection(this.plan.map(item => { + return item.value.plan_id + }), 1) + }) - this.toggleSelection(this.plan.map(item => { - return item.value.plan_id - }), 1) }, async showPlanForSearch() { this.isShowPlanForSearch = true @@ -331,7 +339,7 @@ console.log(sel) if (sel) { this.select.plan_id = sel.id; - this.select.plan_name = "["+sel.year+"]-"+sel.name; + this.select.plan_name = "[" + sel.year + "]-" + sel.name; } else { this.select.plan_id = ""; this.select.plan_name = ""; @@ -352,18 +360,40 @@ this.pageIndex = e this.getFundLogs() }, - - async getFundLogs() { - const res = await getFundLog({ + toExport() { + this.is_export = 1; + this.getFundLogs(true); + }, + async getFundLogs(is_export) { + await getFundLog({ page_size: 10, page: this.pageIndex, keyword: this.keyword, date: this.selectDate, status: this.status, act_plan_link_id: this.select.plan_id + }).then(res => { + let tokens = getToken(); + if (is_export) { + var url = "/api/admin/fund_log/index?token=" + tokens + if (this.selectDate) + url += "&date=" + this.selectDate; + if (this.keyword) + url += "&keyword=" + this.keyword; + if (this.status) + url += "&status=" + this.status; + if (this.plan_id) + url += "&act_plan_link_id=" + this.plan_id; + url += "&is_export=" + this.is_export; + url = location.host + url; + console.log(url) + window.open("http://" + url, '_blank') + this.select.is_export = 0 + return; + } + this.list = res.data + this.total = res.total }) - this.list = res.data - this.total = res.total }, deleteFundLog(row) {