store-in-2.vue 23 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051
  1. <template>
  2. <div class="container">
  3. <my-nav
  4. @listener-in="inHandle"
  5. @listener-helper="helperHandle"
  6. ></my-nav>
  7. <div class="content">
  8. <div class="reading" v-if="reading">
  9. 入库扫描中<br />
  10. 请将需要入库的物料推入感应门
  11. </div>
  12. <div v-else style="height: 100%">
  13. <div
  14. style="
  15. display: flex;
  16. justify-content: space-between;
  17. align-items: center;
  18. "
  19. >
  20. <div style="width: 108px"></div>
  21. <div class="title">入库扫描</div>
  22. <div style="padding: 0 10px">
  23. <Button
  24. type="primary"
  25. style="margin-right: 10px"
  26. @click="purContractPageListModal = true"
  27. >手动入库</Button
  28. >
  29. <Button type="primary" @click="scanShow = true"
  30. >辅助扫描</Button
  31. >
  32. </div>
  33. </div>
  34. <div class="main">
  35. <div class="list-wrap">
  36. <div class="list" style="margin-right: 20px">
  37. <div class="sub-title">已贴标物料</div>
  38. <div
  39. style="
  40. height: calc(100% - 46px);
  41. overflow: auto;
  42. "
  43. >
  44. <div
  45. class="row"
  46. v-for="(item, index) in data"
  47. :key="index"
  48. >
  49. <div
  50. class="col"
  51. style="width: 50px; align-items: center"
  52. >
  53. <Icon
  54. type="ios-checkmark-circle"
  55. color="red"
  56. size="18"
  57. v-if="item.checked"
  58. />
  59. </div>
  60. <div class="col" style="flex: 1">
  61. <div>{{ item.materialName }}</div>
  62. <div>
  63. 物料长度:{{ item.quantity }}米
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="list">
  70. <div class="sub-title">本次入库</div>
  71. <div
  72. style="
  73. height: calc(100% - 46px);
  74. overflow: auto;
  75. "
  76. >
  77. <div
  78. class="row"
  79. v-for="(
  80. item, index
  81. ) in scanData.rfidTagItems"
  82. :key="index"
  83. >
  84. <div
  85. class="col"
  86. style="width: 50px; align-items: center"
  87. ></div>
  88. <div
  89. class="col"
  90. style="flex: 1"
  91. :style="{
  92. color:
  93. item.scanRfidStatus === 1
  94. ? 'orange'
  95. : item.scanRfidStatus === 2
  96. ? 'red'
  97. : '#fff',
  98. }"
  99. >
  100. <div>{{ item.materialName }}</div>
  101. <div>
  102. 物料长度:{{ item.quantity || 0 }}米
  103. </div>
  104. </div>
  105. <div
  106. class="col"
  107. style="flex: 1"
  108. :style="{
  109. color:
  110. item.scanRfidStatus === 1
  111. ? 'orange'
  112. : item.scanRfidStatus === 2
  113. ? 'red'
  114. : '#fff',
  115. }"
  116. >
  117. <div>标签值:{{ item.rfid }}</div>
  118. </div>
  119. <div class="col" style="width: 50px">
  120. <Icon
  121. type="ios-trash"
  122. size="20"
  123. color="red"
  124. @click="del(item, index)"
  125. style="cursor: pointer"
  126. />
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. <div class="list-wrap bottom">
  133. <div class="list">
  134. <div class="sub-title">
  135. 本次统计
  136. <a class="remark" href="#" @click="show = true"
  137. >填写备注</a
  138. >
  139. </div>
  140. <div
  141. style="
  142. height: calc(100% - 46px);
  143. overflow: auto;
  144. "
  145. >
  146. <div
  147. class="row"
  148. v-for="(item, index) in materialItemsCopy"
  149. :key="index"
  150. >
  151. <div
  152. class="col"
  153. style="flex: 3"
  154. :style="{
  155. color:
  156. item.scanRfidStatus === 1
  157. ? 'orange'
  158. : item.scanRfidStatus === 2
  159. ? 'red'
  160. : '#fff',
  161. }"
  162. >
  163. <div>{{ item.materialName }}</div>
  164. </div>
  165. <div
  166. class="col"
  167. style="flex: 2"
  168. :style="{
  169. color:
  170. item.scanRfidStatus === 1
  171. ? 'orange'
  172. : item.scanRfidStatus === 2
  173. ? 'red'
  174. : '#fff',
  175. }"
  176. >
  177. <div>入库件数:{{ item.tagCount }}</div>
  178. </div>
  179. <div
  180. class="col"
  181. style="flex: 2"
  182. :style="{
  183. color:
  184. item.scanRfidStatus === 1
  185. ? 'orange'
  186. : item.scanRfidStatus === 2
  187. ? 'red'
  188. : '#fff',
  189. }"
  190. >
  191. <div>
  192. 入库数量:{{ item.quantity }}米
  193. </div>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. </div>
  199. </div>
  200. <div class="footer">
  201. <Button
  202. type="error"
  203. size="large"
  204. style="margin-right: 20px"
  205. @click="pass(0)"
  206. >重新扫描</Button
  207. >
  208. <Button type="success" size="large" @click="pass(1)"
  209. >确认无误</Button
  210. >
  211. </div>
  212. </div>
  213. </div>
  214. <div class="remark-content">
  215. <Modal
  216. v-model="modal"
  217. :mask-closable="false"
  218. :closable="false"
  219. :fullscreen="true"
  220. :footer-hide="true"
  221. >
  222. <Progress
  223. :percent="percent"
  224. :stroke-color="['#108ee9', '#87d068']"
  225. :hide-info="true"
  226. style="width: 400px"
  227. />
  228. </Modal>
  229. </div>
  230. <!-- 填写备注 -->
  231. <Modal
  232. v-model="show"
  233. :closable="false"
  234. :footer-hide="true"
  235. class-name="vertical-center-modal"
  236. @on-cancel="cancel"
  237. >
  238. <div class="remark-content">
  239. <div class="title">填写备注</div>
  240. <Input v-model="remark" type="textarea" :rows="10" />
  241. <div class="btn">
  242. <Button @click="cfm" type="success" style="width: 120px"
  243. >确定</Button
  244. >
  245. </div>
  246. </div>
  247. </Modal>
  248. <!-- 手动入库 -->
  249. <Modal
  250. v-model="purContractPageListModal"
  251. title="手动入库"
  252. okText="关闭"
  253. class-name="purContractPageList"
  254. @on-cancel="purContractPageListModal = false"
  255. width="90%"
  256. >
  257. <my-table
  258. :data="purContractPageListData"
  259. :columns="purContractPageListColumns"
  260. :table-filter="tableFilter"
  261. :table-page="params"
  262. @event-handle="eventHandle"
  263. @on-change="changePage"
  264. ></my-table>
  265. </Modal>
  266. <my-manege-modal
  267. v-model="showInfo"
  268. :data="formData"
  269. @approval-handle="approvalHandle"
  270. >
  271. </my-manege-modal>
  272. <!-- 辅助扫描 -->
  273. <Modal
  274. v-model="scanShow"
  275. class-name="vertical-center-modal"
  276. @on-cancel="cancel"
  277. >
  278. <div class="scan-title" slot="header">辅助扫描</div>
  279. <div class="scan-btn" slot="footer">
  280. <Button
  281. type="primary"
  282. style="width: 80px"
  283. @click="scanShow = false"
  284. >关闭</Button
  285. >
  286. </div>
  287. <div class="scan-content" v-if="otherData.length > 0">
  288. <div
  289. class="item"
  290. v-for="(item, index) in otherData"
  291. :key="index"
  292. >
  293. <div class="left">
  294. <div class="row">RFID标签:{{ item.rfidCode }}</div>
  295. <div class="row">物料编码:{{ item.materialCode }}</div>
  296. <div class="row">物料名称:{{ item.materialName }}</div>
  297. <div class="row">最近操作:{{ item.lastOpera }}</div>
  298. </div>
  299. <div class="right">
  300. <Button
  301. type="primary"
  302. ghost
  303. @click="add(item)"
  304. v-if="item.lastOpera.indexOf('入库') === -1"
  305. >入库</Button
  306. >
  307. </div>
  308. </div>
  309. </div>
  310. <div v-else style="padding: 10px 0; color: #ffffff">暂无数据</div>
  311. </Modal>
  312. </div>
  313. </template>
  314. <script>
  315. import MyNav from '@/components/my-nav'
  316. import * as signalR from '@microsoft/signalr'
  317. import { MessagePackHubProtocol } from '@microsoft/signalr-protocol-msgpack'
  318. import withUrl from '@/config/withUrl'
  319. import MyTable from '@/components/my-table/my-table'
  320. import {
  321. GetHasTagMaterialList,
  322. PlcStorageIn,
  323. ReScan,
  324. GetScanRfidStocInOut,
  325. DelScanRfid,
  326. GetPurContractPageList,
  327. } from '@/api/integrated'
  328. import store from '@/store'
  329. import { logOut } from '@/libs/util'
  330. import MyManegeModal from './my-manage-modal'
  331. export default {
  332. name: 'store-in',
  333. components: {
  334. MyTable,
  335. MyNav,
  336. MyManegeModal,
  337. },
  338. data() {
  339. return {
  340. scanShow: false,
  341. show: false,
  342. modal: false,
  343. percent: 0,
  344. addTimer: null,
  345. overTimer: null,
  346. reading: false,
  347. connection: null,
  348. data: [], // 左侧数据列表
  349. scanData: {
  350. rfidTagItems: [],
  351. materialItems: [],
  352. }, // 扫描数据
  353. otherData: [], // 扫描辅助数据
  354. tempDelData: [], // 临时删除列表
  355. remark: '',
  356. materialItemsCopy: [],
  357. // 手动入库
  358. showInfo: false,
  359. formData: {},
  360. purContractPageListModal: false,
  361. purContractPageListData: [],
  362. purContractPageListColumns: [
  363. {
  364. title: '序号',
  365. type: 'index',
  366. width: 60,
  367. align: 'center',
  368. },
  369. {
  370. title: '合同编号',
  371. key: 'purchaseBillNo',
  372. minWidth: 200,
  373. render: (h, params) => {
  374. let _this = this
  375. return h(
  376. 'a',
  377. {
  378. on: {
  379. click() {},
  380. },
  381. },
  382. params.row.purchaseBillNo
  383. )
  384. },
  385. },
  386. {
  387. title: '合同状态',
  388. key: 'supplierShipState',
  389. minWidth: 150,
  390. },
  391. {
  392. title: '交货日期',
  393. key: 'deliverTime',
  394. minWidth: 150,
  395. },
  396. {
  397. title: '件号',
  398. key: 'materialCode',
  399. minWidth: 150,
  400. },
  401. {
  402. title: '物料名称',
  403. key: 'materialName',
  404. minWidth: 150,
  405. },
  406. {
  407. title: '规格',
  408. key: 'spec',
  409. minWidth: 150,
  410. },
  411. {
  412. title: '单位',
  413. key: 'unitName',
  414. minWidth: 150,
  415. },
  416. {
  417. title: '采购数量',
  418. key: 'purchaseQty',
  419. minWidth: 150,
  420. },
  421. {
  422. title: '单价',
  423. key: 'price',
  424. minWidth: 150,
  425. },
  426. {
  427. title: '小计',
  428. key: 'totalAmount',
  429. minWidth: 150,
  430. },
  431. {
  432. title: '已出货',
  433. key: 'shipQuantity',
  434. minWidth: 150,
  435. },
  436. {
  437. title: '已出货金额',
  438. key: 'shipAmount',
  439. minWidth: 150,
  440. },
  441. {
  442. title: '操作',
  443. key: 'takeState',
  444. minWidth: 180,
  445. align: 'center',
  446. fixed: 'right',
  447. render: (h, params) => {
  448. let _this = this
  449. return h('div', [
  450. h(
  451. 'Button',
  452. {
  453. props: {
  454. type: 'primary',
  455. size: 'small',
  456. },
  457. style: {
  458. marginRight: '10px',
  459. },
  460. on: {
  461. click: () => {
  462. _this.formData = {
  463. ...params.row,
  464. }
  465. _this.showInfo = true
  466. },
  467. },
  468. },
  469. '查看批次'
  470. ),
  471. ])
  472. },
  473. },
  474. ],
  475. tableFilter: [
  476. {
  477. name: 'Input',
  478. value: 'key',
  479. placeholder: '请输入关键字',
  480. },
  481. {
  482. name: 'Button',
  483. type: 'primary',
  484. text: '查询',
  485. e: 'search',
  486. },
  487. ],
  488. params: {
  489. pageIndex: 1,
  490. pageSize: 10,
  491. total: 0,
  492. supplierShipState: 0,
  493. },
  494. ws:null,
  495. }
  496. },
  497. methods: {
  498. add(item) {
  499. item.totalQuantity = item.qty
  500. item.quantity = item.qty
  501. // 辅助扫描的添加一个isTemp 标识以供删除区分
  502. if (
  503. this.scanData.rfidTagItems.find(
  504. (scan) => scan.materialCode === item.materialCode
  505. )
  506. ) {
  507. this.$Message.error('物料已添加')
  508. } else {
  509. this.scanData.rfidTagItems.push({ ...item, isTemp: true })
  510. this.scanData.materialItems.push({ ...item, isTemp: true })
  511. this.$Message.info('添加成功')
  512. }
  513. },
  514. cancel() {
  515. this.remark = ''
  516. },
  517. cfm() {
  518. this.show = false
  519. },
  520. /* 临时删除 */
  521. del(item, index) {
  522. // if (item.isTemp) {
  523. this.scanData.rfidTagItems.splice(index, 1)
  524. this.scanData.materialItems.splice(index, 1)
  525. /* 添加一个临时删除数据 用于再次扫描数据时过滤已临时删除的数据 */
  526. this.tempDelData.push(item)
  527. this.materialItemsCopy = []
  528. for (
  529. let i = 0;
  530. i < this.scanData.rfidTagItems.length;
  531. i++
  532. ) {
  533. const element = this.scanData.rfidTagItems[i]
  534. if (this.materialItemsCopy.length == 0) {
  535. this.materialItemsCopy.push({
  536. ...element,
  537. tagCount: 1,
  538. })
  539. } else {
  540. var isTotal = false
  541. for (
  542. let j = 0;
  543. j < this.materialItemsCopy.length;
  544. j++
  545. ) {
  546. const jelement = this.materialItemsCopy[j]
  547. if (
  548. element.materialCode ===
  549. jelement.materialCode
  550. ) {
  551. isTotal = true
  552. jelement.tagCount++
  553. jelement.quantity += element.quantity
  554. }
  555. }
  556. if (!isTotal)
  557. this.materialItemsCopy.push({
  558. ...element,
  559. tagCount: 1,
  560. })
  561. }
  562. }
  563. },
  564. /* 辅助扫描通知 */
  565. helperHandle(data) {
  566. this.otherData = data
  567. },
  568. /* 入库通知 */
  569. inHandle() {
  570. this.getScanList()
  571. clearTimeout(this.overTimer)
  572. this.overTimer = setTimeout(() => {
  573. clearInterval(this.addTimer)
  574. this.percent = 100
  575. setTimeout(() => {
  576. this.modal = false
  577. }, 500)
  578. }, 3000)
  579. },
  580. /* 是否通过 0否 1是 */
  581. pass(type) {
  582. if (type === 0) {
  583. this.$Message.info('请重新扫描入库!')
  584. this.scanData.rfidTagItems = []
  585. this.scanData.materialItems = []
  586. this.materialItemsCopy = []
  587. this.tempDelData = []
  588. if(window.ws) window.ws.close()
  589. setTimeout(() => {
  590. this.socketInit()
  591. }, 500);
  592. } else if (type === 1) {
  593. // 入库
  594. PlcStorageIn({
  595. storageDoor: sessionStorage.getItem('door'),
  596. plcStationCode: sessionStorage.getItem('plcCode'),
  597. rfidList: this.scanData.rfidTagItems.map(
  598. (item) => item.rfid
  599. ),
  600. remark: this.remark,
  601. }).then((res) => {
  602. if (res.code === 0) {
  603. this.$Message.info('入库成功!')
  604. logOut()
  605. // this.$store.commit('setHasGetInfo', false)
  606. // this.$store.commit('setToken', '')
  607. // setTimeout(() => {
  608. // this.$router.push({
  609. // name: 'Home',
  610. // query: {
  611. // plcCode: sessionStorage.getItem('plcCode'),
  612. // door: sessionStorage.getItem('door')
  613. // }
  614. // })
  615. // }, 500)
  616. }
  617. })
  618. }
  619. },
  620. getList() {
  621. /* 获取已贴标数据 */
  622. GetHasTagMaterialList().then((res) => {
  623. if (res.code === 0) {
  624. this.data = res.result
  625. }
  626. })
  627. },
  628. // 检索条件事件处理
  629. eventHandle(option) {
  630. switch (option._evnet) {
  631. case 'search':
  632. this.params.pageIndex = 1
  633. this.params.purchaseBillNo = option.key
  634. this.params.supplierShipState = option.supplierShipState
  635. this.gePurContractPage()
  636. break
  637. case 'add':
  638. this.formType = 'add'
  639. this.show = true
  640. break
  641. case 'back':
  642. this.$router.go(-1)
  643. break
  644. case 'download':
  645. window.open(
  646. 'https://fzjx.oss-cn-hangzhou.aliyuncs.com/order/20211014/211014041759903892.xlsx'
  647. )
  648. break
  649. case 'ip':
  650. this.ipShow = true
  651. break
  652. }
  653. },
  654. /* 点击删除 出货后触发审批流操作 */
  655. approvalHandle() {
  656. this.getList()
  657. },
  658. changePage(pageIndex) {
  659. this.params.pageIndex = pageIndex
  660. this.gePurContractPage()
  661. },
  662. gePurContractPage() {
  663. GetPurContractPageList(this.params).then((res) => {
  664. if (res.code === 0) {
  665. this.purContractPageListData = res.result.list
  666. this.params.total = res.result.totalCount
  667. }
  668. })
  669. },
  670. unique(arr, val) {
  671. const res = new Map()
  672. return arr.filter(
  673. (item) => !res.has(item[val]) && res.set(item[val], 1)
  674. )
  675. },
  676. getScanList(rfidTagItems) {
  677. if(!rfidTagItems) return
  678. this.reading = false
  679. console.log(rfidTagItems)
  680. this.scanData.rfidTagItems = [
  681. ...this.scanData.rfidTagItems,
  682. ...rfidTagItems,
  683. ]
  684. this.scanData.materialItems = [
  685. ...this.scanData.materialItems,
  686. ]
  687. this.scanData.rfidTagItems = this.unique(
  688. this.scanData.rfidTagItems,
  689. 'rfid'
  690. )
  691. /* 临时删除的数据不可再添加到出入库列表中 */
  692. this.tempDelData.forEach((temp) => {
  693. for (const index in this.scanData.rfidTagItems) {
  694. if (
  695. temp.rfid ===
  696. this.scanData.rfidTagItems[index].rfid
  697. ) {
  698. this.scanData.rfidTagItems.splice(index, 1)
  699. }
  700. }
  701. for (const index in this.scanData.materialItems) {
  702. if (
  703. temp.materialCode ===
  704. this.scanData.materialItems[index].materialCode
  705. ) {
  706. this.scanData.materialItems.splice(index, 1)
  707. }
  708. }
  709. })
  710. this.materialItemsCopy = []
  711. for (
  712. let i = 0;
  713. i < this.scanData.rfidTagItems.length;
  714. i++
  715. ) {
  716. const element = this.scanData.rfidTagItems[i]
  717. if (this.materialItemsCopy.length == 0) {
  718. this.materialItemsCopy.push({
  719. ...element,
  720. tagCount: 1,
  721. })
  722. } else {
  723. var isTotal = false
  724. for (
  725. let j = 0;
  726. j < this.materialItemsCopy.length;
  727. j++
  728. ) {
  729. const jelement = this.materialItemsCopy[j]
  730. if (
  731. element.materialCode ===
  732. jelement.materialCode
  733. ) {
  734. isTotal = true
  735. jelement.tagCount++
  736. jelement.quantity += element.quantity
  737. }
  738. }
  739. if (!isTotal)
  740. this.materialItemsCopy.push({
  741. ...element,
  742. tagCount: 1,
  743. })
  744. }
  745. }
  746. this.data.forEach((item) => {
  747. this.scanData.rfidTagItems.forEach((scan) => {
  748. if (item.rfid === scan.rfid) {
  749. item.checked = true
  750. }
  751. })
  752. })
  753. },
  754. socketInit() {
  755. const v = this
  756. window.ws = new WebSocket(
  757. 'ws://120.79.80.64:8050/cloudApi/webStock/' + window.localStorage.getItem('jobNo')
  758. //'ws://192.168.1.97:8300/webStock/' + window.localStorage.getItem('token')
  759. )
  760. //申请一个WebSocket对象,参数是服务端地址,同http协议使用http://开头一样,WebSocket协议的url使用ws://开头,另外安全的WebSocket协议使用wss://开头
  761. window.ws.onopen = function () {
  762. //当WebSocket创建成功时,触发onopen事件
  763. console.log('open')
  764. }
  765. window.ws.onmessage = function (e) {
  766. //当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
  767. var msg = JSON.parse(e.data)
  768. if (msg.type == 1) {
  769. msg.data.instructions = 'in' + sessionStorage.getItem('plcCode')
  770. msg.data.businessType = 1
  771. // 仓库id: 一楼仓库'c185883dba22478cb593d33f6b66cc53' 四楼仓库'0b8f584250bb4b40b72d641ce4849d15'
  772. msg.data.stockHouseId = sessionStorage.getItem('plcCode') == 2 ? '0b8f584250bb4b40b72d641ce4849d15' : 'c185883dba22478cb593d33f6b66cc53',
  773. msg.data.type = 2
  774. msg.type = 2
  775. window.ws.send(JSON.stringify(msg))
  776. }
  777. if(msg.type == 3){
  778. console.log(msg.data.rfidData)
  779. v.getScanList(msg.data.rfidData)
  780. }
  781. }
  782. window.ws.onclose = function (e) {
  783. //当客户端收到服务端发送的关闭连接请求时,触发onclose事件
  784. console.log('close')
  785. }
  786. window.ws.onerror = function (e) {
  787. //如果出现连接、处理、接收、发送数据失败的时候触发onerror事件
  788. console.log(error)
  789. }
  790. },
  791. },
  792. mounted() {
  793. this.gePurContractPage()
  794. this.socketInit()
  795. this.tempDelData = []
  796. this.getList()
  797. //this.getScanList()
  798. this.addTimer = setInterval(() => {
  799. this.percent += 1
  800. if (this.percent === 100) {
  801. clearInterval(this.addTimer)
  802. clearTimeout(this.overTimer)
  803. this.modal = false
  804. }
  805. }, 100)
  806. this.overTimer = setTimeout(() => {
  807. clearInterval(this.addTimer)
  808. this.percent = 100
  809. setTimeout(() => {
  810. this.modal = false
  811. }, 500)
  812. }, 3000)
  813. },
  814. destroyed() {},
  815. }
  816. </script>
  817. <style>
  818. .purContractPageList .table-filter,
  819. .purContractPageList .table-page,
  820. .purContractPageList .ivu-modal-footer,
  821. .purContractPageList .ivu-modal-header {
  822. background: #fff;
  823. }
  824. .purContractPageList .table-content,
  825. .purContractPageList .container {
  826. height: auto !important;
  827. }
  828. </style>
  829. <style lang="scss" scoped>
  830. .container {
  831. width: 100vw;
  832. height: 100vh;
  833. overflow: auto;
  834. //background: rgba(2, 125, 180, 1);
  835. background-image: linear-gradient(
  836. 270deg,
  837. #2c3034 0%,
  838. #50575e 49%,
  839. #2c3034 100%
  840. );
  841. .content {
  842. margin: 10px;
  843. height: calc(100% - 121.6px);
  844. overflow: hidden;
  845. box-sizing: border-box;
  846. //background: rgba(1, 84, 120, 1);
  847. border-radius: 10px;
  848. .reading {
  849. height: 100%;
  850. display: flex;
  851. align-items: center;
  852. justify-content: center;
  853. font-size: 36px;
  854. font-weight: bold;
  855. color: #00ffff;
  856. }
  857. .title {
  858. padding-bottom: 10px;
  859. text-align: center;
  860. font-size: 36px;
  861. font-weight: bold;
  862. color: #2dc57c;
  863. }
  864. .main {
  865. height: calc(100% - 113.6px);
  866. display: flex;
  867. flex-direction: column;
  868. .list-wrap {
  869. flex: 2;
  870. overflow: hidden;
  871. padding: 0 10px;
  872. width: 100%;
  873. display: flex;
  874. justify-content: space-between;
  875. align-items: center;
  876. .list {
  877. position: relative;
  878. //padding: 0 10px;
  879. flex: 1;
  880. height: 100%;
  881. overflow: hidden;
  882. //background: rgba(2, 125, 180, 0.486274509803922);
  883. background: #2c3034;
  884. border-radius: 4px;
  885. border: solid 1px #3879e7;
  886. .sub-title {
  887. position: relative;
  888. padding: 5px 0;
  889. font-size: 24px;
  890. color: #0077ff;
  891. font-weight: bold;
  892. .remark {
  893. position: absolute;
  894. right: 10px;
  895. top: 50%;
  896. transform: translateY(-50%);
  897. font-size: 16px;
  898. font-weight: normal;
  899. color: #0077ff;
  900. }
  901. }
  902. .row {
  903. padding: 5px 0;
  904. display: flex;
  905. justify-content: space-between;
  906. align-items: center;
  907. //background: rgba(2, 167, 240, 1);
  908. border-top: 1px solid #2655ad;
  909. //border-radius: 5px;
  910. &:last-child {
  911. border-bottom: 1px solid #2655ad;
  912. }
  913. .col {
  914. padding: 0 5px;
  915. display: flex;
  916. flex-direction: column;
  917. align-items: flex-start;
  918. justify-content: center;
  919. text-align: left;
  920. color: #ffffff;
  921. }
  922. }
  923. .total {
  924. padding: 5px 10px;
  925. //position: absolute;
  926. left: 0;
  927. bottom: 0;
  928. text-align: left;
  929. font-size: 20px;
  930. font-weight: bold;
  931. color: #f59a23;
  932. .top {
  933. font-size: 24px;
  934. }
  935. .label {
  936. margin-left: 40px;
  937. display: inline-block;
  938. width: 100px;
  939. }
  940. }
  941. }
  942. }
  943. .bottom {
  944. margin-top: 20px;
  945. flex: 1;
  946. .row {
  947. border: none !important;
  948. }
  949. .col {
  950. padding: 0 20px !important;
  951. }
  952. }
  953. }
  954. .footer {
  955. padding: 10px 0;
  956. padding-bottom: 0;
  957. /deep/ .ivu-btn-large {
  958. border-radius: 20px;
  959. font-weight: bold;
  960. width: 150px;
  961. }
  962. }
  963. }
  964. }
  965. /deep/.ivu-modal-content {
  966. background: #2c3034;
  967. }
  968. /deep/.ivu-modal-body {
  969. display: flex;
  970. align-items: center;
  971. justify-content: center;
  972. padding: 0;
  973. }
  974. /deep/.remark-content {
  975. padding: 16px;
  976. width: 100%;
  977. .title {
  978. font-size: 24px;
  979. font-weight: bold;
  980. text-align: center;
  981. color: #ffffff;
  982. padding-bottom: 10px;
  983. }
  984. .btn {
  985. text-align: center;
  986. padding-top: 10px;
  987. }
  988. }
  989. /deep/ .ivu-modal-header {
  990. border-bottom: none;
  991. }
  992. /deep/ .ivu-modal-footer {
  993. border-top: none;
  994. }
  995. .scan-title {
  996. font-size: 18px;
  997. font-weight: bold;
  998. color: #ffffff;
  999. }
  1000. .scan-btn {
  1001. text-align: center;
  1002. }
  1003. .scan-content {
  1004. padding: 10px 16px;
  1005. width: 100%;
  1006. max-height: 40vh;
  1007. overflow: auto;
  1008. background-color: #3d3d3d;
  1009. color: #ffffff;
  1010. .item {
  1011. margin-bottom: 5px;
  1012. border-bottom: 1px solid #ffffff;
  1013. display: flex;
  1014. justify-content: space-between;
  1015. align-items: center;
  1016. &:last-child {
  1017. margin-bottom: 0;
  1018. border-bottom: none;
  1019. }
  1020. .left {
  1021. flex: 1;
  1022. overflow: hidden;
  1023. }
  1024. .right {
  1025. width: 60px;
  1026. /deep/ .ivu-btn-primary {
  1027. background-color: rgb(204, 228, 255);
  1028. }
  1029. }
  1030. .row {
  1031. margin-bottom: 5px;
  1032. word-break: break-all;
  1033. }
  1034. }
  1035. }
  1036. </style>