WXL (wul)
8 天以前 da65acd978c10cf75c91334ee1a768e7d82884f7
src/views/patient/archives/generateConfig/index.vue
@@ -182,6 +182,20 @@
            </el-table-column>
            <el-table-column
              label="随访周期"
              align="center"
              min-width="180"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-if="formatFollowupCycle(scope.row)">
                  {{ formatFollowupCycle(scope.row) }}
                </span>
                <span v-else style="color: #c0c4cc">—</span>
              </template>
            </el-table-column>
            <el-table-column
              label="备注"
              align="center"
              prop="remark"
@@ -241,7 +255,7 @@
    <el-dialog
      :title="dialogTitle"
      :visible.sync="dialogVisible"
      width="45%"
      width="60%"
      :close-on-click-modal="false"
      @close="cancelForm"
    >
@@ -337,6 +351,16 @@
          <div class="form-tip">从疾病诊断表中选择,按 ICD10 编码匹配患者</div>
        </el-form-item>
        <el-form-item label="随访周期配置">
          <EditableTable
            :data.sync="form.followupCycle"
            :editing="true"
            :columns="followupColumns"
            auto-seq="seq"
          />
          <div class="form-tip">定义该规则匹配后建档的随访计划(随访周期 / 方式 / 内容)</div>
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input
            v-model="form.remark"
@@ -375,6 +399,7 @@
} from "@/api/smartor/specificArchiveGenerateConfig";
import { getillnesslist } from "@/api/AiCentre/index";
import OptionalForm from "@/components/OptionalForm";
import EditableTable from "../components/EditableTable.vue";
// 部门类型:1 科室,2 病区
const DEPT_TYPE_OPTIONS = [
@@ -403,7 +428,7 @@
export default {
  name: "GenerateConfig",
  components: { OptionalForm },
  components: { OptionalForm, EditableTable },
  data() {
    // 科室/病区编码 与 诊断编码 至少填写一项,否则该规则无法匹配任何患者
    const validateDeptOrIcd = (rule, value, callback) => {
@@ -420,6 +445,14 @@
      // 常量
      DEPT_TYPE_OPTIONS,
      DEPT_CATEGORY_OPTIONS,
      // 随访周期配置列(随访计划模板:序号 / 随访周期 / 随访方式 / 随访内容)
      followupColumns: [
        { prop: "seq", label: "序号", width: 60 },
        { prop: "cycle", label: "随访周期", width: 180 },
        { prop: "method", label: "随访方式", width: 160 },
        { prop: "content", label: "随访内容", minWidth: 240 },
      ],
      // 遮罩层
      loading: false,
@@ -461,6 +494,7 @@
        archiveType: "",
        deptCodes: [],
        icdList: [],
        followupCycle: [],
        remark: "",
      },
      // 表单校验
@@ -583,6 +617,7 @@
        archiveType: row.archiveType || "",
        deptCodes: this.parseJsonArray(row.deptCodes),
        icdList: this.resolveIcdCodes(row.icd10Codes),
        followupCycle: this.parseJsonArray(row.followupPeriod),
        remark: row.remark || "",
      };
    },
@@ -657,6 +692,10 @@
          this.form.icdList && this.form.icdList.length
            ? JSON.stringify(this.form.icdList.map((d) => d.icdcode))
            : "[]";
        data.followupPeriod =
          this.form.followupCycle && this.form.followupCycle.length
            ? JSON.stringify(this.form.followupCycle)
            : "[]";
        saveSpecificArchiveGenerateConfig(data)
          .then((response) => {
@@ -694,6 +733,7 @@
        archiveType: "",
        deptCodes: [],
        icdList: [],
        followupCycle: [],
        remark: "",
      };
    },
@@ -759,6 +799,20 @@
        .join("、");
    },
    /** 随访周期 -> 展示文本(随访周期 / 随访方式 拼接) */
    formatFollowupCycle(row) {
      const list = this.parseJsonArray(row.followupPeriod);
      if (!list.length) return "";
      return list
        .map((c) => {
          const cycle = c.cycle || "";
          const method = c.method ? "(" + c.method + ")" : "";
          return cycle + method;
        })
        .filter((s) => s.trim())
        .join("、");
    },
    /** 解析后端返回的 JSON 字符串(deptCodes / icd10Codes) */
    parseJsonArray(val) {
      if (!val) return [];