|
@@ -181,7 +181,7 @@ import chat from '@c/chat.vue';
|
|
|
import _ from 'lodash';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions: personRoom } = createNamespacedHelpers('personRoom');
|
|
|
-const { mapActions: transaction } = createNamespacedHelpers('transaction');
|
|
|
+const { mapActions: dockTranscation } = createNamespacedHelpers('dockTranscation');
|
|
|
export default {
|
|
|
name: 'achieveInfo',
|
|
|
props: {
|
|
@@ -199,7 +199,7 @@ export default {
|
|
|
created() {},
|
|
|
methods: {
|
|
|
...personRoom(['create']),
|
|
|
- ...transaction({ getTran: 'query', createTran: 'create' }),
|
|
|
+ ...dockTranscation({ tranCreate: 'create' }),
|
|
|
async btnPhone() {
|
|
|
if (!this.room.id) {
|
|
|
//TODO 请求房间号
|
|
@@ -232,29 +232,30 @@ export default {
|
|
|
},
|
|
|
//供求对接
|
|
|
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('您不能对自己的成果进行对接!');
|
|
|
- return;
|
|
|
- }
|
|
|
- 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('您已申请供求对接,无需再次申请!');
|
|
|
- return;
|
|
|
- }
|
|
|
- const res = await this.createTran(obj);
|
|
|
- this.$checkRes(res, '对接成功', res.errmsg || '对接失败');
|
|
|
+ console.log(this.user);
|
|
|
+ // 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('您不能对自己的成果进行对接!');
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // 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('您已申请供求对接,无需再次申请!');
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // const res = await this.tranCreate(obj);
|
|
|
+ // this.$checkRes(res, '对接成功', res.errmsg || '对接失败');
|
|
|
},
|
|
|
},
|
|
|
computed: {
|