processDetails.vue 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064
  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="oqc-checkout">
  19. <view class="card-list-flexbox">
  20. <text class="card-list-title" :style="[isPad?'font-size: 18px':'font-size: 14px']">详细信息</text>
  21. <view class="card-list-item">
  22. <text>生产订单号</text>
  23. <text>{{ ProcessParams.erpWorkOrderNo }}</text>
  24. </view>
  25. <view class="card-list-item">
  26. <text>产品编号</text>
  27. <text>{{ ProcessParams.materialNo }}</text>
  28. </view>
  29. <view class="card-list-item">
  30. <text>产品名称</text>
  31. <text>{{ ProcessParams.materialName }}</text>
  32. </view>
  33. <view class="card-list-item">
  34. <text>计划数量</text>
  35. <text>{{ ProcessParams.planningQty }} {{ ProcessParams.unitName }}</text>
  36. </view>
  37. <view class="card-list-item">
  38. <text>包装量</text>
  39. <text>{{ ProcessParams.numberOfPieces }} {{ ProcessParams.unitName }}</text>
  40. </view>
  41. <view class="card-list-item">
  42. <text>生产工序</text>
  43. <text>{{ ProcessParams.processName }}</text>
  44. </view>
  45. <view class="card-list-item">
  46. <text>计划号</text>
  47. <text>{{ ProcessParams.erpWorkOrderNo }}</text>
  48. </view>
  49. <view class="card-list-item">
  50. <text>需求日期</text>
  51. <text>{{ $parseTime(ProcessParams.needTime) }}</text>
  52. </view>
  53. <view class="card-list-item">
  54. <text>单据日期</text>
  55. <text>{{ $parseTime(ProcessParams.createTime) }}</text>
  56. </view>
  57. </view>
  58. <view class="table-title" style="margin-top: 16px;">
  59. <span>工艺路线</span>
  60. </view>
  61. <view class="custom-table2">
  62. <uni-table border stripe empty-text="暂无更多数据">
  63. <!-- 表头行 -->
  64. <uni-tr class="custom-table-head">
  65. <uni-th align="center" width="140px">工序</uni-th>
  66. <uni-th align="center" width="140px">机器</uni-th>
  67. <uni-th align="center" width="140px">模具</uni-th>
  68. <uni-th align="center" width="140px">备注</uni-th>
  69. </uni-tr>
  70. <!-- 表格数据行 -->
  71. <uni-tr>
  72. <uni-td align="center">{{ ProcessParams.processName }}</uni-td>
  73. <uni-td align="center" />
  74. <uni-td align="center">{{ ProcessParams.tooling }}</uni-td>
  75. <uni-td align="center">{{ ProcessParams.remark }}</uni-td>
  76. </uni-tr>
  77. </uni-table>
  78. </view>
  79. <view class="table-title">
  80. <span>物料清单</span>
  81. </view>
  82. <view class="custom-table">
  83. <uni-table border stripe empty-text="暂无更多数据">
  84. <!-- 表头行 -->
  85. <uni-tr class="custom-table-head">
  86. <uni-th align="center" width="55px">序号</uni-th>
  87. <uni-th align="center" width="110px">物料编码</uni-th>
  88. <uni-th align="center" width="160px">物料名称</uni-th>
  89. <uni-th align="center" width="100px">规格</uni-th>
  90. <uni-th align="center" width="100px">单位</uni-th>
  91. <uni-th align="center" width="100px">需求数量</uni-th>
  92. <uni-th align="center" width="100px">实发数量</uni-th>
  93. <uni-th align="center" width="100px">是否主材</uni-th>
  94. </uni-tr>
  95. <!-- 表格数据行 -->
  96. <uni-tr v-for="(item, key) in ProcessParams.materialList" :key="key">
  97. <uni-td align="center" width="120px">{{ ++key }}</uni-td>
  98. <uni-td align="center">{{ item.materialNo }}</uni-td>
  99. <uni-td align="center">{{ item.materialName }}</uni-td>
  100. <uni-td align="center">{{ item.materialModels }}</uni-td>
  101. <uni-td align="center">{{ item.unitCode }}</uni-td>
  102. <uni-td align="center">{{ item.needNum }}</uni-td>
  103. <uni-td align="center">{{ item.realityNum }}</uni-td>
  104. <uni-td align="center">{{ item.keyMaterial === 'Y'? '是': '否' }}</uni-td>
  105. </uni-tr>
  106. </uni-table>
  107. </view>
  108. <view class="table-title">
  109. <span>执行情况</span>
  110. </view>
  111. <view class="custom-table" style="margin-bottom: 80px;">
  112. <uni-table border stripe empty-text="暂无更多数据">
  113. <!-- 表头行 -->
  114. <uni-tr class="custom-table-head">
  115. <uni-th align="center" width="55px">序号</uni-th>
  116. <uni-th align="center" width="100px">标签补打</uni-th>
  117. <uni-th align="center" width="140px">标签名称</uni-th>
  118. <uni-th align="center" width="80px">单位</uni-th>
  119. <uni-th align="center" width="80px">数量</uni-th>
  120. <uni-th align="center" width="80px">状态</uni-th>
  121. <uni-th align="center" width="80px">备注</uni-th>
  122. </uni-tr>
  123. <!-- 表格数据行 -->
  124. <uni-tr v-for="(item, key) in ProcessParams.executeResultFlatKnifeDOList" :key="key">
  125. <uni-td align="center"
  126. :style="item.status * 1 === 2? 'background-color: rgba(109, 205, 50, 1);color: white;': ''">{{ ++key }}</uni-td>
  127. <uni-td align="center"
  128. :style="item.status * 1 === 2? 'background-color: rgba(109, 205, 50, 1);color: white;': ''">
  129. <button v-if="item.status * 1 === 2" size="mini" type="primary"
  130. @tap="handlePatchWork(item)">补打</button>
  131. </uni-td>
  132. <uni-td align="center"
  133. :style="item.status * 1 === 2? 'background-color: rgba(109, 205, 50, 1);color: white;': ''">{{ item.labelName }}</uni-td>
  134. <uni-td align="center"
  135. :style="item.status * 1 === 2? 'background-color: rgba(109, 205, 50, 1);color: white;': ''">{{ item.unitName }}</uni-td>
  136. <uni-td align="center"
  137. :style="item.status * 1 === 2? 'background-color: rgba(109, 205, 50, 1);color: white;': ''">{{ item.qty }}</uni-td>
  138. <uni-td align="center"
  139. :style="item.status * 1 === 2? 'background-color: rgba(109, 205, 50, 1);color: white;': ''">{{ item.status === 1? '未打印': '已打印' }}</uni-td>
  140. <uni-td align="center"
  141. :style="item.status * 1 === 2? 'background-color: rgba(109, 205, 50, 1);color: white;': ''">{{ item.remark }}</uni-td>
  142. </uni-tr>
  143. </uni-table>
  144. </view>
  145. <view class="table-title">
  146. <span>卸料情况</span>
  147. </view>
  148. <view class="custom-table" style="margin-bottom: 80px;">
  149. <uni-table border stripe empty-text="暂无更多数据">
  150. <!-- 表头行 -->
  151. <uni-tr class="custom-table-head">
  152. <uni-th align="center" width="55px">序号</uni-th>
  153. <uni-th align="center" width="100px">标签补打</uni-th>
  154. <uni-th align="center" width="140px">物料名称</uni-th>
  155. <uni-th align="center" width="120px">卸料数量(m²)</uni-th>
  156. </uni-tr>
  157. <!-- 表格数据行 -->
  158. <uni-tr v-for="(item, key) in unLoadList" :key="key">
  159. <uni-td align="center">{{ ++key }}</uni-td>
  160. <uni-td align="center">
  161. <button size="mini" type="primary" @tap="handleUnloadPrintLabel(item)">补打</button>
  162. </uni-td>
  163. <uni-td align="center">{{ item.materialName }}</uni-td>
  164. <uni-td align="center">{{ item.unloadNumber }}</uni-td>
  165. </uni-tr>
  166. </uni-table>
  167. </view>
  168. <view class="operationBtn">
  169. <button v-if="ProcessParams.processName !== '全检'" type="primary"
  170. style="width: calc(100% - 8px);margin: 0 4px;"
  171. @click="handleSubmitApprovalModal('前段')">工序执行</button>
  172. <button v-else type="primary" style="width: calc(100% - 8px);margin: 0 4px;"
  173. @click="handleSubmitApprovalModal('后段')">后段执行</button>
  174. </view>
  175. </view>
  176. <uni-popup ref="errorTip" type="dialog">
  177. <uni-popup-dialog type="error" cancel-text="关闭" confirm-text="确认" title="提示" :content="errorTipMessage"
  178. @confirm="handleCloseErrorTipsModal" @close="handleCloseErrorTipsModal" />
  179. </uni-popup>
  180. </template>
  181. </gui-page>
  182. </template>
  183. <script>
  184. import {
  185. computed,
  186. defineComponent,
  187. ref,
  188. onBeforeMount
  189. } from 'vue'
  190. import tsc from '@/unit/CHITEN_SDK_APP/tsc.js'
  191. export default defineComponent({
  192. onLoad() {
  193. // // #ifdef APP-PLUS
  194. // plus.screen.lockOrientation('default');
  195. // // #endif
  196. },
  197. onUnload() {
  198. // // #ifdef APP-PLUS
  199. // plus.screen.lockOrientation('portrait-primary');
  200. // // #endif
  201. },
  202. onResize() {
  203. if ([90, -90].includes(plus.navigator.getOrientation())) {
  204. this.isLandscapeScreen = true
  205. } else {
  206. this.isLandscapeScreen = false
  207. }
  208. },
  209. setup(options) {
  210. const popup = ref()
  211. const bluetooth = ref()
  212. const isLandscapeScreen = ref(false)
  213. const parentRow = uni.getStorageSync('HotPressInfo') ?? {}
  214. const unLoadList = ref([])
  215. const errorState = ref(0)
  216. const errorTip = ref('')
  217. const errorTipMessage = ref('')
  218. // 工单信息
  219. const ProcessParams = ref({
  220. id: '',
  221. erpWorkOrderNo: '',
  222. materialNo: '',
  223. materialName: '',
  224. planningQty: '',
  225. numberOfPieces: '',
  226. processName: '',
  227. createTime: '',
  228. materialList: [], // 物料清单
  229. executeResultFlatKnifeDOList: [] // 执行情况
  230. })
  231. const blueConfig = ref({
  232. loopBuffer: 0,
  233. currentTime: 1,
  234. lastData: 0,
  235. onBufferSize: 20,
  236. printerNum: 1,
  237. currentPrint: 1,
  238. isLabelSend: false
  239. })
  240. // 卸料列表
  241. const getUnloadList = function() {
  242. uni.$reqGet('getUnLoadList', {
  243. hotPressId: ProcessParams.value.id
  244. })
  245. .then(({
  246. code,
  247. data,
  248. msg
  249. }) => {
  250. if (code === 0) {
  251. unLoadList.value = data ?? []
  252. } else {
  253. uni.showToast({
  254. title: msg,
  255. duration: 2000,
  256. icon: 'none'
  257. })
  258. }
  259. })
  260. }
  261. onBeforeMount(() => {
  262. Object.assign(ProcessParams.value, JSON.parse(parentRow))
  263. // #ifdef APP-PLUS
  264. const bluetoothConfig = uni.getStorageSync('bluetoothConfig')
  265. if ([null, '', undefined].includes(bluetoothConfig)) {
  266. bluetooth.value = {
  267. 'isOpenBle': false,
  268. 'deviceId': '',
  269. 'serviceId': '',
  270. 'writeId': '',
  271. 'notifyId': ''
  272. }
  273. setTimeout(() => {
  274. // #ifdef APP-PLUS
  275. plus.device.beep(2)
  276. // #endif
  277. errorTipMessage.value = '蓝牙打印机未连接'
  278. errorState.value = -1
  279. errorTip.value.open()
  280. }, 800)
  281. } else {
  282. bluetooth.value = JSON.parse(bluetoothConfig)
  283. }
  284. // #endif
  285. getUnloadList()
  286. })
  287. const goBack = function() {
  288. uni.$goBack('/pages/workbranch/production/processExecution/processList')
  289. }
  290. const handleSubmitApprovalModal = function(state) {
  291. if (state === '前段') {
  292. uni.navigateTo({
  293. url: `/pages/workbranch/production/processExecution/processExecution`
  294. })
  295. } else {
  296. uni.navigateTo({
  297. url: `/pages/workbranch/production/processExecution/processPosteriorSegment?hotPressId=${ProcessParams.value.id}`
  298. })
  299. }
  300. }
  301. const Send = function(buff) {
  302. var currentTime = blueConfig.value.currentTime
  303. var loopBuffer = blueConfig.value.loopBuffer
  304. var lastData = blueConfig.value.lastData
  305. var onBufferSize = blueConfig.value.onBufferSize
  306. var printNum = blueConfig.value.printerNum
  307. var currentPrint = blueConfig.value.currentPrint
  308. var buf
  309. var dataView
  310. if (currentTime < loopBuffer) {
  311. buf = new ArrayBuffer(onBufferSize)
  312. dataView = new DataView(buf)
  313. for (let i = 0; i < onBufferSize; ++i) {
  314. dataView.setUint8(i, buff[(currentTime - 1) * onBufferSize + i])
  315. }
  316. } else {
  317. buf = new ArrayBuffer(lastData)
  318. dataView = new DataView(buf)
  319. for (let i = 0; i < lastData; ++i) {
  320. dataView.setUint8(i, buff[(currentTime - 1) * onBufferSize + i])
  321. }
  322. }
  323. plus.bluetooth.writeBLECharacteristicValue({
  324. deviceId: bluetooth.value.deviceId,
  325. serviceId: bluetooth.value.serviceId,
  326. characteristicId: bluetooth.value.writeId,
  327. value: buf,
  328. success: function(res) {
  329. if (currentPrint <= printNum) {
  330. wx.showToast({
  331. title: '数据打印中',
  332. icon: 'loading'
  333. })
  334. }
  335. // 将complete中处理数据的代码挪过来,增加30ms延迟, 解决蓝牙打印数据传输10007问题
  336. setTimeout(() => {
  337. currentTime += 1
  338. if (currentTime <= loopBuffer) {
  339. blueConfig.value.isLabelSend = true
  340. blueConfig.value.currentTime = currentTime
  341. Send(buff)
  342. }
  343. // end
  344. if (currentTime === loopBuffer) {
  345. blueConfig.value.currentPrint += 1
  346. blueConfig.value.isLabelSend = false
  347. }
  348. }, 10)
  349. },
  350. fail: function(e) {
  351. wx.showToast({
  352. title: '打印第' + currentPrint + '张失败' + 'error: code ' + e
  353. ?.code + ', message ' + e?.message,
  354. icon: 'none',
  355. duration: 4000
  356. })
  357. },
  358. complete: function() {}
  359. })
  360. }
  361. const prepareSend = function(buff) {
  362. var time = blueConfig.value.onBufferSize
  363. var loopBuffer = parseInt(buff.length / time)
  364. var lastData = parseInt(buff.length % time)
  365. blueConfig.value.loopBuffer = loopBuffer + 1
  366. blueConfig.value.lastData = lastData
  367. blueConfig.value.currentTime = 1
  368. Send(buff)
  369. }
  370. const labelTest = function(ret) {
  371. var command = tsc.dlabelPrinter.createNew()
  372. command.setBackFeed(6)
  373. // (480 * 200)dots
  374. command.setSize(60, 25)
  375. command.setCls()
  376. command.setGap(6)
  377. command.setBox(0, 0, 475, 200, 1)
  378. // 1
  379. command.setBar(108, 0, 2, 40)
  380. command.setBar(108, 40, 2, 40)
  381. command.setBar(108, 80, 2, 40)
  382. command.setBar(108, 120, 2, 40)
  383. command.setBar(108, 160, 2, 40)
  384. command.setBar(108, 200, 2, 40)
  385. // 竖
  386. command.setBar(210, 80, 2, 40)
  387. command.setBar(210, 120, 2, 40)
  388. command.setBar(210, 160, 2, 40)
  389. command.setBar(210, 200, 2, 40)
  390. // 横
  391. command.setBar(0, 40, 480, 2)
  392. command.setBar(0, 80, 320, 2)
  393. command.setBar(0, 120, 210, 2)
  394. command.setBar(0, 160, 210, 2)
  395. // 横
  396. command.setBar(320, 80, 480, 2)
  397. command.setBar(320, 120, 480, 2)
  398. command.setBar(320, 160, 480, 2)
  399. // 竖
  400. command.setBar(322, 40, 2, 40)
  401. command.setBar(322, 80, 2, 40)
  402. command.setBar(322, 120, 2, 40)
  403. command.setBar(322, 160, 2, 40)
  404. // 竖
  405. command.setBar(378, 40, 2, 40)
  406. command.setBar(378, 80, 2, 40)
  407. command.setBar(378, 120, 2, 40)
  408. command.setBar(378, 160, 2, 40)
  409. // row1
  410. command.setText(4, 8, 'TSS24.BF2', 0, 1, 1, '料号')
  411. command.setText(112, 10, '2', 0, 1, 1, ret.materialName)
  412. // row2
  413. command.setText(4, 48, 'TSS24.BF2', 0, 1, 1, '工令单')
  414. command.setText(112, 50, '2', 0, 1, 1, ret.wordOrderNo)
  415. command.setText(328, 48, 'TSS24.BF2', 0, 1, 1, '数量')
  416. command.setText(384, 50, '2', 0, 1, 1, ret.qty)
  417. // row3
  418. command.setText(4, 88, 'TSS24.BF2', 0, 1, 1, '生产日期')
  419. command.setText(110, 90, '1', 0, 1, 1, ret.dateOfManufacture)
  420. command.setText(328, 88, 'TSS24.BF2', 0, 1, 1, '库位')
  421. command.setText(384, 90, '1', 0, 1, 1, ret.storageLocation)
  422. // row4
  423. command.setText(4, 128, 'TSS24.BF2', 0, 1, 1, '供应商')
  424. command.setText(112, 130, '3', 0, 1, 1, ret.vendor)
  425. command.setText(328, 128, 'TSS24.BF2', 0, 1, 1, '后制')
  426. command.setText(384, 130, '1', 0, 1, 1, ret.postProduction)
  427. // row5
  428. command.setText(4, 168, 'TSS24.BF2', 0, 1, 1, '包装')
  429. command.setText(112, 170, '1', 0, 1, 1, ret.packaging)
  430. command.setText(328, 168, 'TSS24.BF2', 0, 1, 1, 'QC')
  431. command.setText(384, 170, '1', 0, 1, 1, ret.qc)
  432. command.setQrcode(214, 88, 'L', 5, 'A', ret.qrCode)
  433. command.setPagePrint()
  434. prepareSend(command.getData())
  435. }
  436. const cuttingPrint = function(ret) {
  437. var command = tsc.dlabelPrinter.createNew()
  438. command.setBackFeed(6)
  439. // (640 * 320)dots
  440. command.setSize(80, 40)
  441. command.setCls()
  442. command.setGap(8)
  443. command.setBox(0, 0, 635, 315, 1)
  444. command.setBar(0, 40, 640, 2)
  445. command.setBar(0, 80, 640, 2)
  446. command.setBar(0, 120, 640, 2)
  447. command.setBar(0, 160, 640, 2)
  448. command.setBar(0, 200, 366, 2)
  449. command.setBar(0, 240, 366, 2)
  450. command.setBar(0, 280, 640, 2)
  451. // 1
  452. command.setBar(115, 0, 2, 40)
  453. command.setBar(115, 40, 2, 40)
  454. command.setBar(115, 80, 2, 40)
  455. command.setBar(115, 120, 2, 40)
  456. command.setBar(115, 160, 2, 40)
  457. command.setBar(115, 200, 2, 40)
  458. command.setBar(115, 240, 2, 40)
  459. command.setBar(115, 280, 2, 40)
  460. // 2
  461. command.setBar(360, 40, 2, 40)
  462. command.setBar(360, 80, 2, 40)
  463. command.setBar(360, 120, 2, 40)
  464. command.setBar(360, 160, 2, 40)
  465. command.setBar(360, 200, 2, 40)
  466. command.setBar(360, 240, 2, 40)
  467. command.setBar(360, 280, 2, 40)
  468. // 3
  469. command.setBar(475, 40, 2, 40)
  470. command.setBar(475, 80, 2, 40)
  471. command.setBar(475, 120, 2, 40)
  472. command.setBar(475, 280, 2, 40)
  473. command.setText(10, 6, 'TSS24.BF2', 0, 1, 1, '物料名称')
  474. command.setText(126, 6, 'TSS24.BF2', 0, 1, 1, ret.materialName)
  475. // row2
  476. command.setText(10, 46, 'TSS24.BF2', 0, 1, 1, '物料编码')
  477. command.setText(126, 46, 'TSS24.BF2', 0, 1, 1, ret.materialNo)
  478. command.setText(366, 46, 'TSS24.BF2', 0, 1, 1, '供应商')
  479. command.setText(481, 46, 'TSS24.BF2', 0, 1, 1, ret.supplierName)
  480. // row3
  481. command.setText(10, 86, 'TSS24.BF2', 0, 1, 1, '物料规格')
  482. command.setText(126, 86, 'TSS24.BF2', 0, 1, 1, ret.size)
  483. command.setText(366, 86, 'TSS24.BF2', 0, 1, 1, '分切日期')
  484. command.setText(481, 86, 'TSS24.BF2', 0, 1, 1, ret.createTime)
  485. // row4
  486. command.setText(10, 126, 'TSS24.BF2', 0, 1, 1, 'Lot no.')
  487. command.setText(126, 126, '1', 0, 1, 1, ret.materialLots)
  488. command.setText(366, 126, 'TSS24.BF2', 0, 1, 1, '储位')
  489. command.setText(481, 126, 'TSS24.BF2', 0, 1, 1, ret.wmsStockLocationName)
  490. // row5
  491. command.setText(10, 166, 'TSS24.BF2', 0, 1, 1, '有效期')
  492. command.setText(126, 166, 'TSS24.BF2', 0, 1, 1, ret.validityDate)
  493. // row6
  494. command.setText(10, 206, 'TSS24.BF2', 0, 1, 1, '检测日期')
  495. command.setText(126, 206, 'TSS24.BF2', 0, 1, 1, ret.inspectTime)
  496. // row7
  497. command.setText(10, 246, 'TSS24.BF2', 0, 1, 1, '存储条件')
  498. const strList = ret.storageEnvironment?.split(' ')
  499. const strText = strList[0] + ' ' + strList[1]
  500. command.setText(126, 246, 'TSS24.BF2', 0, 1, 1, strText)
  501. // row8
  502. command.setText(10, 286, 'TSS24.BF2', 0, 1, 1, '分切单号')
  503. command.setText(126, 286, 'TSS24.BF2', 0, 1, 1, ret.slittingOrderNo)
  504. command.setText(366, 286, 'TSS24.BF2', 0, 1, 1, '生产日期')
  505. command.setText(481, 286, 'TSS24.BF2', 0, 1, 1, ret.produceDate)
  506. command.setText(480, 216, '2', 0, 1, 1, ret.qty)
  507. command.setQrcode(366, 166, 'L', 4, 'A', ret.batchNumber)
  508. command.setPagePrint()
  509. prepareSend(command.getData())
  510. }
  511. const handlePatchWork = function(item) {
  512. let list = []
  513. uni.request({
  514. method: 'GET',
  515. url: uni.$baseUrl + '/report/print/getPrintDataFeol',
  516. data: {
  517. executeResultId: item?.id
  518. }
  519. }).then(async ({
  520. data: {
  521. code,
  522. data,
  523. msg
  524. }
  525. }) => {
  526. if (code === 0) {
  527. uni.showToast({
  528. title: '标签打印中,请勿操作',
  529. duration: 10000,
  530. icon: 'none'
  531. })
  532. list = data
  533. if (list.length > 0) {
  534. blueConfig.value.currentPrint = 1
  535. blueConfig.value.printNum = list.length
  536. const timer = setInterval(async () => {
  537. const currentPrint = blueConfig.value.currentPrint - 1
  538. if (blueConfig.value.isLabelSend === false &&
  539. currentPrint <
  540. blueConfig.value.printNum) {
  541. const paramsObj = {
  542. pn: list[currentPrint]
  543. .pn ?? '',
  544. wordOrderNo: list[currentPrint]
  545. .wordOrderNo ??
  546. '',
  547. qty: list[currentPrint]
  548. .qty ??
  549. '',
  550. dateOfManufacture: list[currentPrint]
  551. .dateOfManufacture ??
  552. '',
  553. storageLocation: list[currentPrint]
  554. .storageLocation ??
  555. '',
  556. postProduction: list[currentPrint]
  557. .postProduction ??
  558. '',
  559. vendor: list[currentPrint]
  560. .vendor ??
  561. '',
  562. packaging: list[currentPrint]
  563. .packaging ??
  564. '',
  565. qc: list[currentPrint]
  566. .qc ??
  567. '',
  568. qrCode: list[currentPrint]
  569. .qrCode ??
  570. ''
  571. }
  572. await labelTest(paramsObj)
  573. }
  574. if (currentPrint === blueConfig.value.printNum) {
  575. await clearInterval(timer)
  576. }
  577. }, 3000)
  578. }
  579. } else {
  580. uni.showToast({
  581. title: msg,
  582. duration: 2000,
  583. icon: 'none'
  584. })
  585. }
  586. })
  587. }
  588. const handleUnloadPrintLabel = function(item) {
  589. let list = []
  590. uni.request({
  591. url: uni.$baseUrl + '/report/print/slittingPrintData',
  592. data: {
  593. id: item.labelMasterId
  594. }
  595. }).then(async ({
  596. data: {
  597. data
  598. }
  599. }) => {
  600. if (data?.length > 0) {
  601. uni.showToast({
  602. title: '标签打印中,请勿进行操作',
  603. duration: 10000,
  604. icon: 'none'
  605. })
  606. list = data
  607. if (list.length > 0) {
  608. blueConfig.value.currentPrint = 1
  609. blueConfig.value.printNum = list.length
  610. const timer = setInterval(async () => {
  611. const currentPrint = blueConfig.value.currentPrint - 1
  612. if (blueConfig.value.isLabelSend === false &&
  613. currentPrint <
  614. blueConfig.value.printNum) {
  615. const paramsObj = {
  616. materialName: list[currentPrint]
  617. .materialName ?? '',
  618. materialNo: list[currentPrint]
  619. .materialNo ??
  620. '',
  621. supplierName: list[currentPrint]
  622. .supplierName ??
  623. '',
  624. size: list[currentPrint]
  625. .size ??
  626. '',
  627. createTime: list[currentPrint]
  628. .createTime ??
  629. '',
  630. materialLots: list[currentPrint]
  631. .materialLots ??
  632. '',
  633. wmsStockLocationName: list[currentPrint]
  634. .wmsStockLocationName ??
  635. '',
  636. validityDate: list[currentPrint]
  637. .validityDate ??
  638. '',
  639. inspectTime: list[currentPrint]
  640. .inspectTime ??
  641. '',
  642. storageEnvironment: list[currentPrint]
  643. .storageEnvironment ??
  644. '',
  645. slittingOrderNo: list[currentPrint]
  646. .slittingOrderNo ??
  647. '',
  648. produceDate: list[currentPrint]
  649. .produceDate ??
  650. '',
  651. batchNumber: list[currentPrint]
  652. .batchNumber ??
  653. '',
  654. qty: list[currentPrint]
  655. .qty ??
  656. ''
  657. }
  658. await cuttingPrint(paramsObj)
  659. }
  660. if (currentPrint === blueConfig.value.printNum) {
  661. await clearInterval(timer)
  662. }
  663. }, 3000)
  664. }
  665. } else {
  666. uni.showToast({
  667. title: '打印数据错误',
  668. icon: 'none',
  669. duration: 2000
  670. })
  671. }
  672. })
  673. }
  674. // 关闭错误信息弹窗
  675. const handleCloseErrorTipsModal = async function() {
  676. errorTip.value.close()
  677. }
  678. return {
  679. popup,
  680. goBack,
  681. unLoadList,
  682. errorTip,
  683. errorState,
  684. errorTipMessage,
  685. isLandscapeScreen,
  686. ProcessParams,
  687. handlePatchWork,
  688. handleUnloadPrintLabel,
  689. handleCloseErrorTipsModal,
  690. handleSubmitApprovalModal
  691. }
  692. }
  693. })
  694. </script>
  695. <style lang="scss" scoped>
  696. .gui-header-leader-btns {
  697. color: black;
  698. font-size: 24px !important;
  699. margin-left: 24rpx;
  700. }
  701. .gui-sbody {
  702. background-color: rgba(234, 239, 242, 1);
  703. }
  704. .gui-relative {
  705. overflow: visible;
  706. height: 100vh;
  707. .oqc-checkout {
  708. width: 100vw;
  709. height: calc(100vh - 75px);
  710. position: absolute;
  711. top: 95px;
  712. overflow-y: scroll;
  713. }
  714. }
  715. .card-list-flexbox {
  716. width: calc(100vw - 24px);
  717. height: 345px;
  718. margin: 0 12px;
  719. display: flex;
  720. justify-content: center;
  721. flex-direction: column;
  722. align-items: center;
  723. overflow-y: scroll;
  724. .card-list-title {
  725. width: 100%;
  726. height: 35px;
  727. line-height: 35px;
  728. margin: 0 4px 0 4px;
  729. border-radius: 4px 4px 0 0;
  730. text-align: center;
  731. color: white;
  732. background-color: rgba(0, 160, 233, 1.0);
  733. }
  734. .card-list-item,
  735. .card-list-item-operation {
  736. width: 100%;
  737. height: 35px;
  738. margin: 0 4px 3rpx 4px;
  739. border-radius: 4px;
  740. display: flex;
  741. flex-direction: row;
  742. align-items: center;
  743. justify-content: space-between;
  744. background-color: #fff;
  745. uni-text {
  746. font-size: 14px;
  747. height: 50rpx;
  748. text-align: left;
  749. padding: 0 8px;
  750. display: flex;
  751. flex-direction: row;
  752. align-items: center;
  753. }
  754. .text-1 {
  755. flex: 1;
  756. height: 35px;
  757. justify-content: flex-start;
  758. }
  759. .text-2 {
  760. flex: 3;
  761. height: 35px;
  762. justify-content: flex-end;
  763. margin-right: 4px;
  764. padding: 2px 6px;
  765. }
  766. }
  767. }
  768. .popup-content {
  769. width: 100vw;
  770. height: 55vh;
  771. overflow-y: scroll;
  772. }
  773. .card-list-flexbox-popup {
  774. width: 100vw;
  775. display: flex;
  776. flex-direction: row;
  777. align-items: center;
  778. flex-wrap: wrap;
  779. .card-list-item,
  780. .card-list-item-input {
  781. width: 100vw;
  782. height: 100%;
  783. min-height: 40px;
  784. display: flex;
  785. flex-direction: row;
  786. align-items: center;
  787. background-color: #fff;
  788. uni-text {
  789. font-size: 14px;
  790. height: 50rpx;
  791. text-align: left;
  792. padding: 0 12px;
  793. display: flex;
  794. flex-direction: row;
  795. align-items: center;
  796. }
  797. uni-image {
  798. width: calc(100vw / 2 - 4px);
  799. height: calc(100vw / 3.2 - 2px);
  800. pointer-events: none;
  801. }
  802. uni-image::after {
  803. content: "×";
  804. width: 22px;
  805. height: 22px;
  806. position: absolute;
  807. top: 5px;
  808. right: 5px;
  809. display: flex;
  810. justify-content: center;
  811. align-items: center;
  812. color: rgba(255, 255, 255, 0.9);
  813. background-color: rgba(0, 0, 0, 0.5);
  814. border-radius: 50%;
  815. font-size: 24px;
  816. /*给伪元素开启鼠标事件,将事件冒泡到父元素的点击事件中*/
  817. pointer-events: auto;
  818. }
  819. .text-1 {
  820. flex: 1;
  821. height: 40px;
  822. justify-content: flex-start;
  823. }
  824. .text-2 {
  825. flex: 3;
  826. height: 40px;
  827. justify-content: flex-end;
  828. margin-right: 4px;
  829. padding: 2px 6px;
  830. }
  831. .text-3 {
  832. width: calc(100% - 15%);
  833. min-height: 35px;
  834. justify-content: flex-end;
  835. padding: 2px 6px;
  836. }
  837. .text-3::before {}
  838. .btn-mg {
  839. margin: 0 5px;
  840. }
  841. }
  842. .card-list-item {
  843. justify-content: center;
  844. }
  845. .card-list-item-input {
  846. margin: 10px 0 10px 2%;
  847. display: flex;
  848. flex-direction: column;
  849. uni-view {
  850. width: 100%;
  851. height: 100%;
  852. display: flex;
  853. uni-textarea {
  854. flex: 8;
  855. }
  856. uni-view {
  857. flex: 1;
  858. }
  859. .operation-icon,
  860. .operation-icon-2 {
  861. height: auto;
  862. uni-text {
  863. width: 22px;
  864. height: 100%;
  865. padding: 0 !important;
  866. text-align: center;
  867. display: flex;
  868. justify-content: center;
  869. align-items: center;
  870. border-top-right-radius: 4px;
  871. border-bottom-right-radius: 4px;
  872. color: white;
  873. background-color: #80b7ff;
  874. }
  875. }
  876. .operation-icon-2 {
  877. uni-text {
  878. background-color: #ff5962;
  879. }
  880. }
  881. }
  882. }
  883. .grid-image {
  884. /* 设置容器布局为grid布局 */
  885. display: grid;
  886. /* 指定每一行的宽度 每个宽度中间用空格隔开 */
  887. grid-template-rows: repeat(auto-fill, 1fr);
  888. /* 指定每一列的宽度 每个宽度中间用空格隔开 */
  889. grid-template-columns: repeat(2, 1fr);
  890. padding: 0 4px;
  891. }
  892. .card-list-item:nth-of-type(1) {
  893. .text-1 {
  894. flex: 9;
  895. font-weight: bold;
  896. color: black !important;
  897. }
  898. .text-1::before {
  899. content: "";
  900. width: 4px;
  901. height: 20px;
  902. border-radius: 4px;
  903. margin-right: 4px;
  904. background-color: skyblue;
  905. }
  906. .text-2 {
  907. flex: 4;
  908. display: flex;
  909. flex-direction: row;
  910. justify-content: flex-end;
  911. align-items: center;
  912. color: limegreen !important;
  913. }
  914. }
  915. }
  916. .table-title {
  917. height: 40px;
  918. line-height: 40px;
  919. margin: 4px 0 -3px 0;
  920. padding: 0 12px;
  921. font-size: 16px;
  922. font-weight: bold;
  923. background-color: white;
  924. }
  925. .custom-table {
  926. height: 24vh;
  927. min-height: 230px;
  928. margin: 5px 0;
  929. // min-height: 600px;
  930. overflow-y: scroll;
  931. }
  932. .custom-table2 {
  933. height: 100px;
  934. margin: 5px 0;
  935. overflow-y: scroll;
  936. }
  937. .uni-list-cell {
  938. width: 100vw;
  939. height: 35px;
  940. margin: 4px 0;
  941. display: flex;
  942. flex-direction: row;
  943. align-items: center;
  944. justify-content: space-between;
  945. border-bottom: 2px solid #eaeff2;
  946. background-color: #fff;
  947. view {
  948. font-size: 14px;
  949. height: 50rpx;
  950. text-align: left;
  951. padding: 0 8px;
  952. display: flex;
  953. flex-direction: row;
  954. align-items: center;
  955. }
  956. .uni-list-cell-left {
  957. flex: 1;
  958. height: 35px;
  959. justify-content: flex-start;
  960. }
  961. .uni-list-cell-db {
  962. flex: 3;
  963. height: 35px;
  964. justify-content: flex-end;
  965. margin-right: 4px;
  966. padding: 2px 6px;
  967. uni-picker {
  968. width: 100%;
  969. display: flex;
  970. flex-direction: row;
  971. justify-content: center;
  972. }
  973. }
  974. }
  975. .modal-btns {
  976. height: 100rpx;
  977. line-height: 100rpx;
  978. display: flex;
  979. justify-content: center;
  980. align-items: center;
  981. }
  982. .line {
  983. margin-top: 10rpx;
  984. height: 80rpx;
  985. width: 1rpx;
  986. background-color: #dcdcdc;
  987. }
  988. .operationBtn {
  989. position: fixed;
  990. width: 100%;
  991. bottom: 0;
  992. padding: 12px 0;
  993. }
  994. </style>