浏览代码

颜选商城

zhengjinyi 1 年之前
父节点
当前提交
bc11bc9470

+ 12 - 7
src/api/stricts/order/order.js

@@ -26,16 +26,21 @@ export function getHeHeOrderList(params) {
   })
   })
 }
 }
 /**
 /**
- * 颜选美学小程序限时特价列表
- * @param {*} name,
- * @param {*} status 状态:1待上架,2已上架,3已下架,
- * @param {*} pageNum,
- * @param {*} pageSize
+ * 颜选美学退款单列表
+ * @param {*} returnedNo, 退款编号
+ * @param {*} shopOrderId 订单ID
+ * @param {*} shopOrderNo 订单编号
+ * @param {*} name 买家
+ * @param {*} beginTime 申请开始时间
+ * @param {*} endTime 申请结束时间
+ * @param {*} status 退款审核状态 1待审核、2审核通过、3审核不通过
+ * @param {*} pageNum, 页码
+ * @param {*} pageSize 页数
  * @returns
  * @returns
  */
  */
-export function getHeHeDiscount(params) {
+export function returnedPurchaseList(params) {
   return request({
   return request({
-    url: '/HeHe/discount/activity',
+    url: '/HeHe/returnedPurchase/list',
     method: 'get',
     method: 'get',
     params
     params
   })
   })

+ 58 - 0
src/api/stricts/user/user.js

@@ -31,3 +31,61 @@ export function getHeHeSalesList(params) {
     params
     params
   })
   })
 }
 }
+/**
+ * 添加分销者
+ * @param {*} mobile 手机号
+ * @param {*} name 姓名
+ * @returns
+ */
+export function saveSales(data) {
+  return request({
+    url: '/HeHe/save/sales',
+    method: 'post',
+    data: data
+  })
+}
+/**
+ * 分销者活动商品列表
+ * @param {*} userId 分销者ID
+ * @param {*} name 商品名称
+ * @param {*} shopName 供应商名称
+ * @param {*} pageNum 页数
+ * @param {*} pageSize 条数
+ * @returns
+ */
+export function getSalesProducts(params) {
+  return request({
+    url: '/HeHe/sales/products',
+    method: 'get',
+    params
+  })
+}
+/**
+ * 分销者活动商品弹窗列表
+ * @param {*} productId 商品ID
+ * @param {*} name 商品名称
+ * @param {*} shopName 供应商名称
+ * @param {*} pageNum 页数
+ * @param {*} pageSize 条数
+ * @returns
+ */
+export function getSalesActivityProducts(params) {
+  return request({
+    url: '/HeHe/sales/activity/products',
+    method: 'get',
+    params
+  })
+}
+/**
+ * 添加分销者
+ * @param {*} userId 分销者ID
+ * @param {*} productIds 商品ID
+ * @returns
+ */
+export function saveSalesProducts(data) {
+  return request({
+    url: '/HeHe/add/sales/products',
+    method: 'post',
+    data: data
+  })
+}

+ 7 - 0
src/router/modules/strict.js

@@ -67,6 +67,13 @@ const strictRouter = {
           name: 'RetailsList',
           name: 'RetailsList',
           component: () => import('@/views/stricts/retails/list'),
           component: () => import('@/views/stricts/retails/list'),
           meta: { title: '分销列表' }
           meta: { title: '分销列表' }
+        },
+        {
+          path: 'retails-goods-list',
+          name: 'RetailsGoodsList',
+          component: () => import('@/views/stricts/retails/retails-goods-list'),
+          meta: { title: '分销者商品列表' },
+          hidden: true
         }
         }
       ]
       ]
     },
     },

+ 59 - 55
src/views/stricts/order/refund-list.vue

@@ -5,7 +5,7 @@
       <div class="filter-control">
       <div class="filter-control">
         <span>退款编号:</span>
         <span>退款编号:</span>
         <el-input
         <el-input
-          v-model="listQuery.productName"
+          v-model="listQuery.returnedNo"
           placeholder="退款编号"
           placeholder="退款编号"
           clearable
           clearable
           style="width: 180px"
           style="width: 180px"
@@ -16,7 +16,7 @@
       <div class="filter-control">
       <div class="filter-control">
         <span>订单ID:</span>
         <span>订单ID:</span>
         <el-input
         <el-input
