浏览代码

商家端

潘超林 4 月之前
父节点
当前提交
336b348700

+ 15 - 0
src/api/active/index.js

@@ -15,3 +15,18 @@ export function promotionSku(query) {
         data: query
     })
 }
+
+export function spuList(query) {
+    return request({
+        url: '/system/promotion/spu/list',
+        method: 'get',
+        params: query
+    })
+}
+
+export function spuRemove(query) {
+    return request({
+        url: '/system/promotion/spu/' + query,
+        method: 'delete',
+    })
+}

+ 18 - 0
src/api/manage/client.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+
+
+export function customerList(query) {
+    return request({
+        url: '/system/order/customer/list',
+        method: 'get',
+        params: query
+    })
+}
+export function customerExport(query) {
+    return request({
+        url: '/system/order/customer/export',
+        method: 'post',
+        data: query
+    })
+}
+

+ 11 - 0
src/api/manage/product.js

@@ -0,0 +1,11 @@
+import request from '@/utils/request'
+
+
+export function getGoodsListPage(query) {
+    return request({
+        url: '/system/goods/getGoodsListPage',
+        method: 'get',
+        params: query
+    })
+}
+

+ 84 - 31
src/utils/derive.js

@@ -32,38 +32,91 @@ function exportExcel(columns, datas, downloadName) {
 }
 function dataImpl(data) {
     data.forEach(e => {
-        if (e.afterSaleStatus) {
-            if (e.afterSaleStatus == 0) {
-                e.afterSaleStatus = '未申请';
-            }
-            switch (e.afterSaleStatus) {
-                case 1: e.afterSaleStatus = '已申请'; break;
-                case 2: e.afterSaleStatus = '审核失败'; break;
-                case 3: e.afterSaleStatus = '审核成功(退款中)'; break;
-                case 4: e.afterSaleStatus = '退款成功'; break;
-                case 5: e.afterSaleStatus = '退款失败(联系客服解决)'; break;
-            }
-        } else if (e.orderStatus) {
-            switch (e.orderStatus) {
-                case 0:
-                    e.orderStatus = '待商家确认修改运费';
-                    break;
-                case 10: e.orderStatus = '等待买家支付'; break;
-                case 20: e.orderStatus = '等待商家发布货运信息'; break;
-                case 90: e.orderStatus = '等待司机接单'; break;
-                case 100: e.orderStatus = '等待司机支付保证金'; break;
-                case 110: e.orderStatus = '等待司机装货)'; break;
-                case 120: e.orderStatus = '已装货,运输中'; break;
-                case 30: e.orderStatus = '司机已到达,等待买家签收'; break;
-                case 40: e.orderStatus = '买家已收货'; break;
-                case 50: e.orderStatus = '已取消'; break;
-                case 60: e.orderStatus = '退款中'; break;
-                case 70: e.orderStatus = '退款成功'; break;
-                case 80: e.orderStatus = '退款失败'; break;
-                case 130: e.orderStatus = '待处理售后'; break;
-                case 140: e.orderStatus = '已处理售后'; break;
-            }
+        if (e.goodsAmount) {
+            e.goodsAmount = e.goodsAmount.toFixed(2)
         }
+        if (e.specsValue.length < 1) {
+            e.specsValue = ""
+        }
+        if (e.orderStatus == '0') {
+            e.orderStatus = '待商家确认修改运费';
+        } else if (e.orderStatus == '10') {
+            e.orderStatus = '等待买家支付';
+        } else if (e.orderStatus == '20') {
+            e.orderStatus = '等待商家发布货运信息';
+        } else if (e.orderStatus == '90') {
+            e.orderStatus = '等待司机接单';
+        } else if (e.orderStatus == '100') {
+            e.orderStatus = '等待司机支付保证金';
+        } else if (e.orderStatus == '110') {
+            e.orderStatus = '等待司机装货';
+        } else if (e.orderStatus == '120') {
+            e.orderStatus = '已装货,运输中';
+        } else if (e.orderStatus == '30') {
+            e.orderStatus = '司机已到达,等待买家签收';
+        } else if (e.orderStatus == '40') {
+            e.orderStatus = '买家已收货';
+        } else if (e.orderStatus == '50') {
+            e.orderStatus = '已取消';
+        } else if (e.orderStatus == '60') {
+            e.orderStatus = '退款中';
+        } else if (e.orderStatus == '70') {
+            e.orderStatus = '退款成功';
+        } else if (e.orderStatus == '80') {
+            e.orderStatus = '退款失败';
+        } else if (e.orderStatus == '130') {
+            e.orderStatus = '待处理售后';
+        } else if (e.orderStatus == '140') {
+            e.orderStatus = '已处理售后';
+        }
+
+        if (e.afterSaleStatus == '0') {
+            e.afterSaleStatus = '未申请';
+        } else if (e.afterSaleStatus == '1') {
+            e.afterSaleStatus = '已申请';
+        } else if (e.afterSaleStatus == '2') {
+            e.afterSaleStatus = '审核失败';
+        } else if (e.afterSaleStatus == '3') {
+            e.afterSaleStatus = '审核成功(退款中)';
+        } else if (e.afterSaleStatus == '4') {
+            e.afterSaleStatus = '退款成功';
+        } else if (e.afterSaleStatus == '5') {
+            e.afterSaleStatus = '退款失败(联系客服解决)';
+        }
+
+        // if (e.afterSaleStatus) {
+        //     if (e.afterSaleStatus == 0) {
+        //         e.afterSaleStatus = '未申请';
+        //     }
+        //     switch (e.afterSaleStatus) {
+        //         case '1': e.afterSaleStatus = '已申请'; break;
+        //         case '2': e.afterSaleStatus = '审核失败'; break;
+        //         case '3': e.afterSaleStatus = '审核成功(退款中)'; break;
+        //         case '4': e.afterSaleStatus = '退款成功'; break;
+        //         case '5': e.afterSaleStatus = '退款失败(联系客服解决)'; break;
+        //     }
+        // }
+        // else if (e.orderStatus) {
+        //     switch (e.orderStatus) {
+        //         case 0:
+        //             e.orderStatus = '待商家确认修改运费';
+        //             break;
+        //         case 10: e.orderStatus = '等待买家支付'; break;
+        //         case 20: e.orderStatus = '等待商家发布货运信息'; break;
+        //         case 90: e.orderStatus = '等待司机接单'; break;
+        //         case 100: e.orderStatus = '等待司机支付保证金'; break;
+        //         case 110: e.orderStatus = '等待司机装货'; break;
+        //         case 120: e.orderStatus = '已装货,运输中'; break;
+        //         case 30: e.orderStatus = '司机已到达,等待买家签收'; break;
+        //         case 40: e.orderStatus = '买家已收货'; break;
+        //         case 50: e.orderStatus = '已取消'; break;
+        //         case 60: e.orderStatus = '退款中'; break;
+        //         case 70: e.orderStatus = '退款成功'; break;
+        //         case 80: e.orderStatus = '退款失败'; break;
+        //         case 130: e.orderStatus = '待处理售后'; break;
+        //         case 140: e.orderStatus = '已处理售后'; break;
+        //     }
+        // }
 
     });
     return data;

+ 12 - 8
src/views/index.vue

@@ -16,14 +16,16 @@
                 <div>
                   <span>
                     +{{
-                      statistics.totalSalePriceRate ? statistics.totalSalePriceRate : "0%"
+                      statistics.totalSalePriceRate
+                        ? statistics.totalSalePriceRate + "%"
+                        : "0%"
                     }}
                   </span>
                 </div>
                 <div>
                   <span> 今日新增</span>
                   <span>
-                    {{ statistics.daySalePrice ? statistics.daySalePrice : 0 }}
+                    {{ statistics.daySalePrice ? statistics.daySalePrice : 0 }}
                   </span>
                 </div>
               </div>
@@ -43,14 +45,16 @@
                 <div>
                   <span>
                     +{{
-                      statistics.totalSeeCountRate ? statistics.totalSeeCountRate : "0%"
+                      statistics.totalSeeCountRate
+                        ? statistics.totalSeeCountRate + "%"
+                        : "0%"
                     }}
                   </span>
                 </div>
                 <div>
                   <span> 今日新增</span>
                   <span>
-                    {{ statistics.daySeeCount ? statistics.daySeeCount : 0 }}
+                    {{ statistics.daySeeCount ? statistics.daySeeCount : 0 }}
                   </span>
                 </div>
               </div>
@@ -71,7 +75,7 @@
                   <span>
                     +{{
                       statistics.totalOrderCountRate
-                        ? statistics.totalOrderCountRate
+                        ? statistics.totalOrderCountRate + "%"
                         : "0%"
                     }}
                   </span>
@@ -79,7 +83,7 @@
                 <div>
                   <span> 今日新增</span>
                   <span>
-                    {{ statistics.dayOrderCount ? statistics.dayOrderCount : 0 }}
+                    {{ statistics.dayOrderCount ? statistics.dayOrderCount : 0 }}
                   </span>
                 </div>
               </div>
@@ -100,7 +104,7 @@
                   <span>
                     +{{
                       statistics.totalRefundPriceRate
-                        ? statistics.totalRefundPriceRate
+                        ? statistics.totalRefundPriceRate + "%"
                         : "0%"
                     }}
                   </span>
@@ -108,7 +112,7 @@
                 <div>
                   <span> 今日新增</span>
                   <span>
-                    {{ statistics.dayRefundPrice ? statistics.dayRefundPrice : 0 }}
+                    {{ statistics.dayRefundPrice ? statistics.dayRefundPrice : 0 }}
                   </span>
                 </div>
               </div>

+ 214 - 34
src/views/manage/active.vue

@@ -36,11 +36,7 @@ a
       </el-form-item>
     </el-form>
 
-    <el-table
-      v-loading="loading"
-      :data="configList"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table v-loading="loading" :data="activeList">
       <el-table-column label="活动名称" align="center" prop="title" />
       <el-table-column
         label="活动介绍"
@@ -49,13 +45,13 @@ a
         :show-overflow-tooltip="true"
       >
       </el-table-column>
-      <el-table-column
+      <!-- <el-table-column
         label="活动详情"
         align="center"
         prop="content"
         :show-overflow-tooltip="true"
       >
-      </el-table-column>
+      </el-table-column> -->
       <el-table-column label="活动海报" align="center" prop="img">
         <template slot-scope="scope">
           <el-image
@@ -67,6 +63,35 @@ a
           </el-image>
         </template>
       </el-table-column>
+      <el-table-column label="活动背景图" align="center" prop="bgImg">
+        <template slot-scope="scope">
+          <el-image
+            v-if="scope.row.bgImg"
+            style="width: 60px; height: 60px"
+            :src="scope.row.img"
+            :preview-src-list="[scope.row.bgImg]"
+          >
+          </el-image>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="活动标签" align="center" prop="bgImg">
+        <template slot-scope="scope">
+          <el-tag type="success" v-if="scope.row.tag > 0">{{
+            scope.row.tag == 1
+              ? "年货节"
+              : scope.row.tag == 2
+              ? "6.18"
+              : scope.row.tag == 3
+              ? "国庆大促"
+              : scope.row.tag == 4
+              ? "双十一"
+              : scope.row.tag == 5
+              ? "双十二"
+              : ""
+          }}</el-tag>
+        </template>
+      </el-table-column>
 
       <el-table-column label="浏览量" align="center" prop="hits" />
 
@@ -74,7 +99,7 @@ a
         <template slot-scope="scope">
           {{
             scope.row.startTime
-              ? $moment(scope.row.startTime).format("YYYY-MM-DD HH:mm:ss")
+              ? $moment(scope.row.startTime).format("yyyy-MM-DD HH:mm:ss")
               : ""
           }}
         </template>
@@ -84,7 +109,7 @@ a
         <template slot-scope="scope">
           {{
             scope.row.endTime
-              ? $moment(scope.row.endTime).format("YYYY-MM-DD HH:mm:ss")
+              ? $moment(scope.row.endTime).format("yyyy-MM-DD HH:mm:ss")
               : ""
           }}
         </template>
@@ -120,13 +145,12 @@ a
         </template>
       </el-table-column>
 
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" width="200">
         <template slot-scope="scope">
           <el-button
             v-if="scope.row.isJoin == 0"
             size="mini"
             type="text"
-            icon="el-icon-edit"
             @click="handleParticipate(scope.row)"
             v-hasPermi="['active:add']"
             >参与活动</el-button
@@ -135,7 +159,6 @@ a
             v-if="scope.row.isJoin == 1"
             size="mini"
             type="text"
-            icon="el-icon-edit"
             @click="ParticipateEdit(scope.row)"
             v-hasPermi="['active:edit']"
             >编辑商品</el-button
@@ -143,7 +166,6 @@ a
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-edit"
             @click="handleDetail(scope.row)"
             v-hasPermi="['active:detail']"
             >活动详情</el-button
@@ -155,14 +177,14 @@ a
     <pagination
       v-show="total > 0"
       :total="total"
-      :page.sync="queryParams.pageNum"
+      :page.sync="queryParams.pageNo"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
 
     <!-- 添加或修改用户配置对话框 -->
     <el-dialog title="详情" :visible.sync="detailOpen" width="600px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
         <el-row>
           <el-col :span="24">
             <el-form-item label="活动名称" prop="title">
@@ -180,12 +202,33 @@ a
             </el-form-item>
           </el-col>
           <el-col :span="24">
-            <el-form-item label="活动时间" prop="dateRange">
+            <el-form-item label="活动标签" prop="content">
+              <el-tag type="success" v-if="form.tag > 0">{{
+                form.tag == 1
+                  ? "年货节"
+                  : form.tag == 2
+                  ? "6.18"
+                  : form.tag == 3
+                  ? "国庆大促"
+                  : form.tag == 4
+                  ? "双十一"
+                  : form.tag == 5
+                  ? "双十二"
+                  : ""
+              }}</el-tag>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="活动开始时间" prop="dateRange">
               {{
                 form.startTime
                   ? $moment(form.startTime).format("YYYY-MM-DD HH:mm:ss")
                   : ""
-              }}-
+              }}
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="活动结束时间" prop="dateRange">
               {{
                 form.endTime ? $moment(form.endTime).format("YYYY-MM-DD HH:mm:ss") : ""
               }}
