ll
liukangdong
2024-11-05 2f8216198bcf091bf7758326aef222d6631b258f
ll
已添加2个文件
已修改6个文件
495 ■■■■■ 文件已修改
admin/src/api/business/cars.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/components/business/OperaMemberWindow.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/components/operation/OperCarUseBookParamWindow.vue 301 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/vehicle/cars.vue 67 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/vehicle/components/OperaCarsImportWindow.vue 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen/src/utils/index.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen/src/views/EnergyConsum.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen/src/views/LogisticsEfficiency.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/api/business/cars.js
@@ -11,6 +11,16 @@
    trim: true
  })
}
export function importExcel (data) {
  return request.post('/visitsAdmin/cloudService/business/cars/importExcel', data)
}
// å¯¼å‡ºExcel
export function exportExcel (data) {
  return request.post('/visitsAdmin/cloudService/business/cars/exportExcel', data, {
    trim: true,
    download: true
  })
}
// åˆ›å»º
export function create (data) {
admin/src/components/business/OperaMemberWindow.vue
@@ -243,6 +243,7 @@
          // this.updateImg = false
          this.form.faceImg = res.imgaddr
          this.form.faceImgFull = res.url
          this.isShowCropper = false
          // this.$emit('uploadSuccess', { imgurl: res.imgaddr, imgurlfull: res.url, name: res.originname })
          // this.$emit('uploadEnd')
        }, () => {
admin/src/components/operation/OperCarUseBookParamWindow.vue
@@ -1,92 +1,40 @@
<template>
  <GlobalWindow
    :title="title"
    width="1000px"
    :visible.sync="visible"
    :confirm-working="isWorking"
    @confirm="confirm"
  >
  <GlobalWindow :title="title" width="1000px" :visible.sync="visible" :confirm-working="isWorking" @confirm="confirm">
    <div class="modal_wrap">
      <el-form :model="form" ref="formRef" class="el_form" :rules="rules">
        <el-form-item label="用车范围" prop="type">
          <el-radio v-model="form.type" style="width: 80px" :label="0"
            >市内用车</el-radio
          >
          <el-radio v-model="form.type" style="width: 80px" :label="1"
            >市外用车</el-radio
          >
          <el-radio v-model="form.type" @change="changeType" style="width: 80px" :label="0">市内用车</el-radio>
          <el-radio v-model="form.type" @change="changeType" style="width: 80px" :label="1">市外用车</el-radio>
        </el-form-item>
        <el-form-item label="选择车辆" prop="carId">
          <el-select v-model="form.carId" @change="clearTime" placeholder="选择车辆">
            <el-option
              v-for="item in carsList"
              :key="item.id"
              :label="item.code"
              :value="item.id"
            >
            <el-option v-for="item in carsList" :key="item.id" :label="item.code" :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="用车时间" prop="startTime">
          <div
            v-if="form.startTime && form.endTime"
            class="sel_btn text"
            @click="openTime"
          >
          <div v-if="form.startTime && form.endTime" class="sel_btn text" @click="openTime">
            {{ form.startTime }}-{{ form.endTime }}
          </div>
          <div v-else class="sel_btn" @click="openTime">选择时间</div>
        </el-form-item>
        <el-form-item label="预计出发时间" prop="planUseDate">
          <el-date-picker
            v-if="form.type == '0'"
            :disabled="!form.startTime"
            v-model="form.planUseDate"
            format="yyyy-MM-dd HH:mm"
            value-format="yyyy-MM-dd HH:mm:ss"
            :picker-options="pickerOptions"
            default-time="08:00:00"
            type="datetime"
            placeholder="选择日期时间"
          />
          <el-date-picker
            v-if="form.type == '1'"
            :disabled="!form.startTime"
            v-model="form.planUseDate"
            format="yyyy-MM-dd HH:mm"
            value-format="yyyy-MM-dd HH:mm:ss"
            :picker-options="pickerOptions2"
            default-time="08:00:00"
            type="datetime"
            placeholder="选择日期时间"
          />
          <el-date-picker v-if="form.type == '0'" :disabled="!form.startTime" v-model="form.planUseDate"
            format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm" type="datetime" placeholder="选择日期时间" />
          <el-date-picker v-if="form.type == '1'" :disabled="!form.startTime" v-model="form.planUseDate"
            format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm" type="datetime" placeholder="选择日期时间" />
        </el-form-item>
        <el-form-item label="目的地" prop="addr">
          <el-input v-model="form.addr" placeholder="请输入内容"></el-input>
        </el-form-item>
        <el-form-item label="乘车人员" prop="memberIds">
          <el-select
            v-model="form.memberIds"
            multiple
            filterable
            placeholder="请选择"
          >
            <el-option
              v-for="item in memberList"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            >
          <el-select v-model="form.memberIds" multiple filterable placeholder="请选择">
            <el-option v-for="item in memberList" :key="item.id" :label="item.name" :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="用车事由" prop="content">
          <el-input
            v-model="form.content"
            type="textarea"
            placeholder="请输入"
            :rows="4"
          ></el-input>
          <el-input v-model="form.content" type="textarea" placeholder="请输入" :rows="4"></el-input>
        </el-form-item>
      </el-form>
      <div class="tip_wrap">
@@ -103,42 +51,25 @@
    </div>
    <!-- å¸‚内 -->
    <el-dialog
      title="选择用车时间"
      :visible.sync="isShowTime"
      append-to-body
      width="640px"
    >
    <el-dialog title="选择用车时间" :visible.sync="isShowTime" append-to-body width="640px">
      <el-form :model="form" ref="modalRef" class="el_form" :rules="rules">
        <el-form-item label="用车日期" prop="dateDay">
          <el-date-picker
            v-model="form.dateDay"
            value-format="yyyy-MM-dd"
            type="date"
            placeholder="选择日期"
          <el-date-picker v-model="form.dateDay" value-format="yyyy-MM-dd" type="date" placeholder="选择日期"
            :picker-options="{
              disabledDate(time) {
                return time.getTime() < Date.now() - 8.64e7;
                return time.getTime() < Date.now() - 8.64e7 * 7;
              },
            }"
            @change="seletedDate"
          >
            }" @change="seletedDate">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="用车时间" prop="dateDay">
          <div>
            <div class="time_list">
              <div
                class="item"
                :class="{
                  disable: item.isUse == 1,
                  active: item.checked == '1',
                  hasSub: item.carUseBookId,
                }"
                @click="datetimeClick(item, i)"
                v-for="(item, i) in timeList"
                :key="i"
              >
              <div class="item" :class="{
                disable: item.pastFlag,
                active: item.checked == '1',
                hasSub: item.carUseBookId,
              }" @click="datetimeClick(item, i)" v-for="(item, i) in timeList" :key="i">
                {{ item.startHours }} - {{ item.endHours }}
              </div>
            </div>
