فهرست منبع

feat: 软件锁状态相关修改

outaozhen 5 سال پیش
والد
کامیت
366863599f

+ 67 - 16
src/pages/Product/Lock/Lockstore/components/LocksDetail/Form.jsx

@@ -36,17 +36,28 @@ const LockForm = props => {
     })
     toggleDrawer()
   }
-  const longleStatusNum = {
+  // 出库状态
+  const longleStockStatusNum = {
     1: '生成',
-    2: '接收',
-    3: '借出',
-    4: '销售',
-    5: '升级',
-    6: '更换',
-    7: '收回',
-    8: '备注',
-    9: '赠送'
+    2: '接收'
   }
+  // 销售状态
+  const longleSellStatusNum = {
+    1: '接收',
+    2: '借出',
+    3: '赠送'
+  }
+  // 维护状态
+  const longlePreserveStatusNum = {
+    1: '升级',
+    2: '更换',
+    3: '收回'
+  }
+  // 使用新状态
+  // const longleNewStatusNum = {
+  //   0: '未使用',
+  //   1: '使用'
+  // }
   return (
     <div>
       <Row>
@@ -69,17 +80,52 @@ const LockForm = props => {
         <Divider style={{ margin: '12px 0' }} />
         <Col span={6}>期限</Col>
         <Col span={18}>{longle.allotedTime}</Col>
+      </Row>
+      <Row>
         <Divider style={{ margin: '12px 0' }} />
-        <Col span={6}>使用状态</Col>
-        <Col span={18}>{longleStatusNum[longle.status]}</Col>
+        <Col span={12}>
+          <Row>
+            <Col span={9}>出库状态</Col>
+            <Col span={13}>{longleStockStatusNum[longle.stockStatus]}</Col>
+          </Row>
+        </Col>
+        <Col span={12}>
+          <Row>
+            <Col span={9}>出库时间</Col>
+            <Col span={13}>{longle.stockTime}</Col>
+          </Row>
+        </Col>
         <Divider style={{ margin: '12px 0' }} />
-        <Col span={6}>负责人</Col>
-        <Col span={18}>{longle.responsible}</Col>
+        <Col span={12}>
+          <Row>
+            <Col span={9}>销售状态</Col>
+            <Col span={13}>{longleSellStatusNum[longle.sellStatus]}</Col>
+          </Row>
+        </Col>
+        <Col span={12}>
+          <Row>
+            <Col span={9}>销售时间</Col>
+            <Col span={13}>{longle.sellTime}</Col>
+          </Row>
+        </Col>
         <Divider style={{ margin: '12px 0' }} />
-        <Col span={6}>联系人</Col>
-        <Col span={18}>
-          <ChangeClient dataSource={changeCopInputData} />
+        <Col span={12}>
+          <Row>
+            <Col span={9}>维护状态</Col>
+            <Col span={13}>{longlePreserveStatusNum[longle.preserveStatus]}</Col>
+          </Row>
+        </Col>
+        <Col span={12}>
+          <Row>
+            <Col span={9}>维护时间</Col>
+            <Col span={13}>{longle.preserveTime}</Col>
+          </Row>
         </Col>
+        {/* <Col span={6}>使用状态</Col> */}
+        {/* <Col span={18}>{longleStatusNum[longle.status]}</Col> */}
+        <Divider style={{ margin: '12px 0' }} />
+        <Col span={6}>负责人</Col>
+        <Col span={18}>{longle.responsible}</Col>
         <Divider style={{ margin: '12px 0' }} />
         <Col span={6}>客户</Col>
         <Col span={18}>
@@ -88,6 +134,11 @@ const LockForm = props => {
           </span>
         </Col>
         <Divider style={{ margin: '12px 0' }} />
+        <Col span={6}>联系人</Col>
+        <Col span={18}>
+          <ChangeClient dataSource={changeCopInputData} />
+        </Col>
+        <Divider style={{ margin: '12px 0' }} />
         <Col span={6}>注册码</Col>
         <Col span={18}>
           <CopyAuthorizeStr authorizeStr={longle.authorizeStr} />

+ 25 - 14
src/pages/Product/Lock/Lockstore/components/LocksDetail/LockModal.jsx

@@ -35,7 +35,8 @@ const LockModal = props => {
   const [form] = Form.useForm()
   const dispatch = useDispatch()
   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 = {
     layout: 'vertical'
   }
@@ -44,7 +45,8 @@ const LockModal = props => {
     longle: [],
     client: [],
     search: '',
-    status: 3,
+    logStatus: 3,
+    sellStatus: 1,
     noMore: false,
     current: 1,
     pageSize: 10,
@@ -112,7 +114,7 @@ const LockModal = props => {
     if (type === lockTypeEnum.CHANGE || type === lockTypeEnum.SALE) {
       const params = { search: value, current: 1, pageSize: state.pageSize }
       if (type === lockTypeEnum.SALE) {
-        params.status = state.status
+        params.logStatus = state.logStatus
       }
       initData(params)
     }
@@ -126,32 +128,40 @@ const LockModal = props => {
         return
       }
       if (type === lockTypeEnum.SALE) {
-        initData({ current: 1, pageSize: 10, status: state.status })
+        initData({ current: 1, pageSize: 10, logStatus: state.logStatus })
         return
       }
       form.resetFields()
       if (type === lockTypeEnum.RECOVER) {
-        form.setFieldsValue({ longleId, status })
+        form.setFieldsValue({ longleId, logStatus })
       }
     }
   }, [visible, type])
 
   const handleonOk = () => {
     form.validateFields().then(values => {
-      onConfirm({ ...values, status: type })
+      onConfirm({ ...values, logStatus: type })
     })
   }
 
   const checkGroupOnChange = e => {
     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 { code = -1 } = await apiSoftwareAddLonglelog({
       clientId: id,
-      status: state.status,
+      logStatus: state.logStatus,
+      sellStatus: state.sellStatus,
+      preserveStatus: state.preserveStatus,
       longleId
     })
     if (code === consts.RET_CODE.SUCCESS) {
@@ -167,7 +177,8 @@ const LockModal = props => {
   const connectLongle = async id => {
     const { code = -1 } = await apiSoftwareAddLonglelog({
       newLongleId: id,
-      status: type,
+      logStatus: type,
+      preserveStatus: type,
       longleId
     })
     if (code === consts.RET_CODE.SUCCESS) {
@@ -191,7 +202,7 @@ const LockModal = props => {
         return
       }
       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)
     }
   }
@@ -237,10 +248,10 @@ const LockModal = props => {
       }>
       {type === lockTypeEnum.SALE ? (
         <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>
         </div>
       ) : null}

+ 3 - 1
src/pages/Product/Lock/Lockstore/components/LocksDetail/index.jsx

@@ -85,7 +85,9 @@ const Index = props => {
               longleId={state.longle.id}
               clientId={state.longle.clientId}
               keyNum={state.longle.keyNum}
-              status={state.longle.status}
+              logStatus={state.longle.logStatus}
+              // sellStatus={state.longle.sellStatus}
+              // preserveStatus={state.longle.preserveStatus}
             />
             <LockLowerList log={state.log} />
           </Col>

+ 92 - 0
src/pages/Product/Lock/Lockstore/index.jsx

@@ -64,6 +64,24 @@ const longleStatusNum = {
   }
 }
 
+// 出库状态
+const longleStockStatusNum = {
+  1: { text: '生成' },
+  2: { text: '接收' }
+}
+// 销售状态
+const longleSellStatusNum = {
+  1: { text: '接收' },
+  2: { text: '借出' },
+  3: { text: '赠送' }
+}
+// 维护状态
+const longlePreserveStatusNum = {
+  1: { text: '升级' },
+  2: { text: '更换' },
+  3: { text: '收回' }
+}
+
 // 刷新
 const refreshData = () => {
   tRef.current.reload()
@@ -211,6 +229,57 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
       }
     },
     {
+      title: '出库状态',
+      dataIndex: 'stockStatus',
+      valueType: 'date',
+      key: 'stockStatus',
+      width: 150,
+      render: (_, { stockStatus }) => {
+        return <>{longleStockStatusNum[stockStatus]?.text}</>
+      }
+    },
+    {
+      title: '出库时间',
+      dataIndex: 'stockTime',
+      valueType: 'date',
+      key: 'stockTime',
+      width: 150
+    },
+    {
+      title: '销售状态',
+      dataIndex: 'sellStatus',
+      valueType: 'date',
+      key: 'sellStatus',
+      width: 150,
+      render: (_, { sellStatus }) => {
+        return <>{longleSellStatusNum[sellStatus]?.text}</>
+      }
+    },
+    {
+      title: '销售时间',
+      dataIndex: 'sellTime',
+      valueType: 'date',
+      key: 'sellTime',
+      width: 150
+    },
+    {
+      title: '维护状态',
+      dataIndex: 'preserveStatus',
+      valueType: 'date',
+      key: 'preserveStatus',
+      width: 150,
+      render: (_, { preserveStatus }) => {
+        return <>{longlePreserveStatusNum[preserveStatus]?.text}</>
+      }
+    },
+    {
+      title: '维护时间',
+      dataIndex: 'preserveTime',
+      key: 'preserveTime',
+      valueType: 'date',
+      width: 150
+    },
+    {
       title: '责任人',
       dataIndex: 'responsible',
       width: 150,
@@ -261,6 +330,27 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
       width: 150
     }
   ]
+  const [columnsStateMap, setColumnsStateMap] = useState({
+    stockStatus: {
+      show: false
+    },
+    stockTime: {
+      show: false
+    },
+    sellStatus: {
+      show: false
+    },
+    sellTime: {
+      show: false
+    },
+    preserveStatus: {
+      show: false
+    },
+    preserveTime: {
+      show: false
+    }
+  })
+
   const { getScrollRef, redoHeight } = useTableScroll(columns, selectKeys)
 
   // 处理权限Select下拉组件OnChange事件
@@ -302,6 +392,8 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
         }
       }}
       scroll={getScrollRef}
+      columnsStateMap={columnsStateMap}
+      onColumnsStateChange={map => setColumnsStateMap(map)}
       headerTitle={
         <>
           <PermSelect onConfirm={handlePermChange} dataType={PermDataTypeEunm.PRODUCT} />

+ 11 - 12
src/pages/workbench/Dashboard/components/RatioPanels.jsx

@@ -58,10 +58,10 @@ const ServiceRatioPanels = ({ staffIds, cyclical, dataPermission }) => {
   })
   const showDrawer = id => {
     let children = null
-    if (state.activeKey === 0) {
-      children = <ContactDetail dataId={id} orderIds={state.orderIds} />
+    if (state.activeKey === '0') {
+      children = <ClientDetail dataId={id} orderIds={state.orderIds} />
     }
-    if (state.activeKey === 1) {
+    if (state.activeKey === '1') {
       children = <CompanyDetail dataId={id} orderIds={state.orderIds} />
     }
     setDrawerProps({
@@ -80,15 +80,14 @@ const ServiceRatioPanels = ({ staffIds, cyclical, dataPermission }) => {
     {
       dataIndex: activeKeyMap[state.activeKey].key,
       title: `${activeKeyMap[state.activeKey].title}名称`,
-      width: '20%'
-      // render: (text, record) => (
-      //   // console.log(record[activeKeyMap[state.activeKey].id])
-      //   <span
-      //     onClick={() => showDrawer(record.id)}
-      //     className="text-primary cursor-pointer hover:text-[#967bbd]">
-      //     {text}
-      //   </span>
-      // )
+      width: '20%',
+      render: (text, record) => (
+        <span
+          onClick={() => showDrawer(record[activeKeyMap[state.activeKey].id])}
+          className="text-primary cursor-pointer hover:text-[#967bbd]">
+          {text}
+        </span>
+      )
     },
     {
       dataIndex: 'status',