Commit 6b885fc5 authored by GuanHua's avatar GuanHua
parents b57c505e 64e6d664
......@@ -309,4 +309,8 @@ a {
.global-block-center {
margin-left: auto !important;
margin-right: auto !important;
}
.ant-modal {
width: 704px !important; // 重置模态框高度
}
\ No newline at end of file
@import './mixins/layout.less';
#root {
// 去除input type为number时的箭头
.ant-input-number-handler-wrap {
display: none;
......
......@@ -336,40 +336,40 @@ const AddProducts: React.FC<{}> = (props) => {
]}
>
<Card>
<Tabs onChange={callback} type="card" defaultActiveKey="1">
<TabPane tab="基本信息" key="1">
<Tabs onChange={callback} type="card" defaultActiveKey="10000">
<TabPane tab="基本信息" key="10001">
<BasicInfoForm
onRef={(refs) => setFormRefs([...formRefs, refs])}
onChangeAttributeList={(_lists: any) => setAttributeList(_lists)} />
</TabPane>
<TabPane tab="选择货品" key="2">
<TabPane tab="选择货品" key="20002">
<SelectGoodsForm />
</TabPane>
<TabPane tab="商品属性" key="3">
<TabPane tab="商品属性" key="30003">
<ProductAttributeForm
onRef={(refs) => setFormRefs([...formRefs, refs])}
attributesData={attributeList}
/>
</TabPane>
<TabPane tab="价格设置" key="4">
<TabPane tab="价格设置" key="40004">
<PriceAttributeForm
onRef={(refs) => setFormRefs([...formRefs, refs])}
/>
</TabPane>
<TabPane tab="商品图片" key="5">
<TabPane tab="商品图片" key="50005">
<ProductImageForm />
</TabPane>
<TabPane tab="商品描述" key="6">
<TabPane tab="商品描述" key="60006">
{
renderTemplate()
}
</TabPane>
<TabPane tab="物流信息" key="7">
<TabPane tab="物流信息" key="70007">
<LogisticsForm
onRef={(refs) => setFormRefs([...formRefs, refs])}
/>
</TabPane>
<TabPane tab="其他" key="8">
<TabPane tab="其他" key="80008">
<OtherForm
onRef={(refs) => setFormRefs([...formRefs, refs])}
/>
......
import React, { useState, useEffect, useRef, useMemo } from 'react'
import {history} from 'umi'
import { Button, Form, Select, Checkbox, Tooltip, Radio, Input, Table, Modal, Row, Col, InputNumber } from 'antd'
import { Button, Form, Select, Checkbox, Tooltip, Radio, Input, Table, Modal, Row, Col, InputNumber, Space } from 'antd'
import styles from './index.less'
import { PublicApi } from '@/services/api'
import { ColumnType } from 'antd/lib/table/interface'
......@@ -68,6 +68,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
productInfoByEdit,
getPriceAttributeFormParamsByEdit,
selectCategoryId,
productAttributeAndImageParams,
} = ProductStore
_tableDataSource = useMemo(() => tableDataSource, [tableDataSource]) // 保持最新值
......@@ -486,8 +487,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
tempArr.push({ numberPrice: null, numberRange: { numberMin: minOrder, numberMax: null } })
setPriceForm.setFieldsValue({ladderPrice: true, ladderRange: tempArr})
}
}
}
}
const changeLadderPrice = (e: any) => {
......@@ -511,6 +511,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
// 校验阶梯范围
const validatorNumberRange = (rule, value, callback) => {
console.log(value,'v')
try {
if(Array.isArray(value)){
let range = value.map(item => {
......@@ -523,7 +524,6 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
[]
)
let result = range.reduce((a, b) => { if(a<b) return b })
// console.log(result, range, 'result')
if(!result) throw new Error('请正确输入阶梯数量范围');
if(range[0]!==minOrderNumber) throw new Error('阶段的起始值必须为最小起订数');
callback()
......@@ -702,6 +702,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
name="settingPrice"
form={setPriceForm}
initialValues={{ladderPrice: false}}
autoComplete="off"
>
{
planPrice!==3 &&
......@@ -728,7 +729,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
}
]}
>
<Form.List name="ladderRange" key={Math.random()}>
<Form.List name="ladderRange">
{(fields, { add, remove }) => {
if (!fields.length) {
add()
......@@ -736,87 +737,63 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
return (
<div>
{fields.map(field => (
<Row key={field.key} gutter={[0, 10]}>
<Row key={ field.key } gutter={[0, 10]}>
<Col span={20} style={{ display: 'flex' }}>
<Item
<Form.Item
{...field}
name={[field.name, 'numberRange', 'numberMin']}
fieldKey={[field.fieldKey, 'numberRange', 'numberMin']}
rules={[
{ required: true, message: '阶梯最小数量为必填项' },
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '阶梯数值仅限三位小数',
}
]}
>
<Input placeholder="最小数量" />
</Form.Item>
<Input
style={{
width: 30,
height: 32,
borderLeft: 0,
borderRight: 0,
pointerEvents: 'none',
}}
placeholder="~"
disabled
/>
<Form.Item
{...field}
name={[field.name, 'numberRange']}
fieldKey={[field.fieldKey, 'numberRange']}
key={'_' + field.fieldKey}
noStyle
name={[field.name, 'numberRange', 'numberMax']}
fieldKey={[field.fieldKey, 'numberRange', 'numberMax']}
rules={[
{ required: true, message: '阶梯最大数量为必填项' },
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '阶梯数值仅限三位小数',
}
]}
>
<Input.Group compact>
<Form.Item
name={[field.name, 'numberRange', 'numberMin']}
noStyle
rules={[
{
required: true,
message: '阶梯最小数量为必填项'
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '阶梯数值小数点后仅限三位',
}
]}
>
<InputNumber min={0} style={{ width: 100, textAlign: 'center' }} placeholder="最小数量" />
</Form.Item>
<Input
style={{
width: 30,
borderLeft: 0,
borderRight: 0,
pointerEvents: 'none',
}}
placeholder="~"
disabled
/>
<Form.Item
name={[field.name, 'numberRange', 'numberMax']}
noStyle
rules={[
{
required: true,
message: '阶梯最大数量为必填项'
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '阶梯数值小数点后仅限三位',
}
]}
>
<InputNumber
min={0}
className={styles.siteInputRight}
style={{
width: 100,
textAlign: 'center',
}}
placeholder="最大数量"
/>
</Form.Item>
</Input.Group>
</Item>
<Item
<Input placeholder="最大数量" />
</Form.Item>
<Form.Item
{...field}
name={[field.name, 'numberPrice']}
fieldKey={[field.fieldKey, 'numberPrice']}
key={'__' + field.fieldKey}
noStyle
rules={[
{
required: true,
message: '阶梯单价为必填项'
},
{ required: true, message: '阶梯单价为必填项' },
{
pattern: /^\d+(\.\d{1,4})?$/,
message: '阶梯单价小数点后仅限四位',
message: '阶梯单价仅限四位小数',
}
]}
style={{marginLeft: 20}}
>
<InputNumber min={0} style={{ width: '50%', marginLeft: 24 }} placeholder="请输入单价" />
</Item>
<Input placeholder="请输入单价" />
</Form.Item>
</Col>
<Col span={4}>
<Button size="small" onClick={() => add()} style={{ marginLeft: 20, marginRight: 8 }} icon={<PlusOutlined />} />
......
......@@ -17,11 +17,22 @@ const formActions = createFormActions();
const AccountLists: React.FC<{}> = () => {
const ref = useRef<any>({})
// "memberName": "L1LCU",
// "memberTypeName": "hgVH2V",
// "memberRoleName": "7V4vEk",
// "memberLevelName": "DT5Q",
// "accountBalance": 1071807455613740.5,
// "lockBalance": -5417889512914380,
// "usableBalance": -604051859942576.9,
// "memberStatus": 6014545168701916,
// "accountStatus": 6386448687731208,
// "createTime": 5022413924183292
const columns: ColumnType<any>[] = [
{
title: '账户归属',
dataIndex: 'name',
key: 'name',
dataIndex: 'memberName',
key: 'memberName',
className: 'commonPickColor',
render: (text, record) => <EyePreview
url={`/memberCenter/payandSettle/capitalAccounts/accountLists/accountDetail?id=${record.id}`}
......@@ -31,18 +42,18 @@ const AccountLists: React.FC<{}> = () => {
},
{
title: '会员类型',
dataIndex: 'type',
key: 'type',
dataIndex: 'memberTypeName',
key: 'memberTypeName',
},
{
title: '会员角色',
dataIndex: ['customerCategory', 'name'],
key: 'customerCategory',
dataIndex: 'memberRoleName',
key: 'memberRoleName',
},
{
title: '会员等级',
dataIndex: ['brand', 'name'],
key: 'brand',
dataIndex: 'memberLevelName',
key: 'memberLevelName',
},
{
title: '会员等级类型',
......@@ -51,24 +62,30 @@ const AccountLists: React.FC<{}> = () => {
},
{
title: '会员状态',
dataIndex: 'unitName',
key: 'unit',
dataIndex: 'memberStatus',
key: 'memberStatus',
},
{
title: '账户状态',
dataIndex: 'unitName',
key: 'unit',
dataIndex: 'accountStatus',
key: 'accountStatus',
},
{
title: '账户余额',
dataIndex: 'accountStatus',
key: 'accountStatus',
render: text => `¥${text}`
},
{
title: '锁定余额',
dataIndex: 'costPrice',
key: 'costPrice',
dataIndex: 'lockBalance',
key: 'lockBalance',
render: text => `¥${text}`
},
{
title: '可用余额',
dataIndex: 'batch',
key: 'batch',
dataIndex: 'usableBalance',
key: 'usableBalance',
render: text => `¥${text}`
},
]
......@@ -77,7 +94,7 @@ const AccountLists: React.FC<{}> = () => {
console.log(params)
return new Promise((resolve, reject) => {
let obj = { ...params }
PublicApi.getProductGoodsGetGoodsList(obj).then(res => {
PublicApi.getPayAssetAccountGetAssetAccountList(obj).then(res => {
resolve(res.data)
})
})
......@@ -99,7 +116,7 @@ const AccountLists: React.FC<{}> = () => {
useStateFilterSearchLinkageEffect(
$,
actions,
'name',
'parentMemberName',
FORM_FILTER_PATH,
);
}}
......
......@@ -15,7 +15,7 @@ export const searchSchema: ISchema = {
grid: true,
},
properties: {
name: {
parentMemberName: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
......@@ -38,17 +38,39 @@ export const searchSchema: ISchema = {
},
},
properties: {
code: {
memberStatus: {
type: 'string',
'x-component-props': {
placeholder: '会员状态'
placeholder: '会员状态',
style: { width: '174px' },
},
enum: [
{
label: '正常',
value: 1,
},
{
label: '已冻结',
value: 2,
}
],
},
batch: {
accountStatus: {
type: 'string',
'x-component-props': {
placeholder: '账户状态'
placeholder: '账户状态',
style: { width: '174px' },
},
enum: [
{
label: '正常',
value: 1,
},
{
label: '已冻结',
value: 2,
}
],
},
applyTime: {
type: "daterange",
......@@ -56,6 +78,7 @@ export const searchSchema: ISchema = {
"[start,end]": {
'x-component-props': {
placeholder: ['开始时间','结束时间'],
style: { width: '174px' },
},
}
}
......
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