Commit 701fc12b authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:处理手工下单商品价格没有算入折扣,处理销售订单待审核订单审核时候无法默认选择已有的电子合同模板

parent 1e1e4c9d
......@@ -798,10 +798,12 @@ export const PurchaseOrderInsideWorkStateTexts = {
2: '一级待审核订单',
3: '二级待审核订单',
4: '待提交订单',
5: '待确认电子合同',
// 5: '待确认电子合同',
5: '提交订单完成',
6: '提交一级审核订单不通过',
7: '提交二级审核订单不通过',
8: '待支付订单',
// 8: '待支付订单',
8: '确认电子合同',
10: '支付成功',
11: '支付失败',
12: '待确认收货',
......
......@@ -189,8 +189,9 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
effects={($, actions) => {
// $('onFormInit').subscribe(() => {
if (data.isElectronicContract === 1) {
useAsyncSelect('contractTemplateId', async () => (await PublicApi.getOrderSelectListContractTemplate()).data, ['name', 'id'])
actions.setFieldValue("contractTemplateId", data.contractTemplateId)
useAsyncSelect('contractTemplateId', async () => (await PublicApi.getOrderSelectListContractTemplate()).data, ['name', 'id']).then(()=>{
actions.setFieldValue("contractTemplateId", data.contractTemplateId)
})
} else {
actions.setFieldState('usingElectronicContracts', state => {
state.value = 0
......
......@@ -30,6 +30,7 @@ import { changeRouterTitleByStatus } from '../../_public/order/utils'
import { ReadyAddOrderDetailContext } from '../context'
import AuditProcess from '@/components/AuditProcess'
import styles from './index.less'
import { toPoint } from '@/utils/type'
export interface PurchaseOrderDetailProps {}
......@@ -180,7 +181,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
orderProductRequests: _orderProductRequests.map(v => {
v.price = 1
v.isMemberPrice = Number(v.isMemberPrice)
v.memberPrice = parseInt(v.memberPrice)
v.memberPrice = toPoint(v.memberPrice)
v.imgUrl = v.mainPic
v.minOrder = v.minOrder
// v.productId = v.id
......
......@@ -5,6 +5,7 @@ import { productInfoColumns } from '../constant';
import ProductTableCell, { ProductEditableRow } from '../components/productTableCell';
import { useModalTable } from './useModalTable';
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
import { toPoint } from '@/utils/type';
export const getUnitPriceTotal = (record) => {
const purchaseCount = Number(record['purchaseCount']) || 0
......@@ -27,7 +28,9 @@ export const getUnitPriceTotal = (record) => {
return false
}
})
return unitPrice * purchaseCount
// 考虑会员折扣
let memberPrice = record?.memberPrice ? toPoint(record.memberPrice) : 1
return unitPrice * purchaseCount * memberPrice
}
export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActions) => {
const productRef = useRef<any>({})
......
export function isString(str: any):str is string {
return typeof str === 'string'
}
// 分数转小数
export const toPoint = (percent: string) => {
let str: any = percent.replace("%","");
str = str / 100;
return str;
}
// 小数转分数
export const toPercent = (point: number) => {
let str = Number(point * 100).toFixed(1);
str += "%";
return str;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment