Преглед изворни кода

Merge branch 'master' of http://132.232.92.186:3000/XinXiBu/oa-system

yuanrf пре 1 година
родитељ
комит
e6cd99005f

+ 72 - 27
src/components/Finance/DailyFeePayment.vue

@@ -176,12 +176,7 @@
 
 <script>
 export default {
-    beforeRouteLeave(to, from, next) {
-        if(to.name!='DailyFeeedit'){
-            from.meta.keepAlive = false;
-        }
-        next()
-    },
+    
     data() {
         return {
             banned:true,
@@ -284,8 +279,7 @@ export default {
         numFilter(row,column) {
             return parseFloat(row[column.property]).toFixed(2);
         },
-        async postPageDailyPaymentList() {
-            console.log(this.feeTypValue)
+        postPageDailyPaymentList() {
             var url = "/api/Financial/PostPageSearchDailyPaymentList"
             var that = this
             this.$axios({
@@ -373,7 +367,6 @@ export default {
                     this.feeSubTypeData.push(this.feeSubType[i]);
                 }
             }
-            console.log(this.feeTypValue);
             if(this.feeSubTypeData.length==1){
                 this.banned=true;
             }else{
@@ -391,7 +384,7 @@ export default {
         },
         //编辑保存全局变量
         handleEdit(index, row) {
-            this.$store.state.PaymentRequest = {
+            var PaymentRequest = {
                 feeTypValue:this.feeTypValue,
                 feeSubTypeValue:this.feeSubTypeValue,
                 financialValue:this.financialValue,
@@ -402,20 +395,57 @@ export default {
                 pgindex:this.currentPage,
                 pageSize:this.pageSize,
             };
+            localStorage.setItem('PaymentRequest', JSON.stringify(PaymentRequest));
             this.$router.push({path: '/home/DailyFeeedit?id=' + row.id +''});
         },
         //判断全局变量是否有值
         estimatePaymentRequest(){
-            console.log(this.$store.state.PaymentRequest);
-            this.feeTypValue=this.$store.state.PaymentRequest.feeTypValue?this.$store.state.PaymentRequest.feeTypValue:-1;
-            this.feeSubTypeValue=this.$store.state.PaymentRequest.feeSubTypeValue?this.$store.state.PaymentRequest.feeSubTypeValue:-1;
-            this.financialValue=this.$store.state.PaymentRequest.financialValue?this.$store.state.PaymentRequest.financialValue:-1;
-            this.GMValue=this.$store.state.PaymentRequest.GMValue?this.$store.state.PaymentRequest.GMValue:-1;
-            this.formInline.feeDesc=this.$store.state.PaymentRequest.feeDesc?this.$store.state.PaymentRequest.feeDesc:'';
-            this.userNameValue=this.$store.state.PaymentRequest.userNameValue?this.$store.state.PaymentRequest.userNameValue:'';
-            this.isPaySign=this.$store.state.PaymentRequest.isPaySign?this.$store.state.PaymentRequest.isPaySign:'-1';
-            this.currentPage=this.$store.state.PaymentRequest.pgindex?this.$store.state.PaymentRequest.pgindex:1;
-            this.pageSize=this.$store.state.PaymentRequest.pageSize?this.$store.state.PaymentRequest.pageSize:10;
+            if(JSON.parse(localStorage.getItem('PaymentRequest'))){
+                this.feeTypValue=JSON.parse(localStorage.getItem('PaymentRequest')).feeTypValue;
+                this.feeSubTypeValue=JSON.parse(localStorage.getItem('PaymentRequest')).feeSubTypeValue;
+                this.financialValue=JSON.parse(localStorage.getItem('PaymentRequest')).financialValue;
+                this.GMValue=JSON.parse(localStorage.getItem('PaymentRequest')).GMValue;
+                this.formInline.feeDesc=JSON.parse(localStorage.getItem('PaymentRequest')).feeDesc;
+                this.userNameValue=JSON.parse(localStorage.getItem('PaymentRequest')).userNameValue;
+                this.isPaySign=JSON.parse(localStorage.getItem('PaymentRequest')).isPaySign;
+                this.currentPage=JSON.parse(localStorage.getItem('PaymentRequest')).pgindex;
+                this.pageSize=JSON.parse(localStorage.getItem('PaymentRequest')).pageSize;
+                
+               
+                var url = "/api/Financial/PostPageSearchDailyPaymentPriceTypeData"
+                var that = this
+                this.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + that.token
+                    },
+                    data: {
+                        portType: 1,
+                    }
+                }).then(function (res) {
+                    if (res.data.code == 200) {
+                        that.feeSubType=res.data.data.feeSubTypeData;
+                        that.feeSubTypeData=[
+                            {
+                                id: -1,
+                                name: "全部",
+                                sTid:'-1'
+                            }
+                        ];
+                        for(var i=0;i<that.feeSubType.length;i++){
+                            if(that.feeSubType[i].sTid==that.feeTypValue){
+                                that.feeSubTypeData.push(that.feeSubType[i]);
+                            }
+                        }
+                        if(that.feeSubTypeData.length==1){
+                            that.banned=true;
+                        }else{
+                            that.banned=false;
+                        }
+                    }
+                })
+            }
         },
         handleDelete(index, row,rows) {
             console.log(index, row);
@@ -513,25 +543,40 @@ export default {
         }
     },
     created(){
-        this.estimatePaymentRequest();
+        
         this.token = JSON.parse(localStorage.getItem('userinif')).token;
         this.userid=JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
+        if(this.userid==21){//zhang
+            this.GMValue=0
+        }else if(this.userid==22){//zhu
+            this.financialValue=0
+
+        }
+        this.getTypeData();
         this.judgmentpms();
+        this.estimatePaymentRequest();
     }, 
     mounted() {
         this.postPageDailyPaymentList();
-        this.getTypeData();
+        // this.getTypeData();
         
     },
     watch:{
         'feeSubTypeData.length': {
-        handler(newValue, oldValue) {
-            if (newValue !== oldValue) {
-                // this.banned=false
+            handler(newValue, oldValue) {
+                if (newValue !== oldValue) {
+                    // this.banned=false
+                }
             }
         }
-    }
-    }
+    },
+    beforeRouteLeave(to, from, next) {
+        console.log(to)
+        if(to.name!='DailyFeeedit'){
+            localStorage.removeItem('PaymentRequest');
+        }
+        next()
+    },
 }
 </script>
 <style>

+ 1 - 0
src/components/Finance/DailyFeeedit.vue

@@ -372,6 +372,7 @@ export default {
                         type: 'success',
                         offset:50
                     });
+                    that.$router.push({ path: "/home/DailyFeePayment"});
                 }else{
                     that.$message.error(res.data.msg);
                 }

+ 26 - 15
src/components/Resource/OpInvitationOfficialActivityData.vue

@@ -289,12 +289,17 @@ export default {
                     that.OpInvitationOfficialActivityData.faceBook = res.data.data.faceBook
                     that.OpInvitationOfficialActivityData.ins = res.data.data.ins
                     var delList = res.data.data.delegation.split(',')
+                    console.log(res.data.data.delegation)
                     var delegaLOist = [];
-                    delList.forEach(function (item, index) {
-                        delegaLOist.push(
-                            parseInt(item)
-                        )
-                    });
+                    if (res.data.data.delegation) {
+                        delList.forEach(function (item, index) {
+                            delegaLOist.push(
+                                parseInt(item)
+                            )
+                        });
+                    }else{
+                        delegaLOist=''
+                    }
                     that.OpInvitationOfficialActivityData.delegation = delegaLOist
                     that.OpInvitationOfficialActivityData.filePath = res.data.data.filePath
                     that.OpInvitationOfficialActivityData.sndFilePath = res.data.data.sndFilePath
@@ -325,10 +330,12 @@ export default {
                     debugger
                     if (that.uploadFiles.length == 0 || that.uploadFiles[0].name == that.OpInvitationOfficialActivityData.sndFilePath) {
                         var delegationStr = '';
-                        that.OpInvitationOfficialActivityData.delegation.forEach(function (item, index) {
-                            delegationStr += item + ','
-                        });
-                        that.OpInvitationOfficialActivityData.delegation = delegationStr.substring(0, delegationStr.length - 1)
+                        if(that.OpInvitationOfficialActivityData.delegation){
+                            that.OpInvitationOfficialActivityData.delegation.forEach(function (item, index) {
+                                delegationStr += item + ','
+                            });
+                            that.OpInvitationOfficialActivityData.delegation = delegationStr.substring(0, delegationStr.length - 1)
+                        }
                         var url = "/api/Resource/OpInvitationOfficialActivity"
                         that.$axios({
                             method: 'post',
@@ -340,14 +347,18 @@ export default {
                         }).then(function (res) {
                             debugger
                             if (res.data.code == 200) {
+                                console.log(that.OpInvitationOfficialActivityData.delegation);
                                 var delList = that.OpInvitationOfficialActivityData.delegation.split(',')
                                 var delegaLOist = [];
-                                delList.forEach(function (item, index) {
-                                    delegaLOist.push(
-                                        parseInt(item)
-                                    )
-                                });
-                                that.OpInvitationOfficialActivityData.delegation = delegaLOist
+                                console.log(delList);
+                                if(delList){
+                                    delList.forEach(function (item, index) {
+                                        delegaLOist.push(
+                                            parseInt(item)
+                                        )
+                                    });
+                                    that.OpInvitationOfficialActivityData.delegation = delegaLOist
+                                }
                                 that.$message({
                                     message: res.data.msg,
                                     type: 'success'

+ 5 - 1
src/components/Resource/OpOfficialActivities.vue

@@ -121,7 +121,7 @@
                         </el-form-item>
                     </div>
                     <div style="width: 385px;">
-                        <el-form-item label="涉及领域:" label-width="160px">
+                        <el-form-item label="涉及领域:" prop="field" label-width="160px">
                             <el-input clearable placeholder="涉及领域" v-model="OpOfficialActivitiesDto.field">
                             </el-input>
                         </el-form-item>
@@ -355,6 +355,10 @@ export default {
                     { required: true, message: '该信息为必填信息', trigger: 'blur' },
                     { required: true, message: '该信息为必填信息', trigger: 'change' },
                 ],
+                field: [
+                    { required: true, message: '该信息为必填信息', trigger: 'blur' },
+                    { required: true, message: '该信息为必填信息', trigger: 'change' },
+                ],
 
             },
             uploadURL: "http://localhost:5256/api/Resource/UploadOfficialActivities",