|
@@ -140,7 +140,7 @@ import chat from '@c/chat.vue';
|
|
import _ from 'lodash';
|
|
import _ from 'lodash';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
const { mapActions: personRoom } = createNamespacedHelpers('personRoom');
|
|
const { mapActions: personRoom } = createNamespacedHelpers('personRoom');
|
|
-const { mapActions: transaction } = createNamespacedHelpers('transaction');
|
|
|
|
|
|
+const { mapActions: dockTranscation } = createNamespacedHelpers('dockTranscation');
|
|
export default {
|
|
export default {
|
|
name: 'techolInfo',
|
|
name: 'techolInfo',
|
|
props: {
|
|
props: {
|
|
@@ -162,7 +162,7 @@ export default {
|
|
created() {},
|
|
created() {},
|
|
methods: {
|
|
methods: {
|
|
...personRoom(['create']),
|
|
...personRoom(['create']),
|
|
- ...transaction({ getTran: 'query', createTran: 'create' }),
|
|
|
|
|
|
+ ...dockTranscation({ tranCreate: 'create' }),
|
|
async btnPhone() {
|
|
async btnPhone() {
|
|
if (!this.room.id) {
|
|
if (!this.room.id) {
|
|
//TODO 请求房间号
|
|
//TODO 请求房间号
|
|
@@ -195,28 +195,25 @@ export default {
|
|
},
|
|
},
|
|
//供求对接
|
|
//供求对接
|
|
async onSubmit() {
|
|
async onSubmit() {
|
|
- const data = _.cloneDeep(this.form);
|
|
|
|
- const obj = {
|
|
|
|
- dock_id: this.dock_id,
|
|
|
|
- supplier: _.get(data, 'user_id'),
|
|
|
|
- s_name: _.get(data, 'contacts'),
|
|
|
|
- s_phone: _.get(data, 'phone'),
|
|
|
|
- product_id: _.get(data, 'id'),
|
|
|
|
- product: _.get(data, 'name'),
|
|
|
|
- demander: _.get(this.user, 'id'),
|
|
|
|
- d_name: _.get(this.user, 'name'),
|
|
|
|
- d_phone: _.get(this.user, 'phone'),
|
|
|
|
- };
|
|
|
|
- if (obj.demander === obj.supplier) {
|
|
|
|
- this.$message.error('您不能对自己的成果进行对接!');
|
|
|
|
|
|
+ let data = { dock_id: this.dock_id, product_id: this.form.id, s_id: this.form.user_id, s_name: this.form.company, s_phone: this.form.phone };
|
|
|
|
+ if (!_.get(this.user, 'id')) {
|
|
|
|
+ this.$message({
|
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
|
+ message: '<strong><a href="http://broadcast.waityou24.cn/live/login" style="color:red;">游客身份无法与专家进行对接,请先注册</a></strong>',
|
|
|
|
+ type: 'error',
|
|
|
|
+ });
|
|
return;
|
|
return;
|
|
|
|
+ } else {
|
|
|
|
+ // 需求者信息
|
|
|
|
+ data.d_id = this.user.id;
|
|
|
|
+ data.d_name = this.user.name;
|
|
|
|
+ data.d_phone = this.user.phone;
|
|
}
|
|
}
|
|
- const list = await this.getTran({ product_id: obj.product_id, demander: obj.demander, dock_id: this.dock_id });
|
|
|
|
- if (list.total > 0) {
|
|
|
|
- this.$message.warning('您已申请供求对接,无需再次申请!');
|
|
|
|
|
|
+ if (data.d_id === data.s_id) {
|
|
|
|
+ this.$message.error('您不能对自己进行对接!');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- const res = await this.createTran(obj);
|
|
|
|
|
|
+ const res = await this.tranCreate(data);
|
|
this.$checkRes(res, '对接成功', res.errmsg || '对接失败');
|
|
this.$checkRes(res, '对接成功', res.errmsg || '对接失败');
|
|
},
|
|
},
|
|
// 隐藏手机号
|
|
// 隐藏手机号
|