guhongwei 4 éve
szülő
commit
832b3a87d4

+ 12 - 0
src/router/index.js

@@ -136,6 +136,18 @@ const routes = [
     meta: { title: '产品信息管理', isleftarrow: true },
     meta: { title: '产品信息管理', isleftarrow: true },
     component: () => import('../views/adminCenter/enterpriseProduct/detail.vue'),
     component: () => import('../views/adminCenter/enterpriseProduct/detail.vue'),
   },
   },
+  {
+    path: '/adminCenter/transaction/index',
+    name: 'adminCenter_transaction',
+    meta: { title: '交易审核管理', isleftarrow: true },
+    component: () => import('../views/adminCenter/transaction/index.vue'),
+  },
+  {
+    path: '/adminCenter/transaction/detail',
+    name: 'adminCenter_transaction',
+    meta: { title: '交易信息管理', isleftarrow: true },
+    component: () => import('../views/adminCenter/transaction/detail.vue'),
+  },
   // 登录
   // 登录
   {
   {
     path: '/login',
     path: '/login',

+ 8 - 0
src/store/index.js

@@ -10,6 +10,10 @@ import exportuser from './market/exportuser';
 import login from './user/login';
 import login from './user/login';
 // 个人中心
 // 个人中心
 import marketuser from './market/user';
 import marketuser from './market/user';
+// 交易审核
+import transaction from './market/transaction';
+// 交易记录
+import productpact from './market/productpact';
 // 公共
 // 公共
 import * as ustate from '@/store/common/state';
 import * as ustate from '@/store/common/state';
 import * as umutations from '@/store/common/mutations';
 import * as umutations from '@/store/common/mutations';
@@ -33,5 +37,9 @@ export default new Vuex.Store({
     login,
     login,
     // 个人中心
     // 个人中心
     marketuser,
     marketuser,
+    // 交易审核
+    transaction,
+    // 交易记录
+    productpact,
   },
   },
 });
 });

+ 49 - 0
src/store/market/productpact.js

@@ -0,0 +1,49 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  productpactInfo: `/api/market/productpact`,
+  findpactInfo: `/api/market/productpact/findpact`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(api.productpactInfo, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.productpactInfo}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.productpactInfo}/${payload}`);
+    return res;
+  },
+
+  async findpact({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.findpactInfo}/${payload}`);
+    return res;
+  },
+
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.productpactInfo}/update/${id}`, data);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.productpactInfo}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 42 - 0
src/store/market/transaction.js

@@ -0,0 +1,42 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  transactionInfo: `/api/market/transaction`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.transactionInfo}`, { skip, limit, ...info });
+    return res;
+  },
+  async productquery({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.transactionInfo}/findTransactionList`, payload);
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.transactionInfo}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.transactionInfo}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.transactionInfo}/update/${id}`, data);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.transactionInfo}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 51 - 38
src/views/adminCenter/transaction/detail.vue

@@ -1,12 +1,30 @@
 <template>
 <template>
-  <div id="index">
+  <div id="detail">
     <el-row>
     <el-row>
       <el-col :span="24" class="style">
       <el-col :span="24" class="style">
         <el-col :span="24" class="top">
         <el-col :span="24" class="top">
           <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
           <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
         </el-col>
         </el-col>
         <el-col :span="24" class="main">
         <el-col :span="24" class="main">
-          <detaliinfo :form="form" @onSubmit="onSubmit"></detaliinfo>
+          <van-form>
+            <van-field v-model="form.product_name" name="产品名称" label="产品名称" placeholder="产品名称" readonly />
+            <van-field v-model="form.market_username" name="营销人名称" label="营销人名称" placeholder="营销人名称" readonly />
+            <van-field v-model="form.username" name="购买人名称" label="购买人名称" placeholder="购买人名称" readonly />
+            <van-field v-model="form.description" rows="1" autosize label="描述" type="textarea" placeholder="描述" />
+            <van-field name="radio" label="状态">
+              <template #input>
+                <van-radio-group v-model="form.status" direction="horizontal">
+                  <van-radio name="0">待审核</van-radio>
+                  <van-radio name="1">通过</van-radio>
+                </van-radio-group>
+              </template>
+            </van-field>
+            <div style="margin: 16px;" v-if="form.status == '0'">
+              <van-button round block type="info" @click="onSubmit">
+                提交
+              </van-button>
+            </div>
+          </van-form>
         </el-col>
         </el-col>
       </el-col>
       </el-col>
     </el-row>
     </el-row>
