|
@@ -21,7 +21,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="来文机关" prop="sendingAgency"
|
|
|
- :rules="[
|
|
|
+ :rules="[{required: true, message:'来文机关不能为空', trigger:'blur'}
|
|
|
]">
|
|
|
<el-input v-model="inputForm.sendingAgency" placeholder="请填写来文机关" ></el-input>
|
|
|
</el-form-item>
|
|
@@ -68,18 +68,46 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="内容摘要" prop="contentSummary"
|
|
|
- :rules="[
|
|
|
+ :rules="[{required: true, message:'内容摘要不能为空', trigger:'blur'}
|
|
|
]">
|
|
|
<el-input type="textarea" v-model="inputForm.contentSummary" placeholder="请填写内容摘要" ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="来文附件" prop="attachedDocumentId"
|
|
|
+ <el-form-item label="来文附件图片" prop="attachedDocumentId"
|
|
|
:rules="[
|
|
|
]">
|
|
|
- <image-upload v-model="inputForm.attachedDocumentId" :limit="3" tip="最多上传3个图片,单个图片不要超过10M"></image-upload>
|
|
|
+ <image-upload v-model="inputForm.attachedDocumentId" :limit="100" tip=""></image-upload>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="来文附件文件" prop="attachedDocumentId2"
|
|
|
+ :rules="[
|
|
|
+ ]">
|
|
|
+ <el-upload ref="attachedDocumentId2"
|
|
|
+ class="upload-demo"
|
|
|
+ :action="`${this.$http.BASE_URL}/gwfile/upload?uploadPath=userdir`"
|
|
|
+ :on-preview="(file, fileList) => {$window.location.href = (file.response && file.response.url) || file.url}"
|
|
|
+ :on-success="handleSuccess"
|
|
|
+ :on-remove="handleRemove"
|
|
|
+ :before-remove="(file, fileList) => {
|
|
|
+ return $confirm(`确定移除 ${file.name}?`)
|
|
|
+ }"
|
|
|
+ multiple
|
|
|
+ :limit="100"
|
|
|
+ :on-exceed="(files, fileList) =>{
|
|
|
+ $message.warning(`当前限制选择 100 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
|
|
|
+ }"
|
|
|
+ :file-list="uploadfilesArra">
|
|
|
+ <el-button size="small" type="primary">点击上传</el-button>
|
|
|
+ <template #tip>
|
|
|
+ <div class="el-upload__tip" style="min-width: 255px;">
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-upload>
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<!-- <el-col :span="12">
|
|
|
<el-form-item label="备注" prop="remark"
|
|
|
:rules="[
|
|
@@ -122,6 +150,7 @@
|
|
|
visible: false,
|
|
|
loading: false,
|
|
|
cardNum: "",
|
|
|
+ uploadfilesArra: [],
|
|
|
inputForm: {
|
|
|
id: '',
|
|
|
yearNum: '',
|
|
@@ -133,6 +162,7 @@
|
|
|
receivingTime: '',
|
|
|
contentSummary: '',
|
|
|
attachedDocumentId: '',
|
|
|
+ attachedDocumentId2: '',
|
|
|
remark: '',
|
|
|
state: ''
|
|
|
}
|
|
@@ -183,6 +213,26 @@
|
|
|
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
+ handleSuccess(res) {
|
|
|
+ if(this.inputForm.attachedDocumentId2==''){
|
|
|
+ this.inputForm.attachedDocumentId2 = res;
|
|
|
+ }else{
|
|
|
+ this.inputForm.attachedDocumentId2 = this.inputForm.attachedDocumentId2+","+res;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ handleRemove(res) {
|
|
|
+ if(this.inputForm.attachedDocumentId2.indexOf(res.response+",")!=-1){
|
|
|
+ this.inputForm.attachedDocumentId2=this.inputForm.attachedDocumentId2.replace(res.response+",","")
|
|
|
+ }else if(this.inputForm.attachedDocumentId2.indexOf(","+res.response)!=-1){
|
|
|
+ this.inputForm.attachedDocumentId2=this.inputForm.attachedDocumentId2.replace(","+res.response,"")
|
|
|
+ }else{
|
|
|
+ this.inputForm.attachedDocumentId2=this.inputForm.attachedDocumentId2.replace(res.response,"")
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// 表单提交
|
|
|
doSubmit () {
|
|
|
this.$refs['inputForm'].validate((valid) => {
|
|
@@ -191,6 +241,14 @@
|
|
|
this.inputForm.writtenTime = this.inputForm.writtenTime + " 00:00:00";
|
|
|
this.inputForm.receivingTime = this.inputForm.receivingTime + " 00:00:00";
|
|
|
this.inputForm.cardNum = this.cardNum
|
|
|
+
|
|
|
+ //文件和图片文件合并
|
|
|
+ if(this.inputForm.attachedDocumentId2!=''){
|
|
|
+ this.inputForm.attachedDocumentId=this.inputForm.attachedDocumentId+","+this.inputForm.attachedDocumentId2;
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log("图片:"+this.uploadfilesArra);
|
|
|
+
|
|
|
gwCirculationCard2Service.save(this.inputForm).then((data) => {
|
|
|
this.visible = false
|
|
|
this.$message.success(data)
|