Ver código fonte

接口对接

zhangdan 4 anos atrás
pai
commit
673b86315f

+ 23 - 0
src/api/releaseRecord.js

@@ -0,0 +1,23 @@
+import { axios } from '@/utils/request'
+
+// 列表
+export const getDeliveryLogList = (params) => {
+  const url = `deliveryLog/query/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 合计
+export const getDeliveryLogTotal = (params) => {
+  const url = `deliveryLog/total`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 10 - 0
src/api/userManage.js

@@ -0,0 +1,10 @@
+import { axios } from '@/utils/request'
+
+// 合作商
+export const sellerList = params => {
+  return axios.request({
+    url: `/seller/queryList`,
+    method: 'post',
+    data: {}
+  })
+}

+ 76 - 17
src/config/router.config.js

@@ -158,6 +158,63 @@ export const asyncRouterMap = [{
     }
     ]
   },
+  // 用户
+  {
+    path: '/userInfo',
+    redirect: '/userInfo/userManageList',
+    component: PageView,
+    meta: {
+      title: '用户',
+      icon: 'shop'
+      // permission: 'M_shop'
+    },
+    children: [{
+      path: '/userInfo/userManage',
+      redirect: '/userInfo/userManageList/list',
+      name: 'userManageList',
+      component: RouteView,
+      meta: {
+        title: '用户管理',
+        icon: 'profile'
+        // permission: 'M_tenants_list'
+      },
+      hideChildrenInMenu: true,
+      children: [{
+        path: '/userInfo/userManageList/list',
+        name: 'userManageList',
+        component: () => import(/* webpackChunkName: "tenants" */ '@/views/userInfo/userManageList.vue'),
+        meta: {
+          title: '用户列表',
+          icon: 'profile',
+          hidden: true
+          // permission: 'M_tenants_list'
+        }
+      },
+      {
+        path: '/userInfo/userManageList_user/detail/:id',
+        name: 'userManageDetail',
+        component: () => import(/* webpackChunkName: "tenants" */ '@/views/userInfo/userDetails.vue'),
+        meta: {
+          title: '用户详情',
+          icon: 'profile',
+          hidden: true
+          // permission: 'M_tenants_list'
+        }
+      },
+      {
+        path: '/userInfo/userManageList_Ld/detail/:id',
+        name: 'ledouDetail',
+        component: () => import(/* webpackChunkName: "tenants" */ '@/views/userInfo/LdDetails.vue'),
+        meta: {
+          title: '乐豆详情',
+          icon: 'profile',
+          hidden: true
+          // permission: 'M_tenants_list'
+        }
+      }
+      ]
+    }]
+  },
   {
     path: '/businessManage',
     redirect: '/businessManag/userManage',
@@ -180,7 +237,8 @@ export const asyncRouterMap = [{
     {
       path: '/businessManage/partnerManage',
       name: 'partnerManage',
-      component: () => import(/* webpackChunkName: "tenants" */ '@/views/businessManage/partnerManage/partnerManage.vue'),
+      component: () => import(/* webpackChunkName: "tenants" */
+        '@/views/businessManage/partnerManage/partnerManage.vue'),
       meta: {
         title: '销售商管理',
         icon: 'solution',
@@ -219,24 +277,25 @@ export const asyncRouterMap = [{
       }
     },
     {
-	  path: '/equipmentManage/boxSetting',
-	  name: 'boxSetting',
-	  component: () => import(/* webpackChunkName: "tenants" */ '@/views/equipmentManage/boxSetting/boxSetting.vue'),
-	  meta: {
-	    title: '箱体类型设置',
-	    icon: 'profile'
-	    // permission: 'M_tenants_list'
-	  }
+      path: '/equipmentManage/boxSetting',
+      name: 'boxSetting',
+      component: () => import(/* webpackChunkName: "tenants" */ '@/views/equipmentManage/boxSetting/boxSetting.vue'),
+      meta: {
+        title: '箱体类型设置',
+        icon: 'profile'
+        // permission: 'M_tenants_list'
+      }
     },
     {
-	  path: '/equipmentManage/exchangeSetting',
-	  name: 'exchangeSetting',
-	  component: () => import(/* webpackChunkName: "tenants" */ '@/views/equipmentManage/exchangeSetting/ExchangeSetting.vue'),
-	  meta: {
-	    title: '兑换规则设置',
-	    icon: 'profile'
-	    // permission: 'M_tenants_list'
-	  }
+      path: '/equipmentManage/exchangeSetting',
+      name: 'exchangeSetting',
+      component: () => import(/* webpackChunkName: "tenants" */
+        '@/views/equipmentManage/exchangeSetting/ExchangeSetting.vue'),
+      meta: {
+        title: '兑换规则设置',
+        icon: 'profile'
+        // permission: 'M_tenants_list'
+      }
     },
     {
       path: '/equipmentManage/openTimeSetting',

+ 337 - 1
src/views/businessManage/userManage/userManage.vue

@@ -1,8 +1,344 @@
 <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 :md="6" :sm="24">
+            <a-form-item label="用户名称" :label-col="{ span: 3 }" :wrapper-col="{ span: 12 }">
+              <a-input
+                allowClear
+                v-model.trim="queryParam.name"
+                placeholder="请输入用户名称"
+                id="userList-name"
+                :maxLength="30"
+              />
+            </a-form-item>
+          </a-col>
+
+          <a-col :md="6" :sm="24">
+            <a-form-item label="手机号码" :label-col="{ span: 3 }" :wrapper-col="{ span: 12 }">
+              <a-input
+                allowClear
+                v-model.trim="queryParam.phone"
+                placeholder="请输入手机号码"
+                :maxLength="11"
+                id="userList-phone"
+              />
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="合作商" :label-col="{ span:3 }" :wrapper-col="{ span:12}">
+              <a-select
+                placeholder="请选择"
+                allowClear
+                v-model="queryParam.officialPartnerNo"
+                :showSearch="true"
+                option-filter-prop="children"
+                :filter-option="filterOption"
+                @focus="handleFocus"
+                @blur="handleBlur"
+                @change="handleChange">
+                <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 :md="6" :sm="24">
+            <a-button type="primary" @click="$refs.table.refresh(true)" id="userList-handSubmit" style="margin-right: 10px;">查询</a-button>
+            <a-button type="" @click="reset" id="userList-reset">重置</a-button>
+          </a-col>
+
+        </a-row>
+        <a-row :gutter="48" style="margin-top: 25px;">
+          <a-col :md="6" :sm="24">
+            <a-form-item label="用户状态" >
+              <v-select code="ENABLE_FLAG" v-model="queryParam.loginFlag" allowClear placeholder="请选择状态" id="userList-check-enable-state"></v-select>
+            </a-form-item>
+          </a-col>
+
+        </a-row>
+      </a-form>
+    </div>
+    <a-divider />
+    <div class="table-operator">
+      <a-button type="primary" icon="plus" @click="openModal" id="userList-openModal">新增</a-button>
+    </div>
+
+    <s-table
+      ref="table"
+      size="default"
+      rowKey="id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <span slot="status" slot-scope="text, record">
+        <a-switch
+          checkedChildren="启用"
+          unCheckedChildren="禁用"
+          v-model="record.loginFlag"
+          @change="changeFlagHandle(text, record)"
+          id="userList-changeFlagHandle" />
+      </span>
+      <span slot="action" slot-scope="text, record">
+        <a-icon
+          type="unlock"
+          title="重置密码"
+          v-if="record.loginFlag==1"
+          class="actionBtn icon-orange"
+          @click="resetPassword(record)" />
+        <a-icon
+          type="edit"
+          title="编辑"
+          class="actionBtn icon-blues"
+          @click="handleEdit(record)"
+        />
+        <a-icon
+          type="delete"
+          title="删除"
+          class="actionBtn icon-red"
+          v-if="record.loginFlag==0"
+          @click="delect(record)"/>
+      </span>
+    </s-table>
+    <userModal :visible="showModal" @refresh="$refs.table.refresh(true)" :data="itemData" @close="showModal = false"></userModal>
+  </a-card>
 </template>
 
 <script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import userModal from './userModal.vue'
+import {
+  resetPSD,
+  updateEnableStatus,
+  getPowerUserList,
+  delectUserPower
+} from '@/api/power-user.js'
+import { sellerList } from '@/api/userManage.js'
+export default {
+  name: 'UserList',
+  components: {
+    STable,
+    VSelect,
+    userModal
+  },
+  data () {
+    return {
+      // 查询参数
+      queryParam: {
+        name: '',
+        phone: '',
+        loginFlag: '',
+        officialPartnerNo: undefined
+      },
+      showModal: false,
+      itemData: {}, // 编辑行数据
+	  optionData: [],
+      // 表头
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 60,
+        align: 'center'
+      },
+      {
+        title: '创建时间',
+        dataIndex: 'createDate',
+        width: '120',
+        align: 'center'
+      },
+      {
+        title: '用户名称',
+        dataIndex: 'name',
+        width: '100',
+        align: 'center'
+      },
+      {
+        title: '手机号码',
+        dataIndex: 'phone',
+        width: '100',
+        align: 'center'
+      },
+	  {
+	    title: '合作商',
+	    dataIndex: 'phone',
+	    width: '100',
+	    align: 'center'
+	  },
+	  {
+	    title: '超级管理员',
+	    width: '100',
+	    align: 'center',
+	    scopedSlots: {
+	      customRender: 'status'
+	    }
+	  },
+      {
+        title: '角色',
+        width: '100',
+        align: 'center',
+        dataIndex: 'roleNames'
+      },
+      {
+        title: '状态',
+        width: '100',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'status'
+        }
+      },
+      {
+        title: '操作',
+        width: '100',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return getPowerUserList(Object.assign(parameter, this.queryParam)).then(res => {
+          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.loginFlag = _item.loginFlag + '' === '1'
+          }
+          return res.data
+        })
+      },
+      optionAlertShow: false
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getSellerList()
+    })
+  },
+  methods: {
+	  handleChange (value) {
+	    console.log(`selected ${value}`)
+	  },
+	  handleBlur () {
+	    console.log('blur')
+	  },
+	  handleFocus () {
+	    console.log('focus')
+	  },
+	  filterOption (input, option) {
+	    return (
+	      option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+	    )
+	  },
+	  // 获取合作商数据
+	  getSellerList () {
+		  sellerList().then(res => {
+			  console.log(res, '-----合作商')
+			  if (res.status == 200) {
+				  this.optionData = res.data || []
+			  }
+		  })
+	  },
+
+    // 刷新列表
+    refreshTable () {
+      this.$refs.table.refresh(true)
+    },
+    // 新建
+    openModal () {
+      this.showModal = true
+      this.itemData = {}
+    },
+    // 重置
+    reset () {
+      this.queryParam.name = ''
+      this.queryParam.phone = '',
+      this.queryParam.loginFlag = ''
+	   this.queryParam.officialPartnerNo = undefined
+      this.refreshTable()
+    },
+    // 重置密码
+    resetPassword (row) {
+      resetPSD({
+        id: row.id
+      }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+        }
+      })
+    },
+    // 删除
+    delect (row) {
+      const _this = this
+      this.$confirm({
+        title: '警告',
+        centered: true,
+        content: '删除后无法恢复,确认删除?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          delectUserPower({
+            id: row.id
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
+        }
+      })
+    },
+    getBizStr (storeBizList) {
+      const str = []
+      storeBizList.forEach(item => {
+        str.push(item.bizTypeName)
+      })
+      return str.join(',')
+    },
+    handleEdit (row) {
+      console.log(row, 'row')
+      this.showModal = true
+      this.itemData = row
+    },
+    // 修改状态
+    changeFlagHandle (text, record) {
+      const _data = {
+        id: record.id,
+        flag: record.loginFlag ? '1' : '0'
+      }
+      updateEnableStatus(_data).then(res => {
+        if (res.status + '' === '200') {
+          this.$message.success(res.message)
+        } else {
+          record.loginFlag = !record.loginFlag
+        }
+      })
+    }
+  }
+}
 </script>
+<style scoped>
+	.table-page-search-wrapper .ant-form-inline .ant-form-item {
+		margin-bottom: 0;
+	}
+
+	.action-button {
+		line-height: 40px;
+		white-space: nowrap;
+		padding: 5px 10px;
+		background-color: #1890ff;
+		border-radius: 4px;
+		color: #fff;
+		margin-right: 5px;
+	}
+
+	.red-text {
+		background-color: red;
+	}
 
-<style>
+	.reset-text {
+		background-color: #31b50b;
+	}
 </style>

+ 363 - 0
src/views/businessManage/userManage/userModal.vue

@@ -0,0 +1,363 @@
+<template>
+  <div>
+    <a-modal
+      class="modalBox"
+      :title="titleText"
+      v-model="isshow"
+      @cancle="cancel"
+      width="60%"
+      :centered="true">
+      <a-form :form="form" @submit="handleSubmit">
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <!-- 用户名称 -->
+            <a-form-item label="用户名称" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+              <a-input
+                placeholder="请输入用户名称(最多30个字符)"
+                allowClear
+                id="userModal-name"
+                :maxLength="30"
+                v-decorator="['formData.name', {
+                  initialValue: formData.name,getValueFromEvent: $filterEmpty,
+                  rules: [{ required: true, message: '请输入用户名称(最多30个字符)!' },{pattern:'^[^<|>]{1,30}$',message:'请输入不含<或>的字符,最多30个字符'}] }]"
+              />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <!-- 手机号码 -->
+            <a-form-item label="手机号码" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+              <a-input
+                placeholder="请输入手机号码"
+                allowClear
+                :maxLength="11"
+                id="userModal-phone"
+                v-decorator="['formData.phone', {
+                  initialValue: formData.phone,getValueFromEvent: $filterEmpty,
+                  rules: [{ required: true, message: '请输入手机号码!' },{pattern:/^[1][0-9]{10}$/, message: '请输入正确的手机号码!'}] }]"
+              />
+            </a-form-item>
+          </a-col>
+        </a-row>
+
+        <a-row :gutter="24">
+          <!-- 性别 -->
+          <a-col :span="12">
+            <a-form-item label="性别" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+              <v-select
+                code="SEX"
+                id="userModal-sex"
+                v-decorator="[
+                  'formData.sex',
+                  {
+                    initialValue: formData.sex,
+                    rules: [{ required: true, message: '请选择性别!' }] },
+                ]"
+                allowClear ></v-select>
+
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="所属合作商" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+              <a-select
+                placeholder="请选择"
+                allowClear
+                v-decorator="[
+                  'formData.officialPartnerNo',
+                  {
+                    initialValue: formData.officialPartnerNo,
+                    rules: [{ required: true, message: '请选择!' }] },
+                ]"
+                :showSearch="true"
+                option-filter-prop="children"
+                :filter-option="filterOption"
+                @focus="handleFocus"
+                @blur="handleBlur"
+                @change="handleChange">
+                <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-row>
+        <a-row :gutter="24">
+          <!-- 状态 -->
+          <a-col :span="12">
+            <a-form-item label="状态" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+              <a-radio-group
+                name="radioGroup"
+                id="userModal-loginFlag"
+                v-decorator="[
+                  'formData.loginFlag',
+                  {
+                    initialValue: formData.loginFlag,
+                    rules: [{ required: true, message: '请选择状态!' }] },
+                ]"
+              >
+                <a-radio :value="1">启用</a-radio>
+                <a-radio :value="0">禁用</a-radio>
+              </a-radio-group>
+
+            </a-form-item>
+          </a-col>
+          <!-- 状态 -->
+          <a-col :span="12">
+            <a-form-item label="是否为超级管理员" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+              <a-radio-group
+                name="radioGroup"
+                id="userModal-loginFlag"
+                v-decorator="[
+                  'formData.loginFlag',
+                  {
+                    initialValue: formData.loginFlag,
+                    rules: [{ required: true, message: '请选择!' }] },
+                ]"
+              >
+                <a-radio :value="1">是</a-radio>
+                <a-radio :value="0">否</a-radio>
+              </a-radio-group>
+
+            </a-form-item>
+          </a-col>
+        </a-row>
+
+        <a-row :gutter="24">
+          <a-col :span="24">
+            <a-form-item label="角色" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
+              <a-select
+                id="userModal-roleNames"
+                v-decorator="[
+                  'formData.roleNames',
+                  {
+                    initialValue: formData.roleNames,
+                    rules: [{ required: true, message: '请选择角色!' }] },
+                ]"
+                mode="multiple"
+                style="width: 100%"
+                placeholder="请选择角色"
+                allowClear
+              >
+                <a-select-option
+                  v-for="item in roleList"
+                  :key="item.id"
+                  :disabled="item.isEnable == '0' ? true : false"
+                >{{ item.name }}</a-select-option
+                >
+              </a-select>
+            </a-form-item>
+          </a-col>
+
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="24">
+            <a-form-item label="备注" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
+              <a-textarea
+                id="userModal-remarks"
+                :maxLength="500"
+                v-decorator="[
+                  'formData.remarks',
+                  {
+                    initialValue: formData.remarks,getValueFromEvent: $filterEmpty,
+                    rules: [] },
+                ]"
+                style="min-height: 50px;"
+                placeholder="请输入备注(最多500个字符)"
+                autosize />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-form-item :wrapper-col="{ span: 24, offset: 10}">
+          <a-button type="primary" @click="handleSubmit()" id="userModal-handleSubmit" :style="{ marginRight: '15px' }">
+            保存
+          </a-button>
+          <a-button :style="{ marginLeft: '15px' }" @click="handleCancel()" id="userModal-handleCancel">
+            取消
+          </a-button>
+        </a-form-item>
+      </a-form>
+
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import { getRoleList, saveUserPower } from '@/api/power-user.js'
+import { sellerList } from '@/api/userManage.js'
+export default {
+  name: 'UserModal',
+  components: {
+    STable, VSelect
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    data: {
+      type: Object,
+      default: function () {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      titleText: '新增用户',
+      isshow: this.visible,
+      formLayout: 'horizontal',
+      form: this.$form.createForm(this, { name: 'miniForm' }),
+      roleList: [],
+	  optionData: [],
+      formData: {
+        roleNames: undefined, // 角色
+        name: '',
+        loginFlag: '', // 活动状态
+        phone: '',
+        sex: '',
+        remarks: '',
+        officialPartnerNo: undefined
+      }
+
+    }
+  },
+  methods: {
+    cancel (e) {
+      this.clear()
+      this.$emit('close')
+    },
+    handleChange (value) {
+	    console.log(`selected ${value}`)
+	  },
+	  handleBlur () {
+	    console.log('blur')
+	  },
+	  handleFocus () {
+	    console.log('focus')
+	  },
+	  filterOption (input, option) {
+	    return (
+	      option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+	    )
+	  },
+	  // 获取合作商数据
+	  getSellerList () {
+		  sellerList().then(res => {
+			  console.log(res, '-----合作商')
+			  if (res.status == 200) {
+				  this.optionData = res.data || []
+			  }
+		  })
+	  },
+    // 保存提交
+    handleSubmit () {
+      const _this = this
+      this.form.validateFields((err, values) => {
+        console.log(values, 'values222')
+        if (!err) {
+          values.formData.roleNames = values.formData.roleNames.join(',')
+          console.log(values.formData, ' formData.type222222222')
+          console.log(Object.assign({ id: this.data.id ? this.data.id : '' }, values.formData))
+          saveUserPower(Object.assign({ id: this.data.id ? this.data.id : '' }, values.formData)).then(res => {
+            console.log(res, 'res--save')
+            if (res.status + '' === '200') {
+              this.$message.success(res.message ? res.message : '保存成功')
+              this.$emit('refresh')
+              setTimeout(function () {
+                _this.cancel()
+              }, 300)
+            } else {
+              // this.$message.error(res.message)
+            }
+          })
+        }
+      })
+    },
+    // 取消
+    handleCancel () {
+      this.cancel()
+    },
+    clear () {
+      this.form.resetFields()
+      delete this.formData.id
+      this.formData.roleNames = []
+      this.formData.name = ''
+      this.formData.loginFlag = ''
+      this.formData.phone = ''
+      this.formData.sex = ''
+      this.formData.remarks = ''
+	  this.formData.officialPartnerNo = undefined
+    },
+
+    // 获取角色列表接口
+    getRoleList () {
+      getRoleList().then(res => {
+        console.log(res, 'res--role')
+        if (res.status + '' === '200') {
+          this.roleList = res.data
+        } else {
+          this.$message.warning(res.message)
+        }
+      })
+    }
+
+  },
+  mounted () {
+    this.getRoleList()
+    this.getSellerList()
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, { name: 'miniForm' })
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (newValue) {
+        if (this.data.id) { // 编辑
+          this.titleText = '编辑用户'
+          this.formData = Object.assign({}, this.data)
+          delete this.formData.no
+          let roleNames = this.formData.roleNames
+          console.log(roleNames, 'roleNames')
+          if (roleNames) {
+            roleNames = roleNames.split(',')
+            console.log(roleNames, 'roleNames22')
+            const arr = []
+            console.log(this.roleList, 'this.roleList')
+
+            roleNames.map(item => {
+              const row = this.roleList.find(a => {
+                return a.name == item
+              })
+              if (row) {
+                arr.push(row.id)
+              }
+            })
+
+            console.log(arr, 'arrs')
+            this.formData.roleNames = arr
+          } else {
+            this.formData.roleNames = []
+          }
+
+          this.formData.loginFlag = Number(this.formData.loginFlag)
+          // this.formData.sex = Number(this.formData.sex)
+          console.log(this.formData, 'this.formData')
+        } else {
+          this.titleText = '新增用户'
+        }
+      } else {
+        this.cancel()
+      }
+    }
+  }
+}
+</script>
+
+<style >
+  .modalBox{
+  }
+  .ant-modal-footer {
+    display: none;
+  }
+</style>

+ 99 - 72
src/views/releaseRecord/releaseRecordList.vue

@@ -4,19 +4,19 @@
       <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-form-item label="投递时间:" :label-col="{ span: 7 }" :wrapper-col="{ span: 17}">
               <a-range-picker
-                id="shopOrder-time"
-                v-model="time"
-                :format="dateFormat"
-                :placeholder="['开始时间','结束时间']"
+                style="width:100%"
+                id="PaySettlementRecords-queryOrderDate"
                 :disabledDate="disabledDate"
-                @change="onChange" />
+                v-model="queryOrderDate"
+                format="YYYY-MM-DD"
+                :placeholder="['开始时间', '结束时间']" />
             </a-form-item>
           </a-col>
           <a-col :span="6">
             <a-form-item label="设备编号" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-input id="shopOrder-orderNo" allowClear :maxLength="30" v-decorator="[ 'queryParam.orderNo', { initialValue: queryParam.orderNo, getValueFromEvent: $filterEmpty, rules: [] }]" placeholder="请输入设备编号" />
+              <a-input id="shopOrder-srcDeviceCode" allowClear :maxLength="30" v-model=" queryParam.srcDeviceCode " placeholder="请输入设备编号" />
             </a-form-item>
           </a-col>
           <a-col :span="6">
@@ -38,7 +38,7 @@
         <a-row :gutter="48">
           <a-col :span="6">
             <a-form-item label="用户账号" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-input id="shopOrder-contactPhone" allowClear :maxLength="11" v-decorator="[ 'queryParam.contactPhone', { initialValue: queryParam.contactPhone, getValueFromEvent: $filterEmpty, rules: [] }]" placeholder="请输入用户账号" />
+              <a-input id="shopOrder-customerMobile" allowClear :maxLength="11" v-model=" queryParam.customerMobile" placeholder="请输入用户账号" />
             </a-form-item>
           </a-col>
         </a-row>
@@ -56,17 +56,26 @@
       :data="loadData"
       bordered>
       <!-- 订单状态 -->
-      <!-- <template slot="orderStatus" slot-scope="text, record">
-        <span>{{ record.orderStatus==1 ? '已启用' : '已禁用' }}</span>
-      </template> -->
-      <!-- 订单总额 -->
-      <template slot="orderPrice" slot-scope="text, record">
-        <span>{{ record.orderPrice || 0 }}乐豆</span>
+      <template slot="one" slot-scope="text, record">
+        <span v-if="record.rubbishType=='CLOTHING'">{{ record.rubbishWeight }}</span>
+        <span v-else>0</span>
+      </template>
+      <template slot="two" slot-scope="text, record">
+        <span v-if="record.rubbishType=='PAPER'">{{ record.rubbishWeight }}</span>
+        <span v-else>0</span>
+        </span></template>
+      <template slot="therr" slot-scope="text, record">
+        <span v-if="record.rubbishType=='PLASTIC'">{{ record.rubbishWeight }}</span>
+        <span v-else>0</span>
+      </template>
+      <template slot="four" slot-scope="text, record">
+        <span v-if="record.rubbishType=='METAL'">{{ record.rubbishWeight }}</span>
+        <span v-else>0</span>
+      </template>
+      <template slot="five" slot-scope="text, record">
+        <span v-if="record.rubbishType=='RUBBISH'">{{ record.rubbishWeight }}</span>
+        <span v-else>0</span>
       </template>
-      <!-- 操作 -->
-      <!-- <template slot="action" slot-scope="text, record">
-        <a-icon type="eye" id="shopOrder-handleView" title="详情" class="actionBtn icon-green" @click="handleView(record)" />
-      </template> -->
     </s-table>
   </a-card>
 
@@ -74,10 +83,9 @@
 
 <script>
 import { STable, VSelect } from '@/components'
-import getDate from '@/libs/getDate.js'
+import { getDeliveryLogList, getDeliveryLogTotal } from '@/api/releaseRecord.js'
 import moment from 'moment'
 export default {
-  name: 'ShopOrder',
   components: { STable, VSelect },
   data () {
     return {
@@ -86,58 +94,58 @@ export default {
         labelCol: { span: 4 },
         wrapperCol: { span: 16 }
       },
+	  queryOrderDate: undefined,
       // 查询参数
       queryParam: {
         beginDate: null, // 开始时间
         endDate: null, // 结束时间
-        contactPhone: '', //  用户手机
-        orderNo: '', //  订单编号
-        orderStatus: null // 订单状态
+        customerMobile: '', //  用户手机
+        srcDeviceCode: '', //  设备编号
+        orderStatus: null // 网点名称
       },
+	  orderTotal: 0,	// 总单数
+	  amountTotal: 0,	// 总金额
       // 表头
       columns: [
         { 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: 200, align: 'center' },
-        { title: '本次兑换乐豆(个)', scopedSlots: { customRender: 'orderPrice' }, width: 200, align: 'center' },
-        { title: '1号箱(g)', width: 200, align: 'center' },
-        { title: '2号箱(g)', width: 200, align: 'center' },
-        { title: '3号箱(g)', width: 200, align: 'center' },
-        { title: '4号箱(g)', width: 200, align: 'center' }
+        { title: '投放时间', dataIndex: 'deliveryTime', width: 200, align: 'center' },
+        { title: '网点名称', dataIndex: 'stationName', width: 200, align: 'center' },
+        { title: '设备编号', dataIndex: 'srcDeviceCode', width: 200, align: 'center' },
+        { title: '用户账号', dataIndex: 'customerMobile', width: 200, align: 'center' },
+        { title: '本次兑换乐豆(个)', dataIndex: 'goldNum', width: 200, align: 'center' },
+        { title: '内置各箱体投放重量(g)',
+				  children: [
+            { title: '废旧衣物', width: 200, align: 'center', scopedSlots: { customRender: 'one' } },
+            { title: '废旧纸张', width: 200, align: 'center', scopedSlots: { customRender: 'two' } },
+            { title: '废旧塑料', width: 200, align: 'center', scopedSlots: { customRender: 'therr' } },
+            { title: '废旧金属', width: 200, align: 'center', scopedSlots: { customRender: 'four' } },
+            { title: '有害垃圾', width: 200, align: 'center', scopedSlots: { customRender: 'five' } }
+				  ]
+        }
+
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        // 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)
+		  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 getDeliveryLogList(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.getListTotal()
+            return res.data
+          }
         })
-      },
-      // 将默认当天时间日期回显在时间选择框中
-      time: [
-        moment(getDate.getToday().starttime, this.dateFormat),
-        moment(getDate.getToday().endtime, this.dateFormat)
-      ],
-      dateFormat: 'YYYY-MM-DD'
+      }
     }
   },
   beforeRouteEnter (to, from, next) {
@@ -158,20 +166,39 @@ export default {
         this.queryParam.endDate = dateStrings[1]
       }
     },
-    //  查看详情
-    // handleView (row) {
-    //   this.$router.push({ path: `/shop/order/detail/${row.no}` })
-    // },
+    // 合计
+    getListTotal () {
+      const params = {
+        customerMobile: this.queryParam.customerMobile,
+        beginDate: this.queryParam.beginDate,
+        endDate: this.queryParam.endDate,
+        srcDeviceCode: this.queryParam.srcDeviceCode, //  设备编号
+        orderStatus: this.queryParam.orderStatus // 网点名称
+      }
+      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 = ''
+      }
+      getDeliveryLogTotal(params).then(res => {
+        if (res.status == 200) {
+          if (res.data) {
+            this.orderTotal = res.data.totalNum || 0
+            this.amountTotal = res.data.goldNum || 0
+          } else {
+			  this.orderTotal = 0
+			  this.amountTotal = 0
+		  }
+        }
+      })
+    },
     // 重置
     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.contactPhone = ''
-      this.queryParam.orderNo = ''
+      this.queryOrderDate = undefined
+      this.queryParam.customerMobile = ''
+      this.queryParam.srcDeviceCode = ''
       this.queryParam.orderStatus = null
       this.$refs.table.refresh(true)
     }

+ 231 - 0
src/views/userInfo/LdDetails.vue

@@ -0,0 +1,231 @@
+<template>
+  <a-card :bordered="false" class="shopOrder-table-page-search-wrapper">
+    <div class="shopOrder-searchForm">
+      <a-form layout="inline" v-bind="formItemLayout" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="48">
+          <a-col :span="6">
+            <a-form-item label="下单时间" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+              <a-range-picker
+                id="shopOrder-time"
+                v-model="time"
+                :format="dateFormat"
+                :placeholder="['开始时间','结束时间']"
+                :disabledDate="disabledDate"
+                @change="onChange" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="类型" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+              <v-select
+                v-model="queryParam.orderStatus"
+                ref="orderStatus"
+                id="shopOrder-status"
+                code="SETTLE_STATUS_ALL"
+                placeholder="请选择订单状态"
+                allowClear></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="原因" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+              <v-select
+                v-model="queryParam.orderStatus"
+                ref="orderStatus"
+                id="shopOrder-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-btn-serach" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button class="handle-btn" type="" id="shopOrder-btn-reset" @click="handleReset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <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 getDate from '@/libs/getDate.js'
+import moment from 'moment'
+export default {
+  name: 'ShopOrder',
+  components: { STable, VSelect },
+  data () {
+    return {
+      formItemLayout: {
+        labelCol: { span: 7 },
+        wrapperCol: { span: 17 }
+      },
+      // 查询参数
+      queryParam: {
+        beginDate: null, // 开始时间
+        endDate: null, // 结束时间
+        contactPhone: '', //  用户手机
+        orderNo: '', //  订单编号
+        orderStatus: null // 订单状态
+      },
+      loading: false, // 导出loading
+      // 表头
+      columns: [
+        { 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: 200, align: 'center' },
+        { title: '详情', scopedSlots: { customRender: 'orderPrice' }, width: 200, align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        // 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)
+        })
+      },
+      // 将默认当天时间日期回显在时间选择框中
+      time: [
+        moment(getDate.getToday().starttime, this.dateFormat),
+        moment(getDate.getToday().endtime, this.dateFormat)
+      ],
+      dateFormat: 'YYYY-MM-DD'
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.handleReset()
+    })
+  },
+  methods: {
+    moment,
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
+    // 创建时间change
+    onChange (dates, dateStrings) {
+      if ((dates, dateStrings)) {
+        this.queryParam.beginDate = dateStrings[0]
+        this.queryParam.endDate = dateStrings[1]
+      }
+    },
+    //  查看详情
+    handleView (row) {
+      this.$router.push({ path: `/shop/order/detail/${row.id}` })
+    },
+    // 重置
+    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.contactPhone = ''
+      this.queryParam.orderNo = ''
+      this.queryParam.orderStatus = null
+      this.$refs.table.refresh(true)
+    }
+    // 导出
+    // handleExport () {
+    //   const params = {
+    //     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 (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 3) {
+    //     this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
+    //   }
+    //   // 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{
+      .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;
+    }
+    .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;
+    }
+    .blue {
+    	color: #1890FF;
+    }
+    .green {
+    	color: #16b50e;
+    }
+    .red {
+    	color: red;
+    }
+  }
+</style>

+ 98 - 0
src/views/userInfo/userDetails.vue

@@ -0,0 +1,98 @@
+<template>
+  <a-card :bordered="false" class="orderDetail-goods-info">
+    <a-row :gutter="48">
+      <a-col :span="24" class="item-cont">
+        <p class="item-label">头像:</p>
+        <p class="item-main">2020-10-30 16:45</p>
+      </a-col>
+      <a-col :span="24" class="item-cont">
+        <p class="item-label">手机号码:</p>
+        <p class="item-main">No12387612387</p>
+        <a style="margin-left: 100px; color: #2D8CF0;" @click="editPhone">修改手机号码</a>
+      </a-col>
+      <a-col :span="24" class="item-cont">
+        <p class="item-label">收货地址:</p>
+        <p class="item-main">陕西省西安市未央区阿克苏接电话高科技大厦</p>
+      </a-col>
+      <a-col :span="24" class="item-cont">
+        <p class="item-label">乐豆余额:</p>
+        <p class="item-main">1123乐豆</p>
+        <a style="margin-left: 145px; color: #2D8CF0;" @click="editLd">修改乐豆余额</a>
+      </a-col>
+      <a-col :span="24" class="item-cont">
+        <p class="item-label">用户手机:</p>
+        <p class="item-main">15757989887</p>
+      </a-col>
+      <a-col :span="24" class="item-cont">
+        <p class="item-label">累计乐豆:</p>
+        <p class="item-main">11乐豆</p>
+      </a-col>
+      <a-col :span="24" class="item-cont">
+        <p class="item-label">账户状态:</p>
+        <p class="item-main">启用</p>
+      </a-col>
+      <a-col :span="24" class="item-cont">
+        <p class="item-label">注册时间:</p>
+        <p class="item-main">2020-10-30 16:46</p>
+      </a-col>
+      <a-col :span="24" class="item-cont">
+        <p class="item-label">最后登录时间:</p>
+        <p class="item-main">2020-10-30 16:46</p>
+      </a-col>
+      <a-col :span="24" class="item-cont">
+        <p class="item-label">最后投递时间:</p>
+        <p class="item-main">2020-10-30 16:46</p>
+      </a-col>
+    </a-row>
+    <div class="page-header" style="margin-top: 50px; color: #2D8CF0; text-align: center;">
+      <a @click="goBack">返回列表</a>
+    </div>
+  </a-card>
+</template>
+
+<script>
+
+export default {
+
+  data () {
+    return {
+      formLayout: {
+        labelCol: {
+          xs: {
+            span: 24
+          },
+          sm: {
+            span: 8
+          }
+        },
+        wrapperCol: {
+          xs: {
+            span: 24
+          },
+          sm: {
+            span: 16
+          }
+        }
+      }
+    }
+  },
+  methods: {
+	  editPhone () {
+		  console.log('-----------修改手机号码')
+	  },
+    editLd () {
+      console.log('-----修改乐豆余额')
+    },
+    // 返回列表
+    goBack () {
+      this.$router.push({ path: `/userInfo/userManageList/list` })
+    }
+  }
+}
+</script>
+<style lang="less">
+	.item-cont{
+		display: flex;
+		margin: 10px 10px 10px 50px ;
+	}
+</style>

+ 272 - 0
src/views/userInfo/userManageList.vue

@@ -0,0 +1,272 @@
+<template>
+  <a-card :bordered="false" class="shopOrder-table-page-search-wrapper">
+    <div class="shopOrder-searchForm">
+      <a-form layout="inline" v-bind="formItemLayout" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="48">
+          <a-col :span="6">
+            <a-form-item label="用户手机" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+              <a-input id="shopOrder-contactPhone" allowClear :maxLength="11" v-model="queryParam.contactPhone" placeholder="请输入用户手机" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="乐豆余额" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+              <div class="input-number">
+                <a-input-number
+                  id="inputNumber"
+                  v-model="queryParam.value1"
+                  :min="1"
+                  :max="10"
+                  @change="onChange" />-<a-input-number
+                    id="inputNumber"
+                    v-model="queryParam.value2"
+                    :min="1"
+                    :max="10"
+                    @change="onChange"
+                  />
+              </div>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="账户状态" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+              <v-select
+                v-model="queryParam.orderStatus"
+                ref="orderStatus"
+                id="shopOrder-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-btn-serach" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button class="handle-btn" type="" id="shopOrder-btn-reset" @click="handleReset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <a-divider />
+    <div class="table-operator">
+      <a-button class="export-btn" id="shopOrder-btn-export" type="" :loading="loading" @click="handleExport">导出</a-button>
+    </div>
+    <s-table
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 订单状态 -->
+      <template slot="orderStatus" slot-scope="text, record">
+        <span>{{ record.orderStatus==1 ? '已启用' : '已禁用' }}</span>
+      </template>
+      <!-- 订单总额 -->
+      <template slot="orderPrice" slot-scope="text, record">
+        <span>{{ record.orderPrice || 0 }}乐豆</span>
+      </template>
+      <!--启用禁用 -->
+      <span slot="state" slot-scope="text, record">
+        <a-switch
+          v-hasPermission="'B_goodsClass_enable'"
+          checkedChildren="启用"
+          unCheckedChildren="禁用"
+          id="bannerSetting-changeFlagHandle"
+          :checked="record.state == 1 ? true : false"
+          @change="changeFlagHandle(text, record)" />
+      </span>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-button id="shopOrder-handleView" type="link" @click="handleUser(record)">用户详情</a-button>
+        <a-button id="shopOrder-handleView" type="link" @click="handleLd(record)">乐豆明细</a-button>
+      </template>
+    </s-table>
+  </a-card>
+
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import getDate from '@/libs/getDate.js'
+import moment from 'moment'
+export default {
+  name: 'ShopOrder',
+  components: { STable, VSelect },
+  data () {
+    return {
+      formItemLayout: {
+        labelCol: { span: 7 },
+        wrapperCol: { span: 17 }
+      },
+      // 查询参数
+      queryParam: {
+        beginDate: null, // 开始时间
+        endDate: null, // 结束时间
+        contactPhone: '', //  用户手机
+        orderNo: '', //  订单编号
+        orderStatus: null, // 订单状态
+        value1: '',
+        value2: ''
+      },
+      loading: false, // 导出loading
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '用户手机', dataIndex: 'userMoblie', width: 200, align: 'center' },
+        { title: '乐豆余额', dataIndex: 'orderDate', width: 200, align: 'center' },
+        { title: '累计乐豆', dataIndex: 'orderNo', width: 200, align: 'center' },
+        { title: '注册时间', scopedSlots: { customRender: 'orderStatus' }, width: 200, align: 'center' },
+        { title: '最后登录时间', scopedSlots: { customRender: 'orderPrice' }, width: 200, align: 'center' },
+        { title: '最后投递时间', scopedSlots: { customRender: 'orderPrice' }, width: 200, align: 'center' },
+        { title: '状态', width: 100, dataIndex: 'state', align: 'center', scopedSlots: { customRender: 'state' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        // 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)
+        })
+      },
+      // 将默认当天时间日期回显在时间选择框中
+      time: [
+        moment(getDate.getToday().starttime, this.dateFormat),
+        moment(getDate.getToday().endtime, this.dateFormat)
+      ],
+      dateFormat: 'YYYY-MM-DD'
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.handleReset()
+    })
+  },
+  methods: {
+    moment,
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
+    // 创建时间change
+    onChange (dates, dateStrings) {
+      if ((dates, dateStrings)) {
+        this.queryParam.beginDate = dateStrings[0]
+        this.queryParam.endDate = dateStrings[1]
+      }
+    },
+    // 查看用户详情
+    handleUser (row) {
+      this.$router.push({ path: `/userInfo/userManageList_user/detail/${row.id}` })
+    },
+    // 查看乐豆详情
+    handleLd (row) {
+      this.$router.push({ path: `/userInfo/userManageList_Ld/detail/${row.id}` })
+    },
+    // 重置
+    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.contactPhone = ''
+      this.queryParam.orderNo = ''
+      this.queryParam.orderStatus = null
+      this.$refs.table.refresh(true)
+    },
+    // 导出
+    handleExport () {
+      const params = {
+        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 (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 3) {
+        this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
+      }
+      // 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{
+      .ant-form-inline .ant-form-item{
+        width: 100%;
+      }
+      // 搜索框的下间距
+      .ant-form-item {
+      	margin-bottom: 10px;
+      }
+	  .input-number{
+		  display: flex;
+		  margin-top:3px;
+	  }
+      .handle-btn{
+        margin-top: 4px;
+      }
+      .serach-btn{
+        margin-right: 10px;
+      }
+    }
+    .export-btn{
+      background-color: #ff9900;
+      border-color: #ff9900;
+      color: #fff;
+    }
+    .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;
+    }
+    .blue {
+    	color: #1890FF;
+    }
+    .green {
+    	color: #16b50e;
+    }
+    .red {
+    	color: red;
+    }
+  }
+</style>