Browse Source

门墩儿新任命权益效验

Xiao_123 4 months ago
parent
commit
da7ba6f60d

+ 9 - 0
src/api/recruit/enterprise/newlyAppointed/index.js

@@ -0,0 +1,9 @@
+import request from '@/config/axios'
+
+// 获得新任命分页
+export const getNewAppointmentsPage = async (params) => {
+	return await request.get({
+		url: '/app-api/menduner/system/new-appointments/page',
+		params
+	})
+}

+ 1 - 1
src/layout/company/navBar.vue

@@ -8,7 +8,7 @@
       <div class="innerBox d-flex justify-space-between">
         <div>
           <div class="nav-logo" style="cursor: pointer;" @click="handleLogoClick">
-            <v-img src="../../assets/logo.png"  aspect-ratio="16/9" cover :width="90" style="height: 40px"></v-img>
+            <v-img src="../../assets/logo.png"  aspect-ratio="16/9" cover :width="97" style="height: 40px"></v-img>
           </div>
         </div>
         

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

@@ -371,22 +371,22 @@ const enterprise = [
       }
     ]
   },
-  {
-    path: '/recruit/enterprise/newlyAppointed',
-    component: Layout,
-    name: 'Newly Appointed',
-    meta: {
-      title: '门墩儿新任命',
-      enName: 'Newly Appointed',
-      icon: 'mdi-new-box'
-    },
-    children: [
-      {
-        path: '/recruit/enterprise/newlyAppointed',
-        show: true,
-        component: () => import('@/views/recruit/enterprise/newlyAppointed/index.vue')
-      }
-    ]
-  },
+  // {
+  //   path: '/recruit/enterprise/newlyAppointed',
+  //   component: Layout,
+  //   name: 'Newly Appointed',
+  //   meta: {
+  //     title: '门墩儿新任命',
+  //     enName: 'Newly Appointed',
+  //     icon: 'mdi-new-box'
+  //   },
+  //   children: [
+  //     {
+  //       path: '/recruit/enterprise/newlyAppointed',
+  //       show: true,
+  //       component: () => import('@/views/recruit/enterprise/newlyAppointed/index.vue')
+  //     }
+  //   ]
+  // },
 ]
 export default enterprise

+ 54 - 6
src/views/recruit/enterprise/newlyAppointed/index.vue

@@ -32,15 +32,32 @@
 	<v-navigation-drawer v-model="showDetail" absolute location="left" rounded temporary width="500" class="pa-5">
 		详情
 	</v-navigation-drawer>
+
+	<!-- 无权限提示 -->
+	<CtDialog :visible="showDialog" :widthType="4" :footer="false" titleClass="text-h6" title="系统提示" @close="showDialog = false">
+		<div class="d-flex align-center flex-column">
+			<div class="color-warning">
+				<p>您没有权限查看门墩儿新任命信息</p>
+				<p>请用微信扫描下方二维码联系门墩儿管理员开通权限</p>
+			</div>
+			<div style="width: 150px; height: 150px;">
+				<v-img src="https://minio.citupro.com/dev/menduner/official-account-code4.jpg"></v-img>
+			</div>
+		</div>
+			
+  </CtDialog>
 </template>
 
 <script setup>
 defineOptions({ name: 'newlyAppointedTable'})
 import { ref } from 'vue'
-// import { timesTampChange } from '@/utils/date'
+import { getNewAppointmentsPage } from '@/api/recruit/enterprise/newlyAppointed'
+import { useUserStore } from '@/store/user'
+// import Snackbar from '@/plugins/snackbar'
 
+const store = useUserStore()
 const loading = ref(false)
-const total = ref(11)
+const total = ref(10)
 const query = ref({
   pageSize: 10,
 	pageNo: 1
@@ -56,7 +73,6 @@ const items = ref([
 	{ id: 8, nameChinese: '吴十', workTerritory: '成都', inaugurationHotel: '成都茂业万豪酒店' },
 	{ id: 9, nameChinese: '郑十一', workTerritory: '重庆', inaugurationHotel: '重庆富力丽思卡尔顿酒店' },
 	{ id: 10, nameChinese: '王十二', workTerritory: '西安', inaugurationHotel: '西安希尔顿酒店' },
-	{ id: 11, nameChinese: '冯十三', workTerritory: '长沙', inaugurationHotel: '长沙万达文华东方酒店' },
 ])
 const headers = [
 	{ title: '宣布日期', key: 'announceTime', sortable: false },
@@ -139,14 +155,40 @@ const formItems = ref({
 		}
   ]
 })
+const showDialog = ref(false)
+
+// 获取企业权益信息
+const info = ref(localStorage.getItem('entBaseInfo') ? JSON.parse(localStorage.getItem('entBaseInfo')) : {})
+store.$subscribe((mutation, state) => {
+  if (Object.keys(state.entBaseInfo).length) info.value = state.entBaseInfo
+})
+
+const getList = async () => {
+	const result = await getNewAppointmentsPage(query.value)
+	items.value = result.list
+	total.value = result.total
+}
 
 // 分页切换
-const handleChangePage = (e) => {
+const handleChangePage = async (e) => {
+	await store.getEnterpriseInfo(true)
+	// 没有权限提示联系门墩儿
+	if (!info.value?.entitlement?.newAppointment) {
+		showDialog.value = true
+		return
+	}
 	query.value.pageNo = e
+	getList()
 }
 
 // 搜索
-const handleSearch = () => {
+const handleSearch = async () => {
+	await store.getEnterpriseInfo(true)
+	// 没有权限提示联系门墩儿
+	if (!info.value?.entitlement?.newAppointment) {
+		showDialog.value = true
+		return
+	}
 	const param = {}
 	formItems.value.options.forEach(item => {
 	  if (item.noParam) return
@@ -163,8 +205,14 @@ const handleReset = () => {
 
 // 查看详情
 const showDetail = ref(false)
-const handleDetail = (item) => {
+const handleDetail = async (item) => {
 	console.log(item, 'detail')
+	await store.getEnterpriseInfo(true)
+	// 没有权限提示联系门墩儿
+	if (!info.value?.entitlement?.newAppointment) {
+		showDialog.value = true
+		return
+	}
 	showDetail.value = true
 }
 </script>