index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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. methods: {
  81. //新增
  82. beforeOpen(row){
  83. this.$router.push({
  84. path: "/task_editPages",
  85. query: {id: JSON.stringify(row.fwxm)},
  86. });
  87. },
  88. //查看
  89. beforeOpenPage(row){
  90. this.$router.push({
  91. path: "/task_editPages",
  92. query: {id: JSON.stringify(row.fwxm)},
  93. });
  94. },
  95. //修改
  96. editOpen(row){
  97. this.$router.push({
  98. path: "/task_editPages",
  99. query: {id: JSON.stringify(row.fwxm)},
  100. });
  101. },
  102. //
  103. //删除列表后面的删除按钮触发触发(row, index, done)
  104. rowDel(row, index, done) {
  105. this.$confirm("确定将选择数据删除?", {
  106. confirmButtonText: "确定",
  107. cancelButtonText: "取消",
  108. type: "warning"
  109. }).then(() => {
  110. this.$message({
  111. type: "success",
  112. message: "操作成功!"
  113. });
  114. // 数据回调进行刷新
  115. done(row);
  116. });
  117. },
  118. //查询全部
  119. initData(){
  120. customerList().then(res => {
  121. console.log(this.form);
  122. const column = this.findObject(this.option.column, "parentId");
  123. column.dicData = res.data.data.records;
  124. });
  125. },
  126. //点击搜索按钮触发
  127. searchChange(params, done) {
  128. this.query = params;
  129. this.page.currentPage = 1;
  130. params.parentId = 0
  131. this.onLoad(this.page, params);
  132. done()
  133. },
  134. searchReset() {
  135. console.log('1')
  136. },
  137. selectionChange() {
  138. console.log('1')
  139. },
  140. currentChange() {
  141. console.log('1')
  142. },
  143. sizeChange() {
  144. console.log('1')
  145. },
  146. refreshChange() {
  147. console.log('1')
  148. },
  149. onLoad(page, params = {}) {
  150. const {createTimeA} = this.query;
  151. let values = {
  152. ...params,
  153. size:this.page.pageSize,
  154. current:this.page.currentPage
  155. };
  156. if (createTimeA) {
  157. values = {
  158. ...params,
  159. createTime: createTimeA[0] + ' 00:00:00',
  160. endTime: createTimeA[1] + ' 23:59:59',
  161. ...this.query,
  162. size:this.page.pageSize,
  163. current:this.page.currentPage
  164. };
  165. values.createTimeA = null;
  166. }
  167. values.parentId = 0
  168. this.dataList = [{
  169. aname:"tuobao",
  170. bname:"途宝注册",
  171. cname:"途宝",
  172. dname:"ABC",
  173. ename:"2020-10-10",
  174. fname:"2020-10-10",
  175. gname:"2020-10-10",
  176. hname:"技术部",
  177. iname:"123",
  178. jname:"2100",
  179. kname:"李",
  180. }];
  181. },
  182. //树桩列点击展开触发
  183. treeLoad(tree, treeNode, resolve) {
  184. const parentId = tree.id;
  185. customerList({parentId:parentId}).then(res => {
  186. resolve(res.data.data.records);
  187. });
  188. },
  189. }
  190. }
  191. </script>
  192. <style scoped>
  193. </style>