浏览代码

订单新增增加主账号判断调整

qymljy 1 年之前
父节点
当前提交
f90b1a3a4f
共有 3 个文件被更改,包括 80 次插入25 次删除
  1. 34 7
      src/SManagement/user/pay-orders/modules/add.vue
  2. 46 17
      src/components/layout/modules/aside.vue
  3. 0 1
      src/views/homePage/index.vue

+ 34 - 7
src/SManagement/user/pay-orders/modules/add.vue

@@ -213,14 +213,41 @@ export default {
   },
   components:{tableLayout},
   methods:{
-    onShow(){
-      this.dialogVisible = true
+    async onShow(){
+      let params = {
+        "id": 20230908131502,
+        "content":{}
+      }
+      const res = await this.$api.requested(params)
+      console.log(res.data)
+      if (res.data){
+        this.dialogVisible = true
+        this.queryInstructions()
+        this.queryCoupon()
+        this.creatOrder()
+      }else {
+        this.$confirm('您的团队缺少主账号无法使用,请联系客服!', '提示', {
+          confirmButtonText: '确定',
+          showCancelButton:false,
+          showClose:false,
+          type: 'warning'
+        }).then(() => {
+          this.dialogVisible = false
+          this.createNow = false
+          this.amount = 0
+          this.orig_amount = 0
+          this.coupon_amount = 0
+          this.userLeader = ''
+          this.form.remarks = ''
+          this.accountNum = 0
+          this.usAccountNum = 0
+          this.isleader = 0
+        }).catch(() => {
+
+        });
+      }
+
 
-      /*this.queryAccount()*/
-      this.queryInstructions()
-      this.queryCoupon()
-      this.creatOrder()
-      /*this.queryVersion()*/
     },
     /*新建订单*/
     async creatOrder(){

+ 46 - 17
src/components/layout/modules/aside.vue

@@ -25,7 +25,7 @@ export default {
       auth_data:'',
       isneedpay:false,
       dialogVisible:false,
-      usertype:21
+      usertype:21,
     }
   },
   computed: {
@@ -38,24 +38,53 @@ export default {
   methods:{
     handleOpen () {},
     handleClose () {},
-    // 查询应用授权
-    getAuthList () {
-      let active_modules = JSON.parse(sessionStorage.getItem('active_modules'))
-      this.auth_data = active_modules.apps
-      let usertype = JSON.parse(sessionStorage.getItem('active_account'))
-      this.usertype = usertype.usertype
-      console.log(this.usertype,'usertype')
-      if (this.activePath) {
-        this.activePath = active_modules.apps[0].path
-      } else {
-        if (this.auth_data[0].isneedpay){
-          this.activePath = '/mask'
-          this.$router.replace({path:'/mask',meta:{title: '无权限'}})
-          this.open()
-        }else {
-          this.activePath = this.$route.path
+    // 获取应用授权
+    getAuthList (flags) {
+      if (flags === 1) {
+        let active_modules = JSON.parse(sessionStorage.getItem('active_modules'))
+        this.auth_data = active_modules.apps
+        let usertype = JSON.parse(sessionStorage.getItem('active_account'))
+        this.usertype = usertype.usertype
+        if (this.activePath) {
+          this.activePath = active_modules.apps[0].path
+        } else {
+          if (this.auth_data[0].isneedpay){
+            this.activePath = '/mask'
+            this.$router.replace({path:'/mask',meta:{title: '无权限'}})
+            this.open()
+          }else {
+            this.activePath = this.$route.path
+          }
+        }
+      }else {
+        let active_modules = JSON.parse(sessionStorage.getItem('active_modules'))
+        this.auth_data = active_modules.apps
+        let usertype = JSON.parse(sessionStorage.getItem('active_account'))
+        this.usertype = usertype.usertype
+        if (this.activePath) {
+          this.activePath = active_modules.apps[0].path
+        } else {
+          if (this.auth_data[0].isneedpay){
+            this.query_userauth()
+          }else {
+            this.activePath = this.$route.path
+          }
         }
       }
+
+    },
+    // 查询应用授权
+    async query_userauth () {
+      const res = await this.$api.requested({
+        "classname": "system.payorder.payorder",
+        "method": "query_userauth",
+        "content": {
+        }
+      })
+      this.auth_data = res.data
+      sessionStorage.setItem('module_info', JSON.stringify(this.auth_data))
+      this.getAuthList(1)
+      /*this.$router.push('/main')*/
     },
     clickNow(val){
       this.isneedpay = val.isneedpay

+ 0 - 1
src/views/homePage/index.vue

@@ -193,7 +193,6 @@ export default {
     this.flag = JSON.parse(sessionStorage.getItem('flag'))
     this.userids[0] =  this.type[0].userid
     this.getDataOverview()
-    console.log(this.flag,'flag')
     if (this.flag != '1' && this.flag != '2'){
       this.queryAccount()
     }