Commit 1e9fcb4c authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

Merge branch 'dev' into dev-srm

parents fd8a41c6 1df445f9
......@@ -303,7 +303,7 @@ const DirectChannel: React.FC<{}> = () => {
PublicApi.getTemplateWebMemberChannelWebFindCurrMemberChannel().then(res => {
if(res.data.id){
setCheckedValues(values)
setShopId(res.data.shopId)
setShopId(res.data.id)
}else{
message.error('您还没有开通店铺,无法上下架商品!')
}
......
......@@ -57,6 +57,7 @@ const AddLogistics: React.FC<{}> = () => {
const [memberInfo, setmemberInfo] = useState<any>({});
const [form] = Form.useForm();
const [goodsForm] = Form.useForm();
const [loading, setLoading] = useState<boolean>(false)
/**输入框输入 */
const inputOnchange = (id, e, name) => {
const { value } = e.target
......@@ -603,6 +604,7 @@ const AddLogistics: React.FC<{}> = () => {
/** 提交数据 */
const handleSubmit = async () => {
setLoading(true);
const data = [...badge]
const params = { ...query };
const basicRef = await form.validateFields().then(res => { console.log(res); params.digest = res.digest; return true }).catch(error => { return error });
......@@ -611,6 +613,7 @@ const AddLogistics: React.FC<{}> = () => {
if (basicRef.errorFields) {
data[0] = basicRef.errorFields.length;
setbadge(data);
setLoading(false);
} else {
data[0] = 0;
setbadge(data)
......@@ -626,20 +629,25 @@ const AddLogistics: React.FC<{}> = () => {
params.detailList = detailList
if (path === 'edit') {
PublicApi.postLogisticsOrderWaitSubmitUpdate({ ...params }).then(res => {
if (res.code === 1000) {
history.goBack()
if (res.code !== 1000) {
setLoading(false);
return
}
history.goBack()
})
} else {
PublicApi.postLogisticsOrderWaitSubmitAdd({ ...params }).then(res => {
if (res.code === 1000) {
history.goBack()
if (res.code !== 1000) {
setLoading(false);
return
}
history.goBack()
})
}
}
} else {
message.error('请先添加商品')
setLoading(false);
}
}
......@@ -707,7 +715,7 @@ const AddLogistics: React.FC<{}> = () => {
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReturnEle description='返回' />}
extra={<Button type="primary" onClick={handleSubmit}> 保存</Button>}
extra={<Button type="primary" onClick={handleSubmit} loading={loading}> 保存</Button>}
>
<Card>
<Tabs type="card">
......@@ -756,7 +764,7 @@ const AddLogistics: React.FC<{}> = () => {
</Select>
</Form.Item>
<Form.Item label="单据时间" name='voucherTime'><span>{query.voucherTime && moment(query.voucherTime).format('YYYY-MM-DD HH:mm:ss')} </span></Form.Item>
{(createType === 2 || createType === 3 ) ?
{(createType === 2 || createType === 3) ?
<Form.Item label="外部状态" name='externalState'>
{
query.externalState === 1 ? <Badge status="warning" text='待提交' /> :
......
......@@ -66,7 +66,7 @@ const company: React.FC<parmas> = (props) => {
//hook只能写在函数组件的顶级作用域
const ref = useRef<any>({})
const { pageStatus, id, isSee } = props
const [productRowSelection, productRowCtl] = useRowSelectionTable({ type: 'radio', customKey: 'memberId' })
const [productRowSelection, productRowCtl] = useRowSelectionTable({ type: 'radio', customKey: 'id' })
const [menuForm] = Form.useForm();
const [headerTitle, setHeaderTitle] = useState('新建物流公司')
const [loading, setLoading] = useState<boolean>(false)
......@@ -320,7 +320,7 @@ const company: React.FC<parmas> = (props) => {
fetchTableData={params => fetchData(params)}
modalType="SelectLogisticsService"
tableProps={{
rowKey: 'memberId'
rowKey: 'id'
}}
>
</ModalTable>
......
......@@ -91,13 +91,16 @@ const AddQuotes: React.FC<parmas> = (props) => {
}
}, [])
//提交
const onSumbit = async (params: any) => {
const onSumbit = async () => {
setloading(true);
const basicInfo = await basicInfoRef.current.validateFields();
const tradingConditions = await tradingConditionsRef.current.validateFields();
const basicInfoData = basicInfo.data;
const tradingConditionsData = tradingConditions.data;
console.log(basicInfo, tradingConditions, 100086)
if (!basicInfo.state || !tradingConditions.state) {
setloading(false);
return
}
if (basicInfo.state && tradingConditions.state) {
if (goodsList.length === 0) {
message.error('请添加一个询价商品!');
......@@ -139,7 +142,6 @@ const AddQuotes: React.FC<parmas> = (props) => {
// 获取到会员信息
const getMemberList = (list: any) => {
setmember(list);
console.log(list, '会员信息')
}
// 获取添加的商品列表
const getGoodsList = (list: any) => {
......
......@@ -35,7 +35,7 @@ const BasicInfo: React.FC<queryProps> = (props) => {
const [memberName, setmemberName] = useState<any>();
const [memberId, setmemberId] = useState<any>();
const [roleId, setroleId] = useState<any>();
const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'memberId', type: 'radio' });
const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'id', type: 'radio' });
const handleOkAddMember = () => {
if (memberRowCtl.selectRow.length > 0) {
setVisibleChannelMember(false)
......@@ -62,8 +62,8 @@ const BasicInfo: React.FC<queryProps> = (props) => {
const columnsSetMember: any[] = [
{
title: 'ID',
dataIndex: 'memberId',
key: 'memberId',
dataIndex: 'id',
key: 'id',
},
{
title: '会员名称',
......@@ -169,7 +169,7 @@ const BasicInfo: React.FC<queryProps> = (props) => {
</Form.Item>
<Form.Item label='被询价会员' name='memberId' rules={[{ required: true, message: '请选择被询价会员' }]}>
<Search disabled={type === 3 || type === 2} value={memberName ? memberName : undefined} readOnly enterButton={<><LinkOutlined /> 选择</>} onSearch={() => setVisibleChannelMember(true)} />
{memberName && <Button type='link' onClick={() => window.open(`/shop?roleId=${roleId}shopId=${btoa(JSON.stringify({ memberId, roleId }))}`)}>查看会员详情</Button>}
{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>
......@@ -201,7 +201,7 @@ const BasicInfo: React.FC<queryProps> = (props) => {
}
}
tableProps={{
rowKey: 'memberId',
rowKey: 'id',
}}
/>
</>
......
......@@ -37,7 +37,7 @@ const TradingConditions: React.FC<queryProps> = (props) => {
}
})
}).catch(errorInfo => {
resolve({state: false})
resolve({ state: false })
})
})
}
......@@ -61,7 +61,7 @@ const TradingConditions: React.FC<queryProps> = (props) => {
useEffect(() => {
// 编辑时回显的数据
if(Object.keys(editData).length > 0) {
if (Object.keys(editData).length > 0) {
TradingConditionsForm.setFieldsValue({
paymentType: editData.paymentType,
taxes: editData.taxes,
......@@ -69,14 +69,14 @@ const TradingConditions: React.FC<queryProps> = (props) => {
packRequire: editData.packRequire,
otherRequire: editData.otherRequire,
offer: editData.offer,
quotationAsTime: moment(editData.quotationAsTime),
deliveryTime: moment(editData.deliveryTime),
quotationAsTime: editData.quotationAsTime ? moment(editData.quotationAsTime) : undefined,
deliveryTime: editData.deliveryTime ? moment(editData.deliveryTime) : undefined,
fullAddressId: editData.fullAddressId,
})
}
}, [editData])
const addressOnChange = (value:any, option:any) => {
const addressOnChange = (value: any, option: any) => {
getAddress(option)
}
......
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