Просмотр исходного кода

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

liuhj лет назад: 2
Родитель
Сommit
d1dcdae501
3 измененных файлов с 274 добавлено и 260 удалено
  1. 157 190
      src/components/Finance/FeesPage.vue
  2. 25 3
      src/components/OP/AirTicketRes.vue
  3. 92 67
      src/components/OP/OpAirTicketRes.vue

+ 157 - 190
src/components/Finance/FeesPage.vue

@@ -4,7 +4,8 @@
             <el-form :inline="true" :model="formInline" class="demo-form-inline">
                 <el-form-item>
                     <el-select v-model="formInline.Status" @change="shStatus()" placeholder="审核状态">
-                        <el-option v-for="(item,index) in AuditStatus" :key="index" :label="item.title" :value="item.id"></el-option>
+                        <el-option v-for="(item, index) in AuditStatus" :key="index" :label="item.title"
+                            :value="item.id"></el-option>
                     </el-select>
                 </el-form-item>
                 <el-form-item label="团队名称:">
@@ -23,7 +24,7 @@
                     {{ formInline.Days }}天 / {{ formInline.Number }}人
                 </el-form-item>
             </el-form>
-            <el-form v-if="formInline.Status==0" :inline="true" :model="formInline" class="demo-form-inline">
+            <el-form v-if="formInline.Status == 0" :inline="true" :model="formInline" class="demo-form-inline">
                 <el-form-item>
                     <el-button type="primary" @click="PostAuditGrpCreditCardPayment(1)">通 过(多选)</el-button>
                 </el-form-item>
@@ -39,7 +40,7 @@
                 </el-form-item>
                 <el-form-item v-show="causetrue">
                     <el-input v-model="formInline.cause"></el-input>
-                  </el-form-item>
+                </el-form-item>
             </el-form>
         </div>
         <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
@@ -52,83 +53,40 @@
             <el-tab-pane label="团组增减款项" name="98"></el-tab-pane>
         </el-tabs>
         <div>
-            <el-table
-            ref="multipleTable"
-            border
-            :data="tableData"
-            tooltip-effect="dark"
-            style="width: 100%"
-            @selection-change="handleSelectionChange">
-                <el-table-column
-                type="selection"
-                width="40"
-                v-if="formInline.Status==0">
+            <el-table ref="multipleTable" border :data="tableData" tooltip-effect="dark" style="width: 100%"
+                @selection-change="handleSelectionChange">
+                <el-table-column type="selection" width="40" v-if="formInline.Status == 0">
                 </el-table-column>
-                <el-table-column
-                prop="priceNameContent"
-                label="费用所属"
-                width="200">
+                <el-table-column prop="priceNameContent" label="费用所属" width="200">
                     <template slot-scope="scope">
-                        <el-popover style="white-space: pre-wrap;" placement="top-start" width="100" trigger="click" :content="scope.row.priceMsgContent">
-                            <span slot="reference">{{ scope.row.priceNameContent}}</span>
+                        <el-popover style="white-space: pre-wrap;" placement="top-start" width="100" trigger="click"
+                            :content="scope.row.priceMsgContent">
+                            <span slot="reference">{{ scope.row.priceNameContent }}</span>
                         </el-popover>
                     </template>
                 </el-table-column>
-                <el-table-column
-                prop="priceName"
-                label="费用模块"
-                width="120">
+                <el-table-column prop="priceName" label="费用模块" width="120">
                 </el-table-column>
-                <el-table-column
-                prop="busName"
-                label="Bus名称"
-                show-overflow-tooltip>
+                <el-table-column prop="busName" label="Bus名称" show-overflow-tooltip>
                 </el-table-column>
-                <el-table-column
-                prop="waitPay"
-                label="应付款金额"
-                show-overflow-tooltip>
+                <el-table-column prop="waitPay" label="应付款金额" show-overflow-tooltip>
                 </el-table-column>
-                <el-table-column
-                prop="currPay"
-                label="此次付款金额"
-                show-overflow-tooltip>
+                <el-table-column prop="currPay" label="此次付款金额" show-overflow-tooltip>
                 </el-table-column>
-                <el-table-column
-                prop="balance"
-                label="剩余尾款"
-                show-overflow-tooltip>
+                <el-table-column prop="balance" label="剩余尾款" show-overflow-tooltip>
                 </el-table-column>
