浏览代码

05091752lhj三公

liuhj 1 年之前
父节点
当前提交
7250a759d9

+ 3 - 0
src/components/Finance/PaymentFiled.vue

@@ -84,6 +84,9 @@
                                     <span>
                                         {{ data.moduleName?'['+data.moduleName+']':''}}
                                     </span>
+                                    <span>
+                                        {{ data.priceName?data.priceName:''}}
+                                    </span>
                                     <span>
                                         {{ data.payee?'(收款方:'+data.payee+')':'' }}
                                     </span>

+ 1 - 1
src/components/OP/AirTicketRes.vue

@@ -334,7 +334,7 @@ export default {
                 if (res.data.code == 200) {
                     window.location.href = res.data.data
                 } else {
-                    that.$message.error("网络错误,请稍后重试");
+                    that.$message.error(res.data.smg);
                 }
             })
         },

+ 162 - 40
src/components/OP/EntryDetails.vue

@@ -58,7 +58,7 @@
                         </div>
                         <div class="Entry-inif-box">
                             <label>签证费用描述:</label>
-                            <el-input style="width:1200px" size="mini" v-model="DomesticFees.visafeesDescription"></el-input>
+                            <el-input style="width:900px" size="mini" v-model="DomesticFees.visafeesDescription"></el-input>
                             <span class="redzhu">{{visabeizhu}}</span>
                         </div>
                     </div>
@@ -124,6 +124,11 @@
                             <el-input-number size="mini"  :controls="false" :precision="2" v-model="TotalExpenses.BusinessClass"></el-input-number>
                             <span>元/人;</span>
                         </div>
+                        <span v-if="JSON.stringify(TicketJudgment) == '{}'" class="redzhu">(机票数据未录入)</span>
+                        <div v-else>
+                            <span v-if="TicketJudgment.jjcCurrentRate!=TotalExpenses.EconomyClass||TicketJudgment.gwcCurrentRate!=TotalExpenses.BusinessClass" class="redzhu">{{ TicketJudgment.remark }}</span>&nbsp;&nbsp;&nbsp;&nbsp;
+                            <el-button v-if="TicketJudgment.jjcCurrentRate!=TotalExpenses.EconomyClass||TicketJudgment.gwcCurrentRate!=TotalExpenses.BusinessClass" type="primary" @click="Fillin" size="mini">填 入</el-button>
+                        </div>
                     </div>
                     <div class="Entry-li-inif">
                         <div class="Entry-inif-box">
@@ -137,7 +142,20 @@
                             <label>{{item.currencyName}}汇率:</label>
                             <el-input-number size="mini"  :controls="false" :precision="4" v-model="item.rate"></el-input-number>
                         </div>
-                        <span class="redzhu">(注:请先修改汇率在添加数据,否则请删除在添加!)</span>
+                        <el-popover
+                        placement="top"
+                        width="402"
+                        trigger="hover">
+                            <el-table border :data="currencyss">
+                                <el-table-column width="100" property="currName" label="币种"></el-table-column>
+                                <el-table-column width="100" property="rate" label="汇率"></el-table-column>
+                                <el-table-column width="200" property="lastUpdateDt" label="更新时间"></el-table-column>
+                            </el-table>
+                            <!-- <el-button slot="reference">click 激活</el-button> -->
+                            <span v-show="cubtn" slot="reference" class="redzhu">{{CurrencysRemark}}</span>
+                        </el-popover>
+                        &nbsp;&nbsp;&nbsp;&nbsp;
+                        <el-button v-if="cubtn" @click="adoptRealtime" type="primary" size="mini">采用最新汇率</el-button>
                     </div>
                 </div>
                 <div class="Entry-form-li">
@@ -524,7 +542,7 @@
 <script>
 
 import { Decimal } from 'decimal.js'
