wuhongyu 5 năm trước cách đây
mục cha
commit
76b96a1530

+ 7 - 2
src/layout/enterprise/enterprise.vue

@@ -21,7 +21,7 @@
               </el-table-column>
               <el-table-column prop="state" label="状态" align="center">
                 <template v-slot="scoped">
-                  {{ `${scoped.row.status}` === `0` ? '未审核' : `${scoped.row.status}` === `1` ? '已经审核' : '交易完成' }}
+                  {{ `${scoped.row.status}` === `0` ? '审核中' : `${scoped.row.status}` === `1` ? '审核通过' : '审核拒绝' }}
                 </template>
               </el-table-column>
               <el-table-column label="操作" align="center">
@@ -29,7 +29,9 @@
                   <el-tooltip content="审核通过" placement="bottom" effect="light">
                     <el-button type="text" size="small" @click="handleEdit(scoped.row)"><i class="el-icon-share"></i></el-button>
                   </el-tooltip>
-
+                  <el-tooltip content="审核拒绝" placement="bottom" effect="light">
+                    <el-button type="text" size="small" @click="handleshibai(scoped.row)"><i class="el-icon-share"></i></el-button>
+                  </el-tooltip>
                   <el-tooltip content="删除" placement="bottom" effect="light">
                     <el-button type="text" size="small" @click="handleDelete(scoped.row)"><i class="el-icon-delete"></i></el-button>
                   </el-tooltip>
@@ -78,6 +80,9 @@ export default {
     handleEdit(row) {
       this.$emit('edit', { data: row });
     },
+    handleshibai(row) {
+      this.$emit('shibai', { data: row });
+    },
     handleSizeChange(val) {
       console.log(`每页 ${val} 条`);
     },

+ 60 - 0
src/layout/enterprise/jiaoyidetail.vue

@@ -0,0 +1,60 @@
+<template>
+  <div id="columnDetail">
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="24" class="top">
+          <el-col :span="12" class="topTitle"> </el-col>
+          <el-col :span="12" class="topBtn"> </el-col>
+        </el-col>
+        <el-col :span="24" class="messgae">
+          <el-form ref="form" :model="form" label-width="120px">
+            <el-form-item label="审核">
+              <el-radio-group v-model="form.status">
+                <el-radio :label="2" name="2">交易成功</el-radio>
+                <el-radio :label="3" name="3">交易取消</el-radio>
+              </el-radio-group>
+            </el-form-item>
+
+            <el-form-item>
+              <el-button type="primary" @click="onSubmit(form)">提交</el-button>
+            </el-form-item>
+          </el-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'columnDetail',
+  props: {
+    form: null,
+  },
+  components: {},
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {
+    onSubmit() {
+      this.$emit('submitDate', { data: this.form, id: this.form.id });
+    },
+    returnBtn() {
+      this.$router.push({ path: '/personnel/column' });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.top {
+  padding: 15px 0;
+}
+.top .topTitle {
+  text-align: left;
+}
+.top .topBtn {
+  text-align: right;
+  padding: 0 5px;
+}
+</style>

+ 18 - 0
src/layout/enterprise/transaction.vue

@@ -32,6 +32,24 @@
                 <template slot-scope="scoped">
                   <el-tooltip content="审核" placement="bottom" effect="light">
                     <el-button
+                      v-if="scoped.row.status == 1"
+                      type="text"
+                      size="small"
+                      @click="
+                        $router.push({
+                          path: '/enterprise/jiaoyidetail',
+                          query: {
+                            id: scoped.row.id,
+                          },
+                        })
+                      "
+                      ><i class="el-icon-edit"></i
+                    ></el-button>
+                  </el-tooltip>
+
+                  <el-tooltip content="发起交易" placement="bottom" effect="light">
+                    <el-button
+                      v-if="scoped.row.status == 0"
                       type="text"
                       size="small"
                       @click="

+ 7 - 1
src/router/index.js

@@ -137,11 +137,17 @@ const routes = [
     component: () => import('../views/enterprise/transaction.vue'),
   },
 
-  //科技超市交易审核详情
+  //科技超市发起交易审核详情
   {
     path: '/enterprise/detail',
     component: () => import('../views/enterprise/detail.vue'),
   },
+
+  //科技超市交易审核管理
+  {
+    path: '/enterprise/jiaoyidetail',
+    component: () => import('../views/enterprise/jiaoyidetail.vue'),
+  },
   // 站点信息
   {
     path: '/site/index',

+ 17 - 1
src/views/enterprise/index.vue

@@ -5,7 +5,14 @@
         <topInfo :topTitle="topTitle"></topInfo>
       </el-col>
       <el-col :span="24" class="main">
-        <enterprise :recruitInfo="recruitInfo" :total="total" @handleCurrentChange="handleCurrentChange" @delete="deleteData" @edit="edit"></enterprise>
+        <enterprise
+          :recruitInfo="recruitInfo"
+          :total="total"
+          @handleCurrentChange="handleCurrentChange"
+          @delete="deleteData"
+          @edit="edit"
+          @shibai="shibai"
+        ></enterprise>
       </el-col>
     </el-row>
   </div>
@@ -54,6 +61,15 @@ export default {
       this.$checkRes(res, '审核成功', '审核失败');
       console.log(data);
     },
+
+    async shibai({ data }) {
+      console.log('a');
+      data.status = '2';
+      let res = await this.update(data);
+      this.$checkRes(res, '审核成功', '审核失败');
+      console.log(data);
+    },
+
     async handleCurrentChange({ skip, limit, currentPage }) {
       this.$set(this, `skip`, skip);
       this.search();

+ 82 - 0
src/views/enterprise/jiaoyidetail.vue

@@ -0,0 +1,82 @@
+<template>
+  <div id="columnDetail">
+    <el-row>
+      <el-col :span="24" class="top">
+        <topInfo :topTitle="topTitle"></topInfo>
+      </el-col>
+      <el-col :span="24" class="main">
+        <jiaoyidetail :form="form" @submitDate="onSubmit"></jiaoyidetail>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import topInfo from '@/layout/public/top.vue';
+import jiaoyidetail from '@/layout/enterprise/jiaoyidetail.vue';
+import { createNamespacedHelpers, mapState } from 'vuex';
+const { mapActions: transaction } = createNamespacedHelpers('transaction');
+export default {
+  name: 'columnDetail',
+  props: {},
+  components: {
+    jiaoyidetail,
+    topInfo,
+  },
+  data: () => ({
+    topTitle: '交易',
+    form: {},
+    xinxi: {},
+  }),
+  created() {
+    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: {
+    ...transaction({ transactionsfetch: 'fetch', transactionslist: 'query', transactionupdate: 'update' }),
+    async search() {
+      let transaction_id = this.id;
+      const res = await this.transactionsfetch(transaction_id);
+      console.log(res.data);
+      this.$set(this, `form`, res.data);
+    },
+    async onSubmit({ data }) {
+      console.log(data);
+      console.log(data.status);
+
+      let res = await this.transactionupdate(data);
+      this.$checkRes(res, '审核成功', '审核失败');
+      this.$router.push({ path: '/enterprise/transaction' });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  padding: 20px;
+  margin: 10px 20px;
+  border: 1px solid #ccc;
+  width: 96%;
+}
+</style>