lex-xin преди 3 години
родител
ревизия
0e95ba3ee3

+ 7 - 0
src/views/organManager/api.js

@@ -46,4 +46,11 @@ export const checkStudentPhone = (data) => request2({
   method: 'get',
   params: data,
   hideLoading: true
+})
+
+// 获取机构协议列表
+export const tenantContractRecordList = (data) => request2({
+  url: '/api-web/tenantContractRecord/queryPage',
+  method: 'post',
+  data
 })

+ 21 - 5
src/views/organManager/index.vue

@@ -123,7 +123,7 @@
                 type="text"
                 >缴费二维码</el-button>
               <el-button
-                v-if="scope.row.contractUrl"
+                v-if="scope.row.payState === 1"
                  @click="onDownloadProtocol(scope.row)"
                 type="text"
                 >下载协议</el-button>
@@ -142,12 +142,17 @@
       </div>
     </div>
     <qr-code v-model="qrcodeStatus" title="机构缴费二维码" :codeUrl="codeUrl" />
+
+    <el-dialog title="协议下载" :visible.sync="protocolVisible" width="650px">
+      <protocol-model v-if="protocolVisible" @close="protocolVisible = false" :protocolVersions="protocolVersions" />
+    </el-dialog>
   </div>
 </template>
 <script>
 import pagination from "@/components/Pagination/index";
 import QrCode from "@/components/QrCode/index";
