wucl 2 years ago
parent
commit
be142ffcaf

+ 29 - 0
src/api/modules/marketLog.js

@@ -0,0 +1,29 @@
+import request from '@/utils/request'
+import { fileDown } from '../../utils/file'
+import md5 from 'js-md5'
+/*
+* 市场人员日志
+*/
+export default {
+  list(params) {
+    return request.get(`marketLog`, { params: params })
+  },
+  detail(params) {
+    return request.get(`marketLog/${params}`)
+  },
+  simpleAll() {
+    return request.get(`marketLog/simpleAll`)
+  },
+  add(params) {
+    return request.post(`marketLog`, params)
+  },
+  edit(params) {
+    return request.put(`marketLog`, params)
+  },
+   delete(params) {
+     return request.delete(`marketLog/${params}`)
+   },
+  collect(params){
+    return request.get(`marketLog/collect`, { params: params })
+  },
+}

+ 11 - 0
src/api/modules/marketStat.js

@@ -0,0 +1,11 @@
+import request from '@/utils/request'
+import { fileDown } from '../../utils/file'
+import md5 from 'js-md5'
+/*
+* 市场首页统计
+*/
+export default {
+  getMarketStat() {
+    return request.get(`marketStat`)
+  },
+}

+ 5 - 1
src/router/urlMap.js

@@ -46,6 +46,8 @@ import _views_market_visit from '@/views/market/visit/list'
 import _views_market_visit_add from '@/views/market/visit/detail'
 import _views_market_visit_detail from '@/views/market/visit/detail'
 import _views_market_index from '@/views/market/index'