@@ -193,7 +236,12 @@ a
           </el-col>
           <el-col :span="24">
             <el-form-item label="活动海报">
-              <img v-if="imageUrl" :src="imageUrl" class="avatar" />
+              <img v-if="form.img" :src="form.img" class="avatar" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="活动背景图">
+              <img v-if="form.bgImg" :src="form.bgImg" class="avatar" />
             </el-form-item>
           </el-col>
           <el-col :span="24">
@@ -206,43 +254,104 @@ a
     </el-dialog>
 
     <!-- 添加或修改用户配置对话框 -->
-    <el-dialog title="参与活动" :visible.sync="open" width="800px" append-to-body>
+    <el-dialog
+      title="参与活动"
+      :visible.sync="open"
+      width="1200px"
+      append-to-body
+      :destroy-on-close="true"
+      @close="open = false"
+    >
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-row>
           <el-col :span="24">
             <el-form-item label="适用商品" prop="title">
               <el-radio v-model="shop.type" :label="0">全部商品</el-radio>
               <el-radio v-model="shop.type" :label="1">指定商品</el-radio>
-              <span v-if="shop.type == 1" style="color: #134dd1b3; cursor: pointer"
+              <span
+                v-if="shop.type == 1"
+                style="color: #134dd1b3; cursor: pointer"
+                @click="selectSpu"
                 >选择商品</span
               >
             </el-form-item>
           </el-col>
-          <el-col :span="24" v-if="shop.type == 1">
+          <el-col :span="24">
+            <div style="margin-bottom: 10px; font-size: 18px">已选择商品</div>
             <el-table :data="shopList">
               <el-table-column label="商品名称" align="center" prop="title" />
