Xiao_123 преди 6 месеца
родител
ревизия
8f95a974fa

+ 2 - 2
src/components/Position/item.vue

@@ -23,8 +23,8 @@
             <span v-for="(j, i) in item.tagList" :key="i" class="mr-3 tags" style="color: #345768;">{{ j }}</span>
           </div>
           <div v-if="tab === 3 && item.hire" class="text-end mt-3">
-            <v-chip v-if="item.hirePrice" size="small" label color="primary">赏金:{{ commissionCalculation(item.hirePrice, 1) }}元</v-chip>
-            <v-chip v-if="item.hirePoint" size="small" label class="ml-1" color="primary">积分:{{ commissionCalculation(item.hirePoint, 1) }}点</v-chip>
+            <v-chip v-if="item.hirePrice" size="small" label color="primary">赏金:{{ commissionCalculation(item.hirePrice / 100, 1) }}元</v-chip>
+            <v-chip v-if="item.hirePoint" size="small" label class="ml-1" color="primary">积分:{{ commissionCalculation(item.hirePoint / 100, 1) }}点</v-chip>
           </div>
           <div v-if="tab === 2" class="font-size-14 mb-3 text-end" style="color: #345768;">发布时间:{{ timesTampChange(item.updateTime, 'Y-M-D h:m') }}</div>
         </div>

+ 2 - 2
src/components/PositionLongStrip/item.vue

@@ -16,8 +16,8 @@
               <p v-if="!item.job.payFrom && !item.job.payTo" class="salary ml-1">面议</p>
               <p v-else class="salary ml-1">{{ item.job.payFrom ? item.job.payFrom + '-' : '' }}{{ item.job.payTo }}{{ item.job.payName ? '/' + item.job.payName : '' }}</p>
               <div v-if="item?.job?.hire">
-                <v-chip v-if="item?.job?.hirePrice && item?.job?.hirePrice > 0" class="ml-3" label color="primary" size="small">赏金:{{ commissionCalculation(item.job.hirePrice, 1) }}元</v-chip>
-                <v-chip v-if="item?.job?.hirePoint && item?.job?.hirePoint > 0" class="ml-3" label color="primary" size="small">积分:{{ commissionCalculation(item.job.hirePoint, 1) }}点</v-chip>
+                <v-chip v-if="item?.job?.hirePrice && item?.job?.hirePrice > 0" class="ml-3" label color="primary" size="small">赏金:{{ commissionCalculation(item.job.hirePrice / 100, 1) }}元</v-chip>
+                <v-chip v-if="item?.job?.hirePoint && item?.job?.hirePoint > 0" class="ml-3" label color="primary" size="small">积分:{{ commissionCalculation(item.job.hirePoint / 100, 1) }}点</v-chip>
               </div>
             </div>
             <div class="mt-2">

+ 13 - 18
src/components/pay/index.vue

@@ -14,8 +14,8 @@
     <!-- 赏金所需 -->
     <div class="pt-3 pb-5" style="color: var(--v-error-base); font-weight: bold; text-align: center;">
       <!-- <span class="font-size-13">¥</span> -->
-      <span class="font-size-30"> {{ cost }}</span>
-      <span class="font-size-15 ml-1">{{ unit }}</span>
+      <span class="font-size-30"> {{ cost / 100 }}</span>
+      <span class="font-size-15 ml-1">{{ payUnit }}</span>
     </div>
     <template v-if="payTypeList?.length">
       <v-chip-group v-model="payType" selected-class="text-primary" column mandatory @update:modelValue="payTypeChange">
@@ -33,10 +33,9 @@
             <span style="color: var(--v-primary-base);">{{ accountBalance }}</span>
           </div>
           <div class="my-3" v-if="notEnoughMoney">
-            <!-- <v-icon color="warning">mdi-information</v-icon> -->
-            <!-- <span class="color-warning">{{ props.params?.txt || '当前余额不足,请选择其他支付方式' }}</span> -->
             <span class="color-error">
