Browse Source

按钮、输入框等加id

chenrui 4 years ago
parent
commit
1759a8ceb9

+ 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>

+ 2 - 2
src/api/customerBundle.js

@@ -1,15 +1,15 @@
 import { axios } from '@/utils/request'
 
+//  已购套餐 列表
 export const listCustomerBundle = params => {
   const url = `customerBundle/queryLike/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
-
   return axios.request({
     url: url,
     data: params,
     method: 'post'
-  }).then(res => res.data)
+  }).then(res => res)
 }
 
 export const customerBundleDetail = (params) => {

+ 25 - 7
src/views/SetmealSales/BuySetmeal.vue

@@ -6,6 +6,7 @@
         <a-col :span="19" class="search-con">
           <a-input-search
             v-model="queryWord"
+            allowClear
             placeholder="搜索套餐"
             enter-button
             class="search-inp"
@@ -16,7 +17,7 @@
       <div class="draConts">
         <!-- 分类 -->
         <a-tabs v-model="clsId" tabPosition="left" class="smenus" @change="tabChange">
-          <a-tab-pane key="" tab="全部"></a-tab-pane>
+          <a-tab-pane key="all" tab="全部"></a-tab-pane>
           <a-tab-pane v-for="item in setmealType" :key="item.id" :tab="item.dispName"></a-tab-pane>
         </a-tabs>
         <!-- 套餐数据列表 -->
@@ -54,9 +55,9 @@
       </div>
     </a-card>
     <!-- 下单弹框 -->
-    <SetmealPayMoney :openModal="openSetmealPay" :setmealId="setmealId" @close="openSetmealPay=false" />
+    <SetmealPayMoney :openModal="openSetmealPay" :setmealId="setmealId" @close="closeModal" />
     <!-- 套餐详细 -->
-    <SetmealItemDetailModal :openModal="openSetmealDetails" :setmealId="setmealId" @close="openSetmealDetails=false" />
+    <SetmealItemDetailModal :openModal="openSetmealDetails" :setmealId="setmealId" @close="closeModal" />
   </div>
 
 </template>
@@ -124,24 +125,35 @@ export default {
     },
     //  tab 切换
     tabChange (v) {
-      console.log(v)
+      this.listData = []
       document.getElementById('bundelScroll').scrollTop = 0
-      this.clsId = v || 'all'
+      this.clsId = v
+      if (this.clsId == 'all') {
+        this.queryWord = this.queryWord
+      } else {
+        this.queryWord = ''
+      }
       this.initData()
     },
     // 下单
     openPay (data) {
-      this.setmealId = data.id
+      this.setmealId = String(data.id)
       this.openSetmealPay = true
     },
+    closeModal () {
+      this.setmealId = null
+      this.openSetmealPay = false
+      this.openSetmealDetails = false
+    },
     //  查看详细
     openDetails (data) {
-      this.setmealId = data.id
+      this.setmealId = String(data.id)
       this.openSetmealDetails = true
     }
   },
   mounted () {
     this.winH = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight // 浏览器高度
+    this.pageInit()
   }
 }
 </script>
@@ -156,6 +168,12 @@ export default {
       .search-inp{
         width: 60%;
       }
+      .ant-input-group .ant-input-affix-wrapper{
+        height: 34px;
+      }
+      .ant-input-group-addon{
+        padding: 0;
+      }
     }
     .ant-tabs .ant-tabs-left-bar .ant-tabs-tab, .ant-tabs .ant-tabs-right-bar .ant-tabs-tab{
       padding: 12px 55px;

+ 40 - 79
src/views/SetmealSales/PurchasedSetmeal.vue

@@ -2,7 +2,7 @@
   <a-card :bordered="false" class="purchasedSetmeal-wrap">
     <!-- 搜索条件 -->
     <div class="purchasedSetmeal-searchForm">
-      <a-form ref="searchForm">
+      <a-form ref="searchForm" @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}">
@@ -17,27 +17,27 @@
           </a-col>
           <a-col :span="6">
             <a-form-item label="订单号" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-input v-model.trim="searchForm.number" id="purchasedSetmeal-number" placeholder="请输入" allowClear />
+              <a-input v-model.trim="searchForm.number" id="purchasedSetmeal-number" placeholder="请输入订单号" allowClear />
             </a-form-item>
           </a-col>
           <a-col :span="6">
             <a-form-item label="客户信息" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-input v-model.trim="searchForm.queryWord" id="purchasedSetmeal-queryWord" placeholder="手机号/车牌号" allowClear />
+              <a-input v-model.trim="searchForm.queryWord" id="purchasedSetmeal-queryWord" placeholder="请输入手机号/车牌号" allowClear />
             </a-form-item>
           </a-col>
           <a-col :span="6">
             <a-form-item label="套餐名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-input v-model.trim="searchForm.bundleName" id="purchasedSetmeal-bundleName" placeholder="请输入" allowClear />
+              <a-input v-model.trim="searchForm.bundleName" id="purchasedSetmeal-bundleName" placeholder="请输入套餐名称" allowClear />
             </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="searchForm.refundStatus"
-                ref="refundStatus"
+                v-model="searchForm.refundFlag"
+                ref="refundFlag"
                 id="purchasedSetmeal-status"
                 code="REFUND_STATUS"
-                placeholder="请选择"
+                placeholder="请选择状态"
                 allowClear></v-select>
             </a-form-item>
           </a-col>
@@ -68,8 +68,8 @@
       :data="loadData"
       bordered>
       <!-- 状态 -->
-      <span slot="orderStatus" slot-scope="text">
-        {{ $refs.orderStatus.getNameByCode(text) }}
+      <span slot="refundFlag" slot-scope="text">
+        {{ $refs.refundFlag.getNameByCode(text) }}
       </span>
       <!-- 操作 -->
       <span slot="action" slot-scope="text, record">
@@ -77,7 +77,7 @@
       </span>
     </s-table>
     <!-- 查看详情弹窗 -->
-    <setmeal-detail-modal :openModal="openDetailModal" :nowId="detailId" @close="openDetailModal=false" />
+    <setmeal-detail-modal :openModal="openDetailModal" :setmealId="detailId" @close="openDetailModal=false" />
   </a-card>
 </template>
 
@@ -93,7 +93,6 @@ export default {
   components: { STable, VSelect, SetmealDetailModal },
   data () {
     return {
-      storeId: [], // 网点名称
       // 查询参数
       searchForm: {
         beginDate: null, // 开始时间
@@ -101,13 +100,11 @@ export default {
         bundleName: '', // 套餐名称
         number: '', // 订单号
         queryWord: '', // 客户信息
-        refundStatus: '' // 状态
+        refundFlag: '' // 状态
       },
       loading: false, // 导出loading
       orderTotal: '', // 合计开单数量
       paymentAmountTotal: '', // 合计实收金额
-      itemOptionData: [], // 服务项目数据
-      storeOptionData: [], // 网点名称数据
       openDetailModal: false, // 查看详情弹窗 默认关闭
       detailId: null, // 初始化id
       // 将默认当天时间日期回显在时间选择框中
@@ -118,12 +115,12 @@ export default {
       dateFormat: 'YYYY-MM-DD',
       columns: [
         { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
-        { title: '订单号', dataIndex: 'orderNo', width: 100, align: 'center' },
-        { title: '下单时间', dataIndex: 'orderTime', width: 100, align: 'center' },
-        { title: '套餐名称', dataIndex: 'storeName', width: 100, align: 'center' },
+        { title: '订单号', dataIndex: 'number', width: 100, align: 'center' },
+        { title: '下单时间', dataIndex: 'orderDate', width: 100, align: 'center' },
+        { title: '套餐名称', dataIndex: 'bundleName', width: 100, align: 'center' },
         { title: '客户信息', dataIndex: 'customerMobile', width: 100, align: 'center' },
-        { title: '应收金额(¥)', dataIndex: 'payableAmount', width: 100, align: 'center' },
-        { title: '单据状态', scopedSlots: { customRender: 'orderStatus' }, width: 100, align: 'center' },
+        { title: '应收金额(¥)', dataIndex: 'payedAmount', width: 80, align: 'center' },
+        { title: '单据状态', scopedSlots: { customRender: 'refundFlag' }, width: 80, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -161,32 +158,6 @@ export default {
         this.searchForm.endDate = dateStrings[1]
       }
     },
-    // 获取服务项目数据
-    getItemListData () {
-      itemList({
-        pageNo: 1,
-        pageSize: 1000
-      }).then(res => {
-        if (res.status == 200) {
-          this.itemOptionData = res.data.list || []
-        } else {
-          this.itemOptionData = []
-        }
-      })
-    },
-    // 获取网点名称数据
-    getStoreListData () {
-      storeList({
-        pageNo: 1,
-        pageSize: 1000
-      }).then(res => {
-        if (res.status == 200) {
-          this.storeOptionData = res.data.list || []
-        } else {
-          this.storeOptionData = []
-        }
-      })
-    },
     // 合计
     getTotal () {
       const params = {
@@ -195,23 +166,23 @@ export default {
         bundleName: this.searchForm.bundleName,
         number: this.searchForm.number,
         queryWord: this.searchForm.queryWord,
-        refundStatus: this.searchForm.refundStatus
+        refundFlag: this.searchForm.refundFlag
       }
       params.beginDate == null ? params.beginDate = getDate.getToday().starttime : null
       params.endDate == null ? params.endDate = getDate.getToday().endtime : null
-      orderTotal(params).then(res => {
-        console.log(res, '--------')
-        if (res.status == 200) {
-          this.orderTotal = res.data.orderNum || 0
-          this.paymentAmountTotal = res.data.paymentAmount || 0
-        }
-      })
+      // orderTotal(params).then(res => {
+      //   console.log(res, '--------')
+      //   if (res.status == 200) {
+      //     this.orderTotal = res.data.orderNum || 0
+      //     this.paymentAmountTotal = res.data.paymentAmount || 0
+      //   }
+      // })
     },
     // 查看详情--跳转到对应的详情页
     seeDetail (record) {
       // 将当前行的id传递给详情页
+      this.detailId = String(record.id)
       this.openDetailModal = true
-      this.detailId = record.id
     },
     // 查询
     handleSearch () {
@@ -226,13 +197,11 @@ export default {
         moment(getDate.getToday().starttime, this.dateFormat),
         moment(getDate.getToday().endtime, this.dateFormat)
       ]
-      this.storeId = []
-      this.searchForm.orderNo = ''
-      this.searchForm.itemId = undefined
-      this.searchForm.customerMobile = ''
-      this.searchForm.orderStatus = ''
-      // this.$refs.searchForm.resetFields()
-      this.$refs.table.refresh()
+      this.searchForm.bundleName = ''
+      this.searchForm.number = ''
+      this.searchForm.queryWord = ''
+      this.searchForm.refundFlag = null
+      this.$refs.table.refresh(true)
       this.getTotal()
     },
     // 导出
@@ -241,11 +210,10 @@ export default {
       const params = {
         beginDate: this.searchForm.beginDate == null ? getDate.getToday().starttime : this.searchForm.beginDate,
         endDate: this.searchForm.endDate == null ? getDate.getToday().endtime : this.searchForm.endDate,
-        storeIdList: this.storeId,
-        orderNo: this.searchForm.orderNo,
-        itemId: this.searchForm.itemId,
-        customerMobile: this.searchForm.customerMobile,
-        orderStatus: this.searchForm.orderStatus
+        bundleName: this.searchForm.bundleName,
+        number: this.searchForm.number,
+        queryWord: this.searchForm.queryWord,
+        refundFlag: this.searchForm.refundFlag
       }
       // 判断两个时间段是否相差m个月
       if (!completeDate(params.beginDate, params.endDate, 3)) {
@@ -259,29 +227,18 @@ export default {
       })
     },
     download (data) {
-      if (!data) {
-        return
-      }
+      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 = '已购套餐记录-' + a
       console.log(fname, '111111')
       link.setAttribute('download', fname + '.xlsx')
-
       document.body.appendChild(link)
       link.click()
     }
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {
-      vm.getItemListData()
-      vm.handleReset()
-      vm.getStoreListData()
-    })
   }
 }
 </script>
@@ -304,6 +261,10 @@ export default {
         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;
+      }
     }
     .table-operator{
       margin: 18px 0 30px;

+ 14 - 12
src/views/SetmealSales/SetmealDetailModal.vue

@@ -65,25 +65,27 @@
       <a-tabs type="card">
         <a-tab-pane key="1" tab="套餐内容">
           <!-- 套餐内容列表 -->
-          <s-table
+          <a-table
             ref="tcTable"
-            size="default"
+            size="middle"
             :rowKey="(record) => record.id"
             :columns="setMealColumns"
-            :data="setMealData"
+            :dataSource="setMealData"
+            :pagination="false"
             bordered>
-          </s-table>
+          </a-table>
         </a-tab-pane>
         <a-tab-pane key="2" tab="使用记录">
           <!-- 使用记录列表 -->
-          <s-table
+          <a-table
             ref="recordTable"
-            size="default"
+            size="middle"
             :rowKey="(record) => record.id"
             :columns="recordColumns"
-            :data="recordData"
+            :dataSource="recordData"
+            :pagination="false"
             bordered>
-          </s-table>
+          </a-table>
         </a-tab-pane>
       </a-tabs>
       <div class="btn-cont">
@@ -120,10 +122,10 @@ export default {
         { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
         { title: '使用时间', dataIndex: 'orderNo', width: 100, align: 'center' },
         { title: '车牌号', dataIndex: 'orderTime', width: 100, align: 'center' },
-        { title: '服务内容', dataIndex: 'orderTime', width: 100, align: 'center' },
-        { title: '服务门店', dataIndex: 'orderTime', width: 100, align: 'center' },
-        { title: '使用数量', dataIndex: 'orderTime', width: 100, align: 'center' },
-        { title: '工单', dataIndex: 'orderTime', width: 100, align: 'center' }
+        { title: '服务内容', dataIndex: 'orderTimes', width: 100, align: 'center' },
+        { title: '服务门店', dataIndex: 'orderTimess', width: 100, align: 'center' },
+        { title: '使用数量', dataIndex: 'orderTimesss', width: 100, align: 'center' },
+        { title: '工单', dataIndex: 'orderTimessss', width: 100, align: 'center' }
       ],
       setMealData: [], //  套餐内容
       recordData: [] //  使用记录

+ 3 - 1
src/views/SetmealSales/SetmealItemDetailModal.vue

@@ -74,7 +74,7 @@ export default {
     },
     setmealId: {
       //  套餐id
-      type: Number || String,
+      type: String,
       default: ''
     }
   },
@@ -132,6 +132,7 @@ export default {
       }
       this.bundleItemList = data.bundleItemList || []
       this.bundlePartList = data.bundlePartList || []
+      console.log(data, '---data', this.bundleItemList)
     }
   },
   watch: {
@@ -146,6 +147,7 @@ export default {
       }
     },
     setmealId (newValue, oldValue) {
+      console.log(newValue, '-newValue   详情', this.isShow)
       if (newValue && this.isShow) {
         this.getSetmealInfo(newValue)
       }

+ 22 - 3
src/views/SetmealSales/SetmealPayMoney.vue

@@ -10,7 +10,7 @@
     <!-- 表单 -->
     <a-form-model ref="ruleForm" :model="form" :rules="rules" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
       <a-form-model-item label="手机号" prop="customerMobile">
-        <a-input v-model.trim="form.customerMobile" :maxLength="11" placeholder="支持新增和搜索" />
+        <a-input v-model.trim="form.customerMobile" @input="mobileInput" :maxLength="11" placeholder="支持新增和搜索" />
       </a-form-model-item>
       <a-form-model-item label="车牌号" prop="vehicle">
         <a-input v-model.trim="form.vehicle" :maxLength="8" placeholder="请输入车牌号(最多8个字符)" />
@@ -45,7 +45,7 @@ export default {
     },
     setmealId: {
       //  套餐id
-      type: Number || String,
+      type: String,
       default: ''
     }
   },
@@ -96,8 +96,26 @@ export default {
   methods: {
     //  套餐信息
     getSetmealInfo () {},
+    //  手机号输入监听
+    mobileInput () {
+      if (this.form.customerMobile.length == 11) {
+        if (isMobile(this.form.customerMobile)) { //  校验手机号
+          //  根据手机号去查询是否已绑定车牌
+          //  有车牌信息则需禁用掉车牌输入框
+        }
+      }
+    },
     //  确认收款
-    onSubmit () {},
+    onSubmit () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
     //  取消收款
     cancel () {
       this.resetForm() //  重置表单数据
@@ -124,6 +142,7 @@ export default {
       }
     },
     setmealId (newValue, oldValue) {
+      console.log(newValue, '-newValue   下单', this.isShow)
       if (newValue && this.isShow) {
         this.getSetmealInfo(newValue)
       }

+ 3 - 2
src/views/power/role/menuModal.vue

@@ -4,6 +4,7 @@
       <a-form class="form-box" style="max-height: 600px;" :form="form" @submit="handleSubmit">
 
         <a-tree
+          id="role-menu-tree"
           checkable
           @check="onCheck"
           @expand="onExpand"
@@ -15,10 +16,10 @@
 
       </a-form>
       <a-form-item :wrapper-col="{ offset: 15 }">
-        <a-button type="primary" @click="handleSubmit()">
+        <a-button id="role-menu-btn-save" type="primary" @click="handleSubmit()">
           保存
         </a-button>
-        <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+        <a-button id="role-menu-btn-cancel" :style="{ marginLeft: '8px' }" @click="handleCancel()">
           取消
         </a-button>
       </a-form-item>

+ 9 - 9
src/views/power/role/roleList.vue

@@ -1,28 +1,28 @@
 <template>
   <a-card :bordered="false">
     <div class="table-page-search-wrapper">
-      <a-form layout="inline">
+      <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="角色名称">
-              <a-input allowClear v-model.trim="queryParam.name" @pressEnter="$refs.table.refresh(true)" placeholder="请输入角色名称"/>
+              <a-input allowClear v-model.trim="queryParam.name" id="role-name" placeholder="请输入角色名称"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="状态">
-              <v-select code="CHECK_ENABLE_STATE" v-model="queryParam.isEnable" allowClear placeholder="请选择状态" ></v-select>
+              <v-select code="CHECK_ENABLE_STATE" v-model="queryParam.isEnable" id="role-enable" allowClear placeholder="请选择状态" ></v-select>
             </a-form-item>
           </a-col>
           <a-col :md="4" :sm="24" class="flex-sp">
-            <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
-            <a-button @click="reset">重置</a-button>
+            <a-button type="primary" id="role-btn-search" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button id="role-btn-reset" @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>
+      <a-button id="role-btn-add" type="primary" icon="plus" @click="openModal">新建</a-button>
     </div>
 
     <s-table
@@ -39,9 +39,9 @@
 
       <span slot="action" slot-scope="text, record">
         <template>
-          <a class="action-button menu-text" @click="openMenuModal(record)">菜单权限</a>
-          <a class="action-button" @click="handleEdit(record)">修改</a>
-          <a v-if="!record.isEnable" class="action-button red-text" @click="delect(record)">删除</a>
+          <a class="action-button menu-text" id="role-btn-menu" @click="openMenuModal(record)">菜单权限</a>
+          <a class="action-button" id="role-btn-edit" @click="handleEdit(record)">修改</a>
+          <a v-if="!record.isEnable" class="action-button red-text" id="role-btn-del" @click="delect(record)">删除</a>
         </template>
       </span>
     </s-table>

+ 5 - 2
src/views/power/role/roleModal.vue

@@ -5,6 +5,7 @@
         <!-- 用户名称 -->
         <a-form-item label="角色名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-input
+            id="role-add-name"
             placeholder="请输入角色名称"
             v-decorator="['formData.name', {
               initialValue: formData.name,
@@ -15,6 +16,7 @@
         <!-- 状态 -->
         <a-form-item label="状态" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-radio-group
+            id="role-add-enable"
             name="radioGroup"
             v-decorator="[
               'formData.isEnable',
@@ -30,6 +32,7 @@
 
         <a-form-item label="角色描述" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-textarea
+            id="role-add-remarks"
             v-decorator="[
               'formData.remarks',
               { initialValue: formData.remarks,
@@ -41,10 +44,10 @@
         </a-form-item>
 
         <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-          <a-button type="primary" @click="handleSubmit()">
+          <a-button id="role-add-btn-save" type="primary" @click="handleSubmit()">
             保存
           </a-button>
-          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+          <a-button id="role-add-btn-cancel" :style="{ marginLeft: '8px' }" @click="handleCancel()">
             取消
           </a-button>
         </a-form-item>

+ 9 - 9
src/views/power/user/userList.vue

@@ -1,33 +1,33 @@
 <template>
   <a-card :bordered="false">
     <div class="table-page-search-wrapper">
-      <a-form layout="inline">
+      <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="用户名称">
-              <a-input allowClear v-model.trim="queryParam.name" @pressEnter="$refs.table.refresh(true)" placeholder="请输入用户名称"/>
+              <a-input allowClear v-model.trim="queryParam.name" id="user-name" placeholder="请输入用户名称"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="手机号码">
-              <a-input allowClear v-model.trim="queryParam.phone" @pressEnter="$refs.table.refresh(true)" placeholder="请输入手机号码"/>
+              <a-input allowClear v-model.trim="queryParam.phone" id="user-phone" placeholder="请输入手机号码"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="状态">
-              <v-select code="CHECK_ENABLE_STATE" v-model="queryParam.loginFlag" allowClear placeholder="请选择状态"></v-select>
+              <v-select code="CHECK_ENABLE_STATE" v-model="queryParam.loginFlag" id="user-loginFlag" allowClear placeholder="请选择状态"></v-select>
             </a-form-item>
           </a-col>
           <a-col :md="4" :sm="24" class="flex-sp">
-            <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
-            <a-button @click="reset">重置</a-button>
+            <a-button type="primary" id="user-btn-search" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button id="user-btn-reset" @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>
+      <a-button id="user-btn-add" type="primary" icon="plus" @click="openModal">新建</a-button>
     </div>
 
     <s-table
@@ -49,8 +49,8 @@
         <template>
           <div >
             <a class="action-button" @click="handleEdit(record)">修改</a>
-            <a v-if="record.loginFlag" class="action-button reset-text" @click="resetPassword(record)">重置密码</a>
-            <a v-if="!record.loginFlag" class="action-button red-text" @click="delect(record)">删除</a>
+            <a v-if="record.loginFlag" class="action-button reset-text" id="user-btn-resetPass" @click="resetPassword(record)">重置密码</a>
+            <a v-if="!record.loginFlag" class="action-button red-text" id="user-btn-del" @click="delect(record)">删除</a>
           </div>
         </template>
       </span>

+ 8 - 2
src/views/power/user/userModal.vue

@@ -7,6 +7,7 @@
             <!-- 用户名称 -->
             <a-form-item label="用户名称" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
+                id="user-add-name"
                 placeholder="请输入用户名称"
                 v-decorator="['formData.name', {
                   initialValue: formData.name,
@@ -18,6 +19,7 @@
             <!-- 手机号码 -->
             <a-form-item label="手机号码" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
+                id="user-add-phone"
                 placeholder="请输入手机号码"
                 v-decorator="['formData.phone', {
                   initialValue: formData.phone,
@@ -31,6 +33,7 @@
           <a-col :span="12">
             <a-form-item label="性别" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <v-select
+                id="user-add-sex"
                 code="SEX"
                 v-decorator="[
                   'formData.sex',
@@ -46,6 +49,7 @@
           <a-col :span="12">
             <a-form-item label="状态" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-radio-group
+                id="user-add-loginFlag"
                 name="radioGroup"
                 v-decorator="[
                   'formData.loginFlag',
@@ -65,6 +69,7 @@
           <a-col :span="24">
             <a-form-item label="角色" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
               <a-select
+                id="user-add-role"
                 v-decorator="[
                   'formData.roleNames',
                   {
@@ -89,6 +94,7 @@
           <a-col :span="24">
             <a-form-item label="备注" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
               <a-textarea
+                id="user-add-remarks"
                 v-decorator="[
                   'formData.remarks',
                   {
@@ -102,10 +108,10 @@
           </a-col>
         </a-row>
         <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-          <a-button type="primary" @click="handleSubmit()">
+          <a-button id="user-add-btn-save" type="primary" @click="handleSubmit()">
             保存
           </a-button>
-          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+          <a-button id="user-add-btn-cancel" :style="{ marginLeft: '8px' }" @click="handleCancel()">
             取消
           </a-button>
         </a-form-item>