settleAccounts.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <div>
  3. <basic-container v-show="show">
  4. <avue-crud
  5. ref="crud"
  6. :data="data"
  7. :option="option"
  8. :page.sync="page"
  9. :search.sync="search"
  10. :table-loading="loading"
  11. @row-del="rowDel"
  12. @size-change="sizeChange"
  13. @current-change="currentChange"
  14. @search-change="searchChange"
  15. @refresh-change="refreshChange"
  16. @on-load="getList"
  17. @saveColumn="saveColumn"
  18. >
  19. <template slot="corpIdSearch">
  20. <select-component
  21. v-model="search.corpId"
  22. :configuration="configuration"
  23. ></select-component>
  24. </template>
  25. <template slot="userNameSearch">
  26. <el-select
  27. v-model="search.userName"
  28. multiple
  29. filterable
  30. remote
  31. reserve-keyword
  32. :remote-method="remoteMethod">
  33. <el-option
  34. v-for="item in options"
  35. :key="item.value"
  36. :label="item.label"
  37. :value="item.value">
  38. </el-option>
  39. </el-select>
  40. </template>
  41. <template slot-scope="{row,index}" slot="menuLeft">
  42. <el-button
  43. icon="el-icon-printer"
  44. size="small"
  45. type="primary"
  46. @click.stop=""
  47. >报 表
  48. </el-button>
  49. </template>
  50. <template slot-scope="scope" slot="menu">
  51. <el-button
  52. type="text"
  53. icon="el-icon-edit"
  54. size="small"
  55. @click.stop="settleAccounts(scope.row, scope.index)"
  56. >编 辑
  57. </el-button>
  58. </template>
  59. </avue-crud>
  60. </basic-container>
  61. <detail-page
  62. v-if="!show"
  63. ref="detail"
  64. @goBack="goBack"
  65. :detailData="detailData"
  66. ></detail-page>
  67. </div>
  68. </template>
  69. <script>
  70. import option from "./configuration/settleAccounts.json";
  71. import { getList } from "@/api/workManagement/mainProject";
  72. import detailPage from "./settleAccountsDetailsPage.vue";
  73. export default {
  74. data() {
  75. return {
  76. loading: false,
  77. show:true,
  78. detailData:{},
  79. data: [],
  80. option: option,
  81. search:{},
  82. configuration:{
  83. multipleChoices:false,
  84. multiple:false,
  85. disabled:false,
  86. searchShow:true,
  87. collapseTags:false,
  88. clearable:true,
  89. placeholder:'请点击右边按钮选择',
  90. dicData:[]
  91. },
  92. page: {
  93. currentPage: 1,
  94. total: 0,
  95. pageSize: 10
  96. }
  97. };
  98. },
  99. components:{
  100. detailPage
  101. },
  102. mounted() {
  103. // option.height = window.innerHeight - 340 ;
  104. },
  105. methods: {
  106. getList(page,params={}) {
  107. this.loading = true;
  108. params.flag = 1;
  109. if(params){
  110. if (params.createTime != undefined && params.createTime.length !=0) { //发货
  111. params.createStartDate = params.createTime[0]+ " " + "00:00:00";
  112. params.createEndDate = params.createTime[1] + " " + "23:59:59";
  113. this.$delete(params,'createTime')
  114. }
  115. }
  116. getList(page.currentPage, page.pageSize,params).then(res =>{
  117. this.data = res.data.data.records
  118. this.page.total = res.data.data.total
  119. this.loading = false
  120. })
  121. },
  122. //结算
  123. settleAccounts(row){
  124. this.detailData = {
  125. id: row.id
  126. };
  127. this.show = false;
  128. },
  129. searchChange(params, done) {
  130. this.getList(this.page, params);
  131. done();
  132. },
  133. sizeChange(val) {
  134. this.page.pageSize = val;
  135. this.getList();
  136. },
  137. currentChange(val) {
  138. this.page.currentPage = val;
  139. this.getList();
  140. },
  141. refreshChange() {
  142. this.page.currentPage = 1;
  143. this.getList();
  144. },
  145. //删除列表后面的删除按钮触发触发(row, index, done)
  146. rowDel(row, index, done) {
  147. this.$confirm("确定将选择数据删除?", {
  148. confirmButtonText: "确定",
  149. cancelButtonText: "取消",
  150. type: "warning"
  151. }).then(() => {
  152. this.$message({
  153. type: "success",
  154. message: "操作成功!"
  155. });
  156. // 数据回调进行刷新
  157. done(row);
  158. });
  159. },
  160. saveColumn(row, column) {
  161. console.log(row, column);
  162. },
  163. goBack() {
  164. this.detailData=this.$options.data().detailData
  165. this.show = true;
  166. this.search.createTime[0] = this.search.createStartDate
  167. this.search.createTime[1] = this.search.createEndDate
  168. console.log(this.search)
  169. this.getList(this.page,this.search)
  170. },
  171. }
  172. };
  173. </script>
  174. <style></style>