guhongwei 4 years ago
parent
commit
602b50a4ea

+ 27 - 24
src/views/adminCenter/transaction/index.vue

@@ -5,7 +5,14 @@
         <el-col :span="24" class="leftTop"> <span>|</span> <span>交易备案</span> </el-col>
         <el-col :span="24" class="info">
           <span v-if="view">
-            <list :recruitInfo="recruitInfo" :total="total" @handleCurrentChange="handleCurrentChange" @shareBtn="shareBtn"></list>
+            <el-tabs v-model="activeName" type="card">
+              <el-tab-pane label="待确定" name="first">
+                <one :oneList="oneList" :oneTotal="oneTotal" @shareBtn="shareBtn"></one>
+              </el-tab-pane>
+              <el-tab-pane label="审核完成" name="second">
+                <two :twoList="twoList" :twoTotal="twoTotal"></two>
+              </el-tab-pane>
+            </el-tabs>
           </span>
           <span v-else>
             <detail :form="form" @submitDate="onSubmit"></detail>
@@ -17,7 +24,8 @@
 </template>
 
 <script>
-import list from './parts/list.vue';
+import one from './parts/one.vue';
+import two from './parts/two.vue';
 import detail from './parts/detail.vue';
 import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
 const { mapActions: tranaudit } = createNamespacedHelpers('tranaudit');
@@ -28,17 +36,19 @@ export default {
   name: 'recruit',
   props: {},
   components: {
-    list,
+    one,
+    two,
     detail,
   },
   data: () => ({
     topTitle: '审核信息',
+    // 显示判断
     view: true,
-    recruitInfo: [],
-    total: 1,
-    currentPage: 0,
-    pageSize: 10,
-    skip: '',
+    activeName: 'first',
+    oneList: [],
+    oneTotal: 0,
+    twoList: [],
+    twoTotal: 0,
     form: {},
   }),
   created() {
@@ -49,27 +59,19 @@ export default {
     shareBtn(id) {
       this.searchinfo(id), (this.view = false);
     },
-    // 删除
-    // async deleteBtn(id) {
-    //   const res = await this.transactiondetele(id);
-    //   this.$checkRes(res, '删除成功', '删除失败');
-    //   this.search();
-    // },
-
     ...productpact({ transactionQuery: 'query', productpactFetch: 'findpact', productpactUpdate: 'update' }),
     ...tranaudit({ tranauditList: 'query', tranauditListupdate: 'update' }),
     ...transactions({ transactionsfetch: 'fetch', transactionslist: 'query', transactiondetele: 'detele', transactionupdate: 'update' }),
     ...dock({ dockQuery: 'query', dockFetch: 'fetch' }),
     async search({ skip = 0, limit = 10, ...info } = {}) {
       const res = await this.dockFetch(this.user.uid);
-      const arr = await this.transactionslist({ skip, dockid: res.data.id, limit, status: '4', ...info });
-      this.$set(this, `recruitInfo`, arr.data);
-      this.$set(this, `total`, arr.total);
-    },
-
-    async handleCurrentChange({ skip, limit, currentPage }) {
-      this.$set(this, `skip`, skip);
-      this.search();
+      const arr = await this.transactionslist({ dockid: res.data.id, ...info });
+      var one = arr.data.filter(item => item.status === '4');
+      var two = arr.data.filter(item => item.status === '2' || item.status === '3');
+      this.$set(this, `oneList`, one);
+      this.$set(this, `oneTotal`, one.length);
+      this.$set(this, `twoList`, two);
+      this.$set(this, `twoTotal`, two.length);
     },
     //审核页面
     async searchinfo(id) {
@@ -91,6 +93,7 @@ export default {
           });
         }
         this.view = true;
+        this.search();
       }
     },
   },
@@ -119,6 +122,6 @@ export default {
   color: #22529a;
 }
 .info {
-  padding: 0 40px 0 0;
+  padding: 0 40px 0 10px;
 }
 </style>

+ 42 - 25
src/views/adminCenter/transaction/parts/list.vue

