From abc14c4f8a402e4c41b0645bfa0e1c797f0210a1 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 05 十一月 2024 19:07:49 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
admin/src/components/operation/OperCarUseBookParamWindow.vue | 301 ++++++++++++++------------------
admin/src/components/business/OperaMemberWindow.vue | 1
screen/src/utils/index.js | 6
admin/src/views/vehicle/cars.vue | 67 ++++++-
admin/public/template/cars.xlsx | 0
screen/src/views/LogisticsEfficiency.vue | 4
admin/src/api/business/cars.js | 10 +
screen/src/views/EnergyConsum.vue | 22 +-
admin/src/views/vehicle/components/OperaCarsImportWindow.vue | 84 +++++++++
9 files changed, 305 insertions(+), 190 deletions(-)
diff --git a/admin/public/template/cars.xlsx b/admin/public/template/cars.xlsx
index e82a64b..96713fd 100644
--- a/admin/public/template/cars.xlsx
+++ b/admin/public/template/cars.xlsx
Binary files differ
diff --git a/admin/src/api/business/cars.js b/admin/src/api/business/cars.js
index a9802ff..49ecf90 100644
--- a/admin/src/api/business/cars.js
+++ b/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) {
diff --git a/admin/src/components/business/OperaMemberWindow.vue b/admin/src/components/business/OperaMemberWindow.vue
index ff2e2f6..8800e11 100644
--- a/admin/src/components/business/OperaMemberWindow.vue
+++ b/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')
}, () => {
diff --git a/admin/src/components/operation/OperCarUseBookParamWindow.vue b/admin/src/components/operation/OperCarUseBookParamWindow.vue
index fddb479..5e67444 100644
--- a/admin/src/components/operation/OperCarUseBookParamWindow.vue
+++ b/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;
}
diff --git a/admin/src/views/vehicle/cars.vue b/admin/src/views/vehicle/cars.vue
index 058289a..415f184 100644
--- a/admin/src/views/vehicle/cars.vue
+++ b/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>
@@ -48,7 +57,8 @@
<el-table-column prop="code" label="杞︾墝鍙�" min-width="100px"></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}">
@@ -63,7 +73,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 ? '缂栬緫杞﹁締' : '鏂板缓杞﹁締'
diff --git a/admin/src/views/vehicle/components/OperaCarsImportWindow.vue b/admin/src/views/vehicle/components/OperaCarsImportWindow.vue
new file mode 100644
index 0000000..a0ab3a4
--- /dev/null
+++ b/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/cars.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>
diff --git a/screen/src/utils/index.js b/screen/src/utils/index.js
new file mode 100644
index 0000000..3a6cdc9
--- /dev/null
+++ b/screen/src/utils/index.js
@@ -0,0 +1,6 @@
+export const formatNum = (num) => {
+ if(!num ) return 0
+ if(num > 1000000){
+
+ }
+}
\ No newline at end of file
diff --git a/screen/src/views/EnergyConsum.vue b/screen/src/views/EnergyConsum.vue
index e885fb9..938e91a 100644
--- a/screen/src/views/EnergyConsum.vue
+++ b/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: '鍗曚綅锛歬w路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]
}
}
}
diff --git a/screen/src/views/LogisticsEfficiency.vue b/screen/src/views/LogisticsEfficiency.vue
index cde3e9f..332092e 100644
--- a/screen/src/views/LogisticsEfficiency.vue
+++ b/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()
})
--
Gitblit v1.9.3