|
|
@@ -7,12 +7,7 @@
|
|
|
<h3>
|
|
|
{{ details.nboName }}
|
|
|
<span>
|
|
|
- <el-button :disabled="details.nboType === 'A'" type="primary" @click="handleBusinessGradation('升级')">
|
|
|
- 升级
|
|
|
- </el-button>
|
|
|
- <el-button :disabled="details.nboType === 'C'" type="danger" @click="handleBusinessGradation('降级')">
|
|
|
- 降级
|
|
|
- </el-button>
|
|
|
+ <business-gradation :bus-id="id" :nbo-type="details.nboType" @fetch-data="init" />
|
|
|
<el-button @click="handleTransfer">转移项目</el-button>
|
|
|
<el-button>创建工单</el-button>
|
|
|
<el-button @click="createContract">创建合同</el-button>
|
|
|
@@ -121,16 +116,16 @@
|
|
|
<el-tab-pane label="工单记录" name="worksheet" />
|
|
|
<el-tab-pane label="归属记录" name="belong">
|
|
|
<el-table v-loading="belongLoading" border :data="belongs" height="calc(100% - 42px)">
|
|
|
- <el-table-column align="center" label="归属销售" prop="opnContent.saleName" />
|
|
|
- <el-table-column align="center" label="原来归属" prop="opnContent.origSaleName" />
|
|
|
+ <el-table-column align="center" label="归属销售" prop="opnContent.saleName" show-overflow-tooltip />
|
|
|
+ <el-table-column align="center" label="原来归属" prop="opnContent.origSaleName" show-overflow-tooltip />
|
|
|
<el-table-column align="center" label="操作方式" prop="opnType">
|
|
|
<template slot-scope="scope">
|
|
|
<el-tag v-if="scope.row.opnType == 30">转移</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" label="操作人" prop="createdName" />
|
|
|
- <el-table-column align="center" label="操作时间" min-width="160px" prop="opnDate" />
|
|
|
- <el-table-column align="center" label="备注" prop="remark" />
|
|
|
+ <el-table-column align="center" label="操作人" prop="createdName" show-overflow-tooltip />
|
|
|
+ <el-table-column align="center" label="操作时间" min-width="160px" prop="opnDate" show-overflow-tooltip />
|
|
|
+ <el-table-column align="center" label="备注" prop="remark" show-overflow-tooltip />
|
|
|
</el-table>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
@@ -153,6 +148,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import BusinessGradation from '@/views/proj/business/components/BusinessGradation'
|
|
|
import to from 'await-to-js'
|
|
|
import { mapGetters } from 'vuex'
|
|
|
import businessApi from '@/api/proj/business'
|
|
|
@@ -166,11 +162,20 @@
|
|
|
|
|
|
export default {
|
|
|
name: 'BusinessDetail',
|
|
|
- components: { Edit, Transfer, DetailsContact, DetailsContract, DetailsRecords, DetailsFollow, ContractEdit },
|
|
|
+ components: {
|
|
|
+ BusinessGradation,
|
|
|
+ Edit,
|
|
|
+ Transfer,
|
|
|
+ DetailsContact,
|
|
|
+ DetailsContract,
|
|
|
+ DetailsRecords,
|
|
|
+ DetailsFollow,
|
|
|
+ ContractEdit,
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
id: undefined,
|
|
|
- details: {},
|
|
|
+ details: { nboType: '' },
|
|
|
product: [],
|
|
|
abstract: {},
|
|
|
activeName: 'follow',
|
|
|
@@ -189,24 +194,27 @@
|
|
|
username: 'user/username',
|
|
|
}),
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ created() {
|
|
|
this.id = parseInt(this.$route.query.id)
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
this.init()
|
|
|
},
|
|
|
methods: {
|
|
|
- async init() {
|
|
|
- Promise.all([businessApi.getEntityById({ id: this.id })]).then(([details]) => {
|
|
|
- console.log(details.data)
|
|
|
+ init() {
|
|
|
+ Promise.all([
|
|
|
+ businessApi.getEntityById({ id: this.id }),
|
|
|
+ this.getRecord(),
|
|
|
+ this.handleClick({ name: this.activeName }),
|
|
|
+ ]).then(([details]) => {
|
|
|
if (details.data) this.details = details.data
|
|
|
})
|
|
|
- await this.getRecord()
|
|
|
- await this.handleClick({ name: this.activeName })
|
|
|
},
|
|
|
async getRecord() {
|
|
|
const [err, res] = await to(businessApi.getBusinessDynamics({ busId: this.id }))
|
|
|
if (err) return
|
|
|
- if (res.data.list[0]) {
|
|
|
- let obj = res.data.list[0]
|
|
|
+ if (res.data.list) {
|
|
|
+ let obj = res.data.list
|
|
|
const keys = Object.keys(obj).reverse()
|
|
|
let records = {}
|
|
|
for (const item of keys) {
|
|
|
@@ -220,13 +228,10 @@
|
|
|
async handleClick(tab) {
|
|
|
if (tab.name == 'follow') {
|
|
|
await this.$refs.follow.fetchData()
|
|
|
- return
|
|
|
} else if (tab.name == 'contact') {
|
|
|
await this.$refs.contact.fetchData()
|
|
|
- return
|
|
|
} else if (tab.name == 'contract') {
|
|
|
this.$refs.detailsContract.open(this.id)
|
|
|
- return
|
|
|
} else if (tab.name == 'worksheet') {
|
|
|
return
|
|
|
} else if (tab.name == 'belong') {
|
|
|
@@ -238,7 +243,6 @@
|
|
|
this.belongs = list ? list : []
|
|
|
this.belongTotal = total
|
|
|
this.belongLoading = false
|
|
|
- return
|
|
|
} else {
|
|
|
return
|
|
|
}
|