公章,批量缴费

This commit is contained in:
fz
2023-11-23 20:07:01 +08:00
parent f512868759
commit 68d600c0e5
12 changed files with 484 additions and 119 deletions
@@ -6,6 +6,12 @@
<el-form-item label="模板名称" prop="temName">
<el-input v-model="ruleForm.temName"></el-input>
</el-form-item>
<el-form-item label="模板类型" prop="temType">
<el-select v-model="ruleForm.temType" placeholder="请选择">
<el-option v-for="dict in dict.type.template_type" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="机构名称" prop="identifyId">
<el-select v-model="ruleForm.identifyId" placeholder="请选择">
<el-option v-for="item in tempList" :key="item.id" :label="item.identifyName" :value="item.id">
@@ -15,8 +21,8 @@
</el-form>
<el-upload class="avatar-uploader" :before-upload="beforeUpload" :on-success="handleSuccess" ref="upload"
:action="UploadUrl()" :headers="headers" :data="filedata" :on-remove="handleRemove"
:on-change="handleChange" accept=".pdf,.word" :file-list="fileList" :auto-upload="false">
<el-button size="small" type="primary">点击上传</el-button>
:on-change="handleChange" accept=".doc,.docx" :file-list="fileList" :auto-upload="false">
<el-button size="small" type="primary">选择模板文件</el-button>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel" class="endbutton"><span>取 消</span></el-button>
@@ -31,12 +37,14 @@ import {
deptIdentifyList,
} from "@/api/officialSeal/officialSeal.js";
export default {
props: ["uploadVisable", "uploadData","queryParams"],
props: ["uploadVisable", "uploadData", "queryParams"],
dicts: ["template_type"],
data() {
return {
fileList: [],
data: [],
tempList:[],
tempList: [],
isImg:false,
headers: {
Authorization: "Bearer " + getToken(),
},
@@ -47,6 +55,12 @@ export default {
temName: [
{ required: true, message: '请输入模板名称', trigger: 'blur' },
],
temType: [
{ required: true, message: '请输入模板名称', trigger: 'blur' },
],
identifyId: [
{ required: true, message: '请输入模板名称', trigger: 'blur' },
]
}
};
},
@@ -72,7 +86,7 @@ export default {
this.$emit("cancelUpload");
},
handleChange(file, fileList) {
// this.imageUrl = URL.createObjectURL(file.raw);
this.isImg = file.type === '.doc' || '.docx'
},
UploadUrl() {
return window.location.origin + "/API/deptIdentify/insertTemplate";
@@ -82,7 +96,11 @@ export default {
if (valid) {
this.filedata.identifyId = this.ruleForm.identifyId;
this.filedata.temName = this.ruleForm.temName;
this.$refs.upload.submit();
if (this.isImg) {
this.$refs.upload.submit();
}else{
this.$message.error('只能上传doc,docx格式的文件')
}
}
});
},
@@ -90,16 +108,13 @@ export default {
console.log(file, fileList);
},
beforeUpload(file) {
const isImg = file.type === '.pdf' || '.word'
if (!isImg) {
this.$message.error('只能上传pdf,word格式的文件')
}
return isImg
// debugger
// this.isImg = file.type === '.doc' || '.docx'
},
handleSuccess() {
this.$message.success('上传成功');
this.$emit("cancelUpload");
this.$emit('getList',this.queryParams);
this.$emit('getList', this.queryParams);
}
},
};