|
@@ -13,7 +13,7 @@
|
|
|
</template>
|
|
|
<jobTypeCard class="jobTypeCardBox" :select="[query.positionId].filter(Boolean)" :isSingle="true" @handleJobClick="handleJobClickItem"></jobTypeCard>
|
|
|
</v-menu>
|
|
|
- <v-btn class="ml-3 half-button" color="primary" style="margin-top: 2px;" @click="useJobTemplate(item)">岗位模板</v-btn>
|
|
|
+ <v-btn v-if="showTemplateBtn" class="ml-3 half-button" color="primary" style="margin-top: 2px;" @click="useJobTemplate(item)">岗位模板</v-btn>
|
|
|
</template>
|
|
|
</CtForm>
|
|
|
</div>
|
|
@@ -26,7 +26,11 @@ import { reactive, ref, watch } from 'vue'
|
|
|
import textUI from '@/components/FormUI/TextInput'
|
|
|
import jobTypeCard from '@/components/jobTypeCard'
|
|
|
import { getRecruitPositionDetails } from '@/api/recruit/enterprise/position'
|
|
|
+import Confirm from '@/plugins/confirm'
|
|
|
+import Snackbar from '@/plugins/snackbar'
|
|
|
+import { useI18n } from '@/hooks/web/useI18n';
|
|
|
|
|
|
+const { t } = useI18n()
|
|
|
const props = defineProps({
|
|
|
itemData: Object
|
|
|
})
|
|
@@ -35,6 +39,7 @@ const getValue = (key) => {
|
|
|
return items.value.options.find(e => e.key === key)
|
|
|
}
|
|
|
|
|
|
+const showTemplateBtn = ref(true)
|
|
|
const formPageRef = ref()
|
|
|
let query = reactive({})
|
|
|
|
|
@@ -113,19 +118,20 @@ const handleJobClickItem = (list, name) => {
|
|
|
positionId.value = ''
|
|
|
return
|
|
|
}
|
|
|
+ showTemplateBtn.value = true
|
|
|
query.positionId = list[0]
|
|
|
positionId.value = name
|
|
|
}
|
|
|
|
|
|
-// 岗位模板
|
|
|
-import Confirm from '@/plugins/confirm'
|
|
|
-import Snackbar from '@/plugins/snackbar'
|
|
|
-import { useI18n } from '@/hooks/web/useI18n'; const { t } = useI18n()
|
|
|
const useJobTemplate = async () => {
|
|
|
if (!query.positionId) return Snackbar.warning('请先选择职位类型')
|
|
|
// 获取职位模板内容-赋值
|
|
|
const res = await getRecruitPositionDetails(query.positionId)
|
|
|
- if (!res || !res.content || !res.requirement) return Snackbar.warning('此职位类型没有可使用的模板!')
|
|
|
+ if (!res || !res.content || !res.requirement) {
|
|
|
+ Snackbar.warning('此职位类型没有可使用的模板!')
|
|
|
+ showTemplateBtn.value = false
|
|
|
+ return
|
|
|
+ }
|
|
|
const content = items.value.options.find(e => e.key === 'content')
|
|
|
const requirement = items.value.options.find(e => e.key === 'requirement')
|
|
|
if ((content && content.value) || (requirement && requirement.value)) {
|