liuhj 2 weeks ago
parent
commit
58698b953a
1 changed files with 206 additions and 41 deletions
  1. 206 41
      src/components/OP/EntryDetailsdraft.vue

+ 206 - 41
src/components/OP/EntryDetailsdraft.vue

@@ -2,10 +2,10 @@
     <div v-loading.fullscreen.lock="fullscreenLoading">
         <div class="Entrydraft-all">
             <div class="Entrydraft-head">
-                <div class="Entrydraft-head-li" style="width:320px">
+                <div class="Entrydraft-head-li" style="width:270px">
                     <label>草稿名称:</label>
                     <el-autocomplete
-                    style="width:250px"
+                    style="width:200px"
                     class="inline-input"
                     v-model="valuename"
                     :fetch-suggestions="querySearch"
@@ -701,8 +701,6 @@ export default {
             };
         },
         handleSelect(item) {
-            console.log(item);
-            console.log(this.value);
             this.value=item.id;
             this.GetEnterExitCostInfobyDiId();
             this.PostGroupTeamRateByDiIdAndCTableId();
@@ -1891,7 +1889,6 @@ export default {
         },
         //保存
         storage: debounce(function () {
-            console.log(this.currencys);
             return new Promise((resolve, reject) => {
                 //住宿费
                 this.fullscreenLoading = true
@@ -2075,45 +2072,213 @@ 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/EnterExitCostDraftDownload"
-            var that = this
-            this.$axios({
-                method: 'post',
-                url: url,
-                headers: {
-                    Authorization: 'Bearer ' + this.token
-                },
-                data: {
-                    portType: 1,
-                    id: 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/EnterExitCostDraftOp"
+                var that = this
+                let filteredObjects = that.draftNameDatas.filter(obj =>
+                    that.valuename == obj.value
+                );
+                if (filteredObjects.length < 1) {
+                    that.value = 0;
+                }
+                this.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + this.token,
+                        contentType: 'application/json'
+                    },
+                    data: {
+                        portType: 1,
+                        userId: that.userId,
+                        id: that.value,
+                        draftName: that.valuename,
+                        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
+                        });
+                        if (that.value == 0) {
+                            that.value = res.data.data.sign;
+                            that.draftNameDatas.push({
+                                id: res.data.data.sign,
+                                value: res.data.data.draftName,
+                            })
+                        }
+
+
+                        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/EnterExitCostDraftDownload"
+                        that.$axios({
+                            method: 'post',
+                            url: url,
+                            headers: {
+                                Authorization: 'Bearer ' + that.token
+                            },
+                            data: {
+                                portType: 1,
+                                id: 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);
+                            }
+                        })
+                        that.GetEnterExitCostInfobyDiId()
+                    } 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),
         //
         calculation() {