lex-xin 3 yıl önce
ebeveyn
işleme
d1b8d9147f

BIN
public/systemMaintain/bg.png


+ 127 - 12
public/systemMaintain/index.html

@@ -1,29 +1,144 @@
 <!DOCTYPE html>
 <html lang="en">
+
 <head>
   <meta charset="UTF-8">
   <link rel="icon" href="./favicon.ico" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>管乐迷</title>
   <style>
-    #loading{
-      position: fixed;
-      left: 50%;
-      top: 50%;
+    .wscn-http404-container {
       transform: translate(-50%, -50%);
-      visibility: hidden;
+      position: absolute;
+      top: 40%;
+      left: 50%;
+    }
+
+    .wscn-http404 {
+      position: relative;
+      width: 1000px;
+      padding: 0 50px;
+      overflow: hidden;
+    }
+
+    .pic-404 {
+      position: relative;
+      float: left;
+      width: 475px;
+      overflow: hidden;
+    }
+
+    .pic-404__parent {
+      width: 100%;
+      width: 475px;
+      height: 430px;
+    }
+
+    .pic-404__child {
+      position: absolute;
+      width: 475px;
+      height: 430px;
+    }
+
+
+    .bullshit {
+      position: relative;
+      float: left;
+      width: 365px;
+      padding: 120px 0 30px;
+      margin-left: 100px;
+      overflow: hidden;
+    }
+
+    .bullshit__oops {
+      font-size: 32px;
+      font-weight: bold;
+      line-height: 40px;
+      color: #000;
+      opacity: 0;
+      margin-bottom: 20px;
+      animation-name: slideUp;
+      animation-duration: 0.5s;
+      animation-fill-mode: forwards;
+    }
+
+    .bullshit__headline {
+      font-size: 20px;
+      line-height: 24px;
+      color: #222;
+      font-weight: bold;
+      opacity: 0;
+      margin-bottom: 10px;
+      animation-name: slideUp;
+      animation-duration: 0.5s;
+      animation-delay: 0.1s;
+      animation-fill-mode: forwards;
+    }
+
+    .bullshit__info {
+      font-size: 18px;
+      line-height: 31px;
+      color: #666;
+      opacity: 0;
+      margin-bottom: 30px;
+      animation-name: slideUp;
+      animation-duration: 0.5s;
+      animation-delay: 0.2s;
+      animation-fill-mode: forwards;
+    }
+
+    .bullshit__return-home {
+      display: block;
+      float: left;
+      width: 110px;
+      height: 36px;
+      background: #1482f0;
+      border-radius: 100px;
+      text-align: center;
+      color: #ffffff;
       opacity: 0;
-      transition: opacity .3s;
+      font-size: 14px;
+      line-height: 36px;
+      cursor: pointer;
+      animation-name: slideUp;
+      animation-duration: 0.5s;
+      animation-delay: 0.3s;
+      animation-fill-mode: forwards;
     }
-    #loading.show {
-      visibility: visible;
-      opacity: 1;
+
+    @keyframes slideUp {
+      0% {
+        transform: translateY(60px);
+        opacity: 0;
+      }
+
+      100% {
+        transform: translateY(0);
+        opacity: 1;
+      }
     }
+
   </style>
 </head>
+
 <body>
-  <div id="app"></div>
-  <img id="loading" class="show" src="./loading.svg" alt="loading"/>
-  系统维护中
+  <div class="wscn-http404-container">
+    <div class="wscn-http404">
+      <div class="pic-404">
+        <img class="pic-404__parent" src="./bg.png" alt="bg">
+      </div>
+      <div class="bullshit">
+        <div class="bullshit__oops">系统升级中</div>
+        <div class="bullshit__info">我们正在对系统进行升级,升级期间暂时无法访问。预计结束时间:2022年2月10日 22:00
+          给您带来的不便,敬请谅解!</div>
+        <!-- <a href=""
+           class="bullshit__return-home">返回首页</a> -->
+      </div>
+    </div>
+  </div>
+  <!-- <div id="app"></div>
+  <img id="loading" class="show" src="./bg.png" alt="loading"/>
+  系统维护中 -->
 </body>
