Commit e7316078 authored by hezhen's avatar hezhen
parents 94910996 f8f9b3cc
...@@ -68,9 +68,16 @@ ...@@ -68,9 +68,16 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="所属分公司" prop="companyId"> <el-form-item label="所属分公司" prop="companyId">
<el-select class="filter-item" v-model="form.companyId" placeholder="请选择分公司"> <el-autocomplete
<el-option v-for="item in allCompanies" :key="item.id" :label="item.name" :value="item.id"> </el-option> class="inline-input"
</el-select> v-model="form.state2"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="handleSelect1"
></el-autocomplete>
<!--<el-select class="filter-item" v-model="form.companyId" placeholder="请选择分公司">-->
<!--<el-option v-for="item in allCompanies" :key="item.id" :label="item.name" :value="item.id"> </el-option>-->
<!--</el-select>-->
</el-form-item> </el-form-item>
<el-form-item label="所属角色" prop="groupId"> <el-form-item label="所属角色" prop="groupId">
<el-select v-model="form.members" multiple filterable remote placeholder="请选择角色" :remote-method="remoteGroupsMethod" :loading="loading"> <el-select v-model="form.members" multiple filterable remote placeholder="请选择角色" :remote-method="remoteGroupsMethod" :loading="loading">
...@@ -107,7 +114,8 @@ import{ ...@@ -107,7 +114,8 @@ import{
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { import {
getAllCompany getAllCompany,
getAll
} from 'api/base_info/branch_company/'; } from 'api/base_info/branch_company/';
import { import {
...@@ -130,6 +138,7 @@ export default { ...@@ -130,6 +138,7 @@ export default {
status: 1, status: 1,
zoneId: undefined, zoneId: undefined,
companyId: undefined, companyId: undefined,
state2: '',
password: undefined, password: undefined,
passwordEdit: undefined, passwordEdit: undefined,
description: undefined, description: undefined,
...@@ -211,6 +220,7 @@ export default { ...@@ -211,6 +220,7 @@ export default {
userManager_btn_del: false, userManager_btn_del: false,
userManager_btn_add: false, userManager_btn_add: false,
allCompanies: {}, allCompanies: {},
allCompaniesArr: [],
myGroups: [], myGroups: [],
loading: false, loading: false,
textMap: { textMap: {
...@@ -222,6 +232,10 @@ export default { ...@@ -222,6 +232,10 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
getAll()
.then(response => {
this.allCompaniesArr = response.data;
})
getAllCompany(codeAndBranchCompany => { getAllCompany(codeAndBranchCompany => {
this.allCompanies = codeAndBranchCompany; this.allCompanies = codeAndBranchCompany;
}); });
...@@ -342,6 +356,16 @@ export default { ...@@ -342,6 +356,16 @@ export default {
}, },
create(formName) { create(formName) {
const set = this.$refs; const set = this.$refs;
if(!this.form.state2 || this.form.state2 == "全部"){
this.form.companyId = undefined;
// this.$notify({
// title: '失败',
// message: '请选择分公司',
// type: 'warning',
// duration: 2000
// });
// return;
}
set[formName].validate(valid => { set[formName].validate(valid => {
if (valid) { if (valid) {
addObj(this.form) addObj(this.form)
...@@ -364,7 +388,41 @@ export default { ...@@ -364,7 +388,41 @@ export default {
this.dialogFormVisible = false; this.dialogFormVisible = false;
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
}, },
querySearch(queryString, cb) {
let selectArry = [];
this.allCompaniesArr.map(function(item){
item.value = item.name;
selectArry.push(item);
});
this.selectArry = selectArry;
var results = queryString ? selectArry.filter(this.createFilter(queryString)) : selectArry;
// 调用 callback 返回建议列表的数据
cb(results);
},
handleSelect1(item){
if(item.value == "全部"){
this.form.companyId = undefined;
} else {
this.form.companyId = item.id;
}
console.log(item);
},
createFilter(queryString) {
return (restaurant) => {
return (restaurant.name.indexOf(queryString.toLowerCase()) != -1);
};
},
update(formName) { update(formName) {
if(!this.form.state2 || this.form.state2 == "全部"){
this.form.companyId = undefined;
// this.$notify({
// title: '失败',
// message: '请选择分公司',
// type: 'warning',
// duration: 2000
// });
// return;
}
const set = this.$refs; const set = this.$refs;
set[formName].validate(valid => { set[formName].validate(valid => {
if (valid) { if (valid) {
...@@ -400,6 +458,7 @@ export default { ...@@ -400,6 +458,7 @@ export default {
zoneId: undefined, zoneId: undefined,
passwordEdit:undefined, passwordEdit:undefined,
companyId: undefined, companyId: undefined,
state2: '',
password: "", password: "",
description: undefined, description: undefined,
dataLimit: [], dataLimit: [],
......
...@@ -166,6 +166,7 @@ ...@@ -166,6 +166,7 @@
@click="showMoreMoreCol=!showMoreMoreCol"> @click="showMoreMoreCol=!showMoreMoreCol">
更多列 更多列
</el-button> </el-button>
<el-button class="filter-item" type="primary" v-waves @click="reloadPage">刷新</el-button>
</div> </div>
...@@ -1258,6 +1259,38 @@ ...@@ -1258,6 +1259,38 @@
getValue(e){ getValue(e){
this.listQuery.addrCity = undefined; this.listQuery.addrCity = undefined;
}, },
/**
* 刷新
* */
reloadPage(){
this.listQuery = {
page: 1,
limit: 20,
zoneId: undefined,
addrProvince: undefined,
addrCity: undefined,
addrTown: undefined,
vin: undefined,
insuranceCompany: undefined,
mileageRangeStart: undefined,
mileageRangeEnd: undefined,
insuranceDateRange: undefined,
mRange: undefined,
aVRange: undefined,
subordinateBranch: undefined,
numberPlate: undefined,
status: undefined,
bookedStartDate: undefined,
bookedEndDate: undefined,
notBookedStartDate: undefined,
notBookedEndDate: undefined,
code: undefined
};
this.getList();
// this.reload();
// window.reload();
// this.$router.go(0)
},
querySearch(queryString, cb) { querySearch(queryString, cb) {
let selectArry = []; let selectArry = [];
let iitem = { let iitem = {
...@@ -1434,6 +1467,7 @@ ...@@ -1434,6 +1467,7 @@
type: 'success', type: 'success',
duration: 2000 duration: 2000
}); });
this.getList();
} else { } else {
this.$notify({ this.$notify({
title: '失败', title: '失败',
...@@ -1517,6 +1551,7 @@ ...@@ -1517,6 +1551,7 @@
type: 'success', type: 'success',
duration: 2000 duration: 2000
}); });
this.getList();
} else { } else {
this.$notify({ this.$notify({
title: '失败', title: '失败',
...@@ -1693,6 +1728,7 @@ ...@@ -1693,6 +1728,7 @@
return regions[0].name + ' ' + regions[1].name + ' ' + regions[2].name + ' '; return regions[0].name + ' ' + regions[1].name + ' ' + regions[2].name + ' ';
}, },
handleFilter() { handleFilter() {
this.listQuery.page = 1;
this.$refs.queryForm.validate(valid => { this.$refs.queryForm.validate(valid => {
if (valid) { if (valid) {
this.getList(); this.getList();
...@@ -1783,6 +1819,7 @@ ...@@ -1783,6 +1819,7 @@
type: 'success', type: 'success',
duration: 2000 duration: 2000
}); });
this.getList();
} else { } else {
this.$notify({ this.$notify({
title: '失败', title: '失败',
...@@ -1832,6 +1869,7 @@ ...@@ -1832,6 +1869,7 @@
type: 'success', type: 'success',
duration: 2000 duration: 2000
}); });
this.getList();
} else { } else {
this.$notify({ this.$notify({
title: '失败', title: '失败',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment