fix : 修复功能

This commit is contained in:
2024-05-12 23:28:47 +08:00
parent 2d73580195
commit 4070e15e63
4 changed files with 28 additions and 72 deletions

View File

@@ -74,14 +74,12 @@
<script setup lang="jsx">
import {useAuthStore} from '@/stores/userstore.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 ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
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()
@@ -187,7 +185,7 @@ const init = async () => {
const handleSubmit = () => {
if (route.query.isAdd == undefined) {
resubmitRequirement({
resubmit({
...formData.value,
requirementId: 0,
files: fileList.value,

View File

@@ -11,7 +11,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="所属公司">
<span>{{ formData.companyIds }}</span>
<span>{{ getDataSourceOptionItem(formData.companyIds) }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -100,6 +100,7 @@ const companyOption = ref([])
const processInstanceData = ref({})
const processDiagramViewer = ref(false)
const processTree = ref()
const companyNameArray = ref([])
const formData = ref({})
const auditOpinion = ref('')
const handleSubmit = () => {
@@ -121,33 +122,38 @@ const handleReject = () => {
console.log(res)
})
}
const getCompanyOption=async ()=>{
const getCompanyOption = async () => {
const res = await getSubCompOpt()
companyOption.value= res.data
console.log('companyOption.value',companyOption.value)
companyOption.value = res.data
}
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) {
// if (item.value === dataSourceId) {
// return item.label;
// }
// }
// return "";
}
const getDataSourceOptionItem = (val) => {
if (val !== undefined) {
val.forEach(item => {
matterTree(companyOption.value,item)
})
}
return companyNameArray.value.join('');
}
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;
@@ -169,6 +175,7 @@ a {
font-size: 14px;
color: #2a99ff;
}
.detail-block {
display: flex;
justify-content: space-between;