Commit 7f25ee9f by 胡悦

添加对账管理

1 parent 37a547c7
...@@ -6,6 +6,7 @@ VUE_APP_TITLE=金融分期管理平台 ...@@ -6,6 +6,7 @@ VUE_APP_TITLE=金融分期管理平台
# 网络请求公用地址 http://tfims.glsx.com.cn/router # 网络请求公用地址 http://tfims.glsx.com.cn/router
#VUE_APP_API=http://tfims.test.glsx.com.cn/router #VUE_APP_API=http://tfims.test.glsx.com.cn/router
VUE_APP_API=http://llg.test.glsx.com.cn/admin/ VUE_APP_API=http://llg.test.glsx.com.cn/admin/
#VUE_APP_API=http://llg.glsx.com.cn/admin/
# 仓库地址 # 仓库地址
VUE_APP_REPO=https://oss-config.test.glsx.com.cn/mock/5d638b3b6fbe9a0ac59d872e/tFIMS VUE_APP_REPO=https://oss-config.test.glsx.com.cn/mock/5d638b3b6fbe9a0ac59d872e/tFIMS
......
import request from './request'
import RequestMethods from './request.methods'
const path = 'reconcile/'
// 对账列表
function reconcileList(data) {
data.method = `${path}search`
return request(data)
}
// 导出对账列表
function exportList (data) {
data.method = `${path}export`
return request(data, RequestMethods.GET, 'arraybuffer')
}
// 导入对账数据
function importData() {
data.method = `${path}import`
return request(data)
}
export {
reconcileList,
exportList,
importData
}
\ No newline at end of file \ No newline at end of file
...@@ -45,7 +45,7 @@ function errorLog(error) { ...@@ -45,7 +45,7 @@ function errorLog(error) {
// 创建一个 axios 实例 // 创建一个 axios 实例
const service = axios.create({ const service = axios.create({
baseURL: process.env.VUE_APP_API, baseURL: process.env.VUE_APP_API,
timeout: 5000, // 请求超时时间 timeout: 60000, // 请求超时时间
transformRequest: [function(data) { transformRequest: [function(data) {
return Qs.stringify(data) return Qs.stringify(data)
}] }]
......
...@@ -21,7 +21,7 @@ const frameIn = [{ ...@@ -21,7 +21,7 @@ const frameIn = [{
export const home = { export const home = {
path: '/index', path: '/index',
name: 'index', name: 'index',
icon: 'document', icon: 's-shop',
meta: { meta: {
title: '门店管理', title: '门店管理',
authId: '101', authId: '101',
...@@ -127,41 +127,28 @@ export const resources = { ...@@ -127,41 +127,28 @@ export const resources = {
}, },
component: _import('table2') component: _import('table2')
}, },
// '103': { '103': {
// path: '/storeManagement',
// icon: 'document',
// name: 'storeManagement',
// meta: {
// title: '门店管理',
// authId: '103',
// parentId: '0'
// },
// auth: [{
// authId: '1030001',
// parentId: '103',
// label: '删除',
// handle: 'handleDelete'
// },
// {
// authId: '1030002',
// parentId: '103',
// label: '编辑',
// handle: 'handleEdit'
// }
// ],
// component: _import('storeManagement')
// },
'104': {
path: '/orderManagement', path: '/orderManagement',
icon: 'document', icon: 'document',
name: 'orderManagement', name: 'orderManagement',
meta: { meta: {
title: '订单管理', title: '订单管理',
authId: '104', authId: '103',
parentId: '0' parentId: '0'
}, },
component: _import('orderManagement') component: _import('orderManagement')
}, },
'104': {
path: '/reconciliateManagement',
icon: 'reading',
name: 'reconciliateManagement',
meta: {
title: '对账管理',
authId: '104',
parentId: '0'
},
component: _import('reconciliateManagement')
},
'107': { '107': {
path: '/users', path: '/users',
icon: 'user', icon: 'user',
......
...@@ -22,11 +22,8 @@ export default { ...@@ -22,11 +22,8 @@ export default {
'authId': '101', 'authId': '101',
'parentId': '0' 'parentId': '0'
}, { }, {
'authId': '1010001', 'authId': '103',
'parentId': '101' 'parentId': '0'
}, {
'authId': '1010002',
'parentId': '101'
}, { }, {
'authId': '104', 'authId': '104',
'parentId': '0' 'parentId': '0'
......
<template>
<d2-container>
<el-form :inline="true" label-width="140px">
<el-form-item label="门店名称:">
<el-input v-model="searchForm.shopName" placeholder="请输入" clearable></el-input>
</el-form-item>
<el-form-item label="选择日期:">
<el-date-picker
v-model="dateValue"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
@click="searchTable"
>查询</el-button>
<el-button @click="handleExport">导出Excel</el-button>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click='handleImportExcel'
>导入对账信息</el-button>
</el-form-item>
</el-form>
<d2-table
ref="reconciliateTable"
:searchForm="searchForm"
:tableParams="tableParams"
:getListApi="queryListApi">
</d2-table>
<el-dialog
title="导入对账信息"
width='40%'
:before-close="handleImportExcel"
:visible.sync='importExcelVisible'>
<div class='file-title'>
请选择要导入的Excel文件
<!-- <el-link
type="primary"
class='file-down'
@click='downLoadStoreDome'
:underline='false'
>下载导入Excel模版</el-link> -->
</div>
<el-upload
ref="upload"
:action="uploadAction"
:on-preview="handlePreview"
:on-remove="handleRemove"
:on-success='onSuccess'
:auto-upload="false"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
with-credentials
multiple
limit='1'
>
<el-button
slot="trigger"
size="small"
type="primary"
>选择EXCEL文件</el-button>
</el-upload>
<span
slot="footer"
class="dialog-footer"
>
<el-button
size="small"
type="primary"
@click="submitUpload"
>确定导入</el-button>
<el-button @click="handleImportExcel">取消</el-button>
</span>
</el-dialog>
</d2-container>
</template>
<script>
import * as api from '@api/reconcile'
export default {
name: 'reconciliateManagement',
data() {
return {
searchForm: {},
dateValue: '',
tableParams: {
listName: 'list',
tableColumns: [
{
label: '门店编号',
prop: 'merId',
width: '80'
},
{
label: '门店名称',
prop: 'belongShop'
},
{
label: '客户名称',
prop: 'consumerName'
},
{
label: '订单金额(元)',
prop: 'tradeAmount'
},
{
label: '结算金额(元)',
prop: 'settleAmount'
},
{
label: '费率差额(元)',
prop: 'interestDifferential'
},
{
label: '订单时间',
prop: 'payDate'
}
]
},
queryListApi: api.reconcileList,
importExcelVisible: false,
uploadAction: `${process.env.VUE_APP_API}reconcile/import`,
}
},
methods: {
// 搜索
searchTable() {
this.handleDate()
this.$refs.reconciliateTable.refreshTable()
},
handleDate() {
if (this.dateValue) {
this.searchForm.sDate = this.dateValue[0]
this.searchForm.eDate = this.dateValue[1]
} else {
if (this.searchForm.sDate) delete this.searchForm.sDate
if (this.searchForm.eDate) delete this.searchForm.eDate
}
},
// 导出
handleExport () {
this.handleDate()
api.exportList(this.searchForm).then(res => {
let a = document.createElement('a')
let blob = new Blob([res], { type: "application/vnd.ms-excel" })
let objectUrl = URL.createObjectURL(blob)
a.setAttribute("href", objectUrl)
a.setAttribute("download", '对账信息.xlsx')
a.click()
})
},
handleImportExcel() {
this.importExcelVisible = !this.importExcelVisible
},
onSuccess(res) {
this.notice.warningTips(res.data.tips)
this.$refs.upload.clearFiles()
this.$refs.reconciliateTable.refreshTable()
},
submitUpload () {
this.$refs.upload.submit()
this.handleImportExcel()
},
},
}
</script>
\ No newline at end of file \ No newline at end of file
...@@ -107,12 +107,24 @@ ...@@ -107,12 +107,24 @@
width="35%" width="35%"
:before-close="handleEdit" :before-close="handleEdit"
> >
<el-dialog
width="30%"
title="修改门店信息"
:visible.sync="innerVisible"
append-to-body>
是否要修改
<span class="tips-content">{{storeCopyForm.name}}</span>
门店,修改关键信息将影响资金清分!
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSave">确定</el-button>
<el-button @click="innerVisible = false">取 消</el-button>
</div>
</el-dialog>
<el-form <el-form
:model="storeForm" :model="storeForm"
:rules="storeFormRules" :rules="storeFormRules"
ref="storeRuleForm" ref="storeRuleForm"
label-width="140px" label-width="140px">
>
<el-form-item <el-form-item
label="门店名称:" label="门店名称:"
prop="name" prop="name"
...@@ -209,8 +221,7 @@ ...@@ -209,8 +221,7 @@
title="批量导入门店信息" title="批量导入门店信息"
width='40%' width='40%'
:before-close="handleImportExcel" :before-close="handleImportExcel"
:visible.sync='importExcelVisible' :visible.sync='importExcelVisible'>
>
<div class='file-title'> <div class='file-title'>
请选择要导入的Excel文件 请选择要导入的Excel文件
<el-link <el-link
...@@ -227,6 +238,7 @@ ...@@ -227,6 +238,7 @@
:on-remove="handleRemove" :on-remove="handleRemove"
:on-success='onSuccess' :on-success='onSuccess'
:auto-upload="false" :auto-upload="false"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
with-credentials with-credentials
multiple multiple
limit='1' limit='1'
...@@ -239,10 +251,10 @@ ...@@ -239,10 +251,10 @@
</el-upload> </el-upload>
<div <div
class='file-title tips-content' class='file-title tips-content'
v-if='fileTips' v-if='fileTips'>
>
{{fileTips}} {{fileTips}}
<el-link <el-link
v-if="failFile"
type="warning" type="warning"
class='file-down' class='file-down'
:href='failFile' :href='failFile'
...@@ -301,6 +313,7 @@ ...@@ -301,6 +313,7 @@
:on-remove="handleRemove" :on-remove="handleRemove"
:on-success='onMerIdSuccess' :on-success='onMerIdSuccess'
:auto-upload="false" :auto-upload="false"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
with-credentials with-credentials
multiple multiple
limit='1' limit='1'
...@@ -317,6 +330,7 @@ ...@@ -317,6 +330,7 @@
> >
{{merIdTips}} {{merIdTips}}
<el-link <el-link
v-if="merIdFailFile"
type="warning" type="warning"
class='file-down' class='file-down'
:href='merIdFailFile' :href='merIdFailFile'
...@@ -451,7 +465,10 @@ export default { ...@@ -451,7 +465,10 @@ export default {
queryListApi: api.storeList, queryListApi: api.storeList,
storeVisible: false, storeVisible: false,
importExcelVisible: false, importExcelVisible: false,
// 编辑二次确认
innerVisible: false,
storeForm: {}, storeForm: {},
storeCopyForm: {},
storeFormRules: { storeFormRules: {
name: [{ required: true, message: '请输入门店名称', trigger: 'blur' }], name: [{ required: true, message: '请输入门店名称', trigger: 'blur' }],
bank: [{ required: true, message: '请输入银行名称', trigger: 'blur' }], bank: [{ required: true, message: '请输入银行名称', trigger: 'blur' }],
...@@ -500,7 +517,6 @@ export default { ...@@ -500,7 +517,6 @@ export default {
let id = row.id let id = row.id
if (!this.storeVisible) return if (!this.storeVisible) return
api.getStoreDetails({ id: id }, id).then(res => { api.getStoreDetails({ id: id }, id).then(res => {
console.log(res)
let obj = { let obj = {
id: id, id: id,
name: res.name, name: res.name,
...@@ -513,17 +529,38 @@ export default { ...@@ -513,17 +529,38 @@ export default {
merId: res.merId, merId: res.merId,
} }
this.storeForm = obj this.storeForm = obj
this.storeCopyForm = JSON.parse(JSON.stringify(obj))
}) })
}, },
handleSubmit () { handleSubmit () {
this.$refs.storeRuleForm.validate(valid => { this.$refs.storeRuleForm.validate(valid => {
this.storeForm.merId = this.storeForm.merId ? Number(this.storeForm.merId) : ''
if (valid) { if (valid) {
this.checkForm()
if (!this.innerVisible){
this.handleSave()
}
}
})
},
// 是否有修改
checkForm() {
for(let key in this.storeForm) {
if (key != 'merId') {
if (this.storeForm[key] != this.storeCopyForm[key]) {
this.innerVisible = !this.innerVisible
}
}
}
},
// 保存的方法
handleSave() {
this.storeForm.merId = this.storeForm.merId ? Number(this.storeForm.merId) : ''
axios.post(`${process.env.VUE_APP_API}shop/edit`, this.storeForm).then(res => { axios.post(`${process.env.VUE_APP_API}shop/edit`, this.storeForm).then(res => {
this.$refs.storeTable.refreshTable() this.$refs.storeTable.refreshTable()
this.storeVisible = false this.storeVisible = false
}) if (this.innerVisible) this.innerVisible = !this.innerVisible
}
}) })
}, },
handleExport () { handleExport () {
...@@ -565,13 +602,13 @@ export default { ...@@ -565,13 +602,13 @@ export default {
return this.$confirm(`确定移除 ${file.name}?`); return this.$confirm(`确定移除 ${file.name}?`);
}, },
onSuccess (res) { onSuccess (res) {
console.log(res)
this.fileTips = res.data.tips this.fileTips = res.data.tips
this.batchId = res.data.batchId this.batchId = res.data.batchId
if (res.data.failFile) { if (res.data.failFile) {
let failFile = `${res.data.failFile.split('/')[1]}/${res.data.failFile.split('/')[2]}` let failFile = `${res.data.failFile.split('/')[1]}/${res.data.failFile.split('/')[2]}`
this.failFile = `${process.env.VUE_APP_API}${failFile}` this.failFile = `${process.env.VUE_APP_API}${failFile}`
} }
}, },
submitUpload () { submitUpload () {
this.$refs.upload.submit() this.$refs.upload.submit()
......
...@@ -121,8 +121,8 @@ export default { ...@@ -121,8 +121,8 @@ export default {
time: dayjs().format('HH:mm:ss'), time: dayjs().format('HH:mm:ss'),
// 表单 // 表单
formLogin: { formLogin: {
username: '', username: 'admin',
password: '' password: '123456'
// loginType: LOGIN_TYPE // loginType: LOGIN_TYPE
}, },
// 表单校验 // 表单校验
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!