Ver código fonte

ldap对接,9.27前问题修复

fangq 4 anos atrás
pai
commit
2571197d9d

+ 1 - 0
public/index.html

@@ -109,6 +109,7 @@
 <script src="<%= BASE_URL %>cdn/axios/1.0.0/axios.min.js" charset="utf-8"></script>
 <script src="<%= BASE_URL %>cdn/element-ui/2.15.1/index.js" charset="utf-8"></script>
 <script src="<%= BASE_URL %>cdn/avue/2.8.12/avue.min.js" charset="utf-8"></script>
+<script src="https://cdn.bootcss.com/crypto-js/3.1.9-1/crypto-js.min.js"></script>
 </body>
 
 </html>

+ 3 - 2
src/api/bank/autostruct.js

@@ -49,8 +49,9 @@ export const update = (row) => {
 }
 
 export const opStr2opObj = (optionStr) => {
-  optionStr = optionStr.replace(/(s*?{s*?|s*?,s*?)(['"])?([a-zA-Z0-9]+)(['"])?:/g, '$1"$3":').replaceAll('\'', '\"');
-  optionStr = optionStr.replace('&gt;', '>')
+  optionStr = optionStr.replace(/(s*?{s*?|s*?,s*?)(['"])?([a-zA-Z0-9]+)(['"])?:/g, '$1"$3":');
+  optionStr = optionStr.replace(/\'/ig,"\"")
+  optionStr = optionStr.replace(/&gt;/ig,">")
   optionStr = optionStr.replace(/\s*/g, '')
   // str.replace(/\s*/g,"")
   let optionObj = JSON.parse(optionStr, (k,v)=>{

+ 1 - 1
src/api/report/userlog.js

@@ -2,7 +2,7 @@ import request from '@/router/axios';
 
 export const getList = (current, size, params) => {
   return request({
-    url: '/api/bank/userlog/list',
+    url: '/api/bank/userlog/page',
     method: 'get',
     params: {
       ...params,

+ 102 - 0
src/components/common/returns-approve-batch.vue

@@ -0,0 +1,102 @@
+<template>
+  <div>
+    <avue-form :option="option"
+               @submit="submit"
+               v-model="form"
+               ref="form">
+    </avue-form>
+  </div>
+</template>
+
+<script>
+  import {returnsApprove} from "@/api/bank/returns";;
+
+  export default {
+    name: "returns-approve-batch",
+    data(){
+      return {
+        loading: false,
+        form: {},
+        option: {
+          mockBtn: false,
+          submitText: '確認',
+          printBtn: false,
+          emptyBtn: false,
+          column: [
+            {
+              label: "接辦行經辦",
+              prop: "handlingBank",
+              rules: [{
+                required: true,
+                message: "请输入接辦行經辦",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "接辦行覆核",
+              prop: "handlingBankReview",
+              rules: [{
+                required: false,
+                message: "请输入接辦行覆核",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "跟進情況",
+              prop: "handlingStatus",
+              type: "select",
+              dataType: "string",
+              dicUrl: `/api/blade-system/dict/dictionary?code=processing_status`,
+              props: {
+                label: "dictValue",
+                value: "dictKey"
+              },
+              dicFormatter: (res) => {
+                res.data.forEach(item => {item.disabled = item.isSealed == 1;})
+                return res.data;
+              },
+              change: ({value}) => {
+                this.findObject(this.option.column, 'bankRemark').rules[0].required = value == '2'
+              },
+              rules: [{
+                required: false,
+                message: "请输入跟進情況",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "支行備註",
+              prop: "bankRemark",
+              rules: [{
+                required: false,
+                message: "请输入支行備註",
+                trigger: "blur"
+              }]
+            },
+          ]
+        }
+      }
+    },
+    props: {
+      data: {
+        type: Object
+      },
+
+    },
+    mounted() {
+    },
+    methods: {
+      submit(row, index, done, loading){
+        for (let i = 0; i < this.data.length; i++) {
+          let row = this.data[i];
+          returnsApprove(Object.assign(row, this.form)).then(() => {});
+        }
+        this.$emit("close")
+      },
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 4 - 0
src/components/common/returns-comfire.vue

@@ -5,6 +5,7 @@
                :data="data"
                @row-update="infoSubmit"
                @row-del="removeItem"
+               @selection-change="selectionChange"
                v-model="form"
                ref="crud2">
       <template slot="menuLeft">
@@ -257,6 +258,9 @@
       removeItem(row, index){
         this.data.splice(index, 1)
       },
+      selectionChange(list) {
+        this.selectionList = list;
+      },
     }
   }
 </script>

+ 4 - 4
src/components/common/returns-issue.vue

@@ -132,7 +132,7 @@
               prop: "remark",
               disabled: true,
               rules: [{
-                required: true,
+                required: false,
                 message: "请输入備註",
                 trigger: "blur"
               }]
@@ -142,7 +142,7 @@
               prop: "barCode",
               disabled: true,
               rules: [{
-                required: true,
+                required: false,
                 message: "请输入條碼",
                 trigger: "blur"
               }]
@@ -162,7 +162,7 @@
               prop: "handlingBankReview",
               disabled: true,
               rules: [{
-                required: true,
+                required: false,
                 message: "请输入接辦行覆核",
                 trigger: "blur"
               }]
@@ -203,7 +203,7 @@
                 return res.data;
               },
               rules: [{
-                required: true,
+                required: false,
                 message: "请输入跟進情況",
                 trigger: "blur"
               }]

+ 0 - 1
src/page/login/userlogin.vue

@@ -137,7 +137,6 @@
               spinner: "el-icon-loading"
             });
             this.$store.dispatch("LoginByUsername", this.loginForm).then(() => {
-              debugger
               this.$router.push({path: this.tagWel.value});
               loading.close();
             }).catch(() => {

+ 2 - 1
src/store/modules/user.js

@@ -7,6 +7,7 @@ import website from '@/config/website'
 import {loginByUsername, loginBySocial, getUserInfo, logout, refreshToken, getButtons} from '@/api/user'
 import {getTopMenu, getRoutes} from '@/api/system/menu'
 import md5 from 'js-md5'
+import {cyEncryptByDES} from "../../util/util";
 
 
 function addPath(ele, first) {
@@ -48,7 +49,7 @@ const user = {
     //根据用户名登录
     LoginByUsername({commit}, userInfo) {
       return new Promise((resolve, reject) => {
-        loginByUsername(userInfo.tenantId, userInfo.username, md5(userInfo.password), userInfo.type, userInfo.key, userInfo.code).then(res => {
+        loginByUsername(userInfo.tenantId, userInfo.username, cyEncryptByDES(userInfo.password), userInfo.type, userInfo.key, userInfo.code).then(res => {
           const data = res.data;
           if (data.error_description) {
             Message({

+ 26 - 0
src/util/util.js

@@ -365,3 +365,29 @@ export const downloadFileBase64 = (path, name) => {
     }
   };
 }
+
+export const encryptByDES = (message, key) => {
+  var keyHex = CryptoJS.enc.Utf8.parse(key);
+  var encrypted = CryptoJS.DES.encrypt(message, keyHex, {
+    mode: CryptoJS.mode.ECB,
+    padding: CryptoJS.pad.Pkcs7
+  });
+  return encrypted.ciphertext.toString();
+}
+
+export const decryptByDES = (ciphertext, key) => {
+  var keyHex = CryptoJS.enc.Utf8.parse(key);
+  var decrypted = CryptoJS.DES.decrypt({
+    ciphertext: CryptoJS.enc.Hex.parse(ciphertext)
+  }, keyHex, {
+    mode: CryptoJS.mode.ECB,
+    padding: CryptoJS.pad.Pkcs7
+  });
+  var result_value = decrypted.toString(CryptoJS.enc.Utf8);
+  return result_value;
+}
+
+export const cyEncryptByDES = (message) => {
+  let key = "cyzh2020";
+  return encryptByDES(message, key)
+}

+ 13 - 4
src/views/bank/checkwarehouse.vue

@@ -389,7 +389,7 @@
               editDisplay: false,
               rules: [{
                 required: true,
-                message: "请输入查庫人身份證後四位",
+                message: "查庫人員工號或身份證後四位",
                 trigger: "blur"
               }]
             },
@@ -397,7 +397,7 @@
               label: "備註",
               prop: "remark",
               // span: 24,
-              labelWidth: 150,
+              type: 'textarea',
               rules: [{
                 required: false,
                 message: "请输入備註(可簡要補充檢查發現情況)",
@@ -499,13 +499,14 @@
       selectCallback(value){
         this.form.checkPersonNo = value.ehr;
         this.form.checkPersonName = value.name;
-        this.a = 3;
       },
       rowSave(row, done, loading) {
         if (row.checkUnit == 1 && !!row.checkPersonNameOut && !!row.checkPersonNoOut){
           row.checkPersonName = row.checkPersonNameOut;
           row.checkPersonNo = row.checkPersonNoOut;
         }
+       /* row.checkContent = row.checkContent.join();
+        row.checkPurpose = row.checkPurpose.join();*/
         add(row).then(() => {
           this.onLoad(this.page);
           this.$message({
@@ -523,6 +524,8 @@
           row.checkPersonName = row.checkPersonNameOut;
           row.checkPersonNo = row.checkPersonNoOut;
         }
+        /*row.checkContent = row.checkContent.join();
+        row.checkPurpose = row.checkPurpose.join();*/
         update(row).then(() => {
           this.onLoad(this.page);
           this.$message({
@@ -575,6 +578,7 @@
           });
       },
       beforeOpen(done, type) {
+        this.attachForm = {};
         this.attachOption.column[0].disabled = type == 'view';
         if (type === 'add'){
           let userInfo = localStorage.getItem("saber-userInfo");
@@ -604,7 +608,6 @@
         this.onLoad(this.page);
       },
       searchChange(params, done) {
-        debugger
         if (params.checkUnit){
           params.checkUnit = params.checkUnit.join();
         }
@@ -646,6 +649,12 @@
         getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
+
+          data.records.forEach(item => {
+            item.checkPurpose = item.checkPurpose.split(',');
+            item.checkContent = item.checkContent.split(',');
+          })
+
           this.data = data.records;
           this.loading = false;
           this.selectionClear();

+ 1 - 0
src/views/bank/goodsuse.vue

@@ -548,6 +548,7 @@
         getLastByType(this.form.type).then(res => {
           const data = res.data.data;
           let lastBalance = 0;
+          this.form.lastBalance = 0;
 
           if (data && Object.keys(data).length > 0){
             lastBalance = data.balance;

+ 7 - 2
src/views/bank/message.vue

@@ -32,7 +32,7 @@
                    v-if="permission.message_delete"
                    @click="attachBox = true">上 傳
         </el-button>-->
-        <avue-form ref="form" :option="attachOption" v-model="attachForm" :upload-after="uploadAfter" :upload-error="uploadError" :upload-delete="uploadDelete">
+        <avue-form ref="form" :option="attachOption" v-model="attachForm" :upload-after="uploadAfter" :upload-error="uploadError" :upload-delete="uploadDelete" :upload-preview="uploadPreview">
         </avue-form>
 
       </template>
@@ -79,6 +79,7 @@
               // label: '附件上传',
               prop: 'attachFile',
               type: 'upload',
+              disabled: true,
               drag: true,
               loadText: '模板上传中,请稍等',
               span: 24,
@@ -274,7 +275,8 @@
       uploadDelete(column,file) {
         return this.$confirm(`是否确定移除该选项?`);
       },
-
+      uploadPreview(){
+      },
       handleDownload(row) {
         // window.open(`${row.link}`);
         // this.downFile(row.file, row.originalName)
@@ -348,6 +350,9 @@
           });
       },
       beforeOpen(done, type) {
+        // 查看時,把上傳組件設為禁用
+        this.attachForm = {};
+        this.attachOption.column[0].disabled = type == 'view';
         if (["edit", "view"].includes(type)) {
           getDetail(this.form.id).then(res => {
             const data = res.data.data;

+ 8 - 3
src/views/bank/postchange.vue

@@ -197,6 +197,11 @@
               type: "datetime",
               format: "yyyy-MM-dd",
               valueFormat: "yyyy-MM-dd",
+              pickerOptions: {
+                disabledDate(time) {
+                  return time.getTime() < Date.now() - 8.64e7;
+                }
+              },
               rules: [{
                 required: true,
                 message: "请输入生效日期",
@@ -342,7 +347,7 @@
                 prop: "holder1",
                 span: 11,
                 type: "select",
-                multiple: true,
+                // multiple: true,
                 props: {
                   label: "text",
                   value: "ehr"
@@ -811,14 +816,14 @@
                 data.orgNo = data2.orgNo;
                 _this.form = data;
               });
-              getSetting().then((res) => {
+              /*getSetting().then((res) => {
                 let data = res.data.data;
                 if (!!data){
                   _this.form.personId = data.personId;
                   _this.form.personNo = data.personNo;
                   _this.form.personName = data.personName;
                 }
-              });
+              });*/
               _this.option.updateBtnText = '提交';
               _this.option.editTitle = '编辑【網點出納主管及專管員崗位表更記錄表】';
               _this.option.column.forEach(item => {

+ 57 - 2
src/views/bank/returns.vue

@@ -23,6 +23,7 @@
                    size="small"
                    icon="el-icon-delete"
                    plain
+                   :disabled="delBatchBtn"
                    v-if="permission.returns_delete"
                    @click="handleDelete">删 除
         </el-button>
@@ -47,7 +48,10 @@
                    v-if="permission.returns_download"
                    @click="handleDownload">下載
         </el-button>
+        <el-button size="small" :disabled="issueBatchBtn" v-if="permission.returns_issue" @click="issueBatch">批量發佈</el-button>
+        <el-button size="small" :disabled="approveBatchBtn" v-if="permission.returns_approve" @click="approveBatch"><i class="el-icon-check"></i>批量審批</el-button>
       </template>
+
       <template slot="menu" slot-scope="{row, index}">
         <el-button size="small" class="el-button--text" v-if="permission.returns_delete && row.process <= 2" @click="$refs.crud.rowDel(row, index)"><i class="el-icon-delete"></i> 刪 除</el-button>
         <el-button size="small" class="el-button--text" v-if="permission.returns_view" @click="$refs.crud.rowView(row, index)"><i class="el-icon-view"></i> 查 看</el-button>
@@ -81,6 +85,13 @@
       <returns-comfire :data="data2"></returns-comfire>
     </el-dialog>
 
+    <el-dialog title="批量審核"
+               append-to-body
+               :visible.sync="approveBatchVisible"
+               width="70%">
+      <returns-approve-batch :data="this.selectionList" @close="approveBatchVisible = false, onLoad(page)"></returns-approve-batch>
+    </el-dialog>
+
     <el-dialog title="信息審核"
                append-to-body
                :visible.sync="approveVisible"
@@ -100,7 +111,7 @@
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove, returnsSubmit, settingSave, getSetting} from "@/api/bank/returns";
+  import {getList, getDetail, add, update, remove, returnsSubmit, settingSave, getSetting, issue} from "@/api/bank/returns";
   import {mapGetters} from "vuex";
   import {dateFormat} from "../../util/date";
   import ReturnsComfire from "../../components/common/returns-comfire";
@@ -109,9 +120,10 @@
   import ReturnsIssue from "../../components/common/returns-issue";
   import {getDeptTree, getTree} from "@/api/system/dept";
   import {getStandardByCode} from "@/api/bank/handoverstandard";
+  import ReturnsApproveBatch from "../../components/common/returns-approve-batch";
 
   export default {
-    components: {ReturnsIssue, FlowSettings, ReturnsApprove, ReturnsComfire},
+    components: {ReturnsApproveBatch, ReturnsIssue, FlowSettings, ReturnsApprove, ReturnsComfire},
     data() {
       return {
         personId: null,
@@ -120,12 +132,17 @@
         settingVisible: false,
         issueVisible: false,
 
+        delBatchBtn: true,
+        issueBatchBtn: true,
+        approveBatchBtn: true,
+
         form: {},
         approveForm: {},
         query: {},
         loading: true,
         temVisible: false,
         approveVisible: false,
+        approveBatchVisible: false,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -415,6 +432,10 @@
                 trigger: "blur"
               }]
             },
+            {
+              label: "待辦人",
+              prop: 'personNo'
+            },
             {
               label: "進度",
               prop: "process",
@@ -536,6 +557,24 @@
         });
         this.settingVisible = true;
       },
+      issueBatch(){
+        this.$confirm("确定将选择数据發佈?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            for (let i = 0; i < this.selectionList.length; i++) {
+              let row = this.selectionList[i];
+              issue(row).then(() => {})
+            }
+            this.$message.success('批量發佈成功!');
+          })
+
+      },
+      approveBatch(){
+        this.approveBatchVisible = true;
+      },
       approve(row, index){
         this.approveVisible = true;
         this.approveForm = row;
@@ -678,6 +717,22 @@
       },
       selectionChange(list) {
         this.selectionList = list;
+        if (list && list.length > 0){
+          let issueFlag = true, approveFlag = true, delFlag = true;
+          for (let i = 0; i < list.length; i++) {
+            let item = list[i];
+            delFlag = delFlag && item.process <= 2;
+            issueFlag = issueFlag && item.process == 2 && item.personNo == this.userInfo.user_ehr;
+            approveFlag = approveFlag && item.process == 3;
+          }
+          this.delBatchBtn = !delFlag;
+          this.issueBatchBtn = !issueFlag;
+          this.approveBatchBtn = !approveFlag;
+        }else{
+          this.delBatchBtn = true;
+          this.issueBatchBtn = true;
+          this.approveBatchBtn = true;
+        }
       },
       selectionClear() {
         this.selectionList = [];

+ 24 - 7
src/views/bank/tellertrunk.vue

@@ -198,6 +198,10 @@
                 label: "dictValue",
                 value: "dictKey",
               },
+              dicFormatter: (res) => {
+                res.data.forEach(item => {item.disabled = item.isSealed == 1;})
+                return res.data;
+              },
               rules: [{
                 required: true,
                 message: "请输入檢查內容",
@@ -240,6 +244,10 @@
                 label: "dictValue",
                 value: "dictKey",
               },
+              dicFormatter: (res) => {
+                res.data.forEach(item => {item.disabled = item.isSealed == 1;})
+                return res.data;
+              },
               change: ({value, column}) => {
                 if (!value) return;
 
@@ -253,12 +261,12 @@
                 $no.display = value == '1';
                 $no.disabled = value == '1';
                 if (!this.form.checkResult) return;
-                let $remark = this.findObject(this.option.column, 'remark');
+                /*let $remark = this.findObject(this.option.column, 'remark');
                 if (value == '1' && this.form.checkResult == '1'){
                   $remark.rules[0].required = false;
                 }else{
                   $remark.rules[0].required = true;
-                }
+                }*/
               },
               rules: [{
                 required: true,
@@ -295,6 +303,10 @@
                 label: "dictValue",
                 value: "dictKey",
               },
+              dicFormatter: (res) => {
+                res.data.forEach(item => {item.disabled = item.isSealed == 1;})
+                return res.data;
+              },
               rules: [{
                 required: true,
                 message: "请输入檢查類型",
@@ -310,15 +322,19 @@
                 label: "dictValue",
                 value: "dictKey",
               },
+              dicFormatter: (res) => {
+                res.data.forEach(item => {item.disabled = item.isSealed == 1;})
+                return res.data;
+              },
               tip: "不能為空值;如選擇〝賬實不符〞需要在備註欄解釋原因",
               change: ({value, column}) => {
-                if (!this.form.checkUnit || !value) return;
+               /* if (!this.form.checkUnit || !value) return;
                 let $remark = this.findObject(this.option.column, 'remark');
                 if (this.form.checkUnit == '1' && value == '1'){
                   $remark.rules[0].required = false;
                 }else{
                   $remark.rules[0].required = true;
-                }
+                }*/
               },
               rules: [{
                 required: true,
@@ -361,7 +377,7 @@
               }]
             },
             {
-              label: "查庫人身份證後四位",
+              label: "查庫人員工號或身份證後四位",
               prop: "checkPersonNoOut",
               hide: true,
               viewDisplay: false,
@@ -369,7 +385,7 @@
               editDisplay: false,
               rules: [{
                 required: true,
-                message: "请输入查庫人身份證後四位",
+                message: "查庫人員工號或身份證後四位",
                 trigger: "blur"
               }]
             },
@@ -410,7 +426,7 @@
               formslot: true,
               hide: true,
               rules: [{
-                required: true,
+                required: false,
                 message: "请上傳附件",
                 trigger: "blur"
               }]
@@ -573,6 +589,7 @@
           });
       },
       beforeOpen(done, type) {
+        this.attachForm = {};
         this.attachOption.column[0].disabled = type == 'view';
         if (type === 'add'){
           let userInfo = localStorage.getItem("saber-userInfo");

+ 1 - 1
src/views/bank/user-log-view.vue

@@ -458,7 +458,7 @@
               prop: "checkPersonNameOut",
             },
             {
-              label: "查庫人身份證後四位",
+              label: "查庫人員工號或身份證後四位",
               prop: "checkPersonNoOut",
             },
             {

+ 23 - 0
src/views/report/userlog.vue

@@ -93,6 +93,7 @@
             {
               label: "機構號",
               prop: "orgNo",
+              search: true,
               rules: [{
                 required: true,
                 message: "请输入機構號",
@@ -103,6 +104,7 @@
               label: "表名",
               prop: "tableName",
               type: "select",
+              search: true,
               dicData: [
                 {
                   label: "網點鎖匙/密碼登記表", value: "keypwd"
@@ -144,6 +146,7 @@
             {
               label: "員工號",
               prop: "personNo",
+              search: true,
               rules: [{
                 required: true,
                 message: "请输入員工號",
@@ -163,6 +166,7 @@
               label: "操作類型",
               prop: "operationType",
               type: "select",
+              search: true,
               dicData: [
                 {
                   label: "新增", value: "add"
@@ -210,6 +214,19 @@
               prop: "createTime",
               disabled: true,
               type: "datetime",
+              format: "yyyy-MM-dd HH:mm",
+              valueFormat: "yyyy-MM-dd HH:mm",
+            },
+            {
+              label: "操作時間",
+              prop: "createTimeRange",
+              hide: true,
+              display: false,
+              search: true,
+              searchRange:true,
+              type: "date",
+              format: "yyyy-MM-dd",
+              valueFormat: "yyyy-MM-dd",
             },
           ]
         },
@@ -482,6 +499,12 @@
         this.onLoad(this.page);
       },
       searchChange(params, done) {
+
+        if (params.createTimeRange){
+          params.createTime_begin = params.createTimeRange[0], params.createTime_end = params.createTimeRange[1];
+          params.createTimeRange = null;
+        }
+
         this.query = params;
         this.page.currentPage = 1;
         this.onLoad(this.page, params);

+ 34 - 7
src/views/system/login-test.vue

@@ -1,10 +1,13 @@
 <template>
-  <avue-form ref="form" v-model="form" :option="option" @submit="submit">
-    <template slot-scope="scope" slot="menuForm">
-      <el-button @click="test1">test1</el-button>
-      <el-button @click="test2">test2</el-button>
-    </template>
-  </avue-form>
+  <div>
+    <avue-form ref="form" v-model="form" :option="option" @submit="submit">
+      <template slot-scope="scope" slot="menuForm">
+        <el-button @click="test1">test1</el-button>
+        <el-button @click="test2">test2</el-button>
+        <el-button @click="test3">test3</el-button>
+      </template>
+    </avue-form>
+  </div>
 </template>
 
 <script>
@@ -49,12 +52,36 @@
           });
         },
         test2(){
-          findByCn(this.form.account).then(res => {
+          let account = this.encryptByDES(this.form.account, "cyzh2020");
+          console.log(account)
+          findByCn(account).then(res => {
             console.log('findByCn')
             console.log(res)
             this.$Log.primary('findByCn' + res)
           });
         },
+        test3(){
+
+        },
+        encryptByDES(message, key){
+          var keyHex = CryptoJS.enc.Utf8.parse(key);
+          var encrypted = CryptoJS.DES.encrypt(message, keyHex, {
+            mode: CryptoJS.mode.ECB,
+            padding: CryptoJS.pad.Pkcs7
+          });
+          return encrypted.ciphertext.toString();
+        },
+        decryptByDES(ciphertext, key){
+          var keyHex = CryptoJS.enc.Utf8.parse(key);
+          var decrypted = CryptoJS.DES.decrypt({
+            ciphertext: CryptoJS.enc.Hex.parse(ciphertext)
+          }, keyHex, {
+            mode: CryptoJS.mode.ECB,
+            padding: CryptoJS.pad.Pkcs7
+          });
+          var result_value = decrypted.toString(CryptoJS.enc.Utf8);
+          return result_value;
+        }
       },
     }
 </script>

+ 109 - 78
src/views/wel/index.vue

@@ -2,90 +2,86 @@
   <div>
     <el-row>
       <el-col :span="24">
-        <basic-container>
+        <basic-container v-if="permission.home_front">
+          <avue-data-rotate :option="optionFront"></avue-data-rotate>
+        </basic-container>
+
+        <basic-container v-if="permission.home_quick_menu || permission.home_manage">
+
           <el-collapse v-model="activeNames" @change="handleChange">
-            <el-row v-for="(item1, index1) in menus" :key="item1.id">
-              <el-collapse-item :title="item1.name" :name="index1" >
-                <el-col :span="8" v-for="(item2, index2) in item1.children" :key="item2.id">
-                  <el-button type="primary" plain @click="$router.push({path: item2.path})">{{item2.name}}</el-button>
+
+            <div v-if="permission.home_quick_menu">
+              <el-row v-for="(item1, index1) in menus" :key="item1.id">
+                <el-collapse-item :title="item1.name" :name="index1" >
+                  <el-col :span="8" v-for="(item2, index2) in item1.children" :key="item2.id">
+                    <el-button type="primary" plain @click="$router.push({path: item2.path})">{{item2.name}}</el-button>
+                  </el-col>
+                </el-collapse-item>
+              </el-row>
+            </div>
+
+            <div v-if="permission.home_manage">
+              <el-collapse-item title="每日、每周、每月待辦事項" :name="5">
+                <el-col :span="8" >
+                  <avue-crud
+                    :option="optionDay"
+                    :data="dataDay"
+                    :page.sync="pageDay"
+                    v-model="form"
+                    ref="crud"
+                    @on-load="onLoadDay"
+                  >
+                    <template slot="status" slot-scope="{row, index}">
+                      <div align="center">
+                        <i v-if="row.status" style="width:20px;height:20px;border-radius:50%;background-color:green;display: block"></i>
+                        <i v-if="!row.status" style="width:20px;height:20px;border-radius:50%;background-color:red;display: block"></i>
+                      </div>
+                    </template>
+                  </avue-crud>
+                </el-col>
+                <el-col :span="8" >
+                  <avue-crud
+                    :option="optionWeek"
+                    :data="dataWeek"
+                    :page.sync="pageWeek"
+                    v-model="form"
+                    ref="crud"
+                    @on-load="onLoadWeek"
+                  >
+                    <template slot="status" slot-scope="{row, index}">
+                      <div align="center">
+                        <i v-if="row.status" style="width:20px;height:20px;border-radius:50%;background-color:green;display: block"></i>
+                        <i v-if="!row.status" style="width:20px;height:20px;border-radius:50%;background-color:red;display: block"></i>
+                      </div>
+                    </template>
+                  </avue-crud>
+                </el-col>
+                <el-col :span="8" >
+                  <avue-crud
+                    :option="optionMonth"
+                    :data="dataMonth"
+                    :page.sync="pageMonth"
+                    v-model="form"
+                    ref="crud"
+                    @on-load="onLoadMonth"
+                  >
+                    <template slot="status" slot-scope="{row, index}">
+                      <div align="center">
+                        <i v-if="row.status" style="width:20px;height:20px;border-radius:50%;background-color:green;display: block"></i>
+                        <i v-if="!row.status" style="width:20px;height:20px;border-radius:50%;background-color:red;display: block"></i>
+                      </div>
+                    </template>
+                  </avue-crud>
                 </el-col>
               </el-collapse-item>
-            </el-row>
-            <el-collapse-item title="每日、每周、每月待辦事項" :name="5">
-              <el-col :span="8" >
-                <avue-crud
-                  :option="optionDay"
-                  :data="dataDay"
-                  :page.sync="pageDay"
-                  v-model="form"
-                  ref="crud"
-                  @on-load="onLoadDay"
-                >
-                  <template slot="status" slot-scope="{row, index}">
-                    <div align="center">
-                      <i v-if="row.status" style="width:20px;height:20px;border-radius:50%;background-color:green;display: block"></i>
-                      <i v-if="!row.status" style="width:20px;height:20px;border-radius:50%;background-color:red;display: block"></i>
-                    </div>
-                  </template>
-                </avue-crud>
-              </el-col>
-              <el-col :span="8" >
-                <avue-crud
-                  :option="optionWeek"
-                  :data="dataWeek"
-                  :page.sync="pageWeek"
-                  v-model="form"
-                  ref="crud"
-                  @on-load="onLoadWeek"
-                >
-                  <template slot="status" slot-scope="{row, index}">
-                    <div align="center">
-                      <i v-if="row.status" style="width:20px;height:20px;border-radius:50%;background-color:green;display: block"></i>
-                      <i v-if="!row.status" style="width:20px;height:20px;border-radius:50%;background-color:red;display: block"></i>
-                    </div>
-                  </template>
-                </avue-crud>
-              </el-col>
-              <el-col :span="8" >
-                <avue-crud
-                  :option="optionMonth"
-                  :data="dataMonth"
-                  :page.sync="pageMonth"
-                  v-model="form"
-                  ref="crud"
-                  @on-load="onLoadMonth"
-                >
-                  <template slot="status" slot-scope="{row, index}">
-                    <div align="center">
-                      <i v-if="row.status" style="width:20px;height:20px;border-radius:50%;background-color:green;display: block"></i>
-                      <i v-if="!row.status" style="width:20px;height:20px;border-radius:50%;background-color:red;display: block"></i>
-                    </div>
-                  </template>
-                </avue-crud>
-              </el-col>
-            </el-collapse-item>
+            </div>
           </el-collapse>
         </basic-container>
 
-        <!--<basic-container v-if="permission.home_front">
-          <avue-data-rotate :option="optionFront"></avue-data-rotate>
-        </basic-container>
-        <basic-container v-if="permission.home_manage">
-          <el-row>
-            <el-col :span="8">
-              <div id="chartDay" :style="{width: '400px', height: '400px'}"></div>
-            </el-col>
-            <el-col :span="8">
-              <div id="chartWeek" :style="{width: '400px', height: '400px'}"></div>
-            </el-col>
-            <el-col :span="8">
-              <div id="chartMonth" :style="{width: '400px', height: '400px'}"></div>
-            </el-col>
-          </el-row>
-        </basic-container>
         <basic-container v-if="permission.home_backgr">
           <avue-data-rotate :option="optionBackgr"></avue-data-rotate>
-        </basic-container>-->
+        </basic-container>
+
       </el-col>
     </el-row>
 
@@ -125,7 +121,7 @@
                 this.$router.push({path: "/desk/tobeconfirm"})
               },
               count: '53%',
-              title: '待確認',
+              title: '待處理',
               display: false,
               icon: 'el-icon-view',
               color: '#f39c12'
@@ -134,7 +130,7 @@
                 this.$router.push({path: "/desk/confirmed"})
               },
               count: '44',
-              title: '我的確認',
+              title: '已處理',
               icon: 'el-icon-setting',
               color: '#5daf34'
             }
@@ -494,8 +490,43 @@
       ...mapGetters(["permission", "userInfo", "menuAll"]),
     },
     created() {
+      getMyInitiated().then(res => {
+        const initiatedCount = res.data.data;
+        this.optionFront.data[0].count = initiatedCount;
+        this.optionBackgr.data[4].count = initiatedCount;
+      })
+      getToBoReleased().then(res => {
+        const tobeReleaseCount = res.data.data;
+        this.optionBackgr.data[5].count = tobeReleaseCount;
+      });
+      getToBeConfirmed().then(res => {
+        const tobeConfirmedCount = res.data.data;
+        this.optionFront.data[1].count = tobeConfirmedCount;
+      });
+      getMyConfirmation().then(res => {
+        const confirmedCount = res.data.data;
+        this.optionFront.data[2].count = confirmedCount;
+      });
     },
     mounted() {
+
+      let _this = this;
+      getHomeCount().then(res => {
+        const data = res.data.data;
+        _this.option1.series[0].data[1].value = data.dayCheckedCount;
+        _this.option1.series[0].data[0].value = data.dayNocheckCount;
+        _this.option2.series[0].data[1].value = data.weekCheckedCount;
+        _this.option2.series[0].data[0].value = data.weekNocheckCount;
+        _this.option3.series[0].data[1].value = data.monthCheckedCount;
+        _this.option3.series[0].data[0].value = data.monthNocheckCount;
+
+        _this.optionBackgr.data[0].count = ( (data.dayNocheckCount) + '/' + (data.dayCheckedCount + data.dayNocheckCount));
+        _this.optionBackgr.data[1].count = ( (data.weekNocheckCount) + '/' + (data.weekCheckedCount + data.weekNocheckCount));
+        _this.optionBackgr.data[2].count = ( (data.monthNocheckCount) + '/' + (data.monthCheckedCount + data.monthNocheckCount));
+        _this.optionBackgr.data[3].count = data.dayNocheckCount + data.weekNocheckCount + data.monthNocheckCount;
+        // _this.drawLine()
+      })
+
       if (this.menuAll.length > 0){
         this.getBusinessMenu();
       }else{