@@ -1,5 +1,5 @@ | |||
VUE_APP_PUBLIC_PATH=/ | |||
VUE_APP_NAME=捷配管理后台 | |||
VUE_APP_NAME=捷配审单云管理后台 | |||
VUE_APP_ROUTES_KEY=admin.routes | |||
VUE_APP_PERMISSIONS_KEY=admin.permissions | |||
VUE_APP_ROLES_KEY=admin.roles | |||
@@ -328,6 +328,9 @@ export default { | |||
</script> | |||
<style lang="less"> | |||
a.link{font-size:16px; line-height:2em; display: inline-block} | |||
.font2h{text-overflow:-o-ellipsis-lastline; overflow:hidden; text-overflow:ellipsis; display:-webkit-box!important; -webkit-line-clamp:2; -webkit-box-orient:vertical; word-break: break-all;} | |||
.font3h{-webkit-line-clamp:3;} | |||
.fontovdd{display:block; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; white-space:nowrap;} | |||
.formSa .ant-form-item{margin-bottom:.5em} | |||
.tabbn .ant-btn{padding:0 .5em; color:#f90} | |||
.tabbn .ant-btn:hover{opacity:.4} | |||
@@ -2,21 +2,32 @@ | |||
<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"> | |||
<span slot="state" slot-scope="text">{{text==1?'启用':'禁用'}}</span> | |||
<div slot="state" slot-scope="text"><span :style="'color:#'+(text==2?'f30':'f90')">{{text==1?'启用':'禁用'}}</span></div> | |||
<span slot="type" slot-scope="text">{{getResSelects('platformType',text)}}</span> | |||
<div slot="id" slot-scope="text,record,index"> | |||
<a-spin :spinning="record.load"> | |||
<a-space> | |||
<a-button @click="showNEAgent(record)">修改</a-button> | |||
<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-popconfirm title="确定删除吗?" ok-text="Yes" cancel-text="No" @confirm="fnDel(record,index)"><a-button type="danger"><a-icon type="delete" /></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-form-model v-model="formNA" v-bind="layout"> | |||
<a-form-model-item label="平台描述"><a-input v-model="formNA.description"/></a-form-model-item> | |||
<a-modal :title="formNA.id?'修改平台信息':'新增平台'" :visible="showNA" :confirm-loading="confirmNewAgent" @ok="NEAgent" @cancel="showNA=false"> | |||
<a-form-model :model="formNA" v-bind="layout" ref="ruleForm" :rules="rules"> | |||
<a-form-model-item label="平台类型" prop="type"> | |||
<a-select v-model="formNA.type"> | |||
<a-select-option value="">请选择平台类型</a-select-option> | |||
<a-select-option v-for="(li,index) in platformType" :key="index" :value="li.value">{{li.text}}</a-select-option> | |||
</a-select> | |||
</a-form-model-item> | |||
<a-form-model-item label="平台描述" prop="description"><a-input v-model="formNA.description" placeholder="描述"/></a-form-model-item> | |||
<a-form-model-item label="登录帐号" prop="userName"><a-input v-model="formNA.userName" placeholder="登录此平台用户名"/></a-form-model-item> | |||
<a-form-model-item label="登录密码" prop="password"><a-input v-model="formNA.password" placeholder="登录此平台密码" /></a-form-model-item> | |||
<a-form-model-item label="链接地址" prop="url"><a-input v-model="formNA.url" placeholder="http"/></a-form-model-item> | |||
</a-form-model> | |||
</a-modal> | |||
</div> | |||
@@ -27,11 +38,11 @@ import IncSearch from "@/pages/Common/search"; | |||
import { | |||
delMerchants, | |||
MerchantsList, | |||
NewMerchants, | |||
NEMerchants, | |||
pubMerchantsAccess, | |||
setMerchantsState | |||
} from "@/services/Merchants/Merchants"; | |||
import {formatDate} from "@/services/Common"; | |||
import {formatDate, getRandCode,resSelects} from "@/services/Common"; | |||
export default { | |||
name: 'agentList', | |||
components: {IncSearch}, | |||
@@ -40,7 +51,7 @@ export default { | |||
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:'button',name:'newAgent',title:'新增平台',value:'',alt:'',fn:this.showNEAgent}, | |||
], | |||
pagination: { | |||
pageSize: 10, | |||
@@ -49,14 +60,24 @@ export default { | |||
}, | |||
tableLoad: false, | |||
tableColumns:[ | |||
// {title: '商户ID',dataIndex: 'id',key: 'id',}, | |||
{title: '平台类型',dataIndex: 'type',key: 'type',width:'100px',scopedSlots: { customRender: 'type' },}, | |||
{title: '状态',dataIndex: 'state',key: 'state',align:'center',width:'100px',scopedSlots: { customRender: 'state' },}, | |||
{title: '平台描述',dataIndex: 'description',key: 'description',scopedSlots: { customRender: 'description' },}, | |||
{title: '状态',dataIndex: 'state',key: 'state',scopedSlots: { customRender: 'state' },}, | |||
// {title: '邮箱',dataIndex: 'email',key: 'email'}, | |||
{title: '帐号',dataIndex: 'userName',key: 'userName',align:'center'}, | |||
{title: '登录链接',dataIndex: 'url',key: 'url'}, | |||
{title: '操作',width:'300px',dataIndex: 'id',key: 'id',scopedSlots: { customRender: 'id' },}, | |||
], | |||
tableData:[],showNA:false,confirmNewAgent:false, | |||
formNA:{description:''}, | |||
platformType:[], | |||
formNA_b:{description:'',userName:'',password:'',type:'',url:''}, | |||
formNA:{}, | |||
rules: { | |||
type: [{required: true, message: '请选择平台类型!', trigger: 'change' },], | |||
description: [{required: true, message: '请填写平台描述!', trigger: 'blur' },], | |||
userName: [{required: true, message: '请填写登录此平台用户名!', trigger: 'blur' },], | |||
password: [{required: true, message: '请填写登录此平台密码!', trigger: 'blur' },], | |||
url: [{required: true, message: '请填写平台链接地址!', trigger: 'blur' },], | |||
}, | |||
layout: { | |||
labelCol: { span:7 }, | |||
wrapperCol: { span:12 }, | |||
@@ -100,25 +121,32 @@ export default { | |||
this.filterSearch(); | |||
}) | |||
}, | |||
showNewAgent(){ | |||
showNEAgent(arr){ | |||
this.platformType = resSelects('platformType'); | |||
if (arr?.id){ | |||
this.formNA = {...arr}; | |||
let typeVal =this.formNA.type; | |||
this.formNA.type = typeVal===0?'':typeVal.toString(); | |||
} | |||
else this.formNA = {...this.formNA_b}; | |||
this.showNA = true; | |||
this.$refs.ruleForm?.resetFields(); | |||
}, | |||
newAgent(){ | |||
let name = this.formNA.description; | |||
if (name==''){ | |||
this.$message.error('请填写平台描述!'); | |||
return false; | |||
} | |||
this.confirmNewAgent = true; | |||
NewMerchants(name).then(res=>{ | |||
if(res.success) { | |||
this.$message.success(res.message); | |||
this.showNA = false; | |||
this.formNA.description = ''; | |||
this.filterSearch(); | |||
}else this.$message.error(res.message) | |||
}).finally(()=>{ | |||
this.confirmNewAgent = false; | |||
NEAgent(){ | |||
this.$refs.ruleForm.validate(valid => { | |||
if (valid) { | |||
this.confirmNewAgent = true; | |||
NEMerchants(this.formNA).then(res=>{ | |||
if(res.success) { | |||
this.$message.success(res.message); | |||
this.showNA = false; | |||
this.filterSearch(); | |||
}else this.$message.error(res.message) | |||
}).finally(()=>{ | |||
this.confirmNewAgent = false; | |||
}); | |||
} | |||
else return false; | |||
}); | |||
}, | |||
filterSearch(page){ | |||
@@ -160,6 +188,13 @@ export default { | |||
formatDateTime(time){ | |||
return formatDate(time,'yyyy-MM-dd hh:mm'); | |||
}, | |||
//随机密码 | |||
randPWD(){ | |||
this.formNA.password = getRandCode(); | |||
}, | |||
getResSelects(type,val){ | |||
return resSelects(type,val) | |||
} | |||
} | |||
} | |||
</script> | |||
@@ -1,7 +1,7 @@ | |||
module.exports = { | |||
messages: { | |||
CN: { | |||
welcome: '您好,欢迎来到\n捷配管理后台', | |||
welcome: '您好,欢迎来到\n捷配审单云管理后台', | |||
login: '登录', | |||
usernamePlaceholder: '请输入账户名', | |||
usernameInvalidMessage: '请输入账户名', | |||
@@ -2,18 +2,29 @@ | |||
<div class="boxMain"> | |||
<inc-search :listInput="listInput" :loadSoBn="tableLoad" :onSearch="filterSearch" :orderType="orderType"></inc-search> | |||
<a-table class="tablesa" :columns="tableColumns" :data-source="tableData" :rowKey="lists => lists.orderNo" :pagination="pagination" :loading="tableLoad" @change="filterSearch"> | |||
<div slot="memberNo" slot-scope="text,record"> | |||
<i v-if="record.memberLevel!==null" :class="'star s'+record.memberLevel">{{record.memberLevel}}</i>{{text}} | |||
</div> | |||
<div slot="orderNo" slot-scope="text,record"> | |||
<router-link :to="'detail?Id='+record.orderNo"><a-icon type="file-text" /> {{text}}</router-link> | |||
<router-link class="fontovdd" :title="text" :to="'detail?Id='+record.orderNo"><a-icon type="file-text" /> {{text}}</router-link> | |||
<span :style="'color:'+(record.isJiaJi?'#f90':'#999')">加急:{{record.isJiaJi?'是':'否'}}</span><br> | |||
<span :style="'color:'+(record.isReorder?'#f90':'#999')">返单:{{record.isReorder?'是':'否'}}</span> | |||
</div> | |||
<div slot="orderMoney" slot-scope="text,record"> | |||
¥{{record.orderMoney}}<br> | |||
<span :style="'color:'+(record.isPay?'#f90':'#999')">{{record.isPay?'已支付':'未支付'}}</span> | |||
</div> | |||
<span class="amount" slot="amount" slot-scope="text,record">金额:<span>${{ text }}</span><br>已付:<span>${{record.paidAmount||0}}</span></span> | |||
<span slot="orderType" slot-scope="text,record">{{getSelTxt('orderType',text)}}<br>{{getSelTxt('sourceType',record.sourceType)}}</span> | |||
<span slot="status" slot-scope="text">{{getSelTxt('orderStatus',text)}}</span> | |||
<div slot="groupNo" slot-scope="text">{{text}}<br></div> | |||
<span slot="parsingStatus" slot-scope="text">{{getSelTxt('parseStatue',text)}}</span> | |||
<span slot="creationTime" slot-scope="text">{{formatDateTime(text)}}</span> | |||
<div class="files" slot="files" slot-scope="text"> | |||
<ul> | |||
<li v-for="(file,fid) in text" :key="fid"><a :href="file.url" :title="file.name" target="_blank"><a-icon type="link" /> {{file.name}}</a></li> | |||
</ul> | |||
<div slot="createTime" slot-scope="text">{{formatDateTime(text)}}</div> | |||
<div slot="pcbFileName" slot-scope="text,record"> | |||
<a class="font2h" :href="record.pcbFilePath" target="_blank" :title="'下载文件:'+text"><a-icon type="cloud-download" style="color:#1fb1ff" /> {{text}}</a> | |||
</div> | |||
<div slot="id" slot-scope="text,record"> | |||
<router-link :to="'detail?Id='+record.orderNo">详情</router-link> | |||
</div> | |||
</a-table> | |||
</div> | |||
</template> | |||
@@ -53,15 +64,20 @@ export default { | |||
}, | |||
tableLoad: false, | |||
tableColumns:[ | |||
{title: '订单编号',dataIndex: 'orderNo',key: 'orderNo',width:'260px',scopedSlots: { customRender: 'orderNo' },}, | |||
// {title: '加急/返单',dataIndex: 'isJiaJi',key: 'isJiaJi',align:'center',width:'100px',scopedSlots: { customRender: 'isJiaJi' },}, | |||
{title: '订单编号',dataIndex: 'orderNo',key: 'orderNo',width:'160px',scopedSlots: { customRender: 'orderNo' },}, | |||
{title: '类型/来源',dataIndex: 'orderType',key: 'orderType',align:'center',width:'100px',scopedSlots: { customRender: 'orderType' },}, | |||
{title: '订单包',dataIndex: 'groupNo',key: 'groupNo',width:'200px',scopedSlots: { customRender: 'groupNo' },}, | |||
{title: '订单金额',dataIndex: 'orderMoney',key: 'orderMoney',width:'120px',scopedSlots: { customRender: 'orderMoney' },}, | |||
{title: '客户编号',dataIndex: 'memberNo',key: 'memberNo',width:'140px',scopedSlots: { customRender: 'memberNo' },}, | |||
{title: '审单员',dataIndex: 'checkAccountName',align:'center',key:'checkAccountName',width:'80px'}, | |||
{title: '跟单人员账号',dataIndex: 'followAccount',align:'center',key:'followAccount',width:'160px'}, | |||
{title: '状态',dataIndex: 'status',key: 'status',width:'100px',scopedSlots: { customRender: 'status' },}, | |||
{title: '解析状态',dataIndex: 'parsingStatus',key: 'parsingStatus',width:'100px',scopedSlots: { customRender: 'parsingStatus' },}, | |||
{title: '创建时间',dataIndex: 'creationTime',key: 'creationTime',width:'160px',scopedSlots: { customRender: 'creationTime' },}, | |||
{title: '下单时间',dataIndex: 'orderTime',key: 'orderTime',width:'160px'}, | |||
{title: '时效',dataIndex: 'deliveryTime',key: 'deliveryTime',width:'120px'}, | |||
{title: '数量',dataIndex: 'qty',key: 'qty',width:'80px'}, | |||
{title: '文件',dataIndex: 'files',key: 'files',width:'300px',scopedSlots: { customRender: 'files' },}, | |||
{title: '金额',dataIndex: 'amount',key: 'amount',scopedSlots: { customRender: 'amount' }}, | |||
{title: '解析状态',dataIndex: 'parsingStatus',align:'center',key: 'parsingStatus',width:'100px',scopedSlots: { customRender: 'parsingStatus' },}, | |||
{title: '文件',dataIndex: 'pcbFileName',key: 'pcbFileName',width:'160px',scopedSlots: { customRender: 'pcbFileName' },}, | |||
{title: '创建时间',dataIndex: 'createTime',key: 'createTime',scopedSlots: { customRender: 'createTime' },}, | |||
{title: '操作',dataIndex: 'id',align:'center',key:'id',width:'100px',scopedSlots: { customRender: 'id' },}, | |||
// {title: '文件',dataIndex: 'files',key: 'files',width:'300px',scopedSlots: { customRender: 'files' },}, | |||
], | |||
tableData:[], | |||
} | |||
@@ -118,5 +134,7 @@ export default { | |||
</script> | |||
<style scoped> | |||
i.star{background-color: #f90; color:#fff; border-radius:50%; padding:0 .3em; text-align: center; font-style: normal; display: inline-block; margin-right:.3em} | |||
i.star:before{content:'v'; display: inline-block; transform: scale(.8)} | |||
i.star.s0{background-color: #ccc} | |||
</style> |
@@ -62,13 +62,26 @@ function padLeftZero (str) { | |||
//订单类型:orderType | |||
//订单状态:orderStatus | |||
//解析状态:parseStatue | |||
//平台类别:platformType | |||
export function resSelects(type='',val=''){ | |||
// console.log(type,val) | |||
let list = []; | |||
if (type==='orderType'){ | |||
list = [ | |||
{value:'1',text:'打样'}, | |||
{value:'2',text:'批量'}, | |||
{value:'0',text:'内贸'}, | |||
{value:'1',text:'外贸'}, | |||
{value:'2',text:'精密'}, | |||
{value:'3',text:'铝基板'}, | |||
{value:'4',text:'调度中心'}, | |||
] | |||
} | |||
else if (type==='sourceType'){ | |||
list = [ | |||
{value:'0',text:'内贸'}, | |||
{value:'1',text:'外贸'}, | |||
{value:'2',text:'精密'}, | |||
{value:'3',text:'铝基板'}, | |||
{value:'4',text:'调度中心'}, | |||
] | |||
} | |||
else if (type==='orderStatus'){ | |||
@@ -88,9 +101,17 @@ export function resSelects(type='',val=''){ | |||
{value:'3',text:'解析失败'}, | |||
] | |||
} | |||
else if (type==='platformType'){ | |||
list = [ | |||
{value:'1',text:'内贸'}, | |||
{value:'2',text:'外贸'}, | |||
{value:'3',text:'调度平台'}, | |||
{value:'4',text:'精密铝基板'}, | |||
] | |||
} | |||
else return false; | |||
//返回内容 | |||
if(val!=='' && typeof val=='number'){ | |||
if(val!==''){ | |||
for(let i in list){ | |||
if (val.toString() === list[i].value) return list[i].text; | |||
} | |||
@@ -1,14 +1,9 @@ | |||
import { requestApi, METHOD } from '@/utils/request'; | |||
//新增商户 | |||
export function NewMerchants(name) { | |||
return new Promise((resolve, reject) => { | |||
requestApi('/api/app/access-manager-server/insert?description='+name, METHOD.POST).then(res => { | |||
resolve(res); | |||
}).catch(err=>{ | |||
reject(err); | |||
}) | |||
}) | |||
export function NEMerchants(params) { | |||
if (params?.id) return requestApi('/api/app/access-manager-server/update', METHOD.PUT, params) | |||
else return requestApi('/api/app/access-manager-server/insert', METHOD.POST, params) | |||
} | |||
//获取开放接口列表 | |||
@@ -118,6 +118,15 @@ const resCommon = { | |||
*/ | |||
onFulfilled(response, options) { | |||
const { message } = options; | |||
// if (response?.success&&!response.success){ | |||
// console.log(response); | |||
// } | |||
if (response.code === 40008){ | |||
message.error('认证 token 已过期,请重新登录'); | |||
Cookie.remove(xsrfHeaderName); | |||
router.push('/loginjmp'); | |||
return Promise.reject(error); | |||
} | |||
if (response.code === 200 || response.code === 204) { | |||
if (!response.isSuccess) { | |||
message.error(response.message); | |||