|
|
@ -48,12 +48,12 @@ |
|
|
|
<el-input type="textarea" v-model="dataForm.remark" placeholder="备注"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item class="block" |
|
|
|
label="附件" |
|
|
|
label="照片" |
|
|
|
label-width="150px" |
|
|
|
prop="attach"> |
|
|
|
<el-upload class="upload-demo" |
|
|
|
:action="uploadUlr" |
|
|
|
accept=".doc,.pdf,.xls,.docx,.xlsx,.jpg,.png,.jpeg,.bmp,.mp4,.wma,.m4a,.mp3" |
|
|
|
accept=".jpg,.png,.jpeg,.bmp" |
|
|
|
:on-success="handleFileSuccess" |
|
|
|
:on-remove="handleFileRemove" |
|
|
|
:on-preview="handleFileDownload" |
|
|
@ -64,7 +64,7 @@ |
|
|
|
:disabled="dataForm.fileList.length===3" |
|
|
|
type="primary">点击上传</el-button> |
|
|
|
<div slot="tip" |
|
|
|
class="el-upload__tip">支持图片、word、pdf</div> |
|
|
|
class="el-upload__tip">支持jpg、png、bmp</div> |
|
|
|
</el-upload> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
@ -114,15 +114,9 @@ export default { |
|
|
|
computed: { |
|
|
|
dataRule () { |
|
|
|
return { |
|
|
|
customerId: [ |
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|
|
|
], |
|
|
|
agencyId: [ |
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|
|
|
], |
|
|
|
pids: [ |
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|
|
|
], |
|
|
|
gridId: [ |
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|
|
|
], |
|
|
@ -200,7 +194,7 @@ export default { |
|
|
|
const array = file.name.split('.') |
|
|
|
const extension = array[array.length - 1] |
|
|
|
|
|
|
|
const formatarray = ['jpg', 'png', 'jpeg', 'bmp', 'mp4', 'wma', 'm4a', 'mp3', 'doc', 'docx', 'xls', 'xlsx', 'pdf'] |
|
|
|
const formatarray = ['jpg', 'png', 'jpeg', 'bmp'] |
|
|
|
|
|
|
|
if (formatarray.indexOf(extension) === -1) { |
|
|
|
this.$message.error('只支持图片、word、pdf') |
|
|
@ -242,7 +236,6 @@ export default { |
|
|
|
|
|
|
|
file.fileName = file.name |
|
|
|
file.fileType = file.type |
|
|
|
file.url = file.url |
|
|
|
|
|
|
|
this.dataForm.fileList.push(file) |
|
|
|
console.log(this.dataForm.fileList) |
|
|
@ -265,6 +258,9 @@ export default { |
|
|
|
if (this.dataForm.content.length < 70) { |
|
|
|
return this.$message.error("内容不能少于70字") |
|
|
|
} |
|
|
|
if (this.dataForm.fileList.length < 1) { |
|
|
|
return this.$message.error("照片不能为空") |
|
|
|
} |
|
|
|
this.$refs['dataForm'].validate((valid) => { |
|
|
|
if (!valid) { |
|
|
|
return false |
|
|
|