fix : 修复功能
This commit is contained in:
@@ -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>
|
||||
@@ -80,8 +76,11 @@ import {useProcessStore} from '@/stores/processStore.js';
|
||||
import {getWorkflowInfo, addRequirement, getInfo} 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()
|
||||
@@ -121,36 +120,53 @@ 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
|
||||
@@ -167,30 +183,48 @@ 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)
|
||||
}
|
||||
})
|
||||
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 () => {
|
||||
getInfo(route.query.id).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg)
|
||||
formData.value = res.data.formData
|
||||
if(route.query.isAdd==undefined){
|
||||
showTable.value=true
|
||||
}
|
||||
// if (route.query.isAdd == undefined) {
|
||||
// showTable.value = true
|
||||
// }
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
@@ -200,11 +234,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()
|
||||
@@ -223,11 +272,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;
|
||||
}
|
||||
|
||||
@@ -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">
|
||||
@@ -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