Merge pull request 'master' (#155) from master into prod
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/155
This commit is contained in:
@@ -54,13 +54,6 @@ export const resubmit = (data) => {
|
|||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
export const resubmitRequirement = (data) => {
|
|
||||||
return request({
|
|
||||||
url: '/workflow/mosr/requirement/resubmit',
|
|
||||||
method: "post",
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
export const deleteFile = (fileId) => {
|
export const deleteFile = (fileId) => {
|
||||||
return request({
|
return request({
|
||||||
url: `/workflow/process/file/delete/${fileId}`,
|
url: `/workflow/process/file/delete/${fileId}`,
|
||||||
|
|||||||
@@ -13,33 +13,11 @@
|
|||||||
>
|
>
|
||||||
<el-button color="#DED0B2" :loading="loading">上传文件</el-button>
|
<el-button color="#DED0B2" :loading="loading">上传文件</el-button>
|
||||||
</el-upload>
|
</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>-->
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {defineProps, computed, ref} from "vue";
|
import {ElMessage} from "element-plus";
|
||||||
import {ElMessage, ElMessageBox} from "element-plus";
|
|
||||||
import {getToken} from '@/utils/auth'
|
import {getToken} from '@/utils/auth'
|
||||||
import {deleteFile} from "@/api/project-demand";
|
|
||||||
|
|
||||||
const baseURL = import.meta.env.VITE_BASE_URL
|
const baseURL = import.meta.env.VITE_BASE_URL
|
||||||
const uploadFileUrl = ref(baseURL + "/workflow/process/file/upload")
|
const uploadFileUrl = ref(baseURL + "/workflow/process/file/upload")
|
||||||
const headers = reactive({
|
const headers = reactive({
|
||||||
@@ -99,26 +77,6 @@ const handleUploadSuccess = (res, file) => {
|
|||||||
fileList.value.push(data)
|
fileList.value.push(data)
|
||||||
emit("getFile", fileList.value)
|
emit("getFile", fileList.value)
|
||||||
}
|
}
|
||||||
const beforeRemove = (row) => {
|
|
||||||
ElMessageBox.confirm(`确认删除名称为${row.originalFilename}的表格吗?`, '系统提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
handleRemove(row)
|
|
||||||
}).catch(() => {
|
|
||||||
ElMessage.warning("用户取消删除! ");
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleRemove = (row) => {
|
|
||||||
deleteFile(row.id).then(res => {
|
|
||||||
if (res.code === 1000) {
|
|
||||||
ElMessage.success("删除成功");
|
|
||||||
fileList.value.splice(fileList.value.findIndex((item) => item.id === row.id), 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -74,14 +74,12 @@
|
|||||||
<script setup lang="jsx">
|
<script setup lang="jsx">
|
||||||
import {useAuthStore} from '@/stores/userstore.js'
|
import {useAuthStore} from '@/stores/userstore.js'
|
||||||
import {useProcessStore} from '@/stores/processStore.js';
|
import {useProcessStore} from '@/stores/processStore.js';
|
||||||
import {getWorkflowInfo, addRequirement, getFormInfo,resubmit} from "@/api/project-demand/index.js";
|
import {getWorkflowInfo, addRequirement, getFormInfo, resubmit, deleteFile} from "@/api/project-demand/index.js";
|
||||||
import FileUpload from "@/components/FileUpload.vue";
|
import FileUpload from "@/components/FileUpload.vue";
|
||||||
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
||||||
import {ElMessage, ElMessageBox} from "element-plus";
|
import {ElMessage, ElMessageBox} from "element-plus";
|
||||||
import {useRoute, useRouter} from 'vue-router'
|
import {useRoute, useRouter} from 'vue-router'
|
||||||
import {getSubCompOpt} from '@/api/user/user.js'
|
import {getSubCompOpt} from '@/api/user/user.js'
|
||||||
import {deleteFile} from "@/api/project-demand";
|
|
||||||
import {resubmitRequirement} from "../../../api/project-demand";
|
|
||||||
|
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@@ -124,41 +122,31 @@ const loading = ref(false)
|
|||||||
const processStore = useProcessStore()
|
const processStore = useProcessStore()
|
||||||
const processInstanceData = ref()
|
const processInstanceData = ref()
|
||||||
|
|
||||||
|
const compositeParam=(item)=>{
|
||||||
|
return {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
const getFile = (val) => {
|
const getFile = (val) => {
|
||||||
console.log('val', val, route.query.isAdd)
|
let fileObj = {}
|
||||||
if (route.query.isAdd == undefined) {
|
let newFileArray = []
|
||||||
// showTable.value = true
|
if (route.query.isAdd === undefined) {
|
||||||
let fileObj = {}
|
|
||||||
let newFileArray = []
|
|
||||||
val.forEach(item => {
|
val.forEach(item => {
|
||||||
fileObj = {
|
fileObj =compositeParam(item)
|
||||||
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)
|
newFileArray.push(fileObj)
|
||||||
formData.value.fileList.push(fileObj)
|
formData.value.fileList.push(fileObj)
|
||||||
})
|
})
|
||||||
fileList.value = formData.value.fileList
|
fileList.value = formData.value.fileList
|
||||||
} else {
|
} else {
|
||||||
let fileObj = {}
|
|
||||||
let newFileArray = []
|
|
||||||
val.forEach(item => {
|
val.forEach(item => {
|
||||||
fileObj = {
|
fileObj =compositeParam(item)
|
||||||
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)
|
newFileArray.push(fileObj)
|
||||||
})
|
})
|
||||||
formData.value.fileList = newFileArray
|
formData.value.fileList = newFileArray
|
||||||
@@ -166,7 +154,6 @@ const getFile = (val) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const init = async () => {
|
const init = async () => {
|
||||||
const res = await getSubCompOpt()
|
const res = await getSubCompOpt()
|
||||||
companyOption.value = res.data
|
companyOption.value = res.data
|
||||||
@@ -185,39 +172,26 @@ const init = async () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSubmit = () => {
|
const handleSubmit = async () => {
|
||||||
if (route.query.isAdd == undefined) {
|
let params = {
|
||||||
resubmitRequirement({
|
...formData.value,
|
||||||
...formData.value,
|
requirementId: 0,
|
||||||
requirementId: 0,
|
files: fileList.value,
|
||||||
files: fileList.value,
|
deploymentId: processInstanceData.value.deploymentId
|
||||||
deploymentId: processInstanceData.value.deploymentId
|
}
|
||||||
}).then(res => {
|
let res
|
||||||
if (res.code === 1000) {
|
if (route.query.isAdd === undefined) {
|
||||||
ElMessage.success(res.msg)
|
res = await resubmit(params)
|
||||||
router.push({
|
} else {
|
||||||
path: '/projectdemand/demandcollection'
|
res = await addRequirement(params)
|
||||||
})
|
}
|
||||||
} else {
|
if (res.code === 1000) {
|
||||||
ElMessage.error(res.msg)
|
ElMessage.success(res.msg)
|
||||||
}
|
await router.push({
|
||||||
})
|
path: '/projectdemand/demandcollection'
|
||||||
}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)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.msg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const getDetailInfo = async () => {
|
const getDetailInfo = async () => {
|
||||||
@@ -225,11 +199,7 @@ const getDetailInfo = async () => {
|
|||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
ElMessage.success(res.msg)
|
ElMessage.success(res.msg)
|
||||||
// formData.value = res.data
|
formData.value = res.data
|
||||||
formData.value = res.data.formData
|
|
||||||
// if (route.query.isAdd == undefined) {
|
|
||||||
// showTable.value = true
|
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.msg)
|
ElMessage.error(res.msg)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ const companyOption = ref([])
|
|||||||
const processInstanceData = ref({})
|
const processInstanceData = ref({})
|
||||||
const processDiagramViewer = ref(false)
|
const processDiagramViewer = ref(false)
|
||||||
const processTree = ref()
|
const processTree = ref()
|
||||||
|
const companyNameArray = ref([])
|
||||||
const formData = ref({})
|
const formData = ref({})
|
||||||
const auditOpinion = ref('')
|
const auditOpinion = ref('')
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
@@ -121,33 +122,39 @@ const handleReject = () => {
|
|||||||
console.log(res)
|
console.log(res)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const getCompanyOption=async ()=>{
|
const getCompanyOption = async () => {
|
||||||
const res = await getSubCompOpt()
|
const res = await getSubCompOpt()
|
||||||
companyOption.value= res.data
|
companyOption.value = res.data
|
||||||
console.log('companyOption.value',companyOption.value)
|
|
||||||
}
|
}
|
||||||
const getDataSourceOptionItem = (val) => {
|
|
||||||
console.log('val',val,companyOption.value)
|
|
||||||
if(val!==undefined){
|
|
||||||
|
|
||||||
|
const matterTree = (data, id) => {
|
||||||
|
if(id){
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
if (data[i].value == id) {
|
||||||
|
companyNameArray.value.push(data[i].label);
|
||||||
|
}
|
||||||
|
if (data[i].children && data[i].children.length > 0) {
|
||||||
|
matterTree(data[i].children)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return companyNameArray.value;
|
||||||
}
|
}
|
||||||
// let arr=[]
|
}
|
||||||
// console.log('arr',arr)
|
|
||||||
// for (let item of companyOption.value) {
|
const getDataSourceOptionItem = (val) => {
|
||||||
// if (item.value === dataSourceId) {
|
if (val !== undefined) {
|
||||||
// return item.label;
|
val.forEach(item => {
|
||||||
// }
|
matterTree(companyOption.value,item)
|
||||||
// }
|
})
|
||||||
// return "";
|
}
|
||||||
|
return companyNameArray.value.join(',');
|
||||||
}
|
}
|
||||||
const init = async () => {
|
const init = async () => {
|
||||||
await getCompanyOption()
|
await getCompanyOption()
|
||||||
getInfo(route.query.id).then(res => {
|
getInfo(route.query.id).then(res => {
|
||||||
let data = res.data
|
let data = res.data
|
||||||
formData.value = data.formData;
|
formData.value = data.formData;
|
||||||
if(data.formData.companyIds.length!==0){
|
data.formData.companyIds= getDataSourceOptionItem(data.formData.companyIds)
|
||||||
|
|
||||||
}
|
|
||||||
processInstanceData.value = data
|
processInstanceData.value = data
|
||||||
processStore.setDesign(data)
|
processStore.setDesign(data)
|
||||||
processStore.runningList.value = data.runningList;
|
processStore.runningList.value = data.runningList;
|
||||||
@@ -169,16 +176,12 @@ a {
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #2a99ff;
|
color: #2a99ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.detail-block {
|
.detail-block {
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
//overflow-y: auto;
|
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
|
|
||||||
.left-info {
|
.left-info {
|
||||||
flex: 0.6;
|
|
||||||
|
|
||||||
.info {
|
.info {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@@ -198,36 +201,10 @@ a {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.approval-record {
|
.approval-record {
|
||||||
flex: 0.4;
|
|
||||||
padding-bottom: 30px;
|
padding-bottom: 30px;
|
||||||
|
|
||||||
.process {
|
.process {
|
||||||
//padding-top: 20px;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
//max-height: calc(100vh - 96px);
|
|
||||||
//height: calc(100vh - 250px);
|
|
||||||
//height: auto;
|
|
||||||
//overflow: auto;
|
|
||||||
|
|
||||||
//&::-webkit-scrollbar {
|
|
||||||
// width: 6px;
|
|
||||||
// height: 6px;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//// 滚动条轨道
|
|
||||||
//&::-webkit-scrollbar-track {
|
|
||||||
// background: rgb(239, 239, 239);
|
|
||||||
// border-radius: 2px;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//// 小滑块
|
|
||||||
//&::-webkit-scrollbar-thumb {
|
|
||||||
// background: rgba(80, 81, 82, 0.29);
|
|
||||||
// border-radius: 10px;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user