|
@@ -1,12 +1,12 @@
|
|
<template>
|
|
<template>
|
|
<view class="message-detail-index">
|
|
<view class="message-detail-index">
|
|
<view class="message-detail-content">
|
|
<view class="message-detail-content">
|
|
- {{detail.sendUserName}}{{detail.message}}
|
|
|
|
|
|
+ <text v-if="detail.id">{{detail.sendUserName}}{{detail.message}}</text>
|
|
</view>
|
|
</view>
|
|
- <view class="message-btn-box">
|
|
|
|
- <view class="message-btn red" @click="btnClick('拒绝')">拒绝</view>
|
|
|
|
|
|
+ <view class="message-btn-box" v-if="dataDetail.status === 1">
|
|
|
|
+ <view class="message-btn red" @click="btnClick('拒绝',3)">拒绝</view>
|
|
<view class="line"></view>
|
|
<view class="line"></view>
|
|
- <view class="message-btn primary" @click="btnClick('同意')">同意</view>
|
|
|
|
|
|
+ <view class="message-btn primary" @click="btnClick('同意',2)">同意</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
@@ -14,43 +14,72 @@
|
|
<script>
|
|
<script>
|
|
import {
|
|
import {
|
|
getMessageDetailById,
|
|
getMessageDetailById,
|
|
- bindProject
|
|
|
|
|
|
+ bindProject,
|
|
|
|
+ getCustomerDetailById,
|
|
|
|
+ updateCustomer
|
|
} from '@/request/api/message.js'
|
|
} from '@/request/api/message.js'
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
messageId: '',
|
|
messageId: '',
|
|
- detail: {}
|
|
|
|
|
|
+ detail: {},
|
|
|
|
+ dataDetail: {}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(body) {
|
|
onLoad(body) {
|
|
this.messageId = body.id;
|
|
this.messageId = body.id;
|
|
- this.detail = JSON.parse(body.item);
|
|
|
|
|
|
+ this.init();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
init() {
|
|
init() {
|
|
-
|
|
|
|
|
|
+ getMessageDetailById(this.messageId).then(res => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.detail = res.data;
|
|
|
|
+ this.detail = Object.assign(this.detail, JSON.parse(this.detail.json));
|
|
|
|
+ this.initDetail();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ initDetail() {
|
|
|
|
+ getCustomerDetailById(this.detail.dataId).then(res => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.dataDetail = res.data;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- btnClick(msg) {
|
|
|
|
|
|
+ btnClick(msg, type) {
|
|
uni.showModal({
|
|
uni.showModal({
|
|
title: '有极提示',
|
|
title: '有极提示',
|
|
content: '是否' + msg + '加入该项目',
|
|
content: '是否' + msg + '加入该项目',
|
|
success: (res) => {
|
|
success: (res) => {
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
- bindProject({
|
|
|
|
- organizationId: this.detail.organizationId,
|
|
|
|
- projectId: this.detail.projectId,
|
|
|
|
- clientId: this.detail.dataId,
|
|
|
|
- userId: this.$store.getters.user.userId,
|
|
|
|
- identityId: this.detail.identityId || 1
|
|
|
|
|
|
+ updateCustomer({
|
|
|
|
+ id: this.dataDetail.id,
|
|
|
|
+ status: type
|
|
}).then(res => {
|
|
}).then(res => {
|
|
- if (res.code === 200) {
|
|
|
|
- this.$toast('操作成功')
|
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ if (type === 2) return this.operationProject();
|
|
|
|
+ this.initDetail();
|
|
|
|
+ this.$toast('操作成功');
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ },
|
|
|
|
+ operationProject() {
|
|
|
|
+ bindProject({
|
|
|
|
+ organizationId: this.detail.organizationId,
|
|
|
|
+ projectId: this.detail.projectId,
|
|
|
|
+ clientId: this.detail.dataId,
|
|
|
|
+ userId: this.$store.getters.user.userId,
|
|
|
|
+ identityId: this.detail.identityId
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$toast('操作成功');
|
|
|
|
+ this.initDetail();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|