-          v-model="listQuery.shopName"
+          v-model="listQuery.shopOrderId"
           placeholder="订单ID"
           placeholder="订单ID"
           clearable
           clearable
           style="width: 120px"
           style="width: 120px"
@@ -27,7 +27,7 @@
       <div class="filter-control">
       <div class="filter-control">
         <span>订单编号:</span>
         <span>订单编号:</span>
         <el-input
         <el-input
-          v-model="listQuery.shopName"
+          v-model="listQuery.shopOrderNo"
           placeholder="订单编号"
           placeholder="订单编号"
           clearable
           clearable
           style="width: 180px"
           style="width: 180px"
@@ -38,7 +38,7 @@
       <div class="filter-control">
       <div class="filter-control">
         <span>买家:</span>
         <span>买家:</span>
         <el-input
         <el-input
-          v-model="listQuery.shopName"
+          v-model="listQuery.name"
           placeholder="买家"
           placeholder="买家"
           clearable
           clearable
           style="width: 120px"
           style="width: 120px"
@@ -75,70 +75,60 @@
     </div>
     </div>
     <!-- 列表 -->
     <!-- 列表 -->
     <el-table v-loading="isLoading" :data="list" border style="width: 100%" height="660">
     <el-table v-loading="isLoading" :data="list" border style="width: 100%" height="660">
-      <el-table-column prop="id" label="ID" align="center" width="50" />
-      <el-table-column prop="productName" label="商品名称" align="center" />
-      <el-table-column prop="shopName" label="供应商名称" align="center">
+      <el-table-column prop="returnedNo" label="退款编号" align="center" />
+      <el-table-column label="退款审核状态" align="center" prop="status" width="120">
         <template slot-scope="{ row }">
         <template slot-scope="{ row }">
-          {{ row.shopName ? row.shopName : '---' }}
+          <el-tag v-if="row.status * 1 === 1" type="warning" size="small">待审核</el-tag>
+          <el-tag v-if="row.status * 1 === 2" type="success" size="small">审核通过</el-tag>
+          <el-tag v-if="row.status * 1 === 3" type="danger" size="small">审核不通过</el-tag>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column prop="price" label="拼团价格" align="center" width="100">
+      <el-table-column prop="name" label="买家" align="center" width="120" />
+      <el-table-column prop="shopOrderId" label="子订单编号(ID)" align="center" width="120">
         <template slot-scope="{ row }">
         <template slot-scope="{ row }">
-          {{ row.price | amountfilters }}
+          {{ row.shopOrderId ? row.shopOrderId : '---' }}
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column prop="memberNum" label="拼团人数" align="center" width="50" />
-      <el-table-column prop="name" label="已拼人数" align="center" width="50">
+      <el-table-column prop="price" label="退款金额" align="center" width="120">
         <template slot-scope="{ row }">
         <template slot-scope="{ row }">
-          <span v-if="row.status === 2">{{ row.memberNum }}</span>
-          <span v-else>{{ row.orderIdList.length }}</span>
+          {{ row.refundFee | amountfilters }}
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column prop="orderIdList" label="关联订单" align="center" width="100">
+      <el-table-column prop="price" label="退款方式" align="center">
         <template slot-scope="{ row }">
         <template slot-scope="{ row }">
-          <template v-if="row.orderIdList">
-            <p v-for="item in row.orderIdList" :key="item">
-              {{ item ? item : '---' }}
-            </p>
+          <template v-if="row.returnedWay === '4'">
+            <span>未支付无退款</span>
+          </template>
+          <template v-if="row.returnedWay === '1'">
+            <template v-if="row.refundBalanceFee && row.refundBalanceFee > 0">
+              <span>余额账户:{{ row.refundBalanceFee | amountfilters }}</span>
+            </template>
+            <template v-if="row.refundOnlineFee && row.refundOnlineFee > 0">
+              <span>线上退回:{{ row.refundOnlineFee | amountfilters }}</span>
+            </template>
+            <template v-if="row.refundOfflineFee && row.refundOfflineFee > 0">
+              <span>线下转账:{{ row.refundOfflineFee | amountfilters }}</span>
+            </template>
           </template>
           </template>
