Commit ffbc494c authored by lixy's avatar lixy

预定申请管理

parent dfed328d
......@@ -3,10 +3,17 @@
<div class="filter-container" ref="filter-container">
<el-form :rules="rules4Query" ref="queryForm" :inline="inline" :model="listQuery">
<el-form-item label="分公司" prop="subordinateBranch">
<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-autocomplete
class="inline-input"
v-model="state2"
: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 label="">
......@@ -212,10 +219,17 @@
<el-form :model="form4Lift" :rules="rules4Lift" ref="form4Lift" label-width="120px">
<el-form-item label="提车分公司" prop="liftCompany">
<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-autocomplete
class="inline-input"
v-model="form4Lift.state1"
: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 label="提车里程数" prop="mileageLift">
......@@ -229,7 +243,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<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>
</el-dialog>
......@@ -284,7 +298,8 @@
import {
getAllCompany
getAllCompany,
getAll
} from 'api/base_info/branch_company/';
import {
......@@ -318,6 +333,7 @@
},
data() {
return {
state2: '',//搜索-分公司名称
rules4Query: {
selectedMonth4Query: [
{
......@@ -354,8 +370,10 @@
dialogForm4LiftVisible: false,
dialogForm4RetVisible: false,
allCompanies: {},
allCompaniesArr: [],
tableKey: 0,
form4Lift: {
state1: '',
id: undefined,
mileageLift: undefined,
liftCompany: undefined,
......@@ -455,6 +473,10 @@
},
created() {
this.getList();
getAll()
.then(response => {
this.allCompaniesArr = response.data;
})
getAllCompany(codeAndBranchCompany => {//初始化公司列表
this.allCompanies = codeAndBranchCompany;
});
......@@ -486,6 +508,41 @@
}
},
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) {
this.dialogForm4LiftVisible = false;
this.$refs[formName].resetFields();
......@@ -494,7 +551,20 @@
this.dialogForm4RetVisible = false;
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;
set[formName].validate(valid => {
if (valid) {
......@@ -585,9 +655,15 @@
}
return '未知';
},
/**
* 搜索按钮
* */
handleFilter() {
if(this.state2 == "" || this.state2 == "全部"){
this.listQuery.subordinateBranch = undefined;
}
this.listQuery.page = 1;
this.$refs.queryForm.validate(valid => {
if (valid) {
this.getList();
} else {
......@@ -671,6 +747,10 @@
});
});
},
/**
* 操作-提车
* @param row
*/
handleLift(row) {
this.resetTemp4Lift();
getObj(row.id, row.bookEndDate)
......@@ -678,6 +758,17 @@
if (!this.$utils.isEmpty(response.data) && this.$utils.isInteger(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.dialogForm4LiftVisible = true;
});
......@@ -765,6 +856,7 @@
resetTemp4Lift() {
this.form4Lift = {
id: undefined,
state1: '',
mileageLift: undefined,
liftCompany: 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