You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1325 lines
32 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <div class="pda-container">
  3. <!-- 头部栏 -->
  4. <div class="header-bar">
  5. <div class="header-left" @click="$router.back()">
  6. <i class="el-icon-arrow-left"></i>
  7. <span>销售出库</span>
  8. </div>
  9. <div class="header-right" @click="$router.push({ path: '/' })">
  10. 首页
  11. </div>
  12. </div>
  13. <!-- 搜索框 -->
  14. <div class="search-container">
  15. <el-input clearable class="compact-input"
  16. v-model="scanCode"
  17. placeholder="请扫描标签条码"
  18. prefix-icon="el-icon-search"
  19. @keyup.enter.native="handleScan"
  20. ref="scanInput"
  21. />
  22. <div class="mode-switch">
  23. <el-switch
  24. class="custom-switch"
  25. v-model="isRemoveMode"
  26. active-color="#ff4949"
  27. inactive-color="#13ce66">
  28. </el-switch>
  29. <span v-if="isRemoveMode" class="switch-text">{{ '移除' }}</span>
  30. <span v-else class="switch-text2">{{ '添加' }}</span>
  31. </div>
  32. </div>
  33. <!-- 出库单信息卡片 -->
  34. <div class="material-info-card" v-if="outboundInfo.outboundNo">
  35. <div class="card-header">
  36. <div class="card-title-group">
  37. <span class="title-label">出库单号</span>
  38. <span class="title-value">{{ outboundInfo.outboundNo }}</span>
  39. </div>
  40. </div>
  41. <div class="card-body">
  42. <div class="info-row">
  43. <div class="info-item">
  44. <span class="info-label">关联单号:</span>
  45. <span class="info-value">{{ outboundInfo.relatedNo || '-' }}</span>
  46. </div>
  47. <div class="info-item">
  48. <span class="info-label">关联行号:</span>
  49. <span class="info-value highlight">{{ outboundInfo.relatedLineNo || '-' }}</span>
  50. </div>
  51. </div>
  52. <div class="stats-row">
  53. <div class="stat-item">
  54. <div class="stat-label">标签张数</div>
  55. <div class="stat-value">
  56. <span class="qualified">{{ outboundInfo.availableLabels }}</span>
  57. <span class="separator">/</span>
  58. <span class="total">{{ outboundInfo.totalLabels }}</span>
  59. </div>
  60. </div>
  61. <div class="stat-item">
  62. <div class="stat-label">物料总数</div>
  63. <div class="stat-value">
  64. <span class="qualified">{{ outboundInfo.availableQty }}</span>
  65. <span class="separator">/</span>
  66. <span class="total">{{ outboundInfo.totalQty }}</span>
  67. </div>
  68. </div>
  69. <div class="stat-item">
  70. <div class="stat-label">创建日期</div>
  71. <div class="stat-value single">{{ formatDate(outboundInfo.createDate) }}</div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <!-- 出库信息确认标题 -->
  77. <div class="section-title">
  78. <div class="title-left">
  79. <i class="el-icon-circle-check"></i>
  80. <span>出库信息确认</span>
  81. </div>
  82. <div class="title-right">
  83. <span class="material-list-link" @click="showMaterialListDialog">物料清单</span>
  84. </div>
  85. </div>
  86. <!-- 标签列表 -->
  87. <div class="label-list">
  88. <div class="list-header">
  89. <div class="col-no">NO.</div>
  90. <div class="col-label">标签条码</div>
  91. <div class="col-part">物料编码</div>
  92. <div class="col-qty">标签数量</div>
  93. </div>
  94. <div class="list-body">
  95. <div
  96. v-for="(label, index) in labelList"
  97. :key="label.id"
  98. class="list-item"
  99. >
  100. <div class="col-no">{{ labelList.length - index }}</div>
  101. <div class="col-label">{{ label.labelCode }}</div>
  102. <div class="col-part">{{ label.partNo }}</div>
  103. <div class="col-qty">{{ label.quantity }}</div>
  104. </div>
  105. <!-- 空状态 -->
  106. <div v-if="labelList.length === 0" class="empty-labels">
  107. <p>暂无扫描标签</p>
  108. </div>
  109. </div>
  110. </div>
  111. <!-- 底部操作按钮 -->
  112. <div class="bottom-actions">
  113. <button class="action-btn secondary" @click="confirmOutbound">
  114. 确定
  115. </button>
  116. <button class="action-btn secondary" style="margin-left: 10px;" @click="printLabels">
  117. 打印
  118. </button>
  119. <button class="action-btn secondary" style="margin-left: 10px;" @click="cancelOutbound">
  120. 取消
  121. </button>
  122. </div>
  123. <!-- 物料清单弹窗 -->
  124. <div v-if="showMaterialDialog" class="material-overlay">
  125. <div class="material-modal">
  126. <div class="modal-header">
  127. <span class="modal-title">物料清单</span>
  128. <i class="el-icon-close close-btn" @click="closeMaterialDialog"></i>
  129. </div>
  130. <div class="modal-body">
  131. <!-- 加载状态 -->
  132. <div v-if="materialListLoading" class="loading-container">
  133. <i class="el-icon-loading"></i>
  134. <span>加载中...</span>
  135. </div>
  136. <!-- 物料表格 -->
  137. <div v-else-if="materialList.length > 0" class="material-table">
  138. <div class="table-header">
  139. <div class="col-no">NO.</div>
  140. <div class="col-material-code">物料编码</div>
  141. <div class="col-part-name">物料名称</div>
  142. <div class="col-required-qty">需求数量</div>
  143. <div class="col-available-qty">出库数量</div>
  144. <div class="col-scans-qty">扫描数量</div>
  145. </div>
  146. <div class="table-body">
  147. <div
  148. v-for="(item, index) in materialList"
  149. :key="index"
  150. class="table-row"
  151. >
  152. <div class="col-no">{{ index + 1 }}</div>
  153. <div class="col-material-code clickable-part" @click="showStockDialogFn(item)">{{ item.materialCode || item.partNo }}</div>
  154. <div class="col-part-name">
  155. <span class="part-name-text" @click.stop="showPartNameTip(item.materialName, $event)">{{ item.materialName || '-' }}</span>
  156. </div>
  157. <div class="col-required-qty">{{ item.requiredQty || 0 }}</div>
  158. <div class="col-available-qty">{{ item.pickedQty || 0 }}</div>
  159. <div class="col-scans-qty">{{ item.scansQty || 0 }}</div>
  160. </div>
  161. </div>
  162. </div>
  163. <!-- 空数据状态 -->
  164. <div v-else class="empty-material">
  165. <i class="el-icon-document"></i>
  166. <p>暂无物料数据</p>
  167. </div>
  168. </div>
  169. <div class="modal-footer">
  170. <button class="btn-close" @click="closeMaterialDialog">关闭</button>
  171. </div>
  172. </div>
  173. <!-- 物料名称提示框 -->
  174. <div v-if="showPartNameTooltip" class="part-name-tooltip" :style="tooltipStyle" @click.stop>
  175. <div class="tooltip-content">{{ currentPartName }}</div>
  176. </div>
  177. </div>
  178. <!-- 可用库存弹窗 -->
  179. <div v-if="showStockDialog" class="stock-overlay">
  180. <div class="stock-modal">
  181. <div class="modal-header">
  182. <span class="modal-title">可用库存 - {{ currentPartNo }}</span>
  183. <i class="el-icon-close close-btn" @click="closeStockDialog"></i>
  184. </div>
  185. <div class="modal-body">
  186. <div v-if="stockLoading" class="loading-container"><i class="el-icon-loading"></i><span>加载中...</span></div>
  187. <div v-else-if="stockList.length > 0" class="stock-table">
  188. <div class="table-header">
  189. <div class="col-roll-no">标签条码</div>
  190. <div class="col-qty">数量</div>
  191. <div class="col-location">库位</div>
  192. <div class="col-batch">合约号码</div>
  193. <div class="col-date">入库天数</div>
  194. </div>
  195. <div class="table-body">
  196. <div v-for="(item, index) in stockList" :key="index" class="table-row">
  197. <div class="col-roll-no">{{ item.rollNo }}</div>
  198. <div class="col-qty">{{ item.rollQty }} <span class="unit-text">{{ item.um }}</span></div>
  199. <div class="col-location">{{ item.location }}</div>
  200. <div class="col-batch">{{ item.batchNo }}</div>
  201. <div class="col-date">{{ item.daysInStock }}</div>
  202. </div>
  203. </div>
  204. </div>
  205. <div v-else class="empty-stock"><i class="el-icon-box"></i><p>暂无可用库存</p></div>
  206. </div>
  207. <div class="modal-footer"><button class="btn-close" @click="closeStockDialog">关闭</button></div>
  208. </div>
  209. </div>
  210. </div>
  211. </template>
  212. <script>
  213. import { getOutboundDetails, validateLabelWithOutbound, confirmSalesOutbound, getMaterialList, getScannedLabelList } from "@/api/sales/sales-outbound.js";
  214. import { getInventoryStock } from "@/api/inbound.js";
  215. import { getCurrentWarehouse } from '@/utils'
  216. import moment from 'moment';
  217. export default {
  218. data() {
  219. return {
  220. scanCode: '',
  221. outboundInfo: {},
  222. labelList: [],
  223. outboundNo: '',
  224. relatedNo: '',
  225. relatedLineNo: '',
  226. showMaterialDialog: false,
  227. materialList: [],
  228. materialListLoading: false,
  229. isRemoveMode: false, // 默认为添加模式
  230. showStockDialog: false,
  231. stockList: [],
  232. stockLoading: false,
  233. currentPartNo: '',
  234. // 物料名称提示框相关
  235. showPartNameTooltip: false,
  236. currentPartName: '',
  237. tooltipStyle: { top: '0px', left: '0px' }
  238. };
  239. },
  240. methods: {
  241. formatDate(date) {
  242. return date ? moment(date).format('YYYY-MM-DD') : '';
  243. },
  244. // 处理扫描
  245. handleScan() {
  246. if (!this.scanCode.trim()) {
  247. return;
  248. }
  249. if (this.isRemoveMode) {
  250. this.removeLabelByCode(this.scanCode.trim());
  251. } else {
  252. this.validateAndAddLabel(this.scanCode.trim());
  253. }
  254. this.scanCode = '';
  255. },
  256. // 验证标签并添加到列表(调用存储过程)
  257. validateAndAddLabel(labelCode) {
  258. const params = {
  259. labelCode: labelCode,
  260. outboundNo: this.outboundNo,
  261. relatedNo: this.relatedNo,
  262. relatedLineNo: this.relatedLineNo,
  263. site: localStorage.getItem('site'),
  264. buNo: this.buNo,
  265. operationType: 'I', // 添加标签
  266. warehouseId: getCurrentWarehouse() // 当前仓库
  267. };
  268. validateLabelWithOutbound(params).then(({ data }) => {
  269. if (data && data.code === 0) {
  270. this.$message.success('标签添加成功');
  271. // 重新加载已扫描标签列表
  272. this.loadScannedLabelList();
  273. } else {
  274. this.$message.error(data.msg || '该标签与出库单不符,请检查');
  275. }
  276. }).catch(error => {
  277. console.error('标签验证失败:', error);
  278. this.$message.error('操作失败');
  279. });
  280. },
  281. // 通过条码移除标签(调用存储过程)
  282. removeLabelByCode(labelCode) {
  283. const params = {
  284. labelCode: labelCode,
  285. outboundNo: this.outboundNo,
  286. relatedNo: this.relatedNo,
  287. relatedLineNo: this.relatedLineNo,
  288. site: localStorage.getItem('site'),
  289. buNo: this.buNo,
  290. operationType: 'D', // 移除标签
  291. warehouseId: getCurrentWarehouse() // 当前仓库
  292. };
  293. validateLabelWithOutbound(params).then(({ data }) => {
  294. if (data && data.code === 0) {
  295. this.$message.success('标签移除成功');
  296. // 重新加载已扫描标签列表
  297. this.loadScannedLabelList();
  298. } else {
  299. this.$message.error(data.msg || '移除失败');
  300. }
  301. }).catch(error => {
  302. console.error('标签移除失败:', error);
  303. this.$message.error('移除失败');
  304. });
  305. },
  306. // 确认出库(调用存储过程)
  307. confirmOutbound() {
  308. if (this.labelList.length === 0) {
  309. this.$message.warning('请先扫描标签');
  310. return;
  311. }
  312. // 获取库位(使用第一个标签的库位,如果有的话)
  313. const locationCode = this.labelList.length > 0 && this.labelList[0].locationId
  314. ? this.labelList[0].locationId
  315. : '';
  316. const params = {
  317. site: this.outboundInfo.site,
  318. buNo: this.outboundInfo.buNo,
  319. outboundNo: this.outboundNo,
  320. relatedNo: this.relatedNo,
  321. relatedLineNo: this.relatedLineNo,
  322. locationCode: locationCode
  323. };
  324. confirmSalesOutbound(params).then(({ data }) => {
  325. if (data && data.code === 0) {
  326. this.$message.success('出库成功');
  327. this.$router.back();
  328. } else {
  329. this.$message.error(data.msg || '出库失败');
  330. }
  331. }).catch(error => {
  332. console.error('出库失败:', error);
  333. this.$message.error('出库失败');
  334. });
  335. },
  336. // 打印标签
  337. printLabels() {
  338. if (this.labelList.length === 0) {
  339. this.$message.warning('暂无标签可打印');
  340. return;
  341. }
  342. this.$message.warning('打印功能开发中...');
  343. },
  344. // 取消出库
  345. cancelOutbound() {
  346. if (this.labelList.length > 0) {
  347. this.$confirm('取消后将清空已扫描的标签,确定取消吗?', '提示', {
  348. confirmButtonText: '确定',
  349. cancelButtonText: '继续操作',
  350. type: 'warning'
  351. }).then(() => {
  352. this.$router.back();
  353. }).catch(() => {
  354. // 用户选择继续操作
  355. });
  356. } else {
  357. this.$router.back();
  358. }
  359. },
  360. // 显示物料清单弹窗
  361. showMaterialListDialog() {
  362. this.showMaterialDialog = true;
  363. this.loadMaterialList();
  364. },
  365. // 加载物料清单
  366. loadMaterialList() {
  367. if (!this.outboundInfo.site || !this.outboundInfo.buNo || !this.outboundNo) {
  368. this.$message.error('缺少必要参数,无法获取物料清单');
  369. return;
  370. }
  371. this.materialListLoading = true;
  372. const params = {
  373. site: this.outboundInfo.site,
  374. buNo: this.outboundInfo.buNo,
  375. outboundNo: this.outboundNo,
  376. warehouseId: getCurrentWarehouse() // 当前仓库
  377. };
  378. getMaterialList(params).then(({ data }) => {
  379. this.materialListLoading = false;
  380. if (data && data.code === 0) {
  381. this.materialList = data.data || [];
  382. } else {
  383. this.$message.error(data.msg || '获取物料清单失败');
  384. this.materialList = [];
  385. }
  386. }).catch(error => {
  387. this.materialListLoading = false;
  388. console.error('获取物料清单失败:', error);
  389. this.$message.error('获取物料清单失败');
  390. this.materialList = [];
  391. });
  392. },
  393. // 关闭物料清单弹窗
  394. closeMaterialDialog() {
  395. this.showMaterialDialog = false;
  396. this.hidePartNameTip();
  397. },
  398. // 显示物料名称提示框
  399. showPartNameTip(partName, event) {
  400. if (!partName || partName === '-') return;
  401. const rect = event.target.getBoundingClientRect();
  402. this.tooltipStyle = { top: (rect.top - 5) + 'px', left: rect.left + 'px' };
  403. this.currentPartName = partName;
  404. this.showPartNameTooltip = true;
  405. setTimeout(() => { document.addEventListener('click', this.hidePartNameTip); }, 0);
  406. },
  407. // 隐藏物料名称提示框
  408. hidePartNameTip() {
  409. this.showPartNameTooltip = false;
  410. this.currentPartName = '';
  411. document.removeEventListener('click', this.hidePartNameTip);
  412. },
  413. showStockDialogFn(item) {
  414. this.currentPartNo = item.materialCode || item.partNo;
  415. this.showStockDialog = true;
  416. this.loadInventoryStock(this.currentPartNo);
  417. },
  418. loadInventoryStock(partNo) {
  419. this.stockLoading = true;
  420. const params = {
  421. site: this.outboundInfo.site,
  422. notifyNo: this.outboundNo,
  423. notifyType: '销售出库',
  424. orderNo: '',
  425. orderLineNo: '',
  426. partNo: partNo,
  427. warehouseId: localStorage.getItem('warehouseId') || ''
  428. };
  429. getInventoryStock(params).then(({ data }) => {
  430. this.stockLoading = false;
  431. if (data && data.code === 0) { this.stockList = data.data || []; }
  432. else { this.$message.error(data.msg || '获取可用库存失败'); this.stockList = []; }
  433. }).catch(error => { this.stockLoading = false; this.$message.error('获取可用库存失败'); this.stockList = []; });
  434. },
  435. closeStockDialog() {
  436. this.showStockDialog = false;
  437. this.stockList = [];
  438. this.currentPartNo = '';
  439. },
  440. // 加载出库单详情
  441. loadOutboundDetails() {
  442. const params = {
  443. outboundNo: this.outboundNo,
  444. buNo: this.buNo,
  445. warehouseId: getCurrentWarehouse(),
  446. site: localStorage.getItem('site'),
  447. };
  448. getOutboundDetails(params).then(({ data }) => {
  449. if (data && data.code === 0) {
  450. this.outboundInfo = data.data;
  451. // 从出库单详情中获取关联单号和关联单行号
  452. if (data.data.relatedNo) {
  453. this.relatedNo = data.data.relatedNo;
  454. }
  455. if (data.data.relatedLineNo) {
  456. this.relatedLineNo = data.data.relatedLineNo;
  457. }
  458. // 加载已扫描的标签列表
  459. this.loadScannedLabelList();
  460. } else {
  461. this.$message.error(data.msg || '获取出库单详情失败');
  462. }
  463. }).catch(error => {
  464. console.error('获取出库单详情失败:', error);
  465. this.$message.error('获取出库单详情失败');
  466. });
  467. },
  468. // 加载已扫描标签列表(从临时表)
  469. loadScannedLabelList() {
  470. const params = {
  471. site: localStorage.getItem('site'),
  472. buNo: this.buNo,
  473. outboundNo: this.outboundNo,
  474. relatedNo: this.relatedNo,
  475. relatedLineNo: this.relatedLineNo
  476. };
  477. getScannedLabelList(params).then(({ data }) => {
  478. if (data && data.code === 0) {
  479. this.labelList = (data.data || []).map(item => ({
  480. id: Date.now() + Math.random(),
  481. labelCode: item.labelCode || item.RollNo,
  482. partNo: item.partNo || item.part_no,
  483. quantity: item.quantity || item.RollQty,
  484. batchNo: item.batchNo || '',
  485. locationId: item.locationId || ''
  486. }));
  487. } else {
  488. console.error('获取已扫描标签列表失败:', data.msg);
  489. this.labelList = [];
  490. }
  491. }).catch(error => {
  492. console.error('获取已扫描标签列表失败:', error);
  493. this.labelList = [];
  494. });
  495. }
  496. },
  497. mounted() {
  498. // 获取路由参数
  499. this.outboundNo = this.$route.params.outboundNo;
  500. this.buNo = this.$route.params.buNo;
  501. if (!this.outboundNo || !this.buNo) {
  502. this.$message.error('参数错误');
  503. this.$router.back();
  504. return;
  505. }
  506. // 聚焦扫描框
  507. this.$nextTick(() => {
  508. if (this.$refs.scanInput) {
  509. this.$refs.scanInput.focus();
  510. }
  511. });
  512. // 加载出库单详情
  513. this.loadOutboundDetails();
  514. }
  515. };
  516. </script>
  517. <style scoped>
  518. /* 复用生产入库的样式,保持一致性 */
  519. .pda-container {
  520. width: 100vw;
  521. height: 100vh;
  522. display: flex;
  523. flex-direction: column;
  524. background: #f5f5f5;
  525. }
  526. /* 头部栏 */
  527. .header-bar {
  528. display: flex;
  529. justify-content: space-between;
  530. align-items: center;
  531. padding: 8px 16px;
  532. background: #17B3A3;
  533. color: white;
  534. height: 40px;
  535. min-height: 40px;
  536. }
  537. .header-left {
  538. display: flex;
  539. align-items: center;
  540. cursor: pointer;
  541. font-size: 16px;
  542. font-weight: 500;
  543. }
  544. .header-left i {
  545. margin-right: 8px;
  546. font-size: 18px;
  547. }
  548. .header-right {
  549. cursor: pointer;
  550. font-size: 16px;
  551. font-weight: 500;
  552. }
  553. /* 搜索容器 */
  554. .search-container {
  555. padding: 12px 16px;
  556. background: white;
  557. display: flex;
  558. align-items: center;
  559. gap: 12px;
  560. }
  561. .search-container .el-input {
  562. width: 240px;
  563. margin-right: 12px;
  564. }
  565. /* 紧凑型输入框样式 */
  566. .compact-input ::v-deep .el-input__inner {
  567. height: 36px;
  568. padding: 0 12px 0 35px;
  569. font-size: 14px;
  570. }
  571. .compact-input ::v-deep .el-input__prefix {
  572. left: 10px;
  573. }
  574. .compact-input ::v-deep .el-input__suffix {
  575. right: 30px;
  576. }
  577. /* 模式切换开关 */
  578. .mode-switch {
  579. position: relative;
  580. display: inline-block;
  581. }
  582. .custom-switch {
  583. transform: scale(1.3);
  584. }
  585. /* 中间文字 */
  586. .switch-text {
  587. position: absolute;
  588. left: 25%;
  589. transform: translateX(-50%);
  590. top: 50%;
  591. transform: translateY(-50%) translateX(-50%);
  592. font-size: 12px;
  593. font-weight: 500;
  594. color: #606266;
  595. white-space: nowrap;
  596. pointer-events: none;
  597. z-index: 1;
  598. top: 53%;
  599. transform: translate(-50%, -50%);
  600. font-size: 12px;
  601. font-weight: bold;
  602. color: white;
  603. pointer-events: none;
  604. z-index: 2;
  605. }
  606. .switch-text2 {
  607. position: absolute;
  608. left: 75%;
  609. transform: translateX(-50%);
  610. top: 50%;
  611. transform: translateY(-50%) translateX(-50%);
  612. font-size: 12px;
  613. font-weight: 500;
  614. color: #606266;
  615. white-space: nowrap;
  616. pointer-events: none;
  617. z-index: 1;
  618. top: 53%;
  619. transform: translate(-50%, -50%);
  620. font-size: 12px;
  621. font-weight: bold;
  622. color: white;
  623. pointer-events: none;
  624. z-index: 2;
  625. }
  626. /* 调整 switch 尺寸以便容纳文字 */
  627. .custom-switch ::v-deep .el-switch__core {
  628. width: 60px;
  629. height: 28px;
  630. }
  631. /* 物料信息卡片 */
  632. .material-info-card {
  633. background: white;
  634. margin: 4px 16px;
  635. border-radius: 12px;
  636. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  637. border: 1px solid #f0f0f0;
  638. overflow: hidden;
  639. }
  640. /* 卡片头部 */
  641. .card-header {
  642. background: white;
  643. padding: 10px 16px;
  644. border-bottom: 1px solid #e8e8e8;
  645. }
  646. .card-title-group {
  647. display: flex;
  648. flex-direction: column;
  649. gap: 3px;
  650. }
  651. .title-label {
  652. font-size: 11px;
  653. color: #999;
  654. font-weight: normal;
  655. }
  656. .title-value {
  657. font-size: 16px;
  658. font-weight: bold;
  659. color: #333;
  660. line-height: 1.2;
  661. letter-spacing: 0.5px;
  662. }
  663. /* 卡片主体 */
  664. .card-body {
  665. padding: 12px 16px;
  666. }
  667. /* 信息行(关联单号和行号) */
  668. .info-row {
  669. display: flex;
  670. gap: 12px;
  671. margin-bottom: 10px;
  672. padding-bottom: 10px;
  673. border-bottom: 1px dashed #e8e8e8;
  674. }
  675. .info-item {
  676. flex: 1;
  677. display: flex;
  678. align-items: center;
  679. gap: 6px;
  680. }
  681. .info-label {
  682. font-size: 11px;
  683. color: #666;
  684. font-weight: 500;
  685. white-space: nowrap;
  686. }
  687. .info-value {
  688. font-size: 12px;
  689. color: #333;
  690. font-weight: 600;
  691. overflow: hidden;
  692. text-overflow: ellipsis;
  693. white-space: nowrap;
  694. }
  695. .info-value.highlight {
  696. color: #333;
  697. font-weight: 600;
  698. }
  699. /* 统计数据行 */
  700. .stats-row {
  701. display: flex;
  702. justify-content: space-between;
  703. gap: 6px;
  704. }
  705. .stat-item {
  706. flex: 1;
  707. text-align: center;
  708. padding: 6px 4px;
  709. background: white;
  710. border-radius: 6px;
  711. }
  712. .stat-label {
  713. font-size: 10px;
  714. color: #666;
  715. margin-bottom: 4px;
  716. font-weight: normal;
  717. }
  718. .stat-value {
  719. font-size: 12px;
  720. color: #333;
  721. font-weight: 600;
  722. line-height: 1.3;
  723. }
  724. .stat-value.single {
  725. color: #666;
  726. }
  727. .stat-value .qualified {
  728. color: #333;
  729. font-weight: 700;
  730. }
  731. .stat-value .total {
  732. color: #666;
  733. font-weight: 500;
  734. }
  735. .stat-value .separator {
  736. color: #ccc;
  737. margin: 0 2px;
  738. }
  739. /* 区域标题 */
  740. .section-title {
  741. display: flex;
  742. align-items: center;
  743. justify-content: space-between;
  744. padding: 6px 8px;
  745. background: white;
  746. margin: 0 16px;
  747. margin-top: 4px;
  748. border-radius: 8px 8px 0 0;
  749. border-bottom: 2px solid #17B3A3;
  750. }
  751. .title-left {
  752. display: flex;
  753. align-items: center;
  754. }
  755. .title-left i {
  756. color: #17B3A3;
  757. font-size: 16px;
  758. margin-right: 8px;
  759. }
  760. .title-left span {
  761. color: #17B3A3;
  762. font-size: 14px;
  763. font-weight: 500;
  764. }
  765. .title-right {
  766. display: flex;
  767. align-items: center;
  768. }
  769. .material-list-link {
  770. color: #17B3A3;
  771. font-size: 14px;
  772. font-weight: 500;
  773. cursor: pointer;
  774. text-decoration: underline;
  775. transition: color 0.2s ease;
  776. }
  777. .material-list-link:hover {
  778. color: #0d8f7f;
  779. }
  780. /* 标签列表 */
  781. .label-list {
  782. background: white;
  783. margin: 0 16px 12px;
  784. border-radius: 0 0 8px 8px;
  785. overflow: hidden;
  786. flex: 1;
  787. display: flex;
  788. flex-direction: column;
  789. max-height: 300px; /* 限制最大高度 */
  790. }
  791. .label-list .list-body {
  792. flex: 1;
  793. overflow-y: auto; /* 允许垂直滚动 */
  794. max-height: 250px; /* 内容区域最大高度 */
  795. }
  796. /* 滚动条样式优化 */
  797. .label-list .list-body::-webkit-scrollbar {
  798. width: 4px;
  799. }
  800. .label-list .list-body::-webkit-scrollbar-track {
  801. background: #f1f1f1;
  802. border-radius: 2px;
  803. }
  804. .label-list .list-body::-webkit-scrollbar-thumb {
  805. background: #17B3A3;
  806. border-radius: 2px;
  807. }
  808. .label-list .list-body::-webkit-scrollbar-thumb:hover {
  809. background: #0d8f7f;
  810. }
  811. .list-header {
  812. display: flex;
  813. background: #f8f9fa;
  814. padding: 12px 8px;
  815. border-bottom: 1px solid #e0e0e0;
  816. font-size: 12px;
  817. color: #666;
  818. font-weight: 500;
  819. }
  820. .list-item {
  821. display: flex;
  822. padding: 12px 8px;
  823. border-bottom: 1px solid #f0f0f0;
  824. font-size: 12px;
  825. color: #333;
  826. }
  827. .list-item:last-child {
  828. border-bottom: none;
  829. }
  830. .col-no {
  831. width: 20px;
  832. text-align: center;
  833. }
  834. .col-label {
  835. flex: 2;
  836. text-align: center;
  837. }
  838. .col-part {
  839. flex: 2;
  840. text-align: center;
  841. }
  842. .col-qty {
  843. width: 60px;
  844. text-align: center;
  845. }
  846. .empty-labels {
  847. padding: 40px 20px;
  848. text-align: center;
  849. color: #999;
  850. }
  851. .empty-labels p {
  852. margin: 0;
  853. font-size: 14px;
  854. }
  855. /* 底部操作按钮 */
  856. .bottom-actions {
  857. display: flex;
  858. padding: 16px;
  859. gap: 20px;
  860. background: white;
  861. margin-top: auto;
  862. }
  863. .action-btn {
  864. flex: 1;
  865. padding: 12px;
  866. border: 1px solid #17B3A3;
  867. background: white;
  868. color: #17B3A3;
  869. border-radius: 20px;
  870. font-size: 14px;
  871. cursor: pointer;
  872. transition: all 0.2s ease;
  873. }
  874. .action-btn:hover {
  875. background: #17B3A3;
  876. color: white;
  877. }
  878. .action-btn:active {
  879. transform: scale(0.98);
  880. }
  881. /* 物料清单弹窗样式 */
  882. .material-overlay {
  883. position: fixed;
  884. top: 0;
  885. left: 0;
  886. right: 0;
  887. bottom: 0;
  888. background: rgba(0, 0, 0, 0.5);
  889. z-index: 9999;
  890. display: flex;
  891. align-items: center;
  892. justify-content: center;
  893. padding: 20px;
  894. }
  895. .material-modal {
  896. background: white;
  897. border-radius: 12px;
  898. width: 100%;
  899. max-width: 800px;
  900. max-height: 80vh;
  901. box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  902. overflow: hidden;
  903. display: flex;
  904. flex-direction: column;
  905. }
  906. .material-modal .modal-header {
  907. background: #17B3A3;
  908. color: white;
  909. padding: 5px 16px;
  910. display: flex;
  911. justify-content: space-between;
  912. align-items: center;
  913. min-height: 28px;
  914. }
  915. .close-btn {
  916. font-size: 16px;
  917. cursor: pointer;
  918. color: white;
  919. transition: color 0.2s ease;
  920. padding: 4px;
  921. display: flex;
  922. align-items: center;
  923. justify-content: center;
  924. }
  925. .close-btn:hover {
  926. color: #e0e0e0;
  927. }
  928. .material-modal .modal-title {
  929. font-size: 16px;
  930. font-weight: 500;
  931. margin: 0;
  932. line-height: 1.2;
  933. }
  934. .material-modal .modal-body {
  935. flex: 1;
  936. overflow: auto;
  937. padding: 0;
  938. }
  939. .material-table {
  940. min-width: 500px;
  941. width: max-content;
  942. }
  943. .table-header {
  944. display: flex;
  945. background: #f8f9fa;
  946. padding: 10px 6px;
  947. border-bottom: 2px solid #17B3A3;
  948. font-size: 12px;
  949. color: #333;
  950. font-weight: 600;
  951. position: sticky;
  952. top: 0;
  953. z-index: 1;
  954. }
  955. .table-body {
  956. /* 垂直滚动由modal-body处理 */
  957. }
  958. .table-row {
  959. display: flex;
  960. padding: 10px 6px;
  961. border-bottom: 1px solid #f0f0f0;
  962. font-size: 12px;
  963. color: #333;
  964. transition: background-color 0.2s ease;
  965. }
  966. .table-row:hover {
  967. background-color: #f8f9fa;
  968. }
  969. .table-row:last-child {
  970. border-bottom: none;
  971. }
  972. .material-table .col-no {
  973. width: 25px;
  974. text-align: center;
  975. flex-shrink: 0;
  976. font-size: 12px;
  977. }
  978. .material-table .col-material-code {
  979. flex: 1.8;
  980. text-align: center;
  981. min-width: 100px;
  982. font-size: 12px;
  983. word-break: break-all;
  984. }
  985. .clickable-part { color: #17B3A3; font-weight: 500; cursor: pointer; text-decoration: underline; }
  986. .clickable-part:hover { color: #0d8f7f; }
  987. .stock-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; }
  988. .stock-modal { background: white; border-radius: 12px; width: 100%; max-width: 800px; max-height: 80vh; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); overflow: hidden; display: flex; flex-direction: column; }
  989. .stock-modal .modal-header { background: #17B3A3; color: white; padding: 5px 16px; display: flex; justify-content: space-between; align-items: center; min-height: 28px; }
  990. .stock-modal .modal-body { flex: 1; overflow: auto; padding: 0; }
  991. .stock-table { min-width: 500px; width: max-content; }
  992. .stock-table .table-header { display: flex; background: #f8f9fa; padding: 10px 6px; border-bottom: 2px solid #17B3A3; font-size: 12px; color: #333; font-weight: 600; position: sticky; top: 0; }
  993. .stock-table .table-body { /* 垂直滚动由modal-body处理 */ }
  994. .stock-table .table-row { display: flex; padding: 10px 6px; border-bottom: 1px solid #f0f0f0; font-size: 12px; color: #333; }
  995. .stock-table .table-row:hover { background-color: #f8f9fa; }
  996. .stock-table .col-roll-no { flex: 1.5; text-align: center; min-width: 100px; }
  997. .stock-table .col-qty { flex: 0.8; text-align: center; min-width: 60px; }
  998. .unit-text { color: #999; font-size: 11px; margin-left: 2px; }
  999. .stock-table .col-location { flex: 0.8; text-align: center; min-width: 60px; }
  1000. .stock-table .col-batch { flex: 1; text-align: center; min-width: 80px; }
  1001. .stock-table .col-date { flex: 1; text-align: center; min-width: 80px; }
  1002. .stock-modal .modal-footer { padding: 15px 20px; display: flex; justify-content: center; border-top: 1px solid #f0f0f0; }
  1003. .empty-stock { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; color: #999; }
  1004. .empty-stock i { font-size: 48px; margin-bottom: 16px; color: #ddd; }
  1005. .empty-stock p { margin: 0; font-size: 14px; }
  1006. .material-table .col-required-qty {
  1007. flex: 0.8;
  1008. text-align: center;
  1009. min-width: 65px;
  1010. font-size: 12px;
  1011. }
  1012. .material-table .col-available-qty {
  1013. flex: 0.8;
  1014. text-align: center;
  1015. min-width: 65px;
  1016. font-size: 12px;
  1017. }
  1018. .material-table .col-scans-qty {
  1019. flex: 0.8;
  1020. text-align: center;
  1021. min-width: 65px;
  1022. font-size: 12px;
  1023. }
  1024. /* 物料名称列样式 */
  1025. .material-table .col-part-name {
  1026. flex: 1.2;
  1027. text-align: left;
  1028. min-width: 80px;
  1029. font-size: 12px;
  1030. overflow: hidden;
  1031. }
  1032. .material-table .col-part-name .part-name-text {
  1033. display: block;
  1034. white-space: nowrap;
  1035. overflow: hidden;
  1036. text-overflow: ellipsis;
  1037. max-width: 100%;
  1038. color: #17B3A3;
  1039. cursor: pointer;
  1040. }
  1041. .material-table .col-part-name .part-name-text:active {
  1042. color: #0d8f7f;
  1043. }
  1044. /* 物料名称提示框样式 */
  1045. .part-name-tooltip {
  1046. position: fixed;
  1047. z-index: 10001;
  1048. transform: translateY(-100%);
  1049. max-width: 200px;
  1050. animation: tooltipFadeIn 0.2s ease;
  1051. }
  1052. @keyframes tooltipFadeIn {
  1053. from { opacity: 0; transform: translateY(-100%) translateY(5px); }
  1054. to { opacity: 1; transform: translateY(-100%) translateY(0); }
  1055. }
  1056. .part-name-tooltip .tooltip-content {
  1057. background: #303133;
  1058. color: #fff;
  1059. padding: 8px 12px;
  1060. border-radius: 4px;
  1061. font-size: 12px;
  1062. line-height: 1.4;
  1063. word-break: break-all;
  1064. box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  1065. }
  1066. .part-name-tooltip::after {
  1067. content: '';
  1068. position: absolute;
  1069. bottom: -6px;
  1070. left: 15px;
  1071. border-width: 6px 6px 0 6px;
  1072. border-style: solid;
  1073. border-color: #303133 transparent transparent transparent;
  1074. }
  1075. .material-modal .modal-footer {
  1076. padding: 15px 20px;
  1077. display: flex;
  1078. justify-content: center;
  1079. border-top: 1px solid #f0f0f0;
  1080. }
  1081. .btn-close {
  1082. padding: 10px 20px;
  1083. border-radius: 6px;
  1084. font-size: 14px;
  1085. cursor: pointer;
  1086. transition: all 0.2s;
  1087. border: 1px solid #17B3A3;
  1088. background: white;
  1089. color: #17B3A3;
  1090. }
  1091. .btn-close:hover {
  1092. background: #17B3A3;
  1093. color: white;
  1094. }
  1095. /* 加载状态样式 */
  1096. .loading-container {
  1097. display: flex;
  1098. flex-direction: column;
  1099. align-items: center;
  1100. justify-content: center;
  1101. padding: 60px 20px;
  1102. color: #666;
  1103. }
  1104. .loading-container i {
  1105. font-size: 24px;
  1106. margin-bottom: 12px;
  1107. color: #17B3A3;
  1108. }
  1109. .loading-container span {
  1110. font-size: 14px;
  1111. }
  1112. /* 空数据状态样式 */
  1113. .empty-material {
  1114. display: flex;
  1115. flex-direction: column;
  1116. align-items: center;
  1117. justify-content: center;
  1118. padding: 60px 20px;
  1119. color: #999;
  1120. }
  1121. .empty-material i {
  1122. font-size: 48px;
  1123. margin-bottom: 16px;
  1124. color: #ddd;
  1125. }
  1126. .empty-material p {
  1127. margin: 0;
  1128. font-size: 14px;
  1129. }
  1130. /* 响应式设计 */
  1131. @media (max-width: 360px) {
  1132. .header-bar {
  1133. padding: 8px 12px;
  1134. }
  1135. .search-container {
  1136. padding: 8px 12px;
  1137. }
  1138. .material-info-card {
  1139. margin: 4px 12px;
  1140. }
  1141. .card-header {
  1142. padding: 10px 12px;
  1143. }
  1144. .card-body {
  1145. padding: 10px 12px;
  1146. }
  1147. .info-row {
  1148. flex-direction: column;
  1149. gap: 8px;
  1150. }
  1151. .stats-row {
  1152. flex-wrap: wrap;
  1153. gap: 6px;
  1154. }
  1155. .stat-item {
  1156. flex: 0 0 48%;
  1157. min-width: 45%;
  1158. }
  1159. .section-title {
  1160. margin: 0 12px;
  1161. margin-top: 4px;
  1162. }
  1163. .label-list {
  1164. margin: 0 12px 8px;
  1165. }
  1166. .list-header, .list-item {
  1167. font-size: 11px;
  1168. }
  1169. .col-label, .col-part {
  1170. flex: 1.5;
  1171. }
  1172. }
  1173. </style>