main.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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. corpType: {
  92. type: String
  93. }
  94. },
  95. filters: {
  96. nameFormat(name) {
  97. return nameReportFormat(name);
  98. }
  99. },
  100. methods: {
  101. cellStyle() {
  102. return "padding:0;height:40px;";
  103. },
  104. onClose() {
  105. this.visible = false;
  106. Object.assign(this.$data, this.$options.data());
  107. this.$emit("onClose", false);
  108. },
  109. getList() {
  110. this.loading = true;
  111. getList(
  112. this.page.currentPage,
  113. this.page.pageSize,
  114. Object.assign(this.query)
  115. ).then(res => {
  116. const data = res.data.data;
  117. this.page.total = data.total;
  118. this.data = data.records;
  119. this.loading = false;
  120. if (this.page.total) {
  121. this.option.height = window.innerHeight - 350;
  122. }
  123. });
  124. },
  125. goReport(name) {
  126. let tenantId = this.$store.getters.userInfo.tenant_id;
  127. if (this.reportName == "同海-统计列表") {
  128. this.$router.push({
  129. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}
  130. &tenantId=${this.searchValue.tenantId}
  131. &status=${this.searchValue.status}
  132. &cornId=${this.searchValue.cornId}
  133. &deptid=${this.searchValue.deptid}
  134. &pname=${this.searchValue.pname}
  135. &projectType=${this.searchValue.projectType}
  136. &payStartTime=${this.searchValue.payStartTime}
  137. &payEndTime=${this.searchValue.payEndTime}
  138. &userName=${this.searchValue.userName}`
  139. });
  140. } else if (this.reportName == "进口贸易-提成统计表") {
  141. this.$router.push({
  142. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}
  143. &year=${this.searchValue.year}
  144. &quarter=${this.searchValue.quarter}
  145. &userType=${this.searchValue.userType}
  146. &userId=${this.searchValue.userId}
  147. &goodsId=${this.searchValue.goodsId}`
  148. });
  149. }
  150. // else if (name == "客户资料-客户资料.ureport.xml") {
  151. // this.$router.push({
  152. // path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}&id=${this.reportId}&tenantId=${tenantId}`,
  153. // query: {
  154. //
  155. // }
  156. // });
  157. // }
  158. else if (name == "国内贸易-库存账.ureport.xml") {
  159. this.$router.push({
  160. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}`,
  161. query: {
  162. code: this.searchValue.code,
  163. cname: this.searchValue.cname,
  164. brandItem: this.searchValue.brandItem,
  165. placeProduction: this.searchValue.placeProduction,
  166. typeno: this.searchValue.typeno,
  167. typenoOne: this.searchValue.typenoOne,
  168. typenoTwo: this.searchValue.typenoTwo,
  169. stockName: this.searchValue.stockName,
  170. brand: this.searchValue.brand,
  171. tenantId: tenantId
  172. }
  173. });
  174. } else if (name == "国内贸易-客户确认.ureport.xml") {
  175. this.$router.push({
  176. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}`,
  177. query: {
  178. orgOrderNo: this.searchValue.orgOrderNo,
  179. corpId: this.searchValue.corpId,
  180. salesCompany: this.searchValue.salesCompany,
  181. businessStartDate: this.searchValue.businessStartDate,
  182. businessEndDate: this.searchValue.businessEndDate,
  183. storageId: this.searchValue.storageId,
  184. arrivalAddress: this.searchValue.arrivalAddress,
  185. arrivalContact: this.searchValue.arrivalContact,
  186. arrivalTel: this.searchValue.arrivalTel,
  187. createUser: this.searchValue.createUser,
  188. createTimeStart: this.searchValue.createTimeStart,
  189. createTimeEnd: this.searchValue.createTimeEnd,
  190. tenantId: tenantId
  191. }
  192. });
  193. } else if (name == "经销商-可用库存表.ureport.xml") {
  194. this.$router.push({
  195. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}`,
  196. query: {
  197. tradeType: "JXS",
  198. tenantId: tenantId
  199. }
  200. });
  201. } else if (name == "客户信息.ureport.xml") {
  202. let userId = JSON.parse(localStorage.getItem("saber-userInfo")).content
  203. .user_id;
  204. this.$router.push({
  205. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}`,
  206. query: {
  207. id: this.reportId,
  208. userId: userId,
  209. tenantId: tenantId,
  210. corpType: this.corpType
  211. }
  212. });
  213. } else if (name == "经销商-采购单.ureport.xml") {
  214. this.$router.push({
  215. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}`,
  216. query: {
  217. id: this.reportId,
  218. tradeType: "JXS",
  219. tenantId: tenantId
  220. }
  221. });
  222. } else {
  223. let userId = JSON.parse(localStorage.getItem("saber-userInfo")).content
  224. .user_id;
  225. this.$router.push({
  226. path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}`,
  227. query: {
  228. id: this.reportId,
  229. userId: userId,
  230. tenantId: tenantId
  231. }
  232. });
  233. }
  234. this.$emit("onClose", false);
  235. }
  236. },
  237. watch: {
  238. switchDialog: function(i) {
  239. this.visible = i;
  240. this.query = {
  241. name: this.reportName ? this.reportName : this.$router.currentRoute.name
  242. };
  243. if (i) {
  244. this.getList();
  245. }
  246. }
  247. }
  248. };
  249. </script>
  250. <style lang="scss" scoped></style>