Commit 196d77b5 authored by Bill's avatar Bill

fix: 加工与结算bug

parent 82ccea90
......@@ -209,11 +209,12 @@ const MemberSettleAdd: React.FC = () => {
return (
<PageHeaderWrapper
extra={[
<Button loading={submitLoading} key="1" type="primary" onClick={handleClick} >
保存
</Button>,
]}
onBack={() => window.history.back()}
extra={[
<Button loading={submitLoading} key="1" type="primary" onClick={handleClick} >
保存
</Button>,
]}
>
<Card>
<NiceForm
......
import React, { useEffect, useState, } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined } from '@ant-design/icons';
import { Button, Card, Select, DatePicker, Radio, Table, Space, message } from 'antd';
import { Button, Card, Select, DatePicker, Radio, Table, Space, message, Modal } from 'antd';
import { history } from 'umi';
import ReutrnEle from '@/components/ReturnEle';
import { createFormActions, FormEffectHooks } from '@formily/antd';
......@@ -404,7 +404,7 @@ const Add: React.FC<{}> = () => {
})
}
const handleChangeSomeList = (values: any) => {
const handleChangeSomeList = (values: any, onOk, onCancel) => {
const isProcessProduct = formActions.getFieldValue('source') === 2;
const keyName = isProcessProduct ? 'Tabs.tab-2.layout.productList' : 'Tabs.tab-2.layout.orderList'
let someList = formActions.getFieldValue(keyName);
......@@ -419,9 +419,21 @@ const Add: React.FC<{}> = () => {
productProps: values.productProps,
files: values.files
}
console.log(someList)
formActions.setFieldValue(keyName, [...someList])
if(!isProcessProduct && values.process.quantity > someList[index].restTotal) {
Modal.confirm({
title: '当前编辑的商品加工数量大于剩余加工数量,是否继续?',
onOk: () => {
formActions.setFieldValue(keyName, [...someList])
!!onOk && onOk();
}
})
} else {
formActions.setFieldValue(keyName, [...someList])
!!onOk && onOk();
}
}
}
/**
......
......@@ -97,6 +97,19 @@ const Detail: React.FC<{}> = () => {
}
return res;
}, [info])
const hasProductNoReply = useMemo(() => {
let res = false
if(pathname === `${PENDING_RECEIPT_PATH}/detail`) {
if(!info || !info.pnoReceiveDeliverDetailDOList) {
return false
}
res = info.pnoReceiveDeliverDetailDOList.some((item) => {
return item.receiptStatus === 1
});
return res
}
return res;
}, [info])
const getInfo = () => {
const service = SERVICE_MAP[pathname];
......@@ -230,12 +243,16 @@ const Detail: React.FC<{}> = () => {
const NextBtn = <Button loading={loading} icon={<SaveOutlined />} onClick={toNext} type="primary">提交</Button>
const AllReceiptReceive = (
<Space direction={"vertical"}>
<Popconfirm
title={hasProductNoDelievery ? '您还有未发货的商品,是否确认全部发货已完成' : '确认本单全部发货单是否已全部收到回单'}
onConfirm={() => handleAllReceiptReceive(true)}
>
<Button loading={loading} type="primary" style={{width: '100%'}}>确认本单全部发货单已收到回单</Button>
</Popconfirm>
{
hasProductNoReply
? <Popconfirm
title={'确认本单全部发货单是否已全部收到回单'}
onConfirm={() => handleAllReceiptReceive(true)}
>
<Button loading={loading} type="primary" style={{width: '100%'}}>确认本单全部发货单已收到回单</Button>
</Popconfirm>
: null
}
<div style={{display: 'flex', justifyContent: 'flex-end'}}>
<Popconfirm
title={hasProductNoDelievery ? '是否继续发货' : '您商品都已发货,是否确认还需要继续发货'}
......@@ -339,7 +356,7 @@ const Detail: React.FC<{}> = () => {
style={{padding: '0 32px', fontWeight: 400}}
colon={false}
>
<Descriptions.Item span={3} label="通知单摘要:" style={{overflow: 'hidden'}}>{info?.summary}我额时代峻峰卡德加弗兰克敬爱的封了就枯鲁杜鹃发大数据觉得封了就艾迪康类父节点拉屎发送到咖啡机的律师费</Descriptions.Item>
<Descriptions.Item span={3} label="通知单摘要:" style={{overflow: 'hidden'}}>{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>
......@@ -460,12 +477,6 @@ const Detail: React.FC<{}> = () => {
<Appendix files={info.otherAsk?.annex}/>
</div>
</div>
{/* <Row justify="space-between">
<Col flex={8}>
</Col>
<Col flex={2} style={{marginLeft: '20px'}} >
</Col>
</Row> */}
</div>
<div style={{marginTop: '20px'}} >
<Card bodyStyle={{padding: '10px 24px 24px 24px'}}>
......
......@@ -135,16 +135,17 @@ const processStock: React.FC<{}> = () => {
}
},
{
title: () => pathname == PENDING_ADD_PROCESS_PATH ? '入库单号' : '发货单号',
title: () => [PENDING_ADD_PROCESS_PATH,ASSIGN_PENDING_RECEIVE].includes(pathname) ? '入库单号' : '发货单号',
dataIndex: 'deliveryNo',
render: (text, record: any) => {
if(!text) {
return null
}
const url = '/memberCenter/tranactionAbility/stockSellStorage/bills/detail';
const type = pathname == PENDING_ADD_PROCESS_PATH ? DOC_TYPE_PROCESS_RECEIPT : DOC_TYPE_PROCESS_INVOICE
const type = [PENDING_ADD_PROCESS_PATH,ASSIGN_PENDING_RECEIVE].includes(pathname) ? 'storage' : 'delivery'
const id = type === 'storage' ? record.storageId : record.deliveryId
return (
<EyePreview url={`${url}?id=${record.id}`} >{text}</EyePreview>
<EyePreview url={`${url}?id=${id}`} >{record[`${type}No`]}</EyePreview>
)
}
},
......
......@@ -180,8 +180,9 @@ export const SUPPLIER_INNER_STATUS_COLOR = {
"3": "processing",
'4': 'processing',
"5": "success",
"7": "processing",
"9": "error",
"10": "success"
"10": "success",
}
......
......@@ -24,7 +24,6 @@ const styles = {
const AppendixItem = (props) => {
const handleDownload = (name:string, url: string) => {
console.log(url, name);
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
......
......@@ -27,6 +27,10 @@ const schema = {
{
required: true,
message: '请填写加工数量'
},
{
pattern: /^\d+$/,
message: '请填写数字'
}
]
},
......
......@@ -5,7 +5,7 @@ import { PublicApi } from '@/services/api'
interface Iprops {
type: "view" | "edit", // veiw | edit,
submit?: (params: any) => void,
submit?: (params: any, onOk, onCancel) => void,
// id: string,
// primaryKey: string
quantity?: string,
......@@ -73,16 +73,31 @@ const ProcessDetail: React.FC<Iprops> = (props) => {
setFiles(props.files);
}, [props.files])
const formSubmit = (values) => {
!!props.submit && props.submit({
files: files,
uniqueID: props.uniqueID,
process: values,
productProps: info?.attributes
useEffect(() => {
setInfo((prevState) => {
return {
...prevState,
quantity: props.quantity,
processUnitPrice: props.processUnitPrice
}
})
setVisible(false);
}, [props.quantity, props.processUnitPrice])
console.log("fuck");
const formSubmit = (values) => {
!!props.submit && props.submit(
{
files: files,
uniqueID: props.uniqueID,
process: values,
productProps: info?.attributes
},
() => {
setVisible(false);
},
() => {
console.log("error")
}
)
}
const fileOnChange = (values) => {
......@@ -109,7 +124,7 @@ const ProcessDetail: React.FC<Iprops> = (props) => {
取消
</Button>
<Button onClick={handleSubmit} type="primary">
确认{visible}
确认
</Button>
</div>
}
......
......@@ -26,17 +26,30 @@ interface Iprops {
const FileList: React.FC<Iprops> = (props) => {
const { name, url} = props;
const handleDownload = (name:string, url: string) => {
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", name);
document.body.appendChild(link) //a标签插至页面中
link.click();
document.body.removeChild(link);
}
return (
<div className={styles.item} >
<div className={styles.icon}>
<img src={pdf_icon} className={styles.img} />
</div>
<a className={styles.fileName} download={name} href={url} target={"_blank"}>{name}</a>
<div className={styles.remove} onClick={() => !!props.removeFile && props.removeFile(name)}>
<DeleteOutlined />
</div>
<div className={styles.fileName} onClick={() => handleDownload(name, url)}>{name}</div>
{
!!props.removeFile &&
<div className={styles.remove} onClick={() => props.removeFile(name)}>
<DeleteOutlined />
</div>
}
</div>
)
}
export default FileList
\ No newline at end of file
export default FileList
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