|
|
@@ -91,6 +91,15 @@
|
|
|
{{ details.nextPlan }}
|
|
|
</el-descriptions-item>
|
|
|
</el-descriptions>
|
|
|
+ <div style="margin-top: 20px">
|
|
|
+ <el-button :disabled="!operateData.hasLast" type="primary" @click="getOperateData('Last')">
|
|
|
+ 上一条
|
|
|
+ </el-button>
|
|
|
+ <el-button :disabled="!operateData.hasNext" type="primary" @click="getOperateData('Next')">
|
|
|
+ 下一条
|
|
|
+ </el-button>
|
|
|
+ <el-button @click="back">返回</el-button>
|
|
|
+ </div>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</div>
|
|
|
@@ -116,6 +125,8 @@
|
|
|
40: '信息有效,可转为经销商',
|
|
|
30: '信息无效,不再跟进',
|
|
|
},
|
|
|
+ // 可操作数据
|
|
|
+ operateData: { hasLast: false, hasNext: false },
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -132,10 +143,45 @@
|
|
|
methods: {
|
|
|
init() {
|
|
|
Promise.all([api.get({ id: this.id })]).then(([details]) => {
|
|
|
- if (details.data) this.details = details.data
|
|
|
+ if (details.data) {
|
|
|
+ this.details = details.data
|
|
|
+ this.getOperateData('Now')
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
handleClick() {},
|
|
|
+ // 获取操作数据
|
|
|
+ getOperateData(operateType) {
|
|
|
+ this.operateData.hasLast = false
|
|
|
+ this.operateData.hasNext = false
|
|
|
+ api
|
|
|
+ .getOperateEntity({ id: this.id, operateType: operateType, createdTime: this.details.createdTime })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data) {
|
|
|
+ this.operateData.hasLast = res.data.hasLast
|
|
|
+ this.operateData.hasNext = res.data.hasNext
|
|
|
+ if (operateType != 'Now') {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/consult/detail',
|
|
|
+ query: {
|
|
|
+ id: res.data.id,
|
|
|
+ },
|
|
|
+ })
|
|
|
+ this.id = res.data.id
|
|
|
+ this.init()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 返回
|
|
|
+ back() {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/consult',
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|