setting.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <div>
  3. <div style="margin-top:50px;">
  4. <!-- <span class="title">打印设置</span> -->
  5. <group title="打印设置">
  6. <cell title="默认" @click.native="onClick(0)">
  7. <icon v-if="(type === 0)" type="success_no_circle"></icon>
  8. </cell>
  9. <cell title="全部数据" @click.native="onClick(1)">
  10. <icon v-if="(type === 1)" type="success_no_circle"></icon>
  11. </cell>
  12. </group>
  13. <box gap="20px 10px">
  14. <x-button type="primary" @click.native="save">保存</x-button>
  15. </box>
  16. </div>
  17. <toast v-model="showInfo" type="text" :time="2000">{{info}}</toast>
  18. </div>
  19. </template>
  20. <script>
  21. import { Group, Cell, Badge, XButton, Box, Icon, Toast, Loading } from 'vux'
  22. export default {
  23. name: 'setting',
  24. components: {
  25. Cell,
  26. Group,
  27. Badge,
  28. XButton,
  29. Box,
  30. Icon,
  31. Toast,
  32. Loading
  33. },
  34. data() {
  35. return {
  36. type: 1,
  37. showInfo: false,
  38. isLoading: false,
  39. loadingText: '',
  40. info: '',
  41. loaded: false,
  42. uid: ''
  43. }
  44. },
  45. mounted() {
  46. this.$services.print.get('printauth', null)
  47. .then(res => {
  48. this.type = res.data.printall
  49. })
  50. },
  51. methods: {
  52. onClick(val) {
  53. this.type = val;
  54. },
  55. save() {
  56. this.showInfo = true;
  57. this.info = '保存成功';
  58. }
  59. }
  60. }
  61. </script>
  62. <style>
  63. html, body {
  64. -webkit-touch-callout: none;
  65. -webkit-user-select: none;
  66. }
  67. .title {
  68. display: block;
  69. margin-bottom: -20px;
  70. text-align: left;
  71. padding: 10px 10px 0px 10px;
  72. color: #757575;
  73. font-size: 16px;
  74. }
  75. </style>