123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- <template>
- <basic-container>
- <avue-crud :option="option"
- :data="dataList"
- ref="crud"
- v-model="form"
- :page.sync="page"
- :before-open="beforeOpen"
- @row-del="rowDel"
- @search-change="searchChange"
- @search-reset="searchReset"
- @selection-change="selectionChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- @on-load="onLoad"
- @tree-load="treeLoad">
- <template slot="menuLeft">
- <el-button type="primary"
- size="small"
- icon="el-icon-upload2"
- plain
- @click="">导 入
- </el-button>
- </template>
- <template slot-scope="scope" slot="menu">
- <el-button
- type="text"
- icon="el-icon-view"
- size="small"
- @click.stop="beforeOpenPage(scope.row)"
- >查看
- </el-button>
- <el-button
- type="text"
- icon="el-icon-edit"
- size="small"
- @click.stop="editOpen(scope.row)"
- >编辑
- </el-button>
- <el-button
- type="text"
- icon="el-icon-view"
- size="small"
- @click.stop=""
- >发送
- </el-button>
- <el-button
- type="text"
- icon="el-icon-edit"
- size="small"
- @click.stop=""
- >完工
- </el-button>
- </template>
- </avue-crud>
- </basic-container>
- </template>
- <script>
- import option from "./configuration/mainList.json";
- import {customerList, typeSave,detail,deleteDetails} from "@/api/basicData/customerCategory"
- export default {
- name: "customerInformation",
- data() {
- return {
- form: {},
- option: option,
- parentId:0,
- dataList: [],
- page: {
- pageSize: 10,
- pagerCount: 5,
- total: 0,
- },
- query:{}
- }
- },
- created() {
- },
- methods: {
- //新增
- beforeOpen(row){
- this.$router.push({
- path: "/task_editPages",
- query: {id: JSON.stringify(row.fwxm)},
- });
- },
- //查看
- beforeOpenPage(row){
- this.$router.push({
- path: "/task_editPages",
- query: {id: JSON.stringify(row.fwxm)},
- });
- },
- //修改
- editOpen(row){
- this.$router.push({
- path: "/task_editPages",
- query: {id: JSON.stringify(row.fwxm)},
- });
- },
- //
- //删除列表后面的删除按钮触发触发(row, index, done)
- rowDel(row, index, done) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- // 数据回调进行刷新
- done(row);
- });
- },
- //查询全部
- initData(){
- customerList().then(res => {
- console.log(this.form);
- const column = this.findObject(this.option.column, "parentId");
- column.dicData = res.data.data.records;
- });
- },
- //点击搜索按钮触发
- searchChange(params, done) {
- this.query = params;
- this.page.currentPage = 1;
- params.parentId = 0
- this.onLoad(this.page, params);
- done()
- },
- searchReset() {
- console.log('1')
- },
- selectionChange() {
- console.log('1')
- },
- currentChange() {
- console.log('1')
- },
- sizeChange() {
- console.log('1')
- },
- refreshChange() {
- console.log('1')
- },
- onLoad(page, params = {}) {
- const {createTimeA} = this.query;
- let values = {
- ...params,
- size:this.page.pageSize,
- current:this.page.currentPage
- };
- if (createTimeA) {
- values = {
- ...params,
- createTime: createTimeA[0] + ' 00:00:00',
- endTime: createTimeA[1] + ' 23:59:59',
- ...this.query,
- size:this.page.pageSize,
- current:this.page.currentPage
- };
- values.createTimeA = null;
- }
- values.parentId = 0
- this.dataList = [{
- aname:"tuobao",
- bname:"途宝注册",
- cname:"途宝",
- dname:"ABC",
- ename:"2020-10-10",
- fname:"2020-10-10",
- gname:"2020-10-10",
- hname:"技术部",
- iname:"123",
- jname:"2100",
- kname:"李",
- }];
- },
- //树桩列点击展开触发
- treeLoad(tree, treeNode, resolve) {
- const parentId = tree.id;
- customerList({parentId:parentId}).then(res => {
- resolve(res.data.data.records);
- });
- },
- }
- }
- </script>
- <style scoped>
- </style>
|