-import { tenantInfoQueryPage , tenantInfoOpsState } from "./api";
+import protocolModel from '@/views/studentManager/modals/protocolModel';
+import { tenantInfoQueryPage , tenantInfoOpsState, tenantContractRecordList } from "./api";
 import { getTimes } from "@/utils";
 import { vaildTeachingUrl } from "@/utils/validate";
 const initSearch = {
@@ -158,7 +163,7 @@ const initSearch = {
   createdName: null,
 };
 export default {
-  components: { pagination, QrCode },
+  components: { pagination, QrCode, protocolModel },
   data() {
     return {
       tableList: [],
@@ -172,6 +177,8 @@ export default {
       searchForm: { ...initSearch },
       qrcodeStatus: false,
       codeUrl: null,
+      protocolVisible: false,
+      protocolVersions: [],
     };
   },
   mounted() {
@@ -201,8 +208,17 @@ export default {
       this.searchForm = { ...initSearch };
       this.search();
     },
-    onDownloadProtocol(item) {
-      window.location.href = item.url;
+    async onDownloadProtocol(item) {
+      try {
+        const res = await tenantContractRecordList({ tenantId: item.id })
+        console.log(res)
+        this.protocolVersions = res.data?.rows || [];
+        this.protocolVisible = true;
+      } catch(e) {
+        //
+        console.log(e)
+      }
+      // window.location.href = item.url;
     },
     onQrCode(row) {
       // 生成报名二维码

+ 0 - 0
src/views/studentManager/modals/js.js


+ 60 - 0
src/views/studentManager/modals/protocolModel.vue

@@ -0,0 +1,60 @@
+<template>
+  <div>
+    <el-table
+      style="width: 100%"
+      :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+      :data="protocolVersions"
+    >
+      <el-table-column align="center" prop="studentId" label="协议名称">
+        <template slot-scope="scope">
+          <span>{{scope.row.contractName || name}} {{ scope.row.version ? 'v' + scope.row.version : null }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="签署时间" prop="createTime">
+      </el-table-column>
+      <el-table-column align="center" width="150px" label="操作">
+        <template slot-scope="scope">
+          <div>
+            <el-button type="text" @click="onDownloadProtocol(scope.row)"
+              >下载</el-button
+            >
+          </div>
+        </template>
+      </el-table-column>
+    </el-table>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="$listeners.close()">取 消</el-button>
+    </span>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'protocolModel',
+  props: {
+    name: {
+      type: String,
+      default: '产品与服务协议'
+    },
+    protocolVersions: {
+      type: [Array, Object],
+      default() {
+        return []
+      }
+    }
+  },
+  methods: {
+    onDownloadProtocol(item) {
+      window.location.href = item.url;
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+.dialog-footer {
+  display: block;
+  text-align: right;
+  margin-top: 20px;
+}
+</style>

+ 3 - 53
src/views/studentManager/studentList.vue

@@ -845,44 +845,7 @@
     </el-dialog>
 
     <el-dialog title="协议下载" :visible.sync="protocolVisible" width="650px">
-      <div v-if="protocolVisible">
-        <!-- <el-alert
-          title="点击下载"
-          :closable="false"
-          type="info">
-        </el-alert>
-        <p style="font-size: 14px; color: var(--color-primary); line-height: 1.5; padding: 8px 16px; cursor: pointer;" v-for="item in protocolVersions" :key="item.id" @click="onDownloadProtocol(item)">
-          产品与服务协议{{ item.version == 2 ? "(含课程)" : "(含系统)" }}
-        </p> -->
-        <el-table
-          style="width: 100%"
-          :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
-          :data="protocolVersions"
-        >
-          <el-table-column align="center" prop="studentId" label="协议名称">
-            <template slot-scope="scope">
-              <!-- {{ formatProtocol(scope.row.version) }} -->
-              <span
-                v-html="`产品与服务协议${formatProtocol(scope.row.version)}`"
-              ></span>
-            </template>
-          </el-table-column>
-          <el-table-column align="center" label="签署时间" prop="createTime">
-          </el-table-column>
-          <el-table-column align="center" width="150px" label="操作">
-            <template slot-scope="scope">
-              <div>
-                <el-button type="text" @click="onDownloadProtocol(scope.row)"
-                  >下载</el-button
-                >
-              </div>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="protocolVisible = false">取 消</el-button>
-      </span>
+      <protocol-model v-if="protocolVisible" @close="protocolVisible = false" :protocolVersions="protocolVersions" />
     </el-dialog>
 
     <el-dialog
@@ -906,6 +869,7 @@
 </template>
 <script>
 import pagination from "@/components/Pagination/index";
+import protocolModel from '@/views/studentManager/modals/protocolModel';
 import {
   queryStudentList,
   getStudentInfoByPhone,
@@ -925,7 +889,7 @@ import load from "@/utils/loading";
 import createMember from "./modals/createMember";
 export default {
   name: "studentManagerList",
-  components: { pagination, qrCode, createMember },
+  components: { pagination, qrCode, createMember, protocolModel },
   data() {
     return {
       studentVisible: false,
@@ -1065,17 +1029,6 @@ export default {
       this.qrcodeStatus = true;
       this.qrcodeUrl = vaildStudentUrl() + `/#/queryStudentPer?tenantId=`+ this.tenantId;
     },
-    formatProtocol(version) {
-      let str = "(含课程)";
-      if (version == 3) {
-        str = "(含系统)";
-      } else if (version == 4) {
-        str = "(含团练宝)";
-      } else if (version == 5) {
-        str = "(含团练宝<sup>+</sup>)";
-      }
-      return str;
-    },
     getList() {
       let params = {...this.searchForm};
       params.rows = this.pageInfo.limit;
@@ -1414,9 +1367,6 @@ export default {
         }
       });
     },
-    onDownloadProtocol(item) {
-      window.location.href = item.url;
-    },
     checkDate(dateStr) {
       let dayjs = this.$helpers.dayjs;
       let nowDate = new Date().getTime();

+ 9 - 0
src/views/teacherManager/teacherList.vue

@@ -291,6 +291,12 @@
                   >修改密码</el-button
                 >
               </auth>
+
+              <el-button
+                v-if="scope.row.contractUrl"
+                @click="onDownloadProtocol(scope.row)"
+                type="text"
+                >下载协议</el-button>
               <!--  -->
             </template>
           </el-table-column>
@@ -487,6 +493,9 @@ export default {
         "是否确认导出老师列表?"
       );
     },
+    onDownloadProtocol(item) {
+      window.location.href = item.contractUrl;
+    },
     getList() {
       let params = {...this.searchForm};
       // params.organId = this.organId