Ver código fonte

平台管理

develop
pai
commit
5261d8fe7c
5 arquivos alterados com 191 adições e 128 exclusões
  1. +2
    -2
      package.json
  2. +88
    -39
      src/pages/agent/list.vue
  3. +70
    -70
      src/router/config.js
  4. +30
    -10
      src/services/Merchants/Merchants.js
  5. +1
    -7
      vue.config.js

+ 2
- 2
package.json Ver arquivo

@@ -5,8 +5,8 @@
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build --dest dist_捷配后台_生产",
"build:test": "vue-cli-service build --mode test --dest dist_捷配后台_测试",
"build": "vue-cli-service build --dest dist_审单云系统_生产",
"build:test": "vue-cli-service build --mode test --dest dist_审单云系统_测试",
"lint": "vue-cli-service lint"
},
"dependencies": {


+ 88
- 39
src/pages/agent/list.vue Ver arquivo

@@ -2,19 +2,21 @@
<div class="boxMain">
<inc-search :listInput="listInput" :loadSoBn="tableLoad" :onSearch="filterSearch"></inc-search>
<a-table class="tablesa" :columns="tableColumns" :data-source="tableData" :rowKey="lists => lists.id" :pagination="pagination" :loading="tableLoad" @change="filterSearch">
<router-link slot="code" slot-scope="text,record" :to="'detail?id='+record.id"><a-icon type="file-text" /> {{text}}</router-link>
<span slot="validDate" slot-scope="text">{{formatDateTime(text)}}</span>
<span slot="state" slot-scope="text">{{text==1?'启用':'禁用'}}</span>
<div slot="id" slot-scope="text,record,index">
<a-spin :spinning="record.load">
<a-space>
<a-button type="primary" v-if="record.state==2" @click="fnSetState(record,index)">启用</a-button>
<a-button type="primary" v-else @click="fnSetState(record,index)">禁用</a-button>
<a-button @click="fnRelease(record,index)">发布</a-button>
<a-popconfirm title="确定删除吗?" ok-text="Yes" cancel-text="No" @confirm="fnDel(record,index)"><a-button type="danger" >删除</a-button></a-popconfirm>
</a-space>
</a-spin>
</div>
</a-table>
<a-modal title="新增商户" :visible="showNA" :confirm-loading="confirmNewAgent" @ok="newAgent" @cancel="showNA=false">
<a-modal title="新增平台" :visible="showNA" :confirm-loading="confirmNewAgent" @ok="newAgent" @cancel="showNA=false">
<a-form-model v-model="formNA" v-bind="layout">
<a-form-model-item label="商户编码"><a-input v-model="formNA.code"/></a-form-model-item>
<a-form-model-item label="商户简称"><a-input v-model="formNA.shortName"/></a-form-model-item>
<a-form-model-item label="商户名称"><a-input v-model="formNA.name"/></a-form-model-item>
<a-form-model-item label="商户邮箱"><a-input v-model="formNA.email"/></a-form-model-item>
<a-form-model-item label="商户网址"><a-input v-model="formNA.website"/></a-form-model-item>
<a-form-model-item label="Logo地址"><a-input v-model="formNA.logoUrl"/></a-form-model-item>
<a-form-model-item label="法人代表"><a-input v-model="formNA.legalRepresent"/></a-form-model-item>
<a-form-model-item label="截至有效期"><a-date-picker v-model="formNA.validDate" format="yyyy-MM-DD" valueFormat="yyyy-MM-DD 00:00:00"/></a-form-model-item>
<a-form-model-item label="平台描述"><a-input v-model="formNA.description"/></a-form-model-item>
</a-form-model>
</a-modal>
</div>
@@ -22,7 +24,13 @@

<script>
import IncSearch from "@/pages/Common/search";
import {MerchantsList, NewMerchants} from "@/services/Merchants/Merchants";
import {
delMerchants,
MerchantsList,
NewMerchants,
pubMerchantsAccess,
setMerchantsState
} from "@/services/Merchants/Merchants";
import {formatDate} from "@/services/Common";
export default {
name: 'agentList',
@@ -30,9 +38,9 @@ export default {
data(){
return{
listInput:[
{type:'input',name:'code',title:'商户编码',value:'',alt:'全匹配'},
{type:'input',name:'name',title:'商户名称',value:'',alt:'模糊匹配'},
{type:'button',name:'newAgent',title:'新增商户',value:'',alt:'',fn:this.showNewAgent},
{type:'input',name:'code',title:'关键词',value:'',alt:'全匹配'},
// {type:'input',name:'name',title:'商户名称',value:'',alt:'模糊匹配'},
{type:'button',name:'newAgent',title:'新增平台',value:'',alt:'',fn:this.showNewAgent},
],
pagination: {
pageSize: 10,
@@ -42,16 +50,13 @@ export default {
tableLoad: false,
tableColumns:[
// {title: '商户ID',dataIndex: 'id',key: 'id',},
{title: '商户编码',dataIndex: 'code',key: 'code',scopedSlots: { customRender: 'code' },},
{title: '名称',dataIndex: 'name',key: 'name',},
{title: '简称',dataIndex: 'shortName',key: 'shortName',},
{title: '法定代表人',dataIndex: 'legalRepresent',key: 'legalRepresent',},
{title: '网址',dataIndex: 'website',key: 'website',},
{title: '截止有效期',dataIndex: 'validDate',key: 'validDate',scopedSlots: { customRender: 'validDate' },},
{title: '邮箱',dataIndex: 'email',key: 'email'},
{title: '平台描述',dataIndex: 'description',key: 'description',scopedSlots: { customRender: 'description' },},
{title: '状态',dataIndex: 'state',key: 'state',scopedSlots: { customRender: 'state' },},
// {title: '邮箱',dataIndex: 'email',key: 'email'},
{title: '操作',width:'300px',dataIndex: 'id',key: 'id',scopedSlots: { customRender: 'id' },},
],
tableData:[],showNA:false,confirmNewAgent:false,
formNA:{code:'',shortName:'',name:'',email:'',website:'',logoUrl:'',legalRepresent:'',validDate:''},
formNA:{description:''},
layout: {
labelCol: { span:7 },
wrapperCol: { span:12 },
@@ -62,19 +67,57 @@ export default {
this.filterSearch();
},
methods:{
fnSetState(arr,index){
// console.log('设置状态:',arr,index)
this.tableData[index].load = true;
setMerchantsState(arr.id,arr.state).then(res=>{
if (res.success) this.$message.success(res.message)
else this.$message.error(res.message)
}).finally(()=>{
this.tableData[index].load = false;
this.filterSearch();
})
},
fnRelease(arr,index){
// console.log('发布:',arr,index)
this.tableData[index].load = true;
pubMerchantsAccess(arr.id).then(res=>{
if (res.success) this.$message.success(res.message)
else this.$message.error(res.message)
}).finally(()=>{
this.tableData[index].load = false;
this.filterSearch();
})
},
fnDel(arr,index){
// console.log('删除',arr,index)
this.tableData[index].load = true;
delMerchants(arr.id).then(res=>{
if (res.success) this.$message.success(res.message)
else this.$message.error(res.message)
}).finally(()=>{
this.tableData[index].load = false;
this.filterSearch();
})
},
showNewAgent(){
this.showNA = true;
},
newAgent(){
let name = this.formNA.description;
if (name==''){
this.$message.error('请填写平台描述!');
return false;
}
this.confirmNewAgent = true;
NewMerchants(this.formNA).then(res=>{
if(res.id) {
this.$message.success('商户添加成功!');
NewMerchants(name).then(res=>{
if(res.success) {
this.$message.success(res.message);
this.showNA = false;
this.formNA.description = '';
this.filterSearch();
}
this.showNA = false;
this.confirmNewAgent = false;
}).catch(err=>{
}else this.$message.error(res.message)
}).finally(()=>{
this.confirmNewAgent = false;
});
},
@@ -87,9 +130,8 @@ export default {
let count = (this.pagination.current-1)*this.pagination.pageSize;
let params={
code:this.listInput[0].value,
name:this.listInput[1].value,
skipCount:count,
maxResultCount:this.pagination.pageSize,
pageIndex: this.pagination.current,
pageSize: this.pagination.pageSize
}
// console.log(params)
this.fetch(params);
@@ -97,12 +139,19 @@ export default {
fetch(params = {}) {
this.tableLoad = true;
MerchantsList(params).then(data=>{
const pagination = { ...this.pagination};
pagination.total = data.totalCount;
this.tableLoad = false;
this.tableData = data.items;
this.pagination = pagination;
}).catch(err=>{
if (data.success){
data = data.data;
const pagination = { ...this.pagination};
pagination.total = data.totalCount;
for (let i in data.items){
data.items[i].load = false;
}
this.tableData = data.items;
this.pagination = pagination;
}else{
this.$message.error('获取失败!');
}
}).finally(()=>{
this.tableLoad = false;
})
},


+ 70
- 70
src/router/config.js Ver arquivo

@@ -99,34 +99,34 @@ const options = {
},
],
},
{
path: 'delivery',
name: '单证物流',
meta: {icon: 'icon-DCC'},
component: BlankView,
children: [
{
path: 'wait',
name: '待收货入库',
component: () => import('@/pages/OrderDelivery/listWaitReceive'),
},
{
path: 'list',
name: '待发货列表',
component: () => import('@/pages/OrderDelivery/listDelivery'),
},
{
path: 'docBox',
name: '箱单管理',
component: () => import('@/pages/OrderDelivery/listDocBox'),
},
{
path: 'purchasePI',
name: '形式发票(PI)',
component: () => import('@/pages/PI/PIList'),
},
],
},
// {
// path: 'delivery',
// name: '单证物流',
// meta: {icon: 'icon-DCC'},
// component: BlankView,
// children: [
// {
// path: 'wait',
// name: '待收货入库',
// component: () => import('@/pages/OrderDelivery/listWaitReceive'),
// },
// {
// path: 'list',
// name: '待发货列表',
// component: () => import('@/pages/OrderDelivery/listDelivery'),
// },
// {
// path: 'docBox',
// name: '箱单管理',
// component: () => import('@/pages/OrderDelivery/listDocBox'),
// },
// {
// path: 'purchasePI',
// name: '形式发票(PI)',
// component: () => import('@/pages/PI/PIList'),
// },
// ],
// },
// {
// path: 'agent',
// name: '商户',
@@ -135,7 +135,7 @@ const options = {
// },
{
path: 'agent',
name: '商户',
name: '平台管理',
meta: {icon: 'icon-kehu',type: 'link',},
redirect: '/agent/list',
component: BlankView,
@@ -143,13 +143,13 @@ const options = {
children: [
{
path: 'list',
name: '商户列表',
name: '平台列表',
// meta: {invisible: true},
component: () => import('@/pages/agent/list'),
},
{
path: 'detail',
name: '商户详情',
name: '平台详情',
// meta: {invisible: true},
component: () => import('@/pages/agent/detail'),
},
@@ -177,37 +177,37 @@ const options = {
// // },
// ]
// },
{
path: 'PCBConfig',
name: 'PCB配置',
meta: {icon: 'icon-shengchan' },
component: BlankView,
children: [
{
path: 'CraftCategory',
name: 'PCB工艺类别管理',
component: () => import('@/pages/PCBConfig/CraftCategory'),
},
{
path: 'craft',
name: 'PCB工艺信息管理',
component: () => import('@/pages/PCBConfig/CraftList'),
},
{
path: 'boardType',
name: 'PCB板材上下架管理',
component: () => import('@/pages/PCBConfig/BoardShelf'),
},
{
path: 'board',
name: 'PCB板材管理',
component: () => import('@/pages/PCBConfig/BoardList'),
},
]
},
// {
// path: 'PCBConfig',
// name: 'PCB配置',
// meta: {icon: 'icon-shengchan' },
// component: BlankView,
// children: [
// {
// path: 'CraftCategory',
// name: 'PCB工艺类别管理',
// component: () => import('@/pages/PCBConfig/CraftCategory'),
// },
// {
// path: 'craft',
// name: 'PCB工艺信息管理',
// component: () => import('@/pages/PCBConfig/CraftList'),
// },
// {
// path: 'boardType',
// name: 'PCB板材上下架管理',
// component: () => import('@/pages/PCBConfig/BoardShelf'),
// },
// {
// path: 'board',
// name: 'PCB板材管理',
// component: () => import('@/pages/PCBConfig/BoardList'),
// },
// ]
// },
{
path: 'setting',
name: '设置',
name: '系统设置',
meta: {icon:'icon-lingjian'},
component: BlankView,
children: [
@@ -216,21 +216,21 @@ const options = {
name: '角色管理',
component: () => import('@/pages/roles/list'),
},
{
path: 'org',
name: '组织部门',
component: () => import('@/pages/Org/list'),
},
// {
// path: 'org',
// name: '组织部门',
// component: () => import('@/pages/Org/list'),
// },
{
path: 'user',
name: '账号管理',
component: () => import('@/pages/User/list'),
},
{
path: 'dictionary',
name: '字典管理',
component: () => import('@/pages/Dictionary/listDictionary'),
},
// {
// path: 'dictionary',
// name: '字典管理',
// component: () => import('@/pages/Dictionary/listDictionary'),
// },
]
},
{


+ 30
- 10
src/services/Merchants/Merchants.js Ver arquivo

@@ -1,9 +1,9 @@
import { requestApi, METHOD } from '@/utils/request';

//新增商户
export function NewMerchants(params) {
export function NewMerchants(name) {
return new Promise((resolve, reject) => {
requestApi('/api/admin/merchants', METHOD.POST, params).then(res => {
requestApi('/api/app/access-manager-server/insert?description='+name, METHOD.POST).then(res => {
resolve(res);
}).catch(err=>{
reject(err);
@@ -11,27 +11,47 @@ export function NewMerchants(params) {
})
}

//获取商户列表
//获取开放接口列表
export function MerchantsList(params) {
return requestApi('/api/admin/merchants', METHOD.GET, params)
return requestApi('/api/app/access-manager-server/list-by-page', METHOD.POST, params)
}
//获取商户列表->选择:code商户编码 全匹配,name商户名称 模糊匹配
export function MerchantsListSearch(params) {
return requestApi('/api/admin/merchants/lookup/search', METHOD.GET, params)
//发布访问密钥
export function pubMerchantsAccess(id) {
return new Promise((resolve, reject) => {
requestApi(`/api/app/access-manager-server/${id}/release-access`, METHOD.POST).then(res => {resolve(res);}).catch(err => {reject(err);})
})
}
//状态设置
export function setMerchantsState(id,state) {
return new Promise((resolve, reject) => {
state = state==1?'disable':'enable';
requestApi(`/api/app/access-manager-server/${id}/${state}-access`, METHOD.POST).then(res => {resolve(res);}).catch(err => {reject(err);})
})
}
//删除授权
export function delMerchants(id) {
return new Promise((resolve, reject) => {
requestApi(`/api/app/access-manager-server/${id}/delete`, METHOD.DELETE).then(res => {resolve(res);}).catch(err => {reject(err);})
})
}

//获取商户详情
//获取开放接口详情
export function MerchantsDetail(id) {
return requestApi('/api/admin/merchants/'+id, METHOD.GET, null)
}

//修改商户详情
//修改开放接口详情
export function upMerchantsDetail(id,patams) {
return new Promise((resolve, reject) => {
requestApi('/api/admin/merchants/' + id, METHOD.PUT, patams).then(res => {resolve(res);}).catch(err => {reject(err);})
})
}

//获取开放接口列表搜索
export function MerchantsListSearch(params) {
return requestApi('/api/admin/merchants/lookup/search', METHOD.GET, params)
}


//商户充值
export function MerchantsRecharge(id,patams) {
return new Promise((resolve, reject) => {


+ 1
- 7
vue.config.js Ver arquivo

@@ -64,14 +64,8 @@ module.exports = {
},
logLevel: 'debug',
},
'/api/account': {
target: 'http://192.168.19.4:44339',
changeOrigin: true,
pathRewrite: {},
logLevel: 'debug',
},
'/api': {
target: 'http://192.168.19.4:44331',
target: 'http://192.168.19.4:44332',
changeOrigin: true,
pathRewrite: {},
logLevel: 'debug',


Carregando…
Cancelar
Salvar