zpj 1 rok temu
rodzic
commit
f81fce4dbc

+ 4 - 33
src/assets/css/common/tools.css

@@ -11,24 +11,7 @@
 .el-collapse-item__content{
   padding-bottom: 0;
 }
-/*.v-modal{*/
-/*  z-index: 99999 !important;*/
-/*}*/
-/*.el-drawer__wrapper{*/
-/*  z-index: 100000 !important;*/
-/*}*/
-/*.el-dialog__wrapper{*/
-/*  z-index: 100000 !important;*/
-/*}*/
-/*.el-select-dropdown{*/
-/*  z-index: 100000 !important;*/
-/*}*/
-/*.el-cascader__dropdown {*/
-/*  z-index: 100000 !important;*/
-/*}*/
-/*.el-notification {*/
-/*  z-index: 100000 !important;*/
-/*}*/
+
 .w-e-toolbar{
   z-index: 2000 !important;
 }
@@ -50,10 +33,7 @@
 .cut-b-class{
   background: var(--bc);
 }
-.el-button--primary {
-  background: var(--bc) !important;
-  border-color: var(--bc) !important;
- }
+
 .el-checkbox__input.is-checked .el-checkbox__inner, .el-checkbox__input.is-indeterminate .el-checkbox__inner{
   background-color: var(--bc) !important;
   border-color: var(--bc) !important;
@@ -74,11 +54,7 @@
 .el-message-box__btns button:nth-child(2){
   background: #2B7DFAFF !important;
 }
-/*.el-radio__inner::after{*/
-/*  width: 10px;*/
-/*  height: 10px;*/
-/*  background-color: var(--bc) !important;*/
-/*}*/
+
 .el-pagination.is-background .btn-next, .el-pagination.is-background .btn-prev, .el-pagination.is-background .el-pager li{
   background: transparent;
 }
@@ -111,13 +87,8 @@
 }
 .el-button{
   border-radius: 10px;
-  box-shadow: 0px 1px 2px 0px #B8C8E039;
-  border: 1px solid #D8E0F0
-}
-.el-button--primary{
-  background: #2B7DFA;
-  border-color: #2B7DFA;
 }
+
 .el-button--success{
   background-color: #00BF8A;
 }

+ 16 - 12
src/utils/request.js

