Sfoglia il codice sorgente

Merge branch 'deploy_0203' of chelingzhu-web/zxyj-admin-html into master

lilei 4 anni fa
parent
commit
578e4706cf

+ 10 - 0
src/api/boxSetting.js

@@ -48,3 +48,13 @@ export const deleteBoxSetting = (params) => {
     method: 'get'
   })
 }
+
+// 导出
+export const exportDevice = (params) => {
+  return axios.request({
+    url: 'device/exportDevice',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 42 - 0
src/api/ledouCollectRecord.js

@@ -0,0 +1,42 @@
+import { axios } from '@/utils/request'
+
+// 列表
+export const offPartnerGoldLogList = (params) => {
+  const url = `offPartnerGoldLog/queryGoldLog/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 总计
+export const getOffPartnerGoldLogTotal = (params) => {
+  const url = `offPartnerGoldLog/sumGoldLog`
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 商户名称
+export const sellerList = params => {
+  return axios.request({
+    url: `offPartnerGoldLog/getAllPartner`,
+    method: 'get',
+    data: {}
+  })
+}
+
+// 导出
+export const exportOffPartnerGoldLog = (params) => {
+  return axios.request({
+    url: 'offPartnerGoldLog/exportGoldLog',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 10 - 0
src/api/order.js

@@ -51,3 +51,13 @@ export const orderExport = (params) => {
     responseType: 'blob'
   })
 }
+
+// 导出订单明细
+export const orderDetailExport = (params) => {
+  return axios.request({
+    url: 'orderGoods/exportOrderGoodDetails',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 10 - 0
src/api/shopSetting.js

@@ -44,6 +44,16 @@ export const saveGoodsClass = (params) => {
   })
 }
 
+// 排序 上移下移
+export const goodsChangeSort = (params) => {
+  const url = `goodsType/swapGoodTypeSort/${params.currentId}/${params.id}`
+  return axios.request({
+    url: url,
+    data: {},
+    method: 'post'
+  })
+}
+
 /* 供货商管理 */
 
 // 列表

+ 11 - 0
src/config/router.config.js

@@ -559,6 +559,17 @@ export const asyncRouterMap = [{
         permission: 'M_userManage_list'
       }
     },
+    {
+		  path: '/businessManage/ledouCollectRecord',
+		  name: 'ledouCollectRecord',
+		  component: () => import(/* webpackChunkName: "businessManage" */
+		    '@/views/businessManage/ledouCollectRecord/ledouCollectRecord.vue'),
+		  meta: {
+		    title: '乐豆收取记录',
+		    icon: 'bar-chart',
+		    permission: 'M_ledouCollectRecord_list'
+		  }
+    },
     {
       path: '/businessManage/leduQuery',
       name: 'leduQuery',

+ 268 - 0
src/views/businessManage/ledouCollectRecord/ledouCollectRecord.vue

@@ -0,0 +1,268 @@
+<template>
+  <a-card :bordered="false" class="ledouCollectRecord-table-page-search-wrapper">
+    <div class="ledouCollectRecord-searchForm">
+      <a-form layout="inline" @keyup.enter.native="refresh">
+        <a-row :gutter="48">
+          <a-col :xs="24" :sm="12" :md="6" :lg="5">
+            <a-form-item label="收取时间:" :label-col="{ span: 7 }" :wrapper-col="{ span: 17}">
+              <a-range-picker
+                style="width:100%"
+                id="ledouCollectRecord-queryOrderDate"
+                :disabledDate="disabledDate"
+                v-model="queryOrderDate"
+                :format="dateFormat"
+                :placeholder="['开始时间', '结束时间']" />
+            </a-form-item>
+          </a-col>
+          <a-col :xs="24" :sm="12" :md="6" :lg="5">
+            <a-form-item label="用户手机" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-input id="ledouCollectRecord-customerMobile" allowClear :maxLength="11" v-model=" queryParam.customerMobile" placeholder="请输入用户手机" />
+            </a-form-item>
+          </a-col>
+          <a-col :xs="24" :sm="12" :md="6" :lg="5">
+            <a-form-item label="商户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-select
+                placeholder="请选择"
+                allowClear
+                v-model="queryParam.officialPartnerNo"
+                :showSearch="true"
+                option-filter-prop="children"
+                :filter-option="filterOption"
+              >
+                <a-select-option v-for="item in optionData" :key="item.officialPartnerNo" :value="item.officialPartnerNo">{{ item.name }}</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :xs="24" :sm="12" :md="6" :lg="5">
+            <a-form-item label="是否撤销" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <v-select code="GOLD_LOG_CANCEL_FLAG" v-model="queryParam.cancelFlag" allowClear placeholder="请选择" id="ledouCollectRecord"></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col :xs="24" :sm="12" :md="6" :lg="4">
+            <a-button class="handle-btn serach-btn" id="ledouCollectRecord-serach" type="primary" @click="refresh">查询</a-button>
+            <a-button class="handle-btn" id="ledouCollectRecord-reset" @click="handleReset">重置</a-button>
+            <a-button class="handle-btn export-btn" id="ledouCollectRecord-export" :loading="loading" @click="handleExport" v-hasPermission="'B_ledouCollectRecord_export'">导出</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 合计 -->
+    <a-alert type="info" showIcon style="margin-bottom:15px">
+      <div class="ftext" slot="message">总计<span> {{ orderTotal }} </span>条记录,累计乐豆收取<span> {{ totalGold }} </span>个,其中 {{ cancelGold }} 个乐豆已撤销收取</div>
+    </a-alert>
+    <s-table
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+    </s-table>
+  </a-card>
+
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import { offPartnerGoldLogList, getOffPartnerGoldLogTotal, sellerList, exportOffPartnerGoldLog } from '@/api/ledouCollectRecord.js'
+import moment from 'moment'
+import getDate from '@/libs/getDate.js'
+export default {
+  components: { STable, VSelect },
+  data () {
+    return {
+      loading: false,
+      form: this.$form.createForm(this),
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 16 }
+      },
+      // 将默认近7天时间日期回显在时间选择框中
+      queryOrderDate: [
+        moment(getDate.getRecentday().starttime, this.dateFormat),
+        moment(getDate.getRecentday().endtime, this.dateFormat)
+      ],
+      dateFormat: 'YYYY-MM-DD',
+      // 查询参数
+      queryParam: {
+        beginDate: null, // 开始时间
+        endDate: null, // 结束时间
+        customerMobile: '', //  用户手机
+        officialPartnerNo: undefined, // 商户名称
+        cancelFlag: '' // 是否撤销
+      },
+      optionData: [],
+      orderTotal: 0,	// 总单数
+      totalGold: 0,	// 总金额
+	  cancelGold: 0, // 撤销收取乐豆数
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '收取时间', dataIndex: 'createDate', align: 'center' },
+        { title: '收取乐豆个数', dataIndex: 'changeNum', width: 200, customRender: (text) => { return text || 0 }, align: 'center' },
+        { title: '用户手机', dataIndex: 'customerMobile', align: 'center' },
+        { title: '商户名称', dataIndex: 'officialPartnerName', align: 'center' },
+        { title: '是否撤销乐豆收取', dataIndex: 'cancelFlagDictValue', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        const searchData = Object.assign(parameter, this.queryParam)
+        if (this.queryOrderDate && this.queryOrderDate.length) {
+          searchData.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
+          searchData.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
+        } else {
+          searchData.beginDate = ''
+          searchData.endDate = ''
+        }
+        return offPartnerGoldLogList(searchData).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
+            }
+            this.orderTotal = res.data.count
+            this.getTotal()
+            return res.data
+          }
+        })
+      }
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+	  vm.queryOrderDate = [
+	    moment(getDate.getRecentday().starttime, vm.dateFormat),
+	    moment(getDate.getRecentday().endtime, vm.dateFormat)
+	  ]
+	  vm.queryParam.officialPartnerNo = undefined
+	  vm.queryParam.customerMobile = ''
+	  vm.queryParam.cancelFlag = ''
+	  vm.getSellerList()
+    })
+  },
+  methods: {
+    moment,
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
+    filterOption (input, option) {
+	  return (
+	    option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+	  )
+    },
+    // 获取合作商数据
+    getSellerList () {
+	  sellerList().then(res => {
+		  if (res.status == 200) {
+			  this.optionData = res.data || []
+		  }
+	  })
+    },
+    // 导出
+    handleExport () {
+      const params = this.queryParam
+      if (this.queryOrderDate && this.queryOrderDate.length) {
+        params.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
+        params.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
+      } else {
+        params.beginDate = ''
+        params.endDate = ''
+      }
+      if (!params.beginDate && !params.endDate) {
+        this.$message.error('请先选择收取时间后查询并导出!')
+        return
+      }
+      // 判断两个时间段是否相差m个月  第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
+      if (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 3) {
+        this.$message.error('仅支持导出最多3个月的数据,请先修改收取时间再进行导出!')
+        return
+      }
+      this.loading = true
+      exportOffPartnerGoldLog(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()
+    },
+    // 查询
+    refresh () {
+      this.$refs.table.refresh(true)
+    },
+    // 合计
+    getTotal () {
+      const params = this.queryParam
+      if (this.queryOrderDate && this.queryOrderDate.length) {
+        params.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
+        params.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
+      } else {
+        params.beginDate = ''
+        params.endDate = ''
+      }
+      getOffPartnerGoldLogTotal(params).then(res => {
+        if (res.status == 200) {
+          if (res.data) {
+            this.totalGold = res.data.totalGold || 0
+            this.cancelGold = res.data.totalCancelGold || 0
+          } else {
+            this.totalGold = 0
+            this.cancelGold = 0
+          }
+        }
+      })
+    },
+    // 重置
+    handleReset () {
+      this.queryOrderDate = [
+        moment(getDate.getRecentday().starttime, this.dateFormat),
+        moment(getDate.getRecentday().endtime, this.dateFormat)
+      ]
+	  this.queryParam.officialPartnerNo = undefined
+	  this.queryParam.customerMobile = ''
+	  this.queryParam.cancelFlag = ''
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>
+<style lang="less" scoped>
+  .ledouCollectRecord-table-page-search-wrapper{
+    .ledouCollectRecord-searchForm{
+      .ant-form-inline .ant-form-item{
+        width: 100%;
+      }
+      // 搜索框的下间距
+      .ant-form-item {
+      	margin-bottom: 10px;
+      }
+      .handle-btn{
+        margin-top: 4px;
+      }
+      .serach-btn{
+        margin-right: 10px;
+      }
+    }
+    .export-btn{
+      background-color: #ff9900;
+      border-color: #ff9900;
+      color: #fff;
+      margin-left: 10px;
+    }
+    .export-btn.ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger), .export-btn.ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger){
+      color: #fff;
+      border-color: #ff9900;
+    }
+  }
+</style>

+ 36 - 2
src/views/equipmentManage/equipment/equipment.vue

@@ -58,6 +58,7 @@
           <a-col :span="6">
             <a-button class="handle-btn serach-btn" id="equipment-btn-serach" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
             <a-button class="handle-btn" type="" id="equipment-btn-reset" @click="handleReset">重置</a-button>
+            <a-button class="handle-btn export-btn" id="ledouCollectRecord-export" :loading="loading" @click="handleExport" v-hasPermission="'B_equipment_export'">导出</a-button>
           </a-col>
         </a-row>
       </a-form>
@@ -102,12 +103,14 @@
 import { STable, VSelect } from '@/components'
 import equipmentLogModal from './logModal.vue'
 import { deviceList } from '@/api/device'
-import { deviceTypeListQuery } from '@/api/boxSetting'
+import { deviceTypeListQuery, exportDevice } from '@/api/boxSetting'
+import moment from 'moment'
 export default {
   name: 'Equipment',
   components: { STable, VSelect, equipmentLogModal },
   data () {
     return {
+      loading: false,
       formItemLayout: {
         labelCol: { span: 7 },
         wrapperCol: { span: 17 }
@@ -136,7 +139,7 @@ export default {
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        return deviceList(Object.assign(parameter, this.queryParam,{ deviceType:"BOX"})).then(res => {
+        return deviceList(Object.assign(parameter, this.queryParam, { deviceType: 'BOX' })).then(res => {
           if (res.status == 200) {
             const no = (res.data.pageNo - 1) * res.data.pageSize
             this.orderTotal = res.data.count
@@ -169,6 +172,27 @@ export default {
       this.queryParam.state = undefined
       this.$refs.table.refresh(true)
     },
+    // 导出
+    handleExport () {
+		  const params = Object.assign(this.queryParam, { deviceType: 'BOX' })
+		  this.loading = true
+		  exportDevice(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()
+    },
     //  查看掉线日志
     checkLog (row) {
       this.srcDeviceCode = row ? row.srcDeviceCode : null
@@ -212,6 +236,16 @@ export default {
       .serach-btn{
         margin-right: 10px;
       }
+			.export-btn{
+			  background-color: #ff9900;
+			  border-color: #ff9900;
+			  color: #fff;
+			  margin-left: 10px;
+			}
+			.export-btn.ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger), .export-btn.ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger){
+			  color: #fff;
+			  border-color: #ff9900;
+			}
     }
     .actionBtn {
     	font-size: 20px;

+ 3 - 1
src/views/releaseRecord/releaseRecordList.vue

@@ -180,6 +180,7 @@ export default {
         stationNo: undefined, // 网点名称
         deviceType: '', // 设备类型
         deliveryWay: '', // 投放方式
+        rubbishType: '',
         goldNumStart: null, // 兑换最小值
         goldNumEnd: null, // 兑换最大值
         rubbishWeightStart: null, // 投放重量最小值
@@ -385,7 +386,8 @@ export default {
       this.queryParam.rubbishWeightStart = ''// 投放重量最小值
       this.queryParam.rubbishWeightEnd = '' // 投放重量最大值
       this.queryParam.deliveryWay = '' // 投放方式
-	  this.queryParam.weightTagList = []
+      this.queryParam.rubbishType = ''
+	    this.queryParam.weightTagList = []
       this.$refs.table.refresh(true)
     }
   }

+ 44 - 11
src/views/shop/shopOrder.vue

@@ -19,7 +19,7 @@
               <a-input id="shopOrder-customerMobile" allowClear :maxLength="11" v-model="queryParam.customerMobile" placeholder="请输入用户手机" />
             </a-form-item>
           </a-col>
-          <a-col :span="4">
+          <a-col :span="6">
             <a-form-item label="订单状态" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
               <v-select
                 v-model="queryParam.orderState"
@@ -38,15 +38,21 @@
               <a-input id="shopOrder-orderSn" allowClear :maxLength="30" v-model="queryParam.orderSn" placeholder="请输入订单编号" />
             </a-form-item>
           </a-col>
-          <a-col :span="6">
-            <a-button class="handle-btn serach-btn" id="shopOrder-btn-serach" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+          <a-col :span="18">
+            <a-button class="handle-btn btn-right" id="shopOrder-btn-serach" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button class="handle-btn btn-right" type="" id="shopOrder-btn-reset" @click="handleReset">重置</a-button>
             <a-button
               v-if="$hasPermissions('B_orderManage_export')"
               class="export-btn"
               id="shopOrder-btn-export"
               :loading="loading"
-              @click="handleExport">导出</a-button>
-            <a-button class="handle-btn" type="" id="shopOrder-btn-reset" @click="handleReset">重置</a-button>
+              @click="handleExport">导出订单</a-button>
+            <a-button
+              class="export-btn"
+              id="shopOrder-btn-exportDetail"
+              v-if="$hasPermissions('B_orderManage_exportOrder')"
+              :loading="loadingDetail"
+              @click="handleOrderExport">导出订单明细</a-button>
           </a-col>
         </a-row>
       </a-form>
@@ -76,7 +82,7 @@
 import { STable, VSelect } from '@/components'
 import getDate from '@/libs/getDate.js'
 import moment from 'moment'
-import { orderList, orderExport } from '@/api/order'
+import { orderList, orderExport, orderDetailExport } from '@/api/order'
 export default {
   name: 'ShopOrder',
   components: { STable, VSelect },
@@ -95,6 +101,7 @@ export default {
         orderState: null // 订单状态
       },
       loading: false, // 导出loading
+	  loadingDetail: false, // 导出订单明细loading
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
@@ -181,22 +188,48 @@ export default {
       // 判断两个时间段是否相差m个月  第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
       if (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 3) {
         this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
-		return
+        return
       }
       this.loading = true
       orderExport(params).then(res => {
         this.loading = false
-        this.download(res)
+        const frname = '订单记录-'
+        this.download(res, frname)
+      })
+    },
+    // 导出订单明细
+    handleOrderExport () {
+      const params = { order: {
+        beginDate: this.queryParam.beginDate == null ? getDate.getToday().starttime : this.queryParam.beginDate,
+        endDate: this.queryParam.endDate == null ? getDate.getToday().endtime : this.queryParam.endDate,
+        customerMobile: this.queryParam.customerMobile,
+        orderSn: this.queryParam.orderSn,
+        orderState: this.queryParam.orderState
+      } }
+      if (!params.order.beginDate && !params.order.endDate) {
+        this.$message.error('请先选择下单时间后查询并导出!')
+        return
+      }
+      // 判断两个时间段是否相差m个月  第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
+      if (moment(params.order.endDate).diff(moment(params.order.beginDate), 'months', true) > 3) {
+        this.$message.error('仅支持导出最多3个月数据,请先修改下单时间再进行导出!')
+        return
+      }
+      this.loadingDetail = true
+      orderDetailExport(params).then(res => {
+        this.loadingDetail = false
+        const frname = '订单商品明细-'
+        this.download(res, frname)
       })
     },
-    download (data) {
+    download (data, frname) {
       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
+      const fname = frname + a
       link.setAttribute('download', fname + '.xlsx')
       document.body.appendChild(link)
       link.click()
@@ -217,7 +250,7 @@ export default {
       .handle-btn{
         margin-top: 4px;
       }
-      .serach-btn{
+      .btn-right{
         margin-right: 10px;
       }
     }

+ 243 - 232
src/views/shopSetting/goodsClass.vue

@@ -1,244 +1,256 @@
 <template>
-  <a-card :bordered="false" class="goodsClass-page-info">
-    <!-- 搜索框 -->
-    <div class="goodsClass-search">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="20">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="商品分类名称" :label-col="{ span:8 }" :wrapper-col="{ span: 16 }">
-              <a-input allowClear v-model="searchData.name" :maxLength="30" placeholder="请输入" id="goodsClass-name" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-button style="margin-right: 10px;" type="primary" @click="$refs.table.refresh(true)" id="goodsClass-refresh">查询</a-button>
-            <a-button type="" @click="resetForm" id="goodsClass-resetForm">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <div class="add">
-      <a-button
-        type="primary"
-        icon="plus"
-        class="addBtn"
-        @click="showModal"
-        id="goodsClass-showModal"
-        v-hasPermission="'B_goodsClass_add'">新增</a-button>
-    </div>
-    <!-- table列表 -->
-    <s-table
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      bordered>
-      <span slot="action" slot-scope="text, record">
-        <a-icon
-          v-hasPermission="'B_goodsClass_edit'"
-          type="edit"
-          id="goodsClass-handleEdit"
-          title="编辑"
-          class="actionBtn icon-blues"
-          @click="handleEdit(record)" />
-        <span v-if="!$hasPermissions('B_goodsClass_edit')">--</span>
-      </span>
-      <span slot="state" slot-scope="text, record">
-        <a-switch
-          v-hasPermission="'B_goodsClass_enable'"
-          checkedChildren="启用"
-          unCheckedChildren="禁用"
-          id="goodsClass-changeFlagHandle"
-          :checked="record.state == 1 ? true : false"
-          @change="changeFlagHandle(text, record)" />
-        <span v-if="!$hasPermissions('B_goodsClass_enable')">--</span>
-      </span>
-      </span></s-table>
-    <add-goodsClass-modal
-      :itemId="itemId"
-      :itemData="itemData"
-      :openGoodClassModal="openGoodClassModal"
-      @refresh="$refs.table.refresh(true)"
-      @close="cancel"></add-goodsClass-modal>
-  </a-card>
+	<a-card :bordered="false" class="goodsClass-page-info">
+		<!-- 搜索框 -->
+		<div class="goodsClass-search">
+			<a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+				<a-row :gutter="20">
+					<a-col :md="6" :sm="24">
+						<a-form-item label="商品分类名称" :label-col="{ span:8 }" :wrapper-col="{ span: 16 }">
+							<a-input allowClear v-model="searchData.name" :maxLength="30" placeholder="请输入" id="goodsClass-name" />
+						</a-form-item>
+					</a-col>
+					<a-col :md="6" :sm="24">
+						<a-button style="margin-right: 10px;" type="primary" @click="$refs.table.refresh(true)" id="goodsClass-refresh">查询</a-button>
+						<a-button type="" @click="resetForm" id="goodsClass-resetForm">重置</a-button>
+					</a-col>
+				</a-row>
+			</a-form>
+		</div>
+		<div class="add">
+			<a-button type="primary" icon="plus" class="addBtn" @click="showModal" id="goodsClass-showModal" v-hasPermission="'B_goodsClass_add'">新增</a-button>
+		</div>
+		<!-- table列表 -->
+		<s-table ref="table" size="default" :rowKey="(record) => record.id" :columns="columns" :data="loadData" bordered>
+			<span slot="action" slot-scope="text, record">
+				<a-icon v-hasPermission="'B_goodsClass_edit'" type="edit" id="goodsClass-handleEdit" title="编辑" class="actionBtn icon-blues"
+				 @click="handleEdit(record)" />
+				<span v-if="!$hasPermissions('B_goodsClass_edit')">--</span>
+			</span>
+			<span slot="state" slot-scope="text, record">
+				<a-switch v-hasPermission="'B_goodsClass_enable'" checkedChildren="启用" unCheckedChildren="禁用" id="goodsClass-changeFlagHandle"
+				 :checked="record.state == 1 ? true : false" @change="changeFlagHandle(text, record)" />
+				<span v-if="!$hasPermissions('B_goodsClass_enable')">--</span>
+			</span>
+			<!-- 排序 -->
+			<template slot="sort" slot-scope="text, record, index">
+				<span v-hasPermission="'B_goodsClass_changeSort'">
+					<a-icon title="下移" v-if="index != list.length-1" :style="{ fontSize: '18px', color: '#1891FF', cursor: 'pointer',padding:'0 10px' }"
+					 @click="changeSort(index,record,0)" type="arrow-down" />
+					<a-icon title="上移" v-if="index != 0" :style="{ fontSize: '18px', color: '#1891FF',cursor: 'pointer', padding:'0 10px' }"
+					 @click="changeSort(index,record,1)" type="arrow-up" />
+					<span v-if="list.length===1">--</span>
+				</span>
+				<span v-if="!$hasPermissions('B_goodsClass_changeSort')">--</span>
+			</template>
+		</s-table>
+		<add-goodsClass-modal :itemId="itemId" :itemData="itemData" :openGoodClassModal="openGoodClassModal" @refresh="$refs.table.refresh(true)"
+		 @close="cancel"></add-goodsClass-modal>
+	</a-card>
 </template>
 
 <script>
-import {
-  Upload,
-  STable,
-  VSelect
-} from '@/components'
-import addGoodsClassModal from './addGoodsClassModal.vue'
-import {
-  getGoodsClassList,
-  changeGoodsStatus
-} from '@/api/shopSetting.js'
+	import {
+		Upload,
+		STable,
+		VSelect
+	} from '@/components'
+	import addGoodsClassModal from './addGoodsClassModal.vue'
+	import {
+		getGoodsClassList,
+		changeGoodsStatus,
+		goodsChangeSort
+	} from '@/api/shopSetting.js'
 
-export default {
-  components: {
-    STable,
-    Upload,
-    VSelect,
-    addGoodsClassModal
-  },
-  data () {
-    return {
-      searchData: {
-        name: ''
-      },
-      openGoodClassModal: false, // 默认关闭弹窗
-      itemId: null, // 编辑行id
-	  itemData: {}, // 编辑行数据
-      formLayout: 'horizontal',
-      form: this.$form.createForm(this),
-      // 表头
-      columns: [{
-        title: '序号',
-        dataIndex: 'no',
-        width: 60,
-        align: 'center'
-      },
-      {
-        title: '商品分类名称',
-        width: 100,
-        dataIndex: 'name',
-        align: 'center'
-      },
-      {
-        title: '订单起购金额',
-        width: 100,
-        dataIndex: 'goldLimit',
-        align: 'center'
-      },
-	  {
-	    title: '商城主页显示数量',
-	    width: 100,
-	    dataIndex: 'popularizeGoodsLimit',
-	    align: 'center'
-	  },
-      {
-        title: '状态',
-        width: 100,
-        dataIndex: 'state',
-        align: 'center',
-        scopedSlots: {
-          customRender: 'state'
-        }
-      },
-      {
-        title: '备注',
-        width: 100,
-        dataIndex: 'remarks',
-        align: 'center',
-        customRender: (text) => {
-          return text || '--'
-        }
-      },
-      {
-        title: '操作',
-        align: 'center',
-        width: 100,
-        scopedSlots: {
-          customRender: 'action'
-        }
-      }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        return getGoodsClassList(
-          Object.assign(parameter, this.searchData)
-        ).then(res => {
-          const no = (res.data.pageNo - 1) * res.data.pageSize
-          if (res.status == 200) {
-            for (let i = 0; i < res.data.list.length; i++) {
-              const _item = res.data.list[i]
-              _item.no = no + i + 1
-            }
-            return res.data
-          }
-        })
-      }
-    }
-  },
-  beforeCreate () {
-    this.form = this.$form.createForm(this, {
-      name: 'validate_other'
-    })
-  },
-  methods: {
-    showModal () {
-      console.log('---新增')
-      this.itemId = null
-	  this.itemData = {}
-      this.openGoodClassModal = true
-    },
-    // 编辑
-    handleEdit (record) {
-      this.itemId = record.id
-	  this.itemData = record
-      console.log(this.itemId, '-------编辑')
-      this.openGoodClassModal = true
-    },
-    // 重置
-    resetForm () {
-      this.searchData.name = ''
-      this.$refs.table.refresh(true)
-    },
-    //
-    cancel () {
-      this.itemId = null
-      this.openGoodClassModal = false
-    },
-    // 更改启用禁用状态
-    changeFlagHandle (text, record) {
-      console.log(text)
-      const _this = this
-      const _data = {
-        id: record.id,
-        flag: record.state == 1 ? '0' : '1'
-      }
-      if (record.state == 1) {
-        this.$confirm({
-          title: '提示',
-          centered: true,
-          content: '商品分类被禁用后,该分类将不在显示给用户,确定禁用吗?',
-          okText: '确定',
-          cancelText: '取消',
-          onOk () {
-            changeGoodsStatus(_data).then(res => {
-              if (res.status == 200) {
-                _this.$message.success(res.message)
-                _this.$refs.table.refresh()
-              }
-            })
-          }
-        })
-      } else {
-        changeGoodsStatus(_data).then(res => {
-          if (res.status == 200) {
-            _this.$message.success(res.message)
-            _this.$refs.table.refresh()
-          } else {
-            record.state = !record.state
-          }
-        })
-      }
-    },
-    beforeRouteEnter (to, from, next) {
-      next(vm => {
-        vm.resetForm()
-      })
-    }
-  }
-}
+	export default {
+		components: {
+			STable,
+			Upload,
+			VSelect,
+			addGoodsClassModal
+		},
+		data() {
+			return {
+				searchData: {
+					name: ''
+				},
+				openGoodClassModal: false, // 默认关闭弹窗
+				itemId: null, // 编辑行id
+				itemData: {}, // 编辑行数据
+				formLayout: 'horizontal',
+				list: [], // 列表数据
+				form: this.$form.createForm(this),
+				// 表头
+				columns: [{
+						title: '序号',
+						dataIndex: 'no',
+						width: 60,
+						align: 'center'
+					},
+					{
+						title: '商品分类名称',
+						width: 100,
+						dataIndex: 'name',
+						align: 'center'
+					},
+					{
+						title: '订单起购金额',
+						width: 100,
+						dataIndex: 'goldLimit',
+						align: 'center'
+					},
+					{
+						title: '商城主页显示数量',
+						width: 100,
+						dataIndex: 'popularizeGoodsLimit',
+						align: 'center'
+					},
+					{
+						title: '状态',
+						width: 100,
+						dataIndex: 'state',
+						align: 'center',
+						scopedSlots: {
+							customRender: 'state'
+						}
+					},
+					{
+						title: '备注',
+						width: 100,
+						dataIndex: 'remarks',
+						align: 'center',
+						customRender: (text) => {
+							return text || '--'
+						}
+					},
+					{
+						title: '排序',
+						width: 200,
+						align: 'center',
+						scopedSlots: {
+							customRender: 'sort'
+						}
+					},
+					{
+						title: '操作',
+						align: 'center',
+						width: 100,
+						scopedSlots: {
+							customRender: 'action'
+						}
+					}
+				],
+				// 加载数据方法 必须为 Promise 对象
+				loadData: parameter => {
+					return getGoodsClassList(
+						Object.assign(parameter, this.searchData)
+					).then(res => {
+						this.list = res.data.list || []
+						const no = (res.data.pageNo - 1) * res.data.pageSize
+						if (res.status == 200) {
+							for (let i = 0; i < res.data.list.length; i++) {
+								const _item = res.data.list[i]
+								_item.no = no + i + 1
+							}
+							return res.data
+						}
+					})
+				}
+			}
+		},
+		beforeCreate() {
+			this.form = this.$form.createForm(this, {
+				name: 'validate_other'
+			})
+		},
+		methods: {
+			showModal() {
+				console.log('---新增')
+				this.itemId = null
+				this.itemData = {}
+				this.openGoodClassModal = true
+			},
+			// 编辑
+			handleEdit(record) {
+				this.itemId = record.id
+				this.itemData = record
+				console.log(this.itemId, '-------编辑')
+				this.openGoodClassModal = true
+			},
+			// 重置
+			resetForm() {
+				this.searchData.name = ''
+				this.$refs.table.refresh(true)
+			},
+			//
+			cancel() {
+				this.itemId = null
+				this.openGoodClassModal = false
+			},
+			// 更改启用禁用状态
+			changeFlagHandle(text, record) {
+				console.log(text)
+				const _this = this
+				const _data = {
+					id: record.id,
+					flag: record.state == 1 ? '0' : '1'
+				}
+				if (record.state == 1) {
+					this.$confirm({
+						title: '提示',
+						centered: true,
+						content: '商品分类被禁用后,该分类将不在显示给用户,确定禁用吗?',
+						okText: '确定',
+						cancelText: '取消',
+						onOk() {
+							changeGoodsStatus(_data).then(res => {
+								if (res.status == 200) {
+									_this.$message.success(res.message)
+									_this.$refs.table.refresh()
+								}
+							})
+						}
+					})
+				} else {
+					changeGoodsStatus(_data).then(res => {
+						if (res.status == 200) {
+							_this.$message.success(res.message)
+							_this.$refs.table.refresh()
+						} else {
+							record.state = !record.state
+						}
+					})
+				}
+			},
+			// 上移 下移 排序 index:下标  item:数据  type:类型 0 下移 1 上移
+			changeSort(index, item, type) {
+				const indexThat = type === 0 ? index + 1 : index - 1
+				const params = {
+					'currentId': item.id,
+					'id': this.list[indexThat].id,
+				}
+				goodsChangeSort(params).then(res => {
+					if (res.status == 200) {
+						this.$refs.table.refresh()
+					} else {
+						this.$message.error(res.message)
+					}
+				})
+			}
+		},
+		beforeRouteEnter(to, from, next) {
+			next(vm => {
+				vm.resetForm()
+			})
+		}
+	}
 </script>
 
 <style lang="less">
-	.goodsClass-page-info{
-		.goodsClass-search{
+	.goodsClass-page-info {
+		.goodsClass-search {
 			margin-bottom: 15px;
 		}
+
 		.w-e-toolbar {
 			flex-wrap: wrap;
 		}
@@ -247,5 +259,4 @@ export default {
 			margin-bottom: 20px;
 		}
 	}
-
 </style>