@@ -152,41 +83,25 @@
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <div>已选择:{{ selDatetime }}</div>
        <div style="text-align: left;">
          <div>已选择:{{ selDatetime }}</div>
          <div class="red">{{ selPastDatetime }}</div>
        </div>
        <div class="btn" @click="subTime">确认时间</div>
      </span>
    </el-dialog>
    <!-- å¸‚外 -->
    <el-dialog
      title="选择用车时间"
      :visible.sync="isShowShiwai"
      append-to-body
      width="600px"
      :before-close="clearTime"
    >
    <el-dialog title="选择用车时间" :visible.sync="isShowShiwai" append-to-body width="600px" :before-close="clearTime">
      <el-form :model="form" ref="modalRef" class="el_form" :rules="rules">
        <el-form-item label="用车开始时间" prop="startTime">
          <el-date-picker
            v-model="form.startTime"
            format="yyyy-MM-dd HH:mm:ss"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            :default-time="defaultTime"
            :picker-options="pickerOptionsNow"
            @change="seletedShiwaiDate(1)"
          >
          <el-date-picker v-model="form.startTime" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm"
            type="datetime" :default-time="defaultTime" :picker-options="pickerOptionsNow"
            @change="seletedShiwaiDate(1)">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="用车结束时间" prop="endTime">
          <el-date-picker
            v-model="form.endTime"
            format="yyyy-MM-dd HH:mm:ss"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            :default-time="defaultTime"
            :picker-options="pickerOptions"
            @change="seletedShiwaiDate"
          >
          <el-date-picker v-model="form.endTime" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm"
            type="datetime" :default-time="defaultTime" :picker-options="pickerOptions" @change="seletedShiwaiDate">
          </el-date-picker>
        </el-form-item>
      </el-form>
