公章,批量缴费

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
@@ -7,13 +7,14 @@
<el-input v-model="ruleForm.temName"></el-input>
</el-form-item>
<el-form-item label="当前模板">
<span style="color: #0e5ce3;cursor:pointer" @click="openUrl(editData.temOrigPath)">{{ editData.temOrigPath }}</span>
<span style="color: #0e5ce3;cursor:pointer" @click="openUrl(editData.temOrigPath)">{{ editData.fileName
}}</span>
</el-form-item>
</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>
@@ -25,7 +26,7 @@
<script>
import { getToken } from "@/utils/auth";
export default {
props: ["editVisable", "editData","queryParams"],
props: ["editVisable", "editData", "queryParams"],
data() {
return {
fileList: [],
@@ -33,6 +34,7 @@ export default {
headers: {
Authorization: "Bearer " + getToken(),
},
isImg: false,
filedata: {},
flagBtn: false,
ruleForm: {},
@@ -55,7 +57,7 @@ export default {
},
methods: {
// 打开链接
openUrl(urlTemp){
openUrl(urlTemp) {
let headPath = window.location.origin + "/API/";
window.open(headPath + urlTemp);
},
@@ -63,7 +65,8 @@ export default {
this.$emit("cancelEdit");
},
handleChange(file, fileList) {
// this.imageUrl = URL.createObjectURL(file.raw);
debugger
this.isImg = (file.type === '.doc' || file.type === '.docx') ? true:false;
},
UploadUrl() {
return window.location.origin + "/API/deptIdentify/updateTemplate";
@@ -73,7 +76,11 @@ export default {
if (valid) {
this.filedata.id = this.editData.id;
this.filedata.temName = this.ruleForm.temName;
this.$refs.upload.submit();
if (this.isImg) {
this.$refs.upload.submit();
}else{
this.$message.error('只能上传doc,docx格式的文件')
}
}
});
},
@@ -81,20 +88,15 @@ export default {
console.log(file, fileList);
},
beforeUpload(file) {
const isImg = file.type === '.pdf' || '.word'
if (!isImg) {
this.$message.error('只能上传pdf,word格式的文件')
}
return isImg
this.isImg = file.type === '.doc' || '.docx'
},
handleSuccess() {
this.$message.success('上传成功');
this.$emit("cancelEdit");
this.$emit('getList',this.queryParams);
this.$emit('getList', this.queryParams);
}
},
};
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>