应用层PC端前端服务

sealManage.vue 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <div>
  3. <el-dialog title="公章列表" :visible="sealVisable" @close="cancel" width="800px" center :distroy-on-close="true">
  4. <el-table v-loading="loading" :data="dataList" style="width: 100%">
  5. <el-table-column label="序号" type="index" align="center">
  6. <template slot-scope="scope">
  7. <span>{{
  8. (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
  9. }}</span>
  10. </template>
  11. </el-table-column>
  12. <el-table-column label="印章名称" align="center" prop="sealName"
  13. :show-overflow-tooltip="true"></el-table-column>
  14. <el-table-column label="印章图片" align="center" prop="annexPath">
  15. <template slot-scope="scope">
  16. <el-image style="width: 40px; height: 40px;" :src="imgUrl + scope.row.annexPath"
  17. :preview-src-list="[imgUrl + scope.row.annexPath]">
  18. </el-image>
  19. <!-- <span>{{ imgUrl + scope.row.annexPath }}</span> -->
  20. </template>
  21. </el-table-column>
  22. <el-table-column label="是否启用" align="center" prop="sealStatus">
  23. <template slot-scope="scope">
  24. <el-tag type="success" v-if="scope.row.isUse == 1">已启用</el-tag>
  25. <el-tag type="info"
  26. v-if="(scope.row.isUse == 0 || scope.row.isUse == null) && scope.row.sealStatus !== 0">未启用</el-tag>
  27. <el-tag type="danger" v-if="scope.row.sealStatus == 0">审核中</el-tag>
  28. </template>
  29. </el-table-column>
  30. <el-table-column label="操作" align="center">
  31. <template slot-scope="scope">
  32. <el-button size="mini" @click="isUseChange(scope.row.id, 1)" type="text" icon="el-icon-thumb"
  33. v-if="(scope.row.isUse == 0 || scope.row.isUse == null) && scope.row.sealStatus !== 0">启用</el-button>
  34. <el-button size="mini" @click="isUseChange(scope.row.id, 0)" type="text" icon="el-icon-thumb"
  35. v-if="scope.row.isUse == 1">禁用</el-button>
  36. </template>
  37. </el-table-column>
  38. </el-table>
  39. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
  40. :limit.sync="queryParams.pageSize" @pagination="sealListFn(queryParams)" />
  41. </el-dialog>
  42. </div>
  43. </template>
  44. <script>
  45. import {
  46. sealList,
  47. updateSealLockStatus
  48. } from "@/api/officialSeal/officialSeal.js";
  49. export default {
  50. props: ["sealVisable", "sealData"],
  51. data() {
  52. return {
  53. loading: false,
  54. srcList: [],
  55. queryParams: {
  56. pageNum: 1,
  57. pageSize: 10,
  58. },
  59. dataList: [
  60. ],
  61. total: 0,
  62. imgUrl: ""
  63. };
  64. },
  65. watch: {
  66. sealVisable(val) {
  67. if (val) {
  68. this.queryParams.id = this.sealData.id;
  69. this.sealListFn(this.queryParams)
  70. }
  71. }
  72. },
  73. created() {
  74. this.UploadUrl()
  75. },
  76. methods: {
  77. UploadUrl() {
  78. this.imgUrl = window.location.origin + '/API';
  79. },
  80. // 查询列表数据
  81. sealListFn(data) {
  82. this.loading = true;
  83. sealList(data).then(res => {
  84. this.dataList = res.rows;
  85. this.total = res.total;
  86. this.loading = false;
  87. })
  88. },
  89. // 更新公章状态
  90. updateSealLockStatusFn(data) {
  91. updateSealLockStatus(data).then(res => {
  92. this.$message.success('更新状态成功');
  93. this.sealListFn(this.queryParams);
  94. })
  95. },
  96. // 启用或者禁用公章
  97. isUseChange(id, type) {
  98. let params = {
  99. id: id,
  100. isUse: type
  101. }
  102. this.$modal
  103. .confirm("是否更改状态")
  104. .then((res) => {
  105. this.updateSealLockStatusFn(params);
  106. })
  107. },
  108. cancel() {
  109. this.$emit("cancelSeal");
  110. },
  111. },
  112. };
  113. </script>
  114. <style lang="scss" scoped></style>