Ver Fonte

付费规则更新

qymljy há 2 anos atrás
pai
commit
7fc9878f22

+ 5 - 2
src/SManagement/user/pay-orders/index.vue

@@ -1,8 +1,8 @@
 <template>
   <div>
     <div class="container normal-panel normal-margin  flex-between">
-      <add @onSuccess="onSuccess" v-if="tool.checkAuth($route.name,'insert')"></add>
-      <payment ref="payment" v-if="tool.checkAuth($route.name,'insert')"></payment>
+      <add @onSuccess="onSuccess" v-if="tool.checkAuth($route.name,'insert')" ref="add"></add>
+      <payment ref="payment" v-if="tool.checkAuth($route.name,'insert')" @closeSuccess="listData(param.content.pageNumber = 1)"></payment>
     </div>
     <div class="container normal-panel">
       <el-input style="width:200px;" placeholder="搜索" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'"
@@ -121,6 +121,9 @@ export default {
   },
   mounted() {
     this.listData()
+    if (this.$route.query.isPay === '1'){
+      this.$refs.add.onShow()
+    }
   },
   created() {
     this.tablecols = this.tool.tabelCol(this.$route.name).payOrdersTable.tablecols

+ 9 - 3
src/SManagement/user/pay-orders/modules/payment.vue

@@ -3,7 +3,8 @@
     <el-dialog
         title="待付费订单"
         :visible.sync="dialogVisible"
-        width="900px">
+        width="900px"
+        @close="onClose">
       <el-row :gutter="20" style="margin-top: -20px">
         <el-col :span="24" >
           <span class="span_title">订单信息</span>
@@ -80,7 +81,7 @@
         </el-col>
       </el-row>
       <span slot="footer" class="dialog-footer ">
-        <el-button style="margin-right: 45% !important;" @click="dialogVisible = false" size="small" class="normal-btn-width">取 消</el-button>
+        <el-button style="margin-right: 45% !important;" @click="onClose" size="small" class="normal-btn-width">取 消</el-button>
       </span>
     </el-dialog>
   </div>
@@ -151,6 +152,11 @@ export default {
       this.code_url = res.data.code_url
     },
 
+    onClose(){
+      this.dialogVisible = false
+      this.$emit('closeSuccess')
+    }
+
   },
   mounted() {
 
@@ -185,4 +191,4 @@ export default {
   .div_span_top{
     margin-top: 20px;
   }
-</style>
+</style>

+ 6 - 6
src/components/layout/index.vue

@@ -109,13 +109,13 @@ export default {
         }
       })
       this.$store.dispatch('setUsershortcuts')
-      
+
       // 若当前删除模块为激活红的模块则返回首页
       let systemmodulename = JSON.parse(sessionStorage.getItem('active_modules')).systemmodulename
       if (item.systemmodulename === systemmodulename) {
         this.$router.replace({path:'/home'})
       }
