|
|
@@ -7,7 +7,7 @@
|
|
7
|
7
|
<span v-if="quesName">姓名: {{ quesName }}</span>
|
|
8
|
8
|
</el-col>
|
|
9
|
9
|
<el-col :lg="8">
|
|
10
|
|
- <span v-if="quesPhone">电话: <span class="quesephon" @click="outboundClick">{{ quesPhone }}</span></span>
|
|
|
10
|
+ <span v-if="quesPhone">电话: <span class="quesephon" @click="outboundClick(quesPhone)">{{ quesPhone }}</span></span>
|
|
11
|
11
|
</el-col>
|
|
12
|
12
|
</el-row>
|
|
13
|
13
|
</p>
|
|
|
@@ -45,11 +45,13 @@
|
|
45
|
45
|
<!-- 呼叫结果 -->
|
|
46
|
46
|
<el-card v-if="callResults.length" shadow="hover" class="call_result">
|
|
47
|
47
|
<h5 class="title">呼叫结果</h5>
|
|
48
|
|
- <el-radio-group v-model="callresultid">
|
|
49
|
|
- <el-radio v-for="item in callResults" :key="item.id" :label="item.id" border>
|
|
50
|
|
- {{ item.name }}
|
|
51
|
|
- </el-radio>
|
|
52
|
|
- </el-radio-group>
|
|
|
48
|
+ <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="100px" class="order_form">
|
|
|
49
|
+ <el-radio-group v-model="ruleForm.callresultid">
|
|
|
50
|
+ <el-radio v-for="item in callResults" :key="item.id" :label="item.id" border>
|
|
|
51
|
+ {{ item.name }}
|
|
|
52
|
+ </el-radio>
|
|
|
53
|
+ </el-radio-group>
|
|
|
54
|
+ </el-form>
|
|
53
|
55
|
</el-card>
|
|
54
|
56
|
<p v-if="pagerLists.length > 0" class="btn">
|
|
55
|
57
|
<el-button type="primary" @click="submitPager">提 交</el-button>
|
|
|
@@ -58,7 +60,10 @@
|
|
58
|
60
|
</template>
|
|
59
|
61
|
|
|
60
|
62
|
<script>
|
|
61
|
|
-import { getPager, answerPager, taskId } from '@/api/questionnaire/management'
|
|
|
63
|
+import store from '@/store'
|
|
|
64
|
+import { mapGetters } from 'vuex'
|
|
|
65
|
+import { Send } from '@/utils/telWebsocket'
|
|
|
66
|
+import { getPager, answerPager, taskId, getPhone } from '@/api/questionnaire/management'
|
|
62
|
67
|
import { getDictionary } from '@/api/commonAPI'
|
|
63
|
68
|
import { uniqueObjArray } from '@/utils'
|
|
64
|
69
|
|
|
|
@@ -81,7 +86,8 @@ export default {
|
|
81
|
86
|
data() {
|
|
82
|
87
|
return {
|
|
83
|
88
|
ruleForm: {
|
|
84
|
|
- id: ''
|
|
|
89
|
+ id: '',
|
|
|
90
|
+ callresultid: '5bfe540c5a10b06b7a35a83a'
|
|
85
|
91
|
},
|
|
86
|
92
|
rules: {
|
|
87
|
93
|
callresultid: [{
|
|
|
@@ -93,15 +99,32 @@ export default {
|
|
93
|
99
|
loading: false,
|
|
94
|
100
|
title: '',
|
|
95
|
101
|
quesName: '',
|
|
|
102
|
+ taskid: '',
|
|
|
103
|
+ recordid: '',
|
|
96
|
104
|
quesPhone: '',
|
|
97
|
105
|
remark: '',
|
|
98
|
106
|
pagerid: '',
|
|
99
|
|
- callresultid: '5bfe540c5a10b06b7a35a83a', // 否 string 话务状态(字典项:外呼结果)
|
|
100
|
107
|
pagerLists: [],
|
|
101
|
108
|
callResults: [], // 呼叫结果数据
|
|
102
|
109
|
jumpItem: [] // 跳过的试题
|
|
103
|
110
|
}
|
|
104
|
111
|
},
|
|
|
112
|
+ computed: {
|
|
|
113
|
+ ...mapGetters([
|
|
|
114
|
+ 'usercode', // 工号
|
|
|
115
|
+ 'extension', // 分机号
|
|
|
116
|
+ 'telIsLogin', // 是否签入
|
|
|
117
|
+ 'telSeatState', // 坐席状态
|
|
|
118
|
+ 'telLineState', // 线路状态
|
|
|
119
|
+ 'telIsVisCallout' // 外呼面板是否显示
|
|
|
120
|
+ ]),
|
|
|
121
|
+ // 是否可以点击外呼
|
|
|
122
|
+ isAllowCallout: function() {
|
|
|
123
|
+ // `this` 指向 vm 实例
|
|
|
124
|
+ return this.telIsLogin && this.telSeatState === 2 && this.telLineState === 1
|
|
|
125
|
+ }
|
|
|
126
|
+ //
|
|
|
127
|
+ },
|
|
105
|
128
|
watch: {
|
|
106
|
129
|
pagerDatas(newValue, oldValue) {
|
|
107
|
130
|
// console.log(newValue.pageid, oldValue.pageid)
|
|
|
@@ -110,6 +133,7 @@ export default {
|
|
110
|
133
|
}
|
|
111
|
134
|
}
|
|
112
|
135
|
},
|
|
|
136
|
+
|
|
113
|
137
|
created() {
|
|
114
|
138
|
if (this.rowid) {
|
|
115
|
139
|
this.ruleForm.id = this.rowid
|
|
|
@@ -127,6 +151,7 @@ export default {
|
|
127
|
151
|
this.loading = false
|
|
128
|
152
|
if (response.state.toLowerCase() === 'success') {
|
|
129
|
153
|
this.taskid = response.data.pagerid
|
|
|
154
|
+ this.recordid = response.data.tasktel.id
|
|
130
|
155
|
this.quesName = response.data.tasktel.cusname
|
|
131
|
156
|
this.quesPhone = response.data.tasktel.phone
|
|
132
|
157
|
this.getPagers(this.taskid)
|
|
|
@@ -168,30 +193,68 @@ export default {
|
|
168
|
193
|
|
|
169
|
194
|
// 提交
|
|
170
|
195
|
submitPager() {
|
|
171
|
|
- // alert('111')
|
|
172
|
|
- // 验证必填项
|
|
173
|
|
- // let pagerOptions = []
|
|
174
|
|
- // let pagerDatas
|
|
175
|
|
- // // 修改试题数据用于提交
|
|
176
|
|
- // pagerOptions = this.getPagerOptions()
|
|
177
|
|
- // const data = Object.assign(this.pagerDatas, {
|
|
178
|
|
- // result: pagerOptions
|
|
179
|
|
- // })
|
|
180
|
|
- // console.log(JSON.stringify(data))
|
|
181
|
|
- // answerPager(data).then(response => {
|
|
182
|
|
- // this.loading = false
|
|
183
|
|
- // if (response.state.toLowerCase() === 'success') {
|
|
184
|
|
- // debugger
|
|
185
|
|
- // // 触发父组件的方法
|
|
186
|
|
- // this.$emit('getTP')
|
|
187
|
|
- // this.$message.success('恭喜你,数据提交成功!')
|
|
188
|
|
- // }
|
|
189
|
|
- // }).catch(() => {
|
|
190
|
|
- // this.loading = false
|
|
191
|
|
- // })
|
|
|
196
|
+ let pagerOptions = []
|
|
|
197
|
+ let pagerDatas
|
|
|
198
|
+ // 修改试题数据用于提交
|
|
|
199
|
+ pagerOptions = this.getPagerOptions()
|
|
|
200
|
+ // console.log(pagerOptions)
|
|
|
201
|
+ const data = {
|
|
|
202
|
+ fullname: this.quesName,
|
|
|
203
|
+ tel: this.quesPhone,
|
|
|
204
|
+ pageid: this.taskid,
|
|
|
205
|
+ recordid: this.recordid,
|
|
|
206
|
+ result: pagerOptions,
|
|
|
207
|
+ callresult: this.ruleForm.callresultid
|
|
|
208
|
+ }
|
|
|
209
|
+ console.log(this.ruleForm.callresultid)
|
|
|
210
|
+ answerPager(data).then(response => {
|
|
|
211
|
+ this.loading = false
|
|
|
212
|
+ if (response.state.toLowerCase() === 'success') {
|
|
|
213
|
+ debugger
|
|
|
214
|
+ // 触发父组件的方法
|
|
|
215
|
+ this.$emit('getTP')
|
|
|
216
|
+ this.$message.success('恭喜你,数据提交成功!')
|
|
|
217
|
+ }
|
|
|
218
|
+ }).catch(() => {
|
|
|
219
|
+ this.loading = false
|
|
|
220
|
+ })
|
|
192
|
221
|
},
|
|
193
|
|
- outboundClick() {
|
|
194
|
|
- // alert('111')
|
|
|
222
|
+ outboundClick(quesPhone) {
|
|
|
223
|
+ this.loading = true
|
|
|
224
|
+ this.$confirm('您确定要对此客户发起呼叫吗?', '提示', {
|
|
|
225
|
+ confirmButtonText: '确定',
|
|
|
226
|
+ cancelButtonText: '取消',
|
|
|
227
|
+ type: 'warning'
|
|
|
228
|
+ })
|
|
|
229
|
+ .then(() => {
|
|
|
230
|
+ getPhone(quesPhone).then(response => {
|
|
|
231
|
+ if (response.state.toLowerCase() === 'success') {
|
|
|
232
|
+ const res = response.data
|
|
|
233
|
+ this.scoketDatas = {
|
|
|
234
|
+ 'Type': 'MakeCall',
|
|
|
235
|
+ 'AgentID': this.usercode,
|
|
|
236
|
+ 'AgentExten': this.extension,
|
|
|
237
|
+ 'Header': res.fix, // 号码前缀 用于截断前缀得到真实号码
|
|
|
238
|
+ 'DestinationNumber': res.phone //
|
|
|
239
|
+ }
|
|
|
240
|
+ store.dispatch('ChangeCallNum', quesPhone)
|
|
|
241
|
+ Send(this.scoketDatas)
|
|
|
242
|
+ // store.dispatch('UpdateCalloutScreen', false)// 关闭外呼面板
|
|
|
243
|
+ }
|
|
|
244
|
+ })
|
|
|
245
|
+ })
|
|
|
246
|
+ .catch(() => {
|
|
|
247
|
+ this.$message.info('已取消呼叫')
|
|
|
248
|
+ })
|
|
|
249
|
+ // return new Promise(resolve => {
|
|
|
250
|
+ // getPhone(quesPhone).then(response => {
|
|
|
251
|
+ // this.loading = false
|
|
|
252
|
+ // if (response.state.toLowerCase() === 'success') {
|
|
|
253
|
+ // debugger
|
|
|
254
|
+ // }
|
|
|
255
|
+ // })
|
|
|
256
|
+ // resolve()
|
|
|
257
|
+ // })
|
|
195
|
258
|
},
|
|
196
|
259
|
// 单选题跳题
|
|
197
|
260
|
jumpPage(value, e) {
|