|
@@ -18,7 +18,7 @@
|
|
v-bind="props"
|
|
v-bind="props"
|
|
></TextInput>
|
|
></TextInput>
|
|
</template>
|
|
</template>
|
|
- <industryTypeCard :limit="1" :select="query.industryIdList" :currentData="currentSelect" @handleClickIndustry="handleIndustry"></industryTypeCard>
|
|
|
|
|
|
+ <industryTypeCard :limit="1" :select="[query.industryId].filter(Boolean)" @handleClickIndustry="handleIndustry"></industryTypeCard>
|
|
</v-menu>
|
|
</v-menu>
|
|
</template>
|
|
</template>
|
|
</CtForm>
|
|
</CtForm>
|
|
@@ -30,21 +30,23 @@
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
defineOptions({name: 'informationSettingsComponents-basicInfo'})
|
|
defineOptions({name: 'informationSettingsComponents-basicInfo'})
|
|
-import { inject, ref, reactive } from 'vue'
|
|
|
|
-// import { getEnterpriseBaseInfo } from '@/api/enterprise'
|
|
|
|
|
|
+import { ref, reactive } from 'vue'
|
|
|
|
+import { getEnterpriseBaseInfo, updateEnterpriseBaseInfo } from '@/api/enterprise'
|
|
|
|
+import { getDict } from '@/hooks/web/useDictionaries'
|
|
import industryTypeCard from '@/components/industryTypeCard'
|
|
import industryTypeCard from '@/components/industryTypeCard'
|
|
|
|
+import Snackbar from '@/plugins/snackbar'
|
|
|
|
|
|
|
|
+const CtFormRef = ref()
|
|
const query = reactive({})
|
|
const query = reactive({})
|
|
-const infoData = JSON.parse(inject('infoData'))
|
|
|
|
const formItems = ref({
|
|
const formItems = ref({
|
|
options: [
|
|
options: [
|
|
{
|
|
{
|
|
type: 'text',
|
|
type: 'text',
|
|
key: 'name',
|
|
key: 'name',
|
|
value: '',
|
|
value: '',
|
|
- label: '企业名称 *',
|
|
|
|
|
|
+ label: '企业全称 *',
|
|
slotName: 'name',
|
|
slotName: 'name',
|
|
- rules: [v => !!v || '请输入企业名称']
|
|
|
|
|
|
+ rules: [v => !!v || '请输入企业全称']
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 'text',
|
|
type: 'text',
|
|
@@ -80,16 +82,16 @@ const formItems = ref({
|
|
{
|
|
{
|
|
slotName: 'industryId',
|
|
slotName: 'industryId',
|
|
key: 'industryId',
|
|
key: 'industryId',
|
|
- value: '',
|
|
|
|
|
|
+ value: null,
|
|
label: '所在行业 *',
|
|
label: '所在行业 *',
|
|
outlined: true,
|
|
outlined: true,
|
|
clearable: false,
|
|
clearable: false,
|
|
itemText: 'label',
|
|
itemText: 'label',
|
|
itemValue: 'value',
|
|
itemValue: 'value',
|
|
col: 6,
|
|
col: 6,
|
|
|
|
+ noParam: true,
|
|
flexStyle: 'mr-3',
|
|
flexStyle: 'mr-3',
|
|
- rules: [v => !!v || '请选择所在行业'],
|
|
|
|
- items: []
|
|
|
|
|
|
+ rules: [v => !!v || '请选择所在行业']
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 'autocomplete',
|
|
type: 'autocomplete',
|
|
@@ -127,55 +129,70 @@ const formItems = ref({
|
|
col: 6,
|
|
col: 6,
|
|
class: 'mb-3',
|
|
class: 'mb-3',
|
|
label: '上班时间(示例:上午09:00 - 下午17:00) *',
|
|
label: '上班时间(示例:上午09:00 - 下午17:00) *',
|
|
- rules: [v => !!v || '请选择上班时间']
|
|
|
|
|
|
+ rules: [v => !!v || '请填写上班时间']
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 'textarea',
|
|
type: 'textarea',
|
|
key: 'introduce',
|
|
key: 'introduce',
|
|
value: null,
|
|
value: null,
|
|
counter: 2000,
|
|
counter: 2000,
|
|
|
|
+ rows: 6,
|
|
label: '企业介绍 *',
|
|
label: '企业介绍 *',
|
|
outlined: true,
|
|
outlined: true,
|
|
rules: [v => !!v || '请输入企业介绍']
|
|
rules: [v => !!v || '请输入企业介绍']
|
|
},
|
|
},
|
|
]
|
|
]
|
|
})
|
|
})
|
|
-formItems.value.options.forEach(e => { if (infoData[e.key]) e.value = infoData[e.key] })
|
|
|
|
|
|
|
|
const setValue = (key, value) => {
|
|
const setValue = (key, value) => {
|
|
formItems.value.options.find(e => e.key === key).value = value
|
|
formItems.value.options.find(e => e.key === key).value = value
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// 行业列表
|
|
|
|
+const industryList = ref([])
|
|
|
|
+getDict('menduner_industry_type', {}, 'industryList').then(({ data }) => {
|
|
|
|
+ data = data?.length && data || []
|
|
|
|
+ industryList.value = data
|
|
|
|
+})
|
|
|
|
+
|
|
// 获取基本信息
|
|
// 获取基本信息
|
|
-// const getBaseInfo = async () => {
|
|
|
|
-// const data = await getEnterpriseBaseInfo()
|
|
|
|
-// console.log(data, 'info')
|
|
|
|
-// }
|
|
|
|
-// getBaseInfo()
|
|
|
|
|
|
+const getBaseInfo = async () => {
|
|
|
|
+ const data = await getEnterpriseBaseInfo()
|
|
|
|
+ if (!data) return
|
|
|
|
+ query.id = data.id
|
|
|
|
+ formItems.value.options.forEach(item => {
|
|
|
|
+ if (item.dictTypeName) {
|
|
|
|
+ getDict(item.dictTypeName).then(({ data }) => {
|
|
|
|
+ data = data?.length && data || []
|
|
|
|
+ item.items = data
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ query.industryId = data.industryId
|
|
|
|
+ if (item.key === 'industryId') {
|
|
|
|
+ item.value = industryList.value.find(e => e.id === data[item.key]).nameCn
|
|
|
|
+ } else item.value = data[item.key]
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+getBaseInfo()
|
|
|
|
|
|
-// 行业类型
|
|
|
|
-let currentSelect = reactive([])
|
|
|
|
|
|
+// 所在行业
|
|
const handleIndustry = (list, arr) => {
|
|
const handleIndustry = (list, arr) => {
|
|
- console.log(list, arr, 'in')
|
|
|
|
if (!list.length) return
|
|
if (!list.length) return
|
|
- query.industryId = list
|
|
|
|
- currentSelect = arr
|
|
|
|
|
|
+ query.industryId = list[0]
|
|
const str = arr.map(e => e.nameCn).join('、')
|
|
const str = arr.map(e => e.nameCn).join('、')
|
|
setValue('industryId', str)
|
|
setValue('industryId', str)
|
|
}
|
|
}
|
|
|
|
|
|
const handleSave = async () => {
|
|
const handleSave = async () => {
|
|
- // const { valid } = await formPageRef.value.formRef.validate()
|
|
|
|
- // if (!valid) return
|
|
|
|
- // items.value.options.forEach(e => {
|
|
|
|
- // if (arr.includes(e.key)) query[e.key] = e.value
|
|
|
|
- // })
|
|
|
|
- // if (editId.value) query.id = editId.value
|
|
|
|
- // await saveResumeJobInterested(query)
|
|
|
|
- // Snackbar.success('保存成功')
|
|
|
|
- // isAdd.value = false
|
|
|
|
- // resetForm()
|
|
|
|
- // getJobInterested()
|
|
|
|
|
|
+ const { valid } = await CtFormRef.value.formRef.validate()
|
|
|
|
+ if (!valid) return
|
|
|
|
+ formItems.value.options.forEach(e => {
|
|
|
|
+ if (e.noParam) return
|
|
|
|
+ query[e.key] = e.value
|
|
|
|
+ })
|
|
|
|
+ await updateEnterpriseBaseInfo(query)
|
|
|
|
+ Snackbar.success('编辑成功')
|
|
|
|
+ getBaseInfo()
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|