index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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="cornIdSearch">
  18. <select-component
  19. v-model="search.cornId"
  20. :configuration="configuration"
  21. ></select-component>
  22. </template>
  23. <template slot="menuLeft">
  24. <el-button
  25. icon="el-icon-printer"
  26. size="small"
  27. type="primary"
  28. @click.stop="openReport()"
  29. >报 表
  30. </el-button>
  31. </template>
  32. <template slot-scope="scope" slot="menu">
  33. <el-button
  34. type="text"
  35. icon="el-icon-view"
  36. size="small"
  37. @click.stop=""
  38. >发送
  39. </el-button>
  40. <el-button
  41. type="text"
  42. icon="el-icon-edit"
  43. :disabled="scope.row.status != 1"
  44. size="small"
  45. @click.stop="completion(scope.row)"
  46. >完工
  47. </el-button>
  48. </template>
  49. </avue-crud>
  50. </basic-container>
  51. </template>
  52. <script>
  53. import option from "./configuration/mainList.json";
  54. import { getFlowList } from "@/api/workManagement/mainProject";
  55. import { updateItemStatus } from "@/api/workManagement/mainProject";
  56. export default {
  57. name: "customerInformation",
  58. data() {
  59. return {
  60. loading : false,
  61. form: {},
  62. search:{},
  63. configuration:{
  64. multipleChoices:false,
  65. multiple:false,
  66. disabled:false,
  67. searchShow:true,
  68. collapseTags:false,
  69. clearable:true,
  70. placeholder:'请点击右边按钮选择',
  71. dicData:[]
  72. },
  73. option: option,
  74. parentId:0,
  75. dataList: [],
  76. page: {
  77. pageSize: 10,
  78. pagerCount: 5,
  79. total: 0,
  80. },
  81. query:{}
  82. }
  83. },
  84. created() {
  85. },
  86. mounted() {
  87. option.height = window.innerHeight - 350 ;
  88. },
  89. methods: {
  90. //完工
  91. completion(row){
  92. this.$confirm("确认将此任务完工?", {
  93. confirmButtonText: "确定",
  94. cancelButtonText: "取消",
  95. type: "warning"
  96. }).then(() => {
  97. updateItemStatus(row.id,4).then(res =>{
  98. if(res.data.success){
  99. this.$message({
  100. type: "success",
  101. message: "操作成功!"
  102. });
  103. this.onLoad(this.page);
  104. }
  105. })
  106. });
  107. },
  108. //点击搜索按钮触发
  109. searchChange(params, done) {
  110. this.query = params;
  111. this.page.currentPage = 1;
  112. this.onLoad(this.page, params);
  113. done()
  114. },
  115. searchReset() {
  116. console.log('1')
  117. },
  118. selectionChange() {
  119. console.log('1')
  120. },
  121. currentChange() {
  122. console.log('1')
  123. },
  124. sizeChange() {
  125. console.log('1')
  126. },
  127. refreshChange() {
  128. console.log('1')
  129. },
  130. onLoad(page, params = {}) {
  131. if(!params.status){
  132. params.status = "1,4,5";
  133. }
  134. this.loading = true
  135. getFlowList(page.currentPage, page.pageSize,params).then(res =>{
  136. this.dataList = res.data.data.records
  137. this.page.total = res.data.data.total
  138. this.loading = false
  139. })
  140. },
  141. }
  142. }
  143. </script>
  144. <style scoped>
  145. </style>