Commit 5e51f768 authored by 陈万宝's avatar 陈万宝

Merge branch 'feature/20230327_public_takeaway' of...

Merge branch 'feature/20230327_public_takeaway' of http://git.quantgroup.cn/ui/merchant-manage-ui into feature/20230327_public_takeaway
parents 0aa6a9e0 d8b9d47d
...@@ -164,7 +164,7 @@ class goodsManage extends Component { ...@@ -164,7 +164,7 @@ class goodsManage extends Component {
className={styles.searchForm} className={styles.searchForm}
> >
<FormItem label="SKU编码" name="skuId"> <FormItem label="SKU编码" name="skuId">
<InputNumber placeholder="请输入SKU编码" style={selectW} /> <InputNumber placeholder="请输入SKU编码" max={99999999999999999} style={selectW} />
</FormItem> </FormItem>
<FormItem label="商品名称" name="skuName"> <FormItem label="商品名称" name="skuName">
<Input placeholder="请输入商品名称" allowClear style={selectW} /> <Input placeholder="请输入商品名称" allowClear style={selectW} />
...@@ -193,48 +193,48 @@ class goodsManage extends Component { ...@@ -193,48 +193,48 @@ class goodsManage extends Component {
/> />
</FormItem> </FormItem>
{this.state.productType !== 5 && ( {this.state.productType !== 5 && (
<FormItem label="审核状态" name="state"> <>
<Select <FormItem label="审核状态" name="state">
style={selectW} <Select
placeholder="请选择审核状态" style={selectW}
allowClear placeholder="请选择审核状态"
filterOption={filterOption} allowClear
> filterOption={filterOption}
{stateList?.map(item => ( >
<Option key={item.value} value={item.value}> {stateList?.map(item => (
{item.label} <Option key={item.value} value={item.value}>
</Option> {item.label}
))} </Option>
</Select> ))}
</FormItem> </Select>
)} </FormItem>
<FormItem label="供货价区间"> <FormItem label="供货价区间">
<FormItem name="supplyPriceMin" className={styles.iptNumRight} noStyle> <FormItem name="supplyPriceMin" className={styles.iptNumRight} noStyle>
<InputNumber placeholder="请输入" min={0} max={999999999} style={iptNumWidth} /> <InputNumber placeholder="请输入" min={0} max={999999999} style={iptNumWidth} />
</FormItem> </FormItem>
<span> <span>
<SwapRightOutlined /> <SwapRightOutlined />
</span> </span>
<FormItem name="supplyPriceMax" className={styles.iptNumRight} noStyle> <FormItem name="supplyPriceMax" className={styles.iptNumRight} noStyle>
<InputNumber <InputNumber
style={iptNumWidth} style={iptNumWidth}
min={0} min={0}
max={999999999} max={999999999}
placeholder="请输入" placeholder="请输入"
onChange={this.valueMin} onChange={this.valueMin}
/> />
</FormItem> </FormItem>
</FormItem> </FormItem>
{this.state.productType !== 5 && ( <FormItem name="thirdSkuNo" label="第三方SKU编码">
<FormItem name="thirdSkuNo" label="第三方SKU编码"> <Input placeholder="请输入第三方SKU编码" allowClear style={selectW} />
<Input placeholder="请输入第三方SKU编码" allowClear style={selectW} /> </FormItem>
</FormItem> </>
)} )}
<FormItem className={styles.queryBtn}> <FormItem className={styles.queryBtn}>
<Button onClick={() => this.handleSearch()} type="primary" className={styles.button}> <Button onClick={() => this.handleSearch()} type="primary" className={styles.button}>
查询 查询
</Button> </Button>
<Button onClick={() => this.onReset()} type="primary" className={styles.button}> <Button onClick={() => this.onReset()} className={styles.button}>
重置 重置
</Button> </Button>
{this.state.productType !== 5 && ( {this.state.productType !== 5 && (
...@@ -242,6 +242,8 @@ class goodsManage extends Component { ...@@ -242,6 +242,8 @@ class goodsManage extends Component {
<Button <Button
loading={this.state.loading} loading={this.state.loading}
onClick={() => this.onExportGoodsInfo()} onClick={() => this.onExportGoodsInfo()}
type="primary"
ghost
className={styles.button} className={styles.button}
> >
导出 导出
......
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Form, Modal, Input, Switch, Alert, message } from 'antd'; import { Form, Modal, Input, Switch, Alert, message } from 'antd';
import { apiCreateStorage, apiEditStorage, apiStorageInfo } from '../../service'; import { apiCreateStorage, apiEditStorage, apiStorageInfo } from '../../service';
import { stringOrObjectTrim } from '@/utils/utils';
const GroupInfo = options => { const GroupInfo = options => {
const [form] = Form.useForm(); const [form] = Form.useForm();
...@@ -15,14 +16,17 @@ const GroupInfo = options => { ...@@ -15,14 +16,17 @@ const GroupInfo = options => {
const handleConfirm = async () => { const handleConfirm = async () => {
const { name, necessary } = await form.validateFields(); const { name, necessary } = await form.validateFields();
const api = options.id ? apiEditStorage : apiCreateStorage; const api = options.id ? apiEditStorage : apiCreateStorage;
await api({ const res = await api({
name, name: stringOrObjectTrim(name),
necessary: necessary ? 1 : 0, necessary: necessary ? 1 : 0,
shopId: options.shopId, shopId: options.shopId,
id: options.id, id: options.id,
}); });
handleCancel(); if (res.code === '0000' && res.businessCode === '0000') {
options.search(); message.success('保存成功!');
handleCancel();
options.search();
}
}; };
const getInfo = async id => { const getInfo = async id => {
......
...@@ -90,7 +90,9 @@ export async function getInfo() { ...@@ -90,7 +90,9 @@ export async function getInfo() {
if (res.townId) { if (res.townId) {
res.addr.push(res.townId); res.addr.push(res.townId);
} }
settlementType = +res.settlementType; if (settlementType !== null) {
settlementType = +res.settlementType;
}
} }
// 身份证有效期处理 // 身份证有效期处理
const date = res.legalPersonPeriod.split('-') || []; const date = res.legalPersonPeriod.split('-') || [];
......
...@@ -239,15 +239,25 @@ class BusinessInfo extends Component { ...@@ -239,15 +239,25 @@ class BusinessInfo extends Component {
} }
}); });
} }
obj.businessLicenseImage = imgs.businessLicenseImage[0].url;
obj.idCardEmblemImage = imgs.idCardEmblemImage[0].url; obj.businessLicenseImage =
obj.idCardPortraitImage = imgs.idCardPortraitImage[0].url; (imgs?.businessLicenseImage?.length && imgs?.businessLicenseImage[0].url) || '';
obj.primaryImage = imgs.primaryImage[0].url; obj.idCardEmblemImage =
obj.sealImage = imgs.sealImage[0].url; (imgs?.idCardEmblemImage?.length && imgs?.idCardEmblemImage[0].url) || '';
obj.brandCertificate = imgs?.brandCertificate[0]?.url || ''; obj.idCardPortraitImage =
obj.differentNameAuthorizationImage = imgs?.differentNameAuthorizationImage[0]?.url || ''; (imgs?.idCardPortraitImage?.length && imgs?.idCardPortraitImage[0].url) || '';
obj.householdRegisterImage = imgs?.householdRegisterImage[0]?.url || ''; obj.primaryImage = (imgs?.primaryImage?.length && imgs?.primaryImage[0].url) || '';
obj.icbProofImage = imgs?.icbProofImage[0]?.url || ''; obj.sealImage = (imgs?.sealImage?.length && imgs?.sealImage[0].url) || '';
// 新增
obj.brandCertificate =
(imgs?.brandCertificate?.length && imgs?.brandCertificate[0]?.url) || '';
obj.differentNameAuthorizationImage =
(imgs?.differentNameAuthorizationImage?.length &&
imgs?.differentNameAuthorizationImage[0]?.url) ||
'';
obj.householdRegisterImage =
(imgs?.householdRegisterImage?.length && imgs?.householdRegisterImage[0]?.url) || '';
obj.icbProofImage = (imgs?.icbProofImage?.length && imgs?.icbProofImage[0]?.url) || '';
obj.applySource = 1; obj.applySource = 1;
obj.signDateType = 1; obj.signDateType = 1;
......
...@@ -3,6 +3,7 @@ import ProTable from '@ant-design/pro-table'; ...@@ -3,6 +3,7 @@ import ProTable from '@ant-design/pro-table';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { notification, Button, Modal, Image, message } from 'antd'; import { notification, Button, Modal, Image, message } from 'antd';
import { query } from './services'; import { query } from './services';
import style from './style.less';
const ContractView = () => { const ContractView = () => {
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
...@@ -74,23 +75,30 @@ const ContractView = () => { ...@@ -74,23 +75,30 @@ const ContractView = () => {
]; ];
return ( return (
<PageHeaderWrapper> <PageHeaderWrapper>
<ProTable {!visible && (
search={{ <ProTable
collapsed: false, search={{
collapseRender: () => null, collapsed: false,
}} collapseRender: () => null,
columns={columns} }}
request={params => query({ ...params })} columns={columns}
rowKey={r => r.appealNo} request={params => query({ ...params })}
expandIconColumnIndex={10} rowKey={r => r.appealNo}
bordered expandIconColumnIndex={10}
toolBarRender={false} bordered
scroll={{ x: '100%', y: 400 }} toolBarRender={false}
pagination={false} scroll={{ x: '100%', y: 400 }}
/> pagination={false}
<Modal visible={visible} width="1000px" onCancel={() => setVisible(false)}> />
<iframe src={url} height="500" width="95%" title="合同"></iframe> )}
</Modal> {visible && (
<div className={style.contract}>
<iframe src={url} height="500" width="95%" title="合同"></iframe>
<Button type="primary" onClick={() => setVisible(false)}>
取消
</Button>
</div>
)}
</PageHeaderWrapper> </PageHeaderWrapper>
); );
}; };
......
.contract {
text-align: center;
}
...@@ -127,6 +127,27 @@ export const getClientInfo = () => { ...@@ -127,6 +127,27 @@ export const getClientInfo = () => {
}; };
}; };
// 字符串或json去空格
export const stringOrObjectTrim = params => {
if (isClass(params) === 'String') {
return params.trim();
}
if (isClass(params) === 'Object') {
Object.keys(params).forEach(key => {
if (isClass(params[key]) === 'String') {
params[key] = params[key].trim();
} else if (isClass(params[key]) === 'Object') {
stringOrObjectTrim(params[key]);
} else if (isClass(params[key]) === 'Array') {
params[key].forEach((item, i) => {
params[key][i] = stringOrObjectTrim(item);
});
}
});
}
return params;
};
export const getObjectType = v => Object.prototype.toString.call(v).replace(/\[object |]/g, ''); export const getObjectType = v => Object.prototype.toString.call(v).replace(/\[object |]/g, '');
// 获取长表单错误提示 // 获取长表单错误提示
......
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