Commit 7069a4d5 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

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

parents 7f21ba74 e0c7f11e
......@@ -67,7 +67,7 @@
"bizcharts": "^4.0.14",
"copy-to-clipboard": "^3.3.1",
"crypto-js": "^4.0.0",
"god": "^0.2.4",
"god": "0.2.5",
"immutability-helper": "^3.1.1",
"lingxi-design": "^1.0.14",
"lingxi-design-ui": "^1.1.21",
......
This diff is collapsed.
.field-header_container {
display: flex;
justify-content: space-between;
font-size: 14px;
margin-bottom: 18px;
}
.field-header_title {
display: flex;
align-items: center;
font-weight: 700;
&::before {
content: "";
width: 2px;
height: 14px;
background: #00B37A;
margin-right: 6px;
}
}
import React, { ReactNode } from 'react'
import mixinsClassName from 'classnames'
import './index.less'
export interface FieldHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
renderTitle: ReactNode,
extra?: ReactNode,
}
const FieldHeader:React.FC<FieldHeaderProps> = (props) => {
const { renderTitle, extra, className, ...restDivProps } = props
return (
<div className={mixinsClassName('field-header_container', className)} {...restDivProps}>
<div className='field-header_title'>{renderTitle}</div>
<div>{extra}</div>
</div>
)
}
FieldHeader.defaultProps = {}
export default FieldHeader
import React, { useState, useEffect } from 'react';
import { Input, Button, message } from 'antd';
import { LinkOutlined } from '@ant-design/icons';
import styled from 'styled-components';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import ModalTable from '@/components/ModalTable';
const RowStyleLayout = styled(props => <div {...props} />)`
width: 100%;
.relevance {
height: 100%;
background: #909399;
border-radius: 0;
&[disabled] {
background: #F4F5F7;
}
}
.ant-input-group-addon {
padding: 0;
border: none;
}
`;
const Relevance = props => {
const {
editable,
value = [],
} = props;
const {
modalProps = {
title: '标题',
width: 960,
},
selectionType = 'radio',
columns,
formilyProps,
tableProps = {},
fetchTableData,
title = '选择',
tip = '', // 点击按钮前的提示,用于前提需要提示的场景
disabled = false,
} = props.props['x-component-props'];
const tableRowKey = tableProps.rowKey || 'id';
const tableRowLableKey = tableProps.lableKey || ''; // Input展示用的 key val
const [visible, setVisible] = useState(false);
const [rowSelection, rowCtl] = useRowSelectionTable({ type: selectionType, customKey: tableRowKey });
useEffect(() => {
// Table 只能缓存 keys
const rowKeys = value.map(item => item[tableRowKey]);
rowCtl.setSelectedRowKeys(rowKeys);
rowCtl.setSelectRow(value);
}, [props.value, tableProps.rowKey]);
const handleConfirm = () => {
const rows = rowCtl.selectRow;
const keys = rows.map(item => item[tableRowKey]);
if (props.mutators) {
if (rows && rows.length) {
props.mutators.change(rows);
}
setVisible(false);
return;
}
rowCtl.setSelectedRowKeys(keys);
setVisible(false);
};
const handleModalVisible = () => {
if (!fetchTableData) {
message.warning(tip || '请传入 fetchTableData 属性,否则Table 将无法发起请求');
return;
}
setVisible(true);
};
return (
<RowStyleLayout>
<Input
value={
tableRowLableKey ?
value.map(item => item[tableRowLableKey]).join(',') :
''
}
addonAfter={(
<>
{editable && (
<Button
type="primary"
className="relevance"
icon={<LinkOutlined />}
onClick={handleModalVisible}
disabled={disabled}
block
>
{title}
</Button>
)}
</>
)}
disabled
/>
<ModalTable
confirm={handleConfirm}
cancel={() => setVisible(false)}
visible={visible}
width={960}
{...modalProps}
modalTitle={modalProps.title}
rowSelection={rowSelection}
columns={columns}
fetchTableData={fetchTableData}
formilyProps={formilyProps}
tableProps={tableProps}
resetModal={{
destroyOnClose: true,
}}
/>
</RowStyleLayout>
);
};
Relevance.defaultProps = {};
Relevance.isFieldComponent = true;
export default Relevance;
import React, { useState, useEffect } from 'react';
import { Input, Button, message } from 'antd';
import { LinkOutlined } from '@ant-design/icons';
import styled from 'styled-components';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import ModalTable from '@/components/ModalTable';
const RowStyleLayout = styled(props => <div {...props} />)`
width: 100%;
.relevance {
height: 100%;
background: #909399;
border-radius: 0;
border: none;
&[disabled] {
background: #F4F5F7;
}
}
.ant-input-group-addon {
padding: 0;
border: none;
}
`;
const Relevance = props => {
const {
editable,
value = [],
} = props;
const {
modalProps = {
title: '标题',
width: 960,
},
selectionType = 'radio',
columns,
formilyProps,
tableProps = {},
fetchTableData,
title = '选择',
tip = '', // 点击按钮前的提示,用于前提需要提示的场景
disabled = false,
} = props.props['x-component-props'];
const tableRowKey = tableProps.rowKey || 'id';
const tableRowLableKey = tableProps.lableKey || ''; // Input展示用的 key val
const [visible, setVisible] = useState(false);
const [rowSelection, rowCtl] = useRowSelectionTable({ type: selectionType, customKey: tableRowKey });
useEffect(() => {
// Table 只能缓存 keys
const rowKeys = value.map(item => item[tableRowKey]);
rowCtl.setSelectedRowKeys(rowKeys);
rowCtl.setSelectRow(value);
}, [props.value, tableProps.rowKey]);
const handleConfirm = () => {
const rows = rowCtl.selectRow;
const keys = rows.map(item => item[tableRowKey]);
if (props.mutators) {
if (rows && rows.length) {
props.mutators.change(rows);
}
setVisible(false);
return;
}
rowCtl.setSelectedRowKeys(keys);
setVisible(false);
};
const handleModalVisible = () => {
if (!fetchTableData) {
message.warning(tip || '请传入 fetchTableData 属性,否则Table 将无法发起请求');
return;
}
setVisible(true);
};
return (
<RowStyleLayout>
<Input
value={
tableRowLableKey ?
value.map(item => item[tableRowLableKey]).join(',') :
''
}
addonAfter={(
<>
{editable && (
<Button
type="primary"
className="relevance"
icon={<LinkOutlined />}
onClick={handleModalVisible}
disabled={disabled}
block
>
{title}
</Button>
)}
</>
)}
disabled
/>
<ModalTable
confirm={handleConfirm}
cancel={() => setVisible(false)}
visible={visible}
width={960}
{...modalProps}
modalTitle={modalProps.title}
rowSelection={rowSelection}
columns={columns}
fetchTableData={fetchTableData}
formilyProps={formilyProps}
tableProps={tableProps}
resetModal={{
destroyOnClose: true,
}}
/>
</RowStyleLayout>
);
};
Relevance.defaultProps = {};
Relevance.isFieldComponent = true;
export default Relevance;
......@@ -128,14 +128,7 @@ const NiceForm: React.FC<NiceFormProps> = props => {
useEffect(() => {
let paginationInfo: currentStateType = getCurrentState();
// 一般 列表检索传入的 controlRender 的 NiceForm 是没有 value 或者 initialValues 的
// value 或者 initialValues 的,表单页有
if (
match.path === paginationInfo.pathname
&& !('value' in reset)
&& !('initialValues' in reset)
) {
if(paginationInfo?.queryParams) {
reset.actions.setFormState(
state => (state.values = paginationInfo.queryParams),
);
......
......@@ -11,9 +11,27 @@ interface IProps {
const ReutrnEle: React.FC<IProps> = (props) => {
const { description, logoSrc } = props
const bubbles = (e: any) => {
let ev = e || window.event;
if(ev && ev.stopPropagation) {
ev.stopPropagation();
} else {
ev.cancelBubble = true;
}
}
return <>
<span style={{ fontSize: 12, color: '#909399FF' }}><ArrowLeftOutlined /> {logoSrc ? <img src={logoSrc} style={{ width: 48, height: 48, margin: '0 0 0 14px' }} /> : description}</span>
<span style={{ fontSize: 12, color: '#909399FF' }}>
<ArrowLeftOutlined />
{
logoSrc
?
<img src={logoSrc} style={{ width: 48, height: 48, margin: '0 0 0 14px', cursor: 'default' }} onClick={bubbles} />
:
description
}
</span>
</>
}
export default ReutrnEle
\ No newline at end of file
export default ReutrnEle
import { Modal } from "antd"
import { ReactNode, useCallback, useEffect, useState } from "react"
export interface leaveOptions {
title?: ReactNode,
onSave: any,
onModalOk(resolve: any),
onModalCancel(reject: any),
}
/**
* 对即将离开某个操作时, 发出提示弹窗
*/
export const useLeavePage = (options: leaveOptions): [React.Dispatch<React.SetStateAction<boolean>>, any] => {
const { title, onSave, onModalOk, onModalCancel } = options
const [saveStatus, setSaveStatus] = useState<boolean>(true)
const validateSaveStatus = useCallback(() => {
if (saveStatus) {
return Promise.resolve()
} else {
return new Promise((resolve, reject) => {
Modal.confirm({
content: title || '确认要离开当前页面吗,您提交的数据尚未保存',
onOk() {
onModalOk(resolve)
},
onCancel() {
onModalCancel(reject)
}
})
})
}
}, [saveStatus])
return [setSaveStatus, validateSaveStatus]
}
import { useMap } from '@umijs/hooks'
import React, { useState, useEffect } from 'react'
import { Modal } from 'antd'
import { TabTreeActions } from '@/components/TabTree'
import { ISchemaFormActions } from '@formily/antd'
import { isObject } from '@/utils'
export enum FormState {
FREE, // 空闲状态
EDIT, // 编辑状态
ADD, // 新增状态
}
export interface useTreeTabOptions {
selectCallback?(selectKey?, node?),
fetchMenuData?(),
fetchItemDetailData?(id),
// 重置右侧详情
resetDetail?(),
// 对树形工具栏做render扩展
extendsToolsRender?: any,
// 树形的实例操作方法
treeActions?: TabTreeActions
// 右侧表单的实例操作方法
formActions?: ISchemaFormActions
// 删除菜单时调用的API
deleteMenu?: any
}
export interface treeNodeResponse {
/**
* 该节点是否选中
*/
selected: boolean,
/**
* 节点信息
*/
node: any
}
export const useTreeData = (options: useTreeTabOptions = {}) => {
const { selectCallback, fetchMenuData, treeActions, formActions, extendsToolsRender, deleteMenu } = options
const [treeExtraMaps, { set, get }] = useMap<any, any>()
const [treeData, setTreeData] = useState<any[]>([])
const [treeStatus, setTreeStatus] = useState<FormState>(FormState.FREE)
const [nodeRecord, setNodeRecord] = useState<any>(null)
const [isEditForm, setIsEditForm] = useState<boolean>(false)
useEffect(() => {
resetMenu()
}, [])
const resetMenu = async () => {
if (fetchMenuData) {
const res = await fetchMenuData()
setTreeData(res.data || [])
}
}
const handleSelect = (selectKey?, node?) => {
return new Promise<treeNodeResponse>((resolve, reject) => {
if (selectCallback) {
// 完全自定义点击节点事件
selectCallback(selectKey, node)
return;
}
resolve({
selected: true,
node: node || null
})
})
}
const handleDeleteMenu = (id) => {
deleteMenu({
id: isObject(id) ? nodeRecord.key : id
}).then(() => {
setTreeStatus(FormState.FREE)
setNodeRecord(undefined)
resetMenu()
})
}
// 新增整合树形操作菜单
// 树形工具栏
const toolsRender = {
addNode(node) {
const activeParentId = treeActions && treeActions.getParent(node.key || node.id)?.id
setNodeRecord({
...node,
parentId: activeParentId, // 添加同级的时候 使用上一级的id作为parentId
})
formActions && formActions.reset({ validate: false })
setTreeStatus(FormState.ADD)
},
addChildNode(node) {
setNodeRecord({
...node,
parentId: node.key || node.id
})
formActions && formActions.reset({ validate: false })
set(node.key || node.id, null)
setTreeStatus(FormState.ADD)
},
deleteNode(node) {
const id = node.key || node.id
handleDeleteMenu(id)
},
...extendsToolsRender
}
return {
handleSelect,
treeStatus,
setTreeStatus,
treeData,
setTreeData,
nodeRecord,
setNodeRecord,
isEditForm,
setIsEditForm,
treeExtraMaps,
setTreeMaps: set,
getTreeMaps: get,
resetMenu,
toolsRender,
handleDeleteMenu
}
}
.org-tag-container {
margin-bottom: 8px;
.ant-tag-has-color, .ant-tag-has-color a, .ant-tag-has-color a:hover, .ant-tag-has-color .anticon-close, .ant-tag-has-color .anticon-close:hover {
color: #606266;
}
}
.org-tag {
color: #606266;
}
import TabTree, { createTreeActions } from '@/components/TabTree'
import { useTreeTabs } from '@/hooks/useTreeTabs'
import { PublicApi } from '@/services/api'
import { Button, Drawer, Row } from 'antd'
import React, { useEffect, useState } from 'react'
import './orgModal.less'
export interface OrgModalProps {
visible: boolean,
handleSyncSelect: any,
plateformTreeData: any,
fetchOrgsTreeData: any,
selectKeys: any[],
onSuccess(selectKeys: any[]),
onCancel(),
modalRef: any,
}
const syncTreeActions = createTreeActions()
const OrgModal:React.FC<OrgModalProps> = (props) => {
const { visible, onSuccess, onCancel, plateformTreeData, handleSyncSelect, fetchOrgsTreeData, selectKeys } = props
const [resetSearch, setResetSearch] = useState(false)
const [customPlateformExpandkeys, setCustomPlateformExpandkeys] = useState<any>()
const handleSuccess = () => {
onSuccess(syncTreeActions.getSelectKeys())
}
useEffect(() => {
syncTreeActions.setSelectKeys(selectKeys)
}, [selectKeys, syncTreeActions])
return (
<Drawer
visible={visible}
closable={false}
placement='right'
width={600}
forceRender
>
<TabTree
fetchData = {params => fetchOrgsTreeData()}
treeData={plateformTreeData}
handleSelect={handleSyncSelect}
actions={syncTreeActions}
customKey="id"
enableSearch
searchPlaceholder="组织机构名称"
checkStrictly
resetSearch={resetSearch}
customExpandkeys={customPlateformExpandkeys}
checkable={true}
/>
<Row justify='end'>
<Button onClick={onCancel} style={{marginRight: 8}}>关闭</Button>
<Button onClick={handleSuccess} type='primary'>确认</Button>
</Row>
</Drawer>
)
}
OrgModal.defaultProps = {}
export default OrgModal
......@@ -77,10 +77,12 @@ const AddUser: React.FC<{}> = () => {
...omitValue,
userId: Number(id)
} : omitValue
await run(params)
setTimeout(() => {
history.goBack(-1)
}, 300)
const result = await run(params)
if (result.code === 1000) {
setTimeout(() => {
history.goBack(-1)
}, 300)
}
};
// 角色确认弹窗
......
This diff is collapsed.
import React, { ReactNode, useRef } from 'react';
import { history } from 'umi'
import { Button, Popconfirm, Card } from 'antd';
import {
PlusOutlined,
} from '@ant-design/icons';
import {StandardTable} from 'god'
import {ColumnType} from 'antd/lib/table/interface'
import { PublicApi } from '@/services/api';
import StatusSwitch from '@/components/StatusSwitch';
import EyePreview from '@/components/EyePreview';
import { STATUS_ENUM } from '@/constants';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
const fetchData = async (params) => {
const { data } = await PublicApi.getMemberAbilitySalesPage(params)
return data
}
const ChannelMember: React.FC<{}> = () => {
const ref = useRef<any>({})
const deleteItem = async (record) => {
// 删除该项
await PublicApi.postMemberAbilitySalesDelete({
userId: record.userId
})
ref.current.reload()
}
const updateItem = (record) => {
history.push(`/memberCenter/channelAbility/memberList/add?id=${record.userId}&preview=0`)
}
const columns: ColumnType<any>[] = [
{
title: '登录账号',
dataIndex: 'userId',
align: 'center',
key: 'userId',
},
{
title: '姓名',
dataIndex: 'name',
align: 'center',
key: 'name',
className: 'commonPickColor',
render: (text, record) => <EyePreview url={`/memberCenter/channelAbility/memberList/detail?id=${record.userId}&preview=1`}>{text}</EyePreview>
},
{
title: '所属机构',
align: 'center',
dataIndex: 'orgName',
key: 'orgName',
},
{
title: '绑定手机号',
align: 'center',
dataIndex: 'phone',
key: 'phone',
},
{
title: '职位',
align: 'center',
dataIndex: 'jobTitle',
key: 'jobTitle',
},
{
title: '所属角色',
align: 'center',
dataIndex: 'memberRoleName',
key: 'memberRoleName',
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (text:any, record:any) => {
return <>
<Button type='link' onClick={()=>updateItem(record)}>修改</Button>
{
record.status === 0 ?
<Popconfirm
title="确定要执行这个操作?"
onConfirm={() => deleteItem(record)}
okText="是"
cancelText="否"
>
<Button type='link'>删除</Button>
</Popconfirm>
: null
}
</>
}
}
];
return (
<PageHeaderWrapper>
<Card className="common-wrapper">
<StandardTable
columns={columns}
currentRef={ref}
fetchTableData={(params:any) => fetchData(params)}
formilyLayouts={{
justify: 'space-between'
}}
formilyChilds={{
layouts: {
order: 2
},
children: <Button style={{width: 140}} icon={<PlusOutlined/>} onClick={() => history.push('/memberCenter/channelAbility/memberList/add')} type='primary'>新建</Button>
}}
formilyProps={{
layouts: {
order: 3
},
ctx: {
effects: ($) => {
$('onFieldInputChange', 'status').subscribe(() => {
ref.current.reload()
})
},
schema: {
type: 'object',
properties: {
account: {
type: 'Search',
"x-component-props": {
placeholder: '请输入角色名称'
}
},
name: {
type: 'Search',
"x-component-props": {
placeholder: '请输入角色名称'
}
}
}
}
}
}}
/>
</Card>
</PageHeaderWrapper>
)
}
export default ChannelMember
......@@ -232,6 +232,13 @@ const ModalTableOrder: React.FC<ModalTableProps> = (props) => {
}
})
break;
case 5:
PublicApi.getEnhanceProcessToBeDeliveryList({ ...parmas }).then((res: any) => {
if (res.code === 1000) {
resolve(res.data)
}
})
break;
}
})
}
......@@ -256,45 +263,46 @@ const ModalTableOrder: React.FC<ModalTableProps> = (props) => {
{...nestTableProps}
/>
) : (
<StandardTable
tableType='small'
currentRef={selfRef}
fetchTableData={(params) => fetchData(params)}
formRender={(child, ps) => <Row justify='space-between' style={{ marginBottom: 16 }}>
<Col span={18} style={{ zIndex: 99 }}>
<Form form={form}>
<Form.Item name='radio' label='单据选择'>
<Radio.Group onChange={(e) => { setType(e.target.value); selfRef.current.reload(); }}>
<Radio value={1}>订单</Radio>
<Radio value={2}>换货申请单(退货发货)</Radio>
<Radio value={3}>换货申请单(换货发货)</Radio>
<Radio value={4}>退货申请单</Radio>
</Radio.Group>
</Form.Item>
</Form>
</Col>
<Col style={{ marginTop: 4 }}>{ps}</Col>
<Col span={18} style={{ zIndex: 99 }}>{child}</Col>
</Row >}
formilyProps={
{
ctx: {
schema: type === 1 ? logisticsDeliverySearchSchema : otherSearchSchema,
components: { ModalSearch: Search, SearchSelect, Submit, DateSelect },
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
type === 1 ? 'orderNo' : 'applyNo',
FORM_FILTER_PATH,
);
}
<StandardTable
tableType='small'
currentRef={selfRef}
fetchTableData={(params) => fetchData(params)}
formRender={(child, ps) => <Row justify='space-between' style={{ marginBottom: 16 }}>
<Col span={18} style={{ zIndex: 99 }}>
<Form form={form}>
<Form.Item name='radio' label='单据选择'>
<Radio.Group onChange={(e) => { setType(e.target.value); selfRef.current.reload(); }}>
<Radio value={1}>订单</Radio>
<Radio value={2}>换货申请单(退货发货)</Radio>
<Radio value={3}>换货申请单(换货发货)</Radio>
<Radio value={4}>退货申请单</Radio>
<Radio value={5}>生产通知单</Radio>
</Radio.Group>
</Form.Item>
</Form>
</Col>
<Col style={{ marginTop: 4 }}>{ps}</Col>
<Col span={18} style={{ zIndex: 99 }}>{child}</Col>
</Row >}
formilyProps={
{
ctx: {
schema: type === 1 ? logisticsDeliverySearchSchema : otherSearchSchema,
components: { ModalSearch: Search, SearchSelect, Submit, DateSelect },
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
type === 1 ? 'orderNo' : 'applyNo',
FORM_FILTER_PATH,
);
}
}
}
{...resetTable}
/>
)
}
{...resetTable}
/>
)
}
</Modal>
......
......@@ -116,7 +116,7 @@ const AddLogistics: React.FC<{}> = () => {
width: 120,
dataIndex: 'amount',
render: (text: any, record: any, index: number) =>
<Form.Item noStyle name={`amount${index}`} initialValue={record.amount} rules={[{ required: true, message: '请输入数量' }]}>
<Form.Item style={{ marginBottom: 0 }} name={`amount${index}`} initialValue={record.amount} rules={[{ required: true, message: '请输入数量' }]}>
<Input type='number' min={1} onBlur={(e) => inputOnchange(record.productId, e, 'amount')} />
</Form.Item>
......@@ -127,7 +127,7 @@ const AddLogistics: React.FC<{}> = () => {
width: 120,
dataIndex: 'carton',
render: (text: any, record: any, index: number) =>
<Form.Item noStyle name={`carton${index}`} initialValue={record.carton} rules={[{ required: true, message: '请输入箱数' }]}>
<Form.Item style={{ marginBottom: 0 }} name={`carton${index}`} initialValue={record.carton} rules={[{ required: true, message: '请输入箱数' }]}>
<Input type='number' min={1} onBlur={(e) => inputOnchange(record.productId, e, 'carton')} />
</Form.Item>
},
......@@ -137,7 +137,7 @@ const AddLogistics: React.FC<{}> = () => {
width: 120,
dataIndex: 'weight',
render: (text: any, record: any, index: number) =>
<Form.Item noStyle name={`weight${index}`} initialValue={record.weight} rules={[{ required: true, message: '请输入重量 (KG)' }]}>
<Form.Item style={{ marginBottom: 0 }} name={`weight${index}`} initialValue={record.weight} rules={[{ required: true, message: '请输入重量 (KG)' }]}>
<Input type='number' min={1} onBlur={(e) => inputOnchange(record.productId, e, 'weight')} />
</Form.Item>
},
......@@ -147,7 +147,7 @@ const AddLogistics: React.FC<{}> = () => {
width: 120,
dataIndex: 'volume',
render: (text: any, record: any, index: number) =>
<Form.Item noStyle name={`volume${index}`} initialValue={record.volume} rules={[{ required: true, message: '请输入体积 (M3)' }]}>
<Form.Item style={{ marginBottom: 0 }} name={`volume${index}`} initialValue={record.volume} rules={[{ required: true, message: '请输入体积 (M3)' }]}>
<Input type='number' min={1} onBlur={(e) => inputOnchange(record.productId, e, 'volume')} />
</Form.Item>
},
......@@ -376,6 +376,25 @@ const AddLogistics: React.FC<{}> = () => {
return new Promise(resolve => {
switch (Number(createType)) {
case 1:
if (query.shipmentOrderId) {
PublicApi.getWarehouseInvoicesProductList({ ...params, invoicesId: query.shipmentOrderId }).then((res: any) => {
if (res.code === 1000) {
res.data.data.forEach(item => {
item.category = item.categoryName
item.brand = item.brandName
item.unit = item.unitName
})
resolve(res.data)
}
})
} else {
PublicApi.getOrderProcurementOrderProductList({ ...params, id: query.relevanceOrderId, orderNo: query.relevanceOrderCode }).then((res: any) => {
if (res.code === 1000) {
resolve(res)
}
})
}
break;
case 2:
PublicApi.getProductInvoicesProductList({ ...params, invoicesId: query.shipmentOrderId ? query.shipmentOrderId : query.relevanceOrderId }).then((res: any) => {
if (res.code === 1000) {
......@@ -636,6 +655,7 @@ const AddLogistics: React.FC<{}> = () => {
if (goodsRef.errorFields) {
data[1] = goodsRef.errorFields.length;
setbadge([...data]);
setLoading(false);
} else {
data[1] = 0;
setbadge(data)
......@@ -770,7 +790,7 @@ const AddLogistics: React.FC<{}> = () => {
<div>{query.receiverFullAddress}</div>
</Form.Item>
<Form.Item label="发货地址" name="shipperAddressId" rules={[{ required: true, message: '请选择发货地址' }]}>
<Select allowClear onChange={(value, option) => handleSelectAddress(option )}>
<Select allowClear onChange={(value, option) => handleSelectAddress(option)}>
{
listShipperAddress.map((item: any, idx: number) => (
<Option key={item.id} value={item.id} shipperName={item.shipperName} shipperPhone={item.phone}>{item.fullAddress}</Option>
......@@ -849,7 +869,7 @@ const AddLogistics: React.FC<{}> = () => {
/>
{/* 选择对应订单号/售后单 */}
<ModalTableOrder
width={900}
width={1000}
visible={invoicesvisible}
columns={invoicesColumns}
invoicesNo={query.invoicesNo}
......
import React, { Component, useState, useEffect } from 'react';
import { Modal, Button, Form } from 'antd'
import { Modal, Button, Form, message } from 'antd'
import {
SchemaForm, SchemaMarkupField as Field,
createFormActions,
......
......@@ -217,7 +217,7 @@ const AddRepository:React.FC<{}> = (props) => {
<Tabs.TabPane key='tab1' tab='仓位设置'>
<PositionSetting onFieldChange={onPublicFieldChange} addSchemaAction={addSchemaAction} schema={repositTabOneSchema} formSubmit={formSubmit}/>
</Tabs.TabPane>
<Tabs.TabPane key='tab2' tab='库存调入\调'>
<Tabs.TabPane key='tab2' tab='库存调入\调'>
<Tabs defaultActiveKey='tab2-1' tabPosition='left'>
<Tabs.TabPane tab='库存调入' key="tab2-1">
{/* 使用formProvider 共享两个表单中的值 */}
......
......@@ -106,7 +106,7 @@ const Details: React.FC<parmas> = (props) => {
console.log(data)
window.open(`/shop/commodity/detail?id=${data.commodityId}&shopId=${btoa(JSON.stringify({ roleId: data.memberRoleId, memberId: data.memberId }))}`)
}
const inquiryGoods: ColumnType<any>[] = [{
const column: ColumnType<any>[] = [{
title: 'ID',
key: 'productId',
dataIndex: 'productId',
......@@ -131,14 +131,52 @@ const Details: React.FC<parmas> = (props) => {
title: '采购数量',
key: 'purchaseCount',
dataIndex: 'purchaseCount',
}]
const inquiryGoods: ColumnType<any>[] = [{
title: 'ID',
key: 'productId',
dataIndex: 'productId',
}, {
title: '报价商品名称',
key: 'productName',
dataIndex: 'productName',
render: (text: any, record: any) => <EyePreview type='button' handleClick={() => handleJump(record)}>{text}</EyePreview>
}, {
title: '品类',
key: 'category',
dataIndex: 'category',
}, {
title: '品牌',
key: 'brand',
dataIndex: 'brand',
}, {
title: '单位',
key: 'unit',
dataIndex: 'unit',
}, {
title: '采购数量',
key: 'purchaseCount',
dataIndex: 'purchaseCount',
},
{
title: '报价单价',
key: 'price',
dataIndex: 'price',
}, {
render: (text:any) => (
<>
{ text ? `¥${text.toFixed(2)}` : `¥0`}
</>
)
},
{
title: '金额',
key: 'money',
dataIndex: 'money',
render: (text:any) => (
<>
{ text ? `¥${text.toFixed(2)}` : `¥0`}
</>
)
}]
// 条件交易&其他报价说明
const infoTem = {
......@@ -488,8 +526,8 @@ const Details: React.FC<parmas> = (props) => {
</Tabs>
</div>
<div className={style.item_wrap}>
<div className={style.mainCol_title} style={view === 2 ? { paddingBottom: '0px' } : { paddingBottom: '24px' }}>询价商品</div>
{view === 1 && <Table columns={inquiryGoods} pagination={false} rowKey='id' dataSource={data.inquiryListProductRequests} />}
<div className={style.mainCol_title} style={view === 2 ? { paddingBottom: '0px' } : { paddingBottom: '24px' }}>{view === 1 ? '商品询价' : '商品报价'}</div>
{view === 1 && <Table columns={column} pagination={false} rowKey='id' dataSource={data.inquiryListProductRequests} />}
{view === 2 &&
<StandardTable
currentRef={ref}
......
......@@ -33,7 +33,6 @@ const BasicInfo: React.FC<queryProps> = (props) => {
const handleOkAddMember = () => {
if (inquiryRowCtl.selectRow.length > 0) {
setVisibleChannelMember(false)
console.log(inquiryRowCtl.selectRow[0])
setinquiryNo(inquiryRowCtl.selectRow[0]);
getMemberList(inquiryRowCtl.selectRow[0]); // 回传给父级
}
......@@ -145,8 +144,8 @@ const BasicInfo: React.FC<queryProps> = (props) => {
<Form.Item label='报价单号' name='quotationNo'>
<span>{Object.keys(editData).length > 0 ? editData.quotationNo : '-'}</span>
</Form.Item>
<Form.Item label='询价会员' name='memberName'>
<span>{Object.keys(editData).length > 0 ? editData.memberName : '-'}</span>
<Form.Item label='询价会员' name='inquiryListMemberName'>
<span>{Object.keys(editData).length > 0 ? (editData.inquiryListMemberName || editData.memberName ) : '-'}</span>
</Form.Item>
<Form.Item label='报价截止时间' name='quotationAsTime'>
<span>{Object.keys(editData).length > 0 ? format(editData.quotationAsTime) : '-'}</span>
......
......@@ -136,6 +136,32 @@ const Details: React.FC<parmas> = (props) => {
console.log(data)
window.open(`/shop/commodity/detail?id=${data.productId}&type=2&shopId=${btoa(JSON.stringify({ roleId: data.memberRoleId, memberId: data.memberId }))}`)
}
const column: ColumnType<any>[] = [{
title: 'ID',
key: 'productId',
dataIndex: 'productId',
}, {
title: '报价商品名称',
key: 'productName',
dataIndex: 'productName',
render: (text: any, record: any) => <EyePreview type='button' handleClick={() => handleJump(record)}>{text}</EyePreview>
}, {
title: '品类',
key: 'category',
dataIndex: 'category',
}, {
title: '品牌',
key: 'brand',
dataIndex: 'brand',
}, {
title: '单位',
key: 'unit',
dataIndex: 'unit',
}, {
title: '采购数量',
key: 'purchaseCount',
dataIndex: 'purchaseCount',
}]
const inquiryGoods: ColumnType<any>[] = [{
title: 'ID',
key: 'productId',
......@@ -161,6 +187,26 @@ const Details: React.FC<parmas> = (props) => {
title: '采购数量',
key: 'purchaseCount',
dataIndex: 'purchaseCount',
},
{
title: '报价单价',
key: 'price',
dataIndex: 'price',
render: (text:any) => (
<>
{ text ? `¥${text.toFixed(2)}` : `¥0`}
</>
)
},
{
title: '金额',
key: 'money',
dataIndex: 'money',
render: (text:any) => (
<>
{ text ? `¥${text.toFixed(2)}` : `¥0`}
</>
)
}]
// 条件交易&其他报价说明
const infoTem = {
......@@ -532,8 +578,8 @@ const Details: React.FC<parmas> = (props) => {
</Tabs>
</div>
<div className={style.item_wrap}>
<div className={style.mainCol_title}>询价商品</div>
{view === 1 && <Table columns={inquiryGoods} pagination={false} rowKey='id' dataSource={data.inquiryListProductRequests} />}
<div className={style.mainCol_title}>{view === 1 ? '商品询价' : '商品报价'}</div>
{view === 1 && <Table columns={column} pagination={false} rowKey='id' dataSource={data.inquiryListProductRequests} />}
{view === 2 &&
<StandardTable
currentRef={ref}
......
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