-          <p v-else>---</p>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column prop="status" label="小程序状态" align="center" width="100">
-        <template slot-scope="{ row }">
-          <el-tag v-if="row.status === 1" type="warning" size="small">拼团中</el-tag>
-          <el-tag v-if="row.status === 2" type="success" size="small">已拼成</el-tag>
-        </template>
+      <el-table-column prop="" label="申请人" align="center" width="100">
+        <span>---</span>
       </el-table-column>
       </el-table-column>
-      <el-table-column prop="startTime" label="开始时间" align="center" width="100">
+      <el-table-column prop="returnTime" label="申请时间" align="center" width="100">
         <template slot-scope="{ row }">
         <template slot-scope="{ row }">
-          {{ row.startTime ? row.startTime : '---' }}
+          {{ row.returnTime ? row.returnTime : '---' }}
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column prop="endTime" label="结束时间" align="center" width="100">
-        <template slot-scope="{ row }">
-          {{ row.endTime ? row.endTime : '---' }}
-        </template>
+      <el-table-column prop="" label="审核人" align="center" width="100">
+        <span>---</span>
       </el-table-column>
       </el-table-column>
-      <el-table-column prop="completeTime" label="成团时间" align="center" width="100">
-        <template slot-scope="{ row }">
-          {{ row.completeTime ? row.completeTime : '---' }}
-        </template>
+      <el-table-column prop="" label="审核时间" align="center" width="100">
+        <span>---</span>
       </el-table-column>
       </el-table-column>
       <el-table-column fixed="right" label="操作" align="center">
       <el-table-column fixed="right" label="操作" align="center">
         <template slot-scope="{ row }">
         <template slot-scope="{ row }">
-          <el-button
-            v-if="row.status === 1"
-            type="primary"
-            size="mini"
-            style="margin: 2px"
-            @click="handleRecordDetail(3, row)"
-          >
-            一键成团
-          </el-button>
-          <el-button type="danger" size="mini" style="margin: 2px" @click="handleRecordDetail(3, row)">
-            拼团成员
-          </el-button>
+          <el-button type="primary" size="mini" @click="handleRecordDetail(3, row)"> 查看详情 </el-button>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
@@ -149,13 +139,13 @@
       :page-size="20"
       :page-size="20"
       :page.sync="listQuery.pageNum"
       :page.sync="listQuery.pageNum"
       :limit.sync="listQuery.pageSize"
       :limit.sync="listQuery.pageSize"
