|
@@ -4,13 +4,13 @@
|
|
|
<a-form layout="inline">
|
|
|
<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-form-item label="员工姓名">
|
|
|
+ <a-input allowClear v-model.trim="queryParam.name" @pressEnter="$refs.table.refresh(true)" 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" @pressEnter="$refs.table.refresh(true)" placeholder="请输入手机号码" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
@@ -25,20 +25,19 @@
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
</div>
|
|
|
- <a-divider/>
|
|
|
+ <a-divider />
|
|
|
<div class="table-operator">
|
|
|
<a-button type="primary" icon="plus" @click="openModal">新建</a-button>
|
|
|
</div>
|
|
|
- <s-table
|
|
|
+ <!-- <s-table
|
|
|
ref="table"
|
|
|
size="default"
|
|
|
rowKey="id"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
- bordered
|
|
|
- >
|
|
|
+ bordered>
|
|
|
<span slot="status" slot-scope="text, record">
|
|
|
- <a-switch checkedChildren="" unCheckedChildren="" v-model="record.loginFlag" @change="changeFlagHandle(text, record)"/>
|
|
|
+ <a-switch checkedChildren="启用" unCheckedChildren="禁用" v-model="record.loginFlag" @change="changeFlagHandle(text, record)" />
|
|
|
</span>
|
|
|
<div slot="roleNames" slot-scope="text, record" :title="record.roleNames">
|
|
|
<span v-if="record.roleNames">{{ record.roleNames.substr(0,12) + '...' }}</span>
|
|
@@ -46,26 +45,70 @@
|
|
|
</div>
|
|
|
<span slot="action" slot-scope="text, record">
|
|
|
<template>
|
|
|
- <div >
|
|
|
+ <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>
|
|
|
</div>
|
|
|
</template>
|
|
|
</span>
|
|
|
- </s-table>
|
|
|
+ </s-table> -->
|
|
|
+ <a-table :columns="columns" :data-source="data" bordered>
|
|
|
+ <span slot="action" slot-scope="text, record">
|
|
|
+ <!-- 点检关联门店 -->
|
|
|
+ <a-tooltip placement="bottom">
|
|
|
+ <template slot="title">
|
|
|
+ <span>编辑</span>
|
|
|
+ </template>
|
|
|
+ <a-icon type="edit" style="font-size: 20px;color: #1890FF;padding: 0 10px;" @click="handleEdit(record)" />
|
|
|
+ </a-tooltip>
|
|
|
+ <a-tooltip placement="bottom">
|
|
|
+ <template slot="title">
|
|
|
+ <span>关联点检门店</span>
|
|
|
+ </template>
|
|
|
+ <a-icon type="apartment" :style="{ fontSize: '20px', color: '#e29e14', padding: '0 10px' }" @click="selectStore(record)" />
|
|
|
+ </a-tooltip>
|
|
|
+ <a-tooltip placement="bottom">
|
|
|
+ <template slot="title">
|
|
|
+ <span>重置密码</span>
|
|
|
+ </template>
|
|
|
+ <a-icon type="unlock" style="font-size: 20px;color: #08c0de;padding: 0 10px;"/>
|
|
|
+ </a-tooltip>
|
|
|
+ <a-tooltip placement="bottom">
|
|
|
+ <template slot="title">
|
|
|
+ <span>删除</span>
|
|
|
+ </template>
|
|
|
+ <a-icon type="delete" style="font-size: 20px;color: red;padding: 0 10px;" @click="delect(record)" />
|
|
|
+ </a-tooltip>
|
|
|
+ </span>
|
|
|
+ </a-table>
|
|
|
+ <!-- 新增用户弹窗 -->
|
|
|
<userModal :visible="showModal" @refresh="$refs.table.refresh(true)" :data="itemData" @close="showModal = false"></userModal>
|
|
|
+ <!-- 点检门店弹窗 -->
|
|
|
+ <storeModal :visible="showStoreModal" @close="showStoreModal=false"></storeModal>
|
|
|
</a-card>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { STable, VSelect } from '@/components'
|
|
|
+import {
|
|
|
+ STable,
|
|
|
+ VSelect
|
|
|
+} from '@/components'
|
|
|
import userModal from './userModal.vue'
|
|
|
-import { resetPSD, updateEnableStatus, getPowerUserList, delectUserPower } from '@/api/card-voucher-user.js'
|
|
|
+import storeModal from './storeModal.vue'
|
|
|
+// import {
|
|
|
+// resetPSD,
|
|
|
+// // updateEnableStatus,
|
|
|
+// getPowerUserList,
|
|
|
+// delectUserPower
|
|
|
+// } from '@/api/card-voucher-user.js'
|
|
|
export default {
|
|
|
name: 'UserList',
|
|
|
components: {
|
|
|
- STable, VSelect, userModal
|
|
|
+ STable,
|
|
|
+ VSelect,
|
|
|
+ userModal,
|
|
|
+ storeModal
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
@@ -76,72 +119,89 @@ export default {
|
|
|
loginFlag: ''
|
|
|
},
|
|
|
showModal: false,
|
|
|
+ showStoreModal: false,
|
|
|
itemData: {}, // 编辑行数据
|
|
|
- // 表头
|
|
|
- columns: [
|
|
|
- {
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
title: '序号',
|
|
|
- dataIndex: 'no',
|
|
|
- width: '40',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '用户名称',
|
|
|
- dataIndex: 'name',
|
|
|
- width: '100',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '手机号码',
|
|
|
- dataIndex: 'phone',
|
|
|
- width: '100',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
+ dataIndex: 'no',
|
|
|
+ minWidth: '100',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '创建时间',
|
|
|
+ dataIndex: 'createDate',
|
|
|
+ minWidth: '100',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '员工姓名',
|
|
|
+ dataIndex: 'name',
|
|
|
+ minWidth: '100',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '手机号码',
|
|
|
+ dataIndex: 'phone',
|
|
|
+ minWidth: '100',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
{
|
|
|
- title: '角色',
|
|
|
- width: '100',
|
|
|
- align: 'center',
|
|
|
- scopedSlots: { customRender: 'roleNames' }
|
|
|
+ title: '角色',
|
|
|
+ dataIndex: 'userType',
|
|
|
+ minWidth: '100',
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
- title: '状态',
|
|
|
- width: '100',
|
|
|
- align: 'center',
|
|
|
- scopedSlots: { customRender: 'status' }
|
|
|
+ title: '启用状态',
|
|
|
+ dataIndex: 'status',
|
|
|
+ minWidth: '100',
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
- {
|
|
|
- title: '创建时间',
|
|
|
- dataIndex: 'createDate',
|
|
|
- width: '120',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- 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
|
|
|
- })
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ dataIndex: 'action',
|
|
|
+ minWidth: '100',
|
|
|
+ align: 'center',
|
|
|
+ scopedSlots: { customRender: 'action' }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ data: [{
|
|
|
+ key: '1',
|
|
|
+ name: 'John Brown',
|
|
|
+ age: 32,
|
|
|
+ address: 'New York No. 1 Lake Park',
|
|
|
+ tags: ['nice', 'developer']
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: '2',
|
|
|
+ name: 'Jim Green',
|
|
|
+ age: 42,
|
|
|
+ address: 'London No. 1 Lake Park',
|
|
|
+ tags: ['loser']
|
|
|
},
|
|
|
- optionAlertShow: false
|
|
|
+ {
|
|
|
+ key: '3',
|
|
|
+ name: 'Joe Black',
|
|
|
+ age: 32,
|
|
|
+ address: 'Sidney No. 1 Lake Park',
|
|
|
+ tags: ['cool', 'teacher']
|
|
|
+ }],
|
|
|
+ // 加载数据方法 必须为 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.$refs.table.refresh()
|
|
|
- })
|
|
|
- },
|
|
|
methods: {
|
|
|
// 刷新列表
|
|
|
refreshTable () {
|
|
@@ -161,19 +221,24 @@ export default {
|
|
|
this.showModal = true
|
|
|
this.itemData = {}
|
|
|
},
|
|
|
+ // 选择点检门店
|
|
|
+ selectStore (row) {
|
|
|
+ this.showStoreModal = true
|
|
|
+ console.log('wobeidianjile')
|
|
|
+ },
|
|
|
// 重置密码
|
|
|
resetPassword (row) {
|
|
|
- resetPSD({
|
|
|
- id: row.id
|
|
|
- }).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.$message.success('密码重置成功')
|
|
|
- } else {
|
|
|
- this.$message.error(res.message)
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- this.$message.success('密码重置失败, 请稍后重试')
|
|
|
- })
|
|
|
+ // resetPSD({
|
|
|
+ // id: row.id
|
|
|
+ // }).then(res => {
|
|
|
+ // if (res.status == 200) {
|
|
|
+ // this.$message.success('密码重置成功')
|
|
|
+ // } else {
|
|
|
+ // this.$message.error(res.message)
|
|
|
+ // }
|
|
|
+ // }).catch(() => {
|
|
|
+ // this.$message.success('密码重置失败, 请稍后重试')
|
|
|
+ // })
|
|
|
},
|
|
|
// 删除
|
|
|
delect (row) {
|
|
@@ -184,18 +249,18 @@ export default {
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
onOk () {
|
|
|
- delectUserPower({
|
|
|
- id: row.id
|
|
|
- }).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- _this.$message.success('删除成功')
|
|
|
- _this.$refs.table.refresh()
|
|
|
- } else {
|
|
|
- _this.$message.error(res.message)
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- _this.$message.success('删除失败, 请稍后重试')
|
|
|
- })
|
|
|
+ // delectUserPower({
|
|
|
+ // id: row.id
|
|
|
+ // }).then(res => {
|
|
|
+ // if (res.status == 200) {
|
|
|
+ // _this.$message.success('删除成功')
|
|
|
+ // _this.$refs.table.refresh()
|
|
|
+ // } else {
|
|
|
+ // _this.$message.error(res.message)
|
|
|
+ // }
|
|
|
+ // }).catch(() => {
|
|
|
+ // _this.$message.success('删除失败, 请稍后重试')
|
|
|
+ // })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -206,6 +271,7 @@ export default {
|
|
|
})
|
|
|
return str.join(',')
|
|
|
},
|
|
|
+ // 编辑
|
|
|
handleEdit (row) {
|
|
|
this.showModal = true
|
|
|
this.itemData = row
|
|
@@ -216,40 +282,44 @@ export default {
|
|
|
id: record.id,
|
|
|
flag: record.loginFlag ? '1' : '0'
|
|
|
}
|
|
|
- updateEnableStatus(_data).then(res => {
|
|
|
- if (res.status + '' === '200') {
|
|
|
- this.$message.success('修改成功')
|
|
|
- } else {
|
|
|
- this.$message.error(res.message)
|
|
|
- record.loginFlag = !record.loginFlag
|
|
|
- }
|
|
|
- })
|
|
|
+ // updateEnableStatus(_data).then(res => {
|
|
|
+ // if (res.status + '' === '200') {
|
|
|
+ // this.$message.success('修改成功')
|
|
|
+ // } else {
|
|
|
+ // this.$message.error(res.message)
|
|
|
+ // record.loginFlag = !record.loginFlag
|
|
|
+ // }
|
|
|
+ // })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
- .table-page-search-wrapper .ant-form-inline .ant-form-item{
|
|
|
- margin-bottom: 0;
|
|
|
- }
|
|
|
- .flex-sp{
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
- }
|
|
|
- .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;
|
|
|
- }
|
|
|
- .reset-text {
|
|
|
- background-color: #31b50b;
|
|
|
- }
|
|
|
+ .table-page-search-wrapper .ant-form-inline .ant-form-item {
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .flex-sp {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .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;
|
|
|
+ }
|
|
|
+
|
|
|
+ .reset-text {
|
|
|
+ background-color: #31b50b;
|
|
|
+ }
|
|
|
</style>
|