diff --git a/src/views/accounting/voucher/index.vue b/src/views/accounting/voucher/index.vue index 04309368..fbc4feb8 100644 --- a/src/views/accounting/voucher/index.vue +++ b/src/views/accounting/voucher/index.vue @@ -88,11 +88,6 @@ - - @@ -109,39 +104,6 @@ - - - - - @@ -218,92 +174,85 @@ - + + + + - + + + + - + + + + + + + + + + + + + + + + - - - - @@ -325,12 +274,19 @@ import { getVoucherPage, exportVoucherExcel, } from "@/api/accounting/voucher"; +import { listUser } from "@/api/system/user"; +import { getSiteTree } from "@/api/setting/organization"; export default { name: "Voucher", components: {}, data() { return { + propName: { + label: "pName", + value: "pId", + multiple: false, + }, // 遮罩层 loading: true, // 导出遮罩层 @@ -384,10 +340,18 @@ export default { form: {}, // 表单校验 rules: {}, + userOptions: [], //用户数据 + siteOptions: [], //归档位置数据 + siteArray: [], //归档位置选中值 + audit: null, + checker: null, + handle: null, }; }, created() { this.getList(); + this.getUserList(); + this.getSiteList(); }, methods: { /** 查询列表 */ @@ -400,6 +364,40 @@ export default { this.loading = false; }); }, + //获取归档位置 + getSiteList() { + getSiteTree().then((response) => { + this.siteOptions = response.data; + this.siteOptions.map((w) => { + w.children.map((l) => { + let lstr = JSON.stringify(l.children) + .replace(/depotId/g, "lId") + .replace(/cabinetId/g, "pId") + .replace(/cabinetName/g, "pName"); + l.children = JSON.parse(lstr); + }); + + let wstr = JSON.stringify(w.children) + .replace(/organizationId/g, "wId") + .replace(/depotId/g, "pId") + .replace(/depotName/g, "pName"); + w.children = JSON.parse(wstr); + }); + let ostr = JSON.stringify(this.siteOptions) + .replace(/organizationId/g, "pId") + .replace(/organizationName/g, "pName"); + this.siteOptions = JSON.parse(ostr); + console.log(this.siteOptions); + }); + }, + //选择默认的归档位置 + handleSiteChanged(obj) { + if (obj != null) { + this.form.organizationId = obj[0]; + this.form.depotId = obj[1]; + this.form.cabinetId = obj[2]; + } + }, /** 取消按钮 */ cancel() { this.open = false; @@ -451,6 +449,21 @@ export default { this.resetForm("queryForm"); this.handleQuery(); }, + //获取用户 + getUserList() { + listUser().then((response) => { + this.userOptions = response.data.list; + }); + }, + handleSelectUser(val) { + this.form.audit = val.username; + }, + handleSelectUser1(val) { + this.form.checker = val.username; + }, + handleSelectUser2(val) { + this.form.handle = val.username; + }, /** 新增按钮操作 */ handleAdd() { this.reset();