Commit ffbc494c authored by lixy's avatar lixy

预定申请管理

parent dfed328d
...@@ -3,10 +3,17 @@ ...@@ -3,10 +3,17 @@
<div class="filter-container" ref="filter-container"> <div class="filter-container" ref="filter-container">
<el-form :rules="rules4Query" ref="queryForm" :inline="inline" :model="listQuery"> <el-form :rules="rules4Query" ref="queryForm" :inline="inline" :model="listQuery">
<el-form-item label="分公司" prop="subordinateBranch"> <el-form-item label="分公司" prop="subordinateBranch">
<el-select class="filter-item" v-model="listQuery.subordinateBranch" placeholder="请选择分公司"> <el-autocomplete
<el-option :key="undefined" label="无" :value="undefined"></el-option> class="inline-input"
<el-option v-for="item in allCompanies" :key="item.id" :label="item.name" :value="item.id"></el-option> v-model="state2"
</el-select> :fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="handleSelect2"
></el-autocomplete>
<!--<el-select class="filter-item" v-model="listQuery.subordinateBranch" placeholder="请选择分公司">-->
<!--<el-option :key="undefined" label="无" :value="undefined"></el-option>-->
<!--<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=""> <el-form-item label="">
...@@ -212,10 +219,17 @@ ...@@ -212,10 +219,17 @@
<el-form :model="form4Lift" :rules="rules4Lift" ref="form4Lift" label-width="120px"> <el-form :model="form4Lift" :rules="rules4Lift" ref="form4Lift" label-width="120px">
<el-form-item label="提车分公司" prop="liftCompany"> <el-form-item label="提车分公司" prop="liftCompany">
<el-select class="filter-item" v-model="form4Lift.liftCompany" placeholder="请选择提车分公司"> <el-autocomplete
<el-option :key="undefined" label="无" :value="undefined"></el-option> class="inline-input"
<el-option v-for="item in allCompanies" :key="item.id" :label="item.name" :value="item.id"></el-option> v-model="form4Lift.state1"
</el-select> :fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="handleSelect1"
></el-autocomplete>
<!--<el-select class="filter-item" v-model="form4Lift.liftCompany" placeholder="请选择提车分公司">-->
<!--<el-option :key="undefined" label="无" :value="undefined"></el-option>-->
<!--<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="mileageLift"> <el-form-item label="提车里程数" prop="mileageLift">
...@@ -229,7 +243,7 @@ ...@@ -229,7 +243,7 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cancelDialog4Lift('form4Lift')">取 消</el-button> <el-button @click="cancelDialog4Lift('form4Lift')">取 消</el-button>
<el-button type="primary" @click="lift('form4Lift')">确 定</el-button> <el-button type="primary" @click="liftOk('form4Lift')">确 定</el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -284,7 +298,8 @@ ...@@ -284,7 +298,8 @@
import { import {
getAllCompany getAllCompany,
getAll
} from 'api/base_info/branch_company/'; } from 'api/base_info/branch_company/';
import { import {
...@@ -318,6 +333,7 @@ ...@@ -318,6 +333,7 @@
}, },
data() { data() {
return { return {
state2: '',//搜索-分公司名称
rules4Query: { rules4Query: {
selectedMonth4Query: [ selectedMonth4Query: [
{ {
...@@ -354,8 +370,10 @@ ...@@ -354,8 +370,10 @@
dialogForm4LiftVisible: false, dialogForm4LiftVisible: false,
dialogForm4RetVisible: false, dialogForm4RetVisible: false,
allCompanies: {}, allCompanies: {},
allCompaniesArr: [],
tableKey: 0, tableKey: 0,
form4Lift: { form4Lift: {
state1: '',
id: undefined, id: undefined,
mileageLift: undefined, mileageLift: undefined,
liftCompany: undefined, liftCompany: undefined,
...@@ -455,6 +473,10 @@ ...@@ -455,6 +473,10 @@
}, },
created() { created() {
this.getList(); this.getList();
getAll()
.then(response => {
this.allCompaniesArr = response.data;
})
getAllCompany(codeAndBranchCompany => {//初始化公司列表 getAllCompany(codeAndBranchCompany => {//初始化公司列表
this.allCompanies = codeAndBranchCompany; this.allCompanies = codeAndBranchCompany;
}); });
...@@ -486,6 +508,41 @@ ...@@ -486,6 +508,41 @@
} }
}, },
methods: { methods: {
querySearch(queryString, cb) {
let selectArry = [];
let iitem = {
value: "全部",
name: "全部"
};
selectArry.push(iitem);
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);
},
createFilter(queryString) {
return (restaurant) => {
return (restaurant.name.indexOf(queryString.toLowerCase()) != -1);
};
},
/**
* 分公司搜索
* */
handleSelect2(item){
this.listQuery.subordinateBranch = item.id;
console.log(item);
},
/**
* 提车分公司
* */
handleSelect1(item){
this.form4Lift.liftCompany = item.id;
console.log(item);
},
cancelDialog4Lift(formName) { cancelDialog4Lift(formName) {
this.dialogForm4LiftVisible = false; this.dialogForm4LiftVisible = false;
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
...@@ -494,7 +551,20 @@ ...@@ -494,7 +551,20 @@
this.dialogForm4RetVisible = false; this.dialogForm4RetVisible = false;
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
}, },
lift(formName) { /**
* 提车弹框-确定
* */
liftOk(formName) {
if(this.form4Lift.state1 == "" || this.form4Lift.state1 == "全部"){
this.form4Lift.liftCompany = 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) {
...@@ -585,9 +655,15 @@ ...@@ -585,9 +655,15 @@
} }
return '未知'; return '未知';
}, },
/**
* 搜索按钮
* */
handleFilter() { handleFilter() {
if(this.state2 == "" || this.state2 == "全部"){
this.listQuery.subordinateBranch = undefined;
}
this.listQuery.page = 1;
this.$refs.queryForm.validate(valid => { this.$refs.queryForm.validate(valid => {
if (valid) { if (valid) {
this.getList(); this.getList();
} else { } else {
...@@ -671,6 +747,10 @@ ...@@ -671,6 +747,10 @@
}); });
}); });
}, },
/**
* 操作-提车
* @param row
*/
handleLift(row) { handleLift(row) {
this.resetTemp4Lift(); this.resetTemp4Lift();
getObj(row.id, row.bookEndDate) getObj(row.id, row.bookEndDate)
...@@ -678,6 +758,17 @@ ...@@ -678,6 +758,17 @@
if (!this.$utils.isEmpty(response.data) && this.$utils.isInteger(response.data.liftCompany)) { if (!this.$utils.isEmpty(response.data) && this.$utils.isInteger(response.data.liftCompany)) {
this.form4Lift.liftCompany = response.data.liftCompany; this.form4Lift.liftCompany = response.data.liftCompany;
} }
let that = this;
let selectArry = [];
this.allCompaniesArr.map(function(item){
item.value = item.name;
selectArry.push(item);
});
selectArry.map(function (iitem) {
if( that.form4Lift.liftCompany == iitem.id){
that.form4Lift.state1 = iitem.name;
}
});
this.form4Lift.id = row.id; this.form4Lift.id = row.id;
this.dialogForm4LiftVisible = true; this.dialogForm4LiftVisible = true;
}); });
...@@ -765,6 +856,7 @@ ...@@ -765,6 +856,7 @@
resetTemp4Lift() { resetTemp4Lift() {
this.form4Lift = { this.form4Lift = {
id: undefined, id: undefined,
state1: '',
mileageLift: undefined, mileageLift: undefined,
liftCompany: undefined, liftCompany: undefined,
liftRemark: undefined liftRemark: undefined
......
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