| | |
| | | <div class="scrollable-container"> |
| | | <div class="content"> |
| | | <el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false" |
| | | :filter-node-method="filterNode" ref="tree" node-key="id" :default-expanded-keys="treeId" |
| | | highlight-current @node-click="handleNodeClick" :render-content="renderContent" v-loading="loadings" /> |
| | | :filter-node-method="filterNode" ref="tree" node-key="id" :default-expanded-keys="treeId" |
| | | highlight-current @node-click="handleNodeClick" :render-content="renderContent" v-loading="loadings"/> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="项目标准值" align="center" prop="proScope" :show-overflow-tooltip="true" width="90px"> |
| | | </el-table-column> |
| | | <el-table-column label="Lis项目名称" align="center" prop="lisXmmc" :show-overflow-tooltip="true" width="200px"> |
| | | <el-table-column label="Lis项目名称" align="center" prop="lisXmmc" :show-overflow-tooltip="true" width="200px"> |
| | | </el-table-column> |
| | | <el-table-column label="Lis编码" align="center" prop="lisXmbm" :show-overflow-tooltip="true" width="90px"> |
| | | </el-table-column> |
| | |
| | | <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width" width="80px"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['hosp:project:edit']" title="修改1"></el-button> |
| | | v-hasPermi="['hosp:project:edit']" title="修改"></el-button> |
| | | <el-button v-if="scope.row.proParentId == '0'" size="mini" type="text" icon="el-icon-plus" |
| | | @click="handleAdd(scope.row)" v-hasPermi="['system:dept:add']" title="增加"></el-button> |
| | | <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" |
| | |
| | | }); |
| | | }, |
| | | methods: { |
| | | debounceFilter: debounce(function (val) { |
| | | debounceFilter: debounce(function(val) { |
| | | this.$refs.tree.filter(val); |
| | | }, 300), |
| | | precomputePinyin() { |
| | |
| | | this.form.proParentId = row.proId || 0; |
| | | this.open = true; |
| | | } else if (this.treeDate.id) { |
| | | if (this.treeDate.qf == "0") { |
| | | this.form.proParentId = "0" |
| | | this.projectOptions.forEach((item) => { |
| | | item.children.forEach((item1) => { |
| | | if (this.treeDate.id == item1.deptId) { |
| | | this.form.deptId = item1.deptId; |
| | | } |
| | | }); |
| | | if(this.treeDate.qf == "0"){ |
| | | this.form.proParentId = "0" |
| | | this.projectOptions.forEach((item) => { |
| | | item.children.forEach((item1) => { |
| | | if (this.treeDate.id == item1.deptId) { |
| | | this.form.deptId = item1.deptId; |
| | | } |
| | | }); |
| | | } else { |
| | | this.form.proParentId = this.treeDate.id; |
| | | this.projectOptions.forEach((item) => { |
| | | item.children.forEach((item1) => { |
| | | if (this.form.proParentId == item1.proId) { |
| | | this.form.deptId = item1.deptId; |
| | | } |
| | | }); |
| | | }); |
| | | }else{ |
| | | this.form.proParentId = this.treeDate.id; |
| | | this.projectOptions.forEach((item) => { |
| | | item.children.forEach((item1) => { |
| | | if (this.form.proParentId == item1.proId) { |
| | | this.form.deptId = item1.deptId; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | }); |
| | | } |
| | | |
| | | |
| | | this.open = true; |
| | | } else { |
| | | this.form.proParentId = "0" |
| | | this.form.proParentId = "0" |
| | | this.open = true; |
| | | } |
| | | } |
| | |
| | | this.treeId.push(this.treeDate.id); |
| | | }); |
| | | }, |
| | | handleNodeClick(date, node) { |
| | | // 当 qf 为 "0" 时,仅执行展开/折叠操作 |
| | | if (date.qf === "0") { |
| | | if (node.expanded) { |
| | | node.collapse(); // 折叠节点 |
| | | } else { |
| | | node.expand(); // 展开节点 |
| | | } |
| | | return; // 直接返回,不执行后续操作 |
| | | } |
| | | |
| | | // 以下逻辑仅在 qf 不为 "0" 时执行 |
| | | this.treeDate = date; |
| | | console.log('Selected node:', this.treeDate); |
| | | |
| | | this.id = date.id; |
| | | this.queryParams.proId = this.id; |
| | | this.xiugais = date.qf === "0"; |
| | | let data = { |
| | | proId: this.queryParams.proId, |
| | | proName: this.queryParams.proName || '', |
| | | }; |
| | | |
| | | this.loading = true; |
| | | getInfoByProId(this.id) |
| | | .then((response) => { |
| | | this.xiugaiList = response.data; |
| | | }) |
| | | .catch((error) => { |
| | | console.error('Failed to get info by proId:', error); |
| | | this.$message.error('获取数据失败'); |
| | | }); |
| | | |
| | | getAllChildListById(data) |
| | | .then((response) => { |
| | | if (response.code === 200) { |
| | | this.projectList = response.data.list.length >= 1 ? this.handleTree(response.data.list, "proId") : []; |
| | | this.ListId = this.projectList.length && this.projectList[0]?.proId ? [this.projectList[0].proId] : []; |
| | | this.key = response.data.key; |
| | | this.getList(); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.error('Failed to get all child list:', error); |
| | | this.$message.error('加载列表失败'); |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | handleNodeClick(date) { |
| | | |
| | | this.treeDate = date; |
| | | console.log(this.treeDate) |
| | | this.xiugais = date.qf === "0"; |
| | | let proId = date.id; |
| | | getInfoByProId(proId).then((response) => { |
| | | this.xiugaiList = response.data; |
| | | }); |
| | | this.id = date.id; |
| | | this.queryParams.proId = date.id; |
| | | let data = { |
| | | proId: this.queryParams.proId, |
| | | proName: this.queryParams.proName, |
| | | }; |
| | | this.loading = true; |
| | | getAllChildListById(data).then((response) => { |
| | | if (response.code == 200) { |
| | | this.projectList = response.data.list.length >= 1 ? this.handleTree(response.data.list, "proId") : []; |
| | | this.ListId = this.projectList.length ? [this.projectList[0].proId] : []; |
| | | this.key = response.data.key; |
| | | this.loading = false; |
| | | } |
| | | }); |
| | | }, |
| | | toggleExpandAll() { |
| | | this.refreshTable = false; |
| | | this.isExpandAll = !this.isExpandAll; |
| | |
| | | this.getList(); |
| | | this.$modal.msgSuccess("删除成功"); |
| | | }) |
| | | .catch(() => { }); |
| | | .catch(() => {}); |
| | | }, |
| | | handleExport() { |
| | | this.download( |