Commit 49b43353 by 姜雷

Merge branch 'test' into 'master'

Test See merge request !14
parents 4120b771 3f79ff83
......@@ -100,6 +100,9 @@ input[type='number'] {
.col-line-3 {
width: 32%;
}
.col-line-3-1 {
width: 68%;
}
</style>
<script>
export default {
......
......@@ -45,7 +45,7 @@ service.interceptors.response.use(response => {
if (res.code !== 1000) {
if (
response.headers &&
response.headers['content-type'] === 'application/octet-stream'
/application\/octet-stream/.test(response.headers['content-type'])
) {
return response;
}
......
import fetch from '@/api/fetch';
import downloadUrl from '@/utils/download';
export const fetchApplyList = entity =>
fetch({
......@@ -13,3 +14,15 @@ export const dealApply = entity =>
method: 'post',
data: entity,
});
export const exportApplyList = entity =>
fetch({
url: '/publicCar/export/manager/teacherAppoCar',
method: 'post',
data: entity,
responseType: 'blob',
timeout: 120000,
}).then(res => {
let blob = new Blob([res.data], { type: res.headers });
let fileName = res.headers['content-disposition'].split('=')[1];
downloadUrl(blob, fileName);
});
import fetch from '@/api/fetch';
import downloadUrl from '@/utils/download';
export const fetchApplyList = entity =>
fetch({
......@@ -13,3 +14,16 @@ export const dealApply = entity =>
method: 'post',
data: entity,
});
export const exportApplyList = entity =>
fetch({
url: '/repair/export/manager/userRepair',
method: 'post',
data: entity,
responseType: 'blob',
timeout: 120000,
}).then(res => {
let blob = new Blob([res.data], { type: res.headers });
let fileName = res.headers['content-disposition'].split('=')[1];
downloadUrl(blob, fileName);
});
......@@ -16,7 +16,7 @@
</div>
</div>
<div class="copyright">
Copyright@成都多彩任意门科技有限公司2015-2017 蜀ICP备14012163号-1
Copyright©成都多彩任意门科技有限公司2015-2017 蜀ICP备14012163号-1
</div>
</div>
</template>
......
......@@ -118,8 +118,8 @@ $light_gray: #eee;
background-image: url('../../assets/images/login/login_bg@3x.png');
background-size: cover;
input:-webkit-autofill {
box-shadow: 0 0 0px 1000px #293444 inset !important;
-webkit-text-fill-color: #fff !important;
box-shadow: 0 0 0px 1000px #fff inset !important;
-webkit-text-fill-color: #666 !important;
}
input {
background: transparent;
......
......@@ -22,7 +22,9 @@
</el-date-picker>
</div>
<el-button type="primary" icon="el-icon-search" @click="searchList">搜索</el-button>
<el-button type="primary" icon="el-icon-download" @click="exportList">导出</el-button>
</el-form>
<div class="tabel-wrap">
<el-table border v-loading="loading" :data="list" style="width: 100%">
<el-table-column type="index" label="序号" width="50">
......@@ -57,6 +59,7 @@
<el-pagination layout="prev, pager, next" :current-page="pagination.pageNum" :page-size="pagination.pageSize" :total="pagination.total" @current-change="changePage">
</el-pagination>
</div>
<drag-dialog :title="editType ? '处理' : '详情'" :visible.sync="dialogEditVisible" :before-close="resetEditDialog" width="70%" top="5vh">
<el-form class="editForm" :disabled="loading">
<div class="line-wrap">
......@@ -88,9 +91,9 @@
<el-form-item class="col-line-3" label="派车人" label-width="100px">
<span>{{selected.dealName}}</span>
</el-form-item>
<el-form-item class="col-line-3" label="派车车牌" label-width="100px">
<el-select v-if="editType" v-model="selected.carPlate" filterable clearable placeholder="派车车牌">
<el-option v-for="item in carPlateOptions" :key="item.id" :label="item.name" :value="item.name">
<el-form-item class="col-line-3-1" label="派车车牌" label-width="100px">
<el-select class="w100" v-if="editType" v-model="selected.carPlateList" filterable clearable multiple placeholder="派车车牌">
<el-option v-for="item in carPlateOptions" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
<span v-else>{{selected.carPlate}}</span>
......@@ -161,7 +164,7 @@
import listMixin from '@/mixin/listPage.js';
import { mapGetters, mapActions } from 'vuex';
import store from './store.js';
import { dealApply } from '@/api/management/publicCar.js';
import { dealApply, exportApplyList } from '@/api/management/publicCar.js';
// import printJS from 'print-js';
export default {
......@@ -220,6 +223,7 @@ export default {
birthday: '',
jobNumber: '',
cellphone: '',
carPlateList: [],
};
},
getCategoryValue(c, r, val) {
......@@ -227,6 +231,10 @@ export default {
let item = list.find(item => item.checked);
return item ? item.name : '';
},
exportList() {
const filters = this.getFilters();
exportApplyList(filters);
},
showEditDialog(type, data) {
this.editType = type;
if (this.carPlateOptions.length == 0) {
......@@ -255,6 +263,7 @@ export default {
lineDescription: data.row.lineDescription,
dealName: data.row.dealName || this.userInfo.name,
carPlate: data.row.carPlate,
carPlateList: data.row.carPlate ? data.row.carPlate.split(',') : [],
startKilometers: data.row.startKilometers,
stopKilometers: data.row.stopKilometers,
trueKilometers: data.row.trueKilometers,
......@@ -266,13 +275,19 @@ export default {
};
this.dialogEditVisible = true;
},
resetEditDialog(done) {
this.initSelected();
done && typeof done == 'function'
? done()
: (this.dialogEditVisible = false);
},
toogleDealResult(val) {
if (val === 2) {
this.selected.dealOpinion = '';
}
},
validateSelect() {
if (this.selected.dealResult == 2 && !this.selected.carPlate) {
if (this.selected.dealResult == 2 && !this.selected.carPlateList.length) {
this.$message.error('请选择派车车牌!');
return;
}
......@@ -298,10 +313,13 @@ export default {
? `不同意 - ${this.selected.dealOpinion}`
: `不同意 - 无车可派送`;
}
let carPlate = this.selected.carPlateList.map(
id => this.carPlateOptions.find(i => i.id === id).name
);
const entity = {
userId: this.userInfo.id,
id: this.selected.id,
carPlate: this.selected.carPlate,
carPlate: carPlate.join(','),
startKilometers: this.selected.startKilometers,
stopKilometers: this.selected.stopKilometers,
trueKilometers: this.selected.trueKilometers,
......@@ -352,7 +370,10 @@ export default {
},
showPrintDialog(data) {
let categoryName = JSON.parse(data.row.categoryName).map(
item => (item.checked ? `☑ ${item.name}` : `▢ ${item.name}`)
(item, index) =>
item.checked
? `☑ ${index + 1}${item.name}`
: `▢ ${index + 1}${item.name}`
);
this.selected = {
id: data.row.id,
......@@ -417,6 +438,9 @@ export default {
margin-left: 30px;
}
}
.w100 {
width: 100%;
}
.printIframe {
width: 100%;
height: 500px;
......
......@@ -31,6 +31,7 @@
</el-date-picker>
</div>
<el-button type="primary" icon="el-icon-search" @click="searchList">搜索</el-button>
<el-button type="primary" icon="el-icon-download" @click="exportList">导出</el-button>
</el-form>
<div class="tabel-wrap">
<el-table border v-loading="loading" :data="list" style="width: 100%">
......@@ -106,7 +107,7 @@
import listMixin from '@/mixin/listPage.js';
import { mapGetters, mapActions } from 'vuex';
import store from './store.js';
import { dealApply } from '@/api/management/repair.js';
import { dealApply, exportApplyList } from '@/api/management/repair.js';
export default {
beforeRouteEnter(to, from, next) {
......@@ -171,6 +172,10 @@ export default {
let item = this.dealStateOptions.find(item => item.value == val);
return item ? item.label : val;
},
exportList() {
const filters = this.getFilters();
exportApplyList(filters);
},
showEditDialog(type, data) {
this.editType = type;
this.selected = {
......
......@@ -18,7 +18,7 @@
<div :span="4" class="tableCell tabelCol-4">
<span>用车类型<br>(勾选)</span>
</div>
<div :span="20" class="tableCell tabelCol-20 tal">{{selected.categoryName}}</div>
<div :span="20" class="tableCell tabelCol-20 tal mtel">{{selected.categoryName}}</div>
</div>
<div class="tableRow">
<div :span="4" class="tableCell tabelCol-4">用车起始时间</div>
......@@ -28,23 +28,26 @@
<div :span="4" class="tableCell tabelCol-4">
<span>用车详细路线</span>
</div>
<div :span="20" class="tableCell tabelCol-20 tal">{{selected.lineDescription}}</div>
<div :span="20" class="tableCell tabelCol-20 tal mtel">{{selected.lineDescription}}</div>
</div>
<div class="tableRow">
<div :span="4" class="tableCell tabelCol-4">部门负责人<br>签字(盖章)</div>
<div :span="4" class="tableCell tabelCol-10"></div>
<div :span="4" class="tableCell tabelCol-4"></div>
<div :span="4" class="tableCell tabelCol-4 directCol">
<div>派车人</div>
<div>派车车牌</div>
</div>
<div :span="4" class="tableCell tabelCol-6 directCol">
<span>
<div :span="4" class="tableCell tabelCol-12 directCol">
<span class="carPlate">
{{selected.dealName}}
</span>
<span>
{{selected.carPlate}}
</span>
<div class="carPlate">
<template v-for="(rowIndex) in carPlateArrRow">
<div :key="rowIndex">{{carPlateArr.slice((rowIndex-1) * 3, 3 * rowIndex).join(',')}}</div>
</template>
</div>
</div>
</div>
<div class="tableRow">
<div :span="4" class="tableCell tabelCol-4">出车公里数</div>
......@@ -104,6 +107,13 @@ export default {
return sed;
},
carPlateArr() {
return this.selected.carPlate.split(',');
},
carPlateArrRow() {
const length = this.carPlateArr.length;
return Math.ceil(length / 3);
},
},
created() {
window.vmPrint = this.printHandle;
......@@ -126,7 +136,7 @@ export default {
height: 978px;
text-align: center;
margin: 0 auto;
line-height: 45px;
line-height: 48px;
.tableTitle {
font-size: 20px;
line-height: 80px;
......@@ -152,11 +162,22 @@ export default {
border-bottom: none;
}
.tal {
text-indent: 20px;
text-indent: 10px;
text-align: left;
justify-content: flex-start;
align-items: flex-start;
}
.mtel {
text-indent: 0;
line-height: 30px;
padding: 15px 10px;
}
.carPlate {
width: 100%;
padding: 0 20px;
text-align: left;
line-height: 30px;
}
.directCol {
flex-direction: column;
line-height: 36px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment