receiptSettle.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <basic-container v-if="show">
  3. <avue-crud :option="option"
  4. :data="dataList"
  5. ref="crud"
  6. v-model="form"
  7. :page.sync="page"
  8. :search.sync="search"
  9. :table-loading="loading"
  10. @search-change="searchChange"
  11. @search-reset="searchReset"
  12. @selection-change="selectionChange"
  13. @current-change="currentChange"
  14. @size-change="sizeChange"
  15. @refresh-change="refreshChange"
  16. @on-load="onLoad">
  17. <template slot="corpIdSearch">
  18. <select-component
  19. v-model="search.corpId"
  20. :configuration="configuration"
  21. ></select-component>
  22. </template>
  23. <template slot="menuLeft">
  24. <el-button type="primary"
  25. size="small"
  26. icon="el-icon-plus"
  27. @click="addReceipt">新 单
  28. </el-button>
  29. <el-button size="small"
  30. type="info"
  31. @click.stop="openReport()"
  32. >导出报表
  33. </el-button>
  34. </template>
  35. <template slot-scope="scope" slot="menu">
  36. <el-button
  37. type="text"
  38. size="small"
  39. @click.stop="editOpen(scope.row, 2)"
  40. >编辑
  41. </el-button>
  42. <el-button
  43. type="text"
  44. size="small"
  45. @click.stop="rowDel(scope.row, scope.index)"
  46. >删除
  47. </el-button>
  48. </template>
  49. </avue-crud>
  50. </basic-container>
  51. <detail-page
  52. ref="detail"
  53. @goBack="goBack"
  54. :detailData="detailData"
  55. v-else
  56. ></detail-page>
  57. </template>
  58. <script>
  59. import option from "./configuration/mainList.json";
  60. import {getList ,remove} from "@/api/financialManagement/financialManagement"
  61. import detailPage from "./receiptSettleDetailsPage.vue";
  62. export default {
  63. data() {
  64. return {
  65. loading : false,
  66. form: {},
  67. search:{},
  68. option: option,
  69. parentId:0,
  70. show:true,
  71. detailData:{},
  72. dataList: [{
  73. canem:""
  74. }],
  75. page: {
  76. pageSize: 10,
  77. pagerCount: 5,
  78. total: 0,
  79. },
  80. query:{},
  81. configuration:{
  82. multipleChoices:false,
  83. multiple:false,
  84. disabled:false,
  85. searchShow:true,
  86. collapseTags:false,
  87. clearable:true,
  88. placeholder:'请点击右边按钮选择',
  89. dicData:[]
  90. },
  91. }
  92. },
  93. components:{
  94. detailPage
  95. },
  96. created() {
  97. if(this.$route.query.params){
  98. this.detailData={
  99. params:this.$route.query.params
  100. }
  101. this.show = false;
  102. this.$store.commit("RECE_IN_DETAIL");
  103. }
  104. },
  105. mounted() {
  106. this.option.height = window.innerHeight - 310;
  107. let i = 0;
  108. this.option.column.forEach(item => {
  109. if (item.search) i++
  110. })
  111. if (i % 4 !== 0){
  112. const num = 4 - Number(i % 4)
  113. this.option.searchMenuSpan = num * 8;
  114. this.option.searchMenuPosition = "right";
  115. }
  116. },
  117. methods: {
  118. //新单打开
  119. addReceipt(row){
  120. this.detailData = {
  121. id: row.id,
  122. status: 1
  123. };
  124. this.show = false;
  125. },
  126. //编辑打开
  127. editOpen(row,status){
  128. this.detailData = {
  129. id: row.id,
  130. status: status
  131. };
  132. this.show = false;
  133. },
  134. rowDel(row, index, done) {
  135. if(row.id){
  136. this.$confirm("确定将选择数据删除?", {
  137. confirmButtonText: "确定",
  138. cancelButtonText: "取消",
  139. type: "warning"
  140. }).then(() => {
  141. remove(row.id).then(res =>{
  142. if(res.data.success){
  143. this.$message.success("操作成功!");
  144. this.onLoad(this.page);
  145. }
  146. })
  147. });
  148. }
  149. },
  150. //点击搜索按钮触发
  151. searchChange(params, done) {
  152. this.query = params;
  153. this.page.currentPage = 1;
  154. this.onLoad(this.page, params);
  155. done()
  156. },
  157. searchReset() {
  158. console.log('1')
  159. },
  160. selectionChange() {
  161. console.log('1')
  162. },
  163. currentChange() {
  164. console.log('1')
  165. },
  166. sizeChange() {
  167. console.log('1')
  168. },
  169. refreshChange() {
  170. console.log('1')
  171. },
  172. onLoad(page, params = {}) {
  173. if (params.settlementDate != undefined) { //合同
  174. params.settlementStartDate = params.settlementDate[0]+ " " + "00:00:00";
  175. params.settlementEndDate = params.settlementDate[1] + " " + "23:59:59";
  176. this.$delete(params,'settlementDate')
  177. }
  178. params.billType = "收费"
  179. this.loading = true
  180. getList(page.currentPage, page.pageSize,params).then(res =>{
  181. this.dataList = res.data.data.records
  182. this.page.total = res.data.data.total
  183. this.loading = false
  184. })
  185. },
  186. goBack() {
  187. this.detailData=this.$options.data().detailData
  188. this.show = true;
  189. }
  190. }
  191. }
  192. </script>
  193. <style scoped>
  194. </style>