Commit 3c667349 authored by Bill's avatar Bill

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

parents e1c2c6e1 98529af6
...@@ -8,7 +8,7 @@ export const tableListSchema: ISchema = { ...@@ -8,7 +8,7 @@ export const tableListSchema: ISchema = {
type: 'string', type: 'string',
"x-component": 'SearchFilter', "x-component": 'SearchFilter',
'x-component-props': { 'x-component-props': {
placeholder: '请输入标编号', placeholder: '请输入标编号',
align: 'flex-end', align: 'flex-end',
}, },
}, },
......
...@@ -193,7 +193,7 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => { ...@@ -193,7 +193,7 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
dataIndex: 'logisticsNo', dataIndex: 'logisticsNo',
align: 'center', align: 'center',
key: 'logisticsNo', key: 'logisticsNo',
render: text => <a target="blank" href={`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail?code=${text}`}>{text}</a> // render: text => <a target="blank" href={`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail?code=${text}`}>{text}</a>
}, },
{ {
title: '物流公司', title: '物流公司',
......
...@@ -77,20 +77,22 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => { ...@@ -77,20 +77,22 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
return ( return (
<> <>
<Row style={{ marginTop: 24 }} gutter={24}> <Row style={{ marginTop: 24 }} gutter={24}>
<Col span={12}> <Col span={(data.externalStateName !== '不接受订单') || (data.orderModel > 30) ? 15 : 12}>
<MellowCard title='交易信息' fullHeight> <MellowCard title='交易信息' fullHeight>
<RenderCard infoList={payInfo} dataSource={data} /> <RenderCard infoList={payInfo} dataSource={data} />
</MellowCard> </MellowCard>
</Col> </Col>
<Col span={6}> <Col span={(data.externalStateName !== '不接受订单') || (data.orderModel > 30) ? 9: 6}>
<MellowCard title='其他信息' fullHeight> <MellowCard title='其他信息' fullHeight>
<RenderCard infoList={otherInfo} dataSource={data} /> <RenderCard infoList={otherInfo} dataSource={data} />
</MellowCard> </MellowCard>
</Col> </Col>
<Col span={6}> {
<MellowCard title='电子合同' fullHeight> (data.externalStateName !== '不接受订单') || (data.orderModel > 30) ?
{ null
data.externalStateName !== '不接受订单' ? :
<Col span={6}>
<MellowCard title='电子合同' fullHeight>
<ContractList <ContractList
dataSource={ dataSource={
data.electronicContractUrl ? data.electronicContractUrl ?
...@@ -103,11 +105,9 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => { ...@@ -103,11 +105,9 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
null null
} }
/> />
: </MellowCard>
null </Col>
} }
</MellowCard>
</Col>
</Row> </Row>
<Modal title="发票信息" visible={isModalVisible} onOk={()=>setIsModalVisible(false)} onCancel={()=>setIsModalVisible(false)}> <Modal title="发票信息" visible={isModalVisible} onOk={()=>setIsModalVisible(false)} onCancel={()=>setIsModalVisible(false)}>
<Row gutter={[0 ,10]} style={{fontSize: 14}}> <Row gutter={[0 ,10]} style={{fontSize: 14}}>
......
...@@ -335,7 +335,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => { ...@@ -335,7 +335,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
dataIndex: 'taxRate', dataIndex: 'taxRate',
align: 'center', align: 'center',
key: 'taxRate', key: 'taxRate',
render: (t, r) => `${t}%` render: (t, r) => t ? `${t}%` : null
}, },
{ {
title: creditsCommodity ? '所需积分小计' : '金额', title: creditsCommodity ? '所需积分小计' : '金额',
...@@ -431,7 +431,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => { ...@@ -431,7 +431,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
dataIndex: 'taxRate', dataIndex: 'taxRate',
align: 'center', align: 'center',
key: 'taxRate', key: 'taxRate',
render: (t, r) => `${t}%` render: (t, r) => t ? `${t}%` : null
}, },
{ {
title: '金额', title: '金额',
......
...@@ -537,7 +537,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => { ...@@ -537,7 +537,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
dataIndex: 'taxRate', dataIndex: 'taxRate',
align: 'center', align: 'center',
key: 'taxRate', key: 'taxRate',
render: (t, r) => `${t}%` render: (t, r) => t ? `${t}%` : null
}, },
{ {
title: '金额', title: '金额',
......
...@@ -63,7 +63,7 @@ const InquirySearch = () => { ...@@ -63,7 +63,7 @@ const InquirySearch = () => {
title: '操作', title: '操作',
key: 'options', key: 'options',
dataIndex: 'options', dataIndex: 'options',
render: (text: any, record: any) => <Button disabled={record.isQuoted === 1} onClick={() => history.push(`/memberCenter/tranactionAbility/inquiryQuote/addInquiryOrder/quote?id=${record.id}`)} type='link'>报价</Button> render: (text: any, record: any) => <Button disabled={record.isQuoted === 1} onClick={() => history.push(`/memberCenter/tranactionAbility/inquiryOffer/waitAddOffer/offer?id=${record.id}`)} type='link'>报价</Button>
} }
]; ];
......
...@@ -83,7 +83,7 @@ const Material: React.FC<Materialprops> = (props: any) => { ...@@ -83,7 +83,7 @@ const Material: React.FC<Materialprops> = (props: any) => {
key: 'costPrice', key: 'costPrice',
dataIndex: 'costPrice', dataIndex: 'costPrice',
render: (text: any) => ( render: (text: any) => (
<Typography.Text>{text ?`¥${text.toFixed(2)}` : `¥0`}</Typography.Text> <Typography.Text>{text ? `¥${text.toFixed(2)}` : `¥0`}</Typography.Text>
) )
}, },
{ {
...@@ -150,19 +150,20 @@ const Material: React.FC<Materialprops> = (props: any) => { ...@@ -150,19 +150,20 @@ const Material: React.FC<Materialprops> = (props: any) => {
message.warning('请选择货品') message.warning('请选择货品')
return return
} }
console.log(e, 10086)
setDataSource(e.selectRow.map((item: any) => { setDataSource(e.selectRow.map((item: any) => {
return { return {
id: item.id, productId: item.id,
number: item.code, number: item.code,
name: item.name, name: item.name,
model: item.type, model: item.type,
category: !isEmpty(item.customerCategory) && item.customerCategory.name, category: !isEmpty(item.customerCategory) && item.customerCategory.name,
brand: !isEmpty(item.brand) && item.brand.name, brand: !isEmpty(item.brand) && item.brand.name,
unit: item.unitName, unit: item.unitName,
needCount: null, needCount: item.needCount ? item.needCount : null,
costPrice: item.costPrice, costPrice: item.costPrice,
needPrice: null, needPrice: item.needPrice ? item.needPrice : null,
arriveTime: null, arriveTime: item.arriveTime ? item.arriveTime : null,
} }
})) }))
setVisible(false) setVisible(false)
...@@ -179,6 +180,12 @@ const Material: React.FC<Materialprops> = (props: any) => { ...@@ -179,6 +180,12 @@ const Material: React.FC<Materialprops> = (props: any) => {
const data = [...dataSource]; const data = [...dataSource];
data.splice(index, 1); data.splice(index, 1);
message.success('删除成功') message.success('删除成功')
data.forEach((item, index) => {
form.setFieldsValue({
[`needCount${index}`]: item.needCount ? item.needCount : undefined,
[`arriveTime${index}`]: item.arriveTime ? moment(item.arriveTime) : undefined,
})
})
setDataSource(data) setDataSource(data)
} }
...@@ -244,6 +251,7 @@ const Material: React.FC<Materialprops> = (props: any) => { ...@@ -244,6 +251,7 @@ const Material: React.FC<Materialprops> = (props: any) => {
visible={visible} visible={visible}
onclose={() => setVisible(false)} onclose={() => setVisible(false)}
confirm={handleConfirm} confirm={handleConfirm}
rowCtlData={dataSource}
/> />
</Form> </Form>
) )
......
import React, { useRef } from 'react'; import React, { useEffect, useRef } from 'react';
import { import {
Drawer, Drawer,
Button Button
...@@ -19,14 +19,19 @@ import { ...@@ -19,14 +19,19 @@ import {
const formActions = createFormActions(); const formActions = createFormActions();
interface Iprops { interface Iprops {
/** 显示隐藏 */
visible: boolean, visible: boolean,
/** 关闭 */
onclose?(), onclose?(),
/** 确认 */
confirm?(e:any), confirm?(e:any),
/** 回显时选中的勾选 */
rowCtlData?: Array<any>[],
} }
const SelectProduct: React.FC<Iprops> = (props: any) => { const SelectProduct: React.FC<Iprops> = (props: any) => {
const ref = useRef({}); const ref = useRef<any>({});
const { visible, onclose, confirm } = props; const { visible, onclose, confirm, rowCtlData } = props;
const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'id' }); const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'id' });
const columns: ColumnType<any>[] = [ const columns: ColumnType<any>[] = [
{ {
...@@ -71,6 +76,31 @@ const SelectProduct: React.FC<Iprops> = (props: any) => { ...@@ -71,6 +76,31 @@ const SelectProduct: React.FC<Iprops> = (props: any) => {
}) })
} }
useEffect(() => {
if (rowCtlData) {
RowCtl.setSelectRow(rowCtlData.map((item:any) => {
return {
id: item.productId,
code: item.number,
name: item.name,
type: item.model,
customerCategory: { name: item.category },
brand: { name: item.brand },
unitName: item.unit,
costPrice: item.costPrice,
needCount: item.needCount,
needPrice: item.needPrice,
arriveTime: item.arriveTime,
}
}))
RowCtl.setSelectedRowKeys(rowCtlData.map(v => v.productId))
}
}, [rowCtlData])
const search = (values: any) => {
ref.current.reload(values)
}
return ( return (
<Drawer <Drawer
visible={visible} visible={visible}
...@@ -101,6 +131,7 @@ const SelectProduct: React.FC<Iprops> = (props: any) => { ...@@ -101,6 +131,7 @@ const SelectProduct: React.FC<Iprops> = (props: any) => {
controlRender={ controlRender={
<NiceForm <NiceForm
actions={formActions} actions={formActions}
onSubmit={values => search(values)}
effects={($, actions) => { effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'name', FORM_FILTER_PATH) useStateFilterSearchLinkageEffect($, actions, 'name', FORM_FILTER_PATH)
FormEffectHooks.onFieldChange$('category').subscribe(state => { FormEffectHooks.onFieldChange$('category').subscribe(state => {
......
...@@ -80,8 +80,8 @@ const DemandDetailed = () => { ...@@ -80,8 +80,8 @@ const DemandDetailed = () => {
{ {
label: '适用地市', extra: ( label: '适用地市', extra: (
<div> <div>
{areas.map((item: any, index: number) => ( {data.areas.map((it: any, idx: number) => (
<p key={`areas${index + 1}`}>{item}</p> <p key={`areas${idx + 1}`}>{`${it.province}/${it.city}`}</p>
))} ))}
</div> </div>
) )
......
...@@ -78,7 +78,7 @@ const PurchasInfo: React.FC<PurchasInfoPropsType> = (props) => { ...@@ -78,7 +78,7 @@ const PurchasInfo: React.FC<PurchasInfoPropsType> = (props) => {
const fetchAllShop = () => { const fetchAllShop = () => {
const param: any = { const param: any = {
siteId, siteId,
type: 1 type: 3
} }
PublicApi.getManageShopFindShopsBySiteId(param).then(res => { PublicApi.getManageShopFindShopsBySiteId(param).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
......
...@@ -407,16 +407,27 @@ export const SelectProductSchema: ISchema = { ...@@ -407,16 +407,27 @@ export const SelectProductSchema: ISchema = {
placeholder: '货号' placeholder: '货号'
} }
}, },
customerCategory: { customerCategoryId: {
type: 'string', type: 'string',
"x-component": 'SearchSelect',
"x-component-props": { "x-component-props": {
placeholder: '品类' placeholder: '请选择品类',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetSelectCustomerCategory,
style: {
width: 160
}
} }
}, },
brand: { brandId: {
type: 'string', type: 'string',
"x-component": 'SearchSelect',
"x-component-props": { "x-component-props": {
placeholder: '品牌' placeholder: '请选择品牌',
fetchSearch: PublicApi.getProductSelectGetSelectBrand,
style: {
width: 160
}
} }
}, },
type: { type: {
...@@ -425,7 +436,6 @@ export const SelectProductSchema: ISchema = { ...@@ -425,7 +436,6 @@ export const SelectProductSchema: ISchema = {
placeholder: '规格型号' placeholder: '规格型号'
} }
}, },
} }
}, },
sumbit: { sumbit: {
......
...@@ -34,7 +34,7 @@ export const procurementRenderField = (_orderProductRequests) => { ...@@ -34,7 +34,7 @@ export const procurementRenderField = (_orderProductRequests) => {
relevanceProductBrand: item.brand, relevanceProductBrand: item.brand,
relevanceProductCategory: item.category, relevanceProductCategory: item.category,
logistics: item.logistics.deliveryType, logistics: item.logistics.deliveryType,
id: item.materialId, // id: item.materialId,
code: item.materialCode, code: item.materialCode,
name: item.materialName, name: item.materialName,
type: item.materialType, type: item.materialType,
...@@ -62,7 +62,7 @@ export const procurementProcessField = (value) => { ...@@ -62,7 +62,7 @@ export const procurementProcessField = (value) => {
// @todo 后端暂无返回 写死1 // @todo 后端暂无返回 写死1
minOrder: 1, minOrder: 1,
// 物料信息 // 物料信息
materialId: item.id, // materialId: item.id,
materialCode: item.code, materialCode: item.code,
materialName: item.name, materialName: item.name,
materialType: item.type, materialType: item.type,
...@@ -450,7 +450,7 @@ export const productInfoColumns: any[] = [ ...@@ -450,7 +450,7 @@ export const productInfoColumns: any[] = [
dataIndex: 'taxRate', dataIndex: 'taxRate',
align: 'center', align: 'center',
key: 'taxRate', key: 'taxRate',
render: (t, r) => `${t}%` render: (t, r) => t ? `${t}%` : null
}, },
{ {
title: '金额', title: '金额',
...@@ -491,6 +491,13 @@ export const materialInfoColumns: any[] = [ ...@@ -491,6 +491,13 @@ export const materialInfoColumns: any[] = [
className: 'commonHide' className: 'commonHide'
}, },
{ {
title: '物料ID',
dataIndex: 'materialId',
align: 'center',
key: 'materialId',
className: 'commonHide'
},
{
title: '物料编号', title: '物料编号',
dataIndex: 'code', dataIndex: 'code',
align: 'center', align: 'center',
...@@ -561,7 +568,7 @@ export const materialInfoColumns: any[] = [ ...@@ -561,7 +568,7 @@ export const materialInfoColumns: any[] = [
dataIndex: 'taxRate', dataIndex: 'taxRate',
align: 'center', align: 'center',
key: 'taxRate', key: 'taxRate',
render: (t, r) => `${t}%` render: (t, r) => t ? `${t}%` : null
}, },
{ {
title: '金额', title: '金额',
......
...@@ -109,6 +109,8 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio ...@@ -109,6 +109,8 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
} }
const handleSave = row => { const handleSave = row => {
const { pageStatus } = usePageStatus()
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const newData = [...ctx.getFieldValue('orderProductRequests')]; const newData = [...ctx.getFieldValue('orderProductRequests')];
const index = newData.findIndex(item => row.id === item.id); const index = newData.findIndex(item => row.id === item.id);
...@@ -120,7 +122,7 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio ...@@ -120,7 +122,7 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
addModel === OrderModalType["HAND_ORDER"] || addModel === OrderModalType["HAND_ORDER"] ||
addModel === OrderModalType["CHANNEL_DIRECT_MINING_ORDER"] || addModel === OrderModalType["CHANNEL_DIRECT_MINING_ORDER"] ||
addModel === OrderModalType["CHANNEL_SPOT_MANUAL_ORDER"] addModel === OrderModalType["CHANNEL_SPOT_MANUAL_ORDER"]
) ? row.id : row.productId ) && (pageStatus === PageStatus.ADD) ? row.id : row.productId
newData.splice(index, 1, { newData.splice(index, 1, {
...item, ...item,
...row, ...row,
......
...@@ -169,6 +169,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction ...@@ -169,6 +169,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
} }
const handleSave = row => { const handleSave = row => {
const { pageStatus } = usePageStatus()
// 商品采购数量变动 清空之前的支付信息 // 商品采购数量变动 清空之前的支付信息
if (pageStatus === PageStatus.ADD) { if (pageStatus === PageStatus.ADD) {
ctx.setFieldValue('paymentInformationResponses', []) ctx.setFieldValue('paymentInformationResponses', [])
...@@ -184,7 +185,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction ...@@ -184,7 +185,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
addModel === OrderModalType["HAND_ORDER"] || addModel === OrderModalType["HAND_ORDER"] ||
addModel === OrderModalType["CHANNEL_DIRECT_MINING_ORDER"] || addModel === OrderModalType["CHANNEL_DIRECT_MINING_ORDER"] ||
addModel === OrderModalType["CHANNEL_SPOT_MANUAL_ORDER"] addModel === OrderModalType["CHANNEL_SPOT_MANUAL_ORDER"]
) ? row.id : row.productId ) && (pageStatus === PageStatus.ADD) ? row.id : row.productId
newData.splice(index, 1, { newData.splice(index, 1, {
...item, ...item,
...row, ...row,
......
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