Commit d9698617 authored by GuanHua's avatar GuanHua

Merge branch 'dev' into test

parents 3cf401e1 1ec4dc25
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
"god": "^0.2.1", "god": "^0.2.1",
"immutability-helper": "^3.1.1", "immutability-helper": "^3.1.1",
"lingxi-design": "^1.0.8", "lingxi-design": "^1.0.8",
"lingxi-design-ui": "^1.1.10", "lingxi-design-ui": "^1.1.14",
"lingxi-editor-core": "^1.0.6", "lingxi-editor-core": "^1.0.6",
"lingxi-web": "^1.0.6", "lingxi-web": "^1.0.6",
"lint-staged": "^10.0.7", "lint-staged": "^10.0.7",
......
...@@ -42,7 +42,7 @@ const BrandSetting: React.FC<ShopSettingPropsType> = (props) => { ...@@ -42,7 +42,7 @@ const BrandSetting: React.FC<ShopSettingPropsType> = (props) => {
useEffect(() => { useEffect(() => {
fetchBrandsList() fetchBrandsList()
}, [filterParam]) }, [filterParam, current])
const fetchBrandsList = () => { const fetchBrandsList = () => {
let param = { let param = {
...@@ -84,7 +84,6 @@ const BrandSetting: React.FC<ShopSettingPropsType> = (props) => { ...@@ -84,7 +84,6 @@ const BrandSetting: React.FC<ShopSettingPropsType> = (props) => {
const handlePageChange = (page: number, pageSize?: number | undefined) => { const handlePageChange = (page: number, pageSize?: number | undefined) => {
setCurrent(page) setCurrent(page)
setPageSize(pageSize || 10) setPageSize(pageSize || 10)
fetchBrandsList()
} }
const handleSearch = () => { const handleSearch = () => {
......
...@@ -9,6 +9,26 @@ const GoodsItem: React.FC<GoodsItemPropsType> = (props) => { ...@@ -9,6 +9,26 @@ const GoodsItem: React.FC<GoodsItemPropsType> = (props) => {
const { dataInfo = {} } = props const { dataInfo = {} } = props
const renderPriceByType = (info: any) => {
switch (info.priceType) {
case 1:
return (
<div className={styles.goods_item_info_price}>
<i></i>
<span>{dataInfo.priceRange || dataInfo.goodsPrice}</span>
</div>
)
case 2:
return (
<div className={styles.inquiry_price}>
<label>在线询价</label>
</div>
)
default:
break
}
}
return ( return (
<div className={styles.goods_item}> <div className={styles.goods_item}>
<div className={styles.goods_item_imgbox}> <div className={styles.goods_item_imgbox}>
...@@ -16,10 +36,7 @@ const GoodsItem: React.FC<GoodsItemPropsType> = (props) => { ...@@ -16,10 +36,7 @@ const GoodsItem: React.FC<GoodsItemPropsType> = (props) => {
</div> </div>
<div className={styles.goods_item_info}> <div className={styles.goods_item_info}>
<div className={styles.goods_item_info_name}>{dataInfo.goodsName}</div> <div className={styles.goods_item_info_name}>{dataInfo.goodsName}</div>
<div className={styles.goods_item_info_price}> { renderPriceByType(dataInfo) }
<i></i>
<span>{dataInfo.priceRange || dataInfo.goodsPrice}</span>
</div>
<div className={styles.goods_item_info_brief}> <div className={styles.goods_item_info_brief}>
<span>品类:</span> <span>品类:</span>
<span>{dataInfo.categoryName}</span> <span>{dataInfo.categoryName}</span>
......
...@@ -14,6 +14,17 @@ ...@@ -14,6 +14,17 @@
} }
} }
.inquiry_price {
color: #FFF;
background-color: #D32F2F;
font-size: 12px;
height: 18px;
line-height: 14px;
padding: 2px 8px;
display: inline-block;
margin-top: 2px;
}
&_info { &_info {
flex-grow: 1; flex-grow: 1;
width: 0; width: 0;
......
...@@ -95,7 +95,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => { ...@@ -95,7 +95,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
useEffect(() => { useEffect(() => {
fetchGoodsList() fetchGoodsList()
}, [filterParam]) }, [filterParam, current])
const fetchGoodsList = () => { const fetchGoodsList = () => {
let param = { let param = {
...@@ -150,7 +150,6 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => { ...@@ -150,7 +150,6 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const handlePageChange = (page: number, pageSize?: number | undefined) => { const handlePageChange = (page: number, pageSize?: number | undefined) => {
setCurrent(page) setCurrent(page)
setPageSize(pageSize || 10) setPageSize(pageSize || 10)
fetchGoodsList()
} }
const handleSearch = () => { const handleSearch = () => {
......
...@@ -63,15 +63,17 @@ const Add: React.FC<{}> = () => { ...@@ -63,15 +63,17 @@ const Add: React.FC<{}> = () => {
return ( return (
<Space> <Space>
<ProcessDetail <ProcessDetail
id={record.goodsId} id={record.commodityId}
type={"view"} type={"view"}
quantity={record.processNum} quantity={record.processNum}
primaryKey={record.id}
processUnitPrice={record.processUnitPrice} processUnitPrice={record.processUnitPrice}
> >
<a>查看</a> <a>查看</a>
</ProcessDetail> </ProcessDetail>
<ProcessDetail <ProcessDetail
id={record.goodsId} id={record.commodityId}
primaryKey={record.id}
type={"edit"} type={"edit"}
submit={handleChangeSomeList} submit={handleChangeSomeList}
quantity={record.processNum} quantity={record.processNum}
...@@ -261,7 +263,7 @@ const Add: React.FC<{}> = () => { ...@@ -261,7 +263,7 @@ const Add: React.FC<{}> = () => {
specs: item.productProps && item.productProps.map((item) => { specs: item.productProps && item.productProps.map((item) => {
return { return {
name: item.customerAttribute.name, name: item.customerAttribute.name,
value: item.customerAttribute.name value: item.customerAttributeValue.value
} }
}) || [], }) || [],
annex: item.files.map((item) => ({name: item.name, value: item.url})) annex: item.files.map((item) => ({name: item.name, value: item.url}))
...@@ -303,7 +305,7 @@ const Add: React.FC<{}> = () => { ...@@ -303,7 +305,7 @@ const Add: React.FC<{}> = () => {
const handleChangeSomeList = (values: any) => { const handleChangeSomeList = (values: any) => {
let someList = formActions.getFieldValue('Tabs.tab-2.layout.someLists'); let someList = formActions.getFieldValue('Tabs.tab-2.layout.someLists');
const index = someList.findIndex((item) => item.goodsId == values.id); const index = someList.findIndex((item) => item.id == values.primaryKey);
if(index > -1) { if(index > -1) {
someList[index] = { someList[index] = {
...someList[index], ...someList[index],
......
...@@ -90,7 +90,7 @@ const basicTab = { ...@@ -90,7 +90,7 @@ const basicTab = {
value: 2 value: 2
} }
], ],
default: 2 default: 1
}, },
deliveryDate: { deliveryDate: {
......
import React from 'react';
import moment from 'moment';
import DrawerProcessDetail from '../../components/ProcessDetail/DrawerProcessDetail';
import { ColumnsType } from 'antd/es/table';
/**
* 通知单明细
*/
export const columns = [
{
title: '订单号',
dataIndex: 'orderNo',
},
{
title: 'ID',
dataIndex: 'id',
},
{
title: '商品名称',
dataIndex: 'goodsName',
},
{
title: '品类',
dataIndex: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
},
{
title: '加工数量',
dataIndex: 'processNum',
},
{
title: '加工单价',
dataIndex: 'processPrice',
},
{
title: '加工费',
dataIndex: 'processTotalPrice',
},
{
title: '交期',
dataIndex: 'deliveryDate',
render: (text, record) => {
return moment(text).format('YYYY-MM-DD');
}
},
{
title: '操作',
dataIndex: 'action',
render: (text, record) => {
return (
<DrawerProcessDetail
type="view"
id={record.goodsId}
brand={record.brand}
category={record.category}
name={record.goodsName}
productProps={record.property.specs}
files={record.property.annex}
unitName={record.unit}
quantity={record.processNum}
processUnitPrice={record.processPrice}
>
<a>查看加工明细</a>
</DrawerProcessDetail>
)
}
},
];
/**
* 外部工作流记录
*/
export const innerWorkFlowRecordColumn: ColumnsType = [
{
title: '流转记录',
dataIndex: 'id'
},
{
title: '操作人',
dataIndex: 'userId',
},
{
title: '部门',
dataIndex: 'department'
},
{
title: '职位',
dataIndex: 'jobTitle'
},
{
title: '状态',
dataIndex: 'status'
},
{
title: '操作',
dataIndex: 'operate'
},
{
title: '操作时间',
dataIndex: 'operateTime'
},
{
title: '审核意见',
dataIndex: 'opinion'
}
]
/**
* 内部流转
*/
export const outerWorkflowRecordsColumn: ColumnsType = [
{
title: '流转顺序号',
dataIndex: 'id'
},
{
title: '操作角色',
dataIndex: 'roleId',
},
{
title: '状态',
dataIndex: 'roleName'
},
{
title: '操作',
dataIndex: 'operate'
},
{
title: '操作时间',
dataIndex: 'operateTime'
},
{
title: '审核意见',
dataIndex: 'opinion'
}
]
...@@ -7,12 +7,12 @@ import Circulation from '../../components/Circulation'; ...@@ -7,12 +7,12 @@ import Circulation from '../../components/Circulation';
import WrapTable from '../../components/WrapTable'; import WrapTable from '../../components/WrapTable';
import OtherRequirement from '../../components/OtherRequirement'; import OtherRequirement from '../../components/OtherRequirement';
import Appendix from '../../components/Appendix'; import Appendix from '../../components/Appendix';
import ProcessDetail from '../../components/ProcessDetail';
import { usePageStatus } from '@/hooks/usePageStatus' import { usePageStatus } from '@/hooks/usePageStatus'
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import StatusTag from '@/components/StatusTag'; import StatusTag from '@/components/StatusTag';
import DeliveryInfomation from '../../components/DeliveryInformation'; import DeliveryInfomation from '../../components/DeliveryInformation';
import moment from 'moment'; import moment from 'moment';
import { columns, innerWorkFlowRecordColumn, outerWorkflowRecordsColumn } from './columns';
const { TabPane } = Tabs; const { TabPane } = Tabs;
const Detail: React.FC<{}> = () => { const Detail: React.FC<{}> = () => {
...@@ -73,7 +73,7 @@ const Detail: React.FC<{}> = () => { ...@@ -73,7 +73,7 @@ const Detail: React.FC<{}> = () => {
<div style={{marginTop: '20px'}}> <div style={{marginTop: '20px'}}>
<Card> <Card>
<h1 style={{fontSize: '16px', marginBottom: '16px'}}><strong>通知单明细</strong></h1> <h1 style={{fontSize: '16px', marginBottom: '16px'}}><strong>通知单明细</strong></h1>
<WrapTable dataSource={info?.details}/> <WrapTable dataSource={info?.details} columns={columns}/>
</Card> </Card>
</div> </div>
...@@ -81,7 +81,7 @@ const Detail: React.FC<{}> = () => { ...@@ -81,7 +81,7 @@ const Detail: React.FC<{}> = () => {
<Card bodyStyle={{padding: '10px 24px 24px 24px'}}> <Card bodyStyle={{padding: '10px 24px 24px 24px'}}>
<Tabs> <Tabs>
<TabPane tab="收发货统计" key="1"> <TabPane tab="收发货统计" key="1">
<WrapTable dataSource={[]} /> <WrapTable columns={columns} dataSource={[]} />
</TabPane> </TabPane>
<TabPane tab="收发货明细" key="2"> <TabPane tab="收发货明细" key="2">
<WrapTable dataSource={[]} /> <WrapTable dataSource={[]} />
...@@ -101,10 +101,10 @@ const Detail: React.FC<{}> = () => { ...@@ -101,10 +101,10 @@ const Detail: React.FC<{}> = () => {
<div style={{marginTop: '20px'}}> <div style={{marginTop: '20px'}}>
<Row justify="space-between"> <Row justify="space-between">
<Col flex={4}> <Col flex={4}>
<OtherRequirement /> <OtherRequirement explain={info.otherAsk?.explain} />
</Col> </Col>
<Col flex={2} style={{marginLeft: '20px'}} > <Col flex={2} style={{marginLeft: '20px'}} >
<Appendix /> <Appendix files={info.otherAsk?.annex}/>
</Col> </Col>
</Row> </Row>
</div> </div>
...@@ -112,10 +112,16 @@ const Detail: React.FC<{}> = () => { ...@@ -112,10 +112,16 @@ const Detail: React.FC<{}> = () => {
<Card bodyStyle={{padding: '10px 24px 24px 24px'}}> <Card bodyStyle={{padding: '10px 24px 24px 24px'}}>
<Tabs> <Tabs>
<TabPane tab="外部流转记录" key="1"> <TabPane tab="外部流转记录" key="1">
<WrapTable dataSource={info.outerWorkflowRecordsList} /> <WrapTable
columns={outerWorkflowRecordsColumn}
dataSource={info.outerWorkflowRecordsList}
/>
</TabPane> </TabPane>
<TabPane tab="内部流转记录" key="2"> <TabPane tab="内部流转记录" key="2">
<WrapTable dataSource={info.innerWorkflowRecordsList}/> <WrapTable
columns={innerWorkFlowRecordColumn}
dataSource={info.innerWorkflowRecordsList}
/>
</TabPane> </TabPane>
</Tabs> </Tabs>
</Card> </Card>
......
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
* @Description: 附件 * @Description: 附件
*/ */
import React from 'react'; import React from 'react';
import { Card } from 'antd'; import { Card } from 'antd';
const styles = { const styles = {
display: 'flex', display: 'flex',
flexDirection: 'row', flexDirection: 'row',
alignItem: 'center', alignItem: 'center',
...@@ -17,21 +17,35 @@ ...@@ -17,21 +17,35 @@
padding: '10px 15px', padding: '10px 15px',
cursor: 'pointer', cursor: 'pointer',
height: '100%' height: '100%'
} }
const AppendixItem = () => {
const AppendixItem = (props) => {
return ( return (
<div style={styles}>工程技术资料.pdf</div> <div style={styles}>{props.name}</div>
) )
} }
interface Iprops {
files: any[]
}
const Appendix = () => { const Appendix: React.FC<Iprops> = (props) => {
const { files = [] } = props;
return ( return (
<> <>
<Card title={"附件"} style={{height: '100%'}}> <Card title={"附件"} style={{height: '100%'}}>
<AppendixItem /> {
files.map((item, key) => {
return (
<AppendixItem key={key} name={item.name} value={item.value}/>
)
})
}
</Card> </Card>
</> </>
) )
} }
export default Appendix; export default Appendix;
\ No newline at end of file
...@@ -22,7 +22,7 @@ const DeliveryInfomation: React.FC<Iprops> = (props) => { ...@@ -22,7 +22,7 @@ const DeliveryInfomation: React.FC<Iprops> = (props) => {
{/* <OtherRequirement /> */} {/* <OtherRequirement /> */}
<Row style={{marginBottom: '20px'}}> <Row style={{marginBottom: '20px'}}>
<Col span={6}>配送方式</Col> <Col span={6}>配送方式</Col>
<Col>{props.deliveryType}</Col> <Col>{props.deliveryType == 1 ? '物流' : '自提'}</Col>
</Row> </Row>
<Row> <Row>
<Col span={6}>交期</Col> <Col span={6}>交期</Col>
......
...@@ -38,6 +38,7 @@ const SearchForm = (props) => { ...@@ -38,6 +38,7 @@ const SearchForm = (props) => {
state.props["x-component-props"]["loading"] = true; state.props["x-component-props"]["loading"] = true;
}) })
props.request(values).then((res) => { props.request(values).then((res) => {
console.log(res);
if(res.code === 1000) { if(res.code === 1000) {
setTableStatus({dataSource:res.data.data, totalCount: res.data.totalCount}) setTableStatus({dataSource:res.data.data, totalCount: res.data.totalCount})
} else { } else {
......
import React from 'react'; import React from 'react';
import { Card, Row, Col } from 'antd'; import { Card, Row, Col } from 'antd';
const OtherRequirement = () => {
interface Iexpain {
[key: string]: string
}
interface Iprops {
explain: Iexpain[]
}
const OtherRequirement: React.FC<Iprops> = (props) => {
const { explain = [] } = props;
return ( return (
<Card title="其他要求"> <Card title="其他要求">
<Row> {
<Col span={3}>交付说明</Col> [0,1,2].map((item) => {
<Col span={8}>东莞市石龙镇西葫芦53号交付说明</Col> return (
<Col span={3}>物流说明</Col> <Row style={{marginBottom: '15px'}} key={item}>
<Col span={8}>东莞市石龙镇西葫芦53号交付说明</Col> {
</Row> explain.slice(item * 2, item * 2 + 2).map((i) => {
<Row style={{margin: '20px 0'}}> return (
<Col span={3}>付款说明</Col> <React.Fragment key={i.name} >
<Col span={8}>首付 30%, 收货后70%</Col> <Col span={3}>{i.name}</Col>
<Col span={3}>包装说明</Col> <Col span={8}>{i.value}</Col>
<Col span={8}>纸箱</Col> </React.Fragment>
</Row> )
<Row> })
<Col span={3}>税收说明</Col> }
<Col span={8}>含税</Col>
<Col span={3}>其他说明</Col>
<Col span={8}></Col>
</Row> </Row>
)
})
}
</Card> </Card>
) )
} }
......
import React, { useState, useEffect } from 'react';
import { Button, Drawer } from 'antd';
import Content from './content';
import { PublicApi } from '@/services/api'
import { createFormActions } from '@formily/antd'
const actions = createFormActions();
interface Iprops {
type: string, // veiw | edit,
id: string,
brand: string,
category: string,
name: string,
productProps: any[],
files: IfileProps[],
unitName: string,
quantity?: string,
processUnitPrice?: string
}
interface IfileProps {
name: string,
url: string
}
const DrawerProcessDetail: React.FC<Iprops> = (props) => {
const { id, brand, category, name, productProps, files, unitName, quantity, processUnitPrice} = props;
const [visible, setVisible] = useState<boolean>(false);
const onClose = () => {
setVisible(false)
}
const onOpen = () => {
setVisible(true)
}
return (
<>
<div onClick={onOpen}>
{props.children}
</div>
<Drawer
title="查看加工明细"
width={720}
onClose={onClose}
visible={visible}
bodyStyle={{ padding: '0'}}
footer={
<div
style={{
textAlign: 'right',
}}
>
<Button onClick={onClose} style={{ marginRight: 8 }}>
取消
</Button>
<Button onClick={onClose} type="primary">
确认
</Button>
</div>
}
>
<Content
name={name}
id={id}
brand={brand}
category={category}
unitName={unitName}
productProps={productProps}
quantity={quantity}
processUnitPrice={processUnitPrice}
type={"detail"}
files={files}
actions={actions}
/>
</Drawer>
</>
)
}
export default DrawerProcessDetail;
\ No newline at end of file
import React, { useState, useRef } from 'react'; import React, { useState, useRef, useEffect } from 'react';
import styles from './content.less'; import styles from './content.less';
import { Row, Col } from 'antd'; import { Row, Col, Anchor } from 'antd';
import classnames from 'classnames'; import classnames from 'classnames';
import {FileList, UploadFile} from '../../components/UploadFile'; import {FileList, UploadFile} from '../../components/UploadFile';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
const menuList = ["基本信息", "产地", "外观尺寸", "工艺", "特殊说明/其他", "附件", "加工要求"];
const HEIGHT_MAP = {
'基本信息': 0,
'产地': 238,
'外观尺寸': 476,
'工艺': 238 * 3,
'特殊说明/其他': 238 * 4,
'附件': 238 * 4 + 60,
'加工要求': 238 * 4 + 60
}
const schema = { const schema = {
type: 'object', type: 'object',
...@@ -56,8 +46,9 @@ const schema = { ...@@ -56,8 +46,9 @@ const schema = {
} }
const Content = (props) => { const Content = (props) => {
const { id, name, category, brand, unitName, files, productProps = [], quantity, processUnitPrice } = props; const { id, name, category, brand, unitName, files, productProps, quantity, processUnitPrice } = props;
const [active, setActive] = useState<string>("基本信息"); const [active, setActive] = useState<string>("基本信息");
const [menu, setMenu] = useState([])
const ref = useRef(null); const ref = useRef(null);
const getMenuItemCs = (name: string) => { const getMenuItemCs = (name: string) => {
...@@ -68,24 +59,38 @@ const Content = (props) => { ...@@ -68,24 +59,38 @@ const Content = (props) => {
} }
const activeAndScroll = (item) => { const activeAndScroll = (item) => {
const scrollHeight = HEIGHT_MAP[item]; setActive(item.name);
console.log(scrollHeight); ref.current.scrollTop = item.value;
setActive(item); }
// window.scrollTo = scrollHeight;
console.log(ref.current); useEffect(() => {
ref.current.scrollTop = scrollHeight; const basic = [{name: '基本信息', value: 0}]; // 238
let height = 238;
let flag = false;
const attributes = productProps && productProps.map((item) => {
const prevHeight = height;
height = height + 112;
flag = true;
return {
name: item.customerAttribute?.name || item.name,
value: prevHeight
} }
}) || [];
const files = [{name: '附件', value: flag ? height : height - 112}];
height += 130;
const progress = [{name: '加工要求', value: height}];
setMenu(basic.concat(attributes, files, progress));
}, [productProps])
return ( return (
<div className={styles.container}> <div className={styles.container}>
<div className={styles.menu}> <div className={styles.menu}>
{ {
menuList.map((item:string) => { menu.map((item,key) => {
return ( return (
<div <div key={item.name} className={getMenuItemCs(item.name)} onClick={() => activeAndScroll(item)}>
key={item} className={getMenuItemCs(item)} {item.name}
onClick={() => activeAndScroll(item) </div>
}>{item}</div>
) )
}) })
} }
...@@ -114,17 +119,14 @@ const Content = (props) => { ...@@ -114,17 +119,14 @@ const Content = (props) => {
</div> </div>
</div> </div>
{ {
productProps.map((item) => { productProps && productProps.map((item, key) => {
const value = item.customerAttributeValueList.reduce((prev, current) => {
return prev += current.value + ","
}, "")
return ( return (
<div className={styles.common} key={item.id}> <div className={styles.common} key={key}>
<div className={styles.header}>{item.customerAttribute.name}</div> <div className={styles.header}>{item.customerAttribute?.name || item.name}</div>
<div className={styles.info}> <div className={styles.info}>
<Row className={styles.infoRow}> <Row className={styles.infoRow}>
<Col className={styles.label} span={4}>{item.customerAttribute.name}</Col> <Col className={styles.label} span={4}>{item.customerAttribute?.name || item.name}</Col>
<Col span={12}>{value}</Col> <Col span={12}>{item.customerAttributeValue?.value || item.value}</Col>
</Row> </Row>
</div> </div>
</div> </div>
...@@ -132,7 +134,7 @@ const Content = (props) => { ...@@ -132,7 +134,7 @@ const Content = (props) => {
}) })
} }
<div className={styles.common} > <div className={styles.common} id="附件" >
<div className={styles.header}>{"附件"}</div> <div className={styles.header}>{"附件"}</div>
<div className={styles.info}> <div className={styles.info}>
{ {
......
...@@ -12,6 +12,7 @@ interface Iprops { ...@@ -12,6 +12,7 @@ interface Iprops {
id: string, id: string,
quantity?: string, quantity?: string,
processUnitPrice?: string processUnitPrice?: string
primaryKey: string
} }
interface IfileProps { interface IfileProps {
...@@ -38,8 +39,15 @@ const ProcessDetail: React.FC<Iprops> = (props) => { ...@@ -38,8 +39,15 @@ const ProcessDetail: React.FC<Iprops> = (props) => {
PublicApi.getProductCommodityGetCommodity({id: props.id}) PublicApi.getProductCommodityGetCommodity({id: props.id})
.then((data) => { .then((data) => {
if(data.code == 1000) { if(data.code == 1000) {
console.log(quantity) const target = data.data.unitPriceAndPicList.filter((item) => item.id.toString() == props.primaryKey.toString());
setInfo({...data.data, quantity: quantity, processUnitPrice: processUnitPrice}); console.log(props.primaryKey, target)
console.log(data.data.unitPriceAndPicList);
setInfo({
...data.data,
quantity: quantity,
processUnitPrice: processUnitPrice,
attributes: target[0].attributeAndValueList
});
} }
}) })
} }
...@@ -54,11 +62,12 @@ const ProcessDetail: React.FC<Iprops> = (props) => { ...@@ -54,11 +62,12 @@ const ProcessDetail: React.FC<Iprops> = (props) => {
} }
const formSubmit = (values) => { const formSubmit = (values) => {
!!props.submit && props.submit({ !!props.submit && props.submit({
files: files, files: files,
id: props.id, primaryKey: props.primaryKey,
process: values, process: values,
productProps: info?.commodityAttributeList productProps: info?.attributes
}) })
setVisible(false) setVisible(false)
} }
...@@ -99,14 +108,14 @@ const ProcessDetail: React.FC<Iprops> = (props) => { ...@@ -99,14 +108,14 @@ const ProcessDetail: React.FC<Iprops> = (props) => {
brand={info?.brand?.name} brand={info?.brand?.name}
category={info?.customerCategory?.fullName} category={info?.customerCategory?.fullName}
unitName={info?.unitName} unitName={info?.unitName}
actions={actions} productProps={info?.attributes}
formSubmit={formSubmit}
fileOnChange={fileOnChange}
files={files}
productProps={info?.commodityAttributeList}
type={props.type}
quantity={info?.quantity} quantity={info?.quantity}
processUnitPrice={info?.processUnitPrice} processUnitPrice={info?.processUnitPrice}
type={props.type}
files={files}
fileOnChange={fileOnChange}
formSubmit={formSubmit}
actions={actions}
/> />
</Drawer> </Drawer>
</> </>
......
import React, { useState } from 'react'; import React, { useState, useCallback } from 'react';
import { Button, Table, Drawer } from 'antd'; import { Button, Table, Drawer } from 'antd';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview'; import EyePreview from '@/components/EyePreview';
...@@ -11,23 +11,27 @@ const actions = createFormActions(); ...@@ -11,23 +11,27 @@ const actions = createFormActions();
const columns = [ const columns = [
{ {
title: '订单号', title: '订单号',
dataIndex: 'id' dataIndex: 'orderNo'
}, },
{ {
title: '订单摘要', title: '订单摘要',
dataIndex: 'desc' dataIndex: 'orderThe'
}, },
{ {
title: '采购会员', title: '采购会员',
dataIndex: 'orderPeople' dataIndex: 'supplyMembersName'
},
{
title: '下单时间',
dataIndex: 'createTime'
}, },
{ {
title: '订单状态', title: '订单状态',
dataIndex: 'orderStatus' dataIndex: 'externalState'
}, },
{ {
title: '订单类型', title: '订单类型',
dataIndex: 'orderType' dataIndex: 'type'
} }
] ]
...@@ -76,10 +80,12 @@ const schema = processProductSchema(tableSchema); ...@@ -76,10 +80,12 @@ const schema = processProductSchema(tableSchema);
const ProcessProducts = ({visible, cancel, ...restProps}) => { const ProcessProducts = ({visible, cancel, ...restProps}) => {
// const [selectRow, setSelectRow] = useState({}); // const [selectRow, setSelectRow] = useState({});
const [selectRow, memberRowCtl] = useRowSelectionTable({ customKey: 'id' }); const [selectRow, memberRowCtl] = useRowSelectionTable({ customKey: 'id' });
const fetchData = async (params: any) => { const [orderData, setOrderData] = useState<any>([])
let res = await PublicApi.getMemberAbilityInfoPage(params);
return res.data; const fetchData = useCallback(async (params: any) => {
}; let res = await PublicApi.getOrderProcessingOrderList(params);
return res;
}, [])
const expandable = { const expandable = {
expandedRowRender: record => ( expandedRowRender: record => (
...@@ -87,7 +93,7 @@ const ProcessProducts = ({visible, cancel, ...restProps}) => { ...@@ -87,7 +93,7 @@ const ProcessProducts = ({visible, cancel, ...restProps}) => {
columns={expandRowColumn} columns={expandRowColumn}
rowKey={"id"} rowKey={"id"}
// rowSelection={rowSelection} // rowSelection={rowSelection}
dataSource={data} dataSource={record.productDateilss}
pagination={false} pagination={false}
/> />
), ),
......
...@@ -23,6 +23,7 @@ const ProcessProducts = ({visible, cancel, ...restProps}) => { ...@@ -23,6 +23,7 @@ const ProcessProducts = ({visible, cancel, ...restProps}) => {
environment: 1, environment: 1,
...params, ...params,
} }
console.log(postData);
let res = await PublicApi.getProductCommodityCommonGetCommodityListByBuyer(postData); let res = await PublicApi.getProductCommodityCommonGetCommodityListByBuyer(postData);
return res; return res;
}; };
......
...@@ -36,6 +36,7 @@ import { timeRange } from '@/utils'; ...@@ -36,6 +36,7 @@ import { timeRange } from '@/utils';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'; import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import moment from 'moment'; import moment from 'moment';
import { Link } from 'umi' import { Link } from 'umi'
import StatusTag from '@/components/StatusTag';
const formActions = createFormActions(); const formActions = createFormActions();
// 根据 lastTypeParams, 获取相对应的schema // 根据 lastTypeParams, 获取相对应的schema
...@@ -109,7 +110,13 @@ const Query: React.FC<{}> = (props) => { ...@@ -109,7 +110,13 @@ const Query: React.FC<{}> = (props) => {
return moment(text).format('YYYY-MM-DD'); return moment(text).format('YYYY-MM-DD');
} }
}, },
{ title: '外部状态', dataIndex: 'outerStatusName',}, {
title: '外部状态',
dataIndex: 'outerStatusName',
render: (text) => {
return <StatusTag title={text} type="success"></StatusTag>
}
},
{ {
title: '内部状态', title: '内部状态',
dataIndex: 'innerStatusName', dataIndex: 'innerStatusName',
...@@ -265,7 +272,6 @@ const Query: React.FC<{}> = (props) => { ...@@ -265,7 +272,6 @@ const Query: React.FC<{}> = (props) => {
}) })
} }
} }
console.log(FILTER_NAMES[lastTypeParams], SCHEMAS[lastTypeParams]);
/** /**
* 查询 * 查询
* @params values 表单字段 * @params values 表单字段
......
...@@ -7,7 +7,6 @@ import { docTime } from '../../common'; ...@@ -7,7 +7,6 @@ import { docTime } from '../../common';
* @author: Bill * @author: Bill
* @description: 指派生产通知单查询页 schema - 生产通知单查询 * @description: 指派生产通知单查询页 schema - 生产通知单查询
*/ */
console.log(QUERY_SEARCH_NAME);
export const querySchema: ISchema = { export const querySchema: ISchema = {
type: 'object', type: 'object',
properties: { properties: {
......
import React from 'react' import React from 'react'
import { Table } from 'antd' import { Table } from 'antd'
import moment from 'moment'; import moment from 'moment';
import ProcessDetail from '../ProcessDetail'; import DrawerProcessDetail from '../ProcessDetail/DrawerProcessDetail';
interface Iprops { interface Iprops {
dataSource: any[] dataSource: any[],
columns?: any[]
} }
const WrapTable: React.FC<Iprops> = (props) => { const WrapTable: React.FC<Iprops> = (props) => {
const dataSource = props.dataSource || [] const dataSource = props.dataSource || []
const columns = [
{
title: '订单号',
dataIndex: 'orderNo',
},
{
title: 'ID',
dataIndex: 'id',
},
{
title: '商品名称',
dataIndex: 'goodsName',
},
{
title: '品类',
dataIndex: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
},
{
title: '加工数量',
dataIndex: 'processNum',
},
{
title: '加工单价',
dataIndex: 'processPrice',
},
{
title: '加工费',
dataIndex: 'processTotalPrice',
},
{
title: '交期',
dataIndex: 'deliveryDate',
render: (text, record) => {
return moment(text).format('YYYY-MM-DD');
}
},
{
title: '操作',
dataIndex: 'action',
render: (text, record) => {
return (
<ProcessDetail type="view" id={record.goodsId} quantity={record.processNum} processUnitPrice={record.processPrice}>
<a>查看加工明细</a>
</ProcessDetail>
)
}
},
];
return ( return (
<Table <Table
columns={columns} columns={props.columns || []}
rowKey={"id"} rowKey={"id"}
dataSource={dataSource} dataSource={dataSource}
/> />
......
import React, { useEffect, useState } from 'react';
import AbilityContainer from './Container';
import styles from './center.less'
import logistics from '@/assets/imgs/logistics.png';
import logistics_form from '@/assets/imgs/logistics_form.png';
import logistics_address from '@/assets/imgs/logistics_address.png';
import logistics_cost from '@/assets/imgs/logistics_cost.png';
import { Row, Col, Skeleton } from 'antd';
import {useInViewport} from '@umijs/hooks';
import { PublicApi } from '@/services/api';
import { Link } from 'umi'
interface Iprops {};
const KEY_TO_TITLE = {
creditList: '授信处理',
accountList: '资金账户管理'
}
const FundCenter: React.FC<Iprops> = () => {
const [inViewPort, ref] = useInViewport<HTMLDivElement>();
const [data, setData] = useState<any>({});
const [flag, setFlag] = useState<boolean>(false);
const [loading, setLoading] = useState<boolean>(false);
const tagsList = [
{
icon: logistics,
text: '物流派单'
},
{
icon: logistics_form,
text: '接单报价'
},
{
icon: logistics_address,
text: '收货地址管理'
},
{
icon: logistics_address,
text: '发货地址管理'
},
{
icon: logistics_cost,
text: '运费模板'
}
]
useEffect(() => {
if(inViewPort && !flag) {
setLoading(true);
PublicApi.getReportMemberHomeGetAccount()
.then(({code, data}) => {
if(code === 1000) {
console.log(data);
setData(data)
setFlag(true)
setLoading(false)
}
})
}
}, [inViewPort])
return (
<AbilityContainer
title="资金账户管理"
tips={"提供资金账户管理、授信额度管理等功能。"}
>
<div ref={ref}>
{
loading
? <Skeleton active />
: (
<>
{/* <div className={styles.tags}>
{
tagsList.map((item) => {
return (
<div className={styles.tagsItem} key={item.text}>
<div className={styles.icon}>
<img src={item.icon} />
</div>
<div className={styles.text}>{item.text}</div>
</div>
)
})
}
</div> */}
<div>
{
Object.keys(data).map((item) => {
return (
<Row key={item} className={styles.row}>
<Col span={4} className={styles.rowTitle}>{KEY_TO_TITLE[item]}</Col>
<Col span={20} className={styles.colRow}>
{
data[item].map((record) => {
return (
<Col span={4} key={record.name} className={styles.col}>
<div className={styles.colTitle}>{record.name}</div>
{
record.link
? <Link to={record.Link} className={styles.colValue}>{record.count}</Link>
: <div className={styles.colValue}>{record.count}</div>
}
</Col>
)
})
}
</Col>
</Row>
)
})
}
</div>
</>
)
}
</div>
</AbilityContainer>
)
}
export default FundCenter;
\ No newline at end of file
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
.colTitle { .colTitle {
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
color: #909399;; color: #909399;
min-height: 36px;
} }
.colValue { .colValue {
......
...@@ -5,6 +5,7 @@ import SettlementCenter from './SettlementCenter'; ...@@ -5,6 +5,7 @@ import SettlementCenter from './SettlementCenter';
import AfterSoldCenter from './AfterSoldCenter' import AfterSoldCenter from './AfterSoldCenter'
import LogisticsCenter from './LogisticsCenter' import LogisticsCenter from './LogisticsCenter'
import ProcessCenter from './ProcessCenter'; import ProcessCenter from './ProcessCenter';
import FundCenter from './FundCenter';
export { export {
TradeCenter, TradeCenter,
...@@ -13,5 +14,6 @@ export { ...@@ -13,5 +14,6 @@ export {
SettlementCenter, SettlementCenter,
AfterSoldCenter, AfterSoldCenter,
LogisticsCenter, LogisticsCenter,
ProcessCenter ProcessCenter,
FundCenter
} }
\ No newline at end of file
...@@ -8,7 +8,7 @@ import LatestAnnounce from './components/LatestAnnounces'; ...@@ -8,7 +8,7 @@ import LatestAnnounce from './components/LatestAnnounces';
import RecentVisit from './components/RecentVisit'; import RecentVisit from './components/RecentVisit';
import AnyQuestion from './components/AnyQuestion'; import AnyQuestion from './components/AnyQuestion';
import AdvertisementContainer from './components/AdvertisementSpace'; import AdvertisementContainer from './components/AdvertisementSpace';
import { TradeCenter, ShopCenter, ProductCenter, SettlementCenter, AfterSoldCenter, LogisticsCenter, ProcessCenter } from './components/Centers'; import { TradeCenter,FundCenter, ShopCenter, ProductCenter, SettlementCenter, AfterSoldCenter, LogisticsCenter, ProcessCenter } from './components/Centers';
import styles from './index.less' import styles from './index.less'
import { CompassFilled } from '@ant-design/icons'; import { CompassFilled } from '@ant-design/icons';
...@@ -53,6 +53,9 @@ const Home: React.FC<{}> = () => { ...@@ -53,6 +53,9 @@ const Home: React.FC<{}> = () => {
<div className={styles.ability} style={{order: centerOrder["product"]}}> <div className={styles.ability} style={{order: centerOrder["product"]}}>
<ProductCenter /> <ProductCenter />
</div> </div>
<div className={styles.ability} style={{order: centerOrder["product"]}}>
<FundCenter />
</div>
<div className={styles.ability} style={{order: centerOrder["settlement"]}}> <div className={styles.ability} style={{order: centerOrder["settlement"]}}>
<SettlementCenter /> <SettlementCenter />
</div> </div>
......
...@@ -109,7 +109,9 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => { ...@@ -109,7 +109,9 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
// @ts-ignore // @ts-ignore
PublicApi.getTemplateChannelFindFirstCategoryDetail(param).then(res => { PublicApi.getTemplateChannelFindFirstCategoryDetail(param).then(res => {
if(res.code === 1000) {
resolve(res.data) resolve(res.data)
}
}) })
}) })
} }
......
...@@ -14,7 +14,7 @@ import { store } from '@/store' ...@@ -14,7 +14,7 @@ import { store } from '@/store'
import ProductDescription from './components/ProductDescription' import ProductDescription from './components/ProductDescription'
import InputNumber from '@/components/InputNumber' import InputNumber from '@/components/InputNumber'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { GetSearchShopStoreGetCommodityDetailResponse } from '@/services/SearchApi' import { GetSearchShopStoreGetCommodityDetailResponse, GetSearchShopChannelGetCommodityDetailResponse } from '@/services/SearchApi'
import { getAuth } from '@/utils/auth' import { getAuth } from '@/utils/auth'
import { numFormat, priceFormat } from '@/utils/numberFomat' import { numFormat, priceFormat } from '@/utils/numberFomat'
import jinhuodanIcon from '@/assets/imgs/jinhuodan.png' import jinhuodanIcon from '@/assets/imgs/jinhuodan.png'
...@@ -62,7 +62,7 @@ const CommodityDetail = (props) => { ...@@ -62,7 +62,7 @@ const CommodityDetail = (props) => {
const { updateOrderInfo } = OrderStore const { updateOrderInfo } = OrderStore
const [addSuccessVisible, setAddSuccessVisible] = useState<boolean>(false) const [addSuccessVisible, setAddSuccessVisible] = useState<boolean>(false)
const [attributeList, setAttributeList] = useState([]) const [attributeList, setAttributeList] = useState([])
const [commodityDetail, setCommodityDetail] = useState<GetSearchShopStoreGetCommodityDetailResponse>() const [commodityDetail, setCommodityDetail] = useState<GetSearchShopStoreGetCommodityDetailResponse & GetSearchShopChannelGetCommodityDetailResponse>()
const [attrAndValList, setAttrAndValList] = useState<any>({}) const [attrAndValList, setAttrAndValList] = useState<any>({})
const [selectAttrVal, setSelectAttrVal] = useState<selectAttrValType[]>([]) const [selectAttrVal, setSelectAttrVal] = useState<selectAttrValType[]>([])
const [stockCount, setStockCount] = useState<number>(0) const [stockCount, setStockCount] = useState<number>(0)
...@@ -70,6 +70,7 @@ const CommodityDetail = (props) => { ...@@ -70,6 +70,7 @@ const CommodityDetail = (props) => {
const [commodityPriceInfo, setCommodityPriceInfo] = useState([]) const [commodityPriceInfo, setCommodityPriceInfo] = useState([])
const [parameter, setParameter] = useState<number>() // 权益参数 const [parameter, setParameter] = useState<number>() // 权益参数
const [selectCommodityId, setSelectCommodityId] = useState<number>() const [selectCommodityId, setSelectCommodityId] = useState<number>()
const [selectCommodityUnitPriceId, setSelectCommodityUnitPriceId] = useState<number>()
const [buyCount, setBuyCount] = useState<number>(1) const [buyCount, setBuyCount] = useState<number>(1)
const [purchaseCount, setPurchaseCount] = useState<number>(0) const [purchaseCount, setPurchaseCount] = useState<number>(0)
const [payWayList, setPayWayList] = useState([]) const [payWayList, setPayWayList] = useState([])
...@@ -284,6 +285,7 @@ const CommodityDetail = (props) => { ...@@ -284,6 +285,7 @@ const CommodityDetail = (props) => {
} else { } else {
if (selectCommodityId) { if (selectCommodityId) {
setSelectCommodityId(null) setSelectCommodityId(null)
setSelectCommodityUnitPriceId(null)
} }
} }
...@@ -301,7 +303,7 @@ const CommodityDetail = (props) => { ...@@ -301,7 +303,7 @@ const CommodityDetail = (props) => {
}) })
if (judgeArrisCommon(temp, selectAttrVal)) { if (judgeArrisCommon(temp, selectAttrVal)) {
setSelectCommodityId(item.id) setSelectCommodityId(item.id)
setSelectCommodityUnitPriceId(item.commodityUnitPriceAndPicId)
setCurrentPriceRange(sortUnitPrice(item.unitPrice)) setCurrentPriceRange(sortUnitPrice(item.unitPrice))
setAttrAndValList(item) setAttrAndValList(item)
setStockCount(item.stockCount) setStockCount(item.stockCount)
...@@ -346,6 +348,8 @@ const CommodityDetail = (props) => { ...@@ -346,6 +348,8 @@ const CommodityDetail = (props) => {
case LAYOUT_TYPE.channel: case LAYOUT_TYPE.channel:
case LAYOUT_TYPE.ichannel: case LAYOUT_TYPE.ichannel:
param.commodityType = 2 param.commodityType = 2
param.channelCommodityUnitPriceId = selectCommodityId
param.commodityUnitPriceId = selectCommodityUnitPriceId
postFn = PublicApi.postSearchShopPurchaseChannelSaveOrUpdatePurchase postFn = PublicApi.postSearchShopPurchaseChannelSaveOrUpdatePurchase
break; break;
default: default:
......
...@@ -96,7 +96,9 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => { ...@@ -96,7 +96,9 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
// @ts-ignore // @ts-ignore
PublicApi.getTemplateShopFindFirstCategoryDetail(param).then(res => { PublicApi.getTemplateShopFindFirstCategoryDetail(param).then(res => {
if(res.code === 1000) {
resolve(res.data) resolve(res.data)
}
}) })
}) })
} }
......
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