-
+import {debounce} from '../../store/statice'
 export default {
     data() {
         return {
@@ -653,7 +671,12 @@ export default {
 
             storageid:0,
             visabeizhu:"",
-            ID:''
+            ID:'',
+            TicketJudgment:{},
+            CurrencysRemark:'',
+            //监听币种数组
+            watchedPrice: null,
+            cubtn:false,
         }
     },
     methods:{
@@ -686,33 +709,72 @@ export default {
             })
         },
         //获取签证标注
-        GetEnterExitCostCorrelationTips(){
-            this.TotalExpenses.EconomyClass=0;
-            this.TotalExpenses.BusinessClass=0;
-            this.DomesticFees.visafees=0;
-            this.DomesticFees.visafeesDescription="";
-            var url = "/api/Groups/GetEnterExitCostCorrelationTips"
-            var that = this
-            this.$axios({
-                method: 'post',
-                url: url,
-                headers: {
-                    Authorization: 'Bearer ' + this.token
-                },
-                data:{
-                    portType: 1,
-                    diId:that.value
-                }
-            }).then(function (res) {
-                if(res.data.code==200){
-                    that.TotalExpenses.EconomyClass=res.data.data.airData.jjcCurrentRate;
-                    that.TotalExpenses.BusinessClass=res.data.data.airData.gwcCurrentRate;
-                    that.DomesticFees.visafees=res.data.data.visaData.feeTotal;
-                    that.DomesticFees.visafeesDescription=res.data.data.visaData.remark;
-                }else{
-                    that.$message.error(res.data.msg);
-                }
-            })
+        GetEnterExitCostCorrelationTips(val){
+            if(val==1){
+                this.TotalExpenses.EconomyClass=0;
+                this.TotalExpenses.BusinessClass=0;
+                this.DomesticFees.visafees=0;
+                this.DomesticFees.visafeesDescription="";
+                var url = "/api/Groups/GetEnterExitCostCorrelationTips"
+                var that = this
+                this.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + this.token
+                    },
+                    data:{
+                        portType: 1,
+                        diId:that.value
+                    }
+                }).then(function (res) {
+                    if(res.data.code==200){
+                        that.TotalExpenses.EconomyClass=res.data.data.airData.jjcCurrentRate;
+                        that.TotalExpenses.BusinessClass=res.data.data.airData.gwcCurrentRate;
+                        that.DomesticFees.visafees=res.data.data.visaData.feeTotal;
+                        that.DomesticFees.visafeesDescription=res.data.data.visaData.remark;
+                    }else{
+                        that.$message.error(res.data.msg);
+                    }
+                })
+            }else{
+                var url = "/api/Groups/GetEnterExitCostCorrelationTips"
+                var that = this
+                this.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + this.token
+                    },
+                    data:{
+                        portType: 1,
+                        diId:that.value
+                    }
+                }).then(function (res) {
+                    if(res.data.code==200){
+                        that.TicketJudgment=res.data.data.airData;
+                        that.currencyss=res.data.data.reteInfos;
+                        console.log(that.currencys);
+                        console.log(that.currencyss);
+                        for(let s=0;s<that.currencys.length;s++){
+                            if(that.currencys[s].rate!=that.currencyss[s].rate){
+                                that.cubtn=true;
+                                that.CurrencysRemark='当前汇率与实时汇率不同!移上查看'
+                                return
+                            }else{
+                                that.cubtn=false;
+                            }
+                        }
+                    }else{
+                        that.$message.error(res.data.msg);
+                    }
+                })
+            }
+        },
+        //机票费用填入
+        Fillin(){
+            this.TotalExpenses.EconomyClass=this.TicketJudgment.jjcCurrentRate;
+            this.TotalExpenses.BusinessClass=this.TicketJudgment.gwcCurrentRate;
         },
         //获取费用标注
         GetNationalTravelFeeData(){
@@ -1208,16 +1270,17 @@ export default {
                     that.storageid=res.data.data.id;
                     // that.GetNationalTravelFeeData();
                     that.fullscreenLoading=false;
-                    //that.GetEnterExitCostCorrelationTips();
+                    that.GetEnterExitCostCorrelationTips(2);
                 }else{
                     that.fullscreenLoading=false;
-                    that.GetEnterExitCostCorrelationTips();
+                    that.GetEnterExitCostCorrelationTips(1);
                     that.$message.warning(res.data.msg);
                 }
             })
         },
         //全部清空
         cleanout(){
+            this.fullscreenLoading=true
             this.$confirm('此操作将全部清空, 是否继续?', '提示', {
                 confirmButtonText: '确定',
                 cancelButtonText: '取消',
@@ -1258,12 +1321,12 @@ export default {
         },
         //下拉
         handNodeClick(data,node,e){
-            console.log(data)
-            console.log(node)
-            console.log(e)
+            // console.log(data)
+            // console.log(node)
+            // console.log(e)
             this.treeDataValue= data.name
             this.treeData= data.name
-            console.log(this.treeData)
+            // console.log(this.treeData)
         },
         //住宿地区选择
         changeSelect(val,item,index){
@@ -1493,8 +1556,9 @@ export default {
             }
         },
         //保存
-        storage(){
+        storage:debounce(function(){
             //住宿费
+            this.fullscreenLoading=true
             var quarterageDatas=[];
             for(let m=0;m<this.quarterageData.length;m++){
                 if(this.quarterageData[m].nationalTravelFeeId!=''){
@@ -1563,7 +1627,7 @@ export default {
                 }
             }
             this.storageAPI(quarterageDatas,boardWagesDatas,miscellaneousFeeDatas,trainingExpenseDatas)
-        },
+        },5000,true),
         //保存API
         storageAPI(arrthre,arrfour,arrfive,arrsix){
             var url = "/api/Groups/PostEnterExitCostOperate"
@@ -1825,6 +1889,17 @@ export default {
                 });
             });
         },
+        //填入实时汇率
+        adoptRealtime(){
+            for(let at=0;at<this.currencys.length;at++){
+                for(let rt=0;rt<this.currencyss.length;rt++){
+                    if(this.currencys[at].currencyCode==this.currencyss[rt].currCode){
+                        this.currencys[at].rate=this.currencyss[rt].rate
+                    }
+                }
+            }
+            this.cubtn=false;
+        }
     },
     filters: {
         numFilter (value) {
@@ -1948,7 +2023,54 @@ export default {
             immediate: true,
             deep: true // 可以深度检测到 person 对象的属性值的变化
         },
-        
+        //监听汇率数组是否变化
+        currencys:{
+            handler(val){
+                console.log(val);
+                // console.log(this.quarterageData);
+                //住宿费
+                this.TotalAccommodationFee=0
+                for(let q=0;q<this.quarterageData.length;q++){
+                    for(let qc=0;qc<this.currencys.length;qc++){
+                        if(this.currencys[qc].currencyCode==this.quarterageData[q].curremcyCode){
+                            this.quarterageData[q].subTotal=this.currencys[qc].rate*this.quarterageData[q].cost
+                        }
+                    }
+                    this.TotalAccommodationFee+=this.quarterageData[q].subTotal
+                }
+                //伙食费
+                this.TotalMeals=0
+                for(let b=0;b<this.boardWagesData.length;b++){
+                    for(let bc=0;bc<this.currencys.length;bc++){
+                        if(this.currencys[bc].currencyCode==this.boardWagesData[b].curremcyCode){
+                            this.boardWagesData[b].subTotal=this.currencys[bc].rate*this.boardWagesData[b].cost
+                        }
+                    }
+                    this.TotalMeals+=this.boardWagesData[b].subTotal
+                }
+                //公杂费
+                this.TotalMiscellaneous=0
+                for(let m=0;m<this.miscellaneousFeeData.length;m++){
+                    for(let mc=0;mc<this.currencys.length;mc++){
+                        if(this.currencys[mc].currencyCode==this.miscellaneousFeeData[m].curremcyCode){
+                            this.miscellaneousFeeData[m].subTotal=this.currencys[mc].rate*this.miscellaneousFeeData[m].cost
+                        }
+                    }
+                    this.TotalMiscellaneous+=this.miscellaneousFeeData[m].subTotal
+                }
+                //培训费
+                this.trainingExpense=0
+                for(let t=0;t<this.trainingExpenseData.length;t++){
+                    for(let tc=0;tc<this.currencys.length;tc++){
+                        if(this.currencys[tc].currencyCode==this.trainingExpenseData[t].curremcyCode){
+                            this.trainingExpenseData[t].subTotal=this.currencys[tc].rate*this.trainingExpenseData[t].cost
+                        }
+                    }
+                    this.trainingExpense+=this.trainingExpenseData[t].subTotal
+                }
+            },
+            deep:true
+        }
     },
     mounted(){
         this.userId=JSON.parse(localStorage.getItem('userinif')).userInfo.userId;

+ 14 - 14
src/components/OP/visaAgencyfee.vue

@@ -47,7 +47,7 @@
                             v-model="scope.row.obType" placeholder="请选择团组">
                             <el-option  label="大公务" :value=1 key='1'></el-option>
                             <el-option  label="小公务" :value=2 key='2'></el-option>
-                            <el-option  label="未选择" :value=0 key='0'></el-option>
+                            <!-- <el-option  label="未选择" :value=0 key='0'></el-option> -->
                         </el-select>
                     </template>
                 </el-table-column>
@@ -89,7 +89,7 @@ export default {
                 isChecked: 0,
                 country: '',
                 visaFee: 0,
-                obType:0,
+                obType:1,
                 agencyFee: 0,
                 otherFee: 0,
             }, {
@@ -97,7 +97,7 @@ export default {
                 isChecked: 0,
                 country: '',
                 visaFee: 0,
-                obType:0,
+                obType:1,
                 agencyFee: 0,
                 otherFee: 0,
             }, {
@@ -105,7 +105,7 @@ export default {
                 isChecked: 0,
                 country: '',
                 visaFee: 0,
-                obType:0,
+                obType:1,
                 agencyFee: 0,
                 otherFee: 0,
             }, {
@@ -113,7 +113,7 @@ export default {
                 isChecked: 0,
                 country: '',
                 visaFee: 0,
-                obType:0,
+                obType:1,
                 agencyFee: 0,
                 otherFee: 0,
             }, {
@@ -121,7 +121,7 @@ export default {
                 isChecked: 0,
                 country: '',
                 visaFee: 0,
-                obType:0,
+                obType:1,
                 agencyFee: 0,
                 otherFee: 0,
             }, {
@@ -129,7 +129,7 @@ export default {
                 isChecked: 0,
                 country: '',
                 visaFee: 0,
-                obType:0,
+                obType:1,
                 agencyFee: 0,
                 otherFee: 0,
             }],
@@ -180,7 +180,7 @@ export default {
         //详细
         PostVisaFeeList() {
             var url = "/api/Groups/PostVisaFeeList"
-            var that = this
+            var that = this                                                           
             this.$axios({
                 method: 'post',
                 url: url,
@@ -203,7 +203,7 @@ export default {
                                 isChecked: 0,
                                 country: '',
                                 visaFee: 0,
-                                obType:0,
+                                obType:1,
                                 agencyFee: 0,
                                 otherFee: 0,
                             }, {
@@ -211,7 +211,7 @@ export default {
                                 isChecked: 0,
                                 country: '',
                                 visaFee: 0,
-                                obType:0,
+                                obType:1,
                                 agencyFee: 0,
                                 otherFee: 0,
                             }, {
@@ -219,7 +219,7 @@ export default {
                                 isChecked: 0,
                                 country: '',
                                 visaFee: 0,
-                                obType:0,
+                                obType:1,
                                 agencyFee: 0,
                                 otherFee: 0,
                             }, {
@@ -227,7 +227,7 @@ export default {
                                 isChecked: 0,
                                 country: '',
                                 visaFee: 0,
-                                obType:0,
+                                obType:1,
                                 agencyFee: 0,
                                 otherFee: 0,
                             }, {
@@ -235,7 +235,7 @@ export default {
                                 isChecked: 0,
                                 country: '',
                                 visaFee: 0,
-                                obType:0,
+                                obType:1,
                                 agencyFee: 0,
                                 otherFee: 0,
                             }, {
@@ -243,7 +243,7 @@ export default {
                                 isChecked: 0,
                                 country: '',
                                 visaFee: 0,
-                                obType:0,
+                                obType:1,
                                 agencyFee: 0,
                                 otherFee: 0,
                             }

+ 52 - 0
src/store/statice.js

@@ -0,0 +1,52 @@
+// 防抖
+export const debounce = (fn, delay) => {
+	var time = null
+	return function() {
+		let context = this;//记录一下this指向
+		let args = arguments;
+		//清除定时任务
+		if (time) clearTimeout(time);
+		time = setTimeout(function() {
+			time = null;
+			fn.apply(context, args)
+		}, delay)
+	}
+}
+//节流
+export const throttle=(fn, delay) => {
+	// 时间戳
+	var timeTwo = 0 //new Date();
+	// 定时器
+	var timeThree = null;
+	return function() {
+		let context = this;
+		let args = arguments;
+		var now = new Date()
+
+		// !!!!时间戳实现【new Date()虽然获取结果不是时间戳但是计算结果会自动转化为时间戳】
+		// if(now-timeTwo>=delay){
+		//     fn.apply(context,args);
+		//     timeTwo=new Date();
+		// }
+
+		// !!!!定时器实现
+		// if (!timeThree) {
+		//     timeThree = setTimeout(function () {
+		//         fn.apply(context, args);
+		//         timeThree=null;
+		//     }, delay)
+		// }
+
+		// 结合 ps:最后一次触发在固定频率内会在延迟后触发
+		var wait = delay - (now - timeTwo)
+		clearTimeout(timeThree)
+		if (wait <= 0) {
+			fn.apply(context, args);
+			timeTwo = new Date();
+		} else {
+			timeThree = setTimeout(function() {
+				fn.apply(context, args);
+			}, delay)
+		}
+	}
+}