index.blade.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. @extends('layouts.base')
  2. @section('title','打印设置')
  3. @section('content')
  4. <link rel="stylesheet" type="text/css"
  5. href="{{resource_get('plugins/electronics-bill/src/common/static/css/electronics-bill.css', 1)}}"/>
  6. <div id="app">
  7. <div class="electronics-div">
  8. <span>打印设置</span>
  9. <div id="install">
  10. <span>打印控件下载</span>
  11. <span><a href="{{resource_get('plugins/electronics-bill/src/common/lodop/CLodop_Setup_for_Win32NT.exe', 1)}}">CLodop_Setup_for_Win32NT.exe</a></span>
  12. <span><a href="{{resource_get('plugins/electronics-bill/src/common/lodop/install_lodop32.exe', 1)}}">install_lodop32.exe(请根据操作系统位数选择下载)</a></span>
  13. <span><a href="{{resource_get('plugins/electronics-bill/src/common/lodop/install_lodop64.exe', 1)}}">install_lodop64.exe(请根据操作系统位数选择下载)</a></span>
  14. <span style="color: red">提示:请在连有打印的电脑上安装控件并进行打印</span>
  15. </div>
  16. <div class="electronics-table">
  17. <el-form ref="form" label-width="150px" style="width: 60%">
  18. <el-form-item label="本地打印机IP">
  19. <el-input v-model="set.ip"></el-input>
  20. </el-form-item>
  21. <el-form-item label="打印机端口">
  22. <el-input v-model="set.port"></el-input>
  23. </el-form-item>
  24. <el-form-item label="打印机名称">
  25. <el-input v-model="set.name"></el-input>
  26. </el-form-item>
  27. </el-form>
  28. </div>
  29. </div>
  30. <div class="electronics-div" style="padding-bottom: 200px">
  31. <span>芸签 APIkey</span>
  32. <div class="electronics-table">
  33. <el-form ref="form" label-width="150px" style="width: 60%">
  34. <el-form-item label="APPID">
  35. <el-input v-model="set.apikey"></el-input>
  36. </el-form-item>
  37. <el-form-item label="APPSecret">
  38. <el-input v-model="set.app_secret"></el-input>
  39. </el-form-item>
  40. <el-form-item>
  41. <p>接口总数:[[set.yun_form.apiTotalCount]] 单;接口使用总数: [[set.yun_form.statistics]] 单;接口剩余总数:[[set.yun_form.apiTotalCount - set.yun_form.statistics]] 单;到期时间:[[set.yun_form.endDate]]</p>
  42. </el-form-item>
  43. </el-form>
  44. </div>
  45. </div>
  46. <div class="confirm-btn">
  47. <el-button type="primary" @click="submit()">提交</el-button>
  48. </div>
  49. </div>
  50. <script>
  51. var detail_url = '{!! yzWebFullUrl('plugin.electronics-bill.admin.set.detail') !!}';
  52. var submit_url = '{!! yzWebFullUrl('plugin.electronics-bill.admin.set.save') !!}'
  53. var app = new Vue({
  54. el: '#app',
  55. delimiters: ['[[', ']]'],
  56. data() {
  57. return {
  58. set: {
  59. ip: '',
  60. port: '',
  61. name: '',
  62. apikey: '',
  63. app_secret: '',
  64. yun_form:{
  65. apiTotalCount:0,
  66. statistics:0,
  67. apiTotalPrice:0
  68. }
  69. }
  70. }
  71. },
  72. created() {
  73. },
  74. mounted() {
  75. this.getData();
  76. },
  77. methods: {
  78. getData() {
  79. let loading = this.$loading({
  80. target: document.querySelector(".content"),
  81. background: 'rgba(0, 0, 0, 0)'
  82. });
  83. this.$http.get(detail_url).then(function (res) {
  84. if (res.data.result == 1) {
  85. if (res.data.data != false) {
  86. this.set = res.data.data;
  87. }
  88. } else {
  89. this.$message({message: res.data.msg, type: 'error'});
  90. }
  91. loading.close();
  92. }, function (err) {
  93. this.$message({
  94. message: err.data.msg,
  95. type: 'error'
  96. });
  97. loading.close();
  98. })
  99. },
  100. submit() {
  101. let that = this;
  102. let loading = that.$loading({
  103. target: document.querySelector(".content"),
  104. background: 'rgba(0, 0, 0, 0)'
  105. });
  106. let set = {
  107. ip: that.set.ip,
  108. port: that.set.port,
  109. name: that.set.name,
  110. apikey: that.set.apikey,
  111. app_secret: that.set.app_secret,
  112. };
  113. that.$http.post(submit_url, {'set': set}).then(function (res) {
  114. if (res.data.result == 1) {
  115. that.$message({message: res.data.msg, type: 'success'});
  116. } else {
  117. let tips = '';
  118. if (res.data.msg instanceof Object) {
  119. for (let key in res.data.msg) {
  120. tips += res.data.msg[key][0];
  121. }
  122. }
  123. that.$message({
  124. message: tips ? tips : res.data.msg,
  125. type: 'error'
  126. });
  127. }
  128. loading.close();
  129. }, function (err) {
  130. that.$message({
  131. message: err.data.msg,
  132. type: 'error'
  133. });
  134. loading.close();
  135. });
  136. },
  137. },
  138. });
  139. </script>
  140. @endsection