|
@@ -81,8 +81,7 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
- <el-form-item label="公司LOGO" prop="logo" ref="img">
|
|
|
|
- <!-- <el-checkbox-group v-model="form.logo" v-show="false"></el-checkbox-group> -->
|
|
|
|
|
|
+ <!-- <el-form-item label="公司LOGO" prop="logo" ref="img">
|
|
<el-upload
|
|
<el-upload
|
|
action="#"
|
|
action="#"
|
|
accept="image/png,image/jpg,image/jpeg"
|
|
accept="image/png,image/jpg,image/jpeg"
|
|
@@ -106,6 +105,19 @@
|
|
<el-dialog :visible.sync="dialogVisible" >
|
|
<el-dialog :visible.sync="dialogVisible" >
|
|
<img width="100%" :src="dialogImageUrl" alt="">
|
|
<img width="100%" :src="dialogImageUrl" alt="">
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+ </el-form-item> -->
|
|
|
|
+ <el-form-item label="单位LOGO" prop="logo" ref="img">
|
|
|
|
+ <el-upload
|
|
|
|
+ class="upload-demo"
|
|
|
|
+ action="#"
|
|
|
|
+ :limit = 1
|
|
|
|
+ :on-change="handleChange"
|
|
|
|
+ :file-list="fileList"
|
|
|
|
+ :auto-upload="false"
|
|
|
|
+ accept=".jpg,.jpeg,.JPG,.JPEG,.PNG,.png,.GIF,.gif"
|
|
|
|
+ >
|
|
|
|
+ <el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
+ </el-upload>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -169,7 +181,7 @@ export default {
|
|
logo:"",
|
|
logo:"",
|
|
batchNo:undefined,
|
|
batchNo:undefined,
|
|
businessType:"产品logo",
|
|
businessType:"产品logo",
|
|
- uploadType:"file"
|
|
|
|
|
|
+ uploadType:"file",
|
|
},
|
|
},
|
|
// 表单校验
|
|
// 表单校验
|
|
rules: {
|
|
rules: {
|
|
@@ -192,6 +204,7 @@ export default {
|
|
},
|
|
},
|
|
formData:undefined,
|
|
formData:undefined,
|
|
limit:100,
|
|
limit:100,
|
|
|
|
+ num:0,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -282,13 +295,9 @@ export default {
|
|
this.form.name =undefined
|
|
this.form.name =undefined
|
|
this.form.introduce =undefined
|
|
this.form.introduce =undefined
|
|
this.form.logo =undefined
|
|
this.form.logo =undefined
|
|
- this.form.batchNo =undefined
|
|
|
|
this.reset();
|
|
this.reset();
|
|
this.open = true;
|
|
this.open = true;
|
|
this.title = "添加参数";
|
|
this.title = "添加参数";
|
|
- setTimeout(()=>{
|
|
|
|
- document.getElementsByClassName("el-upload--picture-card")[0].style.display="block"
|
|
|
|
- },200)
|
|
|
|
},
|
|
},
|
|
// 多选框选中数据
|
|
// 多选框选中数据
|
|
handleSelectionChange(selection) {
|
|
handleSelectionChange(selection) {
|
|
@@ -302,16 +311,6 @@ export default {
|
|
Object.assign(this.form, row.id ? this.adminList.find(val=>val.id === row.id) : this.adminList.find(val=>val.id === this.ids[0]))
|
|
Object.assign(this.form, row.id ? this.adminList.find(val=>val.id === row.id) : this.adminList.find(val=>val.id === this.ids[0]))
|
|
this.open = true;
|
|
this.open = true;
|
|
this.title = "修改参数";
|
|
this.title = "修改参数";
|
|
- setTimeout(() =>{
|
|
|
|
- if(this.fileList.length>0){
|
|
|
|
- }else{
|
|
|
|
- this.fileList.push([])
|
|
|
|
- this.fileList[0].url = row.logo
|
|
|
|
- }
|
|
|
|
- document.getElementsByClassName("el-upload--picture-card")[0].style.display="none"
|
|
|
|
- },100)
|
|
|
|
- this.limit = 1
|
|
|
|
- // });
|
|
|
|
},
|
|
},
|
|
// 图片上传尺寸大小检验
|
|
// 图片上传尺寸大小检验
|
|
beforeUpload (file) {
|
|
beforeUpload (file) {
|
|
@@ -355,18 +354,23 @@ export default {
|
|
};
|
|
};
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- uploadFile(param){
|
|
|
|
|
|
+ handleChange(param){
|
|
this.limit = 1
|
|
this.limit = 1
|
|
- document.getElementsByClassName("el-upload--picture-card")[0].style.display="none"
|
|
|
|
- fileId().then(res=>{
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- this.$refs['form'].clearValidate(['logo']);
|
|
|
|
|
|
+ this.num++
|
|
|
|
+ if(this.num>1){
|
|
|
|
+ this.num = 0
|
|
|
|
+ return false
|
|
|
|
+ }else{
|
|
|
|
+ fileId().then(res=>{ //获取文件批号
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs['form'].clearValidate(['logo']);
|
|
|
|
+ })
|
|
|
|
+ this.form.batchNo = res.data
|
|
|
|
+ this.form.logo = res.data
|
|
|
|
+ this.formData = new FormData()// FormData 对象
|
|
|
|
+ this.formData.append('files', param.raw)
|
|
})
|
|
})
|
|
- this.form.batchNo = res.msg
|
|
|
|
- this.form.logo = res.msg
|
|
|
|
- this.formData = new FormData()// FormData 对象
|
|
|
|
- this.formData.append('files', param.file)// 文件对象
|
|
|
|
- })
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
handSuccess(){
|
|
handSuccess(){
|
|
this.$refs.img.clearValidate();
|
|
this.$refs.img.clearValidate();
|
|
@@ -385,6 +389,7 @@ export default {
|
|
if (valid) {
|
|
if (valid) {
|
|
this.loading = true
|
|
this.loading = true
|
|
// 上传图片
|
|
// 上传图片
|
|
|
|
+ this.form.businessType = "产品logo",
|
|
uploadFileApi(this.form.batchNo,this.form.businessType,this.formData).then(response => {
|
|
uploadFileApi(this.form.batchNo,this.form.businessType,this.formData).then(response => {
|
|
if(response.data.length>0){
|
|
if(response.data.length>0){
|
|
let ids = new FormData()
|
|
let ids = new FormData()
|