Commit 616e92cc authored by youjj's avatar youjj

股权信息加图片

parent face095d
...@@ -31,22 +31,22 @@ module.exports = { ...@@ -31,22 +31,22 @@ module.exports = {
assetsPublicPath: '/', assetsPublicPath: '/',
proxyTable: { proxyTable: {
'/jwt': { '/jwt': {
target: 'http://10.5.52.3:8765', // target: 'http://10.5.52.3:8765',
// target: 'http://localhost:8765', target: 'http://localhost:8765',
pathRewrite: { pathRewrite: {
'^/jwt': '/jwt' '^/jwt': '/jwt'
}, },
}, },
'/api':{ '/api':{
target: 'http://10.5.52.3:8765', // target: 'http://10.5.52.3:8765',
// target: 'http://localhost:8765', target: 'http://localhost:8765',
pathRewrite: { pathRewrite: {
'^/api': '/api' '^/api': '/api'
}, },
}, },
'/vehicle': { '/vehicle': {
target: 'http://10.5.52.3:8765' // target: 'http://10.5.52.3:8765'
// target: 'http://localhost:8765' target: 'http://localhost:8765'
}, },
}, },
// CSS Sourcemaps off by default because relative paths are "buggy" // CSS Sourcemaps off by default because relative paths are "buggy"
......
...@@ -97,6 +97,19 @@ ...@@ -97,6 +97,19 @@
:label="stockStateStr.get(item).label" :value="stockStateStr.get(item).value"></el-option> :label="stockStateStr.get(item).label" :value="stockStateStr.get(item).value"></el-option>
</el-select> </el-select>
</el-form-item> </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> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="handleCancel('form')">取 消</el-button> <el-button @click="handleCancel('form')">取 消</el-button>
...@@ -119,13 +132,18 @@ ...@@ -119,13 +132,18 @@
getSonRegionByCodes, getSonRegionByCodes,
getRegionByCodes getRegionByCodes
} from 'api/base_info/region/'; } from 'api/base_info/region/';
import { mapGetters } from 'vuex'; import {
getToken
} from 'utils/auth';
import {mapGetters} from 'vuex';
import rsCode from '../../../utils/rsCode'; import rsCode from '../../../utils/rsCode';
export default { export default {
name: 'branchCompanyStock', name: 'branchCompanyStock',
data() { data() {
return { return {
BASE_API: process.env.BASE_API,
showLoadingBody: false,
state: null, state: null,
stockStateStr: new Map([ stockStateStr: new Map([
[-1, { [-1, {
...@@ -157,7 +175,8 @@ ...@@ -157,7 +175,8 @@
price: null, price: null,
addrProvince: null, addrProvince: null,
addrCity: null, addrCity: null,
state: null state: null,
companyPic: null
}, },
rules: { rules: {
companyName: [ companyName: [
...@@ -244,9 +263,34 @@ ...@@ -244,9 +263,34 @@
return null; return null;
} }
return getSonRegionByCodes(this.form.addrProvince); return getSonRegionByCodes(this.form.addrProvince);
},
getHeaderWithToken() {
return {Authorization: getToken()};
} }
}, },
methods: { 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) { handleUpdate(row) {
getObj(row.id) getObj(row.id)
.then(response => { .then(response => {
......
<template> <template>
<div class="app-container calendar-list-container"> <div class="app-container calendar-list-container">
<div class="filter-container"> <!-- <div class="filter-container">-->
<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="姓名" <!-- <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="车牌号"-->
v-model="listQuery.name"></el-input> <!-- 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" 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" <!-- </div>-->
type="primary" icon="edit">添加
</el-button>
</div>
<el-table :key='tableKey' :data="list" v-loading.body="listLoading" border fit highlight-current-row <el-table :key='tableKey' :data="list" v-loading.body="listLoading" border fit highlight-current-row
style="width: 100%"> style="width: 100%">
<el-table-column align="center" label="车牌号" width="65"> <el-table-column align="center" label="车牌号" width="65">
...@@ -212,11 +209,20 @@ ...@@ -212,11 +209,20 @@
mileageEnd: null, mileageEnd: null,
state: null state: null
}, },
list: null,
total: null,
listLoading: true,
listQuery: { listQuery: {
page: 1, page: 1,
limit: 20, limit: 20,
name: undefined name: undefined
} },
dialogStatus: '',
textMap: {
update: '编辑',
create: '创建'
},
tableKey: 0
} }
}, },
created() { created() {
...@@ -228,6 +234,9 @@ ...@@ -228,6 +234,9 @@
]) ])
}, },
methods: { methods: {
handleFilter() {
this.getList();
},
getList() { getList() {
this.listLoading = true; this.listLoading = true;
page(this.listQuery) page(this.listQuery)
...@@ -236,6 +245,14 @@ ...@@ -236,6 +245,14 @@
this.total = response.data.total; this.total = response.data.total;
this.listLoading = false; 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