@@ -1,10 +1,10 @@
 <template>
-  <div id="column">
+  <div id="one">
     <el-row>
       <el-col :span="24" class="info">
         <el-col :span="24" class="list">
           <template>
-            <el-table :data="recruitInfo" style="width: 100%">
+            <el-table :data="list" style="width: 100%" border>
               <el-table-column prop="product_name" label="商品名称 " align="center"> </el-table-column>
               <el-table-column prop="username" label="购买人名称" align="center"> </el-table-column>
               <el-table-column prop="market_username" label="营销人名称" align="center"> </el-table-column>
@@ -28,17 +28,15 @@
               <el-table-column label="操作" align="center">
                 <template slot-scope="scoped">
                   <el-button v-if="scoped.row.status == 4" type="primary" size="mini" @click="shareBtn(scoped.row.id)">确定 </el-button>
-                  <!-- <el-button type="danger" size="mini" @click="handleDelete(scoped.row.id)">删除</el-button> -->
                 </template>
               </el-table-column>
             </el-table>
             <el-col :span="24" class="page">
               <el-pagination
-                @size-change="handleSizeChange"
                 @current-change="handleCurrentChange"
                 :current-page="currentPage"
                 layout="total, prev, pager, next, jumper"
-                :total="total"
+                :total="oneTotal"
                 :page-size="pageSize"
               >
               </el-pagination>
@@ -51,38 +49,51 @@
 </template>
 
 <script>
+import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
+import _ from 'loadsh';
 export default {
-  name: 'column',
+  name: 'one',
   props: {
-    recruitInfo: null,
-    total: null,
-
-    view: null,
+    oneList: null,
+    oneTotal: null,
   },
   components: {},
   data: () => ({
-    currentPage: 0,
-    pageSize: 10,
+    currentPage: 1, //默认数据1
+    pageSize: 10, //每页显示数据数量
+    origin: [], //分割数据
+    list: [], //显示数据列表
   }),
   created() {},
-  computed: {},
   methods: {
+    searchPage(page = 1) {
+      this.$set(this, `list`, this.origin[page - 1]);
+    },
+    handleCurrentChange(currentPage) {
+      this.searchPage(currentPage);
+    },
+    // 审核
     shareBtn(id) {
       this.$emit('shareBtn', id);
     },
-
-    // handleDelete(id) {
-    //   this.$emit('deleteBtn', id);
-    // },
-    handleEdit(row) {
-      this.$emit('edit', { data: row });
-    },
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
     },
-    handleCurrentChange(currentPage) {
-      console.log(currentPage);
-      this.$emit('handleCurrentChange', { skip: (currentPage - 1) * this.pageSize, limit: this.pageSize, currentPage });
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    oneList: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
+        this.searchPage();
+      },
     },
   },
 };
@@ -100,6 +111,12 @@ export default {
   padding: 0 10px 0 0;
   text-align: right;
 }
