Quellcode durchsuchen

feature:新建联系人电话微信必填其一,跟进增加新必填字段,跟进详情增加填写评论入口,督办页面优化

liuzl vor 2 Jahren
Ursprung
Commit
b8adce5015

+ 21 - 0
src/components/postComments/index.js

@@ -0,0 +1,21 @@
+import Vue from 'vue'
+import postComments from './index.vue'
+let postCommentsConstructor = Vue.extend(postComments)
+let PostComment = function (options) {
+  return new Promise((res, rej) => {
+    //promise封装,ok执行resolve,no执行rejectlet
+    let confirmDom = new postCommentsConstructor({
+      el: document.createElement('div'),
+      data: options,
+    })
+    document.body.appendChild(confirmDom.$el) //new一个对象,然后插入body里面
+    confirmDom.handleSub = function () {
+      res()
+    }
+    confirmDom.handleClose = function () {
+      confirmDom.visible = false
+      rej()
+    }
+  })
+}
+export default PostComment

+ 79 - 0
src/components/postComments/index.vue

@@ -0,0 +1,79 @@
+<!--
+ * @Author: wanglj 471442253@qq.com
+ * @Date: 2022-12-29 18:00:08
+ * @LastEditors: liuzhenlin
+ * @LastEditTime: 2023-06-08 10:17:38
+ * @Description: file content
+ * @FilePath: \订单全流程管理系统\src\views\base\components\PostComments.vue
+-->
+<template>
+  <el-dialog title="发表评论" :visible.sync="visible">
+    <el-form ref="editForm" :model="editForm" :rules="editRules">
+      <el-form-item label="评论" prop="content">
+        <el-input
+          v-model="editForm.content"
+          maxlength="500"
+          placeholder="请输入评论内容"
+          resize="none"
+          :rows="5"
+          show-word-limit
+          type="textarea" />
+      </el-form-item>
+    </el-form>
+    <span slot="footer">
+      <el-button :loading="loading" type="primary" @click="postContent">提交</el-button>
+      <el-button @click="handleClose">关闭</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+  import api from '@/api/customer/follow'
+  import to from 'await-to-js'
+  export default {
+    data() {
+      return {
+        loading: false,
+        visible: false,
+        editForm: {
+          content: '',
+        },
+        form: {},
+        editRules: {
+          content: [{ required: true, trigger: 'blur', message: '请输入评论内容' }],
+        },
+      }
+    },
+    created() {
+      console.log(this.visible)
+      console.log(this.editForm)
+      console.log(this.editRules)
+      console.log(this.form)
+    },
+    methods: {
+      async postContent() {
+        this.$refs['editForm'].validate(async (valid) => {
+          if (valid) {
+            this.loading = true
+            let params = {
+              followId: '' + this.form.id,
+              content: this.editForm.content,
+            }
+            const [err, res] = await to(api.addComment({ ...params }))
+            this.loading = false
+            if (err) return
+            if (res.code == 200) {
+              this.$baseMessage('发表成功', 'success', 'vab-hey-message-success')
+              this.visible = false
+              this.handleSub()
+            }
+          }
+        })
+      },
+      handleSub() {},
+      handleClose() {},
+    },
+  }
+</script>
+
+<style></style>

+ 203 - 0
src/components/select/SelectDistributorContact.vue