@@ -202,8 +117,7 @@
            <span>
              {{ item.startTime.slice(5, 16) }}至{{
                item.endTime.slice(5, 16)
              }}</span
            >
              }}</span>
          </div>
          <div class="line">
            <span>目的地</span>
@@ -226,22 +140,18 @@
      <span slot="footer" class="dialog-footer">
        <div>已选择:{{ selDatetime }}</div>
        <div class="btn" :class="{disable: info && info.length > 0}" @click="subTime">确认时间</div>
        <div class="btn" :class="{ disable: info && info.length > 0 }" @click="subTime">确认时间</div>
      </span>
    </el-dialog>
    <!-- è¯¦æƒ… -->
     <el-dialog
      title="选择用车时间"
      :visible.sync="isShowDetail"
      append-to-body
      width="600px"
    >
    <el-dialog title="选择用车时间" :visible.sync="isShowDetail" append-to-body width="600px">
      <div class="detail_modal">
        <div class="title">车辆预约情况</div>
        <div class="h1" v-if="activeInfo.carCode">{{ activeInfo.carCode }}</div>
        <div class="line">
          <div class="label">预计用车时段</div>
          <div class="value" v-if="activeInfo.startTime">{{ activeInfo.startTime.slice(5, 16) }} - {{ activeInfo.endTime.slice(5, 16) }}</div>
          <div class="value" v-if="activeInfo.startTime">{{ activeInfo.startTime.slice(5, 16) }} - {{
            activeInfo.endTime.slice(5, 16) }}</div>
        </div>
        <div class="line">
          <div class="label">目的地</div>
@@ -257,10 +167,11 @@
        </div>
        <div class="line">
          <div class="label">申请人</div>
          <div class="value">{{ activeInfo.memberName }} <span class="primaryColor ml12">{{ activeInfo.memberPhone }}</span></div>
          <div class="value">{{ activeInfo.memberName }} <span class="primaryColor ml12">{{ activeInfo.memberPhone
              }}</span></div>
        </div>
      </div>
     </el-dialog>
    </el-dialog>
  </GlobalWindow>
