Sfoglia il codice sorgente

修改部分成本导出代码

yuanrf 1 anno fa
parent
commit
1ea79b5fb7
1 ha cambiato i file con 123 aggiunte e 2 eliminazioni
  1. 123 2
      src/components/Finance/Cost.vue

+ 123 - 2
src/components/Finance/Cost.vue

@@ -22,7 +22,7 @@
                     <div class="ser-btn-li">
                         <el-button type="primary">导入收款账单</el-button>
                         <el-button type="primary" @click="GetPriceCheckWord">生成收款账单</el-button>
-                        <el-button type="primary">导出客户报表</el-button>
+                        <el-button type="primary" @click="GetClientWord">导出客户报表</el-button>
                         <el-button type="primary" @click="GetGroupCostExcel">导出成本</el-button>
                         <el-button type="primary" @click="save">保存设置</el-button>
                         <el-button type="primary">一键复制</el-button>
@@ -2075,6 +2075,15 @@ export default {
                 ],
             },
             titleText: [],
+            vehicleLables: ['VF', 'T/G OF', 'T/G S', 'T/G TF', 'C/F OF'],
+            DJMeal: ['B', 'L', 'D'],
+            SubsidizedMeals: ['T/G M', 'C/F M'],
+            NightRepair: ['T/G A'],
+            AttractionsTickets: ['T/G EF', 'EF'],
+            MiscellaneousFees: ['B/R/F', 'TE', 'T/L F'],
+            ATip: ['T/G T', 'DRV T'],
+
+
         };
     },
     watch: {
@@ -3914,7 +3923,7 @@ export default {
                     var file = resp.data.data;
                     that.fileDownload(file.data, file.strFileName);
                 } else {
-                    this.$message.error('操作失败!' + resp.data.msg);
+                    that.$message.error('操作失败!' + resp.data.msg);
                 }
             })
 
@@ -4040,6 +4049,78 @@ export default {
         },
         GetClientWord() {
 
+            var that = this;
+            var data = {
+                "diid": this.diid,
+                "costType": this.costTypevalue,
+                "rate": this.AGroupCostParameter.rate,
+                "carGuides1": "",
+                "meal": "",
+                "subsidizedMeals": "",
+                "nightRepair": "",
+                "attractionsTickets": "",
+                "miscellaneousFees": "",
+                "aTip": "",
+                "tzZCost": ""
+            };
+
+            var vehicleResult = this.GetDJLableBJ(this.vehicleLables);
+            var DJMealResult = this.GetDJLableBJ(this.DJMeal);
+            var SubsidizedMealsResult = this.GetDJLableBJ(this.SubsidizedMeals);
+            var NightRepairResult = this.GetDJLableBJ(this.NightRepair);
+            var AttractionsTicketsResult = this.GetDJLableBJ(this.AttractionsTickets);
+            var DJMealResult = this.GetDJLableBJ(this.DJMeal);
+            var ATipResult = this.GetDJLableBJ(this.ATipResult);
+
+            // vehicleLables: ['VF', 'T/G OF', 'T/G S', 'T/G TF', 'C/F OF'],
+            // DJMeal: ['B', 'L', 'D'],
+            // SubsidizedMeals: ['T/G M', 'C/F M'],
+            // NightRepair: ['T/G A'],
+            // AttractionsTickets: ['T/G EF', 'EF'],
+            // MiscellaneousFees: ['B/R/F', 'TE', 'T/L F'],
+            // ATip: ['T/G T', 'DRV T'],
+
+
+            if (this.costTypevalue === "B") {
+
+                data.carGuides1 = "RMB A段费用 " + vehicleResult.sum + " B段费用 RMB" + vehicleResult.Bsum;
+                data.meal = "RMB A段费用 " + DJMealResult.sum + " B段费用 RMB" + DJMealResult.Bsum;
+                data.subsidizedMeals = "RMB A段费用 " + SubsidizedMealsResult.sum + " B段费用 RMB" + SubsidizedMealsResult.Bsum;
+                data.nightRepair = "RMB A段费用 " + NightRepairResult.sum + " B段费用 RMB" + NightRepairResult.Bsum;
+                data.attractionsTickets = "RMB A段费用 " + AttractionsTicketsResult.sum + " B段费用 RMB" + AttractionsTicketsResult.Bsum;
+                data.miscellaneousFees = "RMB A段费用 " + DJMealResult.sum + " B段费用 RMB" + DJMealResult.Bsum;
+                data.aTip = "RMB A段费用 " + ATipResult.sum + " B段费用 RMB" + ATipResult.Bsum;
+
+            } else {
+                data.carGuides1 = "RMB " + vehicleResult.sum;
+                data.meal = "RMB " + DJMealResult.sum;
+                data.subsidizedMeals = "RMB " + SubsidizedMealsResult.sum;
+                data.nightRepair = "RMB " + NightRepairResult.sum;
+                data.attractionsTickets = "RMB " + AttractionsTicketsResult.sum;
+                data.miscellaneousFees = "RMB " + DJMealResult.sum;
+                data.aTip = "RMB " + ATipResult.sum;
+            }
+
+            var cabinDatalLast = this.cabinDatal.filter(function (x) {
+                return x.label == '团组预算明细'
+            })
+
+            data.tzZCost = cabinDatalLast[0].sheetInfo[0].gtroupQuotes;
+
+            this.$axios.post('/api/Groups/ExportClientWordFile', data, {
+                headers: {
+                    'Authorization': this.token,
+                }
+            }).then(resp => {
+                console.log(resp, '------------------------------------');
+                if (resp.data.code == 200) {
+                    var file = resp.data.data;
+                    that.fileDownload(file.data, file.strFileName);
+                } else {
+                    that.$message.error('操作失败!' + resp.data.msg);
+                }
+            })
+
         },
         insertRow(index, rowParam, oper) {
 
@@ -4172,6 +4253,46 @@ export default {
                 this.tableData[index].date = "";
             }
 
+        },
+        GetDJLableBJ(lableList) {
+            var that = this;
+            var result = { sum: 0, Bsum: 0 };
+            if (typeof lableList != "object" || lableList['length'] == undefined) {
+                return result
+            }
+
+            let Djsum = 0;
+            let BDjsum = 0;
+            for (var i = 0; i < lableList.length; i++) {
+                that.sumTopPrice.forEach(function (item1) {
+                    if (lableList[i] == item1.label) {
+                        var Aprice = Number(item1.Aprice);
+                        if (!isNaN(Aprice)) {
+                            Djsum += Aprice;
+                        }
+
+                        var Bprice = Number(item1.Bprice);
+                        if (!isNaN(Bprice)) {
+                            BDjsum += Bprice;
+                        }
+                    }
+                })
+            }
+
+            Djsum = Djsum * this.AGroupCostParameter.rate * this.AGroupCostParameter.djxs;
+            BDjsum = BDjsum * this.AGroupCostParameter.rate * this.BGroupCostParameter.djxs;
+            if (isNaN(Djsum)) {
+                Djsum = 0;
+            }
+
+            if (isNaN(BDjsum)) {
+                BDjsum = 0;
+            }
+
+            result.sum = Djsum.toFixed(2);
+            result.Bsum = BDjsum.toFixed(2);
+
+            return result;
         }
 
     },