Commit d7a12e40 by chenwq

对账单

1 parent 81907db5
......@@ -43,3 +43,9 @@ export function getBillDetailList(data) {
data.method = "dj.api.smartcarlife.reconciliationBill.confirmContentPage"
return request(data)
}
// 系统分账-财务直接下载对账单(通过自定义字段,获取对账单字段和数据)
export function getBillTmplAdapter(data) {
data.method = 'dj.api.smartcarlife.reconciliationBill.generateUseRequestAdapter'
return request(data, "post")
}
<template>
<d2-dialog title="系统对账单" :is-visible="billVisible" class="privacyDailog" width="80%" btnOkLabel="关闭" :noCancel="true" @closeDialog="handleClose" @confirmDialog="handleClose">
<el-table :data="tableList" style="width: 100%">
<el-table-column v-for="(item, idx) in tableHeader" :key="idx" :label="item.moduleName">
<el-table-column v-for="(subItem, subIdx) in item.items" :key="subIdx" :prop="subItem.fieldCode" :label="subItem.fieldName"></el-table-column>
</el-table-column>
</el-table>
</d2-dialog>
</template>
<script>
import { deepClone } from '@/common/util'
export default {
name: 'SystemBillDialog',
props: {
billVisible: {
type: Boolean,
default: false
},
billTmplInfo: {
type: Object,
default: () => { }
}
},
data() {
return {
tmplFieldsList: [],
tableHeader: [],
tableList: [],
}
},
watch: {},
mounted() {
this.tmplFieldsList = JSON.parse(this.billTmplInfo.fieldsJson)
this.tableList = this.billTmplInfo.orders
// console.log(this.tmplFieldsList, 'this.tmplFieldsList')
this.dealTableHeader()
},
methods: {
handleClose() {
this.$emit('handleClose')
},
dealTableHeader() {
this.tableHeader = []
const moduleList = [...new Set(this.tmplFieldsList.map(item => item.moduleName))]
moduleList.forEach(item => {
let list = this.tmplFieldsList.filter(k => k.moduleName == item)
this.tableHeader.push({
moduleName: item,
items: list
})
})
console.log(this.tableHeader, 'this.tableHeader---')
console.log(this.tableList, 'this.tableList---')
},
},
};
</script>
<style lang="scss" scoped>
</style>
<!-- 下载对账单 -->
<template>
<d2-dialog title="下载对账单" :is-visible="accountVisible" class="accountDailog" width="688px" btn-ok-label="下载" @closeDialog="handleClose" @confirmDialog="handleAddConfirm">
<el-button v-if="isTmpl" slot="btn-start" type="primary">系统对账</el-button>
<el-button v-if="isTmpl" slot="btn-start" type="primary" @click="handleSystemBill">系统对账</el-button>
<el-form ref="accountForm" :model="infoForm" :rules="formRules" label-width="120px">
<el-form-item label="商户类型:" prop="merchantType">
<el-radio-group v-model="infoForm.merchantType" @change="changeType">
......@@ -79,9 +79,10 @@ import {
import dayjs from 'dayjs'
import { deepClone } from '@/common/util'
import { getMerchantPageSearch } from '@api/publicAccount'
import { getTmplList, getMetaTmpl } from '@api/accountManage'
import { getTmplList, getMetaTmpl, getBillTmplAdapter } from '@api/accountManage'
import { mapActions, mapState } from 'vuex'
import { localTmplList } from "./constant/baseData"
import { resData } from "./resData"
export default {
name: 'DownloadAccountDialog',
data() {
......@@ -342,7 +343,7 @@ export default {
const tmplName = this.localTmplList.find(item => item.type == this.infoForm.tmplType)?.name || 'trafficTmpl'
var list = JSON.parse(localStorage.getItem(tmplName))
if (list) {
this.dealFieldsJson(list)
this.dealFieldsJson(list)
} else {
getMetaTmpl({ type: this.infoForm.tmplType }).then(res => {
this.dealFieldsJson(res)
......@@ -384,35 +385,62 @@ export default {
})
},
getParams() {
var infoForm = deepClone(this.infoForm)
// console.log(infoForm)
var params = {}
var merchantList = []
var obj
infoForm.merchant.forEach(item => {
obj = {}
obj.merchantId = item
obj.merchantName = this.baseData.merchantList.find(
mer => mer.merchantId === item
).merchantName
merchantList.push(obj)
})
params.payStartDate = infoForm.payStartDate + ' 00:00:00'
params.payEndDate = infoForm.payEndDate + ' 23:59:59'
merchantList.forEach((item, index) => {
const merchantName = `merchantList[${index}].merchantName`
const merchantId = `merchantList[${index}].merchantId`
params[merchantName] = item.merchantName
params[merchantId] = item.merchantId
})
params.merchantType = infoForm.merchantType
if (infoForm.merchantType == '7') {
params.reportType = infoForm.reportType
}
params.sceneType = this.scene
// 对账状态
params.reconciliationStatus = infoForm.reconciliationStatus == 'all' ? '' : infoForm.reconciliationStatus
params.payeeType = infoForm.payeeType == 'all' ? '' : infoForm.payeeType
if (this.isTmpl) {
params.templateId = infoForm.templateId
params.fieldsJson = infoForm.fieldsJson
}
return params
},
// 系统对账
handleSystemBill() {
this.$emit('handleBill', { billTmplInfo: resData.data })
// this.$refs.accountForm.validate(valid => {
// if (valid) {
// var params = this.getParams()
// console.log('params', params)
// getBillTmplAdapter(params).then(res => {
// console.log(res, 'res')
// this.$emit('handleBill', { billTmplInfo: res })
// })
// }
// })
},
handleAddConfirm() {
this.$refs.accountForm.validate(valid => {
if (valid) {
var infoForm = deepClone(this.infoForm)
console.log(infoForm)
var params = {}
var merchantList = []
var obj
infoForm.merchant.forEach(item => {
obj = {}
obj.merchantId = item
obj.merchantName = this.baseData.merchantList.find(
mer => mer.merchantId === item
).merchantName
merchantList.push(obj)
})
params.payStartDate = infoForm.payStartDate + ' 00:00:00'
params.payEndDate = infoForm.payEndDate + ' 23:59:59'
merchantList.forEach((item, index) => {
const merchantName = `merchantList[${index}].merchantName`
const merchantId = `merchantList[${index}].merchantId`
params[merchantName] = item.merchantName
params[merchantId] = item.merchantId
})
params.merchantType = infoForm.merchantType
if (infoForm.merchantType == '7') {
params.reportType = infoForm.reportType
}
params.sceneType = this.scene
var params = this.getParams()
params.method = 'dj.api.smartcarlife.goodsOrderProfitAllocation.exportAccountStatementForAudit.async'
console.log('params', params)
const list = [
......
......@@ -456,7 +456,7 @@
</el-table>
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page.currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="page.pageSize" :total="total" layout="sizes,total,->,prev,pager,next,jumper" />
</div>
<download-account-dialog :account-visible="accountVisible" v-if="accountVisible" :scene="searchForm.sceneType" @custTmpl="handleCustTmpl" @accountClose="accountClose" />
<download-account-dialog :account-visible="accountVisible" v-if="accountVisible" :scene="searchForm.sceneType" @custTmpl="handleCustTmpl" @handleBill="handleBill" @accountClose="accountClose" />
<!-- 出库面板 -->
<warehouse-detail v-if="warehouseVisible" :warehouse-visible="warehouseVisible" :order-info-id="orderId" @handleDrawerClose="handleDrawerClose" />
<d2-dialog :title="'上传文件'" :is-visible="fileVisible" @closeDialog="handleImport" @confirmDialog="handleConfirmImport">
......@@ -476,7 +476,8 @@
</el-form>
</slot>
</d2-dialog>
<tmpl-drawer v-if="tmplDrawerVisible" :tmplDrawerVisible="tmplDrawerVisible" :type="type" :tmplSelectList="tmplSelectList" @handleConfirm="handleCustConfirm" @handleClose="handleCustVisible"></tmpl-drawer>
<tmpl-drawer v-if="tmplDrawerVisible" :tmplDrawerVisible="tmplDrawerVisible" :type="tmplInfo.type" :tmplSelectList="tmplInfo.tmplSelectList" @handleConfirm="handleCustConfirm" @handleClose="handleCustVisible"></tmpl-drawer>
<system-bill-dialog v-if="billVisible" :billVisible="billVisible" :billTmplInfo="billTmplInfo" @handleClose="handleBillVisible"></system-bill-dialog>
</div>
</template>
......@@ -502,6 +503,7 @@ import {
import downloadAccountDialog from "./downloadAccountDialog"
import warehouseDetail from "./warehouseDetail"
import tmplDrawer from "./components/TmplDrawer"
import SystemBillDialog from "./components/SystemBillDialog"
import * as echarts from "echarts"
import { returnFloat, deepClone } from "@/common/util"
export default {
......@@ -509,7 +511,8 @@ export default {
components: {
downloadAccountDialog,
warehouseDetail,
tmplDrawer
tmplDrawer,
SystemBillDialog
},
data() {
......@@ -751,8 +754,12 @@ export default {
fileForm: {},
fileVisible: false,
tmplDrawerVisible: false,
type: '',
tmplSelectList: []
tmplInfo: {
type: '',
tmplSelectList: [],
},
billVisible: false,
billTmplInfo: []
}
},
......@@ -1296,8 +1303,8 @@ export default {
// 自定义模版字段
handleCustTmpl(val) {
console.log(val, 'val---')
this.type = val.tmplType
this.tmplSelectList = val.tmplSelectList || []
this.tmplInfo.type = val.tmplType
this.tmplInfo.tmplSelectList = val.tmplSelectList || []
this.handleCustVisible()
},
......@@ -1306,6 +1313,15 @@ export default {
this.$EventBus.$emit('changeFieldIds', { fieldIds: obj.fieldIds })
},
handleBillVisible() {
this.billVisible = !this.billVisible
},
handleBill(obj) {
this.billTmplInfo = deepClone(obj.billTmplInfo)
this.handleBillVisible()
},
exWarehouse(row) {
this.orderId = row.orderCode
this.warehouseVisible = true
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!