main.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <el-dialog
  3. title="提报列表"
  4. :visible.sync="visible"
  5. top="5vh"
  6. width="60%"
  7. :before-close="onClose"
  8. append-to-body
  9. class="el-dialogDeep"
  10. v-dialog-drag
  11. >
  12. <avue-crud
  13. :option="option"
  14. :table-loading="loading"
  15. :data="data"
  16. ref="crud"
  17. :page.sync="page"
  18. @current-change="currentChange"
  19. @size-change="sizeChange"
  20. :cell-style="cellStyle"
  21. >
  22. <template slot-scope="{ row }" slot="name">
  23. <el-tag style="cursor:pointer" @click="goReport(row.name)">{{
  24. row.name | nameFormat
  25. }}</el-tag>
  26. </template>
  27. </avue-crud>
  28. <span slot="footer" class="dialog-footer">
  29. <el-button @click="onClose()">关 闭</el-button>
  30. </span>
  31. </el-dialog>
  32. </template>
  33. <script>
  34. import { getList } from "@/api/report/report";
  35. import { nameReportFormat } from "@/filters/report";
  36. export default {
  37. data() {
  38. return {
  39. visible: false,
  40. loading: true,
  41. query: {},
  42. page: {
  43. pageSize: 10,
  44. currentPage: 1,
  45. total: 0
  46. },
  47. option: {
  48. addBtn: false,
  49. border: true,
  50. index: true,
  51. refreshBtn: false,
  52. menu: false,
  53. columnBtn: false,
  54. header: false,
  55. column: [
  56. {
  57. label: "文件名",
  58. prop: "name",
  59. overHidden: true
  60. },
  61. {
  62. label: "创建时间",
  63. prop: "createTime",
  64. overHidden: true
  65. },
  66. {
  67. label: "更新时间",
  68. prop: "updateTime",
  69. overHidden: true
  70. }
  71. ]
  72. },
  73. data: []
  74. };
  75. },
  76. props: {
  77. switchDialog: {
  78. type: Boolean,
  79. default: false
  80. },
  81. reportName: {
  82. type: String
  83. },
  84. reportId: {
  85. type: String
  86. },
  87. searchValue:{
  88. type:Object
  89. }
  90. },
  91. filters: {
  92. nameFormat(name) {
  93. return nameReportFormat(name);
  94. }
  95. },
  96. methods: {
  97. cellStyle() {
  98. return "padding:0;height:40px;";
  99. },
  100. onClose() {
  101. this.visible = false;
  102. Object.assign(this.$data, this.$options.data());
  103. this.$emit("onClose", false);
  104. },
  105. getList() {
  106. this.loading = true;
  107. getList(
  108. this.page.currentPage,
  109. this.page.pageSize,
  110. Object.assign(this.query)
  111. ).then(res => {
  112. const data = res.data.data;
  113. this.page.total = data.total;
  114. this.data = data.records;
  115. this.loading = false;
  116. if (this.page.total) {
  117. this.option.height = window.innerHeight - 350;
  118. }
  119. });
  120. },
  121. goReport(name) {
  122. let tenantId = this.$store.getters.userInfo.tenant_id
  123. if(this.reportName == "同海-统计列表"){
  124. this.$router.push({
  125. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}
  126. &tenantId=${this.searchValue.tenantId}
  127. &status=${this.searchValue.status}
  128. &cornId=${this.searchValue.cornId}
  129. &deptid=${this.searchValue.deptid}
  130. &pname=${this.searchValue.pname}
  131. &projectType=${this.searchValue.projectType}
  132. &payStartTime=${this.searchValue.payStartTime}
  133. &payEndTime=${this.searchValue.payEndTime}
  134. &userName=${this.searchValue.userName}`
  135. });
  136. }else if(name == "客户资料-客户资料.ureport.xml"){
  137. this.$router.push({
  138. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}&id=${this.reportId}&tenantId=${tenantId}`
  139. });
  140. }else if(name == "国内贸易-库存账.ureport.xml"){
  141. this.$router.push({
  142. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}&id=${this.reportId}
  143. &code=${this.searchValue.code}
  144. &cname=${this.searchValue.cname}
  145. &brandItem=${this.searchValue.brandItem}
  146. &placeProduction=${this.searchValue.placeProduction}
  147. &typeno=${this.searchValue.typeno}
  148. &typenoOne=${this.searchValue.typenoOne}
  149. &typenoTwo=${this.searchValue.typenoTwo}
  150. &stockName=${this.searchValue.stockName}
  151. &brand=${this.searchValue.brand}
  152. &tenantId=${tenantId}`
  153. });
  154. }else{
  155. this.$router.push({
  156. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}&id=${this.reportId}`
  157. });
  158. }
  159. this.$emit("onClose", false);
  160. }
  161. },
  162. watch: {
  163. switchDialog: function(i) {
  164. this.visible = i;
  165. this.query = {
  166. name: this.reportName ? this.reportName : this.$router.currentRoute.name
  167. };
  168. if (i) {
  169. this.getList();
  170. }
  171. }
  172. }
  173. };
  174. </script>
  175. <style lang="scss" scoped></style>