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