detail.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <div>
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  6. @click="backToList">返回列表
  7. </el-button>
  8. </div>
  9. </div>
  10. <basic-container class="page-crad" style="margin-top: 30px">
  11. <avue-crud
  12. ref="crud"
  13. :option="option"
  14. :data="dataList"
  15. :table-loading="loading"
  16. :cell-style="cellStyle"
  17. :key="crudIndex"
  18. >
  19. <template slot="menuLeft">
  20. <el-button type="info" size="small" @click="outExport" icon="el-icon-download">导出</el-button>
  21. </template>
  22. <template slot="accSysNo" slot-scope="scope">
  23. <span style="color: #409EFF;cursor: pointer" @click.stop="jumpPage(scope.row,scope.index)">{{ scope.row.accSysNo }}</span>
  24. </template>
  25. </avue-crud>
  26. </basic-container>
  27. </div>
  28. </template>
  29. <script>
  30. import {detail} from "@/api/statisticAnalysis/profitLedger";
  31. import { getToken } from "@/util/auth";
  32. export default {
  33. name: "detail",
  34. props: {
  35. detailData: {
  36. type: Object
  37. },
  38. tradeType: {
  39. type: [Number, String]
  40. }
  41. },
  42. data() {
  43. return {
  44. crudIndex: 0,
  45. dataList: [],
  46. loading: false,
  47. option: {
  48. searchShow: true,
  49. align: "center",
  50. searchSpan: 8,
  51. border: true,
  52. index: true,
  53. addBtn: false,
  54. viewBtn: false,
  55. editBtn: false,
  56. delBtn: false,
  57. cellBtn: false,
  58. cancelBtn: false,
  59. refreshBtn: false,
  60. showSummary: true,
  61. summaryText: '合计',
  62. sumColumnList: [
  63. {
  64. name: 'amount',
  65. type: 'sum'
  66. },
  67. {
  68. name: 'settlementAmount',
  69. type: 'sum'
  70. },
  71. {
  72. name: 'outstandingAmount',
  73. type: 'sum'
  74. },
  75. ],
  76. searchIcon: true,
  77. searchIndex: 2,
  78. menu: false,
  79. column: [
  80. {
  81. label: "单据来源",
  82. prop: "billType",
  83. overHidden: true,
  84. },
  85. {
  86. label: "结算单位",
  87. prop: "corpName",
  88. overHidden: true,
  89. },
  90. {
  91. label: "订单号",
  92. prop: "accSysNo",
  93. overHidden: true,
  94. },
  95. {
  96. label: "费用名称",
  97. prop: "itemName",
  98. overHidden: true,
  99. },
  100. {
  101. label: "单价",
  102. prop: "price",
  103. overHidden: true,
  104. },
  105. {
  106. label: "账单金额",
  107. prop: "amount",
  108. overHidden: true,
  109. },
  110. {
  111. label: "结算金额",
  112. prop: "settlementAmount",
  113. overHidden: true,
  114. },
  115. {
  116. label: "币别",
  117. prop: "currency",
  118. overHidden: true,
  119. },
  120. {
  121. label: "汇率",
  122. prop: "exchangeRate",
  123. overHidden: true,
  124. },
  125. ],
  126. },
  127. }
  128. },
  129. created() {
  130. if (this.detailData.id) {
  131. this.queryData(this.detailData.id);
  132. }
  133. },
  134. methods: {
  135. cellStyle() {
  136. return "padding:0;height:40px;";
  137. },
  138. queryData(id) {
  139. this.loading = true;
  140. detail(id, this.tradeType).then(res => {
  141. this.dataList = res.data.data.records;
  142. }).finally(() => {
  143. this.loading = false;
  144. this.option.height = window.innerHeight - 180;
  145. this.crudIndex++;
  146. })
  147. },
  148. backToList() {
  149. this.$emit("goBack");
  150. },
  151. //导出
  152. outExport() {
  153. this.$confirm('是否导出应付总账详情信息?', '提示', {
  154. confirmButtonText: '确定',
  155. cancelButtonText: '取消',
  156. type: 'warning'
  157. }).then(() => {
  158. window.open(
  159. `/api/trade-finance/profit/exportItem?${
  160. this.website.tokenHeader
  161. }=${getToken()}&$tradeType=${this.tradeType}&corpId=${this.detailData.id}`
  162. );
  163. }).catch(() => {
  164. this.$message({
  165. type: 'info',
  166. message: '已取消' //
  167. });
  168. })
  169. },
  170. // 跳转页面
  171. jumpPage(row, index) {
  172. if (row.billType == '申请') {
  173. if (this.tradeType == '' || this.tradeType == 'JXS') {
  174. this.$router.$avueRouter.closeTag("/dealer/purchase/index");
  175. this.$router.push({
  176. path: "/dealer/purchase/index",
  177. query: {
  178. params: row.srcParentId
  179. },
  180. });
  181. }
  182. } else if (row.billType == '收费') {
  183. if (this.tradeType == '' || this.tradeType == 'JXS') {
  184. this.$router.$avueRouter.closeTag("/dealer/sales/index");
  185. this.$router.push({
  186. path: "/dealer/sales/index",
  187. query: {
  188. params: row.srcParentId
  189. },
  190. });
  191. }
  192. }
  193. },
  194. },
  195. }
  196. </script>
  197. <style scoped>
  198. </style>