Bläddra i källkod

03-20 1625lhj

liuhj 1 år sedan
förälder
incheckning
0c12dd84c4

+ 47 - 20
src/components/OP/InvitationOfficialActivities.vue

@@ -116,14 +116,14 @@
 </template>
 <script>
 export default {
-    beforeRouteLeave(to, from, next) {
-        console.log(to)
-        console.log(from)
-        if(to.name!='OpInvitationOfficialActivities'){
-            from.meta.keepAlive = false;
-        }
-        next()
-    },
+    // beforeRouteLeave(to, from, next) {
+    //     console.log(to)
+    //     console.log(from)
+    //     if(to.name!='OpInvitationOfficialActivities'){
+    //         from.meta.keepAlive = false;
+    //     }
+    //     next()
+    // },
     data() {
         return {
             loading: false,
@@ -134,6 +134,7 @@ export default {
             input: '',
             token: '',
             userId: 0,
+            DiIdst:'',
             DiId: '',
             inviter: "",
             pickerOptions: {
@@ -197,9 +198,12 @@ export default {
             }).then(function (res) {
                 if (res.data.code == 200) {
                     that.AirTicketResSelectData = res.data.data.groupName;
-
-                    that.DiId = parseInt(that.AirTicketResSelectData[0].id);
-                    that.delegationInfo = that.AirTicketResSelectData[0];
+                    if(that.DiIdst==undefined||that.DiIdst!=that.DiIdst){
+                        that.DiId =that.AirTicketResSelectData[0].id;
+                    }else{
+                        that.DiId =that.DiIdst
+                    }
+                    that.AirTicketResSelectChange()
                     that.InvitationOfficialActivities()
                 }
             }).catch(function (error) {
@@ -217,16 +221,38 @@ export default {
             this.InvitationOfficialActivities();
         },
         AirTicketResSelectChange() {
-            if (this.DiId != 0 && this.DiId != null) {
-                this.InvitationOfficialActivities();
-                for (let index = 0; index < this.AirTicketResSelectData.length; index++) {
+            // this.$router.push({ query: {} });
+            var url = "/api/Business/PostShareGroupInfo"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + this.token
+                },
+                data: {
+                    portType: 1,
+                    id: that.DiId,
+                }
+            }).then(function (res) {
+                if (res.data.code == 200) {
 
-                    if (this.AirTicketResSelectData[index].id == parseInt(this.DiId)) {
-                        this.delegationInfo = this.AirTicketResSelectData[index];
-                        break;
-                    }
+                    that.delegationInfo=res.data.data;
+                    that.InvitationOfficialActivities();
                 }
-            }
+            }).catch(function (error) {
+                that.$message.error(error);
+            });
+            // if (this.DiId != 0 && this.DiId != null) {
+                
+            //     for (let index = 0; index < this.AirTicketResSelectData.length; index++) {
+
+            //         if (this.AirTicketResSelectData[index].id == parseInt(this.DiId)) {
+            //             this.delegationInfo = this.AirTicketResSelectData[index];
+            //             break;
+            //         }
+            //     }
+            // }
 
         },
 
@@ -306,7 +332,7 @@ export default {
                         DeleteUserId: this.userId
                     }
                 }).then(function (res) {
-                    console.log(res)
+
 
                     if (res.data.code == 200) {
 
@@ -356,6 +382,7 @@ export default {
     },
 
     mounted() {
+        this.DiIdst = Number(this.$route.query.DiId);
         this.token = JSON.parse(localStorage.getItem('userinif')).token;
         this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
         this.AirTicketResSelect();

+ 205 - 61
src/components/OP/OpInvitationOfficialActivities.vue

@@ -156,7 +156,7 @@
                                 </el-form-item>
                             </div>
                             <div style="width: 28%;">
-                                <el-form-item prop="interpreterCurrency" label-width="5px">
+                                <el-form-item prop="sendCurrency" label-width="5px">
                                     <el-select @change="computerenminbi" v-model="InvitationOfficialActivities.sendCurrency" placeholder="币种">
                                         <el-option v-for="item in rateList" :key="item.currencyId"
                                             :label="item.currencyCode" :value="item.currencyId"></el-option>
@@ -211,13 +211,24 @@
                         <el-form-item label="费用标识:" prop="orbitalPrivateTransfer">
                             <el-select v-model="InvitationOfficialActivities.orbitalPrivateTransfer" placeholder="费用标识"
                                 style="width: 100%;">
-                                <el-option key="0" label="公转" :value=0>
-                                </el-option>
-                                <el-option key="1" label="私转" :value=1>
+                                <el-option v-for="item in costIdentificationData" :key="item.id" :label="item.name" :value="item.id">
                                 </el-option>
                             </el-select>
                         </el-form-item>
                     </div>
+                    <div style="width: 25%;">
+                        <el-form-item label="消费日期:" prop="consumptionDate">
+                            <el-date-picker value-format="yyyy-MM-dd" v-model="InvitationOfficialActivities.consumptionDate"
+                                type="date" placeholder="选择日期">
+                            </el-date-picker>
+                        </el-form-item>
+                    </div>
+                    <div style="width: 25%;">
+                        <el-form-item label="消费方式:" prop="consumptionPatterns">
+                            <el-input placeholder="消费方式" v-model="InvitationOfficialActivities.consumptionPatterns">
+                            </el-input>
+                        </el-form-item>
+                    </div>
                     <div style="width: 25%;">
                         <el-form-item label="支付方式:" prop="payDId">
                             <el-select v-model="InvitationOfficialActivities.payDId" placeholder="支付方式">
@@ -226,7 +237,50 @@
                             </el-select>
                         </el-form-item>
                     </div>
-                    
+                    <div v-if="InvitationOfficialActivities.payDId==72" style="width: 25%;">
+                        <el-form-item label="卡类型:" prop="ctdId">
+                            <el-select @change="cardhandoff" v-model="InvitationOfficialActivities.ctdId" placeholder="卡类型">
+                                <el-option v-for="item in cardTypeData" :key="item.id" :label="item.name" :value="item.id">
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                    </div>
+                    <div v-if="InvitationOfficialActivities.payDId==72" style="width: 25%;">
+                        <el-form-item label="银行卡号:" prop="bankNo">
+                            <el-input :disabled="true" placeholder="银行卡号" v-model="InvitationOfficialActivities.bankNo">
+                            </el-input>
+                        </el-form-item>
+                    </div>
+                    <div v-if="InvitationOfficialActivities.payDId==72" style="width: 25%;">
+                        <el-form-item label="持卡人姓名:" prop="cardholderName">
+                            <el-input :disabled="true" placeholder="持卡人姓名" v-model="InvitationOfficialActivities.cardholderName">
+                            </el-input>
+                        </el-form-item>
+                    </div>
+                    <div v-if="InvitationOfficialActivities.payDId==73||InvitationOfficialActivities.payDId==83" style="width: 25%;">
+                              <el-form-item label="公司银行卡号:" prop="companyBankNo">
+                            <el-input placeholder="公司银行卡号" v-model="InvitationOfficialActivities.companyBankNo">
+                            </el-input>
+                        </el-form-item>
+                    </div>
+                    <div v-if="InvitationOfficialActivities.payDId==73||InvitationOfficialActivities.payDId==83" style="width: 25%;">
+                        <el-form-item label="对方开户行:" prop="otherBankName">
+                            <el-input placeholder="对方开户行" v-model="InvitationOfficialActivities.otherBankName">
+                            </el-input>
+                        </el-form-item>
+                    </div>
+                    <div v-if="InvitationOfficialActivities.payDId==73||InvitationOfficialActivities.payDId==83" style="width: 25%;">
+                        <el-form-item label="对方银行账号:" prop="otherSideNo">
+                            <el-input placeholder="对方银行账号" v-model="InvitationOfficialActivities.otherSideNo">
+                            </el-input>
+                        </el-form-item>
+                    </div>
+                    <div v-if="InvitationOfficialActivities.payDId==73||InvitationOfficialActivities.payDId==83" style="width: 25%;">
+                        <el-form-item label="对方姓名:" prop="otherSideName">
+                            <el-input placeholder="对方姓名" v-model="InvitationOfficialActivities.otherSideName">
+                            </el-input>
+                        </el-form-item>
+                    </div>
                     <div style="width: 25%;">
                         <el-form-item label="附件:" prop="fileUrl" label-width="160px">
                             <el-upload :file-list="uploadFiles" ref="upload" :on-success="upLoadSuccess"
@@ -252,9 +306,7 @@
                 <el-form-item>
                     <div style="text-align: right;">
                         <el-button type="primary" @click="addBtn">保存</el-button>
-                        <router-link to='/home/InvitationOfficialActivities'>
-                            <el-button>取消</el-button>
-                        </router-link>
+                        <el-button @click="cancelbtn">取消</el-button>
                     </div>
                 </el-form-item>
             </el-form>
@@ -281,9 +333,11 @@ export default {
             IsAuditGM: 0,
             delegationInfoList: [],//团组下拉框
             payment: [],//支付方式下拉框
+            cardTypeData:[],//卡类型下拉框
+            costIdentificationData:[],//费用标识下拉框
             InvitationOfficialActivities: {
                 status: 0,
-                payDId: 73,
+                payDId: 0,
                 orbitalPrivateTransfer: 0,
                 payee: '',
                 id: 0,
@@ -293,15 +347,15 @@ export default {
                 inviteTime: this.transformDateFormat(new Date()),
                 attachment: '',
                 payMoney:0,
-                paymentCurrency:0,
+                paymentCurrency:'',
                 eventsCost:0,
-                eventsCurrency:0,
+                eventsCurrency:'',
                 inviteCost: 0,
-                inviteCurrency: 0,
+                inviteCurrency: '',
                 translateCost:0,
-                translateCurrency: 0,
+                translateCurrency: '',
                 sendCost: 0,
-                sendCurrency:0,
+                sendCurrency:'',
                 isGoOfficaiaBussiness: 0,
                 createUserId: 0,
                 remark: '',
@@ -311,7 +365,16 @@ export default {
                 tel: '',
                 email: '',
                 fax: '',
-                otherInformation: ''
+                otherInformation: '',
+                consumptionDate: '',//消费日期
+                consumptionPatterns: '',//消费方式
+                ctdId: '',//卡类型
+                bankNo: '',//银行卡号
+                cardholderName: '',//持卡人姓名
+                companyBankNo: '',//公司银行卡号
+                otherBankName: '',//对方开户行
+                otherSideNo: '',//对方银行账号
+                otherSideName: '',//对方姓名
             },
             headers: {
                 Authorization: JSON.parse(localStorage.getItem('userinif')).token,
@@ -333,6 +396,18 @@ export default {
                 payMoney: [
                     { required: true, message: '请输入费用金额', trigger: 'blur' },
                 ],
+                companyBankNo: [
+                    { required: true, message: '请输入', trigger: 'blur' },
+                ],
+                otherBankName: [
+                    { required: true, message: '请输入', trigger: 'blur' },
+                ],
+                otherSideNo: [
+                    { required: true, message: '请输入', trigger: 'blur' },
+                ],
+                otherSideName: [
+                    { required: true, message: '请输入', trigger: 'blur' },
+                ],
                 inviterArea: [
                     { required: true, message: '请输入邀请方地区', trigger: 'change' },
                     { required: true, message: '请输入邀请方地区', trigger: 'blur' },
@@ -345,6 +420,14 @@ export default {
                     { required: true, message: '请选择邀请时间', trigger: 'change' },
                     { required: true, message: '请选择邀请时间', trigger: 'blur' },
                 ],
+                consumptionDate: [
+                    { required: true, message: '请选择邀请时间', trigger: 'change' },
+                    { required: true, message: '请选择邀请时间', trigger: 'blur' },
+                ],
+                consumptionPatterns: [
+                    { required: true, message: '请选择邀请时间', trigger: 'change' },
+                    { required: true, message: '请选择邀请时间', trigger: 'blur' },
+                ],
                 contact: [
                     { required: true, message: '请输入联系人', trigger: 'change' },
                     { required: true, message: '请输入联系人', trigger: 'blur' },
@@ -387,6 +470,54 @@ export default {
         }
     },
     methods: {
+        //卡类型切换
+        cardhandoff(val){
+            console.log(val)
+            for(var i=0;i<this.cardTypeData.length;i++){
+                if(val==this.cardTypeData[i].id){
+                    this.InvitationOfficialActivities.bankNo=this.cardTypeData[i].remark;
+                    this.InvitationOfficialActivities.cardholderName=this.cardTypeData[i].cardholder;
+                }
+            }
+        },
+        //获取基础数据
+        InvitationOfficialActivityInitBasicData() {
+            var url = "/api/Groups/InvitationOfficialActivityInitBasicData"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + this.token
+                }
+            
+            }).then(function (res) {
+                if (res.data.code == 200) {
+                    console.log(res)
+                    that.payment = res.data.data.payTypeData;
+                    that.cardTypeData = res.data.data.cardTypeData;
+                    that.costIdentificationData = res.data.data.costIdentificationData;
+                    //下拉框初始值
+                    that.InvitationOfficialActivities.orbitalPrivateTransfer=that.costIdentificationData[0].id;
+                    that.InvitationOfficialActivities.payDId=that.payment[0].id;
+                    that.InvitationOfficialActivities.ctdId=that.cardTypeData[0].id;
+                    that.InvitationOfficialActivities.bankNo=that.cardTypeData[0].remark;
+                    that.InvitationOfficialActivities.cardholderName=that.cardTypeData[0].cardholder;
+                    if (that.id != null && that.id != undefined && that.id != 0) {
+                        that.InvitationOfficialActivitiesById();
+                        that.title = "修改商邀费用";
+                        that.InvitationOfficialActivities.status = 2
+                        that.isShow = true
+                    } else {
+                        that.InvitationOfficialActivities.status = 1
+                        that.title = "新增商邀费用"
+                        that.isShow = false
+                    }
+                }else{
+                    that.$message.error(res.data.msg);
+                }
+            })
+        },
         //团组下拉框
         AirTicketResSelect() {
             var url = "/api/Groups/DecreasePaymentsSelect"
@@ -403,6 +534,7 @@ export default {
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
+                    console.log(res)
                     that.delegationInfoList = res.data.data.groupName;
                     that.DiIdSelect = parseInt(that.DiId)
                     for (let index = 0; index < that.delegationInfoList.length; index++) {
@@ -411,12 +543,9 @@ export default {
                             break;
                         }
                     }
-                    that.payment = res.data.data.payment
+                    // that.payment = res.data.data.payment
                 }
-
             })
-
-
         },
         InvitationOfficialActivitiesById() {
             var url = "/api/Groups/InvitationOfficialActivitiesById"
@@ -434,29 +563,47 @@ export default {
             }).then(function (res) {
                 if (res.data.code == 200) {
                     console.log(res.data.data)
-                    that.InvitationOfficialActivities.payDId = res.data.data._CreditCard.payDId
-                    that.InvitationOfficialActivities.orbitalPrivateTransfer = res.data.data._CreditCard.orbitalPrivateTransfer
-                    that.InvitationOfficialActivities.payee = res.data.data._CreditCard.payee
-                    that.InvitationOfficialActivities.id = res.data.data._Invitation.id
-                    that.InvitationOfficialActivities.diId = res.data.data._Invitation.diId
-                    that.InvitationOfficialActivities.inviterArea = res.data.data._Invitation.inviterArea
-                    that.InvitationOfficialActivities.inviter = res.data.data._Invitation.inviter
-                    that.InvitationOfficialActivities.inviteTime = res.data.data._Invitation.inviteTime
-                    that.InvitationOfficialActivities.attachment = res.data.data._Invitation.attachment
-                    that.projectName = res.data.data._Invitation.attachment
-                    that.InvitationOfficialActivities.inviteCost = res.data.data._Invitation.inviteCost
-                    that.InvitationOfficialActivities.inviteCurrency = res.data.data._Invitation.inviteCurrency
-                    that.InvitationOfficialActivities.sendCost = res.data.data._Invitation.sendCost
-                    that.InvitationOfficialActivities.isGoOfficaiaBussiness = res.data.data._Invitation.isGoOfficaiaBussiness
-                    that.InvitationOfficialActivities.remark = res.data.data._Invitation.remark
-                    that.InvitationOfficialActivities.address = res.data.data._InvitationData.address
-                    that.InvitationOfficialActivities.contact = res.data.data._InvitationData.contact
-                    that.InvitationOfficialActivities.job = res.data.data._InvitationData.job
-                    that.InvitationOfficialActivities.tel = res.data.data._InvitationData.tel
+                    that.InvitationOfficialActivities.payDId = res.data.data._CreditCard.payDId;
+                    that.InvitationOfficialActivities.orbitalPrivateTransfer = res.data.data._CreditCard.orbitalPrivateTransfer;
+                    that.InvitationOfficialActivities.payee = res.data.data._CreditCard.payee;
+                    that.InvitationOfficialActivities.id = res.data.data._Invitation.id;
+                    that.InvitationOfficialActivities.diId = res.data.data._Invitation.diId;
+                    that.InvitationOfficialActivities.inviterArea = res.data.data._Invitation.inviterArea;
+                    that.InvitationOfficialActivities.inviter = res.data.data._Invitation.inviter;
+                    that.InvitationOfficialActivities.inviteTime = res.data.data._Invitation.inviteTime;
+                    that.InvitationOfficialActivities.attachment = res.data.data._Invitation.attachment;
+                    that.projectName = res.data.data._Invitation.attachment;
+                    that.InvitationOfficialActivities.inviteCost = res.data.data._Invitation.inviteCost;
+                    that.InvitationOfficialActivities.inviteCurrency = res.data.data._Invitation.inviteCurrency;
+                    that.InvitationOfficialActivities.sendCost = res.data.data._Invitation.sendCost;
+                    that.InvitationOfficialActivities.sendCurrency = res.data.data._Invitation.sendCurrency;
+                    that.InvitationOfficialActivities.eventsCost = res.data.data._Invitation.eventsCost;
+                    that.InvitationOfficialActivities.eventsCurrency = res.data.data._Invitation.eventsCurrency;
+                    that.InvitationOfficialActivities.translateCost = res.data.data._Invitation.translateCost;
+                    that.InvitationOfficialActivities.translateCurrency = res.data.data._Invitation.translateCurrency;
+                    that.InvitationOfficialActivities.isGoOfficaiaBussiness = res.data.data._Invitation.isGoOfficaiaBussiness;
+                    that.InvitationOfficialActivities.remark = res.data.data._Invitation.remark;
+                    that.InvitationOfficialActivities.address = res.data.data._InvitationData.address;
+                    that.InvitationOfficialActivities.contact = res.data.data._InvitationData.contact;
+                    that.InvitationOfficialActivities.job = res.data.data._InvitationData.job;
+                    that.InvitationOfficialActivities.tel = res.data.data._InvitationData.tel;
                     that.IsAuditGM = res.data.data._CreditCard.isAuditGM;
-                    that.InvitationOfficialActivities.email = res.data.data._InvitationData.email
-                    that.InvitationOfficialActivities.fax = res.data.data._InvitationData.fax
-                    that.InvitationOfficialActivities.otherInformation = res.data.data._InvitationData.remark
+                    //
+                    that.InvitationOfficialActivities.consumptionDate = res.data.data._CreditCard.consumptionDate;
+                    that.InvitationOfficialActivities.consumptionPatterns = res.data.data._CreditCard.consumptionPatterns;
+                    that.InvitationOfficialActivities.ctdId = res.data.data._CreditCard.ctdId;
+                    that.InvitationOfficialActivities.bankNo = res.data.data._CreditCard.bankNo;
+                    that.InvitationOfficialActivities.cardholderName = res.data.data._CreditCard.cardholderName;
+                    that.InvitationOfficialActivities.companyBankNo = res.data.data._CreditCard.companyBankNo;
+                    that.InvitationOfficialActivities.otherBankName = res.data.data._CreditCard.otherBankName;
+                    that.InvitationOfficialActivities.otherSideNo = res.data.data._CreditCard.otherSideNo;
+                    that.InvitationOfficialActivities.otherSideName = res.data.data._CreditCard.otherSideName;
+                    //
+                    that.InvitationOfficialActivities.payMoney=res.data.data._CreditCard.payMoney;
+                    that.InvitationOfficialActivities.paymentCurrency=res.data.data._CreditCard.paymentCurrency;
+                    that.InvitationOfficialActivities.email = res.data.data._InvitationData.email;
+                    that.InvitationOfficialActivities.fax = res.data.data._InvitationData.fax;
+                    that.InvitationOfficialActivities.otherInformation = res.data.data._InvitationData.remark;
                     if (that.InvitationOfficialActivities.attachment != null && that.InvitationOfficialActivities.attachment != undefined && that.InvitationOfficialActivities.attachment != "") {
                         that.uploadFiles.push({
                             name: that.InvitationOfficialActivities.attachment,
@@ -511,6 +658,14 @@ export default {
                 );
             }
         },
+        cancelbtn(){
+            this.$router.push({
+                path: "/home/InvitationOfficialActivities",
+                query: {
+                    DiId: this.DiId,
+                }
+            })
+        },
         //点击保存事件
         addBtn() {
             if (this.IsAuditGM == 1) {
@@ -558,9 +713,8 @@ export default {
                                         message: res.data.msg,
                                         type: 'success'
                                     });
-                                    that.loading = true;
                                     setTimeout(() => {
-                                        that.$router.push('/home/InvitationOfficialActivities')
+                                        that.cancelbtn()
                                     }, 500);
                                 } else {
                                     that.$message.error(res.data.msg);
@@ -604,9 +758,8 @@ export default {
                                             message: res.data.msg,
                                             type: 'success'
                                         });
-                                        that.loading = true;
                                         setTimeout(() => {
-                                            that.$router.push('/home/InvitationOfficialActivities')
+                                            that.cancelbtn();
                                         }, 500);
                                     } else {
                                         that.$message.error(res.data.msg);
@@ -729,11 +882,11 @@ export default {
                     console.log("汇率--", res.data.data);
                     that.rateList = res.data.data.teamRates;
                     console.log(that.rateList[0].currencyId)
-                    that.InvitationOfficialActivities.inviteCurrency=that.rateList[0].currencyId;
-                    that.InvitationOfficialActivities.eventsCurrency=that.rateList[0].currencyId;
-                    that.InvitationOfficialActivities.translateCurrency=that.rateList[0].currencyId;
-                    that.InvitationOfficialActivities.sendCurrency=that.rateList[0].currencyId;
-                    that.InvitationOfficialActivities.paymentCurrency=that.rateList[0].currencyId;
+                    // that.InvitationOfficialActivities.inviteCurrency=that.rateList[0].currencyId;
+                    // that.InvitationOfficialActivities.eventsCurrency=that.rateList[0].currencyId;
+                    // that.InvitationOfficialActivities.translateCurrency=that.rateList[0].currencyId;
+                    // that.InvitationOfficialActivities.sendCurrency=that.rateList[0].currencyId;
+                    // that.InvitationOfficialActivities.paymentCurrency=that.rateList[0].currencyId;
                 }
             })
         },
@@ -749,21 +902,12 @@ export default {
     },
 
     mounted() {
-
         this.token = JSON.parse(localStorage.getItem('userinif')).token;
         this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
+        this.InvitationOfficialActivityInitBasicData();
         this.AirTicketResSelect();
         this.id = this.$route.query.id
-        if (this.id != null && this.id != undefined && this.id != 0) {
-            this.InvitationOfficialActivitiesById();
-            this.title = "修改商邀费用";
-            this.InvitationOfficialActivities.status = 2
-            this.isShow = true
-        } else {
-            this.InvitationOfficialActivities.status = 1
-            this.title = "新增商邀费用"
-            this.isShow = false
-        }
+        
         this.DiId = this.$route.query.DiId
         this.QueryRate();
     }

+ 4 - 4
src/router/index.js

@@ -408,10 +408,10 @@ export default new Router({
           path: '/home/InvitationOfficialActivities',
           name: 'InvitationOfficialActivities',
           component: InvitationOfficialActivities,
-          meta: {
-            keepAlive: true, //此组件需要被缓存
-            isBack:false, //用于判断上一个页面是哪个
-          }
+          // meta: {
+          //   keepAlive: true, //此组件需要被缓存
+          //   isBack:false, //用于判断上一个页面是哪个
+          // }
         },
         {
           path: '/home/OpInvitationOfficialActivities',