Merge pull request 'feat: update standard interface name' (#342) from feat_interface_name_standard into @hera/dev
Reviewed-on: daoyoucloud/tachycode#342 Reviewed-by: sealday <zhanglin@daoyoucloud.com>
This commit is contained in:
commit
0eea4f4b96
@ -1,9 +1,9 @@
|
|||||||
import { RecordCategory } from '../../utils/constants';
|
import { RecordCategory } from '../../utils/constants';
|
||||||
import { recordItems, record_fee_item } from './records';
|
import { RecordItems, Record_fee_item } from './records';
|
||||||
|
|
||||||
export interface Record {
|
export interface Record {
|
||||||
weight_items: any;
|
weight_items: any;
|
||||||
record_items: recordItems[];
|
record_items: RecordItems[];
|
||||||
systemTitle: any;
|
systemTitle: any;
|
||||||
record_lease_rules: any;
|
record_lease_rules: any;
|
||||||
weight: number;
|
weight: number;
|
||||||
@ -20,6 +20,6 @@ export interface Record {
|
|||||||
original_number: any;
|
original_number: any;
|
||||||
movement: number;
|
movement: number;
|
||||||
category: RecordCategory;
|
category: RecordCategory;
|
||||||
record_fee_items: record_fee_item[];
|
record_fee_items: Record_fee_item[];
|
||||||
pdfExplain: string;
|
pdfExplain: string;
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
export interface recordItems {
|
export interface RecordItems {
|
||||||
id: number;
|
id: number;
|
||||||
sort: number;
|
sort: number;
|
||||||
count: number;
|
count: number;
|
||||||
comment: string;
|
comment: string;
|
||||||
product: product;
|
product: Product;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
record_id: number;
|
record_id: number;
|
||||||
t_item_id: any;
|
t_item_id: any;
|
||||||
@ -12,10 +12,10 @@ export interface recordItems {
|
|||||||
unit_price: any;
|
unit_price: any;
|
||||||
createdById: number;
|
createdById: number;
|
||||||
updatedById: number;
|
updatedById: number;
|
||||||
record_item_fee_items: record_fee_item[];
|
record_item_fee_items: Record_fee_item[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface product {
|
export interface Product {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
sort: number;
|
sort: number;
|
||||||
@ -30,10 +30,10 @@ export interface product {
|
|||||||
createdById: number;
|
createdById: number;
|
||||||
custom_name: string;
|
custom_name: string;
|
||||||
updatedById: number;
|
updatedById: number;
|
||||||
product_category: product_category;
|
product_category: Product_category;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface product_category {
|
export interface Product_category {
|
||||||
id: number;
|
id: number;
|
||||||
attr: string[];
|
attr: string[];
|
||||||
name: string;
|
name: string;
|
||||||
@ -49,8 +49,8 @@ export interface product_category {
|
|||||||
conversion_unit: string;
|
conversion_unit: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface record_fee_item {
|
export interface Record_fee_item {
|
||||||
product: product;
|
product: Product;
|
||||||
id: number;
|
id: number;
|
||||||
sort: number;
|
sort: number;
|
||||||
count: number;
|
count: number;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { product } from './records';
|
import { Product } from './records';
|
||||||
import { ConversionLogics, countCource } from '../../utils/constants';
|
import { ConversionLogics, countCource } from '../../utils/constants';
|
||||||
|
|
||||||
export interface FeeRule extends LeaseRule {
|
export interface FeeRule extends LeaseRule {
|
||||||
id: number;
|
id: number;
|
||||||
product: product;
|
product: Product;
|
||||||
fee_product_id: number;
|
fee_product_id: number;
|
||||||
count_source: countCource;
|
count_source: countCource;
|
||||||
unit: string;
|
unit: string;
|
||||||
@ -19,7 +19,7 @@ export interface LeaseRule {
|
|||||||
unit_price: number;
|
unit_price: number;
|
||||||
product_id?: number;
|
product_id?: number;
|
||||||
conversion_logic_id: ConversionLogics;
|
conversion_logic_id: ConversionLogics;
|
||||||
ucl: weightRule;
|
ucl: WeightRule;
|
||||||
product_fee: any;
|
product_fee: any;
|
||||||
products: any;
|
products: any;
|
||||||
}
|
}
|
||||||
@ -36,6 +36,6 @@ export interface RuleItem {
|
|||||||
rule: Rule;
|
rule: Rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface weightRule {
|
export interface WeightRule {
|
||||||
weight_items: any[];
|
weight_items: any[];
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
export interface recordPdfOptions {
|
export interface RecordPdfOptions {
|
||||||
isDouble: number;
|
isDouble: number;
|
||||||
printSetup: String;
|
printSetup: String;
|
||||||
}
|
}
|
@ -1,10 +1,10 @@
|
|||||||
import { RecordCategory } from '../../utils/constants';
|
import { RecordCategory } from '../utils/constants';
|
||||||
import { recordItems, record_fee_item } from './records';
|
import { RecordItems, Record_fee_item } from './records';
|
||||||
|
|
||||||
export interface Record {
|
export interface Record {
|
||||||
weight_items: any;
|
weight_items: any;
|
||||||
record_items: recordItems[];
|
record_items: RecordItems[];
|
||||||
items: recordItems[];
|
items: RecordItems[];
|
||||||
systemTitle: any;
|
systemTitle: any;
|
||||||
record_lease_rules: any;
|
record_lease_rules: any;
|
||||||
weight: number;
|
weight: number;
|
||||||
@ -21,7 +21,7 @@ export interface Record {
|
|||||||
original_number: any;
|
original_number: any;
|
||||||
movement: string;
|
movement: string;
|
||||||
category: RecordCategory;
|
category: RecordCategory;
|
||||||
record_fee_items: record_fee_item[];
|
record_fee_items: Record_fee_item[];
|
||||||
pdfExplain: string;
|
pdfExplain: string;
|
||||||
direct_record_id: number;
|
direct_record_id: number;
|
||||||
id: number;
|
id: number;
|
@ -1,10 +1,10 @@
|
|||||||
export interface recordItems {
|
export interface RecordItems {
|
||||||
label: string;
|
label: string;
|
||||||
id: number;
|
id: number;
|
||||||
sort: number;
|
sort: number;
|
||||||
count: number;
|
count: number;
|
||||||
comment: string;
|
comment: string;
|
||||||
product: product;
|
product: Product;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
record_id: number;
|
record_id: number;
|
||||||
t_item_id: any;
|
t_item_id: any;
|
||||||
@ -13,10 +13,10 @@ export interface recordItems {
|
|||||||
unit_price: any;
|
unit_price: any;
|
||||||
createdById: number;
|
createdById: number;
|
||||||
updatedById: number;
|
updatedById: number;
|
||||||
record_item_fee_items: record_fee_item[];
|
record_item_fee_items: Record_fee_item[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface product {
|
export interface Product {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
sort: number;
|
sort: number;
|
||||||
@ -28,14 +28,14 @@ export interface product {
|
|||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
updatedAt: Date;
|
updatedAt: Date;
|
||||||
category_id: number;
|
category_id: number;
|
||||||
category: product_category;
|
category: Product_category;
|
||||||
createdById: number;
|
createdById: number;
|
||||||
custom_name: string;
|
custom_name: string;
|
||||||
updatedById: number;
|
updatedById: number;
|
||||||
product_category: product_category;
|
product_category: Product_category;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface product_category {
|
export interface Product_category {
|
||||||
id: number;
|
id: number;
|
||||||
attr: string[];
|
attr: string[];
|
||||||
name: string;
|
name: string;
|
||||||
@ -51,8 +51,8 @@ export interface product_category {
|
|||||||
conversion_unit: string;
|
conversion_unit: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface record_fee_item {
|
export interface Record_fee_item {
|
||||||
product: product;
|
product: Product;
|
||||||
id: number;
|
id: number;
|
||||||
sort: number;
|
sort: number;
|
||||||
count: number;
|
count: number;
|
@ -1,9 +1,9 @@
|
|||||||
import { product } from './records';
|
import { Product } from './records';
|
||||||
import { ConversionLogics, countCource } from '../../utils/constants';
|
import { ConversionLogics, countCource } from '../utils/constants';
|
||||||
|
|
||||||
export interface FeeRule extends LeaseRule {
|
export interface FeeRule extends LeaseRule {
|
||||||
id: number;
|
id: number;
|
||||||
product: product;
|
product: Product;
|
||||||
fee_product_id: number;
|
fee_product_id: number;
|
||||||
count_source: countCource;
|
count_source: countCource;
|
||||||
unit: string;
|
unit: string;
|
||||||
@ -19,7 +19,7 @@ export interface LeaseRule {
|
|||||||
unit_price: number;
|
unit_price: number;
|
||||||
product_id?: number;
|
product_id?: number;
|
||||||
conversion_logic_id: ConversionLogics;
|
conversion_logic_id: ConversionLogics;
|
||||||
ucl: weightRule;
|
ucl: WeightRule;
|
||||||
product_fee: any;
|
product_fee: any;
|
||||||
products: any;
|
products: any;
|
||||||
}
|
}
|
||||||
@ -36,6 +36,6 @@ export interface RuleItem {
|
|||||||
rule: Rule;
|
rule: Rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface weightRule {
|
export interface WeightRule {
|
||||||
weight_items: any[];
|
weight_items: any[];
|
||||||
}
|
}
|
@ -3,7 +3,7 @@ import { renderWaybill } from '../pdf-documents/waybills-document';
|
|||||||
import { SqlLoader } from '@hera/plugin-core';
|
import { SqlLoader } from '@hera/plugin-core';
|
||||||
import { Action, Controller, Inject } from '@nocobase/utils';
|
import { Action, Controller, Inject } from '@nocobase/utils';
|
||||||
import { QueryTypes } from 'sequelize';
|
import { QueryTypes } from 'sequelize';
|
||||||
import { Waybill } from '../interfaces/waybill';
|
import { Waybill } from '../../interfaces/waybill';
|
||||||
|
|
||||||
@Controller('waybills')
|
@Controller('waybills')
|
||||||
export class WaybillsController {
|
export class WaybillsController {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Document, Page, Text, View, StyleSheet, Image, renderToStream, Font } from '@hera/plugin-core';
|
import { Document, Page, Text, View, StyleSheet, Image, renderToStream, Font } from '@hera/plugin-core';
|
||||||
import { Record } from '../interfaces/record';
|
import { Record } from '../../interfaces/record';
|
||||||
import * as QRCode from 'qrcode';
|
import * as QRCode from 'qrcode';
|
||||||
import { ConversionLogics, RecordCategory } from '../../utils/constants';
|
import { ConversionLogics, RecordCategory } from '../../utils/constants';
|
||||||
import { formatCurrency, formatQuantity } from '../../utils/currencyUtils';
|
import { formatCurrency, formatQuantity } from '../../utils/currencyUtils';
|
||||||
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import { Document, Page, Text, View, StyleSheet, renderToStream } from '@hera/plugin-core';
|
import { Document, Page, Text, View, StyleSheet, renderToStream } from '@hera/plugin-core';
|
||||||
import { formatCurrency, formatQuantity } from '../../utils/currencyUtils';
|
import { formatCurrency, formatQuantity } from '../../utils/currencyUtils';
|
||||||
import { converDate } from '../../utils/daysUtils';
|
import { converDate } from '../../utils/daysUtils';
|
||||||
import { Waybill } from '../interfaces/waybill';
|
import { Waybill } from '../../interfaces/waybill';
|
||||||
|
|
||||||
const boldFont = {
|
const boldFont = {
|
||||||
fontFamily: 'source-han-sans',
|
fontFamily: 'source-han-sans',
|
||||||
@ -291,7 +291,7 @@ const PreviewDocument = ({ waybill }: { waybill: Waybill }) => {
|
|||||||
<Text>
|
<Text>
|
||||||
附加价格
|
附加价格
|
||||||
<Text style={styles.mainSize}>
|
<Text style={styles.mainSize}>
|
||||||
{formatQuantity(waybill.additional_cost, 2) == '0.00'
|
{formatQuantity(waybill.additional_cost, 2) === '0.00'
|
||||||
? '0'
|
? '0'
|
||||||
: formatQuantity(waybill.additional_cost, 2)}
|
: formatQuantity(waybill.additional_cost, 2)}
|
||||||
元
|
元
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { ConversionLogics, RecordCategory, RulesNumber, SourcesType, countCource } from '../../utils/constants';
|
import { ConversionLogics, RecordCategory, RulesNumber, SourcesType, countCource } from '../../utils/constants';
|
||||||
import { renderItV2 } from '../pdf-documents/records-documentV2';
|
import { renderItV2 } from '../pdf-documents/records-documentV2';
|
||||||
import { Service } from '@nocobase/utils';
|
import { Service } from '@nocobase/utils';
|
||||||
import { recordPdfOptions } from '../interfaces/options';
|
import { RecordPdfOptions } from '../../interfaces/options';
|
||||||
import { PrintSetup } from '../../utils/system';
|
import { PrintSetup } from '../../utils/system';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class RecordPdfService {
|
export class RecordPdfService {
|
||||||
async transformPdfV2(recordData: any, lease_data: any, fee_data: any, options: recordPdfOptions) {
|
async transformPdfV2(recordData: any, lease_data: any, fee_data: any, options: RecordPdfOptions) {
|
||||||
const { isDouble, printSetup } = options;
|
const { isDouble, printSetup } = options;
|
||||||
|
|
||||||
// 直发单不需要打印预览
|
// 直发单不需要打印预览
|
||||||
|
@ -11,10 +11,10 @@ import {
|
|||||||
} from '../../utils/constants';
|
} from '../../utils/constants';
|
||||||
import { converDate } from '../../utils/daysUtils';
|
import { converDate } from '../../utils/daysUtils';
|
||||||
import { converUnitCount } from '../../utils/unitUtils';
|
import { converUnitCount } from '../../utils/unitUtils';
|
||||||
import { Settlement } from '../interfaces/settlement';
|
import { Settlement } from '../../interfaces/settlement';
|
||||||
import { FeeRule, LeaseRule } from '../interfaces/rule';
|
import { FeeRule, LeaseRule } from '../../interfaces/rule';
|
||||||
import { Record } from '../interfaces/record';
|
import { Record } from '../../interfaces/record';
|
||||||
import { recordItems } from '../interfaces/records';
|
import { RecordItems } from '../../interfaces/records';
|
||||||
import { formatQuantity } from '../../utils/currencyUtils';
|
import { formatQuantity } from '../../utils/currencyUtils';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
@ -852,7 +852,7 @@ const recordWeight = (rule, item, settlementsId, productRule, rulefee?) => {
|
|||||||
* @param itemCount 需要计算的订单数量
|
* @param itemCount 需要计算的订单数量
|
||||||
* @returns count,unit 返回了最后的计算数量和单位
|
* @returns count,unit 返回了最后的计算数量和单位
|
||||||
*/
|
*/
|
||||||
const ruleCount = (rules: FeeRule | LeaseRule, item: Record, recordItem: recordItems, valueCount?, rulefee?) => {
|
const ruleCount = (rules: FeeRule | LeaseRule, item: Record, recordItem: RecordItems, valueCount?, rulefee?) => {
|
||||||
let count, unit;
|
let count, unit;
|
||||||
const itemCount = valueCount ? valueCount : recordItem.count;
|
const itemCount = valueCount ? valueCount : recordItem.count;
|
||||||
const conversion_logic_id = rulefee ? rulefee.conversion_logic_id : rules.conversion_logic_id;
|
const conversion_logic_id = rulefee ? rulefee.conversion_logic_id : rules.conversion_logic_id;
|
||||||
|
Loading…
Reference in New Issue
Block a user