Commit 8d08fc75 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

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

parents 8db3aea9 42af0b13
...@@ -28,6 +28,8 @@ const defaultCityData = { index: 0, provinceCode: 0, province: '', cityCode: 0, ...@@ -28,6 +28,8 @@ const defaultCityData = { index: 0, provinceCode: 0, province: '', cityCode: 0,
const LogisticsInfo: React.FC<LogisticsInfoPropsType> = (props) => { const LogisticsInfo: React.FC<LogisticsInfoPropsType> = (props) => {
const { siteUrl, siteId } = props.SiteStore const { siteUrl, siteId } = props.SiteStore
const [door, setDoor] = useState<string>('');
const [resUrl, setResUrl] = useState<string>('');
const [formIsHalfFilledOut, setFormIsHalfFilledOut] = useState(false) const [formIsHalfFilledOut, setFormIsHalfFilledOut] = useState(false)
const [form] = Form.useForm() const [form] = Form.useForm()
const [allMallList, setAllMallList] = useState([]) const [allMallList, setAllMallList] = useState([])
...@@ -163,7 +165,6 @@ const LogisticsInfo: React.FC<LogisticsInfoPropsType> = (props) => { ...@@ -163,7 +165,6 @@ const LogisticsInfo: React.FC<LogisticsInfoPropsType> = (props) => {
} }
const handleInputChange = (data: any) => { const handleInputChange = (data: any) => {
console.log(data, 100086)
setMainBusiness(data); setMainBusiness(data);
form.setFieldsValue({ form.setFieldsValue({
mainBusiness: data mainBusiness: data
...@@ -346,13 +347,12 @@ const LogisticsInfo: React.FC<LogisticsInfoPropsType> = (props) => { ...@@ -346,13 +347,12 @@ const LogisticsInfo: React.FC<LogisticsInfoPropsType> = (props) => {
const { value } = e.target; const { value } = e.target;
const result = [...slideshowBOList]; const result = [...slideshowBOList];
result[index].link = value; result[index].link = value;
console.log(result)
setSlideshowBOList(result) setSlideshowBOList(result)
form.setFieldsValue({ form.setFieldsValue({
slideshowBOList: result slideshowBOList: result
}) })
} }
/**
const handleMallSelectChange = (mallId: number) => { const handleMallSelectChange = (mallId: number) => {
setShopId(mallId) setShopId(mallId)
if (!shopInfo) { if (!shopInfo) {
...@@ -395,10 +395,6 @@ const LogisticsInfo: React.FC<LogisticsInfoPropsType> = (props) => { ...@@ -395,10 +395,6 @@ const LogisticsInfo: React.FC<LogisticsInfoPropsType> = (props) => {
return result return result
} }
const handleFormValueChange = () => {
setFormIsHalfFilledOut(true)
}
const getSelectMallStoreUrl = () => { const getSelectMallStoreUrl = () => {
if (!shopInfo) { if (!shopInfo) {
return null return null
...@@ -415,6 +411,28 @@ const LogisticsInfo: React.FC<LogisticsInfoPropsType> = (props) => { ...@@ -415,6 +411,28 @@ const LogisticsInfo: React.FC<LogisticsInfoPropsType> = (props) => {
} }
return null return null
} }
*/
const handleFormValueChange = () => {
setFormIsHalfFilledOut(true)
}
/** 获取店铺链接 */
const checkUrl = (url) => {
if (url && typeof url === 'string') {
if (url.indexOf('/') === 0) {
return url.replace('/', '').trim()
} else {
return `${url}`.trim()
}
}
}
const handleMallSelectChange = (val, option) => {
setDoor(option.children);
if (option.url) {
checkUrl(option.url) ? setResUrl(`${checkUrl(option.url)}.${siteUrl}`) : setResUrl(`${siteUrl}`)
}
}
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
...@@ -583,13 +601,17 @@ const LogisticsInfo: React.FC<LogisticsInfoPropsType> = (props) => { ...@@ -583,13 +601,17 @@ const LogisticsInfo: React.FC<LogisticsInfoPropsType> = (props) => {
<Select allowClear value={shopId} className={styles.form_item} onChange={handleMallSelectChange}> <Select allowClear value={shopId} className={styles.form_item} onChange={handleMallSelectChange}>
{ {
allMallList.map(item => ( allMallList.map(item => (
<Select.Option key={item.id} value={item.id}>{item.name}</Select.Option> <Select.Option key={item.id} value={item.id} url={item.url}>{item.name}</Select.Option>
)) ))
} }
</Select> </Select>
{ {resUrl && (
getSelectMallStoreUrl() <div className={styles.shop_url}>
} <span>当前{door}链接:</span>
<label>{resUrl}</label>
<CopyOutlined className={styles.copy_icon} onClick={() => handleCopyLinke(resUrl)} />
</div>
)}
</Form.Item> </Form.Item>
</TabPane> </TabPane>
<TabPane tab='SEO' key='2' forceRender> <TabPane tab='SEO' key='2' forceRender>
......
...@@ -92,7 +92,7 @@ const BidCommonLayout: React.FC<BidCommonLayoutProps> = (props: any) => { ...@@ -92,7 +92,7 @@ const BidCommonLayout: React.FC<BidCommonLayoutProps> = (props: any) => {
<Divider dashed style={{ color: '#EBECF0' }} /> <Divider dashed style={{ color: '#EBECF0' }} />
<div className={selfStyles.baseItem}> <div className={selfStyles.baseItem}>
<h5 className={selfStyles.label}>授标意见: </h5> <h5 className={selfStyles.label}>授标意见: </h5>
<h5 className={selfStyles.content}>{effect.signUpIdea}</h5> <h5 className={selfStyles.content}>{effect.signUpIdea || '-'}</h5>
</div> </div>
<div className={selfStyles.baseItem}> <div className={selfStyles.baseItem}>
<h5 className={selfStyles.label}>附件: </h5> <h5 className={selfStyles.label}>附件: </h5>
......
...@@ -148,8 +148,8 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => { ...@@ -148,8 +148,8 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
if (data.length > 0) { if (data.length > 0) {
formatting(data, i); formatting(data, i);
} else { } else {
message.error('当前暂无比价信息'); // message.error('当前暂无比价信息');
setDisabled(true); setDisabled(false);
} }
setLoading(false); setLoading(false);
......
...@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'; ...@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
import { Modal } from 'antd'; import { Modal } from 'antd';
import { import {
SchemaForm, SchemaMarkupField as Field, SchemaForm, SchemaMarkupField as Field,
createAsyncFormActions, createFormActions,
FormEffectHooks, FormEffectHooks,
} from '@formily/antd' } from '@formily/antd'
import { Input, Radio, DatePicker, Checkbox } from '@formily/antd-components' import { Input, Radio, DatePicker, Checkbox } from '@formily/antd-components'
...@@ -11,7 +11,7 @@ import moment from 'moment'; ...@@ -11,7 +11,7 @@ import moment from 'moment';
import styles from './index.less'; import styles from './index.less';
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
const actions = createAsyncFormActions() const actions = createFormActions()
const { onFieldChange$ } = FormEffectHooks; const { onFieldChange$ } = FormEffectHooks;
export interface IProps { export interface IProps {
...@@ -42,6 +42,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => { ...@@ -42,6 +42,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
const [confirmLoading, setConfirmLoading] = useState<boolean>(false); const [confirmLoading, setConfirmLoading] = useState<boolean>(false);
const useFormEffects = () => { const useFormEffects = () => {
const { setFieldState } = createFormActions()
if (modalType === 'audit') { if (modalType === 'audit') {
onFieldChange$('state').subscribe(({ value }) => { onFieldChange$('state').subscribe(({ value }) => {
actions.setFieldState('auditOpinion', state => { actions.setFieldState('auditOpinion', state => {
......
...@@ -81,6 +81,8 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -81,6 +81,8 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
const handleClose = () => { const handleClose = () => {
onClose() onClose()
resetValue() resetValue()
setFiles([])
setProductId(0)
} }
/** 确定 */ /** 确定 */
const handleConfirm = () => { const handleConfirm = () => {
...@@ -89,6 +91,8 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -89,6 +91,8 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
attribute, attribute,
files, files,
}) })
setProductId(0)
setFiles([])
resetValue() resetValue()
} }
...@@ -146,9 +150,18 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -146,9 +150,18 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
if (record.productId) { if (record.productId) {
GetCommodityAttribute(record.productId); GetCommodityAttribute(record.productId);
} }
record.enclosureUrls && setFiles(record.enclosureUrls)
} }
}, [rel, record]) }, [rel, record])
const handleSelProduct = (data) => {
console.log(data);
data.id && setProductId(data.id);
data.productId && setProductId(data.productId);
setFlag(true)
}
return ( return (
<> <>
<Drawer <Drawer
...@@ -169,10 +182,10 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -169,10 +182,10 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
> >
<Button onClick={handleClose} style={{ marginRight: 8 }}> <Button onClick={handleClose} style={{ marginRight: 8 }}>
取消 取消
</Button> </Button>
<Button onClick={handleConfirm} type="primary"> <Button onClick={handleConfirm} type="primary">
确定 确定
</Button> </Button>
</div> </div>
)} )}
</> </>
...@@ -226,7 +239,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -226,7 +239,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
}} }}
> >
基本信息 基本信息
</span> </span>
</> </>
} }
/> />
...@@ -261,7 +274,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -261,7 +274,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
<div className={cx(style.box, style.boxBlue)}> <div className={cx(style.box, style.boxBlue)}>
<div className={cx(style.title, style.tagBlue)}> <div className={cx(style.title, style.tagBlue)}>
报价商品 报价商品
<Text type='danger'>*</Text> <Text type='danger'>*</Text>
</div> </div>
<div className={style.content}> <div className={style.content}>
{Object.keys(product).length > 0 {Object.keys(product).length > 0
...@@ -282,7 +295,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -282,7 +295,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
</> </>
)} )}
{!preview && ( {!preview && (
<Button onClick={() => { setFlag(true); setProductId(product.id); console.log(product) }} block type="dashed" style={{ margin: '16px 0px' }}> <Button onClick={() => handleSelProduct(product)} block type="dashed" style={{ margin: '16px 0px' }}>
<PlusSquareOutlined /> <PlusSquareOutlined />
选择商品 选择商品
</Button> </Button>
...@@ -349,7 +362,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -349,7 +362,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
}} }}
> >
附件 附件
</span> </span>
</> </>
} }
/> />
......
...@@ -159,9 +159,12 @@ const SelectProduct: React.FC<Iprops> = (props: any) => { ...@@ -159,9 +159,12 @@ const SelectProduct: React.FC<Iprops> = (props: any) => {
} }
useEffect(() => { useEffect(() => {
console.log(id)
if (id) { if (id) {
console.log(2)
RowCtl.setSelectedRowKeys([id]); RowCtl.setSelectedRowKeys([id]);
} else { } else {
console.log(1)
RowCtl.setSelectedRowKeys([]); RowCtl.setSelectedRowKeys([]);
} }
}, [visible]) }, [visible])
......
...@@ -316,7 +316,6 @@ const PurchasInfo: React.FC<PurchasInfoPropsType> = (props) => { ...@@ -316,7 +316,6 @@ const PurchasInfo: React.FC<PurchasInfoPropsType> = (props) => {
const { value } = e.target; const { value } = e.target;
const result = [...slideshowBOList]; const result = [...slideshowBOList];
result[index].link = value; result[index].link = value;
console.log(result)
setSlideshowBOList(result) setSlideshowBOList(result)
form.setFieldsValue({ form.setFieldsValue({
slideshowBOList: result slideshowBOList: result
...@@ -385,9 +384,10 @@ const PurchasInfo: React.FC<PurchasInfoPropsType> = (props) => { ...@@ -385,9 +384,10 @@ const PurchasInfo: React.FC<PurchasInfoPropsType> = (props) => {
setFormIsHalfFilledOut(true) setFormIsHalfFilledOut(true)
} }
/** 获取店铺链接 */
const checkUrl = (url) => { const checkUrl = (url) => {
if (url && typeof url === 'string') { if (url && typeof url === 'string') {
if (url.indexOf('/') > -1) { if (url.indexOf('/') === 0) {
return url.replace('/', '').trim() return url.replace('/', '').trim()
} else { } else {
return `${url}`.trim() return `${url}`.trim()
...@@ -395,11 +395,10 @@ const PurchasInfo: React.FC<PurchasInfoPropsType> = (props) => { ...@@ -395,11 +395,10 @@ const PurchasInfo: React.FC<PurchasInfoPropsType> = (props) => {
} }
} }
/** 获取店铺链接 */
const handleMallSelectChange = (val, option) => { const handleMallSelectChange = (val, option) => {
setDoor(option.children); setDoor(option.children);
if (option.url) { if (option.url) {
setResUrl(`${siteUrl}/${checkUrl(option.url)}`) checkUrl(option.url) ? setResUrl(`${checkUrl(option.url)}.${siteUrl}`) : setResUrl(`${siteUrl}`)
} }
} }
......
...@@ -15,6 +15,7 @@ import style from './index.less'; ...@@ -15,6 +15,7 @@ import style from './index.less';
import DrawerWrite from '../modal/drawerWrite'; import DrawerWrite from '../modal/drawerWrite';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import UploadImport from '@/components/UploadImport'; import UploadImport from '@/components/UploadImport';
import EyePreview from '@/components/EyePreview';
const layout: any = { const layout: any = {
colon: false, colon: false,
...@@ -40,7 +41,9 @@ const Material: React.FC<Iprops> = (props: any) => { ...@@ -40,7 +41,9 @@ const Material: React.FC<Iprops> = (props: any) => {
/** 表单表头 */ /** 表单表头 */
const [flag, setFlag] = useState<boolean>(false); const [flag, setFlag] = useState<boolean>(false);
const [edit, setEdit] = useState<any>({}); const [edit, setEdit] = useState<any>({});
const [dataSource, setDataSource] = useState<any>([]) const [dataSource, setDataSource] = useState<any>([]);
const [eidtIndex, setEditIndex] = useState<number | null>();
const [isPreview, setIsPreview] = useState<boolean>(false);
/** 删除列表 */ /** 删除列表 */
const handleRemove = (index: number) => { const handleRemove = (index: number) => {
...@@ -50,9 +53,11 @@ const Material: React.FC<Iprops> = (props: any) => { ...@@ -50,9 +53,11 @@ const Material: React.FC<Iprops> = (props: any) => {
} }
/** 编辑列表 */ /** 编辑列表 */
const handleEdit = (data) => { const handleEdit = (data, index, preview?) => {
setEditIndex(index)
setEdit(data); setEdit(data);
setFlag(true) setFlag(true)
setIsPreview(preview)
} }
const columns: ColumnType<Object>[] = [ const columns: ColumnType<Object>[] = [
...@@ -65,6 +70,9 @@ const Material: React.FC<Iprops> = (props: any) => { ...@@ -65,6 +70,9 @@ const Material: React.FC<Iprops> = (props: any) => {
title: '物料名称', title: '物料名称',
key: 'name', key: 'name',
dataIndex: 'name', dataIndex: 'name',
render: (text: any, record: any, index: number) => (
<EyePreview type='button' handleClick={() => handleEdit(record, index, true) } >{text}</EyePreview>
)
}, },
{ {
title: '规格型号', title: '规格型号',
...@@ -97,7 +105,7 @@ const Material: React.FC<Iprops> = (props: any) => { ...@@ -97,7 +105,7 @@ const Material: React.FC<Iprops> = (props: any) => {
dataIndex: 'operate', dataIndex: 'operate',
render: (_text: any, record: any, index: number) => ( render: (_text: any, record: any, index: number) => (
<> <>
<Button type='link' onClick={() => handleEdit(record) }>编辑</Button> <Button type='link' onClick={() => handleEdit(record, index)}>编辑</Button>
<Button onClick={() => handleRemove(index)} type='link'>删除</Button> <Button onClick={() => handleRemove(index)} type='link'>删除</Button>
</> </>
) )
...@@ -113,12 +121,23 @@ const Material: React.FC<Iprops> = (props: any) => { ...@@ -113,12 +121,23 @@ const Material: React.FC<Iprops> = (props: any) => {
/** 打开添加方式 */ /** 打开添加方式 */
const handleAddmode = () => { const handleAddmode = () => {
setFlag(true) setFlag(true)
setEdit({})
setEditIndex(null)
}
/** 关闭 */
const handleClose = () => {
setFlag(false)
setIsPreview(false)
} }
/** 添加列表 */ /** 添加列表 */
const fetchTableList = (data: any) => { const fetchTableList = (data: any) => {
if (Object.keys(data).length > 0) { if (Object.keys(data).length > 0) {
console.log(data, 98) if (eidtIndex || eidtIndex === 0) {
setDataSource([...dataSource, data]); dataSource[eidtIndex] = data;
setDataSource([...dataSource]);
} else {
setDataSource([...dataSource, data]);
}
setFlag(false); setFlag(false);
} }
} }
...@@ -202,9 +221,10 @@ const Material: React.FC<Iprops> = (props: any) => { ...@@ -202,9 +221,10 @@ const Material: React.FC<Iprops> = (props: any) => {
{materielMode === 1 {materielMode === 1
&& ( && (
<DrawerWrite <DrawerWrite
preview={isPreview}
edit={edit} edit={edit}
flag={flag} flag={flag}
onClose={() => setFlag(false)} onClose={handleClose}
onConfirm={fetchTableList} onConfirm={fetchTableList}
/> />
)} )}
......
...@@ -16,10 +16,13 @@ import { ...@@ -16,10 +16,13 @@ import {
} from 'antd'; } from 'antd';
import style from './index.less'; import style from './index.less';
import { UPLOAD_TYPE } from '@/constants' import { UPLOAD_TYPE } from '@/constants'
import { ColumnType } from 'antd/lib/table/interface';
import { DeleteOutlined, LinkOutlined, UploadOutlined } from '@ant-design/icons'; import { DeleteOutlined, LinkOutlined, UploadOutlined } from '@ant-design/icons';
import SelectProduct from './selectProduct';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
import TableModal from '@/pages/transaction/components/TableModal';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
const layout: any = { const layout: any = {
colon: false, colon: false,
...@@ -34,6 +37,8 @@ interface Iprops { ...@@ -34,6 +37,8 @@ interface Iprops {
onConfirm?(e: any), onConfirm?(e: any),
/** 编辑的数据 */ /** 编辑的数据 */
edit?: any, edit?: any,
/** 查看 */
preview?: boolean
} }
const DrawerWrite: React.FC<Iprops> = (props: any) => { const DrawerWrite: React.FC<Iprops> = (props: any) => {
...@@ -41,7 +46,8 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => { ...@@ -41,7 +46,8 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
flag, flag,
onClose, onClose,
onConfirm, onConfirm,
edit edit,
preview
} = props; } = props;
const [form] = Form.useForm(); const [form] = Form.useForm();
const [visible, setVisile] = useState<boolean>(false) const [visible, setVisile] = useState<boolean>(false)
...@@ -51,16 +57,20 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => { ...@@ -51,16 +57,20 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
const [product, setProduct] = useState<any>({}); const [product, setProduct] = useState<any>({});
const [category, setcategory] = useState([]); const [category, setcategory] = useState([]);
/** 选择货品点击 */ /** 选择货品点击 */
const confirm = (item: any) => { const confirm = (selectRowKeys: string[] | number[], selectRowRecord: any) => {
const { selectRow } = item; const selectRow = selectRowRecord;
if (selectRow.length > 0) { if (selectRow.length > 0) {
const data = selectRow[0] const data: any = selectRow[0]
if (data.customerCategory.category) { if (data.customerCategory.category) {
const fullId = data.customerCategory.category.fullId; const fullId = data.customerCategory.category.fullId;
const ids = fullId.replace(/\b(0+)/gi, '').split('.'); const ids = fullId.replace(/\b(0+)/gi, '').split('.');
form.setFieldsValue({ form.setFieldsValue({
ids: ids.join(',').split(','), ids: ids.join(',').split(','),
}) })
} else {
form.setFieldsValue({
ids: data.ids
})
} }
form.setFieldsValue({ form.setFieldsValue({
...@@ -75,7 +85,6 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => { ...@@ -75,7 +85,6 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
} else { } else {
message.error('请选择货品!') message.error('请选择货品!')
} }
console.log(item)
} }
/**查询品类树 */ /**查询品类树 */
const searchCategoryTree = (id: any) => { const searchCategoryTree = (id: any) => {
...@@ -159,8 +168,9 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => { ...@@ -159,8 +168,9 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
useEffect(() => { useEffect(() => {
form.resetFields(); form.resetFields();
searchCategoryTree('0'); searchCategoryTree(null);
if (!isEmpty(edit)) { if (!isEmpty(edit)) {
console.log(edit)
form.setFieldsValue({ form.setFieldsValue({
number: edit.number, number: edit.number,
name: edit.name, name: edit.name,
...@@ -174,6 +184,54 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => { ...@@ -174,6 +184,54 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
} }
}, [flag]); }, [flag]);
const fetchGoodsData = (params: any) => {
return new Promise(resolve => {
PublicApi.getProductGoodsGetGoodsList(params).then(res => {
const { data } = res
resolve(data)
})
})
}
const toggle = (flag: boolean) => {
setVisile(flag)
}
const columns: ColumnType<any>[] = [
{
title: '货号',
key: 'code',
dataIndex: 'code'
},
{
title: '货品名称',
key: 'name',
dataIndex: 'name',
},
{
title: '规格型号',
key: 'type',
dataIndex: 'type'
},
{
title: '品类',
key: 'customerCategory',
dataIndex: 'customerCategory',
render: (text: any) => <span>{(text && Object.keys(text).length > 0) && text.name}</span>
},
{
title: '品牌',
key: 'brand',
dataIndex: 'brand',
render: (text: any) => <span>{(text && Object.keys(text).length > 0) && text.name}</span>
},
{
title: '单位',
key: 'unitName',
dataIndex: 'unitName'
},
]
return ( return (
<> <>
<Drawer <Drawer
...@@ -184,18 +242,19 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => { ...@@ -184,18 +242,19 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
onClose={handleClose} onClose={handleClose}
className={style.drawer} className={style.drawer}
footer={ footer={
<div !preview ?
style={{ <div
textAlign: 'right', style={{
}} textAlign: 'right',
> }}
<Button onClick={handleClose} style={{ marginRight: 8 }}> >
取消 <Button onClick={handleClose} style={{ marginRight: 8 }}>
</Button> 取消
<Button onClick={handleSubmit} type="primary"> </Button>
确定 <Button onClick={handleSubmit} type="primary">
</Button> 确定
</div> </Button>
</div> : null
} }
> >
<Row> <Row>
...@@ -244,7 +303,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => { ...@@ -244,7 +303,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
}} }}
> >
基本信息 基本信息
</span> </span>
</> </>
} }
/> />
...@@ -255,7 +314,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => { ...@@ -255,7 +314,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
> >
<Input.Search <Input.Search
readOnly readOnly
enterButton={<><LinkOutlined /> 选择</>} enterButton={<Button disabled={preview}><LinkOutlined /> 选择</Button>}
onSearch={() => setVisile(true)} onSearch={() => setVisile(true)}
/> />
</Form.Item> </Form.Item>
...@@ -291,7 +350,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => { ...@@ -291,7 +350,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
label='品牌' label='品牌'
name='brand' name='brand'
> >
<Input /> <Input disabled={preview} />
</Form.Item> </Form.Item>
{/* 采购数量 */} {/* 采购数量 */}
<Form.Item <Form.Item
...@@ -314,7 +373,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => { ...@@ -314,7 +373,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
}} }}
> >
采购数量 采购数量
</span> </span>
</> </>
} }
/> />
...@@ -330,7 +389,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => { ...@@ -330,7 +389,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
name='purchaseCount' name='purchaseCount'
rules={[{ required: true, message: '请输入采购数量' }]} rules={[{ required: true, message: '请输入采购数量' }]}
> >
<InputNumber min={1} style={{ width: '100%' }} /> <InputNumber disabled={preview} min={1} style={{ width: '100%' }} />
</Form.Item> </Form.Item>
{/* 附件 */} {/* 附件 */}
<Form.Item <Form.Item
...@@ -353,7 +412,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => { ...@@ -353,7 +412,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
}} }}
> >
附件 附件
</span> </span>
</> </>
} }
/> />
...@@ -368,9 +427,9 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => { ...@@ -368,9 +427,9 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
<LinkOutlined /> <LinkOutlined />
<span>{v.name}</span> <span>{v.name}</span>
</div> </div>
<div className={style.upload_right}> {!preview && <div className={style.upload_right}>
<DeleteOutlined /> <DeleteOutlined />
</div> </div>}
</div> </div>
))} ))}
</div> </div>
...@@ -382,7 +441,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => { ...@@ -382,7 +441,7 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
beforeUpload={beforeDocUpload} beforeUpload={beforeDocUpload}
onChange={handleChange} onChange={handleChange}
> >
<Button loading={loading} icon={<UploadOutlined />}>上传文件</Button> <Button disabled={preview} loading={loading} icon={<UploadOutlined />}>上传文件</Button>
<div style={{ marginTop: '8px' }}>一次上传一个文件,每个附件大小不能超过 20M</div> <div style={{ marginTop: '8px' }}>一次上传一个文件,每个附件大小不能超过 20M</div>
</Upload> </Upload>
</Form.Item> </Form.Item>
...@@ -390,11 +449,117 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => { ...@@ -390,11 +449,117 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
</Col> </Col>
</Row> </Row>
</Drawer> </Drawer>
<SelectProduct <TableModal
modalType="Drawer"
visible={visible} visible={visible}
onclose={() => setVisile(false)} title="选择货品"
confirm={confirm} mode="radio"
tableProps={{
rowKey: 'id',
}}
fetchData={fetchGoodsData}
onClose={() => toggle(false)}
onOk={confirm}
columns={columns}
effects={($, actions) => {
actions.reset()
useStateFilterSearchLinkageEffect($, actions, "name", FORM_FILTER_PATH)
}}
schema={{
type: 'object',
properties: {
megalayout: {
type: 'object',
"x-component": 'mega-layout',
properties: {
name: {
type: 'string',
"x-component": "Search",
"x-mega-props": {
},
"x-component-props": {
placeholder: '货品名称',
align: 'flex-left',
}
}
}
},
[FORM_FILTER_PATH]: {
type: 'object',
"x-component": "flex-layout",
"x-component-props": {
rowStyle: {
justifyContent: 'flex-start',
flexWrap: 'nowrap'
},
colStyle: {//改变间隔
marginRight: 20
}
},
properties: {
PRO_LAYOUT: {
type: 'object',
"x-component": 'mega-layout',
"x-mega-props": {
span: 5
},
"x-component-props": {
inline: true
},
properties: {
code: {
type: 'string',
"x-component-props": {
placeholder: '货号'
}
},
customerCategoryId: {
type: 'string',
"x-component": 'SearchSelect',
"x-component-props": {
placeholder: '请选择品类',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetSelectCustomerCategory,
style: {
width: 160
}
}
},
brandId: {
type: 'string',
"x-component": 'SearchSelect',
"x-component-props": {
placeholder: '请选择品牌',
fetchSearch: PublicApi.getProductSelectGetSelectBrand,
style: {
width: 160
}
}
},
type: {
type: 'string',
"x-component-props": {
placeholder: '规格型号'
}
},
}
},
sumbit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}}
/> />
</> </>
) )
} }
......
...@@ -95,7 +95,7 @@ const SelectProduct: React.FC<Iprops> = (props: any) => { ...@@ -95,7 +95,7 @@ const SelectProduct: React.FC<Iprops> = (props: any) => {
<StandardTable <StandardTable
currentRef={ref} currentRef={ref}
columns={columns} columns={columns}
tableProps={{ rowKew: 'id' }} tableProps={{ rowkey: 'id' }}
rowSelection={rowSelection} rowSelection={rowSelection}
fetchTableData={(params) => fetchGoodsData(params)} fetchTableData={(params) => fetchGoodsData(params)}
controlRender={ controlRender={
......
...@@ -20,7 +20,7 @@ const tokenList = [ ...@@ -20,7 +20,7 @@ const tokenList = [
{ name: 'TransactionV2', token: '3ad04435494d01c359b9f07948338e019133a3e6c0fccdbe1bc3adc19cf1e0b1', categoryIds: [0] }, // 交易服务V2 { name: 'TransactionV2', token: '3ad04435494d01c359b9f07948338e019133a3e6c0fccdbe1bc3adc19cf1e0b1', categoryIds: [0] }, // 交易服务V2
{ name: 'ContractV2', token: 'bbf1f327cfe7c59d1e7fd9c5d25119829dd79d238b1f1c79ed97331e220721a4', categoryIds: [0] }, // 合同能力V2 { name: 'ContractV2', token: 'bbf1f327cfe7c59d1e7fd9c5d25119829dd79d238b1f1c79ed97331e220721a4', categoryIds: [0] }, // 合同能力V2
{ name: 'OrderV2', token: '033f83bd5f519506f65f46d1513b1f8028a1dc1b5238d22edd0a2feb53cd3a19', categoryIds: [0], }, //订单服务V2 { name: 'OrderV2', token: '033f83bd5f519506f65f46d1513b1f8028a1dc1b5238d22edd0a2feb53cd3a19', categoryIds: [0], }, //订单服务V2
{ name: 'Platform', token: 'cadc3b13452c3ec67b5ef0c57063f12142e857a9eaa64669e80165adf42f5861', categoryIds: [0] }, // 平台后台v2 { name: 'Platform', token: 'db3b086157528c865a1a1a9fafffa574e9c3f098c0518a7c374a72988ba1edbb', categoryIds: [0] }, // 平台后台v2
{ name: 'ProductV2', token: 'b915026587fa1f6edf056f3335817fe2d4b350b0aa84da456786e15e83d45827', categoryIds: [0], }, // 商品服务V2 { name: 'ProductV2', token: 'b915026587fa1f6edf056f3335817fe2d4b350b0aa84da456786e15e83d45827', categoryIds: [0], }, // 商品服务V2
{ name: 'TemplateV2', token: 'f0187aed046ac19accbed5c780cade01cf11b50a37099dab9d456195a4abd0d3', categoryIds: [0], }, // 页面模板服务V2 { name: 'TemplateV2', token: 'f0187aed046ac19accbed5c780cade01cf11b50a37099dab9d456195a4abd0d3', categoryIds: [0], }, // 页面模板服务V2
{ name: 'MemberV2', token: '87f86a297246fbf1c0dff7d34f13729cb194935a95db077a5009ac4ea48cea6f', categoryIds: [0]}, //会员服务 V2 { name: 'MemberV2', token: '87f86a297246fbf1c0dff7d34f13729cb194935a95db077a5009ac4ea48cea6f', categoryIds: [0]}, //会员服务 V2
......
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