Browse Source

2024-01-10 拆带导出加款式备注,新增红色贺岁款库存,批发商排名新增红色款

zhiquz 1 year ago
parent
commit
2aa4393a5d
6 changed files with 253 additions and 96 deletions
  1. BIN
      dist.zip
  2. 8 1
      src/api/stock/goods.js
  3. 10 1
      src/pages/data/order.vue
  4. 6 1
      src/pages/order/list.vue
  5. 127 0
      src/pages/stock/red.vue
  6. 102 93
      src/router/auth.js

BIN
dist.zip


+ 8 - 1
src/api/stock/goods.js

@@ -44,4 +44,11 @@ export function importGoodStock(data) {
     data
   })
 }
-
+// 红色贺岁款库存
+export function GetRight(params) {
+  return request({
+    url: '/goods/GetRight',
+    method: 'Get',
+    params
+  })
+}

+ 10 - 1
src/pages/data/order.vue

@@ -106,6 +106,15 @@
         </template>
       </el-table-column>
       <el-table-column
+        prop="红色款"
+        label="红色贺岁版"
+        sortable="custom"
+      >
+        <template slot-scope="{ row }">
+          <span :class="row.no_pay_account > 0 ? 'red' : ''">{{ row['红色款'] || 0 }} </span>
+        </template>
+      </el-table-column>
+      <el-table-column
         prop="account"
         label="订货金额"
         sortable="custom"
