优化客户和供应商的对账单

This commit is contained in:
季圣华
2021-07-08 00:12:19 +08:00
parent 1149ada422
commit b27ffdf1e5
24 changed files with 101 additions and 108 deletions

View File

@@ -161,12 +161,9 @@ const checkSupplier = (params)=>getAction("/supplier/checkIsNameExist",params);
const findBySelectSup = (params)=>postAction("/supplier/findBySelect_sup",params); const findBySelectSup = (params)=>postAction("/supplier/findBySelect_sup",params);
const findBySelectCus = (params)=>postAction("/supplier/findBySelect_cus",params); const findBySelectCus = (params)=>postAction("/supplier/findBySelect_cus",params);
const findBySelectRetail = (params)=>postAction("/supplier/findBySelect_retail",params); const findBySelectRetail = (params)=>postAction("/supplier/findBySelect_retail",params);
const findSupplierById = (params)=>getAction("/supplier/findById",params);
//单据相关 //单据相关
const findDepotHeadTotalPay = (params)=>getAction("/depotHead/findTotalPay",params);
const findBillDetailByNumber = (params)=>getAction("/depotHead/getDetailByNumber",params); const findBillDetailByNumber = (params)=>getAction("/depotHead/getDetailByNumber",params);
const findStockByDepotAndBarCode = (params)=>getAction("/depotItem/findStockByDepotAndBarCode",params); const findStockByDepotAndBarCode = (params)=>getAction("/depotItem/findStockByDepotAndBarCode",params);
const findAccountHeadTotalPay = (params)=>getAction("/accountHead/findTotalPay",params);
const findFinancialDetailByNumber = (params)=>getAction("/accountHead/getDetailByNumber",params); const findFinancialDetailByNumber = (params)=>getAction("/accountHead/getDetailByNumber",params);
export { export {
@@ -277,11 +274,8 @@ export {
findBySelectSup, findBySelectSup,
findBySelectCus, findBySelectCus,
findBySelectRetail, findBySelectRetail,
findSupplierById,
findDepotHeadTotalPay,
findBillDetailByNumber, findBillDetailByNumber,
findStockByDepotAndBarCode, findStockByDepotAndBarCode,
findAccountHeadTotalPay,
findFinancialDetailByNumber findFinancialDetailByNumber
} }

View File

@@ -51,7 +51,7 @@
批量操作 <a-icon type="down" /> 批量操作 <a-icon type="down" />
</a-button> </a-button>
</a-dropdown> </a-dropdown>
<a-tooltip placement="left" title="采购订单不涉及入库仓库和付款金额采购订单可以转采购入库单但需要先对采购订单进行审核 <a-tooltip placement="left" title="采购订单不涉及付款金额采购订单可以转采购入库单但需要先对采购订单进行审核
勾选之后可以进行批量操作删除审核反审核" slot="action"> 勾选之后可以进行批量操作删除审核反审核" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="info-circle" style="font-size:20px;float:right;" /> <a-icon v-if="btnEnableList.indexOf(1)>-1" type="info-circle" style="font-size:20px;float:right;" />
</a-tooltip> </a-tooltip>

View File

@@ -51,7 +51,7 @@
批量操作 <a-icon type="down" /> 批量操作 <a-icon type="down" />
</a-button> </a-button>
</a-dropdown> </a-dropdown>
<a-tooltip placement="left" title="销售订单不涉及出库仓库和收款金额销售订单可以转销售出库单但需要先对销售订单进行审核 <a-tooltip placement="left" title="销售订单不涉及收款金额销售订单可以转销售出库单但需要先对销售订单进行审核
勾选之后可以进行批量操作删除审核反审核" slot="action"> 勾选之后可以进行批量操作删除审核反审核" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="info-circle" style="font-size:20px;float:right;" /> <a-icon v-if="btnEnableList.indexOf(1)>-1" type="info-circle" style="font-size:20px;float:right;" />
</a-tooltip> </a-tooltip>

View File

@@ -17,7 +17,7 @@
<a-row class="form-row" :gutter="24"> <a-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['operTime']" :show-time="true"/> <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">

View File

@@ -17,7 +17,7 @@
<a-row class="form-row" :gutter="24"> <a-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['operTime']" :show-time="true"/> <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">

View File

@@ -17,7 +17,7 @@
<a-row class="form-row" :gutter="24"> <a-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['operTime']" :show-time="true"/> <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">

View File

@@ -26,7 +26,7 @@
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['operTime']" :show-time="true"/> <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">

View File

@@ -26,7 +26,7 @@
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['operTime']" :show-time="true"/> <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">

View File

@@ -27,7 +27,7 @@
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['operTime']" :show-time="true"/> <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">

View File

@@ -27,7 +27,7 @@
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['operTime']" :show-time="true"/> <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">

View File

@@ -26,7 +26,7 @@
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['operTime']" :show-time="true"/> <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">

View File

@@ -27,7 +27,7 @@
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['operTime']" :show-time="true"/> <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">

View File

@@ -26,7 +26,7 @@
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['operTime']" :show-time="true"/> <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">

View File

@@ -27,7 +27,7 @@
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['operTime']" :show-time="true"/> <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">

View File

@@ -26,7 +26,7 @@
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['operTime']" :show-time="true"/> <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">

View File

@@ -27,7 +27,7 @@
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['operTime']" :show-time="true"/> <j-date v-decorator="['operTime', validatorRules.operTime]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">

View File

@@ -35,7 +35,7 @@
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['billTime']" :show-time="true"/> <j-date v-decorator="['billTime', validatorRules.billTime]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
@@ -149,6 +149,11 @@
rules: [ rules: [
{ required: true, message: '请选择经手人!' } { required: true, message: '请选择经手人!' }
] ]
},
billTime:{
rules: [
{ required: true, message: '请选择单据日期!' }
]
} }
}, },
url: { url: {

View File

@@ -26,7 +26,7 @@
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['billTime']" :show-time="true"/> <j-date v-decorator="['billTime', validatorRules.billTime]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
@@ -139,6 +139,11 @@
{ required: true, message: '请选择经手人!' } { required: true, message: '请选择经手人!' }
] ]
}, },
billTime:{
rules: [
{ required: true, message: '请选择单据日期!' }
]
},
accountId:{ accountId:{
rules: [ rules: [
{ required: true, message: '请选择付款账户!' } { required: true, message: '请选择付款账户!' }

View File

@@ -35,7 +35,7 @@
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['billTime']" :show-time="true"/> <j-date v-decorator="['billTime', validatorRules.billTime ]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
@@ -151,6 +151,11 @@
{ required: true, message: '请选择经手人!' } { required: true, message: '请选择经手人!' }
] ]
}, },
billTime:{
rules: [
{ required: true, message: '请选择单据日期!' }
]
},
accountId:{ accountId:{
rules: [ rules: [
{ required: true, message: '请选择收入账户!' } { required: true, message: '请选择收入账户!' }

View File

@@ -35,7 +35,7 @@
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['billTime']" :show-time="true"/> <j-date v-decorator="['billTime', validatorRules.billTime]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
@@ -151,6 +151,11 @@
{ required: true, message: '请选择经手人!' } { required: true, message: '请选择经手人!' }
] ]
}, },
billTime:{
rules: [
{ required: true, message: '请选择单据日期!' }
]
},
accountId:{ accountId:{
rules: [ rules: [
{ required: true, message: '请选择付款账户!' } { required: true, message: '请选择付款账户!' }

View File

@@ -36,7 +36,7 @@
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['billTime']" :show-time="true"/> <j-date v-decorator="['billTime', validatorRules.billTime]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
@@ -172,6 +172,9 @@
handsPersonId:{ handsPersonId:{
rules: [{ required: true, message: '请选择经手人!' }] rules: [{ required: true, message: '请选择经手人!' }]
}, },
billTime:{
rules: [{ required: true, message: '请选择单据日期!' }]
},
accountId:{ accountId:{
rules: [{ required: true, message: '请选择收款账户!' }] rules: [{ required: true, message: '请选择收款账户!' }]
}, },

View File

@@ -36,7 +36,7 @@
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['billTime']" :show-time="true"/> <j-date v-decorator="['billTime', validatorRules.billTime]" :show-time="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :sm="24"> <a-col :lg="6" :md="12" :sm="24">
@@ -172,6 +172,9 @@
handsPersonId:{ handsPersonId:{
rules: [{ required: true, message: '请选择经手人!' }] rules: [{ required: true, message: '请选择经手人!' }]
}, },
billTime:{
rules: [{ required: true, message: '请选择单据日期!' }]
},
accountId:{ accountId:{
rules: [{ required: true, message: '请选择付款账户!' }] rules: [{ required: true, message: '请选择付款账户!' }]
}, },

View File

@@ -27,7 +27,7 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="4" :sm="24"> <a-col :md="3" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button> <a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" type="primary" icon="printer">打印</a-button> <a-button style="margin-left: 8px" v-print="'#reportPrint'" type="primary" icon="printer">打印</a-button>
@@ -35,7 +35,7 @@
</a-col> </a-col>
<a-col :md="8" :sm="24"> <a-col :md="8" :sm="24">
<a-form-item> <a-form-item>
{{firstTotal}} {{lastTotal}} {{pleaseSelect}} {{firstTotal}} {{lastTotal}}
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@@ -71,7 +71,8 @@
import FinancialDetail from '../financial/dialog/FinancialDetail' import FinancialDetail from '../financial/dialog/FinancialDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getNowFormatMonth } from '@/utils/util'; import { getNowFormatMonth } from '@/utils/util';
import {findBySelectCus, findSupplierById, findDepotHeadTotalPay, findAccountHeadTotalPay, findBillDetailByNumber, findFinancialDetailByNumber} from '@/api/api' import { getAction } from '@/api/manage'
import {findBySelectCus, findBillDetailByNumber, findFinancialDetailByNumber} from '@/api/api'
import JEllipsis from '@/components/jeecg/JEllipsis' import JEllipsis from '@/components/jeecg/JEllipsis'
import moment from 'moment' import moment from 'moment'
export default { export default {
@@ -97,7 +98,6 @@
supList: [], supList: [],
firstTotal: '', firstTotal: '',
lastTotal: '', lastTotal: '',
pleaseSelect: '(请选择客户)',
tabKey: "1", tabKey: "1",
// 表头 // 表头
columns: [ columns: [
@@ -160,40 +160,6 @@
this.queryParam.beginTime=dateString[0]; this.queryParam.beginTime=dateString[0];
this.queryParam.endTime=dateString[1]; this.queryParam.endTime=dateString[1];
}, },
initTotal(prefix, time, type) {
findSupplierById({supplierId: this.queryParam.organId}).then((res)=>{
if (res && res.data && res.data[0]) {
let beginNeedGet = res.data[0].BeginNeedGet;
let beginNeedPay = res.data[0].BeginNeedPay;
findDepotHeadTotalPay({supplierId: this.queryParam.organId, endTime: time, supType: "customer" }).then((res)=>{
if (res && res.code === 200 && res.data && res.data.rows) {
let moneyA = res.data.rows.getAllMoney.toFixed(2) - 0;
findAccountHeadTotalPay({supplierId: this.queryParam.organId, endTime: time, supType: "customer" }).then((res)=>{
if (res && res.code === 200 && res.data && res.data.rows) {
let moneyB = res.data.rows.getAllMoney.toFixed(2) - 0;
let money = moneyA + moneyB;
let moneyBeginNeedGet = beginNeedGet - 0; //期初应收
let moneyBeginNeedPay = beginNeedPay - 0; //期初应付
money = (money + moneyBeginNeedGet - moneyBeginNeedPay).toFixed(2);
if(type === 'first') {
this.firstTotal = prefix + money + ""
} else if(type === 'last') {
this.lastTotal = prefix + money
}
}
})
}
})
}
})
},
initStatistics() {
if(this.queryParam.organId) {
this.initTotal('期初应收:', this.queryParam.beginTime, 'first')
this.initTotal('期末应收:', this.queryParam.endTime, 'last')
this.pleaseSelect = ''
}
},
myHandleDetail(record) { myHandleDetail(record) {
if(record.type === '收入' || record.type === '收款') { if(record.type === '收入' || record.type === '收款') {
findFinancialDetailByNumber({ billNo: record.number }).then((res) => { findFinancialDetailByNumber({ billNo: record.number }).then((res) => {
@@ -211,12 +177,33 @@
}) })
} }
}, },
loadData(arg) {
//加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination.current = 1;
}
let params = this.getQueryParams();//查询条件
this.loading = true;
getAction(this.url.list, params).then((res) => {
if (res.code===200) {
this.dataSource = res.data.rows;
this.ipagination.total = res.data.total;
if(this.queryParam.organId) {
this.firstTotal = '期初应收:' + res.data.firstMoney + ""
this.lastTotal = '期末应收:' + res.data.lastMoney
}
}
if(res.code===510){
this.$message.warning(res.data)
}
this.loading = false;
})
},
searchQuery() { searchQuery() {
if(this.queryParam.beginTime == '' || this.queryParam.endTime == ''){ if(this.queryParam.beginTime === '' || this.queryParam.endTime === ''){
this.$message.warning('请选择单据日期!') this.$message.warning('请选择单据日期!')
} else { } else {
this.loadData(1); this.loadData(1);
this.initStatistics();
} }
} }
} }

View File

@@ -27,7 +27,7 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="4" :sm="24"> <a-col :md="3" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button> <a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" type="primary" icon="printer">打印</a-button> <a-button style="margin-left: 8px" v-print="'#reportPrint'" type="primary" icon="printer">打印</a-button>
@@ -35,7 +35,7 @@
</a-col> </a-col>
<a-col :md="8" :sm="24"> <a-col :md="8" :sm="24">
<a-form-item> <a-form-item>
{{firstTotal}} {{lastTotal}} {{pleaseSelect}} {{firstTotal}} {{lastTotal}}
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@@ -71,7 +71,8 @@
import FinancialDetail from '../financial/dialog/FinancialDetail' import FinancialDetail from '../financial/dialog/FinancialDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getNowFormatMonth } from '@/utils/util'; import { getNowFormatMonth } from '@/utils/util';
import {findBySelectSup, findSupplierById, findDepotHeadTotalPay, findAccountHeadTotalPay, findBillDetailByNumber,findFinancialDetailByNumber} from '@/api/api' import { getAction } from '@/api/manage'
import {findBySelectSup, findBillDetailByNumber,findFinancialDetailByNumber} from '@/api/api'
import JEllipsis from '@/components/jeecg/JEllipsis' import JEllipsis from '@/components/jeecg/JEllipsis'
import moment from 'moment' import moment from 'moment'
export default { export default {
@@ -97,7 +98,6 @@
supList: [], supList: [],
firstTotal: '', firstTotal: '',
lastTotal: '', lastTotal: '',
pleaseSelect: '(请选择供应商)',
tabKey: "1", tabKey: "1",
// 表头 // 表头
columns: [ columns: [
@@ -160,41 +160,6 @@
this.queryParam.beginTime=dateString[0]; this.queryParam.beginTime=dateString[0];
this.queryParam.endTime=dateString[1]; this.queryParam.endTime=dateString[1];
}, },
initTotal(prefix, time, type) {
findSupplierById({supplierId: this.queryParam.organId}).then((res)=>{
if (res && res.data && res.data[0]) {
let beginNeedGet = res.data[0].BeginNeedGet;
let beginNeedPay = res.data[0].BeginNeedPay;
findDepotHeadTotalPay({supplierId: this.queryParam.organId, endTime: time, supType: "customer" }).then((res)=>{
if (res && res.code === 200 && res.data && res.data.rows) {
let moneyA = res.data.rows.getAllMoney.toFixed(2) - 0;
findAccountHeadTotalPay({supplierId: this.queryParam.organId, endTime: time, supType: "customer" }).then((res)=>{
if (res && res.code === 200 && res.data && res.data.rows) {
let moneyB = res.data.rows.getAllMoney.toFixed(2) - 0;
let money = moneyA + moneyB;
let moneyBeginNeedGet = beginNeedGet - 0; //期初应收
let moneyBeginNeedPay = beginNeedPay - 0; //期初应付
money = (money + moneyBeginNeedGet - moneyBeginNeedPay).toFixed(2);
money = 0-money;
if(type === 'first') {
this.firstTotal = prefix + money + ""
} else if(type === 'last') {
this.lastTotal = prefix + money
}
}
})
}
})
}
})
},
initStatistics() {
if(this.queryParam.organId) {
this.initTotal('期初应付:', this.queryParam.beginTime, 'first')
this.initTotal('期末应付:', this.queryParam.endTime, 'last')
this.pleaseSelect = ''
}
},
myHandleDetail(record) { myHandleDetail(record) {
if(record.type === '支出' || record.type === '付款') { if(record.type === '支出' || record.type === '付款') {
findFinancialDetailByNumber({ billNo: record.number }).then((res) => { findFinancialDetailByNumber({ billNo: record.number }).then((res) => {
@@ -212,12 +177,33 @@
}) })
} }
}, },
loadData(arg) {
//加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination.current = 1;
}
let params = this.getQueryParams();//查询条件
this.loading = true;
getAction(this.url.list, params).then((res) => {
if (res.code===200) {
this.dataSource = res.data.rows;
this.ipagination.total = res.data.total;
if(this.queryParam.organId) {
this.firstTotal = '期初应付:' + res.data.firstMoney + ""
this.lastTotal = '期末应付:' + res.data.lastMoney
}
}
if(res.code===510){
this.$message.warning(res.data)
}
this.loading = false;
})
},
searchQuery() { searchQuery() {
if(this.queryParam.beginTime == '' || this.queryParam.endTime == ''){ if(this.queryParam.beginTime === '' || this.queryParam.endTime === ''){
this.$message.warning('请选择单据日期!') this.$message.warning('请选择单据日期!')
} else { } else {
this.loadData(1); this.loadData(1);
this.initStatistics();
} }
} }
} }