diff --git a/yuthon_report/models/receivable_report.py b/yuthon_report/models/receivable_report.py index 9b95d689e..fa4ed4867 100644 --- a/yuthon_report/models/receivable_report.py +++ b/yuthon_report/models/receivable_report.py @@ -6,6 +6,7 @@ class YuthonProperty(models.Model): @api.model def get_complete_ledger_report(self, params): + print("params:", params) domain = [] if params.get("keyword"): keyword = params["keyword"] @@ -21,6 +22,11 @@ class YuthonProperty(models.Model): if params.get("date_end"): domain.append(("due_date", "<=", params.get("date_end"))) + # condition, 这里需要放到具体的搜索条件中 domain . + condition = params.get('condition',False) + partner_id = params.get('partner_id',False) + company_id = params.get('company_id',False) + # # 6. 排除无效账单(作废/红冲) # domain += [ # ("is_invalid", "=", False), diff --git a/yuthon_report/static/src/components/yuthon_report/receivable_report.js b/yuthon_report/static/src/components/yuthon_report/receivable_report.js index 763e3d1e9..5c503db82 100644 --- a/yuthon_report/static/src/components/yuthon_report/receivable_report.js +++ b/yuthon_report/static/src/components/yuthon_report/receivable_report.js @@ -22,8 +22,8 @@ class ReceivableReport extends Component { endDate: null, keyword: "", booleanValue:true, - partnerValue:false, selectPartner:{}, + selectCompany:{}, condition:false, conditions:[{ 'name':'自有', @@ -60,22 +60,31 @@ class ReceivableReport extends Component { async onChangeBoolean(v){ this.state.booleanValue = v } + getDomainCompany(){ + return [] + } getDomain(){ // 过滤条件 - return []; + return [['id', 'in', [107,106, 215,112,110,214,218,173,219]]] } async onUpdatePartner(v){ console.log(v) - this.state.selectPartner = v - this.state.partnerValue = v.display_name + this.state.selectPartner = v[0] + } + + async onUpdateCompany(v){ + this.state.selectCompany = v[0] } async onSearch() { const params = { date_start: this.state.startDate, date_end: this.state.endDate, - keyword: this.state.keyword, + keyword: this.state.keyword || false, + condition:this.state.condition || false, + partner_id:this.state.selectPartner?.id, + company_id:this.state.selectCompany?.id, }; const result = await this.serviceOrm.call( this.config.model, diff --git a/yuthon_report/static/src/components/yuthon_report/receivable_report.xml b/yuthon_report/static/src/components/yuthon_report/receivable_report.xml index 3e499c4e8..38999062c 100644 --- a/yuthon_report/static/src/components/yuthon_report/receivable_report.xml +++ b/yuthon_report/static/src/components/yuthon_report/receivable_report.xml @@ -36,12 +36,12 @@