-              当前剩余点数不足,<span class="text-decoration-underline cursor-pointer" @click="handleRecharge">去充值</span>
+              <!-- 当前剩余点数不足,<span class="text-decoration-underline cursor-pointer" @click="handleRecharge">去充值</span> -->
+              当前剩余点数不足,请微信扫码付款
             </span>
           </div>
         </div>
@@ -111,11 +110,11 @@ const props = defineProps({
   },
   appId: {
     type: Number,
-    default: 10 // 10为一般情况下支付,11为充值支付
+    default: 10 // 10为一般情况下支付(职位发布),11为充值支付
   },
   orderType: {
     type: Number,
-    default: 2 // 订单类型 0平台订单| 1发布职位订单| 2发布众聘职位订单,示例值(1)
+    default: 2 // 订单类型 0平台订单| 1发布职位订单| 2发布众聘职位订单,示例值(1)
   },
   unit: {
     type: String,
@@ -126,6 +125,7 @@ const props = defineProps({
 const showRecharge = ref(false)
 const loading = ref(true)
 const tip = ref('')
+const payUnit = ref('点数')
 
 // 步骤:
 //      1. 获取支付方式类型列表getCodeList (appId不同时数据返回有区别)
@@ -138,7 +138,7 @@ const tip = ref('')
 const accountBalance = ref(0)
 
 const notEnoughMoney = computed(() => {
-  return (Number(props.cost) > Number(accountBalance.value))
+  return (Number(props.cost / 100) > Number(accountBalance.value))
 })
 
 const timer = ref(null)
@@ -171,8 +171,6 @@ const paySubmit = async () => {
 
       if (timer.value) clearInterval(timer.value); timer.value = null
       timer.value = setInterval(() => { payStatus() }, 1000) // 轮巡查询用户是否支付
-      // if (isQrCodePay.value) {
-      // }
     }
   } catch (error) {
     console.log(error)
@@ -201,7 +199,7 @@ const getUnpaidOrderList = async () => {
         await createTradeOrder({
           spuId: props.spuId,
           spuName: props.spuName,
-          price: props.cost,
+          price: props.cost / 100,
           type:  props.orderType, // 发布众聘职位订单
         })
         if (maxCount > 3) return // 避免死循环
@@ -229,10 +227,11 @@ const isWalletPay = ref(false)
 const isQrCodePay = ref(false)
 const payTypeChange = (value) => {
   payType.value = value
+  payUnit.value = value === 'wx_native' ? '元' : '点数'
   tip.value = payTypeList.value.find(e => e.code === payType.value)?.tip || ''
   isQrCodePay.value = qrCodePay.includes(payType.value)
   isWalletPay.value = walletPay.includes(payType.value)
-  paySubmit() //
+  if (isQrCodePay.value) paySubmit()
 }
 // 1.支付方式
 const payType = ref('')
@@ -283,9 +282,6 @@ import Snackbar from '@/plugins/snackbar'
 import { useRoute } from 'vue-router'; const route = useRoute()
 import { useRouter } from 'vue-router'; const router = useRouter()
 const payStatus = async () => {
-  // if (timer.value) clearInterval(timer.value); timer.value = null
-  // setTimeout(() => { // 测试代码
-  // }, 2000)
   try {
     const data = await getOrderPayStatus({ id: (props.appId - 0) === 11 ? payOrder.value.payOrderId : payOrder.value.id })
     if ((data?.status - 0) === 10) {
@@ -324,15 +320,13 @@ const handleRecharge = () => {
 
 const updateAccountInfo = async (init = false) => {
   const account = await store.getEnterpriseUserAccountInfo()
-  accountBalance.value = account?.balance
+  accountBalance.value = account?.balance ? account.balance / 100 : 0
   if (init) return
   loading.value = false
 }
 if ((props.appId - 0) !== 11) updateAccountInfo(true) // 点数发生支付时点充值-充值不查余额
 
-
 // 倒计时
-
 const countdownTime = 60000 * 3 // 倒计时三分钟
 let remainder = 0 // number
 const remainderZhShow = ref('') // 倒计时展示
@@ -372,6 +366,7 @@ const formatDuration = (remainder) => {
 }
 
 </script>
+
 <style lang="scss" scoped>
 .font-size-30 { font-size: 30px; }
 </style>

+ 8 - 8
src/router/modules/components/recruit/enterprise.js

@@ -293,14 +293,14 @@ const enterprise = [
       //   },
       //   component: () => import('@/views/recruit/enterprise/membershipPackage/index.vue')
       // },
-      // {
-      //   path: '/recruit/enterprise/tradingOrder',
-      //   meta: {
-      //     title:'订单管理',
-      //     enName: 'Order management'
-      //   },
-      //   component: () => import('@/views/recruit/enterprise/tradingOrder/index.vue')
-      // },
+      {
+        path: '/recruit/enterprise/tradingOrder',
+        meta: {
+          title:'订单管理',
+          enName: 'Order management'
+        },
+        component: () => import('@/views/recruit/enterprise/tradingOrder/index.vue')
+      },
       {
         path: '/recruit/enterprise/invoiceManagement',
         meta: {

+ 1 - 1
src/utils/position.js

@@ -84,7 +84,7 @@ export const rechargeRatio = () => { return 10 }
 export const commissionCalculation = (count, type) => {
   if (!data || !Object.keys(data).length) return
   // 所占的百分比
-  const ratio = parseFloat(data[list[type]]) / 100 // 所占的百分比-> 50%变为0.5 (不能改)
+  const ratio = parseFloat(data[list[type]]) / 10 // 所占的百分比-> 50%变为0.5 (不能改)
   // 积分变成金额
   const value = count * ratio / rechargeRatio()
   return value % 1 === 0 ? Math.floor(value) : value.toFixed(2)

+ 4 - 2
src/views/recruit/enterprise/hirePosition/components/baseInfo.vue

@@ -93,7 +93,7 @@ const items = ref({
       type: 'number',
       key: 'hirePrice',
       value: null,
-      label: '请填写点数 * (1赏金=10点数,点数填入不得少于10且为10的倍数)',
+      label: '请填写点数 * (1赏金=1点数,点数填入不得少于10且为10的倍数)',
       suffix: '点',
       hideDetails: true,
       change: val => hirePriceChange(val, 'hirePrice')
@@ -170,7 +170,8 @@ watch(
       }
       if (e.noParam) return
       if (e.key === 'expireTime' && !val[e.key]) return handleSoFarChange(true, e)
-      e.value = val[e.key]
+      if (e.key === 'hirePrice') e.value = val[e.key] / 100
+      else e.value = val[e.key]
       e.change && e.change(e.value)
     })
   },
@@ -257,6 +258,7 @@ const getQuery = async () => {
   }
   items.value.options.forEach(e => {
     if (e.noParam || e.value === null) return
+    if (e.key === 'hirePrice') obj[e.key] = e.value * 100
     else obj[e.key] = e.value
   })
   if (!obj.content) {

+ 3 - 3
src/views/recruit/enterprise/hirePosition/components/item.vue

@@ -21,7 +21,7 @@
             <span>{{ val.positionName }}</span>
           </div>
           <div v-if="val?.hire" class="mt-2">
-            <v-chip v-if="val?.hirePrice && val.hirePrice > 0" class="mr-3" label color="primary" size="small">赏金:{{ commissionCalculation(val.hirePrice, 1) }}元</v-chip>
+            <v-chip v-if="val?.hirePrice && val.hirePrice > 0" class="mr-3" label color="primary" size="small">赏金:{{ val.hirePrice / 100 }}元</v-chip>
           </div>
         </div>
         <div class="d-flex align-center">
@@ -65,7 +65,7 @@
 </template>
 
 <script setup>
-import { commissionCalculation } from '@/utils/position'
+// import { commissionCalculation } from '@/utils/position'
 defineOptions({ name: 'enterprise-position-item'})
 import { ref } from 'vue'
 import { useRouter } from 'vue-router'
@@ -121,7 +121,7 @@ const formItem = ref({
       format: 'YYYY-MM-DD',
       label: '到期时间 *',
       labelWidth: 110,
-      disabledDates: true,
+      disabledDate: true,
       teleported: true
     }
   ]

+ 7 - 1
src/views/recruit/enterprise/hirePosition/index.vue

@@ -15,7 +15,7 @@
         </v-tabs>
         <v-window v-model="tab" class="mt-3">
           <v-window-item v-for="val in tabList" :key="val.value" :value="val.value">
-            <PositionItem v-if="items.length" :tab="tab" :items="items" @refresh="getPositionList"></PositionItem>
+            <PositionItem v-if="items.length" :tab="tab" :items="items" @refresh="handleRefresh"></PositionItem>
           </v-window-item>
         </v-window>
         <Empty v-if="!items.length" :message="loading ? '加载中...' : tipsText" :elevation="false"></Empty>
@@ -118,6 +118,12 @@ const getPositionList = async () => {
 }
 getPositionList()
 
+const handleRefresh = (index) => {
+  query.value.pageNo = 1
+  if (index) tab.value = index
+  getPositionList()
+}
+
 const handleChangeTab = () => {
   query.value.pageNo = 1
   getPositionList()

+ 44 - 2
src/views/recruit/enterprise/positionManagement/components/add.vue

@@ -21,6 +21,17 @@
         <v-btn class="half-button" color="primary" :loading="loading" @click="handleSave">{{ $t('common.release') }}</v-btn>
       </div>
     </v-card>
+
+    <!-- 弹窗支付 -->
+    <confirmPaymentDialog
+      v-if="showConfirmPaymentDialog"
+      :cost="payInfo.cost"
+      :spuId="payInfo.spuId"
+      :spuName="payInfo.spuName"
+      :orderType="1"
+      @paySuccess="paySuccess"
+      @close="showConfirmPaymentDialog = false"
+    ></confirmPaymentDialog>
   </div>
 </template>
 
@@ -35,6 +46,7 @@ import jobRequirements from './jobRequirements.vue'
 import Snackbar from '@/plugins/snackbar'
 import { useI18n } from '@/hooks/web/useI18n'
 import { useUserStore } from '@/store/user'
+import { createTradeOrder } from '@/api/position'
 
 // 添加只为之后是否需要额外操作
 const props = defineProps({
@@ -50,6 +62,8 @@ const baseInfoRef = ref()
 const jobRequirementsRef = ref()
 const loading = ref(false)
 const itemData = ref({})
+const showConfirmPaymentDialog = ref(false)
+const payInfo = ref({})
 
 const list = [
   {
@@ -95,26 +109,54 @@ const handleSave = async () => {
       return
     }
   }
-  saveEmit(submitParams)
+  saveEmit()
 }
 
 const saveEmit = async () => {
   loading.value = true
   try {
     const res = await saveJobAdvertised(submitParams)
+    // status:99为待支付职位,弹窗支付
+    if (submitParams?.status && submitParams?.status === '99') {
+      loading.value = true
+      // 金额*100,页面展示/100
+      await createTradeOrder({ spuId: res, spuName: submitParams.name, price: 39900, type: 1 }) // 普通职位type 1
+      loading.value = false
+      payInfo.value = { cost: 39900, spuId: res, spuName: submitParams.name }
+      showConfirmPaymentDialog.value = true
+      Snackbar.warning('当前可发布职位额度不足,请扫码支付')
+      return
+    }
     if (props.afterAdd) {
       await props.afterAdd(res)
       return
     }
-    Snackbar.success(submitParams.id ? t('common.editSuccessMsg') : t('common.publishSuccessMsg'))
+    Snackbar.success(submitParams.id ? t('common.editSuccessMsg') : '发布成功')
     handleCancel()
   } catch (error) {
     console.log('error', error)
+    // 可发布职位额度不足时,将status设为99重新提交
+    if (error === '企业额度已超过') {
+      submitParams.status = '99'
+      saveEmit()
+    }
   } finally {
     loading.value = false
   }
 }
 
+const paySuccess = async () => {
+  showConfirmPaymentDialog.value = false
+  if (props.afterAdd) {
+    await props.afterAdd(payInfo.value.spuId)
+    payInfo.value = {}
+    return
+  }
+  payInfo.value = {}
+  Snackbar.success(submitParams.id ? t('common.editSuccessMsg') : '发布成功')
+  handleCancel()
+}
+
 // 获取编辑的职位详情
 const getPositionDetail = async (id) => {
   const data = await getJobDetails({ id })

+ 73 - 15
src/views/recruit/enterprise/positionManagement/components/item.vue

@@ -1,14 +1,14 @@
 <template>
   <div>
     <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">
         <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="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>
       </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 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;">
@@ -16,14 +16,14 @@
       </div>
       <div class="d-flex justify-space-between" style="padding: 10px 20px;">
         <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>
           </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-else class="position-name">{{ val.name }}</span>
           </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 class="lines" v-if="val.areaName && val.eduName"></span>
             <span>{{ val.eduName }}</span>
@@ -36,6 +36,9 @@
             <span>{{ val.positionName }}</span>
           </div>
         </div>
+        <div class="d-flex align-center">
+          <v-chip v-if="(val.status-0) === 99" color="warning" label>职位待发布,支付后成功后自动发布</v-chip>
+        </div>
       </div>
       <div class="bottom pa-5 d-flex justify-space-between align-center">
         <div>
@@ -52,10 +55,13 @@
               <span class="lines"></span>
               <span class="cursor-pointer actions" @click="handleAction(0, '', val)">{{ $t('common.close') }}</span>
               <span class="lines"></span>
+              <span class="cursor-pointer actions" @click="handleEdit(val)">{{ $t('common.edit') }}</span>
             </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>
+            <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 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>  
           </div>
         </div>
@@ -63,6 +69,16 @@
     </div>
   </div>
 
+  <confirmPaymentDialog
+    v-if="showConfirmPaymentDialog"
+    :cost="39900"
+    :spuId="spuId"
+    :spuName="spuName"
+    :orderType="1"
+    @paySuccess="paySuccess"
+    @close="showConfirmPaymentDialog = false"
+  ></confirmPaymentDialog>
+
   <Loading :visible="loading"></Loading>
 
   <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 { useI18n } from '@/hooks/web/useI18n'
 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 { useUserStore } from '@/store/user'
+import Confirm from '@/plugins/confirm'
+import { getUnpaidOrder } from '@/api/common'
 
 const store = useUserStore()
 const { t } = useI18n()
@@ -107,7 +125,7 @@ const formItem = ref({
       label: '到期时间 *',
       labelWidth: 110,
       teleported: true,
-      disabledDates: true
+      disabledDate: true
     }
   ]
 })
@@ -158,16 +176,56 @@ let baseInfo = ref(JSON.parse(localStorage.getItem('entBaseInfo')) || {})
 store.$subscribe((mutation, state) => {
   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 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]
   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
   try {
     await apiList[index](ids)

+ 12 - 5
src/views/recruit/enterprise/positionManagement/index.vue

@@ -29,7 +29,7 @@
         </v-tabs>
         <v-window v-model="tab" class="mt-1">
           <v-window-item v-for="val in tabList" :key="val.value" :value="val.value">
-            <PositionItem v-if="items.length" :tab="val.value" :items="items" @refresh="getPositionList"></PositionItem>
+            <PositionItem v-if="items.length" :tab="val.value" :items="items" @refresh="handleRefresh"></PositionItem>
           </v-window-item>
         </v-window>
         <Empty v-if="!items.length" :message="loading ? '加载中...' : tipsText" :elevation="false"></Empty>
@@ -78,8 +78,9 @@ const exportLoading = ref(false)
 const uploadFile = ref()
 const tab = ref(1)
 const tabList = [
-  { label: t('position.recruitmentInProgress'), value: 1 },
-  { label: t('position.closed'), value: 2 },
+  { label: '待支付', value: 0, status: 99 },
+  { label: t('position.recruitmentInProgress'), value: 1, status: 0 },
+  { label: t('position.closed'), value: 2, status: 1 },
   { label: t('position.expiredPosition'), value: 3 }
 ]
 let baseInfo = ref(JSON.parse(localStorage.getItem('entBaseInfo')) || {})
@@ -102,7 +103,7 @@ const handleAdd = async () => {
   if (!data || !data.length) return Snackbar.warning('没有该操作权限,请联系平台管理员升级后再试')
   // 新增职位时查询是否有可发布职位数
   await store.getEnterpriseInfo(true)
-  if (baseInfo.value?.entitlement.publishJobCount <= 0) return Snackbar.warning('可发布职位数不足,请联系平台管理员')
+  // if (baseInfo.value?.entitlement.publishJobCount <= 0) return Snackbar.warning('可发布职位数不足,请联系平台管理员')
   router.push('/recruit/enterprise/position/add')
   await store.getEnterpriseUserAccountInfo()
 }
@@ -114,7 +115,7 @@ const getPositionList = async () => {
   items.value = []; total.value = 0
   loading.value = true
   if (tab.value !== 3) {
-    query.value.status = tab.value === 1 ? 0 : (tab.value === 2 ? 1 : null)
+    query.value.status = tabList[tab.value].status
     query.value.hasExpiredData = false
   } else {
     query.value.hasExpiredData = true
@@ -130,6 +131,12 @@ const getPositionList = async () => {
 }
 getPositionList()
 
+const handleRefresh = (index) => {
+  query.pageNo = 1
+  if (index) tab.value = index
+  getPositionList()
+}
+
 // 职位列表导出
 const handleExport = async () => {
   exportLoading.value = true

+ 3 - 3
src/views/recruit/enterprise/tradingOrder/components/trading.vue

@@ -3,10 +3,10 @@
   <div class="white-bgc pa-3 pt-3">
     <v-tabs v-model="tab" align-tabs="start" color="primary" bg-color="#f7f8fa">
       <v-tab value="tab_transaction">{{ '交易订单' }}</v-tab>
-      <v-tab value="tab_recharge">{{ '充值订单' }}</v-tab>
+      <!-- <v-tab value="tab_recharge">{{ '充值订单' }}</v-tab> -->
     </v-tabs>
     <Transaction v-if="tab === 'tab_transaction'"></Transaction>
-    <Recharge v-if="tab === 'tab_recharge'"></Recharge>
+    <!-- <Recharge v-if="tab === 'tab_recharge'"></Recharge> -->
   </div>
 </template>
 
@@ -14,7 +14,7 @@
 defineOptions({name: 'enterprise-memberCenter-tradingOrder'})
 import { ref } from 'vue'
 import Transaction from './trading/transaction.vue'
-import Recharge from './trading/recharge.vue'
+// import Recharge from './trading/recharge.vue'
 
 const tab = ref('tab_transaction')
 </script>

+ 12 - 2
src/views/recruit/enterprise/tradingOrder/components/trading/transaction.vue

@@ -38,7 +38,7 @@
     ></CtTable>
     <div class="text-start ml-5 mt-5">
       开票金额:
-      <span class="color-error font-weight-bold font-size-20">{{ (order.price / 10.0).toFixed(2) }}</span>
+      <span class="color-error font-weight-bold font-size-20">{{ order.price / 100 }}</span>
     </div>
   </CtDialog>
@@ -52,12 +52,22 @@ import { getEnterpriseTradeOrderPage } from '@/api/recruit/enterprise/member/poi
 import { getInvoiceListPage, createInvoice, getInvoiceTitlePage } from '@/api/recruit/enterprise/member/invoice'
 import Snackbar from '@/plugins/snackbar'
 import { getBlob, saveAs } from '@/utils'
+import { getDict } from '@/hooks/web/useDictionaries'
+
+// 支付渠道
+const channelData = ref([])
+const getPayChannelCode = async () => {
+  const { data } = await getDict('pay_channel_code')
+  channelData.value = data
+}
+getPayChannelCode()
 
 const dataList = ref([])
 const headers = [
   { title: '商品名称', key: 'spuName', sortable: false },
-  { title: '使用点数', key: 'price', sortable: false },
+  { title: '使用点数', key: 'price', sortable: false, value: item => item.price / 100 },
   { title: '是否已支付', key: 'payStatus', sortable: false, value: item => item.payStatus ? '已支付' : '未支付' },
+  { title: '支付渠道', key: 'payChannelCode', value: item => channelData.value.find(e => e.value === item.payChannelCode)?.label, sortable: false },
   { title: '支付订单编号', key: 'payOrderId', sortable: false },
   { title: '订单支付时间', key: 'payTime', value: item =>  timesTampChange(item.payTime), sortable: false },
   { title: '开票状态', key: 'id', sortable: false },

+ 5 - 5
src/views/recruit/enterprise/tradingOrder/index.vue

@@ -1,21 +1,21 @@
 <!-- 购买套餐 -->
 <template>
   <v-card class="card-box pa-3" style="min-width: 1100px;">
-    <div class="tabsBox">
+    <!-- <div class="tabsBox">
       <v-tabs v-model="tab" align-tabs="center" color="var(--v-primary-base)">
         <v-tab :value="0" class="font-weight-bold font-size-18">充值</v-tab>
         <v-tab :value="1" class="font-weight-bold font-size-18">交易</v-tab>
       </v-tabs>
-    </div>
-    <PointsAndBalance v-if="tab === 0"></PointsAndBalance>
-    <trading v-else></trading>
+    </div> -->
+    <!-- <PointsAndBalance v-if="tab === 0"></PointsAndBalance> -->
+    <trading></trading>
   </v-card>
 </template>
 
 <script setup>
 defineOptions({name: 'enterprise-memberCenter-myAccount'})
 import { ref } from 'vue'
-import PointsAndBalance from './components/pointsAndBalance.vue'
+// import PointsAndBalance from './components/pointsAndBalance.vue'
 import trading from './components/trading.vue'
 
 const tab = ref(0)

+ 2 - 2
src/views/recruit/personal/position/components/details.vue

@@ -25,8 +25,8 @@
       <div class="d-flex justify-space-between mb-5">
         <div>
           <div>
-            <v-chip v-if="info.hire && info.hirePrice && info.hirePrice > 0" label color="primary">赏金:{{ commissionCalculation(info.hirePrice, 1) }}元</v-chip>
-            <v-chip v-if="info.hire && info.hirePoint && info.hirePoint > 0" label color="primary" class="ml-1">积分:{{ commissionCalculation(info.hirePoint, 1) }}点</v-chip>
+            <v-chip v-if="info.hire && info.hirePrice && info.hirePrice > 0" label color="primary">赏金:{{ commissionCalculation(info.hirePrice / 100, 1) }}元</v-chip>
+            <v-chip v-if="info.hire && info.hirePoint && info.hirePoint > 0" label color="primary" class="ml-1">积分:{{ commissionCalculation(info.hirePoint / 100, 1) }}点</v-chip>
           </div>
           <div v-if="info?.hire" class="font-size-14 mt-3 color-error">推荐好友入职成功即可获得赏金</div>
         </div>

+ 2 - 2
src/views/recruit/personal/shareJob/index.vue

@@ -35,8 +35,8 @@
           <svg-icon v-if="info.hire" name="pin" size="50"></svg-icon>
         </div>
         <div v-if="info.hire" class="mt-3">
-          <v-chip v-if="info.hirePrice" label color="primary">赏金:{{ commissionCalculation(info.hirePrice, 1) }}元</v-chip>
-          <v-chip v-if="info.hirePoint" label color="primary">积分:{{ commissionCalculation(info.hirePoint, 1) }}点</v-chip>
+          <v-chip v-if="info.hirePrice" label color="primary">赏金:{{ commissionCalculation(info.hirePrice / 100, 1) }}元</v-chip>
+          <v-chip v-if="info.hirePoint" label color="primary">积分:{{ commissionCalculation(info.hirePoint / 100, 1) }}点</v-chip>
         </div>
         <v-divider class="mt-3"></v-divider>
         <div class="mt-3 mb-1 f-w-600">{{ $t('position.jobResponsibilities') }}</div>