| | |
| | | <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 :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 :value="0" :key="0">请选择</Option> |
| | | <Option v-for="item in driverList" :value="item.id" :key="item.id">{{ item.nickname }}</Option> |
| | | </Select> |
| | | </FormItem> |
| | |
| | | sortable: true, |
| | | }, |
| | | { |
| | | title: "驾驶人", |
| | | title: "司机", |
| | | key: "nickName", |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: "跟车人", |
| | | title: "配送员", |
| | | key: "followNickName", |
| | | 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, |
| | | sortable: 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, |
| | | }, |
| | | { |
| | |
| | | this.getDataList(); |
| | | }, |
| | | getAllUser(){ |
| | | getDriver(this.type).then((res)=>{ |
| | | getDriver({type:0}).then((res)=>{ |
| | | if (res.success){ |
| | | this.userList=res.result; |
| | | } |
| | | }); |
| | | this.type.type=1; |
| | | getDriver(this.type).then((res)=>{ |
| | | //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; |
| | |
| | | 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) { |
| | |
| | | if (res.success) { |
| | | this.$Message.success("操作成功"); |
| | | this.getDataList(); |
| | | this.roleModalVisible = true; |
| | | this.roleModalVisible = false; |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | if (res.success) { |
| | | this.$Message.success("操作成功"); |
| | | this.getDataList(); |
| | | this.roleModalVisible = true; |
| | | this.roleModalVisible = false; |
| | | } |
| | | }); |
| | | } |
| | |
| | | this.equipmentVisible = true; |
| | | }, |
| | | addCar() { |
| | | this.carForm={}; |
| | | this.getAllUser(); |
| | | this.modalType = 0; |
| | | this.modalTitle = "添加车辆"; |