|
@@ -1,11 +1,11 @@
|
|
<template>
|
|
<template>
|
|
- <div id="columnDetail">
|
|
|
|
|
|
+ <div id="detail">
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="24" class="top">
|
|
<el-col :span="24" class="top">
|
|
- <topInfo :topTitle="topTitle"></topInfo>
|
|
|
|
|
|
+ <topInfo :topTitle="pageTitle"></topInfo>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24" class="main">
|
|
<el-col :span="24" class="main">
|
|
- <detail :form="form" @submitDate="onSubmit"></detail>
|
|
|
|
|
|
+ <detailInfo :form="form" @submitDate="onSubmit"></detailInfo>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
@@ -13,86 +13,59 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import topInfo from '@/layout/public/top.vue';
|
|
import topInfo from '@/layout/public/top.vue';
|
|
-import detail from '@/layout/enterpriseTrans/detail.vue';
|
|
|
|
|
|
+import detailInfo from '@/layout/enterpriseTrans/detail.vue';
|
|
import { createNamespacedHelpers, mapState } from 'vuex';
|
|
import { createNamespacedHelpers, mapState } from 'vuex';
|
|
-const { mapActions: tranaudit } = createNamespacedHelpers('tranaudit');
|
|
|
|
|
|
+const { mapActions: productpact } = createNamespacedHelpers('productpact');
|
|
const { mapActions: transaction } = createNamespacedHelpers('transaction');
|
|
const { mapActions: transaction } = createNamespacedHelpers('transaction');
|
|
-
|
|
|
|
export default {
|
|
export default {
|
|
- name: 'columnDetail',
|
|
|
|
|
|
+ name: 'detail',
|
|
props: {},
|
|
props: {},
|
|
components: {
|
|
components: {
|
|
- detail,
|
|
|
|
|
|
+ detailInfo,
|
|
topInfo,
|
|
topInfo,
|
|
},
|
|
},
|
|
data: () => ({
|
|
data: () => ({
|
|
- topTitle: '审核',
|
|
|
|
form: {},
|
|
form: {},
|
|
- acc: {},
|
|
|
|
- xinxi: {},
|
|
|
|
}),
|
|
}),
|
|
created() {
|
|
created() {
|
|
this.search();
|
|
this.search();
|
|
},
|
|
},
|
|
- computed: {
|
|
|
|
- ...mapState(['user']),
|
|
|
|
-
|
|
|
|
- id() {
|
|
|
|
- return this.$route.query.id;
|
|
|
|
- },
|
|
|
|
- oneid() {
|
|
|
|
- return this.$route.query.oneid;
|
|
|
|
- },
|
|
|
|
- twoid() {
|
|
|
|
- return this.$route.query.twoid;
|
|
|
|
- },
|
|
|
|
- name() {
|
|
|
|
- return this.$route.query.name;
|
|
|
|
- },
|
|
|
|
- keyWord() {
|
|
|
|
- let meta = this.$route.meta;
|
|
|
|
- let main = meta.title || '';
|
|
|
|
- return main;
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
methods: {
|
|
methods: {
|
|
- ...tranaudit(['fetch', 'create', 'update', 'query']),
|
|
|
|
...transaction({ transactionsfetch: 'fetch', transactionslist: 'query', transactionupdate: 'update' }),
|
|
...transaction({ transactionsfetch: 'fetch', transactionslist: 'query', transactionupdate: 'update' }),
|
|
|
|
+ ...productpact({ transactionQuery: 'query', productpactFetch: 'findpact', productpactUpdate: 'update' }),
|
|
async search() {
|
|
async search() {
|
|
- console.log(this.id);
|
|
|
|
- console.log(this.oneid);
|
|
|
|
- console.log(this.twoid);
|
|
|
|
- console.log(this.name);
|
|
|
|
- let transaction_id = this.id;
|
|
|
|
- const ress = await this.transactionsfetch(transaction_id);
|
|
|
|
- console.log(ress.data);
|
|
|
|
- this.$set(this, `form`, ress.data);
|
|
|
|
- this.$set(this, `xinxi`, ress.data);
|
|
|
|
|
|
+ const res = await this.productpactFetch(this.id);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `form`, res.data);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
async onSubmit() {
|
|
async onSubmit() {
|
|
- let acc = {};
|
|
|
|
- acc.username = this.oneid;
|
|
|
|
- acc.market_username = this.twoid;
|
|
|
|
- acc.product_name = this.name;
|
|
|
|
- acc.transaction_id = this.id;
|
|
|
|
- acc.id = this.id;
|
|
|
|
- acc.userid = this.user.uid;
|
|
|
|
- acc.result = this.form.result;
|
|
|
|
- acc.description = this.form.description;
|
|
|
|
- console.log(acc);
|
|
|
|
- if (this.form.result == '1') {
|
|
|
|
- this.xinxi.status = '1';
|
|
|
|
- console.log(this.xinxi);
|
|
|
|
- let res = await this.transactionupdate(this.xinxi);
|
|
|
|
- this.$checkRes(res, '审核成功', '审核失败');
|
|
|
|
- } else if (this.form.result == '2') {
|
|
|
|
- this.xinxi.status = '3';
|
|
|
|
- let res = await this.transactionupdate(this.xinxi);
|
|
|
|
- this.$checkRes(res, '审核成功', '审核失败');
|
|
|
|
|
|
+ const res = await this.productpactUpdate(this.form);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.form.status = '2';
|
|
|
|
+ this.form.id = this.form.transaction_id;
|
|
|
|
+ const arr = await this.transactionupdate(this.form);
|
|
|
|
+ if (this.$checkRes(arr)) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '审核通过',
|
|
|
|
+ type: 'success',
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- this.$router.push({ path: '/enterprise/transaction' });
|
|
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapState(['user']),
|
|
|
|
+ id() {
|
|
|
|
+ return this.$route.query.id;
|
|
|
|
+ },
|
|
|
|
+ pageTitle() {
|
|
|
|
+ return `${this.$route.meta.title}`;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ metaInfo() {
|
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
|
+ },
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|