inventoryDetail.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. <template>
  2. <gui-page :custom-header="true" :header-class="['gui-theme-background-color']">
  3. <template #gHeader>
  4. <view style="height:44px;" class="gui-flex gui-nowrap gui-rows gui-align-items-center">
  5. <text style="font-size:44rpx;" class="gui-header-leader-btns gui-color-white font-icons"
  6. @tap="goBack">&#xe6c5;</text>
  7. <text
  8. class="gui-h4 gui-blod gui-flex1 gui-text-center gui-ellipsis gui-color-white gui-primary-text">盘点明细</text>
  9. <view style="width:40px;" />
  10. </view>
  11. </template>
  12. <template #gBody>
  13. <view class="list-content">
  14. <!-- 库位扫描输入框 -->
  15. <view class="scan">
  16. <view class="scan-card">
  17. <uni-easyinput ref="easyinputStore" v-model="storeName" :input-border="false"
  18. :clearable="false" type="text" placeholder="请扫描库位信息"
  19. @confirm="confirmStore" />
  20. <text class="font-icons" @click="handleScanStore">&#xe6b7;</text>
  21. </view>
  22. </view>
  23. <!-- 物料扫描输入框 -->
  24. <view class="scan">
  25. <view class="scan-card">
  26. <uni-easyinput ref="easyinput" v-model="scanBatchNumber" :input-border="false"
  27. :clearable="false" type="text" placeholder="请扫描物料二维码"
  28. @confirm="handleKeydown" />
  29. <text class="font-icons" @click="handleScanMaterial">
  30. &#xe6b7;
  31. </text>
  32. </view>
  33. </view>
  34. <!-- 是否按货位盘点单选按钮 -->
  35. <view class="check-by-location-radio">
  36. <text class="radio-label">是否按货位盘点:</text>
  37. <radio-group @change="handleCheckByLocationChange" class="radio-group">
  38. <label class="radio-item">
  39. <radio value="1" :checked="checkByLocationFlag === '1'" color="#00a0e9" />
  40. <text>是</text>
  41. </label>
  42. <label class="radio-item">
  43. <radio value="0" :checked="checkByLocationFlag === '0'" color="#00a0e9" />
  44. <text>否</text>
  45. </label>
  46. </radio-group>
  47. </view>
  48. <!-- 仓库和货位信息展示 -->
  49. <view class="info-row">
  50. <text class="info-label">仓库:</text>
  51. <text class="info-value">{{ erpStockName }}</text>
  52. <text class="info-label">货位:</text>
  53. <text class="info-value">{{ wmsStoreName }}</text>
  54. </view>
  55. <!-- 自定义表格:表头固定 + 支持横向滑动 -->
  56. <view class="custom-table-wrapper">
  57. <!-- 表头区域(固定纵向,跟随横向滚动) -->
  58. <scroll-view
  59. class="table-header-scroll"
  60. scroll-x
  61. :scroll-left="tableScrollLeft"
  62. @scroll="handleHeaderScroll"
  63. >
  64. <view class="table-row header-row">
  65. <view class="table-cell" style="width: 120px;">备注</view>
  66. <view class="table-cell" style="width: 100px;">物料编码</view>
  67. <view class="table-cell" style="width: 100px;">物料名称</view>
  68. <view class="table-cell" style="width: 100px;">仓库</view>
  69. <view class="table-cell" style="width: 100px;">库位</view>
  70. <view class="table-cell" style="width: 120px;">条码号</view>
  71. <view class="table-cell" style="width: 80px;">数量</view>
  72. <view class="table-cell" style="width: 80px;">操作</view>
  73. </view>
  74. </scroll-view>
  75. <!-- 内容区域(纵向滚动 + 横向滚动) -->
  76. <scroll-view
  77. class="table-body-scroll"
  78. scroll-y
  79. scroll-x
  80. :scroll-left="tableScrollLeft"
  81. @scroll="handleBodyScroll"
  82. >
  83. <view
  84. class="table-row body-row"
  85. v-for="(item, key) in beforeTableData"
  86. :key="key"
  87. >
  88. <view class="table-cell" style="width: 120px;">
  89. <uni-easyinput
  90. v-model="item.note"
  91. :input-border="false"
  92. placeholder="请输入"
  93. @blur="handleNoteBlur(item)"
  94. />
  95. </view>
  96. <view class="table-cell" style="width: 100px;">{{ item.materialNo }}</view>
  97. <view class="table-cell" style="width: 100px;">{{ item.materialName }}</view>
  98. <view class="table-cell" style="width: 100px;">{{ item.wmsStockCode }}</view>
  99. <view class="table-cell" style="width: 100px;">{{ item.wmsStoreCode }}</view>
  100. <view class="table-cell" style="width: 120px;">{{ item.batchNumber }}</view>
  101. <view class="table-cell" style="width: 80px;">{{ item.batchQty }}</view>
  102. <view class="table-cell" style="width: 80px;">
  103. <text class="delete-btn" @click="deleteTableItem(key)">删除</text>
  104. </view>
  105. </view>
  106. <!-- 空数据提示 -->
  107. <view v-if="beforeTableData.length === 0" class="empty-text">暂无更多数据</view>
  108. </scroll-view>
  109. </view>
  110. <view class="btn-area">
  111. <view class="finish-btn" :class="{ disabled: finishDisabled }" @click="handleFinish">
  112. <text class="btn-text">结束盘点</text>
  113. </view>
  114. </view>
  115. <uni-popup ref="errorTip" type="dialog">
  116. <uni-popup-dialog type="error" cancel-text="关闭" confirm-text="确认" title="提示"
  117. :content="errorTipMessage" @confirm="handleCloseErrorTipsModal"
  118. @close="handleCloseErrorTipsModal" />
  119. </uni-popup>
  120. </view>
  121. </template>
  122. </gui-page>
  123. </template>
  124. <script>
  125. import {
  126. onShow
  127. } from '@dcloudio/uni-app'
  128. import {
  129. ref,
  130. defineComponent,
  131. onBeforeMount,
  132. nextTick
  133. } from 'vue'
  134. export default defineComponent({
  135. setup(options) {
  136. const errorTip = ref('')
  137. const errorTipMessage = ref('')
  138. const easyinput = ref('')
  139. const easyinputStore = ref('')
  140. const errorState = ref(0)
  141. const parentRow = uni.getStorageSync('masterId') ?? {}
  142. const masterId = ref('')
  143. const scanBatchNumber = ref('')
  144. const tableData = ref([])
  145. const beforeTableData = ref([])
  146. const currentScanMaterial = ref([])
  147. const localScannedList = ref([])
  148. const finishDisabled = ref(false)
  149. const receiveList = ref([])
  150. const storeName = ref('')
  151. const erpStockName = ref('')
  152. const wmsStoreName = ref('')
  153. const countStockCode = ref('') // 盘点仓库编码
  154. const countStoreAreaCode = ref('') // 盘点区域编码
  155. const countStoreCode = ref('') // 盘点货位编码
  156. /* -------------------- 是否按货位盘点字段 -------------------- */
  157. const checkByLocationFlag = ref(null)
  158. /* -------------------- 表格横向滚动同步 -------------------- */
  159. const tableScrollLeft = ref(0)
  160. const initMasterId = () => {
  161. const parsedData = JSON.parse(parentRow)
  162. masterId.value = parsedData?.id
  163. }
  164. onBeforeMount(() => {
  165. initMasterId()
  166. if (masterId.value) {
  167. search()
  168. }
  169. })
  170. onShow(() => {
  171. initMasterId()
  172. // if (masterId.value) {
  173. // search()
  174. // }
  175. })
  176. const search = function() {
  177. uni.$reqGet('inventoryGetStockCountSubdetailList', { id: masterId.value })
  178. .then(({ code, data, msg }) => {
  179. if (code === 0) {
  180. receiveList.value = data || []
  181. tableData.value = data || []
  182. // 清空本地扫描列表并重新构建
  183. localScannedList.value = []
  184. tableData.value.forEach(item => {
  185. // 后端返回的字段是 batchQty,但可能为 null,需要处理
  186. localScannedList.value.push({
  187. ...item,
  188. batchQty: item.batchQty || 1, // 如果为 null 默认给 1
  189. note: item.note || ''
  190. })
  191. })
  192. flushBeforeTableData()
  193. } else {
  194. uni.showToast({ title: msg, icon: 'none', duration: 2000 })
  195. }
  196. })
  197. }
  198. const goBack = function() {
  199. if (uni.getStorageSync('masterId')) {
  200. uni.removeStorageSync('masterId')
  201. }
  202. if (uni.getStorageSync('ids')) {
  203. uni.removeStorageSync('ids')
  204. }
  205. uni.$goBack('/pages/workbranch/warehouse/Inventory/inventoryPage')
  206. }
  207. const isProcessing = ref(false)
  208. const handleScanMaterial = async function () {
  209. if (isProcessing.value) {
  210. uni.showToast({ title: '处理中,请稍候...', icon: 'none', duration: 1500 })
  211. return
  212. }
  213. if (!storeName.value) {
  214. errorTipMessage.value = '请先扫描库位信息'
  215. errorTip.value.open()
  216. return
  217. }
  218. const mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module')
  219. const ret = await new Promise(resolve =>
  220. mpaasScanModule.mpaasScan(
  221. { scanType: ['qrCode', 'barCode'], hideAlbum: false },
  222. resolve
  223. )
  224. )
  225. if (ret.resp_code !== 1000) return
  226. const qrCode = ret.resp_result
  227. isProcessing.value = true
  228. try {
  229. // 1. 查询物料信息
  230. const { code, data, msg } = await uni.$reqPost('inventoryGetQrCode', {
  231. countStoreCode: countStoreCode.value || storeName.value,
  232. countStoreAreaCode: countStoreAreaCode.value,
  233. countStockCode: countStockCode.value,
  234. batchNumber: qrCode,
  235. erpStockCountId: receiveList.value?.[0]?.erpStockCountId || masterId.value,
  236. })
  237. if (code !== 0) {
  238. throw new Error(msg || '查询物料失败')
  239. }
  240. scanBatchNumber.value = qrCode
  241. // 2. 组装保存参数
  242. const scanData = {
  243. ...data,
  244. countStoreCode: countStoreCode.value || storeName.value,
  245. countStoreAreaCode: countStoreAreaCode.value,
  246. countStockCode: countStockCode.value,
  247. }
  248. const saveParams = {
  249. ...scanData,
  250. erpStockCountId: receiveList.value?.[0]?.erpStockCountId || masterId.value
  251. }
  252. // 3. 保存数据
  253. const { code: saveCode, data: saveData, msg: saveMsg } = await uni.$reqPost('inventorySaveQrCode', saveParams)
  254. if (saveCode !== 0) {
  255. throw new Error(saveMsg || '保存失败')
  256. }
  257. // 4. 本地更新数据(✅ 去掉 search(),减少一次请求)
  258. localScannedList.value.push({
  259. ...scanData,
  260. batchQty: scanData.receiptQty || 1,
  261. note: '',
  262. id: saveData?.id || scanData.id
  263. })
  264. flushBeforeTableData()
  265. search()
  266. uni.showToast({
  267. title: '保存成功',
  268. icon: 'success',
  269. duration: 1500
  270. })
  271. scanBatchNumber.value = ''
  272. setInputFocus()
  273. } catch (err) {
  274. errorTipMessage.value = err.message || '操作失败'
  275. errorTip.value.open()
  276. errorState.value = 0
  277. } finally {
  278. isProcessing.value = false // ✅ 释放锁
  279. }
  280. }
  281. const handleKeydown = async function(e) {
  282. if (isProcessing.value) {
  283. uni.showToast({ title: '处理中,请稍候...', icon: 'none', duration: 1500 })
  284. return
  285. }
  286. if (!storeName.value) {
  287. errorTipMessage.value = '请先扫描库位信息'
  288. errorTip.value.open()
  289. errorState.value = 0
  290. return
  291. }
  292. isProcessing.value = true
  293. try {
  294. const { code, data, msg } = await uni.$reqPost('inventoryGetQrCode', {
  295. countStoreCode: countStoreCode.value || storeName.value,
  296. countStoreAreaCode: countStoreAreaCode.value,
  297. countStockCode: countStockCode.value,
  298. batchNumber: e,
  299. erpStockCountId: receiveList.value?.[0]?.erpStockCountId || masterId.value,
  300. })
  301. if (code !== 0) {
  302. throw new Error(msg || '查询物料失败')
  303. }
  304. scanBatchNumber.value = e
  305. const scanData = {
  306. ...data,
  307. countStoreCode: countStoreCode.value || storeName.value,
  308. countStoreAreaCode: countStoreAreaCode.value,
  309. countStockCode: countStockCode.value,
  310. }
  311. const saveParams = {
  312. ...scanData,
  313. erpStockCountId: receiveList.value?.[0]?.erpStockCountId || masterId.value
  314. }
  315. const { code: saveCode, data: saveData, msg: saveMsg } = await uni.$reqPost('inventorySaveQrCode', saveParams)
  316. if (saveCode !== 0) {
  317. throw new Error(saveMsg || '保存失败')
  318. }
  319. localScannedList.value.push({
  320. ...scanData,
  321. batchQty: scanData.receiptQty || 1,
  322. note: '',
  323. id: saveData?.id || scanData.id
  324. })
  325. flushBeforeTableData()
  326. search()
  327. uni.showToast({
  328. title: '保存成功',
  329. icon: 'success',
  330. duration: 1500
  331. })
  332. scanBatchNumber.value = ''
  333. setInputFocus()
  334. } catch (err) {
  335. errorTipMessage.value = err.message || '操作失败'
  336. errorTip.value.open()
  337. errorState.value = 0
  338. } finally {
  339. isProcessing.value = false // ✅ 释放锁
  340. }
  341. }
  342. const setInputFocus = function() {
  343. scanBatchNumber.value = ''
  344. easyinput.value.onBlur()
  345. easyinput.value.onFocus()
  346. }
  347. const flushBeforeTableData = function() {
  348. const map = new Map()
  349. localScannedList.value.forEach(it => {
  350. const key = `${it.materialNo}__${it.batchNumber}`
  351. if (map.has(key)) {
  352. map.get(key).batchQty += it.batchQty
  353. if (it.note) {
  354. map.get(key).note = it.note
  355. }
  356. } else {
  357. map.set(key, { ...it })
  358. }
  359. })
  360. beforeTableData.value = Array.from(map.values()).map((v, i) => ({
  361. ...v,
  362. uniqueId: `${v.materialNo}_${v.batchNumber}_${i}`,
  363. slideX: 0
  364. }))
  365. }
  366. // 删除 - 调用 inventoryDelete 接口
  367. const deleteTableItem = async (idx) => {
  368. const target = beforeTableData.value[idx]
  369. uni.showModal({
  370. title: '提示',
  371. content: '确认删除该物料?',
  372. success: async (res) => {
  373. if (res.confirm) {
  374. try {
  375. const { code, msg } = await uni.$reqPost('inventoryDelete', {
  376. id: target.id,
  377. erpStockCountId: receiveList.value?.[0]?.erpStockCountId || masterId.value
  378. })
  379. if (code !== 0) {
  380. errorTipMessage.value = msg || '删除失败'
  381. errorTip.value.open()
  382. return
  383. }
  384. // 删除成功,更新本地数据
  385. const key = `${target.materialNo}__${target.batchNumber}`
  386. const listIdx = localScannedList.value.findIndex(
  387. v => `${v.materialNo}__${v.batchNumber}` === key
  388. )
  389. if (listIdx > -1) localScannedList.value.splice(listIdx, 1)
  390. flushBeforeTableData()
  391. const row = tableData.value.find(r => r.materialNo === target.materialNo)
  392. if (row) row.completedQty -= target.batchQty
  393. search()
  394. } catch (err) {
  395. errorTipMessage.value = err.errMsg || '网络异常,删除失败'
  396. errorTip.value.open()
  397. }
  398. }
  399. }
  400. })
  401. }
  402. // 备注修改 - 调用 inventoryUpdateQrCode 接口
  403. const handleNoteBlur = async (item) => {
  404. // 先同步到本地缓存
  405. const key = `${item.materialNo}__${item.batchNumber}`
  406. localScannedList.value.forEach(it => {
  407. if (`${it.materialNo}__${it.batchNumber}` === key) {
  408. it.note = item.note
  409. }
  410. })
  411. // 调用接口更新备注
  412. if (item.id) {
  413. try {
  414. await uni.$reqPost('inventoryUpdateQrCode', {
  415. id: item.id,
  416. note: item.note,
  417. erpStockCountId: receiveList.value?.[0]?.erpStockCountId || masterId.value
  418. })
  419. search()
  420. } catch (err) {
  421. console.error('备注更新失败', err)
  422. }
  423. }
  424. }
  425. const handleCloseErrorTipsModal = async function() {
  426. errorTip.value.close()
  427. if (errorState.value === 0) {
  428. await setInputFocus()
  429. }
  430. }
  431. const handleScanStore = function() {
  432. const mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module')
  433. mpaasScanModule.mpaasScan({
  434. 'scanType': ['qrCode', 'barCode'],
  435. 'hideAlbum': false
  436. }, (ret) => {
  437. if (ret.resp_code === 1000) {
  438. confirmStore(ret.resp_result)
  439. }
  440. })
  441. }
  442. const confirmStore = function(e) {
  443. storeName.value = e
  444. uni.$reqGet('getStockLocaltionByCode', { code: e })
  445. .then(({ code, data, msg }) => {
  446. if (code === 0) {
  447. if (!data || !data.erpStockName || !data.wmsStoreName) {
  448. errorTipMessage.value = '请扫描正确的库位'
  449. errorTip.value.open()
  450. errorState.value = 0
  451. storeName.value = ''
  452. return
  453. }
  454. erpStockName.value = data.erpStockName
  455. wmsStoreName.value = data.wmsStoreName
  456. // 保存盘点编码
  457. countStockCode.value = data.stockCode || '' // 盘点仓库编码 = 仓库编码
  458. countStoreCode.value = data.locationCode || e // 盘点货位编码 = 货位编码
  459. countStoreAreaCode.value = data.stockCode || '' // 盘点区域编码 = 仓库编码(同仓库)
  460. nextTick(() => {
  461. easyinput.value.onFocus()
  462. })
  463. } else {
  464. errorTipMessage.value = '请扫描正确的库位'
  465. errorTip.value.open()
  466. errorState.value = 0
  467. storeName.value = ''
  468. }
  469. })
  470. }
  471. const mergeBeforeIntoTable = () => {
  472. const mergedTableData = JSON.parse(JSON.stringify(tableData.value))
  473. const map = {}
  474. mergedTableData.forEach(row => {
  475. if (!row.inRequestSubdetailList) row.inRequestSubdetailList = []
  476. map[row.materialNo] = row
  477. })
  478. beforeTableData.value.forEach(item => {
  479. const target = map[item.materialNo]
  480. if (target) {
  481. target.inRequestSubdetailList.push({ ...item, leftQty: null })
  482. }
  483. })
  484. return mergedTableData
  485. }
  486. // 结束盘点 - 调用 inventoryFinishStockCount 接口
  487. const handleFinish = async function() {
  488. if (finishDisabled.value) return
  489. if (checkByLocationFlag.value === null) {
  490. uni.showToast({
  491. title: '请选择是否按货位盘点',
  492. icon: 'none',
  493. duration: 2000
  494. })
  495. return
  496. }
  497. finishDisabled.value = true
  498. try {
  499. await uni.$reqPost('inventoryFinishStockCount', {
  500. id: receiveList.value?.[0]?.erpStockCountId || masterId.value,
  501. storeFlag: checkByLocationFlag.value
  502. })
  503. .then(({ code, data, msg }) => {
  504. if (code === 0) {
  505. uni.showModal({
  506. title: '提示',
  507. content: '盘点结束',
  508. showCancel: false,
  509. success: () => {
  510. goBack()
  511. }
  512. })
  513. } else {
  514. errorTipMessage.value = msg
  515. errorTip.value.open()
  516. errorState.value = 0
  517. }
  518. })
  519. } finally {
  520. finishDisabled.value = false
  521. }
  522. }
  523. // 同步表头和内容的横向滚动
  524. const handleHeaderScroll = function(e) {
  525. tableScrollLeft.value = e.detail.scrollLeft
  526. }
  527. const handleBodyScroll = function(e) {
  528. tableScrollLeft.value = e.detail.scrollLeft
  529. }
  530. // 处理是否按货位盘点单选按钮变化
  531. const handleCheckByLocationChange = function(e) {
  532. checkByLocationFlag.value = e.detail.value
  533. }
  534. return {
  535. goBack,
  536. beforeTableData,
  537. easyinput,
  538. easyinputStore,
  539. errorTip,
  540. errorTipMessage,
  541. handleKeydown,
  542. scanBatchNumber,
  543. handleScanMaterial,
  544. handleCloseErrorTipsModal,
  545. handleFinish,
  546. finishDisabled,
  547. storeName,
  548. erpStockName,
  549. wmsStoreName,
  550. handleScanStore,
  551. confirmStore,
  552. deleteTableItem,
  553. handleNoteBlur,
  554. checkByLocationFlag,
  555. handleCheckByLocationChange,
  556. tableScrollLeft,
  557. handleHeaderScroll,
  558. handleBodyScroll
  559. }
  560. }
  561. })
  562. </script>
  563. <style lang="scss" scoped>
  564. .gui-header-leader-btns {
  565. color: black;
  566. font-size: 24px !important;
  567. margin-left: 24rpx;
  568. }
  569. .list-content {
  570. margin-top: 80px;
  571. background-color: #edeeee;
  572. }
  573. .scan {
  574. height: 45px;
  575. width: calc(100% - 48px);
  576. margin: 12px;
  577. padding: 0 12px;
  578. display: flex;
  579. justify-content: space-between;
  580. align-items: center;
  581. border-radius: 6px;
  582. background-color: white;
  583. .scan-card {
  584. width: 100%;
  585. display: grid;
  586. grid-template-rows: 1fr;
  587. grid-template-columns: 7fr 2fr;
  588. align-items: center;
  589. input {
  590. height: 35px;
  591. line-height: 35px;
  592. }
  593. text {
  594. width: 100%;
  595. text-align: right;
  596. }
  597. }
  598. }
  599. /* ========== 自定义表格样式(支持横向+纵向滚动)========== */
  600. .custom-table-wrapper {
  601. height: calc(100vh - 280px);
  602. min-height: 230px;
  603. margin: 5px 0;
  604. display: flex;
  605. flex-direction: column;
  606. border: 1px solid #e0e0e0;
  607. border-radius: 4px;
  608. overflow: hidden;
  609. }
  610. /* 表头横向滚动容器 */
  611. .custom-table-wrapper {
  612. height: calc(100vh - 280px);
  613. min-height: 230px;
  614. margin: 5px 0;
  615. display: flex;
  616. flex-direction: column;
  617. border: 1px solid #e0e0e0;
  618. border-radius: 4px;
  619. overflow: hidden;
  620. }
  621. /* 内容区域:纵向+横向滚动 */
  622. .table-body-scroll {
  623. height: calc(100% - 40px); /* 明确内容区域高度 */
  624. scrollbar-width: none;
  625. -ms-overflow-style: none;
  626. &::-webkit-scrollbar {
  627. display: none;
  628. }
  629. }
  630. .table-row {
  631. display: flex;
  632. align-items: center;
  633. min-height: 40px;
  634. /* 确保行宽超出容器,触发横向滚动 */
  635. width: max-content;
  636. }
  637. .header-row {
  638. font-weight: bold;
  639. color: #333;
  640. background-color: #f5f7fa;
  641. }
  642. .body-row {
  643. border-bottom: 1px solid #f0f0f0;
  644. &:nth-child(even) {
  645. background-color: #f5f7fa;
  646. }
  647. &:nth-child(odd) {
  648. background-color: #ffffff;
  649. }
  650. }
  651. .table-cell {
  652. padding: 8px 4px;
  653. text-align: center;
  654. box-sizing: border-box;
  655. flex-shrink: 0;
  656. display: flex;
  657. align-items: center;
  658. justify-content: center;
  659. font-size: 12px;
  660. word-break: break-all;
  661. }
  662. .empty-text {
  663. text-align: center;
  664. padding: 20px;
  665. color: #999;
  666. font-size: 14px;
  667. width: 100vw; /* 确保空提示有宽度 */
  668. }
  669. /* ========== 其他样式 ========== */
  670. .info-row {
  671. display: flex;
  672. align-items: center;
  673. padding: 10rpx 20rpx;
  674. background-color: #f0f2f5;
  675. border-radius: 8rpx;
  676. margin: 10rpx 20rpx;
  677. }
  678. .info-label {
  679. color: #666;
  680. font-size: 28rpx;
  681. margin-right: 8rpx;
  682. }
  683. .info-value {
  684. color: #333;
  685. font-size: 28rpx;
  686. margin-right: 20rpx;
  687. font-weight: 500;
  688. }
  689. .delete-btn {
  690. color: #e54d42;
  691. font-size: 12px;
  692. padding: 2px 4px;
  693. }
  694. .btn-area {
  695. margin: 12px 24rpx;
  696. }
  697. .finish-btn {
  698. display: flex;
  699. align-items: center;
  700. justify-content: center;
  701. height: 44px;
  702. background-color: #00a0e9;
  703. border-radius: 6px;
  704. }
  705. .finish-btn.disabled {
  706. opacity: 0.5;
  707. pointer-events: none;
  708. }
  709. .btn-text {
  710. color: #fff;
  711. font-size: 16px;
  712. font-weight: bold;
  713. }
  714. .font-icons {
  715. width: 40px;
  716. font-size: 20px;
  717. }
  718. /* 是否按货位盘点单选按钮样式 */
  719. .check-by-location-radio {
  720. display: flex;
  721. align-items: center;
  722. padding: 10rpx 24rpx;
  723. background-color: #fff;
  724. margin: 0 24rpx 10rpx 24rpx;
  725. border-radius: 6px;
  726. .radio-label {
  727. font-size: 28rpx;
  728. color: #333;
  729. margin-right: 20rpx;
  730. white-space: nowrap;
  731. }
  732. .radio-group {
  733. display: flex;
  734. flex-direction: row;
  735. }
  736. .radio-item {
  737. display: flex;
  738. align-items: center;
  739. margin-right: 30rpx;
  740. radio {
  741. transform: scale(0.8);
  742. }
  743. text {
  744. font-size: 28rpx;
  745. color: #333;
  746. margin-left: 8rpx;
  747. }
  748. }
  749. }
  750. </style>