-      
+
     }
   },
   created () {
@@ -158,7 +158,7 @@ export default {
 }
 .nav-top-item{
   overflow-y: scroll;
-  
+
 }
 
 .item{
@@ -168,7 +168,7 @@ export default {
   margin:0 auto 20px auto;
   cursor: pointer;
   text-align: center;
-  
+
 }
 .item p{
   font-size: 10px;
@@ -182,7 +182,7 @@ export default {
 .item:hover {
   border-radius: 8px;
   background: #095DE0;
-  
+
 }
 .close-shortcut {
   position: absolute;
@@ -233,4 +233,4 @@ export default {
 .nav-top-item::-webkit-scrollbar{
   display:none !important;
 }
-</style>
+</style>

+ 57 - 19
src/components/layout/modules/aside.vue

@@ -10,22 +10,10 @@
         text-color="#666"
         active-text-color="#fff"
         router>
-      <el-menu-item v-for="item in auth_data" :key="item.systemappid" :index="item.path" >
-        <span slot="title" @click="clickNow(item)">{{item.meta.title}}</span>
+      <el-menu-item v-for="item in auth_data" :key="item.systemappid" :index="item.path" @click="clickNow(item)">
+        <span slot="title"  >{{item.meta.title}}</span>
       </el-menu-item>
     </el-menu>
-<!--    <el-dialog
-        title="提示"
-        :visible.sync="dialogVisible"
-
-        width="70%"
-        >
-      <span>这是一段信息</span>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
-      </span>
-    </el-dialog>-->
   </div>
 
 </template>
@@ -58,7 +46,8 @@ export default {
       } else {
         if (this.auth_data[0].isneedpay){
           this.activePath = this.$route.path
-          this.$router.push({path:'/mask',meta:{title: '无权限333'},query:{show:true}})
+          this.$router.push({path:'/mask',meta:{title: '无权限333'}})
+          this.open()
         }else {
           this.activePath = this.$route.path
         }
@@ -66,6 +55,55 @@ export default {
     },
     clickNow(val){
       this.isneedpay = val.isneedpay
+      this.activePath = this.$route.path
+      if (val.isneedpay){
+        this.$router.push({path:'/mask',meta:{title: '无权限333'} })
+        this.open()
+      }
+    },
+    open() {
+      this.$confirm('当前模块未付费,是否付费使用?', '付费提醒', {
+        distinguishCancelAndClose: true,
+        closeOnClickModal:false,
+        confirmButtonText: '付费',
+        cancelButtonText: '提醒付费'
+      })
+      .then(() => {
+        let module = JSON.parse(sessionStorage.getItem('module_info'))
+        let moduleList = []
+        module.forEach(item=>{
+          if (item.systemname === '通用'){
+            moduleList = item
+          }
+        })
+        let apps = []
+         moduleList.modules.forEach(item=>{
+          if (item.systemmodulename === '个人中心'){
+            apps = item
+          }
+        })
+        sessionStorage.setItem('active_modules',JSON.stringify(apps))
+        this.activePath = '/pay_orders'
+        this.$router.replace({path:'/pay_orders',query:{isPay:'1'}})
+        sessionStorage.setItem('currentPath','/pay_orders')
+        let active_modules = JSON.parse(sessionStorage.getItem('active_modules'))
+        this.auth_data = active_modules.apps
+      })
+      .catch(async action => {
+        const res = await this.$api.requested({
+          "classname": "system.payorder.payorder",
+          "method": "sendMessage",
+          "content": {
+            "sys_payorderid": 0
+          },
+        })
+        if (res.code === 1){
+          this.$message({
+            message: '已提醒负责人付费',
+            type: 'success'
+          });
+        }
+      });
     }
   },
 
@@ -73,14 +111,14 @@ export default {
     this.getAuthList()
   },
   watch:{
-    $route(to,from){
+    $route(to,from) {
       if (!to.meta.keeproute) {
-        if (this.isneedpay){
-          this.activePath = this.$route.path
-          this.$router.push({path:'/mask',meta:{title: '无权限333'},query:{show:true}})
+        if (this.isneedpay) {
+          this.activePath = '/pay_orders'
         }else {
           this.activePath = this.$route.path
         }
+
       }
     }
   }

+ 1 - 1
src/router/HManagement.js

@@ -406,7 +406,7 @@ const HManagement = [
     component: () => import(/* webpackChunkName: "about" */ '@/HManagement/clueManage/clue_rule/index.vue')
   }, {
     path: '/mask',
-    name: 'ordercluerule',
+    name: 'payOrders',
     meta: {
       title: '无权限',
       ast_nav: true,

+ 5 - 5
src/utils/tool.js

@@ -6,8 +6,9 @@ export default {
   checkAuth (appname,auth) {
     try {
       // 获取应用数据
+
       let apps = JSON.parse(sessionStorage.getItem('active_modules'))
-      
+
       let module_list =  apps.apps
       // 获取当前应用数据
       let active_modules = module_list.filter(item => {
@@ -21,17 +22,16 @@ export default {
       return _haveAuth
     } catch (error) {
       console.log(error);
-      
       router.replace('/home')
     }
-   
+
   },
 
   // 获取应用表格
   tabelCol (appname) {
     // 获取应用数据
     let apps = JSON.parse(sessionStorage.getItem('active_modules'))
-    
+
     let module_list =  apps.apps
     // 获取当前应用数据
     let active_modules = module_list.filter(item => {
@@ -120,4 +120,4 @@ export default {
       return amountStr.replace(reg, ',')
     }
   },
-} 
+}

+ 9 - 17
src/views/demo/index.vue

@@ -13,33 +13,25 @@ export default {
     }
   },
   methods:{
-    open() {
-     /* this.$confirm('当前模块未付费,是否付费使用?', '付费提醒', {
+   /* open() {
+      this.$confirm('当前模块未付费,是否付费使用?', '付费提醒', {
         distinguishCancelAndClose: true,
         confirmButtonText: '付费',
-        cancelButtonText: '提醒负责人付费'
+        cancelButtonText: '提醒付费'
       })
       .then(() => {
-        this.$message({
-          type: 'info',
-          message: '保存修改'
-        });
+       console.log('立即付费')
       })
       .catch(action => {
-        this.$message({
-          type: 'info',
-          message: action === 'cancel'
-              ? '放弃保存并离开页面'
-              : '停留在当前页面'
-        })
-      });*/
-    }
+        console.log('提醒付费')
+      });
+    }*/
   },
   mounted() {
-    this.show = this.$route.query.show
+    /*this.show = this.$route.query.show
     if (this.show){
       this.open()
-    }
+    }*/
   },
   watch:{
     'show':function (val){