|
|
@ -1,10 +1,9 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-tabs v-model="curTab" |
|
|
|
<el-tabs v-model="curTab"> |
|
|
|
@tab-click="tabChange"> |
|
|
|
|
|
|
|
<el-tab-pane label="产品审批" |
|
|
|
<el-tab-pane label="产品审批" |
|
|
|
name="tab1"> |
|
|
|
name="tab1"> |
|
|
|
<info /> |
|
|
|
<info ref="infoRef" /> |
|
|
|
<el-form ref="formRef" |
|
|
|
<el-form ref="formRef" |
|
|
|
:model="form" |
|
|
|
:model="form" |
|
|
|
:rules="rules" |
|
|
|
:rules="rules" |
|
|
@ -32,11 +31,15 @@ |
|
|
|
<div class="flex flex-col items-end"> |
|
|
|
<div class="flex flex-col items-end"> |
|
|
|
<div class="mb-[18px] text-sm leading-[1.6]"> |
|
|
|
<div class="mb-[18px] text-sm leading-[1.6]"> |
|
|
|
<span class="text-sm font-semibold">审批日期:</span> |
|
|
|
<span class="text-sm font-semibold">审批日期:</span> |
|
|
|
<span>2022年10月18日</span> |
|
|
|
<span>{{ date }}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="inline-flex items-center mb-[18px] text-sm leading-[1.6]"> |
|
|
|
<div class="inline-flex items-center mb-[18px] text-sm leading-[1.6]"> |
|
|
|
<span class="text-sm font-semibold">审批员:</span> |
|
|
|
<span class="text-sm font-semibold">审批员:</span> |
|
|
|
<span class="py-2 px-5 ml-1 text-sm text-white bg-[#006BFF] cursor-pointer">签章</span> |
|
|
|
<span v-if="signed" |
|
|
|
|
|
|
|
class="text-lg text-[#f00]">{{ signed }}</span> |
|
|
|
|
|
|
|
<span v-else |
|
|
|
|
|
|
|
class="py-2 px-5 ml-1 text-sm text-white bg-[#006BFF] cursor-pointer" |
|
|
|
|
|
|
|
@click="sign">签章</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="flex justify-end"> |
|
|
|
<div class="flex justify-end"> |
|
|
@ -50,14 +53,17 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
import { ref, computed, reactive, watch, onMounted } from 'vue'; |
|
|
|
import { ref, computed, reactive, onMounted } from 'vue'; |
|
|
|
import { ElMessage } from 'element-plus'; |
|
|
|
import { ElMessage } from 'element-plus'; |
|
|
|
import type { TabsPaneContext, FormInstance, FormRules } from 'element-plus'; |
|
|
|
import type { TabsPaneContext, FormInstance, FormRules } from 'element-plus'; |
|
|
|
import { useRouter, useRoute } from 'vue-router'; |
|
|
|
import { useRouter, useRoute } from 'vue-router'; |
|
|
|
import Info from './Info.vue'; |
|
|
|
import Info from './Info.vue'; |
|
|
|
|
|
|
|
import { handleId } from '@/utils/common'; |
|
|
|
import { findById, examineAndApprove } from '@/api/bank'; |
|
|
|
import { findById, examineAndApprove } from '@/api/bank'; |
|
|
|
|
|
|
|
import { getTheCurrentUserName, getOperationTime } from '@/api/config'; |
|
|
|
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; |
|
|
|
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; |
|
|
|
import dayjs from 'dayjs'; |
|
|
|
import dayjs from 'dayjs'; |
|
|
|
|
|
|
|
import Cookies from 'js-cookie'; |
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['getList']); |
|
|
|
const emit = defineEmits(['getList']); |
|
|
|
interface RuleForm { |
|
|
|
interface RuleForm { |
|
|
@ -67,10 +73,14 @@ interface RuleForm { |
|
|
|
} |
|
|
|
} |
|
|
|
const router = useRouter(); |
|
|
|
const router = useRouter(); |
|
|
|
const route = useRoute(); |
|
|
|
const route = useRoute(); |
|
|
|
|
|
|
|
const projectId = +Cookies.get('sand-projectId'); |
|
|
|
|
|
|
|
const levelId = +Cookies.get('sand-level'); |
|
|
|
const curTab = ref<string>('tab1'); |
|
|
|
const curTab = ref<string>('tab1'); |
|
|
|
|
|
|
|
const date = ref<string>(dayjs(new Date()).format('YYYY-M-D')); |
|
|
|
const info = ref<any>({}); |
|
|
|
const info = ref<any>({}); |
|
|
|
const config = ref<any[]>([]); |
|
|
|
const config = ref<any[]>([]); |
|
|
|
const formRef = ref<FormInstance>(); |
|
|
|
const formRef = ref<FormInstance>(); |
|
|
|
|
|
|
|
const infoRef = ref<any>(null); |
|
|
|
const form = reactive<RuleForm>({ |
|
|
|
const form = reactive<RuleForm>({ |
|
|
|
id: computed(() => +route.query.id), |
|
|
|
id: computed(() => +route.query.id), |
|
|
|
status: '', |
|
|
|
status: '', |
|
|
@ -80,25 +90,41 @@ const rules = reactive<FormRules<RuleForm>>({ |
|
|
|
status: [{ required: true, message: '请选择审批意见', trigger: 'change' }], |
|
|
|
status: [{ required: true, message: '请选择审批意见', trigger: 'change' }], |
|
|
|
opinionDescription: [{ required: true, message: '请输入意见描述', trigger: 'blur' }], |
|
|
|
opinionDescription: [{ required: true, message: '请输入意见描述', trigger: 'blur' }], |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
const signed = ref<string>(); |
|
|
|
|
|
|
|
|
|
|
|
// tab切换回调 |
|
|
|
|
|
|
|
const tabChange = (tab: TabsPaneContext, event: Event) => { |
|
|
|
|
|
|
|
console.log(tab, event); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
// 配置项 |
|
|
|
// 配置项 |
|
|
|
const getConfig = async () => { |
|
|
|
const getConfig = async () => { |
|
|
|
const { process } = await getProcessInformationBasedOnRoles(43); // 专家委员会43 |
|
|
|
const { process } = await getProcessInformationBasedOnRoles(43); // 专家委员会43 |
|
|
|
config.value = process; |
|
|
|
config.value = process; |
|
|
|
}; |
|
|
|
}; |
|
|
|
watch( |
|
|
|
// 获取操作日期 |
|
|
|
() => route.query, |
|
|
|
const getDate = async () => { |
|
|
|
() => { |
|
|
|
const res = await getOperationTime(levelId, projectId); |
|
|
|
// getDetail(); |
|
|
|
if (res.operationTime) { |
|
|
|
}, |
|
|
|
date.value = res.operationTime; |
|
|
|
{ |
|
|
|
} |
|
|
|
immediate: true, |
|
|
|
}; |
|
|
|
}, |
|
|
|
// 签章 |
|
|
|
); |
|
|
|
const sign = async () => { |
|
|
|
|
|
|
|
const res = await getTheCurrentUserName(); |
|
|
|
|
|
|
|
signed.value = res.userName; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
// 新增判分记录 |
|
|
|
|
|
|
|
const addRecord = async (data: Record<string, any>) => { |
|
|
|
|
|
|
|
const preIds = `1,${levelId},43`; // 1,关卡id,角色(这个页面是专家委员会审批) |
|
|
|
|
|
|
|
const approved = !!infoRef.value.info.approvalTime; // 有审批时间则表示审批过了,判分点要用第二次审批的id |
|
|
|
|
|
|
|
const lcRule = [ |
|
|
|
|
|
|
|
handleId(approved ? 1215 : 145, 69, data.status, preIds + ',' + (approved ? 1215 : 145), 1), |
|
|
|
|
|
|
|
handleId(approved ? 1216 : 146, 70, data.opinionDescription, preIds + ',' + (approved ? 1216 : 146), 3), |
|
|
|
|
|
|
|
handleId(approved ? 1217 : 758, 233, signed.value ? 514 : 515, preIds + ',' + (approved ? 1217 : 758), 1), |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
await addOperation({ |
|
|
|
|
|
|
|
checkpointId: levelId, |
|
|
|
|
|
|
|
parentId: preIds, |
|
|
|
|
|
|
|
lcJudgmentRuleReq: lcRule, |
|
|
|
|
|
|
|
projectId, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}; |
|
|
|
// 提交 |
|
|
|
// 提交 |
|
|
|
const submit = async (formEl: FormInstance | undefined) => { |
|
|
|
const submit = async (formEl: FormInstance | undefined) => { |
|
|
|
if (!formEl) return; |
|
|
|
if (!formEl) return; |
|
|
@ -106,34 +132,20 @@ const submit = async (formEl: FormInstance | undefined) => { |
|
|
|
if (valid) { |
|
|
|
if (valid) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
const param = JSON.parse(JSON.stringify(form)); |
|
|
|
const param = JSON.parse(JSON.stringify(form)); |
|
|
|
param.approvalTime = dayjs(new Date()).format('YYYY年-M月-D日'); |
|
|
|
param.approvalTime = dayjs(new Date()).format('YYYY-M-D'); |
|
|
|
|
|
|
|
|
|
|
|
// const { message } = await examineAndApprove(param); |
|
|
|
await examineAndApprove(param.id, param.opinionDescription, param.status, param.approvalTime); |
|
|
|
const { message } = await examineAndApprove(param.id, param.opinionDescription, param.status, param.approvalTime); |
|
|
|
addRecord(param); |
|
|
|
// addRecord(param, message); |
|
|
|
|
|
|
|
ElMessage.success('提交成功!'); |
|
|
|
ElMessage.success('提交成功!'); |
|
|
|
emit('getList', 1); |
|
|
|
emit('getList', 1); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
|
|
|
|
console.log('error submit!', fields); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
|
// 新增判分记录 |
|
|
|
|
|
|
|
const addRecord = async (data: Record<string, any>, newId: number) => { |
|
|
|
|
|
|
|
const preIds = `1,2,43,${data.productType ? 45 : 44},${newId}`; // 1,关卡id,角色(这个页面是专家委员会审批),个人/企业(44/45) |
|
|
|
|
|
|
|
const lcRule: Array<Record<string, any>> = [handleId(145, 69, data.status, preIds + ',145', 1), handleId(146, 70, data.opinionDescription, preIds + ',146', 3)]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await addOperation({ |
|
|
|
|
|
|
|
checkpointId: +Cookies.get('sand-level'), |
|
|
|
|
|
|
|
parentId: preIds, |
|
|
|
|
|
|
|
lcJudgmentRuleReq: lcRule, |
|
|
|
|
|
|
|
projectId: +Cookies.get('sand-projectId'), |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
onMounted(() => { |
|
|
|
getConfig(); |
|
|
|
getConfig(); |
|
|
|
|
|
|
|
getDate(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|