paymentRequest.vue 4.9 KB

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