index.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <basic-container>
  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="flagSearch">
  18. <el-select v-model="search.flag" placeholder="" >
  19. <el-option
  20. v-for="item in flagOptions"
  21. :key="item.value"
  22. :label="item.label"
  23. :value="item.value">
  24. </el-option>
  25. </el-select>
  26. </template>
  27. <template slot-scope="scope" slot="menu">
  28. <el-button
  29. type="text"
  30. icon="el-icon-delete"
  31. size="small"
  32. :disabled="scope.row.billType === '申请' && scope.row.settlementAmount != 0"
  33. @click.stop=""
  34. >删除
  35. </el-button>
  36. </template>
  37. </avue-crud>
  38. </basic-container>
  39. </template>
  40. <script>
  41. import option from "./config/mainList.json";
  42. import { performanceAnalysis } from "@/api/workManagement/mainProject";
  43. import _ from "lodash";
  44. export default {
  45. data() {
  46. return {
  47. loading : false,
  48. form: {},
  49. search:{},
  50. detailData:{},
  51. option: option,
  52. parentId:0,
  53. dataList: [],
  54. flagOptions:[{
  55. value: '1',
  56. label: '制单人'
  57. }, {
  58. value: '2',
  59. label: '客户'
  60. }],
  61. page: {
  62. pageSize: 10,
  63. pagerCount: 5,
  64. total: 0,
  65. },
  66. query:{},
  67. configuration:{
  68. multipleChoices:false,
  69. multiple:false,
  70. disabled:false,
  71. searchShow:true,
  72. collapseTags:false,
  73. clearable:true,
  74. placeholder:'请点击右边按钮选择',
  75. dicData:[]
  76. },
  77. breakConfiguration:{
  78. multipleChoices:false,
  79. multiple:false,
  80. disabled:false,
  81. searchShow:true,
  82. collapseTags:false,
  83. clearable:true,
  84. placeholder:'请点击右边按钮选择',
  85. dicData:[]
  86. },
  87. }
  88. },
  89. created() {
  90. this.option.column.forEach(item =>{
  91. if(item.prop == "corpNames" || item.prop == "countCreateUser" ) {
  92. item.hide = true
  93. }
  94. })
  95. },
  96. mounted() {
  97. // option.height = window.innerHeight - 200 ;
  98. },
  99. methods: {
  100. //新单打开
  101. addReceipt(row){
  102. console.log(1)
  103. },
  104. //编辑打开
  105. editOpen(row){
  106. console.log(1)
  107. },
  108. searchReset() {
  109. console.log('1')
  110. },
  111. selectionChange() {
  112. console.log('1')
  113. },
  114. sizeChange() {
  115. console.log('1')
  116. },
  117. currentChange(val) {
  118. this.page.currentPage = val
  119. },
  120. refreshChange(params) {
  121. this.onLoad(this.page,params);
  122. },
  123. //点击搜索按钮触发
  124. searchChange(params, done) {
  125. this.query = params;
  126. this.page.currentPage = 1;
  127. this.onLoad(this.page, params);
  128. done()
  129. },
  130. paramsAdjustment(params) {
  131. params = Object.assign({}, this.search);
  132. if(params.flag == 1){
  133. this.option.column.forEach(item =>{
  134. if(item.prop == "corpNames" || item.prop == "countCreateUser" ) {
  135. item.hide = true
  136. }
  137. })
  138. this.option.column.forEach(item =>{
  139. if(item.prop == "createUserName" || item.prop == "countCorp" ) {
  140. item.hide = false
  141. }
  142. })
  143. }else{
  144. this.option.column.forEach(item =>{
  145. if(item.prop == "createUserName" || item.prop == "countCorp" ) {
  146. item.hide = true
  147. }
  148. })
  149. this.option.column.forEach(item =>{
  150. if(item.prop == "corpNames" || item.prop == "countCreateUser" ) {
  151. item.hide = false
  152. }
  153. })
  154. }
  155. return params
  156. },
  157. onLoad(page, params) {
  158. this.loading = true;
  159. params = this.paramsAdjustment(params)
  160. performanceAnalysis(page.currentPage, page.pageSize,params).then(res=>{
  161. this.dataList = res.data.data
  162. // this.page.total = res.data.data
  163. }).finally(()=>{
  164. this.loading = false;
  165. })
  166. },
  167. }
  168. }
  169. </script>
  170. <style scoped>
  171. </style>