|
@@ -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>
|