+
 </html>

+ 0 - 17
public/systemMaintain/loading.svg

@@ -1,17 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin:auto;display:block;" width="200px" height="200px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
-<path transform="translate(30,130)" fill="#e15b64" d="M6.999-2.173c-0.21-1.843-1.216-3.542-2.21-5.061C4.291-7.995,3.814-8.771,3.242-9.477 c-0.389-0.479-0.799-0.955-0.985-1.554c-0.13-0.42,0.033-1.539-0.704-1.467c-0.359,0.035-0.418,0.337-0.471,0.621 c-0.072,0.38,0,0.842,0,1.227c0,4.1,0,8.199,0,12.299c0,1.247,0,2.495,0,3.742c-2.884-1.873-8.377,1.23-8.197,4.705 c0.091,1.754,1.807,2.481,3.362,2.395c1.974-0.108,3.983-1.249,5.113-2.868c1-1.434,0.769-3.163,0.769-4.822 c0-2.398,0-4.797,0-7.195c0-1.72,0-3.439,0-5.159c1.769,2.454,4.472,4.668,4.002,8.037C6.038,1.149,5.681,1.832,5.665,2.494 C5.639,3.53,6.145,2.799,6.343,2.349C6.99,0.875,7.253-0.575,6.999-2.173z">
-  <animateTransform attributeName="transform" type="translate" keyTimes="0;0;0.2;0.4;1" values="30 130;30 130;30 50;30 130;30 130;" keySplines="0 0 1 1;0 0.5 0.5 1;0.5 0 1 0.5;0 0 1 1" calcMode="spline" dur="1.7857142857142856s" repeatCount="indefinite" begin="-0.8928571428571428s"></animateTransform>
-</path>
-<path transform="translate(70,20)" fill="#f47e60" d="M6.999-2.173c-0.21-1.843-1.216-3.542-2.21-5.061C4.291-7.995,3.814-8.771,3.242-9.477 c-0.389-0.479-0.799-0.955-0.985-1.554c-0.13-0.42,0.033-1.539-0.704-1.467c-0.359,0.035-0.418,0.337-0.471,0.621 c-0.072,0.38,0,0.842,0,1.227c0,4.1,0,8.199,0,12.299c0,1.247,0,2.495,0,3.742c-2.884-1.873-8.377,1.23-8.197,4.705 c0.091,1.754,1.807,2.481,3.362,2.395c1.974-0.108,3.983-1.249,5.113-2.868c1-1.434,0.769-3.163,0.769-4.822 c0-2.398,0-4.797,0-7.195c0-1.72,0-3.439,0-5.159c1.769,2.454,4.472,4.668,4.002,8.037C6.038,1.149,5.681,1.832,5.665,2.494 C5.639,3.53,6.145,2.799,6.343,2.349C6.99,0.875,7.253-0.575,6.999-2.173z">
-  <animateTransform attributeName="transform" type="translate" keyTimes="0;0.1;0.4;0.7;1" values="70 130;70 130;70 20;70 130;70 130;" keySplines="0 0 1 1;0 0.5 0.5 1;0.5 0 1 0.5;0 0 1 1" calcMode="spline" dur="1.7857142857142856s" repeatCount="indefinite" begin="-0.8928571428571428s"></animateTransform>
-</path>
-<path transform="translate(40,60)" fill="#f8b26a" d="M10.988-11.314c-0.201-0.914-2.865,0.152-3.31,0.255c-2.865,0.661-5.73,1.322-8.594,1.983 C-1.873-8.855-2.84-8.658-3.791-8.413c-0.481,0.124-0.664,0.217-0.719,0.77c-0.18,1.819,0,3.786,0,5.621c0,2.663,0,5.325,0,7.988 c-2.146-1.278-5.411,0.577-6.269,2.683c-1.074,2.636,1.925,3.462,3.907,2.736c1.954-0.715,3.253-2.269,3.343-4.333 c0.046-1.037,0-2.087,0-3.125c0-1.638,0-3.276,0-4.914c0-0.673,0-1.346,0-2.019c0-0.215-0.116-0.848,0-1.036 c0.17-0.277,1.196-0.348,1.535-0.427c1.425-0.329,2.849-0.657,4.274-0.986c2.579-0.595,5.158-1.19,7.737-1.786 c0,3.284,0,6.569,0,9.853c-1.64-0.977-3.949-0.013-5.2,1.179c-0.958,0.913-1.87,2.579-0.84,3.778 c1.198,1.393,3.567,0.71,4.866-0.135C10.164,6.578,10.936,5.347,11,3.788c0.148-3.605,0-7.245,0-10.853c0-0.415,0-0.829,0-1.244 C11-9.247,11.189-10.396,10.988-11.314z">
-  <animateTransform attributeName="transform" type="translate" keyTimes="0;0.3;0.6;0.9;1" values="40 130;40 130;40 60;40 130;40 130;" keySplines="0 0 1 1;0 0.5 0.5 1;0.5 0 1 0.5;0 0 1 1" calcMode="spline" dur="1.7857142857142856s" repeatCount="indefinite" begin="-0.8928571428571428s"></animateTransform>
-</path>
-<path transform="translate(60,130)" fill="#e15b64" d="M6.999-2.173c-0.21-1.843-1.216-3.542-2.21-5.061C4.291-7.995,3.814-8.771,3.242-9.477 c-0.389-0.479-0.799-0.955-0.985-1.554c-0.13-0.42,0.033-1.539-0.704-1.467c-0.359,0.035-0.418,0.337-0.471,0.621 c-0.072,0.38,0,0.842,0,1.227c0,4.1,0,8.199,0,12.299c0,1.247,0,2.495,0,3.742c-2.884-1.873-8.377,1.23-8.197,4.705 c0.091,1.754,1.807,2.481,3.362,2.395c1.974-0.108,3.983-1.249,5.113-2.868c1-1.434,0.769-3.163,0.769-4.822 c0-2.398,0-4.797,0-7.195c0-1.72,0-3.439,0-5.159c1.769,2.454,4.472,4.668,4.002,8.037C6.038,1.149,5.681,1.832,5.665,2.494 C5.639,3.53,6.145,2.799,6.343,2.349C6.99,0.875,7.253-0.575,6.999-2.173z">
-  <animateTransform attributeName="transform" type="translate" keyTimes="0;0.5;0.75;1;1" values="60 130;60 130;60 70;60 130;60 130;" keySplines="0 0 1 1;0 0.5 0.5 1;0.5 0 1 0.5;0 0 1 1" calcMode="spline" dur="1.7857142857142856s" repeatCount="indefinite" begin="-0.8928571428571428s"></animateTransform>
-</path>
-<path transform="translate(50,130)" fill="#abbd81" d="M10.988-11.314c-0.201-0.914-2.865,0.152-3.31,0.255c-2.865,0.661-5.73,1.322-8.594,1.983 C-1.873-8.855-2.84-8.658-3.791-8.413c-0.481,0.124-0.664,0.217-0.719,0.77c-0.18,1.819,0,3.786,0,5.621c0,2.663,0,5.325,0,7.988 c-2.146-1.278-5.411,0.577-6.269,2.683c-1.074,2.636,1.925,3.462,3.907,2.736c1.954-0.715,3.253-2.269,3.343-4.333 c0.046-1.037,0-2.087,0-3.125c0-1.638,0-3.276,0-4.914c0-0.673,0-1.346,0-2.019c0-0.215-0.116-0.848,0-1.036 c0.17-0.277,1.196-0.348,1.535-0.427c1.425-0.329,2.849-0.657,4.274-0.986c2.579-0.595,5.158-1.19,7.737-1.786 c0,3.284,0,6.569,0,9.853c-1.64-0.977-3.949-0.013-5.2,1.179c-0.958,0.913-1.87,2.579-0.84,3.778 c1.198,1.393,3.567,0.71,4.866-0.135C10.164,6.578,10.936,5.347,11,3.788c0.148-3.605,0-7.245,0-10.853c0-0.415,0-0.829,0-1.244 C11-9.247,11.189-10.396,10.988-11.314z">
-  <animateTransform attributeName="transform" type="translate" keyTimes="0;0;0.4;0.8;1" values="50 130;50 130;50 20;50 130;50 130;" keySplines="0 0 1 1;0 0.5 0.5 1;0.5 0 1 0.5;0 0 1 1" calcMode="spline" dur="1.7857142857142856s" repeatCount="indefinite" begin="0s"></animateTransform>
-</path>
-</svg>

