shipmentOrderInfoDetails.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921
  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">
  20. <view class="scan-card">
  21. <uni-easyinput ref="easyinput" v-model="scanNumber" :input-border="false" :clearable="false"
  22. type="text" focus @focus="handleInputFocus" placeholder="扫描内部标签" @confirm="handleKeydown" />
  23. <text class="font-icons icon-scan" @click="handleMapass">&#xe6b7;</text>
  24. </view>
  25. </view>
  26. <view class="card-list-flexbox">
  27. <text class="card-list-title" :style="[isPad?'font-size: 18px':'font-size: 14px']">出货单信息详情</text>
  28. <view class="card-list-item">
  29. <text>出货货号</text>
  30. <text>{{ formData?.saleOutNo }}</text>
  31. </view>
  32. <view class="card-list-item">
  33. <text>客户</text>
  34. <text>{{ formData?.customerName }}</text>
  35. </view>
  36. <view class="card-list-item">
  37. <text>生产订单</text>
  38. <text>{{ formData?.detail?.workOrderNo }}</text>
  39. </view>
  40. <view class="card-list-item">
  41. <text>出货数量</text>
  42. <text>{{ formData?.detail?.deliveredQty }}</text>
  43. </view>
  44. <view class="card-list-item">
  45. <text>产品名称</text>
  46. <text>{{ formData?.detail?.materialName }}</text>
  47. </view>
  48. <view class="card-list-item">
  49. <text>数量</text>
  50. <text>{{ formData?.detail?.insideQty }} *
  51. {{ formData?.detail?.pieceQty }}</text>
  52. </view>
  53. <!-- <view class="card-list-item">
  54. <text>内包数量</text>
  55. <text>{{ formData?.shipmentHeadBaseVO?.insourcingQty }}</text>
  56. </view>
  57. <view class="card-list-item">
  58. <text>装箱件数</text>
  59. <text>{{ formData?.shipmentHeadBaseVO?.encasementQty }}</text>
  60. </view> -->
  61. <view class="card-list-item">
  62. <text>客户订单</text>
  63. <text>{{ formData?.detail?.erpOrderNo }}</text>
  64. </view>
  65. <!-- <view class="card-list-item" v-if="computedBoxOrderState" @click="handleNavigateToDetailsPage()">
  66. <div style="width: 100%;display: flex;justify-content: space-between;color: orange;">
  67. <text class="font-icons">&#xe6e0;&nbsp;当前出货单存在未装箱内容点</text>
  68. <text class="font-icons" style="text-align: right;">&#xe66b;</text>
  69. </div>
  70. </view> -->
  71. </view>
  72. <view class="collapsed-panel" v-if="cardList.length > 0">
  73. <template v-for="item in cardList" :key="item.id">
  74. <div class="content" @click="handleNavigateToDetailsPage(item)">
  75. <div :class="['panel-row', highLightField?.id === item.id?'printer':'']">
  76. <span>外箱码</span>
  77. <span>{{ item.labelContent }}</span>
  78. </div>
  79. <div :class="['panel-row', highLightField?.id === item.id?'printer':'']">
  80. <span>装箱件数</span>
  81. <span>{{ item.pieceQty }}</span>
  82. </div>
  83. <span :class="['font-icons', highLightField?.id === item.id?'printer':'']">&#xe66b;</span>
  84. </div>
  85. </template>
  86. </view>
  87. <view v-else>
  88. <view class="bg-image">
  89. <image src="@/static/empty.png" mode="heightFix" />
  90. <text>这里什么都没有...</text>
  91. </view>
  92. </view>
  93. </view>
  94. <view class="operation-panel">
  95. <button type="primary" :disabled="!highLightField" style="width: calc(100% - 8px);margin: 0 4px;"
  96. @click="handleShipmentBoxPrinter">外箱标签补打</button>
  97. </view>
  98. <uni-popup ref="errorTip" type="dialog">
  99. <uni-popup-dialog type="error" cancel-text="关闭" confirm-text="确认" title="提示" :content="errorTipMessage"
  100. @confirm="handleCloseErrorTipsModal" @close="handleCloseErrorTipsModal" />
  101. </uni-popup>
  102. </template>
  103. </gui-page>
  104. </template>
  105. <script>
  106. import {
  107. computed,
  108. defineComponent,
  109. onBeforeMount,
  110. ref
  111. } from 'vue'
  112. import tsc from '@/unit/CHITEN_SDK_APP/tsc.js'
  113. export default defineComponent({
  114. setup(options) {
  115. const touchNum = ref(0)
  116. const scanNumber = ref('');
  117. const errorState = ref(0)
  118. const easyinput = ref()
  119. const errorTip = ref('')
  120. const errorTipMessage = ref('')
  121. const parseData = JSON.parse(options?.params) ?? {}
  122. const formData = ref()
  123. const cardList = ref([])
  124. const highLightField = ref()
  125. const bluetooth = ref()
  126. const blueConfig = ref({
  127. loopBuffer: 0,
  128. currentTime: 1,
  129. lastData: 0,
  130. onBufferSize: 20,
  131. printerNum: 1,
  132. currentPrint: 1,
  133. isLabelSend: false
  134. })
  135. // // 是否显示 “当前出货单存在未装箱内容点” 提示信息
  136. // const computedBoxOrderState = computed(() => {
  137. // const forData = formData.value?.shippingLabelRespVOS ?? [];
  138. // let returnState = false;
  139. // for (let i = 0; i < forData.length; i++) {
  140. // if (forData[i].type * 1 === 2) {
  141. // returnState = true;
  142. // break;
  143. // }
  144. // }
  145. // return returnState;
  146. // })
  147. const search = function() {
  148. uni.$reqGet('getSaleOutOrderLabelList', {
  149. id: parseData?.detail.id,
  150. })
  151. .then(async ({
  152. code,
  153. data,
  154. msg
  155. }) => {
  156. if (code === 0) {
  157. cardList.value = data ?? [];
  158. } else {
  159. // #ifdef APP-PLUS
  160. plus.device.beep(2)
  161. // #endif
  162. errorTipMessage.value = msg
  163. errorTip.value.open()
  164. errorState.value = 0
  165. }
  166. })
  167. }
  168. onBeforeMount(async () => {
  169. // #ifdef APP-PLUS
  170. const bluetoothConfig = uni.getStorageSync('bluetoothConfig')
  171. if ([null, '', undefined].includes(bluetoothConfig)) {
  172. bluetooth.value = {
  173. 'isOpenBle': false,
  174. 'deviceId': '',
  175. 'serviceId': '',
  176. 'writeId': '',
  177. 'notifyId': ''
  178. }
  179. setTimeout(() => {
  180. // #ifdef APP-PLUS
  181. plus.device.beep(2)
  182. // #endif
  183. errorTipMessage.value = '蓝牙打印机未连接'
  184. errorState.value = -1
  185. errorTip.value.open()
  186. }, 800)
  187. } else {
  188. bluetooth.value = JSON.parse(bluetoothConfig)
  189. }
  190. // #endif
  191. formData.value = parseData
  192. await search();
  193. })
  194. const handleMapass = function() {
  195. // #ifdef APP-PLUS
  196. const mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module')
  197. mpaasScanModule.mpaasScan({
  198. // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
  199. 'scanType': ['qrCode', 'barCode'],
  200. // 是否隐藏相册,默认false不隐藏
  201. 'hideAlbum': false
  202. },
  203. (ret) => {
  204. if (ret.resp_code === 1000) {
  205. uni.$reqPost('transferTrayCode', {
  206. qrCode: ret.resp_result,
  207. wmsSaleOutOrderId: parseData?.detail.id
  208. })
  209. .then(async ({
  210. code,
  211. data,
  212. msg
  213. }) => {
  214. if (code === 0) {
  215. // 打印内箱码/袋标码
  216. handlePrinter(data);
  217. } else {
  218. // #ifdef APP-PLUS
  219. plus.device.beep(2)
  220. // #endif
  221. errorTipMessage.value = msg
  222. errorTip.value.open()
  223. errorState.value = 0
  224. }
  225. })
  226. }
  227. })
  228. // #endif
  229. }
  230. // 扫描完成品标签输入框回车事件
  231. const handleKeydown = function(e) {
  232. uni.$reqPost('transferTrayCode', {
  233. qrCode: e,
  234. wmsSaleOutOrderId: parseData?.detail.id
  235. })
  236. .then(async ({
  237. code,
  238. data,
  239. msg
  240. }) => {
  241. if (code === 0) {
  242. // 打印内箱码/袋标码
  243. handlePrinter(data);
  244. } else {
  245. // #ifdef APP-PLUS
  246. plus.device.beep(2)
  247. // #endif
  248. errorTipMessage.value = msg
  249. errorTip.value.open()
  250. errorState.value = 0
  251. }
  252. })
  253. }
  254. // 校验是否可以打印外箱码
  255. const handleValidateOtherBoxPrint = function(qrCodeList) {
  256. uni.$reqPost("transferOuterBoxCheckPrint", qrCodeList)
  257. .then(async ({
  258. code,
  259. data,
  260. msg
  261. }) => {
  262. if (code === 0) {
  263. // 可以进行装箱操作
  264. if (data) {
  265. uni.$reqPost("transferOuterBoxCode", {
  266. id: parseData?.detail.id,
  267. shippingLabelIdList: qrCodeList
  268. })
  269. .then(async ({
  270. code,
  271. data,
  272. msg
  273. }) => {
  274. if (code === 0) {
  275. await search();
  276. // 打印外箱
  277. await labelOuterBoxTest(data);
  278. } else {
  279. // #ifdef APP-PLUS
  280. plus.device.beep(2)
  281. // #endif
  282. errorTipMessage.value = msg
  283. errorTip.value.open()
  284. errorState.value = -1
  285. }
  286. })
  287. } else {
  288. setTimeout(async () => {
  289. await search();
  290. }, 300)
  291. }
  292. } else {
  293. // #ifdef APP-PLUS
  294. plus.device.beep(2)
  295. // #endif
  296. errorTipMessage.value = msg
  297. errorTip.value.open()
  298. errorState.value = 0
  299. }
  300. })
  301. }
  302. // 打印内箱码/袋标码
  303. const handlePrinter = async function(data) {
  304. let qrCodeList = cardList.value.find(ret => !ret.id)?.shippingLabelId ?? []
  305. // 校验标签码是否重复
  306. if (qrCodeList.includes(data?.shippingLabelId)) {
  307. // #ifdef APP-PLUS
  308. plus.device.beep(2)
  309. // #endif
  310. qrCodeList = null;
  311. errorTipMessage.value = "不允许录入两条相同的标签号"
  312. errorTip.value.open()
  313. errorState.value = -1
  314. } else {
  315. qrCodeList.push(data?.shippingLabelId);
  316. }
  317. // 标签重复,不执行下一步操作
  318. if (!qrCodeList) return;
  319. // 校验是否可以打外箱标签码
  320. await handleValidateOtherBoxPrint(qrCodeList);
  321. await setInputFocus()
  322. // 打印
  323. await labelInnerTest(data)
  324. blueConfig.value.currentPrint = 1
  325. blueConfig.value.printNum = 2
  326. const timer = setInterval(() => {
  327. if (blueConfig.value.isLabelSend === false &&
  328. blueConfig.value.currentPrint === 2) {
  329. blueConfig.value.currentPrint += 1
  330. labelExternalTest(data)
  331. }
  332. if (blueConfig.value.currentPrint === blueConfig
  333. .value.printNum) {
  334. clearInterval(timer);
  335. }
  336. }, 1500)
  337. }
  338. // 外箱标签补打
  339. const handleShipmentBoxPrinter = function() {
  340. if (highLightField.value?.labelContent) {
  341. uni.$reqGet("getShippingLabelPrintData", {
  342. id: highLightField.value.id
  343. })
  344. .then(async ({
  345. code,
  346. data,
  347. msg
  348. }) => {
  349. if (code === 0) {
  350. // 打印
  351. await labelOuterBoxTest(data);
  352. } else {
  353. // #ifdef APP-PLUS
  354. plus.device.beep(2)
  355. // #endif
  356. errorTipMessage.value = msg
  357. errorTip.value.open()
  358. errorState.value = -1
  359. }
  360. })
  361. } else {
  362. // #ifdef APP-PLUS
  363. plus.device.beep(2)
  364. // #endif
  365. errorTipMessage.value = "此标签还未装箱!"
  366. errorTip.value.open()
  367. errorState.value = -1
  368. }
  369. }
  370. const Send = function(buff) {
  371. var currentTime = blueConfig.value.currentTime
  372. var loopBuffer = blueConfig.value.loopBuffer
  373. var lastData = blueConfig.value.lastData
  374. var onBufferSize = blueConfig.value.onBufferSize
  375. var printNum = blueConfig.value.printerNum
  376. var currentPrint = blueConfig.value.currentPrint
  377. var buf
  378. var dataView
  379. if (currentTime < loopBuffer) {
  380. buf = new ArrayBuffer(onBufferSize)
  381. dataView = new DataView(buf)
  382. for (let i = 0; i < onBufferSize; ++i) {
  383. dataView.setUint8(i, buff[(currentTime - 1) * onBufferSize + i])
  384. }
  385. } else {
  386. buf = new ArrayBuffer(lastData)
  387. dataView = new DataView(buf)
  388. for (let i = 0; i < lastData; ++i) {
  389. dataView.setUint8(i, buff[(currentTime - 1) * onBufferSize + i])
  390. }
  391. }
  392. plus.bluetooth.writeBLECharacteristicValue({
  393. deviceId: bluetooth.value.deviceId,
  394. serviceId: bluetooth.value.serviceId,
  395. characteristicId: bluetooth.value.writeId,
  396. value: buf,
  397. success: function(res) {
  398. if (currentPrint <= printNum) {
  399. wx.showToast({
  400. title: '数据打印中',
  401. icon: 'loading'
  402. })
  403. }
  404. // 将complete中处理数据的代码挪过来,增加30ms延迟, 解决蓝牙打印数据传输10007问题
  405. setTimeout(() => {
  406. currentTime += 1
  407. if (currentTime <= loopBuffer) {
  408. blueConfig.value.isLabelSend = true
  409. blueConfig.value.currentTime = currentTime
  410. Send(buff)
  411. }
  412. // end
  413. if (currentTime === loopBuffer) {
  414. blueConfig.value.currentPrint += 1
  415. blueConfig.value.isLabelSend = false
  416. }
  417. }, 10)
  418. },
  419. fail: function(e) {
  420. wx.showToast({
  421. title: '打印第' + currentPrint + '张失败' + 'error: code ' + e
  422. ?.code + ', message ' + e?.message,
  423. icon: 'none',
  424. duration: 4000
  425. })
  426. },
  427. complete: function() {}
  428. })
  429. }
  430. const prepareSend = function(buff) {
  431. var time = blueConfig.value.onBufferSize
  432. var loopBuffer = parseInt(buff.length / time)
  433. var lastData = parseInt(buff.length % time)
  434. blueConfig.value.loopBuffer = loopBuffer + 1
  435. blueConfig.value.lastData = lastData
  436. blueConfig.value.currentTime = 1
  437. Send(buff)
  438. }
  439. const labelInnerTest = function(ret) {
  440. var command = tsc.dlabelPrinter.createNew()
  441. command.setBackFeed(4)
  442. command.setOffset(-2)
  443. // (480 * 200)dots
  444. command.setSize(60, 25)
  445. command.setCls()
  446. command.setGap(6, 2)
  447. command.setSpeed(1.5)
  448. // row1
  449. command.setText(4, 0, '1', 0, 1, 1, '(C)Customer P/N:')
  450. command.setText(172, 0, '1', 0, 1, 1, ret.c)
  451. command.setText(278, 0, '1', 0, 1, 1, '(D)QTY(EA):')
  452. command.setText(378, 0, '1', 0, 1, 1, ret.qty)
  453. // row2
  454. command.setText(4, 20, '1', 0, 1, 1, '(G)LOT NO:')
  455. const strList = ret.lotNo?.split('');
  456. let lotNo = ''
  457. let lotNo2 = ''
  458. if (strList.length > 16) {
  459. lotNo = ret.lotNo?.substring(0, 16)
  460. lotNo2 = ret.lotNo?.substring(16)
  461. command.setText(102, 20, '1', 0, 1, 1, lotNo)
  462. command.setText(102, 40, '1', 0, 1, 1, lotNo2)
  463. } else {
  464. command.setText(102, 20, '1', 0, 1, 1, ret.lotNo)
  465. }
  466. command.setText(270, 20, '1', 0, 1, 1, '(J)ExpDate:')
  467. const timeList = ret.expDate?.split('');
  468. let timeText = ''
  469. let timeText2 = ''
  470. if (timeList.length > 9) {
  471. timeText = ret.expDate?.substring(0, 9)
  472. timeText2 = ret.expDate?.substring(9)
  473. command.setText(380, 20, '1', 0, 1, 1, timeText)
  474. command.setText(380, 40, '1', 0, 1, 1, timeText2)
  475. } else {
  476. command.setText(380, 20, '1', 0, 1, 1, ret.expDate)
  477. }
  478. // row3
  479. command.setText(128, 60, '1', 0, 1, 1, '(E)Manuf:')
  480. command.setText(218, 60, '1', 0, 1, 1, ret.manuf)
  481. command.setText(128, 78, 'TSS24.BF2', 0, 1, 1, '存储条件:')
  482. // let strList2 = []
  483. // let strText = ''
  484. // if (ret.storageEnvironmentName) {
  485. // strList2 = ret.storageEnvironmentName?.split(' ')
  486. // strText = strList2[0] + ' ' + strList2[1]
  487. // } else {
  488. // strText = '';
  489. // }
  490. command.setText(208, 94, 'TSS24.BF2', 0, 1, 1, '温度 ' + ret.temperature)
  491. command.setText(208, 112, 'TSS24.BF2', 0, 1, 1, '湿度 ' + ret.humidity)
  492. // command.setText(208, 94, 'TSS24.BF2', 0, 1, 1, strText)
  493. // row4
  494. command.setQrcode(4, 64, 'H', 4, 'A', ret.lotNo2)
  495. command.setQrcode(318, 54, 'M', 3, 'A', ret.qrCode1)
  496. command.setText(128, 160, '1', 0, 1, 1, 'C.O.O.CN')
  497. command.setText(128, 178, '2', 0, 1, 1, 'ROHS 2.0 HF')
  498. command.setPagePrint()
  499. blueConfig.value.isLabelSend = true
  500. prepareSend(command.getData())
  501. }
  502. const labelExternalTest = function(ret) {
  503. var command = tsc.dlabelPrinter.createNew()
  504. command.setBackFeed(6)
  505. // (640 * 320)dots
  506. command.setSize(80, 40)
  507. command.setCls()
  508. command.setGap(6)
  509. command.setSpeed(1.5)
  510. // row1
  511. command.setText(4, 0, '1', 0, 1, 1, '(A)Cust PO:')
  512. command.setText(120, 0, '1', 0, 1, 1, ret.a)
  513. // row2
  514. command.setText(4, 15, '1', 0, 1, 1, '(C)Customer P/N:')
  515. command.setText(165, 15, '1', 0, 1, 1, ret.c)
  516. command.setText(280, 12, '1', 0, 1, 1, 'C.O.O.CN')
  517. // row3
  518. command.setText(4, 30, '1', 0, 1, 1, '(E)Manuf:')
  519. command.setText(100, 30, '1', 0, 1, 1, ret.manuf)
  520. // command.setText(300, 45, 'TSS24.BF2', 0, 1, 1, '量产模具生产')
  521. // row4
  522. command.setText(4, 45, '1', 0, 1, 1, '(H)Date Code:')
  523. command.setText(140, 45, '1', 0, 1, 1, ret.h)
  524. command.setText(280, 30, '2', 0, 1, 1, 'ROHS 2.0 HF')
  525. // row5
  526. command.setText(4, 60, '1', 0, 1, 1, '(J)ExpDate:')
  527. command.setText(120, 60, '1', 0, 1, 1, ret.expDate)
  528. command.setText(270, 60, '1', 0, 1, 1, '(B)Line NO:')
  529. command.setText(385, 60, '1', 0, 1, 1, ret.b)
  530. // row6
  531. command.setText(4, 75, '1', 0, 1, 1, '(G)LOT NO:')
  532. const strList = ret.lotNo?.split('');
  533. let lotNo = ''
  534. let lotNo2 = ''
  535. if (strList.length > 16) {
  536. lotNo = ret.lotNo?.substring(0, 16)
  537. lotNo2 = ret.lotNo?.substring(16)
  538. command.setText(102, 75, '1', 0, 1, 1, lotNo)
  539. command.setText(102, 90, '1', 0, 1, 1, lotNo2)
  540. } else {
  541. command.setText(102, 75, '1', 0, 1, 1, ret.lotNo)
  542. }
  543. command.setText(270, 75, '1', 0, 1, 1, '(D)QTY(EA):')
  544. command.setText(385, 75, '1', 0, 1, 1, ret.qty)
  545. // row3
  546. // row3
  547. command.setText(90, 110, 'TSS24.BF2', 0, 1, 1, '存储条件:')
  548. // let strList2 = []
  549. // let strText = ''
  550. // if (ret.storageEnvironmentName) {
  551. // strList2 = ret.storageEnvironmentName?.split(' ')
  552. // strText = strList2[0] + ' ' + strList2[1]
  553. // } else {
  554. // strText = '';
  555. // }
  556. command.setText(90, 135, 'TSS24.BF2', 0, 1, 1, '温度 ' + ret.temperature)
  557. command.setText(90, 150, 'TSS24.BF2', 0, 1, 1, '湿度 ' + ret.humidity)
  558. // command.setText(90, 135, 'TSS24.BF2', 0, 1, 1, strText)
  559. command.setText(230, 110, '1', 0, 1, 1, '(F)MPN:')
  560. command.setText(315, 110, '1', 0, 1, 1, ret.f)
  561. command.setText(4, 195, '1', 0, 1, 1, '(K)ERP LOT:')
  562. // QR
  563. command.setQrcode(4, 100, 'Q', 3, 'A', ret.lotNo2)
  564. command.setQrcode(470, 0, 'Q', 3, 'A', ret.qrCode1)
  565. command.setBarCode(4, 210, '39', 50, 1, 0, 1, 2, ret.k)
  566. // row5
  567. command.setText(230, 125, '1', 0, 1, 1, '(I)ManufID:')
  568. command.setText(340, 125, '1', 0, 1, 1, ret.i)
  569. command.setText(230, 140, '1', 0, 1, 1, '(L)ADH:')
  570. command.setText(315, 140, '1', 0, 1, 1, ret.l)
  571. // row5
  572. command.setText(275, 190, 'TSS24.BF2', 0, 1, 1, '原胶LOT NO:')
  573. command.setText(410, 195, '2', 0, 1, 1, ret.rawIncomingReceiptMaterialLots)
  574. // row6
  575. command.setText(275, 230, '1', 0, 1, 1, 'ADHManufDate:')
  576. command.setText(410, 230, '1', 0, 1, 1, ret.rawProduceDate)
  577. command.setText(275, 250, '1', 0, 1, 1, 'ADHExpDate:')
  578. command.setText(400, 250, '1', 0, 1, 1, ret.rawExpirationDate)
  579. command.setPagePrint()
  580. blueConfig.value.isLabelSend = true
  581. prepareSend(command.getData())
  582. }
  583. const labelOuterBoxTest = function(ret) {
  584. var command = tsc.dlabelPrinter.createNew()
  585. command.setBackFeed(6)
  586. command.setSize(100, 100)
  587. command.setCls()
  588. command.setGap(6)
  589. command.setSpeed(1.5)
  590. // row1
  591. command.setText(180, 0, 'TSS24.BF2', 0, 1, 2, '苏州市东苏发五金粘胶制品有限公司')
  592. // command.setText(180, 0, 'TSS24.BF2', 0, 1, 2, ret.customerName)
  593. // row2
  594. command.setText(24, 60, 'TSS24.BF2', 0, 1, 1, '(A)Cust PO:')
  595. command.setText(182, 60, 'TSS24.BF2', 0, 1, 1, ret.a)
  596. command.setText(398, 60, 'TSS24.BF2', 0, 1, 1, '(B)Line NO:')
  597. command.setText(568, 60, 'TSS24.BF2', 0, 1, 1, ret.b)
  598. command.setText(24, 100, 'TSS24.BF2', 0, 1, 1, '(C)Customer P/N:')
  599. command.setText(224, 100, 'TSS24.BF2', 0, 1, 1, ret.c)
  600. command.setText(398, 100, 'TSS24.BF2', 0, 1, 1, '(D)QTY(EA):')
  601. command.setText(568, 100, 'TSS24.BF2', 0, 1, 1, ret.qty)
  602. command.setText(24, 140, 'TSS24.BF2', 0, 1, 1, '(E)Manuf:')
  603. command.setText(132, 140, 'TSS24.BF2', 0, 1, 1, ret.manuf)
  604. command.setText(398, 140, 'TSS24.BF2', 0, 1, 1, '(F)MPN:')
  605. command.setText(478, 140, 'TSS24.BF2', 0, 1, 1, ret.f)
  606. command.setText(24, 180, 'TSS24.BF2', 0, 1, 1, '(I)ManufID:')
  607. command.setText(182, 180, 'TSS24.BF2', 0, 1, 1, ret.i)
  608. command.setText(24, 220, 'TSS24.BF2', 0, 1, 1, '(J)ExpDate:')
  609. command.setText(162, 220, 'TSS24.BF2', 0, 1, 1, ret.expDate)
  610. command.setText(398, 220, 'TSS24.BF2', 0, 1, 1, '(H)Date Code:')
  611. command.setText(578, 220, 'TSS24.BF2', 0, 1, 1, ret.h)
  612. command.setText(24, 260, 'TSS24.BF2', 0, 1, 1, '(L)ADH:')
  613. command.setText(142, 260, 'TSS24.BF2', 0, 1, 1, ret.l)
  614. command.setText(24, 310, 'TSS24.BF2', 0, 1, 1, 'ADH LOT:')
  615. command.setText(142, 310, 'TSS24.BF2', 0, 1, 1, ret.rawBatch)
  616. command.setText(24, 350, 'TSS24.BF2', 0, 1, 1, 'ADHManufDate:')
  617. command.setText(184, 350, 'TSS24.BF2', 0, 1, 1, ret.rawProduceDate)
  618. command.setText(24, 390, 'TSS24.BF2', 0, 1, 1, 'ADHExpDate:')
  619. command.setText(184, 390, 'TSS24.BF2', 0, 1, 1, ret.rawExpirationDate)
  620. command.setText(24, 425, 'TSS24.BF2', 0, 1, 1, '(G)LOT ID:')
  621. command.setText(180, 425, 'TSS24.BF2', 0, 1, 1, '存储条件:')
  622. // let strList = []
  623. // let strText = ''
  624. // if (ret.storageEnvironmentName) {
  625. // strList = ret.storageEnvironmentName?.split(' ')
  626. // strText = strList[0] + ' ' + strList[1]
  627. // } else {
  628. // strText = '';
  629. // }
  630. command.setText(180, 455, 'TSS24.BF2', 0, 1, 1, '温度 ' + ret.temperature)
  631. command.setText(180, 485, 'TSS24.BF2', 0, 1, 1, '湿度 ' + ret.humidity)
  632. command.setQrcode(24, 455, 'H', 5, 'A', ret.lotNo2)
  633. command.setQrcode(498, 530, 'H', 4, 'A', ret.qrCode2)
  634. command.setText(24, 590, 'TSS24.BF2', 0, 1, 1, '(K):ERP LOT:')
  635. command.setBarCode(24, 630, '93', 90, 1, 0, 2, 4, ret.k)
  636. command.setText(498, 460, '3', 0, 1, 1, 'C.O.O.CN')
  637. command.setText(498, 490, '3', 0, 1, 1, 'ROHS 2.0 HF')
  638. command.setPagePrint()
  639. prepareSend(command.getData())
  640. }
  641. // 跳转
  642. const handleNavigateToDetailsPage = function(data) {
  643. highLightField.value = data;
  644. touchNum.value += 1;
  645. setTimeout(() => {
  646. if (touchNum.value >= 2 && highLightField.value?.id === data?.id) {
  647. uni.navigateTo({
  648. url: `/pages/workbranch/production/shipment/shipmentPackingDetails?params=${JSON.stringify({...parseData, insideRespVOList: data?.insideRespVOList })}`
  649. })
  650. }
  651. touchNum.value = 0;
  652. }, 400);
  653. }
  654. const goBack = function() {
  655. uni.$goBack('/pages/workbranch/production/shipment/shipmentPatchworkPage')
  656. }
  657. // 禁用软键盘
  658. const handleInputFocus = function() {
  659. // #ifdef APP-PLUS
  660. setTimeout(() => {
  661. uni.hideKeyboard()
  662. }, 100)
  663. // #endif
  664. }
  665. const setInputFocus = function() {
  666. scanNumber.value = ''
  667. easyinput.value.onBlur()
  668. easyinput.value.onFocus()
  669. }
  670. // 关闭错误信息弹窗
  671. const handleCloseErrorTipsModal = async function() {
  672. errorTip.value.close()
  673. if (errorState.value === 0) {
  674. await setInputFocus()
  675. }
  676. }
  677. return {
  678. highLightField,
  679. formData,
  680. cardList,
  681. handleKeydown,
  682. goBack,
  683. easyinput,
  684. scanNumber,
  685. errorTip,
  686. errorTipMessage,
  687. handleInputFocus,
  688. // computedBoxOrderState,
  689. handleShipmentBoxPrinter,
  690. handleCloseErrorTipsModal,
  691. handleNavigateToDetailsPage,
  692. }
  693. }
  694. })
  695. </script>
  696. <style lang="scss" scoped>
  697. .gui-header-leader-btns {
  698. color: black;
  699. margin-left: 24rpx;
  700. font-size: 24px !important;
  701. }
  702. .list-content {
  703. margin-top: 80px;
  704. min-height: calc(100vh - 80px);
  705. background-color: #edeeee;
  706. }
  707. .input-200 {
  708. width: 200px;
  709. padding-left: 10px;
  710. }
  711. .icon-scan {
  712. font-size: 20px;
  713. text-align: right;
  714. }
  715. .scan {
  716. height: 45px;
  717. width: calc(100% - 48px);
  718. margin: 12px;
  719. padding: 0 12px;
  720. display: flex;
  721. justify-content: space-between;
  722. align-items: center;
  723. border-radius: 6px;
  724. background-color: white;
  725. .scan-card {
  726. width: 100%;
  727. display: grid;
  728. grid-template-rows: 1fr;
  729. grid-template-columns: 7fr 2fr;
  730. align-items: center;
  731. input {
  732. height: 35px;
  733. line-height: 35px;
  734. }
  735. text {
  736. width: 100%;
  737. text-align: right;
  738. }
  739. }
  740. }
  741. span,
  742. text {
  743. font-size: 12px;
  744. }
  745. .collapsed-panel {
  746. // height: calc(100vh - 190px);
  747. // min-height: 230px;
  748. margin: 5px 0 80px 0;
  749. padding: 0 8px;
  750. overflow-y: scroll;
  751. .content {
  752. position: relative;
  753. overflow-y: scroll;
  754. border-top: 2px dashed rgba(237, 238, 238, 1);
  755. .panel-row {
  756. // height: 32px;
  757. line-height: 32px;
  758. padding: 0 12px;
  759. display: flex;
  760. justify-content: space-between;
  761. background-color: #fbfbfb;
  762. span:nth-of-type(1) {
  763. min-width: 30%;
  764. }
  765. span:nth-of-type(2) {
  766. min-width: 30%;
  767. padding-right: 8px;
  768. text-align: right;
  769. word-wrap: break-word;
  770. overflow-y: scroll;
  771. }
  772. }
  773. .font-icons {
  774. position: absolute;
  775. right: 2px;
  776. top: 50%;
  777. transform: translate(0, -50%);
  778. }
  779. }
  780. }
  781. .card-list-flexbox {
  782. width: calc(100vw - 24px);
  783. height: 295px;
  784. margin: 0 12px;
  785. display: flex;
  786. justify-content: center;
  787. flex-direction: column;
  788. align-items: center;
  789. overflow-y: scroll;
  790. .card-list-title {
  791. width: 100%;
  792. height: 35px;
  793. line-height: 35px;
  794. margin: 0 4px 0 4px;
  795. border-radius: 4px 4px 0 0;
  796. text-align: center;
  797. color: white;
  798. background-color: rgba(0, 160, 233, 1.0);
  799. }
  800. .card-list-item,
  801. .card-list-item-operation {
  802. width: 100%;
  803. height: 35px;
  804. margin: 0 4px 3rpx 4px;
  805. border-radius: 4px;
  806. display: flex;
  807. flex-direction: row;
  808. align-items: center;
  809. justify-content: space-between;
  810. background-color: #fff;
  811. uni-text {
  812. font-size: 14px;
  813. height: 50rpx;
  814. text-align: left;
  815. padding: 0 8px;
  816. display: flex;
  817. flex-direction: row;
  818. align-items: center;
  819. }
  820. .text-1 {
  821. flex: 1;
  822. height: 35px;
  823. justify-content: flex-start;
  824. }
  825. .text-2 {
  826. flex: 3;
  827. height: 35px;
  828. justify-content: flex-end;
  829. margin-right: 4px;
  830. padding: 2px 6px;
  831. }
  832. }
  833. }
  834. .printer {
  835. color: white;
  836. background-color: #00a0e9 !important;
  837. }
  838. .operation-panel {
  839. padding: 12px 0;
  840. position: fixed;
  841. bottom: 0;
  842. width: 100%;
  843. display: grid;
  844. grid-template-columns: 1fr;
  845. grid-template-rows: 1fr;
  846. background-color: white;
  847. .operation-title {
  848. height: 40px;
  849. line-height: 40px;
  850. padding: 0 14px;
  851. font-size: 16px;
  852. font-weight: bold;
  853. }
  854. }
  855. </style>