+import _views_market_log from '@/views/market/log/list'
+import _views_market_log_collect from '@/views/market/log/rateCollect'
 
 export default {
   _views_set_menu,
@@ -80,5 +82,7 @@ export default {
   _views_market_visit,
   _views_market_visit_add,
   _views_market_visit_detail,
-  _views_market_index
+  _views_market_index,
+  _views_market_log,
+  _views_market_log_collect
 }

+ 0 - 9
src/views/log/list.vue

@@ -6,15 +6,6 @@
 
     <y-page-list-layout :page-list="pageData" :page-para="listQuery" :get-page-list="getList">
       <template slot="left">
-        <PermissionButton
-          menu-code="_views_item_add"
-          class-name="filter-item"
-          type="primary"
-          size="mini"
-          :page-jump="true"
-          round
-          style="float: left"
-        />
         <el-input
           v-model="listQuery.itemName"
           placeholder="项目名称"

+ 2 - 2
src/views/market/business/detail.vue

@@ -30,11 +30,11 @@
                   <el-row>
                     <el-col :xs="24" :sm="12" :lg="10" :span="6">
                       <el-form-item
-                        label="客户名:"
+                        label="客户名:"
                         prop="customerId"
                         label-width="180px"
                         class="postInfo-container-item"
-                        :rules="{required: true, message: '请填选择客户名', trigger: 'blur'}"
+                        :rules="{required: true, message: '请填选择客户名', trigger: 'blur'}"
                       >
                         <el-select
                           v-model="postForm.customerId"

+ 2 - 2
src/views/market/business/list.vue

@@ -18,7 +18,7 @@
         />
         <el-input
           v-model="listQuery.customerName"
-          placeholder="客户名"
+          placeholder="客户名"
           clearable
           style="margin-left: 20px;width: 320px;float: left;">
         </el-input>
@@ -56,7 +56,7 @@
         slot="table"
         style="width: 100%;"
       >
-        <el-table-column label="客户名" align="center" width="210">
+        <el-table-column label="客户名" align="center" width="210">
           <template slot-scope="{row}">
             <span>{{ row.customerName }}</span>
           </template>

+ 1 - 2
src/views/market/customer/detail.vue

@@ -19,7 +19,7 @@
                   <el-row>
                     <el-col :xs="24" :sm="12" :lg="6" :span="6">
                       <el-form-item
-                        label="客户名:"
+                        label="客户名:"
                         prop="name"
                         :rules="{required: true, message: '请输入员工姓名', trigger: 'blur'}"
                         label-width="120px"
@@ -80,7 +80,6 @@
                     <el-col :xs="24" :sm="12" :lg="6" :span="6">
                       <el-form-item label="联系电话:"
                                     prop="mobile"
-                                    :rules="[{required: true, message: '请输入联系电话', trigger: 'blur'},]"
                                     label-width="120px" class="postInfo-container-item">
                         <el-input v-model="postForm.mobile" class="filter-item"/>
                       </el-form-item>

+ 31 - 2
src/views/market/customer/list.vue

@@ -18,7 +18,7 @@
         />
         <el-input
           v-model="listQuery.name"
-          placeholder="客户名"
+          placeholder="客户名"
           clearable
           style="margin-left: 20px;width: 320px;float: left;">
         </el-input>
@@ -42,13 +42,39 @@
         >重置
         </el-button>
       </template>
+      <template slot="right">
+        <PermissionButton
+          menu-code="_views_customer_template"
+          class-name="filter-item"
+          round
+          icon="el-icon-download"
+          name="下载模板"
+          @click="handleDownload"
+        />
+        <PermissionButton
+          menu-code="_views_customer_import"
+          class-name="filter-item"
+          round
+          type="text"
+          name=""
+          style="padding: 0; margin-bottom: 10px"
+        >
+          <excelImport
+            ref="uploadControl"
+            flag="customer/importExcel"
+            :style-type="1"
+            title="导入"
+            @fath="getList"
+          />
+        </PermissionButton>
+      </template>
       <parentTable
         v-loading="listLoading"
         :data="pageData.records"
         slot="table"
         style="width: 100%;"
       >
-        <el-table-column label="客户名称" align="center">
+        <el-table-column label="客户名" align="center">
           <template slot-scope="{row}">
             <span>{{ row.name }}</span>
           </template>
@@ -178,6 +204,9 @@
       that.getList();
     },
     methods: {
+      handleDownload() {
+        this.$utils.exportUtil('/customer/download/importTemplate', {}, '模板下载')
+      },
       getAllEnum() {
         const that = this;
         that.$api.globalConfig.getAllEnum().then(data => {

+ 84 - 14
src/views/market/index.vue

@@ -2,13 +2,13 @@
   <div class="app-container">
     <y-data-view-page-layout title="市场管理首页" class="staff-admin-index">
       <y-data-view-module>
-        <div>
-          <y-d-v-over-view style="width: 250px" title="本年签约目标" :typeId="1" :ico="require('@/assets/statics/pg8.png')" :data="[{text:logStaticsInfo.currentDayNum,value:'个'}]"></y-d-v-over-view>
-          <y-d-v-over-view style="width: 250px" title="本年回款目标" :typeId="2" :ico="require('@/assets/statics/pg8.png')" :data="[{text:logStaticsInfo.userName,value:'元'}]" ></y-d-v-over-view>
-          <y-d-v-over-view style="width: 250px" title="潜在商机" :typeId="3" :ico="require('@/assets/statics/pg8.png')" :data="[{text:logStaticsInfo.logDate,value:'个'}]" ></y-d-v-over-view>
-          <y-d-v-over-view style="width: 250px" title="本年已签约" :typeId="4" :ico="require('@/assets/statics/pg9.png')" :data="[{text:logStaticsInfo.totalNum,value:'个'}]" ></y-d-v-over-view>
-          <y-d-v-over-view style="width: 250px" title="本年已回款" :typeId="5" :ico="require('@/assets/statics/pg9.png')" :data="[{text:logStaticsInfo.logDate,value:'元'}]" ></y-d-v-over-view>
-          <y-d-v-over-view style="width: 250px" title="本月已回款" :typeId="6" :ico="require('@/assets/statics/pg9.png')" :data="[{text:logStaticsInfo.logDate,value:'元'}]" ></y-d-v-over-view>
+        <div style="width: 1660px">
+          <y-d-v-over-view style="width: 250px" title="本年签约目标" :typeId="1" :ico="require('@/assets/statics/pg8.png')" :data="[{text:marketStaticsInfo.yearSaleTarget,value:'元'}]" @click.native="openSet('本年签约目标')"></y-d-v-over-view>
+          <y-d-v-over-view style="width: 250px" title="本年回款目标" :typeId="2" :ico="require('@/assets/statics/pg8.png')" :data="[{text:marketStaticsInfo.yearPaymentTarget,value:'元'}]" @click.native="openSet('本年回款目标')"></y-d-v-over-view>
+          <y-d-v-over-view style="width: 250px" title="潜在商机" :typeId="3" :ico="require('@/assets/statics/pg8.png')" :data="[{text:marketStaticsInfo.businessNum,value:'个'}]" ></y-d-v-over-view>
+          <y-d-v-over-view style="width: 250px" title="本年已签约" :typeId="4" :ico="require('@/assets/statics/pg9.png')" :data="[{text:marketStaticsInfo.yearSaleDone,value:'元'}]" ></y-d-v-over-view>
+          <y-d-v-over-view style="width: 250px" title="本年已回款" :typeId="5" :ico="require('@/assets/statics/pg9.png')" :data="[{text:marketStaticsInfo.yearPaymentDone,value:'元'}]" ></y-d-v-over-view>
+          <y-d-v-over-view style="width: 250px" title="本月已回款" :typeId="6" :ico="require('@/assets/statics/pg9.png')" :data="[{text:marketStaticsInfo.monthPaymentDone,value:'元'}]" ></y-d-v-over-view>
         </div>
       </y-data-view-module>
       <div class="calendar-class">
@@ -73,6 +73,32 @@
           </el-form>
         </div>
       </el-drawer>
+      <el-dialog
+        :title="setName"
+        width="600px"
+        :visible.sync="setDialogFormVisible"
+        :close-on-click-modal="false"
+      >
+        <el-form
+          ref="setForm"
+          :model="temp"
+          label-position="right"
+          label-width="110px"
+          style="width: 400px; margin-left:50px;"
+        >
+          <el-form-item label="金额:" prop="amount">
+            <el-input v-model.number="temp.amount" class="filter-item"/>
+          </el-form-item>
+          <el-form-item label="">
+            <el-button @click="setDialogFormVisible = false">
+              取消
+            </el-button>
+            <el-button type="primary" @click="saveSet()">
+              保存
+            </el-button>
+          </el-form-item>
+        </el-form>
+      </el-dialog>
     </y-data-view-page-layout>
   </div>
 </template>
@@ -91,7 +117,7 @@
     data() {
       return {
         value: new Date(),
-        logStaticsInfo:{},
+        marketStaticsInfo:{},
         table: false,
         dialog: false,
         loading: false,
@@ -113,10 +139,16 @@
         dialogVisible:false,
         dynamicTags: [],
         calandarList:[],
+        setDialogFormVisible:false,
+        temp:{
+          amount:null
+        },
+        setName:''
       }
     },
     created() {
       this.getCanlendarList();
+      this.getMarketStat();
     },
     computed:{
       title(){
@@ -124,11 +156,49 @@
       },
     },
     mounted() {
-      this.$nextTick(() => {
-        this.getLogStat();
-      })
+
     },
     methods: {
+      saveSet(){
+        if (isNaN(this.temp.amount) || this.temp.amount===null){
+          this.$notify({
+            title: '失败',
+            message: '请输入数字',
+            type: 'error',
+            duration: 2000
+          });
+          return
+        }
+        let field = 'YEAR_SALE_TARGET';
+        if (this.setName === '本年回款目标'){
+          field = 'YEAR_PAYMENT_TARGET';
+        }
+        let data = {
+          description:this.setName,
+          value:this.temp.amount,
+          name:'MARKET',
+          field:field
+        };
+        this.$api.globalConfig.add(data).then(data => {
+            if (data.code === 200) {
+              this.setDialogFormVisible = false;
+              this.$notify({
+                title: '成功',
+                message: '修改成功',
+                type: 'success',
+                duration: 2000
+              });
+              this.getMarketStat();
+          }else{
+            this.$message.success(data.msg)
+          }
+        })
+      },
+      openSet(key){
+        this.temp.amount = null;
+        this.setName = key;
+        this.setDialogFormVisible = true;
+      },
       getCanlendarList(){
 
         let userId = this.$store.getters.userInfo.id;
@@ -219,10 +289,10 @@
         this.currentDate = date.day;
         this.tagdata();
       },
-      getLogStat(){
-        this.$api.itemLog.getLogStat().then(res => {
+      getMarketStat(){
+        this.$api.marketStat.getMarketStat().then(res => {
           if (res.code === 200){
-            this.logStaticsInfo = res.data;
+            this.marketStaticsInfo = res.data;
           }
         });
       },

+ 372 - 0
src/views/market/log/list.vue

@@ -0,0 +1,372 @@
+<template>
+  <div class="app-container">
+    <div class="title-container">
+      <breadcrumb id="breadcrumb-container" class="breadcrumb-container"/>
+    </div>
+
+    <y-page-list-layout :page-list="pageData" :page-para="listQuery" :get-page-list="getList">
+      <template slot="left">
+        <PermissionButton
+          menu-code="_views_market_log_add"
+          class-name="filter-item"
+          type="primary"
+          round
+          size="mini"
+          @click.native="openAddLog()"
+        />
+<!--        <el-button-->
+<!--          class="filter-item"-->
+<!--          style="margin-left: 10px;float: left;"-->
+<!--          type="primary"-->
+<!--          @click="searchList"-->
+<!--          round-->
+<!--        >搜索-->
+<!--        </el-button>-->
+<!--        <el-button-->
+<!--          class="filter-item"-->
+<!--          style="float: left;"-->
+<!--          round-->
+<!--          type="warning"-->
+<!--          @click="resetSearch()"-->
+<!--        >重置-->
+<!--        </el-button>-->
+      </template>
+      <parentTable
+        v-loading="listLoading"
+        :data="pageData.records"
+        slot="table"
+        style="width: 100%;"
+      >
+        <el-table-column label="日志日期" align="center" width="150">
+          <template slot-scope="{row}">
+            <span>{{ row.logDate }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="日志内容" align="center">
+          <template slot-scope="{row}">
+            <span>{{ row.taskSituation }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="创建时间" align="center" width="180">
+          <template slot-scope="{row}">
+            <span>{{ row.created }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" width="170">
+          <template slot-scope="{row}">
+            <PermissionButton
+              menu-code="_views_market_log_detail"
+              class-name="filter-item"
+              name=""
+              type="primary"
+              round
+              size="mini"
+              @click="detail(row.id,row.logDate,row.taskSituation)"
+            />
+            <PermissionButton
+              menu-code="_views_market_log_remove"
+              class-name="filter-item"
+              name=""
+              type="danger"
+              round
+              size="mini"
+              @click="deleteInfo(row.id)"
+            />
+          </template>
+        </el-table-column>
+      </parentTable>
+    </y-page-list-layout>
+    <el-dialog
+      width="600px"
+      :title="textMap[dialogStatus]"
+      :visible.sync="dialogFormVisible"
+      :close-on-click-modal="false"
+    >
+      <el-form
+        ref="dataForm"
+        v-loading="dialogLoading"
+        :model="temp"
+        label-position="right"
+        label-width="110px"
+        style="width: 400px; margin-left:50px;"
+      >
+        <el-form-item
+          label="日期:"
+          prop="logDate"
+          class="filter-item"
+        >
+          <el-date-picker
+            v-model="temp.logDate"
+            type="date"
+            value-format="yyyy-MM-dd"
+            style="width: 100%"
+            placeholder="选择日期"
+          />
+        </el-form-item>
+        <el-form-item label="内容:" prop="name">
+          <el-input v-model="temp.taskSituation" class="filter-item" type="textarea" :autosize="{ minRows: 8, maxRows: 8}"/>
+        </el-form-item>
+
+        <el-form-item label="">
+          <el-button @click="dialogFormVisible = false">
+            取消
+          </el-button>
+          <el-button type="primary" @click="dialogStatus==='create'?createData():updateData()">
+            保存
+          </el-button>
+        </el-form-item>
+      </el-form>
+      <!--      <div slot="footer" class="dialog-footer" style="text-align: center">-->
+      <!--        -->
+      <!--      </div>-->
+    </el-dialog>
+  </div>
+</template>
+<script>
+  import YPageListLayout from '@/components/YPageListLayout'
+  import Breadcrumb from '@/components/Breadcrumb'
+  import PermissionButton from '@/components/PermissionButton/PermissionButton'
+
+  export default {
+    name: 'ViewsLogList',
+    components: {
+      Breadcrumb,
+      YPageListLayout,
+      PermissionButton,
+    },
+    data() {
+      return {
+        isDisable:false,
+        tableKey: 0,
+        pageData: { records: [] },
+        total: 20,
+        listLoading: true,
+        listQuery: {
+          page: 1,
+          size: 10,
+          // name: '',
+          // staffNo: '',
+          descs: 'id',
+          me: false
+        },
+        listQueryKey: 'keyword',
+        importLoading: false,
+        dialogFormVisible: false,
+        dialogStatus: '',
+        textMap: {
+          update: '编辑',
+          create: '新增'
+        },
+        dialogLoading:false,
+        temp:{
+          id:null,
+          logDate:null,
+          taskSituation:'',
+          userId: this.$store.getters.userInfo.id
+        }
+      }
+    },
+    created() {
+      const that = this;
+      that.getList()
+    },
+
+    computed: {
+      timeDefault() {
+        const date = new Date();
+        const s1 = date.getFullYear() + "-" + (this.getZero(date.getMonth() + 1)) + "-" + this.getZero((date.getDate()));
+        return s1;
+      }
+    },
+    methods: {
+      getZero(num) {
+        // 单数前面加0
+        if (parseInt(num) < 10) {
+          num = '0' + num;
+        }
+        return num;
+      },
+      openAddLog() {
+        this.temp.id = null;
+        this.temp.logDate = null;
+        this.temp.taskSituation = null;
+        this.dialogStatus = 'create';
+        this.dialogFormVisible = true;
+        this.temp.logDate = this.timeDefault;
+      },
+      detail(id, logDate, taskSituation){
+        this.temp.id = id;
+        this.temp.logDate = logDate;
+        this.temp.taskSituation = taskSituation;
+        this.dialogStatus = 'update';
+        this.dialogFormVisible = true;
+      },
+      resetSearch() {
+        this.listQuery = {
+          current: 1,
+          size: 10,
+          descs: 'id',
+        }
+        this.getList()
+      },
+      searchList() {
+        // 重置分页
+        this.listQuery.page = 1
+        this.listQuery.size = 20
+        this.getList()
+      },
+      getList() {
+        const that = this;
+        this.listLoading = true;
+        const key = {}
+        this.$api.marketLog.list(Object.assign({}, that.listQuery, key)).then((res) => {
+            that.pageData = res.data
+            setTimeout(() => {
+              that.listLoading = false
+            }, 200)
+          })
+          .catch(() => {
+            that.listLoading = false
+          })
+      },
+      deleteInfo(id) {
+        const that = this
+        that.$confirm('请确认是否删除该数据?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+          center: true
+        }).then(() => {
+          that.$api.marketLog.delete(id).then(data => {
+            that.loading = false
+            if (data.code === 200) {
+              that.getList()
+            } else {
+              this.$message({
+                type: 'error',
+                message: data.msg
+              })
+            }
+          })
+        }).catch(() => {
+        })
+      },
+      createData() {
+        if (!this.temp.logDate) {
+          this.$notify({
+            title: '错误',
+            message: '日期不能为空',
+            type: 'error',
+            duration: 2000
+          });
+          return
+        }
+        if (!this.temp.taskSituation) {
+          this.$notify({
+            title: '错误',
+            message: '内容不能为空',
+            type: 'error',
+            duration: 2000
+          });
+          return
+        }
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            this.dialogLoading = true;
+            this.$api.marketLog.add(this.temp).then(res => {
+              if (res.code === 200) {
+                this.dialogLoading = false;
+                this.dialogFormVisible = false;
+                this.$notify({
+                  title: '成功',
+                  message: '创建成功',
+                  type: 'success',
+                  duration: 2000
+                });
+                this.getList()
+              }
+            }).catch(() => {
+              this.dialogLoading = false
+            })
+          }
+        })
+      },
+      updateData() {
+        if (!this.temp.logDate) {
+          this.$notify({
+            title: '错误',
+            message: '日期不能为空',
+            type: 'error',
+            duration: 2000
+          });
+          return
+        }
+        if (!this.temp.taskSituation) {
+          this.$notify({
+            title: '错误',
+            message: '内容不能为空',
+            type: 'error',
+            duration: 2000
+          });
+          return
+        }
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            this.$api.marketLog.edit(this.temp).then(res => {
+              if (res.code === 200) {
+                this.dialogFormVisible = false;
+                this.$notify({
+                  title: '成功',
+                  message: '编辑成功',
+                  type: 'success',
+                  duration: 2000
+                });
+                this.getList()
+              }
+            })
+          }
+        })
+      }
+    },
+  }
+</script>
+<style lang="scss" scoped>
+  .right {
+    flex: 1;
+
+    .title {
+      font-size: 16px;
+      font-weight: 500;
+      color: rgba(51, 51, 51, 1);
+      line-height: 35px;
+      margin-bottom: 8px;
+    }
+
+    .menu-2-box {
+      display: flex;
+      flex-wrap: wrap;
+      width: 100%;
+    }
+
+    .menu-2-item {
+      display: flex;
+      align-items: center;
+      color: #656565;
+      font-size: 12px;
+      width: 230px;
+      height: 101px;
+      background: rgb(255, 185, 129);
+      border-radius: 3px;
+      padding-left: 20px;
+      margin-right: 10px;
+      margin-bottom: 10px;
+      cursor: pointer;
+      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
+
+      .text {
+        margin-left: 16px;
+      }
+    }
+  }
+</style>

+ 156 - 0
src/views/market/log/rateCollect.vue

@@ -0,0 +1,156 @@
+<template>
+  <div class="app-container">
+    <div class="title-container">
+      <breadcrumb id="breadcrumb-container" class="breadcrumb-container"/>
+    </div>
+    <div class="condition">
+      <el-date-picker
+        v-model="startDate"
+        type="date"
+        value-format="yyyy-MM-dd"
+        style="width: 200px;margin-top: 10px;margin-left: 17px"
+        placeholder="开始日期"
+      />
+      <el-date-picker
+        v-model="endDate"
+        type="date"
+        value-format="yyyy-MM-dd"
+        style="width: 200px ;margin-top: 10px;margin-left: 17px"
+        placeholder="结束日期"
+      />
+      <el-button
+        class="filter-item"
+        style="margin-left: 10px;"
+        type="primary"
+        @click="getLogs"
+        round
+      >搜索
+      </el-button>
+    </div>
+    <y-page-list-layout>
+      <el-table :data="tableData" slot="table" style="width: 100%;" border="border" height="900px" :row-style="{height:'100px'}">
+        <el-table-column v-if="tableData.length>0" label="日期" width="150px" align="center" fixed>
+          <template slot-scope="{row}">
+            <span>{{row.logDate}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :label="name" v-for="(name,index) in userNames" :key="index" width="520px">
+          <template slot-scope="{row}">
+            <div v-for="(l,index) in row.list" :key="index">
+              <div class="content" v-if = "g.userName===name" v-for="(g,index) in l.logs" >
+                <div class="info">
+                  <div id="info-item" type="info" effect="dark">
+                    {{ index+1 }}、{{g.taskSituation}}
+                  </div>
+                </div>
+              </div>
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+    </y-page-list-layout>
+  </div>
+</template>
+<script>
+  import Breadcrumb from '@/components/Breadcrumb'
+  import YDetailPageLayout from '@/components/YDetailPageLayout'
+
+  export default {
+    name: 'itemRate',
+    components: {
+      Breadcrumb,
+      YDetailPageLayout
+    },
+    data() {
+      return {
+        type: 'detail',
+        br: '<br/>',
+        activeName: 'first',
+        vLoading: false,
+        listQuery:{},
+        scope: false,
+        tableData: [],
+        dates:[],
+        userNames:[],
+        dialogFormVisible: false,
+        postForm:{},
+        startDate:null,
+        endDate:null
+      }
+    },
+    created() {
+      this.endDate = this.timeDefault;
+      this.startDate = this.getago(this.endDate, -10);
+      this.getLogs();
+
+    },
+    computed:{
+      timeDefault() {
+        const date = new Date();
+        const s1 = date.getFullYear() + "-" + (this.getZero(date.getMonth() + 1)) + "-" + this.getZero((date.getDate()));
+        return s1;
+      },
+    },
+    methods:{
+      getago(startDate, valueTime){
+        var date = new Date(startDate);
+        var newDate = new Date(date.getFullYear(), date.getMonth(), date.getDate()+ +valueTime);
+        var Y = newDate.getFullYear();
+        var M = newDate.getMonth()+1;
+        M = M<10?'0'+M:M;
+        var D = newDate.getDate();
+        D = D<10?'0'+D:D;
+        return `${Y}-${M}-${D}`;
+      },
+      getZero(num) {
+        // 单数前面加0
+        if (parseInt(num) < 10) {
+          num = '0' + num;
+        }
+        return num;
+      },
+      getLogs(){
+        this.tableData = null;
+        this.userNames = [];
+        this.$api.marketLog.collect({startDate:this.startDate, endDate:this.endDate}).then(res=>{
+          this.tableData = res.data;
+          const us = this.userNames;
+          const d = this.tableData;
+          d.forEach(function (e) {
+            us.push(e.userName);
+          });
+          this.userNames = Array.from(new Set(us));
+          this.tableData = this.groupByDate(d, 'logDate');
+        });
+      },
+      groupByDate(list, key){
+        var keysArr = list.map(item=>item[key])
+        var keys = [...new Set(keysArr)]
+        var newList = keys.map(item=> {
+          return {
+            [key]: item,
+            list: list.filter(i=>i[key] === item)
+          }
+        });
+        return newList;
+      }
+    }
+  }
+</script>
+<style lang="css" scoped>
+    div.content{
+      margin-bottom: 5px;
+      width: 520px;
+    }
+    /*.info:hover{*/
+    /*  cursor: pointer;*/
+    /*}*/
+    .info {
+      width: 500px;
+      height: auto;
+    }
+    #info-item{
+      text-overflow: ellipsis !important;
+      white-space: pre-wrap !important;
+    }
+</style>

+ 2 - 2
src/views/market/visit/detail.vue

@@ -13,11 +13,11 @@
                   <el-row>
                     <el-col :xs="24" :sm="12" :lg="10" :span="6">
                       <el-form-item
-                        label="客户名:"
+                        label="客户名:"
                         prop="customerId"
                         label-width="180px"
                         class="postInfo-container-item"
-                        :rules="{required: true, message: '请填选择客户名', trigger: 'blur'}"
+                        :rules="{required: true, message: '请填选择客户名', trigger: 'blur'}"
                       >
                         <el-select
                           v-model="postForm.customerId"

+ 2 - 2
src/views/market/visit/list.vue

@@ -18,7 +18,7 @@
         />
         <el-input
           v-model="listQuery.customerName"
-          placeholder="客户名"
+          placeholder="客户名"
           clearable
           style="margin-left: 20px;width: 320px;float: left;">
         </el-input>
@@ -49,7 +49,7 @@
         slot="table"
         style="width: 100%;"
       >
-        <el-table-column label="客户名" align="center" width="210">
+        <el-table-column label="客户名" align="center" width="210">
           <template slot-scope="{row}">
             <span>{{ row.customerName }}</span>
           </template>