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 @@
-
-
- 区级与街道指挥调度中心(调度专管员)网格化工作考核细则(以季度为考核周期)
+
+
+
+ 区级与街道指挥调度中心(调度专管员)网格化工作考核细则(以季度为考核周期)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 保存
+ 导出
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 搜索
- 导出
-
-
-
-
-
-
-
-
+
-
+
{
+ item.K = vueSelf.computeK(item);
+ item.M = (item.K * item.L / 100).toFixed(2);
+ tableDatas.push({...item});
+ })
+ vueSelf.dialog.warning({
+ title: "提示",
+ content: "确定更新吗?",
+ positiveText: "确定",
+ negativeText: "取消",
+ onPositiveClick: () => {
+ vueSelf.dataLoading = true;
+ vueSelf.$axios.put(`api/kpi/khxz/update-ddy`, {
+ datas: tableDatas
+ }).then( resp => {
+ vueSelf.message.info('保存成功');
+ }).catch( ({data}) => {
+ console.error(resp);
+ vueSelf.message.error(data.data.msg);
+ }).finally(() => {
+ vueSelf.dataLoading = false;
+ });
+ },
+ onNegativeClick: () => {
}
- data.push({
- A: d.key,
- B: d.name,
- C: d.sign,
- D: d.baseScore,
- E: d.dispatchCaseCount,
- F: d.dispatchCaseDeductPoints,
- G: d.shouldButNo,
- reasonG: d.reasonShouldButNo,
- H: d.timeout,
- reasonH: d.reasonTimeout,
- I: d.others,
- reasonI: d.reasonOthers,
- J: d.orgEvalution,
- reasonJ: d.reasonOrgEvalution,
- K: d.totalScore,
- L: d.shouldPay,
- M: d.actualPay,
- });
+ })
+ },
+ onExportClick() {
+ let vueSelf = this;
+ vueSelf.btnExportDisabled = true;
+ download(vueSelf.$axios, `api/kpi/khxz/export-ddy`, vueSelf.getQuery(), () => {
+ vueSelf.btnExportDisabled = false;
+ });
+ },
+ getQuery() {
+ return {
+ khYear: this.search.select.year.value,
+ khMonth: this.search.select.month.value,
+ keywords: this.search.input.keywords
}
- this.table.data = data;
+ },
+ listData() {
+ let vueSelf = this;
+ vueSelf.dataLoading = true;
+ vueSelf.$axios.get(`api/kpi/khxz/list-ddy`, {
+ params: vueSelf.getQuery()
+ }).then(({ data }) => {
+ data.forEach((item, index) => {
+ item.A = index + 1;
+ })
+ this.table.data = data;
+ }).catch(({ data }) => {
+ vueSelf.message.error(data.msg);
+ }).finally(() => {
+ vueSelf.dataLoading = false;
+ });
},
resize() {
let body = document.body;
this.table.minHeight = body.clientHeight - 365;
this.table.maxHeight = body.clientHeight - 365;
- this.table.scrollX = body.clientWidth;
+ // this.table.scrollX = body.clientWidth;
+ },
+ init() {
+ this.search.select.year.options = listYear();
+ this.search.select.year.value = getCurrentYear();
+ this.search.select.month.options = listMonth();
+ this.search.select.month.value = getCurrentMonth();
+ this.listData();
}
},
mounted() {
let vueSelf = this;
- vueSelf.listTestData();
+ vueSelf.init();
vueSelf.resize();
window.onresize = this.resize;
}
diff --git a/src/components/table/Wgy.vue b/src/components/table/Wgy.vue
index 0a53566..f7f3217 100644
--- a/src/components/table/Wgy.vue
+++ b/src/components/table/Wgy.vue
@@ -937,6 +937,13 @@ export default {
}
})
},
+ onExportClick() {
+ let vueSelf = this;
+ vueSelf.btnExportDisabled = true;
+ download(vueSelf.$axios, `api/kpi/khxz/export-wgy`, vueSelf.getQuery(), () => {
+ vueSelf.btnExportDisabled = false;
+ });
+ },
getQuery() {
return {
areaId: this.search.select.area.value,
@@ -947,13 +954,6 @@ export default {
keywords: this.search.input.keywords
}
},
- onExportClick() {
- let vueSelf = this;
- vueSelf.btnExportDisabled = true;
- download(vueSelf.$axios, `api/kpi/khxz/export-wgy`, vueSelf.getQuery(), () => {
- vueSelf.btnExportDisabled = false;
- });
- },
resize() {
let body = document.body;
this.table.minHeight = body.clientHeight - 408;
diff --git a/src/components/table/Wgy3.vue b/src/components/table/Wgz.vue
similarity index 71%
rename from src/components/table/Wgy3.vue
rename to src/components/table/Wgz.vue
index e45aa32..4b1813f 100644
--- a/src/components/table/Wgy3.vue
+++ b/src/components/table/Wgz.vue
@@ -1,42 +1,45 @@
-
- 级网格长网格化工作考核细则(以季度为考核周期)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 搜索
- 导出
-
-
-
+
+
+ 级网格长网格化工作考核细则(以季度为考核周期)
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 保存
+ 导出
+
+
+
+
+
+
+
-
+
@@ -59,8 +62,12 @@ import {
NButton,
NDataTable,
NModal,
+ NSpin,
+ useMessage,
+ useDialog,
} from 'naive-ui';
import Scoring from '../common/Scoring.vue';
+import { listYear, listMonth, getCurrentYear, getCurrentMonth, download } from '../utils/common'
export default {
name: 'Wgy3',
@@ -74,13 +81,20 @@ export default {
NButton,
NDataTable,
NModal,
+ NSpin,
Scoring,
},
data() {
let vueSelf = this;
return {
+ message: useMessage(),
+ dialog: useDialog(),
+ dataLoading: false,
+ btnExportDisabled: false,
search: {
+ userId: null,
+ userName: null,
select: {
street: {
value: null,
@@ -363,65 +377,86 @@ export default {
computeN(row) {
return row.C - row.E + row.L + row.M
},
- listTestData() {
- let data = [];
- for (let i = 0; i < 100; i++) {
- let d = {
- userId: 'userId',
- key: i + 1,
- name: i + 'name',
- signBaseScore: i,
- signUnPassCount: Math.floor(Math.random() * 100),
- signUnPassScore: 30,
- gridBaseScore: 2,
- gridUnPassCount: Math.floor(Math.random() * 10),
- gridUnPassScore: Math.floor(Math.random() * 10),
- unComplete: Math.floor(Math.random() * 10),
- unReportError: Math.floor(Math.random() * 10),
- reasonUnReportError: '',
- others: Math.floor(Math.random() * 10),
- reasonOthers: '',
- unComplete: Math.floor(Math.random() * 10),
- reasonUnComplete: '',
- quarter: Math.floor(Math.random() * 10),
- totalScore: Math.floor(Math.random() * 10),
- shouldPay: Math.floor(Math.random() * 10),
- actualPay: Math.floor(Math.random() * 10),
- }
- data.push({
- A: d.key,
- B: d.name,
- C: d.signBaseScore,
- D: d.signUnPassCount,
- E: d.signUnPassScore,
- F: d.gridBaseScore,
- G: d.gridUnPassCount,
- H: d.gridUnPassScore,
- I: d.unComplete,
- J: d.unReportError,
- reasonJ: d.reasonUnReportError,
- K: d.others,
- reasonK: d.reasonOthers,
- L: d.unComplete,
- reasonL: d.reasonUnComplete,
- M: d.quarter,
- N: d.totalScore,
- O: d.shouldPay,
- P: d.actualPay,
- });
- }
- this.table.data = data;
- },
resize() {
let body = document.body;
this.table.minHeight = body.clientHeight - 355;
this.table.maxHeight = body.clientHeight - 355;
- this.table.scrollX = body.clientWidth;
+ // this.table.scrollX = body.clientWidth;
+ },
+ onSearchClick() {
+ this.listData();
+ },
+ onSaveClick() {
+ let vueSelf = this;
+ let tableDatas = [];
+ vueSelf.table.data.forEach(item => {
+ item.AE = vueSelf.computeAE(item);
+ item.AG = (item.AE * item.AF / 100).toFixed(2);
+ tableDatas.push({...item});
+ })
+ vueSelf.dialog.warning({
+ title: "提示",
+ content: "确定更新吗?",
+ positiveText: "确定",
+ negativeText: "取消",
+ onPositiveClick: () => {
+ vueSelf.dataLoading = true;
+ vueSelf.$axios.put(`api/kpi/khxz/update-wgy/${vueSelf.search.select.wgy.value}`, {
+ datas: tableDatas
+ }).then( resp => {
+ vueSelf.message.info('保存成功');
+ }).catch( ({data}) => {
+ console.error(resp);
+ vueSelf.message.error(data.data.msg);
+ }).finally(() => {
+ vueSelf.dataLoading = false;
+ });
+ },
+ onNegativeClick: () => {
+ }
+ })
+ },
+ onExportClick() {
+ let vueSelf = this;
+ vueSelf.btnExportDisabled = true;
+ download(vueSelf.$axios, `api/kpi/khxz/export-wgy`, vueSelf.getQuery(), () => {
+ vueSelf.btnExportDisabled = false;
+ });
+ },
+ getQuery() {
+ return {
+ khYear: this.search.select.year.value,
+ khMonth: this.search.select.month.value,
+ keywords: this.search.input.keywords
+ }
+ },
+ listData() {
+ let vueSelf = this;
+ vueSelf.dataLoading = true;
+ vueSelf.$axios.get(`api/kpi/khxz/list-wgz`, {
+ params: vueSelf.getQuery()
+ }).then(({ data }) => {
+ data.forEach((item, index) => {
+ item.A = index + 1;
+ })
+ this.table.data = data;
+ }).catch(({ data }) => {
+ vueSelf.message.error(data.msg);
+ }).finally(() => {
+ vueSelf.dataLoading = false;
+ });
+ },
+ init() {
+ this.search.select.year.options = listYear();
+ this.search.select.year.value = getCurrentYear();
+ this.search.select.month.options = listMonth();
+ this.search.select.month.value = getCurrentMonth();
+ this.listData();
}
},
mounted() {
let vueSelf = this;
- vueSelf.listTestData();
+ vueSelf.init();
vueSelf.resize();
window.onresize = this.resize
}
diff --git a/src/components/table/ZfGa.vue b/src/components/table/ZfGa.vue
index 4f1c9df..8c5d233 100644
--- a/src/components/table/ZfGa.vue
+++ b/src/components/table/ZfGa.vue
@@ -1,45 +1,45 @@
-
- 执法局、公安分局网格化工作考核细则(以季度为考核周期)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 搜索
- 导出
-
-
-
+
+
+ 执法局、公安分局网格化工作考核细则(以季度为考核周期)
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 保存
+ 导出
+
+
+
+
+
+
+
-
+
-
+
{
+ item.M = vueSelf.computeM(item);
+ item.O = (item.M * item.N / 100).toFixed(2);
+ tableDatas.push({...item});
+ })
+ vueSelf.dialog.warning({
+ title: "提示",
+ content: "确定更新吗?",
+ positiveText: "确定",
+ negativeText: "取消",
+ onPositiveClick: () => {
+ vueSelf.dataLoading = true;
+ vueSelf.$axios.put(`api/kpi/khxz/update-zf-ga/`, {
+ datas: tableDatas
+ }).then( resp => {
+ vueSelf.message.info('保存成功');
+ }).catch( ({data}) => {
+ console.error(resp);
+ vueSelf.message.error(data.data.msg);
+ }).finally(() => {
+ vueSelf.dataLoading = false;
+ });
+ },
+ onNegativeClick: () => {
+ }
+ })
+ },
+ onExportClick() {
+ let vueSelf = this;
+ vueSelf.btnExportDisabled = true;
+ download(vueSelf.$axios, `api/kpi/khxz/export-zf-ga`, vueSelf.getQuery(), () => {
+ vueSelf.btnExportDisabled = false;
+ });
+ },
+ getQuery() {
+ return {
+ departmentId: this.search.select.department.value,
+ khYear: this.search.select.year.value,
+ khMonth: this.search.select.month.value,
+ keywords: this.search.input.keywords
+ }
+ },
+ listData() {
+ let vueSelf = this;
+ vueSelf.dataLoading = true;
+ vueSelf.$axios.get(`api/kpi/khxz/list-zf-ga`, {
+ params: vueSelf.getQuery()
+ }).then(({ data }) => {
+ data.forEach((item, index) => {
+ item.A = index + 1;
+ })
+ this.table.data = data;
+ }).catch(({ data }) => {
+ vueSelf.message.error(data.msg);
+ }).finally(() => {
+ vueSelf.dataLoading = false;
+ });
+ },
+ init() {
+ this.search.select.year.options = listYear();
+ this.search.select.year.value = getCurrentYear();
+ this.search.select.month.options = listMonth();
+ this.search.select.month.value = getCurrentMonth();
+ this.listData();
}
},
mounted() {
let vueSelf = this;
- vueSelf.listTestData();
+ vueSelf.init();
vueSelf.resize();
window.onresize = this.resize
}
diff --git a/src/components/table/Znbm.vue b/src/components/table/Znbm.vue
index ceea717..1ac0f10 100644
--- a/src/components/table/Znbm.vue
+++ b/src/components/table/Znbm.vue
@@ -1,42 +1,45 @@
-
- 其他职能部门网格化工作考核细则(以季度为考核周期)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 搜索
- 导出
-
-
-
+
+
+ 其他职能部门网格化工作考核细则(以季度为考核周期)
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 保存
+ 导出
+
+
+
+
+
+
+
-
+
@@ -58,8 +61,12 @@ import {
NButton,
NDataTable,
NModal,
+ NSpin,
+ useMessage,
+ useDialog,
} from 'naive-ui';
import Scoring from '../common/Scoring.vue';
+import { listYear, listMonth, getCurrentYear, getCurrentMonth, download } from '../utils/common'
export default {
name: 'Znbm',
@@ -73,13 +80,20 @@ export default {
NButton,
NDataTable,
NModal,
+ NSpin,
Scoring,
},
data() {
let vueSelf = this;
return {
+ message: useMessage(),
+ dialog: useDialog(),
+ dataLoading: false,
+ btnExportDisabled: false,
search: {
+ userId: null,
+ userName: null,
select: {
street: {
value: null,
@@ -383,67 +397,83 @@ export default {
computeN(row) {
return row.G - row.H - row.J - row.K + row.L + row.M;
},
- listTestData() {
- let data = [];
- for (let i = 0; i < 100; i++) {
- let d = {
- userId: 'userId',
- key: i + 1,
- name: i + 'name',
- caseCount: i,
- handleCheck: Math.floor(Math.random() * 100),
- handleUnCheck: 30,
- reward: 2,
- unBackError: Math.floor(Math.random() * 10),
- reasonUnBackError: '',
- selfReportUnComplete: Math.floor(Math.random() * 10),
- selfReportUnCompleteDeduct: Math.floor(Math.random() * 10),
- others: Math.floor(Math.random() * 10),
- reasonOthers: '',
- handleResult: Math.floor(Math.random() * 10),
- reasonHandleResult: '',
- superviseResult: Math.floor(Math.random() * 10),
- reasonSuperviseResult: '',
- totalScore: Math.floor(Math.random() * 10),
- shouldPay: Math.floor(Math.random() * 10),
- actualPay: Math.floor(Math.random() * 10),
- }
- data.push({
- A: d.key,
- B: d.name,
- C: d.caseCount,
- D: d.handleCheck,
- E: d.handleUnCheck,
- F: d.reward,
- G: d.unBackError,
- reasonG: d.reasonUnBackError,
- H: d.selfReportUnComplete,
- I: d.selfReportUnCompleteDeduct,
- J: d.others,
- reasonJ: d.reasonOthers,
- K: d.handleResult,
- reasonK: d.reasonHandleResult,
- L: d.superviseResult,
- reasonL: d.reasonSuperviseResult,
- M: d.superviseResult,
- reasonM: d.reasonSuperviseResult,
- N: d.totalScore,
- O: d.shouldPay,
- P: d.actualPay,
- });
- }
- this.table.data = data;
- },
resize() {
let body = document.body;
this.table.minHeight = body.clientHeight - 378;
this.table.maxHeight = body.clientHeight - 378;
this.table.scrollX = body.clientWidth;
+ },
+ onSearchClick() {
+ this.listData();
+ },
+ onSaveClick() {
+ let vueSelf = this;
+ let tableDatas = [];
+ vueSelf.table.data.forEach(item => {
+ item.AE = vueSelf.computeAE(item);
+ item.AG = (item.AE * item.AF / 100).toFixed(2);
+ tableDatas.push({...item});
+ })
+ vueSelf.dialog.warning({
+ title: "提示",
+ content: "确定更新吗?",
+ positiveText: "确定",
+ negativeText: "取消",
+ onPositiveClick: () => {
+ vueSelf.dataLoading = true;
+ vueSelf.$axios.put(`api/kpi/khxz/update-wgy/${vueSelf.search.select.wgy.value}`, {
+ datas: tableDatas
+ }).then( resp => {
+ vueSelf.message.info('保存成功');
+ }).catch( ({data}) => {
+ console.error(resp);
+ vueSelf.message.error(data.data.msg);
+ }).finally(() => {
+ vueSelf.dataLoading = false;
+ });
+ },
+ onNegativeClick: () => {
+ }
+ })
+ },
+ onExportClick() {
+ let vueSelf = this;
+ vueSelf.btnExportDisabled = true;
+ download(vueSelf.$axios, `api/kpi/khxz/export-wgy`, vueSelf.getQuery(), () => {
+ vueSelf.btnExportDisabled = false;
+ });
+ },
+ getQuery() {
+ return {
+ khYear: this.search.select.year.value,
+ khMonth: this.search.select.month.value,
+ keywords: this.search.input.keywords
+ }
+ },
+ listData() {
+ let vueSelf = this;
+ vueSelf.dataLoading = true;
+ vueSelf.$axios.get(`api/kpi/khxz/list-znbm`, {
+ params: vueSelf.getQuery()
+ }).then(({ data }) => {
+ this.table.data = data;
+ }).catch(({ data }) => {
+ vueSelf.message.error(data.msg);
+ }).finally(() => {
+ vueSelf.dataLoading = false;
+ });
+ },
+ init() {
+ this.search.select.year.options = listYear();
+ this.search.select.year.value = getCurrentYear();
+ this.search.select.month.options = listMonth();
+ this.search.select.month.value = getCurrentMonth();
+ this.listData();
}
},
mounted() {
let vueSelf = this;
- vueSelf.listTestData();
+ vueSelf.init();
vueSelf.resize();
window.onresize = this.resize
}
diff --git a/src/main.js b/src/main.js
index 13b09cb..e680e56 100644
--- a/src/main.js
+++ b/src/main.js
@@ -7,7 +7,7 @@ import axios from 'axios';
import Wgy from './components/table/Wgy.vue';
import Ddy from './components/table/Ddy.vue';
import ZfGa from './components/table/ZfGa.vue';
-import Wgy3 from './components/table/Wgy3.vue';
+import Wgz from './components/table/Wgz.vue';
import Znbm from './components/table/Znbm.vue';
// 路由
@@ -17,7 +17,7 @@ const router = createRouter({
{ name: 'wgy', path: '/', component: Wgy },
{ name: 'ddy', path: '/ddy', component: Ddy },
{ name: 'zfga', path: '/zfga', component: ZfGa },
- { name: 'wgy3', path: '/wgy3', component: Wgy3 },
+ { name: 'wgz', path: '/wgz', component: Wgz },
{ name: 'znbm', path: '/znbm', component: Znbm },
]
});