|
|
@ -7,10 +7,15 @@ import { ElButton, ElMessage, ElMessageBox } from 'element-plus';
|
|
|
|
import { getCategory } from '@/api/reporting/RepTemplate/RepTemplate';
|
|
|
|
import { getCategory } from '@/api/reporting/RepTemplate/RepTemplate';
|
|
|
|
import { transfDictList } from '@/utils';
|
|
|
|
import { transfDictList } from '@/utils';
|
|
|
|
import { REPORTING_STATUS_LIST } from '../constants';
|
|
|
|
import { REPORTING_STATUS_LIST } from '../constants';
|
|
|
|
|
|
|
|
import { getLoginNameByUserInfo } from '@/utils/auth';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const session_loginName = getLoginNameByUserInfo();
|
|
|
|
|
|
|
|
|
|
|
|
const { required } = useValidator()
|
|
|
|
const { required } = useValidator()
|
|
|
|
let fileData = null;
|
|
|
|
let fileData = null;
|
|
|
|
|
|
|
|
let tName = null;
|
|
|
|
|
|
|
|
let createTime = null;
|
|
|
|
|
|
|
|
let updateTime = null;
|
|
|
|
const props = defineProps({
|
|
|
|
const props = defineProps({
|
|
|
|
currentRow: {
|
|
|
|
currentRow: {
|
|
|
|
type: Object as PropType<any>,
|
|
|
|
type: Object as PropType<any>,
|
|
|
@ -36,7 +41,7 @@ const formSchema = reactive<FormSchema[]>([
|
|
|
|
field: 'tCategory',
|
|
|
|
field: 'tCategory',
|
|
|
|
label: '报告分类',
|
|
|
|
label: '报告分类',
|
|
|
|
component: 'Select',
|
|
|
|
component: 'Select',
|
|
|
|
optionApi: async () => {
|
|
|
|
optionApi: async () => {
|
|
|
|
const res = await getCategory({ paramName: 'reportingType_param', systemCode: 'ordb' });
|
|
|
|
const res = await getCategory({ paramName: 'reportingType_param', systemCode: 'ordb' });
|
|
|
|
return transfDictList(res.body.result);
|
|
|
|
return transfDictList(res.body.result);
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -89,7 +94,7 @@ const formSchema = reactive<FormSchema[]>([
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
field: 'organCode',
|
|
|
|
field: 'file',
|
|
|
|
label: '报告模版',
|
|
|
|
label: '报告模版',
|
|
|
|
component: 'Upload',
|
|
|
|
component: 'Upload',
|
|
|
|
colProps: { span: 24 },
|
|
|
|
colProps: { span: 24 },
|
|
|
@ -109,22 +114,27 @@ const formSchema = reactive<FormSchema[]>([
|
|
|
|
onExceed: () => {
|
|
|
|
onExceed: () => {
|
|
|
|
ElMessage.warning("上传模板失败,当前已有模板,只能上传一个模板")
|
|
|
|
ElMessage.warning("上传模板失败,当前已有模板,只能上传一个模板")
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
onSuccess:() => {
|
|
|
|
|
|
|
|
ElMessage.success("上传成功")
|
|
|
|
|
|
|
|
},
|
|
|
|
slots: {
|
|
|
|
slots: {
|
|
|
|
default: () =><div class="el-upload"><i class="fa fa-upload cursor-pointer"></i><br/><h1 class="el-upload__text">拖拽报告模版到这里...<br/>或<em>上传报告模版</em></h1></div>,
|
|
|
|
default: () =><div class="el-upload"><i class="el-icon-upload"></i><br/><h1 class="el-upload__text">拖拽报告模版到这里...<br/>或<em>上传报告模版</em></h1></div>,
|
|
|
|
tip: () => <div class="el-upload__tip">doc,docx文件</div>,
|
|
|
|
tip: () => <div class="el-upload__tip">doc,docx文件</div>,
|
|
|
|
file:(file)=>{
|
|
|
|
file:(file)=>{
|
|
|
|
fileData = file.file.raw;
|
|
|
|
fileData = file.file.raw;
|
|
|
|
|
|
|
|
tName=file.file.name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
style:{
|
|
|
|
style:{
|
|
|
|
width:"100%",
|
|
|
|
width:"100%",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
const rules = reactive({
|
|
|
|
const rules = reactive({
|
|
|
|
// tStatus:[required()],//报告状态
|
|
|
|
//file:[required()],//报告模版
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
@ -135,7 +145,19 @@ const submit = async () => {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
if (valid) {
|
|
|
|
if (valid) {
|
|
|
|
const formData = await getFormData()
|
|
|
|
const formData = await getFormData()
|
|
|
|
formData.organCode = fileData;
|
|
|
|
formData.file = fileData;
|
|
|
|
|
|
|
|
formData.tName = tName;
|
|
|
|
|
|
|
|
formData.uploadUser=session_loginName;
|
|
|
|
|
|
|
|
let time = new Date()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//新增
|
|
|
|
|
|
|
|
if(props.actionType=='add'){
|
|
|
|
|
|
|
|
formData.createTime=time.toLocaleString();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//编辑
|
|
|
|
|
|
|
|
else{
|
|
|
|
|
|
|
|
formData.updateTime=time.toLocaleString();
|
|
|
|
|
|
|
|
}
|
|
|
|
return formData
|
|
|
|
return formData
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -159,5 +181,4 @@ defineExpose({
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<Form :rules="rules" @register="formRegister" :schema="formSchema" />
|
|
|
|
<Form :rules="rules" @register="formRegister" :schema="formSchema" />
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|