Commit 427ca7f4 by 胡悦

提交账户类型

1 parent 95fca181
import request from './request' import request from './request'
const path = 'org.ore.api.accountType.' const path = 'org.ore.api.accountType.'
const path1 = 'cn.com.glsx.merchants.product.'
const accountApi = { const accountApi = {
/** 账户类型分页数据*/ /** 账户类型分页数据*/
getPageApi(data = {}) { getPageApi(data = {}) {
...@@ -24,11 +25,20 @@ const accountApi = { ...@@ -24,11 +25,20 @@ const accountApi = {
/** 新增账户类型 */ /** 新增账户类型 */
insert(data = {}) { insert(data = {}) {
data.method = `${path}insert` data.method = `${path}insert`
return request(data) return request(data, 'post')
}, },
/** 编辑账户类型 */ /** 编辑账户类型 */
update(data = {}) { update(data = {}) {
data.method = `${path}update` data.method = `${path}update`
return request(data, 'post')
},
/** 根据产品id查询菜单功能树 */
findProductById(data = {}) {
data.method = `${path1}findProductById`
return request(data)
},
saveStaff(data = {}) {
data.method = 'cn.com.glsx.merchants.staff.saveStaff'
return request(data) return request(data)
} }
} }
......
...@@ -40,6 +40,11 @@ const dictApi = { ...@@ -40,6 +40,11 @@ const dictApi = {
updateDictData(data = {}) { updateDictData(data = {}) {
data.method = `${path}updateDictData` data.method = `${path}updateDictData`
return request(data) return request(data)
},
/** 查询所有字典 */
findAllDictData(data = {}) {
data.method = `${path}findAllDictData`
return request(data)
} }
} }
......
...@@ -29,5 +29,18 @@ export const Common = { ...@@ -29,5 +29,18 @@ export const Common = {
} else { } else {
callback() callback()
} }
},
getParams: function(str = window.location.href) {
var params = str.split('?')
if (params.length < 2) return {}
var param = params[1].split('&')
var obj = {}
for (let i = 0; i < param.length; i++) {
var paramsA = param[i].split('=')
var key = paramsA[0]
var value = paramsA[1]
obj[key] = value
}
return obj
} }
} }
...@@ -5,9 +5,19 @@ const Constants = { ...@@ -5,9 +5,19 @@ const Constants = {
'2': '停用, red' '2': '停用, red'
}, },
ACCOUNT_STAUS: { ACCOUNT_STAUS: {
'0': '正常', '0': '已启用',
'1': '草稿' '1': '存草稿'
}, },
ACCOUNT_STAUS_LIST: [
{
label: '已启用',
value: 0
},
{
label: '存草稿',
value: 1
}
],
DICT_STATUS_OPTIONS: [ DICT_STATUS_OPTIONS: [
{ {
label: '启用', label: '启用',
......
import App from './index.vue'
import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common'
base.getConfig().then(data => {
const { vue, config } = data
vue.use(GlsxVueCommon, config)
base.render(App)
})
<template>
<div class="detail">
<el-form :model="detailForm" label-width="100px">
<h3 class="content-title">员工基本信息</h3>
<el-form-item label="账户名称:">
<div>{{detailForm.accounttypeName}}</div>
</el-form-item>
<el-form-item label="账户类型ID:">
<div>{{detailForm.accounttypeCode}}</div>
</el-form-item>
<el-form-item label="描述:">
<div>{{detailForm.accounttypeDetail}}</div>
</el-form-item>
<el-form-item label="登录权限:">
<div>{{detailForm.accounttypeName}}</div>
</el-form-item>
</el-form>
<div class="footer-btn">
<el-button :size="btn_size" @click="cancel" type="primary"
>取消</el-button
>
</div>
</div>
</template>
<script>
import { accountApi } from '@/api/accountManage'
export default {
data() {
return {
detailForm: {}
}
},
mounted() {
this.accountParams = this.$Common.getParams()
if (this.$Common.getParams()) this.getById(this.$Common.getParams().id)
},
methods: {
getById(id) {
accountApi.getById({ id }).then(res => {
console.log(res)
const { code, data } = res
if (code == '0') {
this.detailForm = {
accounttypeName: data.accounttypeName,
accounttypeDetail: data.accounttypeDetail,
accounttypeCode: data.accounttypeCode,
requestList: data.responseList
}
}
})
},
cancel() {
window.history.go(-1)
}
}
}
</script>
<style>
.detail .el-form-item {
margin-bottom: 0;
}
.footer-btn {
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
background-color: #fff;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -4,12 +4,13 @@ ...@@ -4,12 +4,13 @@
<el-form :inline="true" :model="accountSearchForm"> <el-form :inline="true" :model="accountSearchForm">
<el-form-item label="账户状态:"> <el-form-item label="账户状态:">
<el-select <el-select
v-model="accountSearchForm.value" v-model="accountSearchForm.delFlag"
:size="btn_size" :size="btn_size"
clearable
placeholder="请选择" placeholder="请选择"
> >
<el-option <el-option
v-for="item in options" v-for="item in ACCOUNT_STAUS"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
...@@ -18,19 +19,33 @@ ...@@ -18,19 +19,33 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="账户类型名称:"> <el-form-item label="账户类型名称:">
<el-input v-model="accountSearchForm.input" :size="btn_size" placeholder="请输入内容"></el-input> <el-input
v-model="accountSearchForm.accounttypeName"
clearable
:size="btn_size"
placeholder="请输入内容"
></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" :size="btn_size" :id="accountTableParams.btnId">搜索</el-button> <el-button
<el-button type="primary" :size="btn_size" @click="btnClick('create')">添加账户类型</el-button> type="primary"
:size="btn_size"
:id="accountTableParams.btnId"
>搜索</el-button
>
<el-button type="primary" :size="btn_size" @click="btnClick('create')"
>添加账户类型</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
<d2-table :searchForm="accountSearchForm" :getListApi="getListApi" :tableParams="accountTableParams"> <d2-table
ref="accountTable"
:searchForm="accountSearchForm"
:getListApi="getListApi"
:tableParams="accountTableParams"
>
<div slot="auth-button" slot-scope="scope"> <div slot="auth-button" slot-scope="scope">
<el-button <el-button type="text" :size="btn_size" @click="btnClick('detail', scope.scope)"
type="text"
:size="btn_size"
@click="btnClick()"
>查看详情</el-button >查看详情</el-button
> >
<el-button <el-button
...@@ -56,9 +71,6 @@ export default { ...@@ -56,9 +71,6 @@ export default {
data() { data() {
return { return {
accountSearchForm: {}, accountSearchForm: {},
tableData: [{
name: 'dsfd'
}],
getListApi: accountApi.getPageApi, getListApi: accountApi.getPageApi,
accountTableParams: { accountTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
...@@ -86,7 +98,7 @@ export default { ...@@ -86,7 +98,7 @@ export default {
], ],
tableOption: true tableOption: true
}, },
options: [] ACCOUNT_STAUS: this.$Constants.ACCOUNT_STAUS_LIST
} }
}, },
methods: { methods: {
...@@ -94,11 +106,52 @@ export default { ...@@ -94,11 +106,52 @@ export default {
switch (type) { switch (type) {
case 'create': case 'create':
console.log('create') console.log('create')
this.$root.to(['商户账号系统', '系统设置', '账户管理', '账户类型管理', '*新增账户类型'], { id: 1 }) window.location.href = `./add.html`
// this.$root.to(
// [
// '商户账号系统',
// '系统设置',
// '账户管理',
// '账户类型管理',
// '*新增账户类型'
// ],
// { id: 1 }
// )
break break
case 'edit': case 'edit':
window.location.href = `./add.html?id=${scope.id}`
break break
// eslint-disable-next-line no-case-declarations
case 'delete': case 'delete':
const that = this
const tipData = {
that: that,
tipText: '是否删除当前记录',
tipTitle: '提示',
type: 'warning',
callBack: () => {
const params = { id: scope.id }
console.log(params)
accountApi.delete(params).then(res => {
if (res.code == 0) {
this.$message({
type: 'success',
message: '删除成功!'
})
this.$refs.accountTable.refreshTable()
} else {
this.$message({
type: 'error',
message: res.message
})
}
})
}
}
this.$Common.confirmDialog(tipData)
break
case 'detail':
window.location.href = `./detail.html?id=${scope.id}`
break break
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!