From aa9d10083a6eda7fbdba44bb0162709b10fa30a0 Mon Sep 17 00:00:00 2001 From: TimSpan Date: Fri, 22 Nov 2024 15:36:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20=E6=9B=BF=E6=8D=A2=20?= =?UTF-8?q?=EF=BC=9A=E5=B0=8F=E7=A8=8B=E5=BA=8F=20=E8=80=83=E6=A0=B8?= =?UTF-8?q?=E3=80=81=E5=90=8E=E5=8F=B0=E8=80=83=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dailyInspection/dailyInspection.vue | 6 +- .../src/views/query/assessmentIndex.tsx | 197 +++++++++--------- .../src/views/query/assessmentRecord.vue | 138 ++++++------ 3 files changed, 179 insertions(+), 162 deletions(-) diff --git a/collect_information/src/subPages/police/dailyInspection/dailyInspection.vue b/collect_information/src/subPages/police/dailyInspection/dailyInspection.vue index 6a5ab3f..2e59cc7 100644 --- a/collect_information/src/subPages/police/dailyInspection/dailyInspection.vue +++ b/collect_information/src/subPages/police/dailyInspection/dailyInspection.vue @@ -166,7 +166,7 @@ const assessmentCriteriaRulesByCkProjectId = async function (ckProjectId) { // title: '加载中...', // mask: true, // }) - const res = await api.get(`/assessmentCriteria/assessmentCriteriaRulesByCkProjectId`, { ckProjectId }) + const res = await api.get(`/m2/sa/assessmentCriteriaRulesByCkProjectId`, { ckProjectId }) res.data?.forEach((item) => { item.currentScore = 0 @@ -203,7 +203,7 @@ const assessmentCriteriaRulesByCkProjectId = async function (ckProjectId) { const selectorCheckedType = ref('') const selectorType = ref() const ckProjectListByType = async function (type) { - const res = await api.get(`/assessmentCriteria/ckProjectListByType`, { type }) + const res = await api.get(`/m2/sa/ckProjectListByType`, { type }) console.log(res.data) if (res.data?.length === 0) { @@ -326,7 +326,7 @@ const onSubmit = async function () { } Object.assign(assessmentRecordParams, _form) assessmentRecordParams.assessmentRecordDetails = [...assessmentRecordDetails.value] - const result = await api.post('/assessmentCriteria/submitAssessmentRecord', assessmentRecordParams) + const result = await api.post('/m2/sa/submitAssessmentRecord', assessmentRecordParams) clearData() //清空数据 if (result.code === 200) { diff --git a/policeManagement/src/views/query/assessmentIndex.tsx b/policeManagement/src/views/query/assessmentIndex.tsx index 547b057..2356044 100644 --- a/policeManagement/src/views/query/assessmentIndex.tsx +++ b/policeManagement/src/views/query/assessmentIndex.tsx @@ -1,103 +1,110 @@ -import api from "@/axios"; -import {AssessmentRecordPagerVo, DeductedDetailRes} from "@/types/views/assessmentRecord.ts"; -import {ColumnsType} from "ant-design-vue/es/table"; -import {Modal, Table} from "ant-design-vue"; +import api from '@/axios' +import { AssessmentRecordPagerVo, DeductedDetailRes } from '@/types/views/assessmentRecord.ts' +import { ColumnsType } from 'ant-design-vue/es/table' +import { Modal, Table } from 'ant-design-vue' export const deductedDetail = async (assessmentRecord: AssessmentRecordPagerVo) => { - const {data} = await api.get('/assessmentRecord/deductedDetail', {assessmentRecordId: assessmentRecord.snowFlakeId}) - const groupRowSpan: Record = {} - const itemRowSpan: Record = {} + const { data } = await api.get('/m1/ar/deductedDetail', { assessmentRecordId: assessmentRecord.snowFlakeId }) + const groupRowSpan: Record = {} + const itemRowSpan: Record = {} - data.forEach((item, index) => { - //如果第一次没有值 - if (item.ckGroupId) { - if (!groupRowSpan[item.ckGroupId]) { - groupRowSpan[item.ckGroupId] = {count: 1, firstIndex: index} - } else { - groupRowSpan[item.ckGroupId].count++; - data[index].groupRowSpan = 0 - } + data.forEach((item, index) => { + //如果第一次没有值 + if (item.ckGroupId) { + if (!groupRowSpan[item.ckGroupId]) { + groupRowSpan[item.ckGroupId] = { count: 1, firstIndex: index } + } else { + groupRowSpan[item.ckGroupId].count++ + data[index].groupRowSpan = 0 + } + } + + if (item.ckItemId) { + if (!itemRowSpan[item.ckItemId]) { + itemRowSpan[item.ckItemId] = { count: 1, firstIndex: index } + } else { + itemRowSpan[item.ckItemId].count++ + data[index].itemRowSpan = 0 + } + } + }) + + Object.values(groupRowSpan).forEach(({ count, firstIndex }) => { + data[firstIndex].groupRowSpan = count + }) + + Object.values(itemRowSpan).forEach(({ count, firstIndex }) => { + data[firstIndex].itemRowSpan = count + }) + + const ckProjectDetailTableColumns: ColumnsType = [ + { + dataIndex: 'groupName', + title: '考核分组', + customCell: (_record) => { + return { + rowspan: _record.groupRowSpan, } - - if (item.ckItemId) { - if (!itemRowSpan[item.ckItemId]) { - itemRowSpan[item.ckItemId] = {count: 1, firstIndex: index} - } else { - itemRowSpan[item.ckItemId].count++; - data[index].itemRowSpan = 0 - } + }, + customRender: ({ record: _record }) => { + return ( +
+

+ {_record.groupName}({_record.groupTotalScore}) +

+

{_record.groupRemark}

+
+ ) + }, + }, + { + dataIndex: 'itemName', + title: '考核项', + customCell: (_record) => { + return { + rowspan: _record.itemRowSpan, } - }) - - Object.values(groupRowSpan).forEach(({count, firstIndex}) => { - data[firstIndex].groupRowSpan = count; - }) - - Object.values(itemRowSpan).forEach(({count, firstIndex}) => { - data[firstIndex].itemRowSpan = count; - }) - - const ckProjectDetailTableColumns: ColumnsType = [ - { - dataIndex: 'groupName', - title: '考核分组', - customCell: (_record) => { - return { - rowspan: _record.groupRowSpan - } - }, - customRender: ({record: _record}) => { - return
-

{_record.groupName}({_record.groupTotalScore})

-

{_record.groupRemark}

-
- } - }, { - dataIndex: 'itemName', - title: '考核项', - customCell: (_record) => { - return { - rowspan: _record.itemRowSpan - } - }, - customRender: ({record: _record}) => { - if (!_record.ckItemId) { - return '/' - } - return
-

{_record.itemName}({_record.itemType?.label}) -

-
- } - }, { - dataIndex: 'standardName', - title: '标准', - customRender: ({record: _record}) => { - if (!_record.ckStandardId) { - return '/' - } - return
-

{_record.standardName}扣{_record.deductionPoints}分

-
- } + }, + customRender: ({ record: _record }) => { + if (!_record.ckItemId) { + return '/' } - ] - - Modal.info({ - title: `【${assessmentRecord.enterprisesUnitName}/${assessmentRecord.ckProjectName}】扣分详情`, - icon: ' ', - width: '80%', - centered: true, - content: () =>
-
-
- }) + return ( +
+

+ {_record.itemName}({_record.itemType?.label}) +

+
+ ) + }, + }, + { + dataIndex: 'standardName', + title: '标准', + customRender: ({ record: _record }) => { + if (!_record.ckStandardId) { + return '/' + } + return ( +
+

+ {_record.standardName}扣{_record.deductionPoints}分 +

+
+ ) + }, + }, + ] + Modal.info({ + title: `【${assessmentRecord.enterprisesUnitName}/${assessmentRecord.ckProjectName}】扣分详情`, + icon: ' ', + width: '80%', + centered: true, + content: () => ( +
+
+
+ ), + }) } diff --git a/policeManagement/src/views/query/assessmentRecord.vue b/policeManagement/src/views/query/assessmentRecord.vue index ca33616..e154430 100644 --- a/policeManagement/src/views/query/assessmentRecord.vue +++ b/policeManagement/src/views/query/assessmentRecord.vue @@ -1,92 +1,102 @@ - \ No newline at end of file +