Kaynağa Gözat

Merge branch 'master' of http://git.cc-lotus.info/service-platform/web-website

lrf402788946 5 yıl önce
ebeveyn
işleme
e9d2119e1f

+ 2 - 3
src/components/supermaket/supermarkettableDetail.vue

@@ -17,7 +17,7 @@
       <el-col :span="24" class="main">
         <div class="w_1200">
           <el-col :span="24" class="rightcont">
-            <tablelist></tablelist>
+            <tablelist :tableData="tableData" :total="total" v-on="$listeners"></tablelist>
           </el-col>
         </div>
       </el-col>
@@ -37,7 +37,6 @@ import menuInfo from '@/layout/index/menuInfo.vue';
 import foot from '@/layout/index/foot.vue';
 import fenlei from '@/layout/policy/fenlei.vue';
 import tablelist from '@/layout/supermarket/tablelist.vue';
-import detali from '@/layout/supermarket/detali.vue';
 export default {
   name: 'policy',
   props: {
@@ -46,7 +45,7 @@ export default {
     contentList: null, //内容
     total: null,
     display: { type: String, default: 'list' },
-    policyInfo: null,
+    tableData: null,
   },
   components: {
     top, //头部

+ 7 - 3
src/layout/supermarket/jiaoyi.vue

@@ -5,7 +5,7 @@
         <el-col :span="24" class="topInfo">
           <el-col :span="23" class="left">{{ title }}</el-col>
           <el-col :span="1" class="more">
-            <el-link :underline="false" @click.native="clickmore(scoped.row.id)"><el-image :src="more"></el-image></el-link>
+            <el-link :underline="false" @click="clickmore()"><el-image :src="more"></el-image></el-link>
           </el-col>
         </el-col>
         <el-col :span="24" class="list">
@@ -49,8 +49,8 @@ export default {
   created() {},
   computed: {},
   methods: {
-    clickmore(id) {
-      this.$router.push({ path: '/supermaket/supermarketlists' });
+    clickmore() {
+      this.$router.push({ path: '/supermaket/supermarkelists' });
     },
   },
 };
@@ -90,4 +90,8 @@ export default {
   overflow: hidden;
   white-space: nowrap;
 }
+.list {
+  height: 200px;
+  overflow: hidden;
+}
 </style>

+ 90 - 5
src/layout/supermarket/tablelist.vue

@@ -1,19 +1,104 @@
 <template>
   <div id="tablelist">
-    <p>tablelist</p>
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="24" class="infoTop">
+          <span>交易展示</span>
+        </el-col>
+        <el-col :span="24" class="tableInfo">
+          <el-table :data="tableData" style="width: 100%" stripe border>
+            <el-table-column prop="market_username" label="营销单位" align="center" :show-overflow-tooltip="true"> </el-table-column>
+            <el-table-column prop="username" label="采购单位" align="center" :show-overflow-tooltip="true"> </el-table-column>
+            <el-table-column prop="product_name" label="产品交易" align="center" :show-overflow-tooltip="true"> </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`
+                    ? '交易失败'
+                    : ''
+                }}
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-col>
+        <el-col :span="24" class="page">
+          <el-pagination
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            :page-size="10"
+            layout="total, prev, pager, next, jumper"
+            :total="total"
+          >
+          </el-pagination>
+        </el-col>
+      </el-col>
+    </el-row>
   </div>
 </template>
 
 <script>
 export default {
   name: 'tablelist',
-  props: {},
+  props: {
+    tableData: null,
+    total: null,
+  },
   components: {},
-  data: () => ({}),
+  data: () => ({
+    currentPage: 1,
+  }),
   created() {},
   computed: {},
-  methods: {},
+  methods: {
+    handleCurrentChange(val) {
+      console.log(`当前页: ${val}`);
+      this.$emit('query', val);
+    },
+  },
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.infoTop {
+  height: 60px;
+  border-bottom: 1px solid #22529a;
+  margin: 0 0 30px 0;
+}
+.infoTop span:only-child {
+  width: 15%;
+  height: 60px;
+  background-color: #22529a;
+  color: #fff;
+  text-align: center;
+  line-height: 60px;
+  font-size: 20px;
+  display: block;
+}
+.tableInfo {
+  margin: 0 auto;
+  width: 90%;
+  float: none;
+  height: 630px;
+}
+/deep/.el-table th {
+  background-color: #f3f3f3;
+  color: rgba(1, 1, 1, 0.5);
+  font-size: 18px;
+  text-align: center;
+}
+/deep/.el-table td {
+  color: rgba(1, 1, 1, 0.7);
+  font-size: 18px;
+  text-align: center;
+}
+.page {
+  margin: 20px 0;
+  text-align: center;
+}
+</style>

+ 16 - 1
src/views/supermaket/supermarkelists.vue

@@ -1,6 +1,6 @@
 <template>
   <div id="policy">
-    <supermarkettable-detail :info="info"></supermarkettable-detail>
+    <supermarkettable-detail :tableData="tableData" :total="total" :info="info" @query="query"></supermarkettable-detail>
   </div>
 </template>
 
@@ -9,6 +9,7 @@ import supermarkettableDetail from '@/components/supermaket/supermarkettableDeta
 import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
 import _ from 'loadsh';
 const { mapActions: mapSite } = createNamespacedHelpers('site');
+const { mapActions: transaction } = createNamespacedHelpers('transaction');
 export default {
   name: 'policy',
   props: {},
@@ -23,9 +24,12 @@ export default {
     contentList: [],
     total: 1,
     skip: '',
+    limit: 10,
+    tableData: [],
   }),
   async created() {
     this.searchSite();
+    this.jiaoyilist();
   },
   computed: {
     totaltype() {
@@ -34,6 +38,7 @@ export default {
   },
   methods: {
     ...mapSite(['showInfo']),
+    ...transaction({ transactionQuery: 'query', ProductFetch: 'fetch', ProductDelete: 'delete' }),
 
     // 查询站点信息
     async searchSite() {
@@ -45,6 +50,16 @@ export default {
         this.$message.error(res.errmsg ? res.errmsg : 'error');
       }
     },
+    async jiaoyilist({ skip = 0, limit = 10 } = {}) {
+      const res = await this.transactionQuery({ skip, limit });
+      this.$set(this, `tableData`, res.data);
+      this.$set(this, `total`, res.total);
+    },
+    async query(val) {
+      console.log(val);
+
+      this.jiaoyilist({ skip: (val - 1) * this.limit, limit: this.limit });
+    },
   },
 };
 </script>

+ 1 - 0
src/views/supermaket/supermarketlist.vue

@@ -37,6 +37,7 @@ export default {
     contentList: [],
     total: 1,
     skip: '',
+    tableData: {},
   }),
   async created() {
     this.searchSite();