OutboundConfirm.vue 26 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010
  1. <!-- 借用 - 智能仓储风格 -->
  2. <template>
  3. <dv-border-box-8>
  4. <div class="stock-requisition-page">
  5. <!-- 背景层 -->
  6. <div class="bg-layer" :style="{ backgroundImage: `url(${bgImg})` }" />
  7. <!-- 顶部标题区域 -->
  8. <div class="header-section">
  9. <button class="logout-btn" @click="goHome">
  10. <i class="fas fa-home" />
  11. <span>主页</span>
  12. </button>
  13. <h1 class="page-title">借用</h1>
  14. <!-- 右侧操作按钮 -->
  15. <div class="header-actions">
  16. <button class="action-btn refresh-btn" @click="resetView">
  17. <i class="fas fa-sync-alt" />
  18. <span>重新校验</span>
  19. </button>
  20. </div>
  21. </div>
  22. <!-- 主内容区域 -->
  23. <main class="main-content">
  24. <!-- 统计信息 -->
  25. <div v-if="materialList.length > 0" class="stats-section">
  26. <!-- <span class="stats-text">共 {{ materialList.length }} 条数据,已完成 {{ completedCount }} 条</span> -->
  27. <span class="stats-text">共 {{ materialList.length }} 条数据,不识别 {{ unrecognizedCount }} 条</span>
  28. </div>
  29. <!-- 卡片网格区域 -->
  30. <div class="card-grid-wrapper">
  31. <!-- 空状态 -->
  32. <div v-if="materialList.length === 0 && !loading" class="empty-state">
  33. <i class="fas fa-inbox empty-icon" />
  34. <p>暂无数据</p>
  35. </div>
  36. <!-- 卡片网格 -->
  37. <div v-else class="card-grid">
  38. <template v-for="(item, index) in validMaterialList" :key="item.inventoryId || index">
  39. <div
  40. class="inventory-card"
  41. :class="{
  42. 'completed': item.status === 1 || item.status === 3,
  43. 'not-selectable': item.positionName === '不在库' || item.inventoryName === '未识别epc'
  44. }"
  45. >
  46. <!-- @click="handleSelect(item)" -->
  47. <!-- 'selected': item.selected, -->
  48. <!-- 'warning': item.status === 2 || item.status === 3, -->
  49. <!-- 卡片序号 -->
  50. <div class="card-index" :class="{ 'completed': item.status === 1 }">{{ index + 1 }}</div>
  51. <!-- 信息区域 -->
  52. <div class="card-info">
  53. <div class="info-row">
  54. <span class="info-label">名称:</span>
  55. <span class="info-value">{{ item.inventoryName || '-' }}</span>
  56. </div>
  57. <div class="info-row">
  58. <span class="info-label">编号:</span>
  59. <span class="info-value">{{ item.inventoryNo || '-' }}</span>
  60. </div>
  61. <div class="info-row">
  62. <span class="info-label">类型:</span>
  63. <span class="info-value">{{ item.inventoryType || '-' }}</span>
  64. <i :class="getInventoryIcon(item.inventoryType)" class="type-icon" />
  65. </div>
  66. <div class="info-row location-row">
  67. <i class="fas fa-map-marker-alt location-icon" />
  68. <span class="info-value">{{ item.positionName || '-' }} / {{ item.warehouseName || '-' }}</span>
  69. </div>
  70. <!-- 不在库的借用人信息显示在内容区域 -->
  71. <div v-if="item.positionName === '不在库'" class="info-row borrower-row">
  72. <span class="info-label">借用人:</span>
  73. <span class="info-value">{{ item.borrower || '-' }}</span>
  74. </div>
  75. <div v-else class="borrower-row">
  76. <span class="info-label">-</span>
  77. </div>
  78. </div>
  79. <!-- 操作区域(固定高度) -->
  80. <div class="card-action-section">
  81. <template v-if="item.positionName !== '不在库' && item.inventoryName !== '未识别epc'">
  82. <button v-if="item.status === 1 || item.status === 3" class="status-btn apply-btn" @click.stop="handleApply(item)">
  83. <i class="fas fa-hand-paper" /> 借用
  84. </button>
  85. </template>
  86. <template v-else-if="item.positionName === '不在库'">
  87. <div class="status-badge borrowed-badge">
  88. <i class="fas fa-exclamation-circle" />
  89. 已借用
  90. </div>
  91. </template>
  92. <template v-else>
  93. <span class="status-placeholder">无需操作</span>
  94. </template>
  95. </div>
  96. <!-- 选中状态指示 -->
  97. <!-- <div v-if="item.selected" class="selected-indicator">
  98. <i class="fas fa-check" />
  99. </div> -->
  100. </div>
  101. </template>
  102. </div>
  103. </div>
  104. </main>
  105. <!-- 底部操作按钮 -->
  106. <div class="bottom-actions">
  107. <button class="submit-btn" @click="hasValidMaterials ? handleLeaveClick() : directExit()">
  108. {{ hasValidMaterials ? '闸机开门' : '直接出仓库' }}
  109. <span v-if="hasValidMaterials && selectedCount > 0">({{ selectedCount }})</span>
  110. </button>
  111. </div>
  112. <!-- Loading -->
  113. <div v-if="loading" class="loading-overlay">
  114. <div class="loading-dots">
  115. <div class="dot" />
  116. <div class="dot" />
  117. <div class="dot" />
  118. </div>
  119. <span class="loading-text">执行中...</span>
  120. </div>
  121. <!-- 直接出仓库确认弹窗 -->
  122. <div v-if="exitConfirmVisible" class="tech-modal-overlay" @click.self="exitConfirmVisible = false">
  123. <div class="tech-modal">
  124. <div class="modal-content-row">
  125. <div class="modal-text">
  126. <h3>请确认您要直接出仓库</h3>
  127. <p>系统检测到您未携带物料,或者未勾选任何物料,是否确认直接出仓库?</p>
  128. </div>
  129. <div class="modal-icon">
  130. <div class="icon-box">
  131. <i class="fas fa-clipboard-check" />
  132. </div>
  133. </div>
  134. </div>
  135. <div class="modal-footer">
  136. <button class="modal-btn cancel-btn" @click="directExit">直接出仓库</button>
  137. <button class="modal-btn confirm-btn" @click="exitConfirmVisible = false">取消</button>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. </dv-border-box-8>
  143. </template>
  144. <script setup>
  145. import { useRouter } from 'vue-router';
  146. import { ref, computed, onMounted, onUnmounted } from 'vue';
  147. import { showNotify } from 'vant';
  148. import { cfStockOut, createStockOut, cfStockOutLeave,leaveCFWarehouse } from '../api/stockOut.js';
  149. import { areArraysEqual } from '../common/utils.js';
  150. import { gateController } from '../hardware/GateOperate.js';
  151. // 图片资源
  152. import bgImg from '../assets/images/bj.png';
  153. // 路由
  154. const router = useRouter();
  155. // 操作的id
  156. const operationId = ref(null);
  157. // 返回主页
  158. const goHome = () => {
  159. router.push('/home');
  160. };
  161. // 表格加载状态
  162. const loading = ref(false);
  163. // 物料列表数据
  164. const materialList = ref([]);
  165. const epcs = ref([]);
  166. // 临时数组用于累积EPC数据
  167. const tempEpcs = ref([]);
  168. // 完成数量统计
  169. const completedCount = computed(() => {
  170. return materialList.value.filter(item => item.status === 1).length;
  171. });
  172. // 获取设备类型图标
  173. const getInventoryIcon = type => {
  174. const iconMap = {
  175. '工装': 'fas fa-cube',
  176. '设备': 'fas fa-cogs',
  177. '成品': 'fas fa-box',
  178. };
  179. return iconMap[type] || 'fas fa-cube';
  180. };
  181. // 获取状态颜色
  182. const getStatusColor = status => {
  183. const colorMap = {
  184. 1: '#10b981', // 完成 - 绿色
  185. 2: '#f59e0b', // 进行中 - 橙色
  186. 3: '#3b82f6', // 待开始 - 蓝色
  187. };
  188. return colorMap[status] || '#6b7280';
  189. };
  190. // 判断是否可以离开
  191. const isCanLeave = computed(() => {
  192. // 1. 先判断 materialList 是否存在且是数组
  193. if (!materialList.value || !Array.isArray(materialList.value)) {
  194. return false;
  195. }
  196. // 2. 判断是否有数据(空数组不能离开)
  197. if (materialList.value.length === 0) {
  198. return false;
  199. }
  200. // 3. 判断所有项的 status 是否都为 1
  201. // 使用 every 时需要确保 item 和 item.status 都存在
  202. return materialList.value.every(item => {
  203. return item && typeof item.status !== 'undefined' && item.status === 1;
  204. });
  205. });
  206. const unrecognizedCount = computed(() => {
  207. return materialList.value.filter(item => item.inventoryId == null).length;
  208. });
  209. // 选中数量统计
  210. const selectedCount = computed(() => {
  211. return materialList.value.filter(item => item.selected === true).length;
  212. });
  213. // 判断是否有有效物料(含有inventoryId)
  214. const hasValidMaterials = computed(() => {
  215. return materialList.value.length > 0 && materialList.value.some(item => item.inventoryId != null);
  216. });
  217. // 过滤出有效的物料项目(用于连续序号显示)
  218. const validMaterialList = computed(() => {
  219. return materialList.value.filter(item => item.inventoryId != null);
  220. });
  221. // 卡片选择处理
  222. const handleSelect = item => {
  223. // 不在库和未识别epc的卡片不可选中
  224. if (item.positionName === '不在库' || item.inventoryName === '未识别epc') {
  225. showNotify({ type: 'danger', message: '不在库或尚未借用的卡片不可选中' });
  226. return;
  227. }
  228. // 只有已借用状态(status === 1)的卡片才可被勾选
  229. if (item.status !== 1) {
  230. showNotify({ type: 'danger', message: '只有已借用状态的卡片才可被勾选' });
  231. return;
  232. }
  233. item.selected = !item.selected;
  234. };
  235. // 弹窗状态
  236. const exitConfirmVisible = ref(false);
  237. // 处理离开按钮点击
  238. const handleLeaveClick = () => {
  239. gateController('SHOTOPEN');
  240. router.push('/');
  241. // if (selectedCount.value === 0) {
  242. // exitConfirmVisible.value = true;
  243. // return;
  244. // }
  245. // handleLeave();
  246. };
  247. // 直接出仓库
  248. const directExit = () => {
  249. exitConfirmVisible.value = false;
  250. // 直接开门离开
  251. gateController('SHOTOPEN');
  252. router.push('/');
  253. };
  254. // 开始借用
  255. const handleStart = record => {
  256. operationId.value = record.inventoryId;
  257. generateCFStockOut(record.stockOutPrepareLineId);
  258. };
  259. // 借用
  260. const handleApply = async record => {
  261. showNotify({ type: 'success', message: '申请借用成功' });
  262. try {
  263. const res = await leaveCFWarehouse(record.inventoryId);
  264. if (res.errorCode === 0) {
  265. showNotify({ type: 'success', message: '申请借用成功' });
  266. operationId.value = record.inventoryId;
  267. if(res.data){
  268. materialList.value.forEach(item =>{
  269. if(item.inventoryId == res.data.inventoryId){
  270. // item.status = res.data.status;
  271. // item.stockOutId = res.data.stockOutId;
  272. // item.stockOutPrepareLineId = res.data.stockOutPrepareLineId;
  273. item.borrower = res.data.borrower;
  274. item.epc = res.data.epc;
  275. item.inventoryName = res.data.inventoryName;
  276. item.inventoryType = res.data.inventoryType;
  277. item.warehouseName = res.data.warehouseName;
  278. item.positionName = res.data.positionName;
  279. }
  280. });
  281. }
  282. } else {
  283. showNotify({ type: 'danger', message: res.errorMessage });
  284. }
  285. } catch (error) {
  286. console.error('申请借用API调用失败:', error);
  287. showNotify({ type: 'danger', message: '申请借用API调用失败' });
  288. } finally {
  289. loading.value = false;
  290. }
  291. };
  292. // 借用完成后离开
  293. const handleLeave = async () => {
  294. const params = [];
  295. materialList.value.map(item => {
  296. if(item.inventoryId != null && item.selected === true){
  297. params.push({
  298. stockOutPrepareLineId: item.stockOutPrepareLineId,
  299. stockOutId: item.stockOutId,
  300. inventoryId: item.inventoryId,
  301. });
  302. }
  303. });
  304. if(params.length == 0){
  305. // 直接开门离开
  306. gateController('SHOTOPEN');
  307. router.push('/');
  308. return;
  309. }
  310. loading.value = true;
  311. try {
  312. const res = await cfStockOutLeave(params);
  313. if (res.errorCode === 0) {
  314. gateController('SHOTOPEN');
  315. showNotify({ type: 'success', message: '借用离开成功' });
  316. router.push('/');
  317. } else {
  318. showNotify({ type: 'danger', message: res.errorMessage });
  319. }
  320. } catch (error) {
  321. console.error('借用离开API调用失败:', error);
  322. showNotify({ type: 'danger', message: '借用离开API调用失败' });
  323. } finally {
  324. loading.value = false;
  325. }
  326. };
  327. const resetView = () => {
  328. materialList.value = [];
  329. };
  330. // 获取扫描到的借用数据
  331. const getStockOutList = async () => {
  332. // loading.value = true;
  333. const params = {
  334. epcList: [],
  335. };
  336. const tempMaterialList = [];
  337. for(let i = 0; i < materialList.value.length; i++) {
  338. if(materialList.value[i].queryStatus === 0) {
  339. params.epcList.push(materialList.value[i].epc);
  340. materialList.value[i].queryStatus = 1;
  341. tempMaterialList.push(materialList.value[i]);
  342. }
  343. }
  344. if(params.epcList.length == 0){
  345. return;
  346. }
  347. try {
  348. const res = await cfStockOut(params);
  349. if (res.errorCode === 0) {
  350. if (res.datas && res.datas.length > 0) {
  351. res.datas.forEach(i => {
  352. materialList.value.forEach(j => {
  353. if (j.epc === i.epc) {
  354. j.stockOutId = i.stockOutId;
  355. j.inventoryName = i.inventoryName;
  356. j.inventoryNo = i.inventoryNo;
  357. j.inventoryType = i.inventoryType;
  358. j.borrower = i.borrower;
  359. j.warehouseName = i.warehouseName;
  360. j.positionName = i.positionName;
  361. j.stockOutPrepareNo = i.stockOutPrepareNo;
  362. j.stockOutNo = i.stockOutNo;
  363. j.inventoryId = i.inventoryId;
  364. j.stockOutPrepareLineId = i.stockOutPrepareLineId;
  365. j.queryStatus = 2;
  366. j.status = i.status;
  367. }
  368. });
  369. });
  370. }
  371. } else {
  372. showNotify({ type: 'danger', message: res.errorMessage });
  373. }
  374. } catch (error) {
  375. console.error('获取扫描到的借用数据API调用失败:', error);
  376. showNotify({ type: 'danger', message: '获取扫描到的借用数据API调用失败' });
  377. tempMaterialList.forEach(item => {
  378. item.queryStatus = 0;
  379. });
  380. } finally {
  381. loading.value = false;
  382. }
  383. };
  384. // 生成出库单
  385. const generateCFStockOut = async id => {
  386. loading.value = true;
  387. const params = [
  388. {
  389. stockOutPrepareLineId: id,
  390. deliveryMethod: 'Manual_Delivery',
  391. },
  392. ];
  393. try {
  394. const res = await createStockOut(params);
  395. if (res.errorCode === 0) {
  396. // getStockOutList();
  397. resetView();
  398. } else {
  399. showNotify({ type: 'danger', message: res.errorMessage });
  400. }
  401. } catch (error) {
  402. console.error('生成出库单API调用失败:', error);
  403. showNotify({ type: 'danger', message: '生成出库单API调用失败' });
  404. } finally {
  405. loading.value = false;
  406. }
  407. };
  408. let timer = null; // 用于保存当前定时器引用
  409. const addEpc = data => {
  410. const newEpcs = data.map(item => item.epc);
  411. // 将新的EPC数据添加到临时数组中,使用Set进行去重
  412. const uniqueEpcs = new Set([...newEpcs]);
  413. if(newEpcs != null && newEpcs.length > 0) {
  414. newEpcs.forEach(item => {
  415. let exist = false;
  416. for(let i =0; i < materialList.value.length; i++) {
  417. if(materialList.value[i].epc === item) {
  418. exist = true;
  419. break;
  420. }
  421. }
  422. if(exist == false) {
  423. materialList.value.push({
  424. epc: item,
  425. queryStatus: 0, // 0: 未查询, 1: 查询中, 2: 已查询, 3: 未查询到
  426. selected: false, // 初始化选中状态
  427. });
  428. }
  429. });
  430. }
  431. };
  432. onMounted(() => {
  433. plugin.gateConfig.sendEpc = function(data){
  434. if (typeof(GATE_CONFIG) == 'undefined') {
  435. console.log('设备不支持读写器功能。');
  436. } else {
  437. addEpc(data);
  438. }
  439. };
  440. // 创建全局唯一定时器,每2秒执行一次
  441. timer = setInterval(() => {
  442. getStockOutList();
  443. // addEpc([ { 'epc': 'EEE000000640804317955613' }, { 'epc': 'FFF000000000000000000001' },{ 'epc': 'AAA000000000000000000002' }]);
  444. }, 1000);
  445. });
  446. onUnmounted(() => {
  447. plugin.gateConfig.sendEpc = null;
  448. // 清除定时器
  449. if (timer) {
  450. clearInterval(timer);
  451. timer = null;
  452. }
  453. });
  454. </script>
  455. <style scoped>
  456. /* ========== 基础样式 ========== */
  457. .stock-requisition-page {
  458. width: 100%;
  459. height: 100vh;
  460. max-height: 100vh;
  461. position: relative;
  462. font-family: 'Microsoft YaHei', sans-serif;
  463. color: #fff;
  464. overflow: hidden;
  465. display: flex;
  466. flex-direction: column;
  467. }
  468. /* 背景层 */
  469. .bg-layer {
  470. position: fixed;
  471. top: 0;
  472. left: 0;
  473. width: 100%;
  474. height: 100%;
  475. background-color: #041c3d;
  476. background-size: cover;
  477. background-position: center;
  478. background-repeat: no-repeat;
  479. z-index: 0;
  480. }
  481. /* ========== 主内容区域 ========== */
  482. .main-content {
  483. flex: 1;
  484. display: flex;
  485. flex-direction: column;
  486. padding: 0 30px;
  487. position: relative;
  488. z-index: 10;
  489. min-height: 0;
  490. overflow: hidden;
  491. }
  492. /* 统计信息 */
  493. .stats-section {
  494. background: rgba(9, 61, 140, 0.5);
  495. border: 1px solid #049FD8;
  496. border-radius: 12px;
  497. padding: 15px 20px;
  498. margin-bottom: 15px;
  499. flex-shrink: 0;
  500. }
  501. .stats-text {
  502. color: #7ec8ff;
  503. font-size: 16px;
  504. }
  505. /* ========== 卡片网格区域 ========== */
  506. .card-grid-wrapper {
  507. flex: 1;
  508. display: flex;
  509. flex-direction: column;
  510. min-height: 0;
  511. overflow-y: auto;
  512. overflow-x: hidden;
  513. padding-bottom: 10px;
  514. scrollbar-width: none;
  515. -ms-overflow-style: none;
  516. }
  517. .card-grid-wrapper::-webkit-scrollbar {
  518. display: none;
  519. }
  520. /* 空状态 */
  521. .empty-state {
  522. flex: 1;
  523. display: flex;
  524. flex-direction: column;
  525. align-items: center;
  526. justify-content: center;
  527. color: #7ec8ff;
  528. padding: 60px 0;
  529. }
  530. .empty-icon {
  531. font-size: 80px;
  532. margin-bottom: 20px;
  533. opacity: 0.5;
  534. }
  535. .empty-state p {
  536. font-size: 18px;
  537. margin: 0;
  538. }
  539. /* 卡片网格 - 4列布局 */
  540. .card-grid {
  541. display: grid;
  542. grid-template-columns: repeat(4, 1fr);
  543. gap: 20px;
  544. }
  545. /* ========== 设备卡片样式 ========== */
  546. .inventory-card {
  547. background: rgba(5, 30, 60, 0.8);
  548. border: 2px solid #0d4a8a;
  549. border-radius: 12px;
  550. overflow: hidden;
  551. transition: all 0.3s ease;
  552. position: relative;
  553. }
  554. .inventory-card:hover {
  555. border-color: #1e90ff;
  556. box-shadow: 0 0 20px rgba(30, 144, 255, 0.3);
  557. transform: translateY(-3px);
  558. }
  559. .inventory-card.completed {
  560. border-color: #10b981;
  561. box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
  562. }
  563. .inventory-card.warning {
  564. border-color: #fbbf24 !important;
  565. box-shadow: 0 0 15px rgba(251, 191, 36, 0.4) !important;
  566. }
  567. .inventory-card.selected {
  568. border-color: #fbbf24;
  569. box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
  570. background: rgba(251, 191, 36, 0.1);
  571. }
  572. /* 选中状态指示 - 右上角 */
  573. .selected-indicator {
  574. position: absolute;
  575. top: 10px;
  576. right: 10px;
  577. width: 28px;
  578. height: 28px;
  579. background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  580. border-radius: 50%;
  581. display: flex;
  582. align-items: center;
  583. justify-content: center;
  584. color: white;
  585. font-size: 12px;
  586. font-weight: bold;
  587. box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
  588. z-index: 10;
  589. }
  590. /* 卡片序号 - 左上角 */
  591. .card-index {
  592. position: absolute;
  593. top: 10px;
  594. left: 10px;
  595. width: 36px;
  596. height: 36px;
  597. background: linear-gradient(135deg, #1e90ff 0%, #00bfff 100%);
  598. border-radius: 50%;
  599. display: flex;
  600. align-items: center;
  601. justify-content: center;
  602. font-size: 16px;
  603. font-weight: bold;
  604. color: #fff;
  605. z-index: 2;
  606. box-shadow: 0 2px 8px rgba(0, 191, 255, 0.4);
  607. }
  608. .card-index.completed {
  609. /* background: linear-gradient(135deg, #10b981 0%, #34d399 100%); */
  610. box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
  611. }
  612. /* 类型图标样式 */
  613. .type-icon {
  614. color: #fbbf24;
  615. margin-left: 8px;
  616. font-size: 16px;
  617. }
  618. /* 不可选择的卡片 - 红色边框 */
  619. .inventory-card.not-selectable {
  620. border-color: #ef4444 !important;
  621. box-shadow: 0 0 15px rgba(239, 68, 68, 0.3) !important;
  622. cursor: not-allowed;
  623. }
  624. .inventory-card.not-selectable:hover {
  625. border-color: #dc2626 !important;
  626. box-shadow: 0 0 20px rgba(220, 38, 38, 0.4) !important;
  627. transform: none;
  628. }
  629. /* 借用人信息样式 */
  630. .borrower-info {
  631. display: flex;
  632. flex-direction: column;
  633. gap: 8px;
  634. padding: 8px 0;
  635. min-height: 48px; /* 确保与按钮区域高度一致 */
  636. }
  637. .borrower-row {
  638. display: flex;
  639. align-items: center;
  640. font-size: 14px;
  641. border-bottom: 1px solid rgba(126, 200, 255, 0.2) !important;
  642. }
  643. .borrower-label {
  644. color: #7ec8ff;
  645. white-space: nowrap;
  646. margin-right: 5px;
  647. }
  648. .borrower-value {
  649. color: #fff;
  650. flex: 1;
  651. }
  652. /* 信息区域 */
  653. .card-info {
  654. padding: 50px 15px 15px;
  655. }
  656. .info-row {
  657. display: flex;
  658. align-items: center;
  659. padding: 6px 0; /* 增加内容块高度 */
  660. font-size: 14px;
  661. min-height: 28px; /* 增加最小高度 */
  662. border-bottom: 1px solid rgba(126, 200, 255, 0.2); /* 添加分割线 */
  663. margin-bottom: 0;
  664. }
  665. .info-row:last-child {
  666. border-bottom: none; /* 最后一行不显示分割线 */
  667. }
  668. .info-label {
  669. color: #7ec8ff;
  670. white-space: nowrap;
  671. margin-right: 5px;
  672. }
  673. .info-value {
  674. color: #fff;
  675. flex: 1;
  676. overflow: hidden;
  677. text-overflow: ellipsis;
  678. white-space: nowrap;
  679. }
  680. /* 位置行样式 */
  681. .location-row {
  682. display: flex;
  683. align-items: center;
  684. margin-top: 4px;
  685. /* padding-top: 4px; */
  686. /* border-top: 1px solid rgba(30, 144, 255, 0.2); */
  687. border-bottom: 1px solid rgba(30, 144, 255, 0.2) !important;
  688. }
  689. .location-icon {
  690. color: #00bfff;
  691. font-size: 12px;
  692. margin-right: 6px;
  693. }
  694. /* ========== 操作区域(固定高度) ========== */
  695. .card-action-section {
  696. padding: 8px 15px;
  697. min-height: 48px;
  698. display: flex;
  699. align-items: center;
  700. justify-content: center;
  701. /* 移除边框和背景色差异,与无需操作区域保持一致 */
  702. }
  703. .status-placeholder {
  704. color: #5a8abf;
  705. font-size: 14px;
  706. opacity: 0.8;
  707. margin-top: -10px;
  708. }
  709. /* 状态按钮 */
  710. .status-btn {
  711. width: 100%;
  712. padding: 10px 15px;
  713. border-radius: 6px;
  714. font-size: 13px;
  715. font-weight: 500;
  716. cursor: pointer;
  717. transition: all 0.3s;
  718. border: none;
  719. display: flex;
  720. align-items: center;
  721. justify-content: center;
  722. gap: 6px;
  723. }
  724. .completed-btn {
  725. background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  726. color: #fff;
  727. opacity: 0.7;
  728. cursor: not-allowed;
  729. }
  730. .start-btn {
  731. background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
  732. color: #fff;
  733. }
  734. .start-btn:hover {
  735. box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
  736. }
  737. .apply-btn {
  738. background: linear-gradient(90deg, #1e90ff 0%, #00bfff 100%);
  739. color: #fff;
  740. }
  741. .apply-btn:hover {
  742. box-shadow: 0 0 15px rgba(30, 144, 255, 0.5);
  743. }
  744. .in-stock-btn {
  745. background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  746. color: #fff;
  747. opacity: 0.8;
  748. cursor: default;
  749. }
  750. /* 状态徽章样式 */
  751. .status-badge {
  752. padding: 8px 20px;
  753. border-radius: 20px;
  754. font-size: 13px;
  755. font-weight: 500;
  756. display: flex;
  757. align-items: center;
  758. gap: 6px;
  759. }
  760. .borrowed-badge {
  761. background: rgba(239, 68, 68, 0.3);
  762. border: 1px solid #ef4444;
  763. color: #fca5a5;
  764. margin-top: -10px;
  765. }
  766. /* ========== 底部操作按钮 ========== */
  767. .bottom-actions {
  768. width: 100%;
  769. padding: 15px 30px;
  770. box-sizing: border-box;
  771. background: rgba(4, 28, 61, 0.95);
  772. z-index: 20;
  773. flex-shrink: 0;
  774. }
  775. .submit-btn {
  776. width: 100%;
  777. padding: 18px 0;
  778. background: #4a99e2;
  779. border: none;
  780. border-radius: 12px;
  781. font-size: 24px;
  782. font-weight: bold;
  783. color: #fff;
  784. cursor: pointer;
  785. transition: all 0.3s;
  786. letter-spacing: 8px;
  787. text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  788. }
  789. .submit-btn:hover:not(:disabled) {
  790. box-shadow: 0 0 30px rgba(16, 185, 129, 0.6);
  791. transform: translateY(-2px);
  792. }
  793. .submit-btn:disabled {
  794. opacity: 0.5;
  795. cursor: not-allowed;
  796. background: linear-gradient(90deg, #6b7280 0%, #9ca3af 100%);
  797. }
  798. /* ========== 响应式 - 横屏 ========== */
  799. @media screen and (orientation: landscape) {
  800. .header-section {
  801. padding: 30px 20px 10px 20px;
  802. }
  803. .page-title {
  804. font-size: 22px;
  805. }
  806. .logout-btn {
  807. padding: 6px 14px;
  808. font-size: 13px;
  809. left: 20px;
  810. }
  811. .logout-btn i {
  812. font-size: 14px;
  813. }
  814. .header-actions {
  815. right: 20px;
  816. }
  817. .action-btn {
  818. padding: 6px 14px;
  819. font-size: 13px;
  820. }
  821. .action-btn i {
  822. font-size: 14px;
  823. }
  824. .main-content {
  825. padding: 0 20px;
  826. }
  827. .stats-section {
  828. padding: 10px 15px;
  829. margin-bottom: 10px;
  830. }
  831. .stats-text {
  832. font-size: 14px;
  833. }
  834. /* 卡片网格响应式 */
  835. .card-grid {
  836. grid-template-columns: repeat(6, 1fr);
  837. gap: 15px;
  838. }
  839. .card-index {
  840. width: 24px;
  841. height: 24px;
  842. font-size: 11px;
  843. top: 6px;
  844. left: 6px;
  845. }
  846. .card-image {
  847. margin: 10px;
  848. margin-bottom: 8px;
  849. width: calc(100% - 20px);
  850. }
  851. .image-placeholder {
  852. font-size: 36px;
  853. }
  854. .card-info {
  855. padding: 32px 10px 8px;
  856. }
  857. .info-row {
  858. font-size: 11px;
  859. margin-bottom: 3px;
  860. }
  861. .location-icon {
  862. font-size: 10px;
  863. }
  864. .card-action-section {
  865. padding: 8px 10px;
  866. min-height: 40px;
  867. }
  868. .status-btn {
  869. padding: 10px;
  870. font-size: 11px;
  871. gap: 4px;
  872. }
  873. .status-placeholder {
  874. font-size: 14px;
  875. }
  876. .bottom-actions {
  877. padding: 10px 20px;
  878. }
  879. .submit-btn {
  880. padding: 12px 0;
  881. font-size: 18px;
  882. letter-spacing: 6px;
  883. border-radius: 8px;
  884. }
  885. }
  886. </style>