Эх сурвалжийг харах

工作室合伙人增加搜索
用户热力分部
开票管理添加详情页面

lihongxiao 2 жил өмнө
parent
commit
fec02a9729

+ 2 - 2
config/dev.env.js

@@ -17,8 +17,8 @@ module.exports = merge(prodEnv, {
   // BASE_URL: '"http://192.168.1.101:8080/"',
   // BASE_URL: '"http://192.168.0.250:8080/"',//
   // BASE_URL: '"http:///192.168.0.103:8080/"',//霍续亮
-  // BASE_URL: '"http://192.168.0.52:8080/"',//贺礼霄
-  BASE_URL: '"http:///192.168.0.55:8080/"',// 董鑫
+  BASE_URL: '"http://192.168.0.52:8080/"',//贺礼霄
+  // BASE_URL: '"http:///192.168.0.55:8080/"',// 董鑫
   CONSOLE_BASE_URL: '"http://localhost:8080/"', //控制台测试服务器
   // CONSOLE_BASE_URL: '"https://test.baoxianzhanggui.com/console-api"' //控制台正式服务器
   APP_BASE_URL: '"https://pre.baoxianzhanggui.com/web-api"',    // app打包上传地址

+ 1 - 0
src/components/TemplateTable/index.vue

@@ -32,6 +32,7 @@
               v-model="searchDataClone[f.prop]"
               :placeholder="'请输入' + f.label"
               filterable
+              @change="f.change($event, f.prop)"
             >
               <el-option label="不限" value v-if="f.selectAuto"></el-option>
               <el-option

+ 14 - 0
src/http/moudules/user.js

@@ -629,3 +629,17 @@ export const getGeographyPosition = (params) => {
     params
   })
 }
+export const queryPcAddressHistoryInfo = (data) => {
+  return axios({
+    url: '/sys/ipAddr/queryPcAddressHistoryInfo',
+    method: 'post',
+    data
+  })
+}
+export const queryGeographyRecord = (data) => {
+  return axios({
+    url: '/geography/queryGeographyRecord',
+    method: 'post',
+    data
+  })
+}

+ 19 - 13
src/views/AgreementManage/ChannelCost.vue

@@ -139,6 +139,9 @@ export default {
                     label: "保险公司",
                     prop: "companyId",
                     type: "company",
+                    change:(partnerCompaniesId,val)=>{
+                        this.findAgreement(partnerCompaniesId)
+                    }
                 },
                 {
                     label: "协议",
@@ -439,18 +442,7 @@ export default {
                 })
             }
         });
