|
@@ -18,10 +18,11 @@ function ManufacturerList(props) {
|
|
projectId = 1,
|
|
projectId = 1,
|
|
data,
|
|
data,
|
|
} = props;
|
|
} = props;
|
|
- const { initialState: { user } } = useModel('@@initialState');
|
|
|
|
|
|
+ const { initialState: { user } } = useModel('@@initialState');
|
|
const [visible, setVisible] = useState(false);
|
|
const [visible, setVisible] = useState(false);
|
|
const [curItem, setCurItem] = useState(null);
|
|
const [curItem, setCurItem] = useState(null);
|
|
const [formDisabled, setFormDisabled] = useState(false);
|
|
const [formDisabled, setFormDisabled] = useState(false);
|
|
|
|
+ const [typeDisabled, setTypeDisabled] = useState(false);
|
|
const [total, setTotal] = useState(0);
|
|
const [total, setTotal] = useState(0);
|
|
const [formData, setFormData] = useState({ start_time: "", end_time: "", project_id: projectId * 1, is_super: user?.IsSuper || false, page: 1, page_size: pageSize });
|
|
const [formData, setFormData] = useState({ start_time: "", end_time: "", project_id: projectId * 1, is_super: user?.IsSuper || false, page: 1, page_size: pageSize });
|
|
const queryMfrListRequest = useRequest(queryMfrList, {
|
|
const queryMfrListRequest = useRequest(queryMfrList, {
|
|
@@ -63,49 +64,59 @@ function ManufacturerList(props) {
|
|
}, [queryMfrListRequest.loading, saveMfrRequest.loading, queryCreaterListRequest.loading, editMfrRequest.loading]);
|
|
}, [queryMfrListRequest.loading, saveMfrRequest.loading, queryCreaterListRequest.loading, editMfrRequest.loading]);
|
|
const columns = [
|
|
const columns = [
|
|
{
|
|
{
|
|
- title: '供应商名称',
|
|
|
|
|
|
+ title: '供应商(自然人)名称',
|
|
dataIndex: 'name',
|
|
dataIndex: 'name',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '税号',
|
|
|
|
- dataIndex: 'tax_code',
|
|
|
|
|
|
+ title: '主体类型',
|
|
|
|
+ render: record => {
|
|
|
|
+ if (record.type == 1) return '供应商'
|
|
|
|
+ if (record.type == 4) return '自然人'
|
|
|
|
+ },
|
|
|
|
+ width: '6%'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '地址',
|
|
|
|
- dataIndex: 'address'
|
|
|
|
- // render: (record) => {
|
|
|
|
- // return moment(record.lab_time).format('YYYY-MM-DD')
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
|
|
+ title: '证件类型',
|
|
|
|
+ render: record => {
|
|
|
|
+ if (record.id_type == 1) return '身份证'
|
|
|
|
+ if (record.id_type == 2) return '护照'
|
|
|
|
+ },
|
|
|
|
+ width: '6%'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '证件号',
|
|
|
|
+ dataIndex: 'id_card',
|
|
|
|
+ width: '12%'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '联系人',
|
|
title: '联系人',
|
|
- dataIndex: 'contact',
|
|
|
|
|
|
+ render: record => record.contact || '-',
|
|
|
|
+ width: '6%'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '联系方式',
|
|
title: '联系方式',
|
|
- dataIndex: 'phone_number'
|
|
|
|
|
|
+ render: record => record.phone_number || '-',
|
|
|
|
+ width: '10%'
|
|
// render: (record) => {
|
|
// render: (record) => {
|
|
// return moment(record.create_time).format('YYYY-MM-DD')
|
|
// return moment(record.create_time).format('YYYY-MM-DD')
|
|
// }
|
|
// }
|
|
},
|
|
},
|
|
- {
|
|
|
|
- title: '开户银行',
|
|
|
|
- dataIndex: 'bank_account',
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
title: '银行账号',
|
|
title: '银行账号',
|
|
- dataIndex: 'bank_account',
|
|
|
|
|
|
+ dataIndex: 'bank_number',
|
|
|
|
+ width: '12%'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '创建人',
|
|
title: '创建人',
|
|
dataIndex: 'created_by',
|
|
dataIndex: 'created_by',
|
|
|
|
+ width: '6%'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '创建时间',
|
|
title: '创建时间',
|
|
render: (record) => {
|
|
render: (record) => {
|
|
return dayjs(record.created_on).format('YYYY-MM-DD')
|
|
return dayjs(record.created_on).format('YYYY-MM-DD')
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ width: '8%'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '操作',
|
|
title: '操作',
|
|
@@ -115,6 +126,7 @@ function ManufacturerList(props) {
|
|
<a style={{ color: "#4096ff" }} onClick={() => {
|
|
<a style={{ color: "#4096ff" }} onClick={() => {
|
|
setCurItem(record);
|
|
setCurItem(record);
|
|
setFormDisabled(false);
|
|
setFormDisabled(false);
|
|
|
|
+ setTypeDisabled(true);
|
|
setVisible(true);
|
|
setVisible(true);
|
|
}}>编辑</a>
|
|
}}>编辑</a>
|
|
</>
|
|
</>
|
|
@@ -134,10 +146,12 @@ function ManufacturerList(props) {
|
|
</>
|
|
</>
|
|
</Fragment>
|
|
</Fragment>
|
|
),
|
|
),
|
|
|
|
+ width: '12%'
|
|
},
|
|
},
|
|
];
|
|
];
|
|
const onCancel = () => {
|
|
const onCancel = () => {
|
|
setVisible(false)
|
|
setVisible(false)
|
|
|
|
+ setFormDisabled(false);
|
|
}
|
|
}
|
|
const handleDeleteItem = record => {
|
|
const handleDeleteItem = record => {
|
|
console.log(record);
|
|
console.log(record);
|
|
@@ -155,7 +169,8 @@ function ManufacturerList(props) {
|
|
const data = {
|
|
const data = {
|
|
project_id: 1,
|
|
project_id: 1,
|
|
is_super: user?.IsSuper || false,
|
|
is_super: user?.IsSuper || false,
|
|
- created_by: formData.created_by || ''
|
|
|
|
|
|
+ created_by: formData.created_by || '',
|
|
|
|
+ type: formData.type || undefined
|
|
};
|
|
};
|
|
window.downloadFile(`/api/supplier/v1/supplier/export?${stringify(data)}`, '供应商列表.xlsx', false);
|
|
window.downloadFile(`/api/supplier/v1/supplier/export?${stringify(data)}`, '供应商列表.xlsx', false);
|
|
};
|
|
};
|
|
@@ -169,7 +184,8 @@ function ManufacturerList(props) {
|
|
page: 1,
|
|
page: 1,
|
|
is_super: user?.IsSuper || false,
|
|
is_super: user?.IsSuper || false,
|
|
created_by: formData.created_by || '',
|
|
created_by: formData.created_by || '',
|
|
- name: formData.name || ''
|
|
|
|
|
|
+ name: formData.name || '',
|
|
|
|
+ type: formData.type * 1 || undefined
|
|
}
|
|
}
|
|
queryList(value);
|
|
queryList(value);
|
|
}
|
|
}
|
|
@@ -200,6 +216,9 @@ function ManufacturerList(props) {
|
|
const onChange = name => {
|
|
const onChange = name => {
|
|
setFormData({ ...formData, created_by: name })
|
|
setFormData({ ...formData, created_by: name })
|
|
}
|
|
}
|
|
|
|
+ const onTypeChange = type => {
|
|
|
|
+ setFormData({ ...formData, type: type })
|
|
|
|
+ }
|
|
const onPaginationChange = pagination => {
|
|
const onPaginationChange = pagination => {
|
|
var tempFormData = { ...formData, page: pagination.current }
|
|
var tempFormData = { ...formData, page: pagination.current }
|
|
setFormData(tempFormData)
|
|
setFormData(tempFormData)
|
|
@@ -221,11 +240,16 @@ function ManufacturerList(props) {
|
|
</Form.Item>
|
|
</Form.Item>
|
|
</div>
|
|
</div>
|
|
{
|
|
{
|
|
- user?.IsSuper && <div style={{ margin: '0 24px' }}>
|
|
|
|
- <Form.Item label="创建人:">
|
|
|
|
|
|
+ user?.IsSuper && <div>
|
|
|
|
+ <Form.Item label="主体类型:">
|
|
<Select
|
|
<Select
|
|
- onChange={onChange}
|
|
|
|
- options={queryCreaterListRequest?.data?.list || []}
|
|
|
|
|
|
+ onChange={onTypeChange}
|
|
|
|
+ options={
|
|
|
|
+ [
|
|
|
|
+ { value: 1, label: '供应商' },
|
|
|
|
+ { value: 4, label: '自然人' },
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
style={{ width: 180 }}
|
|
style={{ width: 180 }}
|
|
allowClear
|
|
allowClear
|
|
/>
|
|
/>
|
|
@@ -233,10 +257,22 @@ function ManufacturerList(props) {
|
|
</div>
|
|
</div>
|
|
}
|
|
}
|
|
<div style={{ margin: '0 24px' }}>
|
|
<div style={{ margin: '0 24px' }}>
|
|
- <Form.Item style={{ margin: '0px 24 0 24px' }} label="供应商名称:">
|
|
|
|
|
|
+ <Form.Item label="名称:">
|
|
<Input placeholder="请输入供应商名称" onChange={e => { onInputChange(e) }} />
|
|
<Input placeholder="请输入供应商名称" onChange={e => { onInputChange(e) }} />
|
|
</Form.Item>
|
|
</Form.Item>
|
|
</div>
|
|
</div>
|
|
|
|
+ {
|
|
|
|
+ user?.IsSuper && <div>
|
|
|
|
+ <Form.Item label="创建人:">
|
|
|
|
+ <Select
|
|
|
|
+ onChange={onChange}
|
|
|
|
+ options={queryCreaterListRequest?.data?.list || []}
|
|
|
|
+ style={{ width: 180 }}
|
|
|
|
+ allowClear
|
|
|
|
+ />
|
|
|
|
+ </Form.Item>
|
|
|
|
+ </div>
|
|
|
|
+ }
|
|
<div style={{ display: 'flex' }}>
|
|
<div style={{ display: 'flex' }}>
|
|
<Form.Item>
|
|
<Form.Item>
|
|
<Button style={{ marginLeft: 24 }} type="primary" onClick={() => { handleSearch() }}>
|
|
<Button style={{ marginLeft: 24 }} type="primary" onClick={() => { handleSearch() }}>
|
|
@@ -245,7 +281,8 @@ function ManufacturerList(props) {
|
|
</Form.Item>
|
|
</Form.Item>
|
|
<Button style={{ marginLeft: 10 }} loading={loading} type="primary" onClick={() => {
|
|
<Button style={{ marginLeft: 10 }} loading={loading} type="primary" onClick={() => {
|
|
setCurItem(null);
|
|
setCurItem(null);
|
|
- setVisible(true)
|
|
|
|
|
|
+ setVisible(true);
|
|
|
|
+ setTypeDisabled(false);
|
|
}}>
|
|
}}>
|
|
新增
|
|
新增
|
|
</Button>
|
|
</Button>
|
|
@@ -270,6 +307,7 @@ function ManufacturerList(props) {
|
|
onOk={onOk}
|
|
onOk={onOk}
|
|
item={curItem}
|
|
item={curItem}
|
|
disabled={formDisabled}
|
|
disabled={formDisabled}
|
|
|
|
+ typeDisabled={typeDisabled}
|
|
></FirmModal>
|
|
></FirmModal>
|
|
</>
|
|
</>
|
|
)
|
|
)
|