@@ -246,7 +255,7 @@ export default {
               excel.export_json_to_excel({
                 header: header,
                 data: res.data.map((listItem, i) => header.map(j => {
-                  if (j === '简约版' || j === '纯棉老人版' || j === '精装版' || j === '高腰版' || j === '青春版') {
+                  if (j === '简约版' || j === '纯棉老人版' || j === '精装版' || j === '高腰版' || j === '青春版' || j === '红色款') {
                     listItem[j] = Number(listItem[j]) || 0
                   }
                   if (j === '序号') {

+ 6 - 1
src/pages/order/list.vue

@@ -960,7 +960,8 @@ const moduleList = {
   '发货状态': '',
   '订单状态': '',
   '支付状态': '',
-  '体验店或专车': ''
+  '体验店或专车': '',
+  '款式备注': ''
 }
 export default {
   name: 'OrderList',
@@ -2745,6 +2746,7 @@ export default {
           obj['支付状态'] = info.pay_status
           obj['体验店或专车'] = info.store
           obj['是否满箱'] = '精装满箱'
+          obj['款式备注'] = '常规款'
           // obj['赠品'] = info.gift.map(item => `${item.name}${item.num}`).join(';')
           let num_all = 0
           if (item['精装'][a].sec_attr === '男女款') {
@@ -2845,6 +2847,7 @@ export default {
           obj['支付状态'] = info.pay_status
           obj['体验店或专车'] = info.store
           obj['是否满箱'] = ''
+          obj['款式备注'] = '常规款'
           // obj['赠品'] = info.gift.map(item => `${item.name}${item.num}`).join(';')
           let num_all = 0
           if (item['精装混合'][c].sec_attr === '男女款') {
@@ -2945,6 +2948,7 @@ export default {
           obj['支付状态'] = info.pay_status
           obj['体验店或专车'] = info.store
           obj['是否满箱'] = '红色满箱'
+          obj['款式备注'] = '红色'
           // obj['赠品'] = info.gift.map(item => `${item.name}${item.num}`).join(';')
           let num_all = 0
           if (item['红色'][f].sec_attr === '男女款') {
@@ -2995,6 +2999,7 @@ export default {
           obj['支付状态'] = info.pay_status
           obj['体验店或专车'] = info.store
           obj['是否满箱'] = ''
+          obj['款式备注'] = '红色'
           // obj['赠品'] = info.gift.map(item => `${item.name}${item.num}`).join(';')
           let num_all = 0
           if (item['红色混合'][g].sec_attr === '男女款') {

+ 127 - 0
src/pages/stock/red.vue

@@ -0,0 +1,127 @@
+<!--
+ * @Author: zhiquz zhiquz@163.com
+ * @Date: 2024-01-10 10:46:18
+ * @LastEditors: zhiquz zhiquz@163.com
+ * @LastEditTime: 2024-01-10 11:42:15
+ * @FilePath: \appadmin-new\src\pages\stock\red.vue
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+-->
+<template>
+  <div class="app-container">
+    <div v-loading.fullscreen.lock="loadingFull" />
+    <div>
+      <el-input v-model="mobile" placeholder="请输入客户手机号" style="width:300px" clearable @keyup.enter.native="getGoodStock" />
+      <el-button type="primary" @click="getGoodStock">搜索</el-button>
+    </div>
+    <el-table
+      ref="listTable"
+      :data="table.slice((numPage.currentPage-1)*numPage.pageSize,numPage.currentPage*numPage.pageSize)"
+      :header-cell-style="{ background: '#f8fbfc' }"
+      class="tableBorder"
+      border
+      stripe
+    >
+      <el-table-column prop="nickname" label="客户昵称" align="center" />
+      <el-table-column prop="realname" label="真实姓名" align="center" />
+      <el-table-column prop="name" label="商品名称" align="center">
+        <template>
+          <span>红色贺岁款</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="size" label="款式" align="center">
+        <template slot-scope="{ row }">
+          <span>{{ row.size }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="storage" label="限制数量" align="center">
+        <template slot-scope="{ row }">
+          <span>{{ row.limit_num }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="order_num" label="记录的数量" align="center">
+        <template slot-scope="{ row }">
+          <span>{{ row.num }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="order_num" label="实际订单数量" align="center">
+        <template slot-scope="{ row }">
+          <span>{{ row.real_num }}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div style="margin-top: 20px">
+      <el-pagination
+        :current-page="numPage.currentPage"
+        :page-sizes="[10, 15, 20, 25]"
+        :page-size="numPage.pageSize"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="parseInt(numPage.total)"
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+      />
+    </div>
+  </div>
+</template>
+<script>
+// api
+import { GetRight } from '@/api/stock/goods'
+
+export default {
+  data() {
+    return {
+      mobile: '',
+      table: [],
+      loadingFull: false,
+      numPage: {
+        currentPage: 1,
+        pageSize: 15,
+        total: 0
+      }
+    }
+  },
+  methods: {
+    // 获取列表
+    async getGoodStock() {
+      if (!this.mobile) {
+        this.$message.error('请输入客户手机号!')
+        return
+      }
+      this.loadingFull = true
+      GetRight({ mobile: this.mobile }).then(res => {
+        this.loadingFull = false
+        const { code, message, data } = res
+        if (code === 200) {
+          this.table = data
+          this.numPage.total = data.length
+        } else {
+          this.$message.error(message || '获取失败')
+        }
+      }).catch(e => {
+        this.loadingFull = false
+        this.$message.error('获取商品库存失败!!')
+      })
+    },
+    handleSizeChange(newSize) {
+      // pagesize改变触发
+      this.numPage.pageSize = newSize
+    },
+    handleCurrentChange(newPage) {
+      // 页码改变触发
+      this.numPage.currentPage = newPage
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.red {
+  color: #F5394B;
+}
+.tableBorder {
+  border: 1px solid #ebeef5;
+  margin: 20px 0;
+}
+.item {
+  margin-top: 10px;
+  margin-right: 40px;
+}
+</style>

+ 102 - 93
src/router/auth.js

@@ -1011,99 +1011,99 @@ export const asyncRoutes = [
   //     }
   //   ]
   // },
-  // {
-  //   path: '/data',
-  //   component: 'Layout',
-  //   redirect: 'noRedirect',
-  //   name: 'richSet',
-  //   meta: {
-  //     title: '数据统计',
-  //     icon: 'data'
-  //   },
-  //   children: [
-  //     {
-  //       path: 'order',
-  //       component: '/data/order',
-  //       name: 'data_order',
-  //       meta: {
-  //         title: '批发商排名',
-  //         noCache: true
-  //       }
-  //     },
-  //     {
-  //       path: 'order_report',
-  //       component: '/data/order_report',
-  //       name: 'data_order_report',
-  //       meta: {
-  //         title: '活动数据',
-  //         noCache: true
-  //       }
-  //     },
-  //     {
-  //       path: 'order_belong',
-  //       component: '/data/order_belong',
-  //       name: 'data_order_belong',
-  //       meta: {
-  //         title: '所属者排名',
-  //         noCache: true
-  //       }
-  //     },
-  //     {
-  //       path: 'visual',
-  //       component: '/data/visual',
-  //       name: 'DataVisual',
-  //       meta: {
-  //         title: '实时数据',
-  //         noCache: true
-  //       }
-  //     },
-  //     {
-  //       path: 'previous',
-  //       component: '/data/previous',
-  //       name: 'DataPrevious',
-  //       meta: {
-  //         title: '历届活动',
-  //         noCache: true
-  //       }
-  //     },
-  //     {
-  //       path: 'deal',
-  //       component: '/data/deal',
-  //       name: 'data_deal',
-  //       meta: {
-  //         title: '交易数据',
-  //         noCache: true
-  //       }
-  //     },
-  //     {
-  //       path: 'next',
-  //       component: '/data/next',
-  //       name: 'data_next',
-  //       meta: {
-  //         title: '销售统计',
-  //         noCache: true
-  //       }
-  //     },
-  //     {
-  //       path: 'rank',
-  //       component: '/data/rank',
-  //       name: 'data_rank',
-  //       meta: {
-  //         title: '排行榜',
-  //         noCache: true
-  //       }
-  //     },
-  //     {
-  //       path: 'tshirt',
-  //       component: '/data/tshirt',
-  //       name: 'Tshirt',
-  //       meta: {
-  //         title: 'T恤',
-  //         noCache: true
-  //       }
-  //     }
-  //   ]
-  // },
+  {
+    path: '/data',
+    component: 'Layout',
+    redirect: 'noRedirect',
+    name: 'richSet',
+    meta: {
+      title: '数据统计',
+      icon: 'data'
+    },
+    children: [
+      {
+        path: 'order',
+        component: '/data/order',
+        name: 'data_order',
+        meta: {
+          title: '批发商排名',
+          noCache: true
+        }
+      }
+      // {
+      //   path: 'order_report',
+      //   component: '/data/order_report',
+      //   name: 'data_order_report',
+      //   meta: {
+      //     title: '活动数据',
+      //     noCache: true
+      //   }
+      // },
+      // {
+      //   path: 'order_belong',
+      //   component: '/data/order_belong',
+      //   name: 'data_order_belong',
+      //   meta: {
+      //     title: '所属者排名',
+      //     noCache: true
+      //   }
+      // },
+      // {
+      //   path: 'visual',
+      //   component: '/data/visual',
+      //   name: 'DataVisual',
+      //   meta: {
+      //     title: '实时数据',
+      //     noCache: true
+      //   }
+      // },
+      // {
+      //   path: 'previous',
+      //   component: '/data/previous',
+      //   name: 'DataPrevious',
+      //   meta: {
+      //     title: '历届活动',
+      //     noCache: true
+      //   }
+      // },
+      // {
+      //   path: 'deal',
+      //   component: '/data/deal',
+      //   name: 'data_deal',
+      //   meta: {
+      //     title: '交易数据',
+      //     noCache: true
+      //   }
+      // },
+      // {
+      //   path: 'next',
+      //   component: '/data/next',
+      //   name: 'data_next',
+      //   meta: {
+      //     title: '销售统计',
+      //     noCache: true
+      //   }
+      // },
+      // {
+      //   path: 'rank',
+      //   component: '/data/rank',
+      //   name: 'data_rank',
+      //   meta: {
+      //     title: '排行榜',
+      //     noCache: true
+      //   }
+      // },
+      // {
+      //   path: 'tshirt',
+      //   component: '/data/tshirt',
+      //   name: 'Tshirt',
+      //   meta: {
+      //     title: 'T恤',
+      //     noCache: true
+      //   }
+      // }
+    ]
+  },
   // {
   //   path: '/tshirt',
   //   component: 'Layout',
@@ -1228,6 +1228,15 @@ export const asyncRoutes = [
           noCache: true
         }
       },
+      {
+        path: 'redgoods',
+        component: '/stock/red',
+        name: 'stock_redgoods',
+        meta: {
+          title: '红色贺岁款库存',
+          noCache: true
+        }
+      },
       // {
       //   path: 'crown',
       //   component: '/stock/crown',