fix : 修复首页查看跳转问题及简化代码
This commit is contained in:
@@ -11,6 +11,8 @@
|
|||||||
import {ElNotification} from 'element-plus';
|
import {ElNotification} from 'element-plus';
|
||||||
import {agreeTask, rejectTask} from "@/api/project-demand/index.js";
|
import {agreeTask, rejectTask} from "@/api/project-demand/index.js";
|
||||||
|
|
||||||
|
import { useTagsView } from '@/stores/tagsview.js'
|
||||||
|
const tagsViewStore = useTagsView()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -51,23 +53,35 @@ const back = () => {
|
|||||||
router.push({name: 'Filing'})
|
router.push({name: 'Filing'})
|
||||||
break;
|
break;
|
||||||
case 'Implementation/detail':
|
case 'Implementation/detail':
|
||||||
if (route.query.step === '10') {
|
if (route.query.source === 'home') {
|
||||||
router.push({name: 'Summary'})
|
router.push('/home')
|
||||||
} else if (route.query.step === '20') {
|
} else {
|
||||||
router.push({name: 'Initiation'})
|
if (route.query.step === '10') {
|
||||||
} else if (route.query.step === '40') {
|
router.push({name: 'Summary'})
|
||||||
router.push({name: 'Implementation'})
|
} else if (route.query.step === '20') {
|
||||||
} else if (route.query.step === '50') {
|
router.push({name: 'Initiation'})
|
||||||
router.push({name: 'Filing'})
|
} else if (route.query.step === '40') {
|
||||||
}else if (route.query.step === '00') {
|
router.push({name: 'Implementation'})
|
||||||
router.push({name: 'Requirement'})
|
} else if (route.query.step === '50') {
|
||||||
|
router.push({name: 'Filing'})
|
||||||
|
} else if (route.query.step === '00') {
|
||||||
|
router.push({name: 'Requirement'})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Summary/detail':
|
case 'Summary/detail':
|
||||||
router.push({name: 'Summary'})
|
if (route.query.source === 'home') {
|
||||||
|
router.push('/home')
|
||||||
|
} else {
|
||||||
|
router.push({name: 'Summary'})
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'Requirement/detail':
|
case 'Requirement/detail':
|
||||||
router.push({name: 'Requirement'})
|
if (route.query.source === 'home') {
|
||||||
|
router.push('/home')
|
||||||
|
} else {
|
||||||
|
router.push({name: 'Requirement'})
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'Fund/detail':
|
case 'Fund/detail':
|
||||||
router.push({name: 'Fund'})
|
router.push({name: 'Fund'})
|
||||||
@@ -88,7 +102,6 @@ const handleReject = async () => {
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log('values', values)
|
|
||||||
const params = {
|
const params = {
|
||||||
taskId: props.taskId,
|
taskId: props.taskId,
|
||||||
...values
|
...values
|
||||||
@@ -99,6 +112,7 @@ const handleReject = async () => {
|
|||||||
message: res.msg,
|
message: res.msg,
|
||||||
type: res.code === 1000 ? 'success' : 'error'
|
type: res.code === 1000 ? 'success' : 'error'
|
||||||
})
|
})
|
||||||
|
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||||
back()
|
back()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,6 +129,7 @@ const handleAgree = async () => {
|
|||||||
message: res.msg,
|
message: res.msg,
|
||||||
type: res.code === 1000 ? 'success' : 'error'
|
type: res.code === 1000 ? 'success' : 'error'
|
||||||
})
|
})
|
||||||
|
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||||
back()
|
back()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -46,14 +46,14 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<div v-else style="display: flex; justify-content: center; align-items: center; height: 100%;" >
|
<div v-else style="display: flex; justify-content: center; align-items: center; height: 100%;">
|
||||||
您没有任何角色, 请联系管理员!
|
您没有任何角色, 请联系管理员!
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="jsx">
|
<script setup lang="jsx">
|
||||||
import 'element-plus/theme-chalk/display.css'
|
import 'element-plus/theme-chalk/display.css'
|
||||||
import { useAuthStore } from '@/stores/userstore.js'
|
import {useAuthStore} from '@/stores/userstore.js'
|
||||||
|
|
||||||
const AuthStore = useAuthStore()
|
const AuthStore = useAuthStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@@ -120,9 +120,9 @@ const tableConfig = reactive({
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
showOverflowTooltip: false,
|
showOverflowTooltip: false,
|
||||||
currentRender: ({row, index}) => {
|
currentRender: ({row, index}) => {
|
||||||
if(row.targetState!==null||row.targetState!==undefined){
|
if (row.targetState !== null || row.targetState !== undefined) {
|
||||||
return (<Tag dictType={'todo_type'} value={row.targetState}/>)
|
return (<Tag dictType={'todo_type'} value={row.targetState}/>)
|
||||||
}else {
|
} else {
|
||||||
return '--'
|
return '--'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -162,16 +162,27 @@ const handleView = (row) => {
|
|||||||
router.push({
|
router.push({
|
||||||
name: 'Requirement/detail',
|
name: 'Requirement/detail',
|
||||||
query: {
|
query: {
|
||||||
id: row.targetId
|
id: row.targetId,
|
||||||
|
source: 'home'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else{
|
} else if (row.targetState == '10' && row.targetId) {
|
||||||
|
router.push({
|
||||||
|
name: 'Summary/detail',
|
||||||
|
query: {
|
||||||
|
projectId: row.targetId,
|
||||||
|
state: row.state,
|
||||||
|
source: 'home'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
router.push({
|
router.push({
|
||||||
name: 'Implementation/detail',
|
name: 'Implementation/detail',
|
||||||
query: {
|
query: {
|
||||||
projectId: row.targetId,
|
projectId: row.targetId,
|
||||||
state: row.state,
|
state: row.state,
|
||||||
step: row.targetState
|
step: row.targetState,
|
||||||
|
source: 'home'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
v-model="formData.deadline"
|
v-model="formData.deadline"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
placeholder="截止时间"
|
placeholder="截止时间"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
/>
|
/>
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|||||||
@@ -204,7 +204,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="其中申请公司总部科技创新专项资金(元)" prop="specialFundAmount">
|
<el-form-item label="其中申请公司总部科技创新专项资金(元)" prop="specialFundAmount" v-if="formData.isSpecialFund">
|
||||||
<el-input v-model="formData.specialFundAmount" clearable></el-input>
|
<el-input v-model="formData.specialFundAmount" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -297,16 +297,16 @@ const rules = reactive({
|
|||||||
serviceDescription: [{required: true, message: '请输入现有业务描述', trigger: 'blur'}],
|
serviceDescription: [{required: true, message: '请输入现有业务描述', trigger: 'blur'}],
|
||||||
contentDescription: [{required: true, message: '请输入研发项目关键内容描述', trigger: 'blur'}]
|
contentDescription: [{required: true, message: '请输入研发项目关键内容描述', trigger: 'blur'}]
|
||||||
})
|
})
|
||||||
// const getIsFund = async () => {
|
const getIsFund = async () => {
|
||||||
// getFormInfo(route.query.id).then(res => {
|
getFormInfo(route.query.id).then(res => {
|
||||||
// if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
// formData.value.isSpecialFund = res.data.isSpecialFund
|
formData.value.isSpecialFund = res.data.isSpecialFund
|
||||||
// if(res.data.isSpecialFund){
|
if(res.data.isSpecialFund){
|
||||||
// formData.value.specialFund = Number(res.data.specialFund)
|
formData.value.specialFund = Number(res.data.specialFund)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// })
|
})
|
||||||
// }
|
}
|
||||||
const compositeParam = (item, type) => {
|
const compositeParam = (item, type) => {
|
||||||
let tag = ''
|
let tag = ''
|
||||||
if (name.value === 'Summary/add' || name.value === 'Summary/edit') {
|
if (name.value === 'Summary/add' || name.value === 'Summary/edit') {
|
||||||
@@ -346,12 +346,6 @@ const handleSubmit = debounce(async (instance) => {
|
|||||||
if (!instance) return
|
if (!instance) return
|
||||||
instance.validate(async (valid, fields) => {
|
instance.validate(async (valid, fields) => {
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
// if (JSON.stringify(file.value) === "{}") {
|
|
||||||
// attachment.value.validate()
|
|
||||||
// } else {
|
|
||||||
// attachment.value.clearValidate()
|
|
||||||
// }
|
|
||||||
|
|
||||||
let singleFile = {}
|
let singleFile = {}
|
||||||
if (file.value.fileId !== undefined) {
|
if (file.value.fileId !== undefined) {
|
||||||
singleFile = {
|
singleFile = {
|
||||||
@@ -430,12 +424,6 @@ const handleResubmit = debounce(() => {
|
|||||||
let otherFiles = []
|
let otherFiles = []
|
||||||
let fileArray
|
let fileArray
|
||||||
if (name.value === 'Summary/edit') {
|
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 = {
|
singleFile = {
|
||||||
fileId: attachment.value.singleFile?.fileId
|
fileId: attachment.value.singleFile?.fileId
|
||||||
}
|
}
|
||||||
@@ -502,7 +490,7 @@ const getDetailInfo = async () => {
|
|||||||
const init = async () => {
|
const init = async () => {
|
||||||
const resFund = await getFundOption()
|
const resFund = await getFundOption()
|
||||||
specialFundOption.value = resFund.data
|
specialFundOption.value = resFund.data
|
||||||
// await getIsFund()
|
await getIsFund()
|
||||||
const res = await getSubCompOpt()
|
const res = await getSubCompOpt()
|
||||||
companyOption.value = res.data
|
companyOption.value = res.data
|
||||||
getProcessInfo().then(res => {
|
getProcessInfo().then(res => {
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ const localData = reactive({})
|
|||||||
|
|
||||||
const tableIns = ref()
|
const tableIns = ref()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
|
|
||||||
const searchConfig = reactive([
|
const searchConfig = reactive([
|
||||||
{
|
{
|
||||||
label: '需求名称',
|
label: '需求名称',
|
||||||
@@ -76,7 +74,6 @@ const searchConfig = reactive([
|
|||||||
// colProps: {}
|
// colProps: {}
|
||||||
// },
|
// },
|
||||||
])
|
])
|
||||||
|
|
||||||
const tableConfig = reactive({
|
const tableConfig = reactive({
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -128,12 +128,6 @@ const getFileParam = (item) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
// if (JSON.stringify(file.value) === "{}") {
|
|
||||||
// attachment.value.validate()
|
|
||||||
// return;
|
|
||||||
// } else {
|
|
||||||
// attachment.value.clearValidate()
|
|
||||||
// }
|
|
||||||
let files = []
|
let files = []
|
||||||
let singleFile = {}
|
let singleFile = {}
|
||||||
if (file.value.fileId !== undefined) {
|
if (file.value.fileId !== undefined) {
|
||||||
@@ -180,12 +174,6 @@ const handleResubmit = () => {
|
|||||||
let singleFile = {}
|
let singleFile = {}
|
||||||
let otherFiles = []
|
let otherFiles = []
|
||||||
let fileArray
|
let fileArray
|
||||||
// if (JSON.stringify(file.value) === "{}" || attachment.value.singleFile === null) {
|
|
||||||
// attachment.value.validate()
|
|
||||||
// return;
|
|
||||||
// } else {
|
|
||||||
// attachment.value.clearValidate()
|
|
||||||
// }
|
|
||||||
if (attachment.value.singleFile !== null && name.value === 'Filing/edit') {
|
if (attachment.value.singleFile !== null && name.value === 'Filing/edit') {
|
||||||
singleFile = {
|
singleFile = {
|
||||||
fileId: attachment.value.singleFile.fileId
|
fileId: attachment.value.singleFile.fileId
|
||||||
|
|||||||
@@ -82,13 +82,6 @@ const getFileParam = (item) => {
|
|||||||
const handleSubmit = (instance) => {
|
const handleSubmit = (instance) => {
|
||||||
if (!instance) return
|
if (!instance) return
|
||||||
instance.validate(async (valid) => {
|
instance.validate(async (valid) => {
|
||||||
if (!valid) return
|
|
||||||
if(JSON.stringify(file.value) === "{}"){
|
|
||||||
attachment.value.validate()
|
|
||||||
return;
|
|
||||||
}else {
|
|
||||||
attachment.value.clearValidate()
|
|
||||||
}
|
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
let files = []
|
let files = []
|
||||||
let singleFile={}
|
let singleFile={}
|
||||||
@@ -149,12 +142,6 @@ const handleResubmit = (instance) => {
|
|||||||
let singleFile = {}
|
let singleFile = {}
|
||||||
let otherFiles = []
|
let otherFiles = []
|
||||||
let fileArray
|
let fileArray
|
||||||
// if (JSON.stringify(file.value) === "{}"||attachment.value.singleFile===null) {
|
|
||||||
// attachment.value.validate()
|
|
||||||
// return;
|
|
||||||
// } else {
|
|
||||||
// attachment.value.clearValidate()
|
|
||||||
// }
|
|
||||||
if (attachment.value.singleFile!==null&&name.value === 'Implementation/edit') {
|
if (attachment.value.singleFile!==null&&name.value === 'Implementation/edit') {
|
||||||
singleFile = {
|
singleFile = {
|
||||||
fileId: attachment.value.singleFile.fileId
|
fileId: attachment.value.singleFile.fileId
|
||||||
|
|||||||
@@ -126,17 +126,6 @@ const getFileParam = (item) => {
|
|||||||
const handleSubmit = (instance) => {
|
const handleSubmit = (instance) => {
|
||||||
if (!instance) return
|
if (!instance) return
|
||||||
instance.validate(async (valid) => {
|
instance.validate(async (valid) => {
|
||||||
if (JSON.stringify(file.value) === "{}") {
|
|
||||||
attachment.value.validate()
|
|
||||||
ElNotification({
|
|
||||||
title: '提示',
|
|
||||||
message: '请上传附件',
|
|
||||||
type: 'error'
|
|
||||||
})
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
attachment.value.clearValidate()
|
|
||||||
}
|
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
let files = []
|
let files = []
|
||||||
let singleFile = {}
|
let singleFile = {}
|
||||||
@@ -186,12 +175,6 @@ const handleResubmit = async () => {
|
|||||||
let files = []
|
let files = []
|
||||||
let singleFile = {}
|
let singleFile = {}
|
||||||
let fileArray
|
let fileArray
|
||||||
// if (JSON.stringify(file.value) === "{}" || attachment.value.singleFile === null) {
|
|
||||||
// attachment.value.validate()
|
|
||||||
// return;
|
|
||||||
// } else {
|
|
||||||
// attachment.value.clearValidate()
|
|
||||||
// }
|
|
||||||
if (attachment.value.singleFile !== null && name.value === 'Initiation/edit') {
|
if (attachment.value.singleFile !== null && name.value === 'Initiation/edit') {
|
||||||
singleFile = {
|
singleFile = {
|
||||||
fileId: attachment.value.singleFile.fileId
|
fileId: attachment.value.singleFile.fileId
|
||||||
|
|||||||
Reference in New Issue
Block a user