Browse Source

零星收费添加乐团选项

lex-xin 4 years ago
parent
commit
b426b24c76

+ 2 - 1
src/views/businessManager/shopManager/shopList.vue

@@ -6,6 +6,7 @@
     <div class="m-core">
       <el-button class="btn-primary" @click="onShopOperation('create')" v-permission="'/shopOperation'">添加</el-button>
       <el-upload
+        v-permission="'/import/goods'"
         style="display: inline-block;"
         action="/api-web/import/goods"
         :show-file-list="false"
@@ -16,7 +17,7 @@
         :on-success="handleSuccess">
         <el-button class="btn-primary">商品导入</el-button>
       </el-upload>
-      <el-button class="btn-primary" @click="onDownload">下载模板</el-button>
+      <el-button class="btn-primary" @click="onDownload" v-permission="'/import/downloadTemplate'">下载模板</el-button>
       <!-- 搜索类型 -->
       <!-- <el-form :inline="true"
                class="searchForm"

+ 24 - 24
src/views/sporadicManager/sporadicList.vue

@@ -221,7 +221,7 @@
                     :disabled='!isNew'
                     v-model.trim="maskForm.code"></el-input>
           <el-button type='danger'
-                     @click="onCreateQRCode">二维码</el-button>
+                     @click="qrcodeStatus = true">二维码</el-button>
         </el-form-item>
         <el-form-item label="收费详情"
                       prop="desc">
@@ -292,7 +292,7 @@
         <el-form-item label="所属乐团"
                       prop="musicGroupId">
           <el-select v-model.trim="maskForm1.musicGroupId"
-                     :disabled='!isNew1 || maskMusicList1.length <= 0'
+                     :disabled='!isNew1'
                      clearable
                      filterable>
             <el-option v-for='(item,index) in maskMusicList1'
@@ -307,7 +307,7 @@
                     :disabled='!isNew1'
                     v-model.trim="maskForm1.code"></el-input>
           <el-button type='danger'
-                     @click="onCreateQRCode">二维码</el-button>
+                     @click="qrcodeStatus = true">二维码</el-button>
         </el-form-item>
         <el-form-item label="收费详情"
                       prop="desc">
@@ -334,7 +334,7 @@
                width="300px">
       <div class="right-code">
         <h2 class="title">缴费链接</h2>
-        <vue-qr :text="qrCodeUrl" style="width: 100%" margin="0"></vue-qr>
+        <vue-qr :text="qrCodeUrl" style="width: 100%" :margin="0"></vue-qr>
         <!-- <div id="qrcode"
              class="qrcode code"
              ref="qrCodeUrl"></div> -->
@@ -444,7 +444,7 @@ export default {
       maskMusicList1: [],
       maskRules1: {
         organId: [{ required: true, message: '请选择分部', trigger: 'change' }],
-        musicGroupId: [{ required: true, message: '请选择所属乐团', trigger: 'change' }],
+        // musicGroupId: [{ required: true, message: '请选择所属乐团', trigger: 'change' }],
         type: [{ required: true, message: '请选择收费类型', trigger: 'change' }],
         money: [{ required: true, message: '请输入收费金额', trigger: 'change' }],
         title: [{ required: true, message: '请输入标题名称', trigger: 'change' }],
@@ -534,14 +534,20 @@ export default {
         this.isNew1 = false;
         this.zeroVisible1 = true;
         this.title1 = '查看个人收费'
+        let url = vaildStudentUrl() + `/#/sporadicPay?id=${row.id}&userId=${row.userId}`
+        this.qrCodeUrl = url
+        maskForm.code = url
+        maskForm.studentId = row.userId
+        maskForm.studentName = row.userName
       } else {
         maskForm = this.maskForm
         this.isNew = false;
         this.zeroVisible = true;
         this.title = '查看公用收费'
+        let url = vaildStudentUrl() + `/#/sporadicLogin?id=${row.id}`
+        this.qrCodeUrl = url
+        maskForm.code = url
       }
-
-      maskForm.code = vaildStudentUrl() + `/#/sporadicLogin?id=${this.activeRow.id}`
       maskForm.type = parseInt(row.chargeType)
       maskForm.desc = row.detail
       maskForm.title = row.title
@@ -549,29 +555,26 @@ export default {
       maskForm.money = row.amount
       maskForm.subMoney = row.discountAmount
       maskForm.musicGroupId = row.musicGroupId ? row.musicGroupId : null
-
       if(row.userId) {
-        
-      } else {
-        this.onMusicGroupChange()
-      }
-    },
-    onCreateQRCode () { // 生成报名二维码
-      this.qrcodeStatus = true
-      if (this.activeRow.userId) {
-        this.qrCodeUrl = vaildStudentUrl() + `/#/sporadicPay?id=${this.activeRow.id}&userId=${this.activeRow.userId}`
+        queryUserMusicInfos({ userId: row.userId }).then(studentInfo => {
+          if(studentInfo.code == 200) {
+            this.maskMusicList1 = studentInfo.data
+          }
+        })
       } else {
-        this.qrCodeUrl = vaildStudentUrl() + `/#/sporadicLogin?id=${this.activeRow.id}`
+        this.onMusicGroupChange(true)
       }
     },
-    onMusicGroupChange() {
+    onMusicGroupChange(status) {
       let maskForm = this.maskForm
+      console.log(maskForm)
       if(!maskForm.organId) {
         return
       }
-      maskForm.musicGroupId = null // 重置可能已经选中的乐团
+      if(!status) {
+        maskForm.musicGroupId = null // 重置可能已经选中的乐团
+      }
       queryOrganMusicInfos({ organId: maskForm.organId }).then(res => {
-        console.log(res)
         if(res.code == 200) {
           this.maskMusicList = res.data
         }
@@ -651,9 +654,6 @@ export default {
           }
         }
       })
-
-
-
     },
     removeItem (row) {
       this.$confirm('是否删除该收费', '提示', {