前言
一、图片上传
1、流程及图
2、前端:
2.1 表单提交
<!-- 企业简称 -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="800px">
<el-form :model="editEntity" ref="editEntity"
label-width="80px" class="demo-ruleForm" >
<el-row>
<el-col :span="2">
</el-col>
<el-col :span="12">
<el-button type="danger" disabled>{
{
editEntity.compayName}}</el-button>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="企业名称" prop="name">
<el-input type="text" placeholder="请输入企业名称,最多输入十个字"
v-model="editEntity.name"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="A类单位" prop="invoiceCompanyidA">
<el-select size="mini" v-model="editEntity.invoiceCompanyidA" >
<el-option v-for="invoiceCompanyItem in invoiceCompanyOptionsA" :key="invoiceCompanyItem.id"
:label="invoiceCompanyItem.name" :value="invoiceCompanyItem.id"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="A类公章" prop="taxImageUrl">
<el-upload class="avatar-uploader" :action="uploadImageUrl"
:multiple="false" accept="image/*" :limit="1024" :auto-upload="true"
:show-file-list="false" :on-success="handleUploadSuccess1">
<img v-if="editEntity.taxImageUrl"
:src="editEntity.taxImageUrl" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>