From 569a03b7f3709110c1f4f7995ed42238b7292617 Mon Sep 17 00:00:00 2001 From: TS-QD1 Date: Sat, 13 May 2023 17:26:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BD=91=E6=A0=BC=E5=91=98?= =?UTF-8?q?=E3=80=81=E8=B0=83=E5=BA=A6=E5=91=98=E3=80=81=E6=89=A7=E6=B3=95?= =?UTF-8?q?=E5=85=AC=E5=AE=89=E9=A1=B5=E9=9D=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Index.vue | 16 +- src/components/common/DdyWork.vue | 84 +++++--- src/components/common/ZfGaWork.vue | 84 +++++--- src/components/table/Ddy.vue | 213 +++++++++++--------- src/components/table/Wgy.vue | 14 +- src/components/table/{Wgy3.vue => Wgz.vue} | 209 +++++++++++-------- src/components/table/ZfGa.vue | 223 ++++++++++++--------- src/components/table/Znbm.vue | 206 +++++++++++-------- src/main.js | 4 +- 9 files changed, 622 insertions(+), 431 deletions(-) rename src/components/table/{Wgy3.vue => Wgz.vue} (71%) diff --git a/src/components/Index.vue b/src/components/Index.vue index 699a924..25ea144 100644 --- a/src/components/Index.vue +++ b/src/components/Index.vue @@ -5,10 +5,10 @@ 更新 工作考核细则: 街道社区4-5级网格 - - - - + 区级与街道指挥调度中心(调度专管员) + 执法局、公安分局 + 3 级网格长 + 其他职能部门 @@ -85,8 +85,8 @@ const onDdyClick = () => { const onZfGAClick = () => { router.push({ name: 'zfga' }); } -const onWgy3Click = () => { - router.push({ name: 'wgy3' }); +const onWgzClick = () => { + router.push({ name: 'wgz' }); } const onZnbmClick = () => { router.push({ name: 'znbm' }); @@ -109,9 +109,9 @@ const checkProcess = () => { if(percent >= 100) { clearInterval(checkProcessInterval); checkProcessInterval = null; - isKpiUpdatProgressModalShow.value = false; + // isKpiUpdatProgressModalShow.value = false; } else { - isKpiUpdatProgressModalShow.value = true; + // isKpiUpdatProgressModalShow.value = true; } }).catch((resp) => { console.error(resp) diff --git a/src/components/common/DdyWork.vue b/src/components/common/DdyWork.vue index 09a5b9a..8117592 100644 --- a/src/components/common/DdyWork.vue +++ b/src/components/common/DdyWork.vue @@ -21,6 +21,20 @@ export default { NSpace, NDataTable, }, + props: { + userId: { + required: true, + }, + userName: { + required: true, + }, + year: { + required: true, + }, + month: { + required: true + } + }, data() { let vueSelf = this; return { @@ -28,37 +42,37 @@ export default { columns: [ { align: 'center', - title: '张三2023年1月考勤得分明细表', + title: `${vueSelf.userName}${vueSelf.year}年${vueSelf.month}月考勤得分明细表`, key: 'title', children: [ { align: 'center', - title: '月', - key: 'month', - width: 60, - }, - { - align: 'center', - title: '日', - key: 'day', + title: '日期', + key: 'dayDate', width: 60, }, { align: 'center', title: '签到', - key: 'signIn', + key: 'isSignin', width: 60, + render(row, index) { + return row.isSignin === 0 ? '否' : '是'; + } }, { align: 'center', title: '签退', - key: 'signOut', + key: 'isSignout', width: 60, + render(row, index) { + return row.isSignout === 0 ? '否' : '是'; + } }, { align: 'center', title: '总分', - key: 'score', + key: 'dayScore', width: 60, }, { @@ -66,6 +80,9 @@ export default { title: '备注', key: 'remark', width: 100, + render(row, index) { + return row.isHoliday === 1 ? '法定假期' : '工作日'; + } } ] } @@ -75,20 +92,39 @@ export default { } }, methods: { - + init() { + let vueSelf = this; + vueSelf.$axios.get(`api/kpi/list-n-person-case-day-count/user-id/${vueSelf.userId}`, { + params: { + year: vueSelf.year, + month: vueSelf.month + } + }).then(({data}) => { + let dayScoreTotal = 0; + let signinCount = 0; + let signinLateCount = 0; + let signoutCount = 0; + let signoutEarlyCount = 0; + let workDay = 0; + data.forEach(item => { + dayScoreTotal += item.dayScore; + signinCount += item.isSignin; + signinLateCount += item.isSigninLate; + signoutCount += item.isSignout; + signoutEarlyCount += item.isSignoutEarly; + if(item.isHoliday === 0) { + workDay++; + } + }); + console.log(dayScoreTotal, workDay) + vueSelf.table.data = data; + }).catch(({ data }) => { + vueSelf.message.error(data.msg); + }); + }, }, mounted() { - let data = []; - for(var i = 0; i < 100; i++) { - data.push({ - month: 12, - day: 1, - signIn: 1, - signOut: 1, - remark: '123' - }) - } - this.table.data = data; + this.init(); } } diff --git a/src/components/common/ZfGaWork.vue b/src/components/common/ZfGaWork.vue index 86a11d1..de285b7 100644 --- a/src/components/common/ZfGaWork.vue +++ b/src/components/common/ZfGaWork.vue @@ -21,6 +21,20 @@ export default { NSpace, NDataTable, }, + props: { + userId: { + required: true, + }, + userName: { + required: true, + }, + year: { + required: true, + }, + month: { + required: true + } + }, data() { let vueSelf = this; return { @@ -28,37 +42,37 @@ export default { columns: [ { align: 'center', - title: '张三2023年1月考勤得分明细表', + title: `${vueSelf.userName}${vueSelf.year}年${vueSelf.month}考勤得分明细表`, key: 'title', children: [ { align: 'center', - title: '月', - key: 'month', - width: 60, - }, - { - align: 'center', - title: '日', - key: 'day', + title: '日期', + key: 'dayDate', width: 60, }, { align: 'center', title: '签到', - key: 'signIn', + key: 'isSignin', width: 60, + render(row, index) { + return row.isSignin === 0 ? '否' : '是'; + } }, { align: 'center', title: '签退', - key: 'signOut', + key: 'isSignout', width: 60, + render(row, index) { + return row.isSignout === 0 ? '否' : '是'; + } }, { align: 'center', title: '总分', - key: 'score', + key: 'dayScore', width: 60, }, { @@ -66,6 +80,9 @@ export default { title: '备注', key: 'remark', width: 100, + render(row, index) { + return row.isHoliday === 1 ? '法定假期' : '工作日'; + } } ] } @@ -75,20 +92,39 @@ export default { } }, methods: { - + init() { + let vueSelf = this; + vueSelf.$axios.get(`api/kpi/list-n-person-case-day-count/user-id/${vueSelf.userId}`, { + params: { + year: vueSelf.year, + month: vueSelf.month + } + }).then(({data}) => { + let dayScoreTotal = 0; + let signinCount = 0; + let signinLateCount = 0; + let signoutCount = 0; + let signoutEarlyCount = 0; + let workDay = 0; + data.forEach(item => { + dayScoreTotal += item.dayScore; + signinCount += item.isSignin; + signinLateCount += item.isSigninLate; + signoutCount += item.isSignout; + signoutEarlyCount += item.isSignoutEarly; + if(item.isHoliday === 0) { + workDay++; + } + }); + console.log(dayScoreTotal, workDay) + vueSelf.table.data = data; + }).catch(({ data }) => { + vueSelf.message.error(data.msg); + }); + }, }, mounted() { - let data = []; - for(var i = 0; i < 100; i++) { - data.push({ - month: 12, - day: 1, - signIn: 1, - signOut: 1, - remark: '123' - }) - } - this.table.data = data; + this.init(); } } diff --git a/src/components/table/Ddy.vue b/src/components/table/Ddy.vue index 8c0734f..00e14d0 100644 --- a/src/components/table/Ddy.vue +++ b/src/components/table/Ddy.vue @@ -1,45 +1,41 @@