scannedMaterials.vue 43 KB

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