outaozhen 5 lat temu
rodzic
commit
332e1f17c2

+ 9 - 8
src/pages/Product/Lock/Lockstore/components/LocksDetail/LockModal.jsx

@@ -40,6 +40,7 @@ const LockModal = props => {
     longle: [],
     client: [],
     searchVal: '',
+    radioVal: 3,
     page: 1,
     size: 10,
     total: 0
@@ -103,12 +104,17 @@ const LockModal = props => {
     })
   }
 
+  const checkGroupOnChange = e => {
+    const { value = '' } = e.target
+    initData({ status: value, page: 1, size: 10 })
+  }
+
   // 关联联系人
-  const connectClient = async id => {
+  const connectClient = async (id, value) => {
     const { code = -1 } = await apiSoftwareAddLonglelog({
       // id,
       clientId: id,
-      status: type,
+      status: value,
       longleId
     })
     if (code === consts.RET_CODE.SUCCESS) {
@@ -147,11 +153,6 @@ const LockModal = props => {
     }
   }
 
-  const checkGroupOnChange = e => {
-    const { value = '' } = e.target
-    initData({ status: value, page: 1, size: 10 })
-  }
-
   return (
     <Modal
       title={
@@ -192,7 +193,7 @@ const LockModal = props => {
       {type === lockTypeEnum.SALE ? (
         <>
           <div className="zh-text-center zh-mg-bottom-25">
-            <Radio.Group defaultValue="3" buttonStyle="solid" onChange={checkGroupOnChange}>
+            <Radio.Group value={radioVal} buttonStyle="solid" onChange={checkGroupOnChange}>
               <Radio.Button value="3">借出</Radio.Button>
               <Radio.Button value="4">销售</Radio.Button>
               <Radio.Button value="9">赠送</Radio.Button>