-      @pagination="getHeHeCollageRecord"
+      @pagination="returnedPurchaseList"
     />
     />
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
-import { getHeHeCollageRecord } from '@/api/stricts/active/active'
+import { returnedPurchaseList } from '@/api/stricts/order/order'
 import pickerOptions from '@/utils/time-picker.js'
 import pickerOptions from '@/utils/time-picker.js'
 export default {
 export default {
   name: 'GroupsList',
   name: 'GroupsList',
@@ -166,10 +156,13 @@ export default {
       pickerOptions,
       pickerOptions,
       isLoading: true,
       isLoading: true,
       listQuery: {
       listQuery: {
-        id: '',
-        productName: '',
+        returnedNo: '',
+        shopOrderId: '',
+        shopOrderNo: '',
+        name: '',
+        beginTime: '',
+        endTime: '',
         status: '',
         status: '',
-        shopName: '',
         pageNum: 1,
         pageNum: 1,
         pageSize: 20
         pageSize: 20
       },
       },
@@ -187,13 +180,13 @@ export default {
     getList() {
     getList() {
       this.list = []
       this.list = []
       this.listQuery.pageNum = 1
       this.listQuery.pageNum = 1
-      this.getHeHeCollageRecord()
+      this.returnedPurchaseList()
     },
     },
     // 获取首页导航列表
     // 获取首页导航列表
-    async getHeHeCollageRecord() {
+    async returnedPurchaseList() {
       try {
       try {
         this.isLoading = true
         this.isLoading = true
-        const res = await getHeHeCollageRecord(this.listQuery)
+        const res = await returnedPurchaseList(this.listQuery)
         this.list = res.data.results
         this.list = res.data.results
         this.total = res.data.totalRecord
         this.total = res.data.totalRecord
         this.isLoading = false
         this.isLoading = false
@@ -201,6 +194,17 @@ export default {
         console.log(error)
         console.log(error)
       }
       }
     },
     },
+    // 选择时间
+    handleDatePick() {
+      if (this.time && this.time.length > 0) {
+        this.listQuery.beginTime = this.time[0]
+        this.listQuery.endTime = this.time[1]
+      } else {
+        this.listQuery.beginTime = ''
+        this.listQuery.endTime = ''
+      }
+      this.getList()
+    },
     // 菜单排序
     // 菜单排序
     async consultSort(row) {
     async consultSort(row) {
       try {
       try {

+ 48 - 32
src/views/stricts/retails/components/shop-dialog.vue → src/views/stricts/retails/components/goods-dialog.vue

@@ -1,17 +1,33 @@
 <template>
 <template>
-  <el-dialog
-    title="添加供应商"
-    :visible.sync="visible"
-    width="1200px"
-    :close-on-click-modal="false"
-    :show-close="false"
-  >
+  <el-dialog title="添加商品" :visible.sync="visible" width="1200px" :close-on-click-modal="false" :show-close="false">
     <div class="filter-container">
     <div class="filter-container">
       <div class="filter-control">
       <div class="filter-control">
-        <span>供应商名称:</span>
+        <span>ID:</span>
+        <el-input
+          v-model="listQuery.productId"
+          placeholder="商品ID"
+          clearable
+          style="width: 160px"
+          @keyup.enter.native="getList"
+          @clear="getList"
+        />
+      </div>
+      <div class="filter-control">
+        <span>商品名称:</span>
+        <el-input
+          v-model="listQuery.name"
+          placeholder="商品名称"
+          clearable
+          style="width: 160px"
+          @keyup.enter.native="getList"
+          @clear="getList"
+        />
+      </div>
+      <div class="filter-control">
+        <span>商品名称:</span>
         <el-input
         <el-input
           v-model="listQuery.shopName"
           v-model="listQuery.shopName"
-          placeholder="供应商名称"
+          placeholder="商名称"
           clearable
           clearable
           style="width: 160px"
           style="width: 160px"
           @keyup.enter.native="getList"
           @keyup.enter.native="getList"
@@ -30,17 +46,22 @@
       border
       border
       @selection-change="handleSelectionChange"
       @selection-change="handleSelectionChange"
     >
     >
-      <el-table-column type="selection" width="55" :selectable="selectable" />
-      <el-table-column label="供应商名称" prop="name" align="center" />
-      <el-table-column label="联系人" prop="linkMan" align="center" />
-      <el-table-column label="手机号" prop="contractMobile" align="center">
+      <el-table-column type="selection" width="55" />
+      <el-table-column label="商品ID" prop="productId" align="center" width="100" />
+      <el-table-column prop="mainImage" label="商品图片" align="center" width="120">
         <template slot-scope="{ row }">
         <template slot-scope="{ row }">
-          {{ row.contractMobile ? row.contractMobile : '---' }}
+          <el-popover v-if="row.mainImage" placement="top-start" title="" width="120" trigger="hover">
+            <img :src="row.mainImage" alt="" style="width: 80px; height: 80px" />
+            <img slot="reference" :src="row.mainImage" alt="" style="width: 80px; height: 80px" />
+          </el-popover>
+          <span v-else>---</span>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column label="供应商状态" prop="status" align="center">
+      <el-table-column label="商品名称" prop="name" align="center" />
+      <el-table-column label="供应商" prop="shopName" align="center" />
+      <el-table-column prop="price" label="售价" align="center">
         <template slot-scope="{ row }">
         <template slot-scope="{ row }">
-          <el-tag v-if="row.status === 90" type="success" size="small">已上线</el-tag>
+          {{ row.price | amountfilters }}
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
@@ -51,7 +72,7 @@
       :page-size="100"
       :page-size="100"
       :page.sync="listQuery.pageNum"
       :page.sync="listQuery.pageNum"
       :limit.sync="listQuery.pageSize"
       :limit.sync="listQuery.pageSize"
-      @pagination="getShopList"
+      @pagination="getSalesActivityProducts"
     />
     />
     <div slot="footer">
     <div slot="footer">
       <el-button @click="handleCanle"> 取 消 </el-button>
       <el-button @click="handleCanle"> 取 消 </el-button>
@@ -61,10 +82,10 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { getShopList } from '@/api/user/customer/customer'
+import { getSalesActivityProducts } from '@/api/stricts/user/user'
 
 
 export default {
 export default {
-  name: 'ShopDialog',
+  name: 'GoodsDialog',
   filters: {
   filters: {
     NumFormat(value) {
     NumFormat(value) {
       // 处理金额
       // 处理金额
@@ -75,9 +96,12 @@ export default {
     return {
     return {
       visible: true,
       visible: true,
       listQuery: {
       listQuery: {
+        productId: '',
+        userId: this.$route.query.userId * 1, // 分销者userId,
+        name: '', // 商品名称,
+        shopName: '', // / 供应商名称,
         pageNum: 1, // 页码
         pageNum: 1, // 页码
-        pageSize: 100, // 页面数据数
-        shopName: '' // 供应商公司名称
+        pageSize: 100 // 页面数据数
       },
       },
       list: [],
       list: [],
       total: 0,
       total: 0,
@@ -98,12 +122,12 @@ export default {
     async getList() {
     async getList() {
       this.list = []
       this.list = []
       this.listQuery.pageNum = 1
       this.listQuery.pageNum = 1
-      this.getShopList()
+      this.getSalesActivityProducts()
     },
     },
     // 获取所有供应商列表
     // 获取所有供应商列表
-    async getShopList() {
+    async getSalesActivityProducts() {
       try {
       try {
-        const res = await getShopList(this.listQuery)
+        const res = await getSalesActivityProducts(this.listQuery)
         this.list = res.data.results
         this.list = res.data.results
         this.total = res.data.totalRecord
         this.total = res.data.totalRecord
         this.isLoading = false
         this.isLoading = false
@@ -124,14 +148,6 @@ export default {
       // 取消弹窗
       // 取消弹窗
       this.$emit('cancel')
       this.$emit('cancel')
     },
     },
-    // 已选择的禁用勾选框
-    selectable(row) {
-      if (row.flag) {
-        return true
-      } else {
-        return false
-      }
-    },
     checkedInput(event, type) {
     checkedInput(event, type) {
       let pattern = ''
       let pattern = ''
       switch (type) {
       switch (type) {

+ 81 - 7
src/views/stricts/retails/list.vue

@@ -24,7 +24,7 @@
       </div>
       </div>
       <div class="filter-control">
       <div class="filter-control">
         <el-button type="primary" @click="getList"> 查询 </el-button>
         <el-button type="primary" @click="getList"> 查询 </el-button>
-        <el-button type="primary" @click="getList"> 添加分销者 </el-button>
+        <el-button type="primary" @click="addRetailsDialog = true"> 添加分销者 </el-button>
       </div>
       </div>
     </div>
     </div>
     <!-- 列表 -->
     <!-- 列表 -->
@@ -56,10 +56,8 @@
       </el-table-column>
       </el-table-column>
       <el-table-column fixed="right" label="操作" align="center" width="400">
       <el-table-column fixed="right" label="操作" align="center" width="400">
         <template slot-scope="{ row }">
         <template slot-scope="{ row }">
-          <el-button type="primary" size="mini" style="margin: 4px" @click="handleRecordDetail(3, row)">
-            编辑
-          </el-button>
-          <el-button type="primary" size="mini" style="margin: 4px" @click="handleRecordDetail(3, row)">
+          <el-button type="primary" size="mini" style="margin: 4px" @click="handleEditRetails(row)"> 编辑 </el-button>
+          <el-button type="primary" size="mini" style="margin: 4px" @click="handleRetailsGoods(row)">
             活动商品
             活动商品
           </el-button>
           </el-button>
         </template>
         </template>
@@ -74,11 +72,38 @@
       :limit.sync="listQuery.pageSize"
       :limit.sync="listQuery.pageSize"
       @pagination="getHeHeSalesList"
       @pagination="getHeHeSalesList"
     />
     />
+    <!-- 添加分销者 -->
+    <el-dialog
+      title="添加分销者"
+      :visible.sync="addRetailsDialog"
+      width="500px"
+      :close-on-click-modal="false"
+      :show-close="false"
+    >
+      <el-form
+        ref="retailsForm"
+        :model="retailsForm"
+        :rules="retailsFormRules"
+        label-width="80px"
+        label-position="right"
+      >
+        <el-form-item label="姓名:" prop="name">
+          <el-input v-model="retailsForm.name" maxlength="15" style="width: 200px" />
+        </el-form-item>
+        <el-form-item label="手机号:" prop="mobile">
+          <el-input v-model="retailsForm.mobile" maxlength="11" style="width: 200px" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer">
+        <el-button @click="closeAddRetailsDialog"> 取 消 </el-button>
+        <el-button type="primary" @click="handleConfirm"> 确 定 </el-button>
+      </div>
+    </el-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
-import { getHeHeSalesList } from '@/api/stricts/user/user'
+import { getHeHeSalesList, saveSales } from '@/api/stricts/user/user'
 export default {
 export default {
   name: 'RetailsList',
   name: 'RetailsList',
   filters: {},
   filters: {},
@@ -92,7 +117,16 @@ export default {
         pageSize: 20
         pageSize: 20
       },
       },
       list: [],
       list: [],
-      total: 0
+      total: 0,
+      addRetailsDialog: false,
+      retailsForm: {
+        name: '',
+        mobile: ''
+      },
+      retailsFormRules: {
+        name: [{ required: true, message: '请输入分销者姓名', trigger: ['blur'] }],
+        mobile: [{ required: true, message: '请输入分销者联系方式', trigger: ['blur'] }]
+      }
     }
     }
   },
   },
   computed: {},
   computed: {},
@@ -118,6 +152,46 @@ export default {
       } catch (error) {
       } catch (error) {
         console.log(error)
         console.log(error)
       }
       }
+    },
+    // 编辑分销者
+    handleEditRetails(row) {
+      this.retailsForm.name = row.name
+      this.retailsForm.mobile = row.mobile
+      this.addRetailsDialog = true
+    },
+    // 取消添加分销者
+    closeAddRetailsDialog() {
+      this.$refs.retailsForm.resetFields()
+      this.addRetailsDialog = false
+    },
+
+    // 确定添加分销者
+    async handleConfirm() {
+      try {
+        await this.$refs.retailsForm.validate()
+        this.saveSalesSubmit()
+      } catch (error) {
+        console.log(error)
+      }
+    },
+
+    // 提交添加分销者信息
+    async saveSalesSubmit() {
+      try {
+        await saveSales(this.retailsForm)
+        this.$message.success('添加分销者成功')
+        this.getList()
+      } catch (error) {
+        console.log(error)
+      }
+      this.closeAddRetailsDialog()
+    },
+    // 跳转分销者活动商品列表
+    handleRetailsGoods(row) {
+      this.$router.push({
+        path: '/stricts/user/retails-goods-list',
+        query: { userId: row.userId }
+      })
     }
     }
   }
   }
 }
 }

+ 196 - 0
src/views/stricts/retails/retails-goods-list.vue

@@ -0,0 +1,196 @@
+<template>
+  <div class="app-container">
+    <!-- 顶部操作区域 -->
+    <div class="filter-container">
+      <div class="filter-control">
+        <span>商品名称:</span>
+        <el-input
+          v-model="listQuery.name"
+          placeholder="商品名称"
+          clearable
+          @keyup.enter.native="getList"
+          @clear="getList"
+        />
+      </div>
+      <div class="filter-control">
+        <span>供应商名称:</span>
+        <el-input
+          v-model="listQuery.shopName"
+          placeholder="供应商名称"
+          clearable
+          @keyup.enter.native="getList"
+          @clear="getList"
+        />
+      </div>
+      <div class="filter-control">
+        <el-button type="primary" @click="getList"> 查询 </el-button>
+        <el-button type="primary" @click="getList"> 一键排序 </el-button>
+        <el-button type="primary" @click="goodsDialogVisible = true"> 添加商品 </el-button>
+      </div>
+    </div>
+    <!-- 列表 -->
+    <el-table v-loading="isLoading" :data="list" border style="width: 100%" height="660">
+      <el-table-column prop="productImage" label="商品图片" align="center" width="120">
+        <template v-if="row.productImage" slot-scope="{ row }">
+          <el-popover placement="top-start" title="" width="180" trigger="hover">
+            <img :src="row.productImage" alt="" style="width: 150px; height: 150px" />
+            <img slot="reference" :src="row.productImage" alt="" style="width: 80px; height: 80px" />
+          </el-popover>
+        </template>
+        <template v-else>
+          <span>---</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="productName" label="商品名称" align="center" />
+      <el-table-column prop="shopName" label="供应商名称" align="center" />
+      <el-table-column prop="price" label="售价" align="center">
+        <template slot-scope="{ row }">
+          {{ row.price | amountfilters }}
+        </template>
+      </el-table-column>
+      <el-table-column prop="price" label="活动价" align="center">
+        <template slot-scope="{ row }">
+          {{ row.price | amountfilters }}
+        </template>
+      </el-table-column>
+      <el-table-column prop="sortIndex" label="排序" width="100" align="center">
+        <template slot-scope="{ row }">
+          <el-input v-model="row.sortIndex" maxlength="4" minlength="1" @blur="consultSort(row)" />
+        </template>
+      </el-table-column>
+      <el-table-column fixed="right" label="操作" align="center">
+        <template slot-scope="{ row }">
+          <el-button type="primary" size="mini" style="margin: 2px" @click="handleRecordDetail(3, row)">
+            编辑
+          </el-button>
+          <el-button type="danger" size="mini" style="margin: 2px" @click="handleRecordDetail(3, row)">
+            删除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- 页码 -->
+    <pagination
+      :total="total"
+      :page-sizes="[10, 20, 30, 100]"
+      :page-size="20"
+      :page.sync="listQuery.pageNum"
+      :limit.sync="listQuery.pageSize"
+      @pagination="getSalesProducts"
+    />
+    <!--  添加商品弹窗 -->
+    <goods-dialog v-if="goodsDialogVisible" ref="goodDialog" @confirm="handleAddGoodConfirm" @cancel="handleCancel" />
+  </div>
+</template>
+
+<script>
+import { getSalesProducts, saveSalesProducts } from '@/api/stricts/user/user'
+import GoodsDialog from './components/goods-dialog'
+export default {
+  name: 'RetailsGoodsList',
+  components: { GoodsDialog },
+  filters: {
+    invoiceFilters(value) {
+      const map = {
+        1: '普通发票',
+        2: '增值税发票',
+        3: '不开发票'
+      }
+      return map[value]
+    }
+  },
+  data() {
+    return {
+      isLoading: true,
+      listQuery: {
+        userId: this.$route.query.userId * 1, // 分销者userId,
+        name: '', // 商品名称,
+        shopName: '', // / 供应商名称,
+        pageNum: 1,
+        pageSize: 20
+      },
+      list: [],
+      total: 0,
+      goodsDialogVisible: false
+    }
+  },
+  computed: {},
+  created() {
+    this.getList()
+  },
+  mounted() {},
+  methods: {
+    // 获取行为记录列表
+    getList() {
+      this.list = []
+      this.listQuery.pageNum = 1
+      this.getSalesProducts()
+    },
+    // 获取首页导航列表
+    async getSalesProducts() {
+      try {
+        this.isLoading = true
+        const res = await getSalesProducts(this.listQuery)
+        this.list = res.data.results
+        this.total = res.data.totalRecord
+        this.isLoading = false
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 确认添加商品
+    handleAddGoodConfirm(data) {
+      console.log('data', data)
+      const productIds = []
+      data.forEach((ele) => {
+        productIds.push(ele.productId)
+      })
+      this.saveSalesProducts({ userId: this.listQuery.userId * 1, productIds: productIds.join(',') })
+    },
+    // 保存添加商品
+    async saveSalesProducts(params) {
+      try {
+        await saveSalesProducts(params)
+        this.goodsDialogVisible = false
+        this.$message.success('操作成功')
+        this.getList()
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 取消选择供应商
+    handleCancel() {
+      this.goodsDialogVisible = false
+      this.$refs.shopDialog.visible = false
+    },
+    // 菜单排序
+    async consultSort(row) {
+      try {
+        // await consultSort({ id: row.id, sortNumber: row.sortNumber })
+        this.getList()
+      } catch (error) {
+        console.log(error)
+      }
+    }
+  }
+}
+</script>
+
+<style>
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+  float: left;
+}
+.uploader-tips {
+  position: absolute;
+  bottom: 0;
+  left: 160px;
+  line-height: 28px;
+  color: red;
+  margin: 0;
+}
+</style>