processExecution.vue 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239
  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="scan">
  20. <view class="scan-title">
  21. <span>{{ params.erpWorkOrderNo }}</span>
  22. <span>{{ params.processName }}</span>
  23. </view>
  24. </view>
  25. <view class="scan">
  26. <view class="scan-title">
  27. <span>检验状态</span>
  28. <span>{{ computedIPQCState(btnState) }}</span>
  29. </view>
  30. </view>
  31. <view class="scan">
  32. <view class="scan-card">
  33. <span>执行人</span>
  34. <uni-easyinput ref="userInput" v-model="params.userName" :input-border="false" type="text"
  35. placeholder="请扫描工号" @confirm="confirmUser" @focus="handleInputFocus('userInput')"
  36. @clear="handleClear('userInput')" />
  37. <text class="font-icons" @click="handleScanUser">&#xe6b7;</text>
  38. </view>
  39. </view>
  40. <view v-if="params.equipmentInspection * 1 === 1" class="scan">
  41. <view v-if="params.equipmentInspection * 1 === 0 && !params.userName" class="scan-card">
  42. <span>设备</span>
  43. <uni-easyinput v-model="params.equipmentName" :input-border="false" disabled type="text"
  44. placeholder="请扫描设备码" />
  45. </view>
  46. <view v-if="params.equipmentInspection * 1 === 1 || params.userName" class="scan-card">
  47. <span>设备</span>
  48. <uni-easyinput ref="equipmentInput" v-model="params.equipmentName" :input-border="false"
  49. type="text" placeholder="请扫描设备码" @confirm="confirmEquipmentName"
  50. @focus="handleInputFocus('equipmentInput')" @clear="handleClear('equipmentInput')" />
  51. <text class="font-icons" @click="handleScanDevice">&#xe6b7;</text>
  52. </view>
  53. </view>
  54. <view v-if="params.verifyMoldFixture * 1 === 1" class="scan">
  55. <view v-if="params.verifyMoldFixture * 1 === 0 && !params.equipmentName" class="scan-card">
  56. <span>模具</span>
  57. <uni-easyinput v-model="params.toolingName" :input-border="false" disabled type="text"
  58. placeholder="请扫描模具码" />
  59. </view>
  60. <view v-if="params.verifyMoldFixture * 1 === 1 || params.equipmentName" class="scan-card">
  61. <span>模具</span>
  62. <uni-easyinput ref="toolingInput" v-model="params.toolingName" :input-border="false" type="text"
  63. placeholder="请扫描模具码" @confirm="confirmToolingName" @focus="handleInputFocus('toolingInput')"
  64. @clear="handleClear('toolingInput')" />
  65. <text class="font-icons" @click="handleScanTooling">&#xe6b7;</text>
  66. </view>
  67. </view>
  68. <!-- <view class="scan" v-if="params.verifyMoldFixture === '0'">
  69. <view class="scan-card">
  70. <span>物料清单</span>
  71. <uni-easyinput :inputBorder="false" disabled type="text"
  72. v-model="params.scanMaterialNumber" placeholder="请扫描物料条码/轴号"></uni-easyinput>
  73. </view>
  74. </view> -->
  75. <view class="scan">
  76. <!-- toolState: 当前是否已绑定模具 -->
  77. <!-- verifyMoldFixture: 是否需要绑定摸具 -->
  78. <view v-if="params.toolState * 1 === 0" class="scan-card">
  79. <span>物料清单</span>
  80. <uni-easyinput v-model="params.scanMaterialNumber" :input-border="false" disabled type="text"
  81. placeholder="请扫描物料条码/轴号" />
  82. </view>
  83. <view v-if="params.toolState * 1 === 1" class="scan-card">
  84. <span>物料清单</span>
  85. <uni-easyinput ref="materialInput" v-model="params.scanMaterialNumber" :input-border="false"
  86. type="text" placeholder="请扫描物料条码/轴号" @confirm="confirmMaterial"
  87. @focus="handleInputFocus('materialInput')" @clear="handleClear('materialInput')" />
  88. <text class="font-icons" @click="handleScanMaterialOrAxisNumber">&#xe6b7;</text>
  89. </view>
  90. </view>
  91. <uni-collapse accordion style="margin-bottom: 100px;">
  92. <uni-collapse-item v-for="(item, key) in params.materialList" :key="key">
  93. <template #title>
  94. <view class="collapse">
  95. <text
  96. v-if="params.materialList[key].complete && computedResidualArea(params.materialList[key].batchNumberDetails) > 0"
  97. class="font-icons" style="color: rgba(109, 205, 50, 1);">&#xe6ba;</text>
  98. <text v-else class="font-icons" style="color: orange;">&#xe6d1;</text>
  99. <view class="collapse-title">
  100. <view class="title-text-layout">{{ computedCollapseTitle(item) }}</view>
  101. <view v-if="params.materialList[key].complete"
  102. style="display: grid;grid-template-columns: 2fr 5fr 3fr;">
  103. <view class="title-text-layout">
  104. 轴({{ computedRollNo(params.materialList[key].rollNo) }})</view>
  105. <view class="title-text-layout">
  106. 规格({{ params.materialList[key].materialModels }})</view>
  107. <view class="title-text-layout"
  108. style="text-align: right;color: orange;font-weight: bold;">
  109. {{ computedResidualArea(params.materialList[key].batchNumberDetails) }}
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. </template>
  115. <view class="content">
  116. <view v-for="(Citem, Ckey) in params.materialList[key].batchNumberDetails" :key="Ckey"
  117. class="body-card" @click="handleChangeRow(Citem)">
  118. <view class="body-card-row">
  119. <span>批号</span>
  120. <span>{{ Citem.batchNum }}</span>
  121. </view>
  122. <view class="body-card-row">
  123. <span>余量</span>
  124. <span>{{ Citem.residueNumber }}㎡</span>
  125. </view>
  126. </view>
  127. </view>
  128. </uni-collapse-item>
  129. </uni-collapse>
  130. <view class="operationBtn">
  131. <button v-if="(btnState * 1 === 1) && (params.finishedProcess * 1 === 1)" type="primary"
  132. style="width: calc(100% - 8px);margin: 0 4px;" :disabled="params.printLabel * 1 === 0" @click="handleShowDayModal">打印</button>
  133. <button v-else-if="(btnState * 1 === 1) && (params.finishedProcess * 1 !== 1)" type="primary"
  134. style="width: calc(100% - 8px);margin: 0 4px;" :disabled="params.printLabel * 1 === 0" @click="handleValidataPrint('')">打印</button>
  135. <button v-else-if="btnState === -1" type="primary" style="width: calc(100% - 8px);margin: 0 4px;"
  136. @click="handleSubmission">送检</button>
  137. <button type="primary" style="width: calc(100% - 8px);margin: 0 4px;background-color: #07c160;"
  138. @click="handleNavigate">生产结束</button>
  139. </view>
  140. </view>
  141. <!-- 选择班别 -->
  142. <uni-popup ref="dayModal" background-color="#fff">
  143. <view class="popup-process-content">
  144. <view class="list-title" style="margin-bottom: 8px;">
  145. <span class="font-icons"
  146. style="font-size: 20px;color: #00a0e9;width: 40px;text-align: center;">&#xe6a3;</span>
  147. <span>班别列表</span>
  148. </view>
  149. <view class="grid-box">
  150. <view v-for="(item, key) in dictDataList" :key="key" class="box" @click="handleClickDay(item)">
  151. <text>{{ item.label }}</text>
  152. </view>
  153. </view>
  154. </view>
  155. </uni-popup>
  156. <!-- 打印前,用户需要输入生产数量 -->
  157. <uni-popup ref="inputDialog" type="dialog">
  158. <uni-popup-dialog ref="inputClose" mode="input" title="标签生产数量" :value="qty" placeholder="请输入内容"
  159. @confirm="handleSetNum" />
  160. </uni-popup>
  161. <!-- 提示窗示例 -->
  162. <uni-popup ref="popup" type="dialog">
  163. <uni-popup-dialog type="warn" cancel-text="取消" confirm-text="确认" title="提示"
  164. @confirm="handleReportingWork" @close="popup.close()">
  165. <!-- eslint-disable-next-line -->
  166. <template #default="custom">
  167. <view class="form" style="width: 100%;margin: 0;">
  168. <view class="form-item">
  169. <div class="title">物料批次</div>
  170. <div class="content">
  171. <uni-easyinput v-model="rowEvent.materialCode" disabled type="digit"
  172. placeholder="请输入" />
  173. </div>
  174. </view>
  175. <view class="form-item">
  176. <div class="title">轴号</div>
  177. <div class="content">
  178. <uni-easyinput v-model="rowEvent.rollNo" disabled type="text" />
  179. </div>
  180. </view>
  181. <view class="form-item">
  182. <div class="title">剩余长度</div>
  183. <div class="content">
  184. <uni-easyinput v-model="rowEvent.residueLength" placeholder="请输入长度" type="digit" />
  185. </div>
  186. </view>
  187. <view class="form-item">
  188. <div class="title">核准数量(㎡)</div>
  189. <div class="content" style="margin: 0;">
  190. <input v-model="rowEvent.calculate" disabled>
  191. </div>
  192. </view>
  193. <view style="margin: 0 0 12px 0;display: flex;align-items: center;">
  194. <checkbox-group @change="handlePrintLabelChecked">
  195. <checkbox value="printLabel" :checked="isPrintLabel" color="#007aff"
  196. style="transform:scale(0.7)" />
  197. 打标签
  198. </checkbox-group>
  199. </view>
  200. </view>
  201. </template>
  202. </uni-popup-dialog>
  203. </uni-popup>
  204. <uni-popup ref="errorTip" type="dialog">
  205. <uni-popup-dialog type="error" cancel-text="关闭" confirm-text="确认" title="提示" :content="errorTipMessage"
  206. @confirm="handleCloseErrorTipsModal" @close="handleCloseErrorTipsModal" />
  207. </uni-popup>
  208. </template>
  209. </gui-page>
  210. </template>
  211. <script>
  212. import {
  213. add
  214. } from '@/unit/Math.js'
  215. import {
  216. computed,
  217. defineComponent,
  218. ref,
  219. onMounted,
  220. onBeforeMount,
  221. watch
  222. } from 'vue'
  223. import tsc from '@/unit/CHITEN_SDK_APP/tsc.js'
  224. export default defineComponent({
  225. onLoad() {
  226. // // #ifdef APP-PLUS
  227. // plus.screen.lockOrientation('default');
  228. // // #endif
  229. },
  230. onUnload() {
  231. // // #ifdef APP-PLUS
  232. // plus.screen.lockOrientation('portrait-primary');
  233. // // #endif
  234. },
  235. onResize() {
  236. if ([90, -90].includes(plus.navigator.getOrientation())) {
  237. this.isLandscapeScreen = true
  238. } else {
  239. this.isLandscapeScreen = false
  240. }
  241. },
  242. setup(options) {
  243. const popup = ref()
  244. const btnState = ref(0)
  245. const modalForm = ref()
  246. const dayModal = ref()
  247. const dictDataList = ref([])
  248. const isLandscapeScreen = ref(false)
  249. // 是否打标签
  250. const isPrintLabel = ref(false)
  251. const parentRow = uni.getStorageSync('HotPressInfo') ?? {}
  252. // 绑定的检查人信息
  253. const params = ref({
  254. userState: '0', // 执行人
  255. deviceState: '0', // 设备
  256. toolState: '0', // 模具
  257. processName: '',
  258. routingListId: '',
  259. materialCount: 0,
  260. finishedProcess: '', // 打印是否需要选择班别, 为1则表示需要选择班别
  261. userName: '', // 执行人
  262. equipmentName: '', // 设备
  263. toolingName: '', // 模具
  264. materialNo: '', // 物料编码
  265. scanMaterialNumber: '', // 物料/轴号
  266. upperMaterialId: '', // 物料主表Id
  267. materialList: [], // 用料清单
  268. equipmentInspection: '',
  269. verifyMoldFixture: '',
  270. // 是否打印标签:为0不打印,打印按钮置灰
  271. printLabel: 0
  272. })
  273. const rowEvent = ref({
  274. width: 0, // 宽度
  275. residueLength: 0, //剩余长度
  276. materialCode: '',
  277. batchNum: '',
  278. rollNo: '',
  279. calculate: '',
  280. labelMasterId: ''
  281. })
  282. // 0:物料,1:轴号
  283. const nextScanState = ref('batchNum')
  284. // 生产数量
  285. const qty = ref(0)
  286. const inputDialog = ref()
  287. // 班别列表选择的班别
  288. const className = ref()
  289. // 当前执行物料清单索引
  290. const nextCodeIndex = ref(0)
  291. const bluetooth = ref()
  292. const blueConfig = ref({
  293. loopBuffer: 0,
  294. currentTime: 1,
  295. lastData: 0,
  296. onBufferSize: 20,
  297. printerNum: 1,
  298. currentPrint: 1,
  299. isLabelSend: false
  300. })
  301. const userInput = ref()
  302. const equipmentInput = ref()
  303. const toolingInput = ref()
  304. const materialInput = ref()
  305. const emptyDocument = ref()
  306. const errorState = ref(0)
  307. const errorTip = ref('')
  308. const errorTipMessage = ref('')
  309. // 手风琴表头
  310. const computedCollapseTitle = computed(() => {
  311. return item => {
  312. if (![NaN, null, undefined, ''].includes(item.materialCode)) {
  313. return item?.materialCode + '(' + item?.materialName + ')'
  314. }
  315. return ''
  316. }
  317. })
  318. const computedResidualArea = computed(() => {
  319. return item => {
  320. if (item?.length > 0) {
  321. let num = 0
  322. for (let i = 0; i < item.length; i++) {
  323. num = add(item[i].residueNumber, num)
  324. }
  325. return num
  326. } else {
  327. return 0
  328. }
  329. }
  330. })
  331. // rollNo
  332. const computedRollNo = computed(() => {
  333. return item => {
  334. if (![NaN, null, undefined, ''].includes(item)) {
  335. return item.trim()?.slice(0, 3)
  336. }
  337. return ''
  338. }
  339. })
  340. const computedIPQCState = computed(() => {
  341. return item => {
  342. if (![NaN, null, undefined, ''].includes(item)) {
  343. switch (item) {
  344. case -1:
  345. return '待送检'
  346. case 0:
  347. return '工单冻结不可送检'
  348. case 1:
  349. return '可下料打标签'
  350. case 2:
  351. return '已送检未审核'
  352. }
  353. }
  354. return ''
  355. }
  356. })
  357. // 根据剩余长度计算剩余数量
  358. watch([() => rowEvent.value.residueLength], (oldVal, newVal) => {
  359. rowEvent.value.calculate = Math.ceil((oldVal[0] * 1) * (rowEvent.value.width * 0.001)).toFixed(5);
  360. })
  361. const search = async function() {
  362. await uni.$reqGet('getProcessParam', {
  363. id: params.value?.id
  364. })
  365. .then(({
  366. code,
  367. data,
  368. msg
  369. }) => {
  370. if (code === 0) {
  371. Object.assign(params.value, data)
  372. } else {
  373. uni.showToast({
  374. title: msg,
  375. icon: 'none',
  376. duration: 2000
  377. })
  378. }
  379. })
  380. await uni.$reqGet('getUpperMaterialFlatKnife', {
  381. hotPressId: params.value?.id
  382. })
  383. .then(({
  384. code,
  385. data,
  386. msg
  387. }) => {
  388. if (code === 0) {
  389. data?.materialList.forEach(item => {
  390. item.complete = true
  391. })
  392. nextCodeIndex.value = data?.materialList?.length
  393. if (params.value.verifyMoldFixture * 1 === 0 || data?.toolingName) {
  394. params
  395. .value.toolState = '1'
  396. }
  397. Object.assign(params.value, data)
  398. if (params.value.materialCount > 0) {
  399. const forCount = params.value.materialCount - data
  400. .materialList?.length
  401. for (let i = 0; i < forCount; i++) {
  402. params.value.materialList.push({
  403. batchNum: '',
  404. materialName: '',
  405. rollNo: '',
  406. complete: false
  407. })
  408. }
  409. }
  410. } else {
  411. uni.showToast({
  412. title: msg,
  413. icon: 'none',
  414. duration: 2000
  415. })
  416. }
  417. })
  418. }
  419. // 校验显示打印按钮还是送检按钮
  420. const initChecked = async function() {
  421. const month = new Date().getMonth() + 1
  422. const day = new Date().getDate()
  423. await uni.$reqPost('getCheckedIPQCPass', {
  424. ipqcDate: new Date().getFullYear() + '' + (
  425. month < 10 ? ('0' +
  426. month) :
  427. month) + '' + (day < 10 ? ('0' + day) : day),
  428. mesHotPressId: params.value?.id,
  429. productionCode: '1605796881528524802'
  430. })
  431. .then(({
  432. code,
  433. data,
  434. msg
  435. }) => {
  436. if (code === 0) {
  437. btnState.value = data
  438. } else {
  439. uni.showToast({
  440. title: msg,
  441. icon: 'none',
  442. duration: 2000
  443. })
  444. }
  445. })
  446. }
  447. onBeforeMount(() => {
  448. Object.assign(params.value, JSON.parse(parentRow))
  449. // #ifdef APP-PLUS
  450. const bluetoothConfig = uni.getStorageSync('bluetoothConfig')
  451. if ([null, '', undefined].includes(bluetoothConfig)) {
  452. bluetooth.value = {
  453. 'isOpenBle': false,
  454. 'deviceId': '',
  455. 'serviceId': '',
  456. 'writeId': '',
  457. 'notifyId': ''
  458. }
  459. setTimeout(() => {
  460. // #ifdef APP-PLUS
  461. plus.device.beep(2)
  462. // #endif
  463. errorTipMessage.value = '蓝牙打印机未连接'
  464. errorState.value = -1
  465. errorTip.value.open()
  466. }, 800)
  467. } else {
  468. bluetooth.value = JSON.parse(bluetoothConfig)
  469. }
  470. // #endif
  471. // 获取班别字典数据
  472. uni.$reqGet('getDictDataPage', {
  473. dictType: 'class_flag',
  474. pageNo: 1,
  475. pageSize: 100
  476. })
  477. .then(({
  478. code,
  479. data,
  480. msg
  481. }) => {
  482. dictDataList.value = data?.list ?? []
  483. })
  484. })
  485. onMounted(async () => {
  486. await search()
  487. await initChecked()
  488. if (params.value.userName && params.value.equipmentName && params.value.toolingName) {
  489. materialInput.value.onBlur()
  490. materialInput.value.onFocus()
  491. } else if (params.value.userName && params.value.equipmentName) {
  492. toolingInput.value.onBlur()
  493. toolingInput.value.onFocus()
  494. } else if (params.value.userName) {
  495. equipmentInput.value.onBlur()
  496. equipmentInput.value.onFocus()
  497. } else {
  498. userInput.value.onBlur()
  499. userInput.value.onFocus()
  500. }
  501. })
  502. const goBack = function() {
  503. uni.$goBack('/pages/workbranch/production/processExecution/processDetails')
  504. }
  505. const handleScanUser = function() {
  506. // #ifdef APP-PLUS
  507. const mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module')
  508. mpaasScanModule.mpaasScan({
  509. // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
  510. 'scanType': ['qrCode', 'barCode'],
  511. // 是否隐藏相册,默认false不隐藏
  512. 'hideAlbum': false
  513. },
  514. (ret) => {
  515. if (ret.resp_code === 1000) {
  516. // 执行人
  517. uni.$reqPost('scanUser', {
  518. hotPressId: params.value?.id,
  519. qrCode: ret.resp_result
  520. })
  521. .then(({
  522. code,
  523. data,
  524. msg
  525. }) => {
  526. if (code === 0) {
  527. if (data?.result * 1 === 0) {
  528. params.value.userName = ''
  529. // #ifdef APP-PLUS
  530. plus.device.beep(2)
  531. // #endif
  532. errorTipMessage.value = data.message
  533. errorTip.value.open()
  534. errorState.value = 0
  535. return
  536. }
  537. params.value.userName = data?.echoData
  538. params.value.userState = data?.result
  539. equipmentInput.value.onBlur()
  540. equipmentInput.value.onFocus()
  541. } else {
  542. // #ifdef APP-PLUS
  543. plus.device.beep(2)
  544. // #endif
  545. errorTipMessage.value = msg
  546. errorTip.value.open()
  547. errorState.value = 0
  548. }
  549. })
  550. }
  551. })
  552. // #endif
  553. }
  554. // 绑定执行人
  555. const confirmUser = function(e) {
  556. // 执行人
  557. uni.$reqPost('scanUser', {
  558. hotPressId: params.value?.id,
  559. qrCode: e
  560. })
  561. .then(({
  562. code,
  563. data,
  564. msg
  565. }) => {
  566. if (code === 0) {
  567. if (data?.result * 1 === 0) {
  568. params.value.userName = ''
  569. // #ifdef APP-PLUS
  570. plus.device.beep(2)
  571. // #endif
  572. errorTipMessage.value = data.message
  573. errorTip.value.open()
  574. errorState.value = 0
  575. return
  576. }
  577. params.value.userName = data?.echoData
  578. params.value.userState = data?.result
  579. equipmentInput.value.onBlur()
  580. equipmentInput.value.onFocus()
  581. } else {
  582. // #ifdef APP-PLUS
  583. plus.device.beep(2)
  584. // #endif
  585. errorTipMessage.value = msg
  586. errorTip.value.open()
  587. errorState.value = 0
  588. }
  589. })
  590. }
  591. const handleScanDevice = function() {
  592. // #ifdef APP-PLUS
  593. const mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module')
  594. mpaasScanModule.mpaasScan({
  595. // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
  596. 'scanType': ['qrCode', 'barCode'],
  597. // 是否隐藏相册,默认false不隐藏
  598. 'hideAlbum': false
  599. },
  600. (ret) => {
  601. if (ret.resp_code === 1000) {
  602. // 扫描设备
  603. uni.$reqPost('scanDevice', {
  604. hotPressId: params.value?.id,
  605. qrCode: ret.resp_result
  606. })
  607. .then(({
  608. code,
  609. data,
  610. msg
  611. }) => {
  612. if (code === 0) {
  613. if (data?.result * 1 === 0) {
  614. params.value.equipmentName = ''
  615. // #ifdef APP-PLUS
  616. plus.device.beep(2)
  617. // #endif
  618. errorTipMessage.value = data.message
  619. errorTip.value.open()
  620. errorState.value = 1
  621. return
  622. }
  623. params.value.equipmentName = data?.echoData
  624. params.value.deviceState = data?.result
  625. toolingInput.value.onBlur()
  626. toolingInput.value.onFocus()
  627. } else {
  628. // #ifdef APP-PLUS
  629. plus.device.beep(2)
  630. // #endif
  631. errorTipMessage.value = msg
  632. errorTip.value.open()
  633. errorState.value = 1
  634. }
  635. })
  636. }
  637. })
  638. // #endif
  639. }
  640. const confirmEquipmentName = function(e) {
  641. // 扫描设备
  642. uni.$reqPost('scanDevice', {
  643. hotPressId: params.value?.id,
  644. qrCode: e
  645. })
  646. .then(({
  647. code,
  648. data,
  649. msg
  650. }) => {
  651. if (code === 0) {
  652. if (data?.result * 1 === 0) {
  653. params.value.equipmentName = ''
  654. // #ifdef APP-PLUS
  655. plus.device.beep(2)
  656. // #endif
  657. errorTipMessage.value = data.message
  658. errorTip.value.open()
  659. errorState.value = 1
  660. return
  661. }
  662. params.value.equipmentName = data?.echoData
  663. params.value.deviceState = data?.result
  664. toolingInput.value.onBlur()
  665. toolingInput.value.onFocus()
  666. } else {
  667. // #ifdef APP-PLUS
  668. plus.device.beep(2)
  669. // #endif
  670. errorTipMessage.value = msg
  671. errorTip.value.open()
  672. errorState.value = 1
  673. }
  674. })
  675. }
  676. const handleScanTooling = function() {
  677. // #ifdef APP-PLUS
  678. const mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module')
  679. mpaasScanModule.mpaasScan({
  680. // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
  681. 'scanType': ['qrCode', 'barCode'],
  682. // 是否隐藏相册,默认false不隐藏
  683. 'hideAlbum': false
  684. },
  685. (ret) => {
  686. if (ret.resp_code === 1000) {
  687. // 扫描模具
  688. uni.$reqPost('scanTooling', {
  689. hotPressId: params.value?.id,
  690. qrCode: ret.resp_result
  691. })
  692. .then(({
  693. code,
  694. data,
  695. msg
  696. }) => {
  697. if (code === 0) {
  698. if (data?.result * 1 === 0) {
  699. params.value.toolingName = ''
  700. // #ifdef APP-PLUS
  701. plus.device.beep(2)
  702. // #endif
  703. errorTipMessage.value = data.message
  704. errorTip.value.open()
  705. errorState.value = 2
  706. return
  707. }
  708. params.value.toolingName = data?.echoData
  709. params.value.toolState = data?.result
  710. materialInput.value.onBlur()
  711. materialInput.value.onFocus()
  712. } else {
  713. // #ifdef APP-PLUS
  714. plus.device.beep(2)
  715. // #endif
  716. errorTipMessage.value = msg
  717. errorTip.value.open()
  718. errorState.value = 2
  719. }
  720. })
  721. }
  722. })
  723. // #endif
  724. }
  725. const confirmToolingName = function(e) {
  726. // 扫描模具
  727. uni.$reqPost('scanTooling', {
  728. hotPressId: params.value?.id,
  729. qrCode: e
  730. })
  731. .then(({
  732. code,
  733. data,
  734. msg
  735. }) => {
  736. if (code === 0) {
  737. if (data?.result * 1 === 0) {
  738. params.value.toolingName = ''
  739. // #ifdef APP-PLUS
  740. plus.device.beep(2)
  741. // #endif
  742. errorTipMessage.value = data.message
  743. errorTip.value.open()
  744. errorState.value = 2
  745. return
  746. }
  747. params.value.toolingName = data?.echoData
  748. params.value.toolState = data?.result
  749. materialInput.value.onBlur()
  750. materialInput.value.onFocus()
  751. } else {
  752. // #ifdef APP-PLUS
  753. plus.device.beep(2)
  754. // #endif
  755. errorTipMessage.value = msg
  756. errorTip.value.open()
  757. errorState.value = 2
  758. }
  759. })
  760. }
  761. const handleScanMaterialOrAxisNumber = function() {
  762. // #ifdef APP-PLUS
  763. const mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module')
  764. mpaasScanModule.mpaasScan({
  765. // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
  766. 'scanType': ['qrCode', 'barCode'],
  767. // 是否隐藏相册,默认false不隐藏
  768. 'hideAlbum': false
  769. },
  770. (ret) => {
  771. if (ret.resp_code === 1000) {
  772. if (nextScanState.value !== 'roll') {
  773. // 扫描物料
  774. uni.$reqPost('scanMaterialInfo', {
  775. hotPressId: params.value?.id,
  776. qrCode: ret.resp_result
  777. })
  778. .then(({
  779. code,
  780. data,
  781. msg
  782. }) => {
  783. if (code === 0) {
  784. // errorTipMessage.value = data?.message;
  785. // errorTip.value.open();
  786. if (data?.result * 1 === 1) {
  787. params.value.scanMaterialNumber = ret.resp_result
  788. params.value.materialNo = ret.resp_result
  789. // 存在两种情况,1:物料与轴号对应,2:只需扫物料
  790. // next等于2表示需要扫轴
  791. if (data?.next * 1 === 2) {
  792. nextScanState.value = 'roll'
  793. } else {
  794. nextScanState.value = 'batchNum'
  795. search()
  796. }
  797. } else {
  798. // #ifdef APP-PLUS
  799. plus.device.beep(2)
  800. // #endif
  801. errorTipMessage.value = data.message
  802. errorTip.value.open()
  803. errorState.value = 3
  804. }
  805. } else {
  806. // #ifdef APP-PLUS
  807. plus.device.beep(2)
  808. // #endif
  809. errorTipMessage.value = msg
  810. errorTip.value.open()
  811. errorState.value = 3
  812. }
  813. })
  814. } else {
  815. // 扫描轴号
  816. uni.$reqPost('scaRoll', {
  817. hotPressId: params.value?.id,
  818. materialQrCode: params.value.materialNo,
  819. rollQrCode: ret.resp_result
  820. })
  821. .then(({
  822. code,
  823. data,
  824. msg
  825. }) => {
  826. if (code === 0) {
  827. // errorTipMessage.value = data?.message;
  828. // errorTip.value.open();
  829. if (data?.result * 1 === 1) {
  830. if (data?.next * 1 === 1) {
  831. nextScanState.value = 'batchNum'
  832. }
  833. search()
  834. } else {
  835. // #ifdef APP-PLUS
  836. plus.device.beep(2)
  837. // #endif
  838. errorTipMessage.value = data.message
  839. errorTip.value.open()
  840. errorState.value = 3
  841. }
  842. } else {
  843. // #ifdef APP-PLUS
  844. plus.device.beep(2)
  845. // #endif
  846. errorTipMessage.value = msg
  847. errorTip.value.open()
  848. errorState.value = 3
  849. }
  850. })
  851. }
  852. }
  853. })
  854. // #endif
  855. }
  856. // 绑定物料/轴号
  857. const confirmMaterial = function(e) {
  858. if (nextScanState.value !== 'roll') {
  859. // 扫描物料
  860. uni.$reqPost('scanMaterialInfo', {
  861. hotPressId: params.value?.id,
  862. qrCode: e
  863. })
  864. .then(({
  865. code,
  866. data,
  867. msg
  868. }) => {
  869. if (code === 0) {
  870. // errorTipMessage.value = data?.message;
  871. // errorTip.value.open();
  872. if (data?.result * 1 === 1) {
  873. params.value.materialNo = e
  874. errorState.value = 3
  875. setInputFocus()
  876. // 存在两种情况,1:物料与轴号对应,2:只需扫物料
  877. // next等于2表示需要扫轴
  878. if (data?.next * 1 === 2) {
  879. nextScanState.value = 'roll'
  880. } else {
  881. nextScanState.value = 'batchNum'
  882. search()
  883. }
  884. } else {
  885. // #ifdef APP-PLUS
  886. plus.device.beep(2)
  887. // #endif
  888. errorTipMessage.value = data.message
  889. errorTip.value.open()
  890. errorState.value = 3
  891. }
  892. } else {
  893. // #ifdef APP-PLUS
  894. plus.device.beep(2)
  895. // #endif
  896. errorTipMessage.value = msg
  897. errorTip.value.open()
  898. errorState.value = 3
  899. }
  900. })
  901. } else {
  902. // 扫描轴号
  903. uni.$reqPost('scaRoll', {
  904. hotPressId: params.value?.id,
  905. materialQrCode: params.value.materialNo,
  906. rollQrCode: e
  907. })
  908. .then(({
  909. code,
  910. data,
  911. msg
  912. }) => {
  913. if (code === 0) {
  914. // errorTipMessage.value = data?.message;
  915. // errorTip.value.open();
  916. if (data?.result * 1 === 1) {
  917. errorState.value = 3
  918. setInputFocus()
  919. if (data?.next * 1 === 1) {
  920. nextScanState.value = 'batchNum'
  921. }
  922. search()
  923. } else {
  924. // #ifdef APP-PLUS
  925. plus.device.beep(2)
  926. // #endif
  927. errorTipMessage.value = data.message
  928. errorTip.value.open()
  929. errorState.value = 3
  930. }
  931. } else {
  932. // #ifdef APP-PLUS
  933. plus.device.beep(2)
  934. // #endif
  935. errorTipMessage.value = msg
  936. errorTip.value.open()
  937. errorState.value = 3
  938. }
  939. })
  940. }
  941. }
  942. // 送检
  943. const handleSubmission = function() {
  944. const month = new Date().getMonth() + 1
  945. const day = new Date().getDate()
  946. uni.$reqPost('createIPQCFormHotPress', {
  947. ipqcDate: new Date().getFullYear() + '' + (
  948. month < 10 ? ('0' +
  949. month) :
  950. month) + '' + (day < 10 ? ('0' + day) : day),
  951. mesHotPressId: params.value?.id,
  952. productionCode: '1605796881528524802'
  953. })
  954. .then(({
  955. code,
  956. data,
  957. msg
  958. }) => {
  959. if (code === 0) {
  960. uni.showToast({
  961. title: '送检成功',
  962. icon: 'none',
  963. duration: 2000
  964. })
  965. initChecked()
  966. } else {
  967. // #ifdef APP-PLUS
  968. plus.device.beep(2)
  969. // #endif
  970. errorTipMessage.value = msg
  971. errorTip.value.open()
  972. errorState.value = -1
  973. }
  974. })
  975. }
  976. const handleChangeRow = function(row) {
  977. Object.assign(rowEvent.value, {
  978. materialCode: row.materialCode,
  979. batchNum: row.batchNum,
  980. rollNo: row.rollNo,
  981. labelMasterId: row.labelMasterId ?? '',
  982. width: row.width ?? 0,
  983. residueLength: Math.ceil(((row.residueNumber * 1) / ((row.width * 1) * 0.001))).toFixed(5) ?? 0,
  984. // calculate: row.residueNumber ?? ''
  985. })
  986. popup.value.open()
  987. }
  988. const handleReportingWork = function() {
  989. let list = []
  990. // 卸料
  991. uni.$reqPost('ReportingWorkDischarge', {
  992. hotPressId: params.value?.id,
  993. batchNum: rowEvent.value.batchNum,
  994. materialCode: rowEvent.value.materialCode,
  995. calculate: Number(rowEvent.value.calculate)
  996. })
  997. .then(({
  998. code,
  999. data,
  1000. msg
  1001. }) => {
  1002. if (code === 0) {
  1003. // // #ifdef APP-PLUS
  1004. // const Activity = plus.android.runtimeMainActivity();
  1005. // const Intent = plus.android.importClass("android.content.Intent");
  1006. // const Uri = plus.android.importClass("android.net.Uri");
  1007. // const browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(
  1008. // `${uni.$baseUrl}/jmreport/view/821903765761437696?id=${data}`
  1009. // ))
  1010. // Activity.startActivity(browserIntent);
  1011. // // #endif
  1012. // // #ifdef H5
  1013. // const dom = document.createElement('a');
  1014. // dom.setAttribute("href",
  1015. // `${uni.$baseUrl}/jmreport/view/821903765761437696?id=${data}`
  1016. // );
  1017. // dom.setAttribute("target", "_blank");
  1018. // dom.click();
  1019. // // #endif
  1020. search()
  1021. if (!isPrintLabel.value) {
  1022. uni.showToast({
  1023. title: '卸料成功',
  1024. duration: 2000,
  1025. icon: 'none'
  1026. })
  1027. return
  1028. }
  1029. uni.request({
  1030. url: uni.$baseUrl + '/report/print/slittingPrintData',
  1031. data: {
  1032. id: rowEvent.value.labelMasterId
  1033. }
  1034. }).then(async ({
  1035. data
  1036. }) => {
  1037. if (data.data?.length > 0) {
  1038. uni.showToast({
  1039. title: '标签打印中,请勿进行操作',
  1040. duration: 10000,
  1041. icon: 'none'
  1042. })
  1043. list = data.data
  1044. if (list.length > 0) {
  1045. blueConfig.value.currentPrint = 1
  1046. blueConfig.value.printNum = list.length
  1047. const timer = setInterval(async () => {
  1048. const currentPrint = blueConfig.value
  1049. .currentPrint - 1
  1050. if (blueConfig.value.isLabelSend ===
  1051. false &&
  1052. currentPrint <
  1053. blueConfig.value.printNum) {
  1054. const paramsObj = {
  1055. materialName: list[
  1056. currentPrint]
  1057. .materialName ?? '',
  1058. materialNo: list[
  1059. currentPrint]
  1060. .materialNo ??
  1061. '',
  1062. supplierName: list[
  1063. currentPrint]
  1064. .supplierName ??
  1065. '',
  1066. size: list[currentPrint]
  1067. .size ??
  1068. '',
  1069. createTime: list[
  1070. currentPrint]
  1071. .createTime ??
  1072. '',
  1073. materialLots: list[
  1074. currentPrint]
  1075. .materialLots ??
  1076. '',
  1077. wmsStockLocationName: list[
  1078. currentPrint]
  1079. .wmsStockLocationName ??
  1080. '',
  1081. validityDate: list[
  1082. currentPrint]
  1083. .validityDate ??
  1084. '',
  1085. inspectTime: list[
  1086. currentPrint]
  1087. .inspectTime ??
  1088. '',
  1089. storageEnvironment: list[
  1090. currentPrint]
  1091. .storageEnvironment ??
  1092. '',
  1093. slittingOrderNo: list[
  1094. currentPrint]
  1095. .slittingOrderNo ??
  1096. '',
  1097. produceDate: list[
  1098. currentPrint]
  1099. .produceDate ??
  1100. '',
  1101. batchNumber: list[
  1102. currentPrint]
  1103. .batchNumber ??
  1104. '',
  1105. qty: list[currentPrint]
  1106. .qty ??
  1107. ''
  1108. }
  1109. await cuttingLabelTest(paramsObj)
  1110. }
  1111. if (currentPrint === blueConfig.value
  1112. .printNum) {
  1113. await clearInterval(timer)
  1114. }
  1115. }, 3000)
  1116. }
  1117. } else {
  1118. uni.showToast({
  1119. title: '打印数据错误',
  1120. icon: 'none',
  1121. duration: 2000
  1122. })
  1123. }
  1124. })
  1125. } else {
  1126. // #ifdef APP-PLUS
  1127. plus.device.beep(2)
  1128. // #endif
  1129. errorTipMessage.value = msg
  1130. errorTip.value.open()
  1131. errorState.value = -1
  1132. }
  1133. })
  1134. }
  1135. const handleNavigate = function() {
  1136. uni.navigateTo({
  1137. url: '/pages/workbranch/production/processExecution/takePhoto'
  1138. })
  1139. }
  1140. const handleShowDayModal = function() {
  1141. if (dayModal.value?.showPopup === false) {
  1142. dayModal.value.open('bottom')
  1143. }
  1144. }
  1145. // 班别列表选择事件
  1146. const handleClickDay = function(ret) {
  1147. className.value = ret.value
  1148. handleValidataPrint()
  1149. dayModal.value.close()
  1150. }
  1151. // 分切打印测试
  1152. const cuttingLabelTest = async function(ret) {
  1153. var command = tsc.dlabelPrinter.createNew()
  1154. command.setBackFeed(6)
  1155. // (640 * 320)dots
  1156. command.setSize(80, 40)
  1157. command.setCls()
  1158. command.setGap(8)
  1159. command.setBox(0, 0, 635, 315, 1)
  1160. command.setBar(0, 40, 640, 2)
  1161. command.setBar(0, 80, 640, 2)
  1162. command.setBar(0, 120, 640, 2)
  1163. command.setBar(0, 160, 640, 2)
  1164. command.setBar(0, 200, 366, 2)
  1165. command.setBar(0, 240, 366, 2)
  1166. command.setBar(0, 280, 640, 2)
  1167. // 1
  1168. command.setBar(115, 0, 2, 40)
  1169. command.setBar(115, 40, 2, 40)
  1170. command.setBar(115, 80, 2, 40)
  1171. command.setBar(115, 120, 2, 40)
  1172. command.setBar(115, 160, 2, 40)
  1173. command.setBar(115, 200, 2, 40)
  1174. command.setBar(115, 240, 2, 40)
  1175. command.setBar(115, 280, 2, 40)
  1176. // 2
  1177. command.setBar(360, 40, 2, 40)
  1178. command.setBar(360, 80, 2, 40)
  1179. command.setBar(360, 120, 2, 40)
  1180. command.setBar(360, 160, 2, 40)
  1181. command.setBar(360, 200, 2, 40)
  1182. command.setBar(360, 240, 2, 40)
  1183. command.setBar(360, 280, 2, 40)
  1184. // 3
  1185. command.setBar(475, 40, 2, 40)
  1186. command.setBar(475, 80, 2, 40)
  1187. command.setBar(475, 120, 2, 40)
  1188. command.setBar(475, 280, 2, 40)
  1189. command.setText(10, 6, 'TSS24.BF2', 0, 1, 1, '物料名称')
  1190. command.setText(126, 6, 'TSS24.BF2', 0, 1, 1, ret.materialName)
  1191. // row2
  1192. command.setText(10, 46, 'TSS24.BF2', 0, 1, 1, '物料编码')
  1193. command.setText(126, 46, 'TSS24.BF2', 0, 1, 1, ret.materialNo)
  1194. command.setText(366, 46, 'TSS24.BF2', 0, 1, 1, '供应商')
  1195. command.setText(481, 46, 'TSS24.BF2', 0, 1, 1, ret.supplierName)
  1196. // row3
  1197. command.setText(10, 86, 'TSS24.BF2', 0, 1, 1, '物料规格')
  1198. command.setText(126, 86, 'TSS24.BF2', 0, 1, 1, ret.size)
  1199. command.setText(366, 86, 'TSS24.BF2', 0, 1, 1, '分切日期')
  1200. command.setText(481, 86, 'TSS24.BF2', 0, 1, 1, ret.createTime)
  1201. // row4
  1202. command.setText(10, 126, 'TSS24.BF2', 0, 1, 1, 'Lot no.')
  1203. command.setText(126, 126, '1', 0, 1, 1, ret.materialLots)
  1204. command.setText(366, 126, 'TSS24.BF2', 0, 1, 1, '储位')
  1205. command.setText(481, 126, 'TSS24.BF2', 0, 1, 1, ret.wmsStockLocationName)
  1206. // row5
  1207. command.setText(10, 166, 'TSS24.BF2', 0, 1, 1, '有效期')
  1208. command.setText(126, 166, 'TSS24.BF2', 0, 1, 1, ret.validityDate)
  1209. // row6
  1210. command.setText(10, 206, 'TSS24.BF2', 0, 1, 1, '检测日期')
  1211. command.setText(126, 206, 'TSS24.BF2', 0, 1, 1, ret.inspectTime)
  1212. // row7
  1213. command.setText(10, 246, 'TSS24.BF2', 0, 1, 1, '存储条件')
  1214. const strList = ret.storageEnvironment?.split(' ')
  1215. const strText = strList[0] + ' ' + strList[1]
  1216. command.setText(126, 246, 'TSS24.BF2', 0, 1, 1, strText)
  1217. // row8
  1218. command.setText(10, 286, 'TSS24.BF2', 0, 1, 1, '分切单号')
  1219. command.setText(126, 286, 'TSS24.BF2', 0, 1, 1, ret.slittingOrderNo)
  1220. command.setText(366, 286, 'TSS24.BF2', 0, 1, 1, '生产日期')
  1221. command.setText(481, 286, 'TSS24.BF2', 0, 1, 1, ret.produceDate)
  1222. command.setText(480, 216, '2', 0, 1, 1, ret.qty)
  1223. command.setQrcode(366, 166, 'L', 4, 'A', ret.batchNumber)
  1224. command.setPagePrint()
  1225. prepareSend(command.getData())
  1226. }
  1227. const Send = function(buff) {
  1228. var currentTime = blueConfig.value.currentTime
  1229. var loopBuffer = blueConfig.value.loopBuffer
  1230. var lastData = blueConfig.value.lastData
  1231. var onBufferSize = blueConfig.value.onBufferSize
  1232. var printNum = blueConfig.value.printerNum
  1233. var currentPrint = blueConfig.value.currentPrint
  1234. var buf
  1235. var dataView
  1236. if (currentTime < loopBuffer) {
  1237. buf = new ArrayBuffer(onBufferSize)
  1238. dataView = new DataView(buf)
  1239. for (let i = 0; i < onBufferSize; ++i) {
  1240. dataView.setUint8(i, buff[(currentTime - 1) * onBufferSize + i])
  1241. }
  1242. } else {
  1243. buf = new ArrayBuffer(lastData)
  1244. dataView = new DataView(buf)
  1245. for (let i = 0; i < lastData; ++i) {
  1246. dataView.setUint8(i, buff[(currentTime - 1) * onBufferSize + i])
  1247. }
  1248. }
  1249. plus.bluetooth.writeBLECharacteristicValue({
  1250. deviceId: bluetooth.value.deviceId,
  1251. serviceId: bluetooth.value.serviceId,
  1252. characteristicId: bluetooth.value.writeId,
  1253. value: buf,
  1254. success: function(res) {
  1255. if (currentPrint <= printNum) {
  1256. wx.showToast({
  1257. title: '数据打印中',
  1258. icon: 'loading'
  1259. })
  1260. }
  1261. // 将complete中处理数据的代码挪过来,增加30ms延迟, 解决蓝牙打印数据传输10007问题
  1262. setTimeout(() => {
  1263. currentTime += 1
  1264. if (currentTime <= loopBuffer) {
  1265. blueConfig.value.isLabelSend = true
  1266. blueConfig.value.currentTime = currentTime
  1267. Send(buff)
  1268. }
  1269. // end
  1270. if (currentTime === loopBuffer) {
  1271. blueConfig.value.currentPrint += 1
  1272. blueConfig.value.isLabelSend = false
  1273. }
  1274. }, 10)
  1275. },
  1276. fail: function(e) {
  1277. wx.showToast({
  1278. title: '打印第' + currentPrint + '张失败' + 'error: code ' + e
  1279. ?.code + ', message ' + e?.message,
  1280. icon: 'none',
  1281. duration: 4000
  1282. })
  1283. },
  1284. complete: function() {}
  1285. })
  1286. }
  1287. const prepareSend = function(buff) {
  1288. var time = blueConfig.value.onBufferSize
  1289. var loopBuffer = parseInt(buff.length / time)
  1290. var lastData = parseInt(buff.length % time)
  1291. blueConfig.value.loopBuffer = loopBuffer + 1
  1292. blueConfig.value.lastData = lastData
  1293. blueConfig.value.currentTime = 1
  1294. Send(buff)
  1295. }
  1296. const labelTest = function(ret) {
  1297. var command = tsc.dlabelPrinter.createNew()
  1298. command.setBackFeed(6)
  1299. // (480 * 200)dots
  1300. command.setSize(60, 25)
  1301. command.setCls()
  1302. command.setGap(6)
  1303. command.setBox(0, 0, 475, 200, 1)
  1304. // 1
  1305. command.setBar(108, 0, 2, 40)
  1306. command.setBar(108, 40, 2, 40)
  1307. command.setBar(108, 80, 2, 40)
  1308. command.setBar(108, 120, 2, 40)
  1309. command.setBar(108, 160, 2, 40)
  1310. command.setBar(108, 200, 2, 40)
  1311. // 竖
  1312. command.setBar(210, 80, 2, 40)
  1313. command.setBar(210, 120, 2, 40)
  1314. command.setBar(210, 160, 2, 40)
  1315. command.setBar(210, 200, 2, 40)
  1316. // 横
  1317. command.setBar(0, 40, 480, 2)
  1318. command.setBar(0, 80, 320, 2)
  1319. command.setBar(0, 120, 210, 2)
  1320. command.setBar(0, 160, 210, 2)
  1321. // 横
  1322. command.setBar(320, 80, 480, 2)
  1323. command.setBar(320, 120, 480, 2)
  1324. command.setBar(320, 160, 480, 2)
  1325. // 竖
  1326. command.setBar(322, 40, 2, 40)
  1327. command.setBar(322, 80, 2, 40)
  1328. command.setBar(322, 120, 2, 40)
  1329. command.setBar(322, 160, 2, 40)
  1330. // 竖
  1331. command.setBar(378, 40, 2, 40)
  1332. command.setBar(378, 80, 2, 40)
  1333. command.setBar(378, 120, 2, 40)
  1334. command.setBar(378, 160, 2, 40)
  1335. // row1
  1336. command.setText(4, 8, 'TSS24.BF2', 0, 1, 1, '料号')
  1337. command.setText(112, 10, '2', 0, 1, 1, ret.materialName)
  1338. // row2
  1339. command.setText(4, 48, 'TSS24.BF2', 0, 1, 1, '工令单')
  1340. command.setText(112, 50, '2', 0, 1, 1, ret.wordOrderNo)
  1341. command.setText(328, 48, 'TSS24.BF2', 0, 1, 1, '数量')
  1342. command.setText(384, 50, '2', 0, 1, 1, ret.qty)
  1343. // row3
  1344. command.setText(4, 88, 'TSS24.BF2', 0, 1, 1, '生产日期')
  1345. command.setText(110, 90, '1', 0, 1, 1, ret.dateOfManufacture)
  1346. command.setText(328, 88, 'TSS24.BF2', 0, 1, 1, '库位')
  1347. command.setText(384, 90, '1', 0, 1, 1, ret.storageLocation)
  1348. // row4
  1349. command.setText(4, 128, 'TSS24.BF2', 0, 1, 1, '供应商')
  1350. command.setText(112, 130, '3', 0, 1, 1, ret.vendor)
  1351. command.setText(328, 128, 'TSS24.BF2', 0, 1, 1, '后制')
  1352. command.setText(384, 130, '1', 0, 1, 1, ret.postProduction)
  1353. // row5
  1354. command.setText(4, 168, 'TSS24.BF2', 0, 1, 1, '包装')
  1355. command.setText(112, 170, '1', 0, 1, 1, ret.packaging)
  1356. command.setText(328, 168, 'TSS24.BF2', 0, 1, 1, 'QC')
  1357. command.setText(384, 170, '1', 0, 1, 1, ret.qc)
  1358. command.setQrcode(214, 88, 'L', 5, 'A', ret.qrCode)
  1359. command.setPagePrint()
  1360. prepareSend(command.getData())
  1361. }
  1362. const handleLabelPrint = function() {
  1363. let list = []
  1364. const submitParams = {
  1365. hotPressId: params.value?.id
  1366. }
  1367. if (![null, NaN, undefined, ''].includes(className.value)) {
  1368. submitParams.classFlag = className.value
  1369. }
  1370. if (![null, NaN, undefined, ''].includes(qty.value)) {
  1371. submitParams.qty = qty.value
  1372. }
  1373. // 打印确认
  1374. uni.$reqPost('printConfirm', submitParams)
  1375. .then(async ({
  1376. code,
  1377. data,
  1378. msg
  1379. }) => {
  1380. if (code === 0) {
  1381. uni.showToast({
  1382. title: data?.message,
  1383. icon: 'none',
  1384. duration: 2000
  1385. })
  1386. if (data?.result * 1 === 1) {
  1387. uni.request({
  1388. method: 'GET',
  1389. url: uni.$baseUrl + '/report/print/getPrintDataFeol',
  1390. data: {
  1391. hotPressId: params.value?.id
  1392. }
  1393. }).then(async ({
  1394. data: {
  1395. code,
  1396. data,
  1397. msg
  1398. }
  1399. }) => {
  1400. if (code === 0) {
  1401. uni.showToast({
  1402. title: '标签打印中,请勿操作',
  1403. duration: 10000,
  1404. icon: 'none'
  1405. })
  1406. list = data
  1407. if (list.length > 0) {
  1408. blueConfig.value.currentPrint = 1
  1409. blueConfig.value.printNum = list.length
  1410. const timer = setInterval(async () => {
  1411. const currentPrint = blueConfig
  1412. .value.currentPrint - 1
  1413. if (blueConfig.value
  1414. .isLabelSend === false &&
  1415. currentPrint <
  1416. blueConfig.value.printNum
  1417. ) {
  1418. const paramsObj = {
  1419. pn: list[
  1420. currentPrint
  1421. ]
  1422. .pn ?? '',
  1423. wordOrderNo: list[
  1424. currentPrint
  1425. ]
  1426. .wordOrderNo ??
  1427. '',
  1428. qty: list[
  1429. currentPrint
  1430. ]
  1431. .qty ??
  1432. '',
  1433. dateOfManufacture: list[
  1434. currentPrint
  1435. ]
  1436. .dateOfManufacture ??
  1437. '',
  1438. storageLocation: list[
  1439. currentPrint
  1440. ]
  1441. .storageLocation ??
  1442. '',
  1443. postProduction: list[
  1444. currentPrint
  1445. ]
  1446. .postProduction ??
  1447. '',
  1448. vendor: list[
  1449. currentPrint
  1450. ]
  1451. .vendor ??
  1452. '',
  1453. packaging: list[
  1454. currentPrint
  1455. ]
  1456. .packaging ??
  1457. '',
  1458. qc: list[
  1459. currentPrint
  1460. ]
  1461. .qc ??
  1462. '',
  1463. qrCode: list[
  1464. currentPrint
  1465. ]
  1466. .qrCode ??
  1467. ''
  1468. }
  1469. await labelTest(paramsObj)
  1470. }
  1471. if (currentPrint === blueConfig
  1472. .value.printNum) {
  1473. await clearInterval(timer)
  1474. }
  1475. }, 3000)
  1476. }
  1477. } else {
  1478. // #ifdef APP-PLUS
  1479. plus.device.beep(2)
  1480. // #endif
  1481. errorTipMessage.value = msg
  1482. errorTip.value.open()
  1483. errorState.value = -1
  1484. }
  1485. })
  1486. }
  1487. await search()
  1488. } else {
  1489. // #ifdef APP-PLUS
  1490. plus.device.beep(2)
  1491. // #endif
  1492. errorTipMessage.value = msg
  1493. errorTip.value.open()
  1494. errorState.value = -1
  1495. }
  1496. })
  1497. }
  1498. const handleValidataPrint = function(dictValue) {
  1499. console.log(dictValue)
  1500. uni.$reqGet('getHotProcessProductionNum', {
  1501. id: params.value?.id
  1502. })
  1503. .then(({
  1504. code,
  1505. data,
  1506. msg
  1507. }) => {
  1508. if (code === 0) {
  1509. qty.value = data?.numberOfPieces ?? 0
  1510. inputDialog.value.open()
  1511. }
  1512. })
  1513. }
  1514. const setInputFocus = function() {
  1515. if (errorState.value === 0) {
  1516. params.value.userName = ''
  1517. userInput.value.onBlur()
  1518. userInput.value.onFocus()
  1519. } else if (errorState.value === 1) {
  1520. params.value.equipmentName = ''
  1521. equipmentInput.value.onBlur()
  1522. equipmentInput.value.onFocus()
  1523. } else if (errorState.value === 2) {
  1524. params.value.toolingName = ''
  1525. toolingInput.value.onBlur()
  1526. toolingInput.value.onFocus()
  1527. } else if (errorState.value === 3) {
  1528. params.value.scanMaterialNumber = ''
  1529. materialInput.value.onBlur()
  1530. materialInput.value.onFocus()
  1531. }
  1532. }
  1533. // 关闭错误信息弹窗
  1534. const handleCloseErrorTipsModal = async function() {
  1535. errorTip.value.close()
  1536. await setInputFocus()
  1537. }
  1538. const handleInputFocus = function(text) {
  1539. setTimeout(() => {
  1540. uni.hideKeyboard()
  1541. }, 100)
  1542. emptyDocument.value ? emptyDocument.value.$el.className = 'uni-easyinput' : false
  1543. if (text === 'userInput') {
  1544. userInput.value.$el.className = 'uni-easyinput light-focus'
  1545. emptyDocument.value = userInput.value
  1546. }
  1547. if (text === 'equipmentInput') {
  1548. equipmentInput.value.$el.className = 'uni-easyinput light-focus'
  1549. emptyDocument.value = equipmentInput.value
  1550. }
  1551. if (text === 'toolingInput') {
  1552. toolingInput.value.$el.className = 'uni-easyinput light-focus'
  1553. emptyDocument.value = toolingInput.value
  1554. }
  1555. if (text === 'materialInput') {
  1556. materialInput.value.$el.className = 'uni-easyinput light-focus'
  1557. emptyDocument.value = materialInput.value
  1558. }
  1559. }
  1560. const handleClear = function(text) {
  1561. if (text === 'userInput') {
  1562. userInput.value.onBlur()
  1563. userInput.value.onFocus()
  1564. }
  1565. if (text === 'equipmentInput') {
  1566. equipmentInput.value.onBlur()
  1567. equipmentInput.value.onFocus()
  1568. }
  1569. if (text === 'toolingInput') {
  1570. toolingInput.value.onBlur()
  1571. toolingInput.value.onFocus()
  1572. }
  1573. if (text === 'materialInput') {
  1574. materialInput.value.onBlur()
  1575. materialInput.value.onFocus()
  1576. }
  1577. }
  1578. // 设置标签生产数量
  1579. const handleSetNum = function(ret) {
  1580. if (![NaN, undefined, null, ''].includes(Number(ret))) {
  1581. qty.value = ret
  1582. } else {
  1583. // #ifdef APP-PLUS
  1584. plus.device.beep(2)
  1585. // #endif
  1586. errorTipMessage.value = '数量不正确!'
  1587. errorTip.value.open()
  1588. errorState.value = 3
  1589. return
  1590. }
  1591. handleLabelPrint()
  1592. }
  1593. // 是否打标签单选框触发事件
  1594. const handlePrintLabelChecked = function(e) {
  1595. const checked = e.detail.value
  1596. if (checked?.length > 0) {
  1597. isPrintLabel.value = true
  1598. } else {
  1599. isPrintLabel.value = false
  1600. }
  1601. }
  1602. return {
  1603. popup,
  1604. goBack,
  1605. dayModal,
  1606. modalForm,
  1607. errorState,
  1608. errorTip,
  1609. errorTipMessage,
  1610. userInput,
  1611. equipmentInput,
  1612. toolingInput,
  1613. materialInput,
  1614. isPrintLabel,
  1615. qty,
  1616. rowEvent,
  1617. btnState,
  1618. isLandscapeScreen,
  1619. params,
  1620. inputDialog,
  1621. dictDataList,
  1622. handleInputFocus,
  1623. handleClear,
  1624. computedResidualArea,
  1625. computedRollNo,
  1626. computedIPQCState,
  1627. computedCollapseTitle,
  1628. handleSubmission,
  1629. handleShowDayModal,
  1630. handleValidataPrint,
  1631. handleScanUser,
  1632. handleScanDevice,
  1633. handleScanTooling,
  1634. handleReportingWork,
  1635. handleSetNum,
  1636. confirmUser,
  1637. confirmEquipmentName,
  1638. confirmToolingName,
  1639. confirmMaterial,
  1640. handleScanMaterialOrAxisNumber,
  1641. handleCloseErrorTipsModal,
  1642. handleChangeRow,
  1643. handleNavigate,
  1644. handleClickDay,
  1645. handlePrintLabelChecked
  1646. }
  1647. }
  1648. })
  1649. </script>
  1650. <style lang="scss" scoped>
  1651. .gui-header-leader-btns {
  1652. color: black;
  1653. font-size: 24px !important;
  1654. margin-left: 24rpx;
  1655. }
  1656. .gui-sbody {
  1657. background-color: rgba(234, 239, 242, 1);
  1658. }
  1659. .gui-relative {
  1660. overflow: visible;
  1661. height: 100vh;
  1662. .oqc-checkout {
  1663. width: 100vw;
  1664. height: calc(100vh - 75px);
  1665. position: absolute;
  1666. top: 95px;
  1667. overflow-y: scroll;
  1668. }
  1669. }
  1670. .popup-content {
  1671. width: 100vw;
  1672. height: 55vh;
  1673. overflow-y: scroll;
  1674. }
  1675. .card-list-flexbox-popup {
  1676. width: 100vw;
  1677. display: flex;
  1678. flex-direction: row;
  1679. align-items: center;
  1680. flex-wrap: wrap;
  1681. .card-list-item,
  1682. .card-list-item-input {
  1683. width: 100vw;
  1684. height: 100%;
  1685. min-height: 40px;
  1686. display: flex;
  1687. flex-direction: row;
  1688. align-items: center;
  1689. background-color: #fff;
  1690. uni-text {
  1691. font-size: 14px;
  1692. height: 50rpx;
  1693. text-align: left;
  1694. padding: 0 12px;
  1695. display: flex;
  1696. flex-direction: row;
  1697. align-items: center;
  1698. }
  1699. uni-image {
  1700. width: calc(100vw / 2 - 4px);
  1701. height: calc(100vw / 3.2 - 2px);
  1702. pointer-events: none;
  1703. }
  1704. uni-image::after {
  1705. content: "×";
  1706. width: 22px;
  1707. height: 22px;
  1708. position: absolute;
  1709. top: 5px;
  1710. right: 5px;
  1711. display: flex;
  1712. justify-content: center;
  1713. align-items: center;
  1714. color: rgba(255, 255, 255, 0.9);
  1715. background-color: rgba(0, 0, 0, 0.5);
  1716. border-radius: 50%;
  1717. font-size: 24px;
  1718. /*给伪元素开启鼠标事件,将事件冒泡到父元素的点击事件中*/
  1719. pointer-events: auto;
  1720. }
  1721. .text-1 {
  1722. flex: 1;
  1723. height: 40px;
  1724. justify-content: flex-start;
  1725. }
  1726. .text-2 {
  1727. flex: 3;
  1728. height: 40px;
  1729. justify-content: flex-end;
  1730. margin-right: 4px;
  1731. padding: 2px 6px;
  1732. }
  1733. .text-3 {
  1734. width: calc(100% - 15%);
  1735. min-height: 35px;
  1736. justify-content: flex-end;
  1737. padding: 2px 6px;
  1738. }
  1739. .text-3::before {}
  1740. .btn-mg {
  1741. margin: 0 5px;
  1742. }
  1743. }
  1744. .card-list-item {
  1745. justify-content: center;
  1746. }
  1747. .card-list-item-input {
  1748. margin: 10px 0 10px 2%;
  1749. display: flex;
  1750. flex-direction: column;
  1751. uni-view {
  1752. width: 100%;
  1753. height: 100%;
  1754. display: flex;
  1755. uni-textarea {
  1756. flex: 8;
  1757. }
  1758. uni-view {
  1759. flex: 1;
  1760. }
  1761. .operation-icon,
  1762. .operation-icon-2 {
  1763. height: auto;
  1764. uni-text {
  1765. width: 22px;
  1766. height: 100%;
  1767. padding: 0 !important;
  1768. text-align: center;
  1769. display: flex;
  1770. justify-content: center;
  1771. align-items: center;
  1772. border-top-right-radius: 4px;
  1773. border-bottom-right-radius: 4px;
  1774. color: white;
  1775. background-color: #80b7ff;
  1776. }
  1777. }
  1778. .operation-icon-2 {
  1779. uni-text {
  1780. background-color: #ff5962;
  1781. }
  1782. }
  1783. }
  1784. }
  1785. .grid-image {
  1786. /* 设置容器布局为grid布局 */
  1787. display: grid;
  1788. /* 指定每一行的宽度 每个宽度中间用空格隔开 */
  1789. grid-template-rows: repeat(auto-fill, 1fr);
  1790. /* 指定每一列的宽度 每个宽度中间用空格隔开 */
  1791. grid-template-columns: repeat(2, 1fr);
  1792. padding: 0 4px;
  1793. }
  1794. .card-list-item:nth-of-type(1) {
  1795. .text-1 {
  1796. flex: 9;
  1797. font-weight: bold;
  1798. color: black !important;
  1799. }
  1800. .text-1::before {
  1801. content: "";
  1802. width: 4px;
  1803. height: 20px;
  1804. border-radius: 4px;
  1805. margin-right: 4px;
  1806. background-color: skyblue;
  1807. }
  1808. .text-2 {
  1809. flex: 4;
  1810. display: flex;
  1811. flex-direction: row;
  1812. justify-content: flex-end;
  1813. align-items: center;
  1814. color: limegreen !important;
  1815. }
  1816. }
  1817. }
  1818. .table-title {
  1819. height: 40px;
  1820. line-height: 40px;
  1821. margin: 0 0 -3px 0;
  1822. padding: 0 12px;
  1823. font-size: 16px;
  1824. font-weight: bold;
  1825. background-color: white;
  1826. }
  1827. .uni-list-cell {
  1828. width: 100vw;
  1829. height: 35px;
  1830. margin: 4px 0;
  1831. display: flex;
  1832. flex-direction: row;
  1833. align-items: center;
  1834. justify-content: space-between;
  1835. border-bottom: 2px solid #eaeff2;
  1836. background-color: #fff;
  1837. view {
  1838. font-size: 14px;
  1839. height: 50rpx;
  1840. text-align: left;
  1841. padding: 0 8px;
  1842. display: flex;
  1843. flex-direction: row;
  1844. align-items: center;
  1845. }
  1846. .uni-list-cell-left {
  1847. flex: 1;
  1848. height: 35px;
  1849. justify-content: flex-start;
  1850. }
  1851. .uni-list-cell-db {
  1852. flex: 3;
  1853. height: 35px;
  1854. justify-content: flex-end;
  1855. margin-right: 4px;
  1856. padding: 2px 6px;
  1857. uni-picker {
  1858. width: 100%;
  1859. display: flex;
  1860. flex-direction: row;
  1861. justify-content: center;
  1862. }
  1863. }
  1864. }
  1865. .modal-btns {
  1866. height: 100rpx;
  1867. line-height: 100rpx;
  1868. display: flex;
  1869. justify-content: center;
  1870. align-items: center;
  1871. }
  1872. .line {
  1873. margin-top: 10rpx;
  1874. height: 80rpx;
  1875. width: 1rpx;
  1876. background-color: #dcdcdc;
  1877. }
  1878. .card-list {
  1879. display: grid;
  1880. grid-template-rows: 1fr;
  1881. grid-template-columns: 1fr 1fr;
  1882. background-color: white;
  1883. .card {
  1884. display: grid;
  1885. grid-template-rows: 1fr;
  1886. grid-template-columns: 2fr 5fr;
  1887. height: 45px;
  1888. span {
  1889. font-size: 14px;
  1890. font-weight: bold;
  1891. text-align: center;
  1892. line-height: 45px;
  1893. }
  1894. uni-input {
  1895. height: 45px;
  1896. display: flex;
  1897. align-items: center;
  1898. }
  1899. }
  1900. }
  1901. .font-icons {
  1902. width: 30px;
  1903. font-size: 20px;
  1904. text-align: right;
  1905. }
  1906. .scan {
  1907. height: 45px;
  1908. width: calc(100% - 48px);
  1909. margin: 0 12px 12px 12px;
  1910. padding: 0 12px;
  1911. display: flex;
  1912. justify-content: space-between;
  1913. align-items: center;
  1914. border-radius: 6px;
  1915. background-color: white;
  1916. .scan-title {
  1917. width: 100%;
  1918. display: grid;
  1919. grid-template-rows: 1fr;
  1920. grid-template-columns: 1fr 1fr;
  1921. align-items: center;
  1922. span {
  1923. font-size: 14px;
  1924. font-weight: bold;
  1925. }
  1926. span:nth-of-type(2) {
  1927. text-align: right;
  1928. }
  1929. }
  1930. .scan-card {
  1931. width: 100%;
  1932. display: grid;
  1933. grid-template-rows: 1fr;
  1934. grid-template-columns: 2fr 6fr 1fr;
  1935. align-items: center;
  1936. span {
  1937. font-size: 14px;
  1938. font-weight: bold;
  1939. }
  1940. input {
  1941. height: 35px;
  1942. line-height: 35px;
  1943. }
  1944. text {
  1945. width: 100%;
  1946. text-align: right;
  1947. }
  1948. }
  1949. }
  1950. .body-card {
  1951. width: calc(100% - 48px);
  1952. margin: 0 12px 12px 12px;
  1953. padding: 0 12px;
  1954. display: grid;
  1955. grid-template-columns: 1fr;
  1956. grid-template-rows: 1fr 1fr;
  1957. border-radius: 6px;
  1958. background-color: white;
  1959. .body-card-row {
  1960. height: 35px;
  1961. line-height: 35px;
  1962. display: flex;
  1963. justify-content: space-between;
  1964. }
  1965. }
  1966. .collapse {
  1967. width: 100%;
  1968. display: flex;
  1969. align-items: center;
  1970. .collapse-title {
  1971. height: 90px;
  1972. width: 80%;
  1973. padding: 0 12px;
  1974. display: grid;
  1975. grid-template-columns: 1fr;
  1976. grid-template-rows: 1fr 1fr;
  1977. uni-text {
  1978. display: inline-block;
  1979. height: 45px;
  1980. line-height: 45px;
  1981. font-size: 14px;
  1982. }
  1983. }
  1984. }
  1985. .example-body {
  1986. flex-direction: column;
  1987. flex: 1;
  1988. }
  1989. .form {
  1990. font-size: 14px;
  1991. margin: 0 12px 80px 12px;
  1992. padding: 4px 8px;
  1993. border-radius: 4px;
  1994. background-color: white;
  1995. .form-title {
  1996. height: 32px;
  1997. line-height: 32px;
  1998. text-align: center;
  1999. font-size: 16px;
  2000. font-weight: bold;
  2001. border-bottom: 2px dashed #edeeee;
  2002. }
  2003. .form-item {
  2004. .title {
  2005. height: 32px;
  2006. line-height: 32px;
  2007. text-align: left;
  2008. font-weight: bold;
  2009. color: #333;
  2010. }
  2011. .content {
  2012. height: 42px;
  2013. line-height: 42px;
  2014. margin: 0 0 6px 0;
  2015. }
  2016. }
  2017. }
  2018. .title-text-layout {
  2019. height: 45px;
  2020. line-height: 45px;
  2021. font-size: 14px;
  2022. overflow: hidden;
  2023. white-space: nowrap;
  2024. text-overflow: ellipsis;
  2025. -o-text-overflow: ellipsis;
  2026. }
  2027. .popup-process-content {
  2028. width: 100vw;
  2029. height: 85vh;
  2030. overflow-y: scroll;
  2031. .list-title {
  2032. // position: fixed;
  2033. // top: 0;
  2034. // left: 0;
  2035. // z-index: 99999;
  2036. display: flex;
  2037. align-items: center;
  2038. height: 45px;
  2039. line-height: 45px;
  2040. font-size: 16px;
  2041. font-weight: bold;
  2042. border-top-left-radius: 16px;
  2043. border-top-right-radius: 16px;
  2044. border-bottom: 2px solid #d4d4d4;
  2045. .block {
  2046. width: 6px;
  2047. height: 60%;
  2048. margin: 0 4px;
  2049. background-color: rgb(0, 160, 233);
  2050. }
  2051. }
  2052. .grid-box {
  2053. display: grid;
  2054. grid-template-columns: 1fr 1fr 1fr 1fr;
  2055. .box {
  2056. position: relative;
  2057. height: 40px;
  2058. padding: 10px 6px;
  2059. border: 1px solid rgb(250, 250, 251);
  2060. box-sizing: border-box;
  2061. margin: 12px;
  2062. display: flex;
  2063. justify-content: center;
  2064. align-items: center;
  2065. font-size: 14px;
  2066. font-weight: bold;
  2067. border-radius: 4px;
  2068. color: white;
  2069. box-shadow: 0 3px 6px 0 rgba(121, 118, 118, 0.34);
  2070. background-color: rgb(0, 160, 233);
  2071. }
  2072. .box::before {
  2073. content: '';
  2074. position: absolute;
  2075. top: 20px;
  2076. left: 0;
  2077. bottom: 0;
  2078. transform: translate(-50%, -50%);
  2079. width: 12px;
  2080. height: 12px;
  2081. border-radius: 50%;
  2082. z-index: 1;
  2083. background-color: #ffffff;
  2084. }
  2085. }
  2086. }
  2087. .light-focus {
  2088. border: 1px solid #008aff;
  2089. border-radius: 6px !important;
  2090. ::v-deep .uni-easyinput__content {
  2091. border-radius: 6px !important;
  2092. }
  2093. }
  2094. .light-focus::before {
  2095. position: absolute;
  2096. left: -10px;
  2097. top: -10px;
  2098. content: "✏️";
  2099. width: 20px;
  2100. height: 20px;
  2101. color: red;
  2102. font-weight: bold;
  2103. font-size: 18px;
  2104. }
  2105. .operationBtn {
  2106. position: fixed;
  2107. display: grid;
  2108. grid-template-rows: 1fr;
  2109. grid-template-columns: 1fr 1fr;
  2110. width: 100%;
  2111. bottom: 0;
  2112. padding: 12px 0;
  2113. }
  2114. </style>