Compare commits
No commits in common. "9e540a9e3f9aa3b73af8dd14c9f29b4c52b12373" and "7887a6e854f28eafb4ad38916a40305b0dcbf50b" have entirely different histories.
9e540a9e3f
...
7887a6e854
|
@ -1,198 +1,8 @@
|
|||
<template>
|
||||
<div>
|
||||
<TableProMax ref="tableRef" :request-api="reqApi" :columns="columns">
|
||||
</TableProMax>
|
||||
<div>
|
||||
<a-modal v-model:open="open" :title="title" @ok="open = false" width="80%">
|
||||
<a-table :columns="TableColumns" :data-source="TableData" bordered >
|
||||
<template #bodyCell="{ column, text }">
|
||||
<template v-if="column.dataIndex === 'name'">
|
||||
<div>{{text}}{{column}}</div>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-modal>
|
||||
</div>
|
||||
<!-- 三色预警 -->
|
||||
三色预警
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="tsx">
|
||||
import TableProMax from "@/components/table/TableProMax.vue";
|
||||
import api from "@/axios";
|
||||
import {TableProMaxProps} from "@/types/components/table";
|
||||
import {
|
||||
AssessmentRecordPagerQueryParams,
|
||||
AssessmentRecordPagerVo, DeductedDetailRes,
|
||||
} from "@/types/views/assessmentRecord.ts";
|
||||
import {ComponentExposed} from "vue-component-type-helpers";
|
||||
import { ref} from "vue";
|
||||
import {Modal, TableColumnType} from "ant-design-vue";
|
||||
const tableRef = ref<ComponentExposed<typeof TableProMax>>(null!)
|
||||
type TableProps = TableProMaxProps<AssessmentRecordPagerVo,AssessmentRecordPagerQueryParams>
|
||||
|
||||
const open = ref<boolean>(false);
|
||||
const title = ref('扣分项')
|
||||
const reqApi: TableProps['requestApi'] = (params) => api.post('/assessmentRecord/pager', params) //分页
|
||||
const columns: TableProps['columns'] = [
|
||||
{
|
||||
dataIndex: 'enterprisesUnitName',
|
||||
title: '单位名称'
|
||||
}, {
|
||||
dataIndex: 'type',
|
||||
title: '类型',
|
||||
customRender: ({text}) => text?.label
|
||||
}, {
|
||||
dataIndex: 'ckProjectName',
|
||||
title: '考核项目'
|
||||
}, {
|
||||
dataIndex: 'totalScore',
|
||||
title: '总分'
|
||||
}, {
|
||||
dataIndex: 'deductionPointsTotal',
|
||||
title: '扣分',
|
||||
customRender:({record})=>{
|
||||
if (!record.deductionPointsTotal) {
|
||||
return <a-tag color="green">0</a-tag>
|
||||
}
|
||||
return <a-tag class="pointer" color="red" onClick={()=>deductedDetail(record)}>{record.deductionPointsTotal}</a-tag>
|
||||
}
|
||||
}, {
|
||||
dataIndex: 'result',
|
||||
title: '得分',
|
||||
customRender: ({record}) => record.totalScore - record.deductionPointsTotal
|
||||
}, {
|
||||
dataIndex: 'policeUnitName',
|
||||
title: '考核单位'
|
||||
}, {
|
||||
dataIndex: 'createUserName',
|
||||
title: '考核人'
|
||||
}, {
|
||||
dataIndex: 'createTime',
|
||||
title: '考核时间'
|
||||
}, {
|
||||
dataIndex: 'remark',
|
||||
title: '考核备注'
|
||||
}, {
|
||||
dataIndex: 'signature',
|
||||
title: '签字',
|
||||
customRender:({record})=>{
|
||||
return <a-button onClick={()=>{
|
||||
Modal.info({
|
||||
title: `${record.enterprisesUnitName}${record.ckProjectName} 签字结果`,
|
||||
content: () => <>
|
||||
<div>审核人签字: <a-image src={record.assessmentUserSignature}/>
|
||||
</div>
|
||||
<div>被审核单位人员签字: <a-image src={record.byAssessmentEnterprisesUnitUserSignature}/></div>
|
||||
</>
|
||||
})
|
||||
}}>查看</a-button>
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
const TableData = [
|
||||
{
|
||||
key: '1',
|
||||
name: 'John Brown',
|
||||
age: 32,
|
||||
tel: '0571-22098909',
|
||||
phone: 18889898989,
|
||||
address: 'New York No. 1 Lake Park',
|
||||
},
|
||||
{
|
||||
key: '2',
|
||||
name: 'Jim Green',
|
||||
tel: '0571-22098333',
|
||||
phone: 18889898888,
|
||||
age: 42,
|
||||
address: 'London No. 1 Lake Park',
|
||||
},
|
||||
{
|
||||
key: '3',
|
||||
name: 'Joe Black',
|
||||
age: 32,
|
||||
tel: '0575-22098909',
|
||||
phone: 18900010002,
|
||||
address: 'Sidney No. 1 Lake Park',
|
||||
},
|
||||
{
|
||||
key: '4',
|
||||
name: 'Jim Red',
|
||||
age: 18,
|
||||
tel: '0575-22098909',
|
||||
phone: 18900010002,
|
||||
address: 'London No. 2 Lake Park',
|
||||
},
|
||||
{
|
||||
key: '5',
|
||||
name: 'Jake White',
|
||||
age: 18,
|
||||
tel: '0575-22098909',
|
||||
phone: 18900010002,
|
||||
address: 'Dublin No. 2 Lake Park',
|
||||
},
|
||||
];
|
||||
const sharedOnCell = (_, index) => {
|
||||
if (index === 4) {
|
||||
return { colSpan: 0 };
|
||||
}
|
||||
};
|
||||
const TableColumns: TableColumnType[] = [
|
||||
{
|
||||
title: 'Name',
|
||||
dataIndex: 'name',
|
||||
customCell: (_, index) => ({
|
||||
colSpan: index < 4 ? 1 : 5,
|
||||
}),
|
||||
},
|
||||
{
|
||||
title: 'Age',
|
||||
dataIndex: 'age',
|
||||
customCell: sharedOnCell,
|
||||
},
|
||||
{
|
||||
title: 'Home phone',
|
||||
colSpan: 2,
|
||||
dataIndex: 'tel',
|
||||
customCell: (_, index) => {
|
||||
if (index === 2) {
|
||||
return { rowSpan: 2 };
|
||||
}
|
||||
// These two are merged into above cell
|
||||
if (index === 3) {
|
||||
return { rowSpan: 0 };
|
||||
}
|
||||
if (index === 4) {
|
||||
return { colSpan: 0 };
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Phone',
|
||||
colSpan: 0,
|
||||
dataIndex: 'phone',
|
||||
customCell: sharedOnCell,
|
||||
},
|
||||
{
|
||||
title: 'Address',
|
||||
dataIndex: 'address',
|
||||
customCell: sharedOnCell,
|
||||
},
|
||||
];
|
||||
const deductedDetail = async (res:any)=>{
|
||||
const {data} = await api.get<DeductedDetailRes[]>('/assessmentRecord/deductedDetail', {assessmentRecordId: res.snowFlakeId})
|
||||
open.value = true
|
||||
console.log(data)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
<script setup lang="ts"></script>
|
||||
|
|
|
@ -8,7 +8,6 @@ type DictType =
|
|||
| 'Sex'
|
||||
| 'ServiceProjectType'
|
||||
| 'MiniProgramUserIdentity'
|
||||
| 'ServiceProjectTwoType'
|
||||
|
||||
export const initEnums = () => {
|
||||
api.get<Record<DictType, SelectNodeVo<any>[]>>('/common/enums').then(resp => {
|
||||
|
|
|
@ -2,7 +2,7 @@ import {defineStore} from "pinia";
|
|||
import {TokenInfo, UserStore} from "@/types/stores/userStore.ts";
|
||||
|
||||
export const useUserStore = defineStore({
|
||||
id: 'baUserStore',
|
||||
id: 'useUserStore',
|
||||
state: (): UserStore => {
|
||||
return {
|
||||
tokenInfo: undefined,
|
||||
|
@ -20,7 +20,7 @@ export const useUserStore = defineStore({
|
|||
getTokenInfo: (state): TokenInfo => state.tokenInfo as TokenInfo,
|
||||
},
|
||||
persist: {
|
||||
key: "baUserStore", //spUserStore
|
||||
key: "useUserStore", //spUserStore
|
||||
storage: window.localStorage,
|
||||
paths: ["tokenInfo"],
|
||||
}
|
||||
|
|
|
@ -8,9 +8,7 @@ export interface serviceProjectSaveOrUpdateParams extends BaseTableRowRecord {
|
|||
projectManagerMiniProgramUserName: string,
|
||||
name: string,
|
||||
type: TypeEnum<string>,
|
||||
twoType: BaseEnum<any>,
|
||||
outsourceName:string,
|
||||
isFiling:BaseEnum<number>,
|
||||
isRecruitSecurity: BaseEnum<number>,
|
||||
idNumber: string,
|
||||
serviceArea: number,
|
||||
buildingTotal: number,
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
import TableProMax from "@/components/table/TableProMax.vue";
|
||||
import {TableProMaxProps} from "@/types/components/table";
|
||||
import api from "@/axios";
|
||||
import {computed, onMounted, ref} from "vue";
|
||||
import {onMounted, ref} from "vue";
|
||||
import {ComponentExposed} from "vue-component-type-helpers";
|
||||
import {dictSelectNodes} from "@/config/dict.ts";
|
||||
import {serviceProjectSaveOrUpdateParams} from "@/types/views/serviceManagement.ts";
|
||||
|
@ -81,9 +81,7 @@ const formParams = ref<{
|
|||
projectManagerMiniProgramUserName?:string
|
||||
name: string,
|
||||
type:string,
|
||||
twoType?: number,
|
||||
outsourceName?:string,
|
||||
isFiling?:number,
|
||||
isRecruitSecurity:number,
|
||||
idNumber?: string,
|
||||
serviceArea?:number,
|
||||
buildingTotal?:number,
|
||||
|
@ -93,8 +91,9 @@ const formParams = ref<{
|
|||
remark?: string,
|
||||
}>({
|
||||
name:'',
|
||||
isRecruitSecurity:0,
|
||||
enterprisesUnitId:null,
|
||||
type:'security'
|
||||
type:'property'
|
||||
})
|
||||
|
||||
const columns: TableProps['columns'] = [
|
||||
|
@ -124,19 +123,8 @@ const columns: TableProps['columns'] = [
|
|||
width:100
|
||||
},
|
||||
{
|
||||
dataIndex:'twoType',
|
||||
title: '二级类型',
|
||||
customRender: ({text}) => <a-tag>{text?.label}</a-tag>,
|
||||
width:120
|
||||
},
|
||||
{
|
||||
dataIndex:'outsourceName',
|
||||
title: '外包公司名称',
|
||||
width:120
|
||||
},
|
||||
{
|
||||
dataIndex:'isFiling',
|
||||
title: '是否备案',
|
||||
dataIndex:'isRecruitSecurity',
|
||||
title: '是否自招保安',
|
||||
customRender: ({text}) => <a-tag>{text?.label}</a-tag>,
|
||||
width:120
|
||||
},
|
||||
|
@ -208,14 +196,22 @@ const columns: TableProps['columns'] = [
|
|||
console.log(record,'9999999')
|
||||
visible.value = true
|
||||
serviceTitle.value = '编辑服务项目'
|
||||
idNumberDisabled.value = record.twoType.value !== 'outsource';
|
||||
if(record.isRecruitSecurity === null ){
|
||||
idNumberDisabled.value = false
|
||||
}
|
||||
if(record.type.value === 'security'){
|
||||
isRecruitSecurityHidden.value = true
|
||||
formParams.value.isRecruitSecurity = null
|
||||
}else{
|
||||
formParams.value.isRecruitSecurity = record.isRecruitSecurity.value
|
||||
if(record.isRecruitSecurity.value === 1){
|
||||
idNumberDisabled.value = true
|
||||
}
|
||||
}
|
||||
formParams.value.projectManagerMiniProgramUserId = record.projectManagerMiniProgramUserId
|
||||
formParams.value.snowFlakeId = record.snowFlakeId
|
||||
formParams.value.name = record.name
|
||||
formParams.value.type = record.type.value
|
||||
formParams.value.twoType = record.twoType.value
|
||||
formParams.value.outsourceName = record.outsourceName
|
||||
formParams.value.isFiling = record.isFiling.value
|
||||
formParams.value.remark = record.remark
|
||||
formParams.value.idNumber = record.idNumber
|
||||
formParams.value.serviceArea = record.serviceArea
|
||||
|
@ -250,14 +246,9 @@ const projectManagerMiniProgram = async()=>{
|
|||
// 企事业单位接口
|
||||
const enterprisesUnitIdList = ref<SelectNodeVo<string>[]>([])
|
||||
const enterprisesUnitId = ref('')
|
||||
|
||||
const isRecruitSecurityHidden = ref<boolean>(false)
|
||||
const idNumberDisabled = ref<boolean>(false)
|
||||
|
||||
// 切换options
|
||||
const netType = computed(() => {
|
||||
return formParams.value.type === 'security' ? dictSelectNodes("ServiceProjectTwoType") : dictSelectNodes("UserType" as any)
|
||||
})
|
||||
const idNumberDisabled = ref<boolean>(false)
|
||||
const formItemOptions = ref<FormProMaxItemOptions<serviceProjectSaveOrUpdateParams>>({
|
||||
name: {
|
||||
type: 'input',
|
||||
|
@ -301,47 +292,35 @@ const formItemOptions = ref<FormProMaxItemOptions<serviceProjectSaveOrUpdatePara
|
|||
required: true,
|
||||
componentsProps:{
|
||||
onChange:(e)=>{
|
||||
if(e.target?.value === 'security'){
|
||||
isRecruitSecurityHidden.value = false
|
||||
formParams.value.twoType = null
|
||||
}else{
|
||||
formParams.value.twoType = null
|
||||
if(e.target.value === 'security'){
|
||||
isRecruitSecurityHidden.value = true
|
||||
formParams.value.isRecruitSecurity = null
|
||||
idNumberDisabled.value = false
|
||||
}else{
|
||||
formParams.value.isRecruitSecurity = 0
|
||||
isRecruitSecurityHidden.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
twoType: {
|
||||
isRecruitSecurity: {
|
||||
type: 'radioGroup',
|
||||
label: '二级类型',
|
||||
options:netType,
|
||||
label: '是否自招保安',
|
||||
options:dictSelectNodes('IsOrNot'),
|
||||
hidden:isRecruitSecurityHidden as any,
|
||||
componentsProps:{
|
||||
onChange:(e)=>{
|
||||
if(e.target.value !== "outsource"){
|
||||
idNumberDisabled.value = true
|
||||
formParams.value.outsourceName = ''
|
||||
}else{
|
||||
idNumberDisabled.value = false
|
||||
}
|
||||
},
|
||||
idNumberDisabled.value = e.target.value !== 0;
|
||||
formParams.value.idNumber = ''
|
||||
}
|
||||
}
|
||||
},
|
||||
outsourceName:{
|
||||
type: 'input',
|
||||
label: '外包公司名称',
|
||||
hidden:idNumberDisabled as any
|
||||
},
|
||||
isFiling:{
|
||||
type: 'radioGroup',
|
||||
label: '是否备案',
|
||||
options:dictSelectNodes('IsOrNot'),
|
||||
},
|
||||
idNumber: {
|
||||
type: 'input',
|
||||
label: '保安服务许可证',
|
||||
// componentsProps:{
|
||||
// disabled:idNumberDisabled as any
|
||||
// }
|
||||
componentsProps:{
|
||||
disabled:idNumberDisabled as any
|
||||
}
|
||||
},
|
||||
serviceArea:{
|
||||
type:'inputNumber',
|
||||
|
@ -393,10 +372,6 @@ const formItemOptions = ref<FormProMaxItemOptions<serviceProjectSaveOrUpdatePara
|
|||
label: '备注',
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
const UnitId = ref('')
|
||||
const submit = async()=>{
|
||||
await formRef.value.validate()
|
||||
|
@ -414,9 +389,7 @@ const submit = async()=>{
|
|||
projectManagerMiniProgramUserId:formParams.value.projectManagerMiniProgramUserId,
|
||||
name: formParams.value.name,
|
||||
type:formParams.value.type,
|
||||
twoType: formParams.value.twoType,
|
||||
outsourceName:formParams.value.outsourceName,
|
||||
isFiling:formParams.value.isFiling,
|
||||
isRecruitSecurity:formParams.value.isRecruitSecurity,
|
||||
idNumber: formParams.value.idNumber,
|
||||
serviceArea:formParams.value.serviceArea,
|
||||
buildingTotal:formParams.value.buildingTotal,
|
||||
|
@ -437,7 +410,8 @@ const closeModal = async()=>{
|
|||
enterprisesUnitId:'',
|
||||
administrativeDivisionCodes:'',
|
||||
name:'',
|
||||
type:'security',
|
||||
type:'property',
|
||||
isRecruitSecurity:0,
|
||||
idNumber:'',
|
||||
serviceArea:null,
|
||||
buildingTotal:null,
|
||||
|
@ -446,10 +420,10 @@ const closeModal = async()=>{
|
|||
securityUserTotal:null,
|
||||
remark:''
|
||||
}
|
||||
formRef.value.resetFields()
|
||||
await formRef.value.resetFields()
|
||||
enterprisesUnitId.value = ''
|
||||
serviceTitle.value = '新增服务项目'
|
||||
// isRecruitSecurityHidden.value = false
|
||||
isRecruitSecurityHidden.value = false
|
||||
idNumberDisabled.value = false
|
||||
}
|
||||
const addServiceProjects = () => {
|
||||
|
|
Loading…
Reference in New Issue