cuttingCheckout.vue 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432
  1. <template>
  2. <gui-page :custom-header="true" :is-header-sized="false"
  3. :header-class="['gui-theme-background-color', isLandscapeScreen?'width: 100vmax;':'']"
  4. :style="[isLandscapeScreen?'width: 100vmax':'']">
  5. <template #gHeader>
  6. <view :style="[isLandscapeScreen?'height:44px;width: 100vmax':'height:44px;']"
  7. class="gui-flex gui-nowrap gui-rows gui-align-items-center">
  8. <!-- 使用组件实现返回按钮及返回首页按钮 -->
  9. <text style="font-size:44rpx;" class="gui-header-leader-btns gui-color-white font-icons"
  10. @tap="goBack">&#xe6c5;</text>
  11. <!-- 导航文本此处也可以是其他自定义内容 -->
  12. <text :style="[isPad?'font-size: 18px':'font-size: 14px']"
  13. class="gui-h4 gui-blod gui-flex1 gui-text-center gui-color-white gui-ellipsis gui-primary-text">分切</text>
  14. <!-- 此处加一个右侧展位元素与左侧同宽,实现标题居中 -->
  15. <!-- 实际宽度请根据自己情况设置 -->
  16. <view style="width:40px;" />
  17. </view>
  18. </template>
  19. <template #gBody>
  20. <view class="oqc-checkout">
  21. <view v-if="params.slitStatus !== 2" class="scan">
  22. <view class="scan-card">
  23. <uni-easyinput ref="batchNumberInput" v-model="params.scanBatchNumber" :input-border="false"
  24. type="text" focus placeholder="扫描母卷" @confirm="confirmBatchNumber"
  25. @focus="handleInputFocus('batchNumber')" @clear="handleClear('batchNumber')" />
  26. <text class="font-icons" @click="handleMapass">&#xe6b7;</text>
  27. </view>
  28. </view>
  29. <view v-if="params.slitStatus !== 2" class="scan">
  30. <view class="scan-card">
  31. <uni-easyinput ref="employeeInput" v-model="params.scanEmployeeName" :input-border="false"
  32. :clearable="false" type="text" placeholder="员工码" @confirm="confirmQrCodeEmployee"
  33. @focus="handleInputFocus('employee')" @clear="handleClear('employee')" />
  34. <text class="font-icons" @click="handleMapassQrCodeEmployee">&#xe6b7;</text>
  35. </view>
  36. </view>
  37. <view v-if="params.slitStatus !== 2" class="scan">
  38. <view class="scan-card">
  39. <uni-easyinput ref="deviceInput" v-model="params.scanDeviceName" :input-border="false"
  40. :clearable="false" type="text" placeholder="设备码" @confirm="confirmQrCodeDeviceId"
  41. @focus="handleInputFocus('device')" @clear="handleClear('device')" />
  42. <text class="font-icons" @click="handleMapassQrCodeDeviceId">&#xe6b7;</text>
  43. </view>
  44. </view>
  45. <view class="table-title">
  46. <span>分切来源</span>
  47. </view>
  48. <view class="custom-table">
  49. <uni-table border stripe empty-text="暂无更多数据">
  50. <!-- 表头行 -->
  51. <uni-tr class="custom-table-head">
  52. <uni-th align="center" width="50px">序号</uni-th>
  53. <uni-th align="center" width="170px">批次号</uni-th>
  54. <uni-th align="center" width="120px">物料编码</uni-th>
  55. <uni-th align="center" width="140px">物料名称</uni-th>
  56. <uni-th align="center" width="140px">规格</uni-th>
  57. <uni-th align="center" width="140px">余量</uni-th>
  58. </uni-tr>
  59. <!-- 表格数据行 -->
  60. <uni-tr v-for="(item, key) in slittingLots" :key="key"
  61. :style="[params.scanBatchNumber === item.materialLots? 'background-color: rgba(109, 205, 50, 1)':'background-color: white']">
  62. <uni-td align="center"
  63. :style="[params.scanBatchNumber === item.materialLots? 'color: white':'']">{{ ++key }}</uni-td>
  64. <uni-td align="center"
  65. :style="[params.scanBatchNumber === item.materialLots? 'color: white':'']">{{ item.materialLots }}</uni-td>
  66. <uni-td align="center"
  67. :style="[params.scanBatchNumber === item.materialLots? 'color: white':'']">{{ item.materialNo }}</uni-td>
  68. <uni-td align="center"
  69. :style="[params.scanBatchNumber === item.materialLots? 'color: white':'']">{{ item.materialName }}</uni-td>
  70. <uni-td align="center"
  71. :style="[params.scanBatchNumber === item.materialLots? 'color: white':'']">{{ item.size }}</uni-td>
  72. <uni-td align="center"
  73. :style="[params.scanBatchNumber === item.materialLots? 'color: white':'']">{{ item.remainQty }}</uni-td>
  74. </uni-tr>
  75. </uni-table>
  76. </view>
  77. <view class="table-title">
  78. <span>分切后规格</span>
  79. </view>
  80. <view class="custom-table">
  81. <uni-table border stripe empty-text="暂无更多数据">
  82. <!-- 表头行 -->
  83. <uni-tr class="custom-table-head">
  84. <uni-th align="center" width="80px"
  85. @click="handleCheckedAllRow">{{ isCheckedAllRow?"取消全选": "全选" }}</uni-th>
  86. <uni-th align="center" width="170px">来源批次</uni-th>
  87. <uni-th align="center" width="120px">宽</uni-th>
  88. <uni-th align="center" width="140px">长</uni-th>
  89. <uni-th align="center" width="140px">物料名称</uni-th>
  90. <uni-th align="center" width="140px">数量</uni-th>
  91. <uni-th align="center" width="140px">生产日期</uni-th>
  92. </uni-tr>
  93. <!-- 表格数据行 -->
  94. <uni-tr v-for="(item, key) in slittedLots" :key="key"
  95. :style="[computedLight(item)? 'background-color: rgba(109, 205, 50, 1)':'background-color: white']">
  96. <uni-td align="center">
  97. <checkbox :checked="item.checked" @click="handleCkeckedRow(item)" />
  98. </uni-td>
  99. <uni-td align="center"
  100. :style="[computedLight(item)? 'color: white':'']">{{ item.batchNumber }}</uni-td>
  101. <uni-td align="center"
  102. :style="[computedLight(item)? 'color: white':'']">{{ item.width }}</uni-td>
  103. <uni-td align="center"
  104. :style="[computedLight(item)? 'color: white':'']">{{ item.length }}</uni-td>
  105. <uni-td align="center"
  106. :style="[computedLight(item)? 'color: white':'']">{{ item.materialName }}</uni-td>
  107. <uni-td align="center"
  108. :style="[computedLight(item)? 'color: white':'']">{{ item.qty }}</uni-td>
  109. <uni-td align="center"
  110. :style="[computedLight(item)? 'color: white':'']">{{ $parseTime(item.produceDate) }}</uni-td>
  111. </uni-tr>
  112. </uni-table>
  113. </view>
  114. </view>
  115. <gui-right-menus>
  116. <!-- 扩展按钮 -->
  117. <template #menus-more>
  118. <view hover-class="gui-tap"
  119. class="menu-items gui-bg-blue gui-flex gui-columns gui-justify-content-center"
  120. @click="handleShowPrintDialog">
  121. <text class="menu-text gui-block gui-text-center gui-color-white">打印</text>
  122. </view>
  123. <view v-if="(params.slitStatus === 0 || params.slitStatus === 1) && params.scanBatchNumber"
  124. hover-class="gui-tap"
  125. class="menu-items gui-bg-green gui-flex gui-columns gui-justify-content-center"
  126. @click="handleCutting">
  127. <text class="menu-text gui-block gui-text-center gui-color-white">执行分切</text>
  128. </view>
  129. </template>
  130. <!-- 核心按钮 -->
  131. <template #menus-primary>
  132. <view class="menu-items gui-bg-primary gui-flex gui-columns gui-justify-content-center">
  133. <text class="menu-icon gui-color-white gui-block gui-text-center gui-icons">&#xe614;</text>
  134. <text class="menu-text gui-color-white gui-block gui-text-center">操作</text>
  135. </view>
  136. </template>
  137. </gui-right-menus><!-- 提示窗示例 -->
  138. <uni-popup ref="popup" type="dialog">
  139. <uni-popup-dialog type="success" cancel-text="取消" confirm-text="确认" title="提示"
  140. @confirm="handlePrintLabel" @close="popup.close()">
  141. <!-- eslint-disable-next-line -->
  142. <template #default="custom">
  143. <view class="form" style="width: 100%;margin: 0;">
  144. <div class="form-item">
  145. <div class="title">打印方式</div>
  146. <div class="content">
  147. <uni-data-select v-model="printType" :localdata="printTypeList" />
  148. </div>
  149. </div>
  150. <div class="form-item" v-if="printType === '0'">
  151. <div class="title">打印机</div>
  152. <div class="content">
  153. <uni-data-select v-model="printer" :localdata="printerList" />
  154. </div>
  155. </div>
  156. </view>
  157. </template>
  158. </uni-popup-dialog>
  159. </uni-popup>
  160. <uni-popup ref="errorTip" type="dialog">
  161. <uni-popup-dialog type="error" cancel-text="关闭" confirm-text="确认" title="提示" :content="errorTipMessage"
  162. @confirm="handleCloseErrorTipsModal" @close="handleCloseErrorTipsModal" />
  163. </uni-popup>
  164. </template>
  165. </gui-page>
  166. </template>
  167. <script>
  168. import {
  169. computed,
  170. defineComponent,
  171. ref,
  172. onMounted,
  173. onBeforeMount
  174. } from 'vue'
  175. import tsc from '@/unit/CHITEN_SDK_APP/tsc.js'
  176. export default defineComponent({
  177. // onLoad() {
  178. // // // #ifdef APP-PLUS
  179. // // plus.screen.lockOrientation('default');
  180. // // // #endif
  181. // },
  182. // onUnload() {
  183. // // // #ifdef APP-PLUS
  184. // // plus.screen.lockOrientation('portrait-primary');
  185. // // // #endif
  186. // },
  187. // onResize() {
  188. // if ([90, -90].includes(plus.navigator.getOrientation())) {
  189. // this.isLandscapeScreen = true
  190. // } else {
  191. // this.isLandscapeScreen = false
  192. // }
  193. // },
  194. setup(options) {
  195. const popup = ref()
  196. const printType = ref('0')
  197. const printer = ref('')
  198. const printerList = ref([]);
  199. const printData = ref([]);
  200. const isLandscapeScreen = ref(false)
  201. const parentRow = options?.params ?? {}
  202. const bluetooth = ref()
  203. const blueConfig = ref({
  204. loopBuffer: 0,
  205. currentTime: 1,
  206. lastData: 0,
  207. onBufferSize: 20,
  208. printerNum: 1,
  209. currentPrint: 1,
  210. isLabelSend: false
  211. })
  212. // 绑定的检查人信息
  213. const params = ref({
  214. eBillNo: '',
  215. slitStatus: 0,
  216. materialNo: '',
  217. scanBatchNumber: '',
  218. scanEmployee: '',
  219. scanEmployeeName: '',
  220. scanDeviceId: '',
  221. scanDeviceName: '',
  222. scanChildrenList: []
  223. })
  224. const slittingLots = ref([])
  225. const slittedLots = ref([])
  226. // 是否全选
  227. const isCheckedAllRow = ref(false)
  228. const batchNumberInput = ref()
  229. const employeeInput = ref()
  230. const deviceInput = ref()
  231. const emptyDocument = ref()
  232. const errorState = ref(0)
  233. const errorTip = ref('')
  234. const errorTipMessage = ref('')
  235. // 是否存在分切来源标签码
  236. const computedLight = computed(() => {
  237. return item => {
  238. if (params.value.scanChildrenList.includes(item.batchNumber)) {
  239. return true
  240. }
  241. return false
  242. }
  243. })
  244. // 多选框点击事件
  245. const handleCkeckedRow = function(ret) {
  246. const fdIndex = slittedLots.value.findIndex(item => item?.id === ret?.id)
  247. slittedLots.value[fdIndex].checked = !slittedLots.value[fdIndex].checked
  248. }
  249. onBeforeMount(() => {
  250. // #ifdef APP-PLUS
  251. const bluetoothConfig = uni.getStorageSync('bluetoothConfig')
  252. if ([null, '', undefined].includes(bluetoothConfig)) {
  253. bluetooth.value = {
  254. 'isOpenBle': false,
  255. 'deviceId': '',
  256. 'serviceId': '',
  257. 'writeId': '',
  258. 'notifyId': ''
  259. }
  260. setTimeout(() => {
  261. // #ifdef APP-PLUS
  262. plus.device.beep(2)
  263. // #endif
  264. errorTipMessage.value = '蓝牙打印机未连接'
  265. errorState.value = -1
  266. errorTip.value.open()
  267. }, 800)
  268. } else {
  269. bluetooth.value = JSON.parse(bluetoothConfig)
  270. }
  271. // #endif
  272. if (Object.keys(JSON.parse(parentRow)).length > 0) {
  273. params.value.slitStatus = JSON.parse(parentRow)?.slitStatus
  274. params.value.eBillNo = JSON.parse(parentRow)?.ebillNo
  275. params.value.materialNo = JSON.parse(parentRow)?.materialNo
  276. uni.$reqGet('getSlittingLots', {
  277. eBillNo: params.value.eBillNo
  278. })
  279. .then(({
  280. data
  281. }) => {
  282. slittingLots.value = data
  283. })
  284. uni.$reqGet('getSlittedLots', {
  285. eBillNo: params.value.eBillNo
  286. })
  287. .then(({
  288. data
  289. }) => {
  290. data.map(ret => {
  291. ret.checked = false
  292. })
  293. slittedLots.value = data
  294. })
  295. } else {
  296. uni.showToast({
  297. title: '没有物料编码',
  298. icon: 'none',
  299. duration: 1000
  300. })
  301. setTimeout(() => {
  302. uni.$goBack('/pages/workbranch/production/cutting/cuttingList')
  303. }, 1500)
  304. }
  305. })
  306. onMounted(() => {
  307. const paramsToJSON = JSON.parse(parentRow)
  308. if (Object.keys(paramsToJSON).length > 0) {
  309. if (Object.prototype.toString.call(paramsToJSON) === '[object Object]') {
  310. if (![NaN, null, undefined, ''].includes(paramsToJSON?.qrCode)) {
  311. uni.$reqPost('scanSlitting', {
  312. ebillNo: paramsToJSON.ebillNo,
  313. qrCode: paramsToJSON.qrCode
  314. })
  315. .then(({
  316. code,
  317. data,
  318. msg
  319. }) => {
  320. if (code === 0) {
  321. params.value.scanBatchNumber = data?.batchNumber
  322. params.value.scanChildrenList = data?.list
  323. employeeInput.value.onBlur()
  324. employeeInput.value.onFocus()
  325. } else {
  326. // #ifdef APP-PLUS
  327. plus.device.beep(2)
  328. // #endif
  329. errorTipMessage.value = msg
  330. errorTip.value.open()
  331. errorState.value = 0
  332. }
  333. })
  334. } else {
  335. setTimeout(() => {
  336. if (params.value.slitStatus !== 2) {
  337. handleMapass()
  338. }
  339. }, 500)
  340. }
  341. }
  342. }
  343. // GetPrinters();
  344. })
  345. const GetPrinters = function() {
  346. var cfgData = new Object;
  347. cfgData.XAction = "Printers";
  348. cfgData.XOpenId = "10000861";
  349. cfgData.XTokens = "+fdBeHkvLvLW2tIeEVMWr2DikZtd9jOb";
  350. cfgData.XUrl = "http://192.168.1.58:51320";
  351. // uniapp 1 其它 0
  352. cfgData.FaceType = "1";
  353. uni.CCPrintingAPI.Excute(cfgData,
  354. function(XTimeout) {},
  355. function(XFail) {
  356. // #ifdef APP-PLUS
  357. plus.device.beep(2)
  358. // #endif
  359. errorTipMessage.value = "API可能未安装或未启动"
  360. errorTip.value.open()
  361. errorState.value = -1
  362. },
  363. function(XSuccess) {
  364. var apiResult = JSON.parse(XSuccess.trim());
  365. if (apiResult.Status == "1") {
  366. /*获取到打印机列表*/
  367. if (apiResult.Message.length > 1) {
  368. for (var i = 1; i < apiResult.Message.length; i++) {
  369. printerList.value.push({
  370. text: apiResult.Message[i],
  371. value: apiResult.Message[i]
  372. })
  373. }
  374. /*设置上次使用的打印机*/
  375. printer.value = 'selected'
  376. }
  377. }
  378. }
  379. );
  380. }
  381. const goBack = function() {
  382. uni.reLaunch({
  383. url: '/pages/workbranch/production/cutting/cuttingList'
  384. })
  385. }
  386. const handleMapass = function() {
  387. // #ifdef APP-PLUS
  388. const mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module')
  389. mpaasScanModule.mpaasScan({
  390. // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
  391. 'scanType': ['qrCode', 'barCode'],
  392. // 是否隐藏相册,默认false不隐藏
  393. 'hideAlbum': false
  394. },
  395. (ret) => {
  396. if (ret.resp_code === 1000) {
  397. uni.$reqPost('scanSlitting', {
  398. ebillNo: params.value.eBillNo,
  399. qrCode: ret.resp_result
  400. })
  401. .then(({
  402. code,
  403. data,
  404. msg
  405. }) => {
  406. if (code === 0) {
  407. params.value.scanBatchNumber = data?.batchNumber
  408. params.value.scanChildrenList = data?.list
  409. employeeInput.value.onBlur()
  410. employeeInput.value.onFocus()
  411. } else {
  412. // #ifdef APP-PLUS
  413. plus.device.beep(2)
  414. // #endif
  415. errorTipMessage.value = msg
  416. errorTip.value.open()
  417. errorState.value = 0
  418. }
  419. })
  420. }
  421. })
  422. // #endif
  423. }
  424. const confirmBatchNumber = function(e) {
  425. uni.$reqPost('scanSlitting', {
  426. ebillNo: params.value.eBillNo,
  427. qrCode: e
  428. })
  429. .then(({
  430. code,
  431. data,
  432. msg
  433. }) => {
  434. if (code === 0) {
  435. params.value.scanBatchNumber = data?.batchNumber
  436. params.value.scanChildrenList = data?.list
  437. employeeInput.value.onBlur()
  438. employeeInput.value.onFocus()
  439. } else {
  440. // #ifdef APP-PLUS
  441. plus.device.beep(2)
  442. // #endif
  443. errorTipMessage.value = msg
  444. errorTip.value.open()
  445. errorState.value = 0
  446. }
  447. })
  448. }
  449. const handleMapassQrCodeEmployee = function() {
  450. // #ifdef APP-PLUS
  451. const mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module')
  452. mpaasScanModule.mpaasScan({
  453. // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
  454. 'scanType': ['qrCode', 'barCode'],
  455. // 是否隐藏相册,默认false不隐藏
  456. 'hideAlbum': false
  457. },
  458. (ret) => {
  459. if (ret.resp_code === 1000) {
  460. uni.$reqGet("getEmployeeDetail", {
  461. id: ret.resp_result
  462. })
  463. .then(({
  464. data
  465. }) => {
  466. params.value.scanEmployee = ret.resp_result
  467. params.value.scanEmployeeName = data?.employeeName;
  468. deviceInput.value.onBlur()
  469. deviceInput.value.onFocus()
  470. })
  471. }
  472. })
  473. // #endif
  474. }
  475. const handleMapassQrCodeDeviceId = function() {
  476. // #ifdef APP-PLUS
  477. const mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module')
  478. mpaasScanModule.mpaasScan({
  479. // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
  480. 'scanType': ['qrCode', 'barCode'],
  481. // 是否隐藏相册,默认false不隐藏
  482. 'hideAlbum': false
  483. },
  484. (ret) => {
  485. if (ret.resp_code === 1000) {
  486. params.value.scanDeviceId = ret.resp_result
  487. }
  488. })
  489. // #endif
  490. }
  491. const setInputFocus = function() {
  492. params.value.scanBatchNumber = ''
  493. batchNumberInput.value.onBlur()
  494. batchNumberInput.value.onFocus()
  495. }
  496. // 关闭错误信息弹窗
  497. const handleCloseErrorTipsModal = async function() {
  498. errorTip.value.close()
  499. if (errorState.value === 0) {
  500. await setInputFocus()
  501. }
  502. }
  503. const handleInputFocus = function(text) {
  504. // #ifdef APP-PLUS
  505. setTimeout(() => {
  506. uni.hideKeyboard()
  507. }, 100)
  508. // #endif
  509. emptyDocument.value ? emptyDocument.value.$el.className = 'uni-easyinput' : false
  510. if (text === 'batchNumber') {
  511. batchNumberInput.value.$el.className = 'uni-easyinput light-focus'
  512. emptyDocument.value = batchNumberInput.value
  513. }
  514. if (text === 'employee') {
  515. employeeInput.value.$el.className = 'uni-easyinput light-focus'
  516. emptyDocument.value = employeeInput.value
  517. }
  518. if (text === 'device') {
  519. deviceInput.value.$el.className = 'uni-easyinput light-focus'
  520. emptyDocument.value = deviceInput.value
  521. }
  522. }
  523. const handleClear = function(text) {
  524. if (text === 'batchNumber') {
  525. batchNumberInput.value.onBlur()
  526. batchNumberInput.value.onFocus()
  527. }
  528. if (text === 'employee') {
  529. employeeInput.value.onBlur()
  530. employeeInput.value.onFocus()
  531. }
  532. if (text === 'device') {
  533. deviceInput.value.onBlur()
  534. deviceInput.value.onFocus()
  535. }
  536. }
  537. const confirmQrCodeEmployee = function(e) {
  538. uni.$reqGet("getEmployeeDetail", {
  539. id: e
  540. })
  541. .then(({
  542. code, data, msg
  543. }) => {
  544. if (code === 0) {
  545. params.value.scanEmployee = e
  546. params.value.scanEmployeeName = data?.employeeName;
  547. } else {
  548. // #ifdef APP-PLUS
  549. plus.device.beep(2)
  550. // #endif
  551. errorTipMessage.value = "用户信息不存在请重新扫码"
  552. errorTip.value.open()
  553. errorState.value = -1
  554. }
  555. deviceInput.value.onBlur()
  556. deviceInput.value.onFocus()
  557. })
  558. }
  559. const confirmQrCodeDeviceId = function(e) {
  560. uni.$reqGet("getEquipmentBaseDetail", {
  561. id: e
  562. })
  563. .then(({
  564. code, data, msg
  565. }) => {
  566. if (code === 0) {
  567. params.value.scanDeviceId = e
  568. params.value.scanDeviceName = data?.equipmentName;
  569. } else {
  570. // #ifdef APP-PLUS
  571. plus.device.beep(2)
  572. // #endif
  573. errorTipMessage.value = "设备信息不存在请重新扫码"
  574. errorTip.value.open()
  575. errorState.value = -1
  576. }
  577. deviceInput.value.onBlur()
  578. deviceInput.value.onFocus()
  579. deviceInput.value.$el.className = 'uni-easyinput'
  580. })
  581. }
  582. const Send = function(buff) {
  583. var currentTime = blueConfig.value.currentTime
  584. var loopBuffer = blueConfig.value.loopBuffer
  585. var lastData = blueConfig.value.lastData
  586. var onBufferSize = blueConfig.value.onBufferSize
  587. var printNum = blueConfig.value.printerNum
  588. var currentPrint = blueConfig.value.currentPrint
  589. var buf
  590. var dataView
  591. if (currentTime < loopBuffer) {
  592. buf = new ArrayBuffer(onBufferSize)
  593. dataView = new DataView(buf)
  594. for (let i = 0; i < onBufferSize; ++i) {
  595. dataView.setUint8(i, buff[(currentTime - 1) * onBufferSize + i])
  596. }
  597. } else {
  598. buf = new ArrayBuffer(lastData)
  599. dataView = new DataView(buf)
  600. for (let i = 0; i < lastData; ++i) {
  601. dataView.setUint8(i, buff[(currentTime - 1) * onBufferSize + i])
  602. }
  603. }
  604. plus.bluetooth.writeBLECharacteristicValue({
  605. deviceId: bluetooth.value.deviceId,
  606. serviceId: bluetooth.value.serviceId,
  607. characteristicId: bluetooth.value.writeId,
  608. value: buf,
  609. success: function(res) {
  610. if (currentPrint <= printNum) {
  611. wx.showToast({
  612. title: '数据打印中',
  613. icon: 'loading'
  614. })
  615. }
  616. // 将complete中处理数据的代码挪过来,增加30ms延迟, 解决蓝牙打印数据传输10007问题
  617. setTimeout(() => {
  618. currentTime += 1
  619. if (currentTime <= loopBuffer) {
  620. blueConfig.value.isLabelSend = true
  621. blueConfig.value.currentTime = currentTime
  622. Send(buff)
  623. }
  624. // end
  625. if (currentTime === loopBuffer) {
  626. blueConfig.value.currentPrint += 1
  627. blueConfig.value.isLabelSend = false
  628. }
  629. }, 10)
  630. },
  631. fail: function(e) {
  632. wx.showToast({
  633. title: '打印第' + currentPrint + '张失败' + 'error: code ' + e
  634. ?.code + ', message ' + e?.message,
  635. icon: 'none',
  636. duration: 4000
  637. })
  638. },
  639. complete: function() {}
  640. })
  641. }
  642. const prepareSend = function(buff) {
  643. var time = blueConfig.value.onBufferSize
  644. var loopBuffer = parseInt(buff.length / time)
  645. var lastData = parseInt(buff.length % time)
  646. blueConfig.value.loopBuffer = loopBuffer + 1
  647. blueConfig.value.lastData = lastData
  648. blueConfig.value.currentTime = 1
  649. Send(buff)
  650. }
  651. // 打印测试
  652. const labelTest = async function(ret) {
  653. var command = tsc.dlabelPrinter.createNew()
  654. command.setBackFeed(6)
  655. // (640 * 320)dots
  656. command.setSize(80, 40)
  657. command.setCls()
  658. command.setGap(8)
  659. command.setBox(0, 0, 635, 315, 1)
  660. command.setBar(0, 40, 640, 2)
  661. command.setBar(0, 80, 640, 2)
  662. command.setBar(0, 120, 640, 2)
  663. command.setBar(0, 160, 640, 2)
  664. command.setBar(0, 200, 366, 2)
  665. command.setBar(0, 240, 366, 2)
  666. command.setBar(0, 280, 640, 2)
  667. // 1
  668. command.setBar(115, 0, 2, 40)
  669. command.setBar(115, 40, 2, 40)
  670. command.setBar(115, 80, 2, 40)
  671. command.setBar(115, 120, 2, 40)
  672. command.setBar(115, 160, 2, 40)
  673. command.setBar(115, 200, 2, 40)
  674. command.setBar(115, 240, 2, 40)
  675. command.setBar(115, 280, 2, 40)
  676. // 2
  677. command.setBar(360, 40, 2, 40)
  678. command.setBar(360, 80, 2, 40)
  679. command.setBar(360, 120, 2, 40)
  680. command.setBar(360, 160, 2, 40)
  681. command.setBar(360, 200, 2, 40)
  682. command.setBar(360, 240, 2, 40)
  683. command.setBar(360, 280, 2, 40)
  684. // 3
  685. command.setBar(475, 40, 2, 40)
  686. command.setBar(475, 80, 2, 40)
  687. command.setBar(475, 120, 2, 40)
  688. command.setBar(475, 280, 2, 40)
  689. command.setText(10, 6, 'TSS24.BF2', 0, 1, 1, '物料名称')
  690. command.setText(126, 6, 'TSS24.BF2', 0, 1, 1, ret.materialName)
  691. // row2
  692. command.setText(10, 46, 'TSS24.BF2', 0, 1, 1, '物料编码')
  693. command.setText(126, 46, 'TSS24.BF2', 0, 1, 1, ret.materialNo)
  694. command.setText(366, 46, 'TSS24.BF2', 0, 1, 1, '供应商')
  695. command.setText(481, 46, 'TSS24.BF2', 0, 1, 1, ret.supplierName)
  696. // row3
  697. command.setText(10, 86, 'TSS24.BF2', 0, 1, 1, '物料规格')
  698. command.setText(126, 86, 'TSS24.BF2', 0, 1, 1, ret.size)
  699. command.setText(366, 86, 'TSS24.BF2', 0, 1, 1, '分切日期')
  700. command.setText(481, 86, 'TSS24.BF2', 0, 1, 1, ret.createTime)
  701. // row4
  702. command.setText(10, 126, 'TSS24.BF2', 0, 1, 1, 'Lot no.')
  703. command.setText(126, 126, '1', 0, 1, 1, ret.materialLots)
  704. command.setText(366, 126, 'TSS24.BF2', 0, 1, 1, '储位')
  705. command.setText(481, 126, 'TSS24.BF2', 0, 1, 1, ret.wmsStockLocationName)
  706. // row5
  707. command.setText(10, 166, 'TSS24.BF2', 0, 1, 1, '有效期')
  708. command.setText(126, 166, 'TSS24.BF2', 0, 1, 1, ret.validityDate)
  709. // row6
  710. command.setText(10, 206, 'TSS24.BF2', 0, 1, 1, '检测日期')
  711. command.setText(126, 206, 'TSS24.BF2', 0, 1, 1, ret.inspectTime)
  712. // row7
  713. command.setText(10, 246, 'TSS24.BF2', 0, 1, 1, '存储条件')
  714. const strList = ret.storageEnvironment?.split(' ')
  715. const strText = strList[0] + ' ' + strList[1]
  716. command.setText(126, 246, 'TSS24.BF2', 0, 1, 1, strText)
  717. // row8
  718. command.setText(10, 286, 'TSS24.BF2', 0, 1, 1, '分切单号')
  719. command.setText(126, 286, 'TSS24.BF2', 0, 1, 1, ret.slittingOrderNo)
  720. command.setText(366, 286, 'TSS24.BF2', 0, 1, 1, '生产日期')
  721. command.setText(481, 286, 'TSS24.BF2', 0, 1, 1, ret.produceDate)
  722. command.setText(480, 216, '2', 0, 1, 1, ret.qty)
  723. command.setQrcode(366, 166, 'L', 4, 'A', ret.batchNumber)
  724. command.setPagePrint()
  725. blueConfig.value.isLabelSend = true
  726. const forMatData = await command.getData()
  727. await prepareSend(forMatData)
  728. }
  729. const handleCutting = async function() {
  730. if ([undefined, null, ''].includes(params.value.scanEmployee)) {
  731. uni.showToast({
  732. title: '请绑定员工',
  733. icon: 'none',
  734. duration: 1000
  735. })
  736. return
  737. }
  738. if ([undefined, null, ''].includes(params.value.scanDeviceId)) {
  739. uni.showToast({
  740. title: '请绑定设备',
  741. icon: 'none',
  742. duration: 1000
  743. })
  744. return
  745. }
  746. uni.$reqPost('executeCutting', {
  747. slittingOrderNo: params.value.eBillNo,
  748. employee: params.value.scanEmployee,
  749. deviceId: params.value.scanDeviceId
  750. })
  751. .then(({
  752. code,
  753. data,
  754. msg
  755. }) => {
  756. if (code === 0) {
  757. uni.showToast({
  758. title: '分切成功',
  759. icon: 'none',
  760. duration: 2000
  761. })
  762. } else {
  763. uni.showToast({
  764. title: msg,
  765. icon: 'none',
  766. duration: 2000
  767. })
  768. }
  769. })
  770. // uni.$reqPost("executeCutting", {
  771. // slittingOrderNo: params.value.eBillNo,
  772. // employee: params.value.scanEmployee,
  773. // deviceId: params.value.scanDeviceId,
  774. // })
  775. // .then(({
  776. // code,
  777. // data,
  778. // msg
  779. // }) => {
  780. // if (code === 0) {
  781. // // #ifdef APP-PLUS
  782. // const Activity = plus.android.runtimeMainActivity();
  783. // const Intent = plus.android.importClass("android.content.Intent");
  784. // const Uri = plus.android.importClass("android.net.Uri");
  785. // const browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(
  786. // `${uni.$baseUrl}/jmreport/view/821903765761437696?id=${params.value.eBillNo}`
  787. // ))
  788. // Activity.startActivity(browserIntent);
  789. // // #endif
  790. // // #ifdef H5
  791. // const dom = document.createElement('a');
  792. // dom.setAttribute("href",
  793. // `${uni.$baseUrl}/jmreport/view/821903765761437696?id=${params.value.eBillNo}`
  794. // );
  795. // dom.setAttribute("target", "_blank");
  796. // dom.click();
  797. // // #endif
  798. // uni.navigateTo({
  799. // url: "/pages/workbranch/production/cutting/cuttingList"
  800. // })
  801. // } else {
  802. // uni.showToast({
  803. // title: msg,
  804. // icon: "none",
  805. // duration: 1000,
  806. // })
  807. // }
  808. // })
  809. }
  810. // 获取打印数据
  811. const handleGetPrintData = function(id) {
  812. uni.request({
  813. url: uni.$baseUrl + '/report/print/slittingPrintData',
  814. data: {
  815. id
  816. }
  817. }).then(async ({
  818. data
  819. }) => {
  820. printData.value = [];
  821. if (data.data?.length > 0) {
  822. printData.value = data.data
  823. } else {
  824. // #ifdef APP-PLUS
  825. plus.device.beep(2)
  826. // #endif
  827. errorTipMessage.value = '无打印数据'
  828. errorTip.value.open()
  829. errorState.value = -1
  830. }
  831. })
  832. }
  833. // 蓝牙打印
  834. const bluetoothPrint = function() {
  835. if (printData.value.length > 0) {
  836. blueConfig.value.currentPrint = 1
  837. blueConfig.value.printNum = printData.value.length
  838. const timer = setInterval(async () => {
  839. const currentPrint = blueConfig.value.currentPrint -
  840. 1
  841. if (blueConfig.value.isLabelSend === false &&
  842. currentPrint <
  843. blueConfig.value.printNum) {
  844. const paramsObj = {
  845. materialName: printData.value[currentPrint]
  846. .materialName ?? '',
  847. materialNo: printData.value[currentPrint]
  848. .materialNo ??
  849. '',
  850. supplierName: printData.value[currentPrint]
  851. .supplierName ??
  852. '',
  853. size: printData.value[currentPrint]
  854. .size ??
  855. '',
  856. createTime: printData.value[currentPrint]
  857. .createTime ??
  858. '',
  859. materialLots: printData.value[currentPrint]
  860. .materialLots ??
  861. '',
  862. wmsStockLocationName: printData.value[
  863. currentPrint]
  864. .wmsStockLocationName ??
  865. '',
  866. validityDate: printData.value[currentPrint]
  867. .validityDate ??
  868. '',
  869. inspectTime: printData.value[currentPrint]
  870. .inspectTime ??
  871. '',
  872. storageEnvironment: printData.value[currentPrint]
  873. .storageEnvironment ??
  874. '',
  875. slittingOrderNo: printData.value[currentPrint]
  876. .slittingOrderNo ??
  877. '',
  878. produceDate: printData.value[currentPrint]
  879. .produceDate ??
  880. '',
  881. batchNumber: printData.value[currentPrint]
  882. .batchNumber ??
  883. '',
  884. qty: printData.value[currentPrint]
  885. .qty ??
  886. ''
  887. }
  888. await labelTest(paramsObj)
  889. }
  890. if (currentPrint === blueConfig.value.printNum) {
  891. await clearInterval(timer)
  892. }
  893. }, 3000)
  894. }
  895. }
  896. // 智高打印
  897. const hicorePrint = function() {
  898. var cfgData = new Object;
  899. cfgData.XAction = "Print"
  900. cfgData.XOpenId = "10000004";
  901. cfgData.XTokens = "+fdBeHkvLvJgWBKF/6iODpmABblarwVz";
  902. cfgData.XUrl = "http://192.168.1.58:51320";
  903. // uniapp 1 其它 0
  904. cfgData.FaceType = "1";
  905. /*指定打印机*/
  906. cfgData.PrinterName = printer.value;
  907. /*模板方式,0-客户端模板,1-远程模板,
  908. 2-如果本地模板存在,使用本地,不存在使用远程模板,3-不使用模板*/
  909. cfgData.TemplateMode = "2";
  910. /*远程模板URL或本地模板的文件夹*/
  911. // cfgData.TemplateURL = "http://img.51321.cn/web/chicore/VPrinting/API";
  912. cfgData.TemplateURL = "http://113.105.183.190:9163/bucket163";
  913. // cfgData.TemplateURL = "D:\\\\";
  914. /*模板文件名*/
  915. // cfgData.TemplateName = "183601-70X40.Lblx";
  916. cfgData.TemplateName = "2024-01-26-10-04-38-1706234678133_Label3.Lblx";
  917. // cfgData.TemplateName = "Label2.Lblx";
  918. /*打印数据的类型,0-数组,1-Json数组,元素为JSON对象,字段:值*/
  919. cfgData.PrintDataType = 1;
  920. /*传递打印数据 Json数组*/
  921. /*内容不允许 半角的逗号及半角的分隔符*/
  922. var arr = printData.value;
  923. cfgData.PrintData = JSON.stringify(arr);
  924. /*打印 发送给打印机进行打印*/
  925. uni.CCPrintingAPI.Excute(cfgData,
  926. function(XTimeout) {},
  927. function(XFail) {
  928. // #ifdef APP-PLUS
  929. plus.device.beep(2)
  930. // #endif
  931. errorTipMessage.value = "API可能未安装或未启动"
  932. errorTip.value.open()
  933. errorState.value = -1
  934. },
  935. function(XSuccess) {
  936. var apiResult = JSON.parse(XSuccess.trim());
  937. if (apiResult.Status == "1") {
  938. uni.showToast({
  939. title: '标签打印成功',
  940. icon: "none",
  941. duration: 1500
  942. })
  943. }
  944. }
  945. );
  946. }
  947. const handleShowPrintDialog = function() {
  948. const ids = []
  949. slittedLots.value.forEach(ret => {
  950. if (ret.checked) {
  951. ids.push(ret?.id)
  952. }
  953. })
  954. if (ids.length === 0) {
  955. // #ifdef APP-PLUS
  956. plus.device.beep(2)
  957. // #endif
  958. errorTipMessage.value = '请选中至少一行打印数据'
  959. errorTip.value.open()
  960. errorState.value = -1
  961. } else {
  962. popup.value.open();
  963. handleGetPrintData(ids.toString());
  964. }
  965. }
  966. const handlePrintLabel = function() {
  967. if (printType.value === '0') {
  968. hicorePrint();
  969. }
  970. if (printType.value === '1') {
  971. bluetoothPrint();
  972. }
  973. }
  974. // 全选
  975. const handleCheckedAllRow = function() {
  976. slittedLots.value.map(ret => {
  977. ret.checked = !isCheckedAllRow.value
  978. })
  979. isCheckedAllRow.value = !isCheckedAllRow.value
  980. }
  981. return {
  982. printTypeList: [{
  983. text: '智高标签打印',
  984. value: '0',
  985. }, {
  986. text: '蓝牙打印',
  987. value: '1',
  988. }, ],
  989. popup,
  990. goBack,
  991. printType,
  992. printer,
  993. printerList,
  994. slittedLots,
  995. slittingLots,
  996. isLandscapeScreen,
  997. batchNumberInput,
  998. employeeInput,
  999. handleInputFocus,
  1000. deviceInput,
  1001. errorState,
  1002. errorTip,
  1003. errorTipMessage,
  1004. params,
  1005. computedLight,
  1006. handleClear,
  1007. handleMapass,
  1008. handleCutting,
  1009. isCheckedAllRow,
  1010. handlePrintLabel,
  1011. confirmQrCodeEmployee,
  1012. confirmQrCodeDeviceId,
  1013. confirmBatchNumber,
  1014. handleCkeckedRow,
  1015. handleShowPrintDialog,
  1016. handleCheckedAllRow,
  1017. handleMapassQrCodeEmployee,
  1018. handleMapassQrCodeDeviceId,
  1019. handleCloseErrorTipsModal
  1020. }
  1021. }
  1022. })
  1023. </script>
  1024. <style lang="scss" scoped>
  1025. .gui-header-leader-btns {
  1026. color: black;
  1027. font-size: 24px !important;
  1028. margin-left: 24rpx;
  1029. }
  1030. .gui-sbody {
  1031. background-color: rgba(234, 239, 242, 1);
  1032. }
  1033. .gui-relative {
  1034. overflow: visible;
  1035. height: 100vh;
  1036. .oqc-checkout {
  1037. width: 100vw;
  1038. height: calc(100vh - 75px);
  1039. position: absolute;
  1040. top: 95px;
  1041. overflow-y: scroll;
  1042. }
  1043. }
  1044. .popup-content {
  1045. width: 100vw;
  1046. height: 55vh;
  1047. overflow-y: scroll;
  1048. }
  1049. .card-list-flexbox-popup {
  1050. width: 100vw;
  1051. display: flex;
  1052. flex-direction: row;
  1053. align-items: center;
  1054. flex-wrap: wrap;
  1055. .card-list-item,
  1056. .card-list-item-input {
  1057. width: 100vw;
  1058. height: 100%;
  1059. min-height: 40px;
  1060. display: flex;
  1061. flex-direction: row;
  1062. align-items: center;
  1063. background-color: #fff;
  1064. uni-text {
  1065. font-size: 14px;
  1066. height: 50rpx;
  1067. text-align: left;
  1068. padding: 0 12px;
  1069. display: flex;
  1070. flex-direction: row;
  1071. align-items: center;
  1072. }
  1073. uni-image {
  1074. width: calc(100vw / 2 - 4px);
  1075. height: calc(100vw / 3.2 - 2px);
  1076. pointer-events: none;
  1077. }
  1078. uni-image::after {
  1079. content: "×";
  1080. width: 22px;
  1081. height: 22px;
  1082. position: absolute;
  1083. top: 5px;
  1084. right: 5px;
  1085. display: flex;
  1086. justify-content: center;
  1087. align-items: center;
  1088. color: rgba(255, 255, 255, 0.9);
  1089. background-color: rgba(0, 0, 0, 0.5);
  1090. border-radius: 50%;
  1091. font-size: 24px;
  1092. /*给伪元素开启鼠标事件,将事件冒泡到父元素的点击事件中*/
  1093. pointer-events: auto;
  1094. }
  1095. .text-1 {
  1096. flex: 1;
  1097. height: 40px;
  1098. justify-content: flex-start;
  1099. }
  1100. .text-2 {
  1101. flex: 3;
  1102. height: 40px;
  1103. justify-content: flex-end;
  1104. margin-right: 4px;
  1105. padding: 2px 6px;
  1106. }
  1107. .text-3 {
  1108. width: calc(100% - 15%);
  1109. min-height: 35px;
  1110. justify-content: flex-end;
  1111. padding: 2px 6px;
  1112. }
  1113. .text-3::before {}
  1114. .btn-mg {
  1115. margin: 0 5px;
  1116. }
  1117. }
  1118. .card-list-item {
  1119. justify-content: center;
  1120. }
  1121. .card-list-item-input {
  1122. margin: 10px 0 10px 2%;
  1123. display: flex;
  1124. flex-direction: column;
  1125. uni-view {
  1126. width: 100%;
  1127. height: 100%;
  1128. display: flex;
  1129. uni-textarea {
  1130. flex: 8;
  1131. }
  1132. uni-view {
  1133. flex: 1;
  1134. }
  1135. .operation-icon,
  1136. .operation-icon-2 {
  1137. height: auto;
  1138. uni-text {
  1139. width: 22px;
  1140. height: 100%;
  1141. padding: 0 !important;
  1142. text-align: center;
  1143. display: flex;
  1144. justify-content: center;
  1145. align-items: center;
  1146. border-top-right-radius: 4px;
  1147. border-bottom-right-radius: 4px;
  1148. color: white;
  1149. background-color: #80b7ff;
  1150. }
  1151. }
  1152. .operation-icon-2 {
  1153. uni-text {
  1154. background-color: #ff5962;
  1155. }
  1156. }
  1157. }
  1158. }
  1159. .grid-image {
  1160. /* 设置容器布局为grid布局 */
  1161. display: grid;
  1162. /* 指定每一行的宽度 每个宽度中间用空格隔开 */
  1163. grid-template-rows: repeat(auto-fill, 1fr);
  1164. /* 指定每一列的宽度 每个宽度中间用空格隔开 */
  1165. grid-template-columns: repeat(2, 1fr);
  1166. padding: 0 4px;
  1167. }
  1168. .card-list-item:nth-of-type(1) {
  1169. .text-1 {
  1170. flex: 9;
  1171. font-weight: bold;
  1172. color: black !important;
  1173. }
  1174. .text-1::before {
  1175. content: "";
  1176. width: 4px;
  1177. height: 20px;
  1178. border-radius: 4px;
  1179. margin-right: 4px;
  1180. background-color: skyblue;
  1181. }
  1182. .text-2 {
  1183. flex: 4;
  1184. display: flex;
  1185. flex-direction: row;
  1186. justify-content: flex-end;
  1187. align-items: center;
  1188. color: limegreen !important;
  1189. }
  1190. }
  1191. }
  1192. .table-title {
  1193. height: 40px;
  1194. line-height: 40px;
  1195. margin: 0 0 -3px 0;
  1196. padding: 0 12px;
  1197. font-size: 16px;
  1198. font-weight: bold;
  1199. background-color: white;
  1200. }
  1201. .uni-list-cell {
  1202. width: 100vw;
  1203. height: 35px;
  1204. margin: 4px 0;
  1205. display: flex;
  1206. flex-direction: row;
  1207. align-items: center;
  1208. justify-content: space-between;
  1209. border-bottom: 2px solid #eaeff2;
  1210. background-color: #fff;
  1211. view {
  1212. font-size: 14px;
  1213. height: 50rpx;
  1214. text-align: left;
  1215. padding: 0 8px;
  1216. display: flex;
  1217. flex-direction: row;
  1218. align-items: center;
  1219. }
  1220. .uni-list-cell-left {
  1221. flex: 1;
  1222. height: 35px;
  1223. justify-content: flex-start;
  1224. }
  1225. .uni-list-cell-db {
  1226. flex: 3;
  1227. height: 35px;
  1228. justify-content: flex-end;
  1229. margin-right: 4px;
  1230. padding: 2px 6px;
  1231. uni-picker {
  1232. width: 100%;
  1233. display: flex;
  1234. flex-direction: row;
  1235. justify-content: center;
  1236. }
  1237. }
  1238. }
  1239. .modal-btns {
  1240. height: 100rpx;
  1241. line-height: 100rpx;
  1242. display: flex;
  1243. justify-content: center;
  1244. align-items: center;
  1245. }
  1246. .line {
  1247. margin-top: 10rpx;
  1248. height: 80rpx;
  1249. width: 1rpx;
  1250. background-color: #dcdcdc;
  1251. }
  1252. .font-icons {
  1253. width: 40px;
  1254. font-size: 20px;
  1255. }
  1256. .scan {
  1257. height: 45px;
  1258. width: calc(100% - 48px);
  1259. margin: 0 12px 12px 12px;
  1260. padding: 0 12px;
  1261. display: flex;
  1262. justify-content: space-between;
  1263. align-items: center;
  1264. border-radius: 6px;
  1265. background-color: white;
  1266. .scan-card {
  1267. width: 100%;
  1268. display: grid;
  1269. grid-template-rows: 1fr;
  1270. grid-template-columns: 7fr 2fr;
  1271. align-items: center;
  1272. input {
  1273. height: 35px;
  1274. line-height: 35px;
  1275. }
  1276. text {
  1277. width: 100%;
  1278. text-align: right;
  1279. }
  1280. }
  1281. }
  1282. .light-focus {
  1283. border: 1px solid #008aff;
  1284. border-radius: 6px !important;
  1285. ::v-deep .uni-easyinput__content {
  1286. border-radius: 6px !important;
  1287. }
  1288. }
  1289. .light-focus::before {
  1290. position: absolute;
  1291. left: -10px;
  1292. top: -10px;
  1293. content: "✏️";
  1294. width: 20px;
  1295. height: 20px;
  1296. color: red;
  1297. font-weight: bold;
  1298. font-size: 18px;
  1299. }
  1300. .form {
  1301. font-size: 14px;
  1302. margin: 0 12px 12px 12px;
  1303. padding: 4px 8px;
  1304. border-radius: 4px;
  1305. background-color: white;
  1306. .form-title {
  1307. height: 32px;
  1308. line-height: 32px;
  1309. text-align: center;
  1310. font-size: 16px;
  1311. font-weight: bold;
  1312. border-bottom: 2px dashed #edeeee;
  1313. }
  1314. .form-item {
  1315. .title {
  1316. height: 32px;
  1317. line-height: 32px;
  1318. text-align: left;
  1319. font-weight: bold;
  1320. color: #333;
  1321. }
  1322. .content {
  1323. height: 42px;
  1324. line-height: 42px;
  1325. margin: 0 0 6px 0;
  1326. position: relative;
  1327. .button-add {
  1328. position: absolute;
  1329. width: 37px;
  1330. height: 37px;
  1331. right: 0;
  1332. top: 0;
  1333. display: flex;
  1334. justify-content: center;
  1335. align-items: center;
  1336. border-radius: 4px;
  1337. color: white;
  1338. cursor: pointer;
  1339. background-color: #00a0e9;
  1340. }
  1341. }
  1342. }
  1343. }
  1344. </style>