@@ -17,7 +17,9 @@ service.interceptors.request.use(
     if (localStorage.getItem('token')) {
       config.headers.Authorization = localStorage.getItem('token')
     }
-
+    if(config.ContentType){
+      config.headers["Content-Type"] = ContentType
+    }
     return config
   },
   error => {
@@ -36,11 +38,11 @@ service.interceptors.response.use(
 
     if (res.code == 0) {
       if (response.config.isMsg) {
-        Message({
-          message: res.msg,
-          type: 'error',
-          duration: 3 * 1000
-        })
+        // Message({
+        //   message: res.msg,
+        //   type: 'error',
+        //   duration: 3 * 1000
+        // })
       }
     } else if (res.code === 401) {
       const loginUrl = router.currentRoute.path
@@ -77,11 +79,11 @@ service.interceptors.response.use(
         duration: 3 * 1000
       })
     } else if (res.code === 1) {
-      Message({
-        message: res.msg,
-        type: 'success',
-        duration: 3 * 1000
-      })
+      // Message({
+      //   message: res.msg,
+      //   type: 'success',
+      //   duration: 3 * 1000
+      // })
       return res
     }
     return res
@@ -135,7 +137,7 @@ function endLoading() {
 
 }
 
-const request = (url, method = 'get', data, isLoading = false, isMsg = true) => {
+const request = (url,method = 'get',data,ContentType,isLoading = false,isMsg = true) => {
   const config = {}
 
   if (data) {
@@ -148,6 +150,8 @@ const request = (url, method = 'get', data, isLoading = false, isMsg = true) =>
     data={}
   }
 
+
+
   if (process.env.NODE_ENV==="development"){
     data.token = localStorage.getItem('token');
   }

+ 1 - 1
src/views/admin/organ/add-edit.vue

@@ -169,7 +169,7 @@
         firmSave(this.fromData).then((res)=>{
           this.isAJAX = false
           if(res.code == 1){
-            this.$message(res.msg);
+            this.$message.success(res.msg);
             this.$router.replace({path:'/organ/list'})
           }else{
             this.$message.error(res.msg);

+ 40 - 29
src/views/admin/template/add-edit.vue

@@ -76,10 +76,11 @@
 </template>
 
 <script>
-  import oss from 'ali-oss'
   import {
     GetSts
   } from '@/api/conmmon.js'
+  import oss from "ali-oss"
+
   import {contractInfo,contractSave} from '@/api/contract.js';
   export default {
     data(){
@@ -89,7 +90,7 @@
           name:"",
           sign_party:[],
           texts:[],
-          file:"",
+          file_url:'',
         },
         aliOss: "",
         fileList:[],
@@ -110,6 +111,29 @@
       }
     },
     methods:{
+      async setNewOss() {
+        let obj = await GetSts()
+        obj = obj.data
+        let client = new oss({
+          region: "oss-cn-chengdu",
+          accessKeyId: obj.AccessKeyId,
+          accessKeySecret: obj.AccessKeySecret,
+          stsToken: obj.SecurityToken,
+          refreshSTSToken: async () => {
+            let obj = await GetSts()
+            obj = obj.data
+            return {
+              accessKeyId: obj.accessKeyId,
+              accessKeySecret: obj.accessKeySecret,
+              stsToken: obj.stsToken,
+            }
+          },
+          refreshSTSTokenInterval: 900000,
+          bucket: "jhnewshop",
+        })
+        this.aliOss = client
+      },
+
       getInfo(){
         contractInfo({id:this.fromData.id}).then((res)=>{
           if(res.code == 1){
@@ -126,6 +150,13 @@
                 this.textList.push(obj)
               })
             }
+            this.fileList = [];
+            let obj = {
+              name:res.data.name,
+              url:res.data.file,
+            };
+            this.fileList.push(obj);
+            this.fromData.file_url = res.data.contracts_file;
           }
         })
       },
@@ -148,11 +179,13 @@
           this.fromData.texts.push(v.val)
         })
 
+
+
         contractSave(this.fromData).then((res)=>{
           this.isAJAX = false
           if(res.code == 1){
-            this.$message(res.msg);
-            this.$router.replace({path:'/user/list'})
+            this.$message.success(res.msg);
+            this.$router.replace({path:'/template/list'})
           }else{
             this.$message.error(res.msg);
           }
@@ -176,32 +209,10 @@
         }
       },
 
-      async setNewOss() {
-        let obj = await GetSts()
-        obj = obj.data
-        let client = new oss({
-          region: "oss-cn-chengdu",
-          accessKeyId: obj.AccessKeyId,
-          accessKeySecret: obj.AccessKeySecret,
-          stsToken: obj.SecurityToken,
-          refreshSTSToken: async () => {
-            let obj = await GetSts()
-            obj = obj.data
-            return {
-              accessKeyId: obj.accessKeyId,
-              accessKeySecret: obj.accessKeySecret,
-              stsToken: obj.stsToken,
-            }
-          },
-          refreshSTSTokenInterval: 900000,
-          bucket: "jhnewshop",
-        })
-        this.aliOss = client
-      },
       beforeUpload(file){
         if(this.fileList.length > 0){
           this.fileList = [];
-          this.fromData.file = '';
+          this.fromData.file_url = '';
         }
         // ||file.type === 'application/pdf'
         let isWord = file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' ||file.type === 'application/msword';
@@ -227,7 +238,7 @@
               let a = res.url.substring(0, 4);
               let b = res.url.substring(4);
               let s = 's';
-              this.fromData.file = a+s+b;
+              this.fromData.file_url = a+s+b;
             }
           }else{
             this.$message.error('上传失败,请重新上传')
@@ -236,7 +247,7 @@
       },
       beforeRemove(file, fileList){
         this.fileList = fileList;
-        this.fromData.file = '';
+        this.fromData.file_url = '';
       },
     },
   }

+ 4 - 3
src/views/admin/template/list.vue

@@ -24,14 +24,15 @@
             <el-table-column prop="created_at" label="创建时间"></el-table-column>
             <el-table-column fixed='right' prop="" label="编辑">
               <template slot-scope="scope">
-                <el-button type="warning" icon="el-icon-edit" @click="edit(scope.row)">编辑</el-button>
+                <el-button class="mr-10" type="warning" icon="el-icon-edit" @click="edit(scope.row)">编辑</el-button>
 
                 <el-popconfirm
-                  title="是否立即删除合同模板?"
+                  title="是否立即删除合同模板?" @onConfirm='del(scope.row)' @confirm='del(scope.row)'
                 >
-                  <el-button slot="reference" icon="el-icon-delete" type="danger" @click="del(scope.row)">删除</el-button>
+                  <el-button slot="reference" icon="el-icon-delete" type="danger">删除</el-button>
                 </el-popconfirm>
 
+
               </template>
             </el-table-column>
         </el-table>

+ 1 - 1
src/views/admin/user/add-edit.vue

@@ -82,7 +82,7 @@
         memberSave(this.fromData).then((res)=>{
           this.isAJAX = false
           if(res.code == 1){
-            this.$message(res.msg);
+            this.$message.success(res.msg);
             this.$router.replace({path:'/user/list'})
           }else{
             this.$message.error(res.msg);