Commit 8f5d3662 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

修改商品询价编辑是不可在编辑询价会员

parent 4d3ad00c
......@@ -34,7 +34,16 @@ export const productModalByMemberSchema: ISchema = {
"x-component-props": {
placeholder: '请选择品类',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetMemberCategory,
fetchSearch: () => {
let merber = sessionStorage.getItem('memberInfo');
let meberInfo = JSON.parse(merber)
return new Promise(resolve => {
PublicApi.getProductSelectGetMemberCategory({ name: '', ...meberInfo}).then(res => {
console.log(res.data, 10086)
resolve(res)
})
})
},
style: {
width: 160
}
......@@ -45,7 +54,16 @@ export const productModalByMemberSchema: ISchema = {
"x-component": 'SearchSelect',
"x-component-props": {
placeholder: '请选择品牌',
fetchSearch: PublicApi.getProductSelectGetMemberBrand,
fetchSearch: () => {
let merber = sessionStorage.getItem('memberInfo');
let meberInfo = JSON.parse(merber)
return new Promise(resolve => {
PublicApi.getProductSelectGetMemberBrand({ name: '', ...meberInfo}).then(res => {
console.log(res.data, 10086)
resolve(res)
})
})
},
style: {
width: 160
}
......
......@@ -7,7 +7,7 @@ import { ISchema } from '@formily/antd';
import ModalTable from '@/components/ModalTable'
import { PublicApi } from '@/services/api'
import { history } from 'umi'
import { quoteOrderInternalState, inquiryQuoteOuterState } from '../../../common/tableStatusList';
import { quoteOrderInternalState, inquiryQuoteOuterState } from '../../../common/tableStatusList';
import moment from 'moment';
const layout: any = {
......@@ -44,6 +44,11 @@ const BasicInfo: React.FC<queryProps> = (props) => {
memberRoleId: memberRowCtl.selectRow[0].roleId,
memberRoleName: memberRowCtl.selectRow[0].roleName
}
sessionStorage.setItem('memberInfo', JSON.stringify({
memberId: memberRowCtl.selectRow[0].memberId,
memberRoleId: memberRowCtl.selectRow[0].roleId,
}))
setmemberId(memberRowCtl.selectRow[0].memberId)
setroleId(memberRowCtl.selectRow[0].roleId)
setmemberName(memberRowCtl.selectRow[0].name);
......@@ -95,17 +100,17 @@ const BasicInfo: React.FC<queryProps> = (props) => {
const fetchMemberList = async (params) => {
console.log(params)
return new Promise((resolve, reject) => {
PublicApi.getMemberManagePlatformProviderPage({...params}).then(res => {
PublicApi.getMemberManagePlatformProviderPage({ ...params }).then(res => {
resolve(res.data)
})
});
}
// 选择会员弹框结束
useEffect(() => {
if(memberName) {
basicform.setFieldsValue({'memberId': memberId ? memberId : undefined})
if (memberName) {
basicform.setFieldsValue({ 'memberId': memberId ? memberId : undefined })
}
},[memberName])
}, [memberName])
/************* 页面的一些操作start *************/
// 拿到表单数据
......@@ -120,7 +125,7 @@ const BasicInfo: React.FC<queryProps> = (props) => {
}
})
}).catch(errorInfo => {
resolve({state: false})
resolve({ state: false })
})
})
}
......@@ -136,10 +141,10 @@ const BasicInfo: React.FC<queryProps> = (props) => {
currentRef.current = userAction;
}
}
},[])
}, [])
useEffect(() => {
if(Object.keys(editData).length > 0) {
if (Object.keys(editData).length > 0) {
basicform.setFieldsValue({
details: editData.details,
})
......@@ -161,8 +166,8 @@ const BasicInfo: React.FC<queryProps> = (props) => {
<Input />
</Form.Item>
<Form.Item label='被询价会员' name='memberId' rules={[{ required: true, message: '请选择被询价会员' }]}>
<Search disabled={type === 3} value={memberName ? memberName : undefined} readOnly enterButton={<><LinkOutlined /> 选择</>} onSearch={()=>setVisibleChannelMember(true)} />
{memberName && <Button type='link' onClick={() => window.open(`/shop?shopId=${btoa(JSON.stringify({memberId, roleId}))}`)}>查看会员详情</Button>}
<Search disabled={type === 3 || type === 2} value={memberName ? memberName : undefined} readOnly enterButton={<><LinkOutlined /> 选择</>} onSearch={() => setVisibleChannelMember(true)} />
{memberName && <Button type='link' onClick={() => window.open(`/shop?shopId=${btoa(JSON.stringify({ memberId, roleId }))}`)}>查看会员详情</Button>}
</Form.Item>
<Form.Item label='询价单号' name='orderNumber'>
<span>{(Object.keys(editData).length > 0 && editData.inquiryListNo) ? editData.inquiryListNo : '-'}</span>
......@@ -184,7 +189,7 @@ const BasicInfo: React.FC<queryProps> = (props) => {
cancel={handleCancelAddMember}
visible={visibleChannelMember}
forceRender={visibleChannelMember}
resetModal={{destroyOnClose: true, forceRender: true}}
resetModal={{ destroyOnClose: true, forceRender: true }}
columns={columnsSetMember}
rowSelection={memberRowSelection}
fetchTableData={params => fetchMemberList(params)}
......
......@@ -21,7 +21,7 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
const countMoney = (num: any, money: any) => {
let price: ReactNode = null;
price = (Number(money) * 1) / Number(num);
return Number(price).toFixed(4);
return Number(price).toFixed(2);
}
/**输入框输入 */
......
import React, { useState, useEffect } from 'react';
import styles from './index.less';
import { Form, Input, Row, Col, } from 'antd';
import { PublicApi } from '@/services/api';
interface queryProps {
currentRef?: any,
editData: any
}
const layout: any = {
colon: false,
labelCol: { style: { width: '174px' } },
wrapperCol: { span: 24 },
labelAlign: "left"
};
const TradingConditions: React.FC<queryProps> = (props) => {
const { currentRef, editData } = props;
const [TradingConditionsForm] = Form.useForm();
const hadnleValidateFields = () => {
return new Promise((resolve) => {
TradingConditionsForm.validateFields().then(values => {
resolve({
state: true,
data: {
minimumOrder: values.minimumOrder,
offer: values.offer,
paymentType: values.paymentType,
taxes: values.taxes,
logistics: values.logistics,
packRequire: values.logistics,
otherRequire: values.logistics,
}
})
}).catch(errorInfo => {
console.log(errorInfo)
})
})
}
useEffect(() => {
if (currentRef) {
const userAction = {
validateFields: () => hadnleValidateFields()
}
if (currentRef && typeof currentRef === 'function') {
currentRef(userAction);
}
if (currentRef && typeof currentRef !== 'function') {
currentRef.current = userAction;
}
}
}, [])
useEffect(() => {
// 编辑时回显的数据
if(Object.keys(editData).length > 0) {
console.log(editData, 10086)
TradingConditionsForm.setFieldsValue({
paymentType: editData.paymentType,
taxes: editData.taxes,
logistics: editData.logistics,
packRequire: editData.packRequire,
otherRequire: editData.otherRequire,
offer: editData.offer,
minimumOrder: editData.minimumOrder
})
}
}, [editData])
return (
<Form
{...layout}
form={TradingConditionsForm}
className={styles.revise_style}
>
<Row gutter={70}>
<Col span={12}>
<Form.Item label='最小起订' name='minimumOrder' rules={[{ required: true, message: '请输入最小起订' }]}>
<Input placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='交付说明' name='offer'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='付款说明' name='paymentType'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='税费说明' name='taxes'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='物流说明' name='logistics'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='包装说明' name='packRequire'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label='其他说明' name='otherRequire'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
</Col>
</Row>
</Form>
)
}
export default TradingConditions
\ No newline at end of file
import React, { useState, useEffect } from 'react';
import styles from './index.less';
import { Form, Input, Row, Col, } from 'antd';
import { PublicApi } from '@/services/api';
interface queryProps {
currentRef?: any,
editData: any
}
const layout: any = {
colon: false,
labelCol: { style: { width: '174px' } },
wrapperCol: { span: 24 },
labelAlign: "left"
};
const TradingConditions: React.FC<queryProps> = (props) => {
const { currentRef, editData } = props;
const [TradingConditionsForm] = Form.useForm();
const hadnleValidateFields = () => {
return new Promise((resolve) => {
TradingConditionsForm.validateFields().then(values => {
resolve({
state: true,
data: {
minimumOrder: values.minimumOrder,
deliveryInstructions: values.deliveryInstructions,
paymentType: values.paymentType,
taxes: values.taxes,
logistics: values.logistics,
packRequire: values.logistics,
otherRequire: values.logistics,
}
})
}).catch(errorInfo => {
console.log(errorInfo)
})
})
}
useEffect(() => {
if (currentRef) {
const userAction = {
validateFields: () => hadnleValidateFields()
}
if (currentRef && typeof currentRef === 'function') {
currentRef(userAction);
}
if (currentRef && typeof currentRef !== 'function') {
currentRef.current = userAction;
}
}
}, [])
useEffect(() => {
// 编辑时回显的数据
if(Object.keys(editData).length > 0) {
console.log(editData, 10086)
TradingConditionsForm.setFieldsValue({
paymentType: editData.paymentType,
taxes: editData.taxes,
logistics: editData.logistics,
packRequire: editData.packRequire,
otherRequire: editData.otherRequire,
deliveryInstructions: editData.deliveryInstructions,
minimumOrder: editData.minimumOrder
})
}
}, [editData])
return (
<Form
{...layout}
form={TradingConditionsForm}
className={styles.revise_style}
>
<Row gutter={70}>
<Col span={12}>
<Form.Item label='最小起订' name='minimumOrder' rules={[{ required: true, message: '请输入最小起订' }]}>
<Input placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='交付说明' name='deliveryInstructions'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='付款说明' name='paymentType'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='税费说明' name='taxes'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='物流说明' name='logistics'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='包装说明' name='packRequire'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label='其他说明' name='otherRequire'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
</Col>
</Row>
</Form>
)
}
export default TradingConditions
......@@ -180,7 +180,7 @@ const Details: React.FC<parmas> = (props) => {
title: '其他报价说明',
leftElem: [
{ title: '最小起订', key: '', value: data.minimumOrder },
{ title: '交付说明', key: '', value: data.fullAddress },
{ title: '交付说明', key: '', value: data.deliveryInstructions },
{ title: '付款说明', key: '', value: data.paymentType }
],
centerElem: [
......
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