账户管理对接

master
Caps 6 years ago
parent 6f978b9dfa
commit 3a46e60e75

@ -5,28 +5,48 @@
<span style="margin-left: 20px">账户名</span> <span style="margin-left: 20px">账户名</span>
<i-input placeholder="搜索用户名/账户" style="width: 10%;margin-left: 10px;" v-model="searchContent"/> <i-input placeholder="搜索用户名/账户" style="width: 10%;margin-left: 10px;" v-model="searchContent"/>
<span style=";margin-left: 20px;">角色</span> <span style=";margin-left: 20px;">角色</span>
<Select filterable placeholder="请选择区域" v-model="roleId" class="left-15" style="width:190px;margin-left: 10px;"> <Select filterable placeholder="请选择角色" v-model="changeRoleId" class="left-15"
style="width:190px;margin-left: 10px;">
<Option v-for="item in roleList" :value="item.id" :key="item.id">{{ item.name }}</Option> <Option v-for="item in roleList" :value="item.id" :key="item.id">{{ item.name }}</Option>
</Select> </Select>
<span style=";margin-left: 20px;">店铺</span> <span style=";margin-left: 20px;">店铺</span>
<Select filterable placeholder="请选择店铺" v-model="shopId" class="left-15" style="width:190px;margin-left: 10px;"> <Select filterable placeholder="请选择店铺" v-model="changeShopId" class="left-15"
<Option v-for="item in shopList" :value="item.shopId" :key="item.shopId">{{ item.shopName }}</Option> style="width:190px;margin-left: 10px;">
<Option v-for="item in shopList" :value="item.id" :key="item.name">{{ item.name }}</Option>
</Select> </Select>
<Button type="primary" style="margin-left: 30px">查询</Button> <Button type="primary" style="margin-left: 30px" @click="listAccountInfoFunction"></Button>
<Button type="primary" style="margin-bottom: 20px;margin-right: 20px;float:right;margin-top: 25px" @click="addOneAccount()">+</Button> <Button type="primary" style="margin-bottom: 20px;margin-right: 20px;float:right;margin-top: 25px"
<Button type="primary" ghost style="margin-bottom: 20px;margin-right: 20px;float:right;margin-top: 25px" @click="uploadAccount"></Button> @click="addOneAccount()">+添加账户
</Button>
<Button type="primary" ghost style="margin-bottom: 20px;margin-right: 20px;float:right;margin-top: 25px"
@click="uploadAccount">批量导入账户
</Button>
</Row> </Row>
</template> </template>
<Table :columns="columns1" :data="data1" style="margin-top: 30px"></Table> <Table :columns="columns1" :data="data1" style="margin-top: 30px"></Table>
<Page :total="totalSize" :current="pageNum" :page-size="pageSize" show-elevator show-total <Page :total="totalSize" :current="pageNum" :page-size="pageSize" show-elevator show-total
placement="top" style="float: right;margin-top: 20px"></Page> placement="top" style="float: right;margin-top: 20px"></Page>
<Modal
v-model="modal13"
title="删除提示"
@on-ok="ok"
@on-cancel="cancel" align="center">
<p style="margin-top: 20px;margin-bottom: 20px">确定要删除此账户吗删除后不可恢复</p>
<div slot="footer" style="text-align: center;margin-bottom: 10px;margin-top: 10px">
<Button style="width: 100px;" @click="modal13 = false">取消删除</Button>
<Button type="error" style="width: 100px;margin-left: 20px" @click="modal13 = false">确认删除</Button>
</div>
</Modal>
</div> </div>
</template> </template>
<script> <script>
import accountManagement from "../../services/account/AccountManagement";
export default { export default {
data() { data() {
return { return {
modal13: false,
roleList: [ roleList: [
{ {
id: '1', id: '1',
@ -69,8 +89,12 @@
}, },
{ {
title: '员工ID', title: '员工ID',
key: 'userCode', key: 'staffCode',
width:'150px' width: '150px',
render: (h, params) => {
let that = this;
return h('span', {}, that.data1[params.index].staffCode === null ? '--' : that.data1[params.index].staffCode)
}
}, },
{ {
title: '系统角色', title: '系统角色',
@ -86,6 +110,7 @@
title: '操作', title: '操作',
key: 'operation', key: 'operation',
render: (h, params) => { render: (h, params) => {
let that = this;
return h('div', [ return h('div', [
h('span', { h('span', {
style: { style: {
@ -97,6 +122,7 @@
}, },
on: { on: {
click: () => { click: () => {
that.addOneAccount();
} }
} }
}, '修改'), }, '修改'),
@ -110,7 +136,9 @@
}, },
on: { on: {
click: () => { click: () => {
this.remove(params); that.modal13 = true;
that.updateAccountId = that.data1[params.index].accountId;
that.updateUserId = that.data1[params.index].userId;
} }
} }
}, '删除') }, '删除')
@ -127,17 +155,31 @@
shopName: "全部", shopName: "全部",
} }
], ],
roleId:1, roleId: '',
shopId:1, shopId: '',
// //
totalSize: 0, totalSize: 0,
pageNum: 1, pageNum: 1,
pageSize : 10, pageSize: 20,
// //
searchContent: null, searchContent: null,
changeShopId: null,
changeRoleId: null,
updateAccountId: 0,
updateUserId: 0,
} }
}, },
mounted: function () {
this.listAccountInfoFunction();
this.listRoleInfo();
this.listOfShop();
},
methods: { methods: {
//
handlePage: function (value) {
this.pageNum = value;
this.listAccountInfoFunction();
},
// //
addOneAccount() { addOneAccount() {
this.$router.push({path: '/account/management/add'}); this.$router.push({path: '/account/management/add'});
@ -146,6 +188,136 @@
uploadAccount() { uploadAccount() {
this.$router.push({path: '/account/management/upload'}); this.$router.push({path: '/account/management/upload'});
}, },
//
listRoleInfo() {
let that = this;
that.roleList = [];
accountManagement.listRoleInfoApi({}, function (data) {
data = data.data;
if (data.code === '9999') {
that.$router.push('/login');
that.$Message.error("会话超时请重新登陆!");
}
if (data.code === '0001') {
that.$Message.error("查询角色失败!");
return;
}
if (data.code === '0000') {
data = data.results;
for (let i = 0; i < data.length; i++) {
let row = data[i];
that.roleList.push(row);
}
}
})
},
//
listOfShop() {
let that = this;
that.shopList = [];
let request = {
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId
};
accountManagement.listAllShopApi(request, function (data) {
data = data.data;
if (data.code === '9999') {
that.$router.push('/login');
that.$Message.error("会话超时请重新登陆!");
}
if (data.code === '0001') {
that.$Message.error("查询店铺失败!");
return;
}
if (data.code === '0000') {
data = data.results;
for (let i = 0; i < data.length; i++) {
let row = data[i];
that.shopList.push(row);
}
}
})
},
//
listAccountInfoFunction: function () {
let that = this;
that.data1 = [];
let request = {
searchContent: that.searchContent,
pageNum: that.pageNum,
pageSize: that.pageSize,
roleId: that.changeRoleId,
shopId: that.changeShopId
};
accountManagement.listAccountInfoApi(request, function (data) {
data = data.data;
if (data.code === '9999') {
that.$router.push('/login');
that.$Message.error("会话超时请重新登陆!");
}
if (data.code === '0001') {
that.$Message.error("系统繁忙!");
return
}
if (data.code === '0000') {
if (data) {
let row = data.results.records;
that.totalSize = data.results.total;
for (let i = 0; i < row.length; i++) {
let entity = row[i];
if (!entity.channel) {
entity.channel = '--';
}
if (!entity.account) {
entity.account = '--';
}
if (!entity.userName) {
entity.userName = '--';
}
if (!entity.roleName) {
entity.roleName = '--';
}
if (!entity.shopName) {
entity.shopName = '--';
}
that.data1.push(entity);
}
if (row === null || row.length === 0) {
that.totalSize = 0;
}
}
}
})
},
//
remove() {
let that = this;
let request = {
accountId: that.updateAccountId,
userId: that.updateUserId
};
accountManagement.removeAccountApi(request, function (data) {
if (data.code === '9999') {
that.$router.push('/login');
that.$Message.error("会话超时请重新登陆!");
}
if (data.data.code === '0001') {
that.$Message.info("删除失败");
return
}
if (data.data.code === '0000') {
that.$Message.info("删除成功");
that.pageNum = 1;
that.listAccountInfoFunction();
}
})
},
},
cancel() {
},
ok() {
this.remove();
} }
} }
</script> </script>

@ -24,10 +24,31 @@ export function removeAccountApi(params, call) {
return http.post('account/remove', params).then(call); return http.post('account/remove', params).then(call);
} }
/**
* 查询所有店铺
* @param params
* @param call
* @returns {Promise<any | never>}
*/
export function listAllShopApi(params, call) {
return http.get('/poi/store/all/list', params).then(call);
}
/**
* 查询所有角色
* @param params
* @param call
* @returns {Promise<any | never>}
*/
export function listRoleInfoApi(params, call) {
return http.get('/role/info/list', params).then(call);
}
export default { export default {
listAccountInfoApi, listAccountInfoApi,
removeAccountApi, removeAccountApi,
listAllShopApi,
listRoleInfoApi
} }

Loading…
Cancel
Save