Merge pull request 'dd' (#150) from dd into master
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/150
This commit is contained in:
@@ -54,9 +54,22 @@ export const resubmit = (data) => {
|
||||
data: data
|
||||
});
|
||||
};
|
||||
export const resubmitRequirement = (data) => {
|
||||
return request({
|
||||
url: '/workflow/mosr/requirement/resubmit',
|
||||
method: "post",
|
||||
data: data
|
||||
});
|
||||
};
|
||||
export const deleteFile = (fileId) => {
|
||||
return request({
|
||||
url: `/workflow/process/file/delete/${fileId}`,
|
||||
method: "delete"
|
||||
});
|
||||
};
|
||||
export const getCompanyOption = () => {
|
||||
return request({
|
||||
url: '/admin/mosr/sub/company/companyOption',
|
||||
method: "get"
|
||||
});
|
||||
};
|
||||
|
||||
@@ -13,25 +13,25 @@
|
||||
>
|
||||
<el-button color="#DED0B2" :loading="loading">上传文件</el-button>
|
||||
</el-upload>
|
||||
<div v-if="showTable||fileList.length!==0">
|
||||
<el-table :data="fileList" style="width: 100%">
|
||||
<el-table-column label="序号" type="index" align="center" width="80"/>
|
||||
<el-table-column prop="originalFilename" label="文件名" align="center"/>
|
||||
<el-table-column prop="size" label="文件大小" align="center">
|
||||
<template #default="scope">
|
||||
{{ parseInt(scope.row.size / 1024) }}KB
|
||||
<!-- {{ parseInt(scope.row.size / 1024) > 1024 ? 'MB' : 'KB' }}-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" size="small" @click="beforeRemove(scope.row)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- <div v-if="showTable||fileList.length!==0">-->
|
||||
<!-- <el-table :data="fileList" style="width: 100%">-->
|
||||
<!-- <el-table-column label="序号" type="index" align="center" width="80"/>-->
|
||||
<!-- <el-table-column prop="originalFilename" label="文件名" align="center"/>-->
|
||||
<!-- <el-table-column prop="size" label="文件大小" align="center">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- {{ parseInt(scope.row.size / 1024) }}KB-->
|
||||
<!-- <!– {{ parseInt(scope.row.size / 1024) > 1024 ? 'MB' : 'KB' }}–>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column align="center" label="操作">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <el-button link type="primary" size="small" @click="beforeRemove(scope.row)">-->
|
||||
<!-- 删除-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- </el-table>-->
|
||||
<!-- </div>-->
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
@@ -148,11 +148,11 @@ const tableConfig = reactive({
|
||||
})
|
||||
const handleView = (row) => {
|
||||
console.log('row', row)
|
||||
if (row.requirementId) {
|
||||
if(row.targetState=='00'&&row.taskId){
|
||||
router.push({
|
||||
path: '/projectdemand/demanddetail',
|
||||
query: {
|
||||
id: row.requirementId
|
||||
id: row.taskId
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -7,14 +7,8 @@
|
||||
<el-input v-model="formData.requirementName" placeholder="请输入名称" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属公司" prop="companyIds">
|
||||
<el-select v-model="formData.companyIds" placeholder="所属公司" clearable filterable multiple>
|
||||
<el-option
|
||||
v-for="item in companyOption"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-tree-select v-model="formData.companyIds" :data="companyOption" style="width: 100%;"
|
||||
filterable clearable :check-strictly="true" multiple/>
|
||||
</el-form-item>
|
||||
<el-form-item label="征集类型" prop="collectType">
|
||||
<el-select v-model="formData.collectType" placeholder="征集类型" clearable filterable>
|
||||
@@ -39,11 +33,10 @@
|
||||
</div>
|
||||
</el-form>
|
||||
<baseTitle title="征集说明"></baseTitle>
|
||||
|
||||
<Tinymce image-url="/notice/file" file-url="/notice/file" v-model:value="formData.collectExplain" height="300"/>
|
||||
<baseTitle title="申请文件"></baseTitle>
|
||||
<file-upload @getFile="getFile"/>
|
||||
<el-table :data="formData.fileList" style="width: 100%" v-if="showTable">
|
||||
<el-table :data="formData.fileList" style="width: 100%">
|
||||
<el-table-column label="序号" type="index" align="center" width="80"/>
|
||||
<el-table-column prop="fileName" label="文件名" align="center"/>
|
||||
<el-table-column prop="tag" label="标签" align="center"/>
|
||||
@@ -57,6 +50,9 @@
|
||||
<a :href="scope.row.url">
|
||||
下载
|
||||
</a>
|
||||
<el-button link type="primary" size="small" @click="beforeRemove(scope.row)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -81,8 +77,11 @@ import {useProcessStore} from '@/stores/processStore.js';
|
||||
import {getWorkflowInfo, addRequirement, getFormInfo,resubmit} from "@/api/project-demand/index.js";
|
||||
import FileUpload from "@/components/FileUpload.vue";
|
||||
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
||||
import {ElMessage} from "element-plus";
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {useRoute, useRouter} from 'vue-router'
|
||||
import {getSubCompOpt} from '@/api/user/user.js'
|
||||
import {deleteFile} from "@/api/project-demand";
|
||||
import {resubmitRequirement} from "../../../api/project-demand";
|
||||
|
||||
const authStore = useAuthStore()
|
||||
const router = useRouter()
|
||||
@@ -122,38 +121,55 @@ const form = ref(null)
|
||||
const fileList = ref(null)
|
||||
const menuTree = ref(null)
|
||||
const loading = ref(false)
|
||||
const localData = reactive({
|
||||
affiliatedCompany: []
|
||||
})
|
||||
const processStore = useProcessStore()
|
||||
const processInstanceData = ref()
|
||||
|
||||
const getFile = (val) => {
|
||||
console.log('val', val, route.query.isAdd)
|
||||
if(route.query.isAdd==undefined){
|
||||
showTable.value=true
|
||||
if (route.query.isAdd == undefined) {
|
||||
// showTable.value = true
|
||||
let fileObj = {}
|
||||
let newFileArray = []
|
||||
val.forEach(item => {
|
||||
|
||||
formData.value.fileList.push(item)
|
||||
fileObj = {
|
||||
fileId: item.id,
|
||||
size: item.size,
|
||||
fileName: item.fileName,
|
||||
fileType: item.fileType,
|
||||
url: item.url,
|
||||
processNodeTag: null,
|
||||
tag: formData.value.collectType,
|
||||
userId: authStore.userinfo.userId
|
||||
}
|
||||
newFileArray.push(fileObj)
|
||||
formData.value.fileList.push(fileObj)
|
||||
})
|
||||
fileList.value=formData.value.fileList
|
||||
console.log('fileList.value',fileList.value)
|
||||
fileList.value = formData.value.fileList
|
||||
} else {
|
||||
let fileObj = {}
|
||||
let newFileArray = []
|
||||
val.forEach(item => {
|
||||
fileObj = {
|
||||
fileId: item.id,
|
||||
size: item.size,
|
||||
fileName: item.fileName,
|
||||
fileType: item.fileType,
|
||||
url: item.url,
|
||||
processNodeTag: null,
|
||||
tag: formData.value.collectType,
|
||||
userId: authStore.userinfo.userId
|
||||
}
|
||||
newFileArray.push(fileObj)
|
||||
})
|
||||
formData.value.fileList = newFileArray
|
||||
fileList.value = newFileArray
|
||||
}
|
||||
let fileObj = {}
|
||||
let newFileArray = []
|
||||
val.forEach(item => {
|
||||
fileObj = {
|
||||
fileId: item.id,
|
||||
tag: formData.value.collectType,
|
||||
userId: authStore.userinfo.userId
|
||||
}
|
||||
newFileArray.push(fileObj)
|
||||
})
|
||||
fileList.value=newFileArray
|
||||
}
|
||||
|
||||
|
||||
const init = async () => {
|
||||
const res = await getSubCompOpt()
|
||||
companyOption.value = res.data
|
||||
getWorkflowInfo().then(res => {
|
||||
let data = res.data
|
||||
processInstanceData.value = data
|
||||
@@ -170,47 +186,50 @@ const init = async () => {
|
||||
}
|
||||
|
||||
const handleSubmit = () => {
|
||||
addRequirement({
|
||||
...formData.value,
|
||||
requirementId: 0,
|
||||
files: fileList.value,
|
||||
deploymentId: processInstanceData.value.deploymentId
|
||||
}).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg)
|
||||
router.push({
|
||||
path: '/projectdemand/demandcollection'
|
||||
})
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleResubmit = () => {
|
||||
resubmit({
|
||||
...formData.value,
|
||||
files: fileList.value,
|
||||
deploymentId: processInstanceData.value.deploymentId
|
||||
}).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg)
|
||||
router.push({
|
||||
path: '/projectdemand/demandcollection'
|
||||
})
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
if (route.query.isAdd == undefined) {
|
||||
resubmitRequirement({
|
||||
...formData.value,
|
||||
requirementId: 0,
|
||||
files: fileList.value,
|
||||
deploymentId: processInstanceData.value.deploymentId
|
||||
}).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg)
|
||||
router.push({
|
||||
path: '/projectdemand/demandcollection'
|
||||
})
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
}else {
|
||||
addRequirement({
|
||||
...formData.value,
|
||||
requirementId: 0,
|
||||
files: fileList.value,
|
||||
deploymentId: processInstanceData.value.deploymentId
|
||||
}).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg)
|
||||
router.push({
|
||||
path: '/projectdemand/demandcollection'
|
||||
})
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
const getDetailInfo = async () => {
|
||||
getFormInfo(route.query.id).then(res => {
|
||||
if (res.code === 1000) {
|
||||
console.log(res)
|
||||
ElMessage.success(res.msg)
|
||||
formData.value = res.data
|
||||
if(route.query.isAdd==undefined){
|
||||
showTable.value=true
|
||||
}
|
||||
// formData.value = res.data
|
||||
formData.value = res.data.formData
|
||||
// if (route.query.isAdd == undefined) {
|
||||
// showTable.value = true
|
||||
// }
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
@@ -220,11 +239,26 @@ const getDetailInfo = async () => {
|
||||
const handleBack = () => {
|
||||
history.back()
|
||||
}
|
||||
const beforeRemove = (row) => {
|
||||
ElMessageBox.confirm(`确认删除名称为${row.filename}的表格吗?`, '系统提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
handleRemove(row)
|
||||
}).catch(() => {
|
||||
ElMessage.warning("用户取消删除! ");
|
||||
})
|
||||
}
|
||||
|
||||
watch(localData, (val) => {
|
||||
menuTree.value.filter(val.filterText)
|
||||
})
|
||||
|
||||
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()
|
||||
@@ -243,11 +277,13 @@ onMounted(async () => {
|
||||
//justify-content: space-between;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
|
||||
a {
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
color: #2a99ff;
|
||||
}
|
||||
|
||||
.approval-record {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -91,10 +91,12 @@ import OperationRender from '@/views/workflow/common/OperationRender.vue'
|
||||
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue'
|
||||
import {useProcessStore} from '@/stores/processStore.js';
|
||||
import {getInfo, agreeTask, rejectTask} from "@/api/project-demand/index.js";
|
||||
import {getSubCompOpt} from '@/api/user/user.js'
|
||||
|
||||
const route = useRoute()
|
||||
const form = ref();
|
||||
const processStore = useProcessStore()
|
||||
const companyOption = ref([])
|
||||
const processInstanceData = ref({})
|
||||
const processDiagramViewer = ref(false)
|
||||
const processTree = ref()
|
||||
@@ -119,11 +121,33 @@ const handleReject = () => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
const getCompanyOption=async ()=>{
|
||||
const res = await getSubCompOpt()
|
||||
companyOption.value= res.data
|
||||
console.log('companyOption.value',companyOption.value)
|
||||
}
|
||||
const getDataSourceOptionItem = (val) => {
|
||||
console.log('val',val,companyOption.value)
|
||||
if(val!==undefined){
|
||||
|
||||
}
|
||||
// let arr=[]
|
||||
// console.log('arr',arr)
|
||||
// for (let item of companyOption.value) {
|
||||
// if (item.value === dataSourceId) {
|
||||
// return item.label;
|
||||
// }
|
||||
// }
|
||||
// return "";
|
||||
}
|
||||
const init = async () => {
|
||||
await getCompanyOption()
|
||||
getInfo(route.query.id).then(res => {
|
||||
let data = res.data
|
||||
formData.value = data.formData;
|
||||
if(data.formData.companyIds.length!==0){
|
||||
|
||||
}
|
||||
processInstanceData.value = data
|
||||
processStore.setDesign(data)
|
||||
processStore.runningList.value = data.runningList;
|
||||
|
||||
Reference in New Issue
Block a user