ソースを参照

乐器更换

1
mo 4 年 前
コミット
e5a3b28cf4

+ 4 - 1
src/views/reaplceMusicPlayer/api.js

@@ -47,7 +47,7 @@ export function getInstrumentSoundList (data) {
   })
 }
 
-// 查询详情页列表 replacementInstrumentActivity/queryPage
+// 查询详情页列表
 export function getInstrumentActivityList (data) {
   return request2({
     url: api + `/replacementInstrumentActivity/queryPage`,
@@ -67,3 +67,6 @@ export function updateInstrumentActivity (data) {
   })
 }
 
+// 导出
+
+

+ 57 - 29
src/views/reaplceMusicPlayer/index.vue

@@ -16,13 +16,13 @@
         >
           生成链接
         </div>
-        <div class="newBand" @click="onExport" style="max-width: 150px">
+        <div class="newBand" @click="onExport" style="max-width: 150px" v-if="permission('replacementInstrumentActivity/export')">
           导出
         </div>
       </div>
       <save-form
         :inline="true"
-        ref='searchForm'
+        ref="searchForm"
         :model="searchForm"
         @submit="search"
         @reset="onReSet"
@@ -113,7 +113,7 @@
           <el-table-column align="center" prop="studentId" label="操作">
             <template slot-scope="scope">
               <div>
-                <el-button type="text" @click="lookDetail(scope.row)"
+                <el-button type="text" @click="lookDetail(scope.row)" v-if="permission('replacementInstrumentActivity/queryPage')"
                   >详情</el-button
                 >
                 <el-button
@@ -129,7 +129,10 @@
                 <el-button
                   type="text"
                   @click="openPay(scope.row)"
-                  v-if="!scope.row.openPay&&permission('replacementInstrumentCooperation/openPay')"
+                  v-if="
+                    !scope.row.openPay &&
+                    permission('replacementInstrumentCooperation/openPay')
+                  "
                   >开启缴费</el-button
                 >
               </div>
@@ -165,7 +168,7 @@
       width="1000px"
       v-if="detailVisible"
     >
-      <detail ref="detail" @close="close" :detail="activeRow"/>
+      <detail ref="detail" @close="close" :detail="activeRow" />
       <div slot="footer">
         <el-button type="primary" @click="detailVisible = false"
           >确定</el-button
@@ -173,9 +176,7 @@
       </div>
     </el-dialog>
 
-      <qr-code v-model="qrcodeStatus"
-             :title="qrcodeName"
-             :codeUrl="codeUrl" />
+    <qr-code v-model="qrcodeStatus" :title="qrcodeName" :codeUrl="codeUrl" />
 
     <!-- <el-dialog :title="qrcodeName" :visible.sync="qrcodeStatus" width="300px">
       <div class="left-code">
@@ -200,9 +201,12 @@ import addUrl from "./modals/addUrl";
 import detail from "./modals/detail";
 import load from "@/utils/loading";
 import { getReplacementList, openPayReplacement } from "./api";
+import { Export } from '@/utils/downLoadFile'
+import cleanDeep from 'clean-deep'
+import qs from 'qs';
 import QrCode from "@/components/QrCode/index";
 export default {
-  components: { pagination, addUrl, detail, QrCode, },
+  components: { pagination, addUrl, detail, QrCode },
   data() {
     return {
       searchForm: {
@@ -225,7 +229,7 @@ export default {
       qrcodes: true,
       qrcodeStatus: false,
       qrcodeName: "调查链接",
-      activeRow:null
+      activeRow: null,
     };
   },
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -262,8 +266,8 @@ export default {
       this.getList();
     },
     onReSet() {
-      this.$refs.searchForm.resetFields()
-      this.search()
+      this.$refs.searchForm.resetFields();
+      this.search();
     },
     makeUrl() {
       this.makeUrlVisible = true;
@@ -275,7 +279,25 @@ export default {
       this.makeUrlVisible = false;
       this.detailVisible = false;
     },
-    onExport() {},
+    async onExport() {
+      const { search, ...rest } = this.searchForm;
+      let obj = {
+        ...rest,
+        page: this.rules.page,
+        rows: this.rules.limit,
+        cooperationOrganIdOrName:search
+      };
+      await Export(
+        this,
+        {
+          url: "/api-web/replacementInstrumentActivity/export",
+          fileName: "乐器置换列表.xlsx",
+          method: "post",
+          params: qs.stringify(cleanDeep(obj)),
+        },
+        "您确定导出乐器置换列表"
+      );
+    },
     lookDetail(row) {
       this.activeRow = row;
       this.detailVisible = true;
@@ -298,22 +320,28 @@ export default {
         //     colorLight: "#ffffff",
         //     correctLevel: QRCode.CorrectLevel.H,
         //   });
-          let str;
-          if (name == "调查链接") {
-            let returnUrl = vaildStudentUrl()+`/#/questionnaire?o=${row.organId}&c=${row.cooperationOrganId}`;
-            // console.log(returnUrl)
-            let tempUrl = vaildStudentUrl()+`/#/transfer?returnUrl=${encodeURIComponent(returnUrl)}`
-            str = tempUrl
-          } else if (name == "统计链接") {
-            str = vaildTeachingUrl()+`/#/questionStatistics?o=${row.organId}&c=${row.cooperationOrganId}`;
-          }
-          // vaildTeachingUrl
-          // this.qrcode.makeCode(
-          //   str +
-          //     `/#/questionnaireInfo?o=${row.organId}&c=${row.cooperationOrganId}`
-          // );
-          this.codeUrl =str;
-          this.qrcodes = true;
+        let str;
+        if (name == "调查链接") {
+          let returnUrl =
+            vaildStudentUrl() +
+            `/#/questionnaire?o=${row.organId}&c=${row.cooperationOrganId}`;
+          // console.log(returnUrl)
+          let tempUrl =
+            vaildStudentUrl() +
+            `/#/transfer?returnUrl=${encodeURIComponent(returnUrl)}`;
+          str = tempUrl;
+        } else if (name == "统计链接") {
+          str =
+            vaildTeachingUrl() +
+            `/#/questionStatistics?o=${row.organId}&c=${row.cooperationOrganId}`;
+        }
+        // vaildTeachingUrl
+        // this.qrcode.makeCode(
+        //   str +
+        //     `/#/questionnaireInfo?o=${row.organId}&c=${row.cooperationOrganId}`
+        // );
+        this.codeUrl = str;
+        this.qrcodes = true;
         // }, 100);
       }
     },

+ 7 - 3
src/views/reaplceMusicPlayer/modals/detail.vue

@@ -81,7 +81,7 @@
         <el-table-column align="center" prop="studentId" label="操作">
           <template slot-scope="scope">
             <div>
-              <el-button type="text" @click="resetMusic(scope.row)"
+              <el-button type="text" @click="resetMusic(scope.row)" v-if="permission('replacementInstrumentActivity/update')"
                 >修改</el-button
               >
             </div>
@@ -104,7 +104,7 @@
       append-to-body
       v-if="dialogVisible"
     >
-      <resetInfo @close="close" :detail="resetRow" ref='resetInfo'/>
+      <resetInfo @close="close" :detail="resetRow" ref='resetInfo' @getList='getList'/>
       <div slot="footer">
         <el-button @click="dialogVisible = false">取 消</el-button>
         <el-button type="primary" @click="updateInfo"
@@ -119,6 +119,7 @@ import pagination from "@/components/Pagination/index";
 import resetInfo from "./resetInfo";
 import { getInstrumentSoundList, getInstrumentActivityList } from "../api";
 import ItemVue from "@/layout/components/Sidebar/Item.vue";
+import { permission } from "@/utils/directivePage";
 export default {
   components: { pagination, resetInfo },
   props: ["detail"],
@@ -202,7 +203,10 @@ export default {
     },
     updateInfo(){
       this.$refs.resetInfo.submited()
-    }
+    },
+      permission(str, parent) {
+      return permission(str, parent);
+    },
   },
 };
 </script>

+ 6 - 1
src/views/reaplceMusicPlayer/modals/resetInfo.vue

@@ -44,6 +44,7 @@
 </template>
 <script>
 import { getInstrumentSoundList,updateInstrumentActivity } from "../api";
+
 export default {
   props: ["detail"],
   data() {
@@ -88,6 +89,9 @@ export default {
         if(flag){
           try{
            const res = updateInstrumentActivity({...this.form})
+           this.$message.success('修改成功')
+           this.$emit('close')
+           this.$emit('getList')
           }catch(e){
             console.log(e)
           }
@@ -95,7 +99,8 @@ export default {
         }
       })
       // updateInstrumentActivity
-    }
+    },
+
 
   },
 };