Compare commits
4 Commits
08917db45b
...
59f2fbbfae
| Author | SHA1 | Date | |
|---|---|---|---|
| 59f2fbbfae | |||
| 2cee84c00d | |||
| 11e3ef148b | |||
| ec0ff8dc90 |
@ -89,10 +89,18 @@ export const PrisonerApi = {
|
|||||||
getPage: (params: PageParam) => {
|
getPage: (params: PageParam) => {
|
||||||
return request.get({ url: '/prison/prisoner/page', params })
|
return request.get({ url: '/prison/prisoner/page', params })
|
||||||
},
|
},
|
||||||
|
// 分页查询(别名,用于选择犯人弹窗)
|
||||||
|
getPrisonerPage: (params: PageParam) => {
|
||||||
|
return request.get({ url: '/prison/prisoner/page', params })
|
||||||
|
},
|
||||||
// 获取详情
|
// 获取详情
|
||||||
get: (id: number) => {
|
get: (id: number) => {
|
||||||
return request.get({ url: '/prison/prisoner/get', params: { id } })
|
return request.get({ url: '/prison/prisoner/get', params: { id } })
|
||||||
},
|
},
|
||||||
|
// 获取详情(别名,与其他模块保持一致)
|
||||||
|
getPrisoner: (id: number) => {
|
||||||
|
return request.get({ url: '/prison/prisoner/get', params: { id } })
|
||||||
|
},
|
||||||
// 创建
|
// 创建
|
||||||
create: (data: PrisonerCreateVO) => {
|
create: (data: PrisonerCreateVO) => {
|
||||||
return request.post({ url: '/prison/prisoner/create', data })
|
return request.post({ url: '/prison/prisoner/create', data })
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export interface RiskAssessment {
|
|||||||
id: number // 评估ID
|
id: number // 评估ID
|
||||||
prisonerId?: number // 罪犯ID
|
prisonerId?: number // 罪犯ID
|
||||||
prisonerNo?: string // 罪犯编号
|
prisonerNo?: string // 罪犯编号
|
||||||
prisonerName?: string // 罪犯姓名
|
prisonerName?: string // 罪犯姓名(用于回显)
|
||||||
assessmentType?: number // 评估类型:1-入狱评估 2-定期评估 3-专项评估
|
assessmentType?: number // 评估类型:1-入狱评估 2-定期评估 3-专项评估
|
||||||
assessmentDate?: string // 评估日期
|
assessmentDate?: string // 评估日期
|
||||||
violenceScore: number // 暴力倾向得分
|
violenceScore: number // 暴力倾向得分
|
||||||
@ -31,7 +31,7 @@ export interface RiskAssessment {
|
|||||||
riskFactors: string // 风险因素
|
riskFactors: string // 风险因素
|
||||||
suggestions: string // 管控建议
|
suggestions: string // 管控建议
|
||||||
// assessorId 和 assessorName 由后端自动从登录上下文获取,不需要前端传递
|
// assessorId 和 assessorName 由后端自动从登录上下文获取,不需要前端传递
|
||||||
nextAssessmentDate: string // 下次评估日期
|
nextAssessmentDate?: string // 下次评估日期
|
||||||
status?: number // 状态:1-待审核 2-已通过
|
status?: number // 状态:1-待审核 2-已通过
|
||||||
remark: string // 备注
|
remark: string // 备注
|
||||||
createTime?: string // 创建时间
|
createTime?: string // 创建时间
|
||||||
|
|||||||
@ -55,7 +55,15 @@ const whiteList = [
|
|||||||
'/register',
|
'/register',
|
||||||
'/oauthLogin/gitee',
|
'/oauthLogin/gitee',
|
||||||
'/prisoner/prisoner/dashboard', // Dashboard 页面
|
'/prisoner/prisoner/dashboard', // Dashboard 页面
|
||||||
'/ai-dash-entry' // DashEntry 页面
|
'/ai-dash-entry', // DashEntry 页面
|
||||||
|
// 监狱模块路由(解决SPA路由重定向问题)
|
||||||
|
'/prison/template', // 问卷模版管理
|
||||||
|
'/prison/questionnaire', // 问卷任务管理
|
||||||
|
'/prison/guard', // 狱警管理
|
||||||
|
// AI指导建议路由(evaluation-mgmt)
|
||||||
|
'/prison/evaluation-mgmt/template', // 评估模板管理
|
||||||
|
'/prison/evaluation-mgmt/dimension', // 评估维度管理
|
||||||
|
'/prison/evaluation-mgmt/report', // 评估报告管理
|
||||||
]
|
]
|
||||||
|
|
||||||
// 路由加载前
|
// 路由加载前
|
||||||
|
|||||||
@ -1,8 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog title="消费明细" v-model="dialogVisible" width="600px">
|
<Dialog title="消费明细" v-model="dialogVisible" width="600px">
|
||||||
<el-table :data="detailList" v-loading="loading">
|
<el-table :data="detailList" v-loading="loading">
|
||||||
<el-table-column label="商品名称" prop="goodsName" align="center" />
|
<el-table-column label="商品名称" prop="goodsName" align="center">
|
||||||
<el-table-column label="商品编码" prop="goodsCode" align="center" width="120" />
|
<template #default="{ row }">
|
||||||
|
{{ row.goodsName || '-' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="商品编码" prop="goodsCode" align="center" width="120">
|
||||||
|
<template #default="{ row }">
|
||||||
|
{{ row.goodsCode || '-' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="单价" prop="goodsPrice" align="center" width="100">
|
<el-table-column label="单价" prop="goodsPrice" align="center" width="100">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
¥{{ row.goodsPrice?.toFixed(2) }}
|
¥{{ row.goodsPrice?.toFixed(2) }}
|
||||||
|
|||||||
@ -9,13 +9,13 @@
|
|||||||
>
|
>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="罪犯ID" prop="prisonerId">
|
<el-form-item label="服刑人员">
|
||||||
<el-input v-model="formData.prisonerId" placeholder="请输入罪犯ID" />
|
<el-input v-model="formData.prisonerName" placeholder="服刑人员姓名" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="罪犯编号" prop="prisonerNo">
|
<el-form-item label="罪犯编号" prop="prisonerNo">
|
||||||
<el-input v-model="formData.prisonerNo" placeholder="请输入罪犯编号" />
|
<el-input v-model="formData.prisonerNo" placeholder="罪犯编号" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
@ -135,6 +135,7 @@ const formType = ref('')
|
|||||||
const formData = ref({
|
const formData = ref({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
prisonerId: undefined,
|
prisonerId: undefined,
|
||||||
|
prisonerName: undefined,
|
||||||
prisonerNo: undefined,
|
prisonerNo: undefined,
|
||||||
orderNo: undefined,
|
orderNo: undefined,
|
||||||
type: undefined,
|
type: undefined,
|
||||||
@ -228,6 +229,7 @@ const resetForm = () => {
|
|||||||
formData.value = {
|
formData.value = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
prisonerId: undefined,
|
prisonerId: undefined,
|
||||||
|
prisonerName: undefined,
|
||||||
prisonerNo: undefined,
|
prisonerNo: undefined,
|
||||||
orderNo: undefined,
|
orderNo: undefined,
|
||||||
type: undefined,
|
type: undefined,
|
||||||
|
|||||||
@ -77,12 +77,14 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
import { EvaluationTemplateApi } from '@/api/prison/evaluation'
|
import { EvaluationTemplateApi } from '@/api/prison/evaluation'
|
||||||
import { ElMessage } from 'element-plus'
|
import { useMessage } from '@/hooks/web/useMessage'
|
||||||
|
|
||||||
defineOptions({ name: 'EvaluationTemplateForm' })
|
defineOptions({ name: 'EvaluationTemplateForm' })
|
||||||
|
|
||||||
const emit = defineEmits(['success'])
|
const emit = defineEmits(['success'])
|
||||||
|
|
||||||
|
const message = useMessage()
|
||||||
|
|
||||||
// 保存当前编辑的模板ID,用于刷新数据
|
// 保存当前编辑的模板ID,用于刷新数据
|
||||||
const currentTemplateId = ref<number | undefined>(undefined)
|
const currentTemplateId = ref<number | undefined>(undefined)
|
||||||
|
|
||||||
|
|||||||
@ -163,12 +163,13 @@ const open = async (type: string, templateId: number, id?: number) => {
|
|||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
dialogTitle.value = t('action.' + type)
|
dialogTitle.value = t('action.' + type)
|
||||||
formType.value = type
|
formType.value = type
|
||||||
formData.value.templateId = templateId
|
|
||||||
resetForm()
|
resetForm()
|
||||||
|
formData.value.templateId = templateId
|
||||||
if (id) {
|
if (id) {
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
formData.value = await DimensionApi.getDimension(id)
|
const existingDimension = await DimensionApi.getDimension(id)
|
||||||
|
formData.value = { ...existingDimension, templateId }
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -90,7 +90,7 @@
|
|||||||
<!-- 维度配置 Tab -->
|
<!-- 维度配置 Tab -->
|
||||||
<el-tab-pane label="维度配置" name="dimension">
|
<el-tab-pane label="维度配置" name="dimension">
|
||||||
<div class="dimension-header mb-15px">
|
<div class="dimension-header mb-15px">
|
||||||
<el-button type="primary" @click="openDimensionForm(selectedTemplate.id!)" v-hasPermi="['prison:evaluation-report:dimension:create']">
|
<el-button type="primary" @click="openDimensionForm(selectedTemplate.id!)" v-hasPermi="['prison:evaluation-report:template:update']">
|
||||||
<Icon icon="ep:plus" class="mr-5px" /> 新增维度
|
<Icon icon="ep:plus" class="mr-5px" /> 新增维度
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -111,7 +111,7 @@
|
|||||||
<el-button type="primary" link size="small" @click="openDimensionForm(selectedTemplate.id!, dimension.id)">
|
<el-button type="primary" link size="small" @click="openDimensionForm(selectedTemplate.id!, dimension.id)">
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="danger" link size="small" @click="handleDeleteDimension(dimension.id!)" v-hasPermi="['prison:evaluation-report:dimension:delete']">
|
<el-button type="danger" link size="small" @click="handleDeleteDimension(dimension.id!)" v-hasPermi="['prison:evaluation-report:template:update']">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -271,7 +271,7 @@
|
|||||||
{{ scope.row.finishTime ? formatDateTime(scope.row.finishTime) : '-' }}
|
{{ scope.row.finishTime ? formatDateTime(scope.row.finishTime) : '-' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="320" fixed="right">
|
<el-table-column label="操作" align="center" width="400" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.status === 3"
|
v-if="scope.row.status === 3"
|
||||||
@ -310,6 +310,15 @@
|
|||||||
>
|
>
|
||||||
重置
|
重置
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="handleViewPrisoner(scope.row)"
|
||||||
|
v-hasPermi="['prison:prisoner:query']"
|
||||||
|
>
|
||||||
|
详情
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -328,6 +337,9 @@
|
|||||||
|
|
||||||
<!-- 代填弹窗 -->
|
<!-- 代填弹窗 -->
|
||||||
<AgentFillDialog ref="agentFillDialogRef" @success="loadPrisonerProgress" />
|
<AgentFillDialog ref="agentFillDialogRef" @success="loadPrisonerProgress" />
|
||||||
|
|
||||||
|
<!-- 服刑人员详情弹窗 -->
|
||||||
|
<PrisonerDetail ref="prisonerDetailRef" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -336,6 +348,7 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
|||||||
import { formatDateTime } from '@/utils/formatTime'
|
import { formatDateTime } from '@/utils/formatTime'
|
||||||
import AnswerDetailDialog from '@/views/prison/questionnairerecord/AnswerDetailDialog.vue'
|
import AnswerDetailDialog from '@/views/prison/questionnairerecord/AnswerDetailDialog.vue'
|
||||||
import AgentFillDialog from './AgentFillDialog.vue'
|
import AgentFillDialog from './AgentFillDialog.vue'
|
||||||
|
import PrisonerDetail from '@/views/prison/prisoner/PrisonerDetail.vue'
|
||||||
import { QuestionnaireTaskApi } from '@/api/prison/questionnaire-task'
|
import { QuestionnaireTaskApi } from '@/api/prison/questionnaire-task'
|
||||||
|
|
||||||
defineOptions({ name: 'TaskDetailDialog' })
|
defineOptions({ name: 'TaskDetailDialog' })
|
||||||
@ -353,6 +366,9 @@ const answerDetailDialogRef = ref()
|
|||||||
// 代填弹窗
|
// 代填弹窗
|
||||||
const agentFillDialogRef = ref()
|
const agentFillDialogRef = ref()
|
||||||
|
|
||||||
|
// 服刑人员详情弹窗
|
||||||
|
const prisonerDetailRef = ref()
|
||||||
|
|
||||||
// 任务详情
|
// 任务详情
|
||||||
const taskDetail = ref<any>(null)
|
const taskDetail = ref<any>(null)
|
||||||
|
|
||||||
@ -573,6 +589,11 @@ const handleAgentFill = (row: any) => {
|
|||||||
agentFillDialogRef.value?.open(row)
|
agentFillDialogRef.value?.open(row)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 查看服刑人员详情 */
|
||||||
|
const handleViewPrisoner = (row: any) => {
|
||||||
|
prisonerDetailRef.value?.open(row.prisonerId)
|
||||||
|
}
|
||||||
|
|
||||||
/** 提醒未完成人员 */
|
/** 提醒未完成人员 */
|
||||||
const handleRemind = async () => {
|
const handleRemind = async () => {
|
||||||
if (!taskId.value) return
|
if (!taskId.value) return
|
||||||
|
|||||||
@ -117,29 +117,35 @@ const open = async (type: string, id?: number) => {
|
|||||||
}
|
}
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
/** 提交表单 */
|
/** 提交表单 */
|
||||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
await formRef.value.validate()
|
await formRef.value.validate()
|
||||||
// 提交请求
|
// 提交请求:将 coverImage 数组转换为字符串(取第一个元素或null)
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
const data = formData.value as unknown as Questionnaire
|
const data = { ...formData.value } as unknown as Questionnaire
|
||||||
if (formType.value === 'create') {
|
// 处理 coverImage 数组转换为字符串
|
||||||
await QuestionnaireApi.createQuestionnaire(data)
|
if (Array.isArray(data.coverImage) && data.coverImage.length > 0) {
|
||||||
message.success(t('common.createSuccess'))
|
data.coverImage = data.coverImage[0] as unknown as string
|
||||||
} else {
|
} else {
|
||||||
await QuestionnaireApi.updateQuestionnaire(data)
|
data.coverImage = undefined as unknown as string
|
||||||
message.success(t('common.updateSuccess'))
|
}
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await QuestionnaireApi.createQuestionnaire(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await QuestionnaireApi.updateQuestionnaire(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
dialogVisible.value = false
|
|
||||||
// 发送操作成功的事件
|
|
||||||
emit('success')
|
|
||||||
} finally {
|
|
||||||
formLoading.value = false
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/** 重置表单 */
|
/** 重置表单 */
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
|
|||||||
@ -192,13 +192,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" plain :icon="Plus" @click="addPartition" v-hasPermi="['prison:question:create', 'prison:questionnaire:update']">添加分区</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="savePartitions" type="primary" v-hasPermi="['prison:question:update', 'prison:questionnaire:update']">保存设置</el-button>
|
<el-button @click="savePartitions" type="primary" v-hasPermi="['prison:question:update', 'prison:questionnaire:update']">保存设置</el-button>
|
||||||
<el-button @click="partDialogVisible = false">取消</el-button>
|
<el-button @click="partDialogVisible = false">关闭</el-button>
|
||||||
</template>
|
</template>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
@ -486,26 +483,39 @@ const savePartitions = async () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 收集所有需要更新的问题
|
// 收集所有需要更新的问题(包括默认分区)
|
||||||
const updates: Array<{ id: number; partName?: string; partSort?: number; sort?: number }> = []
|
const updates: Array<{ id: number; partName?: string; partSort?: number; sort?: number }> = []
|
||||||
for (let i = 0; i < allPartList.value.length; i++) {
|
for (let i = 0; i < allPartList.value.length; i++) {
|
||||||
const part = allPartList.value[i]
|
const part = allPartList.value[i]
|
||||||
if (!part.isDefault && part.name) {
|
for (const p of partitions.value) {
|
||||||
for (const p of partitions.value) {
|
// 匹配分区:两个 name 相等,或者两个都是空(默认分区)
|
||||||
if (p.name === part.name) {
|
if ((p.name === part.name) || (p.name === '' && part.name === '')) {
|
||||||
p.questions.forEach((q, sortIndex) => {
|
p.questions.forEach((q, sortIndex) => {
|
||||||
updates.push({
|
updates.push({
|
||||||
id: q.id!,
|
id: q.id!,
|
||||||
partName: part.name,
|
partName: part.name || undefined,
|
||||||
partSort: i,
|
partSort: i,
|
||||||
sort: sortIndex
|
sort: sortIndex
|
||||||
})
|
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 没有需要更新的问题(可能是添加了空分区)
|
||||||
|
if (updates.length === 0) {
|
||||||
|
// 检查是否有新建的空分区
|
||||||
|
const hasNewPartition = allPartList.value.some(p => !p.isDefault && p.id?.toString().startsWith('part_'))
|
||||||
|
if (hasNewPartition) {
|
||||||
|
message.error('请先在该分区下添加问题后再保存')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 如果确实没有变化,直接关闭弹窗
|
||||||
|
partDialogVisible.value = false
|
||||||
|
message.success('保存成功')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 批量更新
|
// 批量更新
|
||||||
await QuestionApi.batchUpdate({ questions: updates })
|
await QuestionApi.batchUpdate({ questions: updates })
|
||||||
await getList()
|
await getList()
|
||||||
@ -518,20 +528,22 @@ const savePartitions = async () => {
|
|||||||
|
|
||||||
/** 分区拖拽排序完成 */
|
/** 分区拖拽排序完成 */
|
||||||
const onPartitionDragEnd = async () => {
|
const onPartitionDragEnd = async () => {
|
||||||
// 收集所有需要更新的问题
|
// 收集所有需要更新的问题(包括默认分区)
|
||||||
const updates: Array<{ id: number; partName?: string; partSort?: number; sort?: number }> = []
|
const updates: Array<{ id: number; partName?: string; partSort?: number; sort?: number }> = []
|
||||||
for (let i = 0; i < partitions.value.length; i++) {
|
for (let i = 0; i < partitions.value.length; i++) {
|
||||||
const part = partitions.value[i]
|
const part = partitions.value[i]
|
||||||
if (part.name) {
|
part.questions.forEach((q, sortIndex) => {
|
||||||
part.questions.forEach((q, sortIndex) => {
|
updates.push({
|
||||||
updates.push({
|
id: q.id!,
|
||||||
id: q.id!,
|
partName: part.name || undefined,
|
||||||
partName: part.name,
|
partSort: i,
|
||||||
partSort: i,
|
sort: sortIndex
|
||||||
sort: sortIndex
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
|
}
|
||||||
|
// 空数组无需调用后端
|
||||||
|
if (updates.length === 0) {
|
||||||
|
return
|
||||||
}
|
}
|
||||||
// 批量更新
|
// 批量更新
|
||||||
await QuestionApi.batchUpdate({ questions: updates })
|
await QuestionApi.batchUpdate({ questions: updates })
|
||||||
|
|||||||
@ -101,7 +101,11 @@
|
|||||||
<dict-tag :type="DICT_TYPE.PRISON_QUESTIONNAIRE_TYPE" :value="scope.row.type" />
|
<dict-tag :type="DICT_TYPE.PRISON_QUESTIONNAIRE_TYPE" :value="scope.row.type" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="问卷说明" align="center" prop="description" width="200" />
|
<el-table-column label="问卷说明" align="center" prop="description" width="200">
|
||||||
|
<template #default="scope">
|
||||||
|
<div v-html="scope.row.description"></div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="总分" align="center" prop="totalScore" width="80" />
|
<el-table-column label="总分" align="center" prop="totalScore" width="80" />
|
||||||
<el-table-column label="及格分" align="center" prop="passScore" width="80" />
|
<el-table-column label="及格分" align="center" prop="passScore" width="80" />
|
||||||
<el-table-column label="状态" align="center" prop="status" width="100">
|
<el-table-column label="状态" align="center" prop="status" width="100">
|
||||||
|
|||||||
@ -40,7 +40,7 @@
|
|||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="formData.assessmentDate"
|
v-model="formData.assessmentDate"
|
||||||
type="date"
|
type="date"
|
||||||
value-format="x"
|
value-format="YYYY-MM-DD"
|
||||||
placeholder="选择评估日期"
|
placeholder="选择评估日期"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -72,17 +72,12 @@
|
|||||||
<el-form-item label="管控建议" prop="suggestions">
|
<el-form-item label="管控建议" prop="suggestions">
|
||||||
<el-input v-model="formData.suggestions" placeholder="请输入管控建议" />
|
<el-input v-model="formData.suggestions" placeholder="请输入管控建议" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="评估人ID" prop="assessorId">
|
<!-- 评估人信息由后端自动从登录上下文获取,不在前端显示 -->
|
||||||
<el-input v-model="formData.assessorId" placeholder="请输入评估人ID" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="评估人姓名" prop="assessorName">
|
|
||||||
<el-input v-model="formData.assessorName" placeholder="请输入评估人姓名" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="下次评估日期" prop="nextAssessmentDate">
|
<el-form-item label="下次评估日期" prop="nextAssessmentDate">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="formData.nextAssessmentDate"
|
v-model="formData.nextAssessmentDate"
|
||||||
type="date"
|
type="date"
|
||||||
value-format="x"
|
value-format="YYYY-MM-DD"
|
||||||
placeholder="选择下次评估日期"
|
placeholder="选择下次评估日期"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -129,8 +124,9 @@ const formData = ref({
|
|||||||
id: undefined,
|
id: undefined,
|
||||||
prisonerId: undefined as number | undefined,
|
prisonerId: undefined as number | undefined,
|
||||||
prisonerNo: undefined as string | undefined,
|
prisonerNo: undefined as string | undefined,
|
||||||
|
prisonerName: undefined as string | undefined, // 罪犯姓名(用于显示)
|
||||||
assessmentType: undefined as number | undefined,
|
assessmentType: undefined as number | undefined,
|
||||||
assessmentDate: undefined as number | undefined,
|
assessmentDate: undefined as string | undefined,
|
||||||
violenceScore: undefined as number | undefined,
|
violenceScore: undefined as number | undefined,
|
||||||
escapeScore: undefined as number | undefined,
|
escapeScore: undefined as number | undefined,
|
||||||
suicideScore: undefined as number | undefined,
|
suicideScore: undefined as number | undefined,
|
||||||
@ -138,9 +134,8 @@ const formData = ref({
|
|||||||
riskLevel: undefined as number | undefined,
|
riskLevel: undefined as number | undefined,
|
||||||
riskFactors: undefined as string | undefined,
|
riskFactors: undefined as string | undefined,
|
||||||
suggestions: undefined as string | undefined,
|
suggestions: undefined as string | undefined,
|
||||||
assessorId: undefined as number | undefined,
|
// assessorId 和 assessorName 由后端自动从登录上下文获取,不从前端传递
|
||||||
assessorName: undefined as string | undefined,
|
nextAssessmentDate: undefined as string | undefined,
|
||||||
nextAssessmentDate: undefined as number | undefined,
|
|
||||||
status: 1 as number | undefined,
|
status: 1 as number | undefined,
|
||||||
remark: undefined as string | undefined
|
remark: undefined as string | undefined
|
||||||
})
|
})
|
||||||
@ -153,7 +148,7 @@ const formRules = reactive({
|
|||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
/** 搜索罪犯 */
|
/** 搜索罪犯 - 支持编号和姓名双条件搜索 */
|
||||||
const searchPrisoner = async (query: string) => {
|
const searchPrisoner = async (query: string) => {
|
||||||
if (!query) {
|
if (!query) {
|
||||||
prisonerList.value = []
|
prisonerList.value = []
|
||||||
@ -164,6 +159,7 @@ const searchPrisoner = async (query: string) => {
|
|||||||
const data = await PrisonerApi.getPage({
|
const data = await PrisonerApi.getPage({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
|
prisonerNo: query, // 按罪犯编号搜索
|
||||||
name: query // 按姓名搜索
|
name: query // 按姓名搜索
|
||||||
} as any)
|
} as any)
|
||||||
prisonerList.value = data.list || []
|
prisonerList.value = data.list || []
|
||||||
@ -236,6 +232,7 @@ const resetForm = () => {
|
|||||||
id: undefined,
|
id: undefined,
|
||||||
prisonerId: undefined,
|
prisonerId: undefined,
|
||||||
prisonerNo: undefined,
|
prisonerNo: undefined,
|
||||||
|
prisonerName: undefined,
|
||||||
assessmentType: undefined,
|
assessmentType: undefined,
|
||||||
assessmentDate: undefined,
|
assessmentDate: undefined,
|
||||||
violenceScore: undefined,
|
violenceScore: undefined,
|
||||||
@ -245,8 +242,7 @@ const resetForm = () => {
|
|||||||
riskLevel: undefined,
|
riskLevel: undefined,
|
||||||
riskFactors: undefined,
|
riskFactors: undefined,
|
||||||
suggestions: undefined,
|
suggestions: undefined,
|
||||||
assessorId: undefined,
|
// assessorId 和 assessorName 由后端自动从登录上下文获取,不从前端传递
|
||||||
assessorName: undefined,
|
|
||||||
nextAssessmentDate: undefined,
|
nextAssessmentDate: undefined,
|
||||||
status: 1,
|
status: 1,
|
||||||
remark: undefined
|
remark: undefined
|
||||||
|
|||||||
@ -290,9 +290,21 @@ const submitForm = async () => {
|
|||||||
// 提交请求
|
// 提交请求
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
|
// 格式化时间,保持中国时区
|
||||||
|
const formatDateTime = (timestamp: number) => {
|
||||||
|
if (!timestamp) return undefined
|
||||||
|
const date = new Date(timestamp)
|
||||||
|
const year = date.getFullYear()
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||||
|
const day = String(date.getDate()).padStart(2, '0')
|
||||||
|
const hours = String(date.getHours()).padStart(2, '0')
|
||||||
|
const minutes = String(date.getMinutes()).padStart(2, '0')
|
||||||
|
const seconds = String(date.getSeconds()).padStart(2, '0')
|
||||||
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
||||||
|
}
|
||||||
const data = {
|
const data = {
|
||||||
...formData.value,
|
...formData.value,
|
||||||
occurTime: formData.value.occurTime ? new Date(formData.value.occurTime).toISOString() : undefined
|
occurTime: formatDateTime(formData.value.occurTime)
|
||||||
} as unknown as SituationSaveReqVO
|
} as unknown as SituationSaveReqVO
|
||||||
if (formType.value === 'create') {
|
if (formType.value === 'create') {
|
||||||
await SituationApi.createSituation(data)
|
await SituationApi.createSituation(data)
|
||||||
|
|||||||
@ -385,8 +385,8 @@ const submitForm = async () => {
|
|||||||
try {
|
try {
|
||||||
const data = {
|
const data = {
|
||||||
...formData.value,
|
...formData.value,
|
||||||
alertTime: formData.value.alertTime ? new Date(formData.value.alertTime).toISOString() : undefined,
|
alertTime: formData.value.alertTime ? new Date(formData.value.alertTime).toISOString().slice(0, 19).replace('T', ' ') : undefined,
|
||||||
occurTime: formData.value.occurTime ? new Date(formData.value.occurTime).toISOString() : undefined
|
occurTime: formData.value.occurTime ? new Date(formData.value.occurTime).toISOString().slice(0, 19).replace('T', ' ') : undefined
|
||||||
} as unknown as WarningSaveReqVO
|
} as unknown as WarningSaveReqVO
|
||||||
if (formType.value === 'create') {
|
if (formType.value === 'create') {
|
||||||
await WarningApi.createWarning(data)
|
await WarningApi.createWarning(data)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user