-              <el-table-column label="商品图片" align="center" prop="title" />
-              <el-table-column label="商品单价" align="center" prop="title" />
-              <el-table-column label="库存" align="center" prop="title" />
-              <el-table-column label="起批量" align="center" prop="title" />
-              <el-table-column label="商品价格" align="center" prop="title" />
-              <el-table-column label="操作" align="center" prop="title" />
+              <el-table-column label="商品图片" align="center">
+                <template slot-scope="scope">
+                  <el-image
+                    v-if="scope.row.pic"
+                    style="width: 60px; height: 60px"
+                    :src="scope.row.pic"
+                    :preview-src-list="[scope.row.pic]"
+                  >
+                  </el-image>
+                </template>
+              </el-table-column>
+              <el-table-column label="商品价格" align="center">
+                <template slot-scope="scope">
+                  {{ scope.row.salePrice }}元/ {{ scope.row.unit }}
+                </template>
+              </el-table-column>
+              <el-table-column label="库存" align="center" prop="title">
+                <template slot-scope="scope">
+                  {{ scope.row.totalStocks }}/ {{ scope.row.unit }}
+                </template>
+              </el-table-column>
+              <el-table-column label="起批量" align="center">
+                <template slot-scope="scope">
+                  {{ scope.row.lowestPurchase }}/ {{ scope.row.unit }}
+                </template>
+              </el-table-column>
+              <el-table-column label="操作" align="center">
+                <template slot-scope="scope">
+                  <el-button
+                    size="mini"
+                    style="color: red"
+                    type="text"
+                    @click="shopRemove(scope.row)"
+                    >删除</el-button
+                  >
+                </template>
+              </el-table-column>
             </el-table>
+            <pagination
+              v-show="shopQuery.total > 0"
+              :total="shopQuery.total"
+              :page.sync="shopQuery.pageNo"
+              :limit.sync="shopQuery.pageSize"
+              @pagination="getShopList"
+            />
           </el-col>
         </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
+        <el-button @click="open = false">取 消</el-button>
       </div>
     </el-dialog>
+
+    <el-drawer
+      title="选择商品"
+      :visible.sync="shopOpen"
+      direction="rtl"
+      :before-close="shopOpen == false"
+      size="50%"
+    >
+      <productList type="active" @multipleTable="multipleTable"></productList>
+    </el-drawer>
   </div>
 </template>
 
 <script>
