Commit 5f27da24 authored by XieZhiXiong's avatar XieZhiXiong

Merge branch 'dev' into test

parents 05e1698f d6cf1e3d
...@@ -23,6 +23,14 @@ const HandlingRoute = { ...@@ -23,6 +23,14 @@ const HandlingRoute = {
icon: 'smile', icon: 'smile',
component: '@/pages/handling/components/Query', component: '@/pages/handling/components/Query',
}, },
// // 指派生产通知单 -> 详情
{
path: '/memberCenter/handling/assign/query/detail',
name: 'assignProductionDetail',
icon: 'smile',
component: '@/pages/handling/assign/detail',
hideInMenu: true
},
// 指派生产通知单 -> 待新增生产通知单 // 指派生产通知单 -> 待新增生产通知单
{ {
path: '/memberCenter/handling/assign/tobeAddQuery', path: '/memberCenter/handling/assign/tobeAddQuery',
...@@ -38,14 +46,7 @@ const HandlingRoute = { ...@@ -38,14 +46,7 @@ const HandlingRoute = {
component: '@/pages/handling/assign/add', component: '@/pages/handling/assign/add',
hideInMenu: true hideInMenu: true
}, },
// // 指派生产通知单 -> 详情
{
path: '/memberCenter/handling/assign/qeury/detail',
name: 'assignProductionDetail',
icon: 'smile',
component: '@/pages/handling/assign/detail',
hideInMenu: true
},
// 指派生产通知单 -> 待审核通知单(一级) // 指派生产通知单 -> 待审核通知单(一级)
{ {
path: '/memberCenter/handling/assign/pendingFirst', path: '/memberCenter/handling/assign/pendingFirst',
...@@ -72,7 +73,8 @@ const HandlingRoute = { ...@@ -72,7 +73,8 @@ const HandlingRoute = {
path: '/memberCenter/handling/assign/pendingAddProcessing', path: '/memberCenter/handling/assign/pendingAddProcessing',
name: 'processStock', name: 'processStock',
icon: 'smile', icon: 'smile',
component: '@/pages/handling/components/Query' component: '@/pages/handling/components/Query',
hideInMenu: true
}, },
// 指派生产通知单 -> 待收货生产通知单 // 指派生产通知单 -> 待收货生产通知单
{ {
...@@ -86,7 +88,8 @@ const HandlingRoute = { ...@@ -86,7 +88,8 @@ const HandlingRoute = {
path: '/memberCenter/handling/assign/createProcessStock', path: '/memberCenter/handling/assign/createProcessStock',
name: 'createProcessStock', name: 'createProcessStock',
icon: 'smile', icon: 'smile',
component: '@/pages/handling/assign/processStock/createProcessStock' component: '@/pages/handling/assign/processStock/createProcessStock',
hideInMenu: true,
} }
] ]
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-09-15 17:48:36 * @Date: 2020-09-15 17:48:36
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-15 17:49:54 * @LastEditTime: 2020-11-06 18:47:46
* @Description: 内外部流转记录组件 * @Description: 内外部流转记录组件
*/ */
import React from 'react'; import React from 'react';
...@@ -16,8 +16,18 @@ import styles from './index.less'; ...@@ -16,8 +16,18 @@ import styles from './index.less';
interface AuditProcessProp { interface AuditProcessProp {
outerVerifyCurrent?: number; outerVerifyCurrent?: number;
innerVerifyCurrent?: number; innerVerifyCurrent?: number;
outerVerifySteps?: { step: number, stepName: string, roleName: string }[]; outerVerifySteps?: {
innerVerifySteps?: { step: number, stepName: string, roleName: string }[]; step: number,
stepName: string,
roleName: string,
status: 'wait' | 'process' | 'finish' | 'error',
}[];
innerVerifySteps?: {
step: number,
stepName: string,
roleName: string,
status: 'wait' | 'process' | 'finish' | 'error',
}[];
customTitleKey?: string customTitleKey?: string
customKey?: string customKey?: string
}; };
...@@ -39,6 +49,7 @@ const AuditProcess: React.FC<AuditProcessProp> = ({ ...@@ -39,6 +49,7 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
key={customKey ? item[customKey] : item.step} key={customKey ? item[customKey] : item.step}
title={customTitleKey ? item[customTitleKey] : item.stepName} title={customTitleKey ? item[customTitleKey] : item.stepName}
description={item.roleName} description={item.roleName}
status={item.status}
/> />
))} ))}
</Steps> </Steps>
...@@ -50,6 +61,7 @@ const AuditProcess: React.FC<AuditProcessProp> = ({ ...@@ -50,6 +61,7 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
key={customKey ? item[customKey] : item.step} key={customKey ? item[customKey] : item.step}
title={customTitleKey ? item[customTitleKey] : item.stepName} title={customTitleKey ? item[customTitleKey] : item.stepName}
description={item.roleName} description={item.roleName}
status={item.status}
/> />
))} ))}
</Steps> </Steps>
......
...@@ -4,11 +4,10 @@ import { SaveOutlined } from '@ant-design/icons'; ...@@ -4,11 +4,10 @@ import { SaveOutlined } from '@ant-design/icons';
import { Button, Card, Select, DatePicker, Radio, Table, Space } from 'antd'; import { Button, Card, Select, DatePicker, Radio, Table, Space } from 'antd';
import { history } from 'umi'; import { history } from 'umi';
import ReutrnEle from '@/components/ReturnEle'; import ReutrnEle from '@/components/ReturnEle';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd'; import { createFormActions, FormEffectHooks } from '@formily/antd';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import schema from './schema'; import schema from './schema';
import { LinkOutlined, PlusOutlined } from '@ant-design/icons'; import { LinkOutlined, PlusOutlined } from '@ant-design/icons';
import ModalContainer from '../../components/ModalContainer';
import EnterPrise from '../../components/EnterPrise'; import EnterPrise from '../../components/EnterPrise';
import ProcessProducts from '../../components/ProcessProducts'; import ProcessProducts from '../../components/ProcessProducts';
import ProcessOrder from '../../components/ProcessOrder'; import ProcessOrder from '../../components/ProcessOrder';
...@@ -48,24 +47,39 @@ const Add: React.FC<{}> = () => { ...@@ -48,24 +47,39 @@ const Add: React.FC<{}> = () => {
const noticesDetailColumn = () => { const noticesDetailColumn = () => {
return [ return [
{ title: '订单号', dataIndex: 'orderId' }, { title: '订单号', dataIndex: 'orderId' },
{ title: '商品ID', dataIndex: 'commodityId' }, { title: '商品ID', dataIndex: 'id' },
{ title: '商品名称', dataIndex: 'name' }, { title: '商品名称', dataIndex: 'name' },
{ title: '品类', dataIndex: 'customerCategoryName' }, { title: '品类', dataIndex: 'customerCategoryName' },
{ title: '品牌', dataIndex: 'brandName' }, { title: '品牌', dataIndex: 'brandName' },
{ title: '单位', dataIndex: 'unitName' }, { title: '单位', dataIndex: 'unitName' },
{ title: '订单数量', dataIndex: 'orderTotal' }, { title: '订单数量', dataIndex: 'orderTotal' },
{ title: '剩余加工数量', dataIndex: 'restTotal' }, { title: '剩余加工数量', dataIndex: 'restTotal' },
{ title: '加工数量', dataIndex: 'quantity' }, { title: '加工数量', dataIndex: 'processNum' },
{ title: '加工单价', dataIndex: 'processUnitPrice' }, { title: '加工单价', dataIndex: 'processUnitPrice' },
{ title: '加工费', dataIndex: 'cost'}, { title: '加工费', dataIndex: 'processTotalPrice'},
{ {
title: '操作', title: '操作',
render: (text, record) => { render: (text, record) => {
return ( return (
<Space> <Space>
<ProcessDetail id={record.commodityId} submit={handleChangeSomeList} /> <ProcessDetail
<a>编辑</a> id={record.goodsId}
<a>删除</a> type={"view"}
quantity={record.processNum}
processUnitPrice={record.processUnitPrice}
>
<a>查看</a>
</ProcessDetail>
<ProcessDetail
id={record.goodsId}
type={"edit"}
submit={handleChangeSomeList}
quantity={record.processNum}
processUnitPrice={record.processUnitPrice}
>
<a>编辑</a>
</ProcessDetail>
<a onClick={() => handleRemoveRow(record.id)}>删除</a>
</Space> </Space>
) )
} }
...@@ -109,7 +123,6 @@ const Add: React.FC<{}> = () => { ...@@ -109,7 +123,6 @@ const Add: React.FC<{}> = () => {
/> />
) )
} }
/* -------- element end-------- */
/** /**
* formEffect, 表单联动操作放这里操作,包括表单的生命周期等操作 * formEffect, 表单联动操作放这里操作,包括表单的生命周期等操作
...@@ -180,8 +193,25 @@ const Add: React.FC<{}> = () => { ...@@ -180,8 +193,25 @@ const Add: React.FC<{}> = () => {
* @param rows * @param rows
*/ */
const processProductSelected = (rows) => { const processProductSelected = (rows) => {
console.log(rows) const {selectedRowKeys, selectRow} = rows;
formActions.setFieldValue('Tabs.tab-2.layout.someLists', rows.selectRow) const currentList = formActions.getFieldValue('Tabs.tab-2.layout.someLists');
// 首先去除掉没有在selectedRowkeys 的那些数据
const inKeys = [];
const hasRemovedList = currentList.filter(
(item) => {
const flag = selectedRowKeys.includes(item.id)
if(flag) {
inKeys.push(item.id);
}
return flag
}
);
// 找到没有在数组中的key,即新增加的key
const newAddKeys = selectedRowKeys.filter((item) => { return !inKeys.includes(item)});
const appendRow = selectRow.filter((item) => newAddKeys.includes(item.id));
const newRows = hasRemovedList.concat(appendRow);
formActions.setFieldValue('Tabs.tab-2.layout.someLists', newRows)
} }
/** /**
...@@ -195,8 +225,9 @@ const Add: React.FC<{}> = () => { ...@@ -195,8 +225,9 @@ const Add: React.FC<{}> = () => {
/** /**
* 提交表单 * 提交表单
*/ */
const handleSubmit = (values) => { const handleSubmit = (values: any) => {
console.log(values) console.log(values)
setSubmitLoading(true);
const SELF_MENTION = 2; // 自提 const SELF_MENTION = 2; // 自提
const { const {
deliveryDate, deliveryDate,
...@@ -208,10 +239,11 @@ const Add: React.FC<{}> = () => { ...@@ -208,10 +239,11 @@ const Add: React.FC<{}> = () => {
materialDesc = '', materialDesc = '',
packingDesc = '', packingDesc = '',
otherDesc = '', otherDesc = '',
someLists,
...rest ...rest
} = values; } = values;
const deliveryDateFormat = deliveryDate.unix() * 1000; const deliveryDateFormat = deliveryDate.unix() * 1000;
const detailList = values.someLists.map((item) => { const detailList = someLists.map((item) => {
return { return {
orederNo: null, orederNo: null,
goodsId: item.commodityId, goodsId: item.commodityId,
...@@ -221,16 +253,17 @@ const Add: React.FC<{}> = () => { ...@@ -221,16 +253,17 @@ const Add: React.FC<{}> = () => {
unit: item.unitName, unit: item.unitName,
purchaseCount:null, purchaseCount:null,
surplusProcessNum:null, surplusProcessNum:null,
processNum: item.quantity || 0, processNum: item.processNum || 0,
processPrice: item.processUnitPrice || 0, processPrice: item.processUnitPrice || 0,
processTotalPrice: item.processTotalPrice,
deliveryDate: deliveryDateFormat, deliveryDate: deliveryDateFormat,
property:{ property:{
specs: item.productProps.map((item) => { specs: item.productProps && item.productProps.map((item) => {
return { return {
name: item.customerAttribute.name, name: item.customerAttribute.name,
value: '' value: item.customerAttribute.name
} }
}), }) || [],
annex: item.files.map((item) => ({name: item.name, value: item.url})) annex: item.files.map((item) => ({name: item.name, value: item.url}))
} }
} }
...@@ -258,25 +291,25 @@ const Add: React.FC<{}> = () => { ...@@ -258,25 +291,25 @@ const Add: React.FC<{}> = () => {
delete postData.receiveUserTel delete postData.receiveUserTel
} }
console.log(postData); console.log(postData);
return ; // return ;
PublicApi.postEnhanceSupplierToBeAddAdd(postData) PublicApi.postEnhanceSupplierToBeAddAdd(postData)
.then(data => { .then(data => {
setSubmitLoading(false);
if(data.code === 1000) { if(data.code === 1000) {
history.push('/memberCenter/handling/assign/tobeAddQuery') history.push('/memberCenter/handling/assign/tobeAddQuery')
} }
}) })
} }
const handleChangeSomeList = (values) => { const handleChangeSomeList = (values: any) => {
console.log("changeSOmeList");
let someList = formActions.getFieldValue('Tabs.tab-2.layout.someLists'); let someList = formActions.getFieldValue('Tabs.tab-2.layout.someLists');
const index = someList.findIndex((item) => item.commodityId == values.id); const index = someList.findIndex((item) => item.goodsId == values.id);
if(index > -1) { if(index > -1) {
someList[index] = { someList[index] = {
...someList[index], ...someList[index],
quantity: values.process.quantity, processNum: values.process.quantity,
processUnitPrice: values.process.processUnitPrice, processUnitPrice: values.process.processUnitPrice,
cost: values.process.quantity * values.process.processUnitPrice, processTotalPrice: values.process.quantity * values.process.processUnitPrice,
productProps: values.productProps, productProps: values.productProps,
files: values.files files: values.files
} }
...@@ -285,6 +318,12 @@ const Add: React.FC<{}> = () => { ...@@ -285,6 +318,12 @@ const Add: React.FC<{}> = () => {
} }
} }
const handleRemoveRow = (id: number) => {
const currentList = formActions.getFieldValue('Tabs.tab-2.layout.someLists');
const newList = currentList.filter((item) => item.id !== id);
formActions.setFieldValue('Tabs.tab-2.layout.someLists', newList)
}
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
onBack={() => history.goBack()} onBack={() => history.goBack()}
......
import React from 'react'; import React, {useState, useEffect} from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi'; import { history } from 'umi';
import AvatarWrap from '@/components/AvatarWrap'; import AvatarWrap from '@/components/AvatarWrap';
...@@ -8,9 +8,26 @@ import WrapTable from '../../components/WrapTable'; ...@@ -8,9 +8,26 @@ 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 ProcessDetail from '../../components/ProcessDetail';
import { usePageStatus } from '@/hooks/usePageStatus'
import { PublicApi } from '@/services/api';
import moment from 'moment';
const { TabPane } = Tabs; const { TabPane } = Tabs;
const Detail: React.FC<{}> = () => { const Detail: React.FC<{}> = () => {
const [info, setInfo] = useState<any>({})
const { id } = usePageStatus();
useEffect(() => {
if(id) {
PublicApi.getEnhanceSupplierAllDetails({id: id})
.then(({data, code}) => {
if(code === 1000) {
setInfo(data);
}
})
}
}, [id])
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
title={ title={
...@@ -24,36 +41,35 @@ const Detail: React.FC<{}> = () => { ...@@ -24,36 +41,35 @@ const Detail: React.FC<{}> = () => {
name: "通知单号:" name: "通知单号:"
}} }}
extra={( extra={(
<span style={{ fontSize: 12, fontWeight: 'normal' }}>{"TPTY12"}</span> <span style={{ fontSize: 12, fontWeight: 'normal' }}>{info?.noticeNo}</span>
)} )}
/> />
} }
> >
<Descriptions <Descriptions
column={3} column={3}
style={{ style={{padding: '0 32px', fontWeight: 400}}
padding: '0 32px', colon={false}
}}
> >
<Descriptions.Item label="通知单摘要">{"进口头层黄牛皮荔枝纹"}</Descriptions.Item> <Descriptions.Item label="通知单摘要:">{info?.summary}</Descriptions.Item>
<Descriptions.Item label="供应会员:">{"广州白马皮具交易中心"}</Descriptions.Item> <Descriptions.Item label="加工企业:">{info?.processName}</Descriptions.Item>
<Descriptions.Item label="单据时间:">{"2020-09-09 12:58:25"}</Descriptions.Item> <Descriptions.Item label="单据时间:">{info && info.createTime && moment(info.createTime).format('YYYY-MM-DD') || null }</Descriptions.Item>
<Descriptions.Item label="通知单来源:">{"订单加工"}</Descriptions.Item> <Descriptions.Item label="通知单来源:">{info?.source == '1' ? '订单加工': '商品加工'}</Descriptions.Item>
<Descriptions.Item label="外部状态:">{"以完成通知单"}</Descriptions.Item> <Descriptions.Item label="外部状态:">{info.outerStatusName}</Descriptions.Item>
<Descriptions.Item label="内部状态:">{"审核通过"}</Descriptions.Item> <Descriptions.Item label="内部状态:">{info.innerStatusName}</Descriptions.Item>
</Descriptions> </Descriptions>
</PageHeader> </PageHeader>
</> </>
} }
> >
<Card bodyStyle={{padding: '5px 24px 15px 24px'}}> <Card bodyStyle={{padding: '5px 24px 15px 24px'}}>
<Circulation /> <Circulation innerStatus={info?.innerStatus} outerStatus={info?.outerStatus} innerTaskList={info?.innerTaskList} outerTaskList={info?.outerTaskList}/>
</Card> </Card>
<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 /> <WrapTable dataSource={info?.details}/>
</Card> </Card>
</div> </div>
......
import React from 'react'; import React, { useState, useEffect } from 'react';
import { Tabs, Steps, Popover } from 'antd'; import { Tabs, Steps, Popover } from 'antd';
const TabPane = Tabs.TabPane; const TabPane = Tabs.TabPane;
...@@ -10,23 +10,65 @@ const customDot = (dot, { status, index }) => ( ...@@ -10,23 +10,65 @@ const customDot = (dot, { status, index }) => (
</span> </span>
); );
const Circulation: React.FC<{}> = () => { interface Iprops {
innerTaskList: any[],
outerTaskList: any[],
innerStatus: number,
outerStatus: number
}
const Circulation: React.FC<Iprops> = (props) => {
const { innerTaskList = [], outerTaskList = [] } = props;
const [innerStatus, setInnerStatus] = useState(0);
const [outerStatus, setOuterStatus] = useState(0);
// const innerStatus = innerTaskList.map(())
useEffect(() => {
const length = innerTaskList.length;
if(length > 0) {
for(let i = length - 1; i >= 0; i--) {
if(innerTaskList[i].isExecute == 1) {
setInnerStatus(i);
break;
}
}
}
}, [innerTaskList])
useEffect(() => {
const length = outerTaskList.length;
if(length > 0) {
for(let i = length - 1; i >= 0; i--) {
if(outerTaskList[i].isExecute == 1) {
setOuterStatus(i);
break;
}
}
}
}, [innerTaskList])
return ( return (
<Tabs defaultActiveKey="1" > <Tabs defaultActiveKey="1" >
<TabPane tab="外部流转" key="1"> <TabPane tab="外部流转" key="1">
<Steps current={1} progressDot={customDot} style={{marginTop: '20px'}}> <Steps current={innerStatus} progressDot={customDot} style={{marginTop: '20px'}}>
<Step title="Finished" description="You can hover on the dot." /> {
<Step title="In Progress" description="You can hover on the dot." /> outerTaskList.map((item) => {
<Step title="Waiting" description="You can hover on the dot." /> return (
<Step title="Waiting" description="You can hover on the dot." /> <Step title={item.taskName} description={item.roleName} key={item.step} />
)
})
}
</Steps> </Steps>
</TabPane> </TabPane>
<TabPane tab="内部流转" key="2"> <TabPane tab="内部流转" key="2">
<Steps current={1} progressDot={customDot} style={{marginTop: '20px'}}> <Steps current={outerStatus} progressDot={customDot} style={{marginTop: '20px'}}>
<Step title="Finished" description="You can hover on the dot." /> {
<Step title="In Progress" description="You can hover on the dot." /> innerTaskList.map((item) => {
<Step title="Waiting" description="You can hover on the dot." /> return (
<Step title="Waiting" description="You can hover on the dot." /> <Step title={item.taskName} description={item.roleName} key={item.step} />
)
})
}
</Steps> </Steps>
</TabPane> </TabPane>
</Tabs> </Tabs>
......
...@@ -5,7 +5,6 @@ import classnames from 'classnames'; ...@@ -5,7 +5,6 @@ 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 menuList = ["基本信息", "产地", "外观尺寸", "工艺", "特殊说明/其他", "附件", "加工要求"];
const HEIGHT_MAP = { const HEIGHT_MAP = {
'基本信息': 0, '基本信息': 0,
...@@ -57,7 +56,7 @@ const schema = { ...@@ -57,7 +56,7 @@ const schema = {
} }
const Content = (props) => { const Content = (props) => {
const { id, name, category, brand, unitName, files, productProps = [] } = props; const { id, name, category, brand, unitName, files, productProps = [], quantity, processUnitPrice } = props;
const [active, setActive] = useState<string>("基本信息"); const [active, setActive] = useState<string>("基本信息");
const ref = useRef(null); const ref = useRef(null);
...@@ -143,7 +142,11 @@ const Content = (props) => { ...@@ -143,7 +142,11 @@ const Content = (props) => {
) )
}) })
} }
<UploadFile onChange={props.fileOnChange} fileMaxSize={20*1024} /> {
props.type == 'edit'
? <UploadFile onChange={props.fileOnChange} fileMaxSize={20*1024} />
: null
}
</div> </div>
</div> </div>
<div className={styles.common} > <div className={styles.common} >
...@@ -155,12 +158,32 @@ const Content = (props) => { ...@@ -155,12 +158,32 @@ const Content = (props) => {
</Row> </Row>
</div> </div>
<div className={styles.info}> <div className={styles.info}>
<NiceForm {
schema={schema} props.type == 'edit'
actions={props.actions} ? <NiceForm
onSubmit={props.formSubmit} schema={schema}
// effects={formEffects()} actions={props.actions}
/> onSubmit={props.formSubmit}
initialValues={{
quantity: quantity,
processUnitPrice: processUnitPrice
}}
// effects={formEffects()}
/>
: (
<>
<Row className={styles.infoRow}>
<Col className={styles.label} span={4}>加工数量</Col>
<Col span={12}>{quantity}</Col>
</Row>
<Row className={styles.infoRow}>
<Col className={styles.label} span={4}>加工单价</Col>
<Col span={12}>{processUnitPrice}</Col>
</Row>
</>
)
}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -6,10 +6,24 @@ import { createFormActions } from '@formily/antd' ...@@ -6,10 +6,24 @@ import { createFormActions } from '@formily/antd'
const actions = createFormActions(); const actions = createFormActions();
const ProcessDetail = (props) => { interface Iprops {
const [visible, setVisible] = useState(false); type: string, // veiw | edit,
submit?: (params: any) => void,
id: string,
quantity?: string,
processUnitPrice?: string
}
interface IfileProps {
name: string,
url: string
}
const ProcessDetail: React.FC<Iprops> = (props) => {
const { quantity, processUnitPrice} = props;
const [visible, setVisible] = useState<boolean>(false);
const [info, setInfo] = useState<any>({}) const [info, setInfo] = useState<any>({})
const [files, setFiles] = useState([]) const [files, setFiles] = useState<IfileProps[]>([])
const onClose = () => { const onClose = () => {
setVisible(false) setVisible(false)
...@@ -23,17 +37,24 @@ const ProcessDetail = (props) => { ...@@ -23,17 +37,24 @@ const ProcessDetail = (props) => {
if(props.id && visible) { if(props.id && visible) {
PublicApi.getProductCommodityGetCommodity({id: props.id}) PublicApi.getProductCommodityGetCommodity({id: props.id})
.then((data) => { .then((data) => {
setInfo(data.data); if(data.code == 1000) {
console.log(quantity)
setInfo({...data.data, quantity: quantity, processUnitPrice: processUnitPrice});
}
}) })
} }
}, [props.id, visible]) }, [props.id, visible])
const handleSubmit = () => { const handleSubmit = () => {
actions.submit(); if(props.type == 'edit') {
actions.submit();
} else {
setVisible(false);
}
} }
const formSubmit = (values) => { const formSubmit = (values) => {
props.submit({ !!props.submit && props.submit({
files: files, files: files,
id: props.id, id: props.id,
process: values, process: values,
...@@ -45,12 +66,12 @@ const ProcessDetail = (props) => { ...@@ -45,12 +66,12 @@ const ProcessDetail = (props) => {
const fileOnChange = (values) => { const fileOnChange = (values) => {
setFiles(values) setFiles(values)
} }
return ( return (
<> <>
<a onClick={onOpen}> <div onClick={onOpen}>
查看加工详情 {props.children}
</a> </div>
<Drawer <Drawer
title="查看加工明细" title="查看加工明细"
width={720} width={720}
...@@ -64,10 +85,10 @@ const ProcessDetail = (props) => { ...@@ -64,10 +85,10 @@ const ProcessDetail = (props) => {
}} }}
> >
<Button onClick={onClose} style={{ marginRight: 8 }}> <Button onClick={onClose} style={{ marginRight: 8 }}>
Cancel 取消
</Button> </Button>
<Button onClick={handleSubmit} type="primary"> <Button onClick={handleSubmit} type="primary">
Submit 确认
</Button> </Button>
</div> </div>
} }
...@@ -83,6 +104,9 @@ const ProcessDetail = (props) => { ...@@ -83,6 +104,9 @@ const ProcessDetail = (props) => {
fileOnChange={fileOnChange} fileOnChange={fileOnChange}
files={files} files={files}
productProps={info?.commodityAttributeList} productProps={info?.commodityAttributeList}
type={props.type}
quantity={info?.quantity}
processUnitPrice={info?.processUnitPrice}
/> />
</Drawer> </Drawer>
</> </>
......
/** /**
* 指派生产通知单-生产通知单查询页 * 指派生产通知单-生产通知单查询页
*/ */
...@@ -8,23 +9,19 @@ export const QUERY_SEARCH_NAME = "noticeNo"; ...@@ -8,23 +9,19 @@ export const QUERY_SEARCH_NAME = "noticeNo";
* 指派生产通知单-待新增生产通知单列表页 * 指派生产通知单-待新增生产通知单列表页
*/ */
export const TO_BE_ADD_QUERY_SEARCH_NAME = "search"; export const TO_BE_ADD_QUERY_SEARCH_NAME = "noticeNo";
/** /**
* 指派生产通知单-待审核生产通知单(一级) * 指派生产通知单-待审核生产通知单(一级)
*/
export const PENDING_FIRST_NOTICE = "search";
/**
* 指派生产通知单-待审核生产通知单(二级) * 指派生产通知单-待审核生产通知单(二级)
*/ */
export const PENDING_FIRST_AND_SECOND_NOTICE = "noticeNo";
export const PENDING_SECOND_NOTICE = "search";
/** /**
* 指派生产通知单-待提交生产通知单 * 指派生产通知单-待提交生产通知单
*/ */
export const PENDING_TO_SUBMIT = "search"; export const PENDING_TO_SUBMIT = "noticeNo";
/** /**
* 指派生产通知单-待新增加工入库单 * 指派生产通知单-待新增加工入库单
...@@ -36,7 +33,7 @@ export const PENDING_ADD_PROCESS = "desc" ...@@ -36,7 +33,7 @@ export const PENDING_ADD_PROCESS = "desc"
* 指派生产通知单-待收货生产通知单 * 指派生产通知单-待收货生产通知单
*/ */
export const PENDING_RECEIVE = "desc" export const PENDING_RECEIVE_SCHEMA = "noticeNo"
/** /**
...@@ -52,7 +49,66 @@ const QUERY_TITLE = '生产通知单查询'; ...@@ -52,7 +49,66 @@ const QUERY_TITLE = '生产通知单查询';
export const TO_BE_ADD_QUERY_PATH = '/tobeAddQuery'; export const TO_BE_ADD_QUERY_PATH = '/tobeAddQuery';
const TO_BE_ADD_QUERY_TITLE = '待新增生产通知单'; const TO_BE_ADD_QUERY_TITLE = '待新增生产通知单';
/**
* 带审核生产通知单(一级)
*/
export const PENDING_FIRST = '/pendingFirst';
const PENDING_FIRST_TITLE = '待审核通知单(一级)';
/**
* 待审核通知单(二级)
*/
export const PENDING_SECOND = '/pendingSecond';
const PENDING_SECOND_TITLE = '待审核通知单(二级)';
/**
* 待审核生产通知单
*/
export const PENDING_SUBMIT = '/pendingSubmit';
const PENDING_SUBMIT_TITLE = '待提交生产通知单';
/**
* 待收货生产通知单
*/
export const PENDING_RECEIVE = '/pendingReceive';
const PENDING_RECEIVE_TITLE = '待收货生产通知单';
export const TITLE_MAPS = { export const TITLE_MAPS = {
[QUERY_PATH]: QUERY_TITLE, [QUERY_PATH]: QUERY_TITLE,
[TO_BE_ADD_QUERY_PATH]: TO_BE_ADD_QUERY_TITLE [TO_BE_ADD_QUERY_PATH]: TO_BE_ADD_QUERY_TITLE,
[PENDING_FIRST]: PENDING_FIRST_TITLE,
[PENDING_SECOND]: PENDING_SECOND_TITLE,
[PENDING_SUBMIT]: PENDING_SUBMIT_TITLE,
[PENDING_RECEIVE]: PENDING_RECEIVE_TITLE
}
export const INNER_STATUS_BADGE_COLOR = {
"1": "default",
"2": "warning",
"3": "processing",
"4": "success",
"5": "error"
}
// 根据 lastTypeParams, 获取对应的高级筛选 name
export const FILTER_NAMES = {
[QUERY_PATH]: QUERY_SEARCH_NAME,
[TO_BE_ADD_QUERY_PATH]: TO_BE_ADD_QUERY_SEARCH_NAME,
[PENDING_FIRST]: PENDING_FIRST_AND_SECOND_NOTICE,
[PENDING_SECOND]: PENDING_FIRST_AND_SECOND_NOTICE,
[PENDING_SUBMIT]: PENDING_TO_SUBMIT,
[PENDING_RECEIVE]: PENDING_RECEIVE_SCHEMA,
"/pendingAddProcessing": PENDING_ADD_PROCESS,
}
export const DETAIL_PATH = {
[QUERY_PATH]: '/memberCenter/handling/assign/query/detail',
[TO_BE_ADD_QUERY_PATH]: '/memberCenter/handling/assign/query/detail',
[PENDING_FIRST]: '/memberCenter/handling/assign/query/detail',
[PENDING_SECOND]: '/memberCenter/handling/assign/query/detail',
[PENDING_SUBMIT]: '/memberCenter/handling/assign/query/detail',
[PENDING_RECEIVE]: '/memberCenter/handling/assign/query/detail',
} }
\ No newline at end of file
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { QUERY_SEARCH_NAME, TO_BE_ADD_QUERY_SEARCH_NAME } from './contants'; import { QUERY_SEARCH_NAME, TO_BE_ADD_QUERY_SEARCH_NAME, PENDING_FIRST_AND_SECOND_NOTICE } from './contants';
import { docTime } from '../../common'; 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: {
...@@ -21,7 +21,7 @@ export const querySchema: ISchema = { ...@@ -21,7 +21,7 @@ export const querySchema: ISchema = {
'x-component-props': { 'x-component-props': {
placeholder: '搜索', placeholder: '搜索',
align: 'flex-left', align: 'flex-left',
tip: '输入通知单号进行搜索', tip: '输入通知单号1进行搜索',
}, },
}, },
[FORM_FILTER_PATH]: { [FORM_FILTER_PATH]: {
...@@ -127,19 +127,17 @@ export const tobeAddQuerySchema: ISchema = { ...@@ -127,19 +127,17 @@ export const tobeAddQuerySchema: ISchema = {
}, },
}, },
properties: { properties: {
name: { memberName: {
type: 'string', type: 'string',
default: undefined,
enum: [],
'x-component-props': { 'x-component-props': {
placeholder: '加工企业名称(全部)', placeholder: '加工企业名称',
allowClear: true, allowClear: true,
}, },
}, },
time: { time: {
type: 'string', type: 'string',
default: undefined, default: 0,
enum: [], enum: docTime,
'x-component-props': { 'x-component-props': {
placeholder: '单据时间(全部)', placeholder: '单据时间(全部)',
allowClear: true, allowClear: true,
...@@ -205,7 +203,7 @@ export const pendingFirstQuerySchema: ISchema = { ...@@ -205,7 +203,7 @@ export const pendingFirstQuerySchema: ISchema = {
children: '{{batchUpdateBtn}}', children: '{{batchUpdateBtn}}',
}, },
}, },
search: { [PENDING_FIRST_AND_SECOND_NOTICE]: {
type: 'string', type: 'string',
'x-component': 'Search', 'x-component': 'Search',
'x-component-props': { 'x-component-props': {
...@@ -225,10 +223,8 @@ export const pendingFirstQuerySchema: ISchema = { ...@@ -225,10 +223,8 @@ export const pendingFirstQuerySchema: ISchema = {
properties: { properties: {
name: { name: {
type: 'string', type: 'string',
default: undefined,
enum: [],
'x-component-props': { 'x-component-props': {
placeholder: '加工企业名称(全部)', placeholder: '加工企业名称',
allowClear: true, allowClear: true,
}, },
}, },
......
import React from 'react' import React from 'react'
import { Table } from 'antd' import { Table } from 'antd'
import moment from 'moment';
import ProcessDetail from '../ProcessDetail';
const WrapTable = () => { interface Iprops {
dataSource: any[]
}
const WrapTable: React.FC<Iprops> = (props) => {
const dataSource = props.dataSource || []
const columns = [ const columns = [
{ {
title: '订单号', title: '订单号',
dataIndex: 'no', dataIndex: 'orderNo',
}, },
{ {
title: 'ID', title: 'ID',
...@@ -13,7 +20,7 @@ const WrapTable = () => { ...@@ -13,7 +20,7 @@ const WrapTable = () => {
}, },
{ {
title: '商品名称', title: '商品名称',
dataIndex: 'name', dataIndex: 'goodsName',
}, },
{ {
title: '品类', title: '品类',
...@@ -21,7 +28,7 @@ const WrapTable = () => { ...@@ -21,7 +28,7 @@ const WrapTable = () => {
}, },
{ {
title: '品牌', title: '品牌',
dataIndex: 'type', dataIndex: 'brand',
}, },
{ {
title: '单位', title: '单位',
...@@ -29,29 +36,40 @@ const WrapTable = () => { ...@@ -29,29 +36,40 @@ const WrapTable = () => {
}, },
{ {
title: '加工数量', title: '加工数量',
dataIndex: 'number', dataIndex: 'processNum',
}, },
{ {
title: '加工单价', title: '加工单价',
dataIndex: 'price', dataIndex: 'processPrice',
}, },
{ {
title: '加工费', title: '加工费',
dataIndex: 'total', dataIndex: 'processTotalPrice',
}, },
{ {
title: '交期', title: '交期',
dataIndex: 'time', dataIndex: 'deliveryDate',
render: (text, record) => {
return moment(text).format('YYYY-MM-DD');
}
}, },
{ {
title: '操作', title: '操作',
dataIndex: 'action', 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={columns}
dataSource={[]} rowKey={"id"}
dataSource={dataSource}
/> />
) )
......
...@@ -543,7 +543,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => { ...@@ -543,7 +543,8 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
buyOrderInfo.payWayList = await getPayWayListByMemberId(selectItem.memberId) buyOrderInfo.payWayList = await getPayWayListByMemberId(selectItem.memberId)
PublicApi.postOrderIsWorkFlow({ productIds }).then(res => { //@ts-ignore
PublicApi.postOrderIsWorkFlow({ productIds, memberId: selectItem.memberId }).then(res => {
setConfirmLoading(false) setConfirmLoading(false)
if (res.code === 1000) { if (res.code === 1000) {
message.destroy() message.destroy()
......
...@@ -14,7 +14,7 @@ import { ...@@ -14,7 +14,7 @@ import {
CREDIT_OUTER_STATUS, CREDIT_STATUS, CREDIT_OUTER_STATUS, CREDIT_STATUS,
CREDIT_INNER_STATUS_UNCOMMITTED, CREDIT_INNER_STATUS_UNCOMMITTED,
} from '@/constants'; } from '@/constants';
import { normalizeFiledata, FileData } from '@/utils'; import { normalizeFiledata, FileData, findLastIndexFlowState, normalizeFlowData } from '@/utils';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import AvatarWrap from '@/components/AvatarWrap'; import AvatarWrap from '@/components/AvatarWrap';
import StatusTag from '@/components/StatusTag'; import StatusTag from '@/components/StatusTag';
...@@ -192,20 +192,22 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -192,20 +192,22 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
step: item.step, step: item.step,
stepName: item.taskName, stepName: item.taskName,
roleName: item.roleName, roleName: item.roleName,
status: item.isExecute ? 'finish' : 'wait',
})) : })) :
[] []
} }
outerVerifyCurrent={quotaInfo && quotaInfo.outerTaskList ? quotaInfo.outerTaskList.findIndex(item => item.isExecute === 0) : 0} outerVerifyCurrent={findLastIndexFlowState(quotaInfo?.outerTaskList)}
innerVerifySteps={ innerVerifySteps={
quotaInfo && quotaInfo.innerTaskList ? quotaInfo && quotaInfo.innerTaskList ?
quotaInfo.innerTaskList.map(item => ({ quotaInfo.innerTaskList.map(item => ({
step: item.step, step: item.step,
stepName: item.taskName, stepName: item.taskName,
roleName: item.roleName, roleName: item.roleName,
status: item.isExecute ? 'finish' : 'wait',
})) : })) :
[] []
} }
innerVerifyCurrent={quotaInfo && quotaInfo.innerTaskList ? quotaInfo.innerTaskList.findIndex(item => item.isExecute === 0) : 0} innerVerifyCurrent={findLastIndexFlowState(quotaInfo?.innerTaskList)}
/> />
</div> </div>
......
import React from 'react' import React from 'react'
import AuditProcess from '@/components/AuditProcess' import AuditProcess from '@/components/AuditProcess'
import { findLastIndexFlowState } from '../../_public/order/utils' import { findLastIndexFlowState } from '@/utils'
import OrderProductTable from '../../components/orderProductTable' import OrderProductTable from '../../components/orderProductTable'
import SaleOrderProductTable from '../../components/saleOrderProductTable' import SaleOrderProductTable from '../../components/saleOrderProductTable'
import OrderPayTabs from '../../components/orderPayTabs' import OrderPayTabs from '../../components/orderPayTabs'
...@@ -22,8 +22,22 @@ const OrderDetailSection:React.FC<OrderDetailSectionProps> = ({formContext, type ...@@ -22,8 +22,22 @@ const OrderDetailSection:React.FC<OrderDetailSectionProps> = ({formContext, type
customKey='state' customKey='state'
outerVerifyCurrent={findLastIndexFlowState(formContext.data.externalWorkflowFlowRecordLogResponses)} outerVerifyCurrent={findLastIndexFlowState(formContext.data.externalWorkflowFlowRecordLogResponses)}
innerVerifyCurrent={findLastIndexFlowState(formContext.data.interiorWorkflowFlowRecordLogResponses)} innerVerifyCurrent={findLastIndexFlowState(formContext.data.interiorWorkflowFlowRecordLogResponses)}
outerVerifySteps={formContext.data.externalWorkflowFlowRecordLogResponses || []} outerVerifySteps={
innerVerifySteps={formContext.data.interiorWorkflowFlowRecordLogResponses || []} formContext.data.externalWorkflowFlowRecordLogResponses ?
formContext.data.externalWorkflowFlowRecordLogResponses.map(item => ({
...item,
status: item.isExecute ? 'finish' : 'wait',
})) :
[]
}
innerVerifySteps={
formContext.data.interiorWorkflowFlowRecordLogResponses ?
formContext.data.interiorWorkflowFlowRecordLogResponses.map(item => ({
...item,
status: item.isExecute ? 'finish' : 'wait',
})) :
[]
}
></AuditProcess> ></AuditProcess>
{ type === 'saleOrder' ? <SaleOrderProductTable/> : <OrderProductTable editable /> } { type === 'saleOrder' ? <SaleOrderProductTable/> : <OrderProductTable editable /> }
......
...@@ -98,7 +98,8 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor ...@@ -98,7 +98,8 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
// 请求一次并复制给支付信息 // 请求一次并复制给支付信息
const productItem = value[0] const productItem = value[0]
fetchOrderApi.getPayInfoList({ fetchOrderApi.getPayInfoList({
productId: productItem.id productId: productItem.id,
memberId: productItem.memberId
}).then(data => { }).then(data => {
ctx.setFieldValue('paymentInformationResponses', data) ctx.setFieldValue('paymentInformationResponses', data)
}).catch(err => { }).catch(err => {
......
...@@ -24,8 +24,8 @@ import { useProductTable } from './model/useProductTable' ...@@ -24,8 +24,8 @@ import { useProductTable } from './model/useProductTable'
import styled from 'styled-components' import styled from 'styled-components'
import { useUpdate } from '@umijs/hooks' import { useUpdate } from '@umijs/hooks'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { formatTimeString, omit } from '@/utils' import { formatTimeString, omit, findLastIndexFlowState } from '@/utils'
import { changeRouterTitleByStatus, findLastIndexFlowState } from '../../_public/order/utils' import { changeRouterTitleByStatus } from '../../_public/order/utils'
import { ReadyAddOrderDetailContext } from '../context' import { ReadyAddOrderDetailContext } from '../context'
import AuditProcess from '@/components/AuditProcess' import AuditProcess from '@/components/AuditProcess'
...@@ -293,8 +293,22 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -293,8 +293,22 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
customKey='state' customKey='state'
outerVerifyCurrent={findLastIndexFlowState(initFormValue.externalWorkflowFlowRecordLogResponses)} outerVerifyCurrent={findLastIndexFlowState(initFormValue.externalWorkflowFlowRecordLogResponses)}
innerVerifyCurrent={findLastIndexFlowState(initFormValue.interiorWorkflowFlowRecordLogResponses)} innerVerifyCurrent={findLastIndexFlowState(initFormValue.interiorWorkflowFlowRecordLogResponses)}
outerVerifySteps={initFormValue.externalWorkflowFlowRecordLogResponses} outerVerifySteps={
innerVerifySteps={initFormValue.interiorWorkflowFlowRecordLogResponses} initFormValue.externalWorkflowFlowRecordLogResponses ?
initFormValue.externalWorkflowFlowRecordLogResponses.map(item => ({
...item,
status: item.isExecute ? 'finish' : 'wait',
})) :
[]
}
innerVerifySteps={
initFormValue.interiorWorkflowFlowRecordLogResponses ?
initFormValue.interiorWorkflowFlowRecordLogResponses.map(item => ({
...item,
status: item.isExecute ? 'finish' : 'wait',
})) :
[]
}
></AuditProcess> } ></AuditProcess> }
<Card className='' style={{marginTop: 24}}> <Card className='' style={{marginTop: 24}}>
<NiceForm <NiceForm
......
...@@ -513,6 +513,29 @@ export const coverColFiltersItem = ( ...@@ -513,6 +513,29 @@ export const coverColFiltersItem = (
} }
}; };
/**
* 找到最后一个可用的工作流状态的索引
* @param {array} data 数据
* @param {string} customKey 自定义 key
*/
export const findLastIndexFlowState = (data: any[], customKey = 'isExecute'): number => {
let index = 0;
if (!Array.isArray(data)) {
return index;
}
// 循环数据,找到状态值,一直覆盖
for (let i = 0; i < data.length; i++) {
if (!Boolean(data[i][customKey])) {
index = i - 1;
}
// 循环到最后如果 index 还是为 0 的话,说明工作流全部跑完了,此时 index 为 data.length - 1
if (i === data.length - 1 && index === 0) {
index = data.length - 1;
}
}
return index;
};
export default { export default {
isArray, isArray,
isObject, isObject,
......
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