裁决书管理
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog title="修改模板" :visible="editVisable" v-if="editVisable" @close="cancel" width="600px" center>
|
||||
<el-form :model="ruleForm" label-position="left" :rules="rules" ref="ruleForm" label-width="90px"
|
||||
class="demo-ruleForm">
|
||||
<el-form-item label="模板名称" prop="temName">
|
||||
<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>
|
||||
</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>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel" class="endbutton"><span>取 消</span></el-button>
|
||||
<el-button type="primary" @click="submitUpload" class="endbutton"><span>确认</span></el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getToken } from "@/utils/auth";
|
||||
export default {
|
||||
props: ["editVisable", "editData","queryParams"],
|
||||
data() {
|
||||
return {
|
||||
fileList: [],
|
||||
data: [],
|
||||
headers: {
|
||||
Authorization: "Bearer " + getToken(),
|
||||
},
|
||||
filedata: {},
|
||||
flagBtn: false,
|
||||
ruleForm: {},
|
||||
rules: {
|
||||
temName: [
|
||||
{ required: true, message: '请输入模板名称', trigger: 'blur' },
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
editData(val) {
|
||||
if (val) {
|
||||
this.ruleForm = val;
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 打开链接
|
||||
openUrl(urlTemp){
|
||||
let headPath = window.location.origin + "/API/";
|
||||
window.open(headPath + urlTemp);
|
||||
},
|
||||
cancel() {
|
||||
this.$emit("cancelEdit");
|
||||
},
|
||||
handleChange(file, fileList) {
|
||||
// this.imageUrl = URL.createObjectURL(file.raw);
|
||||
},
|
||||
UploadUrl() {
|
||||
return window.location.origin + "/API/deptIdentify/updateTemplate";
|
||||
},
|
||||
submitUpload() {
|
||||
this.$refs['ruleForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.filedata.id = this.editData.id;
|
||||
this.filedata.temName = this.ruleForm.temName;
|
||||
this.$refs.upload.submit();
|
||||
}
|
||||
});
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList);
|
||||
},
|
||||
beforeUpload(file) {
|
||||
const isImg = file.type === '.pdf' || '.word'
|
||||
if (!isImg) {
|
||||
this.$message.error('只能上传pdf,word格式的文件')
|
||||
}
|
||||
return isImg
|
||||
},
|
||||
handleSuccess() {
|
||||
this.$message.success('上传成功');
|
||||
this.$emit("cancelEdit");
|
||||
this.$emit('getList',this.queryParams);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
Reference in New Issue
Block a user