5c085dc69e
· 다이얼로그 디자인: 프로젝트정보 박스(주문유형/제품구분/국내해외/고객사·유무상/접수일/견적환종/견적환율) + 품목정보 테이블(No/품번/품명/S/N/요청납기/고객요청사항/반납사유) · ProjectInfoData 정규화 props — 진행관리/판매관리/매출관리 각각 toProjectInfo 매핑으로 호출 · backend SQL 3곳 보강: exchange_rate (contract_mgmt) + customer_request (CI→CM fallback) + return_reason_name (CI CODE_NAME) · 판매관리/매출관리 page에 columns useMemo + project_no 셀 onClick + ProjectInfoDialog state 추가 · wace 운영 URL: /salesMgmt/salesRegForm.do?saleNo=detail 1:1 매핑 (새 창 → 같은 탭 다이얼로그) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
180 lines
5.2 KiB
TypeScript
180 lines
5.2 KiB
TypeScript
import { apiClient } from "./client";
|
|
|
|
export interface SaleListFilter {
|
|
orderType?: string;
|
|
poNo?: string;
|
|
customer_objid?: string;
|
|
productType?: string;
|
|
nation?: string;
|
|
search_partObjId?: string;
|
|
serialNo?: string;
|
|
shippingStatus?: string;
|
|
orderDateFrom?: string;
|
|
orderDateTo?: string;
|
|
shippingDateFrom?: string;
|
|
shippingDateTo?: string;
|
|
salesStatus?: string;
|
|
salesDeadlineFrom?: string;
|
|
salesDeadlineTo?: string;
|
|
}
|
|
|
|
export interface SaleListRow {
|
|
project_no: string;
|
|
contract_no: string | null;
|
|
order_type: string | null;
|
|
order_date: string | null;
|
|
po_no: string | null;
|
|
request_date: string | null;
|
|
customer_objid: string | null;
|
|
customer: string | null;
|
|
product_type: string | null;
|
|
contract_item_objid: string;
|
|
seq: number;
|
|
part_objid: string | null;
|
|
product_no: string | null;
|
|
product_name: string | null;
|
|
order_quantity: string | null;
|
|
sales_quantity: number | null;
|
|
remaining_quantity: number | null;
|
|
sale_no: number | null;
|
|
sales_unit_price: number | null;
|
|
sales_supply_price: number | null;
|
|
sales_vat: number | null;
|
|
sales_total_amount: number | null;
|
|
sales_currency: string | null;
|
|
sales_exchange_rate: number | null;
|
|
shipping_date: string | null;
|
|
shipping_method: string | null;
|
|
shipping_order_status: string | null;
|
|
manager_user_id: string | null;
|
|
incoterms: string | null;
|
|
has_split_shipment: boolean | null;
|
|
order_status: string | null;
|
|
sales_status: string;
|
|
production_status: string | null;
|
|
payment_type: string | null;
|
|
payment_type_name: string | null;
|
|
nation: string | null;
|
|
nation_name: string | null;
|
|
product_type_name: string | null;
|
|
receipt_date: string | null;
|
|
customer_request: string | null;
|
|
manager_name: string | null;
|
|
cu01_cnt: number | null;
|
|
serial_no: string | null;
|
|
// 다이얼로그 표시용 (wace 운영판 1:1)
|
|
order_type_name: string | null;
|
|
contract_currency_name: string | null;
|
|
exchange_rate: string | null;
|
|
return_reason_name: string | null;
|
|
}
|
|
|
|
export interface RevenueListRow {
|
|
project_no: string;
|
|
contract_no: string | null;
|
|
order_type: string | null;
|
|
order_date: string | null;
|
|
po_no: string | null;
|
|
customer_objid: string | null;
|
|
customer: string | null;
|
|
product_type: string | null;
|
|
nation: string | null;
|
|
log_id: number;
|
|
target_objid: string;
|
|
parent_sale_no: number | null;
|
|
sales_quantity: number | null;
|
|
sales_unit_price: number | null;
|
|
sales_supply_price: number | null;
|
|
sales_vat: number | null;
|
|
sales_total_amount: number | null;
|
|
sales_currency: string | null;
|
|
sales_exchange_rate: number | null;
|
|
shipping_date: string | null;
|
|
shipping_method: string | null;
|
|
serial_no: string | null;
|
|
split_serial_no: string | null;
|
|
sales_deadline_date: string | null;
|
|
tax_type: string | null;
|
|
tax_invoice_date: string | null;
|
|
export_decl_no: string | null;
|
|
loading_date: string | null;
|
|
sales_slip_date: string | null;
|
|
sales_slip_menu_sq: number | null;
|
|
remark: string | null;
|
|
receipt_date: string | null;
|
|
payment_type: string | null;
|
|
payment_type_name: string | null;
|
|
request_date: string | null;
|
|
customer_request: string | null;
|
|
order_status: string | null;
|
|
order_status_name: string | null;
|
|
manager_name: string | null;
|
|
incoterms: string | null;
|
|
cu01_cnt: number | null;
|
|
// 다이얼로그 표시용 (wace 운영판 1:1)
|
|
order_type_name: string | null;
|
|
product_type_name: string | null;
|
|
nation_name: string | null;
|
|
product_no: string | null;
|
|
product_name: string | null;
|
|
contract_currency_name: string | null;
|
|
exchange_rate: string | null;
|
|
return_reason_name: string | null;
|
|
}
|
|
|
|
export interface SaleRegisterBody {
|
|
project_no: string;
|
|
shipping_order_status?: string;
|
|
serial_no?: string;
|
|
sales_quantity?: number;
|
|
sales_unit_price?: number;
|
|
sales_supply_price?: number;
|
|
sales_vat?: number;
|
|
sales_total_amount?: number;
|
|
sales_currency?: string;
|
|
sales_exchange_rate?: number;
|
|
shipping_date?: string;
|
|
shipping_method?: string;
|
|
manager_user_id?: string;
|
|
incoterms?: string;
|
|
has_split_shipment?: boolean;
|
|
}
|
|
|
|
export interface DeadlineInfoBody {
|
|
log_id?: number;
|
|
parent_sale_no: number;
|
|
target_objid: string;
|
|
sales_deadline_date?: string;
|
|
tax_type?: string;
|
|
tax_invoice_date?: string;
|
|
export_decl_no?: string;
|
|
loading_date?: string;
|
|
sales_slip_date?: string;
|
|
sales_slip_menu_sq?: number;
|
|
remark?: string;
|
|
}
|
|
|
|
export const salesSaleApi = {
|
|
async saleList(filter: SaleListFilter = {}) {
|
|
const res = await apiClient.get("/sales/sale/list", { params: filter });
|
|
return (res.data?.data ?? []) as SaleListRow[];
|
|
},
|
|
async registerSale(body: SaleRegisterBody) {
|
|
return (await apiClient.post("/sales/sale", body)).data?.data;
|
|
},
|
|
async deleteSale(projectNo: string) {
|
|
return (await apiClient.delete(`/sales/sale/${projectNo}`)).data;
|
|
},
|
|
|
|
async revenueList(filter: SaleListFilter = {}) {
|
|
const res = await apiClient.get("/sales/revenue/list", { params: filter });
|
|
return (res.data?.data ?? []) as RevenueListRow[];
|
|
},
|
|
async saveDeadlineInfo(body: DeadlineInfoBody) {
|
|
return (await apiClient.post("/sales/revenue/deadline-info", body)).data?.data;
|
|
},
|
|
async confirmSalesDeadline(logIds: number[]) {
|
|
return (await apiClient.post("/sales/revenue/deadline-confirm", { logIds })).data;
|
|
},
|
|
};
|