Kaynağa Gözat

文档需求提交

wucl 2 yıl önce
ebeveyn
işleme
fd698824fe

+ 24 - 0
src/api/modules/businessReply.js

@@ -0,0 +1,24 @@
+import request from '@/utils/request'
+/*
+* 业务回复
+*/
+export default {
+  list(params) {
+    return request.get(`businessReply`, { params: params })
+  },
+  detail(params) {
+    return request.get(`businessReply/${params}`)
+  },
+  add(params) {
+    return request.post(`businessReply`, params)
+  },
+  edit(params) {
+    return request.put(`businessReply`, params)
+  },
+  delete(params) {
+    return request.delete(`businessReply/${params}`)
+  },
+  notRead(params) {
+    return request.get(`businessReply/notRead`, { params: params })
+  },
+}

+ 0 - 2
src/router/urlMap.js

@@ -102,6 +102,4 @@ export default {
   _views_brokerage_settle,
   _views_brokerage_settle_detail,
   _views_brokerage_deduction,
-  _views_market_visit_reply: () =>
-    import('../views/market/visit/reply'), //拜访日志回复页
 }

+ 21 - 4
src/views/item/list.vue

@@ -27,6 +27,16 @@
           <el-option label="已完成" value="已完成"/>
           <el-option label="未开始" value="未开始"/>
         </el-select>
+        <el-select
+          v-model="listQuery.cate"
+          placeholder="项目类型"
+          clearable
+          filterable
+          style="margin-left: 20px;width: 100px;float: left;"
+          class="filter-item"
+        >
+          <el-option v-for="item in cateList" :key="item.id" :label="item.name" :value="item.id"/>
+        </el-select>
         <el-input
           v-model="listQuery.name"
           placeholder="项目名称"
@@ -126,15 +136,15 @@
             <el-tag>{{ row.itemStatus}}</el-tag>
           </template>
         </el-table-column>
-        <el-table-column label="当前阶段" align="center" width="100">
+        <el-table-column label="当前阶段" align="center" width="200">
           <template slot-scope="{row}">
             <el-tag>{{computedStageName(row.stageName)}}</el-tag>
           </template>
         </el-table-column>
         <el-table-column label="电子合同" align="center" width="100">
           <template slot-scope="{row}">
-            <el-button v-if="row.contractUrl"  type="success" plain @click="downloadContract(row.contractUrl)">下载</el-button>
-            <el-button v-else plain disabled>下载</el-button>
+            <el-button v-if="row.contractUrl" type="success" plain round @click="downloadContract(row.contractUrl)">下载</el-button>
+            <el-button v-else plain round disabled>下载</el-button>
           </template>
         </el-table-column>
         <el-table-column label="操作" align="center" width="300" fixed="right">
@@ -252,6 +262,7 @@
         },
         listQueryKey: 'keyword',
         importLoading: false,