-import { promotionList, promotionSku } from "@/api/active/index";
+import { promotionList, promotionSku, spuList, spuRemove } from "@/api/active/index";
+import productList from "./product.vue";
 import moment from "moment";
 export default {
+  components: { productList },
   name: "Config",
   //   dicts: ["sys_yes_no"],
   data() {
@@ -252,8 +361,6 @@ export default {
       total: 0,
       // 弹出层标题
       title: "",
-      // 是否显示弹出层
-      open: false,
       // 日期范围
       dateRange: [],
       // 查询参数
@@ -268,6 +375,7 @@ export default {
       shop: {
         type: 0,
         promotionId: "",
+        skuList: [],
       },
       // 表单校验
       rules: {
@@ -279,24 +387,96 @@ export default {
       imageUrl: "",
       open: false,
       shopList: [],
+      activeList: [],
       ParticipateId: "",
+      shopQuery: {
+        pageSize: 5,
+        pageNo: 1,
+        title: "",
+        total: 0,
+      },
+      shopOpen: false,
     };
   },
   created() {
     this.getList();
   },
   methods: {
+    selectSpu() {
+      this.shopOpen = true;
+    },
+    multipleTable(val) {
+      console.log(val);
+
+      let list = [];
+      val.forEach((e) => {
+        list.push({
+          goodsInfo: e.goodsInfo,
+          spuId: e.id,
+        });
+      });
+      this.shop.skuList = list;
+      this.shop.promotionId = this.ParticipateId;
+      promotionSku(this.shop).then((res) => {
+        if (res.code == 200) {
+          this.$message({
+            type: "success",
+            message: "添加成功",
+          });
+          this.shopOpen = false;
+          this.getShopList();
+        }
+      });
+      this.shopOpen = false;
+    },
+    shopRemove(record) {
+      this.$confirm("是否把此商品移除该活动?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          spuRemove(record.id).then((res) => {
+            console.log("12312", res);
+            if (res.code == 200) {
+              this.$message({
+                type: "success",
+                message: "移除成功",
+              });
+              this.getShopList();
+            }
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消删除",
+          });
+        });
+    },
     ParticipateEdit(record) {
       this.ParticipateId = record.id;
-      this.open = true;
+      this.getShopList();
+    },
+    getShopList() {
+      this.shopQuery.promotionId = this.ParticipateId;
+      spuList(this.shopQuery).then((response) => {
+        this.shopList = response.data.records;
+        this.shopQuery.total = response.data.total;
+        this.loading = false;
+        this.open = true;
+      });
     },
+
     handleParticipate(record) {
       this.ParticipateId = record.id;
-      this.open = true;
+
+      this.getShopList();
     },
     handleDetail(record) {
       this.form = record;
       this.imageUrl = record.img;
+
       this.form.dateRange = [
         moment(record.startTime).format("yyyy-MM-DD hh:mm:ss"),
         moment(record.endTime).format("yyyy-MM-DD hh:mm:ss"),
@@ -309,7 +489,7 @@ export default {
       this.loading = true;
       promotionList(this.addDateRange(this.queryParams, this.dateRange)).then(
         (response) => {
-          this.configList = response.data.records;
+          this.activeList = response.data.records;
           this.total = response.data.total;
           this.loading = false;
         }

+ 87 - 75
src/views/manage/afterSaleOrder.vue

@@ -64,7 +64,7 @@
           style="width: 180px"
         />
       </el-form-item>
-      <el-form-item label="下单人手机号" prop="userPhone" label-width="140px">
+      <el-form-item label="买家手机号" prop="userPhone" label-width="140px">
         <el-input
           v-model="queryParams.userPhone"
           placeholder="请输入下单用户手机号"
@@ -106,29 +106,29 @@
           <el-option label="已处理售后" :value="140"> </el-option>
         </el-select>
       </el-form-item> -->
-      <el-form-item label="售后状态" prop="afterSaleStatus">
+      <el-form-item label="售后状态" prop="orderStatusKey">
         <el-select
-          v-model="queryParams.afterSaleStatus"
+          v-model="queryParams.orderStatusKey"
           placeholder="请选择支付方式"
           style="width: 180px"
         >
-          <el-option label="未申请" value="0"> </el-option>
-          <el-option label="已申请" value="1"> </el-option>
-          <el-option label="审核失败" value="2"> </el-option>
-          <el-option label="审核成功(退款中)" value="3"> </el-option>
+          <el-option label="已完成" value="ALREADY"> </el-option>
+          <el-option label="已拒绝" value="ALREADY_REFUSE"> </el-option>
+          <el-option label="待审核" value="WAIT_AUDIT"> </el-option>
+          <!-- <el-option label="审核成功(退款中)" value="3"> </el-option>
           <el-option label="退款成功" value="4"> </el-option>
-          <el-option label="退款失败(联系客服解决)" value="5"> </el-option>
+          <el-option label="退款失败(联系客服解决)" value="5"> </el-option> -->
         </el-select>
       </el-form-item>
 
-      <el-form-item label="支付方式">
+      <el-form-item label="支付方式" prop="paymentType">
         <el-select
           v-model="queryParams.paymentType"
           placeholder="请选择支付方式"
           style="width: 180px"
         >
-          <el-option label="支付宝" value="ALIPAY"> </el-option>
-          <el-option label="微信支付" value="WECHAT"> </el-option>
+          <el-option label="支付宝" value="alipay"> </el-option>
+          <el-option label="微信支付" value="wechat"> </el-option>
         </el-select>
       </el-form-item>
       <el-form-item>
@@ -177,7 +177,8 @@
           <el-image :src="scope.row.skuPic" style="width: 60px; height: 60px"> </el-image>
         </template>
       </el-table-column>
-      <el-table-column label="商品类型" align="center" prop="categoryName">
+
+      <el-table-column label="商品分类" align="center" prop="categoryName">
       </el-table-column>
       <el-table-column label="单价/数量" align="center" prop="price">
         <template slot-scope="scope">
@@ -189,6 +190,7 @@
       </el-table-column>
       <el-table-column label="包装方式" align="center" prop="packageType">
       </el-table-column>
+
       <el-table-column label="规格名称" align="center" prop="specsName" />
       <el-table-column label="规格值" align="center" prop="specsValue" />
       <el-table-column label="实付金额(元)" align="center" prop="goodsAmount">
@@ -207,6 +209,7 @@
         label="商品名称"
         align="center"
         prop="skuName"
+        width="150"
         :show-overflow-tooltip="true"
       >
       </el-table-column>
@@ -249,6 +252,20 @@
           }}
         </template>
       </el-table-column> -->
+      <el-table-column label="支付方式" align="center">
+        <template slot-scope="scope">
+          {{
+            scope.row.paymentType == "alipay"
+              ? "支付宝支付"
+              : scope.row.paymentType == "wechat"
+              ? "微信支付"
+              : scope.row.paymentType == "card"
+              ? "银行卡支付"
+              : ""
+          }}
+        </template>
+      </el-table-column>
+
       <el-table-column label="配送方式" align="center">
         <template slot-scope="scope">
           {{
@@ -304,7 +321,7 @@
     <pagination
       v-show="total > 0"
       :total="total"
-      :page.sync="queryParams.pageNum"
+      :page.sync="queryParams.pageNo"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
@@ -341,18 +358,24 @@
         <el-descriptions-item label="申请原因">{{
           detailInfo.dxAfterSaleVO ? detailInfo.dxAfterSaleVO.reason : ""
         }}</el-descriptions-item>
-        <el-descriptions-item label="申请时间">{{
-          detailInfo.dxAfterSaleVO ? detailInfo.dxAfterSaleVO.createTime : ""
-        }}</el-descriptions-item>
+        <el-descriptions-item label="申请时间">
+          {{
+            detailInfo.dxAfterSaleVO ? parseTime(detailInfo.dxAfterSaleVO.createTime) : ""
+          }}
+        </el-descriptions-item>
         <el-descriptions-item label="问题描述">{{
           detailInfo.dxAfterSaleVO ? detailInfo.dxAfterSaleVO.problemDesc : ""
         }}</el-descriptions-item>
         <el-descriptions-item label="实际退款金额(元)">{{
           detailInfo.dxAfterSaleVO ? detailInfo.dxAfterSaleVO.actualRefundAmount : ""
         }}</el-descriptions-item>
-        <el-descriptions-item label="退款时间">{{
-          detailInfo.dxAfterSaleVO ? detailInfo.dxAfterSaleVO.refundAuditTime : ""
-        }}</el-descriptions-item>
+        <el-descriptions-item label="退款时间">
+          {{
+            detailInfo.dxAfterSaleVO
+              ? parseTime(detailInfo.dxAfterSaleVO.refundAuditTime)
+              : ""
+          }}
+        </el-descriptions-item>
       </el-descriptions>
 
       <el-descriptions title="订单详情" column="3">
@@ -410,22 +433,22 @@
         <el-descriptions-item label="支付方式">
           {{
             detailInfo
-              ? detailInfo.paymentType == "ALIPAY"
+              ? detailInfo.paymentType == "alipay"
                 ? "支付宝"
-                : detailInfo.paymentType == "WECHAT"
+                : detailInfo.paymentType == "wechat"
                 ? "微信支付"
-                : detailInfo.paymentType == "CARD"
+                : detailInfo.paymentType == "card"
                 ? "银行卡支付"
                 : ""
               : ""
           }}</el-descriptions-item
         >
-        <el-descriptions-item label="下单时间">{{
-          detailInfo ? detailInfo.createTime : ""
-        }}</el-descriptions-item>
+        <el-descriptions-item label="下单时间">
+          {{ detailInfo ? parseTime(detailInfo.createTime) : "" }}
+        </el-descriptions-item>
         <el-descriptions-item label="付款时间">
-          {{ detailInfo ? detailInfo.paymentTime : "" }}</el-descriptions-item
-        >
+          {{ detailInfo ? parseTime(detailInfo.paymentTime) : "" }}
+        </el-descriptions-item>
         <el-descriptions-item label="担保服务费(元)">
           {{ detailInfo ? detailInfo.serviceFee : "" }}
         </el-descriptions-item>
@@ -534,8 +557,7 @@ import { statisticsAfterSaleOrder } from "@/api/manage/order";
 import { printOrder, equipmentList } from "@/api/manage/equipment";
 import Utils from "@/utils/derive";
 export default {
-  name: "Config",
-  //   dicts: ["sys_yes_no"],
+  name: "afterSaleOrder",
   data() {
     return {
       spuList: [],
@@ -564,6 +586,12 @@ export default {
       queryParams: {
         pageNo: 1,
         pageSize: 10,
+        spuName: "",
+        userOrderSn: "",
+        userPhone: "",
+        createTime: "",
+        orderStatusKey: "",
+        paymentType: "",
       },
       printForm: {
         sn: "",
@@ -579,17 +607,13 @@ export default {
         { header: "规格名称", key: "specsName", width: 20 },
         { header: "规格值", key: "specsValue", width: 20 },
         { header: "实付金额(元)", key: "goodsAmount", width: 20 },
-        { header: "运费", key: "freightFee", width: 20 },
-        { header: "订单状态", key: "orderStatus", width: 20 },
         { header: "售后状态", key: "afterSaleStatus", width: 20 },
       ],
 
       // 表单参数
       form: {},
       // 表单校验
-      rules: {
-        configValue: [{ required: true, message: "参数键值不能为空", trigger: "blur" }],
-      },
+      rules: {},
       orderStatistics: {},
       mergeObj: {}, // 用来记录需要合并行的下标
       selectList: [],
@@ -613,42 +637,35 @@ export default {
     },
     printSubmitForm() {
       this.printForm.id = this.selectList.toString();
-      printOrder(this.printForm)
-        .then((res) => {
-          if (res.code == 200) {
-            this.equipmentOpen = false;
-            this.$modal.msgSuccess("操作成功!");
-          } else {
-            this.equipmentOpen = false;
-            this.$modal.msgError(res.msg);
-          }
-        })
-        .catch((err) => {
+      printOrder(this.printForm).then((res) => {
+        if (res.code == 200) {
+          this.equipmentOpen = false;
+          this.$modal.msgSuccess("操作成功!");
+        } else {
           this.equipmentOpen = false;
-          this.$modal.msgError(err);
-        });
+          this.$modal.msgError(res.msg);
+        }
+      });
     },
     printOrderBtn() {
       this.equipmentOpen = true;
     },
     getstatisticsAfterSaleOrder() {
-      statisticsAfterSaleOrder()
-        .then((res) => {
-          if (res.code == 200) {
-            this.orderStatistics = res.data;
-            console.log(this.orderStatistics);
-          }
-        })
-        .catch((err) => {
-          this.$modal.msgError(err);
-        });
+      statisticsAfterSaleOrder().then((res) => {
+        if (res.code == 200) {
+          this.orderStatistics = res.data;
+          console.log(this.orderStatistics);
+        } else {
+          this.$modal.msgError(res.msg);
+        }
+      });
     },
     /** 查询参数列表 */
     getList() {
       this.selectList = [];
       this.loading = true;
-      queryAfterSalePage(this.addDateRange(this.queryParams, this.dateRange))
-        .then((response) => {
+      queryAfterSalePage(this.addDateRange(this.queryParams, this.dateRange)).then(
+        (response) => {
           let list = response.data.records;
           let totalList = [];
           for (let i = 0; i < list.length; i++) {
@@ -675,14 +692,12 @@ export default {
               }
             }
           }
-
           this.spuList = totalList;
           this.total = response.data.total;
           this.loading = false;
-        })
-        .catch((err) => {
-          console.log(err);
-        });
+          console.log("loading", this.loading);
+        }
+      );
     },
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
       if (
@@ -714,17 +729,14 @@ export default {
       this.title = "商品详情";
       this.open = true;
       this.dialogLoding = true;
-      afterSaleOrderInfo(record.id)
-        .then((res) => {
-          if (res.code == 200) {
-            this.detailInfo = res.data;
-            this.dialogLoding = false;
-          }
-        })
-        .catch((err) => {
+      afterSaleOrderInfo(record.id).then((res) => {
+        if (res.code == 200) {
+          this.detailInfo = res.data;
+          this.dialogLoding = false;
+        } else {
           this.dialogLoding = false;
-          console.log(err);
-        });
+        }
+      });
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
@@ -757,7 +769,7 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
+      this.queryParams.pageNo = 1;
       this.getList();
     },
     /** 重置按钮操作 */

+ 79 - 180
src/views/manage/client.vue

@@ -9,29 +9,20 @@ a
       v-show="showSearch"
       label-width="120px"
     >
-      <el-form-item label="客户昵称" prop="configName">
+      <el-form-item label="昵称" prop="nick">
         <el-input
-          v-model="queryParams.configName"
-          placeholder="请输入客户昵称"
-          clearable
-          style="width: 240px"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="客户类型" prop="configName" label-width="140px">
-        <el-input
-          v-model="queryParams.configName"
-          placeholder="请输入客户类型"
+          v-model="queryParams.nick"
+          placeholder="请输入昵称"
           clearable
           style="width: 240px"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
 
-      <el-form-item label="客户姓名/手机号">
+      <el-form-item label="手机号" prop="phone">
         <el-input
-          v-model="queryParams.configName"
-          placeholder="请输入客户姓名/手机号"
+          v-model="queryParams.phone"
+          placeholder="请输入手机号"
           clearable
           style="width: 240px"
           @keyup.enter.native="handleQuery"
@@ -42,6 +33,13 @@ a
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
           >搜索</el-button
         >
+        <el-button
+          type="primary"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          >导出</el-button
+        >
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
@@ -52,34 +50,31 @@ a
       @selection-change="handleSelectionChange"
     >
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="订单编号" align="center" prop="configId" />
-      <el-table-column
-        label="商品名称"
-        align="center"
-        prop="configName"
-        :show-overflow-tooltip="true"
-      />
-      <el-table-column label="单价/数量" align="center" prop="configKey" />
-      <el-table-column label="实付款" align="center" prop="configValue" />
-      <el-table-column label="下单时间" align="center" prop="configValue" />
-      <el-table-column label="付款时间" align="center" prop="configValue" />
-      <el-table-column label="买家信息" align="center" prop="configType">
-        <template slot-scope="scope"> </template>
-      </el-table-column>
-      <el-table-column label="支付方式" align="center" prop="remark" />
-      <el-table-column label="配送方式" align="center" prop="remark" />
-      <el-table-column label="交易状态" align="center" prop="createTime" width="180">
-        <template slot-scope="scope"> </template>
+      <el-table-column label="用户id" align="center" prop="userId" />
+      <el-table-column label="用户昵称" align="center" prop="nick" />
+      <el-table-column label="用户电话" align="center" prop="phone" />
+      <el-table-column label="交易金额(元)" align="center" prop="orderAmount" />
+      <el-table-column label="创建时间" align="center" prop="createTime" />
+      <el-table-column label="成交状态" align="center" prop="dealStatus">
+        <template slot-scope="scope">
+          {{
+            scope.row.dealStatus == 0
+              ? "未成交"
+              : scope.row.dealStatus == 1
+              ? "已成交"
+              : ""
+          }}
+        </template>
       </el-table-column>
+
       <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)"
+            @click="handleLookOrder(scope.row)"
             v-hasPermi="['manage:order:detail']"
-            >订单详情</el-button
+            >查看订单</el-button
           >
         </template>
       </el-table-column>
@@ -88,58 +83,30 @@ a
     <pagination
       v-show="total > 0"
       :total="total"
-      :page.sync="queryParams.pageNum"
+      :page.sync="queryParams.pageNo"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
 
-    <!-- 添加或修改参数配置对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="参数名称" prop="configName">
-          <el-input v-model="form.configName" placeholder="请输入参数名称" />
-        </el-form-item>
-        <el-form-item label="参数键名" prop="configKey">
-          <el-input v-model="form.configKey" placeholder="请输入参数键名" />
-        </el-form-item>
-        <el-form-item label="参数键值" prop="configValue">
-          <el-input v-model="form.configValue" placeholder="请输入参数键值" />
-        </el-form-item>
-        <el-form-item label="系统内置" prop="configType">
-          <!-- <el-radio-group v-model="form.configType">
-              <el-radio
-                v-for="dict in dict.type.sys_yes_no"
-                :key="dict.value"
-                :label="dict.value"
-                >{{ dict.label }}</el-radio
-              >
-            </el-radio-group> -->
-        </el-form-item>
-        <el-form-item label="备注" prop="remark">
-          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
+    <el-drawer
+      title="查看订单"
+      :visible.sync="drawer"
+      direction="rtl"
+      size="85%"
+      :before-close="handleClose"
+    >
+      <OrderList type="detail" :userId="userid"></OrderList>
+    </el-drawer>
   </div>
 </template>
 
 <script>
-import {
-  listConfig,
-  getConfig,
-  delConfig,
-  addConfig,
-  updateConfig,
-  refreshCache,
-} from "@/api/system/config";
+import OrderList from "./order.vue";
+import { customerList, customerExport } from "@/api/manage/client";
 
 export default {
   name: "Config",
-  //   dicts: ["sys_yes_no"],
+  components: { OrderList },
   data() {
     return {
       // 遮罩层
@@ -164,55 +131,59 @@ export default {
       dateRange: [],
       // 查询参数
       queryParams: {
-        pageNum: 1,
+        pageNo: 1,
         pageSize: 10,
-        configName: undefined,
-        configKey: undefined,
-        configType: undefined,
+        phone: "",
+        nick: "",
       },
       // 表单参数
       form: {},
       // 表单校验
-      rules: {
-        configName: [{ required: true, message: "参数名称不能为空", trigger: "blur" }],
-        configKey: [{ required: true, message: "参数键名不能为空", trigger: "blur" }],
-        configValue: [{ required: true, message: "参数键值不能为空", trigger: "blur" }],
-      },
+      drawer: false,
+      userid: "",
     };
   },
   created() {
-    // this.getList();
+    this.getList();
   },
   methods: {
+    handleLookOrder(record) {
+      this.userid = record.userId;
+      this.drawer = true;
+      // this.$router.push({
+      //   path: "/order/manage/order",
+      //   query: {
+      //     userId: record.userId,
+      //   },
+      // });
+      // customerList(this.queryParams).then((response) => {
+      //   this.configList = response.data.records;
+      //   this.total = response.data.total;
+      //   this.loading = false;
+      // });
+    },
+    handleExport() {
+      this.download(
+        "/system/order/customer/export",
+        {
+          ...this.queryParams,
+        },
+        `客户表_${new Date().getTime()}.xlsx`
+      );
+    },
     /** 查询参数列表 */
     getList() {
       this.loading = true;
-      listConfig(this.addDateRange(this.queryParams, this.dateRange)).then((response) => {
-        this.configList = response.rows;
-        this.total = response.total;
+      customerList(this.queryParams).then((response) => {
+        this.configList = response.data.records;
+        this.total = response.data.total;
         this.loading = false;
       });
     },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        configId: undefined,
-        configName: undefined,
-        configKey: undefined,
-        configValue: undefined,
-        configType: "Y",
-        remark: undefined,
-      };
-      this.resetForm("form");
-    },
+
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
+      this.queryParams.pageNo = 1;
       this.getList();
     },
     /** 重置按钮操作 */
@@ -221,78 +192,6 @@ export default {
       this.resetForm("queryForm");
       this.handleQuery();
     },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加参数";
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.configId);
-      this.single = selection.length != 1;
-      this.multiple = !selection.length;
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const configId = row.configId || this.ids;
-      getConfig(configId).then((response) => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改参数";
-      });
-    },
-    /** 提交按钮 */
-    submitForm: function () {
-      this.$refs["form"].validate((valid) => {
-        if (valid) {
-          if (this.form.configId != undefined) {
-            updateConfig(this.form).then((response) => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addConfig(this.form).then((response) => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
-        }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const configIds = row.configId || this.ids;
-      this.$modal
-        .confirm('是否确认删除参数编号为"' + configIds + '"的数据项?')
-        .then(function () {
-          return delConfig(configIds);
-        })
-        .then(() => {
-          this.getList();
-          this.$modal.msgSuccess("删除成功");
-        })
-        .catch(() => {});
-    },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download(
-        "system/config/export",
-        {
-          ...this.queryParams,
-        },
-        `config_${new Date().getTime()}.xlsx`
-      );
-    },
-    /** 刷新缓存按钮操作 */
-    handleRefreshCache() {
-      refreshCache().then(() => {
-        this.$modal.msgSuccess("刷新成功");
-      });
-    },
   },
 };
 </script>

+ 9 - 11
src/views/manage/completedOrder.vue

@@ -67,12 +67,12 @@ a
       </el-form-item>
 
       <el-form-item label="交易状态">
-        <el-select v-model="value" placeholder="请选择交易状态"   style="width: 180px">
+        <el-select v-model="value" placeholder="请选择交易状态" style="width: 180px">
           <el-option :label="1" :value="1"> </el-option>
         </el-select>
       </el-form-item>
       <el-form-item label="支付方式">
-        <el-select v-model="value" placeholder="请选择支付方式"   style="width: 180px">
+        <el-select v-model="value" placeholder="请选择支付方式" style="width: 180px">
           <el-option :label="1" :value="1"> </el-option>
         </el-select>
       </el-form-item>
@@ -91,9 +91,7 @@ a
         >
       </el-col>
       <el-col :span="1.5">
-        <el-button type="primary" plain size="mini" @click="printOrder"
-          >导出</el-button
-        >
+        <el-button type="primary" plain size="mini" @click="printOrder">导出</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button type="success" plain icon="el-icon-edit" size="mini" @click="All"
@@ -144,7 +142,7 @@ a
     <pagination
       v-show="total > 0"
       :total="total"
-      :page.sync="queryParams.pageNum"
+      :page.sync="queryParams.pageNo"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
@@ -181,15 +179,15 @@ a
       >、
       <el-descriptions title="商品信息" column="3"> </el-descriptions>
       <el-table :data="tableData" style="width: 100%">
-        <el-table-column label="序号" align="center" >
+        <el-table-column label="序号" align="center">
           <template slot-scope="scope">
             {{ scope.$index + 1 }}
           </template>
         </el-table-column>
-        <el-table-column prop="date" label="商品图片" > </el-table-column>
+        <el-table-column prop="date" label="商品图片"> </el-table-column>
         <el-table-column prop="name" label="商品名称"> </el-table-column>
         <el-table-column prop="name" label="商品单价"> </el-table-column>
-        <el-table-column prop="name" label="下单数量" > </el-table-column>
+        <el-table-column prop="name" label="下单数量"> </el-table-column>
         <el-table-column prop="price" label="总金额"> </el-table-column>
         <el-table-column prop="price" label="实付款"> </el-table-column>
       </el-table>
@@ -239,7 +237,7 @@ export default {
       dateRange: [],
       // 查询参数
       queryParams: {
-        pageNum: 1,
+        pageNo: 1,
         pageSize: 10,
         configName: undefined,
         configKey: undefined,
@@ -287,7 +285,7 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
+      this.queryParams.pageNo = 1;
       this.getList();
     },
     /** 重置按钮操作 */

+ 3 - 3
src/views/manage/equipment.vue

@@ -76,7 +76,7 @@ a
     <pagination
       v-show="total > 0"
       :total="total"
-      :page.sync="queryParams.pageNum"
+      :page.sync="queryParams.pageNo"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
@@ -135,7 +135,7 @@ export default {
       dateRange: [],
       // 查询参数
       queryParams: {
-        pageNum: 1,
+        pageNo: 1,
         pageSize: 10,
       },
       // 表单参数
@@ -180,7 +180,7 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
+      this.queryParams.pageNo = 1;
       this.getList();
     },
     /** 重置按钮操作 */

+ 88 - 32
src/views/manage/order.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <div class="header" style="width: 100%">
+    <div class="header" style="width: 100%" v-if="!queryParams.userId">
       <el-row class="row" :gutter="12">
         <el-col :span="3">
           <el-card shadow="always">
@@ -146,7 +146,7 @@
           style="width: 180px"
         />
       </el-form-item>
-      <el-form-item label="下单人手机号" prop="userPhone" label-width="140px">
+      <el-form-item label="买家手机号" prop="userPhone" label-width="140px">
         <el-input
           v-model="queryParams.userPhone"
           placeholder="请输入下单用户手机号"
@@ -165,13 +165,20 @@
         </el-date-picker>
       </el-form-item>
 
-      <el-form-item label="订单状态" prop="orderStatus">
+      <el-form-item label="订单状态" prop="orderStatusKey">
         <el-select
-          v-model="queryParams.orderStatus"
+          v-model="queryParams.orderStatusKey"
           placeholder="请选择订单状态"
           style="width: 180px"
         >
-          <el-option label="待商家确认修改运费" :value="0"> </el-option>
+          <el-option label="待发货" value="WAIT_DELIVERY"> </el-option>
+          <el-option label="待收货" value="WAIT_RECEIVE"> </el-option>
+          <el-option label="待付款" value="WAIT_PAY"> </el-option>
+          <el-option label="已完成" value="COMPLETE"> </el-option>
+          <el-option label="已取消/申请售后" value="CANCEL"> </el-option>
+          <el-option label="待发布货运信息" value="WAIT_PUBLISH_INVOICE"> </el-option>
+          <el-option label="等待司机接单" value="WAIT_DRIVER_ERCEIVE"> </el-option>
+          <!-- <el-option label="待商家确认修改运费" :value="0"> </el-option>
           <el-option label="等待买家支付" :value="10"> </el-option>
           <el-option label="等待商家发布货运信息" :value="20"> </el-option>
           <el-option label="等待司机接单" :value="90"> </el-option>
@@ -185,13 +192,13 @@
           <el-option label="退款成功" :value="70"> </el-option>
           <el-option label="退款失败" :value="80"> </el-option>
           <el-option label="待处理售后" :value="130"> </el-option>
-          <el-option label="已处理售后" :value="140"> </el-option>
+          <el-option label="已处理售后" :value="140"> </el-option> -->
         </el-select>
       </el-form-item>
       <el-form-item label="售后状态" prop="afterSaleStatus">
         <el-select
           v-model="queryParams.afterSaleStatus"
-          placeholder="请选择支付方式"
+          placeholder="请选择售后状态"
           style="width: 180px"
         >
           <el-option label="未申请" value="0"> </el-option>
@@ -203,14 +210,14 @@
         </el-select>
       </el-form-item>
 
-      <el-form-item label="支付方式">
+      <el-form-item label="支付方式" prop="paymentType">
         <el-select
           v-model="queryParams.paymentType"
           placeholder="请选择支付方式"
           style="width: 180px"
         >
-          <el-option label="支付宝" value="ALIPAY"> </el-option>
-          <el-option label="微信支付" value="WECHAT"> </el-option>
+          <el-option label="支付宝" value="alipay"> </el-option>
+          <el-option label="微信支付" value="wechat"> </el-option>
         </el-select>
       </el-form-item>
       <el-form-item>
@@ -276,12 +283,35 @@
       </el-table-column>
       <el-table-column label="包装方式" align="center" prop="packageType">
       </el-table-column>
+      <el-table-column label="支付方式" align="center" prop="packageType">
+        <template slot-scope="scope">
+          {{
+            scope.row.paymentType == "alipay"
+              ? "支付宝支付"
+              : scope.row.paymentType == "wechat"
+              ? "微信支付"
+              : scope.row.paymentType == "card"
+              ? "银行卡支付"
+              : ""
+          }}
+        </template>
+      </el-table-column>
+
       <el-table-column label="规格名称" align="center" prop="specsName" />
       <el-table-column label="规格值" align="center" prop="specsValue" />
-      <el-table-column label="实付金额(元)" align="center" prop="goodsAmount">
-        <template slot-scope="scope"> {{ scope.row.goodsAmount }}元 </template>
+      <el-table-column label="实付金额(元)" align="center" prop="paymentAmount">
+        <template slot-scope="scope">
+          {{ scope.row.paymentAmount.toFixed(2) }}元
+        </template>
       </el-table-column>
-      <el-table-column label="订单编号" align="center" prop="userOrderSn" width="220" />
+      <el-table-column
+        label="订单编号"
+        align="center"
+        prop="userOrderSn"
+        width="200"
+        :show-overflow-tooltip="true"
+      />
+
       <el-table-column label="买家姓名" align="center" prop="userNick" />
       <el-table-column label="买家头像" align="center">
         <template slot-scope="scope">
@@ -294,6 +324,7 @@
         label="商品名称"
         align="center"
         prop="skuName"
+        width="150"
         :show-overflow-tooltip="true"
       >
       </el-table-column>
@@ -378,7 +409,7 @@
     <pagination
       v-show="total > 0"
       :total="total"
-      :page.sync="queryParams.pageNum"
+      :page.sync="queryParams.pageNo"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
@@ -440,22 +471,22 @@
         <el-descriptions-item label="支付方式">
           {{
             detailInfo
-              ? detailInfo.paymentType == "ALIPAY"
+              ? detailInfo.paymentType == "alipay"
                 ? "支付宝"
-                : detailInfo.paymentType == "WECHAT"
+                : detailInfo.paymentType == "wechat"
                 ? "微信支付"
-                : detailInfo.paymentType == "CARD"
+                : detailInfo.paymentType == "card"
                 ? "银行卡支付"
                 : ""
               : ""
           }}</el-descriptions-item
         >
-        <el-descriptions-item label="下单时间">{{
-          detailInfo ? detailInfo.createTime : ""
-        }}</el-descriptions-item>
-        <el-descriptions-item label="付款时间">
-          {{ detailInfo ? detailInfo.paymentTime : "" }}</el-descriptions-item
+        <el-descriptions-item label="下单时间">
+          {{ parseTime(detailInfo.createTime) }}</el-descriptions-item
         >
+        <el-descriptions-item label="付款时间">
+          {{ parseTime(detailInfo.paymentTime) }}
+        </el-descriptions-item>
         <el-descriptions-item label="担保服务费">
           {{ detailInfo ? detailInfo.serviceFee : "" }}
         </el-descriptions-item>
@@ -565,11 +596,12 @@ import {
   userOrderInfo,
 } from "@/api/manage/order";
 import { printOrder, equipmentList } from "@/api/manage/equipment";
-
+import moment from "moment";
 import Utils from "@/utils/derive";
 export default {
   name: "Config",
   //   dicts: ["sys_yes_no"],
+  props: ["type", "userId"],
   data() {
     return {
       equipmentOpen: false,
@@ -597,6 +629,13 @@ export default {
       queryParams: {
         pageNo: 1,
         pageSize: 10,
+        spuName: "",
+        userOrderSn: "",
+        userPhone: "",
+        createTime: "",
+        orderStatusKey: "",
+        afterSaleStatus: "",
+        paymentType: "",
       },
       printForm: {
         sn: "",
@@ -630,10 +669,25 @@ export default {
       printList: [],
     };
   },
-  created() {
-    this.getList();
-    this.getEquipmentList();
-    this.getstatisticsOrder();
+  watch: {
+    userId(newV, oldV) {
+      console.log(newV, oldV);
+      this.queryParams.userId = this.userId;
+      this.getList();
+      this.getEquipmentList();
+    },
+  },
+  mounted() {
+    console.log("1231231", this.userId);
+    if (this.userId) {
+      this.queryParams.userId = this.userId;
+      this.getList();
+      this.getEquipmentList();
+    } else {
+      this.getList();
+      this.getEquipmentList();
+      this.getstatisticsOrder();
+    }
   },
   methods: {
     getEquipmentList() {
@@ -674,7 +728,9 @@ export default {
         columnIndex === 16 ||
         columnIndex === 14 ||
         columnIndex === 13 ||
-        columnIndex === 15
+        columnIndex === 15 ||
+        columnIndex === 16 ||
+        columnIndex === 17
       ) {
         if (rowIndex === 0 || row.userOrderSn != this.spuList[rowIndex - 1].userOrderSn) {
           let rowspan = 0;
@@ -692,7 +748,7 @@ export default {
     getstatisticsOrder() {
       statisticsOrderNum().then((res) => {
         if (res.code == 200) {
-          this.orderStatistics = res;
+          this.orderStatistics = res.data;
         } else {
           this.$modal.msgError(res.msg);
         }
@@ -751,7 +807,7 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
+      this.queryParams.pageNo = 1;
       this.getList();
     },
     /** 重置按钮操作 */
@@ -767,8 +823,8 @@ export default {
       this.dialogLoding = true;
       userOrderInfo(record.id)
         .then((res) => {
-          if (res) {
-            this.detailInfo = res;
+          if (res.code == 200) {
+            this.detailInfo = res.data;
             this.dialogLoding = false;
           }
         })

+ 181 - 54
src/views/manage/product.vue

@@ -1,4 +1,3 @@
-a
 <template>
   <div class="app-container">
     <el-form
@@ -9,28 +8,30 @@ a
       v-show="showSearch"
       label-width="80px"
     >
-      <el-form-item label="商品名称" prop="configName">
+      <el-form-item label="商品名称" prop="spuName">
         <el-input
-          v-model="queryParams.configName"
+          v-model="queryParams.spuName"
           placeholder="请输入商品名称"
           clearable
           style="width: 240px"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="分类" prop="configName" label-width="140px">
-        <el-input
-          v-model="queryParams.configName"
-          placeholder="请输入下单用户手机号/姓名"
-          clearable
-          style="width: 240px"
-          @keyup.enter.native="handleQuery"
+      <el-form-item label="分类" prop="categoryId">
+        <el-cascader
+          v-model="queryParams.categoryId"
+          ref="formCascader"
+          placeholder="请选择分类"
+          :props="categoryprops"
+          @change="cascaderChange"
         />
       </el-form-item>
 
-      <el-form-item label="状态">
-        <el-select v-model="value" placeholder="请选择状态">
-          <el-option :label="1" :value="1"> </el-option>
+      <el-form-item label="商品状态">
+        <el-select v-model="queryParams.spuStatus" placeholder="请选择商品状态">
+          <el-option label="售罄" value="2"> </el-option>
+          <el-option label="上架" value="0"> </el-option>
+          <el-option label="下架" value="1"> </el-option>
         </el-select>
       </el-form-item>
 
@@ -43,44 +44,133 @@ a
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
+      <el-col :span="1.5" v-if="activeShowBtn">
+        <el-button
+          type="primary"
+          plain
+          size="mini"
+          @click="addActive"
+          :disabled="!multipleSelection.length > 0"
+          >添加商品到活动</el-button
+        >
+      </el-col>
+      <el-col :span="1.5" v-else>
         <el-button type="primary" plain size="mini" @click="prouctAdd"
           >新增商品</el-button
         >
       </el-col>
     </el-row>
 
-    <el-table v-loading="loading" :data="configList">
+    <el-table
+      v-loading="loading"
+      :data="configList"
+      @selection-change="handleSelectionChange"
+      row-key="id"
+    >
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="订单编号" align="center" prop="configId" />
+      <el-table-column label="商品图片" align="center">
+        <template slot-scope="scope">
+          <el-image
+            style="width: 60px; height: 60px"
+            :src="scope.row.pic"
+            :preview-src-list="[scope.row.pic]"
+          >
+          </el-image>
+        </template>
+      </el-table-column>
       <el-table-column
         label="商品名称"
         align="center"
-        prop="configName"
+        prop="spuName"
         :show-overflow-tooltip="true"
       />
-      <el-table-column label="单价/数量" align="center" prop="configKey" />
-      <el-table-column label="实付款" align="center" prop="configValue" />
-      <el-table-column label="下单时间" align="center" prop="configValue" />
-      <el-table-column label="付款时间" align="center" prop="configValue" />
-      <el-table-column label="买家信息" align="center" prop="configType">
-        <template slot-scope="scope"> </template>
+      <el-table-column label="分类" align="center" prop="categoryName" />
+      <el-table-column label="价格" align="center">
+        <template slot-scope="scope">
+          {{ scope.row.lowestPrice }} {{ scope.row.unit }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="起批量" align="center">
+        <template slot-scope="scope">
+          {{ scope.row.lowestPurchase }} {{ scope.row.unit }}
+        </template>
+      </el-table-column>
+      <el-table-column label="库存" align="center">
+        <template slot-scope="scope">
+          {{ scope.row.totalStocks }} {{ scope.row.unit }}
+        </template>
       </el-table-column>
-      <el-table-column label="支付方式" align="center" prop="remark" />
-      <el-table-column label="配送方式" align="center" prop="remark" />
-      <el-table-column label="交易状态" align="center" prop="createTime" width="180">
-        <template slot-scope="scope"> </template>
+      <el-table-column label="销量" align="center" prop="salesVolume"> </el-table-column>
+      <el-table-column label="分销比例" align="center" prop="shareRate" />
+      <el-table-column label="销售模式" align="center">
+        <template slot-scope="scope">
+          {{ scope.row.saleModel == 1 ? "现货" : "预售" }}
+        </template>
+      </el-table-column>
+      <el-table-column label="销售方式" align="center">
+        <template slot-scope="scope">
+          {{
+            scope.row.saleType == 0
+              ? "整车"
+              : scope.row.saleType == 1
+              ? "零售"
+              : scope.row.saleType == 2
+              ? "拼车"
+              : scope.row.saleType == 3
+              ? "一件代发"
+              : ""
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column label="发布状态" align="center">
+        <template slot-scope="scope">
+          {{
+            scope.row.releaseStatus == 0
+              ? "未发布"
+              : scope.row.releaseStatus == 1
+              ? "已发布"
+              : ""
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column label="商品属性" align="center" width="150">
+        <template slot-scope="scope">
+          <div
+            v-for="(item, index) in scope.row.props ? JSON.parse(scope.row.props) : []"
+            :key="index"
+          >
+            <div style="text-align: left">属性{{ index + 1 }}:{{ item.name }}</div>
+            <div style="text-align: left">属性值{{ index + 1 }}:{{ item.value }}</div>
+          </div>
+        </template>
+      </el-table-column>
+
+      <!-- <el-table-column label="发货时间" align="center" prop="shippingTimeDesc">
+      </el-table-column> -->
+      <el-table-column label="商品状态" align="center">
+        <template slot-scope="scope">
+          {{
+            scope.row.spuStatus == 2
+              ? "售罄"
+              : scope.row.spuStatus == 0
+              ? "上架"
+              : scope.row.spuStatus == 1
+              ? "下架"
+              : ""
+          }}
+        </template>
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
-          <el-button
+          <!-- <el-button
             size="mini"
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['manage:order:detail']"
             >订单详情</el-button
-          >
+          > -->
         </template>
       </el-table-column>
     </el-table>
@@ -88,7 +178,7 @@ a
     <pagination
       v-show="total > 0"
       :total="total"
-      :page.sync="queryParams.pageNum"
+      :page.sync="queryParams.pageNo"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
@@ -501,11 +591,12 @@ a
 </template>
 
 <script>
-import { listConfig, getConfig, delConfig, refreshCache } from "@/api/system/config";
-
+import { getGoodsListPage } from "@/api/manage/product";
+import { getClassificationListPage } from "@/api/common/index";
 export default {
   name: "Config",
   //   dicts: ["sys_yes_no"],
+  props: ["type"],
   data() {
     return {
       // 遮罩层
@@ -532,17 +623,16 @@ export default {
       dateRange: [],
       // 查询参数
       queryParams: {
-        pageNum: 1,
+        pageNo: 1,
         pageSize: 10,
+        categoryId: "",
+        spuStatus: "",
+        spuName: "",
       },
       // 表单参数
       form: {},
       // 表单校验
 
-      props: {
-        lazy: true,
-        lazyLoad: this.lazyLoad,
-      },
       specification: [],
       freight: [],
       subType: "",
@@ -580,12 +670,34 @@ export default {
         },
       ],
       optionTime: "",
+      categoryprops: {
+        checkStrictly: true,
+        lazy: true,
+        lazyLoad: this.categoryLazyLoad,
+      },
+
+      activeShowBtn: true,
+      multipleSelection: [],
     };
   },
   created() {
-    // this.getList();
+    this.getList();
   },
+  watch: {
+    type(newV, oldV) {
+      if (newV == "active") {
+        this.activeShowBtn = false;
+      }
+    },
+  },
+
   methods: {
+    addActive() {
+      this.$emit("multipleTable", this.multipleSelection);
+    },
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
     addOption() {
       if (this.optionTime) {
         this.deliveryTimes.push({
@@ -640,9 +752,9 @@ export default {
     /** 查询参数列表 */
     getList() {
       this.loading = true;
-      listConfig(this.addDateRange(this.queryParams, this.dateRange)).then((response) => {
-        this.configList = response.rows;
-        this.total = response.total;
+      getGoodsListPage(this.queryParams).then((res) => {
+        this.configList = res.data.records;
+        this.total = res.data.total;
         this.loading = false;
       });
     },
@@ -666,7 +778,7 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
+      this.queryParams.pageNo = 1;
       this.getList();
     },
     /** 重置按钮操作 */
@@ -682,41 +794,56 @@ export default {
       this.title = "添加商品";
       this.open = true;
     },
-    lazyLoad(node, resolve) {
+    cascaderChange(val) {
+      if (val.length == 1) {
+        this.queryParams.categoryId = val[0];
+      } else if (val.length == 2) {
+        this.queryParams.categoryId = val[1];
+      } else if (val.length == 3) {
+        this.queryParams.categoryId = val[2];
+      }
+      // this.getList();
+    },
+    categoryLazyLoad(node, resolve) {
+      let that = this;
       let level = node.level;
-      console.log(level);
+      console.log(node);
       if (!node.data) {
-        this.getCity().then((res) => {
+        getClassificationListPage({ parentId: 0 }).then((res) => {
           //接口
           const nodes = Array.from(res.data).map((item, index) => ({
-            value: item.cityId,
-            label: `${item.name}`,
+            value: item.id,
+            label: `${item.className}`,
             leaf: level >= 2,
           }));
+          console.log("111", node);
           // 通过调用resolve将子节点数据返回,通知组件数据加载完成
           resolve(nodes);
         });
       } else if (level == 1) {
-        this.getCity({ parentCityId: node.data.value }).then((res) => {
+        getClassificationListPage({ parentId: node.data.value }).then((res) => {
           const nodes = Array.from(res.data).map((item) => ({
-            value: item.cityId,
-            label: `${item.name}`,
+            value: item.id,
+            label: `${item.className}`,
             leaf: level >= 2,
+            // level: 2,
           }));
           // 通过调用resolve将子节点数据返回,通知组件数据加载完成
           resolve(nodes);
         });
       } else if (level == 2) {
-        // resolve({});
-        this.getCity({ parentCityId: node.data.value }).then((res) => {
+        getClassificationListPage({ parentId: node.data.value }).then((res) => {
           const nodes = Array.from(res.data).map((item) => ({
-            value: item.cityId,
-            label: `${item.name}`,
+            value: item.id,
+            label: `${item.className}`,
             leaf: level >= 1,
+            level: 1,
           }));
           // 通过调用resolve将子节点数据返回,通知组件数据加载完成
           resolve(nodes);
         });
+      } else {
+        resolve({});
       }
     },
   },

+ 2 - 4
src/views/manage/sales.vue

@@ -18,7 +18,7 @@
           <el-card shadow="always">
             <div class="item">
               <div style="padding: 10px">
-                <span>单日销(元)</span>
+                <span>单日销售额(元)</span>
 
                 <el-popover
                   placement="top-start"
@@ -70,7 +70,7 @@
           <el-card shadow="always">
             <div class="item">
               <div style="padding: 10px">
-                <span>销量统计(元)</span>
+                <span>总销售额(元)</span>
               </div>
               <div class="count">{{ Statistics ? Statistics.totalSalePrice : 0 }}</div>
             </div>
@@ -324,8 +324,6 @@ export default {
       // this.getList();
     },
     categoryLazyLoad(node, resolve) {
-      console.log("123123123");
-
       let that = this;
       let level = node.level;
       console.log(node);

+ 9 - 7
src/views/system/role/index.vue

@@ -16,7 +16,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="权限字符" prop="roleKey">
+      <!-- <el-form-item label="权限字符" prop="roleKey">
         <el-input
           v-model="queryParams.roleKey"
           placeholder="请输入权限字符"
@@ -24,7 +24,7 @@
           style="width: 240px"
           @keyup.enter.native="handleQuery"
         />
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item label="状态" prop="status">
         <el-select
           v-model="queryParams.status"
@@ -199,7 +199,7 @@
         <el-form-item label="角色名称" prop="roleName">
           <el-input v-model="form.roleName" placeholder="请输入角色名称" />
         </el-form-item>
-        <el-form-item prop="roleKey">
+        <!-- <el-form-item prop="roleKey">
           <span slot="label">
             <el-tooltip
               content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)"
@@ -210,7 +210,7 @@
             权限字符
           </span>
           <el-input v-model="form.roleKey" placeholder="请输入权限字符" />
-        </el-form-item>
+        </el-form-item> -->
         <el-form-item label="角色顺序" prop="roleSort">
           <el-input-number v-model="form.roleSort" controls-position="right" :min="0" />
         </el-form-item>
@@ -321,7 +321,7 @@ import {
   deptTreeSelect,
 } from "@/api/system/role";
 import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
-
+import moment from "moment";
 export default {
   name: "Role",
   dicts: ["sys_normal_disable"],
@@ -397,7 +397,7 @@ export default {
       // 表单校验
       rules: {
         roleName: [{ required: true, message: "角色名称不能为空", trigger: "blur" }],
-        roleKey: [{ required: true, message: "权限字符不能为空", trigger: "blur" }],
+        // roleKey: [{ required: true, message: "权限字符不能为空", trigger: "blur" }],
         roleSort: [{ required: true, message: "角色顺序不能为空", trigger: "blur" }],
       },
     };
@@ -490,7 +490,6 @@ export default {
         (this.form = {
           roleId: undefined,
           roleName: undefined,
-          roleKey: undefined,
           roleSort: 0,
           status: "0",
           menuIds: [],
@@ -627,6 +626,9 @@ export default {
               this.getList();
             });
           } else {
+            var time = new Date();
+            let key = moment(time).valueOf();
+            this.form.roleKey = key;
             this.form.menuIds = this.getMenuAllCheckedKeys();
             addRole(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");