|
@@ -8,7 +8,7 @@
|
|
|
<v-btn class="mr-3" :disabled="!selectAll" color="primary" variant="tonal" size="small" @click="handleAction(4, 'top', {})">取消置顶</v-btn>
|
|
|
<v-btn :disabled="!selectAll" color="primary" variant="tonal" size="small" @click="handleAction(0, 'close', {})">{{ $t('common.close') }}</v-btn>
|
|
|
</div>
|
|
|
- <v-btn v-if="tab === 2" class="ml-8" :disabled="!selectAll" color="primary" variant="tonal" size="small" @click="handleAction(1, 'activation', {})">{{ $t('common.activation') }}</v-btn>
|
|
|
+ <v-btn v-if="tab === 2" class="ml-8" :disabled="!selectAll" color="primary" variant="tonal" size="small" @click="handleAction(1, 'activation', {})">一键激活</v-btn>
|
|
|
</div>
|
|
|
<div v-for="val in items" :key="val.id" class="itemBox mb-3" style="height: 134px;">
|
|
|
<div v-if="val.top && tab === 1" style="position: absolute;">
|
|
@@ -36,14 +36,14 @@
|
|
|
<span>{{ val.positionName }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="d-flex align-center">
|
|
|
- <!-- <v-btn v-if="tab === 1" class="ml-3" color="primary" @click="handleAction(2, '', val)">
|
|
|
+ <!-- <div class="d-flex align-center">
|
|
|
+ <v-btn v-if="tab === 1" class="ml-3" color="primary" @click="handleAction(2, '', val)">
|
|
|
<span>{{ $t('common.refresh') + $t('common.position') }}</span>
|
|
|
<v-icon class="ml-2">mdi-help-circle-outline</v-icon>
|
|
|
<v-tooltip activator="parent" location="top">刷新职位后,发布时间为最新的</v-tooltip>
|
|
|
- </v-btn> -->
|
|
|
+ </v-btn>
|
|
|
<v-btn v-if="tab === 2" color="primary" @click="handleAction(1, '', val)">{{ $t('common.activatePosition') }}</v-btn>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
<div class="bottom pa-5 d-flex justify-space-between align-center">
|
|
|
<div>
|
|
@@ -72,7 +72,7 @@
|
|
|
<Loading :visible="loading"></Loading>
|
|
|
|
|
|
<CtDialog :visible="showExpire" :widthType="2" titleClass="text-h6" title="修改职位到期时间" @close="showExpire = false; expireTimeId = null" @submit="handleSubmit">
|
|
|
- <CtForm v-if="showExpire" ref="CtFormRef" :items="formItem" style="height: 100px;"></CtForm>
|
|
|
+ <CtForm v-if="showExpire" ref="CtFormRef" :items="formItem"></CtForm>
|
|
|
</CtDialog>
|
|
|
</template>
|
|
|
|
|
@@ -85,7 +85,9 @@ import { useI18n } from '@/hooks/web/useI18n'
|
|
|
import { getEnterprisePubJobTypePermission } from '@/api/recruit/enterprise/position'
|
|
|
import { closeJobAdvertised, enableJobAdvertised, refreshJobAdvertised, topJobAdvertised, updatePositionExpireTime, topJobAdvertisedCancel } from '@/api/position'
|
|
|
import Snackbar from '@/plugins/snackbar'
|
|
|
+import { useUserStore } from '@/store/user'
|
|
|
|
|
|
+const store = useUserStore()
|
|
|
const { t } = useI18n()
|
|
|
const emit = defineEmits(['refresh'])
|
|
|
const props = defineProps({
|
|
@@ -110,7 +112,8 @@ const formItem = ref({
|
|
|
format: 'YYYY-MM-DD',
|
|
|
label: '到期时间 *',
|
|
|
labelWidth: 110,
|
|
|
- disabledDates: true,
|
|
|
+ teleported: true,
|
|
|
+ disabledDates: true
|
|
|
}
|
|
|
]
|
|
|
})
|
|
@@ -157,10 +160,18 @@ watch(
|
|
|
{ deep: true }
|
|
|
)
|
|
|
|
|
|
+let baseInfo = ref(JSON.parse(localStorage.getItem('entBaseInfo')) || {})
|
|
|
+store.$subscribe((mutation, state) => {
|
|
|
+ if (Object.keys(state.entBaseInfo).length) baseInfo.value = state.entBaseInfo
|
|
|
+})
|
|
|
const apiList = [closeJobAdvertised, enableJobAdvertised, refreshJobAdvertised, topJobAdvertised, topJobAdvertisedCancel]
|
|
|
-
|
|
|
// 职位关闭、激活、刷新、置顶
|
|
|
const handleAction = async (index, type, { id }) => {
|
|
|
+ // 激活职位时查询是否有可发布职位数
|
|
|
+ if (index === 1) {
|
|
|
+ await store.getEnterpriseInfo(true)
|
|
|
+ if (baseInfo.value?.entitlement.publishJobCount <= 0) return Snackbar.warning('可发布职位数不足,请联系平台管理员')
|
|
|
+ }
|
|
|
const ids = type ? props.items.filter(e => e.select).map(k => k.id) : [id]
|
|
|
if (!ids.length && !index) return
|
|
|
loading.value = true
|