settleAccounts.vue 5.0 KB

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