Commit 1487321a authored by Bill's avatar Bill

Merge branch 'dev-srm' of 10.0.0.22:lingxi/lingxi-business-paltform into dev-srm

parents d033b1f2 412230bc
......@@ -300,7 +300,7 @@
.ant-form-item-label
> label.ant-form-item-required::before {
order: 10;
margin-left: -6px;
// margin-left: -6px;
}
.ant-table-filter-column {
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-21 18:14:10
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-21 18:18:11
* @LastEditTime: 2021-07-03 17:24:28
* @Description: 会员变更信息
*/
import React, { useState, useEffect } from 'react';
......@@ -90,7 +90,7 @@ const MemberChangedInfo: React.FC<IProps> = (props: IProps) => {
const columns: EditableColumns[] = [
{
title: '序号',
dataIndex: 'index',
dataIndex: 'id',
},
{
title: '变更日期',
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-21 17:14:39
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-03 14:57:41
* @LastEditTime: 2021-07-03 17:33:17
* @Description: 会员入库信息
*/
import React from 'react';
......@@ -65,13 +65,16 @@ const MemberDocIncomingInfo: React.FC<IProps> = (props: IProps) => {
<div className={styles.changed}>
{/* {ele.fieldValue} */}
{renderFieldTypeContent(ele.fieldType, ele.fieldValue)}
{ele.lastValue && (
{ele.lastValue && ele.lastValue !== ele.fieldValue && (
<Tooltip title={`变更前:${ele.lastValue}`}>
<span className={styles.new}>NEW</span>
</Tooltip>
)}
</div>
),
columnProps: {
span: 1,
},
});
});
});
......
......@@ -191,6 +191,7 @@ const MemberForm: React.FC<MemberFormProps> = ({
memberTypeId,
roleId,
level,
levelId,
countryCodeId,
phone,
email,
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-04 15:51:19
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-04 15:51:20
* @LastEditTime: 2021-07-03 17:19:58
* @Description:
*/
import { ISchema } from '@formily/antd';
......@@ -41,7 +41,7 @@ export const schema = (groups: GroupItem[]): ISchema => {
wrapperCol: 8,
labelAlign: 'left',
},
properties: createMemberSchema(item.elements),
properties: createMemberSchema(item.elements, false),
},
},
};
......
......@@ -104,12 +104,15 @@ const RULE_REG_MAP = {
4: PATTERN_MAPS.tel,
};
const getFieldType = (field: ElementType) => {
const getFieldType = (field: ElementType, editable: boolean = true) => {
const isDisabled = (!editable && field.fieldValue) || !!field.disabled;
// 默认是 输入框
let description: { [key: string]: any } = {
'x-component-props': {
placeholder: field.fieldRemark,
disabled: !!field.disabled,
disabled: isDisabled,
},
};
// 公共的属性
......@@ -144,7 +147,7 @@ const getFieldType = (field: ElementType) => {
'x-component': 'CustomUpload',
'x-component-props': {
showDesc: false,
disabled: !!field.disabled,
disabled: isDisabled,
},
};
break;
......@@ -154,7 +157,7 @@ const getFieldType = (field: ElementType) => {
'x-component': 'RadioGroup',
enum: field.fieldEnum,
'x-component-props': {
disabled: !!field.disabled,
disabled: isDisabled
},
};
break;
......@@ -163,7 +166,7 @@ const getFieldType = (field: ElementType) => {
description = {
enum: field.fieldEnum,
'x-component-props': {
disabled: !!field.disabled,
disabled: isDisabled,
},
};
break;
......@@ -173,7 +176,7 @@ const getFieldType = (field: ElementType) => {
'x-component': 'CheckboxGroup',
enum: field.fieldEnum,
'x-component-props': {
disabled: !!field.disabled,
disabled: isDisabled,
},
};
break;
......@@ -182,7 +185,7 @@ const getFieldType = (field: ElementType) => {
description = {
'x-component': 'AreaSelect',
'x-component-props': {
disabled: !!field.disabled,
disabled: isDisabled,
},
};
break;
......@@ -193,15 +196,20 @@ const getFieldType = (field: ElementType) => {
return Object.assign({}, description, common);
};
// 根据后台生成注册资料 schema
export function createMemberSchema(elements: ElementType[]) {
/**
* 根据后台生成注册资料 schema
* @param elements
* @param editable 有值的元素是否可编辑
* @returns
*/
export function createMemberSchema(elements: ElementType[], editable: boolean = true) {
const components = {};
if (!Array.isArray(elements)) {
return components;
}
for (let item of elements) {
components[item.fieldName as string] = getFieldType(item);
components[item.fieldName as string] = getFieldType(item, editable);
}
return components;
};
......
import React, { useRef } from 'react';
import { } from 'antd';
import { Table } from 'antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import Card from '../../../card';
......@@ -8,17 +8,21 @@ export interface ListLayoutIProps {
/** 锚点 */
anchor?: string,
/** id */
id: string | number,
id?: string | number,
/** 标题 */
title: string,
/** columns */
columns: ColumnType<any>[],
/** 接口 */
fetch?: () => Promise<unknown>,
/** 是否请求 */
done?: boolean,
/** 展示的数据 */
data?: [],
}
const ListLayout: React.FC<ListLayoutIProps> = (props: any) => {
const { anchor, id, title, columns, fetch } = props;
const { anchor, id, title, columns, fetch, done, data } = props;
const currentRef = useRef({});
const fetchTableData = (params: any) => {
......@@ -34,12 +38,22 @@ const ListLayout: React.FC<ListLayoutIProps> = (props: any) => {
id={anchor}
title={title}
>
<StandardTable
currentRef={currentRef}
columns={columns}
tableProps={{ rowKey: 'id' }}
fetchTableData={(params: any) => fetchTableData(params)}
/>
{!done && (
<StandardTable
currentRef={currentRef}
columns={columns}
tableProps={{ rowKey: 'id' }}
fetchTableData={(params: any) => fetchTableData(params)}
/>
)}
{done && (
<Table
rowKey="id"
columns={columns}
dataSource={data}
pagination={false}
/>
)}
</Card>
)
}
......
......@@ -93,7 +93,21 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
useEffect(() => {
if (isEdit && spam) {
const data: any = JSON.parse(sessionStorage.getItem(spam));
const inquiryListProductRequests: any[] = [];
inquiryListProductRequests.push({
commodityId: id,
productId: data.id,
productName: data.name,
category: data.category,
brand: data.brand.name,
unit: data.unitName,
purchaseCount: 1,
logistics: data.logistics,
memberId: data.memberId,
memberRoleId: data.memberRoleId
})
setInquiryProduct(inquiryListProductRequests)
} else if (isEdit) {
PublicApi.getTransactionInquiryListDetails({ id }).then(res => {
if (res.code !== 1000) {
......@@ -114,7 +128,6 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
children: data.fullAddress,
})
setInquiryProduct(data.inquiryListProductRequests)
console.log(data.inquiryListProductRequests)
form.setFieldsValue({
"inquiryListProductRequests": data.inquiryListProductRequests
})
......
import React, { Fragment, useCallback, useEffect, useState } from 'react';
import { Button, message } from 'antd';
import { Button, message, Typography, Space } from 'antd';
import { history } from 'umi';
import { ColumnType } from 'antd/lib/table/interface';
import PeripheralLayout from '@/pages/transaction/components/detailLayout';
......@@ -83,38 +83,45 @@ const LogisticsBillManageDetail = () => {
const columns: ColumnType<any>[] = [
{
title: '商品ID/名称',
key: 'id',
dataIndex: 'id',
key: 'productId',
dataIndex: 'productId',
render: (text: any, record: any) => (
<Space direction="vertical" size={0}>
<Typography.Text>{text}</Typography.Text>
<Typography.Text>{record.productName}</Typography.Text>
</Space>
)
},
{
title: '品类',
key: 'category',
dataIndex: 'category',
key: 'categoryName',
dataIndex: 'categoryName',
},
{
title: '品牌',
key: 'brand',
dataIndex: 'brand',
key: 'brandName',
dataIndex: 'brandName',
},
{
title: '数量/单位',
key: 'purchaseCount',
dataIndex: 'purchaseCount',
key: 'amount',
dataIndex: 'amount',
render: (text: any, record: any) => <Typography.Text>{`${text}/${record.unitName}`}</Typography.Text>
},
{
title: <>箱数<br />合计:{dataSource.totalCarton}</>,
key: 'purchaseCount',
dataIndex: 'purchaseCount',
key: 'carton',
dataIndex: 'carton',
},
{
title: <>重量(KG)<br />合计:{dataSource.totalWeight}</>,
key: 'purchaseCount',
dataIndex: 'purchaseCount',
key: 'weight',
dataIndex: 'weight',
},
{
title: <>体积(M3)<br />合计:{dataSource.totalVolume}</>,
key: 'purchaseCount',
dataIndex: 'purchaseCount',
key: 'volume',
dataIndex: 'volume',
},
]
......@@ -202,11 +209,11 @@ const LogisticsBillManageDetail = () => {
<ProgressLayout />
<BasicLayout effect={basicEffect} />
<ListLayout
id={id}
anchor="logisticsBillLayout"
title="物流单明细"
anchor="logisticsBillLayout"
columns={columns}
fetch={PublicApi.getTransactionEnquiryProductList}
done={true}
data={dataSource.detailList}
/>
<FreightLayout
anchor="freightLayout"
......
import React, { Fragment, useCallback, useEffect, useState } from 'react';
import { Typography, Space } from 'antd'
import { history } from 'umi';
import { ColumnType } from 'antd/lib/table/interface';
import PeripheralLayout from '@/pages/transaction/components/detailLayout';
......@@ -75,38 +76,45 @@ const LogisticsBillSubmitDetail = () => {
const columns: ColumnType<any>[] = [
{
title: '商品ID/名称',
key: 'id',
dataIndex: 'id',
key: 'productId',
dataIndex: 'productId',
render: (text: any, record: any) => (
<Space direction="vertical" size={0}>
<Typography.Text>{text}</Typography.Text>
<Typography.Text>{record.productName}</Typography.Text>
</Space>
)
},
{
title: '品类',
key: 'category',
dataIndex: 'category',
key: 'categoryName',
dataIndex: 'categoryName',
},
{
title: '品牌',
key: 'brand',
dataIndex: 'brand',
key: 'brandName',
dataIndex: 'brandName',
},
{
title: '数量/单位',
key: 'purchaseCount',
dataIndex: 'purchaseCount',
key: 'amount',
dataIndex: 'amount',
render: (text: any, record: any) => <Typography.Text>{`${text}/${record.unitName}`}</Typography.Text>
},
{
title: <>箱数<br />合计:{dataSource.totalCarton}</>,
key: 'purchaseCount',
dataIndex: 'purchaseCount',
key: 'carton',
dataIndex: 'carton',
},
{
title: <>重量(KG)<br />合计:{dataSource.totalWeight}</>,
key: 'purchaseCount',
dataIndex: 'purchaseCount',
key: 'weight',
dataIndex: 'weight',
},
{
title: <>体积(M3)<br />合计:{dataSource.totalVolume}</>,
key: 'purchaseCount',
dataIndex: 'purchaseCount',
key: 'volume',
dataIndex: 'volume',
},
]
......@@ -161,11 +169,11 @@ const LogisticsBillSubmitDetail = () => {
<ProgressLayout />
<BasicLayout effect={basicEffect} />
<ListLayout
id={id}
anchor="logisticsBillLayout"
title="物流单明细"
anchor="logisticsBillLayout"
columns={columns}
fetch={PublicApi.getTransactionEnquiryProductList}
done={true}
data={dataSource.detailList}
/>
<FreightLayout anchor="freightLayout" title="运费" effect={freightEffect} />
<RecordLyout />
......
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