Pārlūkot izejas kodu

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

liuhj 1 gadu atpakaļ
vecāks
revīzija
26114123ab
1 mainītis faili ar 137 papildinājumiem un 4 dzēšanām
  1. 137 4
      src/components/Finance/Cost.vue

+ 137 - 4
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>
@@ -332,8 +332,11 @@
                                                         <span>{{ AGroupCostParameter[itemsheetone.prop] }}</span>
                                                     </div>
                                                     <div v-else>
-                                                        <el-input v-model="AGroupCostParameter[itemsheetone.prop]"
-                                                            show-word-limit />
+                                                        <!-- <el-input v-model="AGroupCostParameter[itemsheetone.prop]"
+                                                            show-word-limit /> -->
+                                                        <el-input-number v-model="AGroupCostParameter[itemsheetone.prop]"
+                                                            @change="handleChange" :min="0" size="small"
+                                                            :controls="false"></el-input-number>
                                                     </div>
                                                 </div>
                                                 <div v-else-if="itemsheetone.prop === 'ZCB'">
@@ -2075,6 +2078,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 +3926,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 +4052,79 @@ 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": "",
+                "leftInfo": '',
+            };
+
+            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);
+            data.leftInfo = this.GetDomLeftValue();
+            // 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) {
 
@@ -4164,6 +4249,8 @@ export default {
                     }
                 }
             }
+
+
         },
         dateChange(val, index) {
             const regex = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/
@@ -4172,6 +4259,52 @@ 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;
+        },
+        handleChange(currentValue, oldValue) {
+            console.log(currentValue, oldValue);
+            if (currentValue == undefined) {
+
+            }
         }
 
     },