main.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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. :close-on-click-modal="false"
  11. v-dialog-drag
  12. >
  13. <avue-crud
  14. :option="option"
  15. :table-loading="loading"
  16. :data="data"
  17. ref="crud"
  18. :page.sync="page"
  19. @current-change="currentChange"
  20. @size-change="sizeChange"
  21. :cell-style="cellStyle"
  22. >
  23. <template slot-scope="{ row }" slot="name">
  24. <el-tag style="cursor:pointer" @click="goReport(row.name)">{{
  25. row.name | nameFormat
  26. }}</el-tag>
  27. </template>
  28. </avue-crud>
  29. <span slot="footer" class="dialog-footer">
  30. <el-button @click="onClose()">关 闭</el-button>
  31. </span>
  32. </el-dialog>
  33. </template>
  34. <script>
  35. import { getList } from "@/api/report/report";
  36. import { nameReportFormat } from "@/filters/report";
  37. export default {
  38. data() {
  39. return {
  40. visible: false,
  41. loading: true,
  42. query: {},
  43. page: {
  44. pageSize: 10,
  45. currentPage: 1,
  46. total: 0
  47. },
  48. option: {
  49. addBtn: false,
  50. border: true,
  51. index: true,
  52. refreshBtn: false,
  53. menu: false,
  54. columnBtn: false,
  55. header: false,
  56. column: [
  57. {
  58. label: "文件名",
  59. prop: "name",
  60. overHidden: true
  61. },
  62. {
  63. label: "创建时间",
  64. prop: "createTime",
  65. overHidden: true
  66. },
  67. {
  68. label: "更新时间",
  69. prop: "updateTime",
  70. overHidden: true
  71. }
  72. ]
  73. },
  74. data: []
  75. };
  76. },
  77. props: {
  78. switchDialog: {
  79. type: Boolean,
  80. default: false
  81. },
  82. reportName: {
  83. type: String
  84. },
  85. reportId: {
  86. type: String
  87. },
  88. searchValue: {
  89. type: Object
  90. }
  91. },
  92. filters: {
  93. nameFormat(name) {
  94. return nameReportFormat(name);
  95. }
  96. },
  97. methods: {
  98. cellStyle() {
  99. return "padding:0;height:40px;";
  100. },
  101. onClose() {
  102. this.visible = false;
  103. Object.assign(this.$data, this.$options.data());
  104. this.$emit("onClose", false);
  105. },
  106. getList() {
  107. this.loading = true;
  108. getList(
  109. this.page.currentPage,
  110. this.page.pageSize,
  111. Object.assign(this.query)
  112. ).then(res => {
  113. const data = res.data.data;
  114. this.page.total = data.total;
  115. this.data = data.records;
  116. this.loading = false;
  117. if (this.page.total) {
  118. this.option.height = window.innerHeight - 350;
  119. }
  120. });
  121. },
  122. goReport(name) {
  123. console.log(name)
  124. let tenantId = this.$store.getters.userInfo.tenant_id;
  125. if (this.reportName == "同海-统计列表") {
  126. this.$router.push({
  127. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}
  128. &tenantId=${this.searchValue.tenantId}
  129. &status=${this.searchValue.status}
  130. &cornId=${this.searchValue.cornId}
  131. &deptid=${this.searchValue.deptid}
  132. &pname=${this.searchValue.pname}
  133. &projectType=${this.searchValue.projectType}
  134. &payStartTime=${this.searchValue.payStartTime}
  135. &payEndTime=${this.searchValue.payEndTime}
  136. &userName=${this.searchValue.userName}`
  137. });
  138. } else if (this.reportName == "进口贸易-提成统计表") {
  139. this.$router.push({
  140. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}
  141. &year=${this.searchValue.year}
  142. &quarter=${this.searchValue.quarter}
  143. &userType=${this.searchValue.userType}
  144. &userId=${this.searchValue.userId}
  145. &goodsId=${this.searchValue.goodsId}`
  146. });
  147. }
  148. // else if (name == "客户资料-客户资料.ureport.xml") {
  149. // this.$router.push({
  150. // path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}&id=${this.reportId}&tenantId=${tenantId}`,
  151. // query: {
  152. //
  153. // }
  154. // });
  155. // }
  156. else if (name == "国内贸易-库存账.ureport.xml") {
  157. this.$router.push({
  158. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}`,
  159. query: {
  160. code:this.searchValue.code,
  161. cname:this.searchValue.cname,
  162. brandItem:this.searchValue.brandItem,
  163. placeProduction:this.searchValue.placeProduction,
  164. typeno:this.searchValue.typeno,
  165. typenoOne:this.searchValue.typenoOne,
  166. typenoTwo:this.searchValue.typenoTwo,
  167. stockName:this.searchValue.stockName,
  168. brand:this.searchValue.brand,
  169. tenantId:tenantId,
  170. }
  171. });
  172. } else if (name == "国内贸易-客户确认.ureport.xml") {
  173. this.$router.push({
  174. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}`,
  175. query: {
  176. orgOrderNo: this.searchValue.orgOrderNo,
  177. corpId: this.searchValue.corpId,
  178. salesCompany: this.searchValue.salesCompany,
  179. businessStartDate: this.searchValue.businessStartDate,
  180. businessEndDate: this.searchValue.businessEndDate,
  181. storageId: this.searchValue.storageId,
  182. arrivalAddress:this.searchValue.arrivalAddress,
  183. arrivalContact: this.searchValue.arrivalContact,
  184. arrivalTel: this.searchValue.arrivalTel,
  185. createUser: this.searchValue.createUser,
  186. createTimeStart: this.searchValue.createTimeStart,
  187. createTimeEnd: this.searchValue.createTimeEnd,
  188. tenantId: tenantId,
  189. }
  190. });
  191. } else if (name == "经销商-可用库存表.ureport.xml") {
  192. this.$router.push({
  193. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}`,
  194. query: {
  195. tradeType: 'JXS',
  196. tenantId: tenantId,
  197. },
  198. });
  199. } else {
  200. let userId = JSON.parse(localStorage.getItem("saber-userInfo")).content
  201. .user_id;
  202. this.$router.push({
  203. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}`,
  204. query: {
  205. id: this.reportId,
  206. userId: userId,
  207. tenantId: tenantId,
  208. },
  209. });
  210. }
  211. this.$emit("onClose", false);
  212. }
  213. },
  214. watch: {
  215. switchDialog: function(i) {
  216. this.visible = i;
  217. this.query = {
  218. name: this.reportName ? this.reportName : this.$router.currentRoute.name
  219. };
  220. if (i) {
  221. this.getList();
  222. }
  223. }
  224. }
  225. };
  226. </script>
  227. <style lang="scss" scoped></style>