|
|
|
|
@@ -1,13 +1,13 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div v-loading="loading" class="add-block">
|
|
|
|
|
<baseTitle title="需求征集信息录入"></baseTitle>
|
|
|
|
|
<el-form :model="fromData" inline class="query-form" ref="demandForm">
|
|
|
|
|
<el-form :model="formData" inline class="query-form" ref="demandForm">
|
|
|
|
|
<div class="left-info">
|
|
|
|
|
<el-form-item label="名称" prop="name">
|
|
|
|
|
<el-input v-model="fromData.name" placeholder="请输入名称" clearable></el-input>
|
|
|
|
|
<el-form-item label="名称" prop="requirementName">
|
|
|
|
|
<el-input v-model="formData.requirementName" placeholder="请输入名称" clearable></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="所属公司" prop="company">
|
|
|
|
|
<el-select v-model="fromData.company" placeholder="所属公司" clearable filterable>
|
|
|
|
|
<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"
|
|
|
|
|
@@ -16,8 +16,8 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="征集类型" prop="type">
|
|
|
|
|
<el-select v-model="fromData.type" placeholder="征集类型" clearable filterable>
|
|
|
|
|
<el-form-item label="征集类型" prop="collectType">
|
|
|
|
|
<el-select v-model="formData.collectType" placeholder="征集类型" clearable filterable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in typeOption"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
@@ -29,21 +29,17 @@
|
|
|
|
|
<el-form-item label="截止时间" prop="time">
|
|
|
|
|
<el-config-provider>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="dateValue"
|
|
|
|
|
v-model="formData.deadline"
|
|
|
|
|
type="datetime"
|
|
|
|
|
placeholder="截止时间"
|
|
|
|
|
value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
/>
|
|
|
|
|
</el-config-provider>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" @click="getList">搜索</el-button>
|
|
|
|
|
<el-button type="primary" @click="handleReset">重置</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</div>
|
|
|
|
|
</el-form>
|
|
|
|
|
<!-- <fvForm :schema="schame" @getInstance="getInstance" :rules="rules"></fvForm>-->
|
|
|
|
|
<baseTitle title="征集说明"></baseTitle>
|
|
|
|
|
<Tinymce image-url="/notice/file" file-url="/notice/file" v-model:value="instructions" height="300"/>
|
|
|
|
|
<Tinymce image-url="/notice/file" file-url="/notice/file" v-model:value="formData.collectExplain" height="300"/>
|
|
|
|
|
<baseTitle title="申请文件"></baseTitle>
|
|
|
|
|
<file-upload @getFile="getFile"/>
|
|
|
|
|
<div class="approval-record">
|
|
|
|
|
@@ -61,33 +57,42 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="jsx">
|
|
|
|
|
import {useTagsView} from '@/stores/tagsview.js'
|
|
|
|
|
import {useAuthStore} from '@/stores/userstore.js'
|
|
|
|
|
import {getWorkflowInfo, addRequirement} from "@/api/project-demand/index.js";
|
|
|
|
|
import FileUpload from "../../../components/FileUpload.vue";
|
|
|
|
|
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue'
|
|
|
|
|
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 {useRouter} from 'vue-router'
|
|
|
|
|
import {useRoute,useRouter} from 'vue-router'
|
|
|
|
|
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
const dateValue = ref()
|
|
|
|
|
const fromData = reactive({
|
|
|
|
|
name: '',
|
|
|
|
|
company: '',
|
|
|
|
|
type: '',
|
|
|
|
|
})
|
|
|
|
|
const processTree = ref()
|
|
|
|
|
const processDiagramViewer = ref(false)
|
|
|
|
|
const tagsViewStore = useTagsView()
|
|
|
|
|
const authStore = useAuthStore()
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
const demandForm = ref()
|
|
|
|
|
const typeOption = ref([])
|
|
|
|
|
const dateValue = ref()
|
|
|
|
|
let formData = reactive({
|
|
|
|
|
requirementName: '',
|
|
|
|
|
companyIds: '',
|
|
|
|
|
collectType: '',
|
|
|
|
|
collectExplain: ''
|
|
|
|
|
})
|
|
|
|
|
const processDiagramViewer = ref(false)
|
|
|
|
|
|
|
|
|
|
const typeOption = ref([
|
|
|
|
|
{
|
|
|
|
|
label: "需求征集",
|
|
|
|
|
value: '需求征集'
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
const companyOption = ref([
|
|
|
|
|
{
|
|
|
|
|
label: "测试公司",
|
|
|
|
|
value: 1
|
|
|
|
|
label: "测试公司1",
|
|
|
|
|
value: 22
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "测试公司2",
|
|
|
|
|
value: 23
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "测试公司3",
|
|
|
|
|
value: 24
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
const form = ref(null)
|
|
|
|
|
@@ -97,93 +102,14 @@ const loading = ref(false)
|
|
|
|
|
const localData = reactive({
|
|
|
|
|
affiliatedCompany: []
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const processStore = useProcessStore()
|
|
|
|
|
const processInstanceData = ref()
|
|
|
|
|
const instructions = ref()
|
|
|
|
|
const schame = computed(() => {
|
|
|
|
|
let arr = [
|
|
|
|
|
{
|
|
|
|
|
label: '名称',
|
|
|
|
|
prop: 'roleName',
|
|
|
|
|
component: 'el-input',
|
|
|
|
|
props: {
|
|
|
|
|
placeholder: '请输入名称',
|
|
|
|
|
clearable: true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '所属公司',
|
|
|
|
|
prop: 'subCompanyId',
|
|
|
|
|
component: 'el-tree-select',
|
|
|
|
|
props: {
|
|
|
|
|
placeholder: '请选择所属公司',
|
|
|
|
|
clearable: true,
|
|
|
|
|
filterable: true,
|
|
|
|
|
checkStrictly: true,
|
|
|
|
|
data: localData.affiliatedCompany,
|
|
|
|
|
disabled: route.query.userType == 0 ? true : false
|
|
|
|
|
},
|
|
|
|
|
on: {
|
|
|
|
|
change: async (val) => {
|
|
|
|
|
const {data} = await getDeptOpt({subCompanyId: val})
|
|
|
|
|
localData.departmentIdOpt = data
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '征集类型',
|
|
|
|
|
prop: 'subCompanyType',
|
|
|
|
|
component: 'el-tree-select',
|
|
|
|
|
props: {
|
|
|
|
|
placeholder: '请选择征集类型',
|
|
|
|
|
clearable: true,
|
|
|
|
|
filterable: true,
|
|
|
|
|
checkStrictly: true,
|
|
|
|
|
data: localData.affiliatedCompany,
|
|
|
|
|
disabled: route.query.userType == 0 ? true : false
|
|
|
|
|
},
|
|
|
|
|
on: {
|
|
|
|
|
change: async (val) => {
|
|
|
|
|
const {data} = await getDeptOpt({subCompanyId: val})
|
|
|
|
|
localData.departmentIdOpt = data
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '截止时间',
|
|
|
|
|
prop: 'dateValue',
|
|
|
|
|
component: 'el-date-picker',
|
|
|
|
|
props: {
|
|
|
|
|
placeholder: '请选择截止时间',
|
|
|
|
|
clearable: true,
|
|
|
|
|
type: 'datetime'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
return !authStore.roles.includes('superAdmin') ? arr.slice(0, arr.length - 1) : arr
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const rules = reactive({
|
|
|
|
|
roleName: [{required: true, message: '请输入', trigger: 'change'}],
|
|
|
|
|
subCompanyId: [{required: true, message: '请输入', trigger: 'change'}]
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//重置功能
|
|
|
|
|
const handleReset = () => {
|
|
|
|
|
demandForm.value.resetFields()
|
|
|
|
|
init()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getInstance = (e) => {
|
|
|
|
|
form.value = e
|
|
|
|
|
}
|
|
|
|
|
const getFile = (val) => {
|
|
|
|
|
console.log('fileList', val)
|
|
|
|
|
fileList.value = val
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const init = async () => {
|
|
|
|
|
getWorkflowInfo().then(res => {
|
|
|
|
|
let data = res.data
|
|
|
|
|
@@ -200,32 +126,18 @@ const init = async () => {
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// const getTree = async () => {
|
|
|
|
|
// getInitiateInfo('pronode_46c5e446-b4d1-495e-a97d-40667fa6aa9f').then(res => {
|
|
|
|
|
// console.log('res11', res)
|
|
|
|
|
// // processDefinition.value = res.data;
|
|
|
|
|
// //构建表单及校验规则
|
|
|
|
|
// processStore.setDesign(res.data)
|
|
|
|
|
// nextTick(() => {
|
|
|
|
|
// processTree.value.init()
|
|
|
|
|
// })
|
|
|
|
|
// }).catch(err => {
|
|
|
|
|
// ElMessage.error(err);
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// getTree()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleSubmit = () => {
|
|
|
|
|
console.log(fromData, "fromData")
|
|
|
|
|
console.log(formData, "formData")
|
|
|
|
|
addRequirement({
|
|
|
|
|
"collectExplain": "需求说明",
|
|
|
|
|
"collectType": "征集类型",
|
|
|
|
|
"companyIds": [22, 23, 24],
|
|
|
|
|
"files": [],
|
|
|
|
|
"collectExplain": formData.collectExplain,
|
|
|
|
|
"collectType": formData.collectType,
|
|
|
|
|
"companyIds": formData.companyIds,
|
|
|
|
|
"files": fileList.value,
|
|
|
|
|
"deadline": formData.deadline,
|
|
|
|
|
"requirementId": 0,
|
|
|
|
|
"requirementName": "测试需求征集20240519001",
|
|
|
|
|
"deploymentId": "1817079f-0f74-11ef-8b96-f268fc747b04"
|
|
|
|
|
"requirementName": formData.requirementName,
|
|
|
|
|
"deploymentId": processInstanceData.value.deploymentId
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res.code === 1000) {
|
|
|
|
|
ElMessage.success(res.msg)
|
|
|
|
|
@@ -237,6 +149,17 @@ const handleSubmit = () => {
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const getDetailInfo = async () => {
|
|
|
|
|
getInfo(route.query.id).then(res => {
|
|
|
|
|
if (res.code === 1000) {
|
|
|
|
|
ElMessage.success(res.msg)
|
|
|
|
|
console.log('res.data',res.data.formData)
|
|
|
|
|
formData=res.data.formData
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error(res.msg)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleBack = () => {
|
|
|
|
|
@@ -247,15 +170,14 @@ watch(localData, (val) => {
|
|
|
|
|
menuTree.value.filter(val.filterText)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// onMounted(async () => {
|
|
|
|
|
// loading.value = true
|
|
|
|
|
init()
|
|
|
|
|
// if (route.query.id) {
|
|
|
|
|
// await getInfo()
|
|
|
|
|
// }
|
|
|
|
|
// loading.value = false
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
onMounted( async ()=>{
|
|
|
|
|
loading.value = true
|
|
|
|
|
await init()
|
|
|
|
|
// if(route.query.id) {
|
|
|
|
|
// await getDetailInfo()
|
|
|
|
|
// }
|
|
|
|
|
loading.value = false
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
@@ -265,5 +187,8 @@ init()
|
|
|
|
|
//justify-content: space-between;
|
|
|
|
|
overflow-x: hidden;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
.approval-record{
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|