outaozhen 5 年之前
父节点
当前提交
3c75987f30
共有 1 个文件被更改,包括 7 次插入6 次删除
  1. 7 6
      src/pages/Product/Lock/Lockstore/components/LocksDetail/LockModal.jsx

+ 7 - 6
src/pages/Product/Lock/Lockstore/components/LocksDetail/LockModal.jsx

@@ -40,7 +40,7 @@ const LockModal = props => {
     longle: [],
     client: [],
     searchVal: '',
-    radioVal: 3,
+    radioVal: '3',
     page: 1,
     size: 10,
     total: 0
@@ -105,16 +105,17 @@ const LockModal = props => {
   }
 
   const checkGroupOnChange = e => {
-    const { value = '' } = e.target
-    initData({ status: value, page: 1, size: 10 })
+    const { radioVal = '' } = e.target
+    setState({ ...state, radioVal: '' })
+    initData({ status: radioVal, page: 1, size: 10 })
   }
 
   // 关联联系人
-  const connectClient = async (id, value) => {
+  const connectClient = async (id, radioVal) => {
     const { code = -1 } = await apiSoftwareAddLonglelog({
       // id,
       clientId: id,
-      status: value,
+      status: radioVal,
       longleId
     })
     if (code === consts.RET_CODE.SUCCESS) {
@@ -193,7 +194,7 @@ const LockModal = props => {
       {type === lockTypeEnum.SALE ? (
         <>
           <div className="zh-text-center zh-mg-bottom-25">
-            <Radio.Group value={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>