index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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. :before-open="beforeOpen"
  9. @row-del="rowDel"
  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. @tree-load="treeLoad">
  18. <template slot="menuLeft">
  19. <el-button type="primary"
  20. size="small"
  21. icon="el-icon-upload2"
  22. plain
  23. @click="">导 入
  24. </el-button>
  25. </template>
  26. <template slot-scope="scope" slot="menu">
  27. <el-button
  28. type="text"
  29. icon="el-icon-view"
  30. size="small"
  31. @click.stop="beforeOpenPage(scope.row)"
  32. >查看
  33. </el-button>
  34. <el-button
  35. type="text"
  36. icon="el-icon-edit"
  37. size="small"
  38. @click.stop="editOpen(scope.row)"
  39. >编辑
  40. </el-button>
  41. <el-button
  42. type="text"
  43. icon="el-icon-view"
  44. size="small"
  45. @click.stop=""
  46. >发送
  47. </el-button>
  48. <el-button
  49. type="text"
  50. icon="el-icon-edit"
  51. size="small"
  52. @click.stop=""
  53. >完工
  54. </el-button>
  55. </template>
  56. </avue-crud>
  57. </basic-container>
  58. </template>
  59. <script>
  60. import option from "./configuration/mainList.json";
  61. import {customerList, typeSave,detail,deleteDetails} from "@/api/basicData/customerCategory"
  62. export default {
  63. name: "customerInformation",
  64. data() {
  65. return {
  66. form: {},
  67. option: option,
  68. parentId:0,
  69. dataList: [],
  70. page: {
  71. pageSize: 10,
  72. pagerCount: 5,
  73. total: 0,
  74. },
  75. query:{}
  76. }
  77. },
  78. created() {
  79. },
  80. mounted() {
  81. option.height = window.innerHeight - 350 ;
  82. },
  83. methods: {
  84. //新增
  85. beforeOpen(row){
  86. this.$router.push({
  87. path: "/task_editPages",
  88. query: {id: JSON.stringify(row.fwxm)},
  89. });
  90. },
  91. //查看
  92. beforeOpenPage(row){
  93. this.$router.push({
  94. path: "/task_editPages",
  95. query: {id: JSON.stringify(row.fwxm)},
  96. });
  97. },
  98. //修改
  99. editOpen(row){
  100. this.$router.push({
  101. path: "/task_editPages",
  102. query: {id: JSON.stringify(row.fwxm)},
  103. });
  104. },
  105. //
  106. //删除列表后面的删除按钮触发触发(row, index, done)
  107. rowDel(row, index, done) {
  108. this.$confirm("确定将选择数据删除?", {
  109. confirmButtonText: "确定",
  110. cancelButtonText: "取消",
  111. type: "warning"
  112. }).then(() => {
  113. this.$message({
  114. type: "success",
  115. message: "操作成功!"
  116. });
  117. // 数据回调进行刷新
  118. done(row);
  119. });
  120. },
  121. //查询全部
  122. initData(){
  123. customerList().then(res => {
  124. console.log(this.form);
  125. const column = this.findObject(this.option.column, "parentId");
  126. column.dicData = res.data.data.records;
  127. });
  128. },
  129. //点击搜索按钮触发
  130. searchChange(params, done) {
  131. this.query = params;
  132. this.page.currentPage = 1;
  133. params.parentId = 0
  134. this.onLoad(this.page, params);
  135. done()
  136. },
  137. searchReset() {
  138. console.log('1')
  139. },
  140. selectionChange() {
  141. console.log('1')
  142. },
  143. currentChange() {
  144. console.log('1')
  145. },
  146. sizeChange() {
  147. console.log('1')
  148. },
  149. refreshChange() {
  150. console.log('1')
  151. },
  152. onLoad(page, params = {}) {
  153. const {createTimeA} = this.query;
  154. let values = {
  155. ...params,
  156. size:this.page.pageSize,
  157. current:this.page.currentPage
  158. };
  159. if (createTimeA) {
  160. values = {
  161. ...params,
  162. createTime: createTimeA[0] + ' 00:00:00',
  163. endTime: createTimeA[1] + ' 23:59:59',
  164. ...this.query,
  165. size:this.page.pageSize,
  166. current:this.page.currentPage
  167. };
  168. values.createTimeA = null;
  169. }
  170. values.parentId = 0
  171. this.dataList = [{
  172. aname:"tuobao",
  173. bname:"途宝注册",
  174. cname:"途宝",
  175. dname:"ABC",
  176. ename:"2020-10-10",
  177. fname:"2020-10-10",
  178. gname:"2020-10-10",
  179. hname:"技术部",
  180. iname:"123",
  181. jname:"2100",
  182. kname:"李",
  183. }];
  184. },
  185. //树桩列点击展开触发
  186. treeLoad(tree, treeNode, resolve) {
  187. const parentId = tree.id;
  188. customerList({parentId:parentId}).then(res => {
  189. resolve(res.data.data.records);
  190. });
  191. },
  192. }
  193. }
  194. </script>
  195. <style scoped>
  196. </style>