Commit 616e92cc authored by youjj's avatar youjj

股权信息加图片

parent face095d
......@@ -31,22 +31,22 @@ module.exports = {
assetsPublicPath: '/',
proxyTable: {
'/jwt': {
target: 'http://10.5.52.3:8765',
// target: 'http://localhost:8765',
// target: 'http://10.5.52.3:8765',
target: 'http://localhost:8765',
pathRewrite: {
'^/jwt': '/jwt'
},
},
'/api':{
target: 'http://10.5.52.3:8765',
// target: 'http://localhost:8765',
// target: 'http://10.5.52.3:8765',
target: 'http://localhost:8765',
pathRewrite: {
'^/api': '/api'
},
},
'/vehicle': {
target: 'http://10.5.52.3:8765'
// target: 'http://localhost:8765'
// target: 'http://10.5.52.3:8765'
target: 'http://localhost:8765'
},
},
// CSS Sourcemaps off by default because relative paths are "buggy"
......
......@@ -97,6 +97,19 @@
:label="stockStateStr.get(item).label" :value="stockStateStr.get(item).value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="公司图片" prop="drivingLicensePath" :style="{display:'block'}">
<el-upload
class="avatar-uploader"
:action="BASE_API + '/vehicle/branchCompany/stock/upload/companyPic'"
:show-file-list="false"
:headers="getHeaderWithToken"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload" :style="{display:'block'}">
<img v-if="$utils.isString(form.companyPic) && !$utils.isEmpty(form.companyPic)"
:src="getCompanyPicUrl(form.companyPic)" class="avatar" :style="{display:'block'}">
<i v-else class="el-icon-plus avatar-uploader-icon" :style="{lineHeight:'350px'}"></i>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel('form')">取 消</el-button>
......@@ -119,13 +132,18 @@
getSonRegionByCodes,
getRegionByCodes
} from 'api/base_info/region/';
import { mapGetters } from 'vuex';
import {
getToken
} from 'utils/auth';
import {mapGetters} from 'vuex';
import rsCode from '../../../utils/rsCode';
export default {
name: 'branchCompanyStock',
data() {
return {
BASE_API: process.env.BASE_API,
showLoadingBody: false,
state: null,
stockStateStr: new Map([
[-1, {
......@@ -157,7 +175,8 @@
price: null,
addrProvince: null,
addrCity: null,
state: null
state: null,
companyPic: null
},
rules: {
companyName: [
......@@ -244,9 +263,34 @@
return null;
}
return getSonRegionByCodes(this.form.addrProvince);
},
getHeaderWithToken() {
return {Authorization: getToken()};
}
},
methods: {
getCompanyPicUrl(companyPic) {
return process.env.BASE_API +
'/vehicle/branchCompany/stock/download/companyPic?realFileRelPath=' + encodeURI(companyPic);
},
beforeAvatarUpload(file) {
const isJPG = file.type === 'image/jpeg' || file.type === 'image/gif';
const isLt2M = file.size / 1024 / 1024 < 10;
if (!isJPG) {
this.$message.error('上传图片只能是 JPG/GIF 格式!');
}
if (!isLt2M) {
this.$message.error('上传图片大小不能超过 10MB!');
}
this.showLoadingBody = true;
return isJPG && isLt2M;
},
handleAvatarSuccess(res) {
this.form.companyPic = res.data;
this.showLoadingBody = false;
this.$forceUpdate();
},
handleUpdate(row) {
getObj(row.id)
.then(response => {
......
<template>
<div class="app-container calendar-list-container">
<div class="filter-container">
<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="姓名"
v-model="listQuery.name"></el-input>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
<el-button class="filter-item" v-if="memberInfo_btn_add" style="margin-left: 10px;" @click="handleCreate"
type="primary" icon="edit">添加
</el-button>
</div>
<!-- <div class="filter-container">-->
<!-- <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="车牌号"-->
<!-- v-model="listQuery.name"></el-input>-->
<!-- <el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>-->
<!-- </div>-->
<el-table :key='tableKey' :data="list" v-loading.body="listLoading" border fit highlight-current-row
style="width: 100%">
<el-table-column align="center" label="车牌号" width="65">
......@@ -212,11 +209,20 @@
mileageEnd: null,
state: null
},
list: null,
total: null,
listLoading: true,
listQuery: {
page: 1,
limit: 20,
name: undefined
}
},
dialogStatus: '',
textMap: {
update: '编辑',
create: '创建'
},
tableKey: 0
}
},
created() {
......@@ -228,6 +234,9 @@
])
},
methods: {
handleFilter() {
this.getList();
},
getList() {
this.listLoading = true;
page(this.listQuery)
......@@ -236,6 +245,14 @@
this.total = response.data.total;
this.listLoading = false;
})
},
handleSizeChange(val) {
this.listQuery.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.listQuery.page = val;
this.getList();
}
}
}
......
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