|
@@ -194,7 +194,7 @@
|
|
:on-remove="handleRemove"
|
|
:on-remove="handleRemove"
|
|
:on-success="handlepaymentSuccess">
|
|
:on-success="handlepaymentSuccess">
|
|
<i class="el-icon-plus"></i>
|
|
<i class="el-icon-plus"></i>
|
|
- <div class="el-upload__tip" slot="tip">只能上传jpg/png文件,最多上传5张且单张图片不超过5M</div>
|
|
|
|
|
|
+ <div class="el-upload__tip" slot="tip">只能上传jpg/png文件,最多上传5张且单张图片不超过1M</div>
|
|
</el-upload>
|
|
</el-upload>
|
|
<el-dialog :visible.sync="dialogVisible" append-to-body>
|
|
<el-dialog :visible.sync="dialogVisible" append-to-body>
|
|
<img width="100%" :src="dialogImageUrl" alt="" />
|
|
<img width="100%" :src="dialogImageUrl" alt="" />
|
|
@@ -267,7 +267,6 @@ name: "ruleDetail",
|
|
//判断是否是做修改
|
|
//判断是否是做修改
|
|
if(this.$route.query.stationId!=null && this.$route.query.stationId!="" && this.$route.query.parentId !=null &&this.$route.query.parentId !=""){
|
|
if(this.$route.query.stationId!=null && this.$route.query.stationId!="" && this.$route.query.parentId !=null &&this.$route.query.parentId !=""){
|
|
this.queryParams.stationId=this.$route.query.stationId;
|
|
this.queryParams.stationId=this.$route.query.stationId;
|
|
- //this.form.imgFileList=[];
|
|
|
|
let id=this.$route.query.parentId;
|
|
let id=this.$route.query.parentId;
|
|
if(id!=null && id != ""){
|
|
if(id!=null && id != ""){
|
|
getRule(id).then(response => {
|
|
getRule(id).then(response => {
|
|
@@ -342,7 +341,6 @@ name: "ruleDetail",
|
|
this.oilNameOptions = response.rows;
|
|
this.oilNameOptions = response.rows;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
-
|
|
|
|
oilNameChang(e){
|
|
oilNameChang(e){
|
|
let obj = {};
|
|
let obj = {};
|
|
obj = this.oilNameOptions.find((item)=>{//这里的userList就是上面遍历的数据源
|
|
obj = this.oilNameOptions.find((item)=>{//这里的userList就是上面遍历的数据源
|
|
@@ -363,13 +361,10 @@ name: "ruleDetail",
|
|
this.dialogVisible = true;
|
|
this.dialogVisible = true;
|
|
},
|
|
},
|
|
handleRemove(file, fileList) {
|
|
handleRemove(file, fileList) {
|
|
- // if (file.id) {
|
|
|
|
- // console.log('删除了已被上传过的图片')
|
|
|
|
- // console.log(file.id)
|
|
|
|
- // this.deleteImgFileList.push(file.id)
|
|
|
|
- // }
|
|
|
|
- // console.log("wewewewew");
|
|
|
|
- // this.form.imgFileList = fileList;
|
|
|
|
|
|
+ if (file.id) {
|
|
|
|
+ this.deleteImgFileList.push(file.id)
|
|
|
|
+ }
|
|
|
|
+ this.form.imgFileList = fileList;
|
|
//this.hideUpload = fileList.length >= this.limit
|
|
//this.hideUpload = fileList.length >= this.limit
|
|
},
|
|
},
|
|
beforeAvatarUpload(file) {
|
|
beforeAvatarUpload(file) {
|
|
@@ -383,74 +378,10 @@ name: "ruleDetail",
|
|
}
|
|
}
|
|
return isType && isLt5M;
|
|
return isType && isLt5M;
|
|
},
|
|
},
|
|
- picture1Change(file, fileList) {
|
|
|
|
- const isType = file.type === 'image/jpeg' || 'image/png'
|
|
|
|
- const isLt5M = file.size / 1024 / 1024 < 1
|
|
|
|
- if (!isType) {
|
|
|
|
- this.$message.error('上传头像图片只能是 JPG 或 PNG格式!');
|
|
|
|
- fileList.pop();
|
|
|
|
- }
|
|
|
|
- if (!isLt5M) {
|
|
|
|
- this.$message.error('上传头像图片大小不能超过 1MB!');
|
|
|
|
- fileList.pop();
|
|
|
|
- }
|
|
|
|
- console.log("file",file);
|
|
|
|
- console.log("this.form.imgFileList",this.form.imgFileList);
|
|
|
|
- console.log("this.form",this.form);
|
|
|
|
- // if(this.form.imgFileList!=null){
|
|
|
|
- // this.form.imgFileList.push(file);
|
|
|
|
- // }else{
|
|
|
|
- // this.form.imgFileList=[];
|
|
|
|
- // this.form.imgFileList.push(file);
|
|
|
|
- // }
|
|
|
|
- // // this.hideUpload = fileList.length >= this.limit;
|
|
|
|
- // console.log("this.form.imgFileList1",this.form.imgFileList);
|
|
|
|
- },
|
|
|
|
//上传成功
|
|
//上传成功
|
|
handlepaymentSuccess(response,file, fileList){
|
|
handlepaymentSuccess(response,file, fileList){
|
|
- console.log("fileList",fileList);
|
|
|
|
- console.log("response",response);
|
|
|
|
- console.log("file",file);
|
|
|
|
- //this.form.imgFileList.push(file);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
this.form.imgFileList.push({name:file.name,url:response.url});
|
|
this.form.imgFileList.push({name:file.name,url:response.url});
|
|
- //this.form.imgFileList=fileList;
|
|
|
|
- console.log("11:",this.form.imgFileList);
|
|
|
|
},
|
|
},
|
|
- // submitUpload() {
|
|
|
|
- // this.uploadUrl = this.$http.adornUrl(`/common/upload?token=${this.$cookie.get('token')}`);
|
|
|
|
- // console.log("uploadUrl", this.uploadUrl);
|
|
|
|
- // let formData = new FormData(); // 用FormData存放上传文件
|
|
|
|
- // this.form.imgFileList.forEach(file => {
|
|
|
|
- // console.log(file.raw)
|
|
|
|
- // console.log(file.size)
|
|
|
|
- // formData.append('file', file.raw)
|
|
|
|
- // })
|
|
|
|
- // console.log("formData",formData);
|
|
|
|
- // this.$http({
|
|
|
|
- // url: this.uploadUrl,
|
|
|
|
- // method: 'post',
|
|
|
|
- // data: formData,
|
|
|
|
- // headers: {
|
|
|
|
- // "Content-Type": "multipart/form-data"
|
|
|
|
- // }
|
|
|
|
- // }).then(({
|
|
|
|
- // data
|
|
|
|
- // }) => {
|
|
|
|
- // if (data && data.code === 0) {
|
|
|
|
- // console.log("data",data);
|
|
|
|
- // for (var i = 0; i < data.imgNameList.length; i++) {
|
|
|
|
- // this.imgNameList.push(data.imgNameList[i].name)
|
|
|
|
- // this.imgSize.push(data.imgNameList[i].size)
|
|
|
|
- // }
|
|
|
|
- // //this.submitForm()
|
|
|
|
- // this.$refs.upload.clearFiles();
|
|
|
|
- // } else {
|
|
|
|
- // this.$message.error(data.msg)
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
- // },
|
|
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
submitForm() {
|
|
submitForm() {
|
|
this.$refs["form"].validate(valid => {
|
|
this.$refs["form"].validate(valid => {
|