-                <el-table-column
-                prop="operatorName"
-                label="申请人"
-                width="100"
-                show-overflow-tooltip>
+                <el-table-column prop="operatorName" label="申请人" width="100" show-overflow-tooltip>
                 </el-table-column>
-                <el-table-column
-                prop="auditOperatorName"
-                label="审核人"
-                width="100"
-                show-overflow-tooltip>
+                <el-table-column prop="auditOperatorName" label="审核人" width="100" show-overflow-tooltip>
                 </el-table-column>
-                <el-table-column
-                prop="overBudget"
-                label="超预算比例"
-                show-overflow-tooltip>
+                <el-table-column prop="overBudget" label="超预算比例" show-overflow-tooltip>
                 </el-table-column>
-                <el-table-column
-                label="审核操作"
-                >
+                <el-table-column label="审核操作">
                     <template slot-scope="scope">
-                        <el-button
-                        size="mini"
-                        v-if='scope.row.isAuditGM==0||scope.row.isAuditGM==2'
-                        @click="handleEdit(scope.$index, scope.row)">通 过</el-button>
-                        <el-button
-                        size="mini"
-                        type="danger"
-                        v-if='scope.row.isAuditGM==0||scope.row.isAuditGM==1'
-                        @click="handleDelete(scope.$index, scope.row)">不通过</el-button>
+                        <el-button size="mini" v-if='scope.row.isAuditGM == 0 || scope.row.isAuditGM == 2'
+                            @click="handleEdit(scope.$index, scope.row)">通 过</el-button>
+                        <el-button size="mini" type="danger" v-if='scope.row.isAuditGM == 0 || scope.row.isAuditGM == 1'
+                            @click="handleDelete(scope.$index, scope.row)">不通过</el-button>
                     </template>
                 </el-table-column>
             </el-table>
