fix : 修复页面细节
This commit is contained in:
@@ -8,11 +8,19 @@
|
||||
<el-input v-model="formData.projectName" placeholder="请输入项目名称" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="专项资金" prop="specialFund">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="是否专项资金" prop="isSpecialFund">
|
||||
<el-radio-group v-model="formData.isSpecialFund" >
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="专项资金" prop="specialFund" v-if="formData.isSpecialFund">
|
||||
<el-select v-model="formData.specialFund" placeholder="请选择专项资金" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in cacheStore.getDict('todo_type')"
|
||||
v-for="item in specialFundOption"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@@ -46,11 +54,11 @@
|
||||
</el-config-provider>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-form-item label="所属公司" prop="affiliatedCompanyId">-->
|
||||
<!-- <el-tree-select v-model="formData.affiliatedCompanyId" :data="companyOption" style="width: 100%;"-->
|
||||
<!-- filterable clearable :check-strictly="true"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col> <el-col :span="12">-->
|
||||
<!-- <el-form-item label="所属公司" prop="affiliatedCompanyId">-->
|
||||
<!-- <el-tree-select v-model="formData.affiliatedCompanyId" :data="companyOption" style="width: 100%;"-->
|
||||
<!-- filterable clearable :check-strictly="true"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col> <el-col :span="12">-->
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目类型" prop="projectType">
|
||||
@@ -139,18 +147,20 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产学研联合" prop="industryUniversityResearch">
|
||||
<el-radio-group v-model="formData.industryUniversityResearch">
|
||||
<el-radio v-for="item in cacheStore.getDict('industry_university')"
|
||||
:key="item.value"
|
||||
:label="item.value">{{item.label}}</el-radio>
|
||||
<el-radio v-for="item in cacheStore.getDict('industry_university')"
|
||||
:key="item.value"
|
||||
:label="item.value">{{ item.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开展政府申报" prop="governmentDeclaration">
|
||||
<el-radio-group v-model="formData.governmentDeclaration">
|
||||
<el-radio v-for="item in cacheStore.getDict('government_declaration')"
|
||||
:key="item.value"
|
||||
:label="item.value">{{item.label}}</el-radio>
|
||||
<el-radio v-for="item in cacheStore.getDict('government_declaration')"
|
||||
:key="item.value"
|
||||
:label="item.value">{{ item.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -230,13 +240,14 @@
|
||||
</div>
|
||||
<div class="oper-page-btn">
|
||||
<el-button type="info" @click="staging">存为草稿</el-button>
|
||||
<el-button color="#DED0B2" v-if="name==='Summary/add'" @click="handleSubmit(summaryForm)">发布</el-button>
|
||||
<el-button color="#DED0B2" v-else @click="handleResubmit">重新发布</el-button>
|
||||
<el-button color="#DED0B2" v-if="name==='Summary/add'" @click="handleSubmit(summaryForm)">发布</el-button>
|
||||
<el-button color="#DED0B2" v-else @click="handleResubmit">重新发布</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import {debounce} from 'lodash'
|
||||
import {getDetail, getProcessInfo, requirementReported, resubmitReported} from "./api";
|
||||
import {ElMessage, ElNotification} from "element-plus";
|
||||
import {useTagsView} from '@/stores/tagsview.js'
|
||||
@@ -244,6 +255,8 @@ import {useCacheStore} from '@/stores/cache.js'
|
||||
import {useProcessStore} from '@/stores/processStore.js';
|
||||
import {getSubCompOpt} from "@/api/user/user";
|
||||
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
||||
import {getFormInfo} from "@/api/project-demand";
|
||||
import {getFundOption} from "@/api/special-fund";
|
||||
|
||||
const cacheStore = useCacheStore()
|
||||
const processStore = useProcessStore()
|
||||
@@ -257,12 +270,14 @@ const tagsViewStore = useTagsView()
|
||||
const companyOption = ref([])
|
||||
const summaryForm = ref()
|
||||
const deploymentId = ref()
|
||||
const specialFundOption = ref([])
|
||||
const isSpecialFund = ref()
|
||||
const showTable = ref(true)
|
||||
const otherFileList = ref([])
|
||||
const file = ref({})
|
||||
const formData = ref({
|
||||
industryUniversityResearch:'0',
|
||||
governmentDeclaration:'0',
|
||||
industryUniversityResearch: '0',
|
||||
governmentDeclaration: '0',
|
||||
})
|
||||
const rules = reactive({
|
||||
projectName: [{required: true, message: '请输入项目名称', trigger: 'blur'}],
|
||||
@@ -290,6 +305,16 @@ const rules = reactive({
|
||||
serviceDescription: [{required: true, message: '请输入现有业务描述', trigger: 'blur'}],
|
||||
contentDescription: [{required: true, message: '请输入研发项目关键内容描述', trigger: 'blur'}]
|
||||
})
|
||||
const getIsFund = async () => {
|
||||
getFormInfo(route.query.id).then(res => {
|
||||
if (res.code === 1000) {
|
||||
formData.value.isSpecialFund = res.data.isSpecialFund
|
||||
if(res.data.isSpecialFund){
|
||||
formData.value.specialFund = Number(res.data.specialFund)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
const compositeParam = (item, type) => {
|
||||
let tag = ''
|
||||
if (name.value === 'Summary/add' || name.value === 'Summary/edit') {
|
||||
@@ -304,12 +329,11 @@ const compositeParam = (item, type) => {
|
||||
tag: tag
|
||||
}
|
||||
}
|
||||
const getEditOtherFile = (val) => {
|
||||
console.log('getEditOtherFile', val)
|
||||
}
|
||||
|
||||
const getAttachment = (val) => {
|
||||
console.log('上传文件getAttachment', val)
|
||||
file.value = compositeParam(val)
|
||||
formData.value.singleFile = compositeParam(val)
|
||||
}
|
||||
const getOtherFile = (val) => {
|
||||
console.log('上传文件getOtherFile', val)
|
||||
@@ -326,15 +350,16 @@ const getFileParam = (item) => {
|
||||
tag: item.tag
|
||||
}
|
||||
}
|
||||
const handleSubmit = async (instance) => {
|
||||
// if (!instance) return
|
||||
// instance.validate(async (valid, fields) => {
|
||||
// if(JSON.stringify(file.value) == "{}"){
|
||||
// attachment.value.validate()
|
||||
// } else {
|
||||
// attachment.value.clearValidate()
|
||||
// }
|
||||
// if (!valid) return
|
||||
const handleSubmit = debounce(async (instance) => {
|
||||
console.log('formData.value',formData.value)
|
||||
if (!instance) return
|
||||
instance.validate(async (valid, fields) => {
|
||||
if (JSON.stringify(file.value) === "{}") {
|
||||
attachment.value.validate()
|
||||
} else {
|
||||
attachment.value.clearValidate()
|
||||
}
|
||||
if (!valid) return
|
||||
let singleFile = {}
|
||||
if (file.value.fileId !== undefined) {
|
||||
singleFile = {
|
||||
@@ -394,15 +419,21 @@ const handleSubmit = async (instance) => {
|
||||
name: 'Summary'
|
||||
})
|
||||
}
|
||||
// })
|
||||
}
|
||||
const handleResubmit = () => {
|
||||
})
|
||||
})
|
||||
const handleResubmit = debounce(() => {
|
||||
let singleFile = {}
|
||||
let otherFiles = []
|
||||
let fileArray
|
||||
if (name.value === 'Summary/edit') {
|
||||
console.log('attachment.value', attachment.value.singleFile)
|
||||
if (attachment.value.singleFile === null) {
|
||||
attachment.value.validate()
|
||||
} else {
|
||||
attachment.value.clearValidate()
|
||||
}
|
||||
singleFile = {
|
||||
fileId: attachment.value.singleFile.fileId
|
||||
fileId: attachment.value.singleFile?.fileId
|
||||
}
|
||||
fileArray = attachment.value.allFileList
|
||||
} else {
|
||||
@@ -438,7 +469,7 @@ const handleResubmit = () => {
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
const getDetailInfo = async () => {
|
||||
getDetail(route.query.projectId).then(res => {
|
||||
ElNotification({
|
||||
@@ -453,6 +484,9 @@ const getDetailInfo = async () => {
|
||||
})
|
||||
}
|
||||
const init = async () => {
|
||||
const resFund = await getFundOption()
|
||||
specialFundOption.value = resFund.data
|
||||
await getIsFund()
|
||||
const res = await getSubCompOpt()
|
||||
companyOption.value = res.data
|
||||
getProcessInfo().then(res => {
|
||||
|
||||
@@ -143,9 +143,6 @@ const tableConfig = reactive({
|
||||
if (buttons.has("edit")) {
|
||||
btn.push({label: '编辑', prem: ['mosr:collect:resubmit'], func: () => handleEdit(row), type: 'primary'})
|
||||
}
|
||||
// if (buttons.has("delete")) {
|
||||
// btn.push({label: '删除',prem: ['mosr:requirement:del'], func: () => handleEdit(row), type: 'primary'})
|
||||
// }
|
||||
if (buttons.has("report")) {
|
||||
btn.push({label: '上报', prem: ['mosr:collect:reported'], func: () => handleAdd(row), type: 'primary'})
|
||||
}
|
||||
@@ -163,6 +160,12 @@ const tableConfig = reactive({
|
||||
</el-button>
|
||||
))
|
||||
}
|
||||
{
|
||||
buttons.has("delete") ?
|
||||
<popover-delete name={row.requirementName} type={'需求'} btnType={'danger'}
|
||||
perm={['mosr:collect:del']} onDelete={() => handleDelete(row)}/>
|
||||
: ''
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user