option.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <fieldset>
  3. <legend>
  4. <el-tag type="info">按需操作</el-tag>
  5. </legend>
  6. <div class="op-header">
  7. <div class="left-panel">
  8. <el-button type="primary" icon="el-icon-plus" @click="table_add()">新增打印机</el-button>
  9. <el-button type="warning" icon="el-icon-refresh" @click="table_refresh()">查询状态</el-button>
  10. </div>
  11. </div>
  12. </fieldset>
  13. <formMain ref="formMain" @success="handleSuccess"></formMain>
  14. </template>
  15. <script>
  16. import formMain from './form';
  17. export default {
  18. components: {
  19. formMain
  20. },
  21. props: {
  22. type: { type: String, default: "1" },
  23. dataSelect: { type: Array, default: () => [] },
  24. searchKey: { type: Object, default: () => {} },
  25. dataSelectFull: { type: Array, default: () => [] }
  26. },
  27. data(){
  28. return {
  29. }
  30. },
  31. methods: {
  32. async table_refresh(){
  33. var loading = this.$loading();
  34. var resp = await this.$API.print.refresh.post({});
  35. loading.close();
  36. if (resp.code == 0) {
  37. return this.$message.error(resp.msg);
  38. }
  39. this.$message.success(resp.msg);
  40. },
  41. table_add(){
  42. this.$nextTick(() => {
  43. this.$refs.formMain.open()
  44. })
  45. },
  46. handleSuccess(){
  47. this.$emit("success");
  48. },
  49. }
  50. }
  51. </script>