123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286 |
- <template>
- <view v-if="!$isEmpty(detailData)" class="uni-app">
- <view class="status-bar" />
- <wk-nav-bar
- :command-list="commandList"
- :refresh-prev="refreshPrevPage"
- title="公海客户详情"
- theme="white"
- class="nav-bar"
- @command="handleCommand" />
- <scroll-view
- :scroll-y="true"
- class="main-container scroll-view-hook"
- @scrolltolower="handleScrollTolower">
- <view class="header-top">
- <view class="bg linear-gradient" />
- <view class="card">
- <view class="title-cell">
- <image :src="$static('images/application/customer.png')" class="type-icon" />
- <view class="title-text">
- <text class="text">
- {{ detailData.customerName || '' }}
- </text>
- <text v-if="detailData.status === 2" class="wk wk-lock" />
- </view>
- <view :class="detailData.dealStatus === 1 ? 'success' : 'info'" class="title-status">
- <text>{{ detailData.dealStatus === 1 ? '已成交' : '未成交' }}</text>
- </view>
- </view>
- <view class="main-info">
- <view class="info-item">
- <text class="label">
- 客户级别:
- </text>
- <text class="value">
- {{ detailData.level || '--' }}
- </text>
- </view>
- <view class="info-item">
- <text class="label">
- 负责人:
- </text>
- <text class="value">
- {{ detailData.ownerUserName || '--' }}
- </text>
- </view>
- <view class="info-item">
- <text class="label">
- 更新时间:
- </text>
- <text class="value">
- {{ detailData.updateTime || '--' }}
- </text>
- </view>
- </view>
- <image
- v-if="detailData.mobile"
- :src="$static('images/icon/call_up.png')"
- class="call-up"
- @click="ringUp(detailData.mobile)" />
- </view>
- </view>
- <view ref="wkTabs" class="wk-tabs">
- <view
- v-for="(tab, index) in tabs"
- :key="index"
- :class="{active: activeTab === tab.value}"
- class="wk-tab-item"
- @click="handleToggleTabs(tab.value)">
- {{ tab.label }}
- </view>
- </view>
- <wk-keep-alive v-if="id" v-model="activeTab">
- <wk-keep-alive-item>
- <detail-activity-list
- ref="activity"
- :detail-id="id"
- :hidden-add="true"
- type="crm_customer"
- activity-title="客户" />
- </wk-keep-alive-item>
- <wk-keep-alive-item>
- <detail-base-info
- v-if="poolId"
- :detail-id="id"
- :pool-id="poolId"
- :type="comType"
- class="detail-container" />
- </wk-keep-alive-item>
- <wk-keep-alive-item>
- <detail-about
- :detail-id="id"
- :detail-data="detailData"
- :batch-id="detailData.batchId"
- is-seas
- class="detail-container" />
- </wk-keep-alive-item>
- </wk-keep-alive>
- </scroll-view>
- <uni-popup ref="popup" type="dialog">
- <uni-popup-dialog
- :content="dialogMsg"
- type="warning"
- @confirm="handleDialogConfirm" />
- </uni-popup>
- </view>
- </template>
- <script>
- import {
- QueryById,
- DistributeByIds,
- ReceiveByIds
- } from 'API/crm/customer'
- import { DeleteByIds } from 'API/crm/pool'
- import DetailBaseInfo from '../components/detailSection/baseInfo'
- import DetailActivityList from '../components/detailSection/activityList'
- import DetailAbout from '../customer/components/tabsAbout.vue'
- import detailMixins from '../mixins/detail.js'
- export default {
- name: 'SeasDetail',
- components: {
- DetailBaseInfo,
- DetailActivityList,
- DetailAbout
- },
- mixins: [detailMixins],
- data() {
- return {
- comType: 'crm_pool',
- poolId: null,
- commandList: [
- {
- label: '分配',
- imgIcon: 'alloc',
- auth: 'crm.pool.distribute',
- value: 'distribute'
- },
- {
- label: '领取',
- imgIcon: 'receive',
- auth: 'crm.pool.receive',
- value: 'receive'
- },
- {
- label: '删除',
- imgIcon: 'delete',
- noCheck: true,
- value: 'delete'
- }
- ]
- }
- },
- onLoad(options) {
- this.routerQuery = options
- this.id = options.id || null
- this.poolId = options.poolId || null
- if (!this.poolId) {
- this.commandList = [
- {
- label: '删除',
- imgIcon: 'delete',
- noCheck: true,
- value: 'delete'
- }
- ]
- }
- // this.getDetail()
- },
- methods: {
- getDetail() {
- QueryById({customerId: this.id}).then(response => {
- console.log('detail: ', response)
- this.detailData = response
- }).catch(() => {
- this.goBack()
- })
- },
- handleCommand(command) {
- this.commandValue = command.value
- switch (command.value) {
- case 'distribute':
- this.handleToChangeOwnerUser()
- break
- case 'receive':
- this.dialogMsg = '您确定要领取该客户吗?'
- this.$refs.popup.open()
- break
- case 'delete':
- this.dialogMsg = '您确定要删除该客户吗?'
- this.$refs.popup.open()
- break
- }
- },
- handleDialogConfirm(next) {
- switch (this.commandValue) {
- case 'receive':
- this.getCustomerForMyself()
- break
- case 'delete':
- this.deleteCustomer()
- break
- }
- next()
- },
- handleTransfer(user) {
- DistributeByIds({
- userId: user.userId,
- ids: [this.id],
- poolId: this.poolId
- }).then(() => {
- this.$toast('分配成功!')
- this.$refreshAndToPrev(this)
- }).catch()
- },
- getCustomerForMyself() {
- ReceiveByIds({
- ids: [this.id],
- poolId: this.poolId
- }).then(() => {
- this.$toast('领取成功!')
- this.$refreshAndToPrev(this)
- }).catch()
- },
- /**
- * 删除
- */
- deleteCustomer() {
- DeleteByIds({
- ids: [this.id],
- poolId: this.poolId
- }).then(() => {
- this.$toast('删除成功')
- this.$refreshAndToPrev(this)
- })
- }
- }
- }
- </script>
- <style scoped lang="scss">
- @import "../style/detail.scss";
- .header-top {
- .card {
- .title-status {
- &.success {
- color: #FFFFFF;
- background-color: #FF8700;
- }
- &.info {
- color: #BBBBBB;
- background-color: #EEEEEE;
- }
- }
- .main-info {
- margin-bottom: 25rpx;
- }
- .call-up {
- position: absolute;
- right: 50rpx;
- bottom: 0;
- width: 116rpx;
- height: 116rpx;
- }
- }
- }
- </style>
|