-        this.$api.insCompany.findAgreementByCompanyId({ isExternal: 0 }).then((res) => {
-            if (res.code == 200) {
-                this.formList1.forEach(val => {
-                    if (val.prop == 'agreementId') {
-                        res.data.forEach(e => {
-                            e.name = e.agreementName + (e.jobDescriptione ? '-' + e.jobDescription : '') + (e.businessDescription ? '-' + e.businessDescription : '')
-                        })
-                        val.options = res.data
-                    }
-                })
-            }
-        });
+      
 
         let data = { "pageNum": 1, "pageSize": 10, "columnFilters": { "label": { "name": "label", "value": "agreement_audit_status" } } }
         this.$api.dict.findPage(data).then(res => {
@@ -483,7 +475,21 @@ export default {
             this.rowId = row.id
             this.dialogVisible = true
             this.productcopyItemFindPage()
-
+            this.findAgreement()
+        },
+        findAgreement(partnerCompaniesId){
+            this.$api.insCompany.findAgreementByCompanyId({ isExternal: 0,partnerCompaniesId }).then((res) => {
+            if (res.code == 200) {
+                this.formList1.forEach(val => {
+                    if (val.prop == 'agreementId') {
+                        res.data.forEach(e => {
+                            e.name = e.agreementName + (e.jobDescriptione ? '-' + e.jobDescription : '') + (e.businessDescription ? '-' + e.businessDescription : '')
+                        })
+                        val.options = res.data
+                    }
+                })
+            }
+        });
         },
         handleSearchList1(val) {
             this.productcopyItemFindPage(val)

+ 52 - 2
src/views/FinancialManagement/ExpenseManagement/PaymentManagement.vue

@@ -428,7 +428,7 @@
     >
       <!-- 记录表格 -->
       <kt-common-table
-        :operationWidth="130"
+        :operationWidth="160"
         class="ktTable expendTable"
         ref="expendTable"
         :data="expendPageResult"
@@ -436,20 +436,58 @@
         :showBatchDelete="false"
         :showOperation="true"
         button3Name="撤销"
+        button2Name="详情"
         permsButton3="expenseManagement:invoiceManagement:revoke"
         button3Icon="fa fa-trash"
         button3Background="#f56c6c"
         @handleButton3="handleTableRepeal"
+        @handleButton2="handleTablerecordDetail"
         @findPage="getRecordData"
         :isshowpagination="true"
       ></kt-common-table>
     </el-dialog>
+    <el-dialog
+      title="详情"
+      :close-on-click-modal="false"
+      :visible.sync="detailDialogVisible"
+      width="40%"
+    >
+    <el-form  :model="tableForm"
+          ref="tableForm1"
+          label-width="155px"
+          size="small"
+          class="tableForm"
+          disabled>
+          <el-row >
+  <el-col :span="12"  v-for="item in affiliationData"
+                :key="item.profitId + 'sr'">
+      <el-form-item
+      style="margin-bottom: 18px  !important;"
+                :label="item.profitName"
+                prop="entProfit"
+              >
+                <el-input-number
+                  v-model="item.profit"
+                  :min="0"
+                  placeholder="请输入利润"
+                  :max="999999999999999"
+                  label=""
+                ></el-input-number>
+              </el-form-item>
+            </el-col>
+</el-row>
+    </el-form>
+      <span slot="footer" class="dialog-footer">
+          <el-button size="small" @click="detailDialogVisible = false">关闭</el-button>
+      </span>
+    </el-dialog>
+
   </div>
 </template>
         <script>
 import KtCommonTable from "@/views/Core/KtCommonTable.vue"; //表格组件
 import KtButton from "@/views/Core/KtButton"; // 按钮权限组件
-import { toChies } from "../../../utils/moneyTransition"; //金额小写转大写
+import { toChies, convertPositive } from "../../../utils/moneyTransition";
 
 export default {
   name: "InvoiceInformation",
@@ -473,6 +511,8 @@ export default {
       }
     };
     return {
+      tableForm:{},
+      detailDialogVisible:false,
       affiliationData: [], //归属字典数据
       affiliationData2: [], //归属字典数据
       allNumObj: {}, //合计对象
@@ -740,6 +780,16 @@ export default {
     },
   },
   methods: {
+    handleTablerecordDetail({row}){
+     for (let key in row.entProfit) {
+          this.affiliationData.forEach((item) => {
+            if (item.profitEng == key) {
+              item.profit = convertPositive(row.entProfit[key]);
+            }
+          });
+        }
+        this.detailDialogVisible=true
+    },
     /**
      * 撤销转账记录
      */

+ 8 - 9
src/views/PeopleManage/Institutional.vue

@@ -19,7 +19,7 @@
         <!-- 右侧列表页面Start -->
         <SplitArea :size="rightSplitWidth">
           <templateTable :searchData.sync="queryFrom" :tableConfig="tableConfig" :data="pageResult" @getList="findPage"
-            @handleSearchList="handleSearchList" :pagination="pageData">
+            @handleSearchList="handleSearchList" :pagination="pageData" :formList="formList">
             <!-- <template slot="source" slot-scope="scope">
               <span>
                     {{ statMaps(scope.row.source) }}</span
@@ -138,16 +138,15 @@ export default {
       rightSplitWidth: 80,
       currentTreeNode: null,
       formList: [
-        // {
-        //   label: "工号",
-        //   prop: "userId",
-        //   type: "input",
-        // },
         {
-          label: "名称",
+          label: "工号",
           prop: "userId",
-          type: "select",
-          options: []
+          type: "input",
+        },
+        {
+          label: "名称",
+          prop: "userName",
+          type: "input",
         },
         // {
         //   label: "机构id",

+ 8 - 9
src/views/PeopleManage/Partner.vue

@@ -25,7 +25,7 @@
         <!-- 右侧列表页面Start -->
         <SplitArea :size="rightSplitWidth">
           <templateTable :searchData.sync="queryFrom" :tableConfig="tableConfig" :data="pageResult" @getList="findPage"
-            @handleSearchList="handleSearchList" :pagination="pageData">
+            @handleSearchList="handleSearchList" :pagination="pageData" :formList="formList">
             <template slot="type" slot-scope="scope">
               <span
                 :style="{ background: scope.row.type == '1' ? 'linear-gradient( 180deg, #66CDBB 0%, #33A08D 100%)' : '#A6A6A6', borderRadius: '4px', padding: '4px 10px', color: '#fff' }">{{
@@ -97,16 +97,15 @@ export default {
       rightSplitWidth: 80,
       currentTreeNode: null,
       formList: [
-        // {
-        //   label: "工号",
-        //   prop: "userId",
-        //   type: "input",
-        // },
         {
-          label: "名称",
+          label: "工号",
           prop: "userId",
-          type: "select",
-          options: []
+          type: "input",
+        },
+        {
+          label: "名称",
+          prop: "userName",
+          type: "input",
         },
 
       ],

+ 214 - 139
src/views/PeopleManage/PcLoginRecord.vue

@@ -45,17 +45,16 @@
         </el-switch> -->
       </div>
     </div>
-    <div v-if="infoWindowVisible" class="infohis-window" >
+    <div v-if="infoWindowVisible" class="infohis-window">
       <p class="close flex j-s">
         <span>历史记录</span>
         <span style="color: #c3c3c3;font-size:18px" @click="infoWindowVisible = false"> ×</span>
       </p>
-      <el-table :data="tableData" border style="width: 100%;  overflow: auto;"
-        :header-cell-style="{
-          background: '#F2F7FC',
-          fontWeight: '700',
-          color: '#606266',
-        }">
+      <el-table :data="tableData" border style="width: 100%;  overflow: auto;" :header-cell-style="{
+        background: '#F2F7FC',
+        fontWeight: '700',
+        color: '#606266',
+      }">
         <el-table-column prop="userId" label="工号" width="150">
         </el-table-column>
         <el-table-column prop="userName" label="姓名" width="80">
@@ -67,7 +66,7 @@
       </el-table>
       <div class="bottomFixed">
         <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum"
-          :page-sizes="[5,10, 20, 30, 50, 100]" :page-size="pageSize" layout="total, sizes, prev, pager, next"
+          :page-sizes="[5, 10, 20, 30, 50, 100]" :page-size="pageSize" layout="total, sizes, prev, pager, next"
           :total="totalSum">
         </el-pagination>
       </div>
@@ -123,13 +122,16 @@
       <div v-show="activeName == 2">
         <div style="margin-bottom: 10px;">
           <span style="color: #262626;font-weight: 700;font-size: 14px;">时间筛选 </span>
-          <el-date-picker size="small" @change="historyDateFun"  v-model="historyDate" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日"
-            value-format="yyyy-MM-dd">
+          <el-date-picker v-model="historyDate" type="daterange" size="small" @change="historyDateFun"
+            value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
           </el-date-picker>
+          <!-- <el-date-picker size="small" @change="historyDateFun"  v-model="historyDate" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日"
+            value-format="yyyy-MM-dd"> 
+          </el-date-picker>-->
         </div>
         <div class="flex j-s">
           <div class="info-title"><i></i>历史在线人数统计</div>
-          <div class="info-online"><i></i>在线总人数:{{ onlineHisData }}</div>
+          <div class="info-online"><i></i>使用人数:{{ onlineHisData }}</div>
         </div>
         <div id="echarts_box" v-show="isCollapse" style="width: 460px;height:300px;"></div>
 
@@ -168,14 +170,9 @@
             {{ scope.row.source == '1' ? '渠道' : '代理' }}
           </template>
         </el-table-column>
-        <el-table-column
-          label="操作">
+        <el-table-column label="操作">
           <template slot-scope="scope">
-            <el-button
-            style="color:#3865E9 "
-              @click.native.prevent="historicRecords(scope.row)"
-              type="text"
-              size="small">
+            <el-button style="color:#3865E9 " @click.native.prevent="historicRecords(scope.row)" type="text" size="small">
               历史记录
             </el-button>
           </template>
@@ -257,13 +254,15 @@ export default {
       circle: null,
       activeName: '1',
       historyDate: '',
-      onlineData:'',
-      onlineHisData:'',
-      radius:'100000',
+      onlineData: '',
+      onlineHisData: '',
+      radius: '100000',
       markers: [],
-      lineZx:null,
-      lineLx:null,
-      status:null
+      lineZx: null,
+      lineLx: null,
+      status: null,
+      positionType: null,
+      historyData: []
     };
   },
   mounted() {
@@ -284,90 +283,138 @@ export default {
     this.map.destroy();
   },
   methods: {
-    historicRecords(row){
-      this.rowId=row.userId
+    historicRecords(row) {
+      this.rowId = row.userId
       this.detail()
     },
-    handHistory(tab, event){
-      if(tab.name=='2'){
+    handHistory(tab, event) {
+      if (tab.name == '2') {
         this.queryAnalysis();
       }
+      else{
+        this.positionType=1
+        this.initMap();
+      }
     },
-    historyDateFun(val){
-      this.queryAnalysis({dates:val});
+    historyDateFun(val) {
+      this.historyData = val
+      this.queryAnalysis({ startTime: val[0], endTime: val[1] });
     },
     queryAnalysis(param) {
-      this.$api.user.ipAddrGetPcAddress(param).then((res) => {
-      	if (res.code == 200) {
-          this.onlineHisData=res.data.onlineNum
-      		this.formatAnalysisDate(res.data.list)
-      	}
-        else{
+      this.$api.user.ipAddrGetPcAddress({source:this.source ,...param}).then((res) => {
+        if (res.code == 200) {
+          this.onlineHisData = res.data.onlineNum
+          this.formatAnalysisDate(res.data.list)
+          var _this = this;
+
+          _this.map = new AMap.Map("containerMap", {
+            viewMode: "3D", //是否为3D地图模式
+            zoom: 8, //初始化地图级别
+            expandZoomRange: true, //支持可以扩展最大缩放级别
+            center: this.location,
+            resizeEnable: true,
+            mapStyle: "amap://styles/normal" //地图样式,彩色
+          });
+          _this.map.on("complete", () => {
+            //处理后台返回要用到的数据
+            // _this.positionData = res.data.data
+            if (res.data.pcAddressList.length > 0){
+
+              _this.positionType = res.data.pcAddressList[0].type
+            _this.positionData = res.data.pcAddressList.map(item => ({
+              userName: item.userName,
+              id: item.id,
+              userId: item.userId,
+              address: item.address,
+              leaderName: item.leaderName ? item.leaderName : '无',
+              // onlineImg: item.status ? "Frame-1(2).png" : "Frame(2).png",
+              onlineImg: "Frame-1(2).png",
+              operationTime: item.operationTime,
+              source: item.source,
+              status: item.status ? "#1CE247" : "#B2B2B2",
+              // status: item.status ? "在线" : "离线",
+              positionArr: [item.longitude, item.latitude]
+            }));
+            _this.mapPoint();
+          }
+          });
+          // if (location.href.indexOf("&guide=1") !== -1) {
+          //   _this.map.setStatus({ scrollWheel: fal0e });
+          // }
+        }
+        else {
           this.$message.error(res.msg)
         }
       })
     },
     formatAnalysisDate(data) {
       const dateList = data.map(function (item) {
-        return item.time.split(" ")[1]+':00'
+        return item.time.split(" ")[1] ? item.time.split(" ")[1] + ':00' : item.time.split(" ")[0]
       });
       const valueList = data.map(function (item) {
         return item.countNum;
       });
 
       let option = {
-        visualMap:  {
-      show: false,
-      type: 'continuous',
-      seriesIndex: 0,
-      min: 0,
-      max: 400
-    },
-     
+        visualMap: {
+          show: false,
+          type: 'continuous',
+          seriesIndex: 0,
+          min: 0,
+          max: 400
+        },
+
         tooltip: {
           trigger: 'axis'
         },
-        xAxis:{
-            data: dateList,
-            axisLine: {
-                lineStyle: {
-                    color: "#86909C ",
-                }
+        xAxis: {
+          data: dateList,
+          axisLine: {
+            lineStyle: {
+              color: "#86909C ",
             }
-          },
+          }
+        },
         yAxis: {
           name: "人数", //命名
           axisLine: {
-                lineStyle: {
-                  color: "#86909C ",
-                }
+            lineStyle: {
+              color: "#86909C ",
             }
+          }
         },
-        series:  [{
+        series: [{
           type: 'line',
           showSymbol: false,
           data: valueList,
           lineStyle: {
             color: {
               type: 'linear',
-                x: 0,
-                y: 0,
-                x2: 0,
-                y2: 1,
-                colorStops: [
-                  {offset: 0, color: '#3865E9'},
-                    {offset: 1, color: '#A6D2F3'}, 
-                ],
+              x: 0,
+              y: 0,
+              x2: 0,
+              y2: 1,
+              colorStops: [
+                { offset: 0, color: '#3865E9' },
+                { offset: 1, color: '#A6D2F3' },
+              ],
             }
-        }
+          }
         }],
       }
       myChart.setOption(option)
 
     },
     morelFun() {
-      this.$api.user
-        .queryPcAddressInfo({ lng: this.position[0], lat: this.position[1], source: this.source,pageSize: 5, pageNum: this.personnelPageNum })
+      let data = {
+        startTime: this.historyData.length > 0 && this.positionType == 2 ? this.historyData[0] : '',
+        endTime: this.historyData.length > 0 && this.positionType == 2 ? this.historyData[1] : '',
+      }
+      let api = this.positionType == 1 ? 'queryPcAddressInfo' : 'queryPcAddressHistoryInfo'
+      this.$api.user[api]({
+        lng: this.position[0], lat: this.position[1], source: this.source, pageSize: 5,
+        pageNum: this.personnelPageNum, ...data
+      })
         .then(res => {
           if (res.code == 200) {
             this.personnelTotalSize = res.data.totalSize
@@ -388,7 +435,7 @@ export default {
         if (_this.circle) {
           _this.map.remove(_this.circle)
         }
- 
+
 
         _this.circle = new AMap.Circle({
           center: [longitude, latitude],
@@ -421,7 +468,7 @@ export default {
 
         })
         _this.circleEditor.on('adjust', function (event) {
-          _this.radius=event.radius
+          _this.radius = event.radius
           _this.onCircularFun({ latitude: event.lnglat.lat, longitude: event.lnglat.lng, radius: event.radius })
 
         })
@@ -432,56 +479,56 @@ export default {
         })
 
       })
-  
-  // 将点标记添加到地图map上
+
+      // 将点标记添加到地图map上
     },
-   
+
     async onCircularFun(data) {
       let _this = this;
-          //  // 首先创建 AMap.Icon 实例:
-          //  var icon = new AMap.Icon({
-          //   size: new AMap.Size(40, 40), // 图标尺寸
-          //   image: '../../assets/Frame(2).png',
-          //   imageOffset: new AMap.Pixel(0, 0), // 图像相对展示区域的偏移量,适于雪碧图等
-          //   imageSize: new AMap.Size(40, 40), // 根据所设置的大小拉伸或压缩图片
-          // });
-          // // 将 Icon 实例添加到 marker 上:
-          // var marker = new AMap.Marker({
-          //   position: new AMap.LngLat(data.longitude, data.latitude),// icon在地图上显示的位置,数组内对应经纬度
-          //   offset: new AMap.Pixel(-20, -36),//设置icon在地上的偏移量
-          //   icon: icon, // 添加 Icon 实例
-          //   zoom: 13, //缩放等级
-          // });
-          // _this.map.add(marker);
-          // this.addMarker(data)
+      //  // 首先创建 AMap.Icon 实例:
+      //  var icon = new AMap.Icon({
+      //   size: new AMap.Size(40, 40), // 图标尺寸
+      //   image: '../../assets/Frame(2).png',
+      //   imageOffset: new AMap.Pixel(0, 0), // 图像相对展示区域的偏移量,适于雪碧图等
+      //   imageSize: new AMap.Size(40, 40), // 根据所设置的大小拉伸或压缩图片
+      // });
+      // // 将 Icon 实例添加到 marker 上:
+      // var marker = new AMap.Marker({
+      //   position: new AMap.LngLat(data.longitude, data.latitude),// icon在地图上显示的位置,数组内对应经纬度
+      //   offset: new AMap.Pixel(-20, -36),//设置icon在地上的偏移量
+      //   icon: icon, // 添加 Icon 实例
+      //   zoom: 13, //缩放等级
+      // });
+      // _this.map.add(marker);
+      // this.addMarker(data)
       let res = await _this.$api.user.ipAddrLocations(data)
-        if (res.code == 200) {
-          if (res.data && res.data.length > 0) {
-            //处理后台返回要用到的数据
-            // _this.positionData = res.data.data
-            _this.positionData = res.data.map(item => ({
-              userName: item.userName,
-              id: item.id,
-              userId: item.userId,
-              address: item.address,
-              leaderName: item.leaderName,
-              // onlineImg: item.status ? "Frame-1(2).png" : "Frame(2).png",
-              onlineImg: "Frame-1(2).png",
-              operationTime: item.operationTime,
-              source: item.source,
-              // status: item.status ? "在线" : "离线",
-              positionArr: [item.longitude, item.latitude]
-            }));
-            _this.mapPoint();
-          }
-          else {
-            _this.positionData=[]
-            _this.loading = false; //地图加载完成
-          }
-        } else {
-          _this.$message.error(res.msg)
-          _this.loading = false;
+      if (res.code == 200) {
+        if (res.data && res.data.length > 0) {
+          //处理后台返回要用到的数据
+          // _this.positionData = res.data.data
+          _this.positionData = res.data.map(item => ({
+            userName: item.userName,
+            id: item.id,
+            userId: item.userId,
+            address: item.address,
+            leaderName: item.leaderName ? item.leaderName : '无',
+            // onlineImg: item.status ? "Frame-1(2).png" : "Frame(2).png",
+            onlineImg: "Frame-1(2).png",
+            operationTime: item.operationTime,
+            source: item.source,
+            // status: item.status ? "在线" : "离线",
+            positionArr: [item.longitude, item.latitude]
+          }));
+          _this.mapPoint();
+        }
+        else {
+          _this.positionData = []
+          _this.loading = false; //地图加载完成
         }
+      } else {
+        _this.$message.error(res.msg)
+        _this.loading = false;
+      }
 
     },
     queryPcNum() {
@@ -576,7 +623,12 @@ export default {
         this.sourceqd = null
       }
       this.source = null
-      this.initMap();
+      if(this.positionType==1){
+        this.initMap();
+      }
+      else{
+      this.queryAnalysis({ startTime: this.historyData[0], endTime: this.historyData[1] });
+      }
     },
     sourcedlChange(val) {
       if (val) {
@@ -584,7 +636,12 @@ export default {
         this.sourceqd = null
       }
       this.source = 2
-      this.initMap();
+      if(this.positionType==1){
+        this.initMap();
+      }
+      else{
+      this.queryAnalysis({ startTime: this.historyData[0], endTime: this.historyData[1] });
+      }
     },
     sourceqdChange(val) {
       if (val) {
@@ -592,7 +649,12 @@ export default {
         this.sourcedl = null
       }
       this.source = 1
-      this.initMap();
+      if(this.positionType==1){
+        this.initMap();
+      }
+      else{
+      this.queryAnalysis({ startTime: this.historyData[0], endTime: this.historyData[1] });
+      }
     },
     onLineChange(val) {
       if (val) {
@@ -653,7 +715,7 @@ export default {
       this.marker = new AMap.Marker({
         // icon: '//a.amap.com/jsapi_demos/static/demo-c: this.pointenter/icons/po: this.pointi-marker-default.png',
         icon: '../../assets/Frame(2).png',
-        position:new AMap.LngLat(data.longitude, data.latitude),
+        position: new AMap.LngLat(data.longitude, data.latitude),
         offset: new AMap.Pixel(-13, -30) //icon中心点的偏移量
       })
       this.marker.setMap(this.map) //设置icon
@@ -684,12 +746,13 @@ export default {
               if (res.data && res.data.length > 0) {
                 //处理后台返回要用到的数据
                 // _this.positionData = res.data.data
+                this.positionType = res.data[0].type
                 _this.positionData = res.data.map(item => ({
                   userName: item.userName,
                   id: item.id,
                   userId: item.userId,
                   address: item.address,
-                  leaderName: item.leaderName?item.leaderName:'无',
+                  leaderName: item.leaderName ? item.leaderName : '无',
                   // onlineImg: item.status ? "Frame-1(2).png" : "Frame(2).png",
                   onlineImg: "Frame-1(2).png",
                   operationTime: item.operationTime,
@@ -721,9 +784,9 @@ export default {
       //   [114.464586, 39.099962] // 右上角坐标
       // ]);
       // _this.map.limitBounds(bounds);
-      if (location.href.indexOf("&guide=1") !== -1) {
-        _this.map.setStatus({ scrollWheel: false });
-      }
+      // if (location.href.indexOf("&guide=1") !== -1) {
+      //   _this.map.setStatus({ scrollWheel: false });
+      // }
     },
 
     mapPoint() {
@@ -744,7 +807,6 @@ export default {
 
       _this.infoWindow = new AMap.InfoWindow({ offset: new AMap.Pixel(0, -4), closeWhenClickMap: true, }); //信息窗口
       var position = JSON.parse(JSON.stringify(_this.positionData));
-
       for (var i = 0; i < position.length; i++) {
         var labelMarker = new AMap.LabelMarker({
           position: position[i].positionArr
@@ -777,18 +839,25 @@ export default {
       labelsLayer.add(labelMarker);
       this.loading = false; //地图加载完成
     },
-    markerClick(e) {
+    markerClick(e,) {
       let _this = this
       this.position = e.target._position
       // _this.morelFun()
-      this.$api.user
-        .queryPcAddressInfo({ lng: e.target._position[0], lat: e.target._position[1], source: this.source,pageSize: 5, pageNum: this.personnelPageNum })
+      let data = {
+        startTime: this.historyData.length > 0 && this.positionType == 2 ? this.historyData[0] : '',
+        endTime: this.historyData.length > 0 && this.positionType == 2 ? this.historyData[1] : '',
+      }
+      let api = this.positionType == 1 ? 'queryPcAddressInfo' : 'queryPcAddressHistoryInfo'
+      this.$api.user[api]({
+        lng: e.target._position[0], lat: e.target._position[1], source: this.source, pageSize: 5,
+        pageNum: this.personnelPageNum, ...data
+      })
         .then(res => {
           if (res.code == 200) {
             this.personnelTotalSize = res.data.totalSize
             this.personnelData = res.data.content
             let content = e.target.content
-            content =  e.target.content + `<div style="font-weight: 700;display: flex; justify-content: space-between;align-items: center;"> 
+            content = e.target.content + `<div style="font-weight: 700;display: flex; justify-content: space-between;align-items: center;"> 
           <span>共${_this.personnelTotalSize}人信息</span>
            <div style="background: linear-gradient( 270deg, #225FFE 0%, #23CAFF 100%);padding:4px 8px;color:#fff;border-radius: 4px 4px 4px 4px;" onclick="personnelclick()">查看更多</div>
           </div>`
@@ -799,6 +868,7 @@ export default {
           }
         });
 
+
     }
   }
 };
@@ -834,7 +904,7 @@ export default {
   }
 
   span:first-child::before {
-      content: '';
+    content: '';
     display: inline-block;
     width: 9px;
     height: 9px;
@@ -866,7 +936,8 @@ export default {
   width: 30vw;
   box-shadow: 0px 5px 10px #ddd;
 }
-.infohis-window{
+
+.infohis-window {
   position: absolute;
   top: 0;
   right: 0;
@@ -876,6 +947,7 @@ export default {
   width: 25vw;
   box-shadow: 0px 5px 10px #ddd;
 }
+
 .personnel-window {
   position: fixed;
   bottom: 10px;
@@ -916,10 +988,11 @@ export default {
 }
 
 /deep/ {
-  .el-button--primary{
+  .el-button--primary {
     background: #3355FF !important;
     border-color: #3355FF !important;
   }
+
   .el-tabs__item:hover,
   .el-tabs__item.is-active {
     color: #3865E9;
@@ -1000,17 +1073,19 @@ export default {
     display: flex;
     flex-direction: column;
   }
-  .info-online{
+
+  .info-online {
     font-size: 14px;
     line-height: 30px;
-  i {
-    display: inline-block;
-    width: 8px;
-    height: 8px;
-    background: #1CE247;
-    border-radius: 50%;
-    margin-right: 10px;
-  }
+
+    i {
+      display: inline-block;
+      width: 8px;
+      height: 8px;
+      background: #1CE247;
+      border-radius: 50%;
+      margin-right: 10px;
+    }
   }
 }
 </style>

+ 168 - 97
src/views/PeopleManage/UserMap.vue

@@ -3,7 +3,8 @@
     <div id="container" style="width: 100%; height: 87vh" v-loading="loading" element-loading-text="数据量较大,正在为您加载......"
       element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)"></div>
     <div class="province-window">
-      <el-select size="small" v-model="provinceName" clearable placeholder="请选择省" @change="provinceChange" @clear="provinceClear">
+      <el-select size="small" v-model="provinceName" clearable placeholder="请选择省" @change="provinceChange"
+        @clear="provinceClear">
         <el-option v-for="(option, index) in provinceOption" :key="index" :label="option.name"
           :value="option.code"></el-option>
       </el-select>
@@ -45,17 +46,16 @@
         </el-switch> -->
       </div>
     </div>
-    <div v-if="infoWindowVisible" class="infohis-window" >
+    <div v-if="infoWindowVisible" class="infohis-window">
       <p class="close flex j-s">
         <span>历史记录</span>
         <span style="color: #c3c3c3;font-size:18px" @click="infoWindowVisible = false"> ×</span>
       </p>
-      <el-table :data="tableData" border style="width: 100%;  overflow: auto;"
-        :header-cell-style="{
-          background: '#F2F7FC',
-          fontWeight: '700',
-          color: '#606266',
-        }">
+      <el-table :data="tableData" border style="width: 100%;  overflow: auto;" :header-cell-style="{
+        background: '#F2F7FC',
+        fontWeight: '700',
+        color: '#606266',
+      }">
         <el-table-column prop="userId" label="工号" width="150">
         </el-table-column>
         <el-table-column prop="userName" label="姓名" width="80">
@@ -67,7 +67,7 @@
       </el-table>
       <div class="bottomFixed">
         <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum"
-          :page-sizes="[5,10, 20, 30, 50, 100]" :page-size="pageSize" layout="total, sizes, prev, pager, next"
+          :page-sizes="[5, 10, 20, 30, 50, 100]" :page-size="pageSize" layout="total, sizes, prev, pager, next"
           :total="totalSum">
         </el-pagination>
       </div>
@@ -123,13 +123,16 @@
       <div v-show="activeName == 2">
         <div style="margin-bottom: 10px;">
           <span style="color: #262626;font-weight: 700;font-size: 14px;">时间筛选 </span>
-          <el-date-picker size="small" @change="historyDateFun"  v-model="historyDate" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日"
+          <!-- <el-date-picker size="small" @change="historyDateFun"  v-model="historyDate" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日"
             value-format="yyyy-MM-dd">
+          </el-date-picker> -->
+          <el-date-picker v-model="historyDate" type="daterange" size="small" @change="historyDateFun"
+            value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
           </el-date-picker>
         </div>
         <div class="flex j-s">
           <div class="info-title"><i></i>历史在线人数统计</div>
-          <div class="info-online"><i></i>在线总人数:{{ onlineHisData }}</div>
+          <div class="info-online"><i></i>使用人数:{{ onlineHisData }}</div>
         </div>
         <div id="echarts_box" v-show="isCollapse" style="width: 460px;height:300px;"></div>
         <!-- <div v-if="isCollapse &&onlineHisData==0" class="empty" style="text-align: center;">
@@ -156,7 +159,7 @@
             <span v-else style="text-decoration-line: underline;">{{ scope.$index + 1 }}</span>
           </template>
         </el-table-column>
-        <el-table-column prop="userName" label="姓名" >
+        <el-table-column prop="userName" label="姓名">
         </el-table-column>
         <el-table-column prop="id" label="工号">
         </el-table-column>
@@ -171,14 +174,9 @@
             {{ scope.row.source == '1' ? '渠道' : '代理' }}
           </template>
         </el-table-column>
-        <el-table-column
-          label="操作">
+        <el-table-column label="操作">
           <template slot-scope="scope">
-            <el-button
-            style="color:#3865E9 "
-              @click.native.prevent="historicRecords(scope.row)"
-              type="text"
-              size="small">
+            <el-button style="color:#3865E9 " @click.native.prevent="historicRecords(scope.row)" type="text" size="small">
               历史记录
             </el-button>
           </template>
@@ -255,11 +253,13 @@ export default {
       circle: null,
       activeName: '1',
       historyDate: '',
-      onlineData:'',
-      onlineHisData:'',
-      lineZx:null,
-      lineLx:null,
-      status:null
+      onlineData: '',
+      onlineHisData: '',
+      lineZx: null,
+      lineLx: null,
+      status: null,
+      positionType: null,
+      historyData: []
 
     };
   },
@@ -280,81 +280,117 @@ export default {
     this.map.destroy();
   },
   methods: {
-    historicRecords(row){
-      this.rowId=row.id
+    historicRecords(row) {
+      this.rowId = this.positionType==1? row.id:row.userId
       this.detail()
     },
-    handHistory(tab, event){
-      if(tab.name=='2'){
+    handHistory(tab, event) {
+      if (tab.name == '2') {
         this.queryAnalysis();
       }
+      else{
+        this.positionType=1
+        this.initMap();
+      }
     },
-    historyDateFun(val){
-      this.queryAnalysis({dates:val});
+    historyDateFun(val) {
+      // this.queryAnalysis({dates:val});
+      this.historyData = val
+      this.queryAnalysis({ startTime: val[0], endTime: val[1] });
     },
     queryAnalysis(param) {
-      this.$api.user.getGeographyPosition(param).then((res) => {
-      	if (res.code == 200) {
-          this.onlineHisData=res.data.onlineNum
-      		this.formatAnalysisDate(res.data.list)
-      	}
-        else{
+      this.$api.user.getGeographyPosition({source:this.source ,...param}).then((res) => {
+        if (res.code == 200) {
+          this.onlineHisData = res.data.onlineNum
+          this.formatAnalysisDate(res.data.list)
+
+          var _this = this;
+          _this.map = new AMap.Map("container", {
+            viewMode: "3D", //是否为3D地图模式
+            zoom: 8, //初始化地图级别
+            expandZoomRange: true, //支持可以扩展最大缩放级别
+            center: this.location,
+            resizeEnable: true,
+            mapStyle: "amap://styles/normal" //地图样式,彩色
+          });
+          _this.map.on("complete", () => {
+            if (res.data.positionRecordList.length > 0){
+              this.positionType = res.data.positionRecordList[0].type
+            _this.positionData = res.data.positionRecordList.map(item => ({
+              userName: item.userName,
+                  id: item.id,
+                  address: item.address,
+                  onlineImg: item.status ? "Frame-1(2).png" : "Frame(2).png",
+                  // status: item.status ? "在线" : "离线",
+                  status: item.status ? "#1CE247" : "#B2B2B2",
+                  createTime: item.createTime,
+                  deptName: item.deptName,
+                  source: item.source,
+                  leaderName: item.leaderName?item.leaderName:'无',
+                  positionArr: [item.longitude, item.latitude]
+            }));
+            _this.mapPoint();
+          }
+
+          });
+        }
+        else {
           this.$message.error(res.msg)
         }
       })
     },
     formatAnalysisDate(data) {
       const dateList = data.map(function (item) {
-        return item.time.split(" ")[1]+':00'
+        return item.time.split(" ")[1] ? item.time.split(" ")[1] + ':00' : item.time.split(" ")[0]
       });
       const valueList = data.map(function (item) {
         return item.countNum;
       });
 
       let option = {
-        visualMap:  {
-      show: false,
-      type: 'continuous',
-      seriesIndex: 0,
-      min: 0,
-      max: 400
-    },
+        visualMap: {
+          show: false,
+          type: 'continuous',
+          seriesIndex: 0,
+          min: 0,
+          max: 400
+        },
         tooltip: {
           trigger: 'axis'
         },
-        xAxis:{
-            data: dateList,
-            axisLine: {
-                lineStyle: {
-                    color: "#86909C ",
-                }
+        xAxis: {
+          data: dateList,
+          axisLine: {
+            lineStyle: {
+              color: "#86909C ",
             }
-          },
+          }
+        },
         yAxis: {
           name: "人数", //命名
           axisLine: {
-                lineStyle: {
-                  color: "#86909C ",
-                }
+            lineStyle: {
+              color: "#86909C ",
             }
+          }
         },
-        series:  [{
+        series: [{
           type: 'line',
           showSymbol: false,
           data: valueList,
           lineStyle: {
             color: {
               type: 'linear',
-                x: 0,
-                y: 0,
-                x2: 0,
-                y2: 1,
-                colorStops: [
-                  {offset: 0, color: '#3865E9'},
-                    {offset: 1, color: '#A6D2F3'}, 
-                ],
+              x: 0,
+              y: 0,
+              x2: 0,
+              y2: 1,
+              colorStops: [
+                { offset: 0, color: '#3865E9' },
+                { offset: 1, color: '#A6D2F3' },
+              ],
             }
-        }
+          }
         }],
       }
       myChart.setOption(option)
@@ -364,8 +400,14 @@ export default {
       this.morelFun();
     },
     morelFun() {
+      let data = {
+        startTime: this.historyData.length > 0 && this.positionType == 2 ? this.historyData[0] : '',
+        endTime: this.historyData.length > 0 && this.positionType == 2 ? this.historyData[1] : '',
+      }
       this.$api.user
-        .queryGeographyInfo({ lng: this.position[0], lat: this.position[1], pageSize: 5, pageNum: this.personnelPageNum })
+        .queryGeographyInfo({ lng: this.position[0], lat: this.position[1], pageSize: 5, 
+          pageNum: this.personnelPageNum, ...data
+        })
         .then(res => {
           if (res.code == 200) {
             this.personnelTotalSize = res.data.totalSize
@@ -375,7 +417,7 @@ export default {
     },
     checkPrice(index) {
       this.currentIndex = index
-      this.queryRegion(index==0?null:index)
+      this.queryRegion(index == 0 ? null : index)
     },
     queryPcNum() {
       this.$api.user
@@ -391,15 +433,15 @@ export default {
     },
     queryRegion(source = null) {
       this.$api.user
-        .appQueryRegionInfo({source,...this.province})
+        .appQueryRegionInfo({ source, ...this.province })
         .then(res => {
           if (res.code == 200) {
             this.overviewData = res.data;
           }
         });
     },
-    onSearch(){
-      this.currentIndex=0
+    onSearch() {
+      this.currentIndex = 0
       this.queryRegion()
       this.queryPcNum()
       const geocoder = new AMap.Geocoder({
@@ -447,7 +489,7 @@ export default {
       this.districtName = ''
       this.province.city = ''
       this.province.district = ''
-      this.districtOption=[]
+      this.districtOption = []
     },
     provinceClear() {
       this.cityName = ''
@@ -456,8 +498,8 @@ export default {
       this.province.city = ''
       this.province.province = ''
       this.province.district = ''
-      this.districtOption=[]
-      this.cityOption=[]
+      this.districtOption = []
+      this.cityOption = []
     },
     sourceqbChange(val) {
       if (val) {
@@ -465,7 +507,12 @@ export default {
         this.sourceqd = null
       }
       this.source = null
-      this.initMap();
+      if(this.positionType==1){
+        this.initMap();
+      }
+      else{
+      this.queryAnalysis({ startTime: this.historyData[0], endTime: this.historyData[1] });
+      }
     },
     sourcedlChange(val) {
       if (val) {
@@ -473,7 +520,12 @@ export default {
         this.sourceqd = null
       }
       this.source = 2
-      this.initMap();
+      if(this.positionType==1){
+        this.initMap();
+      }
+      else{
+      this.queryAnalysis({ startTime: this.historyData[0], endTime: this.historyData[1] });
+      }
     },
     sourceqdChange(val) {
       if (val) {
@@ -481,7 +533,12 @@ export default {
         this.sourcedl = null
       }
       this.source = 1
-      this.initMap();
+      if(this.positionType==1){
+        this.initMap();
+      }
+      else{
+      this.queryAnalysis({ startTime: this.historyData[0], endTime: this.historyData[1] });
+      }
     },
     // onLineChange(val) {
     //   if (val) {
@@ -527,7 +584,7 @@ export default {
       this.pageNum = val;
       this.detail();
     },
-    
+
     initMap() {
       var _this = this;
       // https://webapi.amap.com/theme/v1.3/markers/n/mark_b.png
@@ -550,10 +607,11 @@ export default {
         _this.map.on("complete", () => {
           _this.$api.user.queryPosition({ source: this.source, ...this.province }).then(res => {
             if (res.code == 200) {
-              if(res.data.list && res.data.list.length>0){
-              // _this.onlineNum = res.data.manNum; //在线人数
+              if (res.data.list && res.data.list.length > 0) {
+                // _this.onlineNum = res.data.manNum; //在线人数
                 //处理后台返回要用到的数据
                 // _this.positionData = res.data.data
+                this.positionType = res.data.list[0].type
                 _this.positionData = res.data.list.map(item => ({
                   userName: item.userName,
                   id: item.id,
@@ -564,15 +622,15 @@ export default {
                   createTime: item.createTime,
                   deptName: item.deptName,
                   source: item.source,
-                  leaderName: item.leaderName,
+                  leaderName: item.leaderName?item.leaderName:'无',
                   positionArr: [item.longitude, item.latitude]
                 }));
                 _this.mapPoint();
               }
-              } else {
-                _this.$message.error(res.msg)
-                _this.loading = false;
-              }
+            } else {
+              _this.$message.error(res.msg)
+              _this.loading = false;
+            }
           });
         });
       });
@@ -617,7 +675,7 @@ export default {
       //     imageSize: new AMap.Size(30, 37)
       // });
 
-      _this.infoWindow = new AMap.InfoWindow({ offset: new AMap.Pixel(0, -4),closeWhenClickMap: true, }); //信息窗口
+      _this.infoWindow = new AMap.InfoWindow({ offset: new AMap.Pixel(0, -4), closeWhenClickMap: true, }); //信息窗口
       var position = JSON.parse(JSON.stringify(_this.positionData));
       for (var i = 0; i < position.length; i++) {
         var labelMarker = new AMap.LabelMarker({
@@ -628,8 +686,8 @@ export default {
         var normalMarker = new AMap.Marker({
           position: position[i].positionArr,
           map: _this.map,
-          content: position[i].source==1?'<div style="width:14px;height:14px;background: #FF3D00;border-radius: 50%;border: 1px solid #FFFFFF;"></div>'
-          :'<div style="width:14px;height:14px;background: #00C2FF;border-radius: 50%;border: 1px solid #FFFFFF;"></div>',
+          content: position[i].source == 1 ? '<div style="width:14px;height:14px;background: #FF3D00;border-radius: 50%;border: 1px solid #FFFFFF;"></div>'
+            : '<div style="width:14px;height:14px;background: #00C2FF;border-radius: 50%;border: 1px solid #FFFFFF;"></div>',
           // icon: require("@/assets/" + position[i].onlineImg)
         });
         normalMarker.content =
@@ -687,14 +745,20 @@ export default {
     markerClick(e) {
       let _this = this
       this.position = e.target._position
-      this.$api.user
-        .queryGeographyInfo({ lng: e.target._position[0], lat: e.target._position[1], pageSize: 5, pageNum: this.personnelPageNum })
+      let data = {
+        startTime: this.historyData.length > 0 && this.positionType == 2 ? this.historyData[0] : '',
+        endTime: this.historyData.length > 0 && this.positionType == 2 ? this.historyData[1] : '',
+      }
+      let api = this.positionType == 1 ? 'queryGeographyInfo' : 'queryGeographyRecord'
+      this.$api.user[api]({ lng: e.target._position[0], lat: e.target._position[1], pageSize: 5, 
+        pageNum: this.personnelPageNum, ...data
+      })
         .then(res => {
           if (res.code == 200) {
             this.personnelTotalSize = res.data.totalSize
             this.personnelData = res.data.content
             let content = e.target.content
-            content=  e.target.content+ `<div style="font-weight: 700;display: flex; justify-content: space-between;align-items: center;"> 
+            content = e.target.content + `<div style="font-weight: 700;display: flex; justify-content: space-between;align-items: center;"> 
           <span>共${_this.personnelTotalSize}人信息</span>
            <div style="background: linear-gradient( 270deg, #225FFE 0%, #23CAFF 100%);padding:4px 8px;color:#fff;border-radius: 4px 4px 4px 4px;" onclick="personnelclick()">查看更多</div>
           </div>`
@@ -807,7 +871,8 @@ export default {
   width: 32vw;
   box-shadow: 0px 5px 10px #ddd;
 }
-.infohis-window{
+
+.infohis-window {
   position: absolute;
   top: 0;
   right: 0;
@@ -817,6 +882,7 @@ export default {
   width: 25vw;
   box-shadow: 0px 5px 10px #ddd;
 }
+
 .personnel-window {
   position: fixed;
   bottom: 10px;
@@ -857,10 +923,11 @@ export default {
 }
 
 /deep/ {
-  .el-button--primary{
+  .el-button--primary {
     background: #3355FF !important;
     border-color: #3355FF !important;
   }
+
   .el-tabs__item:hover,
   .el-tabs__item.is-active {
     color: #3865E9;
@@ -869,9 +936,11 @@ export default {
   .el-tabs__active-bar {
     background-color: #3865E9;
   }
-  .el-table__empty-text{
+
+  .el-table__empty-text {
     line-height: 35px;
   }
+
   .amap-info-contentContainer {
     border-radius: 8px 8px 8px 8px;
     box-shadow: 0px 1px 8px #ddd;
@@ -928,18 +997,21 @@ export default {
     color: #fff;
     background-image: url(../../assets/user-map2.png);
   }
-  
-  .txt{
+
+  .txt {
     padding: 15px 0;
   }
+
   .input-card {
     width: 85px;
     display: flex;
     flex-direction: column;
   }
-  .info-online{
+
+  .info-online {
     font-size: 14px;
     line-height: 30px;
+
     i {
       display: inline-block;
       width: 8px;
@@ -949,5 +1021,4 @@ export default {
       margin-right: 10px;
     }
   }
-}
-</style>
+}</style>