|
@@ -36,11 +36,11 @@ const LockModal = props => {
|
|
|
layout: 'vertical'
|
|
layout: 'vertical'
|
|
|
}
|
|
}
|
|
|
const [state, setState] = useState({
|
|
const [state, setState] = useState({
|
|
|
- laoding: false,
|
|
|
|
|
|
|
+ loading: false,
|
|
|
longle: [],
|
|
longle: [],
|
|
|
client: [],
|
|
client: [],
|
|
|
searchVal: '',
|
|
searchVal: '',
|
|
|
- radioVal: '3',
|
|
|
|
|
|
|
+ radioVal: 3,
|
|
|
page: 1,
|
|
page: 1,
|
|
|
size: 10,
|
|
size: 10,
|
|
|
total: 0
|
|
total: 0
|
|
@@ -67,9 +67,21 @@ const LockModal = props => {
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
|
if (params?.page === 1) {
|
|
if (params?.page === 1) {
|
|
|
// 请求的是第一页
|
|
// 请求的是第一页
|
|
|
- setState({ ...state, client, total, laoding: false })
|
|
|
|
|
|
|
+ setState({
|
|
|
|
|
+ ...state,
|
|
|
|
|
+ client,
|
|
|
|
|
+ total,
|
|
|
|
|
+ laoding: false,
|
|
|
|
|
+ radioVal: params.status || lockTypeEnum.SALE
|
|
|
|
|
+ })
|
|
|
} else {
|
|
} else {
|
|
|
- setState({ ...state, client: state.client.concat(client), total, laoding: false })
|
|
|
|
|
|
|
+ setState({
|
|
|
|
|
+ ...state,
|
|
|
|
|
+ client: state.client.concat(client),
|
|
|
|
|
+ total,
|
|
|
|
|
+ laoding: true,
|
|
|
|
|
+ radioVal: params.status
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -105,9 +117,8 @@ const LockModal = props => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const checkGroupOnChange = e => {
|
|
const checkGroupOnChange = e => {
|
|
|
- const { radioVal = '' } = e.target
|
|
|
|
|
- setState({ ...state, radioVal: '' })
|
|
|
|
|
- initData({ status: radioVal, page: 1, size: 10 })
|
|
|
|
|
|
|
+ const { value = '' } = e.target
|
|
|
|
|
+ initData({ status: value, page: 1, size: 10 })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 关联联系人
|
|
// 关联联系人
|
|
@@ -170,12 +181,6 @@ const LockModal = props => {
|
|
|
visible={visible}
|
|
visible={visible}
|
|
|
confirmLoading={loading}
|
|
confirmLoading={loading}
|
|
|
onCancel={onCancel}
|
|
onCancel={onCancel}
|
|
|
- // onOk={() => {
|
|
|
|
|
- // form.validateFields().then(values => {
|
|
|
|
|
- // values.status = type
|
|
|
|
|
- // onConfirm(values)
|
|
|
|
|
- // })
|
|
|
|
|
- // }}
|
|
|
|
|
width={800}
|
|
width={800}
|
|
|
footer={
|
|
footer={
|
|
|
type !== lockTypeEnum.UPDATE &&
|
|
type !== lockTypeEnum.UPDATE &&
|
|
@@ -195,14 +200,14 @@ const LockModal = props => {
|
|
|
<>
|
|
<>
|
|
|
<div className="zh-text-center zh-mg-bottom-25">
|
|
<div className="zh-text-center zh-mg-bottom-25">
|
|
|
<Radio.Group value={state.radioVal} buttonStyle="solid" onChange={checkGroupOnChange}>
|
|
<Radio.Group value={state.radioVal} buttonStyle="solid" onChange={checkGroupOnChange}>
|
|
|
- <Radio.Button value="3">借出</Radio.Button>
|
|
|
|
|
- <Radio.Button value="4">销售</Radio.Button>
|
|
|
|
|
- <Radio.Button value="9">赠送</Radio.Button>
|
|
|
|
|
|
|
+ <Radio.Button value={3}>借出</Radio.Button>
|
|
|
|
|
+ <Radio.Button value={4}>销售</Radio.Button>
|
|
|
|
|
+ <Radio.Button value={9}>赠送</Radio.Button>
|
|
|
</Radio.Group>
|
|
</Radio.Group>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.modalContainer} ref={scrollRef} onScroll={handleListScroll}>
|
|
<div className={styles.modalContainer} ref={scrollRef} onScroll={handleListScroll}>
|
|
|
<div className={styles.modalContent}>
|
|
<div className={styles.modalContent}>
|
|
|
- <Spin spinning={state.laoding}>
|
|
|
|
|
|
|
+ <Spin spinning={state.loading}>
|
|
|
{state.client.map((item, index) => (
|
|
{state.client.map((item, index) => (
|
|
|
<div key={index} className={styles.card}>
|
|
<div key={index} className={styles.card}>
|
|
|
<div className="zh-flex-sub">{item.clientName}</div>
|
|
<div className="zh-flex-sub">{item.clientName}</div>
|