Browse Source

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

liuhj 3 months ago
parent
commit
3de775db15
2 changed files with 333 additions and 100 deletions
  1. 129 87
      src/components/Finance/Cost.vue
  2. 204 13
      src/components/Resource/OpTicketBlackCode.vue

+ 129 - 87
src/components/Finance/Cost.vue

@@ -34,6 +34,15 @@
             </el-dialog>
 
             <el-dialog width="500" title="机票行程数据" :visible.sync="dialogTableVisible">
+                <div>
+                    <el-select @change="blackCodeSelectChange" v-model="blackCodeSelect" clearable
+                        placeholder="请选择机票方案">
+                        <el-option v-for="blackCode in blackCodeListSeLect" :key="blackCode.id" :label="blackCode.title"
+                            :value="blackCode.id">
+                        </el-option>
+                    </el-select>
+                </div>
+                <br />
                 <el-table border :data="gridData">
                     <el-table-column property="day" label="DAY" width="150"></el-table-column>
                     <el-table-column property="date" label="DATE" width="200"></el-table-column>
@@ -410,8 +419,8 @@
             <div style="color: #606266;font-size: 15px;font-weight: 600;">请选择要显示的项:</div>
             <el-checkbox-group class="form-ss"
                 v-model="CheckBoxListSelect.filter(item => item.cbType == 'Top')[0].cbValues" @change="TopChange">
-                <el-checkbox v-for="(  item, index  ) in checkOptions  " :key="index" :title="item.tips"
-                    :label="item.label" @change="(val) => { topcheckboxChange(val, item.label) }"></el-checkbox>
+                <el-checkbox v-for="(item, index) in checkOptions" :key="index" :title="item.tips" :label="item.label"
+                    @change="(val) => { topcheckboxChange(val, item.label) }"></el-checkbox>
             </el-checkbox-group>
             <el-table :stripe='true' class="tables" style="font-size:10px" :summary-method="getSummaries" show-summary
                 show-overflow-tooltip :data="tableData" :border="true" size="small" row-class-name="row"
@@ -419,7 +428,7 @@
 
                 <!-- :height="centerheight" -->
 
-                <template v-for="(  item, index  ) in tableLabel">
+                <template v-for="(item, index) in tableLabel">
                     <el-table-column :key="index" :prop="item.prop"
                         :width="item.width != '100' ? columnWidth : item.width" :label="item.label"
                         v-if="CheckBoxListSelect.filter(item => item.cbType == 'Top')[0].cbValues.includes(item.label)">
@@ -532,7 +541,7 @@
                                             <span style="color:red">暂无数据!</span>
                                         </div>
                                         <div v-else>
-                                            <div v-for="(  item, index  ) in ShowMeals" :key="index">
+                                            <div v-for="(item, index) in ShowMeals" :key="index">
                                                 {{ item.countryOrCity }} &nbsp;&nbsp; <span style="color:green;">{{
                                                     item.price }}</span>元/人
                                                 <span v-if="item.currPrice">(<span style="color:green;">{{
@@ -577,7 +586,7 @@
                                             <span style="color:red">暂无数据!</span>
                                         </div>
                                         <div v-else>
-                                            <div v-for="(  item, index  ) in ShowHotel" :key="index">
+                                            <div v-for="(item, index) in ShowHotel" :key="index">
                                                 {{ item.countryOrCity }} &nbsp;&nbsp; <span style="color:green;">{{
                                                     item.price }}</span>元/人
                                                 <span v-if="item.currPrice">(<span style="color:green;">{{
@@ -712,12 +721,12 @@
                                                                 <!-- :content="itemsheetone.tips" -->
                                                                 <div v-if="itemsheetone.tips != '暂无!'">
                                                                     <span style="color:green">{{ itemsheetone.tips
-                                                                        }}</span>
+                                                                    }}</span>
                                                                     元/人
                                                                 </div>
                                                                 <div v-else>
                                                                     <span style="color:red">{{ itemsheetone.tips
-                                                                        }}</span>
+                                                                    }}</span>
                                                                 </div>
                                                                 <el-input-number slot="reference"
                                                                     v-model="AGroupCostParameter[itemsheetone.prop]"
@@ -833,20 +842,18 @@
                 <div class="cabin-li">
                     <div style="color: #606266;font-size: 15px;font-weight: 600;">请选择要显示的项:</div>
                     <el-checkbox-group v-model="CheckBoxListSelect.filter(item => item.cbType == 'Right')[0].cbValues">
-                        <el-checkbox v-for="(item, index) in cabinoneOptions      " :key="index"
-                            :label="item"></el-checkbox>
+                        <el-checkbox v-for="(item, index) in cabinoneOptions" :key="index" :label="item"></el-checkbox>
                     </el-checkbox-group>
                     <div style="display: flex;">
                         <div :style="{ 'width': costTypevalue == 'A' ? '100%' : '49%' }">
-                            <div v-for="(      cabinitem, index      ) in cabinDatal      " :key="index">
+                            <div v-for="(cabinitem, index) in cabinDatal" :key="index">
                                 <div class="biaoge"
                                     v-if="CheckBoxListSelect.filter(item => item.cbType == 'Right')[0].cbValues.includes(cabinitem.label)">
                                     <div style="    color: rgb(96, 98, 102);font-size: 15px;font-weight: 600;">{{
                                         cabinitem.label }}
                                     </div>
                                     <el-table :data="cabinitem.sheetInfo" border style="width: 100%">
-                                        <el-table-column
-                                            v-for="(      itemcabinone, index      ) in cabinitem.childList      "
+                                        <el-table-column v-for="(itemcabinone, index) in cabinitem.childList"
                                             :key="index" :prop="itemcabinone.prop" :label="itemcabinone.childLabel">
                                             <template slot-scope="scope">
                                                 <div v-if="itemcabinone.prop === 'toll'">
@@ -866,7 +873,7 @@
                                                                     }}元/人</span>
                                                                 <span v-else style="color: red">暂无!</span>
                                                                 <span slot="reference">{{ scope.row[itemcabinone.prop]
-                                                                    }}</span>
+                                                                }}</span>
                                                             </el-popover>
                                                         </span>
                                                         <span v-else>
