|
|
@@ -2,7 +2,7 @@
|
|
|
* @Author: liuzhenlin 461480418@qq.ocm
|
|
|
* @Date: 2023-01-12 11:57:48
|
|
|
* @LastEditors: liuzhenlin
|
|
|
- * @LastEditTime: 2023-02-17 16:55:08
|
|
|
+ * @LastEditTime: 2023-03-01 16:17:37
|
|
|
* @Description: file content
|
|
|
* @FilePath: \oms\pages\publicPages\follow.vue
|
|
|
-->
|
|
|
@@ -121,7 +121,9 @@
|
|
|
<script>
|
|
|
import { mapGetters } from 'vuex'
|
|
|
import to from 'await-to-js'
|
|
|
- import customerApi from '../../api/customer'
|
|
|
+ import followApi from '../../api/follow'
|
|
|
+ import custApi from '../../api/customer'
|
|
|
+ import prodApi from '../../api/project'
|
|
|
import ProjectContact from '../../components/ProjectContact'
|
|
|
import CustomerContact from '../../components/CustomerContact'
|
|
|
export default {
|
|
|
@@ -187,13 +189,17 @@
|
|
|
trigger: ['blur', 'change'],
|
|
|
},
|
|
|
},
|
|
|
+ details: {},
|
|
|
+ curId: 0,
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters(['followPageDetail']),
|
|
|
+ // ...mapGetters(['details']),
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
+ console.log(option)
|
|
|
this.targetType = option.targetType
|
|
|
+ this.curId = parseInt(option.id)
|
|
|
},
|
|
|
created() {
|
|
|
const navData = uni.getMenuButtonBoundingClientRect()
|
|
|
@@ -201,16 +207,35 @@
|
|
|
this.paddingTop = navData.top + 'px'
|
|
|
},
|
|
|
mounted() {
|
|
|
- console.log(this.followPageDetail)
|
|
|
+ console.log(this.details)
|
|
|
+ this.initData()
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 获取客户/项目信息
|
|
|
+ async initData() {
|
|
|
+ if (this.targetType == '10') {
|
|
|
+ //客户
|
|
|
+ const [err, res] = await to(custApi.getDetail({ ids: [this.curId] }))
|
|
|
+ if (err) return
|
|
|
+ if (res && res.code == 200) {
|
|
|
+ this.details = res.data.list[0]
|
|
|
+ }
|
|
|
+ } else if (this.targetType == '20') {
|
|
|
+ //项目
|
|
|
+ const [err, res] = await to(prodApi.getDetail({ id: this.curId }))
|
|
|
+ if (err) return
|
|
|
+ if (res && res.code == 200) {
|
|
|
+ this.details = res.data
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
// 打开客户联系人
|
|
|
open() {
|
|
|
- console.log(this.followPageDetail)
|
|
|
+ console.log(this.details)
|
|
|
if (this.targetType == '10') {
|
|
|
- this.$refs.concat.open(this.followPageDetail.id)
|
|
|
+ this.$refs.concat.open(this.details.id)
|
|
|
} else if (this.targetType == '20') {
|
|
|
- this.$refs.projectConcat.open(this.followPageDetail.id, this.followPageDetail.custId)
|
|
|
+ this.$refs.projectConcat.open(this.details.id, this.details.custId)
|
|
|
}
|
|
|
},
|
|
|
// 行业选择
|
|
|
@@ -236,24 +261,24 @@
|
|
|
}
|
|
|
},
|
|
|
handleAdd() {
|
|
|
- console.log(this.followPageDetail)
|
|
|
+ console.log(this.details)
|
|
|
this.$refs.addForm
|
|
|
.validate()
|
|
|
.then(async () => {
|
|
|
let idParams = {}
|
|
|
if (this.targetType == '10') {
|
|
|
idParams = {
|
|
|
- custId: this.followPageDetail.id,
|
|
|
- custName: this.followPageDetail.custName,
|
|
|
- targetId: this.followPageDetail.id,
|
|
|
- targetName: this.followPageDetail.custName,
|
|
|
+ custId: this.details.id,
|
|
|
+ custName: this.details.custName,
|
|
|
+ targetId: this.details.id,
|
|
|
+ targetName: this.details.custName,
|
|
|
}
|
|
|
} else if (this.targetType == '20') {
|
|
|
idParams = {
|
|
|
- custId: this.followPageDetail.custId,
|
|
|
- custName: this.followPageDetail.custName,
|
|
|
- targetId: this.followPageDetail.custId,
|
|
|
- targetName: this.followPageDetail.custName,
|
|
|
+ custId: this.details.custId,
|
|
|
+ custName: this.details.custName,
|
|
|
+ targetId: this.details.id,
|
|
|
+ targetName: this.details.nboName,
|
|
|
}
|
|
|
}
|
|
|
let params = Object.assign(
|
|
|
@@ -268,7 +293,7 @@
|
|
|
},
|
|
|
idParams
|
|
|
)
|
|
|
- const [err, res] = await to(customerApi.createFollow(params))
|
|
|
+ const [err, res] = await to(followApi.createFollow(params))
|
|
|
if (err) return
|
|
|
if (res && res.code == 200) {
|
|
|
this.$refs.uToast.show({
|