Commit f721cce7 by chenwq

对账单,生成/查看应收应付单,应付转账

1 parent 01c0eafd
......@@ -120,8 +120,38 @@ export function tmplCheckField(data) {
return request(data, "post")
}
// 生成应付单
export function createPaymentBill(data) {
data.method = 'dj.api.smartcarlife.reconciliationBill.jd.payment.bill'
return request(data, "post")
}
// 查询应付转账信息
export function getBillTransferInfo(data) {
data.method = 'dj.api.smartcarlife.reconciliationBill.transfer.out.info'
return request(data, "post")
}
// 应付转账
export function editBillTransferOut(data) {
data.method = 'dj.api.smartcarlife.reconciliationBill.transfer.out'
return request(data, "post")
}
// 应付转账转账记录
export function getTransferRecord(data) {
data.method = 'dj.api.smartcarlife.reconciliationBill.get.transfer.out.record'
return request(data, "post")
}
// 应收应付列表
export function getJdBillList(data) {
data.method = 'dj.smartcarlife.api.jdbill.page'
return request(data)
}
// 应收应付单-详情分页列表查询
export function getJdDetailPage(data) {
data.method = 'dj.smartcarlife.api.jdbill.detail.page'
return request(data)
}
......@@ -1329,3 +1329,10 @@ export const transferStatusOpt = [
{ confId: 1, confValue: "推送付款单" },
{ confId: 2, confValue: "重推付款单" }
]
// 应收应付 - 推送金蝶状态
export const pushStatusOpt = [
{ confId: 0, confValue: "未推送" },
{ confId: 1, confValue: "成功" },
{ confId: 2, confValue: "失败" }
]
......@@ -490,13 +490,37 @@ export const routerName = {
authId: "9051108",
parentId: "90511",
label: "生成应收单",
handle: ""
handle: "handleCreateReceiveBill"
},
{
authId: "9051109",
parentId: "90511",
label: "生成应付单",
handle: ""
handle: "handleCreatePayBill"
},
{
authId: "9051110",
parentId: "90511",
label: "查看应收单",
handle: "handleDetailBill"
},
{
authId: "9051111",
parentId: "90511",
label: "查看应付单",
handle: "handleDetailBill"
},
{
authId: "9051112",
parentId: "90511",
label: "应付转账",
handle: "handleEditTransfer"
},
{
authId: "9051113",
parentId: "90511",
label: "转账记录",
handle: "handleTransferRecord"
}
],
component: _import("financeManage/accountStateManage/index")
......@@ -573,8 +597,16 @@ export const routerName = {
{
authId: "9051301",
parentId: "90513",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9051302",
parentId: "90513",
label: "详情",
handle: ""
handle: "handleEdit"
}
],
component: _import("financeManage/receivePayManage/index")
......
<!-- 对账单管理 - 列表 -->
<template>
<div>
<d2-container>
<d2-container v-loading="loading">
<div class="header" slot="header" style="padding: 10px 20px;">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="labelWidth" :form-data="showFormData">
</d2-search>
......@@ -49,6 +49,30 @@
<span style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9051107']" />
</span>
<!-- 生成应收单 -->
<span style="margin-right: 10px;" v-if="(!scope.scope.receivableBillIds) && scope.scope.reconciliationBillStatus == '3'">
<auth-button :data="scope.scope" :show-btn-ids="['9051108']" />
</span>
<!-- 生成应付单 -->
<span style="margin-right: 10px;" v-if="(!scope.scope.payableBillIds) && scope.scope.reconciliationBillStatus == '3'">
<auth-button :data="scope.scope" :show-btn-ids="['9051109']" />
</span>
<!-- 查看应收单 -->
<span style="margin-right: 10px;" v-if="scope.scope.receivableBillIds && scope.scope.reconciliationBillStatus == '3'">
<auth-button :data="scope.scope" :show-btn-ids="['9051110']" />
</span>
<!-- 查看应付单 -->
<span style="margin-right: 10px;" v-if="scope.scope.payableBillIds && scope.scope.reconciliationBillStatus == '3'">
<auth-button :data="scope.scope" :show-btn-ids="['9051111']" />
</span>
<!-- 应付转账 -->
<span style="margin-right: 10px;" v-if="[0, 1].includes(scope.scope.transferStatus) && scope.scope.reconciliationBillStatus == '3'">
<auth-button :data="scope.scope" :show-btn-ids="['9051112']" />
</span>
<!-- 转账记录 -->
<span style="margin-right: 10px;" v-if="[1, 2].includes(scope.scope.transferStatus) && scope.scope.reconciliationBillStatus == '3'">
<auth-button :data="scope.scope" :show-btn-ids="['9051113']" />
</span>
</div>
</d2-table>
</div>
......@@ -56,31 +80,49 @@
<ChangeDetailDialog v-if="detailVisible" :detailVisible="detailVisible" :info="info" @dialogClose="handleChangeDetail"></ChangeDetailDialog>
<system-bill-dialog v-if="billVisible" :billVisible="billVisible" :billTmplInfo="billTmplInfo" @handleClose="handleBillVisible" @handleConfirm="handleBillDialogConfirm"></system-bill-dialog>
<system-bill-detail-dialog v-if="billDetailVisible" :billVisible="billDetailVisible" :billTmplInfo="billTmplInfo" @handleClose="handleChangeDetailVisible"></system-bill-detail-dialog>
<select-mer-dialog v-if="merchantVisible" :merchantVisible="merchantVisible" :info="merchantInfo" @handleConfirm="handleMerConfirm" @dialogClose="handleMerVisible"></select-mer-dialog>
<edit-transfer v-if="editTransferVisible" :editTransferVisible="editTransferVisible" :info="merchantInfo" @handleConfirm="handleEditTransferConfirm" @dialogClose="handleEditTransferVisible"></edit-transfer>
<record-transfer v-if="recordTransferVisible" :recordTransferVisible="recordTransferVisible" :info="merchantInfo" @handleConfirm="handleTransferRecordConfirm" @dialogClose="handleTransferRecordVisible"></record-transfer>
<edit-pay-receive v-if="payReceiveVisible" :payReceiveVisible="payReceiveVisible" :info="info" @handleConfirm="handleEditConfirm" @dialogClose="handleEditVisible"></edit-pay-receive>
</div>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { getBillList, editBill, billDetailPage, billConfirm, billCancel, billConfirmChange, billCancelChange } from '@api/accountManage'
import { getBillList, billDetailPage, billConfirm, billCancel, billConfirmChange, billCancelChange, getBillTransferInfo, createPaymentBill } from '@api/accountManage'
import { tmplTypeList, billStatusList, sceneTypeList } from "../constant/baseData"
import ChangeDetailDialog from '../components/ChangeDetailDialog'
import SystemBillDialog from "../components/SystemBillDialog"
import SystemBillDetailDialog from "../components/SystemBillDetailDialog"
import SelectMerDialog from "../components/SelectMerDialog"
import EditTransfer from "../components/EditTransfer"
import RecordTransfer from "../components/RecordTransfer"
import EditPayReceive from "../components/EditPayReceive"
export default {
name: 'accountStateManage',
components: {
ChangeDetailDialog,
SystemBillDialog,
SystemBillDetailDialog
SystemBillDetailDialog,
SelectMerDialog,
EditTransfer,
RecordTransfer,
EditPayReceive
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
labelWidth: '110px',
loading: false,
detailVisible: false,
billDetailVisible: false,
info: '',
info: {},
merchantVisible: false,
merchantInfo: {},
editTransferVisible: false,
payReceiveVisible: false,
recordTransferVisible: false,
searchForm: {
shopMerchantName: '',
sceneType: '',
......@@ -88,7 +130,8 @@ export default {
accountDate: [],
createdDate: [],
reconciliationBillStatus: '',
billType: ''
billType: '',
oaSpNo: ''
},
searchFormSearch: {},
showFormData: [{
......@@ -105,13 +148,13 @@ export default {
label: '对账周期',
name: 'accountDate',
type: 'datePicker',
isClear: true,
isClear: true
// pickerOptions: 'rangePickerOptions'
}, {
label: '创建时间',
name: 'createdDate',
type: 'datePicker',
isClear: true,
isClear: true
// pickerOptions: 'rangePickerOptions'
}, {
label: '状态',
......@@ -137,12 +180,19 @@ export default {
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'sceneTypeList'
}, {
label: '企微审批编号',
name: 'oaSpNo',
type: 'input',
maxlength: '50'
}],
getListApi: getBillList,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableOption: {
width: '150px'
},
tableColumns: [{
label: '流量方',
prop: 'shopMerchantName'
......@@ -181,6 +231,9 @@ export default {
return Util.dateFormate(cellValue.createdDate, 'YYYY-MM-DD HH:mm:ss')
}
}, {
label: '企微审批编号',
prop: 'oaSpNo'
}, {
label: '状态',
prop: 'reconciliationBillStatus',
formatter: (cellValue) => {
......@@ -215,7 +268,7 @@ export default {
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
}),
})
},
methods: {
...mapActions('d2admin/user', ['actionSetDownloadList']),
......@@ -224,11 +277,11 @@ export default {
const dateFormatList = [{
attr: 'accountDate',
startAttr: 'startDateStr',
endAttr: 'endDateStr',
endAttr: 'endDateStr'
}, {
attr: 'createdDate',
startAttr: 'createdDateFrom',
endAttr: 'createdDateTo',
endAttr: 'createdDateTo'
}]
dateFormatList.forEach(item => {
if (params[item.attr] && params[item.attr].length) {
......@@ -283,7 +336,8 @@ export default {
accountDate: [],
createdDate: [],
reconciliationBillStatus: '',
billType: ''
billType: '',
oaSpNo: ''
}
this.$refs.recordTable.refreshTable(false, true)
},
......@@ -402,6 +456,101 @@ export default {
this.billTmplInfo = deepClone(res)
this.handleChangeDetailVisible()
})
},
// 生成应收
handleCreateReceiveBill(row) {
this.createPaymentBill(row)
},
// 生成应付
handleCreatePayBill(row) {
this.info = row
// 应付单且流量方对账单
if (row.billType == 1) {
this.handleEditVisible()
} else {
this.createPaymentBill(row)
}
},
handleEditVisible() {
this.payReceiveVisible = !this.payReceiveVisible
},
handleEditConfirm() {
this.handleEditVisible()
this.$refs.recordTable.refreshTable(false, true)
},
createPaymentBill(row) {
const params = {
id: row.id,
splitExpense: false
}
this.loading = true
createPaymentBill(params).then(() => {
this.$message.success("操作成功")
this.$refs.recordTable.refreshTable(false, true)
}).finally(() => {
this.loading = false
})
},
// 查看应收/应付
handleDetailBill(row) {
console.log(row)
},
// 应付转账
handleEditTransfer(row) {
console.log(row)
this.getBillTransferInfo(row)
},
getBillTransferInfo(row) {
const params = { id: row.id }
getBillTransferInfo(params).then(res => {
console.log(res)
this.merchantInfo = res
this.handleMerVisible()
})
},
handleMerConfirm(obj) {
this.merchantInfo.platformMerchantId = obj.platformMerchantId
this.merchantInfo.platformMerchantName = obj.platformMerchantName
this.handleMerVisible()
this.handleEditTransferVisible()
},
handleMerVisible() {
this.merchantVisible = !this.merchantVisible
},
// 应付转账第二步
handleEditTransferVisible() {
this.editTransferVisible = !this.editTransferVisible
},
handleEditTransferConfirm() {
this.handleEditTransferVisible()
this.$refs.recordTable.refreshTable(false, true)
},
// 转账记录
handleTransferRecord(row) {
console.log(row)
this.merchantInfo = row
this.handleTransferRecordVisible()
},
// 应付转账第二步
handleTransferRecordVisible() {
this.recordTransferVisible = !this.recordTransferVisible
},
handleTransferRecordConfirm() {
this.handleTransferRecordVisible()
}
}
}
......
<template>
<d2-dialog title="提示" :is-visible="payReceiveVisible" class="privacyDailog" width="500px" @closeDialog="handleClose" @confirmDialog="handleConfirm">
<glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="250px" default-width="314px" :isBlock="isBlock" :form-ref="editChildRef" :form-obj="editData" :form-data="editFormData" :form-rules="formRules">
</glsx-combi-form>
</d2-dialog>
</template>
<script>
import { createPaymentBill } from '@api/accountManage'
import { Util, deepClone } from '@/common/util'
export default {
name: 'EditPayReceive',
data() {
return {
isBlock: true,
editChildRef: 'editChildRef',
formRules: {
splitExpense: [{ required: true, message: "请选择拆分成本与流量费" }]
},
editData: {
splitExpense: ''
},
editFormData: [
{
label: "请选择拆分成本与流量费",
name: "splitExpense",
type: "radio",
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'optList'
}
],
baseData: {
optList: [{
confId: true,
confLabel: '拆分'
}, {
confId: false,
confLabel: '不拆分'
}]
}
}
},
props: {
payReceiveVisible: {
type: Boolean,
default: false
},
info: {
type: Object,
default: () => ({})
}
},
mounted() {
this.editFormData[0].optionList = deepClone(this.baseData.optList)
},
methods: {
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => {
if (valid) {
const params = {
id: this.info.id,
splitExpense: this.editData.splitExpense
}
this.loading = true
createPaymentBill(params).then(() => {
this.$message.success("操作成功")
this.$emit('handleConfirm')
}).finally(() => {
this.loading = false
})
}
})
},
handleClose() {
this.$emit('dialogClose')
}
}
}
</script>
<style>
.privacyDailog .el-dialog {
min-width: 700px;
}
</style>
<template>
<d2-dialog title="应付转账" :is-visible="editTransferVisible" class="privacyDailog" width="800px" @closeDialog="handleClose" @confirmDialog="handleConfirm">
<glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="250px" default-width="314px" :isBlock="isBlock" :form-ref="editChildRef" :form-obj="editData" :form-data="editFormData" :form-rules="formRules">
</glsx-combi-form>
<div>* 说明:发起应付转账后,请到企微“SaaS+商务付款”流程中查看审批状态。</div>
</d2-dialog>
</template>
<script>
import { editBillTransferOut } from '@api/accountManage'
import { deepClone } from '@/common/util'
export default {
name: 'EditTransfer',
data() {
return {
isBlock: true,
editChildRef: 'editChildRef',
formRules: {
amount: [{ required: true, message: "请输入转账金额", trigger: 'change' }],
fileUrlList: [{ required: true, message: "请选择转账凭证", trigger: 'change' }],
remark: [{ required: true, message: "请输入备注", trigger: 'change' }]
},
editData: {
platformMerchantId: '',
platformMerchantName: ''
},
editFormData: [
{
label: "所属平台方",
name: "platformMerchantName",
type: "showTxt"
},
{
label: "对账服务商",
name: "billMerchantName",
type: "showTxt"
},
{
label: "转账金额",
name: "amount",
type: "input"
},
{
label: "转账凭证",
name: "fileUrlList",
addHtml: "file"
},
{
label: "备注",
name: "remark",
type: "input",
maxlength: 50
}
],
baseData: {
}
}
},
props: {
editTransferVisible: {
type: Boolean,
default: false
},
info: {
type: Object,
default: () => ({})
}
},
mounted() {
this.editData = deepClone(this.info)
this.editData.fileUrlList = []
this.editFormData[this.findIdx('billMerchantName')].label = this.editData.billType == '1' ? '对账流量方' : '对账服务商'
console.log('editData', this.editData)
},
methods: {
findIdx(attr) {
return this.editFormData.findIndex(item => item.name === attr)
},
handleConfirm() {
this.editData.fileUrlList = ['https://pics5.baidu.com/feed/03087bf40ad162d961034fabc0ed00e38b13cd5e.jpeg@f_auto?token=0aca42cd8d1f4381c9518431db657a5b']
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => {
if (valid) {
editBillTransferOut(deepClone(this.editData)).then(() => {
this.$message.success("操作成功")
this.$emit('handleConfirm')
}).finally(() => {
this.loading = false
})
}
})
},
handleClose() {
this.$emit('dialogClose')
}
}
}
</script>
<style>
.privacyDailog .el-dialog {
min-width: 700px;
}
</style>
<template>
<d2-dialog title="转账记录" :is-visible="recordTransferVisible" class="privacyDailog" width="800px" btnOkLabel="关闭" noCancel="true" @closeDialog="handleClose" @confirmDialog="handleConfirm">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="(item, index) in tabPaneList" :label="item.label" :name="item.name" :key="index">
</el-tab-pane>
</el-tabs>
<glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="250px" default-width="314px" :isBlock="isBlock" :form-ref="editChildRef" :form-obj="editData" :form-data="editFormData" :form-rules="formRules">
</glsx-combi-form>
<div>操作日志</div>
<d2-table ref="logTable" :table-data="logList" :table-params="tableParams" :hasNum="false" :hasPage="false" :array-span-method="arraySpanMethod" :selectable-fn="selectableFn">
</d2-table>
</d2-dialog>
</template>
<script>
import { getTransferRecord } from '@api/accountManage'
import { Util, deepClone } from '@/common/util'
export default {
name: 'RecordTransfer',
data() {
return {
activeName: "0",
tabPaneList: [],
transferList: [],
isBlock: true,
editChildRef: 'editChildRef',
formRules: {
amount: [{ required: true, message: "请输入转账金额", trigger: 'change' }],
fileUrlList: [{ required: true, message: "请选择转账凭证", trigger: 'change' }],
remark: [{ required: true, message: "请输入备注", trigger: 'change' }]
},
editData: {
platformMerchantId: '',
platformMerchantName: ''
},
editFormData: [
{
label: "所属平台方",
name: "platformMerchantName",
type: "showTxt"
},
{
label: "对账服务商",
name: "billMerchantName",
type: "showTxt"
},
{
label: "转账金额",
name: "amount",
type: "showTxt"
},
{
label: "转账凭证",
name: "fileUrlList",
addHtml: "file"
},
{
label: "备注",
name: "remark",
type: "showTxt"
}
],
logList: [],
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableOption: false,
tableColumns: [
{
label: "操作项",
prop: "oprType",
formatter: (cellValue) => {
return { 1: '新增应付转账', 2: '推送企微OA' }[cellValue.oprType] || ''
}
},
{
label: "操作时间",
prop: "createdDate"
},
{
label: "操作结果",
prop: "remark"
},
{
label: "操作人",
prop: "createdBy"
}
]
}
}
},
props: {
recordTransferVisible: {
type: Boolean,
default: false
},
info: {
type: Object,
default: () => ({})
}
},
mounted() {
this.editData = deepClone(this.info)
this.getTransferRecord()
},
methods: {
findIdx(attr) {
return this.editFormData.findIndex(item => item.name === attr)
},
getTransferRecord() {
getTransferRecord({ id: this.info.id }).then(res => {
this.transferList = res.transferList || []
this.editData = deepClone(this.transferList[0]) || {}
this.logList = this.editData.logList || []
this.dealTabList()
})
},
dealTabList() {
this.transferList.forEach((item, idx) => {
this.tabPaneList.push({
label: '转账记录' + (idx + 1),
name: idx + ''
})
})
},
handleClick(tab, event) {
this.editData = deepClone(this.transferList[+tab.name]) || {}
this.logList = this.editData.logList || []
},
handleConfirm() {
this.$emit('dialogClose')
},
handleClose() {
this.$emit('dialogClose')
}
}
}
</script>
<style>
.privacyDailog .el-dialog {
min-width: 700px;
}
</style>
<template>
<d2-dialog title="选择平台方" :is-visible="merchantVisible" class="privacyDailog" width="1080px" @closeDialog="handleClose" @confirmDialog="handleConfirm">
<glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="250px" default-width="314px" :isBlock="isBlock" :form-ref="editChildRef" :form-obj="editData" :form-data="editFormData" :form-rules="formRules">
</glsx-combi-form>
</d2-dialog>
</template>
<script>
import { deepClone } from '@/common/util'
export default {
name: 'SelectMerDialog',
data() {
return {
isBlock: true,
editChildRef: 'editChildRef',
formRules: {
platformMerchantId: [{ required: true, message: "请选择平台方" }]
},
editData: {
platformMerchantId: '',
platformMerchantName: ''
},
editFormData: [
{
label: "平台方",
name: "platformMerchantId",
type: "select",
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'merchantList',
changeAttr: (val, targerItem) => {
this.editData.platformMerchantName = targerItem.optionList.find(item => item.merchantId === val).merchantName
}
}
],
baseData: {
merchantList: []
}
}
},
props: {
merchantVisible: {
type: Boolean,
default: false
},
info: {
type: Object,
default: () => ({})
}
},
mounted() {
this.editFormData[0].optionList = deepClone(this.info.platformMerchantList || [])
},
methods: {
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => {
if (valid) {
this.$emit('handleConfirm', {
platformMerchantId: this.editData.platformMerchantId,
platformMerchantName: this.editData.platformMerchantName
})
}
})
},
handleClose() {
this.$emit('dialogClose')
}
}
}
</script>
<style>
.privacyDailog .el-dialog {
min-width: 700px;
}
</style>
<!-- 应收单管理 -->
<template>
<d2-container class="m-t-40">
<div class="header" slot="header" style="padding-bottom: 20px;">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :form-data="showFormData" label-width="120px">
<div slot="totalAmountHtml">
<input-range start-placeholder="最小金额" end-placeholder="最大金额" :display-value="searchForm.totalAmount"></input-range>
</div>
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId" size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<span>
<auth-button category="Button" /></span>
</d2-table-header>
<d2-table ref="orderTable" :search-form="searchFormSearch" :table-params="tableParams" :get-list-api="getListApi" :before-search-fn="beforeSearchFn">
<auth-button slot="auth-button" slot-scope="scope" :data="scope.scope" />
</d2-table>
</div>
<ReceivePayEditDialog v-if="billVisible" :jdBillInfo="jdBillInfo" :billVisible="billVisible" @handleClose="handleBillVisible" @handleConfirm="handleBillVisible" />
</d2-container>
</template>
<script>
import { mapActions, mapState } from "vuex"
import { Util, deepClone } from "@/common/util"
import inputRange from '../../invoiceManage/components/inputRange'
import ReceivePayEditDialog from '../components/ReceivePayEditDialog.vue'
import {
getJdBillList
} from "@api/accountManage"
import { pushStatusOpt } from "@/common/constants.js"
export default {
name: "InvoiceCodeList",
data() {
return {
searchForm: {
settlementOrg: '',
rcvOrgName: '',
materialNames: '',
createdDate: [],
totalAmount: [],
pushStatus: ''
},
searchFormSearch: {},
showFormData: [
{
label: '结算组织',
name: 'settlementOrg',
type: 'input',
maxlength: '50',
isClear: true
},
{
label: '收款组织',
name: 'rcvOrgName',
type: 'input',
maxlength: '50',
isClear: true
},
{
label: '物料名称',
name: 'materialNames',
type: 'input',
maxlength: '50',
isClear: true
},
{
label: '含税总额',
name: 'totalAmount',
addHtml: "totalAmountHtml"
},
{
label: '生成时间',
name: 'createdDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
},
{
label: "推送金蝶状态",
name: "pushStatus",
type: "select",
isClear: true,
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "pushStatusOpt"
}
],
getListApi: getJdBillList,
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
mutiSelectUniqueKey: 'id',
mutiSelectName: 'payId',
listName: "list",
tableOption: { width: "150px" },
tableColumns: [
{
label: "结算组织",
prop: "settlementOrg"
},
{
label: "收款组织",
prop: "rcvOrgName",
width: "200"
},
{
label: "物料名称",
prop: "materialNames",
width: "200"
},
{
label: "含税总额",
prop: "totalAmount",
width: "150"
},
{
label: "生成时间",
prop: "createdDate",
width: "200"
},
{
label: "推送金蝶状态",
prop: "pushStatus",
width: "150",
formatter: (cellValue) => {
return this.baseData.pushStatusOpt.find(item => item.confId === cellValue.pushStatus)?.confValue
},
className: (cellValue) => {
return {
0: 'ashSpot',
1: 'greenSpot',
2: 'redSpot'
}[cellValue.pushStatus]
}
}
]
},
baseData: {
pushStatusOpt: deepClone(pushStatusOpt)
},
jdBillInfo: {},
billVisible: false
}
},
components: {
inputRange,
ReceivePayEditDialog
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList,
updateList: (state) => state.d2admin.user.updateList
})
},
mounted() {
this.getBaseData()
},
methods: {
...mapActions({
get: "d2admin/base/get",
close: "d2admin/page/close"
}),
...mapActions("d2admin/user", ["actionSetDownloadList"]),
async getBaseData() {
this.getOptionsList()
},
getParams() {
var params = deepClone(this.searchForm)
const dateFormatList = [{
attr: 'createdDate',
startAttr: 'startDate',
endAttr: 'endDate'
}]
dateFormatList.forEach(item => {
if (params[item.attr] && params[item.attr].length) {
params[item.startAttr] = Util.dateFormate(params[item.attr][0], 'YYYY-MM-DD')
params[item.endAttr] = Util.dateFormate(params[item.attr][1], 'YYYY-MM-DD')
delete params[item.attr]
}
})
if (params.totalAmount && params.totalAmount.length > 0) {
params.minTotalAmount = params.totalAmount[0]
params.maxTotalAmount = params.totalAmount[1]
}
delete params.totalAmount
params.billType = '3' // 应收单
return params
},
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = this.getParams()
resolve()
})
},
handleReset() {
this.searchForm = {
settlementOrg: '',
rcvOrgName: '',
materialNames: '',
createdDate: [],
totalAmount: [],
pushStatus: ''
}
this.$refs.orderTable.refreshTable()
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
handleEdit(row) {
this.jdBillInfo = row
this.billVisible = true
},
handleBillVisible() {
this.billVisible = !this.billVisible
this.$refs.orderTable.refreshTable(false, true)
},
handleExport() {
var params = this.getParams()
// 去除为null的值
for (const key in params) {
if (params[key] === null || params[key] === '' || params[key].length == 0) {
delete params[key]
}
}
params.method = 'dj.smartcarlife.api.jdbill.export'
const list = [
...this.dowloadList,
{
name: '应收单管理',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
}
}
}
</script>
<style lang="scss" scoped>
.m-t-40 {
margin-top: 40px;
}
@mixin typeBase {
width: 52px;
border-radius: 239px;
opacity: 1;
font-size: 14px;
text-align: center;
line-height: 24px;
display: inline-block;
}
.type-yellow {
@include typeBase();
background: #ff8d1a1a;
color: #ff8d1a;
}
.type-blue {
@include typeBase();
background: #5850ff1a;
color: #5850ff;
}
.type-green {
@include typeBase();
background: #43cf7c1a;
color: #43cf7c;
}
.m-l-md {
margin-left: 20px;
}
.import-btn {
position: relative;
}
.import-input {
opacity: 0;
position: absolute;
right: 0;
top: 0;
width: 98px;
height: 36px;
cursor: pointer;
font-size: 0;
}
.import-template {
position: absolute;
height: 20px;
top: 50px;
left: 0;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!