bug修改
This commit is contained in:
parent
c696fd7b06
commit
affe602366
|
|
@ -101,7 +101,7 @@
|
||||||
<!-- 添加或修改岗位对话框 -->
|
<!-- 添加或修改岗位对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="项目名称" prop="projectDepartName">
|
<el-form-item label="项目部名称" prop="projectDepartName">
|
||||||
<el-input v-model="form.projectDepartName" maxlength="20" placeholder="请输入项目名称" />
|
<el-input v-model="form.projectDepartName" maxlength="20" placeholder="请输入项目名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="负责人" prop="projectHeadName">
|
<el-form-item label="负责人" prop="projectHeadName">
|
||||||
|
|
@ -243,6 +243,18 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
beforeUpload(file) {
|
||||||
|
const isJPG = file.raw.type === 'image/jpeg' || file.raw.type === 'image/png' || file.raw.type === 'image/jpg'
|
||||||
|
const isLt2M = file.size / 1024 / 1024 < 5
|
||||||
|
// console.log(isJPG)
|
||||||
|
if (!isJPG) {
|
||||||
|
this.$message.error('上传图片只能是 JPG ,JPEG或 PNG 格式!')
|
||||||
|
}
|
||||||
|
if (!isLt2M) {
|
||||||
|
this.$message.error('上传图片大小不能超过 5MB!')
|
||||||
|
}
|
||||||
|
return isJPG && isLt2M
|
||||||
|
},
|
||||||
//单选操作-跨页
|
//单选操作-跨页
|
||||||
handlerSelect(val, row) {
|
handlerSelect(val, row) {
|
||||||
this.currentSelection.indexOf(row.projectId) === -1
|
this.currentSelection.indexOf(row.projectId) === -1
|
||||||
|
|
@ -370,8 +382,14 @@ export default {
|
||||||
// 图片上传
|
// 图片上传
|
||||||
handleChange(file, fileList) {
|
handleChange(file, fileList) {
|
||||||
console.log(file)
|
console.log(file)
|
||||||
|
console.log(fileList)
|
||||||
|
if(this.beforeUpload(file)==false){
|
||||||
|
fileList.splice(fileList.length-1,1)
|
||||||
|
}
|
||||||
// this.$refs["form"].clearValidate()
|
// this.$refs["form"].clearValidate()
|
||||||
this.fileList = fileList;
|
this.fileList = fileList;
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
handleRemove(file, fileList) {
|
handleRemove(file, fileList) {
|
||||||
let sum = 0
|
let sum = 0
|
||||||
|
|
@ -384,6 +402,7 @@ export default {
|
||||||
console.log(this.delFileIdList)
|
console.log(this.delFileIdList)
|
||||||
this.fileList.splice(sum, 1)
|
this.fileList.splice(sum, 1)
|
||||||
},
|
},
|
||||||
|
|
||||||
//上传组件-图片查看
|
//上传组件-图片查看
|
||||||
picturePreview(file) {
|
picturePreview(file) {
|
||||||
console.log(file)
|
console.log(file)
|
||||||
|
|
@ -475,7 +494,7 @@ export default {
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$modal.confirm('是否确认删除项目名称为"' + projectId + '"的数据项?').then(function() {
|
this.$modal.confirm('是否确认删除项目部名称为"' + projectId + '"的数据项?').then(function() {
|
||||||
return delProject(projectId);
|
return delProject(projectId);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue