| | |
| | | <Card> |
| | | <Row class="operation"> |
| | | <Button @click="addCar" type="primary" icon="md-add">添加车辆</Button> |
| | | <Button @click="delAll" icon="md-trash">批量删除</Button> |
| | | <Button @click="init" icon="md-refresh">刷新</Button> |
| | | <Button type="dashed" @click="openTip = !openTip">{{ |
| | | openTip ? "关闭提示" : "开启提示" |
| | | }}</Button> |
| | | <Input |
| | | v-model="searchForm.carNo" |
| | | v-model="searchForm2.carNo" |
| | | suffix="ios-search" |
| | | @on-change="getDataList" |
| | | @on-change="getDataList2" |
| | | placeholder="输入车牌号搜索" |
| | | clearable |
| | | style="width: 250px" |
| | |
| | | <FormItem label="牌照" prop="carNo"> |
| | | <Input v-model="carForm.carNo" /> |
| | | </FormItem> |
| | | <FormItem label="驾驶人" prop="userId"> |
| | | <FormItem label="加油卡号" prop="addOilCode"> |
| | | <Input v-model="carForm.addOilCode" /> |
| | | </FormItem> |
| | | <FormItem label="车辆编号" prop="code"> |
| | | <Input v-model="carForm.code" /> |
| | | </FormItem> |
| | | <FormItem label="司机" prop="userId"> |
| | | <Select v-model="carForm.userId" filterable> |
| | | <Option v-for="item in userList" :value="item.id">{{ item.nickname }}</Option> |
| | | <Option :value="0">请选择</Option> |
| | | <Option v-for="item in userList" :value="item.id" :key="item.id">{{ item.nickname }}</Option> |
| | | </Select> |
| | | </FormItem> |
| | | <FormItem label="跟车人" prop="followUserId"> |
| | | <FormItem label="配送员" prop="followUserId"> |
| | | <Select v-model="carForm.followUserId" filterable> |
| | | <Option v-for="item in userList" :value="item.id">{{ item.nickname }}</Option> |
| | | <Option :value="0" :key="0">请选择</Option> |
| | | <Option v-for="item in driverList" :value="item.id" :key="item.id">{{ item.nickname }}</Option> |
| | | </Select> |
| | | </FormItem> |
| | | </Form> |
| | |
| | | </Modal> |
| | | <Modal :title="modalTitle" v-model="addEquipmentVisible" :mask-closable="false" :width="500"> |
| | | <Form ref="equipmentForm" :model="equipmentForm" :label-width="80" :rules="equipmentFormValidate"> |
| | | <FormItem label="设备" prop="type"> |
| | | <FormItem label="设备类型" prop="type"> |
| | | <Select v-model="equipmentForm.type"> |
| | | <Option :value="0">车机</Option> |
| | | <Option :value="1">摄像机</Option> |
| | |
| | | <Option :value="3">pad</Option> |
| | | </Select> |
| | | </FormItem> |
| | | <FormItem label="设备" prop="status"> |
| | | <FormItem label="状态" prop="status"> |
| | | <Select v-model="equipmentForm.status"> |
| | | <Option :value="0">正常</Option> |
| | | <Option :value="1">停用</Option> |
| | | <Option :value="1">异常</Option> |
| | | </Select> |
| | | </FormItem> |
| | | <FormItem label="编号" prop="code"> |
| | |
| | | getEquipment, |
| | | addEquipment, |
| | | getUser, |
| | | getDriver, |
| | | deleteEquipment, |
| | | } from "@/api/open"; |
| | | import util from "@/libs/util.js"; |
| | |
| | | order: "desc", // 默认排序方式 |
| | | key: "", |
| | | }, |
| | | searchForm2: { |
| | | // 搜索框初始化对象 |
| | | pageNumber: 1, // 当前页数 |
| | | pageSize: 10, // 页面大小 |
| | | sort: "createTime", // 默认排序字段 |
| | | order: "desc", // 默认排序方式 |
| | | key: "", |
| | | }, |
| | | carForm: { |
| | | status : 0 |
| | | }, |
| | | type: { |
| | | type : 0 |
| | | }, |
| | | equipmentForm: { |
| | | status : 0 |
| | |
| | | { |
| | | title: "车牌号", |
| | | key: "carNo", |
| | | width: 110, |
| | | sortable: true, |
| | | }, |
| | | { |
| | | title: "司机", |
| | | key: "nickName", |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: "配送员", |
| | | key: "followNickName", |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: "品牌", |
| | | key: "brand", |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: "型号", |
| | | key: "model", |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: "排量", |
| | | key: "displacement", |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: "加油卡号", |
| | | key: "addOilCode", |
| | | minWidth: 120, |
| | | // sortable: true, |
| | | render: (h, params) => { |
| | | return h("div",params.row.addOilCode=="undefined" ? '':params.row.addOilCode); |
| | | } |
| | | }, |
| | | { |
| | | title: "编号", |
| | | key: "code", |
| | | minWidth: 120, |
| | | tooltip:true, |
| | | // render: (h, params) => { |
| | | // return h("div",params.row.code=="undefined" ? '':params.row.code); |
| | | // } |
| | | }, |
| | | { |
| | | title: "购置年份", |
| | | key: "buyYear", |
| | | minWidth: 120, |
| | | sortable: true, |
| | | }, |
| | | { |
| | | title: "登记日期", |
| | | key: "createTime", |
| | | minWidth: 180, |
| | | sortable: true, |
| | | }, |
| | | { |
| | |
| | | title: "移除原因", |
| | | key: "removeReason", |
| | | width: 170, |
| | | sortable: true, |
| | | }, |
| | | { |
| | | title: "驾驶人", |
| | | key: "nickName", |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: "跟车人", |
| | | key: "followNickName", |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: "品牌", |
| | | key: "brand", |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: "型号", |
| | | key: "model", |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: "排量", |
| | | key: "displacement", |
| | | width: 100, |
| | | sortable: true, |
| | | }, |
| | | { |
| | | title: "购置年份", |
| | | key: "buyYear", |
| | | minWidth: 120, |
| | | sortable: true, |
| | | }, |
| | | { |
| | |
| | | depData: [], |
| | | dataType: 0, |
| | | carId: '', |
| | | driverList: [], |
| | | userList: [], |
| | | editDepartments: [], |
| | | buyYear:'' |
| | |
| | | this.getDataList(); |
| | | }, |
| | | getAllUser(){ |
| | | getUser().then((res)=>{ |
| | | getDriver({type:0}).then((res)=>{ |
| | | if (res.success){ |
| | | this.userList=res.result; |
| | | } |
| | | }); |
| | | //this.type.type=1; |
| | | getDriver({type:1}).then((res)=>{ |
| | | if (res.success){ |
| | | this.driverList=res.result; |
| | | } |
| | | }); |
| | | this.type.type=0; |
| | | console.log(this.userList); |
| | | console.log(this.driverList); |
| | | }, |
| | | changeSort(e) { |
| | | this.searchForm.sort = e.key; |
| | |
| | | } |
| | | }); |
| | | }, |
| | | getDataList2() { |
| | | this.loading = true; |
| | | getCarList(this.searchForm2).then((res) => { |
| | | this.loading = false; |
| | | if (res.success) { |
| | | this.data = res.result.records; |
| | | this.total = res.result.total; |
| | | } |
| | | }); |
| | | }, |
| | | getEquipmentList(carId) { |
| | | this.loading = true; |
| | | this.searchForm.carId=carId; |
| | | getEquipment(this.searchForm).then((res) => { |
| | | this.searchForm2.carId=carId; |
| | | getEquipment(this.searchForm2).then((res) => { |
| | | this.loading = false; |
| | | if (res.success) { |
| | | this.data2 = res.result.records; |
| | |
| | | this.roleModalVisible = false; |
| | | }, |
| | | submitCar() { |
| | | if(this.carForm.userId==undefined || this.carForm.userId==0){ |
| | | this.carForm.userId=""; |
| | | } |
| | | if(this.carForm.followUserId==undefined || this.carForm.followUserId==0){ |
| | | this.carForm.followUserId=""; |
| | | } |
| | | this.carForm.buyYear = this.buyYear; |
| | | this.$refs.carForm.validate((valid) => { |
| | | if (valid) { |
| | |
| | | this.equipmentVisible = true; |
| | | }, |
| | | addCar() { |
| | | this.carForm={}; |
| | | this.getAllUser(); |
| | | this.modalType = 0; |
| | | this.modalTitle = "添加车辆"; |
| | |
| | | this.init(); |
| | | }, |
| | | }; |
| | | </script> |
| | | </script> |