BIN
src/assets/404_images/permission_bg.png


+ 5 - 1
src/styles/iconfont/iconfont.css

@@ -1,6 +1,6 @@
 @font-face {
   font-family: "iconfont"; /* Project id  */
-  src: url('iconfont.ttf?t=1642679515371') format('truetype');
+  src: url('iconfont.ttf?t=1644398529497') format('truetype');
 }
 
 .iconfont {
@@ -411,3 +411,7 @@
   content: "\e67f";
 }
 
+.icon-jigouxieyiguanli:before {
+  content: "\e680";
+}
+

BIN
src/styles/iconfont/iconfont.ttf


+ 37 - 34
src/views/noPermission.vue

@@ -1,46 +1,48 @@
 <template>
-  <div class="wscn-http404-container">
-    <div class="wscn-http404">
-      <div class="pic-404">
-        <img class="pic-404__parent"
-             src="@/assets/404_images/404.png"
-             alt="404">
-        <img class="pic-404__child left"
-             src="@/assets/404_images/404_cloud.png"
-             alt="404">
-        <img class="pic-404__child mid"
-             src="@/assets/404_images/404_cloud.png"
-             alt="404">
-        <img class="pic-404__child right"
-             src="@/assets/404_images/404_cloud.png"
-             alt="404">
-      </div>
-      <div class="bullshit">
-        <div class="bullshit__oops">OOPS!</div>
-        <!-- <div class="bullshit__info">All rights reserved
+  <div style="background: #fff;height: 100%;">
+    <div class="wscn-http404-container">
+      <div class="wscn-http404">
+        <div class="pic-404">
+          <img
+            class="pic-404__parent"
+            src="@/assets/404_images/permission_bg.png"
+            alt="permission"
+          />
+        </div>
+        <div class="bullshit">
+          <div class="bullshit__oops">暂无权限</div>
+          <!-- <div class="bullshit__info">All rights reserved
           <a style="color:#20a0ff"
              href="https://wallstreetcn.com"
              target="_blank"> </a>
         </div> -->
