From 073532ff7c9357adaf100522a011206287254756 Mon Sep 17 00:00:00 2001 From: "271556543@qq.com" <271556543@qq.com> Date: Thu, 13 Oct 2022 17:26:27 +0800 Subject: [PATCH] 2022.10.13 --- src/api/chart/index.js | 25 ++ src/api/home/index.js | 9 - src/api/schedule/index.js | 24 ++ src/components/XyDialog/index1.vue | 369 ++++++++++++++++++ src/components/XyTable/index.vue | 9 + src/views/finance/component/detailServe.vue | 95 ++++- src/views/finance/salaryList.vue | 104 +++-- src/views/finance/serveDetail.vue | 11 +- src/views/schedule/scheduleList.vue | 334 ++++++++++------ src/views/statistics/income.vue | 47 ++- .../barChart.vue | 56 ++- .../doughnutChart.vue | 102 +++-- src/views/statistics/people.vue | 50 ++- .../statistics/peopleComponents/barChart.vue | 145 +++++++ .../peopleComponents/doughnutChart.vue | 148 +++++++ 15 files changed, 1261 insertions(+), 267 deletions(-) create mode 100644 src/api/chart/index.js delete mode 100644 src/api/home/index.js create mode 100644 src/components/XyDialog/index1.vue rename src/views/statistics/{components => incomeComponents}/barChart.vue (65%) rename src/views/statistics/{components => incomeComponents}/doughnutChart.vue (57%) create mode 100644 src/views/statistics/peopleComponents/barChart.vue create mode 100644 src/views/statistics/peopleComponents/doughnutChart.vue diff --git a/src/api/chart/index.js b/src/api/chart/index.js new file mode 100644 index 0000000..de6cd69 --- /dev/null +++ b/src/api/chart/index.js @@ -0,0 +1,25 @@ +import request from "@/utils/request"; + +export function home(params){ + return request({ + method:'get', + url:'/api/admin/chart/home', + params + }) +} + +export function income(params){ + return request({ + method:'get', + url:'/api/admin/chart/income', + params + }) +} + +export function effct(params){ + return request({ + method:'get', + url:'/api/admin/chart/effct', + params + }) +} diff --git a/src/api/home/index.js b/src/api/home/index.js deleted file mode 100644 index 016ae23..0000000 --- a/src/api/home/index.js +++ /dev/null @@ -1,9 +0,0 @@ -import request from "@/utils/request"; - -export function home(params){ - return request({ - method:'get', - url:'/api/admin/chart/home', - params - }) -} diff --git a/src/api/schedule/index.js b/src/api/schedule/index.js index f74135b..a34fa9d 100644 --- a/src/api/schedule/index.js +++ b/src/api/schedule/index.js @@ -31,3 +31,27 @@ export function scheduleDelete(data){ data }) } + +export function scheduleLog(params){ + return request({ + method:'get', + url:'/api/admin/schedule/schedule-log', + params + }) +} + +export function scheduleLogShow(params){ + return request({ + method:'get', + url:'/api/admin/schedule/schedule-log-show', + params + }) +} + +export function scheduleHome(params){ + return request({ + method:'get', + url:'/api/admin/schedule/schedule-home', + params + }) +} diff --git a/src/components/XyDialog/index1.vue b/src/components/XyDialog/index1.vue new file mode 100644 index 0000000..6ba3d9f --- /dev/null +++ b/src/components/XyDialog/index1.vue @@ -0,0 +1,369 @@ + + + + diff --git a/src/components/XyTable/index.vue b/src/components/XyTable/index.vue index b8a7f5d..08ace0f 100644 --- a/src/components/XyTable/index.vue +++ b/src/components/XyTable/index.vue @@ -113,6 +113,9 @@ export default { let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20 - 25; that.tableHeight = tableHeight; }, + doLayout(){ + this.$refs.table.doLayout() + }, deleteClick(row) { this.$emit('delete', row) }, @@ -236,6 +239,8 @@ export default { if (item.customFn) { return ( {item.multiHd.map((item1, index1) => { if (item1.customFn) { return ( diff --git a/src/views/finance/salaryList.vue b/src/views/finance/salaryList.vue index 34fb39c..f453931 100644 --- a/src/views/finance/salaryList.vue +++ b/src/views/finance/salaryList.vue @@ -5,14 +5,22 @@
- - + + +
{ - return ( -
- { - return '' - } - }}> - - -
- ) - } - }, + table:[], + baseTable:[ { label:'姓名', - width:260, + fixed: 'left', + width:140, prop:'name' }, { label:'小计', - minWidth: 160, + width: 80, align:'right', + fixed:'right', customFn:(row)=>{ let total = 0; row.data.map(item => { @@ -103,6 +93,22 @@ export default { } }, methods: { + getDate(year,month){ + let d = new Date(year,month,0) + return d.getDate() + }, + + datePick(e){ + if(!e){ + return + } + let start = parseTime(e,'{y}-{m}-{d}') + + let end = parseTime(new Date(e.getFullYear(),e.getMonth()+1,0),'{y}-{m}-{d}') + this.select.start_date = start + this.select.end_date = end + }, + async getList(){ const res = await getList(this.select) this.tableArr = res.map((item,index) => { @@ -110,9 +116,47 @@ export default { }) this.total = res.length ?? 0 this.list = res + + this.table = [] + let date = this.getDate(new Date(this.select.start_date).getFullYear(),new Date(this.select.start_date).getMonth()+1) + let header = [] + const getHeader = (h) => { + header = [] + for(let i = 1;i <= date;i ++){ + header.push(h('div',{style:{width:'100px',flex:'none',borderRight:'2px solid #EBEEF5'}},`${i}日`)) + } + return header + } + let temp = { + minWidth:date*100 + 10, + renderHeader:(h)=>{ + return h('div',{style:{display:'flex',width:'100%'}},getHeader(h)) + }, + customFn:(row)=>{ + return ( +
+ { + row.data.map(item => { + return ( +
{item.money}
+ ) + }) + } +
+ ) + } + } + this.table.push(temp) + this.table.push(...this.baseTable) + this.$nextTick(()=>{ + this.$refs['xyTable'].doLayout() + }) }, }, mounted() { + this.date = new Date() + this.select.start_date = parseTime(new Date(new Date().getFullYear(),new Date().getMonth(),1),'{y}-{m}-{d}') + this.select.end_date = parseTime(new Date(new Date().getFullYear(),new Date().getMonth()+1,0),'{y}-{m}-{d}') this.getList() } } diff --git a/src/views/finance/serveDetail.vue b/src/views/finance/serveDetail.vue index 6592cdc..854e29d 100644 --- a/src/views/finance/serveDetail.vue +++ b/src/views/finance/serveDetail.vue @@ -19,7 +19,7 @@ @@ -67,7 +67,7 @@ export default { width: 170, customFn:(row) => { return ( -
{parseTime(new Date(row.start_time),'{h}:{i}')}~{parseTime(new Date(row.start_time),'{h}:{i}')}
+
{parseTime(new Date(row.start_time),'{h}:{i}')}~{parseTime(new Date(row.end_time),'{h}:{i}')}
) } }, @@ -111,10 +111,11 @@ export default { } }, methods: { - detail(row){ - console.log(row) + detail(scope){ + this.$refs['detailServe'].time = `${parseTime(new Date(scope.row.start_time),'{h}:{i}')} ~ ${parseTime(new Date(scope.row.end_time),'{h}:{i}')}` + this.$refs['detailServe'].id = scope.row.id + this.$refs['detailServe'].isShow = true }, - async getList(){ const res = await getList(this.select) this.total = res.total diff --git a/src/views/schedule/scheduleList.vue b/src/views/schedule/scheduleList.vue index b6dd376..12cdc25 100644 --- a/src/views/schedule/scheduleList.vue +++ b/src/views/schedule/scheduleList.vue @@ -4,54 +4,93 @@
-
-
{{ item.name }} -
-
+ + + -
-
{{ item.value }} -
+ + + + + + + + 查询 +
+ +
{{select.month}} {{ areaFormatter(select.area_id) }} {{ typeFormatter(select.product_type_id) }}
+ +
+
+
-
-
{{ item }} -
+
+
-
{{select.month}}月 {{ areaFormatter(select.area) }} {{ typeFormatter(select.type) }}
- -
-
- -
+
+
+ diff --git a/src/views/statistics/income.vue b/src/views/statistics/income.vue index 34b8e70..44aa321 100644 --- a/src/views/statistics/income.vue +++ b/src/views/statistics/income.vue @@ -1,25 +1,58 @@ diff --git a/src/views/statistics/components/barChart.vue b/src/views/statistics/incomeComponents/barChart.vue similarity index 65% rename from src/views/statistics/components/barChart.vue rename to src/views/statistics/incomeComponents/barChart.vue index a108f67..1facdf1 100644 --- a/src/views/statistics/components/barChart.vue +++ b/src/views/statistics/incomeComponents/barChart.vue @@ -1,19 +1,19 @@ @@ -25,16 +25,17 @@ require('echarts/theme/macarons') // echarts theme export default { + props:{ + data:{ + type:Array, + default:()=>[] + } + }, data() { return { chart: null } }, - mounted() { - this.$nextTick(() => { - this.init() - }) - }, beforeDestroy() { if (!this.chart) { return @@ -42,8 +43,20 @@ export default { this.chart.dispose() this.chart = null }, + watch:{ + data:{ + handler(){ + this.$nextTick(() => { + this.init() + }) + }, + deep:true + } + }, methods: { init() { + let dataName = this.data.map(item => item.name) + let dataVal = this.data.map(item => item.total) this.chart = echarts.init(document.getElementById('bar-chart')) this.chart.setOption({ tooltip: { @@ -77,12 +90,12 @@ export default { width: '2' } }, - data: ['自营月度4次包', '自营单次', '80岁+老人照护', '残疾人照护', '长护险中度', '长护险重症'] + data: dataName }, series: [ { type: 'bar', - data: [6003, 5041, 4237, 3751, 2001, 1096], + data: dataVal, itemStyle: { normal: { color: '#009DFF', @@ -92,6 +105,17 @@ export default { ] }) } + }, + computed:{ + total(){ + return function (){ + let total = 0; + this.data.forEach(item => { + total += item.total + }) + return total + } + } } } diff --git a/src/views/statistics/components/doughnutChart.vue b/src/views/statistics/incomeComponents/doughnutChart.vue similarity index 57% rename from src/views/statistics/components/doughnutChart.vue rename to src/views/statistics/incomeComponents/doughnutChart.vue index 5d0327b..a49b20f 100644 --- a/src/views/statistics/components/doughnutChart.vue +++ b/src/views/statistics/incomeComponents/doughnutChart.vue @@ -1,24 +1,18 @@