DrawerButtons.tsx 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. import React, { useState, useEffect } from 'react';
  2. import styled from 'styled-components';
  3. import { apiGet } from '../utils/request';
  4. import { getDefaultDate } from '../App'; // 导入getDefaultDate函数
  5. // 按钮容器
  6. const ButtonsContainer = styled.div`
  7. position: fixed;
  8. right: 1vw;
  9. bottom: 8vh;
  10. display: flex;
  11. flex-direction: column;
  12. z-index: 1000;
  13. `;
  14. // 单个按钮
  15. const Button = styled.div<{ isActive: boolean; buttonIndex: number }>`
  16. width: 1.5vw;
  17. height: 9.5vh;
  18. background-image: ${props =>
  19. props.isActive
  20. ? `url('/side_nav_${props.buttonIndex}_active.png')`
  21. : `url('/side_nav_${props.buttonIndex}.png')`};
  22. background-repeat: no-repeat;
  23. background-size: 100% 100%;
  24. display: flex;
  25. flex-direction: column;
  26. justify-content: center;
  27. align-items: center;
  28. color: ${props => props.isActive ? '#0A1433' : '#CCDDFF'};
  29. font-size: 0.6vw;
  30. cursor: pointer;
  31. position: relative;
  32. padding: 0;
  33. writing-mode: vertical-lr;
  34. text-orientation: upright;
  35. letter-spacing: 0.1vw;
  36. margin-bottom: -1vh; /* 使用vh单位实现自适应的负边距 */
  37. `;
  38. // 抽屉容器
  39. const Drawer = styled.div<{ isOpen: boolean }>`
  40. position: fixed;
  41. right: ${props => props.isOpen ? '3vw' : '-50vw'};
  42. top: 12vh;
  43. width: 46.5vw;
  44. height: 80vh;
  45. background: url('/choutibeijingtu_bg.png') no-repeat;
  46. background-size: 100% 100%;
  47. background-position: center;
  48. transition: right 0.3s;
  49. z-index: 999;
  50. display: flex;
  51. flex-direction: column;
  52. padding: 0;
  53. padding-top: 1.5%;
  54. overflow: hidden;
  55. background-color: #051833;
  56. &::after {
  57. content: '';
  58. position: absolute;
  59. bottom: 3vh;
  60. left: 15%;
  61. right: 10%;
  62. height: 2px;
  63. background: url('/bottom_decoration.png') no-repeat;
  64. background-size: contain;
  65. background-position: center;
  66. }
  67. `;
  68. // 模块标题
  69. const ModuleTitle = styled.div`
  70. position: relative;
  71. width: 65%;
  72. height: 1.6vw;
  73. padding-left: 4%;
  74. text-align: left;
  75. line-height: 1.6vw;
  76. font-size: 0.8vw;
  77. color:#E6F2FF;
  78. font-family: 'DingTalk JinBuTi', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
  79. background: url('/component_header_bg.png') no-repeat;
  80. background-size: 100% 100%;
  81. display: flex;
  82. justify-content: space-between;
  83. align-items: center;
  84. &::before {
  85. content: '';
  86. display: none;
  87. }
  88. &::after {
  89. content: '';
  90. display: none;
  91. }
  92. `;
  93. // 关闭按钮
  94. const CloseButton = styled.div`
  95. position: absolute;
  96. z-index: 99;
  97. right: 2.5vw;
  98. bottom: 0.5vw;
  99. width: 2vw;
  100. height: 2vw;
  101. display: flex;
  102. justify-content: center;
  103. align-items: center;
  104. color: transparent;
  105. cursor: pointer;
  106. font-size: 1.5vw;
  107. background: url('/drawer_close_btn.png') no-repeat;
  108. background-size: contain;
  109. background-position: center;
  110. `;
  111. // 抽屉内容
  112. const DrawerContent = styled.div`
  113. flex: 1;
  114. overflow-y: auto;
  115. color: #CCE6FF;
  116. padding: 1vh 1.5vw;
  117. &::-webkit-scrollbar {
  118. width: 0.5vw;
  119. }
  120. &::-webkit-scrollbar-track {
  121. background: rgba(10, 20, 51, 0.2);
  122. border-radius: 10px;
  123. }
  124. &::-webkit-scrollbar-thumb {
  125. background: rgba(78, 128, 229, 0.5);
  126. border-radius: 10px;
  127. }
  128. `;
  129. // 药品列表容器
  130. const MedicineList = styled.div`
  131. display: flex;
  132. flex-direction: column;
  133. gap: 1vh;
  134. width: 100%;
  135. padding-top: 1vw;
  136. padding-right: 1vw;
  137. `;
  138. // 药品项目
  139. const MedicineItem = styled.div`
  140. display: flex;
  141. align-items: center;
  142. width: 100%;
  143. height: 4.5vh;
  144. background: url('/paihangkapian.png') no-repeat;
  145. background-size: 100% 100%;
  146. background-position: center;
  147. /* border-radius: 0.5vw; */
  148. padding: 0;
  149. position: relative;
  150. /* overflow: hidden; */
  151. border: none;
  152. box-shadow: none;
  153. `;
  154. // 序号样式
  155. const SerialNumber = styled.div`
  156. width: 2.5vw;
  157. height: 100%;
  158. font-size: 1vw;
  159. font-weight: bold;
  160. color: #CCE6FF;
  161. text-align: center;
  162. z-index: 1;
  163. /* background: linear-gradient(90deg, rgba(78, 128, 229, 0.2) 0%, rgba(31, 50, 80, 0) 100%); */
  164. display: flex;
  165. justify-content: center;
  166. align-items: center;
  167. `;
  168. // 药品信息区域
  169. const MedicineInfo = styled.div`
  170. display: flex;
  171. flex-direction: column;
  172. margin-left: 0.5vw;
  173. flex: 1;
  174. justify-content: center;
  175. `;
  176. // 药品名称
  177. const MedicineName = styled.div`
  178. font-size: 0.7vw;
  179. color: #fff;
  180. display: flex;
  181. font-weight:bold;
  182. flex-direction: row;
  183. align-items: flex-start;
  184. gap: 0.5vw;
  185. margin-bottom: 0.1vw;
  186. white-space: nowrap;
  187. span {
  188. color: #CCE6FF;
  189. font-size: 0.8vw;
  190. }
  191. `;
  192. // 药品厂家
  193. const MedicineManufacturer = styled.div`
  194. font-size: 0.6vw;
  195. color: #A3B8CC;
  196. text-align: left;
  197. `;
  198. // 数据指标容器
  199. const DataSection = styled.div`
  200. display: flex;
  201. align-items: center;
  202. justify-content: flex-end;
  203. width: 60%;
  204. /* gap: 1.2vw; */
  205. `;
  206. // 单个指标
  207. const DataItem = styled.div`
  208. display: flex;
  209. flex-direction: column;
  210. align-items: flex-start;
  211. flex: 0.15s;
  212. min-width: 0;
  213. `;
  214. // 指标标题
  215. const DataTitle = styled.div`
  216. font-size: 0.55vw;
  217. color: #CCE6FF;
  218. text-align: left;
  219. margin-bottom: 0.1vw;
  220. `;
  221. // 指标数值
  222. const DataValue = styled.div<{ color?: string }>`
  223. font-size: 0.8vw;
  224. color: ${props => props.color || '#CCE6FF'};
  225. font-family: 'DingTalk JinBuTi', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
  226. text-align: left;
  227. `;
  228. // 按钮类型
  229. type ButtonType = '补药清单' | '效期清单' | '滞销清单' | null;
  230. interface DrawerButtonsProps {
  231. currentScreen: number;
  232. equipCode: string;
  233. dateTime: string;
  234. }
  235. const DrawerButtons: React.FC<DrawerButtonsProps> = ({ currentScreen, equipCode, dateTime }) => {
  236. // 所有Hooks必须在组件体最顶层调用,不能放在if语句后面
  237. const [activeDrawer, setActiveDrawer] = useState<ButtonType>(null);
  238. const [supplementData, setSupplementData] = useState<any[]>([]);
  239. const [loading, setLoading] = useState(false);
  240. const [error, setError] = useState<string | null>(null);
  241. const [expiryList, setExpiryList] = useState<any[]>([]);
  242. const [slowList, setSlowList] = useState<any[]>([]);
  243. // 打开指定抽屉
  244. const openDrawer = (type: ButtonType) => {
  245. setActiveDrawer(type);
  246. };
  247. // 关闭抽屉
  248. const closeDrawer = () => {
  249. setActiveDrawer(null);
  250. };
  251. // 补药清单接口请求
  252. useEffect(() => {
  253. if (activeDrawer === '补药清单') {
  254. setLoading(true);
  255. setError(null);
  256. // 使用getDefaultDate()函数获取日期,而不是直接使用传入的dateTime
  257. const defaultDate = getDefaultDate();
  258. apiGet('/equipMana/drugReplenishedList', {
  259. params: {
  260. dateTime: defaultDate,
  261. equipCode: equipCode === 'total' ? '0' : equipCode
  262. }
  263. })
  264. .then((res: any) => {
  265. if (res.data && res.data.data && Array.isArray(res.data.data)) {
  266. setSupplementData(res.data.data);
  267. } else {
  268. setSupplementData([]);
  269. setError('无数据');
  270. }
  271. })
  272. .catch(() => {
  273. setSupplementData([]);
  274. setError('接口请求失败');
  275. })
  276. .finally(() => setLoading(false));
  277. }
  278. if (activeDrawer === '效期清单') {
  279. setLoading(true);
  280. setError(null);
  281. // 使用getDefaultDate()函数获取日期,而不是直接使用传入的dateTime
  282. const defaultDate = getDefaultDate();
  283. apiGet('/equipMana/drugExpiryDateList', {
  284. params: {
  285. dateTime: defaultDate,
  286. equipCode: equipCode === 'total' ? '0' : equipCode
  287. }
  288. })
  289. .then((res: any) => {
  290. if (res.data && res.data.data && Array.isArray(res.data.data)) {
  291. setExpiryList(res.data.data);
  292. } else {
  293. setExpiryList([]);
  294. setError('无数据');
  295. }
  296. })
  297. .catch(() => {
  298. setExpiryList([]);
  299. setError('接口请求失败');
  300. })
  301. .finally(() => setLoading(false));
  302. }
  303. if (activeDrawer === '滞销清单') {
  304. setLoading(true);
  305. setError(null);
  306. // 使用getDefaultDate()函数获取日期,而不是直接使用传入的dateTime
  307. const defaultDate = getDefaultDate();
  308. apiGet('/equipMana/drugSlowMovingList', {
  309. params: {
  310. dateTime: defaultDate,
  311. equipCode: equipCode === 'total' ? '0' : equipCode
  312. }
  313. })
  314. .then((res: any) => {
  315. if (res.data && res.data.data && Array.isArray(res.data.data)) {
  316. setSlowList(res.data.data);
  317. } else {
  318. setSlowList([]);
  319. setError('无数据');
  320. }
  321. })
  322. .catch(() => {
  323. setSlowList([]);
  324. setError('接口请求失败');
  325. })
  326. .finally(() => setLoading(false));
  327. }
  328. }, [activeDrawer, equipCode]); // 移除dateTime依赖,因为现在使用getDefaultDate()
  329. // 效期清单数据结构调整
  330. const expiryData = [
  331. { id: 1, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', expiry: '2024/6/31', quantity: 210, overdueStock: 26 },
  332. { id: 2, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', expiry: '2024/6/31', quantity: 210, overdueStock: 26 },
  333. { id: 3, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', expiry: '2024/6/31', quantity: 210, overdueStock: 26 },
  334. { id: 4, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', expiry: '2024/6/31', quantity: 210, overdueStock: 26 },
  335. { id: 5, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', expiry: '2024/6/31', quantity: 210, overdueStock: 26 },
  336. { id: 6, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', expiry: '2024/6/31', quantity: 210, overdueStock: 26 },
  337. { id: 7, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', expiry: '2024/6/31', quantity: 210, overdueStock: 26 },
  338. ];
  339. // 滞销清单数据结构调整
  340. const slowMovingData = [
  341. { id: 1, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', batchNo: '250305w082', inPackCount: 2930, inPieceCount: 2930, inDate: '2024/6/1', expiry: '2024/6/31', slowDays: 26 },
  342. { id: 2, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', batchNo: '250305w082', inPackCount: 2930, inPieceCount: 2930, inDate: '2024/6/1', expiry: '2024/6/31', slowDays: 26 },
  343. { id: 3, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', batchNo: '250305w082', inPackCount: 2930, inPieceCount: 2930, inDate: '2024/6/1', expiry: '2024/6/31', slowDays: 26 },
  344. { id: 4, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', batchNo: '250305w082', inPackCount: 2930, inPieceCount: 2930, inDate: '2024/6/1', expiry: '2024/6/31', slowDays: 26 },
  345. { id: 5, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', batchNo: '250305w082', inPackCount: 2930, inPieceCount: 2930, inDate: '2024/6/1', expiry: '2024/6/31', slowDays: 26 },
  346. { id: 6, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', batchNo: '250305w082', inPackCount: 2930, inPieceCount: 2930, inDate: '2024/6/1', expiry: '2024/6/31', slowDays: 26 },
  347. { id: 7, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', batchNo: '250305w082', inPackCount: 2930, inPieceCount: 2930, inDate: '2024/6/1', expiry: '2024/6/31', slowDays: 26 },
  348. { id: 8, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', batchNo: '250305w082', inPackCount: 2930, inPieceCount: 2930, inDate: '2024/6/1', expiry: '2024/6/31', slowDays: 26 },
  349. { id: 9, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', batchNo: '250305w082', inPackCount: 2930, inPieceCount: 2930, inDate: '2024/6/1', expiry: '2024/6/31', slowDays: 26 },
  350. { id: 10, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', batchNo: '250305w082', inPackCount: 2930, inPieceCount: 2930, inDate: '2024/6/1', expiry: '2024/6/31', slowDays: 26 },
  351. { id: 11, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', batchNo: '250305w082', inPackCount: 2930, inPieceCount: 2930, inDate: '2024/6/1', expiry: '2024/6/31', slowDays: 26 },
  352. { id: 12, name: '阿魏酸哌嗪片', spec: '[50mgx180.00]', manufacturer: '四川成都亨达制药厂', batchNo: '250305w082', inPackCount: 2930, inPieceCount: 2930, inDate: '2024/6/1', expiry: '2024/6/31', slowDays: 26 },
  353. ];
  354. // 格式化编号为两位数
  355. const formatId = (id: number): string => {
  356. return id < 10 ? `0${id}` : `${id}`;
  357. };
  358. return (
  359. <>
  360. {currentScreen === 2 && (
  361. <>
  362. <ButtonsContainer>
  363. <Button
  364. isActive={activeDrawer === '补药清单'}
  365. onClick={() => openDrawer('补药清单')}
  366. buttonIndex={1}
  367. >
  368. 补药清单
  369. </Button>
  370. <Button
  371. isActive={activeDrawer === '效期清单'}
  372. onClick={() => openDrawer('效期清单')}
  373. buttonIndex={2}
  374. >
  375. 效期清单
  376. </Button>
  377. <Button
  378. isActive={activeDrawer === '滞销清单'}
  379. onClick={() => openDrawer('滞销清单')}
  380. buttonIndex={3}
  381. >
  382. 滞销清单
  383. </Button>
  384. </ButtonsContainer>
  385. <Drawer isOpen={activeDrawer === '补药清单'}>
  386. <CloseButton onClick={closeDrawer}>×</CloseButton>
  387. <ModuleTitle>补药清单</ModuleTitle>
  388. <DrawerContent>
  389. {loading ? (
  390. <div style={{color:'#7E9BCC',textAlign:'center',padding:'2vw'}}>数据加载中...</div>
  391. ) : error ? (
  392. <div style={{color:'#F7B500',textAlign:'center',padding:'2vw'}}>{error}</div>
  393. ) : (
  394. <MedicineList>
  395. {supplementData.map((item, idx) => (
  396. <MedicineItem key={`suppl-${idx}`}>
  397. <SerialNumber>{formatId(idx+1)}</SerialNumber>
  398. <MedicineInfo style={{marginLeft:0}} >
  399. <MedicineName>
  400. {item.medicationname}
  401. </MedicineName>
  402. <MedicineManufacturer>
  403. {item.brandname}
  404. </MedicineManufacturer>
  405. </MedicineInfo>
  406. <DataSection style={{width: '40%',gap: '0.3vw'}}>
  407. <DataItem style={{flex: 0.4}}>
  408. <DataTitle>包装量</DataTitle>
  409. <DataValue color="#B3D9FF">{item.specificationquantity}</DataValue>
  410. </DataItem>
  411. <DataItem style={{flex: 0.4}}>
  412. <DataTitle>补药包装数</DataTitle>
  413. <DataValue color="#B3D9FF">{item.needbox}</DataValue>
  414. </DataItem>
  415. <DataItem style={{flex: 0.4}}>
  416. <DataTitle>缺药率</DataTitle>
  417. <DataValue color="#B3D9FF">{item.needper}</DataValue>
  418. </DataItem>
  419. <DataItem style={{flex: 0.4}}>
  420. <DataTitle >合理库存</DataTitle>
  421. <DataValue color="#B3D9FF">{item.total}</DataValue>
  422. </DataItem>
  423. <DataItem style={{flex: 0.4}}>
  424. <DataTitle>库存</DataTitle>
  425. <DataValue color="#FFEA80">{item.quantity}</DataValue>
  426. </DataItem>
  427. </DataSection>
  428. </MedicineItem>
  429. ))}
  430. </MedicineList>
  431. )}
  432. </DrawerContent>
  433. </Drawer>
  434. <Drawer isOpen={activeDrawer === '效期清单'}>
  435. <CloseButton onClick={closeDrawer}>×</CloseButton>
  436. <ModuleTitle>效期清单</ModuleTitle>
  437. <DrawerContent>
  438. {loading ? (
  439. <div style={{color:'#7E9BCC',textAlign:'center',padding:'2vw'}}>数据加载中...</div>
  440. ) : error ? (
  441. <div style={{color:'#F7B500',textAlign:'center',padding:'2vw'}}>{error}</div>
  442. ) : (
  443. <MedicineList>
  444. {expiryList.map((item, idx) => (
  445. <MedicineItem key={`expiry-${idx}`}>
  446. <SerialNumber>{formatId(idx+1)}</SerialNumber>
  447. <MedicineInfo style={{marginLeft:0,width:'30%'}}>
  448. <MedicineName>
  449. {item.medicationName}
  450. </MedicineName>
  451. <MedicineManufacturer>
  452. {item.manufacturer}
  453. </MedicineManufacturer>
  454. </MedicineInfo>
  455. <DataSection style={{width: '60%'}}>
  456. <DataItem style={{flex: 0.25,marginRight:'0.8vw'}}>
  457. <DataTitle>效期</DataTitle>
  458. <DataValue color="#80EAFF">{item.expiryDate}</DataValue>
  459. </DataItem>
  460. <DataItem style={{flex: 0.15}}>
  461. <DataTitle>库存</DataTitle>
  462. <DataValue color="#80EAFF">{item.stock}</DataValue>
  463. </DataItem>
  464. <DataItem style={{flex: 0.15}}>
  465. <DataTitle>到期天数</DataTitle>
  466. <DataValue color="#FFEA80">{item.daysToExpire}</DataValue>
  467. </DataItem>
  468. </DataSection>
  469. </MedicineItem>
  470. ))}
  471. </MedicineList>
  472. )}
  473. </DrawerContent>
  474. </Drawer>
  475. <Drawer isOpen={activeDrawer === '滞销清单'}>
  476. <CloseButton onClick={closeDrawer}>×</CloseButton>
  477. <ModuleTitle>滞销清单</ModuleTitle>
  478. <DrawerContent>
  479. {loading ? (
  480. <div style={{color:'#7E9BCC',textAlign:'center',padding:'2vw'}}>数据加载中...</div>
  481. ) : error ? (
  482. <div style={{color:'#F7B500',textAlign:'center',padding:'2vw'}}>{error}</div>
  483. ) : (
  484. <MedicineList>
  485. {slowList.map((item, idx) => (
  486. <MedicineItem key={`slow-${idx}`}>
  487. <SerialNumber>{formatId(idx+1)}</SerialNumber>
  488. <MedicineInfo style={{width: '40%',overflow: 'hidden',marginLeft:0}}>
  489. <MedicineName style={{width: '100%', maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap'}}>
  490. {item.medicationname}
  491. </MedicineName>
  492. <MedicineManufacturer style={{width: '100%'}}>
  493. {item.brandname}
  494. </MedicineManufacturer>
  495. </MedicineInfo>
  496. <DataSection style={{width: '60%'}}>
  497. <DataItem style={{flex: 0.2}}>
  498. <DataTitle>批号</DataTitle>
  499. <DataValue style={{color: '#80FFEA'}}>{item.batchnumber?item.batchnumber:'-'}</DataValue>
  500. </DataItem>
  501. <DataItem style={{flex: 0.2}}>
  502. <DataTitle>入库包装数</DataTitle>
  503. <DataValue style={{color: '#80FFEA'}}>{item.inputPackageNum}</DataValue>
  504. </DataItem>
  505. <DataItem style={{flex: 0.2}}>
  506. <DataTitle>入库日期</DataTitle>
  507. <DataValue style={{color: '#80FFEA'}}>{item.inputdate ? item.inputdate.replace(/-/g, '/') : ''}</DataValue>
  508. </DataItem>
  509. <DataItem style={{flex: 0.2}}>
  510. <DataTitle>效期</DataTitle>
  511. <DataValue style={{color: '#80FFEA'}}>{item.expirydate}</DataValue>
  512. </DataItem>
  513. <DataItem style={{flex: 0.15}}>
  514. <DataTitle>滞销天数</DataTitle>
  515. <DataValue style={{color: '#FFEA80'}}>{item.unsoldDays}</DataValue>
  516. </DataItem>
  517. </DataSection>
  518. </MedicineItem>
  519. ))}
  520. </MedicineList>
  521. )}
  522. </DrawerContent>
  523. </Drawer>
  524. </>
  525. )}
  526. </>
  527. );
  528. };
  529. export default DrawerButtons;