scannedMaterials.vue 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393
  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. <!-- 使用组件实现返回按钮及返回首页按钮 -->
  6. <text style="font-size:44rpx;" class="gui-header-leader-btns gui-color-white font-icons"
  7. @tap="goBack">&#xe6c5;</text>
  8. <!-- 导航文本此处也可以是其他自定义内容 -->
  9. <text
  10. class="gui-h4 gui-blod gui-flex1 gui-text-center gui-ellipsis gui-color-white gui-primary-text">扫描出库明细</text>
  11. <!-- 此处加一个右侧展位元素与左侧同宽,实现标题居中 -->
  12. <!-- 实际宽度请根据自己情况设置 -->
  13. <view style="width:40px;" />
  14. <!-- 如果右侧有其他内容可以利用条件编译和定位来实现-->
  15. </view>
  16. </template>
  17. <template #gBody>
  18. <view class="list-content">
  19. <view class="scan" v-if="scanTie">
  20. <view class="scan-card" style="margin-top:8px;">
  21. <uni-easyinput
  22. ref="tmInput"
  23. v-model="tmId"
  24. :input-border="false"
  25. :clearable="false"
  26. type="text"
  27. placeholder="请扫描或输入贴纸ID"
  28. @confirm="setTmOnly"
  29. />
  30. <text class="font-icons" @click="setTmOnly">&#xe6b7;</text>
  31. </view>
  32. </view>
  33. <view class="scan" v-if="scanTie">
  34. <view class="scan-card" style="margin-top:8px;">
  35. <uni-easyinput
  36. ref="partInput"
  37. v-model="tmMaterialNo"
  38. :input-border="false"
  39. :clearable="false"
  40. type="text"
  41. placeholder="请输入料号"
  42. @confirm="handlePartKeydown"
  43. />
  44. <text class="font-icons" @click="handleQueryPart">&#xe6b7;</text>
  45. </view>
  46. </view>
  47. <view class="scan">
  48. <view class="scan-card">
  49. <!-- 禁用软键盘 -->
  50. <!-- <uni-easyinput ref="easyinput" v-model="scanBatchNumber" :input-border="false"
  51. :clearable="false" type="text" focus @focus="handleInputFocus" placeholder="请扫描物料二维码"
  52. @confirm="handleKeydown" /> -->
  53. <!-- 不禁用软键盘(且不自动获取焦点) -->
  54. <uni-easyinput ref="easyinput" v-model="scanBatchNumber" :input-border="false"
  55. :clearable="false" type="text" placeholder="请扫描物料二维码"
  56. @confirm="handleKeydown" />
  57. <text class="font-icons" @click="handleScanMaterial">&#xe6b7;</text>
  58. </view>
  59. </view>
  60. <view class="tabs">
  61. <div class="tabs-list">
  62. <text :class="!isBefore?'tabs-item-active':'tabs-item'" @click="isBefore = false">物料需求</text>
  63. <text :class="isBefore?'tabs-item-active':'tabs-item'" @click="isBefore = true">已扫物料</text>
  64. </div>
  65. </view>
  66. <view v-if="!isBefore" class="custom-table">
  67. <uni-table border stripe empty-text="暂无更多数据">
  68. <!-- 表头行 -->
  69. <uni-tr class="custom-table-head">
  70. <uni-th align="center" width="180px" class="break-col">可出库位(数量)</uni-th>
  71. <uni-th align="center" width="180px">物料</uni-th>
  72. <uni-th align="center" width="120px">应备数</uni-th>
  73. <uni-th align="center" width="120px">已备数</uni-th>
  74. </uni-tr>
  75. <!-- 表格数据行 -->
  76. <!-- 可点击行,方法存在 -->
  77. <uni-tr v-for="(item, key) in tableData" :key="key" @click="handleToDetails(item)">
  78. <!-- 不可点击行 -->
  79. <!-- <uni-tr v-for="(item, key) in tableData" :key="key"> -->
  80. <uni-td align="center" class="break-cell">{{ item.ableStockLocation }}</uni-td>
  81. <uni-td align="center">{{ item.materialNo }}({{ item.materialName }})</uni-td>
  82. <uni-td align="center">{{ item.nowDeliveredQty }}</uni-td>
  83. <uni-td align="center"
  84. style="color: orange;font-weight: bold;">{{ item.completedQty }}</uni-td>
  85. </uni-tr>
  86. </uni-table>
  87. </view>
  88. <view v-else class="custom-table">
  89. <scroll-view scroll-y class="scroll-box" style="height: 300px;">
  90. <view class="cell-row">
  91. <view class="cell1">物料</view>
  92. <view class="cell2">数量</view>
  93. <view class="cell3">批号</view>
  94. </view>
  95. <view
  96. v-for="(item, idx) in beforeTableData"
  97. :key="item.uniqueId"
  98. class="swipe-row"
  99. @touchstart="touchStart"
  100. @touchmove="touchMove"
  101. @touchend="touchEnd"
  102. :data-index="idx"
  103. >
  104. <view class="content-area" :style="`transform: translateX(${item.slideX}px)`">
  105. <view class="cell1">{{ item.materialNo }}({{ item.materialName }})</view>
  106. <view class="cell2">{{ item.batchQty }}</view>
  107. <view class="cell3">{{ item.batchNumber }}</view>
  108. </view>
  109. <view class="btn-area" @click="deleteItem(idx)">删除</view>
  110. </view>
  111. </scroll-view>
  112. </view>
  113. <view class="card-list-item"
  114. style="margin: 12px 0;display: grid;grid-template-columns: 1fr 1fr;grid-template-rows: 1fr;gap: 10px;">
  115. <view class="sign-btn" :class="{ disabled: saveDisabled }" @click="handleSave">
  116. <text :style="saveBtnTextStyle">保存</text>
  117. </view>
  118. <view class="sign-btn" :class="{ disabled: submitDisabled }" @click="handleSubmit">
  119. <text :style="submitBtnTextStyle">提交</text>
  120. </view>
  121. <view style="width: 0px;">
  122. <!-- <uni-easyinput ref="signInput" v-model="signText" @focus="handleInputFocus"
  123. :input-border="false" :clearable="false" type="text" @confirm="handleComplete" /> -->
  124. <uni-easyinput ref="signInput" v-model="signText"
  125. :input-border="false" :clearable="false" type="text" @confirm="handleComplete" />
  126. </view>
  127. </view>
  128. <gui-modal ref="modalForm" :custom-class="['gui-bg-white', 'gui-dark-bg-level-3', 'gui-border-radius']"
  129. title="提示">
  130. <template #content>
  131. <view class="gui-padding gui-bg-gray gui-dark-bg-level-2">
  132. <text class="gui-block gui-text-center gui-text gui-color-gray"
  133. style="line-height:100rpx; padding:10rpx;">备料超出,是否拆分?</text>
  134. </view>
  135. </template>
  136. <!-- 利用 flex 布局 可以放置多个自定义按钮哦 -->
  137. <template #btns>
  138. <view class="gui-flex gui-row gui-space-between operation-flex">
  139. <view hover-class="gui-tap" class="modal-btns gui-flex1" @tap="modalForm.close()">
  140. <text class="modal-btns gui-color-gray">取消</text>
  141. </view>
  142. <view class="line" />
  143. <view hover-class="gui-tap" class="modal-btns gui-flex1" @tap="handleSplitMaterial">
  144. <text class="modal-btns gui-primary-color">确认</text>
  145. </view>
  146. </view>
  147. </template>
  148. </gui-modal>
  149. <uni-popup ref="errorTip" type="dialog">
  150. <uni-popup-dialog type="error" cancel-text="关闭" confirm-text="确认" title="提示"
  151. :content="errorTipMessage" @confirm="handleCloseErrorTipsModal"
  152. @close="handleCloseErrorTipsModal" />
  153. </uni-popup>
  154. <!-- FIFO 二次确认弹窗 -->
  155. <uni-popup ref="fifoPopup" type="dialog">
  156. <uni-popup-dialog
  157. title="FIFO 提示"
  158. :content="fifoMsg"
  159. confirm-text="继续"
  160. cancel-text="取消"
  161. @confirm="fifoContinue"
  162. @close="fifoCancel" />
  163. </uni-popup>
  164. </view>
  165. </template>
  166. </gui-page>
  167. </template>
  168. <script>
  169. import {
  170. onReachBottom
  171. } from '@dcloudio/uni-app'
  172. import {
  173. ref,
  174. onMounted,
  175. defineComponent,
  176. onBeforeMount,
  177. computed,
  178. watch,
  179. nextTick
  180. } from 'vue'
  181. export default defineComponent({
  182. setup(options) {
  183. const popup = ref()
  184. const queryParams = ref({
  185. pageSize: 20,
  186. pageNo: 1,
  187. masterId: options?.id ?? '',
  188. wmsProductionWorkOrderBomId: options?.id ?? ''
  189. })
  190. const errorTip = ref('')
  191. const errorTipMessage = ref('')
  192. const easyinput = ref('')
  193. const partInput = ref(null) // ref 指向料号输入框
  194. const tmMaterialNo = ref('') // 料号
  195. const tmId = ref('') // 贴纸ID
  196. const tmInput = ref(null) // ref 指向贴纸ID输入框
  197. const scanTie = ref(0) // 控制贴纸和料号扫描框显示
  198. const errorState = ref(0)
  199. const modalForm = ref()
  200. const parentRow = uni.getStorageSync('masterId') ?? {}
  201. const masterId = ref('')
  202. const businessType = ref('')
  203. // const saveId = ref('')
  204. const signInput = ref()
  205. const signText = ref('')
  206. const isLightText = ref('')
  207. const isSubmitLight = ref('')
  208. const scanBatchNumber = ref('')
  209. const isBefore = ref(false)
  210. const tableData = ref([])
  211. const beforeTableData = ref([])
  212. const scanMaterialList = ref([])
  213. const receiveList = ref([])
  214. const currentWarehouseId = ref('')
  215. const currentWarehouseName = ref('')
  216. // 当前处理的数据行
  217. const fdIndex = ref(-1)
  218. // 当前扫描的物料
  219. const currentScanMaterial = ref([])
  220. // 前端临时缓存:已扫物料
  221. const localScannedList = ref([])
  222. // 控制保存按钮能否点击
  223. const saveDisabled = ref(false)
  224. // 控制提交按钮能否点击
  225. const submitDisabled = ref(false)
  226. /* -------------------- 下面 4 行是新增变量 -------------------- */
  227. const fifoPopup = ref(null) // 弹窗实例
  228. const fifoMsg = ref('') // 提示语
  229. let fifoQrCode = '' // 缓存本次二维码
  230. const fifoGo = ref(false) // 用户是否点了“继续”
  231. // 存储fifo_check_order_type字典数据
  232. const fifoCheckOrderTypeDict = ref([])
  233. // 标记businessType是否在fifo_check_order_type字典内
  234. const isBusinessTypeInFifoDict = ref(false)
  235. onBeforeMount(() => {
  236. const parsedData = JSON.parse(parentRow)
  237. masterId.value = parsedData?.id
  238. businessType.value = parsedData?.businessType || '0'
  239. console.log('获取到的businessType:', businessType.value)
  240. if (businessType.value == '5') {
  241. submitDisabled.value = true
  242. }
  243. // 获取fifo_check_order_type字典数据
  244. getFifoCheckOrderTypeDict()
  245. })
  246. // 获取fifo_check_order_type字典数据
  247. const getFifoCheckOrderTypeDict = function() {
  248. uni.$reqGet('getDictDataPage', {
  249. dictType: 'fifo_check_order_type'
  250. })
  251. .then(({ code, data, msg }) => {
  252. if (code === 0) {
  253. fifoCheckOrderTypeDict.value = data?.list || []
  254. console.log('fifo_check_order_type字典数据:', fifoCheckOrderTypeDict.value)
  255. console.log('fifo_check_order_type字典数据长度:', fifoCheckOrderTypeDict.value.length)
  256. // 判断businessType是否在字典内
  257. checkBusinessTypeInFifoDict()
  258. } else {
  259. console.error('获取fifo_check_order_type字典失败:', msg)
  260. }
  261. })
  262. .catch(error => {
  263. console.error('获取fifo_check_order_type字典异常:', error)
  264. })
  265. }
  266. // 判断businessType是否在fifo_check_order_type字典内
  267. const checkBusinessTypeInFifoDict = function() {
  268. // 使用some方法检查businessType是否存在于字典数据中
  269. isBusinessTypeInFifoDict.value = fifoCheckOrderTypeDict.value.some(item =>
  270. String(item?.value).trim() === String(businessType.value).trim()
  271. )
  272. console.log('businessType是否在fifo_check_order_type字典内:', isBusinessTypeInFifoDict.value)
  273. }
  274. const search = function() {
  275. uni.$reqGet('getScannedOutMatersDetails', { id: masterId.value })
  276. .then(({ code, data, msg }) => {
  277. if (code === 0) {
  278. uni.setStorageSync('ids', JSON.stringify(data?.inoutRequestDetailPDARespVOList?.[0] || {}))
  279. // saveId.value = data?.id
  280. receiveList.value = data
  281. scanTie.value = data?.scanTie
  282. currentWarehouseId.value = data?.warehouseId
  283. currentWarehouseName.value = data?.warehouseName
  284. tableData.value = data?.inoutRequestDetailPDARespVOList || []
  285. console.log('获取到的scanTie:', scanTie.value)
  286. // 1. 先清空本地已扫列表,准备重新填充
  287. localScannedList.value = []
  288. // 2. 将后端返回的已扫物料数据塞进localScannedList
  289. tableData.value.forEach(item => {
  290. if (item.inoutRequestSubdetailList?.length) {
  291. localScannedList.value.push(...item.inoutRequestSubdetailList)
  292. }
  293. })
  294. // 3. 调用flushBeforeTableData(),以localScannedList为准重新生成beforeTableData
  295. flushBeforeTableData()
  296. // // 新增:根据 scanTie 决定首次焦点
  297. // nextTick(() => {
  298. // if (Number(scanTie.value) === 1) {
  299. // // 先让贴纸 ID 框聚焦
  300. // tmInput.value.onBlur()
  301. // tmInput.value.onFocus()
  302. // } else {
  303. // setInputFocus()
  304. // }
  305. // })
  306. } else {
  307. uni.showToast({
  308. title: msg,
  309. icon: 'none',
  310. duration: 2000
  311. })
  312. }
  313. })
  314. }
  315. onMounted(() => {
  316. search()
  317. })
  318. const goBack = function() {
  319. if (uni.getStorageSync('masterId')) {
  320. uni.removeStorageSync('masterId')
  321. }
  322. if (uni.getStorageSync('ids')) {
  323. uni.removeStorageSync('ids')
  324. }
  325. uni.$goBack('/pages/workbranch/warehouse/scanInOut/Out/scanOutPage')
  326. }
  327. const handleScanMaterial = async function() {
  328. // #ifdef APP-PLUS
  329. /* 0. 基本校验 */
  330. /* 1. 先调摄像头 */
  331. const mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module');
  332. const ret = await new Promise(resolve =>
  333. mpaasScanModule.mpaasScan(
  334. { scanType: ['qrCode', 'barCode'], hideAlbum: false },
  335. resolve
  336. )
  337. );
  338. if (ret.resp_code !== 1000) return;
  339. const qrCode = ret.resp_result;
  340. /* 2. FIFO 校验 */
  341. const ok = await checkFifo(qrCode);
  342. if (!ok && !fifoGo.value) {
  343. // 新增:清空二维码框并重新聚焦
  344. resetAllInputs() // 如果你只想清二维码,也可以只写 scanBatchNumber.value = ''
  345. nextTick(() => easyinput.value.onFocus())
  346. return;
  347. }
  348. /* 3. 业务接口 */
  349. uni.$reqGet('scanPrepareMaterial', {
  350. qrCode,
  351. requestNo: receiveList.value.requestNo,
  352. businessType: receiveList.value.businessType,
  353. tmMaterialNo: tmMaterialNo.value.trim(),
  354. tmId: tmId.value.trim()
  355. })
  356. .then(({ code, data, msg }) => {
  357. fifoGo.value = false;
  358. if (code !== 0) {
  359. // #ifdef APP-PLUS
  360. plus.device.beep(2);
  361. // #endif
  362. resetAllInputs(); // ← 新增
  363. errorTipMessage.value = msg;
  364. errorTip.value.open();
  365. errorState.value = 0;
  366. /* 补焦点 */
  367. nextTick(() => {
  368. Number(scanTie.value) === 1 ? tmInput.value.onFocus() : easyinput.value.onFocus()
  369. });
  370. return;
  371. }
  372. /* ---------- 新增仓库ID校验 ---------- */
  373. if (!validateWarehouseId(data)) {
  374. return; // 仓库ID不一致,终止后续逻辑
  375. }
  376. /* ------------------------------------ */
  377. /* ---------- 新增批号重复校验 ---------- */
  378. const cur = Array.isArray(data) ? data[0] : data;
  379. if (cur && isBatchExist(cur.batchNumber)) {
  380. showBatchRepeatTip();
  381. return;// 直接终止
  382. }
  383. /* ------------------------------------ */
  384. scanBatchNumber.value = qrCode;
  385. // 以下保持你原有逻辑不变
  386. if (Object.prototype.toString.call(data) === '[object Array]') {
  387. fdIndex.value = tableData.value.findIndex(
  388. (item) => item?.materialNo === data[0]?.materialNo
  389. );
  390. }
  391. if (fdIndex.value === -1) {
  392. // #ifdef APP-PLUS
  393. plus.device.beep(2);
  394. // #endif
  395. errorTipMessage.value = '请扫描所需物料的物料条码';
  396. errorTip.value.open();
  397. errorState.value = 0;
  398. return;
  399. }
  400. currentScanMaterial.value = data[0] ?? [];
  401. const row = tableData.value[fdIndex.value];
  402. if (row.nowDeliveredQty > row.completedQty) {
  403. /* ===== 前端暂存逻辑 ===== */
  404. row.completedQty += currentScanMaterial.value.receiptQty || 1;
  405. localScannedList.value.push({
  406. ...currentScanMaterial.value,
  407. batchQty: currentScanMaterial.value.receiptQty || 1,
  408. supplierName: currentScanMaterial.value.supplierName || '',
  409. });
  410. flushBeforeTableData();
  411. /* 唯一成功出口:全部清空 */
  412. resetAllInputs();
  413. /* 再决定下一个焦点 */
  414. nextTick(() => {
  415. Number(scanTie.value) === 1
  416. ? tmInput.value.onFocus() // 贴纸模式→回到贴纸框
  417. : easyinput.value.onFocus() // 原模式→回到二维码框
  418. });
  419. } else {
  420. // #ifdef APP-PLUS
  421. plus.device.beep(2);
  422. // #endif
  423. errorTipMessage.value = '已备数量已满,无需再扫';
  424. errorTip.value.open();
  425. errorState.value = 0;
  426. }
  427. }).catch(() => {
  428. // 异常也要复位
  429. fifoGo.value = false;
  430. });
  431. // #endif
  432. };
  433. const handleToNavigate = function() {
  434. uni.navigateTo({
  435. url: '/pages/workbranch/warehouse/production/materialIssuance'
  436. })
  437. }
  438. const handleComplete = function(e) {
  439. // #ifdef APP-PLUS
  440. // 扫描员工工号
  441. uni.$reqPost('scanPrepareMaterialSign', {
  442. encodedEmployeeId: e,
  443. id: masterId.value
  444. })
  445. .then(({
  446. code,
  447. data,
  448. msg
  449. }) => {
  450. if (code === 0) {
  451. uni.showToast({
  452. title: '扫码成功',
  453. icon: 'none',
  454. duration: 2000
  455. })
  456. setTimeout(() => {
  457. goBack();
  458. }, 500)
  459. } else {
  460. // #ifdef APP-PLUS
  461. plus.device.beep(2)
  462. // #endif
  463. errorTipMessage.value = msg
  464. errorTip.value.open()
  465. errorState.value = -1
  466. }
  467. isLightText.value = false
  468. signText.value = ''
  469. })
  470. // #endif
  471. }
  472. // 物料拆分
  473. const handleSplitMaterial = function() {
  474. uni.$reqPost('prepareSplit', {
  475. prepareId: masterId.value,
  476. id: scanBatchNumber.value,
  477. inQty: currentScanMaterial.value?.receiptQty,
  478. splitQty: tableData.value[fdIndex.value].completedQty - currentScanMaterial.value?.receiptQty
  479. })
  480. .then(res => {
  481. search()
  482. modalForm.value.close()
  483. if (res.code === 0) {
  484. // 调取打印机拆分物料后打印标签
  485. uni.showToast({
  486. title: '拆分完毕',
  487. icon: 'none',
  488. duration: 2000
  489. })
  490. } else {
  491. // #ifdef APP-PLUS
  492. plus.device.beep(2)
  493. // #endif
  494. errorTipMessage.value = res.msg
  495. errorTip.value.open()
  496. errorState.value = 0
  497. }
  498. })
  499. }
  500. const handleKeydown = async function (e) {
  501. const qrCode = e;
  502. /* ===== 新增 FIFO 校验 ===== */
  503. const ok = await checkFifo(qrCode);
  504. if (!ok && !fifoGo.value) {
  505. resetAllInputs()
  506. nextTick(() => easyinput.value.onFocus())
  507. return;
  508. }
  509. /* ========================= */
  510. uni.$reqGet('scanPrepareMaterial', {
  511. qrCode,
  512. requestNo: receiveList.value.requestNo,
  513. businessType: receiveList.value.businessType,
  514. tmMaterialNo: tmMaterialNo.value.trim(),
  515. tmId: tmId.value.trim(),
  516. })
  517. .then(async ({ code, data, msg }) => {
  518. scanBatchNumber.value = qrCode;
  519. fifoGo.value = false;
  520. if (code !== 0) {
  521. // #ifdef APP-PLUS
  522. plus.device.beep(2);
  523. // #endif
  524. /* 1. 全部输入框清空(含二维码) */
  525. resetAllInputs()
  526. errorTipMessage.value = msg;
  527. errorTip.value.open();
  528. errorState.value = 0;
  529. /* 2. 焦点回到正确的输入框 */
  530. nextTick(() => {
  531. Number(scanTie.value) === 1 ? tmInput.value.onFocus() : easyinput.value.onFocus()
  532. });
  533. return;
  534. }
  535. /* ---------- 新增仓库ID校验 ---------- */
  536. if (!validateWarehouseId(data)) {
  537. return; // 仓库ID不一致,终止后续逻辑
  538. }
  539. /* ------------------------------------ */
  540. /* ---------- 新增批号重复校验 ---------- */
  541. const cur = Array.isArray(data) ? data[0] : data;
  542. if (cur && isBatchExist(cur.batchNumber)) {
  543. showBatchRepeatTip();
  544. return;// 直接终止
  545. }
  546. /* ------------------------------------ */
  547. if (Object.prototype.toString.call(data) === '[object Array]') {
  548. fdIndex.value = tableData.value.findIndex(
  549. (item) => item?.materialNo === data[0]?.materialNo
  550. );
  551. }
  552. if (fdIndex.value === -1) {
  553. // #ifdef APP-PLUS
  554. plus.device.beep(2);
  555. // #endif
  556. errorTipMessage.value = '请扫描所需物料的物料条码';
  557. errorTip.value.open();
  558. errorState.value = 0;
  559. return;
  560. }
  561. currentScanMaterial.value = data[0] ?? [];
  562. const row = tableData.value[fdIndex.value];
  563. if (row.nowDeliveredQty > row.completedQty) {
  564. /* ===== 前端暂存逻辑 ===== */
  565. row.completedQty += currentScanMaterial.value.receiptQty || 1;
  566. localScannedList.value.push({
  567. ...currentScanMaterial.value,
  568. batchQty: currentScanMaterial.value.receiptQty || 1,
  569. supplierName: currentScanMaterial.value.supplierName || '',
  570. });
  571. flushBeforeTableData();
  572. setInputFocus();
  573. } else {
  574. // #ifdef APP-PLUS
  575. plus.device.beep(2);
  576. // #endif
  577. errorTipMessage.value = '已备数量已满,无需再扫';
  578. errorTip.value.open();
  579. errorState.value = 0;
  580. }
  581. }).catch(() => {
  582. // 异常也要复位
  583. fifoGo.value = false
  584. });
  585. };
  586. const handleToDetails = function(ret) {
  587. uni.navigateTo({
  588. url: '/pages/workbranch/warehouse/scanInOut/Out/materialsDetail'
  589. })
  590. uni.setStorageSync('mixMaterialDetail', JSON.stringify(ret))
  591. }
  592. // 设置高亮
  593. const handleBtnLight = function() {
  594. // #ifdef APP-PLUS
  595. signInput.value.onBlur()
  596. isLightText.value = true
  597. signInput.value.onFocus()
  598. // #endif
  599. }
  600. const setInputFocus = function() {
  601. if (Number(scanTie.value) === 1) {
  602. // 闭环:回到贴纸 ID
  603. nextTick(() => {
  604. tmInput.value.onBlur()
  605. tmInput.value.onFocus()
  606. })
  607. } else {
  608. // 原逻辑:继续在二维码框循环
  609. easyinput.value.onBlur()
  610. easyinput.value.onFocus()
  611. }
  612. }
  613. /* 统一出口:清空所有输入框 */
  614. const resetAllInputs = () => {
  615. scanBatchNumber.value = ''
  616. tmMaterialNo.value = ''
  617. tmId.value = ''
  618. }
  619. /* ===== 2. 键盘回车 ===== */
  620. const handlePartKeydown = async (e) => {
  621. const desc = tmMaterialNo.value.trim()
  622. if (!desc) return
  623. await queryPart(desc)
  624. }
  625. /* ===== 3. 右侧图标点击 ===== */
  626. const handleQueryPart = async () => {
  627. const desc = tmMaterialNo.value.trim()
  628. if (!desc) return
  629. await queryPart(desc)
  630. }
  631. /* ===== 4. 真正查料号 ===== */
  632. /* ===== 料号框:只保存,不调接口 ===== */
  633. const queryPart = (desc) => {
  634. tmMaterialNo.value = desc.trim() // 1. 保存
  635. if (Number(scanTie.value) === 1) {
  636. nextTick(() => { // 2. 跳二维码框
  637. easyinput.value.onBlur()
  638. easyinput.value.onFocus()
  639. })
  640. } else {
  641. nextTick(() => easyinput.value.onFocus())
  642. }
  643. }
  644. /* ===== 5. 料号框重新聚焦 ===== */
  645. const setPartFocus = () => {
  646. if (Number(scanTie.value) === 1) {
  647. nextTick(() => {
  648. easyinput.value.onBlur()
  649. easyinput.value.onFocus()
  650. })
  651. } else {
  652. // 非贴纸模式保持原逻辑(仅保存)
  653. partInput.value.onBlur()
  654. partInput.value.onFocus()
  655. }
  656. }
  657. /* ===== 2. 仅保存贴纸ID,不请求 ===== */
  658. const setTmOnly = () => {
  659. tmId.value = tmId.value.trim()
  660. if (Number(scanTie.value) === 1) {
  661. // 只在贴纸模式下才自动跳料号
  662. nextTick(() => {
  663. partInput.value.onBlur()
  664. partInput.value.onFocus()
  665. })
  666. } else {
  667. // 非贴纸模式保持原逻辑(仅保存)
  668. tmInput.value.onBlur()
  669. tmInput.value.onFocus()
  670. }
  671. }
  672. // 相同物料+相同批号才合并数量,否则新增一行
  673. const flushBeforeTableData = function() {
  674. const map = new Map()
  675. localScannedList.value.forEach(it => {
  676. // 用“物料编码+批号”当唯一键
  677. const key = `${it.materialNo}__${it.batchNumber}`
  678. if (map.has(key)) {
  679. map.get(key).batchQty += it.batchQty // 同批号累加
  680. } else {
  681. map.set(key, { ...it })// 新批号新开一行
  682. }
  683. })
  684. // 为每个项目添加唯一ID和滑动属性
  685. beforeTableData.value = Array.from(map.values()).map((v, i) => ({
  686. ...v,
  687. uniqueId: `${v.materialNo}_${v.batchNumber}_${i}`,
  688. slideX: 0
  689. }))
  690. }
  691. /* ========= 左滑删除 ========= */
  692. const touchStart = (e) => {
  693. const idx = e.currentTarget.dataset.index
  694. beforeTableData.value.forEach((v, i) => {
  695. if (i !== idx) v.slideX = 0 // 其余归位
  696. })
  697. beforeTableData.value[idx].startX = e.touches[0].pageX
  698. beforeTableData.value[idx].slideX = beforeTableData.value[idx].slideX || 0
  699. }
  700. const touchMove = (e) => {
  701. const idx = e.currentTarget.dataset.index
  702. const row = beforeTableData.value[idx]
  703. const delta = e.touches[0].pageX - row.startX
  704. if (delta < 0) { // 只允许左滑
  705. row.slideX = Math.max(delta, -70) // 70 = 按钮宽度
  706. } else {
  707. row.slideX = Math.min(delta, 0)
  708. }
  709. }
  710. const touchEnd = (e) => {
  711. const idx = e.currentTarget.dataset.index
  712. const row = beforeTableData.value[idx]
  713. row.slideX = row.slideX <= -35 ? -70 : 0 // 过半则露出,否则收回
  714. }
  715. /**
  716. * 删除一条已扫物料
  717. * @param {number} idx 在 beforeTableData 中的下标
  718. */
  719. const deleteItem = async (idx) => {
  720. const target = beforeTableData.value[idx];
  721. /* 1. 有 id 就先调接口删后端 */
  722. if (target.id) {
  723. try {
  724. const { code, msg } = await uni.$reqDelete('deleteScanOutMaterial', { id: target.id });
  725. if (code !== 0) {
  726. // 接口明确返回失败,提示用户并终止后续逻辑
  727. errorTipMessage.value = msg || '后端删除失败';
  728. errorTip.value.open();
  729. return;
  730. }
  731. } catch (err) {
  732. // 网络或其它异常
  733. errorTipMessage.value = err.errMsg || '网络异常,删除失败';
  734. errorTip.value.open();
  735. return;
  736. }
  737. }
  738. /* 2. 无论有没有 id、接口成不成功,只要走到这里就删本地 */
  739. // 2.1 从 localScannedList 里删掉对应项(同物料+同批号)
  740. const key = `${target.materialNo}__${target.batchNumber}`;
  741. const listIdx = localScannedList.value.findIndex(
  742. v => `${v.materialNo}__${v.batchNumber}` === key
  743. );
  744. if (listIdx > -1) localScannedList.value.splice(listIdx, 1);
  745. // 2.2 重新合并生成 beforeTableData
  746. flushBeforeTableData();
  747. // 2.3 把对应物料的“已备数”回退
  748. const row = tableData.value.find(r => r.materialNo === target.materialNo);
  749. if (row) row.completedQty -= target.batchQty;
  750. }
  751. // 关闭错误信息弹窗
  752. const handleCloseErrorTipsModal = async function() {
  753. errorTip.value.close()
  754. if (errorState.value === 0) {
  755. await setInputFocus()
  756. }
  757. }
  758. /* ===================== 公共校验函数 ===================== */
  759. // 仓库ID校验函数
  760. const validateWarehouseId = (scanData) => {
  761. // businessType 为 '1' 时跳过仓库ID校验
  762. if (businessType.value == '1') {
  763. return true;
  764. }
  765. const cur = Array.isArray(scanData) ? scanData[0] : scanData;
  766. if (cur && cur.warehouseId && currentWarehouseId.value && cur.warehouseId !== currentWarehouseId.value) {
  767. // #ifdef APP-PLUS
  768. plus.device.beep(2);
  769. // #endif
  770. errorTipMessage.value = `物料仓库(${cur.erpStockName})与当前仓库(${currentWarehouseName.value})不一致`;
  771. errorTip.value.open();
  772. errorState.value = 0;
  773. return false;
  774. }
  775. return true;
  776. };
  777. // 仅扫描本地缓存池,不再读 beforeTableData
  778. const isBatchExist = (batchNo) =>
  779. beforeTableData.value.some((it) => it.batchNumber === batchNo);
  780. const showBatchRepeatTip = () => {
  781. // #ifdef APP-PLUS
  782. plus.device.beep(2);
  783. // #endif
  784. errorTipMessage.value = '该批号已存在,请勿重复扫描';
  785. errorTip.value.open();
  786. errorState.value = 0;
  787. };
  788. // 禁用软键盘
  789. const handleInputFocus = function() {
  790. setTimeout(() => {
  791. uni.hideKeyboard()
  792. }, 100)
  793. }
  794. // 把 beforeTableData 追加到 tableData 对应物料的 inoutRequestSubdetailList
  795. const mergeBeforeIntoTable = () => {
  796. // 创建新数组存储合并结果
  797. const mergedTableData = JSON.parse(JSON.stringify(tableData.value))
  798. // 先建索引
  799. const map = {}
  800. mergedTableData.forEach(row => {
  801. if (!row.inoutRequestSubdetailList) row.inoutRequestSubdetailList = []
  802. map[row.materialNo] = row
  803. })
  804. // 只追加,不新增
  805. beforeTableData.value.forEach(item => {
  806. const target = map[item.materialNo]
  807. if (target) {
  808. target.inoutRequestSubdetailList.push({ ...item }) // 整条记录丢进去
  809. }
  810. // 不存在就跳过
  811. })
  812. return mergedTableData
  813. }
  814. // 保存按钮点击事件
  815. const handleSave = async function() {
  816. if (saveDisabled.value) return
  817. saveDisabled.value = true
  818. try {
  819. // 保存逻辑实现
  820. isLightText.value = true
  821. // 先合并数据,获取合并后的新数组
  822. const mergedData = mergeBeforeIntoTable()
  823. // 调用保存API,使用合并后的新数组作为参数
  824. await uni.$reqPost('saveScannedOutMaterials', {
  825. id: receiveList.value?.id,
  826. requestNo: receiveList.value?.requestNo,
  827. requestType: receiveList.value?.requestType,
  828. businessType: receiveList.value?.businessType,
  829. businessSubType: receiveList.value?.businessSubType,
  830. status: receiveList.value?.status,
  831. priority: receiveList.value?.priority,
  832. inoutRequestDetailPDASaveReqVOList: mergedData
  833. })
  834. .then(({ code, data, msg }) => {
  835. if (code === 0) {
  836. uni.showModal({
  837. title: '提示',
  838. content: '保存成功',
  839. showCancel: false
  840. })
  841. search();
  842. } else {
  843. // #ifdef APP-PLUS
  844. plus.device.beep(2)
  845. // #endif
  846. errorTipMessage.value = msg
  847. errorTip.value.open()
  848. errorState.value = 0
  849. }
  850. })
  851. } finally {
  852. saveDisabled.value = false
  853. }
  854. }
  855. // 提交按钮点击事件
  856. const handleSubmit = async function() {
  857. if (submitDisabled.value) return
  858. submitDisabled.value = true
  859. try {
  860. // 提交逻辑实现
  861. isSubmitLight.value = true
  862. // 先合并数据,获取合并后的新数组
  863. const mergedData = mergeBeforeIntoTable()
  864. // 调用提交API,使用合并后的新数组作为参数
  865. await uni.$reqPut('submitScannedOutMaterials', {
  866. id: receiveList.value?.id,
  867. requestNo: receiveList.value?.requestNo,
  868. requestType: receiveList.value?.requestType,
  869. businessType: receiveList.value?.businessType,
  870. businessSubType: receiveList.value?.businessSubType,
  871. status: receiveList.value?.status,
  872. priority: receiveList.value?.priority,
  873. inoutRequestDetailPDASaveReqVOList: mergedData
  874. })
  875. .then(({ code, data, msg }) => {
  876. if (code === 0) {
  877. uni.showModal({
  878. title: '提示',
  879. content: '提交成功',
  880. showCancel: false
  881. })
  882. search();
  883. // 保存成功后可以跳转到其他页面或执行其他操作
  884. // goBack()
  885. } else {
  886. // #ifdef APP-PLUS
  887. plus.device.beep(2)
  888. // #endif
  889. errorTipMessage.value = msg
  890. errorTip.value.open()
  891. errorState.value = 0
  892. }
  893. })
  894. } finally {
  895. submitDisabled.value = false
  896. }
  897. }
  898. // uniapp移动端触底事件
  899. onReachBottom(() => {
  900. queryParams.value.pageNo += 1
  901. uni.$reqGet('getPrepareMaterialList', queryParams.value)
  902. .then(({
  903. data
  904. }) => {
  905. Array.prototype.push.call(scanMaterialList.value, ...data?.list ?? [])
  906. })
  907. })
  908. // 保存按钮文字样式
  909. const saveBtnTextStyle = computed(() => ({
  910. fontSize: '14px',
  911. fontWeight: 'bold',
  912. color: saveDisabled.value ? '#ccc' : (isLightText.value ? 'rgba(0,160,233,1)' : '')
  913. }))
  914. // 提交按钮文字样式
  915. const submitBtnTextStyle = computed(() => ({
  916. fontSize: '14px',
  917. fontWeight: 'bold',
  918. color: submitDisabled.value ? '#ccc' : (isSubmitLight.value ? 'rgba(0,160,233,1)' : '')
  919. }))
  920. // 移除status监听,提交按钮和保存按钮均始终可用
  921. // watch(() => receiveList.value?.status, (newStatus) => {
  922. // submitDisabled.value = newStatus !== 0
  923. // })
  924. /* -------------------- 新增 3 个方法 -------------------- */
  925. // 真正继续扫码(关闭弹窗并置标志)
  926. const fifoContinue = () => {
  927. fifoPopup.value.close()
  928. fifoGo.value = true
  929. // 用下一个 tick 把老流程续起来
  930. nextTick(() => {
  931. if (fifoQrCode) handleKeydown(fifoQrCode)
  932. })
  933. }
  934. const fifoCancel = () => { fifoPopup.value.close() } // 什么都不做
  935. // 统一 FIFO 校验入口
  936. const checkFifo = (qrCode) => {
  937. // 用户已点“继续”,直接放行
  938. if (fifoGo.value) return Promise.resolve(true)
  939. if (!isBusinessTypeInFifoDict.value) return Promise.resolve(true)
  940. return uni.$reqPost('fifoCheck', { qrCode,
  941. requestNo: receiveList.value.requestNo,
  942. businessType: receiveList.value.businessType,
  943. }).then(({ code, data, msg }) => {
  944. if (code !== 0) {
  945. errorTipMessage.value = msg || 'FIFO 校验异常'
  946. errorTip.value.open()
  947. return false
  948. }
  949. if (data === null) return true
  950. fifoMsg.value = `当前条码(${qrCode})不是库存中生产日期最早的物料条码(${data}),是否继续发料?`
  951. fifoQrCode = qrCode
  952. fifoPopup.value.open()
  953. return false
  954. })
  955. }
  956. return {
  957. goBack,
  958. popup,
  959. signText,
  960. isBefore,
  961. tableData,
  962. beforeTableData,
  963. signInput,
  964. modalForm,
  965. easyinput,
  966. errorTip,
  967. errorTipMessage,
  968. handleInputFocus,
  969. isLightText,
  970. isSubmitLight,
  971. handleBtnLight,
  972. handleKeydown,
  973. scanBatchNumber,
  974. handleScanMaterial,
  975. handleToNavigate,
  976. saveDisabled,
  977. submitDisabled,
  978. saveBtnTextStyle,
  979. submitBtnTextStyle,
  980. scanMaterialList,
  981. handleComplete,
  982. handleSplitMaterial,
  983. handleToDetails,
  984. handleCloseErrorTipsModal,
  985. handleSubmit,
  986. handleSave,
  987. // 左滑删除相关
  988. touchStart,
  989. touchMove,
  990. touchEnd,
  991. deleteItem,
  992. scanTie,
  993. // 料号输入相关
  994. tmMaterialNo,
  995. partInput,
  996. handlePartKeydown,
  997. handleQueryPart,
  998. // 贴纸ID输入相关
  999. tmId,
  1000. tmInput,
  1001. setTmOnly,
  1002. // FIFO相关
  1003. fifoPopup,
  1004. fifoMsg,
  1005. fifoContinue,
  1006. fifoCancel
  1007. }
  1008. }
  1009. })
  1010. </script>
  1011. <style lang="scss" scoped>
  1012. .gui-header-leader-btns {
  1013. color: black;
  1014. font-size: 24px !important;
  1015. margin-left: 24rpx;
  1016. }
  1017. .list-content {
  1018. margin-top: 80px;
  1019. background-color: #edeeee;
  1020. }
  1021. .card-list-flexbox {
  1022. display: flex;
  1023. flex-direction: row;
  1024. align-items: center;
  1025. flex-wrap: wrap;
  1026. margin: 3px 2px;
  1027. .card-list-item {
  1028. width: 750rpx;
  1029. height: 40px;
  1030. margin: 2rpx 0;
  1031. display: flex;
  1032. flex-direction: row;
  1033. align-items: center;
  1034. justify-content: space-between;
  1035. background-color: #fff;
  1036. uni-text {
  1037. font-size: 14px;
  1038. height: 50rpx;
  1039. text-align: left;
  1040. padding: 0 12px;
  1041. display: flex;
  1042. flex-direction: row;
  1043. align-items: center;
  1044. }
  1045. .text-1 {
  1046. flex: 1;
  1047. height: 40px;
  1048. justify-content: flex-start;
  1049. }
  1050. .text-2 {
  1051. flex: 3;
  1052. height: 40px;
  1053. justify-content: flex-end;
  1054. margin-right: 4px;
  1055. padding: 2px 6px;
  1056. }
  1057. }
  1058. }
  1059. .card-list-flexbox:nth-of-type(2) {
  1060. margin-top: 48px;
  1061. }
  1062. .fixedTop {
  1063. bottom: 0 !important;
  1064. top: 3.25rem !important;
  1065. }
  1066. .popup-content {
  1067. height: 75vh;
  1068. overflow-y: scroll;
  1069. background-color: #edeeee;
  1070. }
  1071. .font-icons {
  1072. width: 40px;
  1073. font-size: 20px;
  1074. }
  1075. .scan {
  1076. height: 45px;
  1077. width: calc(100% - 48px);
  1078. margin: 12px;
  1079. padding: 0 12px;
  1080. display: flex;
  1081. justify-content: space-between;
  1082. align-items: center;
  1083. border-radius: 6px;
  1084. background-color: white;
  1085. .scan-card {
  1086. width: 100%;
  1087. display: grid;
  1088. grid-template-rows: 1fr;
  1089. grid-template-columns: 7fr 2fr;
  1090. align-items: center;
  1091. input {
  1092. height: 35px;
  1093. line-height: 35px;
  1094. }
  1095. text {
  1096. width: 100%;
  1097. text-align: right;
  1098. }
  1099. }
  1100. }
  1101. .custom-table {
  1102. height: calc(100vh - 265px);
  1103. min-height: 230px;
  1104. margin: 5px 0;
  1105. // min-height: 600px;
  1106. overflow-y: scroll;
  1107. }
  1108. .modal-btns {
  1109. height: 100rpx;
  1110. line-height: 100rpx;
  1111. display: flex;
  1112. justify-content: center;
  1113. align-items: center;
  1114. }
  1115. .line {
  1116. margin-top: 10rpx;
  1117. height: 80rpx;
  1118. width: 1rpx;
  1119. background-color: #dcdcdc;
  1120. }
  1121. .tabs {
  1122. width: 100%;
  1123. height: 45px;
  1124. display: flex;
  1125. align-items: flex-end;
  1126. padding: 0 2px;
  1127. background-color: white;
  1128. .tabs-list {
  1129. border-radius: 3px;
  1130. overflow: hidden;
  1131. }
  1132. .tabs-item {
  1133. display: inline-block;
  1134. width: 72px;
  1135. height: 30px;
  1136. line-height: 30px;
  1137. padding: 0 8px;
  1138. font-size: 14px;
  1139. font-weight: bold;
  1140. text-align: center;
  1141. color: black;
  1142. border-bottom: 1.5px dashed #00a0e9;
  1143. transition: all .5s ease-in-out;
  1144. }
  1145. .tabs-item-active {
  1146. position: relative;
  1147. display: inline-block;
  1148. width: 72px;
  1149. height: 30px;
  1150. line-height: 30px;
  1151. padding: 0 8px;
  1152. font-size: 14px;
  1153. font-weight: bold;
  1154. text-align: center;
  1155. color: white;
  1156. border-left: 1px solid #00a0e9;
  1157. border-top: 1px solid #00a0e9;
  1158. border-right: 1px solid #00a0e9;
  1159. border-bottom: 1.5px solid #00a0e9;
  1160. border-radius: 5px 5px 0 0;
  1161. animation: .3s linear show;
  1162. background-color: #00a0e9;
  1163. }
  1164. .tabs-item-active::before {
  1165. content: '';
  1166. position: absolute;
  1167. left: -10px;
  1168. bottom: 0;
  1169. width: 10px;
  1170. height: 10px;
  1171. background: radial-gradient(circle at 0% 25%, transparent 10px, #00a0e9 0)
  1172. }
  1173. .tabs-item-active::after {
  1174. content: '';
  1175. position: absolute;
  1176. right: -10px;
  1177. bottom: 0;
  1178. width: 10px;
  1179. height: 10px;
  1180. background: radial-gradient(circle at 100% 25%, transparent 10px, #00a0e9 0)
  1181. }
  1182. }
  1183. @keyframes show {
  1184. from {
  1185. transform: translateY(5%);
  1186. }
  1187. to {
  1188. transform: translateY(0%);
  1189. }
  1190. }
  1191. .sign-btn {
  1192. display: flex;
  1193. align-items: center;
  1194. justify-content: center;
  1195. margin: 0 8px;
  1196. border: 1px solid #999999;
  1197. background-color: white;
  1198. border-radius: 6px;
  1199. }
  1200. .sign-btn.disabled {
  1201. border-color: #ccc;
  1202. background-color: #f5f5f5;
  1203. pointer-events: none;
  1204. }
  1205. /* 左滑删除样式 */
  1206. .scroll-box{
  1207. height:100%; /* 继承父级高度 */
  1208. }
  1209. .cell-row {
  1210. display: flex;
  1211. background-color: #f5f7fa;
  1212. font-weight: bold;
  1213. border-radius: 4px;
  1214. margin-bottom: 5px;
  1215. }
  1216. .swipe-row{
  1217. position:relative;
  1218. width:100%;
  1219. height:44px;
  1220. overflow:hidden;
  1221. border-bottom:1px solid #eee;
  1222. margin-bottom: 5px;
  1223. border-radius: 4px;
  1224. }
  1225. .content-area{
  1226. position:absolute;
  1227. left:0;
  1228. top:0;
  1229. right:0;
  1230. bottom:0;
  1231. z-index:2;
  1232. background:#fff;
  1233. display:flex;
  1234. align-items:center;
  1235. transition: transform .25s;
  1236. border-radius: 4px;
  1237. }
  1238. .cell1{
  1239. flex:2;
  1240. text-align:center;
  1241. font-size:14px;
  1242. color:#333;
  1243. height: 44px;
  1244. line-height: 44px;
  1245. }
  1246. .cell2{
  1247. flex:1;
  1248. text-align:center;
  1249. font-size:14px;
  1250. color:#333;
  1251. height: 44px;
  1252. line-height: 44px;
  1253. }
  1254. .cell3{
  1255. flex:2;
  1256. text-align:center;
  1257. font-size:14px;
  1258. color:#333;
  1259. height: 44px;
  1260. line-height: 44px;
  1261. }
  1262. .btn-area{
  1263. position:absolute;
  1264. right:0;
  1265. top:0;
  1266. width:70px;
  1267. height:100%;
  1268. background:#e54d42;
  1269. color:#fff;
  1270. display:flex;
  1271. align-items:center;
  1272. justify-content:center;
  1273. font-size:14px;
  1274. z-index:1;
  1275. border-radius: 4px;
  1276. }
  1277. // /* 表头也允许换行,保证与列宽对齐 */
  1278. // ::v-deep .break-col {
  1279. // white-space: normal !important;
  1280. // word-break: break-all !important;
  1281. // line-height: 1.2;
  1282. // }
  1283. // /* 单元格超长自动分段 */
  1284. // ::v-deep .break-cell {
  1285. // white-space: normal !important;
  1286. // word-break: break-all !important;
  1287. // line-height: 1.2;
  1288. // padding: 4px 2px; /* 上下留一点空隙,视觉更舒服 */
  1289. // }
  1290. </style>