@@ -149,161 +107,161 @@ export default {
     data() {
         return {
             activeName: '-1',
-            diid:'',
-            token:'',
-            causetrue:false,
+            diid: '',
+            token: '',
+            causetrue: false,
             formInline: {
                 Status: -1,
                 name: '甘孜州州长团赴瑞士、希腊、奥地利10日团',
-                clientName:'兰卡彬真',
+                clientName: '兰卡彬真',
                 // clientPhone:'15884061115',
-                CountriesVisited:'瑞士 希腊 奥地利',
-                StartTime:' 2023-08-20',
+                CountriesVisited: '瑞士 希腊 奥地利',
+                StartTime: ' 2023-08-20',
                 // EndTime:'2023-08-29',
-                Number:5,
-                Days:10,
-                resource:'',
-                cause:"",
+                Number: 5,
+                Days: 10,
+                resource: '',
+                cause: "",
             },
-            AuditStatus:[
+            AuditStatus: [
                 {
-                    id:-1,
-                    title:'全部'
+                    id: -1,
+                    title: '全部'
                 },
                 {
-                    id:0,
-                    title:'未审核'
+                    id: 0,
+                    title: '未审核'
                 },
                 {
-                    id:1,
-                    title:'审核通过'
+                    id: 1,
+                    title: '审核通过'
                 },
                 {
-                    id:2,
-                    title:'审核不通过'
+                    id: 2,
+                    title: '审核不通过'
                 },
             ],
             tableData: [],
             multipleSelection: [],
-            auditarr:'',
-            userid:'',
-            payable:'',
+            auditarr: '',
+            userid: '',
+            payable: '',
         }
     },
     methods: {
         //控制其他原因
         onSubmit() {
             console.log(this.formInline.resource);
-            if(this.formInline.resource=='3、其他'){
-                this.causetrue=true;
-            }else{
-                this.causetrue=false;
+            if (this.formInline.resource == '3、其他') {
+                this.causetrue = true;
+            } else {
+                this.causetrue = false;
             }
         },
         //获取详情
-        getPostSearchGrpCreditCardPayment(){
-            var url="/api/Groups/PostSearchGrpCreditCardPayment"
-            var that=this
+        getPostSearchGrpCreditCardPayment() {
+            var url = "/api/Groups/PostSearchGrpCreditCardPayment"
+            var that = this
             this.$axios({
                 method: 'post',
-                url:url,
-                headers:{
-                    Authorization:'Bearer '+that.token
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + that.token
                 },
-                data:{
+                data: {
                     diId: 2270,
-                    label:that.activeName,
-                    auditStatus:that.formInline.Status
+                    label: that.activeName,
+                    auditStatus: that.formInline.Status
                 }
-            }).then(function(res){
+            }).then(function (res) {
                 console.log(res);
-                if(res.data.code==200){
-                    that.formInline.name=res.data.data.teamName;
-                    that.formInline.clientName=res.data.data.clientName;
-                    that.formInline.CountriesVisited=res.data.data.visitCountry;
-                    that.formInline.StartTime=res.data.data.visitDate;
-                    that.formInline.Days=res.data.data.visitDays;
-                    that.formInline.Number=res.data.data.visitPNumber;
-                    that.tableData=res.data.data.detailList;
-                    document.querySelector('.payable').innerHTML=res.data.data.totalStr1;
-                    document.querySelector('.payment').innerHTML=res.data.data.totalStr2;
-                    document.querySelector('.remainder').innerHTML=res.data.data.totalStr3;
-                    document.querySelector('.reviewed').innerHTML=res.data.data.totalStr4;
+                if (res.data.code == 200) {
+                    that.formInline.name = res.data.data.teamName;
+                    that.formInline.clientName = res.data.data.clientName;
+                    that.formInline.CountriesVisited = res.data.data.visitCountry;
+                    that.formInline.StartTime = res.data.data.visitDate;
+                    that.formInline.Days = res.data.data.visitDays;
+                    that.formInline.Number = res.data.data.visitPNumber;
+                    that.tableData = res.data.data.detailList;
+                    document.querySelector('.payable').innerHTML = res.data.data.totalStr1;
+                    document.querySelector('.payment').innerHTML = res.data.data.totalStr2;
+                    document.querySelector('.remainder').innerHTML = res.data.data.totalStr3;
+                    document.querySelector('.reviewed').innerHTML = res.data.data.totalStr4;
                 }
             })
         },
         handleSelectionChange(val) {
-            this.auditarr="";
+            this.auditarr = "";
             this.multipleSelection = val;
-            for(var i=0;i<this.multipleSelection.length;i++){
-                this.auditarr+=this.multipleSelection[i].id+','
+            for (var i = 0; i < this.multipleSelection.length; i++) {
+                this.auditarr += this.multipleSelection[i].id + ','
             }
             console.log(this.auditarr.substring(0, this.auditarr.length - 1))
-            this.auditarr=this.auditarr.substring(0, this.auditarr.length - 1)
+            this.auditarr = this.auditarr.substring(0, this.auditarr.length - 1)
         },
         handleClick(tab, event) {
-            this.activeName=tab.name;
+            this.activeName = tab.name;
             this.getPostSearchGrpCreditCardPayment();
         },
-        shStatus(){
+        shStatus() {
             this.getPostSearchGrpCreditCardPayment();
         },
         handleEdit(index, row) {
-            this.noPostAuditGrpCreditCardPayment(row.id,1)
+            this.noPostAuditGrpCreditCardPayment(row.id, 1)
         },
         handleDelete(index, row) {
-            this.noPostAuditGrpCreditCardPayment(row.id,2)
+            this.noPostAuditGrpCreditCardPayment(row.id, 2)
         },
         //多选审批
-        PostAuditGrpCreditCardPayment(val){
-            var url="/api/Groups/PostAuditGrpCreditCardPayment"
-            var that=this
+        PostAuditGrpCreditCardPayment(val) {
+            var url = "/api/Groups/PostAuditGrpCreditCardPayment"
+            var that = this
             this.$axios({
                 method: 'post',
-                url:url,
-                headers:{
-                    Authorization:'Bearer '+that.token
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + that.token
                 },
-                data:{
+                data: {
                     CreditIdStr: that.auditarr,
-                    auditCode:val,//1审核通过,2审核未通过
-                    user:that.userid//userid
+                    auditCode: val,//1审核通过,2审核未通过
+                    user: that.userid//userid
                 }
-            }).then(function(res){
+            }).then(function (res) {
                 console.log(res);
-                if(res.data.code==200){
+                if (res.data.code == 200) {
                     that.$message({
-                        message:res.data.msg ,
+                        message: res.data.msg,
                         type: 'warning',
-                        offset:50
+                        offset: 50
                     });
                     that.getPostSearchGrpCreditCardPayment();
                 }
             })
         },
         //单独审批
-        noPostAuditGrpCreditCardPayment(val,num){
-            console.log(val,num)
-            var url="/api/Groups/PostAuditGrpCreditCardPayment"
-            var that=this
+        noPostAuditGrpCreditCardPayment(val, num) {
+            console.log(val, num)
+            var url = "/api/Groups/PostAuditGrpCreditCardPayment"
+            var that = this
             this.$axios({
                 method: 'post',
-                url:url,
-                headers:{
-                    Authorization:'Bearer '+that.token
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + that.token
                 },
-                data:{
-                    CreditIdStr: val+'',
-                    auditCode:num,//1审核通过,2审核未通过
-                    user:that.userid//userid
+                data: {
+                    CreditIdStr: val + '',
+                    auditCode: num,//1审核通过,2审核未通过
+                    user: that.userid//userid
                 }
-            }).then(function(res){
+            }).then(function (res) {
                 console.log(res);
-                if(res.data.code==200){
+                if (res.data.code == 200) {
                     that.$message({
-                        message:res.data.msg ,
+                        message: res.data.msg,
                         type: 'warning',
-                        offset:50
+                        offset: 50
                     });
                     that.getPostSearchGrpCreditCardPayment();
                 }
@@ -312,53 +270,62 @@ export default {
         childMethod() {
             this.$parent.fatherMethod();
         },
-        ceshi(){
+        ceshi() {
             console.log("tg")
         }
     },
-    mounted(){
-        this.diid=this.$route.query.id;
-        this.token=JSON.parse(localStorage.getItem('userinif')).token;
-        this.userid=JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
+    mounted() {
+        this.diid = this.$route.query.id;
+        this.token = JSON.parse(localStorage.getItem('userinif')).token;
+        this.userid = JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
         this.getPostSearchGrpCreditCardPayment();
         // this.getTime('是否通过该条费用?',this.ceshi(),'通过') 
     }
 }
 </script>
 <style>
-    .fesspage-box{
-        background-color: #fff;
-        padding: 10px;
-        box-shadow: 0 0 5px #0005;
-        border-radius: 10px;
-    }
-    .fesspage-head .el-form-item__label{
-        font-weight: 600;
-    }
-    .fesspage-head .el-form--inline .el-form-item__content{
-        color: #606266;
-    }
-    .fesspage-head .el-form-item{
-        margin-bottom: 10px;
-    }
-    .payments{
-        margin-top: 10px;
-    }
-    .payments>div{
-        margin: 2px 0;
-        font-size: 14px;
-    }
-    .payments .statistics{
-        font-size: 17px;
-        font-weight:600 ;
-    }
-    .payment{
-        color: #008000;
-    }
-    .remainder{
-        color: #ff0000;
-    }
-    .reviewed{
-        color: #1D5DA4;
-    }
+.fesspage-box {
+    background-color: #fff;
+    padding: 10px;
+    box-shadow: 0 0 5px #0005;
+    border-radius: 10px;
+}
+
+.fesspage-head .el-form-item__label {
+    font-weight: 600;
+}
+
+.fesspage-head .el-form--inline .el-form-item__content {
+    color: #606266;
+}
+
+.fesspage-head .el-form-item {
+    margin-bottom: 10px;
+}
+
+.payments {
+    margin-top: 10px;
+}
+
+.payments>div {
+    margin: 2px 0;
+    font-size: 14px;
+}
+
+.payments .statistics {
+    font-size: 17px;
+    font-weight: 600;
+}
+
+.payment {
+    color: #008000;
+}
+
+.remainder {
+    color: #ff0000;
+}
+
+.reviewed {
+    color: #1D5DA4;
+}
 </style>

+ 25 - 3
src/components/OP/AirTicketRes.vue

@@ -7,7 +7,7 @@
                     <div>机票费用录入</div>
                 </div>
                 <div style="display: flex;">
-                    <div style="width: 90%;">
+                    <div style="width: 80%;">
                         <el-select v-model="DiId" placeholder="团组选择" @change="AirTicketResSelectChange">
                             <el-option v-for="item in AirTicketResSelectData" :key="item.id" :label="item.groupName"
                                 :value="item.id">
@@ -15,6 +15,7 @@
                         </el-select>
                     </div>
                     <div>
+                        <el-button type="primary" @click="download" style="margin-left: 10px;">导出报表</el-button>
                         <router-link :to="{ path: '/home/OpAirTicketRes', query: { DiId } }">
                             <el-button type="primary" style="margin-left: 10px;">新增</el-button>
                         </router-link>
@@ -188,7 +189,7 @@ export default {
                 cancelButtonText: '取消',
                 type: 'warning'
             }).then(() => {
-                var url = "/api/Resource/DelCarData"
+                var url = "/api/Groups/DelAirTicketRes"
                 var that = this
                 this.$axios({
                     method: 'post',
@@ -209,7 +210,7 @@ export default {
                             message: '删除成功',
                             type: 'success'
                         });
-                        that.carData();
+                        that.AirTicketResList();
                     } else {
                         that.$message.error('删除失败!');
                     }
@@ -224,6 +225,27 @@ export default {
                     message: '操作已取消!'
                 });
             });
+        },
+        download() {
+            var url = "/api/Groups/DeriveAirTicketRes"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + this.token
+                },
+                data: {
+                    DiId: that.DiId,
+                    UserId: that.userId
+                }
+            }).then(function (res) {
+                if (res.data.code == 200) {
+                    window.location.href = res.data.data
+                } else {
+                    that.$message.error("网络错误,请稍后重试");
+                }
+            })
         }
     },
     mounted() {

+ 92 - 67
src/components/OP/OpAirTicketRes.vue

@@ -72,9 +72,11 @@
                     </div>
                     <div style="width: 33%;">
                         <el-form-item label="机票单价:" prop="prePrice" label-width="160px">
-                            <el-input placeholder="机票单价" v-model="prePrice" style="width: 58%;" @input="peiceinput">
+                            <el-input placeholder="机票单价" v-model="airTicketResOpData.prePrice" style="width: 58%;"
+                                @input="peiceinput">
                             </el-input>
-                            <el-select v-model="currencyId" style="width: 35%;">
+                            <el-select v-model="airTicketResOpData.preCurrency" style="width: 35%;"
+                                @change="currencyChange">
                                 <el-option key="48" label="CNY" :value="48"></el-option>
                                 <el-option key="49" label="USD" :value="49"></el-option>
                                 <el-option key="51" label="EUR" :value="51"></el-option>
@@ -86,7 +88,7 @@
                             <el-input placeholder="机票总价" v-model="airTicketResOpData.price" style="width: 58%;"
                                 :disabled="true">
                             </el-input>
-                            <el-select v-model="currencyId" style="width: 35%;" :disabled="true">
+                            <el-select v-model="airTicketResOpData.currency" style="width: 35%;" :disabled="true">
                                 <el-option key="48" label="CNY" :value="48"></el-option>
                                 <el-option key="49" label="USD" :value="49"></el-option>
                                 <el-option key="51" label="EUR" :value="51"></el-option>
@@ -99,7 +101,7 @@
                 <div style="display: flex;">
                     <div style="width: 33%;">
                         <el-form-item label="此舱位人数:" prop="clientNum" label-width="160px">
-                            <el-input placeholder="此舱位人数" v-model="clientNum" @input="peiceinput">
+                            <el-input placeholder="此舱位人数" v-model="airTicketResOpData.clientNum" @input="peiceinput">
                             </el-input>
                         </el-form-item>
                     </div>
@@ -216,7 +218,7 @@
                         </el-form-item>
                     </div>
                     <div style="width: 25%;">
-                        <el-form-item label="消费方式:" prop="visitCountry">
+                        <el-form-item label="消费方式:" prop="consumptionPatterns">
                             <el-input placeholder="消费方式" v-model="cardPaymentOpData.consumptionPatterns">
                             </el-input>
                         </el-form-item>
@@ -233,7 +235,7 @@
                             <el-input placeholder="付款金额" v-model="cardPaymentOpData.payMoney" style="width: 52%;"
                                 :disabled="true">
                             </el-input>
-                            <el-select v-model="currencyId" style="width: 45%;" :disabled="true">
+                            <el-select v-model="cardPaymentOpData.paymentCurrency" style="width: 45%;" :disabled="true">
                                 <el-option key="48" label="CNY" :value="48"></el-option>
                                 <el-option key="49" label="USD" :value="49"></el-option>
                                 <el-option key="51" label="EUR" :value="51"></el-option>
@@ -244,7 +246,7 @@
                 <div v-if="cardPaymentOpData.payDId == 72">
                     <div style="display: flex;">
                         <div style="width: 25%;">
-                            <el-form-item label="卡类型:">
+                            <el-form-item label="卡类型:" prop="ctdId">
                                 <el-select v-model="cardPaymentOpData.ctdId" placeholder="卡类型" style="width: 100%;"
                                     @change="ctdChange">
                                     <el-option v-for="item in cardType" :key="item.id" :label="item.name" :value="item.id">
@@ -320,13 +322,13 @@
                 <div v-else></div>
                 <div style="display:flex;">
                     <div style="width: 25%;">
-                        <el-form-item label="收款方:">
+                        <el-form-item label="收款方:" prop="payee">
                             <el-input placeholder="对方姓名:" v-model="cardPaymentOpData.payee">
                             </el-input>
                         </el-form-item>
                     </div>
                     <div style="width: 25%;">
-                        <el-form-item label="费用标识:" prop="visitCountry">
+                        <el-form-item label="费用标识:" prop="orbitalPrivateTransfer">
                             <el-select v-model="cardPaymentOpData.orbitalPrivateTransfer" placeholder="费用标识"
                                 style="width: 100%;">
                                 <el-option key="0" label="公转" :value=0>
@@ -388,12 +390,30 @@ export default {
                 ],
                 flightsCity: [
                     { required: true, message: '请输入城市', trigger: 'change' },
-                ]
+                ],
+                clientName: [
+                    { required: true, message: '请输入客人姓名', trigger: 'change' },
+                ],
+                flightsDescription: [
+                    { required: true, message: '请严格遵守格式,正确填写', trigger: 'change' },
+                ],
             },
             cardPaymentRules: {
                 payDId: [
                     { required: true, message: '请选择支付方式', trigger: 'blur' },
-                ]
+                ],
+                consumptionPatterns: [
+                    { required: true, message: '请输入消费方式', trigger: 'blur' },
+                ],
+                payee: [
+                    { required: true, message: '请输入收款方', trigger: 'blur' },
+                ],
+                orbitalPrivateTransfer: [
+                    { required: true, message: '请选择费用表示', trigger: 'blur' },
+                ],
+                // ctdId: [
+                //     { required: true, message: '请选择卡类型', trigger: 'blur' },
+                // ]
             },
             title: "新增机票费用录入",
             token: '',
@@ -404,13 +424,10 @@ export default {
             delegationInfo: {},
             AirTicketResSelectData: [],//团组下拉框
             ticketClass: [],//舱位下拉框
-            currencyId: 48,
             payment: [],//支付方式下拉框
             cardType: [],//卡类型下拉框
             airTicketAgents: [],//合作的代理资料
             airTicketAgentsId: '',
-            prePrice: '',
-            clientNum: '',
             airGroupCostParameter: {},//机票成本预算
             jjccb: 0,
             jjcrs: 0,
@@ -424,9 +441,9 @@ export default {
                 diId: 0,
                 cType: '',
                 prePrice: 0,
-                preCurrency: this.currencyId,
+                preCurrency: 48,
                 price: 0,
-                currency: this.currencyId,
+                currency: 48,
                 clientNum: 0,
                 clientName: '',
                 isCheckIn: 0,
@@ -450,7 +467,7 @@ export default {
                 bankNo: '',
                 cardholderName: 'Zhang Hailin',
                 payMoney: 0,
-                paymentCurrency: this.currencyId,
+                paymentCurrency: 48,
                 companyBankNo: '',
                 otherBankName: '',
                 otherSideNo: '',
@@ -527,52 +544,59 @@ export default {
         //点击保存事件
         addBtn() {
             const that = this;
-            that.$refs.airTicketResOpData.validate((valid) => {
-                if (valid) {
-
-                    that.airTicketResOpData.diId = that.DiId;
-                    that.airTicketResOpData.clientNum = that.clientNum;
-                    that.airTicketResOpData.createUserId = that.userId;
-                    that.airTicketResOpData.currency = that.currencyId;
-                    that.airTicketResOpData.preCurrency = that.currencyId;
-                    that.airTicketResOpData.prePrice = that.prePrice
-                    console.log(that.airTicketResOpData)
+            let formArr = ['airTicketResOpData', 'cardPaymentOpData']//三个form表单的ref
+            var resultArr = [] //用来接受返回结果的数组
+            function checkForm(formName) { //封装验证表单的函数
+                var result = new Promise(function (resolve, reject) {
+                    that.$refs[formName].validate((valid) => {
+                        if (valid) {
+                            resolve();
+                        } else { reject() }
+                    })
+                })
+                resultArr.push(result) //push 得到promise的结果
+            }
+            formArr.forEach(item => { //根据表单的ref校验
+                checkForm(item)
+            })
+            Promise.all(resultArr).then(values => {
+                that.airTicketResOpData.diId = that.DiId;
+                that.airTicketResOpData.createUserId = that.userId;
 
-                    that.cardPaymentOpData.createUserId = that.userId;
-                    that.cardPaymentOpData.diId = that.DiId;
-                    that.cardPaymentOpData.paymentCurrency = that.currencyId
+                that.cardPaymentOpData.createUserId = that.userId;
+                that.cardPaymentOpData.diId = that.DiId;
+                if (that.cardPaymentOpData.ctdId == '') {
                     that.cardPaymentOpData.ctdId = 0;
-                    console.log(that.cardPaymentOpData)
-                    var url = "/api/Groups/OpAirTicketRes"
-                    that.$axios({
-                        method: 'post',
-                        url: url,
-                        headers: {
-                            Authorization: 'Bearer ' + that.token
-                        },
-                        data: {
-                            status: that.status,
-                            airTicketResOpData: that.airTicketResOpData,
-                            cardPaymentOpData: that.cardPaymentOpData
-                        }
-                    }).then(function (res) {
-                        if (res.data.code == 200) {
-                            that.$message({
-                                message: res.data.msg,
-                                type: 'success'
-                            });
-                            that.loading = true;
-                            setTimeout(() => {
-                                that.$router.push('/home/AirTicketRes')
-                            }, 3000);
-                        } else {
-                            that.$message.error(res.data.msg);
-                        }
-                    })
-                } else {
-                    this.$message.error('请完善信息在保存!');
-                    return false;
                 }
+                var url = "/api/Groups/OpAirTicketRes"
+                that.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + that.token
+                    },
+                    data: {
+                        status: that.status,
+                        airTicketResOpData: that.airTicketResOpData,
+                        cardPaymentOpData: that.cardPaymentOpData
+                    }
+                }).then(function (res) {
+                    if (res.data.code == 200) {
+                        that.$message({
+                            message: res.data.msg,
+                            type: 'success'
+                        });
+                        that.loading = true;
+                        setTimeout(() => {
+                            that.$router.push('/home/AirTicketRes')
+                        }, 3000);
+                    } else {
+                        that.$message.error(res.data.msg);
+                    }
+                })// 此时必填完成,做保存后的业务操作
+            }).catch(_ => {
+                this.$message.error('请完善信息在保存!');
+                return false;
             })
         },
         //根据机票费用录入Id查询c表和机票费用信息
@@ -599,6 +623,7 @@ export default {
                 }
             })
         },
+        //支付方式change事件
         payChange() {
             this.cardPaymentOpData.ctdId = '';
             this.cardPaymentOpData.bankNo = '';
@@ -634,9 +659,14 @@ export default {
         },
         //单价值改变事件
         peiceinput() {
-            this.cardPaymentOpData.payMoney = parseFloat(this.prePrice * this.clientNum)
+            this.cardPaymentOpData.payMoney = parseFloat(parseFloat(this.airTicketResOpData.prePrice) * parseFloat(this.airTicketResOpData.clientNum)).toFixed(2)
             this.cardPaymentOpData.payThenMoney = this.cardPaymentOpData.payMoney
-            this.airTicketResOpData.price = parseFloat(this.prePrice * this.clientNum)
+            this.airTicketResOpData.price = parseFloat(parseFloat(this.airTicketResOpData.prePrice) * parseFloat(this.airTicketResOpData.clientNum)).toFixed(2)
+        },
+        currencyChange(Id) {
+            this.cardPaymentOpData.paymentCurrency = Id;
+            this.airTicketResOpData.preCurrency = Id;
+            this.airTicketResOpData.currency = Id;
         }
     },
 
@@ -647,11 +677,6 @@ export default {
         this.AirTicketResSelect();
         this.id = this.$route.query.id
         this.DiId = this.$route.query.DiId
-
-        this.cardPaymentOpData.payMoney = parseFloat(this.prePrice * this.clientNum)
-        this.cardPaymentOpData.payThenMoney = this.cardPaymentOpData.payMoney
-        this.airTicketResOpData.price = parseFloat(this.prePrice * this.clientNum)
-
     }
 }
 </script>