@@ -0,0 +1,203 @@
+<template>
+  <el-dialog append-to-body :title="title" :visible.sync="innerVisible" @close="close">
+    <el-row>
+      <el-col :span="24">
+        <el-input
+          v-model="queryForm.cuctName"
+          clearable
+          placeholder="联系人"
+          style="width: 30%; margin-right: 10px"
+          suffix-icon="el-icon-search"
+          @keyup.enter.native="fetchData" />
+        <el-button icon="el-icon-search" type="primary" @click="fetchData">查询</el-button>
+
+        <!--        <span>显示:</span>-->
+        <!--        <el-radio-group v-model="queryForm.type">-->
+        <!--          <el-radio-button label="全部客户" />-->
+        <!--          <el-radio-button label="我负责的客户" />-->
+        <!--        </el-radio-group>-->
+        <table-tool
+          :columns="columns"
+          :show-columns.sync="showColumns"
+          style="float: right"
+          table-type="selectCustomerContactTable" />
+      </el-col>
+    </el-row>
+    <el-table ref="contactTable" v-loading="listLoading" :data="list" @selection-change="setSelectRows">
+      <el-table-column align="center" type="selection" />
+      <el-table-column
+        v-for="(item, index) in showColumns"
+        :key="index + Math.random()"
+        align="center"
+        :label="item.label"
+        :prop="item.prop"
+        show-overflow-tooltip
+        :sortable="item.sortable"
+        :width="item.width">
+        <template #default="{ row }">
+          <span v-if="item.prop === 'isDecision'">
+            {{ selectDictLabel(yesNoOptions, row.isDecision) }}
+          </span>
+          <span v-else-if="item.prop === 'cuctGender'">
+            {{ selectDictLabel(sexOptions, row.cuctGender) }}
+          </span>
+          <span v-else>{{ row[item.prop] }}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      background
+      :current-page="queryForm.pageNum"
+      :layout="layout"
+      :page-size="queryForm.pageSize"
+      :total="total"
+      @current-change="handleCurrentChange"
+      @size-change="handleSizeChange" />
+    <span slot="footer">
+      <el-button size="mini" type="primary" @click="save">保存</el-button>
+      <el-button size="mini" @click="innerVisible = false">取消</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+  import distrApi from '@/api/base/distr'
+  import TableTool from '@/components/table/TableTool'
+
+  export default {
+    name: 'SelectContact',
+    components: {
+      TableTool,
+    },
+    props: {
+      title: {
+        type: String,
+        default: '选择经销商/代理商联系人',
+      },
+      add: Boolean,
+      multiple: Boolean,
+      // 示例{ custId: id, custName: custName}
+      defaultCustomer: {
+        type: Object,
+        default() {
+          return {}
+        },
+      },
+      queryParams: {
+        type: Object,
+        default() {
+          return {}
+        },
+      },
+    },
+    data() {
+      return {
+        innerVisible: false,
+        queryForm: {
+          pageNum: 1,
+          pageSize: 10,
+        },
+        showColumns: [],
+        columns: [
+          {
+            label: '联系人',
+            width: '160px',
+            prop: 'name',
+            sortable: false,
+          },
+          {
+            label: '手机号码',
+            width: '160px',
+            prop: 'phone',
+            sortable: false,
+          },
+          {
+            label: '职位',
+            width: '160px',
+            prop: 'post',
+            sortable: false,
+          },
+          {
+            label: '微信',
+            width: '160px',
+            prop: 'wechat',
+            sortable: false,
+          },
+          {
+            label: '电子邮箱',
+            width: '160px',
+            prop: 'mail',
+            sortable: false,
+          },
+          {
+            label: '负责区域/业务线',
+            width: '160',
+            prop: 'territory',
+            sortable: false,
+          },
+        ],
+        list: [],
+        listLoading: true,
+        layout: 'total, sizes, prev, pager, next, jumper',
+        total: 0,
+        selectRows: [],
+        sexOptions: [],
+        yesNoOptions: [],
+      }
+    },
+    mounted() {},
+    methods: {
+      open() {
+        this.innerVisible = true
+        this.fetchData()
+      },
+      close() {
+        this.selectRows = []
+        this.queryForm = this.$options.data().queryForm
+        this.$refs.contactTable.clearSelection()
+      },
+      save() {
+        this.innerVisible = false
+        console.log(this.selectRows)
+        this.$emit('save', this.selectRows)
+      },
+
+      async fetchData() {
+        this.listLoading = true
+        let query = Object.assign(this.queryForm, this.queryParams)
+        const {
+          data: { list, total },
+        } = await distrApi.getContactList(query)
+        this.list = list
+        this.total = total
+        this.listLoading = false
+      },
+      setSelectRows(val) {
+        if (!this.multiple && val.length === this.list.length && val.length > 1) {
+          // 返回单条数据情况下-控制全选情况下单选第一条数据
+          this.$refs.contactTable.clearSelection()
+          if (this.selectRows.length === 1) {
+            return
+          }
+          this.$refs.contactTable.toggleRowSelection(val.shift(), true)
+        } else if (!this.multiple && val.length > 1) {
+          // 返回单条数据情况下-控制选择当前点击数据
+          this.$refs.contactTable.clearSelection()
+          this.$refs.contactTable.toggleRowSelection(val.pop(), true)
+        } else {
+          this.selectRows = val
+        }
+      },
+      handleSizeChange(val) {
+        this.queryForm.pageSize = val
+        this.fetchData()
+      },
+      handleCurrentChange(val) {
+        this.queryForm.pageNum = val
+        this.fetchData()
+      },
+    },
+  }
+</script>
+
+<style scoped></style>

+ 6 - 3
src/main.js

@@ -1,10 +1,10 @@
 /*
  * @Author: wanglj 471442253@qq.com
  * @Date: 2023-01-04 16:23:23
- * @LastEditors: wanglj
- * @LastEditTime: 2023-01-05 10:36:59
+ * @LastEditors: liuzhenlin
+ * @LastEditTime: 2023-06-08 10:33:27
  * @Description: file content
- * @FilePath: \opms_frontend\src\main.js
+ * @FilePath: \订单全流程管理系统\src\main.js
  */
 import Vue from 'vue'
 import App from './App'
@@ -16,6 +16,9 @@ import '@/vab'
 import { parseTime, translateDataToTree, resetForm, formatPrice, selectDictLabel } from '@/utils'
 import dictApi from '@/api/system/dict'
 
+import PostComment from '@/components/postComments/index.js'
+
+Vue.prototype.$PostComment = PostComment
 Vue.prototype.parseTime = parseTime
 Vue.prototype.translateDataToTree = translateDataToTree
 Vue.prototype.getDicts = dictApi.getDictDataByType

+ 32 - 2
src/views/base/agent/detail.vue

@@ -6,6 +6,7 @@
           <p>代理商</p>
           <h3>
             {{ detail.distName }}
+            <el-button @click="handleFollow">添加跟进</el-button>
           </h3>
         </div>
         <header>
@@ -116,7 +117,7 @@
             <business-target v-if="activeName == 'business'" />
           </el-tab-pane>
           <el-tab-pane label="跟进记录" name="follow">
-            <follow v-if="activeName == 'follow'" target-type="50" />
+            <follow v-if="activeName == 'follow'" ref="followEl" target-type="50" />
           </el-tab-pane>
           <el-tab-pane label="联系人" name="contacts">
             <contacts v-if="activeName == 'contacts'" @initRecords="getRecord" />
@@ -141,6 +142,8 @@
         <details-records :dynamics-list="dynamicsList" />
       </div>
     </div>
+    <!-- 添加跟进记录 -->
+    <follow-add ref="follow-add" @fetch-data="getFollowData" />
   </div>
 </template>
 
@@ -155,9 +158,20 @@
   import DetailsRecords from './components/DetailsRecords'
   import BusinessTarget from './components/BusinessTarget'
   import Follow from '../components/Follow'
+  import FollowAdd from '@/views/proj/business/components/FollowAdd'
+
   export default {
     name: 'DistributorDetail',
-    components: { DetailsRecords, Contacts, ProjectRecords, ContractRecords, HistoryProxy, BusinessTarget, Follow },
+    components: {
+      DetailsRecords,
+      Contacts,
+      ProjectRecords,
+      ContractRecords,
+      HistoryProxy,
+      BusinessTarget,
+      Follow,
+      FollowAdd,
+    },
     data() {
       return {
         id: 0,
@@ -195,6 +209,22 @@
       //this.getDynamics()
     },
     methods: {
+      getFollowData() {
+        if (this.activeName == 'follow') {
+          this.$refs.followEl.getFollowList()
+        }
+      },
+      // 添加跟进记录
+      handleFollow() {
+        this.followup = {
+          targetId: this.detail.id,
+          targetType: '50',
+          targetName: this.detail.distName,
+        }
+        let tilte = '经销商联系人'
+        console.log(this.followup)
+        this.$refs['follow-add'].showEdit(this.followup, tilte)
+      },
       setCustomerType(type) {
         if (this.customerOptions.length == 0) return
         if (!type) return

+ 8 - 0
src/views/base/components/EditContact.vue

@@ -126,6 +126,10 @@
       async contactSave() {
         this.$refs.contactForm.validate(async (valid) => {
           if (valid) {
+            if (!this.contactForm.wechat && !this.contactForm.telephone) {
+              this.$message.warning('电话和微信二者必须填写其一。')
+              return
+            }
             let params = { ...this.contactForm, distId: this.distId }
             console.log(params)
             const [err, res] = await to(distrApi.addContact(params))
@@ -142,6 +146,10 @@
       async contactEdit() {
         this.$refs.contactForm.validate(async (valid) => {
           if (valid) {
+            if (!this.contactForm.wechat && !this.contactForm.telephone) {
+              this.$message.warning('电话和微信二者必须填写其一。')
+              return
+            }
             let params = { ...this.contactForm, distId: this.distId }
             console.log(params)
             const [err, res] = await to(distrApi.updateContact(params))

+ 9 - 0
src/views/base/components/Follow.vue

@@ -29,6 +29,7 @@
                     <span>{{ item.custName }}</span>
                   </p> -->
                   <div>
+                    <el-button icon="el-icon-edit" size="mini" @click="postComments(item)">发表评论</el-button>
                     <el-button size="mini" @click="showDetail(item)">
                       <vab-icon icon="arrow-right-circle-fill" />
                       详情
@@ -102,6 +103,14 @@
       showDetail(row) {
         this.$refs.followDetail.init({ ...row })
       },
+      // 发表评论
+      postComments(row) {
+        this.$PostComment({ form: row, visible: true })
+          .then(() => {
+            this.getFollowList()
+          })
+          .catch(() => {})
+      },
       // 展开评论
       showComment(row) {
         if (!row.comments.length) return this.$message.warning('暂无评论')

+ 10 - 1
src/views/base/components/FollowDetail.vue

@@ -24,9 +24,18 @@
       <el-descriptions-item label="跟进时间">
         {{ form.followDate }}
       </el-descriptions-item>
-      <el-descriptions-item label="跟进描述">
+      <el-descriptions-item label="本次跟进内容">
         {{ form.followContent }}
       </el-descriptions-item>
+      <el-descriptions-item label="达成效果">
+        {{ form.effect }}
+      </el-descriptions-item>
+      <el-descriptions-item label="问题或困难">
+        {{ form.issue }}
+      </el-descriptions-item>
+      <el-descriptions-item label="下一步跟进计划和目标">
+        {{ form.furtherPlan }}
+      </el-descriptions-item>
       <el-descriptions-item label="客户名称">
         {{ form.custName }}
       </el-descriptions-item>

+ 8 - 0
src/views/base/distributor/components/EditContact.vue

@@ -126,6 +126,10 @@
       async contactSave() {
         this.$refs.contactForm.validate(async (valid) => {
           if (valid) {
+            if (!this.contactForm.wechat && !this.contactForm.telephone) {
+              this.$message.warning('电话和微信二者必须填写其一。')
+              return
+            }
             let params = { ...this.contactForm, distId: this.distId }
             console.log(params)
             const [err, res] = await to(distrApi.addContact(params))
@@ -142,6 +146,10 @@
       async contactEdit() {
         this.$refs.contactForm.validate(async (valid) => {
           if (valid) {
+            if (!this.contactForm.wechat && !this.contactForm.telephone) {
+              this.$message.warning('电话和微信二者必须填写其一。')
+              return
+            }
             let params = { ...this.contactForm, distId: this.distId }
             console.log(params)
             const [err, res] = await to(distrApi.updateContact(params))

+ 23 - 2
src/views/base/distributor/detail.vue

@@ -6,6 +6,7 @@
           <p>经销商</p>
           <h3>
             {{ detail.distName }}
+            <el-button @click="handleFollow">添加跟进</el-button>
           </h3>
         </div>
         <header>
@@ -87,7 +88,7 @@
             </el-descriptions>
           </el-tab-pane>
           <el-tab-pane label="跟进记录" name="follow">
-            <follow v-if="activeName == 'follow'" target-type="50" />
+            <follow v-if="activeName == 'follow'" ref="followEl" target-type="50" />
           </el-tab-pane>
           <el-tab-pane label="联系人" name="contacts">
             <contacts v-if="activeName == 'contacts'" @initRecords="getRecord" />
@@ -112,6 +113,8 @@
         <details-records :dynamics-list="dynamicsList" />
       </div>
     </div>
+    <!-- 添加跟进记录 -->
+    <follow-add ref="follow-add" @fetch-data="getFollowData" />
   </div>
 </template>
 
@@ -125,9 +128,11 @@
   import HistoryProxy from '../components/HistoryProxy'
   import DetailsRecords from './components/DetailsRecords'
   import Follow from '../components/Follow'
+  import FollowAdd from '@/views/proj/business/components/FollowAdd'
+
   export default {
     name: 'DistributorDetail',
-    components: { DetailsRecords, Contacts, ProjectRecords, ContractRecords, HistoryProxy, Follow },
+    components: { DetailsRecords, Contacts, ProjectRecords, ContractRecords, HistoryProxy, Follow, FollowAdd },
     data() {
       return {
         id: 0,
@@ -165,6 +170,22 @@
       //this.getDynamics()
     },
     methods: {
+      getFollowData() {
+        if (this.activeName == 'follow') {
+          this.$refs.followEl.getFollowList()
+        }
+      },
+      // 添加跟进记录
+      handleFollow() {
+        this.followup = {
+          targetId: this.detail.id,
+          targetType: '50',
+          targetName: this.detail.distName,
+        }
+        let tilte = '经销商联系人'
+        console.log(this.followup)
+        this.$refs['follow-add'].showEdit(this.followup, tilte)
+      },
       setCustomerType(type) {
         if (this.customerOptions.length == 0) return
         if (!type) return

+ 8 - 0
src/views/customer/components/Contact.vue

@@ -148,6 +148,10 @@
       async contactSave() {
         this.$refs.contactForm.validate(async (valid) => {
           if (valid) {
+            if (!this.contactForm.wechat && !this.contactForm.telephone) {
+              this.$message.warning('电话和微信二者必须填写其一。')
+              return
+            }
             let params = { ...this.contactForm }
             const [err, res] = await to(api.createContact(params))
             if (err) return
@@ -161,6 +165,10 @@
       async contactEdit() {
         this.$refs.contactForm.validate(async (valid) => {
           if (valid) {
+            if (!this.contactForm.wechat && !this.contactForm.telephone) {
+              this.$message.warning('电话和微信二者必须填写其一。')
+              return
+            }
             let params = { ...this.contactForm }
             const [err, res] = await to(api.updateContact(params))
             if (err) return

+ 10 - 1
src/views/customer/components/FollowDetail.vue

@@ -24,9 +24,18 @@
       <el-descriptions-item label="跟进时间">
         {{ form.followDate }}
       </el-descriptions-item>
-      <el-descriptions-item label="跟进描述">
+      <el-descriptions-item label="本次跟进内容">
         {{ form.followContent }}
       </el-descriptions-item>
+      <el-descriptions-item label="达成效果">
+        {{ form.effect }}
+      </el-descriptions-item>
+      <el-descriptions-item label="问题或困难">
+        {{ form.issue }}
+      </el-descriptions-item>
+      <el-descriptions-item label="下一步跟进计划和目标">
+        {{ form.furtherPlan }}
+      </el-descriptions-item>
       <el-descriptions-item label="客户名称">
         {{ form.custName }}
       </el-descriptions-item>

+ 29 - 3
src/views/customer/detail.vue

@@ -1,10 +1,10 @@
 <!--
  * @Author: wanglj 471442253@qq.com
  * @Date: 2022-12-26 09:30:47
- * @LastEditors: niezch@dashoo.cn
- * @LastEditTime: 2023-04-11 19:04:39
+ * @LastEditors: liuzhenlin
+ * @LastEditTime: 2023-06-08 09:33:25
  * @Description: file content
- * @FilePath: \biobank_frontend02_ziyanc:\zhu\yangbenku\opms_frontend\src\views\customer\detail.vue
+ * @FilePath: \订单全流程管理系统\src\views\customer\detail.vue
 -->
 <template>
   <div class="detail">
@@ -15,6 +15,7 @@
           <h3>
             {{ detail.custName }}
             <div>
+              <el-button @click="handleFollow">添加跟进</el-button>
               <span v-show="detail.salesId > 0">
                 <el-button v-permissions="['cust:list:shift']" @click="handleShift">转移客户</el-button>
                 <el-button v-permissions="['cust:list:open']" @click="handleToOpen">移入公海</el-button>
@@ -143,6 +144,7 @@
                             <span>{{ item.custName }}</span>
                           </p>
                           <div>
+                            <el-button icon="el-icon-edit" size="mini" @click="postComments(item)">发表评论</el-button>
                             <el-button size="mini" @click="showDetail(item)">
                               <vab-icon icon="arrow-right-circle-fill" />
                               详情
@@ -406,6 +408,8 @@
     <Pick ref="pick" />
     <Bid ref="bid" @bidSave="bidSave" />
     <InvoiceHeader ref="invoiceHeader" @save="invoiceHeaderSave" />
+    <!-- 添加跟进记录 -->
+    <follow-add ref="follow-add" @fetch-data="handleClick({ name: 'follow' })" />
   </div>
 </template>
 
@@ -429,10 +433,12 @@
   import Pick from './components/Pick'
   import Bid from './components/Bid'
   import InvoiceHeader from './components/InvoiceHeader'
+  import FollowAdd from '@/views/proj/business/components/FollowAdd'
 
   export default {
     name: 'CustomerDetail',
     components: {
+      FollowAdd,
       Edit,
       Contact,
       Allocate,
@@ -599,6 +605,18 @@
         this.$refs.bid.form.custId = this.detail.id
         this.$refs.bid.init()
       },
+      // 添加跟进记录
+      handleFollow() {
+        this.followup = {
+          targetId: this.detail.id,
+          targetType: '10',
+          targetName: this.detail.custName,
+          custId: this.detail.id,
+          custName: this.detail.custName,
+        }
+        console.log(this.followup)
+        this.$refs['follow-add'].showEdit(this.followup)
+      },
       addInvoiceHeader() {
         this.$refs.invoiceHeader.form.custId = this.detail.id
         this.$refs.invoiceHeader.init()
@@ -777,6 +795,14 @@
       showDetail(row) {
         this.$refs.followDetail.init({ ...row })
       },
+      // 发表评论
+      postComments(row) {
+        this.$PostComment({ form: row, visible: true })
+          .then(() => {
+            this.handleClick({ name: 'follow' })
+          })
+          .catch(() => {})
+      },
       // 展开评论
       showComment(row) {
         if (!row.comments.length) return this.$message.warning('暂无评论')

+ 26 - 0
src/views/customer/inviteTenders/details.vue

@@ -14,6 +14,7 @@
           <p>招标</p>
           <h3>
             {{ detail.title }}
+            <el-button @click="handleFollow">添加跟进</el-button>
           </h3>
         </div>
         <header>
@@ -72,6 +73,7 @@
                             <span>{{ item.custName }}</span>
                           </p>
                           <div>
+                            <el-button icon="el-icon-edit" size="mini" @click="postComments(item)">发表评论</el-button>
                             <el-button size="mini" @click="showDetail(item)">
                               <vab-icon icon="arrow-right-circle-fill" />
                               详情
@@ -104,6 +106,8 @@
     </div>
     <!-- 跟进详情 -->
     <FollowDetail ref="followDetail" />
+    <!-- 添加跟进记录 -->
+    <follow-add ref="follow-add" @fetch-data="handleClick({ name: 'follow' })" />
   </div>
 </template>
 
@@ -112,11 +116,13 @@
   import to from 'await-to-js'
   import FollowDetail from '../components/FollowDetail.vue'
   import bidApi from '@/api/customer/bid'
+  import FollowAdd from '@/views/proj/business/components/FollowAdd'
 
   export default {
     name: 'CustomerDetail',
     components: {
       FollowDetail,
+      FollowAdd,
     },
     data() {
       return {
@@ -141,6 +147,26 @@
       this.getOptions()
     },
     methods: {
+      // 添加跟进记录
+      handleFollow() {
+        this.followup = {
+          targetId: this.detail.id,
+          targetType: '60',
+          targetName: this.detail.cuctName,
+          custId: this.detail.custId,
+          custName: this.detail.cuctName,
+        }
+        console.log(this.followup)
+        this.$refs['follow-add'].showEdit(this.followup)
+      },
+      // 发表评论
+      postComments(row) {
+        this.$PostComment({ form: row, visible: true })
+          .then(() => {
+            this.handleClick({ name: 'follow' })
+          })
+          .catch(() => {})
+      },
       getOptions() {
         this.getDicts('bid_info_type').then((response) => {
           this.bidInfoTypeOptions = {}

+ 99 - 84
src/views/plat/task/detail.vue

@@ -65,90 +65,103 @@
               {{ selectDictLabel(sourceOptions, theTask.source) }}
             </el-descriptions-item>
           </el-descriptions>
-          <el-descriptions :colon="false" :column="1" direction="vertical">
-            <el-descriptions-item content-class-name="my-content" label="督办内容" label-class-name="my-label">
-              <el-tooltip class="item" :content="theTask.taskDesc" effect="dark" placement="top">
-                <span>{{ theTask.taskDesc }}</span>
-              </el-tooltip>
-            </el-descriptions-item>
-          </el-descriptions>
         </header>
-        <el-form label-width="80px" :model="form" style="margin-top: 10px">
-          <el-form-item label="进展情况">
-            <el-button v-show="theTask.step === 20 && type == '1'" circle icon="el-icon-plus" @click="addProgress" />
-          </el-form-item>
-          <el-form-item label-width="0">
-            <el-table border :data="progressList" max-height="300px">
-              <el-table-column align="center" label="进展说明" prop="progDesc">
-                <template #default="{ row }">
-                  <span v-if="row.id">{{ row.progDesc }}</span>
-                  <el-input v-else v-model="row.progDesc" placeholder="进展说明" style="width: 100%" />
-                </template>
-              </el-table-column>
-              <el-table-column align="center" label="时间" prop="progDate">
-                <template #default="{ row }">
-                  <span v-if="row.id">{{ parseTime(row.progDate) }}</span>
-                  <el-date-picker
-                    v-else
-                    v-model="row.progDate"
-                    style="width: 100%"
-                    value-format="yyyy-MM-dd HH:mm:ss" />
-                </template>
-              </el-table-column>
-              <el-table-column align="center" label="附件" prop="progFile">
-                <template #default="{ row }">
-                  <el-upload
-                    action="#"
-                    :disabled="type !== '1' || theTask.step !== 20"
-                    :http-request="uploadrequest"
-                    :show-file-list="false">
-                    <el-button
-                      :disabled="type !== '1' || theTask.step !== 20"
-                      size="mini"
-                      style="margin-left: 10px"
-                      slot="trigger"
-                      type="primary"
-                      @click="showUploadFileDialog(row)">
-                      上传/更新
-                    </el-button>
-                    <el-button
-                      v-show="row.progFile"
-                      size="mini"
-                      style="margin-left: 10px"
-                      @click="showFile(row.progFile)">
-                      查看附件
-                    </el-button>
-                  </el-upload>
-                </template>
-              </el-table-column>
-              <el-table-column align="center" label="备注" prop="remark">
-                <template #default="{ row }">
-                  <span v-if="row.id">{{ row.remark }}</span>
-                  <el-input v-else v-model="row.remark" placeholder="备注" style="width: 100%" />
-                </template>
-              </el-table-column>
-              <el-table-column v-if="theTask.step < 30 && type == 1" align="center" label="操作">
-                <template #default="{ row }">
-                  <el-button v-permissions="['plat:task:enclosure:delete']" type="text" @click="handleDel(row.$index)">
-                    删除
-                  </el-button>
-                </template>
-              </el-table-column>
-            </el-table>
-          </el-form-item>
-          <el-form-item v-if="theTask.step === 30 || theTask.step === 40" label="任务状态">
-            <el-radio v-model="form.isComplete" label="10">完成</el-radio>
-            <el-radio v-model="form.isComplete" label="20">继续进行</el-radio>
-          </el-form-item>
-          <el-form-item v-if="theTask.approDate || theTask.step === 30" label="审批意见">
-            <el-input v-if="theTask.step === 30" v-model="form.approDesc" placeholder="审批意见" />
-            <span v-else>{{ theTask.approDesc }}</span>
-          </el-form-item>
-          <el-form-item v-if="theTask.approDate || theTask.step === 40" label="督办评价">
-            <el-input v-if="theTask.step === 40" v-model="form.evaluateDesc" placeholder="督办评价" />
-            <span v-else>{{ theTask.evaluateDesc }}</span>
-          </el-form-item>
-        </el-form>
+        <!--  -->
+        <el-tabs v-model="activeName">
+          <el-tab-pane label="进展情况" name="progress">
+            <el-form label-width="80px" :model="form" style="margin-top: 10px">
+              <el-form-item label="进展情况">
+                <el-button
+                  v-show="theTask.step === 20 && type == '1'"
+                  circle
+                  icon="el-icon-plus"
+                  @click="addProgress" />
+              </el-form-item>
+              <el-form-item label-width="0">
+                <el-table border :data="progressList" max-height="300px">
+                  <el-table-column align="center" label="进展说明" prop="progDesc">
+                    <template #default="{ row }">
+                      <span v-if="row.id">{{ row.progDesc }}</span>
+                      <el-input v-else v-model="row.progDesc" placeholder="进展说明" style="width: 100%" />
+                    </template>
+                  </el-table-column>
+                  <el-table-column align="center" label="时间" prop="progDate">
+                    <template #default="{ row }">
+                      <span v-if="row.id">{{ parseTime(row.progDate) }}</span>
+                      <el-date-picker
+                        v-else
+                        v-model="row.progDate"
+                        style="width: 100%"
+                        value-format="yyyy-MM-dd HH:mm:ss" />
+                    </template>
+                  </el-table-column>
+                  <el-table-column align="center" label="附件" prop="progFile">
+                    <template #default="{ row }">
+                      <el-upload
+                        action="#"
+                        :disabled="type !== '1' || theTask.step !== 20"
+                        :http-request="uploadrequest"
+                        :show-file-list="false">
+                        <el-button
+                          :disabled="type !== '1' || theTask.step !== 20"
+                          size="mini"
+                          style="margin-left: 10px"
+                          slot="trigger"
+                          type="primary"
+                          @click="showUploadFileDialog(row)">
+                          上传/更新
+                        </el-button>
+                        <el-button
+                          v-show="row.progFile"
+                          size="mini"
+                          style="margin-left: 10px"
+                          @click="showFile(row.progFile)">
+                          查看附件
+                        </el-button>
+                      </el-upload>
+                    </template>
+                  </el-table-column>
+                  <el-table-column align="center" label="备注" prop="remark">
+                    <template #default="{ row }">
+                      <span v-if="row.id">{{ row.remark }}</span>
+                      <el-input v-else v-model="row.remark" placeholder="备注" style="width: 100%" />
+                    </template>
+                  </el-table-column>
+                  <el-table-column v-if="theTask.step < 30 && type == 1" align="center" label="操作">
+                    <template #default="{ row }">
+                      <el-button
+                        v-permissions="['plat:task:enclosure:delete']"
+                        type="text"
+                        @click="handleDel(row.$index)">
+                        删除
+                      </el-button>
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </el-form-item>
+              <el-form-item v-if="theTask.step === 30 || theTask.step === 40" label="任务状态">
+                <el-radio v-model="form.isComplete" label="10">完成</el-radio>
+                <el-radio v-model="form.isComplete" label="20">继续进行</el-radio>
+              </el-form-item>
+              <el-form-item v-if="theTask.approDate || theTask.step === 30" label="审批意见">
+                <el-input v-if="theTask.step === 30" v-model="form.approDesc" placeholder="审批意见" />
+                <span v-else>{{ theTask.approDesc }}</span>
+              </el-form-item>
+              <el-form-item v-if="theTask.approDate || theTask.step === 40" label="督办评价">
+                <el-input v-if="theTask.step === 40" v-model="form.evaluateDesc" placeholder="督办评价" />
+                <span v-else>{{ theTask.evaluateDesc }}</span>
+              </el-form-item>
+            </el-form>
+          </el-tab-pane>
+          <el-tab-pane label="督办内容" name="taskDesc">
+            <el-row>
+              <el-col :span="24">
+                <span>{{ theTask.taskDesc }}</span>
+              </el-col>
+            </el-row>
+          </el-tab-pane>
+        </el-tabs>
+        <!--  -->
       </el-col>
       <el-col :span="8">
         <div class="buttons">
@@ -222,6 +235,7 @@
     name: 'TaskDetail',
     data() {
       return {
+        activeName: 'progress',
         detail: {},
         // 督办进展
         progressList: [],
@@ -272,7 +286,8 @@
         this.getProgressList()
         this.getLogList()
         this.teamNames = ''
-        if (this.theTask.ownerUserId != '') {
+        if (this.theTask.ownerUserId) {
+          console.log(this.theTask.ownerUserId)
           let ids = this.theTask.ownerUserId.split(',')
           for (let id of ids) {
             if (this.teamNames == '') {

+ 9 - 1
src/views/proj/business/components/BusinessAdd.vue

@@ -138,6 +138,14 @@
             <el-input v-model="form.intervention" />
           </el-form-item>
         </el-col>
+        <el-col :span="8">
+          <el-form-item label="项目类别" prop="nboType">
+            <el-select v-model="form.nboType" placeholder="请选择" style="width: 100%">
+              <el-option label="C级" value="30" />
+              <el-option label="储备" value="50" />
+            </el-select>
+          </el-form-item>
+        </el-col>
         <el-col :span="24">
           <el-form-item label="备注信息" prop="remark">
             <el-input v-model="form.remark" placeholder="请输入备注信息" rows="3" show-word-limit type="textarea" />
@@ -273,7 +281,7 @@
           intervention: undefined,
           remark: undefined,
           products: undefined,
-
+          nboType: '30',
           // 跟进
           followTime: new Date(),
           followUserId: undefined,

+ 9 - 0
src/views/proj/business/components/DetailsFollow.vue

@@ -28,6 +28,7 @@
                     <span>{{ item.custName }}</span>
                   </p>
                   <div>
+                    <el-button icon="el-icon-edit" size="mini" @click="postComments(item)">发表评论</el-button>
                     <el-button size="mini" @click="showDetail(item)">
                       <vab-icon icon="arrow-right-circle-fill" />
                       详情
@@ -95,6 +96,14 @@
       showDetail(row) {
         this.$refs.followDetail.init({ ...row })
       },
+      // 发表评论
+      postComments(row) {
+        this.$PostComment({ form: row, visible: true })
+          .then(() => {
+            this.fetchData()
+          })
+          .catch(() => {})
+      },
       // 展开评论
       showComment(row) {
         if (!row.comments.length) return this.$message.warning('暂无评论')

+ 63 - 30
src/views/proj/business/components/FollowAdd.vue

@@ -25,27 +25,31 @@
             </el-select>
           </el-form-item>
         </el-col>
-        <!--        <el-col :span="12">-->
-        <!--          <el-form-item label="跟进内容" prop="followContentType">-->
-        <!--            <el-select v-model="form.followContentType" placeholder="请选择跟进内容" style="width: 100%">-->
-        <!--              <el-option-->
-        <!--                v-for="item in followContentTypeOptions"-->
-        <!--                :key="item.key"-->
-        <!--                :label="item.value"-->
-        <!--                :value="item.key" />-->
-        <!--            </el-select>-->
-        <!--          </el-form-item>-->
-        <!--        </el-col>-->
-        <!--        <el-col v-if="followContentType !== '10'" :span="12">-->
-        <!--          <el-form-item label="总部支持人员" prop="supportName">-->
-        <!--            <el-input v-model="form.supportName" />-->
-        <!--          </el-form-item>-->
-        <!--        </el-col>-->
         <el-col :span="24">
-          <el-form-item label="跟进内容" prop="followContent">
+          <el-form-item label="本次跟进内容" prop="followContent">
             <el-input
               v-model="form.followContent"
-              placeholder="请输入拜访对象,协同拜访人员、具体沟通内容、进展或问题,下一步工作计划及完成时间"
+              placeholder="请输入本次跟进内容"
+              rows="5"
+              show-word-limit
+              type="textarea" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="达成效果" prop="effect">
+            <el-input v-model="form.effect" placeholder="请输入达成效果" rows="5" show-word-limit type="textarea" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="问题或困难" prop="issue">
+            <el-input v-model="form.issue" placeholder="请输入问题或困难" rows="5" show-word-limit type="textarea" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="下一步跟进计划和目标" prop="furtherPlan">
+            <el-input
+              v-model="form.furtherPlan"
+              placeholder="请输入下一步工作计划及完成时间"
               rows="5"
               show-word-limit
               type="textarea" />
@@ -100,12 +104,19 @@
       :default-customer="customerInfo"
       :query-params="queryContact"
       @save="selectContact" />
+
+    <select-distributor
+      ref="selectDistributor"
+      :query-params="queryContact"
+      :title="distrTitle"
+      @save="selectContact" />
   </el-dialog>
 </template>
 
 <script>
   import followApi from '@/api/customer/follow'
   import SelectContact from '@/components/select/SelectCustomerContact'
+  import SelectDistributor from '@/components/select/SelectDistributorContact'
   import asyncUploadFile from '@/utils/uploadajax'
   import axios from 'axios'
 
@@ -113,18 +124,23 @@
     name: 'FollowAdd',
     components: {
       SelectContact,
+      SelectDistributor,
     },
     data() {
       return {
+        distrTitle: '',
         form: {
           followType: '',
           followDate: '',
           followContentType: '',
+          effect: '',
           followContent: '',
+          issue: '',
+          furtherPlan: '',
           targetId: '',
           targetName: '',
           targetType: '',
-          custId: '',
+          custId: 0,
           custName: '',
           contactsId: '',
           contactsName: '',
@@ -138,7 +154,10 @@
           followType: [{ required: true, trigger: 'blur', message: '请输入跟进方式' }],
           followDate: [{ required: true, trigger: 'blur', message: '请输入跟进时间' }],
           followContentType: [{ required: true, trigger: 'blur', message: '请输入跟进内容类型' }],
-          followContent: [{ required: true, trigger: 'blur', message: '请输入跟进内容' }],
+          followContent: [{ required: true, trigger: 'blur', message: '请输入本次跟进内容' }],
+          effect: [{ required: true, trigger: 'blur', message: '请输入达成效果' }],
+          issue: [{ required: true, trigger: 'blur', message: '请输入问题或困难' }],
+          furtherPlan: [{ required: true, trigger: 'blur', message: '请输入下一步跟进计划和目标' }],
           targetId: [{ required: true, trigger: 'blur', message: '请选择跟进对象' }],
           targetName: [{ required: true, trigger: 'blur', message: '跟进对象不能为空' }],
           targetType: [{ required: true, trigger: 'blur', message: '跟进对象类型不能为空' }],
@@ -181,28 +200,42 @@
         )
       },
       handleSelectContact() {
-        if (!this.queryContact.custId) {
-          this.$message.warning('请先选择客户')
-          return
+        console.log(this.form.targetType)
+        if (this.form.targetType == '50') {
+          this.$refs.selectDistributor.open()
+        } else {
+          if (!this.queryContact.custId) {
+            this.$message.warning('请先选择客户')
+            return
+          }
+          this.$refs.selectContact.open()
         }
-        this.$refs.selectContact.open()
       },
       selectContact(val) {
         if (val && val.length > 0) {
+          if (this.form.targetType == '50') {
+            this.form.contactsName = val.map((item) => item.name).join()
+          } else {
+            this.form.contactsName = val.map((item) => item.cuctName).join()
+          }
           this.form.contactsId = val[0].id
-          this.form.contactsName = val.map((item) => item.cuctName).join()
         }
         console.log(this.form)
       },
-      showEdit(row) {
+      showEdit(row, title = null) {
         this.title = '添加跟进记录'
         this.form = Object.assign(this.form, row)
         console.log(this.form)
-        this.queryContact.custId = this.form.custId
-        this.customerInfo = {
-          custId: this.form.custId,
-          custName: this.form.custName,
+        if (this.form.targetType == '10' || this.form.targetType == '20' || this.form.targetType == '60') {
+          this.queryContact.custId = this.form.custId
+          this.customerInfo = {
+            custId: this.form.custId,
+            custName: this.form.custName,
+          }
+        } else if (this.form.targetType == '50') {
+          this.queryContact.distId = this.form.targetId
         }
+        this.distrTitle = title
         this.dialogFormVisible = true
       },
       close() {