detail.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <div id="columnDetail">
  3. <el-row>
  4. <el-col :span="24" class="top">
  5. <topInfo :topTitle="topTitle"></topInfo>
  6. </el-col>
  7. <el-col :span="24" class="main">
  8. <detail :form="form" @submitDate="onSubmit"></detail>
  9. </el-col>
  10. </el-row>
  11. </div>
  12. </template>
  13. <script>
  14. import topInfo from '@/layout/public/top.vue';
  15. import detail from '@/layout/enterpriseTrans/detail.vue';
  16. import { createNamespacedHelpers, mapState } from 'vuex';
  17. const { mapActions: tranaudit } = createNamespacedHelpers('tranaudit');
  18. const { mapActions: transaction } = createNamespacedHelpers('transaction');
  19. export default {
  20. name: 'columnDetail',
  21. props: {},
  22. components: {
  23. detail,
  24. topInfo,
  25. },
  26. data: () => ({
  27. topTitle: '审核',
  28. form: {},
  29. acc: {},
  30. xinxi: {},
  31. }),
  32. created() {
  33. this.search();
  34. },
  35. computed: {
  36. ...mapState(['user']),
  37. id() {
  38. return this.$route.query.id;
  39. },
  40. oneid() {
  41. return this.$route.query.oneid;
  42. },
  43. twoid() {
  44. return this.$route.query.twoid;
  45. },
  46. name() {
  47. return this.$route.query.name;
  48. },
  49. keyWord() {
  50. let meta = this.$route.meta;
  51. let main = meta.title || '';
  52. return main;
  53. },
  54. },
  55. methods: {
  56. ...tranaudit(['fetch', 'create', 'update', 'query']),
  57. ...transaction({ transactionsfetch: 'fetch', transactionslist: 'query', transactionupdate: 'update' }),
  58. async search() {
  59. console.log(this.id);
  60. console.log(this.oneid);
  61. console.log(this.twoid);
  62. console.log(this.name);
  63. let transaction_id = this.id;
  64. const ress = await this.transactionsfetch(transaction_id);
  65. console.log(ress.data);
  66. this.$set(this, `form`, ress.data);
  67. this.$set(this, `xinxi`, ress.data);
  68. },
  69. async onSubmit() {
  70. let acc = {};
  71. acc.username = this.oneid;
  72. acc.market_username = this.twoid;
  73. acc.product_name = this.name;
  74. acc.transaction_id = this.id;
  75. acc.id = this.id;
  76. acc.userid = this.user.uid;
  77. acc.result = this.form.result;
  78. acc.description = this.form.description;
  79. console.log(acc);
  80. if (this.form.result == '1') {
  81. this.xinxi.status = '1';
  82. console.log(this.xinxi);
  83. let res = await this.transactionupdate(this.xinxi);
  84. this.$checkRes(res, '审核成功', '审核失败');
  85. } else if (this.form.result == '2') {
  86. this.xinxi.status = '3';
  87. let res = await this.transactionupdate(this.xinxi);
  88. this.$checkRes(res, '审核成功', '审核失败');
  89. }
  90. this.$router.push({ path: '/enterprise/transaction' });
  91. },
  92. },
  93. };
  94. </script>
  95. <style lang="less" scoped>
  96. .main {
  97. padding: 20px;
  98. margin: 10px 20px;
  99. border: 1px solid #ccc;
  100. width: 96%;
  101. }
  102. </style>