liuhj 2 weeks ago
parent
commit
4d323f6360
1 changed files with 194 additions and 34 deletions
  1. 194 34
      src/components/OP/EntryDetails.vue

+ 194 - 34
src/components/OP/EntryDetails.vue

@@ -1978,43 +1978,203 @@ export default {
             this.PostGroupTeamRateByDiIdAndCTableId();
         },
         eptschedule: debounce(function (val) {
-            var subTypeId = 0
-            if (val == 1) {
-                subTypeId = this.listvalue
-            } else if (val == 2) {
-                subTypeId = this.tablevalue
-            } else {
-                subTypeId = 1
-            }
-            if (subTypeId == "") {
-                this.$message.error('请选择需要导出的表格');
-                return
-            }
-            var url = "/api/Groups/PostEnterExitCostDownload"
-            var that = this
-            this.$axios({
-                method: 'post',
-                url: url,
-                headers: {
-                    Authorization: 'Bearer ' + this.token
-                },
-                data: {
-                    portType: 1,
-                    diId: that.value,
-                    exportType: val,
-                    subTypeId: subTypeId
+            return new Promise((resolve, reject) => {
+                //住宿费
+                this.fullscreenLoading = true
+                var quarterageDatas = [];
+                for (let m = 0; m < this.quarterageData.length; m++) {
+                    if (this.quarterageData[m].nationalTravelFeeId != '') {
+                        quarterageDatas.push({
+                            id: this.quarterageData[m].id,
+                            diId: this.quarterageData[m].diId,
+                            type: this.quarterageData[m].type,
+                            days: this.quarterageData[m].days,
+                            nationalTravelFeeId: this.quarterageData[m].nationalTravelFeeId,
+                            cost: this.quarterageData[m].cost,
+                            currency: this.quarterageData[m].currency,
+                            subTotal: this.quarterageData[m].subTotal,
+                            remark: this.quarterageData[m].remark,
+                        })
+                    }
                 }
-            }).then(function (res) {
-                if (res.data.code == 200) {
-                    that.$message({
-                        type: 'success',
-                        message: res.data.msg
-                    });
-                    window.open(res.data.data.url);
-                } else {
-                    that.$message.error(res.data.msg);
+                //伙食费
+                var boardWagesDatas = [];
+                for (let n = 0; n < this.boardWagesData.length; n++) {
+                    if (this.boardWagesData[n].nationalTravelFeeId != '') {
+                        boardWagesDatas.push({
+                            id: this.boardWagesData[n].id,
+                            diId: this.boardWagesData[n].diId,
+                            type: this.boardWagesData[n].type,
+                            days: this.boardWagesData[n].days,
+                            nationalTravelFeeId: this.boardWagesData[n].nationalTravelFeeId,
+                            cost: this.boardWagesData[n].cost,
+                            currency: this.boardWagesData[n].currency,
+                            subTotal: this.boardWagesData[n].subTotal,
+                            remark: this.boardWagesData[n].remark,
+                        })
+                    }
                 }
+                //公杂费miscellaneousFeeData
+                var miscellaneousFeeDatas = [];
+                for (let b = 0; b < this.miscellaneousFeeData.length; b++) {
+                    if (this.miscellaneousFeeData[b].nationalTravelFeeId != '') {
+                        miscellaneousFeeDatas.push({
+                            id: this.miscellaneousFeeData[b].id,
+                            diId: this.miscellaneousFeeData[b].diId,
+                            type: this.miscellaneousFeeData[b].type,
+                            days: this.miscellaneousFeeData[b].days,
+                            nationalTravelFeeId: this.miscellaneousFeeData[b].nationalTravelFeeId,
+                            cost: this.miscellaneousFeeData[b].cost,
+                            currency: this.miscellaneousFeeData[b].currency,
+                            subTotal: this.miscellaneousFeeData[b].subTotal,
+                            remark: this.miscellaneousFeeData[b].remark,
+                        })
+                    }
+                }
+                //培训费
+                var trainingExpenseDatas = [];
+                for (let p = 0; p < this.trainingExpenseData.length; p++) {
+                    if (this.trainingExpenseData[p].nationalTravelFeeId != '') {
+                        trainingExpenseDatas.push({
+                            id: this.trainingExpenseData[p].id,
+                            diId: this.trainingExpenseData[p].diId,
+                            type: this.trainingExpenseData[p].type,
+                            days: this.trainingExpenseData[p].days,
+                            nationalTravelFeeId: this.trainingExpenseData[p].nationalTravelFeeId,
+                            cost: this.trainingExpenseData[p].cost,
+                            currency: this.trainingExpenseData[p].currency,
+                            subTotal: this.trainingExpenseData[p].subTotal,
+                            remark: this.trainingExpenseData[p].remark,
+                        })
+                    }
+                }
+                //其他费
+                var otherDatas = [];
+                console.log();
+
+                for (let c = 0; c < this.otherData.length; c++) {
+                    if (this.otherData[c].setDataId != '') {
+                        otherDatas.push({
+                            id: this.otherData[c].id,
+                            diId: this.otherData[c].diId,
+                            index: this.otherData[c].index,
+                            setDataId: this.otherData[c].setDataId,
+                            cost: this.otherData[c].cost,
+                            currency: this.otherData[c].currency,
+                            subTotal: this.otherData[c].subTotal,
+                            remark: this.otherData[c].remark,
+                        })
+                    }
+                }
+                var url = "/api/Groups/PostEnterExitCostOperate"
+                var that = this
+                this.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + this.token,
+                        contentType: 'application/json'
+                    },
+                    data: {
+                        portType: 1,
+                        userId: that.userId,
+                        id: that.storageid,
+                        diId: that.value,
+                        choiceOne: that.choiceOne ? 1 : 0,
+                        insidePay: that.DomesticFees.total,
+                        visa: that.DomesticFees.visafees,
+                        visaRemark: that.DomesticFees.visafeesDescription,
+                        yiMiao: that.DomesticFees.vaccinefees,
+                        heSuan: that.DomesticFees.nucleicfees,
+                        service: that.DomesticFees.serviceCharge,
+                        ticket: that.DomesticFees.ticketsExhibitionL,
+                        safe: that.DomesticFees.insurance,
+                        firstItemRemark: that.DomesticFees.firstItemRemark,
+                        choiceTwo: that.choiceTwo ? 1 : 0,
+                        otherExpenses_Checked: that.choiceSeven ? 1 : 0,
+                        sumJJC: that.sumJJC ? 1 : 0,
+                        sumGWC: that.sumGWC ? 1 : 0,
+                        sumTDC: that.sumTDC ? 1 : 0,
+                        outsideJJPay: that.TotalExpenses.EconomyClasstotal,
+                        outsideGWPay: that.TotalExpenses.BusinessClasstotal,
+                        outsideTDPay: that.TotalExpenses.Firstclasstotal,
+                        airJJ: that.TotalExpenses.EconomyClass,
+                        airGW: that.TotalExpenses.BusinessClass,
+                        airTD: that.TotalExpenses.Firstclass,
+                        cityTranffic: that.TotalExpenses.TravellingExpenses,
+                        dayOtherPriceData: otherDatas,
+                        currencys: that.currencys,
+                        choiceThree: that.choiceThree ? 1 : 0,
+                        quarterageData: quarterageDatas,
+                        choiceFour: that.choiceFour ? 1 : 0,
+                        boardWagesData: boardWagesDatas,
+                        choiceFive: that.choiceFive ? 1 : 0,
+                        miscellaneousFeeData: miscellaneousFeeDatas,
+                        choiceSix: that.choiceSix ? 1 : 0,
+                        //加参数
+                        trainingExpenseData: trainingExpenseDatas,
+                        airJJC_Checked: that.airJJC_Checked ? 1 : 0,
+                        airGWC_Checked: that.airGWC_Checked ? 1 : 0,
+                        airTDC_Checked: that.airTDC_Checked ? 1 : 0,
+                    }
+                }).then(function (res) {
+                    if (res.data.code == 200) {
+                        that.$message({
+                            type: 'success',
+                            message: res.data.msg
+                        });
+                        that.GetEnterExitCostInfobyDiId()
+
+                        var subTypeId = 0
+                        if (val == 1) {
+                            subTypeId = that.listvalue
+                        } else if (val == 2) {
+                            subTypeId = that.tablevalue
+                        } else {
+                            subTypeId = 1
+                        }
+                        if (subTypeId == "") {
+                            that.$message.error('请选择需要导出的表格');
+                            return
+                        }
+                        var url = "/api/Groups/PostEnterExitCostDownload"
+                        that.$axios({
+                            method: 'post',
+                            url: url,
+                            headers: {
+                                Authorization: 'Bearer ' + that.token
+                            },
+                            data: {
+                                portType: 1,
+                                diId: that.value,
+                                exportType: val,
+                                subTypeId: subTypeId
+                            }
+                        }).then(function (res) {
+                            if (res.data.code == 200) {
+                                that.$message({
+                                    type: 'success',
+                                    message: res.data.msg
+                                });
+                                window.open(res.data.data.url);
+                            } else {
+                                that.$message.error(res.data.msg);
+                            }
+                        })
+                    } else {
+                        that.fullscreenLoading = false;
+                        that.$message.error(res.data.msg);
+                    }
+                }).catch(function (error) {
+                    that.$message.error(error.message);
+                });
+
+                // this.storageAPI(quarterageDatas, boardWagesDatas, miscellaneousFeeDatas, trainingExpenseDatas, otherDatas)
             })
+
+
+
+            
             // this.storage().then(function () {
             // });
         }, 500, true),