-        <div class="bullshit__headline">{{ message }}</div>
-        <div class="bullshit__info">请检查您输入的网址是否正确,或者点击链接继续浏览</div>
-        <a href=""
-           class="bullshit__return-home">返回首页</a>
+          <div class="bullshit__info">
+            您的账号尚未配置角色权限,<br />请联系机构管理员配置角色权限
+          </div>
+          <!-- <a href="" class="bullshit__return-home">切换账号</a> -->
+          <el-button type="primary" @click="onChange">切换账号</el-button>
+        </div>
       </div>
     </div>
   </div>
 </template>
 
 <script>
-
 export default {
-  name: 'Page404',
+  name: "Page404",
   computed: {
-    message () {
-      return '很抱歉,你访问的页面不存在'
+    message() {
+      return "很抱歉,你访问的页面不存在";
+    }
+  },
+  methods: {
+    onChange() {
+      this.$store.dispatch('user/resetToken').then(() => {
+        location.reload()
+      })
     }
   }
-}
+};
 </script>
 
 <style lang="scss" scoped>
@@ -169,14 +171,15 @@ export default {
   .bullshit {
     position: relative;
     float: left;
-    width: 300px;
-    padding: 30px 0;
+    width: 365px;
+    padding: 50px 0 30px;
+    margin-left: 70px;
     overflow: hidden;
     &__oops {
       font-size: 32px;
       font-weight: bold;
       line-height: 40px;
-      color: #1482f0;
+      color: #000;
       opacity: 0;
       margin-bottom: 20px;
       animation-name: slideUp;
@@ -196,9 +199,9 @@ export default {
       animation-fill-mode: forwards;
     }
     &__info {
-      font-size: 13px;
-      line-height: 21px;
-      color: grey;
+      font-size: 18px;
+      line-height: 31px;
+      color: #666666;
       opacity: 0;
       margin-bottom: 30px;
       animation-name: slideUp;

+ 8 - 0
src/views/organManager/index.vue

@@ -122,6 +122,11 @@
                 @click="onQrCode(scope.row)"
                 type="text"
                 >缴费二维码</el-button>
+              <el-button
+                v-if="scope.row.contractUrl"
+                 @click="onDownloadProtocol(scope.row)"
+                type="text"
+                >下载协议</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -196,6 +201,9 @@ export default {
       this.searchForm = { ...initSearch };
       this.search();
     },
+    onDownloadProtocol(item) {
+      window.location.href = item.url;
+    },
     onQrCode(row) {
       // 生成报名二维码
       this.qrcodeStatus = true;

+ 7 - 0
src/views/teamDetail/teamList.vue

@@ -280,6 +280,13 @@
               </div>
             </template>
           </el-table-column>
+          <el-table-column align="center" width="100px" label="收费标准">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.chargeStandard | moneyFormat(true) }}
+              </div>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             width="220px"

+ 26 - 0
src/views/tenantSetting/api.js

@@ -22,4 +22,30 @@ export const tenantCloudCourseRecord = (data) => request2({
   url: '/api-web/tenantCloudCourseRecord/queryPage',
   method: 'post',
   data,
+})
+
+export const tenantContractTemplateAdd = (data) => request2({
+  url: '/api-web/tenantContractTemplate/add',
+  requestType: 'form',
+  method: 'post',
+  data
+})
+
+export const tenantContractTemplateList = (data) => request2({
+  url: '/api-web/tenantContractTemplate/list',
+  method: 'get',
+  params: data,
+})
+
+export const tenantContractTemplateQuery = (data) => request2({
+  url: '/api-web/tenantContractTemplate/query',
+  method: 'get',
+  params: data,
+})
+
+export const updateStatus = (data) => request2({
+  url: '/api-web/tenantContractTemplate/updateStatus',
+  method: 'post',
+  requestType: 'form',
+  data,
 })

+ 25 - 11
src/views/tenantSetting/model/addProtocol.vue

@@ -20,7 +20,7 @@
       </el-form-item>
       <el-form-item
         label="协议号"
-        prop="code"
+        prop="contractNo"
         :rules="[
           {
             required: true,
@@ -30,14 +30,14 @@
         ]"
       >
         <el-input
-          v-model="form.code"
+          v-model="form.contractNo"
           placeholder="请输入协议号"
           style="width: 100%"
         ></el-input>
       </el-form-item>
       <el-form-item
         label="上传协议"
-        prop="url"
+        prop="origanalFileUrl"
         :rules="[
           {
             required: true,
@@ -51,7 +51,7 @@
           buttonText="点击上传协议"
           accept=".doc, .docx"
           @inputFile="readFileInputEventAsArrayBuffer"
-          v-model="form.url"
+          v-model="form.origanalFileUrl"
         />
       </el-form-item>
     </el-form>
@@ -68,7 +68,8 @@
     >
       <previewProtocol
         @close="lookVisible = false"
-        :form="form"
+        @onSubmit="onSubmit"
+        :fileContent="fileContent"
         v-if="lookVisible"
       />
     </el-dialog>
@@ -76,6 +77,7 @@
 </template>
 
 <script>
+import { tenantContractTemplateAdd } from '../api'
 import previewProtocol from "@/views/tenantSetting/model/previewProtocol";
 import mammoth from "mammoth";
 import { headHtml, footerHtml } from './protocolTemplate'
@@ -85,17 +87,29 @@ export default {
     return {
       form: {
         name: null,
-        code: null,
-        url: null,
-        fileSubmit: null, // 后台需要html内容
-        fileContent: null, // 文件内容
+        contractNo: null,
+        origanalFileUrl: null,
+        status: 0, // 默认不启用
+        contractTemplateContent: null, // 后台需要html内容
       },
+      fileContent: null, // 文件内容
       lookVisible: false
     };
   },
   mounted() {
   },
   methods: {
+    async onSubmit() {
+      try {
+        await tenantContractTemplateAdd(this.form)
+        this.$message.success('创建成功')
+        this.lookVisible = false
+        this.$listeners.close()
+        this.$listeners.getList()
+      } catch(e) {
+        //
+      }
+    },
     addSubmit() {
       this.$refs['form'].validate((_) => {
         if(_) {
@@ -108,8 +122,8 @@ export default {
       let html = result.value;
       let newHTML = html.replace(//g, '')
       .replace('<h1>', '<h2 style="font-size: 16px;font-weight: bold; padding-top: 15px;">')
-      this.form.fileSubmit = headHtml(false) + newHTML + footerHtml(false)
-      this.form.fileContent = headHtml() + newHTML + footerHtml()
+      this.form.contractTemplateContent = newHTML
+      this.fileContent = headHtml() + newHTML + footerHtml()
     },
     readFileInputEventAsArrayBuffer(file) {
       let reader = new FileReader();

+ 14 - 5
src/views/tenantSetting/model/previewProtocol.vue

@@ -1,10 +1,10 @@
 <template>
   <div>
     <div class="scroll">
-      <div v-html="form.fileContent"></div>
+      <div v-html="fileContent"></div>
     </div>
     <span slot="footer" class="dialog-footer">
-      <el-button @click="$listeners.close()">取 消</el-button>
+      <el-button v-if="!look" @click="$listeners.close()">取 消</el-button>
       <el-button type="primary" @click="addSubmit">确 认</el-button>
     </span>
   </div>
@@ -13,8 +13,13 @@
 <script>
 export default {
   props: {
-    form: {
-      type: Object
+    fileContent: {
+      type: String,
+      default: ''
+    },
+    look: {
+      type: Boolean,
+      default: false
     }
   },
   data() {
@@ -25,7 +30,11 @@ export default {
   },
   methods: {
     addSubmit() {
-      console.log(this.form)
+      if(this.look) {
+        this.$listeners.close()
+      } else {
+        this.$emit("onSubmit")
+      }
     }
   }
 }

+ 2 - 2
src/views/tenantSetting/model/protocolTemplate.js

@@ -108,7 +108,7 @@ export function headHtml (isPreview = true, title) {
         </div>
         <div>(本协议中“乙方“指学员及家长;”乙方学员“指购买甲方产品或服务的学员;”乙方家长“仅指乙方学员的法定监护人。)</div>`
     } else {
-        return template + '<h1>《产品与服务协议》</h1>甲方:${compayName} <br/><div style="display: flex;">乙方:<div style="flex: 1 auto;"><div class="iInfo"><span>家长姓名:${studentInfo.realName!}</span><span>电话:${studentInfo.phone!}</span></div><#if studentInfo.certificateType == "IDENTITY"><div class="iInfo"><span>身份证号:${studentInfo.idCardNo!}</span></div></#if><div class="iInfo"><span>学生姓名:${studentInfo.username!}</span></div><#if studentInfo.grade?default("")?trim?length gt 1><div class="iInfo"><span>所在班级:${studentInfo.grade!} ${studentInfo.clazz!}</span></div></#if><#if studentInfo.subject.name?default("")?trim?length gt 1><div class="iInfo"><span>所在声部:${studentInfo.subject.name!}</span></div></#if></div></div><div>(本协议中“乙方“指学员及家长;”乙方学员“指购买甲方产品或服务的学员;”乙方家长“仅指乙方学员的法定监护人。)</div>'
+        return template + '<h1>《产品与服务协议》</h1>甲方:${companyName} <br/><div style="display: flex;">乙方:<div style="flex: 1 auto;"><div class="iInfo"><span>家长姓名:${studentInfo.realName!}</span><span>电话:${studentInfo.phone!}</span></div><#if studentInfo.certificateType == "IDENTITY"><div class="iInfo"><span>身份证号:${studentInfo.idCardNo!}</span></div></#if><div class="iInfo"><span>学生姓名:${studentInfo.username!}</span></div><#if studentInfo.grade?default("")?trim?length gt 1><div class="iInfo"><span>所在班级:${studentInfo.grade!} ${studentInfo.clazz!}</span></div></#if><#if studentInfo.subject.name?default("")?trim?length gt 1><div class="iInfo"><span>所在声部:${studentInfo.subject.name!}</span></div></#if></div></div><div>(本协议中“乙方“指学员及家长;”乙方学员“指购买甲方产品或服务的学员;”乙方家长“仅指乙方学员的法定监护人。)</div>'
     }
 }
 
@@ -129,6 +129,6 @@ export function footerHtml(isPreview = true) {
         </body>
         </html>`
     } else {
-        return '<div class="signature"><#if isShowVisualSeal><div class="sign">甲方签章:${compayName}<img class="cachet" src="${sealPicture!}" alt="" /><span>日期:${.now?string("yyyy年MM月dd日")}</span></div><div class="sign">乙方签章:${studentInfo.realName!}<span>日期:${.now?string("yyyy年MM月dd日")} </span></div><#else><div class="sign">甲方签章:${compayName}<span>日期:${.now?string("yyyy年MM月dd日")}</span></div><div class="sign">乙方签章:<span>日期:${.now?string("yyyy年MM月dd日")} </span></div></#if></div></body></html>'
+        return '<div class="signature"><#if isShowVisualSeal><div class="sign">甲方签章:${companyName}<img class="cachet" src="${sealPicture!}" alt="" /><span>日期:${.now?string("yyyy年MM月dd日")}</span></div><div class="sign">乙方签章:${studentInfo.realName!}<span>日期:${.now?string("yyyy年MM月dd日")} </span></div><#else><div class="sign">甲方签章:${companyName}<span>日期:${.now?string("yyyy年MM月dd日")}</span></div><div class="sign">乙方签章:<span>日期:${.now?string("yyyy年MM月dd日")} </span></div></#if></div></body></html>'
     }
 }

+ 53 - 27
src/views/tenantSetting/tenantInfoProtocol.vue

@@ -43,38 +43,30 @@
           :data="tableList"
           :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
         >
-          <el-table-column align="center" label="协议编号" prop="transNo">
+          <el-table-column align="center" label="协议编号" prop="id">
           </el-table-column>
-          <el-table-column align="center" label="协议号" prop="orderNo">
+          <el-table-column align="center" label="协议号" prop="contractNo">
           </el-table-column>
-          <el-table-column align="center" label="协议名称" prop="createdTime">
+          <el-table-column align="center" label="协议名称" prop="name">
           </el-table-column>
-          <el-table-column align="center" label="上传时间" prop="tenantName">
+          <el-table-column align="center" label="上传时间" prop="updateTime">
           </el-table-column>
-          <el-table-column align="center" label="操作人">
-            <template slot-scope="scope">
-              {{ scope.row.actualAmount | moneyFormat }}
-            </template>
+          <el-table-column align="center" label="操作人" prop="latestOperator">
           </el-table-column>
           <el-table-column align="center" label="状态">
             <template slot-scope="scope">
-              {{ scope.row.orderState | tenantOrderStatus }}
+              {{ scope.row.status ? '启用' : '停用' }}
             </template>
           </el-table-column>
           <el-table-column align="center" label="操作">
             <template slot-scope="scope">
               <el-button
-                @click="openService(scope.row)"
-                v-permission="'tenantInfo/info'"
+                @click="openService(scope.row, 'look')"
                 type="text"
                 >查看</el-button>
                 <el-button
-                @click="openService(scope.row)"
-                v-permission="'tenantInfo/info'"
-                type="text"
-                >修改</el-button>
-                <el-button
-                @click="openService(scope.row)"
+                @click="openService(scope.row, 'open')"
+                v-if="!scope.row.status"
                 v-permission="'tenantInfo/info'"
                 type="text"
                 >启用</el-button>
@@ -94,22 +86,36 @@
     </div>
 
     <el-dialog title="新增协议" :visible.sync="protocolVisible" width="560px">
-      <addProtocol v-if="protocolVisible" @close="protocolVisible = false"  />
+      <addProtocol v-if="protocolVisible" @close="protocolVisible = false" @getList="getList"  />
+    </el-dialog>
+    <el-dialog
+      title="查看协议"
+      :visible.sync="lookVisible"
+      width="415px"
+      append-to-body
+    >
+      <previewProtocol
+        @close="lookVisible = false"
+        :look="true"
+        :fileContent="fileContent"
+        v-if="lookVisible"
+      />
     </el-dialog>
   </div>
 </template>
 <script>
+import { headHtml, footerHtml } from './model/protocolTemplate'
 import pagination from "@/components/Pagination/index";
-import { tenantOrderRecordQueryPage } from "./api";
+import previewProtocol from "@/views/tenantSetting/model/previewProtocol";
+import { tenantContractTemplateList, updateStatus } from "./api";
 import { tenantStatus } from '@/constant'
 import { dealStatus } from "@/utils/searchArray";
 import addProtocol from './model/addProtocol'
-import { getTimes } from "@/utils";
 const initSearch = {
   status: null
 };
 export default {
-  components: { pagination, addProtocol },
+  components: { pagination, addProtocol, previewProtocol },
   data() {
     const baseTenantId = sessionStorage.getItem('baseTenantId')
     return {
@@ -125,6 +131,8 @@ export default {
         total: 0, // 总条数
         page_size: [10, 20, 40, 50], // 选择限制显示条数
       },
+      lookVisible: false,
+      fileContent: null,
       searchForm: { ...initSearch },
     };
   },
@@ -135,14 +143,14 @@ export default {
     async getList() {
       try {
         let { createTimer, ...reset } = this.searchForm;
-        const res = await tenantOrderRecordQueryPage({
+        const res = await tenantContractTemplateList({
           ...reset,
-          ...getTimes(createTimer, ["startDate", "endDate"], "YYYY-MM-DD HH:mm:ss"),
           page: this.pageInfo.page,
           rows: this.pageInfo.limit,
         });
-        this.pageInfo.total = res.total;
-        this.tableList = res.rows;
+        console.log(res)
+        this.pageInfo.total = res.data.total;
+        this.tableList = res.data.rows;
       } catch (e) {}
     },
     search() {
@@ -155,8 +163,26 @@ export default {
       this.searchForm = { ...initSearch };
       this.search();
     },
-    openService(row) {
-      this.protocolVisible = true
+    async openService(row, type) {
+      if(type == 'look') {
+        this.fileContent = headHtml() + row.contractTemplateContent + footerHtml()
+        this.lookVisible = true
+      } else if(type == 'open') {
+        try {
+          this.$confirm(`同一时间协议只能启用一个,启用后,已启用的协议将自动停用?`, "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          }).then( async() => {
+            await updateStatus({ id: row.id })
+            this.$message.success('启用成功')
+            this.getList()
+          });
+        } catch(e) {
+          //
+        }
+      }
+      // this.protocolVisible = true
     },
   },
   filters: {