diff --git a/src/utils/dict.js b/src/utils/dict.js index eced4e9f..22b7df14 100644 --- a/src/utils/dict.js +++ b/src/utils/dict.js @@ -131,6 +131,8 @@ export const DICT_TYPE = { ACCOUNTING_INVOICES_STATUS: 'accounting_invoices_status', // 发票进销项 ACCOUNTING_INVOICES_TYPE: 'accounting_invoices_type', + // 会计其他资料 + ACCOUNTING_OTHER_TYPE: 'accounting_other_type', //合同类型 CONTRACT_TYPE: 'contract_type', //合同状态 diff --git a/src/views/accounting/other/index.vue b/src/views/accounting/other/index.vue index 3381ede2..937dfb0a 100644 --- a/src/views/accounting/other/index.vue +++ b/src/views/accounting/other/index.vue @@ -151,7 +151,28 @@ width="1000px" append-to-body > - + + +
将文件拖到此处,或点击上传
+
+ + @@ -253,6 +274,7 @@ import { getOtherPage, exportOtherExcel, } from "@/api/accounting/other"; +import { getAccessToken } from "@/utils/auth"; // import {DICT_TYPE, getDictDatas} from "@/utils/dict"; export default { name: "Other", @@ -303,6 +325,10 @@ export default { form: {}, // 表单校验 rules: {}, + fileList: [], // 文件列表 + uploadUrl: + process.env.VUE_APP_BASE_API + "/admin-api//accounting/other/upload", // 上传地址地址 + headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头 }; }, created() { @@ -339,6 +365,7 @@ export default { company: undefined, note: undefined, remark: undefined, + fileUrl: null, }; this.resetForm("form"); }, @@ -354,10 +381,16 @@ export default { }, /** 新增按钮操作 */ handleAdd() { + this.fileList = []; this.reset(); this.open = true; this.title = "添加其他资料"; }, + // 上传成功的函数 + handleSuccess(res) { + console.log(res); + this.form.fileUrl = res.data.url; + }, /** 修改按钮操作 */ handleUpdate(row) { this.reset();