From ecd5f28ec3dd41d74f6da96b92e32c600e2cf3d1 Mon Sep 17 00:00:00 2001 From: “linengliang” <vanSuperEnergy@163.com> Date: 星期二, 22 八月 2023 15:10:29 +0800 Subject: [PATCH] 小修改 --- src/views/spare/modules/sparePartScrap/SparePartScrapForm.vue | 31 +++++++++++++++++++++++++++++-- 1 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/views/spare/modules/sparePartScrap/SparePartScrapForm.vue b/src/views/spare/modules/sparePartScrap/SparePartScrapForm.vue index bf9e454..f422f8c 100644 --- a/src/views/spare/modules/sparePartScrap/SparePartScrapForm.vue +++ b/src/views/spare/modules/sparePartScrap/SparePartScrapForm.vue @@ -18,10 +18,18 @@ v-model='model.departId' dictCode="sys_depart,depart_name,id,del_flag!='1'" />--> - <a-select +<!-- <a-select :placeholder="'璇烽�夋嫨棰嗙敤閮ㄩ棬'" :options="this.departs" style="width: 100%" + v-model='model.departId' + />--> + <a-tree-select + style="width: 100%" + :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" + :tree-data="treeData" + placeholder="璇烽�夋嫨棰嗙敤閮ㄩ棬" + tree-default-expand-all v-model='model.departId' /> </a-form-model-item> @@ -62,6 +70,7 @@ :columns='sparesScrapDetailTable.columns' :dataSource='sparesScrapDetailTable.dataSource' :maxHeight='300' + @valueChange="changeAuxiliaryQuantity" :disabled='formDisabled' :rowNumber='true' :rowSelection='true' @@ -97,6 +106,7 @@ }, data() { return { + treeData:[], departs:[], bordered:true, labelCol: { @@ -386,6 +396,7 @@ add: '/spare/sparePartScrap/add', edit: '/spare/sparePartScrap/edit', getSysDeparts: "/eam/equipment/getSysDeparts", + loadOptions: '/sys/sysDepart/loadDepartTreeOptions', queryById: '/spare/sparePartScrap/queryById', sparesScrapDetail: { list: '/spare/sparePartScrap/querySparesScrapDetailByMainId' @@ -414,9 +425,18 @@ }) }, created() { - this.getSysDeparts() + this.initOptions() }, methods: { + initOptions() { + getAction(this.url.loadOptions).then(res => { + if (res.success) { + this.treeData = res.result + } else { + this.$message.warning(res.message) + } + }) + }, getSysDeparts() { getAction(this.url.getSysDeparts).then((res) => { if (res.success) { @@ -532,6 +552,13 @@ this.visible = false this.$emit('close') this.$refs.form.clearValidate() + }, + changeAuxiliaryQuantity(target){ + console.log(target.columnIndex) + let num=target.columnIndex + if (target.columnIndex ===num){ + target.row.scrapAuxiliaryQuantity=Math.abs(target.row.conversionRatio*target.row.scrapMainQuantity) + } } } } -- Gitblit v1.9.3