@@ -5,8 +5,8 @@ | |||||
"private": true, | "private": true, | ||||
"scripts": { | "scripts": { | ||||
"serve": "vue-cli-service serve", | "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" | "lint": "vue-cli-service lint" | ||||
}, | }, | ||||
"dependencies": { | "dependencies": { | ||||
@@ -2,19 +2,21 @@ | |||||
<div class="boxMain"> | <div class="boxMain"> | ||||
<inc-search :listInput="listInput" :loadSoBn="tableLoad" :onSearch="filterSearch"></inc-search> | <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"> | <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-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 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-form-model> | ||||
</a-modal> | </a-modal> | ||||
</div> | </div> | ||||
@@ -22,7 +24,13 @@ | |||||
<script> | <script> | ||||
import IncSearch from "@/pages/Common/search"; | 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"; | import {formatDate} from "@/services/Common"; | ||||
export default { | export default { | ||||
name: 'agentList', | name: 'agentList', | ||||
@@ -30,9 +38,9 @@ export default { | |||||
data(){ | data(){ | ||||
return{ | return{ | ||||
listInput:[ | 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: { | pagination: { | ||||
pageSize: 10, | pageSize: 10, | ||||
@@ -42,16 +50,13 @@ export default { | |||||
tableLoad: false, | tableLoad: false, | ||||
tableColumns:[ | tableColumns:[ | ||||
// {title: '商户ID',dataIndex: 'id',key: 'id',}, | // {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, | tableData:[],showNA:false,confirmNewAgent:false, | ||||
formNA:{code:'',shortName:'',name:'',email:'',website:'',logoUrl:'',legalRepresent:'',validDate:''}, | |||||
formNA:{description:''}, | |||||
layout: { | layout: { | ||||
labelCol: { span:7 }, | labelCol: { span:7 }, | ||||
wrapperCol: { span:12 }, | wrapperCol: { span:12 }, | ||||
@@ -62,19 +67,57 @@ export default { | |||||
this.filterSearch(); | this.filterSearch(); | ||||
}, | }, | ||||
methods:{ | 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(){ | showNewAgent(){ | ||||
this.showNA = true; | this.showNA = true; | ||||
}, | }, | ||||
newAgent(){ | newAgent(){ | ||||
let name = this.formNA.description; | |||||
if (name==''){ | |||||
this.$message.error('请填写平台描述!'); | |||||
return false; | |||||
} | |||||
this.confirmNewAgent = true; | 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.filterSearch(); | ||||
} | |||||
this.showNA = false; | |||||
this.confirmNewAgent = false; | |||||
}).catch(err=>{ | |||||
}else this.$message.error(res.message) | |||||
}).finally(()=>{ | |||||
this.confirmNewAgent = false; | this.confirmNewAgent = false; | ||||
}); | }); | ||||
}, | }, | ||||
@@ -87,9 +130,8 @@ export default { | |||||
let count = (this.pagination.current-1)*this.pagination.pageSize; | let count = (this.pagination.current-1)*this.pagination.pageSize; | ||||
let params={ | let params={ | ||||
code:this.listInput[0].value, | 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) | // console.log(params) | ||||
this.fetch(params); | this.fetch(params); | ||||
@@ -97,12 +139,19 @@ export default { | |||||
fetch(params = {}) { | fetch(params = {}) { | ||||
this.tableLoad = true; | this.tableLoad = true; | ||||
MerchantsList(params).then(data=>{ | 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; | this.tableLoad = false; | ||||
}) | }) | ||||
}, | }, | ||||
@@ -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', | // path: 'agent', | ||||
// name: '商户', | // name: '商户', | ||||
@@ -135,7 +135,7 @@ const options = { | |||||
// }, | // }, | ||||
{ | { | ||||
path: 'agent', | path: 'agent', | ||||
name: '商户', | |||||
name: '平台管理', | |||||
meta: {icon: 'icon-kehu',type: 'link',}, | meta: {icon: 'icon-kehu',type: 'link',}, | ||||
redirect: '/agent/list', | redirect: '/agent/list', | ||||
component: BlankView, | component: BlankView, | ||||
@@ -143,13 +143,13 @@ const options = { | |||||
children: [ | children: [ | ||||
{ | { | ||||
path: 'list', | path: 'list', | ||||
name: '商户列表', | |||||
name: '平台列表', | |||||
// meta: {invisible: true}, | // meta: {invisible: true}, | ||||
component: () => import('@/pages/agent/list'), | component: () => import('@/pages/agent/list'), | ||||
}, | }, | ||||
{ | { | ||||
path: 'detail', | path: 'detail', | ||||
name: '商户详情', | |||||
name: '平台详情', | |||||
// meta: {invisible: true}, | // meta: {invisible: true}, | ||||
component: () => import('@/pages/agent/detail'), | 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', | path: 'setting', | ||||
name: '设置', | |||||
name: '系统设置', | |||||
meta: {icon:'icon-lingjian'}, | meta: {icon:'icon-lingjian'}, | ||||
component: BlankView, | component: BlankView, | ||||
children: [ | children: [ | ||||
@@ -216,21 +216,21 @@ const options = { | |||||
name: '角色管理', | name: '角色管理', | ||||
component: () => import('@/pages/roles/list'), | component: () => import('@/pages/roles/list'), | ||||
}, | }, | ||||
{ | |||||
path: 'org', | |||||
name: '组织部门', | |||||
component: () => import('@/pages/Org/list'), | |||||
}, | |||||
// { | |||||
// path: 'org', | |||||
// name: '组织部门', | |||||
// component: () => import('@/pages/Org/list'), | |||||
// }, | |||||
{ | { | ||||
path: 'user', | path: 'user', | ||||
name: '账号管理', | name: '账号管理', | ||||
component: () => import('@/pages/User/list'), | component: () => import('@/pages/User/list'), | ||||
}, | }, | ||||
{ | |||||
path: 'dictionary', | |||||
name: '字典管理', | |||||
component: () => import('@/pages/Dictionary/listDictionary'), | |||||
}, | |||||
// { | |||||
// path: 'dictionary', | |||||
// name: '字典管理', | |||||
// component: () => import('@/pages/Dictionary/listDictionary'), | |||||
// }, | |||||
] | ] | ||||
}, | }, | ||||
{ | { | ||||
@@ -1,9 +1,9 @@ | |||||
import { requestApi, METHOD } from '@/utils/request'; | import { requestApi, METHOD } from '@/utils/request'; | ||||
//新增商户 | //新增商户 | ||||
export function NewMerchants(params) { | |||||
export function NewMerchants(name) { | |||||
return new Promise((resolve, reject) => { | 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); | resolve(res); | ||||
}).catch(err=>{ | }).catch(err=>{ | ||||
reject(err); | reject(err); | ||||
@@ -11,27 +11,47 @@ export function NewMerchants(params) { | |||||
}) | }) | ||||
} | } | ||||
//获取商户列表 | |||||
//获取开放接口列表 | |||||
export function MerchantsList(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) { | export function MerchantsDetail(id) { | ||||
return requestApi('/api/admin/merchants/'+id, METHOD.GET, null) | return requestApi('/api/admin/merchants/'+id, METHOD.GET, null) | ||||
} | } | ||||
//修改商户详情 | |||||
//修改开放接口详情 | |||||
export function upMerchantsDetail(id,patams) { | export function upMerchantsDetail(id,patams) { | ||||
return new Promise((resolve, reject) => { | return new Promise((resolve, reject) => { | ||||
requestApi('/api/admin/merchants/' + id, METHOD.PUT, patams).then(res => {resolve(res);}).catch(err => {reject(err);}) | 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) { | export function MerchantsRecharge(id,patams) { | ||||
return new Promise((resolve, reject) => { | return new Promise((resolve, reject) => { | ||||
@@ -64,14 +64,8 @@ module.exports = { | |||||
}, | }, | ||||
logLevel: 'debug', | logLevel: 'debug', | ||||
}, | }, | ||||
'/api/account': { | |||||
target: 'http://192.168.19.4:44339', | |||||
changeOrigin: true, | |||||
pathRewrite: {}, | |||||
logLevel: 'debug', | |||||
}, | |||||
'/api': { | '/api': { | ||||
target: 'http://192.168.19.4:44331', | |||||
target: 'http://192.168.19.4:44332', | |||||
changeOrigin: true, | changeOrigin: true, | ||||
pathRewrite: {}, | pathRewrite: {}, | ||||
logLevel: 'debug', | logLevel: 'debug', | ||||