|
|
@@ -7,17 +7,17 @@
|
|
7
|
7
|
</u-navbar>
|
|
8
|
8
|
<view class="form_wrap">
|
|
9
|
9
|
<u--form labelPosition="left" labelWidth="80" :model="form" :rules="rules" ref="form" class="form_wrap">
|
|
10
|
|
-
|
|
|
10
|
+
|
|
11
|
11
|
<u-form-item label="线索id">
|
|
12
|
|
- {{clueDetail && clueDetail.id ? clueDetail.id : "-"}}
|
|
|
12
|
+ {{ clueDetail && clueDetail.id ? clueDetail.id : "-" }}
|
|
13
|
13
|
</u-form-item>
|
|
14
|
|
-
|
|
|
14
|
+
|
|
15
|
15
|
<u-form-item label="线索名称">
|
|
16
|
|
- {{clueDetail && clueDetail.name ? clueDetail.name : "-"}}
|
|
|
16
|
+ {{ clueDetail && clueDetail.name ? clueDetail.name : "-" }}
|
|
17
|
17
|
</u-form-item>
|
|
18
|
|
-
|
|
|
18
|
+
|
|
19
|
19
|
<u-form-item label="操作人">
|
|
20
|
|
- {{userInfo.nickName}}
|
|
|
20
|
+ {{ userInfo.nickName }}
|
|
21
|
21
|
</u-form-item>
|
|
22
|
22
|
|
|
23
|
23
|
<u-form-item label="主叫号码" prop="caller">
|
|
|
@@ -40,14 +40,14 @@
|
|
40
|
40
|
</u-form-item>
|
|
41
|
41
|
</u--form>
|
|
42
|
42
|
</view>
|
|
43
|
|
-
|
|
|
43
|
+
|
|
44
|
44
|
<!-- 录音确认对话框 -->
|
|
45
|
45
|
<u-popup :show="showConfirmDialog" mode="center" :closeable="false" :closeOnClickOverlay="false">
|
|
46
|
46
|
<view class="confirm-dialog">
|
|
47
|
47
|
<view class="dialog-title">确认录音</view>
|
|
48
|
48
|
<view class="dialog-content">
|
|
49
|
49
|
<view class="file-info">
|
|
50
|
|
- <view class="file-name">{{selectedFile.fileName}}</view>
|
|
|
50
|
+ <view class="file-name">{{ selectedFile.fileName }}</view>
|
|
51
|
51
|
</view>
|
|
52
|
52
|
<view class="play-section">
|
|
53
|
53
|
<audio :src="selectedFile.filePath" controls class="audio-player"></audio>
|
|
|
@@ -59,226 +59,226 @@
|
|
59
|
59
|
</view>
|
|
60
|
60
|
</view>
|
|
61
|
61
|
</u-popup>
|
|
62
|
|
-
|
|
|
62
|
+
|
|
63
|
63
|
<!-- <drag-button :isDock="true" /> -->
|
|
64
|
64
|
</view>
|
|
65
|
65
|
</template>
|
|
66
|
66
|
|
|
67
|
67
|
<script>
|
|
68
|
|
- export default {
|
|
69
|
|
- computed: {
|
|
70
|
|
- userInfo() {
|
|
71
|
|
- return this.$store.state.user.userInfo;
|
|
72
|
|
- },
|
|
73
|
|
- filelist(){
|
|
74
|
|
- return this.$store.state.call.filelist;
|
|
75
|
|
- },
|
|
76
|
|
- storeForm() {
|
|
77
|
|
- return this.$store.state.call.form;
|
|
78
|
|
- },
|
|
|
68
|
+export default {
|
|
|
69
|
+ computed: {
|
|
|
70
|
+ userInfo() {
|
|
|
71
|
+ return this.$store.state.user.userInfo;
|
|
79
|
72
|
},
|
|
80
|
|
- data() {
|
|
81
|
|
- return {
|
|
82
|
|
- rules: {
|
|
83
|
|
- 'caller': {
|
|
84
|
|
- type: 'string',
|
|
85
|
|
- required: true,
|
|
86
|
|
- message: '请输入内容',
|
|
87
|
|
- trigger: ['blur', 'change']
|
|
88
|
|
- },
|
|
89
|
|
- 'callee': {
|
|
90
|
|
- type: 'string',
|
|
91
|
|
- required: true,
|
|
92
|
|
- message: '请输入内容',
|
|
93
|
|
- trigger: ['blur', 'change']
|
|
94
|
|
- },
|
|
95
|
|
- 'fileUrl': {
|
|
96
|
|
- type: 'string',
|
|
97
|
|
- required: true,
|
|
98
|
|
- message: '请输入内容',
|
|
99
|
|
- trigger: ['blur', 'change']
|
|
100
|
|
- },
|
|
|
73
|
+ filelist() {
|
|
|
74
|
+ return this.$store.state.call.filelist;
|
|
|
75
|
+ },
|
|
|
76
|
+ storeForm() {
|
|
|
77
|
+ return this.$store.state.call.form;
|
|
|
78
|
+ },
|
|
|
79
|
+ },
|
|
|
80
|
+ data() {
|
|
|
81
|
+ return {
|
|
|
82
|
+ rules: {
|
|
|
83
|
+ 'caller': {
|
|
|
84
|
+ type: 'string',
|
|
|
85
|
+ required: true,
|
|
|
86
|
+ message: '请输入内容',
|
|
|
87
|
+ trigger: ['blur', 'change']
|
|
101
|
88
|
},
|
|
102
|
|
- form: {
|
|
103
|
|
- clueId: undefined,
|
|
104
|
|
- remark: '',
|
|
105
|
|
- fileUrl : undefined,
|
|
106
|
|
- fileName : undefined,
|
|
107
|
|
- type : '3',
|
|
108
|
|
- list : [],
|
|
109
|
|
- caller : '',
|
|
110
|
|
- callee : ''
|
|
|
89
|
+ 'callee': {
|
|
|
90
|
+ type: 'string',
|
|
|
91
|
+ required: true,
|
|
|
92
|
+ message: '请输入内容',
|
|
|
93
|
+ trigger: ['blur', 'change']
|
|
111
|
94
|
},
|
|
112
|
|
- clueDetail : {},
|
|
113
|
|
- // 对话框相关状态
|
|
114
|
|
- showConfirmDialog: false,
|
|
115
|
|
- selectedFile: {
|
|
116
|
|
- filePath: '',
|
|
117
|
|
- fileName: ''
|
|
|
95
|
+ 'fileUrl': {
|
|
|
96
|
+ type: 'string',
|
|
|
97
|
+ required: true,
|
|
|
98
|
+ message: '请输入内容',
|
|
|
99
|
+ trigger: ['blur', 'change']
|
|
118
|
100
|
},
|
|
119
|
|
- }
|
|
120
|
|
- },
|
|
121
|
|
- methods: {
|
|
122
|
|
- initFormFromStore() {
|
|
123
|
|
- const storeFormData = this.storeForm;
|
|
124
|
|
- this.form = {
|
|
125
|
|
- ...this.form,
|
|
126
|
|
- caller: storeFormData.caller || '',
|
|
127
|
|
- callee: storeFormData.callee || '',
|
|
128
|
|
- fileUrl: storeFormData.fileUrl,
|
|
129
|
|
- fileName: storeFormData.fileName,
|
|
130
|
|
- remark: storeFormData.remark,
|
|
131
|
|
- type: storeFormData.type,
|
|
132
|
|
- list: storeFormData.list
|
|
133
|
|
- };
|
|
134
|
|
-
|
|
135
|
|
- uni.$u.api.getClueMainInfoById({id : this.form.clueId}).then(({data})=>{
|
|
136
|
|
- this.clueDetail = data;
|
|
137
|
|
- })
|
|
138
|
|
-
|
|
139
|
|
- if(!this.form.callee){
|
|
140
|
|
- // 没有准备被叫号码 直接去查线索的telephone
|
|
141
|
|
- this.form.callee = this.clueDetail.telephone;
|
|
142
|
|
- };
|
|
143
|
|
- if(!this.form.caller){
|
|
144
|
|
- // 没有准备主叫号码 直接去尝试获取
|
|
145
|
|
- this.$store.dispatch("call/getUserPhoneNumber").then(phone=>{
|
|
146
|
|
- this.form.caller = phone;
|
|
147
|
|
- })
|
|
148
|
|
- }
|
|
149
|
|
- if(storeFormData.fileUrl){
|
|
150
|
|
- // 初始化带了fileUrl 说明是从监听那边跳转的
|
|
151
|
|
- this.handleFileChange({ filePath : storeFormData.fileUrl , fileName : storeFormData.fileName });
|
|
152
|
|
- }
|
|
153
|
|
- this.$store.dispatch("call/resetForm");
|
|
154
|
101
|
},
|
|
155
|
|
-
|
|
156
|
|
- handleFileChange(file){
|
|
157
|
|
- // {
|
|
158
|
|
- // "filePath": "/storage/emulated/0/Recordings/Record/Call/15099989786 2025-11-11 09-41-57.m4a",
|
|
159
|
|
- // "fileName": "15099989786 2025-11-11 09-41-57.m4a"
|
|
160
|
|
- // }
|
|
161
|
|
-
|
|
162
|
|
- const {filePath , fileName} = file;
|
|
163
|
|
-
|
|
164
|
|
- // 显示确认对话框
|
|
165
|
|
- this.selectedFile = { filePath, fileName };
|
|
166
|
|
- this.showConfirmDialog = true;
|
|
|
102
|
+ form: {
|
|
|
103
|
+ clueId: undefined,
|
|
|
104
|
+ remark: '',
|
|
|
105
|
+ fileUrl: undefined,
|
|
|
106
|
+ fileName: undefined,
|
|
|
107
|
+ type: '3',
|
|
|
108
|
+ list: [],
|
|
|
109
|
+ caller: '',
|
|
|
110
|
+ callee: ''
|
|
167
|
111
|
},
|
|
168
|
|
-
|
|
169
|
|
- // 取消确认
|
|
170
|
|
- cancelConfirm() {
|
|
171
|
|
- this.showConfirmDialog = false;
|
|
172
|
|
- this.selectedFile = { filePath: '', fileName: '' };
|
|
173
|
|
- this.form.fileUrl = undefined;
|
|
174
|
|
- this.form.fileName = undefined;
|
|
175
|
|
- },
|
|
176
|
|
-
|
|
177
|
|
- // 确认上传
|
|
178
|
|
- async confirmUpload() {
|
|
179
|
|
- try {
|
|
180
|
|
- // 调用上传接口
|
|
181
|
|
- const result = await uni.$u.api.uploadFile(this.selectedFile.filePath);
|
|
182
|
|
- if (result && result.data) {
|
|
183
|
|
- result.data.remark = this.form.remark;
|
|
184
|
|
- result.data.fileName = result.data.name;
|
|
185
|
|
- result.data.fileUrl = result.data.url;
|
|
186
|
|
- this.form.list = [result.data];
|
|
187
|
|
- }
|
|
188
|
|
- // 设置表单值
|
|
189
|
|
- this.form.fileUrl = this.selectedFile.filePath;
|
|
190
|
|
- this.form.fileName = this.selectedFile.fileName;
|
|
191
|
|
-
|
|
192
|
|
- // 关闭对话框
|
|
193
|
|
- this.showConfirmDialog = false;
|
|
194
|
|
- } catch (error) {
|
|
195
|
|
- uni.hideLoading();
|
|
196
|
|
- console.error('上传失败:', error);
|
|
197
|
|
- uni.$u.toast('上传失败,请重试');
|
|
198
|
|
- }
|
|
|
112
|
+ clueDetail: {},
|
|
|
113
|
+ // 对话框相关状态
|
|
|
114
|
+ showConfirmDialog: false,
|
|
|
115
|
+ selectedFile: {
|
|
|
116
|
+ filePath: '',
|
|
|
117
|
+ fileName: ''
|
|
199
|
118
|
},
|
|
200
|
|
-
|
|
201
|
|
- handleNavSaveClick() {
|
|
202
|
|
- if(!this.form.clueId){
|
|
203
|
|
- uni.$u.toast("相关线索id为空");
|
|
204
|
|
- }
|
|
205
|
|
- this.$refs.form.validate().then(async () => {
|
|
206
|
|
- await uni.$u.api.saveClueFile(this.form);
|
|
207
|
|
- uni.$u.toast("保存成功");
|
|
208
|
|
- this.timer = setTimeout(() => {
|
|
209
|
|
- uni.$emit('uploadRecordSuccess');
|
|
210
|
|
- uni.navigateBack();
|
|
211
|
|
- clearTimeout(this.timer);
|
|
212
|
|
- }, 1000)
|
|
|
119
|
+ }
|
|
|
120
|
+ },
|
|
|
121
|
+ methods: {
|
|
|
122
|
+ initFormFromStore() {
|
|
|
123
|
+ const storeFormData = this.storeForm;
|
|
|
124
|
+ this.form = {
|
|
|
125
|
+ ...this.form,
|
|
|
126
|
+ caller: storeFormData.caller || '',
|
|
|
127
|
+ callee: storeFormData.callee || '',
|
|
|
128
|
+ fileUrl: storeFormData.fileUrl,
|
|
|
129
|
+ fileName: storeFormData.fileName,
|
|
|
130
|
+ remark: storeFormData.remark,
|
|
|
131
|
+ type: storeFormData.type,
|
|
|
132
|
+ list: storeFormData.list
|
|
|
133
|
+ };
|
|
|
134
|
+
|
|
|
135
|
+ uni.$u.api.getClueMainInfoById({ id: this.form.clueId }).then(({ data }) => {
|
|
|
136
|
+ this.clueDetail = data;
|
|
|
137
|
+ })
|
|
|
138
|
+
|
|
|
139
|
+ if (!this.form.callee) {
|
|
|
140
|
+ // 没有准备被叫号码 直接去查线索的telephone
|
|
|
141
|
+ this.form.callee = this.clueDetail.telephone;
|
|
|
142
|
+ };
|
|
|
143
|
+ if (!this.form.caller) {
|
|
|
144
|
+ // 没有准备主叫号码 直接去尝试获取
|
|
|
145
|
+ this.$store.dispatch("call/getUserPhoneNumber").then(phone => {
|
|
|
146
|
+ this.form.caller = phone;
|
|
213
|
147
|
})
|
|
214
|
|
- },
|
|
|
148
|
+ }
|
|
|
149
|
+ if (storeFormData.fileUrl) {
|
|
|
150
|
+ // 初始化带了fileUrl 说明是从监听那边跳转的
|
|
|
151
|
+ this.handleFileChange({ filePath: storeFormData.fileUrl, fileName: storeFormData.fileName });
|
|
|
152
|
+ }
|
|
|
153
|
+ this.$store.dispatch("call/resetForm");
|
|
215
|
154
|
},
|
|
216
|
|
- onLoad(option) {
|
|
217
|
|
- this.$store.dispatch("call/getFileList");
|
|
218
|
|
- this.form.clueId = option.clueId;
|
|
219
|
|
- this.initFormFromStore();
|
|
|
155
|
+
|
|
|
156
|
+ handleFileChange(file) {
|
|
|
157
|
+ // {
|
|
|
158
|
+ // "filePath": "/storage/emulated/0/Recordings/Record/Call/15099989786 2025-11-11 09-41-57.m4a",
|
|
|
159
|
+ // "fileName": "15099989786 2025-11-11 09-41-57.m4a"
|
|
|
160
|
+ // }
|
|
|
161
|
+
|
|
|
162
|
+ const { filePath, fileName } = file;
|
|
|
163
|
+
|
|
|
164
|
+ // 显示确认对话框
|
|
|
165
|
+ this.selectedFile = { filePath, fileName };
|
|
|
166
|
+ this.showConfirmDialog = true;
|
|
220
|
167
|
},
|
|
221
|
|
- }
|
|
|
168
|
+
|
|
|
169
|
+ // 取消确认
|
|
|
170
|
+ cancelConfirm() {
|
|
|
171
|
+ this.showConfirmDialog = false;
|
|
|
172
|
+ this.selectedFile = { filePath: '', fileName: '' };
|
|
|
173
|
+ this.form.fileUrl = undefined;
|
|
|
174
|
+ this.form.fileName = undefined;
|
|
|
175
|
+ },
|
|
|
176
|
+
|
|
|
177
|
+ // 确认上传
|
|
|
178
|
+ async confirmUpload() {
|
|
|
179
|
+ try {
|
|
|
180
|
+ // 调用上传接口
|
|
|
181
|
+ const result = await uni.$u.api.uploadFile(this.selectedFile.filePath);
|
|
|
182
|
+ if (result && result.data) {
|
|
|
183
|
+ result.data.remark = this.form.remark;
|
|
|
184
|
+ result.data.fileName = result.data.name;
|
|
|
185
|
+ result.data.fileUrl = result.data.url;
|
|
|
186
|
+ this.form.list = [result.data];
|
|
|
187
|
+ }
|
|
|
188
|
+ // 设置表单值
|
|
|
189
|
+ this.form.fileUrl = this.selectedFile.filePath;
|
|
|
190
|
+ this.form.fileName = this.selectedFile.fileName;
|
|
|
191
|
+
|
|
|
192
|
+ // 关闭对话框
|
|
|
193
|
+ this.showConfirmDialog = false;
|
|
|
194
|
+ } catch (error) {
|
|
|
195
|
+ uni.hideLoading();
|
|
|
196
|
+ console.error('上传失败:', error);
|
|
|
197
|
+ uni.$u.toast('上传失败,请重试');
|
|
|
198
|
+ }
|
|
|
199
|
+ },
|
|
|
200
|
+
|
|
|
201
|
+ handleNavSaveClick() {
|
|
|
202
|
+ if (!this.form.clueId) {
|
|
|
203
|
+ uni.$u.toast("相关线索id为空");
|
|
|
204
|
+ }
|
|
|
205
|
+ this.$refs.form.validate().then(async () => {
|
|
|
206
|
+ await uni.$u.api.saveClueFile(this.form);
|
|
|
207
|
+ uni.$u.toast("保存成功");
|
|
|
208
|
+ this.timer = setTimeout(() => {
|
|
|
209
|
+ uni.$emit('uploadRecordSuccess');
|
|
|
210
|
+ uni.navigateBack();
|
|
|
211
|
+ clearTimeout(this.timer);
|
|
|
212
|
+ }, 1000)
|
|
|
213
|
+ })
|
|
|
214
|
+ },
|
|
|
215
|
+ },
|
|
|
216
|
+ onLoad(option) {
|
|
|
217
|
+ this.$store.dispatch("call/getFileList");
|
|
|
218
|
+ this.form.clueId = option.clueId;
|
|
|
219
|
+ this.initFormFromStore();
|
|
|
220
|
+ },
|
|
|
221
|
+}
|
|
222
|
222
|
</script>
|
|
223
|
223
|
|
|
224
|
224
|
<style lang="scss" scoped>
|
|
225
|
|
- .form_wrap {
|
|
226
|
|
- background-color: #fff;
|
|
227
|
|
- margin: 20rpx 0;
|
|
|
225
|
+.form_wrap {
|
|
|
226
|
+ background-color: #fff;
|
|
|
227
|
+ margin: 20rpx 0;
|
|
228
|
228
|
|
|
229
|
|
- .form_wrap {
|
|
230
|
|
- ::v-deep .u-form-item__body {
|
|
231
|
|
- padding: 20rpx 40rpx;
|
|
232
|
|
- }
|
|
|
229
|
+ .form_wrap {
|
|
|
230
|
+ ::v-deep .u-form-item__body {
|
|
|
231
|
+ padding: 20rpx 40rpx;
|
|
233
|
232
|
}
|
|
234
|
233
|
}
|
|
235
|
|
-
|
|
236
|
|
- /* 录音确认对话框样式 */
|
|
237
|
|
- .confirm-dialog {
|
|
238
|
|
- padding: 40rpx;
|
|
239
|
|
- min-width: 500rpx;
|
|
240
|
|
- background: #fff;
|
|
241
|
|
- border-radius: 20rpx;
|
|
242
|
|
-
|
|
243
|
|
- .dialog-title {
|
|
244
|
|
- text-align: center;
|
|
245
|
|
- font-size: 32rpx;
|
|
246
|
|
- font-weight: bold;
|
|
247
|
|
- color: #333;
|
|
248
|
|
- margin-bottom: 40rpx;
|
|
249
|
|
- }
|
|
250
|
|
-
|
|
251
|
|
- .dialog-content {
|
|
252
|
|
- margin-bottom: 40rpx;
|
|
253
|
|
-
|
|
254
|
|
- .file-info {
|
|
255
|
|
- margin-bottom: 30rpx;
|
|
256
|
|
-
|
|
257
|
|
- .file-name {
|
|
258
|
|
- background: #f5f5f5;
|
|
259
|
|
- padding: 20rpx;
|
|
260
|
|
- border-radius: 10rpx;
|
|
261
|
|
- font-size: 28rpx;
|
|
262
|
|
- color: #333;
|
|
263
|
|
- word-break: break-all;
|
|
264
|
|
- text-align: center;
|
|
265
|
|
- }
|
|
266
|
|
- }
|
|
267
|
|
-
|
|
268
|
|
- .play-section {
|
|
269
|
|
- .audio-player {
|
|
270
|
|
- width: 100%;
|
|
271
|
|
- }
|
|
|
234
|
+}
|
|
|
235
|
+
|
|
|
236
|
+/* 录音确认对话框样式 */
|
|
|
237
|
+.confirm-dialog {
|
|
|
238
|
+ padding: 40rpx;
|
|
|
239
|
+ min-width: 500rpx;
|
|
|
240
|
+ background: #fff;
|
|
|
241
|
+ border-radius: 20rpx;
|
|
|
242
|
+
|
|
|
243
|
+ .dialog-title {
|
|
|
244
|
+ text-align: center;
|
|
|
245
|
+ font-size: 32rpx;
|
|
|
246
|
+ font-weight: bold;
|
|
|
247
|
+ color: #333;
|
|
|
248
|
+ margin-bottom: 40rpx;
|
|
|
249
|
+ }
|
|
|
250
|
+
|
|
|
251
|
+ .dialog-content {
|
|
|
252
|
+ margin-bottom: 40rpx;
|
|
|
253
|
+
|
|
|
254
|
+ .file-info {
|
|
|
255
|
+ margin-bottom: 30rpx;
|
|
|
256
|
+
|
|
|
257
|
+ .file-name {
|
|
|
258
|
+ background: #f5f5f5;
|
|
|
259
|
+ padding: 20rpx;
|
|
|
260
|
+ border-radius: 10rpx;
|
|
|
261
|
+ font-size: 28rpx;
|
|
|
262
|
+ color: #333;
|
|
|
263
|
+ word-break: break-all;
|
|
|
264
|
+ text-align: center;
|
|
272
|
265
|
}
|
|
273
|
266
|
}
|
|
274
|
|
-
|
|
275
|
|
- .dialog-buttons {
|
|
276
|
|
- display: flex;
|
|
277
|
|
- gap: 30rpx;
|
|
278
|
|
-
|
|
279
|
|
- ::v-deep .u-button {
|
|
280
|
|
- flex: 1;
|
|
|
267
|
+
|
|
|
268
|
+ .play-section {
|
|
|
269
|
+ .audio-player {
|
|
|
270
|
+ width: 100%;
|
|
281
|
271
|
}
|
|
282
|
272
|
}
|
|
283
|
273
|
}
|
|
|
274
|
+
|
|
|
275
|
+ .dialog-buttons {
|
|
|
276
|
+ display: flex;
|
|
|
277
|
+ gap: 30rpx;
|
|
|
278
|
+
|
|
|
279
|
+ ::v-deep .u-button {
|
|
|
280
|
+ flex: 1;
|
|
|
281
|
+ }
|
|
|
282
|
+ }
|
|
|
283
|
+}
|
|
284
|
284
|
</style>
|