wansfa 2 年 前
コミット
8d05f51c22

+ 8 - 0
src/api/store/user.js

@@ -17,6 +17,14 @@ export function getUser(userId) {
   })
 }
 
+// 查询用户详细
+export function queryUserVo(userId) {
+  return request({
+    url: '/store/user/queryvo/' + userId,
+    method: 'get'
+  })
+}
+
 // 新增用户
 export function addUser(data) {
   return request({

+ 1 - 0
src/views/crm/components/customerDetails.vue

@@ -106,6 +106,7 @@
                 </span>
             </el-descriptions-item>
         </el-descriptions>
+        
         <el-tabs style="margin-top:20px;"  z-index = "99" type="border-card" v-model="activeName" @tab-click="handleClick">
             <el-tab-pane label="联系人" name="contacts">
                 <customer-contacts ref="contacts"></customer-contacts>

+ 2 - 2
src/views/crm/customer/index.vue

@@ -300,10 +300,10 @@
     </el-dialog>
     <el-drawer
      size="75%"
-      :title="show.title" :visible.sync="show.open"
-      >
+      :title="show.title" :visible.sync="show.open">
         <customer-details  ref="customerDetails" />
     </el-drawer>
+
     <el-dialog :title="source.title" :visible.sync="source.open" width="600px" append-to-body>
       <edit-customer-source  ref="editSource" @close="closeSource"></edit-customer-source>
     </el-dialog>

+ 0 - 1
src/views/store/storeOrder/index.vue

@@ -485,7 +485,6 @@ export default {
       addressloading: false,
       userloading: false,
       users:[],
-      
       userStatusOptions:[],
       show:{
         open:false,

+ 14 - 0
src/views/store/storeProduct/index.vue

@@ -5,6 +5,7 @@
       <el-form-item label="商品分类" prop="cateId">
          <treeselect  v-model="queryParams.cateId"  style="width:205.4px" :options="categoryOptions" :normalizer="normalizer" placeholder="请选择分类" />
       </el-form-item>
+
       <el-form-item label="商品名称" prop="productName">
         <el-input
           v-model="queryParams.productName"
@@ -14,6 +15,18 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+
+       <el-form-item label="商品编号" prop="barCode">
+        <el-input
+          v-model="queryParams.barCode"
+          placeholder="请输入商品编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+
       <el-form-item label="商品类型" prop="productType">
         <el-select   v-model="queryParams.productType" placeholder="请选择商品类型" clearable size="small" >
          <el-option
@@ -575,6 +588,7 @@ export default {
         productName: null,
         productType: null,
         isShow: "1",
+        barCode:null,
        
       },
       // 表单参数

+ 174 - 0
src/views/store/user/components/storeOrder.vue

@@ -0,0 +1,174 @@
+<template>
+    <div>
+        <el-table v-loading="loading" :data="list" >
+            <el-table-column label="订单号" align="center" prop="orderCode" width="200px" />
+            <el-table-column label="所属公司" align="center" prop="companyName" />
+            <el-table-column label="所属员工" align="center" prop="companyUserNickName" />
+            <el-table-column label="用户昵称" align="center" prop="nickname" width="150px" >
+                <template slot-scope="scope">
+                    <span>{{scope.row.nickname}} </span>
+                </template>
+            </el-table-column>
+            <el-table-column label="收件人" align="center" prop="realName" width="150px" >
+                <template slot-scope="scope">
+                    <span>{{scope.row.realName}} </span>
+                </template>
+            </el-table-column>
+            <!-- <el-table-column label="商品" align="center" width="300px" >
+                <template slot-scope="scope">
+                    <div  v-for="(item, index) in scope.row.items" class="items"  >
+                        <img class="pic" :src="JSON.parse(item.jsonInfo).image" />
+                        <div class="goods-content">
+                        <div class="goods-title">{{ JSON.parse(item.jsonInfo).productName}}</div>
+                        <div class="sku">{{ JSON.parse(item.jsonInfo).sku}}</div>
+                        <div class="price">¥{{JSON.parse(item.jsonInfo).price}}×{{item.num}}</div>
+                        </div>
+                        
+                    </div>
+                </template>
+            </el-table-column> -->
+            <el-table-column label="订单金额" align="center" prop="totalPrice" >
+                <template slot-scope="scope">
+                    <span v-if="scope.row.totalPrice!=null">{{scope.row.totalPrice.toFixed(2)}}</span>
+                </template>
+            </el-table-column>
+            <el-table-column label="应付金额" align="center" prop="payPrice" >
+                <template slot-scope="scope">
+                    <span v-if="scope.row.payPrice!=null">{{scope.row.payPrice.toFixed(2)}}</span>
+                </template>
+            </el-table-column>
+            <el-table-column label="下单时间" align="center" prop="createTime" />
+            <!-- <el-table-column label="支付状态" align="center" prop="paid" /> -->
+            <el-table-column label="支付时间" align="center" prop="payTime" width="180">
+            </el-table-column>
+            <el-table-column label="支付方式" align="center" prop="payType" >
+                <template slot-scope="scope">
+                    <el-tag prop="payType" v-for="(item, index) in payTypeOptions"    v-if="scope.row.payType==item.dictValue">{{item.dictLabel}}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column label="订单类型" align="center" prop="orderType" >
+                <template slot-scope="scope">
+                    <el-tag prop="status" v-for="(item, index) in orderTypeOptions"    v-if="scope.row.orderType==item.dictValue">{{item.dictLabel}}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column label="状态" align="center" prop="status" >
+                <template slot-scope="scope">
+                    <el-tag prop="status" v-for="(item, index) in statusOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column label="物流状态" align="center" prop="deliveryStatus" >
+                <template slot-scope="scope">
+                    <el-tag prop="status" v-for="(item, index) in deliveryStatusOptions"    v-if="scope.row.deliveryStatus==item.dictValue">{{item.dictLabel}}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column label="物流结算状态" align="center" prop="deliveryPayStatus" >
+                <template slot-scope="scope">
+                    <el-tag prop="status" v-for="(item, index) in deliveryPayStatusOptions"    v-if="scope.row.deliveryPayStatus==item.dictValue">{{item.dictLabel}}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column label="操作" fixed="right" width="80px" align="center" class-name="small-padding fixed-width">
+                <template slot-scope="scope">
+                <el-button
+                    size="mini"
+                    type="text"
+                    @click="handleDetails(scope.row)"
+                    v-hasPermi="['store:storeOrder:query']"
+                >查看</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+        />
+        <el-drawer
+        z-index = "999"
+        size="75%"
+        :title="show.title" :visible.sync="show.open"
+        >
+        <product-order  ref="order" />
+        </el-drawer>
+    </div>
+
+</template>
+  
+<script>
+import { listStoreOrder  } from "@/api/store/storeOrder";
+import productOrder from "../../components/productOrder";
+    export default {
+        components: { productOrder  },
+        name: "customerVisit",
+        data() {
+            return {
+                deliveryPayStatusOptions:[],
+                deliveryStatusOptions:[],
+                orderTypeOptions:[],
+                payTypeOptions:[],
+                show:{
+                    open:false,
+                    title:"订单详情"
+                },
+                statusOptions:[],
+                // 遮罩层
+                loading: true,
+                // 总条数
+                total: 0,
+                list: [],
+                // 查询参数
+                queryParams: {
+                    pageNum: 1,
+                    pageSize: 10,
+                    userId: null,
+                },
+            };
+        },
+        created() {
+            this.getDicts("store_order_type").then((response) => {
+                this.orderTypeOptions = response.data;
+            });
+            this.getDicts("user_status").then((response) => {
+                this.userStatusOptions = response.data;
+            });
+            this.getDicts("store_pay_type").then((response) => {
+                this.payTypeOptions = response.data;
+            });
+            this.getDicts("store_order_status").then((response) => {
+                this.statusOptions = response.data;
+            });
+            this.getDicts("store_order_delivery_status").then((response) => {
+                this.deliveryStatusOptions = response.data;
+            });
+            this.getDicts("store_delivery_pay_status").then((response) => {
+                this.deliveryPayStatusOptions = response.data;
+            });
+        },
+        methods: {
+            handleDetails(row){
+                this.show.open=true;
+                const orderId = row.id ;
+                setTimeout(() => {
+                    this.$refs.order.getOrder(orderId);
+                }, 500);
+            },
+            getData(userId){
+                this.queryParams.userId=userId;
+                this.queryParams.pageNum=1;
+                this.getList();
+            },
+            getList() {
+                this.loading = true;
+                listStoreOrder(this.queryParams).then(response => {
+                    this.list = response.rows;
+                    this.total = response.total;
+                    this.loading = false;
+                });
+            },
+        }
+    };
+</script>
+<style lang="scss" scoped> 
+</style>
+ 

+ 97 - 0
src/views/store/user/components/storeSign.vue

@@ -0,0 +1,97 @@
+<template>
+    <div>
+       
+        <el-table v-loading="loading" :data="userSignList" >
+            <el-table-column type="selection" width="55" align="center" />
+        
+            <el-table-column label="用户uid" align="center" prop="userId" />
+            <el-table-column label="签到说明" align="center" prop="title" />
+            <el-table-column label="获得积分" align="center" prop="number" />
+            <el-table-column label="剩余积分" align="center" prop="balance" />
+            <el-table-column label="添加时间" align="center" prop="isDel" />
+            <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+                <template slot-scope="scope">
+                <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-edit"
+                    @click="handleUpdate(scope.row)"
+                    v-hasPermi="['store:userSign:edit']"
+                >修改</el-button>
+                <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-delete"
+                    @click="handleDelete(scope.row)"
+                    v-hasPermi="['store:userSign:remove']"
+                >删除</el-button>
+                </template>
+            </el-table-column> -->
+        </el-table>
+    
+
+        <pagination
+            v-show="total>0"
+            :total="total"
+            :page.sync="queryParams.pageNum"
+            :limit.sync="queryParams.pageSize"
+            @pagination="getList"
+        />
+      
+    </div>
+
+</template>
+  
+<script>
+import { listUserSign } from "@/api/store/userSign";
+
+    export default {
+        //components: { productOrder  },
+        name: "storeUserSign",
+        data() {
+            return {
+               // 签到记录表格数据
+                userSignList: [],
+                statusOptions:[],
+                // 遮罩层
+                loading: true,
+                // 总条数
+                total: 0,
+                // 查询参数
+                queryParams: {
+                    pageNum: 1,
+                    pageSize: 10,
+                    userId: null,
+                    title: null,
+                    number: null,
+                    balance: null,
+                    isDel: null
+                },
+            };
+        },
+        created() {
+            this.getList();
+        },
+        methods: {
+            getData(userId){
+                this.queryParams.userId=userId;
+                this.queryParams.pageNum=1;
+                this.getList();
+            },
+            /** 查询签到记录列表 */
+            getList() {
+                    this.loading = true;
+                    listUserSign(this.queryParams).then(response => {
+                        this.userSignList = response.rows;
+                        this.total = response.total;
+                        this.loading = false;
+                    });
+            }
+        }
+    };
+</script>
+
+
+<style lang="scss" scoped> 
+</style>
+ 

+ 132 - 0
src/views/store/user/components/storeUserDetails.vue

@@ -0,0 +1,132 @@
+<template>
+    <div class="contents" v-if="item!=null">
+        <div class="customer-title"  >
+            <div class="customer-name">
+                {{item.customerName}}
+            </div>
+        </div>
+        <el-descriptions title="" :column="3" border>
+            <el-descriptions-item label="会员姓名"  >
+                <span v-if="item!=null">{{   item.nickname}}</span>
+            </el-descriptions-item>
+            <el-descriptions-item label="注册时间" >
+                <span v-if="item!=null">{{item.createTime}}</span>
+            </el-descriptions-item>
+            <el-descriptions-item label="累计消费金额(元)" >
+                <span v-if="item!=null">{{item.totalAmount}}</span>
+            </el-descriptions-item>
+
+            <el-descriptions-item label="上次消费时间"  >
+                <span v-if="item!=null">{{item.lastBuyTime}}</span>
+            </el-descriptions-item>
+            <el-descriptions-item label="上次消费金额(元)" >
+                <span v-if="item!=null">{{item.number}}</span>
+            </el-descriptions-item>
+            <el-descriptions-item label="剩余积分" >
+                <span v-if="item!=null">{{item.integral}}</span>
+            </el-descriptions-item>
+
+        </el-descriptions>
+
+          <el-tabs style="margin-top:20px;"  z-index = "99" type="border-card" v-model="activeName" @tab-click="handleClick">
+            <el-tab-pane label="会员订单" name="storeOrder">
+                <store-order ref="storeOrder"></store-order>
+            </el-tab-pane>
+            <el-tab-pane label="签到记录" name="storeSign">
+                <store-sign ref="storeSign"></store-sign>
+            </el-tab-pane>
+        </el-tabs>
+    </div>
+</template>
+  
+<script>
+
+
+    import storeOrder from '../components/storeOrder.vue';
+    import storeSign from '../components/storeSign.vue';
+    import {  queryUserVo } from "@/api/store/user";
+    
+    export default {
+        name: "storeUserDtl",
+        components: { storeOrder,storeSign },
+        data() {
+            return {
+                customerExts:[],
+                exts:[],
+                activeName:"",
+                statusOptions:[],
+                typeOptions:[],
+                sourceOptions:[],
+                sexOptions:[],
+                item:null,
+                company:null,
+                 
+            };
+        },
+        created() {
+            this.getDicts("crm_customer_source").then((response) => {
+                this.sourceOptions = response.data;
+            });
+            this.getDicts("common_sex").then((response) => {
+                this.sexOptions = response.data;
+            });
+            this.getDicts("crm_customer_status").then((response) => {
+                this.statusOptions = response.data;
+            });
+            this.getDicts("crm_customer_type").then((response) => {
+                this.typeOptions = response.data;
+            });
+
+            // var data={status:1}
+            // listCustomerExt(data).then(response => {
+            //     this.customerExts = response.data;
+            // });
+            
+        },
+        mounted(){
+        },
+        methods: {
+            handleClick(tab, event) {
+                if(tab.name=="storeOrder"){
+                    this.$refs.storeOrder.getData(this.item.userId);
+                }
+                if(tab.name=="storeSign"){
+                    this.$refs.storeSign.getData(this.item.userId);
+                }
+            },
+            getDetails(userId) {
+                queryUserVo(userId).then(response => {
+                    this.item = response.data;
+                    this.activeName="storeOrder";
+                    var that=this;
+                    setTimeout(() => {
+                        that.$refs.storeOrder.getData(this.item.userId);
+                    }, 100);
+                });
+            },
+        }
+    };
+</script>
+<style lang="scss" scoped>
+.contents{
+    height: 100%;
+    background-color: #fff;
+    padding: 0px 20px;
+}
+.customer-title{
+    margin-bottom: 15px;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    .customer-name{
+        font-size: 28px;
+    }
+}
+</style>
+
+<style>
+  .el-descriptions-item__label.is-bordered-label{
+    font-weight: normal;
+  }
+  
+</style>

+ 26 - 1
src/views/store/user/index.vue

@@ -141,6 +141,14 @@
             @click="handleUpdate(scope.row)"
             v-hasPermi="['store:user:edit']"
           >修改</el-button>
+
+           <el-button
+            size="mini"
+            type="text"
+            @click="handleShow(scope.row)"
+            v-hasPermi="['store:user:query']"
+          >查看</el-button>
+
           <el-button
             size="mini"
             type="text"
@@ -237,13 +245,19 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+       <el-drawer size="75%" :title="show.title" :visible.sync="show.open">
+         <store-user-details ref="storeUserDetails"></store-user-details>
+    </el-drawer>
+
   </div>
 </template>
 
 <script>
 import { listUser, getUser, delUser, addUser, updateUser, exportUser } from "@/api/store/user";
-
+import storeUserDetails from './components/storeUserDetails.vue';
 export default {
+  components: { storeUserDetails },
   name: "User",
   data() {
     return {
@@ -262,6 +276,10 @@ export default {
       showSearch: true,
       // 总条数
       total: 0,
+      show:{
+        title:"会员详情",
+        open:false,
+      },
       // 用户表格数据
       userList: [],
       // 弹出层标题
@@ -461,6 +479,13 @@ export default {
           this.download(response.msg);
         }).catch(function() {});
     }
+    ,handleShow(row){
+      var that=this;
+      that.show.open=true;
+      setTimeout(() => {
+          that.$refs.storeUserDetails.getDetails(row.userId);
+      }, 200);
+    },
   }
 };
 </script>