| | |
| | | > |
| | | <el-option |
| | | class="ruleFormaa" |
| | | v-for="item in belongDepts" |
| | | v-for="item in flatArray" |
| | | :key="item.deptCode" |
| | | :label="item.deptName" |
| | | :value="item.deptCode" |
| | |
| | | > |
| | | <el-option |
| | | class="ruleFormaa" |
| | | v-for="item in belongWards" |
| | | v-for="item in flatArray" |
| | | :key="item.districtCode" |
| | | :label="item.districtName" |
| | | :value="item.districtCode" |
| | |
| | | getFollowuplist, |
| | | deltargetillness, |
| | | getillnesslist, |
| | | depthospgetsonlist , |
| | | depthospgetson, |
| | | depthospgetsonlist, |
| | | illnesslistget, |
| | | getillness, |
| | | getgenerallist, |
| | |
| | | { variatename: "病情", variate: "${illness}", default: 1 }, |
| | | ], |
| | | deptList: [], |
| | | flatArray:[], |
| | | props: { multiple: true, value: "deptId", label: "deptName" }, |
| | | |
| | | variablelist: [ |
| | |
| | | this.gettabList(); |
| | | this.getvFollowup(); |
| | | this.auxiliary(); |
| | | }else{ |
| | | } else { |
| | | this.tempDetpRelevanceslistform = []; |
| | | this.tempbelongWardsform = []; |
| | | } |
| | |
| | | this.id = this.$route.query.id; |
| | | this.task = this.$route.query.task; |
| | | }, |
| | | // 获取科室树 |
| | | getDeptTree() { |
| | | // 科室列表 |
| | | deptTreeSelect().then((response) => { |
| | | this.deptOptions = response.data; |
| | | this.flatArray = this.flattenArray(response.data); |
| | | console.log(this.flatArray,'扩展数据'); |
| | | }); |
| | | }, |
| | | flattenArray(multiArray) { |
| | | let result = []; |
| | | |
| | | // 递归函数,用于将多级数组转换为一维数组 |
| | | function flatten(element, parentId) { |
| | | // 克隆元素以避免修改原始数据 |
| | | let item = JSON.parse(JSON.stringify(element)); |
| | | if (parentId !== undefined) { |
| | | item.parentId = parentId; // 使用字符串或数字作为键 |
| | | } |
| | | result.push(item); // 将元素添加到结果数组 |
| | | if (element.children && element.children.length > 0) { |
| | | element.children.forEach((child) => flatten(child, element.id)); // 递归处理子元素 |
| | | } |
| | | } |
| | | |
| | | multiArray.forEach((element) => flatten(element, null)); // 从顶层元素开始递归 |
| | | return result; // 返回一维数组 |
| | | }, |
| | | // 获取表单数据 |
| | | getvFollowup() { |
| | |
| | | this.ruleForm.assortid = -1; |
| | | } |
| | | this.ruleForm.labelInfo = JSON.stringify(this.dynamicTags); |
| | | if (Array.isArray(this.ruleForm.suitway)) this.ruleForm.suitway = this.ruleForm.suitway.join(","); |
| | | if (Array.isArray(this.ruleForm.campus))this.ruleForm.campus = this.ruleForm.campus.join(","); |
| | | if (Array.isArray(this.ruleForm.submoduleID))this.ruleForm.submoduleID = this.ruleForm.submoduleID.join(","); |
| | | if (Array.isArray(this.ruleForm.suitway)) |
| | | this.ruleForm.suitway = this.ruleForm.suitway.join(","); |
| | | if (Array.isArray(this.ruleForm.campus)) |
| | | this.ruleForm.campus = this.ruleForm.campus.join(","); |
| | | if (Array.isArray(this.ruleForm.submoduleID)) |
| | | this.ruleForm.submoduleID = this.ruleForm.submoduleID.join(","); |
| | | |
| | | // 提交 |
| | | this.ruleForm.ivrLibaTemplateScriptVOList.forEach((res) => { |
| | |
| | | }, 1000); |
| | | // this.submitForm(); |
| | | }, |
| | | // 保存科室/病区 |
| | | putbelongDepts(id) { |
| | | // 保存科室/病区 |
| | | putbelongDepts(id) { |
| | | if (this.tempDetpRelevanceslistform.length > 0) { |
| | | depthospgetson(this.tempDetpRelevanceslistform).then((res) => { |
| | | if (res.code == 200) { |
| | |
| | | isoperation: 1, |
| | | }; |
| | | } |
| | | const exists = this.dynamicTags.some(department => department.tagname === tagname); |
| | | const exists = this.dynamicTags.some( |
| | | (department) => department.tagname === tagname |
| | | ); |
| | | if (exists) { |
| | | this.$modal.msgError("标签重复"); |
| | | return |
| | | return; |
| | | } |
| | | this.ruleForm.ivrLibaTemplateTagList.push(tagvalue); |
| | | this.dynamicTags.push(tagvalue); |
| | |
| | | resetForm(formName) { |
| | | this.$refs[formName].resetFields(); |
| | | }, |
| | | // 科室删除触发 |
| | | removetag(row) { |
| | | // 科室删除触发 |
| | | removetag(row) { |
| | | let result = this.deptlist |
| | | .filter((item) => item.deptCode == row) |
| | | .map((item) => item.id); |
| | |
| | | let result = this.hosplist |
| | | .filter((item) => item.deptCode == row) |
| | | .map((item) => item.id); |
| | | if (result.length) { |
| | | depthospgetsondel(result).then((res) => { |
| | | if (res.code) { |
| | | } |
| | | }); |
| | | } |
| | | if (result.length) { |
| | | depthospgetsondel(result).then((res) => { |
| | | if (res.code) { |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | // 预览--------------- |
| | | preview() { |
| | |
| | | .confirm("即将前往模板测试页面,请确认模板数据已保存。") |
| | | .then((res) => { |
| | | this.$router.push({ |
| | | path: "/knowledge/tpuconfigurat/measurement", |
| | | path: "/knowledge/templateku/configurat/measurement", |
| | | query: { id: this.id, name: this.ruleForm.templateName }, |
| | | }); |
| | | }) |