main.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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. } else if (name == "客户资料-客户资料.ureport.xml") {
  148. this.$router.push({
  149. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}&id=${this.reportId}&tenantId=${tenantId}`
  150. });
  151. } else if (name == "国内贸易-库存账.ureport.xml") {
  152. this.$router.push({
  153. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}
  154. &code=${this.searchValue.code}
  155. &cname=${this.searchValue.cname}
  156. &brandItem=${this.searchValue.brandItem}
  157. &placeProduction=${this.searchValue.placeProduction}
  158. &typeno=${this.searchValue.typeno}
  159. &typenoOne=${this.searchValue.typenoOne}
  160. &typenoTwo=${this.searchValue.typenoTwo}
  161. &stockName=${this.searchValue.stockName}
  162. &brand=${this.searchValue.brand}
  163. &tenantId=${tenantId}`
  164. });
  165. } else if (name == "国内贸易-客户确认.ureport.xml") {
  166. this.$router.push({
  167. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}
  168. &orgOrderNo=${this.searchValue.orgOrderNo}
  169. &corpId=${this.searchValue.corpId}
  170. &salesCompany=${this.searchValue.salesCompany}
  171. &businessStartDate=${this.searchValue.businessStartDate}
  172. &businessEndDate=${this.searchValue.businessEndDate}
  173. &storageId=${this.searchValue.storageId}
  174. &arrivalAddress=${this.searchValue.arrivalAddress}
  175. &arrivalContact=${this.searchValue.arrivalContact}
  176. &arrivalTel=${this.searchValue.arrivalTel}
  177. &createUser=${this.searchValue.createUser}
  178. &createTimeStart=${this.searchValue.createTimeStart}
  179. &createTimeEnd=${this.searchValue.createTimeEnd}
  180. &tenantId=${tenantId}`
  181. });
  182. } else if (name == "经销商-可用库存表.ureport.xml") {
  183. this.$router.push({
  184. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}&tradeType=JXS&tenantId=${tenantId}`
  185. });
  186. } else {
  187. let userId = JSON.parse(localStorage.getItem("saber-userInfo")).content
  188. .user_id;
  189. this.$router.push({
  190. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}&id=${this.reportId}&userId=${userId}&tenantId=${tenantId}`
  191. });
  192. }
  193. this.$emit("onClose", false);
  194. }
  195. },
  196. watch: {
  197. switchDialog: function(i) {
  198. this.visible = i;
  199. this.query = {
  200. name: this.reportName ? this.reportName : this.$router.currentRoute.name
  201. };
  202. if (i) {
  203. this.getList();
  204. }
  205. }
  206. }
  207. };
  208. </script>
  209. <style lang="scss" scoped></style>