Ver Fonte

付费订单

qymljy há 2 anos atrás
pai
commit
8a0f3777b5

+ 7 - 2
src/DRP/SDrpManagement/payOrders/modules/add.vue

@@ -62,6 +62,11 @@
                         <span v-if="form.sys_site_systempartitionid == index" >{{item}}</span>
                      </span>
                   </template>
+                  <template v-else-if="data.column.dataIndex === 'enterprisename'">
+
+                    <span >{{data.record.enterprisename}}</span>
+
+                  </template>
                   <template v-else-if="data.column.dataIndex === 'operation'">
                     <a-space>
                       <a-checkbox :checked="data.record.checkRow" @change="checkSelect(data.record)" :disabled="userLeader === data.record.userid"></a-checkbox>
@@ -208,7 +213,7 @@
         return {
           accountno:item.accountno,
           name:item.name,
-          agentname:item.agentname,
+          enterprisename:item.enterprisename,
           enddate:item.enddate,
           isleader:item.isleader,
           phonenumber:item.phonenumber,
@@ -221,7 +226,7 @@
         return {
           accountno:item.accountno,
           name:item.name,
-          agentname:item.agentname,
+          enterprisename:item.enterprisename,
           enddate:item.enddate,
           isleader:item.isleader,
           phonenumber:item.phonenumber,

+ 37 - 6
src/DRP/SDrpManagement/productGroup/index.vue

@@ -38,22 +38,33 @@
     <div class="empty" v-if="list.length == 0" >
       <a-empty description="暂无产品" />
     </div>
+
   </div>
 </template>
 <script>
-  
+
 </script>
 
 <script setup>
   import Api from '@/api/api'
   import utils from '@/utils/utils'
   import FieldAndClass from './modules/fieldAndClass.vue'
-  import {ref,onMounted,getCurrentInstance} from 'vue'
+  import {ref, onMounted, getCurrentInstance, watch} from 'vue'
+
+
   import { useRouter } from "vue-router"
+  import {useAuthStore} from "../../../stores/modules/auth";
+  import {storeToRefs} from "pinia";
+
   const componentName = getCurrentInstance()?.type.__name;
   const router = useRouter()
+  const store = useAuthStore()
+
   const list = ref([])
+
   let time = ref(null)
+
+  let { system,mods,act_mods } = storeToRefs(store)
   const span = ref(3)
   const param = ref({
     id:20220926142203,
@@ -101,8 +112,28 @@
     param.value.content.pageSize = pageSize
     listData()
   }
+  const queryMods = ()=>{
+    const time = setInterval(()=>{
+      if (mods.value !== []) {
+        let ap = utils.getAppData('productgroup',mods.value)
+        if (mods.value[0].apps[0].isneedpay){
+          sessionStorage.setItem('app',JSON.stringify(ap))
+          sessionStorage.setItem('isAuthCheck','0')
+          router.push({path:'/noAccess'})
+          clearInterval(time)
+        }else {
+          clearInterval(time)
+          listData()
+        }
+      }else {
+
+      }
+    },500)
+
+  }
   onMounted(()=>{
-    listData()
+    queryMods()
+
   })
 </script>
 <style scoped>
@@ -126,14 +157,14 @@
   height: 22px;
   font-weight: bold;
   color: #34495e !important;
-  
+
 }
 .group-panel{
   padding: 10px;
 }
 .group-panel p{
   color: #666;
-  
+
 }
 .empty{
   display: flex;
@@ -152,4 +183,4 @@
 .descript{
   font-size: .875rem;
 }
-</style>
+</style>

+ 5 - 3
src/components/layout/aside.vue

@@ -37,12 +37,14 @@ let { system,mods } = storeToRefs(store)
 const siteInfo = ref({})
 const collapsed = ref(false)
 const onsystemClick = (item)=>{
+
   act_sys.value = item
   mods.value = item.modules
   router.push({path:item.modules[0].apps[0].path})
 }
 
 const siteData = async ()=>{
+
   const res = await Api.requested({
     classname:'webmanage.site.site',
     method:'querySite',
@@ -108,14 +110,14 @@ watch (()=>system.value,() => {
   font-size: 14px;
   text-align: center;
   line-height: 40px;
-  
+
 }
 .collapsed{
   display: block;
   padding: 10px 20px;
- 
+
 }
 .onSystem .uncollapsed{
  color:#fff;
 }
-</style>
+</style>

+ 27 - 8
src/components/layout/header.vue

@@ -58,7 +58,7 @@
       </template>
     </a-dropdown>
   </a-space>
-
+  <noAccess ref="noAccessRef"></noAccess>
 </div>
 </template>
 
@@ -67,7 +67,7 @@ import Api  from '@/api/api'
 import utils  from '@/utils/utils'
 import less from 'less'
 
-
+import noAccess from '@/template/payOrderTable/noAccess.vue'
 
 import { defineComponent,ref, reactive,onMounted,createVNode ,watch} from 'vue';
 
@@ -79,6 +79,8 @@ import {ConfigProvider, Modal } from 'ant-design-vue';
 import { useRouter } from "vue-router";
 const router = useRouter()
 
+
+
 const actApp = ref({})
 const colorState = ref({})
 let current = ref([]);
@@ -95,15 +97,21 @@ let { system,mods,act_mods } = storeToRefs(store)
 const act_name = ref('')
 const count = ref('')
 const auth = async (data) => {
+
   store.systemAuthData(data)
 
   let app = sessionStorage.getItem('app')
 
+  console.log(app,'app数据')
+
   if (app)
     return false
+
   if (mods.value)
     return sessionStorage.setItem('app',JSON.stringify(mods.value[0].apps[0]))
+
   router.push({path:mods.value[0].apps[0].path})
+
 };
 
 const getAccountList = ()=>{
@@ -122,6 +130,8 @@ const getAccountList = ()=>{
 
 const accountItemClick = (account,bool)=>{
 
+  console.log(bool,'bool')
+
   setSessionStorage(account)
 
   at_account.value = account
@@ -144,21 +154,27 @@ const setSessionStorage = (account)=>{
   act_name.value = `${account.name}-${account.sitename}`
 }
 const routeChange = (app)=>{
+
+
   actApp.value = app
   sessionStorage.setItem('app',JSON.stringify(app))
 
-  if (app.isneedpay){
+ /* if (app.isneedpay){
+
     if (sessionStorage.getItem('isAuthCheck') === '0'){
+
       sessionStorage.setItem('isAuthCheck','1')
       authCheck(app)
     }else {
+
       sessionStorage.setItem('isAuthCheck','0')
       router.push({path:'/noAccess',meta:{APP:app}})
+      noAccessRef.value.visibleShow()
     }
-  }else {
-    sessionStorage.setItem('isAuthCheck','0')
+  }else {*/
+
     router.push({path:app.path,meta:{APP:app}})
-  }
+  /*}*/
 }
 /*二次校验权限*/
 const authCheck = async (app)=>{
@@ -237,7 +253,10 @@ const shoppingCartCount = async ()=>{
   count.value = res.data
 }
 const checkHasApp = (to)=>{
+
+
   let [arr, mode, app] = [[], [], []];
+
   system.value.forEach(e=>{
     mode = mode.concat(...e.modules)
   })
@@ -271,10 +290,10 @@ onMounted(()=>{
   store.hideKeyWords(at_account.value)
   shoppingCartCount()
 })
-watch(() => router.currentRoute.value,(to, from) => {
+/*watch(() => router.currentRoute.value,(to, from) => {
   getAppData()
   checkHasApp(to)
-})
+})*/
 </script>
 <style>
 .header .ant-menu-horizontal {

+ 78 - 2
src/components/layout/index.vue

@@ -39,14 +39,17 @@
       <a-button type="primary" @click="onPay">去付费</a-button>
     </template>
   </a-modal>
+  <noAccess ref="noAccessRef"></noAccess>
 </template>
 <script setup>
 import headTemp from './header.vue';
 import asideTemp from './aside.vue'
 import webSocket from '../webSocket/index.vue'
+import noAccess from '@/template/payOrderTable/noAccess.vue'
 import Api from '@/api/api'
+import utils  from '@/utils/utils'
 import { useRouter } from "vue-router";
-import {onMounted, ref} from "vue";
+import {onMounted, ref, watch} from "vue";
 import {useAuthStore} from "../../stores/modules/auth";
 import {storeToRefs} from "pinia";
 import {notification} from "ant-design-vue";
@@ -59,6 +62,7 @@ const router = useRouter()
 const contentMsg = ref()
 const userids = ref([])
 const name = ref()
+const noAccessRef = ref()
 /*查询到期付费账号*/
 const queryAccount = async ()=>{
   const res = await Api.requested({
@@ -87,7 +91,7 @@ const queryReminder = async ()=>{
       "siteid":JSON.parse(sessionStorage.getItem('active_account')).siteid
     },
   })
-  console.log(res.data)
+
   if (res.data.length > 0){
     visible.value = true
     res.data.forEach((item,index)=>{
@@ -140,9 +144,81 @@ const onRemind = async ()=>{
     })
   }
 }
+const checkHasApp = (to)=>{
+
+  let [arr, mode, app] = [[], [], []];
+
+  system.value.forEach(e=>{
+    mode = mode.concat(...e.modules)
+  })
+
+  mode.forEach(e=>{
+    arr = arr.concat(...e.apps)
+  })
+  let hasApp = arr.some(e=>e.name == to.meta.name)
+
+  if (JSON.parse(sessionStorage.getItem('app')) === null){
+    if (!hasApp){
+      if (to.path === '/noAccess'){
+        noAccessRef.value.visibleShow()
+        return router.replace({name:'noAccess'})
+
+      }else {
+        return router.replace({name:'404'})
+      }
+    }
+  }else {
+    if (JSON.parse(sessionStorage.getItem('app')).isneedpay){
+
+      authCheck()
+
+    }
+  }
+}
+/*二次校验权限*/
+const authCheck = async ()=>{
+
+  let data = {
+    "classname": "sysmanage.develop.userauthforweb.userauth",
+    "method": "query_userauth",
+    "content": {
+      "place": 1,
+      "nocache":true
+    },
+    "systemappid": ""
+  }
+  const res = await Api.requested(data)
+  let ap = utils.getAppData(JSON.parse(sessionStorage.getItem('app')).name,res.data)
+  sessionStorage.setItem('app',JSON.stringify(ap))
+  if (JSON.parse(sessionStorage.getItem('app')).isneedpay){
+    router.push({path:'/noAccess'})
+    noAccessRef.value.visibleShow()
+  }else {
+    router.push({path:JSON.parse(sessionStorage.getItem('app')).path})
+  }
+}
+const getAppData = ()=> {
+
+  let app = mods.value.map(e=>e.apps)
+
+  app.forEach(e=>{
+    e.forEach(a=>{
+      if (router.currentRoute.value.meta.name == a.name) {
+        sessionStorage.setItem('app',JSON.stringify(a))
+      }
+    })
+  })
+
+}
+
 onMounted (()=>{
   usertype.value = JSON.parse(sessionStorage.getItem('active_account')).usertype
   queryAccount()
+
+})
+watch(() => router.currentRoute.value,(to, from) => {
+  getAppData()
+  checkHasApp(to)
 })
 
 </script>

+ 2 - 2
src/stores/modules/auth.js

@@ -40,5 +40,5 @@ export const useAuthStore = defineStore('auth', {
       }
     }
   }
-    
-})
+
+})

+ 14 - 6
src/template/payOrderTable/noAccess.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <a-modal v-model:visible="visible" title="付费提醒" :okText="'付费'" :cancelText="cancelText" @ok="handleOk" @cancel="cancel" :centered="true" :closable="false">
+    <a-modal v-model:visible="visible" title="付费提醒" :okText="'付费'"  :cancelText="cancelText" @ok="handleOk" @cancel="cancel" :centered="true" :closable="false">
       <p>当前模块未付费,请前往付费使用</p>
     </a-modal>
   </div>
@@ -13,22 +13,27 @@
   import {storeToRefs} from "pinia";
   import {useAuthStore} from "../../stores/modules/auth";
   import {notification} from "ant-design-vue";
-  const store = useAuthStore()
-  let { system,mods,act_mods } = storeToRefs(store)
+
   const router = useRouter()
 
   const cancelText = ref()
 
-  const visible = ref(true)
+  const visible = ref(false)
+  const store = useAuthStore()
+  let { system,mods,act_mods } = storeToRefs(store)
   const handleOk = ()=>{
     sessionStorage.setItem('isPay',1)
     mods.value = system.value[1].modules
+    visible.value = false
     router.push({name:'payOrders'})
   }
   const cancel = async ()=>{
+    console.log(cancelText.value)
     if (cancelText.value === '取消'){
+      console.log('付费取消')
       visible.value = false
     }else {
+      console.log('付费提醒')
       const res = await Api.requested({
         "classname": "system.payorder.payorder",
         "method": "sendMessage",
@@ -54,19 +59,22 @@
     }
   }
   const visibleShow = ()=>{
+    console.log('11111提醒')
     console.log(JSON.parse(sessionStorage.getItem('active_account')).usertype)
     if (JSON.parse(sessionStorage.getItem('active_account')).usertype == 22){
       cancelText.value = '提醒付费'
+      visible.value = true
     }else {
       cancelText.value = '取消'
+      visible.value = true
     }
-    visible.value = true
+
   }
   defineExpose({
     visibleShow,
   })
   onMounted(()=>{
-    visibleShow()
+    /*visibleShow()*/
   })
 </script>
 

+ 9 - 7
src/views/login/login.vue

@@ -17,7 +17,7 @@
         <a-form-item
           label="账号"
           name="phonenumber"
-          :rules="[{ required: true, message: '请输入账号' }]" 
+          :rules="[{ required: true, message: '请输入账号' }]"
         >
           <a-input v-model:value="formState.phonenumber" size="large" placeholder="请输入账号"/>
         </a-form-item>
@@ -43,7 +43,7 @@
     </div>
     <div class="login-wrap">
       <div class="top">
-        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="#1890ff" fill-opacity="1" d="M0,288L48,266.7C96,245,192,203,288,202.7C384,203,480,245,576,245.3C672,245,768,203,864,202.7C960,203,1056,245,1152,272C1248,299,1344,309,1392,314.7L1440,320L1440,0L1392,0C1344,0,1248,0,1152,0C1056,0,960,0,864,0C768,0,672,0,576,0C480,0,384,0,288,0C192,0,96,0,48,0L0,0Z"></path></svg>    
+        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="#1890ff" fill-opacity="1" d="M0,288L48,266.7C96,245,192,203,288,202.7C384,203,480,245,576,245.3C672,245,768,203,864,202.7C960,203,1056,245,1152,272C1248,299,1344,309,1392,314.7L1440,320L1440,0L1392,0C1344,0,1248,0,1152,0C1056,0,960,0,864,0C768,0,672,0,576,0C480,0,384,0,288,0C192,0,96,0,48,0L0,0Z"></path></svg>
       </div>
     </div>
     <a-layout-footer class="footer">
@@ -52,7 +52,7 @@
   </div>
 </template>
 <script>
-import { defineComponent, reactive,ref } from 'vue';
+import {defineComponent, reactive, ref, watch} from 'vue';
 import { useRouter } from "vue-router";
 import Api  from '@/api/api'
 import md5 from 'js-md5'
@@ -79,7 +79,7 @@ export default defineComponent({
       loading.value = true
       const res = await Api.loginbyaccount({
         "accountno":formState.phonenumber,
-        "password":md5(formState.password),  
+        "password":md5(formState.password),
         "systemclient": "web"
       })
       if (res.code === 1) {
@@ -90,7 +90,7 @@ export default defineComponent({
         } else {
           message.error('当前账号非经销商类型,无法登陆!')
         }
-        
+
       } else {
         loading.value = false
         message.error(res.msg)
@@ -106,6 +106,8 @@ export default defineComponent({
   mounted () {
     sessionStorage.clear()
   }
+
+
 });
 </script>
 
@@ -171,7 +173,7 @@ export default defineComponent({
   overflow: hidden; /* 隐藏超出部分 */
   max-width: 700px; /* 固定宽度为 200 像素 */
   animation: typingH 5s forwards;
-  
+
   display: inline-block; /* 让行内元素可以自适应宽度、允许换行 */
 }
 
@@ -200,4 +202,4 @@ export default defineComponent({
     font-size: 15px;
   }
 }
-</style>
+</style>