+        cateList:[],
       }
     },
     created() {
@@ -259,9 +270,15 @@
       if (this.$route.query.businessNo) {
         this.listQuery.businessNo = this.$route.query.businessNo;
       }
-      that.getList()
+      that.getList();
+      this.getCateList();
     },
     methods: {
+      getCateList(){
+        this.$api.dictData.simpleType("项目类型").then(res => {
+          this.cateList = res.data
+        })
+      },
       downloadContract(url){
         var a = document.createElement('a');
         var event = new MouseEvent('click');

+ 45 - 15
src/views/log/rateEntry.vue

@@ -6,7 +6,7 @@
     <div style="padding-top: 30px;">
       <el-tabs v-model="activeName" @tab-click="handleClick">
         <el-tab-pane label="部门日志" name="first">
-          <y-page-list-layout :get-page-list="getDepartmentList" :page-list="departmentPageData">
+          <y-page-list-layout :page-para="listQuery1" :get-page-list="getDepartmentList" :page-list="departmentPageData">
             <el-table
               size="medium"
               slot="table"
@@ -61,7 +61,32 @@
           </y-page-list-layout>
         </el-tab-pane>
         <el-tab-pane label="项目日志">
-          <y-page-list-layout :get-page-list="getItemList" :page-list="itemPageData">
+          <y-page-list-layout :page-para="listQuery2" :get-page-list="getItemList" :page-list="itemPageData" >
+            <template slot="left">
+              <el-input
+                v-model="listQuery2.name"
+                placeholder="项目名称"
+                clearable
+                style="margin-left: 20px;width: 320px;float: left;"
+              >
+              </el-input>
+              <el-button
+                class="filter-item"
+                style="margin-left: 10px;float: left;"
+                type="primary"
+                @click="getItemList"
+                round
+              >搜索
+              </el-button>
+              <el-button
+                class="filter-item"
+                style="float: left;"
+                round
+                type="warning"
+                @click="resetSearch"
+              >重置
+              </el-button>
+            </template>
             <el-table
               size="medium"
               slot="table"
@@ -88,11 +113,6 @@
                   <span>{{ row.oaNo }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="业务来源" align="center" width="360">
-                <template slot-scope="{row}">
-                  <span>{{ row.businessSource }}</span>
-                </template>
-              </el-table-column>
               <el-table-column label="委托单位" align="center" width="120">
                 <template slot-scope="{row}">
                   <span>{{ row.clientUnit}}</span>
@@ -110,7 +130,7 @@
               </el-table-column>
               <el-table-column label="状态" align="center" width="120">
                 <template slot-scope="{row}">
-                  <span>{{ row.state}}</span>
+                  <span>{{ row.itemStatus}}</span>
                 </template>
               </el-table-column>
               <el-table-column label="操作" align="center" width="100">
@@ -162,9 +182,14 @@
         departmentPageData: {},
         itemPageData: {},
         listLoading: false,
-        listQuery: {
+        listQuery1: {
           current: 1,
-          size: 30,
+          size: 10,
+          descs: 'id',
+        },
+        listQuery2: {
+          current: 1,
+          size: 10,
           descs: 'id',
           me: false
         },
@@ -189,13 +214,18 @@
           phone: ''
         }
       },
-      searchList() {
-        this.listQuery.current = 1;
+      resetSearch() {
+        this.listQuery2 = {
+          current: 1,
+          size: 10,
+          descs: 'id',
+        }
+        this.getItemList()
       },
       getDepartmentList() {
         const that = this;
         this.listLoading = true;
-        this.$api.department.permissionPage(that.listQuery).then(res => {
+        this.$api.department.permissionPage(that.listQuery1).then(res => {
           that.departmentPageData = res.data;
           setTimeout(() => {
             that.listLoading = false
@@ -209,9 +239,9 @@
         this.listLoading = true;
         const key = {};
         if (this.$router.currentRoute.path === '/item/list/me'){
-          this.listQuery.me = true;
+          this.listQuery2.me = true;
         }
-        this.$api.item.list(Object.assign({}, that.listQuery, key)).then((res) => {
+        this.$api.item.list(Object.assign({}, that.listQuery2, key)).then((res) => {
           that.itemPageData = res.data;
           setTimeout(() => {
             that.listLoading = false

+ 3 - 3
src/views/market/index.vue

@@ -65,9 +65,9 @@
                   v-model="textareadata"
                 />
                 <span slot="footer" class="dialog-footer">
-                <el-button @click="dialogVisible = false">取 消</el-button>
-                <el-button type="primary" @click="addtag">确 定</el-button>
-              </span>
+                  <el-button @click="dialogVisible = false">取 消</el-button>
+                  <el-button type="primary" @click="addtag">确 定</el-button>
+                </span>
               </el-dialog>
             </el-col>
           </el-form>

+ 74 - 17
src/views/market/log/list.vue

@@ -14,22 +14,6 @@
           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"
@@ -53,8 +37,11 @@
             <span>{{ row.created }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="操作" align="center" width="170">
+        <el-table-column label="操作" align="center" width="300" style="height: 50px">
           <template slot-scope="{row}">
+            <el-badge :hidden="row.replyCount==0" :value= "row.replyCount" class="item" style="margin-right: 10px">
+              <el-button size="small" round @click="openReply(row.id)">回复</el-button>
+            </el-badge>
             <PermissionButton
               menu-code="_views_market_log_detail"
               class-name="filter-item"
@@ -121,6 +108,47 @@
       <!--        -->
       <!--      </div>-->
     </el-dialog>
+    <el-dialog
+      title="回复内容"
+      :visible.sync="dialogVisible"
+      width="70%"
+      custom-class="tag-class"
+    >
+      <y-page-list-layout :page-list="replyPageData" :page-para="listQuery" :get-page-list="getReplyList">
+        <parentTable
+          v-loading="listLoading"
+          :data="replyPageData.records"
+          slot="table"
+          style="width: 100%;"
+        >
+          <el-table-column label="内容" align="center" width="500">
+            <template slot-scope="{row}">
+              <span>{{ row.content }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="回复人" align="center">
+            <template slot-scope="{row}">
+              <span>{{ row.replier }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="接收人" align="center">
+            <template slot-scope="{row}">
+              <span>{{ row.receiver }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="状态" align="center">
+            <template slot-scope="{row}">
+              <el-tag type="error">{{row.state?'已读':'未读'}}</el-tag>
+            </template>
+          </el-table-column>
+          <el-table-column label="回复时间" align="center">
+            <template slot-scope="{row}">
+              <span>{{ row.created}}</span>
+            </template>
+          </el-table-column>
+        </parentTable>
+      </y-page-list-layout>
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -137,6 +165,8 @@
     },
     data() {
       return {
+        replyPageData:{},
+        dialogVisible:false,
         isDisable:false,
         tableKey: 0,
         pageData: { records: [] },
@@ -180,6 +210,22 @@
       }
     },
     methods: {
+      openReply(id){
+        this.dialogVisible=true;
+        this.getReplyList(id);
+      },
+      getReplyList(id) {
+        const that = this;
+        this.$api.businessReply.list(Object.assign({bizType:'MARKET_LOG_REPLY', bizTableId:id}, that.listQuery)).then((res) => {
+          that.replyPageData = res.data;
+          setTimeout(() => {
+            that.listLoading = false
+          }, 200);
+        })
+          .catch(() => {
+            that.listLoading = false
+          })
+      },
       getZero(num) {
         // 单数前面加0
         if (parseInt(num) < 10) {
@@ -368,5 +414,16 @@
         margin-left: 16px;
       }
     }
+
+  }
+ /deep/ .el-table .cell {
+    box-sizing: border-box;
+    overflow: visible;
+    text-overflow: ellipsis;
+    white-space: normal;
+    word-break: break-all;
+    line-height: 23px;
+    padding-left: 10px;
+    padding-right: 10px;
   }
 </style>

+ 57 - 5
src/views/market/log/rateCollect.vue

@@ -34,14 +34,16 @@
             <span>{{row.logDate}}</span>
           </template>
         </el-table-column>
-        <el-table-column :label="name" v-for="(name,index) in userNames" :key="index" width="520px">
+        <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 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>
+                  <el-tooltip class="item" effect="dark" content="点击回复" placement="right-start">
+                    <div id="info-item" type="info" effect="dark" @click="openDialog(g)">
+                      {{ index+1 }}、{{g.taskSituation}}
+                    </div>
+                  </el-tooltip>
                 </div>
               </div>
             </div>
@@ -49,6 +51,23 @@
         </el-table-column>
       </el-table>
     </y-page-list-layout>
+    <el-dialog
+      title="回复内容"
+      :visible.sync="dialogVisible"
+      width="30%"
+      custom-class="tag-class"
+    >
+      <el-input
+        type="textarea"
+        :rows="8"
+        placeholder="请输入内容"
+        v-model="replyForm.content"
+      />
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="replay">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -63,6 +82,16 @@
     },
     data() {
       return {
+        replyForm: {
+          id:null,
+          content:null,
+          bizType:'MARKET_LOG_REPLY',
+          bizTableId:null,
+          parentId:null,
+          replierId:null,
+          receiverId:null
+        },
+        dialogVisible: false,
         type: 'detail',
         br: '<br/>',
         activeName: 'first',
@@ -92,6 +121,29 @@
       },
     },
     methods:{
+      openDialog(g){
+        this.dialogVisible = true;
+        this.replyForm.bizTableId = g.id;
+        this.replyForm.replierId = this.$store.getters.userInfo.id;
+        this.replyForm.receiverId = g.userId;
+      },
+      replay(){
+        this.$api.businessReply.add(Object.assign({}, this.replyForm, {
+        })).then(res => {
+          if (res.code === 200) {
+            this.$notify({
+              title: '成功',
+              message: '回复成功',
+              type: 'success',
+              duration: 2000
+            });
+            this.dialogVisible = false;
+            this.vLoading = false
+          }
+        }).catch(() => {
+          this.vLoading = false
+        })
+      },
       getago(startDate, valueTime){
         var date = new Date(startDate);
         var newDate = new Date(date.getFullYear(), date.getMonth(), date.getDate()+ +valueTime);

+ 306 - 130
src/views/market/visit/detail.vue

@@ -3,174 +3,242 @@
     <div class="title-container">
       <breadcrumb id="breadcrumb-container" class="breadcrumb-container"/>
     </div>
-    <y-detail-page-layout @save="handleCreate" :edit-status="true" v-loading="vLoading" element-loading-text="处理中。。。">
-      <div style="padding-top: 30px;">
-        <el-tabs v-model="activeName">
-          <el-tab-pane label="拜访详情" name="first">
+    <div style="padding-top: 30px;">
+      <el-tabs v-model="activeName" type="border-card">
+        <el-tab-pane label="拜访详情" name="first">
+          <y-detail-page-layout @save="handleCreate" :edit-status="true" v-loading="vLoading" element-loading-text="处理中。。。">
             <el-form ref="postForm" :model="postForm" class="form-container" style="padding-left: 200px;">
+            <div>
+              <div class="postInfo-container">
+                <el-row>
+                  <el-col :xs="24" :sm="12" :lg="10" :span="6">
+                    <el-form-item
+                      label="客户名字:"
+                      prop="customerId"
+                      label-width="180px"
+                      class="postInfo-container-item"
+                      :rules="{required: true, message: '请填选择客户名字', trigger: 'blur'}"
+                    >
+                      <el-select
+                        v-model="postForm.customerId"
+                        placeholder=""
+                        clearable
+                        filterable
+                        class="filter-item"
+                        style="width:360px"
+                        @change="getCustomerDetail"
+
+                      >
+                        <el-option
+                          v-for="item in customers"
+                          :key="item.id"
+                          :label="item.name"
+                          :value="item.id"
+                        />
+                      </el-select>
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+                <el-row>
+                  <el-col :xs="24" :sm="12" :lg="10" :span="6">
+                    <el-form-item
+                      label="客户等级:"
+                      prop="level"
+                      label-width="180px"
+                      class="postInfo-container-item"
+                    >
+                      <el-input style="width:360px" :value="postForm.customerLevel" readonly disabled/>
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+                <el-row>
+                  <el-col :xs="24" :sm="12" :lg="10" :span="6">
+                    <el-form-item
+                      label="客户部门:"
+                      prop="department"
+                      label-width="180px"
+                      class="postInfo-container-item"
+                    >
+                      <el-input style="width:360px" :value="postForm.customerDepartment" readonly disabled/>
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+                <el-row>
+                  <el-col :xs="24" :sm="12" :lg="10" :span="6">
+                    <el-form-item
+                      label="客户科室:"
+                      prop="section"
+                      label-width="180px"
+                      class="postInfo-container-item"
+                    >
+                      <el-input style="width:360px" :value="postForm.customerSection" readonly disabled/>
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+                <el-row>
+                  <el-col :xs="24" :sm="12" :lg="10" :span="6">
+                    <el-form-item
+                      label="客户职位:"
+                      prop="position"
+                      label-width="180px"
+                      class="postInfo-container-item"
+                    >
+                      <el-input style="width:360px" :value="postForm.customerPosition" readonly disabled/>
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+              </div>
+            </div>
+            <div>
               <div>
                 <div class="postInfo-container">
                   <el-row>
                     <el-col :xs="24" :sm="12" :lg="10" :span="6">
                       <el-form-item
-                        label="客户名字:"
-                        prop="customerId"
+                        label="拜访类型:"
+                        prop="visitType"
                         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"
-                          placeholder=""
-                          clearable
-                          filterable
-                          class="filter-item"
-                          style="width:360px"
-                          @change="getCustomerDetail"
-
-                        >
-                          <el-option
-                            v-for="item in customers"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="item.id"
-                          />
+                        <el-select clearable style="width:360px" v-model="postForm.visitType" placeholder="拜访类型">
+                          <el-option key="0" label="初访" value="初访"/>
+                          <el-option key="1" label="回访" value="回访"/>
                         </el-select>
                       </el-form-item>
                     </el-col>
                   </el-row>
+                </div>
+              </div>
+              <div>
+                <div class="postInfo-container">
                   <el-row>
                     <el-col :xs="24" :sm="12" :lg="10" :span="6">
                       <el-form-item
-                        label="客户等级:"
-                        prop="level"
-                        label-width="180px"
-                        class="postInfo-container-item"
-                      >
-                        <el-input style="width:360px" :value="postForm.customerLevel" readonly disabled/>
-                      </el-form-item>
-                    </el-col>
-                  </el-row>
-                  <el-row>
-                    <el-col :xs="24" :sm="12" :lg="10" :span="6">
-                      <el-form-item
-                        label="客户部门:"
-                        prop="department"
+                        label="拜访日期:"
+                        prop="visitTime"
+                        :rules="{required: true, message: '请选择日期', trigger: 'blur'}"
                         label-width="180px"
                         class="postInfo-container-item"
                       >
-                        <el-input style="width:360px" :value="postForm.customerDepartment" readonly disabled/>
+                        <el-date-picker
+                          v-model="postForm.visitTime"
+                          type="date"
+                          value-format="yyyy-MM-dd"
+                          style="width:360px"
+                          placeholder="选择日期"
+                        />
                       </el-form-item>
                     </el-col>
                   </el-row>
+                </div>
+              </div>
+              <div>
+                <div class="postInfo-container">
                   <el-row>
                     <el-col :xs="24" :sm="12" :lg="10" :span="6">
                       <el-form-item
-                        label="客户科室:"
-                        prop="section"
+                        label="拜访地点:"
+                        prop="spot"
                         label-width="180px"
                         class="postInfo-container-item"
                       >
-                        <el-input style="width:360px" :value="postForm.customerSection" readonly disabled/>
+                        <el-input v-model="postForm.spot"  style="width:360px" class="filter-item"/>
                       </el-form-item>
                     </el-col>
                   </el-row>
+                </div>
+              </div>
+              <div>
+                <div class="postInfo-container">
                   <el-row>
                     <el-col :xs="24" :sm="12" :lg="10" :span="6">
                       <el-form-item
-                        label="客户职位:"
-                        prop="position"
+                        label="沟通内容:"
+                        prop="content"
                         label-width="180px"
                         class="postInfo-container-item"
                       >
-                        <el-input style="width:360px" :value="postForm.customerPosition" readonly disabled/>
+                        <el-input type="textarea" style="width:360px" v-model="postForm.content" class="filter-item" placeholder="200字符" :autosize="{ minRows: 8, maxRows: 8}"/>
                       </el-form-item>
                     </el-col>
                   </el-row>
                 </div>
               </div>
-              <div>
-                <div>
-                  <div class="postInfo-container">
-                    <el-row>
-                      <el-col :xs="24" :sm="12" :lg="10" :span="6">
-                        <el-form-item
-                          label="拜访类型:"
-                          prop="visitType"
-                          label-width="180px"
-                          class="postInfo-container-item"
-                          :rules="{required: true, message: '选择拜访类型', trigger: 'blur'}"
-                        >
-                          <el-select clearable style="width:360px" v-model="postForm.visitType" placeholder="拜访类型">
-                            <el-option key="0" label="初访" value="初访"/>
-                            <el-option key="1" label="回访" value="回访"/>
-                          </el-select>
-                        </el-form-item>
-                      </el-col>
-                    </el-row>
-                  </div>
-                </div>
-                <div>
-                  <div class="postInfo-container">
-                    <el-row>
-                      <el-col :xs="24" :sm="12" :lg="10" :span="6">
-                        <el-form-item
-                          label="拜访日期:"
-                          prop="visitTime"
-                          :rules="{required: true, message: '请选择日期', trigger: 'blur'}"
-                          label-width="180px"
-                          class="postInfo-container-item"
-                        >
-                          <el-date-picker
-                            v-model="postForm.visitTime"
-                            type="date"
-                            value-format="yyyy-MM-dd"
-                            style="width:360px"
-                            placeholder="选择日期"
-                          />
-                        </el-form-item>
-                      </el-col>
-                    </el-row>
-                  </div>
-                </div>
-                <div>
-                  <div class="postInfo-container">
-                    <el-row>
-                      <el-col :xs="24" :sm="12" :lg="10" :span="6">
-                        <el-form-item
-                          label="拜访地点:"
-                          prop="spot"
-                          label-width="180px"
-                          class="postInfo-container-item"
-                        >
-                          <el-input v-model="postForm.spot"  style="width:360px" class="filter-item"/>
-                        </el-form-item>
-                      </el-col>
-                    </el-row>
-                  </div>
-                </div>
-                <div>
-                  <div class="postInfo-container">
-                    <el-row>
-                      <el-col :xs="24" :sm="12" :lg="10" :span="6">
-                        <el-form-item
-                          label="沟通内容:"
-                          prop="content"
-                          label-width="180px"
-                          class="postInfo-container-item"
-                        >
-                          <el-input type="textarea" style="width:360px" v-model="postForm.content" class="filter-item" placeholder="200字符" :autosize="{ minRows: 8, maxRows: 8}"/>
-                        </el-form-item>
-                      </el-col>
-                    </el-row>
-                  </div>
-                </div>
-              </div>
-            </el-form>
-          </el-tab-pane>
-        </el-tabs>
-      </div>
-    </y-detail-page-layout>
+            </div>
+          </el-form>
+          </y-detail-page-layout>
+        </el-tab-pane>
+        <el-tab-pane :lazy="paneLazy" name="replyList">
+          <span slot="label">
+            回复记录<el-badge :is-dot="isDot" class="item"></el-badge>
+          </span>
+          <y-page-list-layout :page-list="pageData" :page-para="listQuery" :get-page-list="getList">
+            <template slot="left">
+              <el-button
+                class="filter-item"
+                style="margin-left: 10px;"
+                type="success"
+                round
+                :disabled="disable"
+                @click="dialogVisible = true"
+              >
+                回复
+              </el-button>
+            </template>
+            <parentTable
+              v-loading="listLoading"
+              :data="pageData.records"
+              slot="table"
+              style="width: 100%;"
+            >
+              <el-table-column label="内容" align="center" width="500">
+                <template slot-scope="{row}">
+                  <span>{{ row.content }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="回复人" align="center">
+                <template slot-scope="{row}">
+                  <span>{{ row.replier }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="接收人" align="center">
+                <template slot-scope="{row}">
+                  <span>{{ row.receiver }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="状态" align="center">
+                <template slot-scope="{row}">
+                  <el-tag type="error">{{row.state?'已读':'未读'}}</el-tag>
+                </template>
+              </el-table-column>
+              <el-table-column label="回复时间" align="center">
+                <template slot-scope="{row}">
+                  <span>{{ row.created}}</span>
+                </template>
+              </el-table-column>
+            </parentTable>
+          </y-page-list-layout>
+        </el-tab-pane>
+      </el-tabs>
+      <el-dialog
+        title="回复内容"
+        :visible.sync="dialogVisible"
+        width="30%"
+        custom-class="tag-class"
+      >
+        <el-input
+          type="textarea"
+          :rows="8"
+          placeholder="请输入内容"
+          v-model="replyForm.content"
+        />
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="dialogVisible = false">取 消</el-button>
+          <el-button type="primary" @click="replay">确 定</el-button>
+        </span>
+      </el-dialog>
+    </div>
   </div>
 </template>
 <script>
@@ -185,26 +253,134 @@
     },
     data() {
       return {
-        type: 'detail',
+        disable:null,
+        paneLazy:true,
+        isDot:null,
+        replyForm: {
+          id:null,
+          content:null,
+          bizType:'MARKET_VISIT_REPLY',
+          bizTableId:this.$route.query.id,
+          parentId:null,
+          replierId:null,
+          receiverId:null
+        },
+        dialogVisible: false,
+        activeName: 'first',
+        tableKey: 0,
+        pageData: {},
+        total: 20,
+        listLoading: true,
+        listQuery: {
+          page: 1,
+          size: 10,
+          descs: 'id',
+        },
+        listQueryKey: 'keyword',
         postForm: {
           customerId:null,
           customerDepartment:null,
           customerSection:null,
           customerPosition:null,
-          customerLevel:null
+          customerLevel:null,
+          customerManagerId:null,
+          userId:null
         },
         visitId : this.$route.query.id,
-        activeName: 'first',
         vLoading: false,
-        listQuery:{},
         customers:[],
+        lastReplier:null,
+        lastReceiver:null,
       }
     },
     created() {
       this.getCustomer();
       this.getDetail();
+      this.getNotRead();
+    },
+    watch:{
+      activeName: {
+        handler(newValue){
+          if (newValue === 'replyList'){
+            this.disable = this.$route.query.id===null?true:false;
+            this.getList();
+            this.isDot=false;
+          }
+        }
+      }
     },
     methods: {
+      getNotRead(){
+        this.replyForm.receiverId = this.$store.getters.userInfo.id;
+        this.replyForm.bizType = 'MARKET_VISIT_REPLY';
+        this.replyForm.bizTableId = this.$route.query.id;
+        this.$api.businessReply.notRead(this.replyForm).then(res => {
+          if (res.code === 200){
+            this.isDot = res.data !== 0;
+          }
+        });
+      },
+      replay(){
+        if (this.lastReplier!=null && this.lastReceiver!=null){
+          this.replyForm.receiverId = this.lastReplier;
+          this.replyForm.replierId = this.$store.getters.userInfo.id;
+        }
+        if (this.lastReplier === this.$store.getters.userInfo.id){
+          this.$notify({
+            title: '错误',
+            message: '不能回复给自己',
+            type: 'error',
+            duration: 2000
+          });
+          this.dialogVisible = false;
+          return;
+        }
+        if (this.postForm.userId ===this.$store.getters.userInfo.id && this.lastReceiver===null){
+          this.$notify({
+            title: '错误',
+            message: '不能回复给自己',
+            type: 'error',
+            duration: 2000
+          });
+          this.dialogVisible = false;
+          return;
+        }
+        this.replyForm.replierId = this.$store.getters.userInfo.id;
+        if (this.lastReceiver===null){
+          this.replyForm.receiverId = this.postForm.userId;
+        }
+        this.$api.businessReply.add(Object.assign({}, this.replyForm, {
+        })).then(res => {
+          if (res.code === 200) {
+            this.$notify({
+              title: '成功',
+              message: '回复成功',
+              type: 'success',
+              duration: 2000
+            });
+            this.dialogVisible = false;
+            this.getList();
+            this.vLoading = false
+          }
+        }).catch(() => {
+          this.vLoading = false
+        })
+      },
+      getList() {
+        const that = this;
+        this.listLoading = true;
+        this.$api.businessReply.list(Object.assign({bizType:'MARKET_VISIT_REPLY', bizTableId:this.visitId}, that.listQuery)).then((res) => {
+          that.pageData = res.data;
+          this.lastReplier = res.data.records[0].replierId;
+          this.lastReceiver = res.data.records[0].receiverId;
+          setTimeout(() => {
+            that.listLoading = false
+          }, 200);
+        })
+          .catch(() => {
+            that.listLoading = false
+          })
+      },
       getCustomerDetail(){
         this.$api.customer.detail(this.postForm.customerId).then(res =>{
           this.postForm.customerDepartment = res.data.department;

+ 10 - 9
src/views/market/visit/list.vue

@@ -13,6 +13,7 @@
           name
           size="mini"
           :page-jump="true"
+          :page-query="{id: null}"
           round
           style="float: left"
         />
@@ -113,15 +114,15 @@
               round
               size="mini"
             />
-            <el-button
-              class="filter-item"
-              style="margin-left: 10px;"
-              type="success"
-              round
-              @click="jumpReply(row.id)"
-            >
-              回复
-            </el-button>
+<!--            <el-button-->
+<!--              class="filter-item"-->
+<!--              style="margin-left: 10px;"-->
+<!--              type="success"-->
+<!--              round-->
+<!--              @click="jumpReply(row.id)"-->
+<!--            >-->
+<!--              回复-->
+<!--            </el-button>-->
             <PermissionButton
               menu-code="_views_market_visit_remove"
               class-name="filter-item"