Просмотр исходного кода

软件锁记录内容和相关高度

outaozhen 5 лет назад
Родитель
Сommit
a663a33386

+ 1 - 1
src/components/PopContent/Companys/CompanyLowerList.jsx

@@ -12,7 +12,7 @@ const CompanyLowerList = props => {
       <div className="zh-pd-left-15">
       <Tabs>
           <TabPane tab="日志" key="日志">
-            <div className="sheet-panel-record" style={{ height:y-250,overflowY:'auto' }}>
+            <div className="sheet-panel-record" style={{ height:y-310,overflowY:'auto' }}>
               <List
                 dataSource={log}
                 split={false}

+ 1 - 0
src/components/PopContent/Companys/index.jsx

@@ -1,4 +1,5 @@
 import React, { useState, useEffect } from 'react'
+import '../index.scss'
 import { Drawer, Row, Col } from 'antd'
 import useAutoTable from '@/hooks/useAutoTable'
 import consts from '@/consts'

+ 2 - 2
src/components/PopContent/Contacts/ContanctLowerList.jsx

@@ -20,7 +20,7 @@ const ContanctLowerList = props => {
       <div className="zh-pd-left-15">
         <Tabs>
           <TabPane tab="服务记录" key="服务记录">
-            <div className="sheet-panel-record" style={{ height:y-250,overflowY:'auto' }}>
+            <div className="sheet-panel-record" style={{ height:y-310,overflowY:'auto' }}>
               <Row>
                 <Col span="8">类型/时间</Col>
                 <Col span="16">服务内容</Col>
@@ -45,7 +45,7 @@ const ContanctLowerList = props => {
             </div>
           </TabPane>
           <TabPane tab="日志" key="日志">
-            <div className="sheet-panel-record" style={{ height:y-250,overflowY:'auto' }}>
+            <div className="sheet-panel-record" style={{ height:y-310,overflowY:'auto' }}>
               <List
                 dataSource={log}
                 split={false}

+ 14 - 14
src/components/PopContent/Locks/LockForm.jsx

@@ -17,20 +17,20 @@ const LockForm = props => {
         </Col>
       </Row>
       <Row>
-        <Col span={8}>锁号</Col>
-        <Col span={16}>{longle.keyNum}</Col>
-        <Col span={8}>产品</Col>
-        <Col span={16}>{longle.product}</Col>
-        <Col span={8}>期限</Col>
-        <Col span={16}>{longle.allotedTime}</Col>
-        <Col span={8}>使用状态</Col>
-        <Col span={16}>{longle.statusT}</Col>
-        <Col span={8}>负责人</Col>
-        <Col span={16}>{longle.responsible}</Col>
-        <Col span={8}>联系人</Col>
-        <Col span={16}>{longle.client}</Col>
-        <Col span={8}>公司</Col>
-        <Col span={16} />
+        <Col span={6}>锁号</Col>
+        <Col span={18}>{longle.keyNum}</Col>
+        <Col span={6}>产品</Col>
+        <Col span={18}>{longle.product}</Col>
+        <Col span={6}>期限</Col>
+        <Col span={18}>{longle.allotedTime}</Col>
+        <Col span={6}>使用状态</Col>
+        <Col span={18}>{longle.statusT}</Col>
+        <Col span={6}>负责人</Col>
+        <Col span={18}>{longle.responsible}</Col>
+        <Col span={6}>联系人</Col>
+        <Col span={18}>{longle.client}</Col>
+        <Col span={6}>公司</Col>
+        <Col span={18} />
       </Row>
       {/* <EditableForm dataSource={longle} columns={columns}/> */}
     </div>

+ 31 - 3
src/components/PopContent/Locks/LockLowerList.jsx

@@ -1,9 +1,37 @@
-import React from 'react'
+import { Tabs, List } from 'antd'
+import useAutoTable from '@/hooks/useAutoTable'
+import { dayjsFormat } from '@/utils/utils'
 
-const LockLowerList = () => {
+const LockLowerList = props => {
+  const { collapsed,log } = props
+  const { TabPane } = Tabs
+  const needSubtractHeight = 48 + 48 + 48 + 64 + 24 // 需要被裁掉的高度
+  const [x, y] = useAutoTable(collapsed, needSubtractHeight)
   return (
     <div>
-      dasda
+      <div className="zh-pd-left-15">
+      <Tabs>
+          <TabPane tab="日志" key="日志">
+            <div className="sheet-panel-record" style={{ height:y-310,overflowY:'auto' }}>
+              <List
+                dataSource={log}
+                split={false}
+                renderItem={item => (
+                  <List.Item>
+                    <a>@{item.operatorName}</a> {item.content}
+                    <List.Item.Meta
+                      // avatar=
+                      // title=
+                      // description={ dayjsFormat(item.createTime, 'YYYY-MM-DD')}
+                      description={ dayjsFormat(item.createTime)}
+                    />
+                  </List.Item>
+                )}
+              />
+            </div>
+          </TabPane>
+        </Tabs>
+      </div>
     </div>
   )
 }

+ 77 - 2
src/components/PopContent/Locks/LockTabList.jsx

@@ -1,9 +1,84 @@
 import React from 'react'
+import { Row, Col, List, Tabs, Button } from 'antd'
+import { dayjsFormat } from '@/utils/utils'
 
-const LockTabList = () => {
+const LockTabList = props => {
+  const { longleLog } = props
+  const { TabPane } = Tabs
   return (
     <div>
-      dasdasdasd
+      <div className="zh-pd-left-15">
+        <Tabs>
+          <TabPane tab="记录内容" key="记录内容">
+            <div className="sheet-right-panel">
+              <Row>
+                <Col span="8">类型/时间</Col>
+                <Col span="16">服务内容</Col>
+              </Row>
+              <List
+                dataSource={longleLog}
+                split={false}
+                renderItem={item => (
+                  <List.Item>
+                    <Row className="zh-width-100P">
+                      <Col span="8">
+                        {item.status} <a>{item.responsible}</a><br />
+                        <a>@{item.operator}</a> <span className="zh-gray">{ dayjsFormat(item.updatetime, 'MM-DD HH:mm')}</span>
+                        {/* <List.Item.Meta
+                          description={ dayjsFormat(item.updatetime, 'MM-DD HH:mm')}
+                        /> */}
+                      </Col>
+                      <Col span="16">{item.product}</Col>
+                    </Row>
+                  </List.Item>
+                )}
+              />
+            </div>
+          </TabPane>
+        </Tabs>
+      </div>
+      <div className="sheet-btns zh-pd-left-15 zh-pd-top-15">
+        <Button
+          type="primary"
+          ghost
+          size="small"
+          className="zh-mg-right-3"
+          // onClick={() => setAddService({ ...setAddService, visible: true })}
+        >
+          借出/销售/赠送
+        </Button>
+        <Button
+          type="primary"
+          ghost
+          size="small"
+          className="zh-mg-right-3"
+        >
+          升级
+        </Button>
+        <Button
+          type="primary"
+          ghost
+          size="small"
+          className="zh-mg-right-3"
+        >
+          更换
+        </Button>
+        <Button
+          type="primary"
+          ghost
+          size="small"
+          className="zh-mg-right-3"
+        >
+          收回
+        </Button>
+        <Button
+          type="primary"
+          ghost
+          size="small"
+        >
+          备注
+        </Button>
+      </div>
     </div>
   )
 }

+ 8 - 5
src/components/PopContent/Locks/index.jsx

@@ -1,4 +1,5 @@
 import React, { useState, useEffect } from 'react'
+import '../index.scss'
 import { Drawer, Row, Col } from 'antd'
 import useAutoTable from '@/hooks/useAutoTable'
 import consts from '@/consts'
@@ -14,15 +15,17 @@ const index = props => {
   const [x,y] = useAutoTable(collapsed, needSubtractHeight)
   const [clientWidth, setClientWidth] = useState(document.body.clientWidth * 0.75)
   const [state, setState] = useState({
-    longle: {}
+    longle: {},
+    log:[],
+    longleLog:[]
   })
   const initData = async () => {
     const {
-      data: { longle = {} },
+      data: { longle = {}, log = [], longleLog = [] },
       code = -1
     } = await apiSoftwareDetail(id)
     if (code === consts.RET_CODE.SUCCESS) {
-      setState({ ...state, longle })
+      setState({ ...state, longle, log, longleLog })
     }
   }
   useEffect(() => {
@@ -59,8 +62,8 @@ const index = props => {
               </div>
             </Col>
             <Col span={12}>
-              <LockTabList />
-              <LockLowerList />
+              <LockTabList longleLog={state.longleLog} />
+              <LockLowerList log={state.log} />
             </Col>
           </Row>
         </Drawer>

+ 1 - 1
src/components/PopContent/index.scss

@@ -6,7 +6,7 @@
   overflow-x: hidden;
 }
 .sheet-right-panel {
-  height: 230px;
+  height: 280px;
   overflow-x: hidden;
   overflow-y: auto;
 }

+ 2 - 2
src/pages/Product/Lock/Lockstore/index.jsx

@@ -20,10 +20,10 @@ const Lockstore = props => {
   const initData = async payload => {
     const {
       code = -1,
-      data: { longle = [], total = 0 } = { longle: [], total: 0 }
+      data: { longle = [], log = [], total = 0 } = { longle: [], log: [], total: 0 }
     } = await queryLock(payload)
     if (code === consts.RET_CODE.SUCCESS) {
-      setState({ ...state, data: longle, total })
+      setState({ ...state, data: longle, log, total })
     }
   }
   useEffect(() => {