wang-hao-jie
2022-01-05 3a9879dfcf271846605c7f896d0397472cf5e839
src/views/your/car-manage/carManage.vue
@@ -8,7 +8,6 @@
    <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 ? "关闭提示" : "开启提示"
@@ -81,14 +80,17 @@
        <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="userId">
          <Select v-model="carForm.userId" filterable>
            <Option v-for="item in userList" :value="item.id">{{ item.nickname }}</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 v-for="item in driverList" :value="item.id" :key="item.id">{{ item.nickname }}</Option>
          </Select>
        </FormItem>
      </Form>
@@ -244,6 +246,7 @@
  getEquipment,
  addEquipment,
  getUser,
  getDriver,
  deleteEquipment,
} from "@/api/open";
import util from "@/libs/util.js";
@@ -281,6 +284,9 @@
      carForm: {
        status : 0
      },
      type: {
        type : 0
      },
      equipmentForm: {
        status : 0
      },
@@ -308,7 +314,7 @@
        {
          title: "车牌号",
          key: "carNo",
          width: 100,
          width: 110,
          sortable: true,
        },
        {
@@ -346,12 +352,12 @@
          sortable: true,
        },
        {
          title: "驾驶人",
          title: "司机",
          key: "nickName",
          width: 100,
        },
        {
          title: "跟车人",
          title: "配送员",
          key: "followNickName",
          width: 100,
        },
@@ -372,9 +378,21 @@
          sortable: true,
        },
        {
          title: "加油卡号",
          key: "addOilCode",
          minWidth: 120,
          sortable: true,
        },
        {
          title: "购置年份",
          key: "buyYear",
          minWidth: 120,
          sortable: true,
        },
        {
          title: "登记日期",
          key: "createTime",
          minWidth: 180,
          sortable: true,
        },
        {
@@ -593,6 +611,7 @@
      depData: [],
      dataType: 0,
      carId: '',
      driverList: [],
      userList: [],
      editDepartments: [],
      buyYear:''
@@ -663,11 +682,20 @@
      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;