@@ -15,49 +33,41 @@
 
 
 <script>
 <script>
 import NavBar from '@/layout/common/topInfo.vue';
 import NavBar from '@/layout/common/topInfo.vue';
-import detaliinfo from '@/layout/transaction/detaliinfo.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: transaction } = createNamespacedHelpers('transaction');
 const { mapActions: transaction } = createNamespacedHelpers('transaction');
 const { mapActions: productpact } = createNamespacedHelpers('productpact');
 const { mapActions: productpact } = createNamespacedHelpers('productpact');
 export default {
 export default {
-  name: 'index',
+  name: 'detail',
   props: {},
   props: {},
   components: {
   components: {
     NavBar,
     NavBar,
-    detaliinfo, //个人信息维护
   },
   },
-  data: () => ({
-    // 头部标题
-    title: '',
-    // meta为true
-    isleftarrow: '',
-    // 返回
-    navShow: true,
-    // 个人信息
-    form: {},
-  }),
-  created() {
-    this.searchInfo();
+  data: function() {
+    return {
+      // 头部标题
+      title: '',
+      // meta为true
+      isleftarrow: '',
+      // 返回
+      navShow: true,
+      form: {},
+    };
   },
   },
-  computed: {
-    ...mapState(['user']),
-    id() {
-      return this.$route.query.id;
-    },
-    role() {
-      return this.$route.query.role;
-    },
+  async created() {
+    await this.search();
   },
   },
   methods: {
   methods: {
-    ...transaction({ transactionsfetch: 'fetch', transactionslist: 'query', transactionupdate: 'update' }),
+    ...transaction({ transactionfetch: 'fetch', transactionlist: 'query', transactiondetele: 'detele', transactionupdate: 'update' }),
     ...productpact({ transactionQuery: 'query', productpactFetch: 'findpact', productpactUpdate: 'update' }),
     ...productpact({ transactionQuery: 'query', productpactFetch: 'findpact', productpactUpdate: 'update' }),
-    async searchInfo() {
-      const res = await this.productpactFetch(this.id);
+    async search() {
+      let res = await this.productpactFetch(this.id);
       if (this.$checkRes(res)) {
       if (this.$checkRes(res)) {
-        this.$set(this, `form`, res.data);
+        this.$set(this, 'form', res.data);
       }
       }
     },
     },
-    async onSubmit({ data }) {
+    // 提交审核
+    async onSubmit() {
+      let data = this.form;
       const res = await this.productpactUpdate(data);
       const res = await this.productpactUpdate(data);
       if (this.$checkRes(res)) {
       if (this.$checkRes(res)) {
         data.status = '2';
         data.status = '2';
@@ -65,18 +75,27 @@ export default {
         const arr = await this.transactionupdate(data);
         const arr = await this.transactionupdate(data);
         if (this.$checkRes(arr)) {
         if (this.$checkRes(arr)) {
           this.$notify({
           this.$notify({
-            message: '确定成功',
+            message: '审核成功',
             type: 'success',
             type: 'success',
           });
           });
+          this.$router.push({ path: '/adminCenter/transaction/index' });
         }
         }
       }
       }
-      this.$router.push({ path: './index' });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
     },
     },
   },
   },
   mounted() {
   mounted() {
     this.title = this.$route.meta.title;
     this.title = this.$route.meta.title;
     this.isleftarrow = this.$route.meta.isleftarrow;
     this.isleftarrow = this.$route.meta.isleftarrow;
   },
   },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
 };
 };
 </script>
 </script>
 
 
@@ -90,14 +109,8 @@ export default {
 .top {
 .top {
   height: 46px;
   height: 46px;
   overflow: hidden;
   overflow: hidden;
-  position: relative;
-  z-index: 999;
 }
 }
 .main {
 .main {
   min-height: 570px;
   min-height: 570px;
 }
 }
-.foot {
-  position: absolute;
-  bottom: 0;
-}
 </style>
 </style>

+ 45 - 47
src/views/adminCenter/transaction/index.vue

@@ -6,7 +6,11 @@
           <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
           <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
         </el-col>
         </el-col>
         <el-col :span="24" class="main">
         <el-col :span="24" class="main">
-          <list></list>
+          <list :list="oneList" @check="check"></list>
+          <!-- <van-tabs v-model="active">
+            <van-tab title="待审核">
+            </van-tab>
+          </van-tabs> -->
         </el-col>
         </el-col>
       </el-col>
       </el-col>
     </el-row>
     </el-row>
@@ -14,32 +18,54 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { mapState, createNamespacedHelpers } from 'vuex';
-import NavBar from '@/layout/common/topInfo.vue';
 import list from './parts/list.vue';
 import list from './parts/list.vue';
+import NavBar from '@/layout/common/topInfo.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: transaction } = createNamespacedHelpers('transaction');
 export default {
 export default {
   name: 'index',
   name: 'index',
   props: {},
   props: {},
-  components: { NavBar, list },
-  data: () => ({
-    // 头部标题
-    title: '',
-    // meta为true
-    isleftarrow: '',
-    // 返回
-    navShow: true,
-    img_path: require('@/assets/logo.png'),
-    active: 0,
-    show: false,
-    newform: {},
-  }),
-  created() {},
-  computed: {},
-  methods: {},
+  components: {
+    NavBar,
+    list,
+  },
+  data: function() {
+    return {
+      // 头部标题
+      title: '',
+      // meta为true
+      isleftarrow: '',
+      // 返回
+      navShow: true,
+      active: '1',
+      oneList: [],
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...transaction({ transactionsfetch: 'fetch', transactionslist: 'query', transactiondetele: 'detele' }),
+    async search() {
+      let res = await this.transactionslist();
+      if (this.$checkRes(res)) {
+        this.$set(this, 'oneList', res.data);
+      }
+    },
+    check(data) {
+      this.$router.push({ path: '/adminCenter/transaction/detail', query: { id: data.id } });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
   mounted() {
   mounted() {
     this.title = this.$route.meta.title;
     this.title = this.$route.meta.title;
     this.isleftarrow = this.$route.meta.isleftarrow;
     this.isleftarrow = this.$route.meta.isleftarrow;
   },
   },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
 };
 };
 </script>
 </script>
 
 
@@ -53,36 +79,8 @@ export default {
 .top {
 .top {
   height: 46px;
   height: 46px;
   overflow: hidden;
   overflow: hidden;
-  position: relative;
-  z-index: 999;
 }
 }
 .main {
 .main {
   min-height: 570px;
   min-height: 570px;
-  .two {
-    position: fixed;
-    top: 80%;
-
-    left: 10px;
-    z-index: 999;
-  }
-}
-/deep/.van-tab {
-  text-align: center;
-}
-/deep/.van-tabs--line .van-tabs__wrap {
-  height: 70px;
-  margin: 0 0 10px 0;
-}
-/deep/.van-tab--active {
-  color: red;
-}
-.van-icon {
-  font-size: 20px;
-}
-/deep/.van-popup--bottom {
-  bottom: 0;
-  left: 0;
-  width: 100%;
-  height: 300px;
 }
 }
 </style>
 </style>

+ 41 - 89
src/views/adminCenter/transaction/parts/list.vue

@@ -1,35 +1,31 @@
 <template>
 <template>
-  <div id="auditList">
+  <div id="list">
     <el-row>
     <el-row>
-      <el-col :span="24" class="info">
+      <el-col :span="24" class="train">
         <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
         <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
-          <p class="textOver">
-            <span @click="$router.push({ path: '/userCenter/matter/detailinfo', query: { id: item.id } })">{{ item.product_name }}</span>
-            <span style="float:right"><van-button v-if="item.status == '4'" type="primary" size="small" @click="submit(item)">备案</van-button> </span>
-          </p>
+          <p class="textOver">{{ item.product_name }}</p>
           <p>
           <p>
-            <span class="ptwo"><span>购买人名称:</span>{{ item.username || '暂无' }}</span>
+            <span class="textOver">营销人:{{ item.market_username }}</span>
+            <span class="textOver">购买人:{{ item.username }}</span>
           </p>
           </p>
-
           <p>
           <p>
-            <span class="ptwo"><span>营销人名称:</span>{{ item.market_username || '暂无' }}</span>
-            <span>状态:</span>
-            {{
-              `${item.status}` === `0`
+            交易状态:{{
+              item.status == '0'
                 ? '未交易'
                 ? '未交易'
-                : `${item.status}` === `1`
+                : item.status == '1'
                 ? '交易中'
                 ? '交易中'
-                : `${item.status}` === `2`
-                ? '交易成'
-                : `${item.status}` === `3`
+                : item.status == '2'
+                ? '交易成'
+                : item.status == '3'
                 ? '交易失败'
                 ? '交易失败'
-                : `${item.status}` === `4`
-                ? '合同待审核'
-                : '未识别'
+                : item.status == '4'
+                ? '待确定'
+                : '暂无'
             }}
             }}
           </p>
           </p>
-
-          <p class="textOver"><span>说明:</span>{{ item.description || '暂无' }}</p>
+          <p>
+            <el-button type="primary" size="mini" @click="check(item)">审核/查看</el-button>
+          </p>
         </el-col>
         </el-col>
       </el-col>
       </el-col>
     </el-row>
     </el-row>
@@ -38,43 +34,19 @@
 
 
 <script>
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: transaction } = createNamespacedHelpers('transaction');
-
 export default {
 export default {
-  name: 'auditList',
-  props: {},
+  name: 'list',
+  props: {
+    list: { type: Array },
+  },
   components: {},
   components: {},
   data: function() {
   data: function() {
-    return {
-      list: [],
-    };
-  },
-  created() {
-    this.searchInfo();
+    return {};
   },
   },
+  created() {},
   methods: {
   methods: {
-    ...transaction({ transactionList: 'query', transactiondtetle: 'delete', shenheupdate: 'update' }),
-    async searchInfo() {
-      if (this.user.role == '4') {
-        let create_userid = this.user.uid;
-        let res = await this.transactionList({ create_userid, status: '4' });
-        let arr = await this.transactionList({ create_userid, status: '2' });
-        if (this.$checkRes(res)) {
-          var newData = res.data.concat(arr.data);
-          this.$set(this, `list`, newData);
-        }
-      } else {
-        let userid = this.user.uid;
-        let res = await this.transactionList({ status: '4' });
-        let arr = await this.transactionList({ status: '2' });
-        if (this.$checkRes(res)) {
-          var newData = res.data.concat(arr.data);
-          this.$set(this, `list`, newData);
-        }
-      }
-    },
-    async submit(item) {
-      this.$router.push({ path: './detail', query: { id: item.id } });
+    check(data) {
+      this.$emit('check', data);
     },
     },
   },
   },
   computed: {
   computed: {
@@ -90,48 +62,28 @@ export default {
 </script>
 </script>
 
 
 <style lang="less" scoped>
 <style lang="less" scoped>
-.info {
-  border-top: 1px solid #f5f5f5;
+.train {
+  padding: 0 10px;
   .list {
   .list {
-    background: #fff;
-    padding: 0 10px;
-    border-bottom: 1px solid #ccc;
+    padding: 10px;
+    border-bottom: 1px dashed #ccc;
     p {
     p {
-      font-size: 14px;
-      color: #000;
-      padding: 5px 0;
-    }
-    p:first-child {
       font-size: 16px;
       font-size: 16px;
+      color: #666;
+      padding: 0 0 5px 0;
+      span {
+        display: inline-block;
+        width: 50%;
+      }
     }
     }
-    p:nth-child(2) .ptwo {
-      display: inline-block;
-      width: 75%;
-    }
-
-    p:nth-child(3) .ptwo {
-      display: inline-block;
-      width: 40%;
-    }
-
-    p:nth-child(3) .ptwo span:first-child {
-      color: #ccc;
-    }
-
-    p:nth-child(2) .ptwo span:first-child {
-      color: #ccc;
+    p:nth-child(1) {
+      font-size: 18px;
+      font-weight: bold;
+      color: #000;
     }
     }
-    p:last-child span {
-      color: #ccc;
+    p:nth-child(4) {
+      text-align: center;
     }
     }
   }
   }
 }
 }
-.content {
-  padding: 16px 16px 160px;
-  height: 160px;
-  background-color: aqua;
-}
-.newptwo {
-  color: #ccc !important;
-}
 </style>
 </style>

+ 1 - 1
src/views/user/parts/clickBtn.vue

@@ -14,7 +14,7 @@
             <van-cell is-link title="用户管理" @click="$router.push({ path: '/adminCenter/user/index' })" />
             <van-cell is-link title="用户管理" @click="$router.push({ path: '/adminCenter/user/index' })" />
             <van-cell is-link title="展会管理" @click="$router.push({ path: '/adminCenter/duijiehui/index' })" />
             <van-cell is-link title="展会管理" @click="$router.push({ path: '/adminCenter/duijiehui/index' })" />
             <van-cell is-link title="审核管理" @click="$router.push({ path: '/adminCenter/enterpriseProduct/index' })" />
             <van-cell is-link title="审核管理" @click="$router.push({ path: '/adminCenter/enterpriseProduct/index' })" />
-            <van-cell is-link title="交易审核" @click="$router.push({ path: '' })" />
+            <van-cell is-link title="交易审核" @click="$router.push({ path: '/adminCenter/transaction/index' })" />
           </span>
           </span>
           <span v-else-if="user.role == '1'">
           <span v-else-if="user.role == '1'">
             机构
             机构