Merge pull request 'master' (#180) from master into prod

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/180
This commit is contained in:
2024-05-15 01:58:49 +00:00
9 changed files with 473 additions and 98 deletions

View File

@@ -6,10 +6,11 @@
with-credentials
:multiple="maxSize > 0"
:data="uploadParams"
:show-file-list="false"
:show-file-list="showFileList"
:auto-upload="true"
:before-upload="beforeUpload"
:on-success="handleUploadSuccess"
:on-error="uploadError"
>
<el-button color="#DED0B2" :loading="loading">上传文件</el-button>
</el-upload>
@@ -37,6 +38,10 @@ const props = defineProps({
maxSize: {
type: Number,
default: 30
},
showFileList: {
type: Boolean,
default: false
}
})
@@ -75,7 +80,11 @@ const handleUploadSuccess = (res, file) => {
showTable.value = true
let data = res.data
fileList.value.push(data)
emit("getFile", fileList.value)
emit("getFile", res.data)
}
const uploadError=(err)=>{
loading.value = false
ElMessage.error("上传失败,请稍后再试!")
}
</script>

View File

@@ -33,10 +33,12 @@
</div>
</el-form>
<baseTitle title="征集说明"></baseTitle>
<Tinymce image-url="/notice/file" file-url="/notice/file" v-model:value="formData.collectExplain" height="300" v-if="showTinymce"/>
<Tinymce image-url="/notice/file" file-url="/notice/file" v-model:value="formData.collectExplain" height="300"
v-if="showTinymce"/>
<baseTitle title="申请文件"></baseTitle>
<file-upload @getFile="getFile"/>
<fvTable style="width: 100%;max-height: 200px" v-if="showTable" :tableConfig="tableConfig" :data="formData.fileList" :isSettingCol="false" :pagination="false">
<file-upload ref="uploadFile" @getFile="getFile"/>
<fvTable style="width: 100%;max-height: 200px" v-if="showTable" :tableConfig="tableConfig" :data="formData.fileList"
:isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
</template>
@@ -78,7 +80,8 @@ const formData = ref({
companyIds: '',
collectType: '',
deadline: '',
collectExplain: ''
collectExplain: '',
fileList: []
})
const showTinymce = ref(true)
const processDiagramViewer = ref(false)
@@ -90,9 +93,9 @@ const typeOption = ref([
])
const companyOption = ref([])
const form = ref(null)
const fileList = ref(null)
const fileList = ref([])
const loading = ref(false)
const showTable = ref(false)
const showTable = ref(true)
const processStore = useProcessStore()
const processInstanceData = ref()
const rules = reactive({
@@ -136,49 +139,37 @@ const tableConfig = reactive({
return (
<div>
<a style="cursor: pointer;font-size: 14px;color: #2a99ff;" href={row.url}>下载</a>
<el-button type="primary" size="large" link onClick={() => beforeRemove(row)}>删除</el-button>
<el-button type="primary" size="large" link onClick={() => handleDelete(row)}>删除</el-button>
</div>
)
}
}
]
})
const compositeParam=(item)=>{
return {
fileId: item.id,
size: item.size,
originalFileName: item.originalFilename,
fileType: item.fileType,
url: item.url,
processNodeTag: null,
tag: formData.value.collectType,
userId: authStore.userinfo.userId
}
const compositeParam = (item) => {
let tag=''
if(!formData.value.collectType&&router.currentRoute.value.name==='Collection/add'){
tag='需求征集'
}
return {
fileId: item.id,
size: item.size,
originalFileName: item.originalFilename,
fileType: item.fileType,
url: item.url,
processNodeTag: null,
tag: tag,
userId: authStore.userinfo.userId
}
}
const getFile = (val) => {
console.log('上传文件',val)
console.log('上传文件', val)
showTable.value = false
let fileObj = compositeParam(val)
formData.value.fileList.push(fileObj)
nextTick(() => {
showTable.value = true
})
let fileObj = {}
let newFileArray = []
if (route.query.isAdd === undefined) {
val.forEach(item => {
fileObj =compositeParam(item)
newFileArray.push(fileObj)
formData.value.fileList.push(fileObj)
})
fileList.value = formData.value.fileList
} else {
val.forEach(item => {
fileObj =compositeParam(item)
newFileArray.push(fileObj)
})
formData.value.fileList = newFileArray
fileList.value = newFileArray
}
}
const init = async () => {
@@ -198,18 +189,23 @@ const init = async () => {
})
})
}
const submitParam=()=>{
return {
collectExplain: formData.value.collectExplain,
collectType: formData.value.collectType,
companyIds: formData.value.companyIds,
deadline: formData.value.deadline,
requirementId: formData.value.requirementId?formData.value.requirementId:0,
requirementName: formData.value.requirementName,
files: formData.value.fileList,
deploymentId: processInstanceData.value.deploymentId
}
}
const handleSubmit = async (instance) => {
if (!instance) return
instance.validate(async (valid) => {
if (!valid) return
let params = {
...formData.value,
requirementId: 0,
files: fileList.value,
deploymentId: processInstanceData.value.deploymentId
}
let res = await addRequirement(params)
let res = await addRequirement(submitParam())
if (res.code === 1000) {
ElMessage.success(res.msg)
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
@@ -222,11 +218,7 @@ const handleSubmit = async (instance) => {
})
}
const handleResubmit = () => {
resubmit({
...formData.value,
files: fileList.value,
deploymentId: processInstanceData.value.deploymentId
}).then(res => {
resubmit(submitParam()).then(res => {
if (res.code === 1000) {
ElMessage.success(res.msg)
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
@@ -241,12 +233,13 @@ const handleResubmit = () => {
const getDetailInfo = async () => {
getFormInfo(route.query.id).then(res => {
if (res.code === 1000) {
console.log(res)
ElMessage.success(res.msg)
formData.value = res.data
showTinymce.value = false
showTable.value = false
nextTick(() => {
showTinymce.value = true
showTable.value = true
})
} else {
ElMessage.error(res.msg)
@@ -257,44 +250,38 @@ const getDetailInfo = async () => {
const handleBack = () => {
history.back()
}
const beforeRemove = (row) => {
const handleDelete = (row) => {
ElMessageBox.confirm(`确认删除名称为${row.originalFileName}的表格吗?`, '系统提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
handleRemove(row)
deleteFile(row.fileId).then(res => {
if (res.code === 1000) {
ElMessage.success("删除成功");
formData.value.fileList.splice(formData.value.fileList.findIndex((item) => item.id === row.fileId), 1);
}
});
}).catch(() => {
ElMessage.warning("用户取消删除! ");
})
}
const handleRemove = (row) => {
deleteFile(row.fileId).then(res => {
if (res.code === 1000) {
ElMessage.success("删除成功");
fileList.value.splice(fileList.value.findIndex((item) => item.id === row.id), 1);
}
});
};
onMounted(async () => {
loading.value = true
await init()
if (route.query.id) {
await getDetailInfo()
}
nextTick(() => {
showTable.value = true
})
loading.value = false
})
</script>
<style lang="scss" scoped>
:deep(.el-empty__description){
:deep(.el-empty__description) {
margin-top: 0;
}
.add-block {
//display: flex;
//justify-content: space-between;

View File

@@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
name: "check"
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,49 @@
<template>
<div class="detail-block">
<el-tabs
v-model="activeName"
type="card"
class="demo-tabs"
@tab-click="handleClick"
>
<el-tab-pane label="需求征集" name="first">
</el-tab-pane>
<el-tab-pane label="需求上报" name="second"></el-tab-pane>
<el-tab-pane label="项目立项" name="third" ></el-tab-pane>
<el-tab-pane label="项目实施" name="third" :disabled="true"></el-tab-pane>
</el-tabs>
</div>
</template>
<script setup lang="jsx">
const activeName = ref('first')
const handleClick = (tab, event) => {
console.log(tab, event)
if(tab.index.value === 0){
}
}
</script>
<style scoped lang="scss">
.detail-block{
padding-top: 15px;
:deep(.el-tabs__nav-scroll){
width: 100%;
display: flex;
.el-tabs__nav{
display: flex;
flex: 1;
.el-tabs__item{
flex: 1;
font-size: 16px;
}
.is-active{
color: black;
background-color: #DED0B2;
}
}
}
}
</style>

View File

@@ -1,15 +1,195 @@
<template>
<div>
项目实施
</div>
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
<fvTable ref="tableIns" :tableConfig="tableConfig">
<template #empty>
<el-empty description="暂无数据"/>
</template>
</fvTable>
</template>
<script>
export default {
name: "index"
<script setup lang="jsx">
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
import {reactive, shallowRef} from "vue";
const router = useRouter()
const searchConfig = reactive([
{
label: '名称',
prop: 'requirementName',
component: 'el-input',
props: {
placeholder: '请输入名称查询',
clearable: true,
filterable: true,
checkStrictly: true
}
},
{
label: '项目类型',
prop: 'collectType',
component: shallowRef(fvSelect),
props: {
placeholder: '请选择项目类型',
clearable: true,
filterable: true,
}
},
{
label: '项目影响',
prop: 'projectEffect',
component: shallowRef(fvSelect),
props: {
placeholder: '请选择项目影响',
clearable: true,
filterable: true,
},
colProps: {}
},
{
label: '研发主体',
prop: 'collectType',
component: shallowRef(fvSelect),
props: {
placeholder: '请选择研发主体',
clearable: true,
filterable: true,
}
},
{
label: '起止时间',
prop: 'time',
component: 'el-date-picker',
props: {
placeholder: '请选择起止时间',
clearable: true,
},
colProps: {}
},
{
label: '最小金额',
prop: 'requirementName',
component: 'el-input',
props: {
placeholder: '请输入金额查询',
clearable: true,
filterable: true,
checkStrictly: true
}
},
{
label: '最大金额',
prop: 'requirementName',
component: 'el-input',
props: {
placeholder: '请输入金额查询',
clearable: true,
filterable: true,
checkStrictly: true
}
},
])
const tableIns = ref()
const tableConfig = reactive({
columns: [
{
type: 'selection',
prop: 'selection'
},
{
prop: 'name',
label: '名称',
align: 'center'
},
{
prop: 'company',
label: '所属公司',
align: 'center'
},
{
prop: 'projectType',
label: '项目类型',
align: 'center'
},
{
prop: 'productMainBody',
label: '研发主体',
align: 'center'
},
{
prop: 'projectEffect',
label: '项目影响',
align: 'center'
},
{
prop: 'survey',
label: '经营概况',
align: 'center'
},
{
prop: 'time',
label: '起止时间',
align: 'center'
},
{
prop: 'status',
label: '状态',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => (<Tag dictType={'process_state'} value={row.state}/>)
},
{
prop: 'oper',
label: '操作',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => {
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}]
if (row.state === '3') {
btn.push({label: '验收', func: () => handleCheck(row), type: 'primary'})
} else if (row.state === '4') {
btn.push({label: '台账', func: () => handleStandingBook(row), type: 'primary'})
btn.push({label: '附件', func: () => handleAttachment(row), type: 'primary'})
btn.push({label: '分摊', func: () => handleShare(row), type: 'primary'})
}
return (
<div style={{width: '100%'}}>
{
btn.map(item => (
<el-button
type={item.type}
// v-perm={item.auth}
onClick={() => item.func()}
link
>
{item.label}
</el-button>
))
}
</div>
)
}
}
],
api: '',
params: {},
btns: [
{name: '生成分摊报表', key: '_export', color: '#DED0B2',auth: ''}
]
})
const search = (val) => {
tableConfig.params = {...val}
tableIns.value.refresh()
}
const handleDetail = (row) => {
router.push({
name:'Implementation/detail',
query: {
id: row.requirementId
}
})
}
</script>
<style scoped>
</style>

View File

@@ -1,23 +1,136 @@
<template>
<div class="apply-block">
<el-form :model="formData" ref="applyForm" label-width="auto" :rules="rules">
<baseTitle title="项目立项-申请"></baseTitle>
<baseTitle title="项目立项申请"></baseTitle>
<el-row>
<el-col :span="12">
<el-form-item label="前置流程">
<el-input v-model="formData.requirementName" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="项目立项附件" prop="attachment">
<file-upload @getFile="getAttachment" :showFileList="true"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="其他文件">
<el-card style="width: 100%">
<file-upload @getFile="getOtherFile" :showFileList="true"/>
<fvTable style="width: 100%;max-height: 250px" v-if="showTable" :tableConfig="tableConfig"
:data="otherFileList" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
</template>
</fvTable>
</el-card>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit(applyForm)">提交</el-button>
</div>
</div>
</template>
<script setup lang="jsx">
import FileUpload from "@/components/FileUpload.vue";
const formData = ref({})
const rules = reactive({
auditOpinion: [{required: true, message: '请输入审核意见', trigger: 'blur'}],
attachment: [{required: true, message: '请上传项目立项附件', trigger: 'blur'}],
})
const fileList = ref(null)
const applyForm = ref()
const showTable = ref(true)
const otherFileList = ref([])
const tableConfig = reactive({
columns: [
{
prop: 'index',
type: 'index',
label: '序号',
align: 'center',
width: '80',
},
{
prop: 'originalFileName',
label: '文件名',
align: 'center',
},
{
prop: 'tag',
label: '标签',
align: 'center'
},
{
prop: 'size',
label: '文件大小',
align: 'center',
currentRender: ({row, index}) => (parseInt(row.size / 1024) + 'KB')
},
{
prop: 'oper',
label: '操作',
align: 'center',
currentRender: ({row, index}) => {
return (
<div>
<a style="cursor: pointer;font-size: 14px;color: #2a99ff;" href={row.url}>下载</a>
<el-button type="primary" size="large" link onClick={() => beforeRemove(row)}>删除</el-button>
</div>
)
}
}
]
})
const compositeParam = (item) => {
return {
fileId: item.id,
size: item.size,
originalFileName: item.originalFilename,
fileType: item.fileType,
url: item.url,
processNodeTag: null,
tag: formData.value.collectType
}
}
const getAttachment = (val) => {
console.log('上传文件', val)
showTable.value = false
nextTick(() => {
showTable.value = true
})
let fileObj = {}
let newFileArray = []
if (route.query.isAdd === undefined) {
val.forEach(item => {
fileObj = compositeParam(item)
newFileArray.push(fileObj)
formData.value.fileList.push(fileObj)
})
fileList.value = formData.value.fileList
} else {
val.forEach(item => {
fileObj = compositeParam(item)
newFileArray.push(fileObj)
})
formData.value.fileList = newFileArray
fileList.value = newFileArray
}
}
const getOtherFile = () => {
}
const handleSubmit = (instance) => {
if (!instance) return
instance.validate(async (valid) => {
if (!valid) return
})
}
</script>
<style scoped>

View File

@@ -1,12 +1,48 @@
<template>
<div>
项目立项详情
<div class="detail-block">
<el-tabs
v-model="activeName"
type="card"
class="demo-tabs"
@tab-click="handleClick"
>
<el-tab-pane label="需求征集" name="first">
</el-tab-pane>
<el-tab-pane label="需求上报" name="second"></el-tab-pane>
<el-tab-pane label="项目立项" name="third" :disabled="true"></el-tab-pane>
</el-tabs>
</div>
</template>
<script setup lang="jsx">
const activeName = ref('first')
const handleClick = (tab, event) => {
console.log(tab, event)
if(tab.index.value === 0){
}
}
</script>
<style scoped>
<style scoped lang="scss">
.detail-block{
padding-top: 15px;
:deep(.el-tabs__nav-scroll){
width: 100%;
display: flex;
.el-tabs__nav{
display: flex;
flex: 1;
.el-tabs__item{
flex: 1;
font-size: 16px;
}
.is-active{
color: black;
background-color: #DED0B2;
}
}
}
}
</style>

View File

@@ -1,12 +0,0 @@
<template>
<div>
项目立项编辑
</div>
</template>
<script setup lang="jsx">
</script>
<style scoped>
</style>

View File

@@ -129,7 +129,7 @@ const tableConfig = reactive({
},
{
prop: 'status',
label: '发布状态',
label: '状态',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => (<Tag dictType={'process_state'} value={row.state}/>)
@@ -165,7 +165,7 @@ const tableConfig = reactive({
}
}
],
api: '/workflow/mosr/requirement',
api: '',
params: {},
})