index.uvue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817
  1. <template>
  2. <uni-navbar-lite @rightClick="handleRight" :show-right="showRight" title="物料申请"></uni-navbar-lite>
  3. <view class="list-page" :class="{ 'has-bottom-bar': showPurchaseBar }">
  4. <!-- 搜索栏和状态标签 -->
  5. <view class="search-block">
  6. <view class="search-bar">
  7. <view class="search-box">
  8. <image class="search-icon" src="/static/images/workbench/list/1.png" mode="aspectFit"></image>
  9. <input class="search-input" type="text" placeholder="请输入申请单号查询" v-model="keyword" @input="handleSearch" />
  10. <view v-if="keyword.length > 0" class="clear-btn" @tap="clearKeyword">
  11. <text class="clear-btn-text">×</text>
  12. </view>
  13. <view class="search-btn" @tap="handleSearch">
  14. <text class="search-btn-text">搜索</text>
  15. </view>
  16. </view>
  17. </view>
  18. <!-- 状态标签 -->
  19. <scroll-view class="status-tabs" scroll-x="true">
  20. <view
  21. class="status-tab"
  22. :class="{ 'active': currentStatus === '' }"
  23. @tap="handleStatusChange('')"
  24. >
  25. <text class="status-tab-text" :class="{ 'active-text': currentStatus === '' }">全部</text>
  26. </view>
  27. <view
  28. class="status-tab"
  29. :class="{ 'active': currentStatus === 'PREPARE' }"
  30. @tap="handleStatusChange('PREPARE')"
  31. >
  32. <text class="status-tab-text" :class="{ 'active-text': currentStatus === 'PREPARE' }">待确认</text>
  33. </view>
  34. <view
  35. class="status-tab"
  36. :class="{ 'active': currentStatus === 'CONFIRMED' }"
  37. @tap="handleStatusChange('CONFIRMED')"
  38. >
  39. <text class="status-tab-text" :class="{ 'active-text': currentStatus === 'CONFIRMED' }">已确认</text>
  40. </view>
  41. <view
  42. class="status-tab"
  43. :class="{ 'active': currentStatus === 'WAITOUT' }"
  44. @tap="handleStatusChange('WAITOUT')"
  45. >
  46. <text class="status-tab-text" :class="{ 'active-text': currentStatus === 'WAITOUT' }">待出库</text>
  47. </view>
  48. <view
  49. class="status-tab"
  50. :class="{ 'active': currentStatus === 'FINISHED' }"
  51. @tap="handleStatusChange('FINISHED')"
  52. >
  53. <text class="status-tab-text" :class="{ 'active-text': currentStatus === 'FINISHED' }">已完成</text>
  54. </view>
  55. </scroll-view>
  56. </view>
  57. <!-- 列表内容 -->
  58. <common-list
  59. :dataList="dataList"
  60. :loading="loading"
  61. :refreshing="refreshing"
  62. :hasMore="hasMore"
  63. @refresh="handleRefresh"
  64. @loadMore="loadMore"
  65. >
  66. <template #default="{ item, index }">
  67. <view class="list-item" @tap="handleItemClick(item, index)">
  68. <view class="item-container">
  69. <view class="item-header">
  70. <view v-if="showPurchaseBar && canPurchase(item)" class="checkbox-wrapper" @tap.stop="toggleSelect(item)">
  71. <view class="checkbox" :class="{ 'checked': isSelected(item) }">
  72. <text v-if="isSelected(item)" class="check-icon">✓</text>
  73. </view>
  74. </view>
  75. <text class="item-title">{{ getApplyCode(item) }}</text>
  76. <text class="item-status" :class="'status-' + getStatus(item)">{{ getStatusText(item) }}</text>
  77. </view>
  78. <view class="item-info">
  79. <view class="info-row">
  80. <view class="info-item">
  81. <text class="info-label">申请时间</text>
  82. <text class="info-value">{{ getCreateTime(item) }}</text>
  83. </view>
  84. <view class="info-item">
  85. <text class="info-label">申请人</text>
  86. <text class="info-value">{{ getNickName(item) }}</text>
  87. </view>
  88. </view>
  89. <view class="info-row">
  90. <view class="info-item">
  91. <text class="info-label">申请数</text>
  92. <text class="info-value warning">{{ getApplyCount(item) }}</text>
  93. </view>
  94. <view class="info-item">
  95. <text class="info-label">已出库</text>
  96. <text class="info-value primary">{{ getOutCount(item) }}</text>
  97. </view>
  98. </view>
  99. <view class="info-row">
  100. <view class="info-item">
  101. <text class="info-label">待领取</text>
  102. <text class="info-value error">{{ getReceiveCount(item) }}</text>
  103. </view>
  104. <view class="info-item">
  105. <text class="info-label">申购状态</text>
  106. <text class="info-value" :class="'purchase-status-' + getPurchaseStatus(item)">{{ getPurchaseStatusText(item) }}</text>
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. </template>
  113. </common-list>
  114. </view>
  115. <!-- 底部固定悬浮采购栏 -->
  116. <view v-if="showPurchaseBar" class="bottom-bar">
  117. <text class="select-count">已选中 {{ selectedIds.size }} 项</text>
  118. <view class="purchase-btn" @tap="handlePurchase">
  119. <text class="purchase-btn-text">批量采购</text>
  120. </view>
  121. </view>
  122. </template>
  123. <script setup lang="uts">
  124. import { ref } from 'vue'
  125. import { onLoad, onShow } from '@dcloudio/uni-app';
  126. import { getPurchaseApplyList, getPendingReceiveApplyCount } from '../../api/apply/index'
  127. import { getUserInfo } from '../../utils/storage'
  128. import { checkPermission } from '../../utils/permission'
  129. let currentUserId: string = ''
  130. // 列表数据
  131. const dataList = ref<any[]>([])
  132. const keyword = ref<string>("")
  133. let searchTimer: number | null = null
  134. const currentStatus = ref<string>("")
  135. const page = ref<number>(1)
  136. const pageSize: number = 10
  137. const hasMore = ref<boolean>(true)
  138. const loading = ref<boolean>(false)
  139. const refreshing = ref<boolean>(false)
  140. const showRight = ref<boolean>(false)
  141. const pendingReceiveCount = ref<number>(0)
  142. const selectedIds = ref<Set<string>>(new Set())
  143. const showPurchaseBar = ref<boolean>(false)
  144. // 加载待领取数量
  145. const loadPendingReceiveCount = (): void => {
  146. if (currentUserId.length === 0) return
  147. getPendingReceiveApplyCount(currentUserId).then((res: any) => {
  148. const result = res as UTSJSONObject
  149. const count = result['data']
  150. pendingReceiveCount.value = count != null ? parseInt(count.toString()) : 0
  151. }).catch((e) => {
  152. console.error('加载待领取数量失败:', e)
  153. })
  154. }
  155. // 获取申请单号
  156. const getApplyCode = (item: any | null): string => {
  157. if (item == null) return ''
  158. const jsonItem = item as UTSJSONObject
  159. const val = jsonItem['applyCode']
  160. return val != null ? val.toString() : ''
  161. }
  162. // 获取状态
  163. const getStatus = (item: any | null): string => {
  164. if (item == null) return ''
  165. const jsonItem = item as UTSJSONObject
  166. const val = jsonItem['status']
  167. return val != null ? val.toString() : ''
  168. }
  169. // 获取状态文本
  170. const getStatusText = (item: any | null): string => {
  171. if (item == null) return ''
  172. const jsonItem = item as UTSJSONObject
  173. const val = jsonItem['status']
  174. const status = val != null ? val.toString() : ''
  175. switch (status) {
  176. case 'PREPARE': return '草稿'
  177. case 'CONFIRMED': return '已确认'
  178. case 'FINISHED': return '已完成'
  179. case 'CANCEL': return '已取消'
  180. case 'APPROVED': return '已审批'
  181. case 'APPROVING': return '审批中'
  182. case 'WAITOUT': return '待出库'
  183. default: return status
  184. }
  185. }
  186. // 获取申购状态
  187. const getPurchaseStatus = (item: any | null): string => {
  188. if (item == null) return ''
  189. const jsonItem = item as UTSJSONObject
  190. const val = jsonItem['applyStatus']
  191. return val != null ? val.toString() : ''
  192. }
  193. // 获取申购状态文本
  194. const getPurchaseStatusText = (item: any | null): string => {
  195. if (item == null) return ''
  196. const jsonItem = item as UTSJSONObject
  197. const val = jsonItem['applyStatus']
  198. const status = val != null ? val.toString() : ''
  199. switch (status) {
  200. case '0': return '未申购'
  201. case '1': return '已申购'
  202. default: return ''
  203. }
  204. }
  205. // 获取创建时间
  206. const getCreateTime = (item: any | null): string => {
  207. if (item == null) return ''
  208. const jsonItem = item as UTSJSONObject
  209. const val = jsonItem['createTime']
  210. return val != null ? val.toString() : ''
  211. }
  212. // 获取申请人
  213. const getNickName = (item: any | null): string => {
  214. if (item == null) return ''
  215. const jsonItem = item as UTSJSONObject
  216. const val = jsonItem['nickName']
  217. return val != null ? val.toString() : ''
  218. }
  219. // 获取申请数量
  220. const getApplyCount = (item: any | null): string => {
  221. if (item == null) return '0'
  222. const jsonItem = item as UTSJSONObject
  223. const val = jsonItem['applyQuantity']
  224. return val != null ? val.toString() : '0'
  225. }
  226. // 获取已出库数量
  227. const getOutCount = (item: any | null): string => {
  228. if (item == null) return '0'
  229. const jsonItem = item as UTSJSONObject
  230. const val = jsonItem['outQuantity']
  231. return val != null ? val.toString() : '0'
  232. }
  233. // 获取待领取数量
  234. const getReceiveCount = (item: any | null): string => {
  235. if (item == null) return '0'
  236. const jsonItem = item as UTSJSONObject
  237. const val = jsonItem['pendingReceiveCount']
  238. return val != null ? val.toString() : '0'
  239. }
  240. // 获取已完成数量
  241. const getFinishedCount = (item: any | null): string => {
  242. if (item == null) return '0'
  243. const jsonItem = item as UTSJSONObject
  244. const val = jsonItem['finishedCount']
  245. return val != null ? val.toString() : '0'
  246. }
  247. // 获取待审核数量 (status=1)
  248. const getPendingAuditCount = (item: any | null): string => {
  249. if (item == null) return '0'
  250. const jsonItem = item as UTSJSONObject
  251. const val = jsonItem['pendingAuditCount']
  252. return val != null ? val.toString() : '0'
  253. }
  254. // 获取待领取数量 (status=2 + status=4)
  255. const getPendingReceiveCount = (item: any | null): string => {
  256. if (item == null) return '0'
  257. const jsonItem = item as UTSJSONObject
  258. const val = jsonItem['pendingReceiveCount']
  259. return val != null ? val.toString() : '0'
  260. }
  261. // 获取待采购数量 (status=3 + status=4)
  262. const getPendingPurchaseCount = (item: any | null): string => {
  263. if (item == null) return '0'
  264. const jsonItem = item as UTSJSONObject
  265. const val = jsonItem['pendingPurchaseCount']
  266. return val != null ? val.toString() : '0'
  267. }
  268. // 加载列表数据
  269. const loadData = async (isRefresh: boolean): Promise<void> => {
  270. if (loading.value) return
  271. try {
  272. loading.value = true
  273. if (isRefresh) {
  274. page.value = 1
  275. }
  276. const searchKeyword = keyword.value != null ? keyword.value : ''
  277. const isPendingReceive = currentStatus.value === 'PENDING_RECEIVE'
  278. const statusParam = isPendingReceive ? '' : (currentStatus.value != null ? currentStatus.value : '')
  279. console.log('loadData - statusParam:', statusParam, 'isPendingReceive:', isPendingReceive)
  280. const result = await getPurchaseApplyList(page.value, pageSize, searchKeyword, statusParam, currentUserId, isPendingReceive)
  281. console.log('getPurchaseApplyList result:', result)
  282. const resultObj = result as UTSJSONObject
  283. const rows = resultObj['rows']
  284. const total = resultObj['total'] as number
  285. console.log('rows:', rows, 'total:', total)
  286. if (rows != null) {
  287. const newData = rows as any[]
  288. if (isRefresh) {
  289. dataList.value = newData
  290. } else {
  291. dataList.value = [...dataList.value, ...newData]
  292. }
  293. hasMore.value = dataList.value.length < total
  294. } else {
  295. if (isRefresh) {
  296. dataList.value = []
  297. }
  298. hasMore.value = false
  299. }
  300. } catch (e) {
  301. console.error('加载失败:', e)
  302. } finally {
  303. loading.value = false
  304. refreshing.value = false
  305. }
  306. }
  307. // 下拉刷新
  308. const handleRefresh = (): void => {
  309. refreshing.value = true
  310. loadData(true)
  311. }
  312. // 加载更多
  313. const loadMore = (): void => {
  314. if (!hasMore.value || loading.value) return
  315. page.value++
  316. loadData(false)
  317. }
  318. // 搜索
  319. const handleSearch = (): void => {
  320. const timer = searchTimer
  321. if (timer != null) {
  322. clearTimeout(timer)
  323. }
  324. searchTimer = setTimeout(() => {
  325. loadData(true)
  326. }, 300)
  327. }
  328. // 清空搜索关键字
  329. const clearKeyword = (): void => {
  330. keyword.value = ''
  331. loadData(true)
  332. }
  333. // 切换状态
  334. const handleStatusChange = (status: string): void => {
  335. currentStatus.value = status
  336. loadData(true)
  337. }
  338. const handleRight = ():void=>{
  339. uni.navigateTo({
  340. url: `/pages/apply/applyNew?from=index`
  341. })
  342. }
  343. // 判断是否可以采购(已确认状态)
  344. const canPurchase = (item: any | null): boolean => {
  345. if (item == null) return false
  346. const jsonItem = item as UTSJSONObject
  347. const status = jsonItem['status']
  348. return status != null && status.toString() === 'CONFIRMED'
  349. }
  350. // 判断是否选中
  351. const isSelected = (item: any | null): boolean => {
  352. if (item == null) return false
  353. const jsonItem = item as UTSJSONObject
  354. const applyId = jsonItem['applyId']
  355. return applyId != null && selectedIds.value.has(applyId.toString())
  356. }
  357. // 切换选中状态
  358. const toggleSelect = (item: any | null): void => {
  359. if (item == null) return
  360. const jsonItem = item as UTSJSONObject
  361. const applyId = jsonItem['applyId']
  362. if (applyId == null) return
  363. const idStr = applyId.toString()
  364. if (selectedIds.value.has(idStr)) {
  365. selectedIds.value.delete(idStr)
  366. } else {
  367. selectedIds.value.add(idStr)
  368. }
  369. }
  370. // 采购按钮点击
  371. const handlePurchase = (): void => {
  372. if (selectedIds.value.size === 0) {
  373. uni.showToast({
  374. title: '请先选择单据',
  375. icon: 'none',
  376. duration: 2000
  377. })
  378. return
  379. }
  380. const hasPurchased = dataList.value.some((item: any) => {
  381. const jsonItem = item as UTSJSONObject
  382. const applyId = jsonItem['applyId']
  383. if (applyId != null && selectedIds.value.has(applyId.toString())) {
  384. const applyStatus = jsonItem['applyStatus']
  385. return applyStatus != null && applyStatus.toString() === '1'
  386. }
  387. return false
  388. })
  389. if (hasPurchased) {
  390. uni.showModal({
  391. title: '提示',
  392. content: '选中的单据中存在已申购的单据,继续采购将重复申购,确定继续吗?',
  393. success: (res) => {
  394. if (res.confirm) {
  395. const ids = Array.from(selectedIds.value).join(',')
  396. uni.navigateTo({
  397. url: `/pages/purchase/createByApply?applyIds=${ids}`
  398. })
  399. }
  400. }
  401. })
  402. } else {
  403. const ids = Array.from(selectedIds.value).join(',')
  404. uni.navigateTo({
  405. url: `/pages/purchase/createByApply?applyIds=${ids}`
  406. })
  407. }
  408. }
  409. // 点击列表项
  410. const handleItemClick = (item: any | null, index: number): void => {
  411. if (item == null) return
  412. const jsonItem = item as UTSJSONObject
  413. const applyId = jsonItem['applyId']
  414. uni.navigateTo({
  415. url: `/pages/apply/applyInfo?id=${applyId}`
  416. })
  417. }
  418. // 页面显示时刷新列表
  419. onShow(() => {
  420. if(currentUserId.length > 0){
  421. loadData(true)
  422. loadPendingReceiveCount()
  423. }
  424. })
  425. onMounted(() => {
  426. const userInfo = getUserInfo()
  427. if (userInfo != null) {
  428. const userId = userInfo['userId']
  429. currentUserId = userId != null ? userId.toString() : ''
  430. console.log("currentUserId:" + currentUserId)
  431. // 初始化
  432. loadData(true)
  433. }
  434. const pages = getCurrentPages()
  435. const currentPage = pages[pages.length - 1]
  436. const options = currentPage.options
  437. if (options != null && options.from == 'new') {
  438. showRight.value = false
  439. }else{
  440. showRight.value = true
  441. }
  442. showPurchaseBar.value = checkPermission('mes:wm:mergePurchase:add')
  443. })
  444. </script>
  445. <style lang="scss">
  446. .list-page {
  447. flex: 1;
  448. background-color: #e8f0f9;
  449. }
  450. .list-page.has-bottom-bar {
  451. padding-bottom: 140rpx;
  452. }
  453. .search-block {
  454. background-color: #ffffff;
  455. }
  456. .pending-receive-bar {
  457. display: flex;
  458. flex-direction: row;
  459. align-items: center;
  460. padding: 20rpx 30rpx;
  461. background-color: #fff7e6;
  462. border-left: 6rpx solid #fa8c16;
  463. margin: 0 30rpx;
  464. border-radius: 8rpx;
  465. }
  466. .pending-receive-label {
  467. font-size: 28rpx;
  468. color: #fa8c16;
  469. font-weight: bold;
  470. }
  471. .pending-receive-count {
  472. margin-left: 16rpx;
  473. padding: 4rpx 16rpx;
  474. background-color: #fa8c16;
  475. color: #ffffff;
  476. font-size: 24rpx;
  477. border-radius: 20rpx;
  478. }
  479. .pending-receive-arrow {
  480. margin-left: auto;
  481. color: #999999;
  482. font-size: 28rpx;
  483. }
  484. .search-bar {
  485. padding: 20rpx 30rpx;
  486. }
  487. .status-tabs {
  488. display: flex;
  489. flex-direction: row;
  490. padding: 0rpx 30rpx 20rpx;
  491. background-color: #ffffff;
  492. white-space: nowrap;
  493. width: 100%;
  494. }
  495. .status-tab {
  496. display: inline-flex;
  497. flex-direction: row;
  498. align-items: center;
  499. padding: 16rpx 24rpx;
  500. text-align: center;
  501. position: relative;
  502. margin-right: 16rpx;
  503. border-radius: 8rpx;
  504. background-color: #f5f5f5;
  505. justify-content: center;
  506. align-items: center;
  507. &:last-child {
  508. margin-right: 0;
  509. }
  510. &.active {
  511. background-color: #007aff;
  512. }
  513. .status-tab-text {
  514. font-size: 26rpx;
  515. color: #666666;
  516. text-align: center;
  517. &.active-text {
  518. color: #ffffff;
  519. font-weight: bold;
  520. }
  521. }
  522. .tab-badge {
  523. margin-left: 8rpx;
  524. min-width: 32rpx;
  525. height: 32rpx;
  526. padding: 0 8rpx;
  527. background-color: #ff3b30;
  528. border-radius: 16rpx;
  529. justify-content: center;
  530. align-items: center;
  531. .tab-badge-text {
  532. font-size: 20rpx;
  533. color: #ffffff;
  534. }
  535. }
  536. }
  537. .search-box {
  538. flex-direction: row;
  539. align-items: center;
  540. height: 72rpx;
  541. padding: 0 24rpx;
  542. background-color: #f5f5f5;
  543. border-radius: 36rpx;
  544. .search-icon {
  545. width: 32rpx;
  546. height: 32rpx;
  547. margin-right: 12rpx;
  548. }
  549. .search-input {
  550. flex: 1;
  551. font-size: 28rpx;
  552. color: #333333;
  553. }
  554. .search-btn {
  555. padding: 10rpx 20rpx;
  556. background-color: #007aff;
  557. border-radius: 8rpx;
  558. margin-left: 10rpx;
  559. }
  560. .search-btn-text {
  561. color: #ffffff;
  562. font-size: 24rpx;
  563. }
  564. .clear-btn {
  565. width: 36rpx;
  566. height: 36rpx;
  567. border-radius: 18rpx;
  568. background-color: #cccccc;
  569. align-items: center;
  570. justify-content: center;
  571. margin-left: 10rpx;
  572. }
  573. .clear-btn-text {
  574. color: #ffffff;
  575. font-size: 24rpx;
  576. font-weight: bold;
  577. }
  578. }
  579. .bottom-bar {
  580. position: fixed;
  581. bottom: 0;
  582. left: 0;
  583. right: 0;
  584. background-color: #ffffff;
  585. padding: 24rpx 40rpx;
  586. border-top: 1rpx solid #e5e5e5;
  587. flex-direction: row;
  588. justify-content: space-between;
  589. align-items: center;
  590. box-shadow: 0 -4rpx 16rpx rgba(0, 0, 0, 0.08);
  591. }
  592. .select-count {
  593. font-size: 28rpx;
  594. color: #666666;
  595. }
  596. .purchase-btn {
  597. background-color: #1677ff;
  598. padding: 20rpx 60rpx;
  599. border-radius: 16rpx;
  600. }
  601. .purchase-btn-text {
  602. color: #ffffff;
  603. font-size: 30rpx;
  604. font-weight: bold;
  605. }
  606. .list-item {
  607. margin: 10rpx 20rpx;
  608. background-color: #ffffff;
  609. border-radius: 16rpx;
  610. }
  611. .item-container {
  612. padding: 30rpx;
  613. }
  614. .item-header {
  615. flex-direction: row;
  616. align-items: center;
  617. margin-bottom: 20rpx;
  618. .checkbox-wrapper {
  619. margin-right: 16rpx;
  620. }
  621. .checkbox {
  622. width: 40rpx;
  623. height: 40rpx;
  624. border: 2rpx solid #d9d9d9;
  625. border-radius: 6rpx;
  626. display: flex;
  627. align-items: center;
  628. justify-content: center;
  629. background-color: #ffffff;
  630. &.checked {
  631. background-color: #1677ff;
  632. border-color: #1677ff;
  633. }
  634. }
  635. .check-icon {
  636. color: #ffffff;
  637. font-size: 24rpx;
  638. font-weight: bold;
  639. }
  640. .item-title {
  641. flex: 1;
  642. font-size: 32rpx;
  643. color: #333333;
  644. font-weight: bold;
  645. }
  646. .item-status {
  647. font-size: 26rpx;
  648. padding: 6rpx 16rpx;
  649. border-radius: 6rpx;
  650. &.status-PREPARE {
  651. background-color: #f0f0f0;
  652. color: #666666;
  653. }
  654. &.status-CONFIRMED {
  655. background-color: #e6f7ff;
  656. color: #1890ff;
  657. }
  658. &.status-FINISHED {
  659. background-color: #f6ffed;
  660. color: #52c41a;
  661. }
  662. &.status-CANCEL {
  663. background-color: #fff1f0;
  664. color: #ff4d4f;
  665. }
  666. &.status-APPROVING {
  667. background-color: #d1f5f8;
  668. color: #ff007f;
  669. }
  670. &.status-WAITOUT {
  671. color: #fa8c16;
  672. }
  673. &.status-APPROVED {
  674. background-color: #ebfffd;
  675. color: #55ff00;
  676. }
  677. }
  678. }
  679. .item-info {
  680. padding: 20rpx;
  681. background-color: #f8f9fa;
  682. border-radius: 8rpx;
  683. .info-row {
  684. flex-direction: row;
  685. justify-content: space-between;
  686. margin-bottom: 16rpx;
  687. &:last-child {
  688. margin-bottom: 0;
  689. }
  690. .info-item {
  691. flex-direction: row;
  692. align-items: center;
  693. flex: 1;
  694. &:last-child {
  695. flex: 1;
  696. justify-content: flex-end;
  697. }
  698. .info-label {
  699. font-size: 26rpx;
  700. color: #666666;
  701. margin-right: 8rpx;
  702. white-space: nowrap;
  703. }
  704. .info-value {
  705. font-size: 26rpx;
  706. color: #333333;
  707. flex: 1;
  708. &.success {
  709. color: #52c41a;
  710. }
  711. &.warning {
  712. color: #faad14;
  713. }
  714. &.error {
  715. color: #ff0000;
  716. }
  717. &.primary {
  718. color: #007aff;
  719. }
  720. &.purchase-status-0 {
  721. color: #faad14;
  722. }
  723. &.purchase-status-1 {
  724. color: #52c41a;
  725. }
  726. }
  727. }
  728. }
  729. }
  730. </style>