|
@@ -1,14 +1,14 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
<div v-if="props.items.length" class="d-flex align-center mb-1">
|
|
<div v-if="props.items.length" class="d-flex align-center mb-1">
|
|
- <v-checkbox v-if="tab !== 3" v-model="selectAll" :label="!selectAll ? $t('common.selectAll') : `已选中${selectList.length}条`" hide-details color="primary" @update:model-value="handleChangeSelectAll"></v-checkbox>
|
|
|
|
|
|
+ <v-checkbox v-if="tab === 1" v-model="selectAll" :label="!selectAll ? $t('common.selectAll') : `已选中${selectList.length}条`" hide-details color="primary" @update:model-value="handleChangeSelectAll"></v-checkbox>
|
|
<div v-if="tab === 1" class="ml-8">
|
|
<div v-if="tab === 1" class="ml-8">
|
|
<v-btn :disabled="!selectAll" color="primary" variant="tonal" size="small" @click="handleAction(2, 'batch', {})">一键刷新</v-btn>
|
|
<v-btn :disabled="!selectAll" color="primary" variant="tonal" size="small" @click="handleAction(2, 'batch', {})">一键刷新</v-btn>
|
|
<v-btn class="mx-3" :disabled="!selectAll" color="primary" variant="tonal" size="small" @click="handleAction(3, 'top', {})">{{ $t('common.topping') }}</v-btn>
|
|
<v-btn class="mx-3" :disabled="!selectAll" color="primary" variant="tonal" size="small" @click="handleAction(3, 'top', {})">{{ $t('common.topping') }}</v-btn>
|
|
- <v-btn class="mr-3" :disabled="!selectAll" color="primary" variant="tonal" size="small" @click="handleAction(4, 'top', {})">取消置顶</v-btn>
|
|
|
|
|
|
+ <!-- <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>
|
|
<v-btn :disabled="!selectAll" color="primary" variant="tonal" size="small" @click="handleAction(0, 'close', {})">{{ $t('common.close') }}</v-btn>
|
|
</div>
|
|
</div>
|
|
- <v-btn v-if="tab === 2" class="ml-8" :disabled="!selectAll" color="primary" variant="tonal" size="small" @click="handleAction(1, '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>
|
|
<div v-for="val in items" :key="val.id" class="itemBox mb-3" style="height: 134px;">
|
|
<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;">
|
|
<div v-if="val.top && tab === 1" style="position: absolute;">
|
|
@@ -16,14 +16,14 @@
|
|
</div>
|
|
</div>
|
|
<div class="d-flex justify-space-between" style="padding: 10px 20px;">
|
|
<div class="d-flex justify-space-between" style="padding: 10px 20px;">
|
|
<div class="position">
|
|
<div class="position">
|
|
- <div class="item-select ml-5" v-if="tab !== 3">
|
|
|
|
|
|
+ <div class="item-select ml-5" v-if="tab === 1">
|
|
<v-checkbox v-model="val.select" hide-details color="primary" @update:model-value="handleChangeSelect"></v-checkbox>
|
|
<v-checkbox v-model="val.select" hide-details color="primary" @update:model-value="handleChangeSelect"></v-checkbox>
|
|
</div>
|
|
</div>
|
|
- <div class="d-flex align-center" :class="{'cursor-pointer': tab === 1, 'ml-15': tab !== 3}" @click="handleDetail(val)">
|
|
|
|
|
|
+ <div class="d-flex align-center" :class="{'cursor-pointer': tab === 1, 'ml-15': tab === 1}" @click="handleDetail(val)">
|
|
<span v-if="val.name.indexOf('style')" v-html="val.name" class="position-name"></span>
|
|
<span v-if="val.name.indexOf('style')" v-html="val.name" class="position-name"></span>
|
|
<span v-else class="position-name">{{ val.name }}</span>
|
|
<span v-else class="position-name">{{ val.name }}</span>
|
|
</div>
|
|
</div>
|
|
- <div :class="['mt-3', 'other-info', 'ellipsis', 'ml-10']">
|
|
|
|
|
|
+ <div :class="['mt-3', 'other-info', 'ellipsis', {'ml-10': tab === 1}]">
|
|
<span>{{ val.areaName }}</span>
|
|
<span>{{ val.areaName }}</span>
|
|
<span class="lines" v-if="val.areaName && val.eduName"></span>
|
|
<span class="lines" v-if="val.areaName && val.eduName"></span>
|
|
<span>{{ val.eduName }}</span>
|
|
<span>{{ val.eduName }}</span>
|
|
@@ -36,6 +36,9 @@
|
|
<span>{{ val.positionName }}</span>
|
|
<span>{{ val.positionName }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="d-flex align-center">
|
|
|
|
+ <v-chip v-if="(val.status-0) === 99" color="warning" label>职位待发布,支付后成功后自动发布</v-chip>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<div class="bottom pa-5 d-flex justify-space-between align-center">
|
|
<div class="bottom pa-5 d-flex justify-space-between align-center">
|
|
<div>
|
|
<div>
|
|
@@ -52,10 +55,13 @@
|
|
<span class="lines"></span>
|
|
<span class="lines"></span>
|
|
<span class="cursor-pointer actions" @click="handleAction(0, '', val)">{{ $t('common.close') }}</span>
|
|
<span class="cursor-pointer actions" @click="handleAction(0, '', val)">{{ $t('common.close') }}</span>
|
|
<span class="lines"></span>
|
|
<span class="lines"></span>
|
|
|
|
+ <span class="cursor-pointer actions" @click="handleEdit(val)">{{ $t('common.edit') }}</span>
|
|
</div>
|
|
</div>
|
|
- <div v-if="tab === 1" class="cursor-pointer actions" @click="handleEdit(val)">{{ $t('common.edit') }}</div>
|
|
|
|
<div v-if="tab === 3" class="cursor-pointer actions" @click="handleUpdateExpireTime(val)">修改到期时间</div>
|
|
<div v-if="tab === 3" class="cursor-pointer actions" @click="handleUpdateExpireTime(val)">修改到期时间</div>
|
|
|
|
+ <span v-if="(val.status-0) === 99" class="cursor-pointer color-primary" @click="toPay(val)">去支付</span>
|
|
<span class="lines" v-if="tab !== 2"></span>
|
|
<span class="lines" v-if="tab !== 2"></span>
|
|
|
|
+ <span v-if="tab === 2" class="cursor-pointer actions" @click="handleAction(1, '', val, val)">激活</span>
|
|
|
|
+ <span class="lines" v-if="tab === 2"></span>
|
|
<span class="cursor-pointer actions" @click="handleDetail(val)">详情</span>
|
|
<span class="cursor-pointer actions" @click="handleDetail(val)">详情</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -63,6 +69,16 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
+ <confirmPaymentDialog
|
|
|
|
+ v-if="showConfirmPaymentDialog"
|
|
|
|
+ :cost="39900"
|
|
|
|
+ :spuId="spuId"
|
|
|
|
+ :spuName="spuName"
|
|
|
|
+ :orderType="1"
|
|
|
|
+ @paySuccess="paySuccess"
|
|
|
|
+ @close="showConfirmPaymentDialog = false"
|
|
|
|
+ ></confirmPaymentDialog>
|
|
|
|
+
|
|
<Loading :visible="loading"></Loading>
|
|
<Loading :visible="loading"></Loading>
|
|
|
|
|
|
<CtDialog :visible="showExpire" :widthType="2" titleClass="text-h6" title="修改职位到期时间" @close="showExpire = false; expireTimeId = null" @submit="handleSubmit">
|
|
<CtDialog :visible="showExpire" :widthType="2" titleClass="text-h6" title="修改职位到期时间" @close="showExpire = false; expireTimeId = null" @submit="handleSubmit">
|
|
@@ -77,9 +93,11 @@ import { useRouter } from 'vue-router'
|
|
import { timesTampChange } from '@/utils/date'
|
|
import { timesTampChange } from '@/utils/date'
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
import { getEnterprisePubJobTypePermission } from '@/api/recruit/enterprise/position'
|
|
import { getEnterprisePubJobTypePermission } from '@/api/recruit/enterprise/position'
|
|
-import { closeJobAdvertised, enableJobAdvertised, refreshJobAdvertised, topJobAdvertised, updatePositionExpireTime, topJobAdvertisedCancel } from '@/api/position'
|
|
|
|
|
|
+import { closeJobAdvertised, enableJobAdvertised, refreshJobAdvertised, topJobAdvertised, updatePositionExpireTime, topJobAdvertisedCancel, createTradeOrder } from '@/api/position'
|
|
import Snackbar from '@/plugins/snackbar'
|
|
import Snackbar from '@/plugins/snackbar'
|
|
import { useUserStore } from '@/store/user'
|
|
import { useUserStore } from '@/store/user'
|
|
|
|
+import Confirm from '@/plugins/confirm'
|
|
|
|
+import { getUnpaidOrder } from '@/api/common'
|
|
|
|
|
|
const store = useUserStore()
|
|
const store = useUserStore()
|
|
const { t } = useI18n()
|
|
const { t } = useI18n()
|
|
@@ -107,7 +125,7 @@ const formItem = ref({
|
|
label: '到期时间 *',
|
|
label: '到期时间 *',
|
|
labelWidth: 110,
|
|
labelWidth: 110,
|
|
teleported: true,
|
|
teleported: true,
|
|
- disabledDates: true
|
|
|
|
|
|
+ disabledDate: true
|
|
}
|
|
}
|
|
]
|
|
]
|
|
})
|
|
})
|
|
@@ -158,16 +176,56 @@ let baseInfo = ref(JSON.parse(localStorage.getItem('entBaseInfo')) || {})
|
|
store.$subscribe((mutation, state) => {
|
|
store.$subscribe((mutation, state) => {
|
|
if (Object.keys(state.entBaseInfo).length) baseInfo.value = state.entBaseInfo
|
|
if (Object.keys(state.entBaseInfo).length) baseInfo.value = state.entBaseInfo
|
|
})
|
|
})
|
|
|
|
+
|
|
|
|
+const showConfirmPaymentDialog = ref(false)
|
|
|
|
+const spuId = ref('')
|
|
|
|
+const spuName = ref('')
|
|
|
|
+const operateObj = ref({})
|
|
|
|
+// 支付
|
|
|
|
+const toPay = (val) => {
|
|
|
|
+ operateObj.value = val
|
|
|
|
+ spuId.value = val.id || ''
|
|
|
|
+ spuName.value = val.name || ''
|
|
|
|
+ showConfirmPaymentDialog.value = true
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 支付成功
|
|
|
|
+const paySuccess = async () => {
|
|
|
|
+ showConfirmPaymentDialog.value = false
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ emit('refresh', 1)
|
|
|
|
+ }, 1000)
|
|
|
|
+}
|
|
|
|
+
|
|
const apiList = [closeJobAdvertised, enableJobAdvertised, refreshJobAdvertised, topJobAdvertised, topJobAdvertisedCancel]
|
|
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 handleAction = async (index, type, { id }, item) => {
|
|
const ids = type ? props.items.filter(e => e.select).map(k => k.id) : [id]
|
|
const ids = type ? props.items.filter(e => e.select).map(k => k.id) : [id]
|
|
if (!ids.length && !index) return
|
|
if (!ids.length && !index) return
|
|
|
|
+
|
|
|
|
+ // 关闭职位提醒
|
|
|
|
+ if (index === 0) {
|
|
|
|
+ Confirm('系统提示', '是否确认关闭所选职位?关闭后再激活需重新收取费用!').then(async () => {
|
|
|
|
+ await apiList[index](ids)
|
|
|
|
+ Snackbar.success(t('common.operationSuccessful'))
|
|
|
|
+ // 清空选项
|
|
|
|
+ selectList.value = []
|
|
|
|
+ selectAll.value = false
|
|
|
|
+ emit('refresh')
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 没有可发布额度激活职位需重新付款
|
|
|
|
+ await store.getEnterpriseInfo(true)
|
|
|
|
+ if (index === 1 && baseInfo.value?.entitlement.publishJobCount <= 0) {
|
|
|
|
+ // 判断是否已有创建好的订单,有就直接跳转支付,没有就创建订单
|
|
|
|
+ const data = await getUnpaidOrder({ spuId: id, type: 1 })
|
|
|
|
+ if (!data) await createTradeOrder({ spuId: id, spuName: item.name, price: 39900, type: 1 })
|
|
|
|
+ toPay(item)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
loading.value = true
|
|
loading.value = true
|
|
try {
|
|
try {
|
|
await apiList[index](ids)
|
|
await apiList[index](ids)
|