+.search {
+  padding: 0 0 18px 0;
+}
+.anniu {
+  padding: 0 10px 0 0;
+}
 .page {
   padding: 20px 0;
   text-align: center;

+ 115 - 0
src/views/adminCenter/transaction/parts/two.vue

@@ -0,0 +1,115 @@
+<template>
+  <div id="one">
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="list">
+          <template>
+            <el-table :data="list" style="width: 100%" border>
+              <el-table-column prop="product_name" label="商品名称 " align="center"> </el-table-column>
+              <el-table-column prop="username" label="购买人名称" align="center"> </el-table-column>
+              <el-table-column prop="market_username" label="营销人名称" align="center"> </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}` === `2`
+                      ? '交易成功'
+                      : `${scoped.row.status}` === `3`
+                      ? '交易失败'
+                      : `${scoped.row.status}` === `4`
+                      ? '待确定'
+                      : '未识别'
+                  }}
+                </template>
+              </el-table-column>
+            </el-table>
+            <el-col :span="24" class="page">
+              <el-pagination
+                @current-change="handleCurrentChange"
+                :current-page="currentPage"
+                layout="total, prev, pager, next, jumper"
+                :total="twoTotal"
+                :page-size="pageSize"
+              >
+              </el-pagination>
+            </el-col>
+          </template>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
+import _ from 'loadsh';
+export default {
+  name: 'one',
+  props: {
+    twoList: null,
+    twoTotal: null,
+  },
+  components: {},
+  data: () => ({
+    currentPage: 1, //默认数据1
+    pageSize: 10, //每页显示数据数量
+    origin: [], //分割数据
+    list: [], //显示数据列表
+  }),
+  created() {},
+  methods: {
+    searchPage(page = 1) {
+      this.$set(this, `list`, this.origin[page - 1]);
+    },
+    handleCurrentChange(currentPage) {
+      this.searchPage(currentPage);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    twoList: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
+        this.searchPage();
+      },
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.top {
+  padding: 15px 0;
+  border-bottom: 1px solid #cccc;
+}
+.top .topTitle {
+  padding: 0 10px;
+}
+.top .topAdd {
+  padding: 0 10px 0 0;
+  text-align: right;
+}
+.search {
+  padding: 0 0 18px 0;
+}
+.anniu {
+  padding: 0 10px 0 0;
+}
+.page {
+  padding: 20px 0;
+  text-align: center;
+}
+</style>

+ 12 - 9
src/views/hall/direct.vue

@@ -181,7 +181,7 @@
                           type="primary"
                           size="mini"
                           @click="$router.push({ path: '/hall/productList/technologyList', query: { column_name: '技术', dockid: dock_id } })"
-                          v-if="jishulist.length > 5"
+                          v-if="jishulist.length > 10"
                           >查看所有项目</el-button
                         >
                       </el-col>
@@ -256,7 +256,7 @@
                             type="primary"
                             size="mini"
                             @click="$router.push({ path: '/hall/productList/technologyList', query: { column_name: '产品', dockid: dock_id } })"
-                            v-if="demandList.length > 5"
+                            v-if="demandList.length > 6"
                             >查看所有项目</el-button
                           >
                         </el-col>
@@ -598,15 +598,16 @@ export default {
         let czxm = res.data.apply.map(item => item.goodsList);
         // let czxm = res.data.map(item => item.apply.map(apply => apply.goodsList));
         czxm = _.flattenDeep(czxm);
-        this.$set(this.statNum, `czxm`, czxm.length);
+        var czxmNew = czxm.filter(item => item.dockStatus == '1');
+        this.$set(this.statNum, `czxm`, czxmNew.length);
         // 找技术
-        var jishuData = czxm.filter(item => item.totaltype === '0');
+        var jishuData = czxmNew.filter(item => item.totaltype === '0');
         this.$set(this, `jishulist`, jishuData);
         // 找产品
-        var chanpinData = czxm.filter(item => item.totaltype === '1');
+        var chanpinData = czxmNew.filter(item => item.totaltype === '1');
         this.$set(this, `demandList`, chanpinData);
         // 找服务
-        var fuwuData = czxm.filter(item => item.totaltype === '2');
+        var fuwuData = czxmNew.filter(item => item.totaltype === '2');
         this.$set(this, `serviceList`, fuwuData);
         // 找专家
         let exportdata = await this.expertQuery({ role: 6 });
@@ -1195,9 +1196,9 @@ export default {
   margin: 20px 0;
   border: 1px solid red;
   .one {
-    height: 468px;
+    height: 467px;
     padding: 0 15px;
-    overflow: auto;
+    overflow: hidden;
     .onnList {
       border-bottom: 1px dashed red;
       padding: 10px;
@@ -1330,6 +1331,8 @@ export default {
 // 产品
 .jishulist {
   .topList {
+    height: 430px;
+    overflow: hidden;
     .list {
       border-bottom: 1px dashed #ccc;
       padding: 6px 0;
@@ -1380,7 +1383,7 @@ export default {
     height: 430px;
     overflow: hidden;
     .list {
-      padding: 6px 0;
+      padding: 4px 0;
       border-bottom: 1px dashed #ccc;
       .name {
         height: 30px;