liuhj 4 months ago
parent
commit
7ddf69387a
2 changed files with 104 additions and 5 deletions
  1. 23 3
      src/components/OP/SuppliesInventory.vue
  2. 81 2
      src/components/statistics/Statistically.vue

+ 23 - 3
src/components/OP/SuppliesInventory.vue

@@ -440,6 +440,15 @@
                     clearable>
                     </el-input>
                 </div>
+                <div class="additems-li">
+                    <label>单位:</label>
+                    <el-input
+                    style="width:250px"
+                    placeholder="请输入单位"
+                    v-model="unit"
+                    clearable>
+                    </el-input>
+                </div>
             </div>
             <div>
                 <label>备注:</label>
@@ -624,13 +633,18 @@
                 width="100">
                 </el-table-column>
                 <el-table-column
+                prop="unit"
+                label="单位"
+                width="100">
+                </el-table-column>
+                <el-table-column
                 prop="lastUpdateUserName"
-                label="录入人"
+                label="最后录入人"
                 width="100">
                 </el-table-column>
                 <el-table-column
                 prop="lastUpdateTime"
-                label="录入时间"
+                label="最后录入时间"
                 width="180">
                 </el-table-column>
                 <el-table-column
@@ -743,6 +757,7 @@ export default {
             AddMaterialinfoType:"",
             AddMaterialinfoTypearr:[],
             AdditemsName:"",
+            unit:"",
             Additemstextarea:"",
             ID:0,
             groupNameData:[],
@@ -1038,6 +1053,7 @@ export default {
             this.AddMaterialType="";
             this.AddMaterialinfoType="";
             this.Additemstextarea="";
+            this.unit="";
             this.AddItemsVisible=true;
         },
         //编辑
@@ -1058,6 +1074,7 @@ export default {
                     that.Additemstextarea=datainfo.remark;
                     that.AdditemsName=datainfo.name;
                     that.AddMaterialType=datainfo.parentType;
+                    that.unit=datainfo.unit;
                     that.AddMaterialinfoType=datainfo.type;
                     that.AddItemsVisible=true;
                     that.AddMaterialTypechange(2);
@@ -1113,7 +1130,9 @@ export default {
         GoodsOP() {
             var url = "/api/PersonnelModule/GoodsOP"
             var that = this
-            if (that.AdditemsName==""||that.AddMaterialinfoType==""||that.Additemstextarea=="") {
+            console.log(that.AdditemsName,that.AddMaterialinfoType,that.AddMaterialTypearr,that.unit);
+            
+            if (that.AdditemsName==""||that.AddMaterialinfoType==""||that.AddMaterialType==""||that.unit=="") {
                 that.$message.error("检查是否填写完全!");
                 return
             }
@@ -1128,6 +1147,7 @@ export default {
                     id:that.ID,
                     name:that.AdditemsName,
                     type:that.AddMaterialinfoType,
+                    unit:that.unit,
                     remark:that.Additemstextarea,
                 }
             }).then(function (res) {

+ 81 - 2
src/components/statistics/Statistically.vue

@@ -169,9 +169,11 @@
                         <div v-else-if="value==2" style="width: 100%;">
                             <div id="hoteltopten" style="width: 100%;height:400px;"></div>
                             <div id="hotelPredeterminedPlatform" style="width: 100%;height:400px;"></div>
+                            <div id="hotelcountry" style="width: 100%;height:400px;"></div>
                         </div>
                         <div v-else-if="value==5" style="width: 100%;">
                             <div id="invitationtopten" style="width: 100%;height:400px;"></div>
+                            <div id="unitcooperation" style="width: 100%;height:400px;"></div>
                         </div>
                         <div v-else-if="value==3" style="width: 100%;text-align: center;">
                             <div class="tabletitle">年记录</div>
@@ -378,7 +380,9 @@ export default {
             AirticketPredetermined:[],
             Hoteltop:[],
             hotelPredetermined:[],
+            hotelcountry:[],
             invitationtop:[],
+            unitcooperationtop:[],
             teamCooperation:[],
             groupnum:[],
             customersNumber:[],
@@ -655,7 +659,7 @@ export default {
                 legend: {},
                 tooltip: {
                     formatter:function(params){
-                        var html="该城市酒店预订总次数:"+params.data[1]+"次<br/>"
+                        var html="该酒店预订总房数:"+params.data[1]+"次<br/>"
                         for(let i=0;i<params.data[2].length;i++){
                             html += '酒店名称:'+params.data[2][i].hotelName+',&nbsp;&nbsp;&nbsp;'+'单人间:' +params.data[2][i].singleRoomCount+',&nbsp;&nbsp;&nbsp;'+'双人间:' +params.data[2][i].doubleRoomCount+',&nbsp;&nbsp;&nbsp;'+'套房:' +params.data[2][i].suiteRoomCount+',&nbsp;&nbsp;&nbsp;'+'其他房型:' +params.data[2][i].otherRoomCount+',&nbsp;&nbsp;&nbsp;'+'总房数:' +params.data[2][i].roomTotal+",<br/>";
                         }
@@ -705,6 +709,33 @@ export default {
                 color:['#2e83d4'],
                 series: [{ type: 'bar' }]
             },true);
+            //预定国家
+            var hotelcountry = echarts.init(document.getElementById('hotelcountry'));
+            hotelcountry.setOption({
+                title:{
+                    text: '预订酒店国家排行',
+                },
+                legend: {},
+                tooltip: {
+                    formatter:function(params){
+                        var html="该国家预订总次数:"+params.data[1]+"次<br/>"
+                        for(let i=0;i<params.data[2].length;i++){
+                            html += '酒店名称:'+params.data[2][i].hotelName+',&nbsp;&nbsp;&nbsp;'+'单人间:' +params.data[2][i].singleRoomCount+',&nbsp;&nbsp;&nbsp;'+'双人间:' +params.data[2][i].doubleRoomCount+',&nbsp;&nbsp;&nbsp;'+'套房:' +params.data[2][i].suiteRoomCount+',&nbsp;&nbsp;&nbsp;'+'其他房型:' +params.data[2][i].otherRoomCount+',&nbsp;&nbsp;&nbsp;'+'总房数:' +params.data[2][i].roomTotal+",<br/>";
+                        }
+                        return html 
+                    }
+
+                },
+                dataset: {
+                    source: this.hotelcountry
+                },
+                xAxis: { type: 'category' },
+                yAxis: {
+                    name: '该国家预订次数',
+                },
+                color:['#2e83d4'],
+                series: [{ type: 'bar' }]
+            },true);
         },
         //团组商邀
         groupinvitation(){
@@ -735,6 +766,39 @@ export default {
                 color:['#2e83d4'],
                 series: [{ type: 'bar' }]
             },true);
+            //单位合作次数前十
+            var unitcooperation = echarts.init(document.getElementById('unitcooperation'));
+            unitcooperation.setOption({
+                title:{
+                    text: '邀请单位合作次数前十',
+                },
+                legend: {},
+                tooltip: {
+                    formatter:function(params){
+                        var html=params.data[0]+":"+params.data[1]+"次<br/>关联团组:<br/>";
+                        console.log(params);
+                        
+                        for(let i=0;i<params.data[2].length;i++){
+                            html += params.data[2][i]+"<br/>";
+                        }
+                        return html 
+                    }
+                },
+                dataset: {
+                    source: this.unitcooperationtop
+                },
+                xAxis: { 
+                    type: 'category',
+                    axisLabel:{
+                        rotate:25
+                    }, 
+                },
+                yAxis: {
+                    name: '次数',
+                },
+                color:['#2e83d4'],
+                series: [{ type: 'bar' }]
+            },true);
         },
         //团组客户合作
         teamhz(){
@@ -958,9 +1022,11 @@ export default {
             if(document.getElementById('hoteltopten')!=null){
                 echarts.init(document.getElementById('hoteltopten')).dispose();
                 echarts.init(document.getElementById('hotelPredeterminedPlatform')).dispose();
+                echarts.init(document.getElementById('hotelcountry')).dispose();
             }
             if(document.getElementById('invitationtopten')!=null){
                 echarts.init(document.getElementById('invitationtopten')).dispose();
+                echarts.init(document.getElementById('unitcooperation')).dispose();
             }
             if(val==1){
                 this.StatisticsAirTicket();
@@ -1083,10 +1149,12 @@ export default {
                 if(res.data.code==200){
                     that.Hoteltop=[];
                     that.hotelPredetermined=[];
+                    that.hotelcountry=[];
                     var datainfo=res.data.data.hotelCityData;
                     var hotelpred=res.data.data.hotelPlatformData
+                    var hotelcountrydata=res.data.data.hotelCountryGroupByData
                     //酒店预订数
-                    that.Hoteltop.push(['product','城市酒店预订排行榜']);
+                    that.Hoteltop.push(['product','酒店房间预订排行榜']);
                     for(let i=0;i<datainfo.length;i++){
                         that.Hoteltop.push([datainfo[i].city,datainfo[i].bookingRoomNum,datainfo[i].hotelData]);
                     }
@@ -1095,6 +1163,11 @@ export default {
                     for(let k=0;k<hotelpred.length;k++){
                         that.hotelPredetermined.push([hotelpred[k].platform,hotelpred[k].bookingRoomNum,hotelpred[k].hotelData]);
                     }
+                    //酒店预订城市
+                    that.hotelcountry.push(['product','酒店预订城市排行榜']);
+                    for(let l=0;l<hotelcountrydata.length;l++){
+                        that.hotelcountry.push([hotelcountrydata[l].country,hotelcountrydata[l].bookingRoomNum,hotelcountrydata[l].hotelData]);
+                    }
                     that.grouphotel()
                 }else{
                     that.$message({
@@ -1120,11 +1193,17 @@ export default {
             }).then(function (res) {
                 if(res.data.code==200){
                     that.invitationtop=[];
+                    that.unitcooperationtop=[];
                     let datainfo=res.data.data.groupByCountry;
+                    let datainfos=res.data.data.groupByClient;
                     that.invitationtop.push(['product','商邀邀请国家数量']);
                     for(let i=0;i<datainfo.length;i++){
                         that.invitationtop.push([datainfo[i].country,datainfo[i].timeNum]);
                     }
+                    that.unitcooperationtop.push(['product','商邀单位合作次数']);
+                    for(let p=0;p<datainfos.length;p++){
+                        that.unitcooperationtop.push([datainfos[p].country,datainfos[p].timeNum,datainfos[p].linkGroupIds]);
+                    }
                     that.groupinvitation()
                 }else{
                     that.$message({