Skip to content

Commit

Permalink
优化界面
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed May 26, 2018
1 parent 70e0427 commit 9cf9a1a
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 91 deletions.
2 changes: 1 addition & 1 deletion config/dev.env.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ var prodEnv = require('./prod.env')

module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
BASE_API: '"http://156.11.1.149:8081/api"',
BASE_API: '"http://localhost:26958/api"',
})
2 changes: 1 addition & 1 deletion config/prod.env.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
NODE_ENV: '"production"',
BASE_API: '"http://156.11.1.149:8081/api"'
BASE_API: '"http://localhost:26958/api"',
}
3 changes: 2 additions & 1 deletion src/views/KaoQin/import.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
import {
DeleteAtten,
AttenDetailByPerson,
GetAttenListToday,
UpdateAtten
} from "@/api/KaoQin/Attendance";
import { GetUsers } from "@/api/KaoQin/person";
Expand Down Expand Up @@ -144,7 +145,7 @@ export default {
},
fetchData(params) {//
this.listLoading = true;
GetUsers(params).then(response => {
GetAttenListToday(params).then(response => {
this.list = response.data.rows;
console.log(this.list);
this.listQuery.totalCount = response.data.total;
Expand Down
180 changes: 92 additions & 88 deletions src/views/KaoQin/person.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
<template>
<div class="app-container" id="person">
<el-button @click="New()" type="primary" size="small">新增</el-button>

<el-button @click="New()" type="primary" size="small">新增</el-button>
<el-input @keyup.enter.native="Refresh" placeholder="请输入姓名/工号" v-model="listQuery.criteria" style="padding-bottom:10px;width:90%">

<el-button slot="append" icon="el-icon-search" v-on:click="Refresh"></el-button>
<el-button slot="append" icon="el-icon-refresh" v-on:click="Clear"></el-button>

</el-input>
<br>
<br>

Expand All @@ -26,9 +32,9 @@
{{scope.row.DeptName}}
</template>
</el-table-column>
<el-table-column label="职位" align="center">
<el-table-column label="手机号码" align="center">
<template slot-scope="scope">
{{scope.row.Workduty}}
{{scope.row.Phone}}
</template>
</el-table-column>
<!-- <el-table-column label="入职时间" align="center">
Expand Down Expand Up @@ -89,9 +95,9 @@

</el-form-item>

<el-form-item label="职位">
<el-form-item label="联系方式">

<el-input class="filter-item" v-model="temp.Workduty" placeholder="请输入职位">
<el-input class="filter-item" v-model="temp.Phone" placeholder="请输入手机号码">

</el-input>
</el-form-item>
Expand All @@ -107,84 +113,88 @@
</template>

<script>
import {
GetUsers,
DeleteUser,
GetUsersDetail,
SaveNewUsers,
UpdateUsers
} from "@/api/KaoQin/person";
import {
GetDeptTree
} from "@/api/system/dept";
import Multiselect from 'vue-multiselect'
export default {//
data() {
return {
selected: null,
options: ['', ''],
depttree: [],
textMap: {
update: "编辑",
create: "新增"
},
listQuery: {
totalCount: null,
pageSize: "10",
pageNumber: "1",
},
dialogFormVisible: false,
dialogStatus: "",
list: null,
listLoading: true,
RoleID: "",
temp: {
ID: "",
No: "",
Name: "",
Gender: "",
Workduty: "",
DeptName: "",
DeptID: "",
phone: "",
IsDeleted: false
},
defaultProps: {
children: "children",
label: "text"
},
import {
GetUsers,
DeleteUser,
GetUsersDetail,
SaveNewUsers,
UpdateUsers
} from "@/api/KaoQin/person";
import { GetDeptTree } from "@/api/system/dept";
import Multiselect from "vue-multiselect";
export default {
//
data() {
return {
selected: null,
options: ["", ""],
depttree: [],
textMap: {
update: "编辑",
create: "新增"
},
listQuery: {
totalCount: null,
pageSize: "10",
pageNumber: "1",
criteria: ""
},
};
dialogFormVisible: false,
dialogStatus: "",
list: null,
listLoading: true,
RoleID: "",
temp: {
ID: "",
No: "",
Name: "",
Gender: "",
Workduty: "",
DeptName: "",
DeptID: "",
Phone: "",
IsDeleted: false
},
defaultProps: {
children: "children",
label: "text"
}
};
},
components: {
Multiselect
},
created() {
this.fetchData(this.listQuery);
GetDeptTree().then(response => {
this.depttree = JSON.parse(response.data);
});
},
methods: {
handleSizeChange(val) {
this.listQuery.pageSize = val;
this.fetchData(this.listQuery);
},
components: {
Multiselect
handleCurrentChange(val) {
this.listQuery.pageNumber = val;
this.fetchData(this.listQuery);
},
created() {
Refresh(){
this.fetchData(this.listQuery);
},
Clear(){
this.listQuery.criteria="";
this.fetchData(this.listQuery);
GetDeptTree().then(response => {
this.depttree = JSON.parse(response.data);
});
},
methods: {
handleSizeChange(val) {
this.listQuery.pageSize = val;
this.fetchData(this.listQuery);
},
handleCurrentChange(val) {
this.listQuery.pageNumber =val;
this.fetchData(this.listQuery);
},
fetchData(params) {
this.listLoading = true;
GetUsers(params).then(response => {
this.list = response.data.rows;
this.listQuery.totalCount = response.data.total;
Expand All @@ -204,7 +214,7 @@
this.selected = null;
this.dialogFormVisible = true;
this.$refs.tree.setCheckedKeys([])
this.$refs.tree.setCheckedKeys([]);
this.dialogStatus = "create";
},
Expand All @@ -215,9 +225,7 @@
type: "warning"
}).then(() => {
DeleteUser(ID).then(response => {
this.fetchData();
this.fetchData(this.listQuery);
});
});
},
Expand All @@ -226,35 +234,31 @@
this.dialogFormVisible = true;
GetUsersDetail(ID).then(response => {
this.temp = response.data;
this.$refs.tree.setCheckedKeys([this.temp.DeptID]);
this.selected = this.temp.Gender;
});
},
create() {
this.temp.DeptID = this.$refs.tree.getCheckedKeys().join(',');
this.temp.DeptID = this.$refs.tree.getCheckedKeys().join(",");
this.temp.Gender = this.selected;
SaveNewUsers(this.temp).then(response => {
this.dialogFormVisible = false;
this.fetchData();
this.fetchData(this.listQuery);
});
},
update() {
this.temp.Gender = this.selected;
this.temp.DeptID = this.$refs.tree.getCheckedKeys().join(',');
this.temp.DeptID = this.$refs.tree.getCheckedKeys().join(",");
UpdateUsers(this.temp).then(response => {
this.dialogFormVisible = false;
this.fetchData();
this.fetchData(this.listQuery);
});
}
}
}
};
</script>

0 comments on commit 9cf9a1a

Please sign in to comment.