@@ -874,7 +881,7 @@
                                                                 :title="itemcabinone.title" width="200" trigger="hover">
                                                                 <span style="color: red">暂无!</span>
                                                                 <span slot="reference">{{ scope.row[itemcabinone.prop]
-                                                                    }}</span>
+                                                                }}</span>
                                                             </el-popover>
                                                         </span>
                                                     </span>
@@ -899,7 +906,7 @@
                                                     }}</span>
                                                 <span v-else :title="scope.row[itemcabinone.prop]">{{
                                                     scope.row[itemcabinone.prop]
-                                                }}</span>
+                                                    }}</span>
 
                                             </template>
                                         </el-table-column>
@@ -909,15 +916,14 @@
                         </div>
                         <div style="width: 2%;" v-show="costTypevalue != 'A'"></div>
                         <div style="width: 49%;" v-show="costTypevalue != 'A'">
-                            <div v-for="(      cabinitem, index      ) in BcabinDatal      " :key="index">
+                            <div v-for="(cabinitem, index) in BcabinDatal" :key="index">
                                 <div class="biaogeB"
                                     v-if="CheckBoxListSelect.filter(item => item.cbType == 'Right')[0].cbValues.includes(cabinitem.label)">
                                     <div style="color: rgb(96, 98, 102);font-size: 15px;font-weight: 600;">{{
                                         cabinitem.label }}
                                     </div>
                                     <el-table :data="cabinitem.sheetInfo" border style="width: 100%">
-                                        <el-table-column
-                                            v-for="(      itemcabinone, index      ) in cabinitem.childList      "
+                                        <el-table-column v-for="(itemcabinone, index) in cabinitem.childList"
                                             :key="index" :prop="itemcabinone.prop" :label="itemcabinone.childLabel">
                                             <template slot-scope="scope">
                                                 <div v-if="itemcabinone.prop === 'toll'">
@@ -949,7 +955,7 @@
                                                     }}</span>
                                                 <span v-else :title="scope.row[itemcabinone.prop]">{{
                                                     scope.row[itemcabinone.prop]
-                                                }}</span>
+                                                    }}</span>
 
                                             </template>
                                         </el-table-column>
@@ -975,7 +981,7 @@
                 <el-table ref="singleTable" border @current-change="SelChange"
                     :data="filterdialogSearchInput.slice((currentPage - 1) * pageSize, currentPage * pageSize)"
                     highlight-current-row style="width: 100%">
-                    <el-table-column v-for="       item, index in SeldialogColumn      " :key="index" :prop="item.prop"
+                    <el-table-column v-for="item, index in SeldialogColumn" :key="index" :prop="item.prop"
                         :label="item.title">
                         <template slot-scope="scope">
                             <div>
