applyNew.uvue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. <template>
  2. <uni-navbar-lite :showRight=false title="物料申请"></uni-navbar-lite>
  3. <view class="page-container">
  4. <scroll-view class="page-content">
  5. <view class="section">
  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" @confirm="handleSearch" confirm-type="search" />
  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. <view class="status-tabs">
  19. <scroll-view class="scroll-view_H" direction="horizontal" :show-scrollbar="false">
  20. <view
  21. v-for="(cat, idx) in categories"
  22. :key="idx"
  23. class="status-tab"
  24. :class="{ 'active': currentStatus === cat.id }"
  25. @click="switchStatus(cat.id)"
  26. >
  27. <text class="status-tab-text" :class="{ 'active-text': currentStatus === cat.id }">{{ cat.name }}</text>
  28. </view>
  29. </scroll-view>
  30. </view>
  31. </view>
  32. <view class="section">
  33. <view class="section-header">
  34. <view class="section-indicator"></view>
  35. <text class="section-title">物料列表</text>
  36. </view>
  37. <view class="material-list">
  38. <view
  39. v-for="(item, index) in dataList"
  40. :key="item.itemId + '_' + page"
  41. class="list-item"
  42. @click="handleItemClick(item, index)"
  43. >
  44. <view class="item-header">
  45. <view class="item-info">
  46. <view class="item-name-row">
  47. <text class="item-name">{{ getItemName(item) }}</text>
  48. <text class="item-measure">{{ getMeasureName(item) }}</text>
  49. </view>
  50. <text class="item-sub-title">{{ getItemTypeName(item) }}</text>
  51. </view>
  52. <view v-if="item.isSelected" class="added-btn">
  53. <text class="added-icon">已选</text>
  54. </view>
  55. <view v-else class="add-btn" @click.stop="addToSelected(item)">
  56. <text class="add-icon">+</text>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <!-- 手动分页 -->
  62. <view class="pagination">
  63. <view class="page-btn" :class="{disabled: page <= 1}" @click="prevPage">
  64. <text class="page-btn-text"><</text>
  65. </view>
  66. <text class="page-info">第{{ page }}页 / 共{{ totalPages }}页</text>
  67. <view class="page-btn" :class="{disabled: page >= totalPages}" @click="nextPage">
  68. <text class="page-btn-text">></text>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="section">
  73. <view class="section-header">
  74. <view class="section-indicator"></view>
  75. <text class="section-title">已选列表</text>
  76. </view>
  77. <view class="selected-list">
  78. <view v-if="selectedItems.length === 0" class="empty-tip">
  79. <text class="empty-tip-text">请选择物料</text>
  80. </view>
  81. <view
  82. v-else
  83. v-for="(selItem, selIndex) in selectedItems"
  84. :key="selIndex"
  85. class="selected-item"
  86. >
  87. <text class="selected-item-name">{{ selItem.itemName }}</text>
  88. <text class="selected-item-measure">{{ selItem.measureName }}</text>
  89. <view class="quantity-control">
  90. <view class="qty-btn" @click="decreaseQty(selIndex)">
  91. <text class="qty-btn-text">-</text>
  92. </view>
  93. <input
  94. class="quantity-input"
  95. type="digit"
  96. v-model="selItem.qty"
  97. placeholder="数量"
  98. />
  99. <view class="qty-btn" @click="increaseQty(selIndex)">
  100. <text class="qty-btn-text">+</text>
  101. </view>
  102. </view>
  103. <view class="delete-btn" @click="removeSelected(selIndex)">
  104. <text class="delete-icon">×</text>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. </scroll-view>
  110. <!-- 底部按钮 -->
  111. <view class="bottom-buttons">
  112. <view class="btn-row">
  113. <button class="save-btn" @click="saveApplication">保存</button>
  114. <button class="confirm-btn" @click="confirmApplication">确认申请</button>
  115. </view>
  116. </view>
  117. </view>
  118. </template>
  119. <script setup lang="uts">
  120. import { ref, computed, onBeforeUnmount, onMounted } from 'vue'
  121. import { getItemTypeListByParentId, getItemList, savePurchaseApply, confirmPurchaseApply } from '../../api/apply/index'
  122. type CategoryItem = { id: string; name: string; code: string }
  123. type Item = { itemId: string; itemName: string; itemTypeName: string; measureName: string; isSelected?: boolean }
  124. type SelectedItem = { itemId: string; itemName: string; itemTypeName: string; measureName: string; qty: string }
  125. const keyword = ref<string>("")
  126. const dataList = ref<Item[]>([])
  127. const selectedItems = ref<SelectedItem[]>([])
  128. const page = ref<number>(1)
  129. const pageSize: number = 10
  130. const total = ref<number>(0)
  131. const totalPages = computed((): number => {
  132. if (total.value <= 0) return 1
  133. return Math.ceil(total.value / pageSize)
  134. })
  135. const hasMore = ref<boolean>(true)
  136. const loading = ref<boolean>(false)
  137. const refreshing = ref<boolean>(false)
  138. const categories = ref<CategoryItem[]>([])
  139. const dealLoad = ref<boolean>(false)
  140. let currentStatus = ref<string>('')
  141. const isSearching = ref<boolean>(false)
  142. // 获取当前选中的分类code
  143. const getCurrentCategoryCode = (): string => {
  144. const currentCat = categories.value.find((c: CategoryItem) => c.id === currentStatus.value)
  145. return currentCat != null ? currentCat.code : ''
  146. }
  147. // 加载物料列表
  148. const loadItems = (): void => {
  149. loading.value = true
  150. const itemTypeCode = getCurrentCategoryCode()
  151. getItemList(itemTypeCode, page.value, pageSize, keyword.value).then((res: any) => {
  152. const data = res as UTSJSONObject
  153. const rows = data['rows']
  154. const totalNum = data['total']
  155. if (totalNum != null) {
  156. total.value = totalNum as number
  157. }
  158. if (rows != null) {
  159. const listData = rows as UTSJSONObject[]
  160. if (listData.length > 0) {
  161. const arr: Item[] = []
  162. const selectedIds = selectedItems.value.map((s: SelectedItem) => s.itemId)
  163. listData.forEach((item: UTSJSONObject) => {
  164. const itemId = item['itemId'] != null ? item['itemId'].toString() : ''
  165. const it: Item = {
  166. itemId: itemId,
  167. itemName: item['itemName'] != null ? item['itemName'].toString() : '',
  168. itemTypeName: item['itemTypeName'] != null ? item['itemTypeName'].toString() : '',
  169. measureName: item['measureName'] != null ? item['measureName'].toString() : '',
  170. isSelected: selectedIds.includes(itemId)
  171. }
  172. arr.push(it)
  173. })
  174. dataList.value = arr
  175. loading.value = false
  176. return
  177. }
  178. }
  179. dataList.value = []
  180. loading.value = false
  181. }).catch(() => {
  182. dataList.value = []
  183. loading.value = false
  184. })
  185. }
  186. // 上一页
  187. const prevPage = (): void => {
  188. if (page.value > 1) {
  189. page.value--
  190. loadItems()
  191. }
  192. }
  193. // 下一页
  194. const nextPage = (): void => {
  195. if (page.value < totalPages.value) {
  196. page.value++
  197. loadItems()
  198. }
  199. }
  200. const loadCategories = (): void => {
  201. getItemTypeListByParentId(200).then((res: any) => {
  202. const data = res as UTSJSONObject
  203. const list = data['data']
  204. if (list != null) {
  205. const listData = list as UTSJSONObject[]
  206. if (listData.length > 0) {
  207. const arr: CategoryItem[] = []
  208. listData.forEach((item: UTSJSONObject) => {
  209. const idVal = item['itemTypeId']
  210. const nameVal = item['itemTypeName']
  211. const codeVal = item['itemTypeCode']
  212. const cat: CategoryItem = {
  213. id: idVal != null ? idVal.toString() : '',
  214. name: nameVal != null ? nameVal.toString() : '',
  215. code: codeVal != null ? codeVal.toString() : ''
  216. }
  217. arr.push(cat)
  218. })
  219. const allItem: CategoryItem = {id: '', name: '全部', code: ''}
  220. arr.unshift(allItem)
  221. categories.value = arr
  222. // 加载第一个分类的物料
  223. if (arr.length > 0) {
  224. currentStatus.value = arr[0].id
  225. loadItems()
  226. }
  227. return
  228. }
  229. }
  230. const defaultArr: CategoryItem[] = []
  231. const defaultItem: CategoryItem = {id: '', name: '全部', code: ''}
  232. defaultArr.push(defaultItem)
  233. categories.value = defaultArr
  234. }).catch(() => {
  235. const defaultArr: CategoryItem[] = []
  236. const defaultItem: CategoryItem = {id: '', name: '全部', code: ''}
  237. defaultArr.push(defaultItem)
  238. categories.value = defaultArr
  239. })
  240. }
  241. // 添加到已选列表
  242. const addToSelected = (item: any | null): void => {
  243. if (item == null) return
  244. const mdItem = item as Item
  245. // 检查是否已存在
  246. const exists = selectedItems.value.find((s: SelectedItem) => s.itemId === mdItem.itemId)
  247. if (exists != null) {
  248. uni.showToast({ title: '该物料已在选择列表中', icon: 'none' })
  249. return
  250. }
  251. const selItem: SelectedItem = {
  252. itemId: mdItem.itemId,
  253. itemName: mdItem.itemName,
  254. itemTypeName: mdItem.itemTypeName,
  255. measureName: mdItem.measureName,
  256. qty: '1'
  257. }
  258. selectedItems.value.push(selItem)
  259. // 更新 dataList 中的选中状态
  260. const idx = dataList.value.findIndex((d: Item) => d.itemId === mdItem.itemId)
  261. if (idx >= 0) {
  262. dataList.value[idx].isSelected = true
  263. }
  264. }
  265. // 删除已选物料
  266. const removeSelected = (index: number): void => {
  267. const removedItem = selectedItems.value[index]
  268. selectedItems.value.splice(index, 1)
  269. // 重新加载当前页数据以更新选中状态
  270. loadItems()
  271. }
  272. // 增加数量
  273. const increaseQty = (index: number): void => {
  274. const currentQty = parseInt(selectedItems.value[index].qty)
  275. selectedItems.value[index].qty = (currentQty + 1).toString()
  276. }
  277. // 减少数量
  278. const decreaseQty = (index: number): void => {
  279. const currentQty = parseInt(selectedItems.value[index].qty)
  280. if (currentQty > 1) {
  281. selectedItems.value[index].qty = (currentQty - 1).toString()
  282. }
  283. }
  284. const handleItemClick = (item: any | null, index: number): void => {
  285. if (item == null) return
  286. const mdItem = item as Item
  287. uni.navigateTo({
  288. url: `/pages/item/itemDetail?id=${mdItem.itemId}`
  289. })
  290. }
  291. const getItemName = (item: any | null): string => {
  292. if (item == null) return ''
  293. const mdItem = item as Item
  294. return mdItem.itemName
  295. }
  296. const getItemTypeName = (item: any | null): string => {
  297. if (item == null) return ''
  298. const mdItem = item as Item
  299. return mdItem.itemTypeName
  300. }
  301. const getMeasureName = (item: any | null): string => {
  302. if (item == null) return ''
  303. const mdItem = item as Item
  304. return mdItem.measureName
  305. }
  306. // 检查物料是否已被选择
  307. const isItemSelected = (item: any | null): boolean => {
  308. if (item == null) return false
  309. const mdItem = item as Item
  310. return selectedItems.value.find((s: SelectedItem) => s.itemId === mdItem.itemId) != null
  311. }
  312. const handleSearch = (): void => {
  313. page.value = 1
  314. loadItems()
  315. }
  316. const clearKeyword = (): void => {
  317. keyword.value = ''
  318. page.value = 1
  319. loadItems()
  320. }
  321. const switchStatus = (status: string): void => {
  322. if (loading.value) {
  323. return;
  324. }
  325. if (isSearching.value) {
  326. return
  327. }
  328. isSearching.value = true
  329. currentStatus.value = status
  330. page.value = 1
  331. loadItems()
  332. setTimeout(() => {
  333. isSearching.value = false
  334. }, 100)
  335. }
  336. // 构建申请单数据
  337. const buildApplyData = (status: string): UTSJSONObject => {
  338. const applyLines: UTSJSONObject[] = []
  339. selectedItems.value.forEach((item: SelectedItem) => {
  340. const lineObj = new UTSJSONObject()
  341. lineObj['itemId'] = parseInt(item.itemId)
  342. lineObj['itemCode'] = ''
  343. lineObj['itemName'] = item.itemName
  344. lineObj['specification'] = ''
  345. lineObj['unitOfMeasure'] = ''
  346. lineObj['quantityApply'] = parseInt(item.qty)
  347. applyLines.push(lineObj)
  348. })
  349. const result = new UTSJSONObject()
  350. result['applyCode'] = ''
  351. result['applyName'] = '物料申请'
  352. result['status'] = status
  353. result['wmPurchaseApplyLineList'] = applyLines
  354. return result
  355. }
  356. // 来源页面
  357. const fromIndexPage = ref<boolean>(false)
  358. // 保存申请
  359. const saveApplication = (): void => {
  360. if (selectedItems.value.length === 0) {
  361. uni.showToast({ title: '请选择物料', icon: 'none' })
  362. return
  363. }
  364. // 构建申请单数据
  365. const applyData = buildApplyData('PREPARE')
  366. savePurchaseApply(applyData).then((res: any) => {
  367. uni.showToast({ title: '保存成功', icon: 'success' })
  368. // 清空已选列表
  369. selectedItems.value = []
  370. loadItems()
  371. // 如果从index.uvue跳转过来,返回index.uvue
  372. if (fromIndexPage.value) {
  373. setTimeout(() => {
  374. uni.navigateBack()
  375. }, 1000)
  376. }
  377. }).catch((e) => {
  378. console.log(e)
  379. const error = e as UTSError
  380. const errMsg = error?.message
  381. uni.showToast({ title: errMsg.toString(), icon: 'none' })
  382. })
  383. }
  384. // 确认申请
  385. const confirmApplication = (): void => {
  386. if (selectedItems.value.length === 0) {
  387. uni.showToast({ title: '请选择物料', icon: 'none' })
  388. return
  389. }
  390. // 验证所有数量都大于0
  391. for (let i = 0; i < selectedItems.value.length; i++) {
  392. const qty = parseFloat(selectedItems.value[i].qty)
  393. if (qty <= 0) {
  394. uni.showToast({ title: '所有物料数量必须大于0', icon: 'none' })
  395. return
  396. }
  397. }
  398. // 构建申请单数据
  399. const applyData = buildApplyData('CONFIRMED')
  400. savePurchaseApply(applyData).then((res: any) => {
  401. uni.showToast({ title: '确认申请成功', icon: 'success' })
  402. // 清空已选列表
  403. selectedItems.value = []
  404. loadItems()
  405. // 如果从index.uvue跳转过来,返回index.uvue
  406. if (fromIndexPage.value) {
  407. setTimeout(() => {
  408. uni.navigateBack()
  409. }, 1000)
  410. }
  411. }).catch((e) => {
  412. const error = e as UTSError
  413. const errMsg = error?.message
  414. uni.showToast({ title: errMsg.toString(), icon: 'none' })
  415. })
  416. }
  417. onMounted(() => {
  418. loadCategories()
  419. // 获取页面参数,判断是否从index.uvue跳转过来
  420. const pages = getCurrentPages()
  421. const currentPage = pages[pages.length - 1]
  422. const options = currentPage.options
  423. if (options != null && options.from == 'index') {
  424. fromIndexPage.value = true
  425. }
  426. })
  427. </script>
  428. <style lang="scss">
  429. .page-container {
  430. flex: 1;
  431. background-color: #f5f8fe;
  432. padding-top: env(safe-area-inset-top);
  433. background-color: #e8f0f9;
  434. padding: 0rpx 20rpx 0rpx 20rpx;
  435. }
  436. .page-content {
  437. flex: 1;
  438. padding: 0rpx;
  439. padding-bottom: 150rpx;
  440. box-sizing: border-box;
  441. }
  442. .section {
  443. margin-top: 10rpx;
  444. padding: 0 10rpx 10rpx;
  445. background: #ffffff;
  446. border-radius: 16rpx;
  447. &-header {
  448. flex-direction: row;
  449. align-items: center;
  450. padding: 30rpx 10rpx 20rpx;
  451. }
  452. &-indicator {
  453. width: 6rpx;
  454. height: 32rpx;
  455. background-color: #007aff;
  456. border-radius: 3rpx;
  457. margin-right: 12rpx;
  458. }
  459. &-title {
  460. font-size: 36rpx;
  461. color: #333333;
  462. font-weight: bold;
  463. }
  464. }
  465. .search-bar {
  466. padding: 10rpx 3rpx;
  467. }
  468. .search-box {
  469. flex-direction: row;
  470. align-items: center;
  471. height: 72rpx;
  472. padding: 0 24rpx;
  473. background-color: #f5f5f5;
  474. border-radius: 16rpx;
  475. .search-icon {
  476. width: 32rpx;
  477. height: 32rpx;
  478. margin-right: 12rpx;
  479. }
  480. .search-input {
  481. flex: 1;
  482. font-size: 28rpx;
  483. color: #333333;
  484. }
  485. .search-btn {
  486. padding: 10rpx 20rpx;
  487. background-color: #007aff;
  488. border-radius: 8rpx;
  489. margin-left: 10rpx;
  490. }
  491. .search-btn-text {
  492. color: #ffffff;
  493. font-size: 24rpx;
  494. }
  495. .clear-btn {
  496. width: 36rpx;
  497. height: 36rpx;
  498. border-radius: 18rpx;
  499. background-color: #cccccc;
  500. align-items: center;
  501. justify-content: center;
  502. margin-left: 10rpx;
  503. }
  504. .clear-btn-text {
  505. color: #ffffff;
  506. font-size: 24rpx;
  507. font-weight: bold;
  508. }
  509. }
  510. .status-tabs {
  511. padding: 20rpx 30rpx;
  512. background-color: #ffffff;
  513. border-bottom: 1rpx solid #eeeeee;
  514. }
  515. .scroll-view_H {
  516. width: 100%;
  517. flex-direction: row;
  518. }
  519. .status-tab {
  520. padding: 16rpx 24rpx;
  521. text-align: center;
  522. margin-right: 16rpx;
  523. border-radius: 8rpx;
  524. background-color: #f5f5f5;
  525. flex-shrink: 0;
  526. &:last-child {
  527. margin-right: 0;
  528. }
  529. &.active {
  530. background-color: #007aff;
  531. }
  532. .status-tab-text {
  533. font-size: 26rpx;
  534. color: #666666;
  535. &.active-text {
  536. color: #ffffff;
  537. font-weight: bold;
  538. }
  539. }
  540. }
  541. .list-item {
  542. margin: 3rpx;
  543. padding: 10rpx 10rpx 0rpx 10rpx;
  544. border-bottom: 1px solid #f9f9f9;
  545. }
  546. .item-header {
  547. flex-direction: row;
  548. align-items: center;
  549. justify-content: space-between;
  550. margin-bottom: 10rpx;
  551. }
  552. .item-title {
  553. flex: 1;
  554. }
  555. .item-name {
  556. font-size: 28rpx;
  557. color: #333333;
  558. font-weight: bold;
  559. }
  560. .item-name-row {
  561. flex-direction: row;
  562. align-items: center;
  563. }
  564. .item-measure {
  565. font-size: 24rpx;
  566. color: #999999;
  567. margin-left: 10rpx;
  568. }
  569. .item-sub-title {
  570. flex: 1;
  571. font-size: 23rpx;
  572. color: #797979;
  573. margin-left: 10rpx;
  574. }
  575. .item-measure {
  576. font-size: 23rpx;
  577. color: #999999;
  578. margin-left: 10rpx;
  579. }
  580. .add-btn {
  581. width: 44rpx;
  582. height: 44rpx;
  583. border-radius: 22rpx;
  584. background-color: #165DFF;
  585. align-items: center;
  586. justify-content: center;
  587. }
  588. .add-icon {
  589. color: #FFFFFF;
  590. font-size: 28rpx;
  591. font-weight: bold;
  592. }
  593. .added-btn {
  594. padding: 8rpx 16rpx;
  595. border-radius: 8rpx;
  596. align-items: center;
  597. justify-content: center;
  598. }
  599. .added-icon {
  600. color: #ff4d4f;
  601. font-size: 24rpx;
  602. }
  603. .detail-link {
  604. font-size: 21rpx;
  605. color: #999999;
  606. }
  607. .material-list {
  608. max-height: 720rpx;
  609. overflow-y: auto;
  610. }
  611. .pagination {
  612. flex-direction: row;
  613. display: flex;
  614. align-items: center;
  615. justify-content: center;
  616. padding: 20rpx;
  617. gap: 30rpx;
  618. }
  619. .page-btn {
  620. padding: 10rpx 20rpx;
  621. margin: 5px;
  622. background-color: #165DFF;
  623. border-radius: 8rpx;
  624. }
  625. .page-btn.disabled {
  626. background-color: #cccccc;
  627. }
  628. .page-btn-text {
  629. color: #FFFFFF;
  630. font-size: 26rpx;
  631. }
  632. .page-info {
  633. font-size: 26rpx;
  634. color: #666666;
  635. }
  636. .selected-list {
  637. padding: 20rpx;
  638. background-color: #ffffff;
  639. min-height: 150rpx;
  640. display: flex;
  641. flex-direction: column;
  642. gap: 15rpx;
  643. }
  644. .empty-tip {
  645. display: flex;
  646. align-items: center;
  647. justify-content: center;
  648. padding: 40rpx;
  649. }
  650. .empty-tip-text {
  651. color: #999999;
  652. font-size: 28rpx;
  653. }
  654. .selected-item {
  655. display: flex;
  656. flex-direction: row;
  657. align-items: center;
  658. background-color: #ffffff;
  659. border-radius: 10rpx;
  660. padding: 20rpx;
  661. border: 1rpx solid #e5e5e5;
  662. box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.05);
  663. white-space: nowrap;
  664. }
  665. .selected-item-name {
  666. font-size: 26rpx;
  667. color: #333333;
  668. margin-right: 20rpx;
  669. font-weight: 500;
  670. // white-space: nowrap;
  671. max-width: 180rpx;
  672. // overflow: hidden;
  673. // text-overflow: ellipsis;
  674. flex-shrink: 0;
  675. }
  676. .selected-item-measure {
  677. font-size: 24rpx;
  678. color: #999999;
  679. margin-right: 20rpx;
  680. flex-shrink: 0;
  681. }
  682. .quantity-control {
  683. display: flex;
  684. flex-direction: row;
  685. align-items: center;
  686. margin-left: auto;
  687. margin-right: 20rpx;
  688. flex-shrink: 0;
  689. }
  690. .qty-btn {
  691. width: 44rpx;
  692. height: 44rpx;
  693. background-color: #f5f5f5;
  694. border-radius: 6rpx;
  695. align-items: center;
  696. justify-content: center;
  697. border: 1rpx solid #e5e5e5;
  698. }
  699. .qty-btn-text {
  700. color: #333333;
  701. font-size: 28rpx;
  702. font-weight: bold;
  703. }
  704. .quantity-input {
  705. width: 160rpx;
  706. height: 44rpx;
  707. background-color: #f5f5f5;
  708. border-radius: 6rpx;
  709. font-size: 24rpx;
  710. padding: 0 10rpx;
  711. border: 1rpx solid #e5e5e5;
  712. text-align: center;
  713. margin: 0 10rpx;
  714. }
  715. .quantity-input:focus {
  716. outline: none;
  717. border-color: #007aff;
  718. background-color: #ffffff;
  719. }
  720. .delete-btn {
  721. width: 40rpx;
  722. height: 40rpx;
  723. border-radius: 20rpx;
  724. background-color: #ff4d4f;
  725. align-items: center;
  726. justify-content: center;
  727. display: flex;
  728. flex-shrink: 0; // 防止删除按钮被压缩
  729. }
  730. .delete-icon {
  731. color: #ffffff;
  732. font-size: 30rpx;
  733. font-weight: bold;
  734. }
  735. /* 底部按钮 */
  736. .bottom-buttons {
  737. padding: 20rpx;
  738. background-color: #ffffff;
  739. border-top: 1rpx solid #e5e5e5;
  740. position: fixed;
  741. bottom: 0;
  742. left: 0;
  743. right: 0;
  744. z-index: 100;
  745. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
  746. }
  747. .btn-row {
  748. flex-direction: row;
  749. display: flex;
  750. gap: 20rpx;
  751. }
  752. .save-btn {
  753. width: 180rpx;
  754. height: 80rpx;
  755. background-color: #f5f5f5;
  756. color: #333333;
  757. font-size: 28rpx;
  758. font-weight: 500;
  759. border-radius: 20rpx;
  760. border: 1rpx solid #e5e5e5;
  761. }
  762. .confirm-btn {
  763. flex: 1;
  764. height: 80rpx;
  765. background-color: #007aff;
  766. color: #ffffff;
  767. font-size: 28rpx;
  768. font-weight: 600;
  769. border-radius: 20rpx;
  770. margin-left: 10rpx;
  771. border: none;
  772. box-shadow: 0 2rpx 8rpx rgba(0, 122, 255, 0.3);
  773. }
  774. </style>