1129测试

This commit is contained in:
fz
2023-11-29 22:56:06 +08:00
parent c507f28f3f
commit b537bd958d
3 changed files with 28 additions and 12 deletions
@@ -31,6 +31,7 @@
</template>
<script>
import { getToken } from "@/utils/auth";
import { updateTemplate } from "@/api/officialSeal/officialSeal"
export default {
props: ["editVisable", "editData", "queryParams"],
dicts: ["template_type"],
@@ -41,7 +42,7 @@ export default {
headers: {
Authorization: "Bearer " + getToken(),
},
isImg: false,
isImg: true,
filedata: {},
flagBtn: false,
ruleForm: {},
@@ -77,19 +78,32 @@ export default {
},
handleChange(file, fileList) {
this.isImg = file.type === '.doc' || '.docx';
this.fileList = fileList;
},
UploadUrl() {
return window.location.origin + "/API/deptIdentify/updateTemplate";
},
submitUpload() {
let that = this;
this.$refs['ruleForm'].validate((valid) => {
if (valid) {
this.filedata.id = this.editData.id;
this.filedata.temName = this.ruleForm.temName;
if (this.isImg) {
this.$refs.upload.submit();
}else{
this.$message.error('只能上传doc,docx格式的文件')
if (that.fileList.length > 0) {
that.filedata.id = that.editData.id;
that.filedata.temName = that.ruleForm.temName;
if (that.isImg) {
that.$refs.upload.submit();
} else {
that.$message.error('只能上传doc,docx格式的文件')
}
} else {
updateTemplate({
id: that.editData.id,
temName: that.ruleForm.temName
}).then(res => {
that.$message.success('修改成功');
that.$emit("cancelEdit");
that.$emit('getList', that.queryParams);
})
}
}
});
@@ -101,7 +115,7 @@ export default {
// this.isImg = file.type === '.doc' || '.docx'
},
handleSuccess() {
this.$message.success('上传成功');
this.$message.success('修改成功');
this.$emit("cancelEdit");
this.$emit('getList', this.queryParams);
}