Commit 75e08b69 authored by lixy's avatar lixy

出车

parent 8d20102f
...@@ -604,9 +604,16 @@ ...@@ -604,9 +604,16 @@
format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker> format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="出车分公司" prop="departureBranchCompanyId"> <el-form-item label="出车分公司" prop="departureBranchCompanyId">
<el-select class="filter-item" v-model="departureForm.departureBranchCompanyId" 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="departureForm.departureBranchCompanyName"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="handleSelectDepartureForm"
></el-autocomplete>
<!--<el-select class="filter-item" v-model="departureForm.departureBranchCompanyId" 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="use"> <el-form-item label="用途" prop="use">
<el-input v-model="departureForm.use" placeholder="请输入出车用途"></el-input> <el-input v-model="departureForm.use" placeholder="请输入出车用途"></el-input>
...@@ -627,9 +634,16 @@ ...@@ -627,9 +634,16 @@
<el-input v-model="departureForm.mileage" placeholder="请输入出车时公里数"></el-input> <el-input v-model="departureForm.mileage" placeholder="请输入出车时公里数"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="预计还车分公司" prop="expectArrivalBranchCompanyId"> <el-form-item label="预计还车分公司" prop="expectArrivalBranchCompanyId">
<el-select class="filter-item" v-model="departureForm.expectArrivalBranchCompanyId" 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="departureForm.expectArrivalBranchCompanyName"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="handleSelectEexpectArrivalCompanyName"
></el-autocomplete>
<!--<el-select class="filter-item" v-model="departureForm.expectArrivalBranchCompanyId" 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> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -1047,12 +1061,14 @@ ...@@ -1047,12 +1061,14 @@
numberPlate: null, numberPlate: null,
departureDate: null, departureDate: null,
departureBranchCompanyId: null, departureBranchCompanyId: null,
departureBranchCompanyName: '',
use: null, use: null,
user: null, user: null,
userTel: null, userTel: null,
checkMan: null, checkMan: null,
checkManTel: null, checkManTel: null,
expectArrivalBranchCompanyId: null, expectArrivalBranchCompanyId: null,
expectArrivalBranchCompanyName: '',
mileage: null mileage: null
}, },
arrivalDialogVisible: false, arrivalDialogVisible: false,
...@@ -1255,6 +1271,22 @@ ...@@ -1255,6 +1271,22 @@
return (restaurant.name.indexOf(queryString.toLowerCase()) != -1); return (restaurant.name.indexOf(queryString.toLowerCase()) != -1);
}; };
}, },
handleSelectDepartureForm(item){
if(item.value == "全部"){
this.departureForm.departureBranchCompanyId = undefined;
} else {
this.departureForm.departureBranchCompanyId = item.id;
}
console.log(item);
},
handleSelectEexpectArrivalCompanyName(item){
if(item.value == "全部"){
this.departureForm.expectArrivalBranchCompanyId = undefined;
} else {
this.departureForm.expectArrivalBranchCompanyId = item.id;
}
console.log(item);
},
handleSelect1(item){ handleSelect1(item){
if(item.value == "全部"){ if(item.value == "全部"){
this.form.subordinateBranch = undefined; this.form.subordinateBranch = undefined;
...@@ -1390,6 +1422,21 @@ ...@@ -1390,6 +1422,21 @@
// open dialog // open dialog
this.departureDialogVisible = true; this.departureDialogVisible = true;
this.clearDepartureForm(); this.clearDepartureForm();
let that = this;
let selectArry = [];
this.allCompaniesArr.map(function(item){
item.value = item.name;
selectArry.push(item);
});
this.departureForm.mileage = row.mileage;
this.departureForm.expectArrivalBranchCompanyId = row.subordinateBranch;
this.departureForm.departureBranchCompanyId = row.subordinateBranch;
selectArry.map(function (iitem) {
if( row.subordinateBranch == iitem.id){
that.departureForm.departureBranchCompanyName = iitem.name;
that.departureForm.expectArrivalBranchCompanyName = iitem.name;
}
});
this.departureForm.vehicleId = row.id; this.departureForm.vehicleId = row.id;
this.departureForm.numberPlate = row.numberPlate; this.departureForm.numberPlate = row.numberPlate;
this.departureForm.departureDate = Date(); this.departureForm.departureDate = Date();
...@@ -1402,6 +1449,7 @@ ...@@ -1402,6 +1449,7 @@
this.departureForm = { this.departureForm = {
vehicleId: null, vehicleId: null,
numberPlate: null, numberPlate: null,
departureBranchCompanyName: '',
departureDate: null, departureDate: null,
departureBranchCompanyId: null, departureBranchCompanyId: null,
use: null, use: null,
...@@ -1410,10 +1458,18 @@ ...@@ -1410,10 +1458,18 @@
checkMan: null, checkMan: null,
checkManTel: null, checkManTel: null,
expectArrivalBranchCompanyId: null, expectArrivalBranchCompanyId: null,
expectArrivalBranchCompanyName: '',
mileage: null mileage: null
} }
}, },
departureVehicleHandler() { departureVehicleHandler() {
console.log(this.departureForm);
if(this.departureForm.expectArrivalBranchCompanyName == "全部" || this.departureForm.expectArrivalBranchCompanyName == ''){
this.departureForm.expectArrivalBranchCompanyId = undefined;
}
if(this.departureForm.departureBranchCompanyName == "全部" || this.departureForm.departureBranchCompanyName == ''){
this.departureForm.departureBranchCompanyId = undefined;
}
departureVehicle(this.departureForm).then(response => { departureVehicle(this.departureForm).then(response => {
if (response.code === rsCode.RS_CODE_SUC) { if (response.code === rsCode.RS_CODE_SUC) {
this.departureDialogVisible = false; this.departureDialogVisible = false;
...@@ -1664,6 +1720,16 @@ ...@@ -1664,6 +1720,16 @@
}, },
create(formName) { create(formName) {
const set = this.$refs; const set = this.$refs;
if(!this.form.state2 || this.form.state2 == "全部"){
this.form.subordinateBranch = undefined;
this.$notify({
title: '失败',
message: '请选择分公司',
type: 'warning',
duration: 2000
});
return;
}
set[formName].validate(valid => { set[formName].validate(valid => {
if (valid) { if (valid) {
let formTemp = this.fillDateRange2Object(this.form, 'insuranceDateRange4form', 'insuranceStartDate', 'insuranceEndDate'); let formTemp = this.fillDateRange2Object(this.form, 'insuranceDateRange4form', 'insuranceStartDate', 'insuranceEndDate');
...@@ -1704,6 +1770,16 @@ ...@@ -1704,6 +1770,16 @@
}, },
update(formName) { update(formName) {
const set = this.$refs; const set = this.$refs;
if(!this.form.state2 || this.form.state2 == "全部"){
this.form.subordinateBranch = undefined;
this.$notify({
title: '失败',
message: '请选择分公司',
type: 'warning',
duration: 2000
});
return;
}
set[formName].validate(valid => { set[formName].validate(valid => {
if (valid) { if (valid) {
let formTemp = this.fillDateRange2Object(this.form, 'insuranceDateRange4form', 'insuranceStartDate', 'insuranceEndDate'); let formTemp = this.fillDateRange2Object(this.form, 'insuranceDateRange4form', 'insuranceStartDate', 'insuranceEndDate');
......
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