|
@@ -2,6 +2,12 @@
|
|
|
<div class="index">
|
|
|
<el-row>
|
|
|
<el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
|
|
|
+ <div class="thr" v-if="companyInfo && companyInfo.id">
|
|
|
+ <el-select size="large" style="width: 350px" clearable v-model="incubator_id" filterable remote reserve-keyword placeholder="请输入想要选择的孵化器" :remote-method="remoteMethod" :loading="searchLoading">
|
|
|
+ <el-option v-for="item in searchList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ <el-button class="button" size="large" @click="toSave" type="primary">确定</el-button>
|
|
|
+ </div>
|
|
|
<el-col :span="24" class="one">基本信息 </el-col>
|
|
|
<el-col :span="24" class="two">
|
|
|
<el-form label-position="top" ref="ruleFormRef" :model="form" :rules="rules" label-width="80px" class="form">
|
|
@@ -62,6 +68,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
+import moment from 'moment'
|
|
|
import { cloneDeep, get } from 'lodash-es'
|
|
|
import { UserStore } from '@/store/user'
|
|
|
const userStore = UserStore()
|
|
@@ -69,11 +76,25 @@ const user = computed(() => userStore.user)
|
|
|
import { UsersStore } from '@/store/api/user/user'
|
|
|
import { DictDataStore } from '@/store/api/system/dictData'
|
|
|
import { SectorStore } from '@/store/api/platform/sector'
|
|
|
+// 接口
|
|
|
+import { CompanyStore } from '@/store/api/user/company'
|
|
|
+import { CirelationStore } from '@/store/api/user/cirelation'
|
|
|
+import { IncubatorStore } from '@/store/api/user/incubator'
|
|
|
+const incubatorStore = IncubatorStore()
|
|
|
+const companystore = CompanyStore()
|
|
|
+const cirelationStore = CirelationStore()
|
|
|
const store = UsersStore()
|
|
|
const dictDataStore = DictDataStore()
|
|
|
const sectorStore = SectorStore()
|
|
|
const $checkRes = inject('$checkRes')
|
|
|
const form = ref({ industry: [] })
|
|
|
+
|
|
|
+// 加载中
|
|
|
+const searchLoading = ref(false)
|
|
|
+const searchList = ref([])
|
|
|
+const incubator_id = ref('')
|
|
|
+const companyInfo = ref({})
|
|
|
+
|
|
|
// 表单验证
|
|
|
const ruleFormRef = ref()
|
|
|
const validatePhoneNumber = (rule, value, callback) => {
|
|
@@ -127,7 +148,15 @@ const searchOther = async () => {
|
|
|
if ($checkRes(result)) genderList.value = result.data
|
|
|
// 板块
|
|
|
result = await sectorStore.query({ is_use: '0' })
|
|
|
+
|
|
|
if ($checkRes(result)) plateList.value = result.data
|
|
|
+ if (user.value.id) {
|
|
|
+ let res = await companystore.query({ user: user.value.id, status: '1' })
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ if (res.data[0] && !res.data[0].logo) res.data[0].logo = []
|
|
|
+ companyInfo.value = res.data[0] || { logo: [] }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
// 保存
|
|
|
const submitForm = async (ruleFormRef) => {
|
|
@@ -142,6 +171,35 @@ const submitForm = async (ruleFormRef) => {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+const remoteMethod = (query) => {
|
|
|
+ if (query) {
|
|
|
+ searchLoading.value = true
|
|
|
+ setTimeout(async () => {
|
|
|
+ searchLoading.value = false
|
|
|
+ const info = { status: '1', name: query }
|
|
|
+ const res = await incubatorStore.query(info)
|
|
|
+ if (res.errcode == '0') searchList.value = res.data
|
|
|
+ }, 200)
|
|
|
+ } else {
|
|
|
+ searchList.value = []
|
|
|
+ }
|
|
|
+}
|
|
|
+const toSave = () => {
|
|
|
+ ElMessageBox.confirm(`您确认选择该数据?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' })
|
|
|
+ .then(async () => {
|
|
|
+ const data = {
|
|
|
+ user: user.value.id,
|
|
|
+ incubator: incubator_id.value,
|
|
|
+ company: companyInfo.value.id,
|
|
|
+ time: moment().format('YYYY-MM-DD'),
|
|
|
+ status: '0'
|
|
|
+ }
|
|
|
+ const res = await cirelationStore.create(data)
|
|
|
+ if ($checkRes(res, true)) ElMessage({ message: `申请进入孵化器成功等待审核`, type: 'success' })
|
|
|
+ incubator_id.value = ''
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
+}
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
|
.main {
|
|
@@ -156,5 +214,13 @@ const submitForm = async (ruleFormRef) => {
|
|
|
text-align: center;
|
|
|
}
|
|
|
}
|
|
|
+ .thr {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin: 0 0 10px 0;
|
|
|
+ .button {
|
|
|
+ margin: 0 0 0 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|