</template>
@@ -277,7 +188,7 @@
  name: 'OperCarUseBookParamWindow',
  extends: BaseOpera,
  components: { GlobalWindow },
  data () {
  data() {
    return {
      // è¡¨å•数据
      isShowTime: false,
@@ -287,6 +198,7 @@
      timeList: [],
      defaultTime: dayjs().format('HH:mm:ss'),
      selDatetime: '',
      selPastDatetime: '',
      colorOptions: [
        { color: this.$store.state.primaryColor, name: '已选择' },
        { color: '#F7F7F7', name: '可预约' },
@@ -334,7 +246,7 @@
      },
      pickerOptionsNow: {
        disabledDate: (time) => {
          return time.getTime() < Date.now() - 8.64e7;
          return time.getTime() < Date.now() - 8.64e7 * 7
        }
      },
      // éªŒè¯è§„则
@@ -353,23 +265,23 @@
  computed: {
  },
  watch: {
    'form.planUseDate': {
      handler (newValue, oldValue) {
        if (newValue) {
          this.$set(this.pickerOptions, 'selectableRange', this.form.startTime.slice(11, 19) + ' - ' + this.form.endTime.slice(11, 19))
          // this.startPickerOptions = this.startPickerOptions
        }
      },
      deep: true,
      immediate: true
    }
  },
  created () {
  // watch: {
  //   'form.planUseDate': {
  //     handler (newValue, oldValue) {
  //       if (newValue) {
  //         this.$set(this.pickerOptions, 'selectableRange', this.form.startTime.slice(11, 16) + ' - ' + this.form.endTime.slice(11, 16))
  //         // this.startPickerOptions = this.startPickerOptions
  //       }
  //     },
  //     deep: true,
  //     immediate: true
  //   }
  // },
  created() {
    this.initData()
  },
  methods: {
    open () {
    open() {
      this.title = '新建公务车用车申请'
      this.form = {
        type: 0,
@@ -380,7 +292,7 @@
      })
      this.visible = true
    },
    confirm () {
    confirm() {
      const form = JSON.parse(JSON.stringify(this.form))
      this.$refs.formRef.validate((valid) => {
        const memberList = []
@@ -394,6 +306,9 @@
        form.memberNames = memberList.map(i => i.name).join(',')
        form.memberList = memberList
        form.memberIds = form.memberIds.join(',')
        form.startTime = form.startTime + ':00'
        form.planUseDate = form.planUseDate + ':00'
        form.endTime = form.endTime + ':59'
        if (valid) {
          carUseBookCraete({
            ...form
@@ -404,7 +319,7 @@
        }
      })
    },
    openTime () {
    openTime() {
      const { form } = this
      if (!form.carId) {
        return this.$tip.error('请先选择车辆')
@@ -419,7 +334,15 @@
        this.isShowShiwai = true
      }
    },
    clearTime () {
    changeType() {
      this.$set(this.form, 'startTime', '')
      this.$set(this.form, 'endTime', '')
      this.$set(this.form, 'planUseDate', '')
      this.$nextTick(() => {
        this.$refs.formRef.clearValidate()
      })
    },
    clearTime() {
      this.isShowShiwai = false
      this.$set(this.form, 'startTime', '')
      this.$set(this.form, 'endTime', '')
@@ -429,17 +352,17 @@
        }
      })
    },
    subTime () {
    subTime() {
      if (this.info && this.info.length > 0) return
      if (this.form.type === 0) {
        const selTimeList = this.timeList.filter(i => i.checked == '1')
        if (selTimeList.length === 0) {
          return this.$tip.error('请先选择用车时间段')
        }
        this.$set(this.form, 'startTime', selTimeList[0].startTime)
        this.$set(this.form, 'endTime', selTimeList[selTimeList.length - 1].endTime)
        this.$set(this.form, 'startTime', selTimeList[0].startTime.slice(0, 16))
        this.$set(this.form, 'endTime', selTimeList[selTimeList.length - 1].endTime.slice(0, 16))
        this.isShowTime = false
        this.$set(this.form, 'planUseDate', null)
        this.$set(this.form, 'planUseDate', selTimeList[0].startTime.slice(0, 16))
        this.$forceUpdate()
      } else {
        this.$refs.modalRef.validate((valid) => {
@@ -447,11 +370,15 @@
          if (new Date(form.startTime).getTime() > new Date(form.endTime).getTime()) {
            return this.$tip.error('结束时间应大于开始时间')
          }
          this.$set(this.form, 'planUseDate', form.startTime)
          this.$forceUpdate()
          this.isShowShiwai = false
        })
      }
      console.log('form', this.form)
    },
    datetimeClick (item, index) {
    datetimeClick(item, index) {
      if (item.carUseBookId) {
        detail(
          item.carUseBookId
@@ -497,30 +424,37 @@
      // console.log('selTimeList', selTimeList);
      if (selTimeLists.length === 0) {
        this.selDatetime = ''
        this.selPastDatetime = ''
      } else {
        let pastList = selTimeLists.filter(i => i.pastFlag)
        if(pastList.length > 0){
          this.selPastDatetime = '当前选择包含已经过去时间,请确认后再提交;'
        }else{
          this.selPastDatetime = ''
        }
        this.selDatetime = this.form.dateDay.slice(5) + ' ' + selTimeLists[0].startHours + '-' + selTimeLists[selTimeLists.length - 1].endHours
      }
    },
    seletedDate (e) {
    seletedDate(e) {
      this.gettimes()
    },
    seletedShiwaiDate (str) {
    seletedShiwaiDate(str) {
      const { form } = this
      if(str && str == 1){
      if (str && str == 1) {
        this.$set(this.form, 'endTime', '')
      }
      if (form.startTime && form.endTime) {
        this.selDatetime = form.startTime + ' - ' + form.endTime
        carUseBookList({
          carId: form.carId,
          startTime: form.startTime,
          endTime: form.endTime
          startTime: form.startTime + ':00',
          endTime: form.endTime + ':59'
        }).then(res => {
          this.info = res || []
        })
      }
    },
    gettimes () {
    gettimes() {
      const { form } = this
      carCanReservationDate({
        dateDay: form.dateDay,
@@ -528,12 +462,14 @@
      }).then(res => {
        this.timeList = res || []
        this.timeList.forEach((i, j) => {
          i.pastFlag = new Date().getTime() > new Date(i.startTime).getTime()
          i.checked = '0',
          i.index = j
        })
      })
    },
    initData () {
    initData() {
      getCarList({
        type: 0
      }).then(res => {
@@ -553,14 +489,18 @@
<style scoped lang="scss">
@import "@/assets/style/variables.scss";
div {
  box-sizing: border-box;
}
.modal_wrap {
  display: flex;
  padding: 20px 0;
  .el_form {
    flex: 1;
    .sel_btn {
      width: 100%;
      height: 32px;
@@ -574,25 +514,31 @@
      box-sizing: border-box;
      cursor: pointer;
    }
    .text {
      color: #606266;
    }
  }
  .tip_wrap {
    flex: 1;
    margin-left: 30px;
    padding: 0 30px;
    h1 {
      margin-bottom: 20px;
    }
    div {
      line-height: 28px;
    }
  }
  }
}
.time_list {
  display: flex;
  flex-wrap: wrap;
  .item {
    margin-right: 8px;
    margin-bottom: 8px;
@@ -609,28 +555,33 @@
    border: #cccccc solid 1px;
    cursor: pointer;
  }
  .active {
    border-color: $primary-color;
    background-color: #f6f9fe;
    color: $primary-color;
  }
  .disable {
    color: #fff;
    border-color: #cccccc;
    background-color: #cccccc;
  }
  .active {
    border-color: $primary-color;
    background-color: #f6f9fe;
    color: $primary-color;
  }
  .hasSub {
    border-color: #bed6f9;
    background-color: #bed6f9;
    color: #fff;
    }
  }
}
.color_op {
  display: flex;
  .item {
    display: flex;
    align-items: center;
    margin-right: 10px;
    .box {
      margin-right: 4px;
      width: 16px;
@@ -638,10 +589,12 @@
    }
  }
}
.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  .btn {
    height: 42px;
    line-height: 42px;
@@ -651,21 +604,26 @@
    text-align: center;
    cursor: pointer;
  }
  .disable{
  .disable {
    background: #cccccc;
  }
}
.have_info {
  padding: 0 0 60px;
  .tit {
    color: #ed4545;
    margin: 20px 0 12px;
  }
  .content {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 15px 15px 5px;
    margin-bottom: 10px;
    .card {
      margin-bottom: 15px;
      font-weight: 500;
@@ -674,14 +632,17 @@
      background: #f7f7f7;
      padding: 0;
    }
    .line {
      display: flex;
      margin-bottom: 10px;
      span {
        &:nth-of-type(1) {
          width: 80px;
          color: #888888;
        }
        &:nth-of-type(2) {
          flex: 1;
        }
@@ -689,26 +650,32 @@
    }
  }
}
.detail_modal {
  padding: 20px 15px;
  .title {
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 20px;
  }
  .h1 {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 16px;
  }
  .line {
    display: flex;
    margin-bottom: 10px;
    .label {
      width: 120px;
      color: #888888;
    }
    .value {
      color: #333333;
    }
admin/src/views/vehicle/cars.vue
@@ -9,10 +9,14 @@
        <el-input v-model="searchForm.memberName" clearable placeholder="车主信息"
          @keypress.enter.native="search"></el-input>
      </el-form-item>
      <!-- <el-form-item label="" prop="cateName" title="车辆分类名称">
        <el-input v-model="searchForm.cateName" clearable placeholder="车辆分类名称"
          @keypress.enter.native="search"></el-input>
      </el-form-item> -->
      <el-form-item label="" prop="catePName" title="分类名称">
        <el-cascader v-model="searchForm.cateIds" @change="changeSel" clearable :options="cateList" :props="{
          label: 'name',
          value: 'id',
          children: 'childCategoryList',
          checkStrictly: true
        }"></el-cascader>
      </el-form-item>
      <el-form-item label="" prop="companyName" title="车主组织名称">
        <el-input v-model="searchForm.companyName" clearable placeholder="车主组织名称"
          @keypress.enter.native="search"></el-input>
@@ -37,9 +41,14 @@
    </el-form>
    <!-- è¡¨æ ¼å’Œåˆ†é¡µ -->
    <template v-slot:table-wrap>
      <ul class="toolbar" v-permissions="['business:cars:create', 'business:parkBook:create']">
      <ul class="toolbar"
        v-permissions="['business:cars:create', 'business:cars:exportExcel', 'business:parkBook:create']">
        <li><el-button type="primary" @click="handleEdit" icon="el-icon-plus"
            v-permissions="['business:cars:create']">新建</el-button></li>
        <li><el-button type="primary" @click="$refs.OperaCarsImportWindowRef.open('人员导入', searchForm.companyType)" v-permissions="['business:cars:create']">车辆导入</el-button>
        </li>
        <li><el-button type="primary" @click="exportExcel" v-permissions="['business:cars:exportExcel']">导出</el-button>
        </li>
        <li><el-button type="primary" @click="startEmpowerBatch" icon="el-icon-plus"
            v-permissions="['business:parkbook:create']">下发授权</el-button></li>
      </ul>
@@ -55,7 +64,8 @@
        </el-table-column>
        <el-table-column prop="memberName" label="车主姓名" min-width="100px"></el-table-column>
        <el-table-column prop="memberPhone" label="车主手机号" min-width="100px"></el-table-column>
        <el-table-column prop="cateName" label="车辆分类" min-width="160px"></el-table-column>
        <el-table-column prop="catePName" label="一级分类" min-width="120px"></el-table-column>
        <el-table-column prop="cateName" label="二级分类" min-width="120px"></el-table-column>
        <el-table-column prop="companyName" label="车主组织" min-width="200px"></el-table-column>
        <el-table-column label="是否授权" align="center" min-width="100px">
          <template slot-scope="{row}">
@@ -70,7 +80,7 @@
                <span
                  :style="(item.hkStatus == 0 ? 'color:#2080f7' : (item.hkStatus == 1 ? 'color:green' : (item.hkStatus == 2 ? 'color:red' : '')))">【{{
                    item.hkStatus ==
                      0 ? '等待下发' : (item.hkStatus == 1 ? '下发成功' : (item.hkStatus == 2 ?'下发失败':''))}}】 </span>{{
                      0 ? '等待下发' : (item.hkStatus == 1 ? '下发成功' : (item.hkStatus == 2 ? '下发失败' : '')) }}】 </span>{{
                    item.parksName }}
              </span>
            </div>
@@ -111,6 +121,7 @@
    </template>
    <!-- æ–°å»º/修改 -->
    <OperaCarAuthWindow ref="operaCarAuthWindow" @success="handlePageChange" />
    <OperaCarsImportWindow ref="OperaCarsImportWindowRef" @success="handlePageChange" />
    <OperaCarsWindow v-if="isShowEdit" ref="operaCarsWindow" @close="isShowEdit = false" @success="handlePageChange" />
  </TableLayout>
</template>
@@ -121,10 +132,12 @@
import Pagination from '@/components/common/Pagination'
import OperaCarsWindow from '@/components/business/OperaCarsWindow'
import OperaCarAuthWindow from '@/components/business/OperaCarAuthWindow'
import OperaCarsImportWindow from './components/OperaCarsImportWindow'
import { fetchList } from '@/api/business/category.js'
export default {
  name: 'Cars',
  extends: BaseTable,
  components: { TableLayout, Pagination, OperaCarsWindow, OperaCarAuthWindow },
  components: { TableLayout, Pagination, OperaCarsWindow, OperaCarAuthWindow,OperaCarsImportWindow },
  data() {
    return {
      // æœç´¢
@@ -132,10 +145,16 @@
        code: '',
        memberName: '',
        companyName: '',
        cateIds: [],
        catePId: '',
        cateId: '',
        type: null,
        authStatus: null
        authStatus: null,
        ids: ''
      },
      isShowEdit: false
      isShowEdit: false,
      cateList: [],
      selIdsList: []
    }
  },
  created() {
@@ -146,8 +165,36 @@
      'field.main': 'id'
    })
    this.search()
    this.getCate()
  },
  methods: {
    handleSelectionChange(e) {
      this.searchForm.ids = e.map(i => i.id).join(',')
    },
    changeSel(e) {
      console.log(e)
      if (e && e.length == 1) {
        this.$set(this.searchForm, 'catePId', e[0])
        this.$set(this.searchForm, 'cateId', '')
      } else if (e && e.length == 2) {
        this.$set(this.searchForm, 'catePId', e[0])
        this.$set(this.searchForm, 'cateId', e[1])
      } else {
        this.$set(this.searchForm, 'catePId', '')
        this.$set(this.searchForm, 'cateId', '')
      }
      this.search()
    },
    getCate() {
      fetchList({
        model: {},
        capacity: 1000,
        page: 1,
      }).then(res => {
        this.cateList = res.records || []
      })
    },
    handleEdit(row) {
      this.isShowEdit = true
      let str = row && row.id ? '编辑车辆' : '新建车辆'
admin/src/views/vehicle/components/OperaCarsImportWindow.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,84 @@
<template>
  <el-dialog
      class="center-title"
      :title="title"
      width="500px"
      top="30vh"
      :visible.sync="visible"
      :confirm-working="isWorking"
      @confirm="confirm"
  >
    <p class="tip-warn"><i class="el-icon-warning"></i>导入说明:<br>
      1.请先下载文件模板,并按照模板要去填写表格内容;<br>
    </p>
    <el-form class="demo-form-inline" >
      <el-form-item label="车辆信息" required>
        <div style="width: 100%;display: flex;align-items: center;">
          <el-button type="primary"   @click="clickRef">点击上传</el-button>
          <el-button type="text" @click="exportTemplate">点击下载模版.EXCEL</el-button>
        </div>
        <div style="font-size: 14px; color: black;" v-if="fileName">{{fileName}}</div>
      </el-form-item>
    </el-form>
    <input type="file" style="position: fixed; left: 0; top: -50px;" accept=".xlsx" ref="fileExcel" @change="result" />
    <template   v-slot:footer>
      <el-button @click="visible=false">返回</el-button>
    </template>
  </el-dialog>
</template>
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import { importExcel } from '@/api/business/cars'
export default {
  extends: BaseOpera,
  // eslint-disable-next-line vue/no-unused-components
  components: { GlobalWindow },
  data () {
    return {
      importing:false,
      fileName: '',
      companyType: 0
    }
  },
  methods: {
    open (title, companyType) {
      this.title = title
      this.fileName = ''
      this.visible = true
      this.companyType = companyType
    },
    // å¯¼å‡ºæ¨¡æ¿
    exportTemplate () {
      // æŠ•保申请
      window.open('/template/member.xlsx')
    },
    clickRef () {
      this.$refs.fileExcel.click()
    },
    result (e) {
      const data = new FormData()
      data.append('file', e.target.files[0])
      // data.append('companyType', this.companyType)
      importExcel(data)
        .then(res => {
          this.$message.success('导入成功')
          this.$emit('success')
          this.visible = false
        })
        .catch(err => {
          // this.$message.error(err)
          this.fileName = ''
        })
        .finally(() => {
          this.$refs.fileExcel.value = null
        })
    }
  }
}
</script>
<style lang="scss" scoped>
</style>
screen/src/utils/index.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,6 @@
export const formatNum = (num) => {
  if(!num ) return 0
  if(num > 1000000){
  }
}
screen/src/views/EnergyConsum.vue
@@ -25,7 +25,7 @@
              <img src="@/assets/images/nenghao_ic1.png" class="co2" alt="">
              <div>
                <div class="name">本年累计循环烟箱</div>
                <div><span class="num">{{ data1.smokeBoxTotal }}</span><span>只</span></div>
                <div><span class="num" v-if="data1.smokeBoxTotal">{{ data1.smokeBoxTotal.toLocaleString() }}</span><span>只</span></div>
              </div>
            </div>
          </div>
@@ -69,7 +69,7 @@
                  <img class="icon" src="@/assets/images/ic_yongdian@2x.png" alt="" />
                  <div class="content">
                    <div class="name">上月用电(kw·h)</div>
                    <div class="num">{{ data1.electricityQuantity }}</div>
                    <div class="num" v-if="data1.electricityQuantity">{{ data1.electricityQuantity.toLocaleString() }}</div>
                  </div>
                </div>
                <div class="static">
@@ -86,7 +86,7 @@
                  <img class="icon" src="@/assets/images/ic_yongshui@2x.png" alt="" />
                  <div class="content">
                    <div class="name">上月用水(t)</div>
                    <div class="num">{{ data1.waterQuantity }}</div>
                    <div class="num" v-if="data1.waterQuantity">{{ data1.waterQuantity.toLocaleString() }}</div>
                  </div>
                </div>
                <div class="static">
@@ -103,7 +103,7 @@
                  <img class="icon" src="@/assets/images/ic_yongqi@2x.png" alt="" />
                  <div class="content">
                    <div class="name">上月用气(t)</div>
                    <div class="num">{{ data1.gasQuantity }}</div>
                    <div class="num" v-if="data1.gasQuantity">{{ data1.gasQuantity.toLocaleString() }}</div>
                  </div>
                </div>
                <div class="static">
@@ -179,7 +179,7 @@
              <img src="@/assets/images/ic_co2@2x.png" class="co2" alt="">
              <div>
                <div class="name">本月累计碳排放</div>
                <div><span class="num">{{ data1.carbon }}</span><span>吨</span></div>
                <div><span class="num" v-if="data1.carbon">{{ data1.carbon.toLocaleString() }}</span><span>吨</span></div>
              </div>
            </div>
          </div>
@@ -197,7 +197,7 @@
                <div class="top"><span v-if="i < 3">top</span>{{ i }}</div>
                <div class="id_card">{{ item.carNo }}</div>
                <div class="wrap">
                  <ChargeRate :rate="item.rate" :color />
                  <ChargeRate :rate="item.rate" :color="i > 2 ? 'cyan': '#e3a83a'" />
                </div>
                <div class="num">{{ item.quantity }}</div>
              </div>
@@ -303,7 +303,7 @@
    grid: {
      top: '26%',
      left: '4%',
      right: '2%',
      right: '6%',
      bottom: '2%',
      containLabel: true
    },
@@ -476,8 +476,8 @@
  // ç»˜åˆ¶å›¾è¡¨
  myChart.setOption({
    grid: {
      top: '26%',
      left: '2%',
      top: '24%',
      left: '6%',
      right: '2%',
      bottom: '4%',
      containLabel: true
@@ -494,7 +494,7 @@
    },
    yAxis: {
      type: 'value',
      name: 'kw·h',
      name: '单位:kw·h',
      nameTextStyle: {
        padding: [0, 0, 4, -30]    // å››ä¸ªæ•°å­—分别为上右下左与原位置距离
      },
@@ -520,7 +520,7 @@
                { offset: 1, color: '#1d4861' }
              ]
            ),
            barBorderRadius: [10, 10, 0, 0]
            barBorderRadius: [3, 3, 0, 0]
          }
        }
      }
screen/src/views/LogisticsEfficiency.vue
@@ -28,7 +28,7 @@
            </div>
            <div class="content_wrap">
              <div class="content">
                <div class="num">{{ activeTab1 == 0 ? data1.monthOutTotal : data1.yearOutTotal }}</div>
                <div class="num" v-if="data1.monthOutTotal || data1.yearOutTotal">{{ activeTab1 == 0 ? data1.monthOutTotal.toLocaleString() : data1.yearOutTotal.toLocaleString() }}</div>
                <div class="unit_wrap" v-if="data1.monthOutTotalOnYear || data1.yearOutTotalOnYear">
                  <span style="color: #869CC9;">同比</span>
                  <img
@@ -714,7 +714,7 @@
  getData5()
  getData6()
  initMap()
   initMap()
})