|
@@ -35,7 +35,8 @@ const LockModal = props => {
|
|
|
const [form] = Form.useForm()
|
|
const [form] = Form.useForm()
|
|
|
const dispatch = useDispatch()
|
|
const dispatch = useDispatch()
|
|
|
const scrollRef = useRef()
|
|
const scrollRef = useRef()
|
|
|
- const { visible, onCancel, onConfirm, loading, type, longleId, keyNum, status, prodList } = props
|
|
|
|
|
|
|
+ const { visible, onCancel, onConfirm, loading, type, longleId, keyNum, logStatus, prodList } =
|
|
|
|
|
+ props
|
|
|
const layout = {
|
|
const layout = {
|
|
|
layout: 'vertical'
|
|
layout: 'vertical'
|
|
|
}
|
|
}
|
|
@@ -44,7 +45,8 @@ const LockModal = props => {
|
|
|
longle: [],
|
|
longle: [],
|
|
|
client: [],
|
|
client: [],
|
|
|
search: '',
|
|
search: '',
|
|
|
- status: 3,
|
|
|
|
|
|
|
+ logStatus: 3,
|
|
|
|
|
+ sellStatus: 1,
|
|
|
noMore: false,
|
|
noMore: false,
|
|
|
current: 1,
|
|
current: 1,
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
@@ -112,7 +114,7 @@ const LockModal = props => {
|
|
|
if (type === lockTypeEnum.CHANGE || type === lockTypeEnum.SALE) {
|
|
if (type === lockTypeEnum.CHANGE || type === lockTypeEnum.SALE) {
|
|
|
const params = { search: value, current: 1, pageSize: state.pageSize }
|
|
const params = { search: value, current: 1, pageSize: state.pageSize }
|
|
|
if (type === lockTypeEnum.SALE) {
|
|
if (type === lockTypeEnum.SALE) {
|
|
|
- params.status = state.status
|
|
|
|
|
|
|
+ params.logStatus = state.logStatus
|
|
|
}
|
|
}
|
|
|
initData(params)
|
|
initData(params)
|
|
|
}
|
|
}
|
|
@@ -126,32 +128,40 @@ const LockModal = props => {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
if (type === lockTypeEnum.SALE) {
|
|
if (type === lockTypeEnum.SALE) {
|
|
|
- initData({ current: 1, pageSize: 10, status: state.status })
|
|
|
|
|
|
|
+ initData({ current: 1, pageSize: 10, logStatus: state.logStatus })
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
form.resetFields()
|
|
form.resetFields()
|
|
|
if (type === lockTypeEnum.RECOVER) {
|
|
if (type === lockTypeEnum.RECOVER) {
|
|
|
- form.setFieldsValue({ longleId, status })
|
|
|
|
|
|
|
+ form.setFieldsValue({ longleId, logStatus })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}, [visible, type])
|
|
}, [visible, type])
|
|
|
|
|
|
|
|
const handleonOk = () => {
|
|
const handleonOk = () => {
|
|
|
form.validateFields().then(values => {
|
|
form.validateFields().then(values => {
|
|
|
- onConfirm({ ...values, status: type })
|
|
|
|
|
|
|
+ onConfirm({ ...values, logStatus: type })
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const checkGroupOnChange = e => {
|
|
const checkGroupOnChange = e => {
|
|
|
const { value = '' } = e.target || {}
|
|
const { value = '' } = e.target || {}
|
|
|
- initData({ status: value, current: 1, pageSize: 10, search: state.search })
|
|
|
|
|
|
|
+ initData({
|
|
|
|
|
+ logStatus: value,
|
|
|
|
|
+ sellStatus: value,
|
|
|
|
|
+ current: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ search: state.search
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 关联联系人
|
|
// 关联联系人
|
|
|
const connectClient = async id => {
|
|
const connectClient = async id => {
|
|
|
const { code = -1 } = await apiSoftwareAddLonglelog({
|
|
const { code = -1 } = await apiSoftwareAddLonglelog({
|
|
|
clientId: id,
|
|
clientId: id,
|
|
|
- status: state.status,
|
|
|
|
|
|
|
+ logStatus: state.logStatus,
|
|
|
|
|
+ sellStatus: state.sellStatus,
|
|
|
|
|
+ preserveStatus: state.preserveStatus,
|
|
|
longleId
|
|
longleId
|
|
|
})
|
|
})
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
@@ -167,7 +177,8 @@ const LockModal = props => {
|
|
|
const connectLongle = async id => {
|
|
const connectLongle = async id => {
|
|
|
const { code = -1 } = await apiSoftwareAddLonglelog({
|
|
const { code = -1 } = await apiSoftwareAddLonglelog({
|
|
|
newLongleId: id,
|
|
newLongleId: id,
|
|
|
- status: type,
|
|
|
|
|
|
|
+ logStatus: type,
|
|
|
|
|
+ preserveStatus: type,
|
|
|
longleId
|
|
longleId
|
|
|
})
|
|
})
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
@@ -191,7 +202,7 @@ const LockModal = props => {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
const params = { current: state.current + 1, pageSize: state.pageSize }
|
|
const params = { current: state.current + 1, pageSize: state.pageSize }
|
|
|
- if (type === lockTypeEnum.SALE) params.status = state.status
|
|
|
|
|
|
|
+ if (type === lockTypeEnum.SALE) params.logStatus = state.logStatus
|
|
|
state.current * state.pageSize < state.total && initData(params)
|
|
state.current * state.pageSize < state.total && initData(params)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -237,10 +248,10 @@ const LockModal = props => {
|
|
|
}>
|
|
}>
|
|
|
{type === lockTypeEnum.SALE ? (
|
|
{type === lockTypeEnum.SALE ? (
|
|
|
<div className="text-center mb-6">
|
|
<div className="text-center mb-6">
|
|
|
- <Radio.Group value={state.status} buttonStyle="solid" onChange={checkGroupOnChange}>
|
|
|
|
|
- <Radio.Button value={3}>借出</Radio.Button>
|
|
|
|
|
- <Radio.Button value={4}>销售</Radio.Button>
|
|
|
|
|
- <Radio.Button value={9}>赠送</Radio.Button>
|
|
|
|
|
|
|
+ <Radio.Group value={state.sellStatus} buttonStyle="solid" onChange={checkGroupOnChange}>
|
|
|
|
|
+ <Radio.Button value={1}>借出</Radio.Button>
|
|
|
|
|
+ <Radio.Button value={2}>销售</Radio.Button>
|
|
|
|
|
+ <Radio.Button value={3}>赠送</Radio.Button>
|
|
|
</Radio.Group>
|
|
</Radio.Group>
|
|
|
</div>
|
|
</div>
|
|
|
) : null}
|
|
) : null}
|