ソースを参照

订单管理、商品管理 update

chenrui 4 年 前
コミット
da7d9fd6c5

+ 2 - 2
src/App.vue

@@ -1,9 +1,9 @@
 <template>
-  <a-locale-provider :locale="locale">
+  <a-config-provider :locale="locale">
     <div id="app">
       <router-view/>
     </div>
-  </a-locale-provider>
+  </a-config-provider>
 </template>
 
 <script>

+ 7 - 1
src/components/UploadFile/index.vue

@@ -56,7 +56,7 @@ export default {
     },
     upText: {
       type: String,
-      default: '上传'
+      default: ''
     },
     value: {
       type: String
@@ -191,6 +191,7 @@ export default {
   .upload-file{
     float: left;
     overflow: hidden;
+    height: 80px;
     /* you can make up upload button and sample style by using stylesheets */
     .ant-upload-select-picture-card i {
       font-size: 32px;
@@ -206,11 +207,16 @@ export default {
         padding: 4px 0;
       }
     }
+    .ant-upload-list-picture-card-container{
+      height: 80px;
+      width: 80px;
+    }
     .ant-upload.ant-upload-select-picture-card,
     .ant-upload-list-picture-card .ant-upload-list-item{
       width:80px;
       height:80px;
       padding: 4px;
+      margin: 0;
     }
     .ant-upload-list-item-info{
       padding: 0 22px 0 4px;

+ 1 - 1
src/components/global.less

@@ -508,7 +508,7 @@ body {
     padding: 0 10px;
   }
   td .icon-blues {
-  	color: #1890FF;
+  	color: #1891FF;
   }
   td .icon-green {
   	color: #16b50e;

+ 77 - 15
src/config/router.config.js

@@ -58,35 +58,97 @@ export const asyncRouterMap = [{
     children: [
       {
         path: '/shop/order',
+        redirect: '/shop/order/list',
         name: 'shopOrder',
-        component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/shopOrder.vue'),
+        component: RouteView,
         meta: {
           title: '订单管理',
           icon: 'profile'
           // permission: 'M_tenants_list'
-        }
-      },
-      {
-        path: '/shop/orderDetail',
-        name: 'shopOrderDetail',
-        hidden: true,
-        component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/orderDetail.vue'),
-        meta: {
-          title: '订单详情',
-          icon: 'profile'
-          // permission: 'M_tenants_list'
-        }
+        },
+        hideChildrenInMenu: true,
+        children: [
+          {
+            path: '/shop/order/list',
+            name: 'shopOrderList',
+            component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/shopOrder.vue'),
+            meta: {
+              title: '订单列表',
+              icon: 'profile',
+              hidden: true
+              // permission: 'M_tenants_list'
+            }
+          },
+          {
+            path: '/shop/order/detail/:id',
+            name: 'shopOrderDetail',
+            component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/orderDetail.vue'),
+            meta: {
+              title: '订单详情',
+              icon: 'profile',
+              hidden: true
+              // permission: 'M_tenants_list'
+            }
+          }
+        ]
       },
       {
         path: '/shop/goods',
+        redirect: '/shop/goods/list',
         name: 'goodsList',
-        component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/goodsList.vue'),
+        component: RouteView,
         meta: {
           title: '商品管理',
           icon: 'shopping'
           // permission: 'M_tenants_list'
-        }
+        },
+        hideChildrenInMenu: true,
+        children: [
+          {
+            path: '/shop/goods/list',
+            name: 'goodsListList',
+            component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/goodsList.vue'),
+            meta: {
+              title: '商品列表',
+              icon: 'shopping',
+              hidden: true
+              // permission: 'M_tenants_list'
+            }
+          },
+          {
+            path: '/shop/goods/add',
+            name: 'goodsListAdd',
+            component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/goodsEdit.vue'),
+            meta: {
+              title: '新增商品',
+              icon: 'shopping',
+              hidden: true
+              // permission: 'M_tenants_list'
+            }
+          },
+          {
+            path: '/shop/goods/edit/:id',
+            name: 'goodsListEdit',
+            component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/goodsEdit.vue'),
+            meta: {
+              title: '编辑商品',
+              icon: 'shopping',
+              hidden: true
+              // permission: 'M_tenants_list'
+            }
+          }
+        ]
       },
+      // {
+      //   path: '/shop/goods',
+      //   name: 'goodsList',
+      //   component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/goodsList.vue'),
+      //   meta: {
+      //     title: '商品管理',
+      //     icon: 'shopping'
+      //     // permission: 'M_tenants_list'
+      //   }
+      // },
       {
         path: '/shop/goodsShelves',
         name: 'goodsShelves',

+ 3 - 0
src/main.js

@@ -6,6 +6,8 @@ import App from './App.vue'
 import router from './router'
 import store from './store/'
 import { VueAxios } from './utils/request'
+//  复制内容到粘贴板
+import VueClipboard from 'vue-clipboard2'
 
 // mock
 // import './mock'
@@ -23,6 +25,7 @@ Vue.config.productionTip = false
 Vue.use(VueAxios)
 Vue.use(VueCookies)
 Vue.$cookies.config('7d')
+Vue.use(VueClipboard)
 /**
  * 权限检查
  */

+ 103 - 0
src/views/shop/GoodsLogistics.vue

@@ -0,0 +1,103 @@
+<template>
+  <a-modal
+    centered
+    class="modalBox"
+    :footer="null"
+    :maskClosable="false"
+    title="物流信息"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="1000">
+    <a-form
+      id="goodsLogistics-form"
+      :form="form"
+      ref="form"
+      v-bind="formItemLayout"
+      @submit="handleSubmit">
+      <a-form-item label="快递公司" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+        <v-select
+          ref="company"
+          code="ADVERT_POSITION"
+          allowClear
+          id="logistics-company"
+          placeholder="请选择快递公司"
+          v-decorator="['formData.company', { initialValue: formData.company, rules: [{ required: true, message: '请选择快递公司' }] }]"
+        ></v-select>
+      </a-form-item>
+      <a-form-item label="运单编号" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+        <a-input
+          id="logistics-orderNo"
+          :maxLength="30"
+          v-decorator="[
+            'formData.orderNo',
+            { initialValue: formData.orderNo, getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入运单编号(最多30个字符)' }] }
+          ]"
+          placeholder="请输入运单编号(最多30个字符)"
+          allowClear />
+      </a-form-item>
+      <a-form-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+        <a-button type="primary" html-type="submit" id="logistics-submit" style="margin-right: 15px">保存</a-button>
+        <a-button @click="close" style="margin-left: 15px" id="logistics-close">取消</a-button>
+      </a-form-item>
+    </a-form>
+  </a-modal>
+</template>
+
+<script>
+import { VSelect } from '@/components'
+export default {
+  name: 'GoodsLogistics',
+  components: { VSelect },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      form: this.$form.createForm(this),
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 16 }
+      },
+      formData: {
+        company: null, //  快递公司
+        orderNo: '' //  运单编号
+      },
+      isShow: this.openModal //  是否填写物流信息
+    }
+  },
+  methods: {
+    //  物流信息  保存
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          this.$emit('success')
+        }
+      })
+    },
+    //  取消
+    close () {
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (val) {
+      if (!val) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+</style>

+ 107 - 0
src/views/shop/GoodsOrder.vue

@@ -0,0 +1,107 @@
+<template>
+  <div class="goods-order-cont">
+    <!-- 标题 -->
+    <div class="goods-order-header" v-if="orderData.orderStatus">
+      <!-- 待发货 -->
+      <div class="unDelivered" v-if="orderData.orderStatus == 1">
+        <p class="order-status">待发货</p>
+        <a-button id="goodsOrder-send" type="primary" size="small" @click="sendGoods">立即发货</a-button>
+      </div>
+      <!-- 已发货 -->
+      <div class="delivered" v-if="orderData.orderStatus == 2">
+        <p class="companyInfo">快递公司:<span>{{ orderData.companyName }}</span></p>
+        <div class="orderNoInfo">
+          <p class="orderNo">运单编号:<span>{{ orderData.orderNo }}</span></p>
+          <a-button id="goodsOrder-copy" size="small" v-clipboard:copy="orderData.orderNo" v-clipboard:success="onCopy">复制</a-button>
+        </div>
+      </div>
+    </div>
+    <!-- 表格 -->
+    <a-table
+      ref="table"
+      size="default"
+      :row-selection="orderData.orderStatus == 1 ? { selectedRowKeys: selectedRowKeys, onChange: onSelectChange } : null"
+      :columns="columns"
+      :rowKey="(record) => record.id"
+      :data-source="orderData.listData || []"
+      :pagination="false"
+      bordered>
+    </a-table>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'GoodsOrder',
+  props: {
+    orderData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      selectedRowKeys: [], //  已选项
+      columns: [
+        { title: '商品名称', dataIndex: 'name', width: 200, align: 'center' },
+        { title: '商品价格', dataIndex: 'price', width: 200, align: 'center' },
+        { title: '购买数量', dataIndex: 'buyNum', width: 200, align: 'center' }
+      ]
+    }
+  },
+  methods: {
+    //  选择商品
+    onSelectChange (selectedRowKeys) {
+      console.log('selectedRowKeys changed: ', selectedRowKeys)
+      this.selectedRowKeys = selectedRowKeys
+    },
+    //  立即发货
+    sendGoods () {
+      if (this.selectedRowKeys.length < 1) {
+        this.$message.warning('请勾选需要发货的商品')
+        return
+      }
+      this.$emit('sendGoods', this.selectedRowKeys)
+    },
+    //  复制成功
+    onCopy (e) {
+      console.log(e)
+      this.$message.success('复制成功')
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .goods-order-cont{
+    p{
+      margin: 0;
+    }
+    .goods-order-header{
+      border-left: 5px solid #ff9900;
+      padding-left: 10px;
+      margin: 30px 0 20px;
+      .unDelivered{
+        .order-status{
+          display: inline-block;
+          margin-right: 65px;
+        }
+      }
+      .delivered{
+        .companyInfo{
+          display: inline-block;
+          margin-right: 65px;
+        }
+        .orderNoInfo{
+          display: inline-block;
+          .orderNo{
+            display: inline-block;
+            margin-right: 20px;
+          }
+        }
+      }
+    }
+  }
+</style>

+ 159 - 0
src/views/shop/goodsEdit.vue

@@ -0,0 +1,159 @@
+<template>
+  <a-card :bordered="false" class="goodsEdit-table-page-wrapper">
+    <a-form
+      id="goodsEdit-form"
+      :form="form"
+      ref="form"
+      v-bind="formItemLayout"
+      @submit="handleSubmit">
+      <a-form-item label="商品图片" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+        <Upload
+          id="goodsEdit-commodity"
+          v-decorator="[
+            'formData.commodity',
+            { initialValue: formData.commodity, rules: [{ required: true, message: '请上传商品图片' }] }
+          ]"
+          ref="bannerImage"
+          :maxNums="6"
+          :fileSize="0.25"
+          @change="changeImage"
+          listType="picture-card"
+        ></Upload>
+        <span class="upload-desc">请上传200*150尺寸的图片,大小不超过0.25MB,png、jpg、jpeg格式。(最多可上传6张)</span>
+      </a-form-item>
+      <a-form-item label="商品名称" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+        <a-input
+          id="goodsEdit-title"
+          :maxLength="30"
+          v-decorator="[
+            'formData.name',
+            { initialValue: formData.name, getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入商品名称(最多30个字符)' }] }
+          ]"
+          placeholder="请输入商品名称(最多30个字符)"
+          allowClear />
+      </a-form-item>
+      <a-form-item label="商品分类" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+        <v-select
+          ref="position"
+          code="ADVERT_POSITION"
+          allowClear
+          id="goodsEdit-position"
+          placeholder="请选择商品分类"
+          v-decorator="['formData.classification', { initialValue: formData.classification, rules: [{ required: true, message: '请选择商品分类' }] }]"
+        ></v-select>
+      </a-form-item>
+      <a-form-item label="商品价格" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+        <a-input-number
+          id="goodsEdit-price"
+          class="inpNumber"
+          :min="0"
+          :max="999999"
+          :precision="2"
+          v-decorator="[ 'formData.price', { initialValue: formData.price, rules: [{ required: true, message: '请输入商品价格(0~999999)' }] } ]"
+          placeholder="请输入商品价格(0~999999)。10个乐豆等值于1元"
+          allowClear />
+        <span class="inp-unit">乐豆</span>
+      </a-form-item>
+      <a-form-item label="库存数量" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+        <a-input-number
+          id="goodsEdit-stockNum"
+          class="inpNumber"
+          :min="0"
+          :max="999999"
+          :precision="2"
+          v-decorator="['formData.stockNum', { initialValue: formData.stockNum, rules: [{ required: true, message: '请输入库存数量(0~999999)' }] }]"
+          placeholder="请输入库存数量(0~999999)。当库存数量为0时显示为已售罄且无法下单"
+          allowClear />
+      </a-form-item>
+      <a-form-item label="供货商" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+        <v-select
+          ref="supplierName"
+          code="ADVERT_POSITION"
+          allowClear
+          id="goodsEdit-position"
+          placeholder="请选择供货商"
+          v-decorator="['formData.supplierName', { initialValue: formData.supplierName, rules: [{ required: true, message: '请选择商品分类' }] }]"
+        ></v-select>
+      </a-form-item>
+      <a-form-item label="商品详情" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+        <editor ref="editor" class="goodsEdit-editor" @on-change="editorChange" :cache="false"></editor>
+      </a-form-item>
+      <a-form-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+        <a-button type="primary" html-type="submit" id="goodsEdit-submit" style="margin-right: 15px">保存</a-button>
+        <a-button @click="close" style="margin-left: 15px" id="goodsEdit-close">取消</a-button>
+      </a-form-item>
+    </a-form>
+  </a-card>
+</template>
+
+<script>
+import { Upload, STable, VSelect } from '@/components'
+import Editor from '@/components/WEeditor'
+export default {
+  name: 'GoodsEdit',
+  components: { Upload, STable, VSelect, Editor },
+  data () {
+    return {
+      form: this.$form.createForm(this),
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 16 }
+      },
+      formData: {
+        commodity: '', //  商品图
+        name: '', // 商品名称
+        classification: '', // 商品分类
+        price: '', //  商品价格
+        stockNum: '', // 库存数量
+        supplierName: null, //  供货商
+        goodsDesc: null //  商品详情
+      }
+    }
+  },
+  methods: {
+    //  保存
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          console.info('success')
+        }
+      })
+    },
+    //  取消
+    close () {
+      this.$router.push({ path: '/shop/goods/list' })
+    },
+    changeImage () {
+
+    },
+    //  商品详情  文本编辑器
+    editorChange (html, text) {
+      console.log(html, '文本编辑器')
+      this.formData.goodsDesc = html
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .goodsEdit-table-page-wrapper{
+    //  商品图片描述
+    .upload-desc{
+      font-size: 12px;
+      color: #808695;
+    }
+    //  input-number 框宽度
+    .inpNumber{
+      width: 90%;
+      margin-right: 8px;
+    }
+    //  文本编辑器  工具栏样式换行
+    .goodsEdit-editor{
+      .w-e-toolbar{
+        flex-wrap: wrap;
+      }
+    }
+  }
+</style>

+ 67 - 116
src/views/shop/goodsList.vue

@@ -1,39 +1,39 @@
 <template>
-  <a-card :bordered="false" class="shopOrder-table-page-search-wrapper">
-    <div class="shopOrder-searchForm">
+  <a-card :bordered="false" class="goodsList-table-page-wrapper">
+    <div class="goodsList-searchForm">
       <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="48">
           <a-col :span="6">
             <a-form-item label="商品名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-input allowClear v-model.trim="queryParam.contactPhone" :maxLength="11" placeholder="请输入商品名称" />
+              <a-input allowClear v-model.trim="queryParam.name" :maxLength="11" placeholder="请输入商品名称" />
             </a-form-item>
           </a-col>
           <a-col :span="6">
             <a-form-item label="供货商" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-input allowClear v-model.trim="queryParam.name" placeholder="请输入供货商" />
+              <a-input allowClear v-model.trim="queryParam.supplierName" placeholder="请输入供货商" />
             </a-form-item>
           </a-col>
           <a-col :span="6">
             <a-form-item label="商品状态" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
               <v-select
-                v-model="queryParam.status"
-                ref="salesChannelSettleStatus"
-                id="shopOrder-status"
+                v-model="queryParam.goodsStatus"
+                ref="goodsStatus"
+                id="goodsList-status"
                 code="SETTLE_STATUS_ALL"
                 placeholder="请选择商品状态"
                 allowClear></v-select>
             </a-form-item>
           </a-col>
           <a-col :span="6">
-            <a-button class="handle-btn serach-btn" id="shopOrder-serach" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
-            <a-button class="handle-btn" type="" id="shopOrder-reset" @click="handleReset">重置</a-button>
+            <a-button class="handle-btn serach-btn" id="goodsList-serach" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button class="handle-btn" type="" id="goodsList-reset" @click="handleReset">重置</a-button>
           </a-col>
         </a-row>
       </a-form>
     </div>
     <a-divider />
     <div class="table-operator">
-      <a-button type="primary" icon="plus" @click="openModal">新增</a-button>
+      <a-button type="primary" icon="plus" @click="handleGoods('add')">新增</a-button>
     </div>
     <s-table
       ref="table"
@@ -42,14 +42,14 @@
       :columns="columns"
       :data="loadData"
       bordered>
-      <!-- 订单状态 -->
+      <!-- 商品状态 -->
       <template slot="orderStatus" slot-scope="text, record">
-        <span :class="[record.orderStatus==1 ? 'green' : 'red']">{{ record.orderStatus==1 ? '已启用' : '已禁用' }}</span>
+        <span>{{ record.orderStatus==1 ? '已启用' : '已禁用' }}</span>
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-icon title="编辑" type="edit" class="actionBtn icon-blues" @click="openModal(record)" />
-        <!-- <a-icon title="删除" type="delete" class="actionBtn icon-red" v-if="record.status == '0'" @click="delect(record)" /> -->
+        <a-icon title="编辑" type="edit" id="goodsList-delect" class="actionBtn icon-blues" @click="handleGoods('edit', record)" />
+        <a-icon title="删除" type="delete" id="goodsList-delect" class="actionBtn icon-red" @click="handleDel(record)" />
       </template>
     </s-table>
   </a-card>
@@ -57,14 +57,8 @@
 </template>
 
 <script>
-import {
-  STable,
-  VSelect
-} from '@/components'
-import {
-  getTenantsList,
-  tenantsDelete
-} from '@/api/tenants.js'
+import { STable, VSelect } from '@/components'
+import { getTenantsList, tenantsDelete } from '@/api/tenants.js'
 import getDate from '@/libs/getDate.js'
 import moment from 'moment'
 export default {
@@ -72,51 +66,49 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
-      pageNo: 1,
-      pageSize: 10,
-      openTenantsModal: false, // 打开授权弹窗
-      itemId: '', // 要编辑的租户id
       // 查询参数
       queryParam: {
-        beginDate: null, // 开始时间
-        endDate: null, // 结束时间
-        name: '',
-        contactPhone: '',
-        status: '' // 状态
+        name: '', //  商品名称
+        supplierName: '', //  供货商
+        goodsStatus: '' // 商品状态
       },
       loading: false, // 导出loading
       // 表头
       columns: [
-        { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '商品名称', dataIndex: 'orderDate', width: 200, align: 'center' },
         { title: '商品价格(乐豆)', dataIndex: 'userMoblie', width: 200, align: 'center' },
         { title: '供货商', dataIndex: 'orderNo', width: 200, align: 'center' },
-        { title: '商品状态', scopedSlots: { customRender: 'orderStatus' }, width: 80, align: 'center' },
+        { title: '商品状态', scopedSlots: { customRender: 'orderStatus' }, width: 200, align: 'center' },
         { title: '库存数量', dataIndex: 'orderPrice', width: 200, align: 'center' },
         { title: '已售数量', dataIndex: 'orderNum', width: 200, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        return getTenantsList(Object.assign(parameter, this.queryParam)).then(res => {
-          console.log(res, 'rrrrrrr')
-          if (res.status == 200) {
-            const no = (res.data.pageNo - 1) * res.data.pageSize
-            for (let i = 0; i < res.data.list.length; i++) {
-              const _item = res.data.list[i]
-              _item.no = no + i + 1
-              _item.status = _item.status + '' === '1'
-            }
-            return res.data
-          }
+        // return getTenantsList(Object.assign(parameter, this.queryParam)).then(res => {
+        //   if (res.status == 200) {
+        //     const no = (res.data.pageNo - 1) * res.data.pageSize
+        //     for (let i = 0; i < res.data.list.length; i++) {
+        //       const _item = res.data.list[i]
+        //       _item.no = no + i + 1
+        //       _item.status = _item.status + '' === '1'
+        //     }
+        //     return res.data
+        //   }
+        // })
+        return new Promise((resolve) => {
+          const data = [
+            { no: 1, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '1', orderPrice: '155', orderNum: '67' },
+            { no: 2, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '0', orderPrice: '155', orderNum: '67' },
+            { no: 3, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '1', orderPrice: '155', orderNum: '67' },
+            { no: 4, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '1', orderPrice: '155', orderNum: '67' },
+            { no: 5, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '0', orderPrice: '155', orderNum: '67' },
+            { no: 6, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '0', orderPrice: '155', orderNum: '67' }
+          ]
+          resolve(data)
         })
-      },
-      // 将默认当天时间日期回显在时间选择框中
-      time: [
-        moment(getDate.getToday().starttime, this.dateFormat),
-        moment(getDate.getToday().endtime, this.dateFormat)
-      ],
-      dateFormat: 'YYYY-MM-DD'
+      }
     }
   },
   beforeRouteEnter (to, from, next) {
@@ -137,89 +129,48 @@ export default {
         this.searchForm.endDate = dateStrings[1]
       }
     },
-    // 打开新增/编辑 弹窗
-    openModal (row) {
-      this.itemId = row ? row.id : ''
-      this.openTenantsModal = true
+    //  新增、编辑商品
+    handleGoods (type, row) {
+      if (type == 'add') {
+        this.$router.push({ path: '/shop/goods/add' })
+      } else if (type == 'edit') {
+        this.$router.push({ path: `/shop/goods/edit/${row.no}` })
+      }
     },
-    // 删除
-    delect (row) {
+    //  删除商品
+    handleDel (row) {
       const _this = this
       this.$confirm({
-        title: '警告',
+        title: '提示',
         centered: true,
         content: '删除后原数据不可恢复,是否删除?',
         okText: '确定',
         cancelText: '取消',
         onOk () {
-          tenantsDelete({
-          	id: row.id
-          }).then(res => {
-          	if (res.status == 200) {
-          		_this.$message.success('res.message')
-          		_this.$refs.table.refresh()
-          	}
-          })
+          // tenantsDelete({
+          // 	id: row.id
+          // }).then(res => {
+          // 	if (res.status == 200) {
+          // 		_this.$message.success('res.message')
+          // 		_this.$refs.table.refresh()
+          // 	}
+          // })
         }
       })
     },
     // 重置
     handleReset () {
-      this.queryParam.beginDate = getDate.getToday().starttime
-      this.queryParam.endDate = getDate.getToday().endtime
-      this.time = [
-        moment(getDate.getToday().starttime, this.dateFormat),
-        moment(getDate.getToday().endtime, this.dateFormat)
-      ]
-      this.queryParam.bundleName = ''
-      this.queryParam.number = ''
-      this.queryParam.orderFlag = null
+      this.queryParam.name = ''
+      this.queryParam.supplierName = ''
+      this.queryParam.goodsStatus = null
       this.$refs.table.refresh(true)
-    },
-    // 导出
-    handleExport () {
-      const params = {
-        beginDate: this.searchForm.beginDate == null ? getDate.getToday().starttime : this.searchForm.beginDate,
-        endDate: this.searchForm.endDate == null ? getDate.getToday().endtime : this.searchForm.endDate,
-        bundleName: this.searchForm.bundleName,
-        number: this.searchForm.number,
-        queryWord: this.searchForm.queryWord,
-        orderFlag: this.searchForm.orderFlag,
-        salesChannelSettleStatus: this.searchForm.salesChannelSettleStatus
-      }
-      if (!params.beginDate && !params.endDate) {
-        this.$message.error('请先选择需要导出的下单时间区间再进行导出!')
-        return
-      }
-      // 判断两个时间段是否相差m个月
-      if (!completeDate(params.beginDate, params.endDate, 3)) {
-        this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
-        return
-      }
-      this.loading = true
-      exportBundle(params).then(res => {
-        this.loading = false
-        this.download(res)
-      })
-    },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDhhmmss')
-      const fname = '已购套餐记录-' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
     }
   }
 }
 </script>
 <style lang="less" scoped>
-  .shopOrder-table-page-search-wrapper{
-    .shopOrder-searchForm{
+  .goodsList-table-page-wrapper{
+    .goodsList-searchForm{
       .ant-form-inline .ant-form-item{
         width: 100%;
       }

+ 141 - 229
src/views/shop/orderDetail.vue

@@ -1,249 +1,161 @@
 <template>
-  <a-card :bordered="false">
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="48">
-          <a-col :span="6">
-            <a-form-item label="企业名称">
-              <a-input allowClear v-model.trim="queryParam.name" placeholder="请输入企业名称" />
-            </a-form-item>
-          </a-col>
-          <a-col :span="6">
-            <a-form-item label="负责人手机">
-              <a-input allowClear v-model.trim="queryParam.contactPhone" placeholder="请输入申请人手机" />
-            </a-form-item>
-          </a-col>
-          <a-col :span="6">
-            <a-form-item label="启用状态">
-              <v-select ref="status" allowClear placeholder="状态" v-model="queryParam.status" code="ENABLE_FLAG"></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :span="6">
-            <a-button type="primary" style="margin-right: 10px;" @click="$refs.table.refresh(true)">查询</a-button>
-            <a-button type="" @click="reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <a-divider />
-    <div class="table-operator">
-      <a-button type="primary" icon="plus" @click="openModal">新增</a-button>
-    </div>
-    <s-table
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      bordered>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-icon title="编辑" type="edit" class="actionBtn icon-blues" @click="openModal(record)" />
-        <!-- <a-icon title="删除" type="delete" class="actionBtn icon-red" v-if="record.status == '0'" @click="delect(record)" /> -->
-      </template>
-      <!-- 启用禁用 -->
-      <template slot="enable" slot-scope="text, row">
-        <span :class="[text==1 ? 'green' : 'red']">{{ text==1 ? '已启用' : '已禁用' }}</span>
-      </template>
-    </s-table>
-  </a-card>
-
+  <div class="orderDetail-page-wrapper">
+    <a-card :bordered="false" class="orderDetail-goods-info">
+      <!-- 标题 -->
+      <div class="page-header">
+        <h3>订单信息</h3>
+        <a-badge count="部分发货" :number-style="{ border: '1px solid #ff9900', backgroundColor: 'transparent', color: '#ff9900', padding: '1px 10px', height: '24px' }" />
+      </div>
+      <a-divider />
+      <a-row :gutter="48">
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">下单时间:</p>
+          <p class="item-main">2020-10-30 16:45</p>
+        </a-col>
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">订单编号:</p>
+          <p class="item-main">No12387612387</p>
+        </a-col>
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">订单总额:</p>
+          <p class="item-main">1123乐豆</p>
+        </a-col>
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">用户手机:</p>
+          <p class="item-main">15757989887</p>
+        </a-col>
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">收货人姓名:</p>
+          <p class="item-main">豆豆</p>
+        </a-col>
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">收货人手机:</p>
+          <p class="item-main">15712457854</p>
+        </a-col>
+        <a-col :span="16" class="item-cont">
+          <p class="item-label">收货地址:</p>
+          <p class="item-main">陕西省西安市未央区阿克苏接电话高科技大厦</p>
+        </a-col>
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">支付时间:</p>
+          <p class="item-main">2020-10-30 16:46</p>
+        </a-col>
+      </a-row>
+    </a-card>
+    <a-card :bordered="false" class="orderDetail-goods-main">
+      <!-- 标题 -->
+      <div class="page-header">
+        <h3>商品信息</h3>
+      </div>
+      <a-divider />
+      <div class="goods-info-cont">
+        <!-- 供应商列 -->
+        <a-menu class="menu-cont" :defaultSelectedKeys="[menuList[0].id]" mode="horizontal" @click="handleClick">
+          <a-menu-item v-for="item in menuList" :key="item.id" :title="item.name">
+            {{ item.name }}
+          </a-menu-item>
+        </a-menu>
+        <!-- 商品订单 -->
+        <GoodsOrder v-for="(item, index) in orderData" :key="index" :orderData="item" @sendGoods="sendGoods" />
+      </div>
+    </a-card>
+    <!-- 物流信息 -->
+    <GoodsLogistics :openModal="openModal" @success="sendGoodsSuccess" @close="openModal=false" />
+  </div>
 </template>
 
 <script>
-import {
-  STable,
-  VSelect
-} from '@/components'
-import {
-  getTenantsList,
-  tenantsDelete
-} from '@/api/tenants.js'
-import moment from 'moment'
+import GoodsOrder from './GoodsOrder.vue'
+import GoodsLogistics from './GoodsLogistics.vue'
 export default {
   name: 'OrderDetail',
-  components: {
-    STable,
-    VSelect
-  },
+  components: { GoodsOrder, GoodsLogistics },
   data () {
     return {
-      moment,
-      pageNo: 1,
-      pageSize: 10,
-      openTenantsModal: false, // 打开授权弹窗
-      itemId: '', // 要编辑的租户id
-      // 查询参数
-      queryParam: {
-        name: '',
-        contactPhone: '',
-        status: '' // 状态
-      },
-      // 表头
-      columns: [{
-        title: '序号',
-        dataIndex: 'no',
-        width: '40',
-        align: 'center'
-      },
-      {
-        title: '创建时间',
-        dataIndex: 'createDate',
-        width: '200',
-        align: 'center'
-      },
-      {
-        title: '企业名称',
-        dataIndex: 'name',
-        align: 'center'
-      },
-      {
-        title: '负责人名称',
-        dataIndex: 'contactName',
-        width: '120',
-        align: 'center',
-        customRender: (text) => {
-		  return text || '--'
-        }
-      },
-      {
-        title: '负责人手机',
-        width: '120',
-        align: 'center',
-        dataIndex: 'contactPhone'
-      },
-      {
-        title: '有效期至',
-        width: '200',
-        align: 'center',
-        dataIndex: 'expireDate'
-      },
-      {
-        title: '启用状态',
-        width: '200',
-        align: 'center',
-        dataIndex: 'status',
-        scopedSlots: {
-          customRender: 'enable'
-        }
-      },
-      {
-        title: '操作',
-        width: '200',
-        align: 'center',
-        scopedSlots: {
-          customRender: 'action'
+      menuList: [
+        { id: 1, name: '供应商1' },
+        { id: 2, name: '供应商2' },
+        { id: 3, name: '供应商3' }
+      ],
+      orderData: [
+        {
+          orderStatus: 1,
+          listData: [
+            { id: 1, name: '蓝精灵阿斯达克洗衣液', price: 52, buyNum: 30 },
+            { id: 2, name: '前往东京国际权威的沐浴露', price: 22, buyNum: 7 },
+            { id: 3, name: '三只松鼠', price: 143, buyNum: 10 }
+          ]
+        },
+        {
+          orderStatus: 2,
+          companyName: '韵达快递',
+          orderNo: '476136981238',
+          listData: [
+            { id: 1, name: '蓝精灵阿斯达克洗衣液', price: 52, buyNum: 30 },
+            { id: 2, name: '前往东京国际权威的沐浴露', price: 22, buyNum: 7 }
+          ]
+        },
+        {
+          orderStatus: 2,
+          companyName: '顺丰快递',
+          orderNo: '4665476136981238',
+          listData: [
+            { id: 1, name: '蓝精灵阿斯达克洗衣液', price: 52, buyNum: 30 },
+            { id: 2, name: '前往东京国际权威的沐浴露', price: 22, buyNum: 7 }
+          ]
         }
-      }
       ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        return getTenantsList(Object.assign(parameter, this.queryParam)).then(res => {
-          console.log(res, 'rrrrrrr')
-          if (res.status == 200) {
-            const no = (res.data.pageNo - 1) * res.data.pageSize
-            for (let i = 0; i < res.data.list.length; i++) {
-              const _item = res.data.list[i]
-              _item.no = no + i + 1
-              _item.status = _item.status + '' === '1'
-            }
-            return res.data
-          }
-        })
-      }
+      openModal: false //  是否填写物流信息
     }
   },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {
-      vm.reset()
-    })
-  },
   methods: {
-    // 打开新增/编辑 弹窗
-    openModal (row) {
-      this.itemId = row ? row.id : ''
-      this.openTenantsModal = true
+    //  切换  供应商
+    handleClick (item) {
+      console.log(item, '---切换供应商')
     },
-    // 删除
-    delect (row) {
-      const _this = this
-      this.$confirm({
-        title: '警告',
-        centered: true,
-        content: '删除后原数据不可恢复,是否删除?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          tenantsDelete({
-          	id: row.id
-          }).then(res => {
-          	if (res.status == 200) {
-          		_this.$message.success('res.message')
-          		_this.$refs.table.refresh()
-          	}
-          })
-        }
-      })
+    //  立即发货
+    sendGoods (idArr) {
+      console.log(idArr)
+      this.openModal = true
     },
-    // 重置
-    reset () {
-      this.queryParam = {
-        name: '',
-        contactPhone: '',
-        status: '' // 状态
-      }
-      this.$refs.table.refresh(true)
+    //  物流信息填写成功
+    sendGoodsSuccess () {
+      console.log('物流信息填写成功')
     }
   }
 }
 </script>
-<style>
-	.table-page-search-wrapper,
-	.addButton {
-		margin-bottom: 0;
-	}
-
-	.table-page-search-wrapper .ant-form-inline .ant-form-item {
-		margin-bottom: 10px;
-	}
-
-	.textCount {
-		border: 1px solid #91d5ff;
-		background-color: #e6f7ff;
-		padding: 10px 0;
-		border-radius: 5px;
-		padding-left: 20px;
-		margin: 10px 0;
-	}
-
-	.action-button {
-		line-height: 40px;
-		white-space: nowrap;
-		padding: 5px 10px;
-		background-color: #1890ff;
-		border-radius: 4px;
-		color: #fff;
-		margin-right: 5px;
-	}
-
-	.menu-text {
-		background-color: #f90;
-	}
-
-	.actionBtn {
-		font-size: 20px;
-		padding: 0 10px;
-	}
-
-	.blue {
-		color: #1890FF;
-	}
-
-	.green {
-		color: #16b50e;
-	}
-
-	.red {
-		color: red;
-	}
+<style lang="less" scoped>
+	.orderDetail-page-wrapper{
+    .orderDetail-goods-info{
+      //  标题
+      .page-header{
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        h3{
+          margin: 0;
+        }
+      }
+      .item-cont{
+        display: flex;
+        justify-content: space-evenly;
+        margin-bottom: 24px;
+        .item-label{
+          display: inline-block;
+          flex-shrink: 0;
+          margin: 0;
+          width: 90px;
+        }
+        .item-main{
+          display: inline-block;
+          flex-grow: 1;
+          margin: 0;
+        }
+      }
+    }
+    .orderDetail-goods-main{
+      margin-top: 15px;
+    }
+  }
 </style>

+ 60 - 83
src/views/shop/shopOrder.vue

@@ -21,14 +21,14 @@
           </a-col>
           <a-col :span="6">
             <a-form-item label="订单编号" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-input allowClear v-model.trim="queryParam.name" placeholder="请输入订单编号" />
+              <a-input allowClear v-model.trim="queryParam.orderNo" placeholder="请输入订单编号" />
             </a-form-item>
           </a-col>
           <a-col :span="6">
             <a-form-item label="订单状态" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
               <v-select
-                v-model="queryParam.status"
-                ref="salesChannelSettleStatus"
+                v-model="queryParam.orderStatus"
+                ref="orderStatus"
                 id="shopOrder-status"
                 code="SETTLE_STATUS_ALL"
                 placeholder="请选择订单状态"
@@ -44,7 +44,6 @@
     </div>
     <a-divider />
     <div class="table-operator">
-      <!-- <a-button type="primary" icon="plus" @click="openModal">新增</a-button> -->
       <a-button class="export-btn" id="shopOrder-export" type="" :loading="loading" @click="handleExport">导出</a-button>
     </div>
     <s-table
@@ -56,12 +55,15 @@
       bordered>
       <!-- 订单状态 -->
       <template slot="orderStatus" slot-scope="text, record">
-        <span :class="[record.orderStatus==1 ? 'green' : 'red']">{{ record.orderStatus==1 ? '已启用' : '已禁用' }}</span>
+        <span>{{ record.orderStatus==1 ? '已启用' : '已禁用' }}</span>
+      </template>
+      <!-- 订单总额 -->
+      <template slot="orderPrice" slot-scope="text, record">
+        <span>{{ record.orderPrice || 0 }}乐豆</span>
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-icon title="编辑" type="edit" class="actionBtn icon-blues" @click="openModal(record)" />
-        <!-- <a-icon title="删除" type="delete" class="actionBtn icon-red" v-if="record.status == '0'" @click="delect(record)" /> -->
+        <a-icon type="eye" id="shopOrder-handleView" title="详情" class="actionBtn icon-green" @click="handleView(record)" />
       </template>
     </s-table>
   </a-card>
@@ -69,14 +71,8 @@
 </template>
 
 <script>
-import {
-  STable,
-  VSelect
-} from '@/components'
-import {
-  getTenantsList,
-  tenantsDelete
-} from '@/api/tenants.js'
+import { STable, VSelect } from '@/components'
+import { getTenantsList, tenantsDelete } from '@/api/tenants.js'
 import getDate from '@/libs/getDate.js'
 import moment from 'moment'
 export default {
@@ -84,42 +80,48 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
-      pageNo: 1,
-      pageSize: 10,
-      openTenantsModal: false, // 打开授权弹窗
-      itemId: '', // 要编辑的租户id
       // 查询参数
       queryParam: {
         beginDate: null, // 开始时间
         endDate: null, // 结束时间
-        name: '',
-        contactPhone: '',
-        status: '' // 状态
+        contactPhone: '', //  用户手机
+        orderNo: '', //  订单编号
+        orderStatus: null // 订单状态
       },
       loading: false, // 导出loading
       // 表头
       columns: [
-        { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '下单时间', dataIndex: 'orderDate', width: 200, align: 'center' },
         { title: '用户手机', dataIndex: 'userMoblie', width: 200, align: 'center' },
         { title: '订单编号', dataIndex: 'orderNo', width: 200, align: 'center' },
-        { title: '订单状态', scopedSlots: { customRender: 'orderStatus' }, width: 80, align: 'center' },
-        { title: '订单总额', dataIndex: 'orderPrice', width: 200, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center' }
+        { title: '订单状态', scopedSlots: { customRender: 'orderStatus' }, width: 200, align: 'center' },
+        { title: '订单总额', scopedSlots: { customRender: 'orderPrice' }, width: 200, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        return getTenantsList(Object.assign(parameter, this.queryParam)).then(res => {
-          console.log(res, 'rrrrrrr')
-          if (res.status == 200) {
-            const no = (res.data.pageNo - 1) * res.data.pageSize
-            for (let i = 0; i < res.data.list.length; i++) {
-              const _item = res.data.list[i]
-              _item.no = no + i + 1
-              _item.status = _item.status + '' === '1'
-            }
-            return res.data
-          }
+        // return getTenantsList(Object.assign(parameter, this.queryParam)).then(res => {
+        //   if (res.status == 200) {
+        //     const no = (res.data.pageNo - 1) * res.data.pageSize
+        //     for (let i = 0; i < res.data.list.length; i++) {
+        //       const _item = res.data.list[i]
+        //       _item.no = no + i + 1
+        //       _item.status = _item.status + '' === '1'
+        //     }
+        //     return res.data
+        //   }
+        // })
+        return new Promise((resolve) => {
+          const data = [
+            { no: 1, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '1', orderPrice: '155' },
+            { no: 2, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '0', orderPrice: '155' },
+            { no: 3, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '1', orderPrice: '155' },
+            { no: 4, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '1', orderPrice: '155' },
+            { no: 5, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '0', orderPrice: '155' },
+            { no: 6, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '0', orderPrice: '155' }
+          ]
+          resolve(data)
         })
       },
       // 将默认当天时间日期回显在时间选择框中
@@ -144,35 +146,13 @@ export default {
     // 创建时间change
     onChange (dates, dateStrings) {
       if ((dates, dateStrings)) {
-        this.searchForm.beginDate = dateStrings[0]
-        this.searchForm.endDate = dateStrings[1]
+        this.queryParam.beginDate = dateStrings[0]
+        this.queryParam.endDate = dateStrings[1]
       }
     },
-    // 打开新增/编辑 弹窗
-    openModal (row) {
-      this.itemId = row ? row.id : ''
-      this.openTenantsModal = true
-    },
-    // 删除
-    delect (row) {
-      const _this = this
-      this.$confirm({
-        title: '警告',
-        centered: true,
-        content: '删除后原数据不可恢复,是否删除?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          tenantsDelete({
-          	id: row.id
-          }).then(res => {
-          	if (res.status == 200) {
-          		_this.$message.success('res.message')
-          		_this.$refs.table.refresh()
-          	}
-          })
-        }
-      })
+    //  查看详情
+    handleView (row) {
+      this.$router.push({ path: `/shop/order/detail/${row.no}` })
     },
     // 重置
     handleReset () {
@@ -182,36 +162,33 @@ export default {
         moment(getDate.getToday().starttime, this.dateFormat),
         moment(getDate.getToday().endtime, this.dateFormat)
       ]
-      this.queryParam.bundleName = ''
-      this.queryParam.number = ''
-      this.queryParam.orderFlag = null
+      this.queryParam.contactPhone = ''
+      this.queryParam.orderNo = ''
+      this.queryParam.orderStatus = null
       this.$refs.table.refresh(true)
     },
     // 导出
     handleExport () {
       const params = {
-        beginDate: this.searchForm.beginDate == null ? getDate.getToday().starttime : this.searchForm.beginDate,
-        endDate: this.searchForm.endDate == null ? getDate.getToday().endtime : this.searchForm.endDate,
-        bundleName: this.searchForm.bundleName,
-        number: this.searchForm.number,
-        queryWord: this.searchForm.queryWord,
-        orderFlag: this.searchForm.orderFlag,
-        salesChannelSettleStatus: this.searchForm.salesChannelSettleStatus
+        beginDate: this.queryParam.beginDate == null ? getDate.getToday().starttime : this.queryParam.beginDate,
+        endDate: this.queryParam.endDate == null ? getDate.getToday().endtime : this.queryParam.endDate,
+        contactPhone: this.queryParam.contactPhone,
+        orderNo: this.queryParam.orderNo,
+        orderStatus: this.queryParam.orderStatus
       }
       if (!params.beginDate && !params.endDate) {
         this.$message.error('请先选择需要导出的下单时间区间再进行导出!')
         return
       }
-      // 判断两个时间段是否相差m个月
-      if (!completeDate(params.beginDate, params.endDate, 3)) {
+      // 判断两个时间段是否相差m个月  第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
+      if (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 3) {
         this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
-        return
       }
-      this.loading = true
-      exportBundle(params).then(res => {
-        this.loading = false
-        this.download(res)
-      })
+      // this.loading = true
+      // exportBundle(params).then(res => {
+      //   this.loading = false
+      //   this.download(res)
+      // })
     },
     download (data) {
       if (!data) { return }
@@ -220,7 +197,7 @@ export default {
       link.style.display = 'none'
       link.href = url
       const a = moment().format('YYYYMMDDhhmmss')
-      const fname = '已购套餐记录-' + a
+      const fname = '订单记录-' + a
       link.setAttribute('download', fname + '.xlsx')
       document.body.appendChild(link)
       link.click()