Commit 1c8a6b02 authored by GuanHua's avatar GuanHua
parents a4d80800 31ad1b5f
......@@ -1152,7 +1152,8 @@ export const SaleOrderTransformInsideWorkStateTexts = {
13: '不接受订单',
14: '确认未到账',
15: '审核不通过',
16: '不接受物流单'
16: '不接受物流单',
17: '审核不通过',
}
export const PayOutWorkStateTexts = {
......
......@@ -2,12 +2,12 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 09:54:04
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-07 13:57:03
* @LastEditTime: 2021-02-04 15:32:24
* @Description: 退货地址信息
*/
import React from 'react';
import React, { useEffect } from 'react';
import MellowCard from '@/components/MellowCard';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import { createAsyncFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { useLinkageUtils } from '@/utils/formEffectUtils';
......@@ -15,7 +15,7 @@ import NiceForm from '@/components/NiceForm';
import { schema } from './schema';
import styles from './index.less';
const modalFormActions = createFormActions();
const modalFormActions = createAsyncFormActions();
const {
onFieldValueChange$,
onFieldInputChange$,
......@@ -74,6 +74,25 @@ const ReturnAddressInfo: React.FC<ReturnAddressInfo> = ({
onSubmit,
}) => {
useEffect(() => {
const { setFieldState } = modalFormActions;
if (isEdit) {
setFieldState('deliveryAddress', state => {
state.visible = true;
});
setFieldState('deliveryAddressShow', state => {
state.visible = false;
});
} else {
setFieldState('deliveryAddress', state => {
state.visible = false;
});
setFieldState('deliveryAddressShow', state => {
state.visible = true;
});
}
}, [isEdit]);
const handleSubmit = values => {
};
......@@ -134,14 +153,6 @@ const ReturnAddressInfo: React.FC<ReturnAddressInfo> = ({
onFieldValueChange$('deliveryType').subscribe(fieldState => {
const { name, value } = fieldState;
if (isEdit) {
linkage.show('deliveryAddress');
linkage.hide('deliveryAddressShow');
} else {
linkage.hide('deliveryAddress');
linkage.show('deliveryAddressShow');
}
switch (value) {
// 物流
case 1: {
......
......@@ -50,7 +50,7 @@ export const constructTableData = (data: any, ctx: ISchemaFormActions | ISchemaF
let col: any = [...columnsUnitProduct]
let temp: any = []
console.log(data, 'dataSoruce')
// 兼容编辑价格策略 新增使用data 编辑使用data[0].commodityUnitPrice
let _data_column = pageStatus === PageStatus.ADD ? data[0] : data[0]["commodityUnitPrice"]
_data_column.attributeAndValueList.map(_item => {
......
......@@ -130,6 +130,7 @@ const PriceModal:React.FC<PriceModalProps> = (props) => {
)
let result = range.map(Number).reduce((a, b) => { if(a<b) return b })
if(!result) throw new Error('请正确输入阶梯数量范围');
if(Number(range[0]) !== schemaAction.getFieldValue("minOrder")) throw new Error('阶段的起始值必须为最小起订数');
callback()
}
} catch (err) {
......
......@@ -91,6 +91,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
}
const handleSetProductPrice = (record: any) => {
console.log(record, 'record')
if(record?.id) {
priceRef.current.setVisible(true)
priceRef.current.setCurrentSetPriceRow(record)
......
......@@ -66,6 +66,7 @@ const ProductModal:React.FC<ProductModalProps> = (props) => {
schemaAction.setFieldValue('productName', selectResult.name)
schemaAction.setFieldValue('productId', selectResult.id)
schemaAction.setFieldValue('minOrder', selectResult.minOrder)
clearModalParams()
}
......
......@@ -234,6 +234,10 @@ export const setPriceSchema: ISchema = {
type: 'string',
display: false
},
minOrder: {
type: 'number',
display: false
},
priceType: {
type: 'radio',
title: '商品定价',
......
......@@ -83,6 +83,19 @@ export const ProductTableCell:React.FC<ProductTableCellProps> = ({
}
}
// 校验最小起订
const validatorNumber = (rule, value, callback) => {
try {
let _value = Number(value)
if(isNaN(_value) || _value < Number(record["minOrder"])) {
throw new Error(`数量不小于最小起订数${record["minOrder"]}`)
}
callback()
} catch (err) {
callback(err)
}
}
let childNode = children;
if (editable) {
childNode =
......@@ -99,6 +112,9 @@ export const ProductTableCell:React.FC<ProductTableCellProps> = ({
pattern: /^\d+(\.\d{1,3})?$/,
message: '采购数量仅限三位小数',
},
{
validator: validatorNumber
}
]}
>
{chooseFormItem(formItem, record[dataIndex] || '')}
......
......@@ -355,9 +355,9 @@ export const mergeParentTableColumns: any[] = [
},
{
title: '采购商名称',
dataIndex: 'supplyMembersName',
dataIndex: 'membersName',
align: 'center',
key: 'supplyMembersName',
key: 'membersName',
},
{
title: '下单时间',
......
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