| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117 |
- <!--
- * @Author: wanglj 471442253@qq.com
- * @Date: 2022-12-26 09:30:47
- * @LastEditors: niezch@dashoo.cn
- * @LastEditTime: 2023-04-11 16:44:55
- * @Description: file content
- * @FilePath: \opms_frontend\src\views\customer\detail.vue
- -->
- <template>
- <div class="detail">
- <div class="side-layout">
- <div class="info">
- <div class="title">
- <p>客户</p>
- <h3>
- {{ detail.custName }}
- <div>
- <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>
- <el-button v-permissions="['cust:list:project']" @click="handleBusiness">创建项目</el-button>
- </span>
- <span v-show="detail.salesId == 0">
- <el-button v-permissions="['cust:open:receive']" @click="handleReceive">领取客户</el-button>
- <el-button v-permissions="['cust:open:allocate']" @click="handleAllocate">分配客户</el-button>
- </span>
- </div>
- </h3>
- </div>
- <header>
- <el-descriptions :colon="false" :column="6" direction="vertical">
- <el-descriptions-item content-class-name="my-content" label="客户编码" label-class-name="my-label">
- {{ detail.custCode }}
- </el-descriptions-item>
- <el-descriptions-item content-class-name="my-content" label="助记名" label-class-name="my-label">
- {{ detail.abbrName }}
- </el-descriptions-item>
- <el-descriptions-item content-class-name="my-content" label="客户级别" label-class-name="my-label">
- {{ selectDictLabel(levelOptions, detail.custLevel) }}
- </el-descriptions-item>
- <el-descriptions-item content-class-name="my-content" label="客户类型" label-class-name="my-label">
- {{ selectDictLabel(industryOptions, detail.custIndustry) }}
- </el-descriptions-item>
- <!-- <el-descriptions-item content-class-name="my-content" label="客户状态" label-class-name="my-label">
- {{ detail.custStatus == 10 ? '正常' : '异常' }}
- </el-descriptions-item> -->
- <el-descriptions-item content-class-name="my-content" label="最后跟进时间" label-class-name="my-label">
- {{ parseTime(detail.followUpDate, '{y}-{m}-{d}') }}
- </el-descriptions-item>
- </el-descriptions>
- </header>
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="详细信息" name="detail">
- <el-descriptions
- border
- :column="2"
- :content-style="{ width: '25%', 'word-break': 'break-all' }"
- :label-style="{ width: '25%' }"
- size="medium">
- <el-descriptions-item label="客户级别">
- {{ selectDictLabel(levelOptions, detail.custLevel) }}
- </el-descriptions-item>
- <el-descriptions-item label="最后跟进时间">
- {{ detail.followUpDate }}
- </el-descriptions-item>
- <el-descriptions-item label="所在省">
- {{ detail.custProvince }}
- </el-descriptions-item>
- <el-descriptions-item label="所在市">
- {{ detail.custCity }}
- </el-descriptions-item>
- <el-descriptions-item label="所在区">
- {{ detail.custRegion }}
- </el-descriptions-item>
- <el-descriptions-item label="详细地址">
- {{ detail.custAddress }}
- </el-descriptions-item>
- <el-descriptions-item label="创建人">
- {{ detail.createdName }}
- </el-descriptions-item>
- <el-descriptions-item label="创建时间">
- {{ detail.createdTime }}
- </el-descriptions-item>
- <el-descriptions-item label="跟进次数">
- {{ abstract.followCount }}
- </el-descriptions-item>
- <el-descriptions-item label="未跟进时长">
- {{ abstract.notFollowDay }}
- </el-descriptions-item>
- <el-descriptions-item label="项目数量">
- {{ abstract.business }}
- </el-descriptions-item>
- <el-descriptions-item label="项目总额">
- {{ formatPrice(abstract.businessTotal) }}
- </el-descriptions-item>
- <el-descriptions-item label="成交次数">
- {{ abstract.dealCotal }}
- </el-descriptions-item>
- <el-descriptions-item label="成交总额">
- {{ formatPrice(abstract.dealTotal) }}
- </el-descriptions-item>
- <el-descriptions-item label="回款总额">
- {{ formatPrice(abstract.paymentTotal) }}
- </el-descriptions-item>
- <el-descriptions-item label="未回款总额">
- {{ formatPrice(abstract.notPaymentTotal) }}
- </el-descriptions-item>
- <el-descriptions-item label="开票总额" :span="24">
- {{ formatPrice(abstract.drawTotal) }}
- </el-descriptions-item>
- <el-descriptions-item label="备注" :span="24">
- {{ detail.remark }}
- </el-descriptions-item>
- </el-descriptions>
- </el-tab-pane>
- <el-tab-pane label="跟进记录" name="follow">
- <ul v-if="followList.length" class="follow">
- <li v-for="(date, index) in followList" :key="index">
- <div class="date">
- <h2>{{ date.followDay.split('-')[2] }}</h2>
- <h3>
- {{ date.followDay.split('-').splice(0, 2).join('.') }}
- </h3>
- </div>
- <ul class="content">
- <li v-for="(item, idx) in date.followupList" :key="idx">
- <!-- <el-avatar class="user-avatar"
- :src="avatar" />-->
- <div class="text-container">
- <vab-icon class="user-avatar" icon="account-circle-fill" />
- <div class="text">
- <p class="action">
- <span>{{ item.createdName }} 跟进({{ formatType(item.followType) }})</span>
- <span>
- <vab-icon icon="time-line" />
- {{ item.followDate }}
- </span>
- </p>
- <p>{{ item.followContent }}</p>
- <div class="footer">
- <p>
- 来自客户:
- <span>{{ item.custName }}</span>
- </p>
- <div>
- <el-button size="mini" @click="showDetail(item)">
- <vab-icon icon="arrow-right-circle-fill" />
- 详情
- </el-button>
- <el-button size="mini" @click="showComment(item)">评论({{ item.commentNumber }})</el-button>
- </div>
- </div>
- </div>
- </div>
- <transition name="height">
- <ul v-if="item.showComment" class="comments">
- <li v-for="comment in item.comments" :key="comment.id">
- <vab-icon class="user-avatar" icon="account-circle-fill" />
- <div class="text">
- <p>{{ comment.createdName }}</p>
- <p>{{ comment.content }}</p>
- <p>{{ comment.createdTime }}</p>
- </div>
- </li>
- </ul>
- </transition>
- </li>
- </ul>
- </li>
- </ul>
- <div v-else class="no-follow">暂无跟进记录</div>
- </el-tab-pane>
- <el-tab-pane label="联系人" name="contact">
- <vab-query-form>
- <vab-query-form-left-panel :span="12">
- <el-input
- v-model="cuctName"
- placeholder="请输入单据名称/编号"
- prefix-icon="el-icon-search"
- style="width: 50%"
- @blur="handleClick({ name: 'contact' })"
- @keyup.enter.native="handleClick({ name: 'contact' })" />
- </vab-query-form-left-panel>
- <vab-query-form-right-panel :span="12">
- <el-button v-permissions="['cust:detail:contact:add']" icon="el-icon-plus" @click="addContact">
- 新建联系人
- </el-button>
- </vab-query-form-right-panel>
- </vab-query-form>
- <el-table border :data="contactList" height="calc(100% - 42px)" @selection-change="setSelectRows">
- <el-table-column align="center" type="selection" />
- <el-table-column align="center" label="姓名" prop="cuctName" />
- <el-table-column align="center" label="岗位" prop="postion" />
- <el-table-column align="center" label="电话" prop="telephone" />
- <el-table-column align="center" label="微信" prop="wechat" />
- <el-table-column align="center" label="邮箱" prop="email" />
- <el-table-column align="center" label="是否决策人">
- <template slot-scope="scope">
- <el-switch v-model="scope.row.isDecision" active-value="10" disabled inactive-value="20" />
- </template>
- </el-table-column>
- <el-table-column align="center" label="操作">
- <template slot-scope="scope">
- <el-button v-permissions="['cust:deatil:contact:edit']" type="text" @click="contactEdit(scope.row)">
- 编辑
- </el-button>
- <el-button v-permissions="['cust:detail:contact:delete']" type="text" @click="contactDel(scope.row)">
- 删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="项目记录" name="item">
- <el-table border :data="items" height="calc(100% - 42px)">
- <el-table-column align="center" label="项目编号" prop="nboCode" width="120px" />
- <el-table-column align="center" label="项目名称" prop="nboName" show-overflow-tooltip width="200px" />
- <el-table-column align="center" label="审批状态" prop="approStatus" width="120px">
- <template slot-scope="scope">
- {{ getStatus(scope.row.approStatus) }}
- </template>
- </el-table-column>
- <!-- <el-table-column align="center" label="项目类别" prop="nboType" width="80px" />-->
- <!-- <el-table-column align="center" label="产品线" prop="productLine" width="120px" />-->
- <el-table-column
- align="center"
- label="经销商/代理商"
- prop="distributorName"
- show-overflow-tooltip
- width="200px" />
- <el-table-column align="center" label="项目预算" prop="nboBudget" width="120px" />
- <el-table-column align="center" label="项目备案时间" prop="filingTime" width="160px" />
- <!-- <el-table-column align="center" label="项目来源" prop="nboSource" width="160px" />-->
- <!-- <el-table-column align="center" label="销售模式" prop="salesModel" width="160px" />-->
- <el-table-column align="center" label="最后跟进时间" prop="finalFollowTime" width="160px" />
- <el-table-column align="center" label="下次跟进时间" prop="nextFollowTime " width="160px" />
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="合同记录" name="contract">
- <el-table border :data="contracts" height="calc(100% - 42px)">
- <el-table-column align="center" label="合同编号" prop="contractCode" width="140px" />
- <el-table-column
- align="center"
- label="合同名称"
- prop="contractName"
- show-overflow-tooltip
- width="240px" />
- <el-table-column align="center" label="项目名称" prop="nboName" show-overflow-tooltip width="240px" />
- <el-table-column align="center" label="审批状态" prop="approStatus" width="120px">
- <template slot-scope="scope">
- {{ getStatus(scope.row.approStatus) }}
- </template>
- </el-table-column>
- <el-table-column align="center" label="合同类型" prop="contractType" width="120px">
- <template slot-scope="scope">
- {{ selectDictLabel(contractTypeOptions, scope.row.contractType) }}
- </template>
- </el-table-column>
- <el-table-column align="center" label="合同金额" prop="contractAmount" width="120px" />
- <el-table-column align="center" label="负责人" prop="inchargeName" width="120px" />
- <el-table-column align="center" label="公司签约人" prop="signatoryName" width="140px" />
- <el-table-column align="center" label="经销商" prop="distributorName" width="320px" />
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="工单记录" name="worksheet">工单记录</el-tab-pane>
- <el-tab-pane label="归属记录" name="belong">
- <el-table border :data="belongs" height="calc(100% - 42px)">
- <el-table-column align="center" label="归属销售" prop="saleName" />
- <el-table-column align="center" label="原来归属" prop="origSaleName" />
- <el-table-column align="center" label="操作方式" prop="opnType">
- <template slot-scope="scope">
- <el-tag v-if="scope.row.opnType == 10">分配</el-tag>
- <el-tag v-else-if="scope.row.opnType == 20">转移</el-tag>
- <el-tag v-else-if="scope.row.opnType == 30">领取</el-tag>
- <el-tag v-else-if="scope.row.opnType == 40">合并</el-tag>
- </template>
- </el-table-column>
- <el-table-column align="center" label="操作人" prop="createdName" />
- <el-table-column align="center" label="操作时间" min-width="160px" prop="opnDatetime" />
- <el-table-column align="center" label="开始时间" min-width="160px" prop="startDate" />
- <el-table-column align="center" label="结束时间" min-width="160px" prop="endDate" />
- <el-table-column align="center" label="备注" prop="remark" />
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="招标记录" name="bid">
- <vab-query-form>
- <vab-query-form-left-panel :span="12">
- <el-input
- v-model="bidSearchText"
- placeholder="招标产品名称/招标信息标题/中标单位"
- prefix-icon="el-icon-search"
- style="width: 50%"
- @blur="handleClick({ name: 'bid' })"
- @keyup.enter.native="handleClick({ name: 'bid' })" />
- </vab-query-form-left-panel>
- <vab-query-form-right-panel :span="12">
- <el-button icon="el-icon-plus" @click="addBid">新建招标记录</el-button>
- </vab-query-form-right-panel>
- </vab-query-form>
- <el-table border :data="bidlist" height="calc(100% - 42px)">
- <el-table-column align="center" label="客户名称" prop="cuctName" width="120px" />
- <el-table-column align="center" label="招标产品名称" prop="productName" width="120px" />
- <el-table-column align="center" label="发布招标日期" prop="publishedTime" width="160px" />
- <el-table-column align="center" label="项目预算" prop="budget" width="120px" />
- <el-table-column align="center" label="招标信息标题" prop="title" width="120px" />
- <el-table-column align="center" label="信息分类" prop="infoType" width="120px">
- <template #default="{ row }">
- {{ bidInfoTypeOptions[row.infoType] }}
- </template>
- </el-table-column>
- <el-table-column align="center" label="中标单位" prop="bidder" width="120px" />
- <el-table-column align="center" label="创建招标日期" prop="createdOn" width="160px" />
- <el-table-column align="center" label="备注" prop="remark" width="120px" />
- <el-table-column align="center" fixed="right" label="操作" width="90px">
- <template slot-scope="scope">
- <el-button type="text" @click="bidEdit(scope.row)">编辑</el-button>
- <el-button type="text" @click="bidDel(scope.row)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="开票抬头" name="invoiceHeader">
- <vab-query-form>
- <vab-query-form-left-panel :span="12">
- <el-input
- v-model="invoiceHeaderSearchText"
- placeholder="客户名称/公司名称/纳税人识别号"
- prefix-icon="el-icon-search"
- style="width: 50%"
- @blur="handleClick({ name: 'invoiceHeader' })"
- @keyup.enter.native="handleClick({ name: 'invoiceHeader' })" />
- </vab-query-form-left-panel>
- <vab-query-form-right-panel :span="12">
- <el-button icon="el-icon-plus" @click="addInvoiceHeader">新建开票抬头</el-button>
- </vab-query-form-right-panel>
- </vab-query-form>
- <el-table border :data="invoiceHeaderList" height="calc(100% - 42px)">
- <el-table-column align="center" label="客户名称" prop="cuctName" width="220px" />
- <el-table-column align="center" label="公司名称" prop="companyName" width="220px" />
- <el-table-column align="center" label="纳税人识别号" prop="taxNo" width="120px" />
- <el-table-column align="center" label="地址" prop="address" width="160px" />
- <el-table-column align="center" label="开户行及账号" prop="bankNo" width="120px" />
- <el-table-column align="center" label="备注" prop="remark" width="120px" />
- <el-table-column align="center" fixed="right" label="操作" width="90px">
- <template slot-scope="scope">
- <el-button type="text" @click="invoiceHeaderEdit(scope.row)">编辑</el-button>
- <el-button type="text" @click="invoiceHeaderDel(scope.row)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- </el-tabs>
- </div>
- <div class="info-side">
- <div class="buttons">
- <el-button v-if="checkPermi('edit')" type="primary" @click="handleEdit">编辑</el-button>
- <el-button v-if="checkPermi('delete')" @click="handleDelete">删除</el-button>
- <el-button @click="$router.go(-1)">返回</el-button>
- </div>
- <ul class="records">
- <li v-for="(value, key) in records" :key="key">
- <div class="date">
- <h2>{{ key.split('-')[2] }}</h2>
- <h3>{{ key.split('-').splice(0, 2).join('.') }}</h3>
- </div>
- <ul class="content">
- <li v-for="(item, index) in records[key]" :key="index">
- <!-- <el-avatar class="user-avatar"
- :src="avatar" /> -->
- <vab-icon class="user-avatar" icon="account-circle-fill" />
- <div class="text">
- <p class="action">{{ item.opnPeople }} {{ item.opnType }}</p>
- <p>{{ item.opnDate }}</p>
- <p v-if="item.opnContent.custName">
- 客户名称:
- <span>{{ item.opnContent.custName }}</span>
- </p>
- <template v-else-if="item.opnContent.cuctName">
- <p>
- 联系人名称:
- <span>{{ item.opnContent.cuctName }}</span>
- </p>
- <p>职务:{{ item.opnContent.postion }}</p>
- <p>手机:{{ item.opnContent.telephone }}</p>
- </template>
- </div>
- </li>
- </ul>
- </li>
- </ul>
- </div>
- </div>
- <Contact ref="contact" @contactSave="contactSave" />
- <Edit ref="edit" @customerSave="customerSave" />
- <!-- 分配客户 -->
- <Allocate ref="allocate" @refresh="back" />
- <!-- 转移客户 -->
- <Shift ref="shift" @refresh="back" />
- <!-- 移入公海 -->
- <ToOpen ref="toOpen" @refresh="backToOpen" />
- <!-- 跟进详情 -->
- <FollowDetail ref="followDetail" />
- <!-- 添加项目 -->
- <Businessedit ref="businessedit" :cust-info="custInfo" @fetch-data="getBusiness" />
- <!-- 领取客户 -->
- <Pick ref="pick" />
- <Bid ref="bid" @bidSave="bidSave" />
- <InvoiceHeader ref="invoiceHeader" @save="invoiceHeaderSave" />
- </div>
- </template>
- <script>
- import { hasPermission } from '@/utils/permission'
- import { mapGetters } from 'vuex'
- import api from '@/api/customer'
- import follow from '@/api/customer/follow'
- import to from 'await-to-js'
- import businessApi from '@/api/proj/business'
- import contractApi from '@/api/contract'
- import bidApi from '@/api/customer/bid'
- import invoiceHeaderApi from '@/api/customer/invoiceHeader'
- import Contact from './components/Contact'
- import Edit from './components/Edit'
- import Allocate from './components/Allocate'
- import Shift from './components/Shift'
- import ToOpen from './components/ToOpen'
- import FollowDetail from './components/FollowDetail'
- import Businessedit from '../proj/business/components/BusinessEdit'
- import Pick from './components/Pick'
- import Bid from './components/Bid'
- import InvoiceHeader from './components/InvoiceHeader'
- export default {
- name: 'CustomerDetail',
- components: {
- Edit,
- Contact,
- Allocate,
- Shift,
- Pick,
- Bid,
- InvoiceHeader,
- ToOpen,
- FollowDetail,
- Businessedit,
- },
- data() {
- return {
- id: '',
- detail: {
- custCode: '', //客户编码
- abbrName: '', //助记名
- level: '', //客户级别
- indusTry: '', //客户类型
- custStatus: '', //客户状态
- followUpDate: '', //最后跟进时间
- },
- abstract: {
- followContent: '', //跟进次数
- notFollowDay: '', //未跟进天数
- business: '', //项目数量
- businessTotal: '', //项目总额
- dealCotal: '', //成交次数
- dealTotal: '', //成交总额
- paymentTotal: '', //回款总额
- notPaymentTotal: '', //未回款总额
- drawTotal: '', //开票总额
- },
- activeName: 'detail',
- cuctName: '',
- bidSearchText: '',
- invoiceHeaderSearchText: '',
- contactList: [],
- selectRows: [],
- records: [], //操作记录
- followList: [], //跟进记录
- belongs: [],
- bidlist: [],
- invoiceHeaderList: [],
- items: [], //项目
- contracts: [], //合同
- appro: [],
- bidInfoTypeOptions: {},
- custInfo: {},
- levelOptions: [],
- industryOptions: [],
- contractTypeOptions: [],
- }
- },
- computed: {
- ...mapGetters({
- avatar: 'user/avatar',
- username: 'user/username',
- }),
- },
- mounted() {
- this.id = this.$route.query.id
- this.init()
- this.getOptions()
- this.getDynamics()
- this.handleClick({ name: 'follow' })
- },
- methods: {
- getOptions() {
- Promise.all([this.getDicts('cust_level'), this.getDicts('cust_idy'), this.getDicts('contract_type')])
- .then(([level, industry, contractType]) => {
- this.levelOptions = level.data.values || []
- this.industryOptions = industry.data.values || []
- this.contractTypeOptions = contractType.data.values || []
- })
- .catch((err) => console.log(err))
- },
- checkPermi(val) {
- let str = 'cust:'
- if (this.detail.salesId) str += 'list:'
- else str += 'open:'
- str += val
- return hasPermission([str])
- },
- async init() {
- Promise.all([
- api.getDetail({ ids: [parseInt(this.id)] }),
- api.getAbstract({ id: parseInt(this.id) }),
- this.getDicts('proj_appro_status'),
- ]).then(([detail, abstract, appro]) => {
- if (detail.data.list[0]) this.detail = detail.data.list[0]
- if (abstract.data.list) this.abstract = abstract.data.list
- this.appro = appro.data.values || []
- })
- this.getDicts('bid_info_type').then((response) => {
- this.bidInfoTypeOptions = {}
- response.data.values.filter((i) => {
- this.bidInfoTypeOptions[i.key] = i.value
- })
- })
- },
- getStatus(val) {
- const obj = this.appro.find((item) => item.key == val)
- if (obj) return obj.value
- },
- async getDynamics() {
- const [err, res] = await to(api.dynamicsList({ custId: parseInt(this.id) }))
- if (err) return
- if (res.data.list && res.data.list[0]) {
- let obj = res.data.list[0]
- const keys = Object.keys(obj).reverse()
- let records = {}
- for (const item of keys) {
- records[item] = obj[item]
- }
- this.records = records
- }
- },
- setSelectRows(val) {
- this.selectRows = val
- },
- async handleClick(tab) {
- let err, res
- if (tab.name == 'contact') {
- ;[err, res] = await to(api.getContact({ custId: parseInt(this.id), cuctName: this.cuctName }))
- if (err) return
- this.contactList = res.data.list || []
- } else if (tab.name == 'follow') {
- let params = {
- custId: String(this.id),
- DaysBeforeToday: 99999,
- }
- ;[err, res] = await to(follow.getListByDay(params))
- if (err) return
- this.followList = res.data.list || []
- } else if (tab.name == 'belong') {
- ;[err, res] = await to(api.getBelongs({ custId: parseInt(this.id) }))
- if (err) return
- this.belongs = res.data.list || []
- } else if (tab.name == 'item') {
- ;[err, res] = await to(businessApi.getList({ custName: this.detail.custName }))
- if (err) return
- this.items = res.data.list || []
- } else if (tab.name == 'contract') {
- ;[err, res] = await to(contractApi.getList({ custId: parseInt(this.id) }))
- this.contracts = res.data.list || []
- } else if (tab.name == 'bid') {
- ;[err, res] = await to(api.bidList({ custId: parseInt(this.id), searchText: this.bidSearchText }))
- this.bidlist = res.data.list || []
- } else if (tab.name == 'invoiceHeader') {
- ;[err, res] = await to(
- invoiceHeaderApi.list({ custId: parseInt(this.id), searchText: this.invoiceHeaderSearchText })
- )
- this.invoiceHeaderList = res.data.list || []
- }
- },
- // 添加联系人
- addContact() {
- this.$refs.contact.contactForm.custId = this.detail.id
- this.$refs.contact.contactForm.custName = this.detail.custName
- this.$refs.contact.contactVisible = true
- },
- addBid() {
- this.$refs.bid.form.custId = this.detail.id
- this.$refs.bid.init()
- },
- addInvoiceHeader() {
- this.$refs.invoiceHeader.form.custId = this.detail.id
- this.$refs.invoiceHeader.init()
- },
- bidEdit(row) {
- this.$refs.bid.init(row.id)
- },
- invoiceHeaderEdit(row) {
- this.$refs.invoiceHeader.init(row.id)
- },
- invoiceHeaderDel(row) {
- this.$confirm('确认删除?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(async () => {
- const [err, res] = await to(invoiceHeaderApi.delete({ id: [row.id] }))
- if (err) return
- if (res.code == 200) {
- this.$message({
- type: 'success',
- message: '删除成功!',
- })
- this.handleClick({ name: 'invoiceHeader' })
- }
- })
- .catch((err) => console.log(err))
- },
- // 删除联系人
- bidDel(row) {
- this.$confirm('确认删除?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(async () => {
- const [err, res] = await to(bidApi.delete({ id: [row.id] }))
- if (err) return
- if (res.code == 200) {
- this.$message({
- type: 'success',
- message: '删除成功!',
- })
- this.handleClick({ name: 'bid' })
- }
- })
- .catch(() => {})
- },
- // 保存联系人
- contactSave() {
- this.handleClick({ name: 'contact' })
- this.getDynamics()
- },
- bidSave() {
- this.handleClick({ name: 'bid' })
- },
- invoiceHeaderSave() {
- this.handleClick({ name: 'invoiceHeader' })
- },
- // 编辑客户
- handleEdit() {
- this.$refs.edit.title = '编辑客户'
- this.$refs.edit.editForm = { ...this.detail }
- this.$refs.edit.editVisible = true
- this.$refs.edit.areaEditDisable = true
- this.$refs.edit.showLocation()
- },
- // 编辑联系人
- contactEdit(row) {
- this.$refs.contact.contactForm = { ...row }
- this.$refs.contact.contactForm.custName = this.detail.custName
- this.$refs.contact.contactVisible = true
- },
- // 删除联系人
- contactDel(row) {
- this.$confirm('确认删除?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(async () => {
- const [err, res] = await to(api.deleteContact({ Ids: [row.id], custId: parseInt(this.id) }))
- if (err) return
- if (res.code == 200) {
- this.$message({
- type: 'success',
- message: '删除成功!',
- })
- this.contactSave()
- }
- })
- .catch(() => {})
- },
- // 转移客户
- handleShift() {
- this.$refs.shift.form.Ids = [parseInt(this.id)]
- this.$refs.shift.visible = true
- },
- // 移入公海
- handleToOpen() {
- this.$refs.toOpen.form.ids = [parseInt(this.id)]
- this.$refs.toOpen.visible = true
- },
- // 客户删除
- handleDelete() {
- this.$confirm('确认删除?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(async () => {
- const [err, res] = await to(api.deleteCustomer({ Id: parseInt(this.id) }))
- if (err) return
- if (res.code == 200) {
- this.$message({
- type: 'success',
- message: '删除成功!',
- })
- this.$router.go(-1)
- }
- })
- .catch(() => {})
- },
- backToOpen() {
- this.$router.push('/customer/openSea')
- },
- back() {
- this.$router.go(-1)
- },
- // 领取
- handleReceive() {
- this.$refs.pick.ids = [parseInt(this.id)]
- this.$refs.pick.visible = true
- // this.$confirm('确认领取客户?', '提示', {
- // confirmButtonText: '确定',
- // cancelButtonText: '取消',
- // type: 'warning',
- // })
- // .then(async () => {
- // const [err, res] = await to(
- // api.receiveCustomer({
- // ids: [parseInt(this.id)],
- // salesId: this.$store.state.user.id,
- // salesName: this.$store.state.user.nickName,
- // receive: '1',
- // })
- // )
- // if (err) return
- // if (res.code == 200) {
- // this.$message({
- // type: 'success',
- // message: '领取成功!',
- // })
- // this.$router.push('/customer/list')
- // }
- // })
- // .catch(() => {})
- },
- handleAllocate() {
- this.$refs.allocate.ids = [parseInt(this.id)]
- this.$refs.allocate.visible = true
- },
- customerSave() {
- this.init()
- this.getDynamics()
- },
- formatType(val) {
- let str = ''
- if (val == 10) str = '电话'
- else if (val == 20) str = '邮件'
- else if (val == 30) str = '拜访'
- return str
- },
- // 跟进记录详情
- showDetail(row) {
- this.$refs.followDetail.init({ ...row })
- },
- // 展开评论
- showComment(row) {
- if (!row.comments.length) return this.$message.warning('暂无评论')
- row.showComment = !row.showComment
- this.$forceUpdate()
- },
- // 创建项目
- handleBusiness() {
- this.custInfo = {
- custId: parseInt(this.id),
- custName: this.detail.custName,
- }
- this.$refs.businessedit.dialogFormVisible = true
- },
- getBusiness() {
- if (this.activeName == 'item') {
- this.handleClick({ name: 'item' })
- }
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- $base: '.detail';
- #{$base} {
- height: calc(100vh - 60px - 12px * 2 - 40px);
- display: flex;
- padding: 20px 40px;
- > .el-row {
- flex: 1;
- width: 100%;
- > .el-col {
- height: 100%;
- }
- }
- .title {
- p,
- h3 {
- margin: 0;
- }
- p {
- font-size: 14px;
- font-weight: 400;
- line-height: 22px;
- }
- h3 {
- font-size: 24px;
- font-weight: 500;
- line-height: 36px;
- color: #333;
- display: flex;
- justify-content: space-between;
- }
- }
- header {
- height: 74px;
- background: rgba(196, 196, 196, 0.5);
- border-radius: 4px;
- display: flex;
- align-items: center;
- padding: 0 20px;
- margin-top: 16px;
- ::v-deep .el-descriptions__body {
- background: transparent;
- }
- ::v-deep .my-label {
- font-size: 14px;
- font-weight: 600;
- color: #1d66dc;
- }
- ::v-deep .my-content {
- font-size: 14px;
- font-weight: 600;
- color: #333;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
- .el-tabs {
- height: calc(100% - 148px);
- display: flex;
- flex-direction: column;
- ::v-deep .el-tabs__content {
- flex: 1;
- .el-tab-pane {
- height: 100%;
- .el-descriptions {
- table-layout: fixed;
- .is-bordered {
- table-layout: fixed;
- }
- }
- }
- }
- }
- .buttons {
- padding-top: 28px;
- text-align: right;
- }
- .records {
- margin: 0;
- padding: 10px 20px;
- list-style: none;
- height: calc(100% - 60px);
- overflow-y: auto;
- > li {
- display: flex;
- & + li {
- margin-top: 10px;
- }
- }
- .date {
- width: 100px;
- display: flex;
- flex-direction: column;
- align-items: center;
- h2,
- h3 {
- margin: 0;
- }
- h2 {
- font-size: 26px;
- line-height: 32px;
- }
- }
- .content {
- flex: 1;
- list-style: none;
- li {
- display: flex;
- & + li {
- margin-top: 10px;
- }
- }
- .user-avatar {
- font-size: 40px;
- }
- .text {
- flex: 1;
- padding-left: 20px;
- p {
- font-weight: 500;
- margin: 0;
- line-height: 20px;
- span {
- color: #1d66dc;
- }
- }
- p:nth-child(2) {
- margin-bottom: 10px;
- }
- .action {
- font-weight: bold;
- color: #333;
- }
- }
- }
- }
- .follow {
- height: 100%;
- padding: 10px 20px;
- overflow: auto;
- > li {
- display: flex;
- + li {
- margin-top: 10px;
- }
- }
- .date {
- width: 100px;
- display: flex;
- flex-direction: column;
- align-items: center;
- h2,
- h3 {
- margin: 0;
- }
- h2 {
- font-size: 26px;
- line-height: 32px;
- }
- }
- .content {
- flex: 1;
- list-style: none;
- > li {
- border: 1px solid rgb(215, 232, 244);
- background: rgb(247, 251, 254);
- border-radius: 4px;
- padding: 8px;
- overflow: hidden;
- .text-container {
- display: flex;
- }
- .comments {
- padding-left: 60px;
- margin-top: 10px;
- max-height: 190px;
- overflow: auto;
- li {
- display: flex;
- border-top: 1px solid #e3e5e7;
- .text {
- flex: 1;
- padding: 0 10px;
- p {
- font-weight: 500;
- margin: 0;
- line-height: 32px;
- }
- p:first-child {
- line-height: 30px;
- font-weight: bold;
- }
- p:last-child {
- font-size: 12px;
- color: #9499a0;
- text-align: right;
- }
- }
- }
- }
- + li {
- margin-top: 10px;
- }
- }
- .user-avatar {
- font-size: 40px;
- }
- .text {
- flex: 1;
- padding-left: 20px;
- padding-right: 10px;
- p {
- font-weight: 500;
- margin: 0;
- line-height: 32px;
- span {
- color: #1d66dc;
- }
- }
- .action {
- display: flex;
- justify-content: space-between;
- span:first-child {
- font-weight: bold;
- color: #333;
- }
- }
- .footer {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- }
- }
- }
- .no-follow {
- height: 100%;
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 12px;
- color: rgba(0, 0, 0, 0.65);
- }
- }
- .height-enter-active,
- .height-leave-active {
- transition: all 0.5s;
- }
- .height-enter-to,
- .height-leave {
- height: 190px;
- }
- .height-enter, .height-leave-to /* .fade-leave-active below version 2.1.8 */ {
- height: 0;
- }
- </style>
|