@@ -3283,14 +3289,16 @@ export default {
             historyCarSelectObject: {},
             historyCarIndex: -1,
             hotelIsTrue: false,
-            rollcallarr: []
+            rollcallarr: [],
+            blackCodeListSeLect: [],
+            blackCodeSelect: '',
         };
     },
     watch: {
         costTypeHotelNumbers: {
             handler(val) {
                 for (var i = 0; i < val.length; i++) {
-                    //console.log(val[i]);
+                    ////console.log(val[i]);
                     if (val[i].tbr == '') {
                         val[i].tbr = 0
                     }
@@ -3315,7 +3323,7 @@ export default {
                     } else {
                         this.centerheight = this.defaultheight + (this.tableData.length * 230) - ((this.tableData.length - 1) * 50);
                     }
-                    //////console.log('高度' + this.centerheight);
+                    ////////console.log('高度' + this.centerheight);
                 }
             }
         }
@@ -3333,8 +3341,8 @@ export default {
         acconinput(val, index) {
             this.acconarr = [];
             this.acconarrs = [];
-            //console.log(val);
-            //console.log(index);
+            ////console.log(val);
+            ////console.log(index);
             for (var i = 0; i < this.tableData.length; i++) {
                 this.acconarr.push(this.tableData[i].accon)
             }
@@ -3344,7 +3352,7 @@ export default {
                 }
             }
             this.acconarrs = Array.from(new Set(this.acconarrs));
-            //console.log(this.acconarrs)
+            ////console.log(this.acconarrs)
             document.querySelectorAll('.accon-ul')[index].classList.add('accons-ul')
         },
         acconclick(val, index) {
@@ -3352,7 +3360,7 @@ export default {
         },
         getSummaries(param) {
             var that = this;
-            ////console.log(param)
+            //////console.log(param)
             const { columns, data } = param;
             const sums = [];
             const sums1 = [];
@@ -3363,11 +3371,11 @@ export default {
             var ATime = { start: that.addOneDay(that.AGroupCostParameter.costTypeStartTime, 0), end: that.addOneDay(that.AGroupCostParameter.costTypeendTime, 0) };
             var BTime = { start: that.addOneDay(that.BGroupCostParameter.costTypeStartTime, 0), end: that.addOneDay(that.BGroupCostParameter.costTypeendTime, 0) };
 
-            //////console.log('ATime,BTime', ATime, BTime);
+            ////////console.log('ATime,BTime', ATime, BTime);
             var data1 = [];
             var data2 = [];
 
-            //////console.log('datas', data);
+            ////////console.log('datas', data);
 
             if (that.costTypevalue == 'B') {
                 for (var i = 0; i < thisData.length; i++) {
@@ -3392,7 +3400,7 @@ export default {
                     that.peopleNumber = Number(that.AGroupCostParameter.costTypenumber);
                 }
             }
-            ////console.log('3data', thisData, data1, data2);
+            //////console.log('3data', thisData, data1, data2);
             columns.forEach((column, index) => {
                 if (index === 0) {
                     prices[index] = "总计:";
@@ -3499,9 +3507,9 @@ export default {
                 }
             });
             this.titleText = texts;
-            //////console.log(that.sumTopPrice, 'sumTopPrice---------------');
+            ////////console.log(that.sumTopPrice, 'sumTopPrice---------------');
             this.CalculatedPrice();
-            ////////console.log(that.sumTopPrice, '------------');
+            //////////console.log(that.sumTopPrice, '------------');
             setTimeout(() => {
                 this.setLastTitle(prices);
                 if (that.costTypevalue == 'B') {
@@ -3516,7 +3524,7 @@ export default {
             return prices;
         },
         handleEdit(index, row, buttonIndex) {
-            ////////console.log(index, row, buttonIndex);
+            //////////console.log(index, row, buttonIndex);
             this.rowIndex = index; // 行的索引
             var api = '';
             switch (buttonIndex) {
@@ -3558,7 +3566,7 @@ export default {
                     'Authorization': that.token,
                 }
             }).then(resp => {
-                //////console.log(resp.data.data, '------------------------------------');
+                ////////console.log(resp.data.data, '------------------------------------');
                 that.outerVisible = true;
                 if (resp.data.code == 200) {
                     that.dialogTableData = resp.data.data;
@@ -3570,7 +3578,7 @@ export default {
 
         },
         handleDelete(index, row, rows) {
-            //////console.log(index, row, rows);
+            ////////console.log(index, row, rows);
             this.$confirm('此操作将删除该条信息, 是否继续?', '提示', {
                 confirmButtonText: '确定',
                 cancelButtonText: '取消',
@@ -3591,7 +3599,7 @@ export default {
         },
         //减
         increase(val) {
-            //console.log(this.tableData[val]);
+            ////console.log(this.tableData[val]);
             if (this.tableData[val].day == "-") {
                 this.tableData[val].day = 0
             }
@@ -3691,7 +3699,7 @@ export default {
                 setTimeout(() => {
                     that.PostTourClientListByDiId(id);
                 }, 1000)
-                //////console.log(resp.data.data, '------------------------------------');
+                ////////console.log(resp.data.data, '------------------------------------');
                 if (resp.data.code == 200) {
 
                     that.options = resp.data.data.groupList;
@@ -3714,7 +3722,7 @@ export default {
                             for (var i = 0; i < that.CheckBoxListSelect.length; i++) {
                                 if (item.cbType == that.CheckBoxListSelect[i].cbType) {
                                     that.CheckBoxListSelect[i].cbValues = item.cbValues.split(',');
-                                    //////console.log(item.cbValues.split(','));
+                                    ////////console.log(item.cbValues.split(','));
                                     break;
                                 }
                                 if (that.CheckBoxListSelect[i].diid == 0) {
@@ -3756,10 +3764,10 @@ export default {
 
                     if (resp.data.data.groupCost.length > 0) {
                         that.tableData = resp.data.data.groupCost;
-                        //console.log(that.tableData);
+                        ////console.log(that.tableData);
                         for (var i = 0; i < that.tableData.length; i++) {
                             for (var prop in that.tableData[i]) {
-                                //console.log(that.tableData[i][prop]);
+                                ////console.log(that.tableData[i][prop]);
                                 if (that.tableData[i][prop] == 0) {
                                     that.tableData[i][prop] = ''
                                 }
@@ -3819,7 +3827,7 @@ export default {
                         if (acostvalue != undefined) {
                             that.AGroupCostParameter = acostvalue;
                             that.isShare = that.AGroupCostParameter.isShare;//是否通知
-                            //console.log(that.AGroupCostParameter)
+                            ////console.log(that.AGroupCostParameter)
                             var result = Number(that.AGroupCostParameter.currency);
                             if (isNaN(result)) {
 
@@ -4156,10 +4164,10 @@ export default {
                                 let item = that.equalWhere[j];
                                 for (var p in item) {
                                     if (baoPi[i].type == p) {
-                                        //////console.log("key:" + p + "已经匹配 value:" + item[p]);
+                                        ////////console.log("key:" + p + "已经匹配 value:" + item[p]);
                                         for (var m = 0; m < that.sheetDatal.length; m++) {
                                             if (that.sheetDatal[m].EnLabel == item[p]) {
-                                                //////console.log(" 1 key:" + that.sheetDatal[m].EnLabel + "已经匹配 1 value:" + baoPi[i].price);
+                                                ////////console.log(" 1 key:" + that.sheetDatal[m].EnLabel + "已经匹配 1 value:" + baoPi[i].price);
                                                 that.sheetDatal[m].childList[0].tips = baoPi[i].price;
                                             }
                                         }
@@ -4274,7 +4282,7 @@ export default {
                         this.AGroupCostParameter.lyjrs = number;
                     }
 
-                    //console.log(pNumber, 'pNumber-------------');
+                    ////console.log(pNumber, 'pNumber-------------');
                     if (this.grouptitleinfo.visitPNumber != pNumber) {
                         this.$message.error('团组人数与房间人数不一致!')
                         return resolve(false);
@@ -4332,7 +4340,7 @@ export default {
 
                     var ResultCostArr = this.Dataformat();
                     Data.groupCosts = ResultCostArr;
-                    //////console.log(Data, "save-------Data");
+                    ////////console.log(Data, "save-------Data");
 
                     var that = this;
                     this.$axios.post('/api/Groups/SaveGroupCost', Data, {
@@ -4340,7 +4348,7 @@ export default {
                             'Authorization': that.token,
                         }
                     }).then(resp => {
-                        //////console.log(resp.data.data, '------------------------------------');
+                        ////////console.log(resp.data.data, '------------------------------------');
                         if (resp.data.code == 200) {
                             this.$message({
                                 message: '保存成功!',
@@ -4588,7 +4596,7 @@ export default {
             this.currentPage = val;
         },
         SelChange(row, oldrow) {
-            //////console.log(row, oldrow);
+            ////////console.log(row, oldrow);
             this.dialogSelectObject = row;
         },
         handleSizeChange(val) {
@@ -4711,8 +4719,8 @@ export default {
             SUITEsum = (SUITEsum * rate).toFixed(2);
             BSUITEsum = (BSUITEsum * rate).toFixed(2);
 
-            // //////console.log(Djsum, GWsum, LYJsum, 'Djsum,GWsum,LYJsum');
-            // //////console.log(SGRsum, TBRsum, JSESsum, SUITEsum, 'SGRsum,TBRsum,JSESsum,SUITEsum');
+            // ////////console.log(Djsum, GWsum, LYJsum, 'Djsum,GWsum,LYJsum');
+            // ////////console.log(SGRsum, TBRsum, JSESsum, SUITEsum, 'SGRsum,TBRsum,JSESsum,SUITEsum');
 
             var sgrfilter = this.costTypeHotelNumbers.filter(x => {
                 return x.type == 'Default'
@@ -4929,7 +4937,7 @@ export default {
             rightCheckArr = [...new Set(rightCheckArr)];
 
             try {
-                //console.log('rightCheckArr', rightCheckArr);
+                ////console.log('rightCheckArr', rightCheckArr);
                 this.CheckBoxListSelect.filter(item => item.cbType == 'Right')[0].cbValues = rightCheckArr;
             } catch (e) { }
 
@@ -5052,7 +5060,7 @@ export default {
             }
         },
         NumberSetTime(number, index) {
-            //console.log(number, index, this.grouptitleinfo.visitStartDate);
+            ////console.log(number, index, this.grouptitleinfo.visitStartDate);
             number = parseInt(number);
             if (!isNaN(number)) {
                 var time = this.addOneDay(this.grouptitleinfo.visitStartDate, number - 1)
@@ -5076,7 +5084,7 @@ export default {
             return `${year}-${month}-${day}`;
         },
         costTypeSelect(val) {
-            //////console.log('costTypeSelect--------------------------------------------------------', val);
+            ////////console.log('costTypeSelect--------------------------------------------------------', val);
         },
         async formVerify() {
             return new Promise((resolve, reject) => {
@@ -5110,7 +5118,7 @@ export default {
             })
         },
         topcheckboxChange(val, label) {
-            // //console.log(val, label, 'topcheckboxChangeval');
+            // ////console.log(val, label, 'topcheckboxChangeval');
             var that = this;
             if (!val) {
                 this.$confirm('此操作将清空整列数据, 是否继续?', '提示', {
@@ -5195,11 +5203,11 @@ export default {
                             for (var i = 0; i < that.tableData.length; i++) {
                                 that.tableData[i][prop] = initval;
                             }
-                            //////console.log(that.tableData, 'that.tableData数据');
+                            ////////console.log(that.tableData, 'that.tableData数据');
                         }
 
                     }
-                    //////console.log('确定清空数据');
+                    ////////console.log('确定清空数据');
                     var fliterList = this.sumTopPrice.filter(x => x.label == label);
                     if (fliterList.length != 0) {
                         fliterList[0].Aprice = 0;
@@ -5258,7 +5266,7 @@ export default {
                         for (var i = 0; i < that.tableData.length; i++) {
                             that.tableData[i][prop] = initval;
                         }
-                        //////console.log(that.tableData, 'that.tableData数据');
+                        ////////console.log(that.tableData, 'that.tableData数据');
                     }
 
                     this.$message({
@@ -5297,7 +5305,7 @@ export default {
                     'Authorization': this.token,
                 }
             }).then(resp => {
-                //////console.log(resp.data.data, '------------------------------------');
+                ////////console.log(resp.data.data, '------------------------------------');
                 if (resp.data.code == 200) {
                     this.isShare = resp.data.data.isShare;
                     this.$message({
@@ -5510,7 +5518,7 @@ export default {
                     'Authorization': this.token,
                 }
             }).then(resp => {
-                //////console.log(resp, '------------------------------------');
+                ////////console.log(resp, '------------------------------------');
                 try {
                     if (resp.data.code != 200) {
                         throw resp.data.msg;
@@ -5542,7 +5550,7 @@ export default {
         },
         async GetGroupCostExcel() {
 
-            //////console.log(this.titleText, 'this.titleText');
+            ////////console.log(this.titleText, 'this.titleText');
 
             var isTrue = await this.save();
             if (!isTrue) {
@@ -5598,14 +5606,14 @@ export default {
             data.rightInfo = rightObject;
             data.titleModel = this.titleText;
 
-            //////console.log(data);
+            ////////console.log(data);
 
             this.$axios.post('/api/Groups/ExportGroupCostExcelFile', data, {
                 headers: {
                     'Authorization': this.token,
                 }
             }).then(resp => {
-                //////console.log(resp, '------------------------------------');
+                ////////console.log(resp, '------------------------------------');
                 if (resp.data.code == 200) {
                     var file = resp.data.data;
                     that.fileDownload(file.data, file.strFileName);
@@ -5800,7 +5808,7 @@ export default {
                     'Authorization': this.token,
                 }
             }).then(resp => {
-                //////console.log(resp, '------------------------------------');
+                ////////console.log(resp, '------------------------------------');
                 if (resp.data.code == 200) {
                     var file = resp.data.data;
                     that.fileDownload(file.data, file.strFileName);
@@ -5870,10 +5878,10 @@ export default {
                 that.tableData.splice(index + 1, 0, row)
             }
 
-            //////console.log('that.tableData', that.tableData)
+            ////////console.log('that.tableData', that.tableData)
             var thisDay = 1;
             for (var i = 0; i < that.tableData.length; i++) {
-                //////console.log("iiiiiiiiiiiiiiii", i, Number(that.tableData.day))
+                ////////console.log("iiiiiiiiiiiiiiii", i, Number(that.tableData.day))
                 if (Number(that.tableData[i].day) > 0) {
                     that.tableData[i].day = thisDay;
                     thisDay++;
@@ -5934,13 +5942,13 @@ export default {
                 }
             }
 
-            //////console.log(numberList, "numberList!");
-            //////console.log(that.tableData, "that.tableData!");
+            ////////console.log(numberList, "numberList!");
+            ////////console.log(that.tableData, "that.tableData!");
             for (var i = 0; i < that.tableData.length; i++) {
                 that.tableData[i].day = that.tableData[i].day.toString();
                 for (var j = 0; j < numberList.length; j++) {
                     if (that.tableData[i][numberList[j]] === "") {
-                        //////console.log(i + "行数据异常!", numberList[j]);
+                        ////////console.log(i + "行数据异常!", numberList[j]);
                         that.tableData[i][numberList[j]] = 0;
                     }
                 }
@@ -5998,7 +6006,7 @@ export default {
             return result;
         },
         handleChange(currentValue, oldValue) {
-            //////console.log(currentValue, oldValue);
+            ////////console.log(currentValue, oldValue);
             if (currentValue == undefined) {
 
             }
@@ -6011,7 +6019,7 @@ export default {
                     var weekday = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
                     return weekday[myDay];
                 } catch (e) {
-                    //////console.log("时间格式不正确!")
+                    ////////console.log("时间格式不正确!")
                     return "时间格式不正确!";
                 }
             }
@@ -6104,7 +6112,7 @@ export default {
             }).then(function (res) {
                 if (res.data.code == 200) {
                     //汇率
-                    ////console.log("汇率--", res.data.data);
+                    //////console.log("汇率--", res.data.data);
                     that.currencyOption = res.data.data.teamRates;
                 }
             })
@@ -6112,7 +6120,7 @@ export default {
 
         },
         changeCurrency(data) {
-            ////console.log('data', data);
+            //////console.log('data', data);
             for (let index = 0; index < this.currencyOption.length; index++) {
                 if (this.currencyOption[index].currencyId == data) {
                     this.AGroupCostParameter.rate = this.currencyOption[index].rate;
@@ -6121,7 +6129,7 @@ export default {
             }
         },
         inSelectChangeCheck() {
-            ////console.log('inSelectChangeCheck');
+            //////console.log('inSelectChangeCheck');
             var arr = [];
             var pusharr = [];
             var topArr = [];
@@ -6182,7 +6190,7 @@ export default {
             var topResultArr = topCheck.filter(item => !topArr.includes(item));
             resultArr = [...resultArr, ...pusharr];
             resultArr = [...new Set(resultArr)];
-            ////console.log('resultArr', resultArr);
+            //////console.log('resultArr', resultArr);
             topResultArr = [...topResultArr, ...topPushArr];
             topResultArr = [...new Set(topResultArr)];
             this.CheckBoxListSelect.filter(item => item.cbType == 'Left')[0].cbValues = resultArr;
@@ -6232,6 +6240,7 @@ export default {
             }
         },
         importBlackCode() {
+            this.blackCodeSelect = '';
             this.gridData = [];
             var url = "/api/Groups/CraeteGroupCostTravel"
             var that = this
@@ -6246,11 +6255,13 @@ export default {
                 }
             }).then(function (resp) {
                 if (resp.data.code == 200) {
-                    //console.log('CraeteGroupCostTravelResponse', resp.data.data);
-                    that.gridData = resp.data.data.groupCost;
+                    ////console.log('CraeteGroupCostTravelResponse', resp.data.data);
+                    //that.gridData = resp.data.data.groupCost;
                     that.blackCodeIsTrue = resp.data.data.blackCodeIsTrue;
                     if (that.blackCodeIsTrue) {
                         that.dialogTableVisible = true;
+                        that.blackCodeListSeLect = resp.data.data.blackCodeListSelect;
+                        //console.log('that.blackCodeListSeLect', that.blackCodeListSeLect);
                     } else {
                         that.$message.error("机票数据未录入!");
                     }
@@ -6270,6 +6281,12 @@ export default {
         },
         //机票行程确认赋值
         confirmationTP() {
+
+            if (this.gridData.length == 0) {
+                this.$message.error("此机票代码无行程!");
+                return
+            }
+
             this.tableData = this.gridData;
             for (var i = 0; i < this.tableData.length; i++) {
                 for (var prop in this.tableData[i]) {
@@ -6314,7 +6331,7 @@ export default {
                 try {
                     clearTimeout(window.myTimer);
                 } catch (e) {
-                    //console.log("setTimerMessage", e.message);
+                    ////console.log("setTimerMessage", e.message);
                 }
             }
             window.myTimer = setInterval(this.SaveAndLogOut, mm * 30);
@@ -6327,10 +6344,10 @@ export default {
                     type: 'success',
                     message: '已退出!'
                 });
-                //console.log("保存成功,已退出!");
+                ////console.log("保存成功,已退出!");
             }).catch(e => {
-                //console.log(e);
-                console.log("保存失败,仅停止自动保存!");
+                ////console.log(e);
+                //console.log("保存失败,仅停止自动保存!");
                 clearInterval(this.autoSave);
             })
         },
@@ -6368,7 +6385,7 @@ export default {
                     that.tableDatas = res.data.data;
                     that.checkboxsXJ = [];
                     that.hotelIsTrue = res.data.data.length > 0 ? true : false;
-                    //console.log(res);
+                    ////console.log(res);
                 } else {
                     that.$message.error(res.data.msg);
                 }
@@ -6386,7 +6403,7 @@ export default {
             var selectArr = this.tableDatas.filter((x) => {
                 return this.checkboxsXJ.includes(x.id);
             });
-            ////console.log(selectArr,'selectArr-----------------------');
+            //////console.log(selectArr,'selectArr-----------------------');
             if (selectArr.length != 0) {
                 for (var i = 0; i < selectArr.length; i++) {
                     var startTime = this.addOneDay(selectArr[i].checkInDate, 0);
@@ -6404,7 +6421,7 @@ export default {
                             flitertabs[j].jS_ES = selectArr[i].suitePrice * selectArr[i].suiteQuantity;
                             flitertabs[j].suite = selectArr[i].otherPrice * selectArr[i].otherQuantity;
                         }
-                        //console.log('flitertabs',flitertabs);
+                        ////console.log('flitertabs',flitertabs);
                     }
                 }
                 this.dialogTableVisibleXJ = false;
@@ -6434,7 +6451,7 @@ export default {
             }).then(function (res) {
                 that.historyCarData = [];
                 if (res.data.code == 200) {
-                    console.log(res.data.data)
+                    //console.log(res.data.data)
                     that.historyCarData = res.data.data;
                 } else {
                     that.$message.error(res.data.msg);
@@ -6446,11 +6463,11 @@ export default {
             this.currentPage = 1;
         },
         historyCarChange(row, oldrow) {
-            //console.log(row, oldrow);
+            ////console.log(row, oldrow);
             this.historyCarSelectObject = row;
         },
         historyCarYes() {
-            //console.log(this.historyCarSelectObject,'historyCarSelectObject');
+            ////console.log(this.historyCarSelectObject,'historyCarSelectObject');
             if (this.historyCarIndex != -1) {
                 this.tableData[this.historyCarIndex].carCost = this.historyCarSelectObject.dayPrice;
             }
@@ -6527,7 +6544,7 @@ export default {
                             id: this.diid
                         }
                     }).then((res) => {
-                        //console.log(res);
+                        ////console.log(res);
                         if (res.data.code == 200) {
                             if (this.grouptitleinfo.visitPNumber != res.data.data.visitPNumber) {
                                 this.grouptitleinfo.visitPNumber = res.data.data.visitPNumber;
@@ -6542,6 +6559,31 @@ export default {
                 }
             })
         },
+        blackCodeSelectChange(val) {
+            //获取行程
+            var that = this
+            var url = "/api/Groups/CraeteGroupCostTravelById"
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + that.token
+                },
+                data: {
+                    diid: this.diid,
+                    BlackCodeId: val
+                }
+            }).then(function (res) {
+                //console.log(res, "res");
+                if (res.data.code == 200) {
+                    that.gridData = res.data.data.groupCost;
+                    //console.log('that.gridData', that.gridData);
+                } else {
+                    that.gridData = [];
+                    that.$message.error("此行程代码有误!");
+                }
+            })
+        }
     },
     updated() {
         this.$emit('transfer', true)
@@ -6602,7 +6644,7 @@ export default {
             })
         },
         columnWidth() {
-            //console.log(this.CheckBoxListSelect.filter(item => item.cbType == 'Top')[0].cbValues.length);
+            ////console.log(this.CheckBoxListSelect.filter(item => item.cbType == 'Top')[0].cbValues.length);
             if (this.CheckBoxListSelect.filter(item => item.cbType == 'Top')[0].cbValues.length < 22) {
                 return 74
             }

+ 204 - 13
src/components/Resource/OpTicketBlackCode.vue

@@ -71,7 +71,7 @@
                 <div style="display: flex;">
                     <div style="width: 60%;">
                         <el-form-item label="黑屏代码:" prop="blackCode" label-width="160px">
-                            <el-input type="textarea" :rows="14"
+                            <el-input @input="parseAirData" type="textarea" :rows="14"
                                 placeholder="请严格遵守此格式!!! 1. EK363 R1 WE08MAR CANDXB HK7 0015 0515 SEAME 2 3 (注意空格以及多条数据换行)"
                                 v-model="OpTicketBlackCodeData.blackCode"></el-input>
                         </el-form-item>
@@ -120,6 +120,16 @@
             </el-form>
 
         </div>
+        <div id="testTable">
+            <el-table border :data="tableData" style="width: 100%">
+                <el-table-column v-for="column in columns" :key="column.prop" :prop="column.prop" :label="column.label"
+                    :width="column.width">
+                    <template slot-scope="scope">
+                        <el-input v-model="scope.row[column.prop]" :disabled="column.prop === 'id'"></el-input>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </div>
     </div>
 </template>
 <script>
@@ -169,6 +179,66 @@ export default {
                 title: [
                     { required: true, message: '该信息为必填信息', trigger: ['blur', 'change'] },
                 ],
+            },
+            //-------------------------
+            flightData: [
+                {
+                    type: "经济现价",
+                    prices: {
+
+                    },
+                    total: 0
+                },
+                {
+                    type: "经济全价",
+                    prices: {
+
+                    },
+                    total: 0
+                },
+                {
+                    type: "公务现价",
+                    prices: {
+
+                    },
+                    total: 0
+                },
+                {
+                    type: "公务全价",
+                    prices: {
+
+                    },
+                    total: 0
+                },
+                {
+                    type: "头等现价",
+                    prices: {
+
+                    },
+                    total: 0
+                },
+                {
+                    type: "头等全价",
+                    prices: {
+
+                    },
+                    total: 0
+                }
+            ],
+            tableData: [],
+            columns: [
+
+            ],
+            PushColumns: [],
+            fiexedColumns: [{ prop: 'type', label: '票价类型', width: 180 },
+            { prop: 'total', label: '合计', width: 180 }],
+            settingValue: {
+                "经济现价": "price",
+                "经济全价": "ecPrice",
+                "公务现价": "nowPrice",
+                "公务全价": "bcPrice",
+                "头等现价": "fcNowPrice",
+                "头等全价": "fcPrice"
             }
         }
     },
@@ -191,13 +261,10 @@ export default {
             }).then(function (res) {
                 if (res.data.code == 200) {
                     that.DelegationSelect = res.data.data;
-                    that.QueryTicketBlackCodeById()
                 }
-
             })
         },
         QueryTicketBlackCodeById() {
-            debugger
             var url = "/api/Resource/QueryTicketBlackCodeById"
             var that = this
             this.$axios({
@@ -212,11 +279,10 @@ export default {
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
-                    debugger
-                    that.delegationInfo = res.data.data.delegationInfo
-                    that.airGroupCostParameter = res.data.data.groupCostParameter
-                    if (res.data.data.ticketBlackCode != null) {
-                        var TicketBlackCode = res.data.data.ticketBlackCode
+                    that.delegationInfo = res.data.data.delegationInfo;
+                    that.airGroupCostParameter = res.data.data.groupCostParameter;
+                    if (res.data.data.ticketBlackCode) {
+                        var TicketBlackCode = res.data.data.ticketBlackCode;
                         that.OpTicketBlackCodeData.id = TicketBlackCode.id
                         that.OpTicketBlackCodeData.diId = TicketBlackCode.diId
                         that.OpTicketBlackCodeData.blackCode = TicketBlackCode.blackCode
@@ -226,9 +292,13 @@ export default {
                         that.OpTicketBlackCodeData.ecPrice = TicketBlackCode.ecPrice
                         that.OpTicketBlackCodeData.remark = TicketBlackCode.remark
                         that.OpTicketBlackCodeData.title = TicketBlackCode.title;
+
+                        for (var key in that.settingValue) {
+                            that.flightData.filter(item => item.type == key)[0].total = TicketBlackCode[that.settingValue[key]];
+                        }
                     }
                 }
-
+                that.parseAirData();
             })
         },
         //跳转
@@ -253,9 +323,14 @@ export default {
             const that = this;
             that.$refs.OpTicketBlackCodeData.validate((valid) => {
                 if (valid) {
+
+                    that.parseAirData();
                     var url = "/api/Resource/OpTicketBlackCode"
                     that.OpTicketBlackCodeData.createUserId = that.userId;
                     that.OpTicketBlackCodeData.diId = that.DiId
+                    that.OpTicketBlackCodeData.price = that.OpTicketBlackCodeData.price.toString();
+                    that.OpTicketBlackCodeData.nowPrice = that.OpTicketBlackCodeData.nowPrice.toString();
+
                     that.$axios({
                         method: 'post',
                         url: url,
@@ -273,7 +348,7 @@ export default {
                             setTimeout(() => {
                                 that.back();
                                 // that.$router.push('/home/TicketBlackCode')
-                            }, 3000);
+                            }, 1000);
                         } else {
                             that.$message.error(res.data.msg);
                         }
@@ -283,7 +358,119 @@ export default {
                     return false;
                 }
             })
-        }
+        },
+        parseAirData() {
+            var data = this.OpTicketBlackCodeData.blackCode;
+            // 按行分割数据
+            const lines = data.trim().split('\n');
+
+            // 提取航司的函数
+            function extractAirline(line) {
+                // 使用正则表达式匹配航司代码(两个大写字母或一个大写字母加一个数字)
+                const match = line.match(/[A-Z]{2}|[A-Z]\d/);
+                return match ? match[0] : null;
+            }
+
+            // 解析每一行并提取航司
+            var flightNumbers = lines.map(line => {
+                // 使用正则表达式匹配航班号(假设航班号是字母+数字的组合)
+                const match = line.match(/[A-Z]{2}\d+/);
+                console.log(match, "match ");
+                return match ? match[0] : null;
+            });
+
+            flightNumbers = flightNumbers.filter(item => item);
+
+            //console.log(flightNumbers, "flightNumbers ");
+
+            this.PushColumns = flightNumbers.map(flightNumber => {
+                return {
+                    prop: flightNumber,
+                    label: flightNumber,
+                    width: 100
+                }
+            })
+
+            // {
+            //         type: "公务全价",
+            //         prices: {
+            //             FM: 55320,
+            //             EK: 22883,
+            //             "3U": 33608
+            //         },
+            //         total: 111811
+            //     }
+
+            var that = this;
+
+            //console.log(this.tableData, "this.tableData ");
+
+            this.tableData.forEach(item => {
+                that.flightData.forEach(flight => {
+                    if (flight.type == item.type) {
+                        var columns = that.PushColumns.map(x => x.prop);
+                        for (var i = 0; i < columns.length; i++) {
+                            flight.prices[columns[i]] = item[columns[i]];
+                        }
+                    }
+                })
+
+                for (var key in that.settingValue) {
+                    if (item.type == key) {
+                        that.OpTicketBlackCodeData[that.settingValue[key]] = Number(item.total);
+                        break;
+                    }
+                }
+            })
+
+            this.flightData.forEach(item => {
+                //遍历item.prices
+                for (var key in item.prices) {
+                    //判断key是否存在that.PushColumns中
+                    var isExist = false;
+                    for (var i = 0; i < that.PushColumns.length; i++) {
+                        if (that.PushColumns[i].prop == key) {
+                            isExist = true;
+                            break;
+                        }
+                    }
+                    //不存在就删除item.prices中的key
+                    if (!isExist) {
+                        delete item.prices[key];
+                    }
+                }
+
+                that.PushColumns.forEach(column => {
+                    //判断item.prices中是否存在column.prop
+                    if (item.prices[column.prop]) {
+                        return;
+                    } else {
+                        item.prices[column.prop] = 0;
+                    }
+                })
+            })
+
+            console.log(this.flightData, "this.flightData ");
+            console.log(this.columns, "this.columns ");
+            this.transformData();
+        },
+        //----------------------
+        transformData() {
+
+            this.columns = [];
+            this.columns.push(...this.fiexedColumns);
+            this.columns.splice(1, 0, ...this.PushColumns);
+            this.tableData = [];
+            this.tableData = this.flightData.map(item => {
+                const tableItem = { type: item.type, total: item.total };
+                for (let column of this.columns) {
+                    if (column.prop !== 'type' && column.prop !== 'total') {
+                        tableItem[column.prop] = item.prices[column.prop];
+                    }
+                }
+                return tableItem;
+            });
+        },
     },
 
     mounted() {
@@ -294,15 +481,19 @@ export default {
         this.id = this.$route.query.id
         this.DiId = parseInt(this.$route.query.DiId)
         this.DelegationSelectFun()
+
         var that = this
-        if (that.DiId != undefined && that.id != undefined) {
+        if (that.DiId && that.id) {
             that.OpTicketBlackCodeData.status = 2;
             that.isShow = true
         } else {
             that.isShow = false
             that.OpTicketBlackCodeData.status = 1;
         }
+
         that.QueryTicketBlackCodeById();
+        //-------
+        //this.transformData();
     }
 }
 </script>