123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- <template>
- <view class="detail-customer-about">
- <about-contacts :list="contactsList" :config="getConfigs('contacts')" class="about-section" />
- <about-group :list="teamList" :config="getConfigs('group')" class="about-section" />
- <about-business :list="businessList" :config="getConfigs('business')" class="about-section" />
- <about-contract :list="contractList" :config="getConfigs('contract')" class="about-section" />
- <about-receivables :list="receivedList" :config="getConfigs('receivables')" class="about-section" />
- <about-file
- v-if="batchId"
- :batch-id="batchId"
- :detail-id="detailId"
- :is-seas="isSeas"
- type="crm_customer"
- class="about-section" />
- <about-operation
- :detail-id="detailId"
- type="crm_customer"
- class="about-section" />
- </view>
- </template>
- <script>
- import {
- QueryContacts,
- QueryBusiness,
- QueryContract,
- QueryReceivables,
- GetMembers
- } from 'API/crm/customer'
- import AboutContacts from '../../components/tabAbout/aboutContacts.vue'
- import AboutGroup from '../../components/tabAbout/aboutGroup.vue'
- import AboutBusiness from '../../components/tabAbout/aboutBusiness.vue'
- import AboutContract from '../../components/tabAbout/aboutContract.vue'
- import AboutReceivables from '../../components/tabAbout/aboutReceivables.vue'
- import AboutFile from '../../components/tabAbout/aboutFile.vue'
- import AboutOperation from '../../components/tabAbout/aboutOperation.vue'
- export default {
- name: 'DetailCustomerAbout',
- components: {
- AboutContacts,
- AboutGroup,
- AboutBusiness,
- AboutContract,
- AboutReceivables,
- AboutFile,
- AboutOperation
- },
- props: {
- detailId: {
- type: [String, Number],
- default: null,
- required: true
- },
- detailData: {
- type: Object,
- default: () => {}
- },
- batchId: {
- type: String,
- default: null
- },
- isSeas: {
- type: Boolean,
- default: false
- }
- },
- data() {
- return {
- contactsList: [],
- businessList: [],
- contractList: [],
- receivedList: [],
- teamList: [],
- contractReady: false,
- receivedReady: false
- }
- },
- computed: {
- flag() {
- return this.contractReady && this.receivedReady
- }
- },
- watch: {
- flag: {
- handler(val) {
- if (val) {
- if (this.contractList.length > 0) {
- this.contractList.forEach(contract => {
- let filterRes = this.receivedList.filter(received => {
- return contract.contract_id == received.contract_id && received.check_status === 2
- })
- let doMoney = 0
- filterRes.forEach(item => {
- doMoney += Number(item.money)
- })
- contract.doMoney = doMoney.toFixed(2)
- this.$set(contract, 'doMoney', contract.doMoney)
- })
- }
- console.log('redy contractList', this.contractList)
- }
- },
- immediate: true
- }
- },
- created() {
- this.getList()
- },
- methods: {
- getList() {
- let params = {
- customerId: this.detailId,
- pageType: 0
- }
- QueryContacts(params).then(response => {
- console.log('contactsList: ', response)
- this.contactsList = response.list
- }).catch()
- QueryBusiness(params).then(response => {
- console.log('businessList: ', response)
- this.businessList = response.list
- })
- QueryContract(params).then(response => {
- console.log('contractList: ', response)
- this.contractList = response.list || []
- this.contractReady = true
- })
- QueryReceivables(params).then(response => {
- console.log('receivedList: ', response)
- this.receivedList = response.list || []
- this.receivedReady = true
- })
- GetMembers({
- id: this.detailId
- }).then(res => {
- console.log('teamList: ', res)
- this.teamList = res
- }).catch(() => {})
- },
- getConfigs() {
- return {
- detail: this.detailData,
- type: 'customer',
- isSeas: this.isSeas
- }
- }
- }
- }
- </script>
- <style scoped lang="scss">
- </style>
|