Commit 5f27da24 authored by XieZhiXiong's avatar XieZhiXiong

Merge branch 'dev' into test

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