zhouhaibin
5 months ago
10 changed files with 503 additions and 14 deletions
@ -0,0 +1,156 @@ |
|||
<template> |
|||
<div> |
|||
<el-divider content-position="left">联合技术审查文件详情</el-divider> |
|||
<UploadfileDetail :projectid="projectId" :stage="6" /> |
|||
</div> |
|||
<div> |
|||
<el-divider content-position="left">联合技术审查审批文件详情</el-divider> |
|||
<UploadfileDetail :projectid="projectId" :stage="7" /> |
|||
</div> |
|||
<ApprovalDetails :processInstanceId="processInstanceId" /> |
|||
<!-- --> |
|||
<ApprovalFromPage |
|||
:showApprovalForm="showApprovalForm" |
|||
:buttons="resButton.buttons" |
|||
ref="ApprovalFromPageRef" |
|||
@submit="handleSubmit" |
|||
@exit="exit" |
|||
> |
|||
<div> |
|||
<div v-if="procesType == '0' && !resButton.isEdit"> |
|||
<el-divider content-position="left">上传意见文件</el-divider> |
|||
<div style="display: flex; justify-content: center; align-items: center; height: 100px"> |
|||
<el-upload |
|||
class="upload-demo" |
|||
ref="upload" |
|||
action |
|||
:http-request="httpRequestadvice" |
|||
:before-upload="beforeUpload" |
|||
:on-exceed="handleExceed" |
|||
:limit="10" |
|||
:on-remove="removeFile" |
|||
> |
|||
<el-button slot="trigger" size="small" type="primary">选取文件</el-button> |
|||
<div slot="tip" class="el-upload__tip">文件大小且不超过500M</div> |
|||
</el-upload> |
|||
</div> |
|||
</div> |
|||
<el-divider content-position="left" v-if="resButton.isEdit">重新上传项目资料</el-divider> |
|||
<div |
|||
v-if="resButton.isEdit" |
|||
style="display: flex; justify-content: center; align-items: center; height: 100px" |
|||
> |
|||
<el-upload |
|||
class="upload-demo" |
|||
ref="upload" |
|||
action |
|||
:http-request="httpRequest" |
|||
:before-upload="beforeUpload" |
|||
:on-exceed="handleExceed" |
|||
:limit="5" |
|||
:on-remove="removeFile" |
|||
> |
|||
<el-button slot="trigger" size="small" type="primary">选取文件</el-button> |
|||
<div slot="tip" class="el-upload__tip">文件大小且不超过500M</div> |
|||
</el-upload> |
|||
</div> |
|||
</div> |
|||
</ApprovalFromPage> |
|||
</template> |
|||
<script lang="ts" name="uploadfileApproval" setup> |
|||
import { onMounted, ref, reactive } from 'vue'; |
|||
import { approveURTFile, getActionParam } from '@/views/myWork/inComplete/inComplete.api'; |
|||
import { ElMessage } from 'element-plus'; |
|||
import ApprovalDetails from '@/views/ProcessApprovalSubPage/component/ApprovalDetails.vue'; |
|||
import ApprovalFromPage from '@/views/ProcessApprovalSubPage/component/ApprovalFromPage.vue'; |
|||
import UploadfileDetail from '@/views/ProcessApprovalSubPage/component/UploadfileDetail.vue'; |
|||
|
|||
let dataTo = defineProps(['record']); |
|||
console.log('routerouterouteroute', dataTo.record); |
|||
let projectId = dataTo.record.projectId as string; |
|||
let processInstanceId = dataTo.record.processInstanceId; |
|||
let taskid = dataTo.record.taskId as string; |
|||
let procesType = dataTo.record.procesType; |
|||
const emit = defineEmits(['close']); |
|||
let showApprovalForm = ref(); |
|||
let ApprovalFromPageRef = ref(); |
|||
let resButton = reactive({ |
|||
showApprovalForm: false, |
|||
isEdit: false, |
|||
buttons: [], |
|||
}); |
|||
let fileList = reactive<Array<any>>([]); |
|||
let fileAdviceList = reactive<Array<any>>([]); |
|||
onMounted(async () => { |
|||
resButton = await getActionParam({ |
|||
processInstanceId: processInstanceId, |
|||
taskId: taskid, |
|||
procesType: dataTo.record.procesType, |
|||
}); |
|||
showApprovalForm.value = resButton.showApprovalForm; |
|||
}); |
|||
|
|||
function removeFile(option) { |
|||
for (let i = 0; i < fileList.length; i++) { |
|||
if (fileList[i].file.name == option.name) { |
|||
fileList.splice(i, 1); |
|||
} |
|||
} |
|||
for (let i = 0; i < fileAdviceList.length; i++) { |
|||
if (fileAdviceList[i].file.name == option.name) { |
|||
fileAdviceList.splice(i, 1); |
|||
} |
|||
} |
|||
} |
|||
function httpRequest(option) { |
|||
fileList.push(option); |
|||
} |
|||
function httpRequestadvice(option) { |
|||
fileAdviceList.push(option); |
|||
} |
|||
// 上传前处理 |
|||
function beforeUpload(file) { |
|||
let fileSize = file.size; |
|||
const FIVE_M = 500 * 1024 * 1024; |
|||
//大于5M,不允许上传 |
|||
if (fileSize > FIVE_M) { |
|||
ElMessage.error('最大上传500M'); |
|||
return false; |
|||
} |
|||
|
|||
return true; |
|||
} |
|||
// 文件数量过多时提醒 |
|||
function handleExceed() { |
|||
ElMessage.warning('最多只能上传五个文件'); |
|||
} |
|||
|
|||
async function handleSubmit() { |
|||
let approvalform = await ApprovalFromPageRef.value.getFieldsValueApprovalForm(); |
|||
const params = new FormData(); |
|||
params.append('flag', approvalform.flag); |
|||
params.append('projectid', projectId); |
|||
params.append('comment', approvalform.comment); |
|||
params.append('taskId', taskid); |
|||
if (fileList.length > 0) { |
|||
fileList.forEach((x) => { |
|||
params.append('file', x.file); |
|||
}); |
|||
} |
|||
if (fileAdviceList.length > 0) { |
|||
fileAdviceList.forEach((x) => { |
|||
params.append('adviceFile', x.file); |
|||
}); |
|||
} |
|||
console.log('param', params, 'approvalform', approvalform); |
|||
if (await ApprovalFromPageRef.value.validateApprovalForm()) { |
|||
let res = await approveURTFile(params); |
|||
console.log('提交成功!', res); |
|||
emit('close'); |
|||
} |
|||
} |
|||
async function exit() { |
|||
emit('close'); |
|||
} |
|||
</script> |
|||
<style></style> |
@ -0,0 +1,135 @@ |
|||
<template> |
|||
<BasicModal v-bind="$attrs" @register="registerModal" width="1200px" :showOkBtn="false" :title="dataTo.title"> |
|||
<!--引用表格--> |
|||
<BasicTable @register="registerTable"> |
|||
<!--插槽:table标题--> |
|||
<!--操作栏--> |
|||
<template #action="{ record }"> |
|||
<!-- <TableAction :actions="getTableAction(record)" /> --> |
|||
<TableAction :actions="getTableAction(record)" /> |
|||
</template> |
|||
</BasicTable> |
|||
|
|||
</BasicModal> |
|||
|
|||
<slot :projectid="proid"></slot> |
|||
<BasicModal @register="registeModal" title="文件详情" width="1200px" :showOkBtn="false" :showCancelBtn="false"> |
|||
<div> |
|||
<el-divider content-position="left">联合技术审查文件详情</el-divider> |
|||
<UploadfileDetail :projectid="projectId" :stage="6" /> |
|||
</div> |
|||
<div> |
|||
<el-divider content-position="left">联合技术审查审批文件详情</el-divider> |
|||
<UploadfileDetail :projectid="projectId" :stage="7" /> |
|||
</div> |
|||
<ApprovalDetails :projectid="projectId" :stage="'createURT'" /> |
|||
|
|||
</BasicModal> |
|||
|
|||
</template> |
|||
|
|||
<script lang="ts" name="ProjectinfoComponent" setup> |
|||
//ts语法 |
|||
import { ref,reactive } from 'vue'; |
|||
import { ActionItem, BasicTable, TableAction, useTable } from '@/components/Table'; |
|||
import { BasicModal, useModal ,useModalInner} from '@/components/Modal'; |
|||
import { columns, searchFormSchema } from '../../projectLib/projectInfo/projectInfo.data'; |
|||
import { getProjectInfoAndChildPageList, isShowByRoles } from '../../projectLib/projectInfo/projectInfo.api'; |
|||
import UploadfileDetail from "@/views/ProcessApprovalSubPage/component/UploadfileDetail.vue" |
|||
import ApprovalDetails from "../../ProcessApprovalSubPage/component/ApprovalDetails.vue" |
|||
|
|||
const [registeModal, { openModal: openregisteModal, closeModal: closeregisteModal }] = useModal();//文件详情 |
|||
|
|||
let emit = defineEmits(["openChildModal"]) |
|||
let proid = ref(); |
|||
let projectId = ref(); |
|||
let dataTo = reactive({ |
|||
title: "", |
|||
api:getProjectInfoAndChildPageList, |
|||
stage: 2, |
|||
columns: columns, |
|||
}) |
|||
|
|||
const [registerModal] = useModalInner(init); |
|||
function init(data) { |
|||
console.log("initdataTo", data,dataTo.api) |
|||
if(data.api){ |
|||
dataTo.api = data.api |
|||
} |
|||
if(data.title){ |
|||
dataTo.title = data.title |
|||
} |
|||
if(data.stage){ |
|||
dataTo.stage = data.stage |
|||
} |
|||
if(data.columns){ |
|||
dataTo.columns = data.columns |
|||
} |
|||
setProps({api:dataTo.api,columns:dataTo.columns}) |
|||
reload() |
|||
} |
|||
console.log("isShowByRoles", isShowByRoles('manage,sys:admin')) |
|||
const [registerTable,{reload,setProps}] = useTable({ |
|||
title: '项目信息', |
|||
api: getProjectInfoAndChildPageList, |
|||
useSearchForm: true, |
|||
columns: columns, |
|||
rowKey: "id", |
|||
showIndexColumn: false, |
|||
actionColumn: { |
|||
width: 140, |
|||
title: '操作', |
|||
dataIndex: 'action', |
|||
slots: { customRender: 'action' }, |
|||
}, |
|||
beforeFetch(param) { |
|||
param.stage = dataTo.stage? dataTo.stage : 2 |
|||
}, |
|||
// rowSelection: { type: 'radio' }, |
|||
//表单查询项设置 |
|||
formConfig: { |
|||
schemas: searchFormSchema, |
|||
} |
|||
}); |
|||
|
|||
function getTableAction(record): ActionItem[] { |
|||
return [ |
|||
{ |
|||
label: "上传文件", |
|||
ifShow:()=>{ |
|||
if(record.utrIsfinish==0){ |
|||
return true |
|||
}else{ |
|||
return false |
|||
} |
|||
}, |
|||
onClick: handlemodify.bind(null, record), |
|||
}, |
|||
{ |
|||
label: "详情", |
|||
ifShow:()=>{ |
|||
if(record.utrIsfinish!=0){ |
|||
return true |
|||
}else{ |
|||
return false |
|||
} |
|||
}, |
|||
onClick: handledetail.bind(null, record), |
|||
} |
|||
]; |
|||
} |
|||
|
|||
|
|||
function handlemodify(record) { |
|||
proid.value = record.id |
|||
console.log("handlemodify", proid.value) |
|||
emit("openChildModal", record) |
|||
|
|||
} |
|||
function handledetail(record) { |
|||
projectId.value = record.id |
|||
openregisteModal() |
|||
} |
|||
</script> |
|||
|
|||
<style scoped></style> |
@ -0,0 +1,107 @@ |
|||
<template> |
|||
<!-- 自定义表单 --> |
|||
<BasicModal v-bind="$attrs" @register="registerModal" title="上传文件" width="1200px" :showOkBtn="false" |
|||
:showCancelBtn="false"> |
|||
<el-form ref="importFormRef"> |
|||
<el-form-item label="上传文件:"> |
|||
<el-upload class="upload-demo" ref="upload" action :http-request="httpRequest" |
|||
:before-upload="beforeUpload" :on-exceed="handleExceed" :limit="10" :on-remove="removeFile"> |
|||
<el-button slot="trigger" size="small" type="primary">选取文件</el-button> |
|||
<div slot="tip" class="el-upload__tip">文件大小且不超过500M</div> |
|||
</el-upload> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button type="primary" @click="submitImportForm">开始导入</el-button> |
|||
<el-button type="info" @click="dialogVisible">关闭窗口</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</BasicModal> |
|||
</template> |
|||
<script lang="ts" name="setProjectWorkReport" setup> |
|||
import { reactive, defineEmits, onMounted, ref } from 'vue'; |
|||
import { ElMessage } from 'element-plus'; |
|||
|
|||
import { useModalInner, BasicModal } from '@/components/Modal'; |
|||
import { uploadURTFile } from '@/views/projectLib/projectPlan/projectPlan.api'; |
|||
import { queryProjectInfoById } from '@/views/projectLib/projectInfo/projectInfo.api'; |
|||
const [registerModal, { closeModal }] = useModalInner(init); |
|||
let fileList = reactive<Array<any>>([]); |
|||
let projectid = ref("") |
|||
async function init(data) { |
|||
console.log('datadatadata', data); |
|||
projectid.value = data.projectid; |
|||
} |
|||
|
|||
const emit = defineEmits(['close']); |
|||
//加载项目数据 |
|||
onMounted(async () => { |
|||
}); |
|||
|
|||
function httpRequest(option) { |
|||
fileList.push(option); |
|||
console.log(fileList, option); |
|||
} |
|||
function removeFile(option) { |
|||
for (let i = 0; i < fileList.length; i++) { |
|||
if (fileList[i].file.name == option.name) { |
|||
fileList.splice(i, 1); |
|||
} |
|||
} |
|||
console.log(fileList, option); |
|||
} |
|||
// 上传前处理 |
|||
function beforeUpload(file, item) { |
|||
console.log('file,item', file, item); |
|||
let fileSize = file.size; |
|||
const FIVE_M = 500 * 1024 * 1024; |
|||
//大于5M,不允许上传 |
|||
if (fileSize > FIVE_M) { |
|||
ElMessage.error('最大上传500M'); |
|||
return false; |
|||
} |
|||
// let geShi = ['xlx', 'xlsx', 'docx', 'doc', 'pdf'] as Array<string>; |
|||
// if (geShi.indexOf(file.name.substring(file.name.indexOf('.') + 1)) == -1) { |
|||
// ElMessage.error('文件格式错误!仅支持' + 'xlx,xlsx, docx, doc, pdf'); |
|||
// console.log('文件格式错误!仅支持' + 'xlsx', 'docx', 'doc', 'pdf'); |
|||
// return false; |
|||
// } |
|||
// if (item.indexOf(file.name.substring(0, file.name.indexOf('.'))) == -1) { |
|||
// ElMessage.error('请上传文件:' + item); |
|||
// return false; |
|||
// } |
|||
console.log('文件上传成功'); |
|||
|
|||
return true; |
|||
} |
|||
// 文件数量过多时提醒 |
|||
function handleExceed() { |
|||
ElMessage.warning('最多只能上传十个文件'); |
|||
} |
|||
//导入Excel病种信息数据 |
|||
async function submitImportForm() { |
|||
if (fileList.length == 0) { |
|||
ElMessage({ |
|||
message: '未选择任何文件,无法上传!', |
|||
type: 'error', |
|||
}); |
|||
return; |
|||
} |
|||
|
|||
// // 使用form表单的数据格式 |
|||
const params = new FormData(); |
|||
// 将上传文件数组依次添加到参数paramsData中 |
|||
fileList.forEach((x) => { |
|||
console.log('xxxxxxxxxx', x, x.file); |
|||
params.append('file', x.file); |
|||
}); |
|||
params.append('projectid', projectid.value); |
|||
uploadURTFile(params).then(() => { |
|||
emit('close'); |
|||
}); |
|||
} |
|||
function dialogVisible() { |
|||
emit('close'); |
|||
} |
|||
</script> |
|||
<style></style> |
Loading…
Reference in new issue