Compare commits

..

No commits in common. "2a9835745a87499937e6936fc0163d414a652e1d" and "c9b41247fa57b0ba209ae4c0dfd8312e9c120673" have entirely different histories.

2 changed files with 36 additions and 42 deletions

View File

@ -494,6 +494,7 @@ export default {
this.getConfigKey("sys.user.initPassword").then(response => { this.getConfigKey("sys.user.initPassword").then(response => {
this.initPassword = response.data.msg; this.initPassword = response.data.msg;
}); });
this.gerCompany()
}, },
methods: { methods: {
/** 查询用户列表 */ /** 查询用户列表 */
@ -512,6 +513,12 @@ export default {
this.deptOptions = response.data; this.deptOptions = response.data;
}); });
}, },
/** 获取公司列表 */
gerCompany(){
companyList().then(res=>{
this.companyList=res.data
})
},
// //
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;

View File

@ -239,6 +239,12 @@
<el-form-item label="车牌号码" prop="licenseNumber"> <el-form-item label="车牌号码" prop="licenseNumber">
<el-input v-model="form.licenseNumber" placeholder="请输入车牌号码" /> <el-input v-model="form.licenseNumber" placeholder="请输入车牌号码" />
</el-form-item> </el-form-item>
<el-form-item label="持有者" prop="holder">
<el-input v-model="form.holder" placeholder="请输入持有者" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -250,7 +256,6 @@
<script> <script>
import { listVehicle, getVehicle, delVehicle, addVehicle, updateVehicle } from "@/api/vehicle/vehicle"; import { listVehicle, getVehicle, delVehicle, addVehicle, updateVehicle } from "@/api/vehicle/vehicle";
import {getInfo} from "@/api/login";
export default { export default {
name: "Vehicle", name: "Vehicle",
@ -298,30 +303,21 @@ export default {
form: {}, form: {},
// //
rules: { rules: {
}, }
userList:null,
}; };
}, },
created() { created() {
this.getList(); this.getList();
}, },
methods: { methods: {
/** 查询车辆列表 */ /** 查询车辆列表 */
getList() { getList() {
getInfo().then(res=>{ this.loading = true;
this.userList=res.data.user.nickName listVehicle(this.queryParams).then(response => {
console.log(this.userList) this.vehicleList = response.data.rows;
this.queryParams.holder=this.userList this.total = response.data.total;
this.loading = true; this.loading = false;
console.log(this.queryParams) });
listVehicle(this.queryParams).then(response => {
this.vehicleList = response.data.rows;
this.total = response.data.total;
this.loading = false;
});
})
}, },
// //
cancel() { cancel() {
@ -389,32 +385,23 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
getInfo().then(res=>{ this.$refs["form"].validate(valid => {
this.userList=res.data.user.nickName if (valid) {
console.log(this.userList) if (this.form.id != null) {
this.form.holder=this.userList updateVehicle(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.$refs["form"].validate(valid => { this.open = false;
if (valid) { this.getList();
if (this.form.id != null) { });
updateVehicle(this.form).then(response => { } else {
this.$modal.msgSuccess("修改成功"); addVehicle(this.form).then(response => {
this.open = false; this.$modal.msgSuccess("新增成功");
this.getList(); this.open = false;
}); this.getList();
} else { });
addVehicle(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
})
}
} }
}) }
});
})
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {