马远东 6 months ago
parent
commit
09d36d632c
  1. 245
      src/views/basicdata/driverArtery/basicdataDriverArteryAdd.vue
  2. 125
      src/views/basicdata/driverArtery/basicdataDriverArteryView.vue
  3. 1
      src/views/supervise/management.vue

245
src/views/basicdata/driverArtery/basicdataDriverArteryAdd.vue

@ -40,7 +40,6 @@
clearable
type="date"
:placeholder="item.placeholder || '请选择' + item.label"
:disabled-date="disabledDate"
class="w100"
:value-format="item.valueFormat || 'yyyy-MM-dd'"
/>
@ -73,13 +72,14 @@
:prop="item.prop"
:rules="item.rules"
>
<div v-loading="item.loading">
<el-upload
list-type="picture-card"
:show-file-list="false"
:on-preview="handlePreview"
:action="'/api/blade-resource/oss/endpoint/put-file'"
:on-success="file => handleUpLoadSuccess(file, item)"
:before-upload="handleBeforeUpload"
:before-upload="file => handleBeforeUpload(file, item)"
:on-exceed="() => handleImgError(item)"
:headers="headers"
>
@ -96,10 +96,68 @@
</div>
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
</el-upload>
</div>
</el-form-item>
</div>
<el-form-item
style="width: 100%"
:label="item.label"
v-for="(item, index) in fileOption"
:key="item.prop"
:prop="item.prop"
:rules="item.rules"
>
<div v-loading="item.loading" style="width: 100%">
<el-upload
ref="upload"
style="width: 100%"
:action="'/api/blade-resource/oss/endpoint/put-file'"
:on-success="file => handleUpLoadSuccess(file, item)"
:before-upload="
file => {
const typeArr = file.name.split('.');
const type = typeArr[typeArr.length - 1];
item.loading = true;
return file;
}
"
:on-exceed="
files => {
try {
console.log('$refs :>> ', $refs);
$refs.upload[index].clearFiles();
const file = files[0];
console.log('file :>> ', file);
$refs.upload[index].handleStart(file);
} catch (error) {
console.log('error :>> ', error);
}
}
"
:headers="headers"
:drag="item.drag"
:show-file-list="false"
>
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">请上传图片 / word文档 / pdf</div>
</el-upload>
</div>
<div v-if="form[item.prop]" style="display: flex; margin-top: 20px">
<el-link :href="form[item.prop]">{{
form[item.prop].split('/').slice(form[item.prop].split('/').length - 1)[0]
}}</el-link>
<div class="clearIcon" style="margin-left: 20px" @click="() => handleRemoveImg(item)">
<el-icon color="#fff"><DeleteFilled /></el-icon>
</div>
</div>
</el-form-item>
</el-form>
</div>
<div class="footer_container"></div>
<div class="submit_container">
<el-button icon="CircleClose" @click="back"> </el-button>
<el-button icon="Refresh" type="primary" @click="handleReset"> </el-button>
@ -136,6 +194,7 @@ export default {
label: '姓名',
prop: 'name',
type: 'input',
default: '',
rules: [{ required: true, message: '请输入姓名!', trigger: ['blur', 'change'] }],
},
{
@ -148,7 +207,7 @@ export default {
payload.value = payload.value + 1;
console.log('111 :>> ', 111);
},
default: '',
rules: [
{
required: true,
@ -162,8 +221,8 @@ export default {
prop: 'type',
filterable: true,
type: 'select',
dicUrl: '/api/blade-system/dict-biz/dictionary?code=basic_driver_type',
options: [],
default: '',
rules: [{ required: true, message: '请选择司机类型', trigger: ['blur', 'change'] }],
},
{
@ -171,9 +230,9 @@ export default {
prop: 'jobType',
filterable: true,
type: 'select',
dicUrl: '/api/blade-system/dict-biz/dictionary?code=basic_driverjob_type',
options: [],
multiple: true,
default: [],
rules: [{ required: true, message: '请选择职务类型', trigger: ['blur'] }],
},
{
@ -181,7 +240,7 @@ export default {
prop: 'drivingType',
filterable: true,
type: 'select',
dicUrl: '/api/blade-system/dict-biz/dictionary?code=basic_driving_type',
default: '',
rules: [{ required: true, message: '请选择准驾车型', trigger: ['blur', 'change'] }],
options: [],
},
@ -193,8 +252,7 @@ export default {
type: 'select',
remote: true,
multiple: true,
// dicData: [],
dicUrl: '/api/logpm-basicdata/vehicle/dictionary?vehicleNub={{key}}',
default: [],
options: [],
multiple: true,
},
@ -204,6 +262,7 @@ export default {
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
default: '',
},
{
label: '合同结束时间',
@ -211,20 +270,21 @@ export default {
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
default: '',
},
{
label: '身份证号',
prop: 'idCard',
type: 'number',
type: 'input',
default: '',
},
{
label: '性别',
prop: 'gender',
filterable: true,
type: 'select',
dicUrl: '/api/blade-system/dict-biz/dictionary?code=sex',
options: [],
default: '',
},
{
label: '仓库',
@ -232,38 +292,42 @@ export default {
filterable: true,
type: 'select',
remote: true,
dicUrl: '/logpm-basicdata/warehouse/listName?name={{key}}',
options: [],
rules: [{ required: true, message: '请选择仓库!', trigger: 'blur' }],
multiple: true,
default: [],
},
{
label: '居住地址',
prop: 'residentialAddress',
type: 'input',
default: '',
},
{
label: '银行类型',
prop: 'bankType',
filterable: true,
type: 'select',
dicUrl: '/api/blade-system/dict-biz/dictionary?code=basic_bank_type',
options: [],
default: '',
},
{
label: '银行卡号',
prop: 'bankCardNub',
type: 'number',
type: 'input',
default: '',
},
{
label: '驾驶证号',
prop: 'driverLicenseNub',
type: 'input',
default: '',
},
{
label: '驾驶证发证机关',
prop: 'driverLicenseOrgan',
type: 'input',
default: '',
},
{
label: '驾驶证起始日期',
@ -271,6 +335,7 @@ export default {
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
default: '',
},
{
label: '驾驶证到期日期',
@ -278,49 +343,60 @@ export default {
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
default: '',
},
{
label: '从业资格证编号',
prop: 'employeeQualificationNub',
type: 'input',
default: '',
},
{
label: '道路经营许可证号',
prop: 'roadOperationLicenseNub',
type: 'input',
default: '',
},
{
label: '承运商',
prop: 'carrierId',
type: 'select',
filterable: true,
dicUrl: '/api/logpm-basicdata/carrier/dictionary',
options: [],
rules: [{ required: true, message: '请选择承运商!', trigger: 'blur' }],
default: '',
},
{
label: '结算渠道',
prop: 'settlementChannel',
type: 'select',
filterable: true,
dicUrl: '/api/logpm-basicdata/carrier/dictionary',
options: [],
rules: [{ required: true, message: '请选择结算渠道!', trigger: 'blur' }],
options: [
{ dictKey: '1', dictValue: '微信' },
{ dictKey: '2', dictValue: '支付宝' },
{ dictKey: '3', dictValue: '银行卡' },
{ dictKey: '4', dictValue: '现金' },
],
rules: [{ required: false, message: '请选择结算渠道!', trigger: 'blur' }],
default: '',
},
{
label: '结算账号',
prop: 'roadOperationLicenseNub',
prop: 'settlementAccount',
type: 'input',
default: '',
},
{
label: '运输协议',
prop: 'transportationAgreement',
type: 'input',
default: '',
},
{
label: '备注',
prop: 'notes',
type: 'input',
default: '',
},
],
imgOption: [
@ -330,13 +406,10 @@ export default {
type: 'upload',
dataType: 'string',
listType: 'picture-img',
hide: true,
multiple: false,
loading: false,
action: '/blade-resource/oss/endpoint/put-file',
propsHttp: {
res: 'data',
url: 'link',
},
default: '',
},
{
label: '身份证正面照片',
@ -344,13 +417,10 @@ export default {
type: 'upload',
dataType: 'string',
listType: 'picture-img',
hide: true,
multiple: false,
loading: false,
action: '/blade-resource/oss/endpoint/put-file',
propsHttp: {
res: 'data',
url: 'link',
},
default: '',
},
{
label: '身份证背面照片',
@ -358,13 +428,10 @@ export default {
type: 'upload',
dataType: 'string',
listType: 'picture-img',
hide: true,
multiple: false,
loading: false,
action: '/blade-resource/oss/endpoint/put-file',
propsHttp: {
res: 'data',
url: 'link',
},
default: '',
},
{
label: '驾驶证照片',
@ -372,13 +439,10 @@ export default {
type: 'upload',
dataType: 'string',
listType: 'picture-img',
hide: true,
multiple: false,
loading: false,
action: '/blade-resource/oss/endpoint/put-file',
propsHttp: {
res: 'data',
url: 'link',
},
default: '',
},
{
label: '驾驶证背面照片',
@ -386,13 +450,24 @@ export default {
type: 'upload',
dataType: 'string',
listType: 'picture-img',
hide: true,
multiple: false,
loading: false,
action: '/blade-resource/oss/endpoint/put-file',
propsHttp: {
res: 'data',
url: 'link',
default: '',
},
],
fileOption: [
{
label: '合同',
prop: 'contract',
type: 'upload',
dataType: 'string',
listType: 'picture-img',
drag: true,
loading: false,
multiple: false,
action: '/blade-resource/oss/endpoint/put-file',
default: '',
},
],
rules: {},
@ -400,35 +475,6 @@ export default {
headers: {
'Blade-Auth': 'bearer ' + getToken(),
},
shortcuts: [
{
text: '最近一周',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
return [start, end];
},
},
{
text: '最近一个月',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
return [start, end];
},
},
{
text: '最近三个月',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
return [start, end];
},
},
],
/** loading */
loadingObj: {
/** 表格loading */
@ -436,6 +482,7 @@ export default {
/** 页面loading */
pageLoading: false,
},
upload: '',
};
},
computed: {
@ -560,7 +607,8 @@ export default {
console.log('res :>> ', res);
},
/** 上传前 */
async handleBeforeUpload(file) {
async handleBeforeUpload(file, item) {
try {
const isJPG = file.type === 'image/jpeg';
const isPNG = file.type === 'image/png';
const isLt2M = file.size / 1024 / 1024 < 2;
@ -573,19 +621,24 @@ export default {
this.$message.error('上传图片大小不能超过 2MB!');
return false;
}
const res = await compressImageBlob(rawFile);
item.loading = true;
const res = await compressImageBlob(file);
return res;
} catch (error) {
console.log('error :>> ', error);
}
},
/** 上传成功 */
handleUpLoadSuccess(file, item) {
console.log('file :>> ', file);
console.log(' this.form :>> ', this.form);
item.loading = false;
if (file.code !== 200) return;
this.form[item.prop] = file.data.link;
},
/** 移除图片 */
handleRemoveImg(item) {
delete this.form[item.prop];
this.form[item.prop] = '';
},
handleImgError(item) {
this.$message.error(item.label + '仅需上传一张图片');
@ -595,7 +648,27 @@ export default {
},
async onLoad() {
const _id = this.$route.query.id;
for (let i = 0; i < this.option.length; i++) {
const val = this.option[i];
this.form[val.prop] = val.default;
}
for (let i = 0; i < this.imgOption.length; i++) {
const val = this.imgOption[i];
this.form[val.prop] = val.default;
}
for (let i = 0; i < this.fileOption.length; i++) {
const val = this.fileOption[i];
this.form[val.prop] = val.default;
}
if (!_id) return;
const res = await getDetail(_id);
const { code, data } = res.data;
@ -738,12 +811,7 @@ export default {
display: block;
}
.upLoadImg_box {
position: relative;
.clearIcon {
opacity: 0;
position: absolute;
.clearIcon {
right: 10px;
top: 10px;
transition: all 0.3s;
@ -754,6 +822,17 @@ export default {
justify-content: center;
background-color: #fff;
border-radius: 50%;
cursor: pointer;
background-color: #f00;
}
.upLoadImg_box {
position: relative;
.clearIcon {
opacity: 0;
position: absolute;
background-color: #fff;
}
&:hover {
@ -764,6 +843,10 @@ export default {
}
}
.footer_container {
height: 60px;
}
.submit_container {
position: absolute;
bottom: 20px;

125
src/views/basicdata/driverArtery/basicdataDriverArteryView.vue

@ -80,6 +80,21 @@
</div>
</el-form-item>
</div>
<el-form-item
style="width: 100%"
:label="item.label"
v-for="(item, index) in fileOption"
:key="item.prop"
:prop="item.prop"
:rules="item.rules"
>
<div v-if="form[item.prop]">
<el-link :href="form[item.prop]">{{
form[item.prop].split('/').slice(form[item.prop].split('/').length - 1)[0]
}}</el-link>
</div>
</el-form-item>
</el-form>
</div>
<div class="submit_container">
@ -114,6 +129,7 @@ export default {
label: '姓名',
prop: 'name',
type: 'input',
default: '',
rules: [{ required: true, message: '请输入姓名!', trigger: ['blur', 'change'] }],
},
{
@ -126,7 +142,7 @@ export default {
payload.value = payload.value + 1;
console.log('111 :>> ', 111);
},
default: '',
rules: [
{
required: true,
@ -140,23 +156,27 @@ export default {
prop: 'type',
filterable: true,
type: 'select',
dicUrl: '/api/blade-system/dict-biz/dictionary?code=basic_driver_type',
options: [],
default: '',
rules: [{ required: true, message: '请选择司机类型', trigger: ['blur', 'change'] }],
},
{
label: '职务类型',
prop: 'jobType',
filterable: true,
type: 'select',
dicUrl: '/api/blade-system/dict-biz/dictionary?code=basic_driverjob_type',
options: [],
multiple: true,
default: [],
rules: [{ required: true, message: '请选择职务类型', trigger: ['blur'] }],
},
{
label: '准驾车型',
prop: 'drivingType',
filterable: true,
type: 'select',
dicUrl: '/api/blade-system/dict-biz/dictionary?code=basic_driving_type',
default: '',
rules: [{ required: true, message: '请选择准驾车型', trigger: ['blur', 'change'] }],
options: [],
},
@ -167,8 +187,7 @@ export default {
type: 'select',
remote: true,
multiple: true,
// dicData: [],
dicUrl: '/api/logpm-basicdata/vehicle/dictionary?vehicleNub={{key}}',
default: [],
options: [],
multiple: true,
},
@ -178,6 +197,7 @@ export default {
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
default: '',
},
{
label: '合同结束时间',
@ -185,20 +205,21 @@ export default {
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
default: '',
},
{
label: '身份证号',
prop: 'idCard',
type: 'number',
type: 'input',
default: '',
},
{
label: '性别',
prop: 'gender',
filterable: true,
type: 'select',
dicUrl: '/api/blade-system/dict-biz/dictionary?code=sex',
options: [],
default: '',
},
{
label: '仓库',
@ -206,38 +227,42 @@ export default {
filterable: true,
type: 'select',
remote: true,
dicUrl: '/logpm-basicdata/warehouse/listName?name={{key}}',
options: [],
rules: [{ required: true, message: '请选择仓库!', trigger: 'blur' }],
multiple: true,
default: [],
},
{
label: '居住地址',
prop: 'residentialAddress',
type: 'input',
default: '',
},
{
label: '银行类型',
prop: 'bankType',
filterable: true,
type: 'select',
dicUrl: '/api/blade-system/dict-biz/dictionary?code=basic_bank_type',
options: [],
default: '',
},
{
label: '银行卡号',
prop: 'bankCardNub',
type: 'number',
type: 'input',
default: '',
},
{
label: '驾驶证号',
prop: 'driverLicenseNub',
type: 'input',
default: '',
},
{
label: '驾驶证发证机关',
prop: 'driverLicenseOrgan',
type: 'input',
default: '',
},
{
label: '驾驶证起始日期',
@ -245,6 +270,7 @@ export default {
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
default: '',
},
{
label: '驾驶证到期日期',
@ -252,36 +278,60 @@ export default {
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
default: '',
},
{
label: '从业资格证编号',
prop: 'employeeQualificationNub',
type: 'input',
default: '',
},
{
label: '道路经营许可证号',
prop: 'roadOperationLicenseNub',
type: 'input',
default: '',
},
{
label: '承运商',
prop: 'carrierId',
filterable: true,
type: 'select',
filterable: true,
dicUrl: '/api/logpm-basicdata/carrier/dictionary',
options: [],
rules: [{ required: true, message: '请选择承运商!', trigger: 'blur' }],
default: '',
},
{
label: '结算渠道',
prop: 'settlementChannel',
type: 'select',
filterable: true,
options: [
{ dictKey: '1', dictValue: '微信' },
{ dictKey: '2', dictValue: '支付宝' },
{ dictKey: '3', dictValue: '银行卡' },
{ dictKey: '4', dictValue: '现金' },
],
rules: [{ required: false, message: '请选择结算渠道!', trigger: 'blur' }],
default: '',
},
{
label: '结算账号',
prop: 'settlementAccount',
type: 'input',
default: '',
},
{
label: '运输协议',
prop: 'transportationAgreement',
type: 'input',
default: '',
},
{
label: '备注',
prop: 'notes',
type: 'input',
default: '',
},
],
imgOption: [
@ -291,13 +341,10 @@ export default {
type: 'upload',
dataType: 'string',
listType: 'picture-img',
hide: true,
multiple: false,
loading: false,
action: '/blade-resource/oss/endpoint/put-file',
propsHttp: {
res: 'data',
url: 'link',
},
default: '',
},
{
label: '身份证正面照片',
@ -305,13 +352,10 @@ export default {
type: 'upload',
dataType: 'string',
listType: 'picture-img',
hide: true,
multiple: false,
loading: false,
action: '/blade-resource/oss/endpoint/put-file',
propsHttp: {
res: 'data',
url: 'link',
},
default: '',
},
{
label: '身份证背面照片',
@ -319,13 +363,10 @@ export default {
type: 'upload',
dataType: 'string',
listType: 'picture-img',
hide: true,
multiple: false,
loading: false,
action: '/blade-resource/oss/endpoint/put-file',
propsHttp: {
res: 'data',
url: 'link',
},
default: '',
},
{
label: '驾驶证照片',
@ -333,13 +374,10 @@ export default {
type: 'upload',
dataType: 'string',
listType: 'picture-img',
hide: true,
multiple: false,
loading: false,
action: '/blade-resource/oss/endpoint/put-file',
propsHttp: {
res: 'data',
url: 'link',
},
default: '',
},
{
label: '驾驶证背面照片',
@ -347,13 +385,24 @@ export default {
type: 'upload',
dataType: 'string',
listType: 'picture-img',
hide: true,
multiple: false,
loading: false,
action: '/blade-resource/oss/endpoint/put-file',
propsHttp: {
res: 'data',
url: 'link',
default: '',
},
],
fileOption: [
{
label: '合同',
prop: 'contract',
type: 'upload',
dataType: 'string',
listType: 'picture-img',
drag: true,
loading: false,
multiple: false,
action: '/blade-resource/oss/endpoint/put-file',
default: '',
},
],
rules: {},

1
src/views/supervise/management.vue

@ -287,6 +287,7 @@ import functions from '@/utils/functions.js';
import { getToken } from '@/utils/auth';
import { downloadXls } from '@/utils/util';
import { useRouter } from 'vue-router';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import {
$_Getclassify,
$_newlyadded,

Loading…
Cancel
Save