fix:一键申请--融合服务特殊处理
This commit is contained in:
parent
5387d6a7a3
commit
21adcb62c8
|
@ -8,139 +8,58 @@
|
|||
</div>
|
||||
<div class="form-container">
|
||||
<div v-if="applySuccess">
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="formName"
|
||||
name="basic"
|
||||
:label-col="{ style: { width: '106px' } }"
|
||||
:wrapper-col="{ style: { width: '230px' } }"
|
||||
labelAlign="left"
|
||||
autocomplete="off"
|
||||
>
|
||||
<a-form ref="formRef" :model="formName" name="basic" :label-col="{ style: { width: '106px' } }"
|
||||
:wrapper-col="{ style: { width: '230px' } }" labelAlign="left" autocomplete="off">
|
||||
<div class="base-info">
|
||||
<a-form-item
|
||||
label="申请标题"
|
||||
name="title"
|
||||
:rules="[{ required: true, message: '请输入申请标题' }]"
|
||||
>
|
||||
<a-input
|
||||
placeholder="请输入能力申请标题"
|
||||
v-model:value="formName.title"
|
||||
/>
|
||||
<a-form-item label="申请标题" name="title" :rules="[{ required: true, message: '请输入申请标题' }]">
|
||||
<a-input placeholder="请输入能力申请标题" v-model:value="formName.title" />
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="base-info">
|
||||
<a-form-item
|
||||
label="申请人信息"
|
||||
name="user"
|
||||
:rules="[{ required: true, message: '请输入申请人' }]"
|
||||
>
|
||||
<a-input
|
||||
placeholder="请输入申请人"
|
||||
v-model:value="formName.user"
|
||||
disabled
|
||||
/>
|
||||
<a-form-item label="申请人信息" name="user" :rules="[{ required: true, message: '请输入申请人' }]">
|
||||
<a-input placeholder="请输入申请人" v-model:value="formName.user" disabled />
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
style="margin: 0 22px"
|
||||
label="电话"
|
||||
name="phone"
|
||||
:rules="[
|
||||
<a-form-item style="margin: 0 22px" label="电话" name="phone" :rules="[
|
||||
{
|
||||
required: true,
|
||||
pattern: /^1[3456789]\d{9}$/,
|
||||
message: '请输入正确的电话号码',
|
||||
},
|
||||
]"
|
||||
>
|
||||
<a-input
|
||||
placeholder="请输入申请人电话"
|
||||
v-model:value="formName.phone"
|
||||
/>
|
||||
]">
|
||||
<a-input placeholder="请输入申请人电话" v-model:value="formName.phone" />
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
label="单位"
|
||||
name="unit"
|
||||
:rules="[{ required: true, message: '请输入单位' }]"
|
||||
>
|
||||
<a-input
|
||||
placeholder="请输入单位"
|
||||
v-model:value="formName.unit"
|
||||
disabled
|
||||
v-if="deptFlage"
|
||||
/>
|
||||
<a-select
|
||||
v-else
|
||||
placeholder="请选择归属部门"
|
||||
v-model:value="formName.unit"
|
||||
@change="deptIdChangeFunction"
|
||||
>
|
||||
<a-select-option
|
||||
v-for="(item, index) in deptNameAll"
|
||||
:key="`${index}-${item}`"
|
||||
:value="item.name"
|
||||
>
|
||||
<a-form-item label="单位" name="unit" :rules="[{ required: true, message: '请输入单位' }]">
|
||||
<a-input placeholder="请输入单位" v-model:value="formName.unit" disabled v-if="deptFlage" />
|
||||
<a-select v-else placeholder="请选择归属部门" v-model:value="formName.unit" @change="deptIdChangeFunction">
|
||||
<a-select-option v-for="(item, index) in deptNameAll" :key="`${index}-${item}`" :value="item.name">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="base-info" v-if="flag">
|
||||
<a-form-item
|
||||
label="应用系统"
|
||||
name="applicationSystem"
|
||||
:rules="[{ required: true, message: '请选择应用系统' }]"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="formName.applicationSystem"
|
||||
show-search
|
||||
placeholder="请输入关键字"
|
||||
style="width: 200px"
|
||||
:options="systemOptions"
|
||||
@focus="handleFocus"
|
||||
@blur="handleBlur"
|
||||
@change="systemHandleChange"
|
||||
@search="systemHandleSearch"
|
||||
></a-select>
|
||||
<a-form-item label="应用系统" name="applicationSystem" :rules="[{ required: true, message: '请选择应用系统' }]">
|
||||
<a-select v-model:value="formName.applicationSystem" show-search placeholder="请输入关键字"
|
||||
style="width: 200px" :options="systemOptions" @focus="handleFocus" @blur="handleBlur"
|
||||
@change="systemHandleChange" @search="systemHandleSearch"></a-select>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
class="applicationScene"
|
||||
label="应用领域"
|
||||
name="applicationScene"
|
||||
:rules="[{ required: true, message: '请选择应用领域' }]"
|
||||
style="width: 6.93rem"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="formName.applicationScene"
|
||||
:options="applicationSceneOpthion"
|
||||
mode="tags"
|
||||
:size="size"
|
||||
placeholder="请选择应用领域"
|
||||
:filterOption="false"
|
||||
:searchValue="false"
|
||||
style="width: 5.87rem"
|
||||
></a-select>
|
||||
<a-form-item class="applicationScene" label="应用领域" name="applicationScene"
|
||||
:rules="[{ required: true, message: '请选择应用领域' }]" style="width: 6.93rem">
|
||||
<a-select v-model:value="formName.applicationScene" :options="applicationSceneOpthion" mode="tags"
|
||||
:size="size" placeholder="请选择应用领域" :filterOption="false" :searchValue="false"
|
||||
style="width: 5.87rem"></a-select>
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div>
|
||||
<a-form-item
|
||||
label="需求依据"
|
||||
name="applicationBackground"
|
||||
:rules="[
|
||||
<a-form-item label="需求依据" name="applicationBackground" :rules="[
|
||||
{ required: true, message: '请输入需求依据' },
|
||||
{ min: 50, message: '需求依据最少为50个字' },
|
||||
]"
|
||||
>
|
||||
<a-textarea
|
||||
placeholder="请输入需求依据"
|
||||
v-model:value="formName.applicationBackground"
|
||||
:rows="4"
|
||||
/>
|
||||
]">
|
||||
<a-textarea placeholder="请输入需求依据" v-model:value="formName.applicationBackground" :rows="4" />
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="bottom-btn">
|
||||
<a-button
|
||||
style="
|
||||
<a-button style="
|
||||
width: 80px;
|
||||
height: 38px;
|
||||
margin-right: 20px;
|
||||
|
@ -151,15 +70,10 @@
|
|||
border: none;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
"
|
||||
type="primary"
|
||||
html-type="cancle"
|
||||
@click="resetFields()"
|
||||
>
|
||||
" type="primary" html-type="cancle" @click="resetFields()">
|
||||
退出申请
|
||||
</a-button>
|
||||
<a-button
|
||||
style="
|
||||
<a-button style="
|
||||
width: 80px;
|
||||
height: 38px;
|
||||
background: #0087ff;
|
||||
|
@ -169,11 +83,7 @@
|
|||
border: none;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
"
|
||||
type="primary"
|
||||
html-type="submit"
|
||||
@click="processStartHandle()"
|
||||
>
|
||||
" type="primary" html-type="submit" @click="processStartHandle()">
|
||||
提交申请
|
||||
</a-button>
|
||||
</div>
|
||||
|
@ -216,6 +126,7 @@
|
|||
import { sgcDel, getApplyForm } from '@/api/personalCenter'
|
||||
import { pageWithAttrs, updateIntegrationServices } from '@/api/home'
|
||||
import { DETAIL_PAGE_CONTENT_DEFAULT_TAB } from '@/global/GlobalConfig.js'
|
||||
import { getIntegrationDetail } from '@/api/home'
|
||||
|
||||
export default {
|
||||
name: '',
|
||||
|
@ -224,26 +135,20 @@
|
|||
HomeHeader,
|
||||
AbilityToApplyFor,
|
||||
},
|
||||
beforeRouteLeave(from, to, next) {
|
||||
console.log('from, to, next------------>', from, to, next);
|
||||
localStorage.removeItem('integrationServicesItemInfo')
|
||||
next()
|
||||
},
|
||||
setup() {
|
||||
const router = useRouter()
|
||||
const disabled = ref(false)
|
||||
const flag = ref(false)
|
||||
const list = ref(JSON.parse(localStorage.getItem('applyList')))
|
||||
const integrationServicesItemInfo = ref(
|
||||
JSON.parse(localStorage.getItem('integrationServicesItemInfo') || '{}')
|
||||
)
|
||||
|
||||
const deptNameAll = ref([]) //所有部门名称
|
||||
const deptFlage = ref(true) //判断是否存在默认部门名称
|
||||
console.log(
|
||||
'integrationServicesItemInfo------------>',
|
||||
integrationServicesItemInfo
|
||||
)
|
||||
const applyAll = router.currentRoute.value.query.applyAll
|
||||
const applyAll = router.currentRoute.value.query.applyAll;
|
||||
// 融合服务id
|
||||
const integrationServicesId = router.currentRoute.value.query.integrationServicesId;
|
||||
// 融合服务详情
|
||||
const integrationServicesItemInfo = ref(null)
|
||||
|
||||
const num = ref(0)
|
||||
if (!applyAll) {
|
||||
list.value.map((item) => {
|
||||
|
@ -376,7 +281,6 @@
|
|||
//退出返回上一页
|
||||
const resetFields = () => {
|
||||
window.history.go(-1)
|
||||
localStorage.removeItem('integrationServicesItemInfo')
|
||||
}
|
||||
|
||||
// 跳转到能力集市
|
||||
|
@ -500,11 +404,11 @@
|
|||
}
|
||||
})
|
||||
} else {
|
||||
// todo 融合服务
|
||||
if (
|
||||
Object.keys(integrationServicesItemInfo).length > 0
|
||||
) {
|
||||
// 融合服务
|
||||
if (integrationServicesId) {
|
||||
getIntegrationServicesDeatil(integrationServicesId).then(res => {
|
||||
updateIntegrationServiceAction()
|
||||
})
|
||||
}
|
||||
jumpToDetailsPageconetent()
|
||||
}
|
||||
|
@ -623,11 +527,11 @@
|
|||
}
|
||||
})
|
||||
} else {
|
||||
// todo 融合服务
|
||||
if (
|
||||
Object.keys(integrationServicesItemInfo).length > 0
|
||||
) {
|
||||
// 融合服务
|
||||
if (integrationServicesId) {
|
||||
getIntegrationServicesDeatil(integrationServicesId).then(res => {
|
||||
updateIntegrationServiceAction()
|
||||
})
|
||||
}
|
||||
jumpToDetailsPageconetent()
|
||||
}
|
||||
|
@ -800,7 +704,7 @@
|
|||
mybus.off('reomveOldData')
|
||||
})
|
||||
|
||||
// 融合服务-更新 todo
|
||||
// 融合服务-更新
|
||||
const updateIntegrationServiceAction = () => {
|
||||
let _applyCount =
|
||||
Number(integrationServicesItemInfo.value.applyCount || 0) + 1
|
||||
|
@ -810,13 +714,34 @@
|
|||
updateIntegrationServices(_data)
|
||||
.then((res) => {
|
||||
console.log('res---更新--------->', res)
|
||||
localStorage.removeItem('integrationServicesItemInfo')
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('err----更新-------->', err)
|
||||
localStorage.removeItem('integrationServicesItemInfo')
|
||||
})
|
||||
}
|
||||
|
||||
// 融合服务--详情
|
||||
const getIntegrationServicesDeatil = (id) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
getIntegrationDetail(id).then(
|
||||
(res) => {
|
||||
resolve(res)
|
||||
if (res.data.code !== 0) {
|
||||
return message.error(res.data.msg)
|
||||
}
|
||||
console.log('res.data.data------------>', res.data.data);
|
||||
|
||||
integrationServicesItemInfo.value = res.data.data || {}
|
||||
},
|
||||
(err) => {
|
||||
reject(err)
|
||||
message.error(err)
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
return {
|
||||
deptIdChangeFunction,
|
||||
formRef,
|
||||
|
@ -848,6 +773,7 @@
|
|||
applicationSceneOpthion,
|
||||
flag,
|
||||
applyAll,
|
||||
getIntegrationServicesDeatil,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@ -860,6 +786,7 @@
|
|||
margin: 0.8rem auto 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
aside {
|
||||
width: 282px;
|
||||
height: 96%;
|
||||
|
@ -867,6 +794,7 @@
|
|||
background-color: #fff;
|
||||
margin: 1% 0 3%;
|
||||
}
|
||||
|
||||
article {
|
||||
width: 1090px;
|
||||
height: 99%;
|
||||
|
@ -874,8 +802,10 @@
|
|||
background-color: #fff;
|
||||
margin: 1% auto;
|
||||
}
|
||||
|
||||
.form-container {
|
||||
padding: 20px 20px 30px 20px;
|
||||
|
||||
.title {
|
||||
font-size: 20px;
|
||||
color: #000;
|
||||
|
@ -883,52 +813,63 @@
|
|||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.base-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
:deep(.ant-form-item-label) {
|
||||
label {
|
||||
color: #666;
|
||||
font-size: 16px;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-form-item-required) {
|
||||
&::before {
|
||||
font-size: 8px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-input) {
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.success {
|
||||
div {
|
||||
width: 100px;
|
||||
margin: 80px auto 40px;
|
||||
}
|
||||
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
.applicationScene {
|
||||
:deep(.ant-select-selector) {
|
||||
overflow-x: scroll;
|
||||
}
|
||||
|
||||
:deep(.ant-select-selection-overflow) {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
textarea {
|
||||
resize: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.bottom-btn {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
|
|
@ -571,10 +571,14 @@ export default {
|
|||
_applyList = jcss.concat(_applyList)
|
||||
localStorage.setItem('applyList', JSON.stringify(_applyList))
|
||||
// 融合服务
|
||||
localStorage.setItem('integrationServicesItemInfo', JSON.stringify(item))
|
||||
router.push({
|
||||
path: '/apply',
|
||||
query: {
|
||||
integrationServicesId: item.id,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
mybus.on('chongzhi', (typeObj) => {
|
||||
|
|
Loading…
Reference in New Issue