|
@@ -169,31 +169,22 @@ export default {
|
|
if (value == 'content') {
|
|
if (value == 'content') {
|
|
// 文字消息
|
|
// 文字消息
|
|
form.msg_type = '0';
|
|
form.msg_type = '0';
|
|
- if (this.form.content) {
|
|
|
|
- form.content = this.form.content;
|
|
|
|
- let res = await this.create(form);
|
|
|
|
- if (this.$checkRes(res, '发送成功', '发送失败')) {
|
|
|
|
- let data = { _id: res.data.room, customer: this.customer, shop: this.shop };
|
|
|
|
- this.toClose();
|
|
|
|
- this.search();
|
|
|
|
- if (this.customer_id == this.customer._id) this.searchDetail();
|
|
|
|
- else this.toView(data);
|
|
|
|
- }
|
|
|
|
- } else this.$message({ type: `warning`, message: `请输入要发送的消息` });
|
|
|
|
|
|
+ if (this.form.content) form.content = this.form.content;
|
|
|
|
+ else this.$message({ type: `warning`, message: `请输入要发送的消息` });
|
|
} else if (value == 'file') {
|
|
} else if (value == 'file') {
|
|
// 图片消息
|
|
// 图片消息
|
|
form.msg_type = '1';
|
|
form.msg_type = '1';
|
|
if (this.file.length == 0) this.$message({ type: `warning`, message: `请选择要发送的图片` });
|
|
if (this.file.length == 0) this.$message({ type: `warning`, message: `请选择要发送的图片` });
|
|
- else {
|
|
|
|
- form.content = this.file[0].url;
|
|
|
|
- let res = await this.create(form);
|
|
|
|
- if (this.$checkRes(res, '发送成功', '发送失败')) {
|
|
|
|
- let data = { _id: res.data.room, customer: this.customer, shop: this.shop };
|
|
|
|
- this.toClose();
|
|
|
|
- this.search();
|
|
|
|
- if (this.customer_id == this.customer._id) this.searchDetail();
|
|
|
|
- else this.toView(data);
|
|
|
|
- }
|
|
|
|
|
|
+ else form.content = this.file[0].url;
|
|
|
|
+ }
|
|
|
|
+ if (form.content) {
|
|
|
|
+ let res = await this.create(form);
|
|
|
|
+ if (this.$checkRes(res, '发送成功', '发送失败')) {
|
|
|
|
+ let data = { _id: res.data.room, customer: this.customer, shop: this.shop };
|
|
|
|
+ this.toClose();
|
|
|
|
+ this.search();
|
|
|
|
+ if (this.customer_id == this.customer._id) this.searchDetail();
|
|
|
|
+ else this.toView(data);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|