WXL
2024-10-12 2fe94c2414aa1b8840e4dbf9a8e19121a8a867b6
测试完成
已添加1个文件
已修改7个文件
3111 ■■■■ 文件已修改
src/api/AiCentre/Followup.js 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/AiCentre/Qtemplate.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/knowledge/questionnaire/compilequer/index.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/patient/propaganda/particty copy.vue 1437 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/patient/propaganda/particty.vue 1395 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/repositoryai/templateku/configurat/index.vue 233 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/user/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/AiCentre/Followup.js
@@ -70,3 +70,25 @@
      data: data,
    });
  }
      // é—®å·ä»»åŠ¡æ¨¡æ¿æ–°å¢žä¿®æ”¹
      export function Taskparticty(data) {
        return request({
          url: "/smartor/ivrTaskTemplate/saveOrUpdateTempScript",
          method: "post",
          data: data,
        });
      }
        // åˆ é™¤ä»»åŠ¡æ¨¡æ¿
    export function deleteTaskparticty(svyid) {
      return request({
        url: "/smartor/ivrTaskTemplate/remove/" + svyid,
        method: "get",
      });
    }
        export function getTaskparticty(svyid) {
          return request({
            url: "/smartor/ivrTaskTemplate/getInfo/" + svyid,
            method: "get",
          });
        }
src/api/AiCentre/Qtemplate.js
@@ -128,7 +128,7 @@
      data: data,
    });
  }
    // åˆ é™¤é—®å·æ¨¡æ¿åˆ†ç±»
    // åˆ é™¤ä»»åŠ¡æ¨¡æ¿
export function deleteTaskQuestioncomit(svyid) {
  return request({
    url: "/smartor/svytemplateTask/remove/" + svyid,
src/views/knowledge/questionnaire/compilequer/index.vue
@@ -280,7 +280,7 @@
                  size="medium"
                  multiple
                  filterable
                  placeholder="请选择科室"
                  placeholder="请选择病区"
                >
                  <el-option
                    class="ruleFormaa"
@@ -1455,8 +1455,7 @@
    this.appraiselist = store.getters.appraiselist;
    this.belongWards = store.getters.belongWards;
    this.belongDepts = store.getters.belongDepts;
    console.log(this.belongWards, "belongWards");
    console.log(this.belongDepts, "belongDepts");
    // this.test();
  },
@@ -1587,9 +1586,7 @@
    },
    // ç§‘室/院区处理
    Departmenttreatment() {
      console.log(this.tempDetpRelevanceslist, "tempDetpRelevanceslist");
      console.log(this.deptlist, "deptlist");
      console.log(this.hosplist, "deptlist");
      this.tempDetpRelevanceslist.forEach((item) => {
        console.log(item);
        let result = this.deptlist.some((obj) => obj.deptCode == item);
@@ -1607,9 +1604,6 @@
      });
      this.tempbelongWards.forEach((item) => {
        let result = this.hosplist.some((obj) => obj.deptCode == item);
        console.log(this.result, "resulthhh");
        if (!result) {
          this.tempbelongWardsform.push({
            deptType: 2,
@@ -1620,11 +1614,7 @@
          });
        }
      });
      console.log(this.tempbelongWardsform, "tempbelongWardsform");
      console.log(
        this.tempDetpRelevanceslistform,
        "tempDetpRelevanceslistform"
      );
      // return
      setTimeout(() => {
src/views/patient/propaganda/particty copy.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,1437 @@
<template>
  <div class="Questionnairemanagement">
    <!-- ä¸Šä¾§æ  -->
    <div class="sidecolumn">
      <div>
        <el-steps simple :active="Editprogress">
          <el-step
            icon="el-icon-edit"
            title="基础信息"
            description="选择模板、形式等基础信息"
          ></el-step>
          <el-step
            icon="el-icon-user"
            title="任务主体"
            description="在本部选择服务患者"
          ></el-step>
        </el-steps>
      </div>
    </div>
    <!-- ä¸‹ä¾§æ•°æ® -->
    <div class="leftvlue" style="margin: 0 20px">
      <!-- åŸºæœ¬ä¿¡æ¯ -->
      <div v-if="Editprogress == 1">
        <el-alert title="选择模板、形式等基础信息" type="success" effect="dark">
        </el-alert>
        <div class="leftvlue-jbxx">
          <!-- åŸºç¡€ä¿¡æ¯ -->
          <div class="examine-jic">
            <div class="headline">
              <div>基础信息</div>
            </div>
            <div class="jic-value">
              <el-form ref="form" :model="form" label-width="105px">
                <el-row :gutter="20">
                  <el-col :span="12"
                    ><el-form-item label="任务名称">
                      <el-input
                        style="width: 220px"
                        v-model="form.taskName"
                        placeholder="请输入任务名称"
                      /> </el-form-item
                  ></el-col>
                  <el-col :span="8"
                    ><el-form-item label="模板名称">
                      <el-input
                        style="width: 220px"
                        :disabled="true"
                        v-model="form.templatename"
                        placeholder="点击右侧选择"
                      /> </el-form-item
                  ></el-col>
                  <el-col :span="4">
                    <el-button
                      type="primary"
                      icon="el-icon-edit"
                      @click="drawermb = true"
                      circle
                    ></el-button>
                  </el-col>
                </el-row>
                <el-form-item label="任务描述">
                  <el-input
                    type="textarea"
                    v-model="form.taskDesc"
                    placeholder="请输入任务描述"
                  />
                </el-form-item>
                <el-form-item label="发送设置:">
                  <el-radio-group v-model="form.sendType">
                    <el-radio :label="1">时间段发送</el-radio>
                    <el-radio :label="3">时间点发送</el-radio>
                    <el-radio :label="2">即刻发送</el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label="发送日期:" v-if="form.sendType == 1">
                  <el-date-picker
                    v-model="daytime"
                    @change="changeTimeday"
                    type="daterange"
                    range-separator="至"
                    start-placeholder="开始日期"
                    end-placeholder="结束日期"
                    value-format="yyyy-MM-dd"
                  >
                  </el-date-picker>
                </el-form-item>
                <el-form-item label="发送时间点:" v-if="form.sendType == 3">
                  <div style="display: flex">
                    <div style="margin-right: 10px">
                      <el-date-picker
                        v-model="time4"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        @change="Totaldate"
                        type="datetime"
                        placeholder="选择日期时间"
                      >
                      </el-date-picker>
                    </div>
                  </div>
                </el-form-item>
                <el-form-item label="发送时间段:" v-if="form.sendType == 1">
                  <div style="display: flex">
                    <div style="margin-right: 10px">
                      <span style="font-size: 18px; margin-right: 10px"
                        >时间段一</span
                      >
                      <el-time-picker
                        is-range
                        arrow-control
                        @change="changeTime"
                        v-model="time1"
                        range-separator="至"
                        start-placeholder="开始时间"
                        end-placeholder="结束时间"
                        placeholder="选择时间范围"
                        value-format="HH:mm:ss"
                      >
                      </el-time-picker>
                    </div>
                    <div style="margin-right: 10px">
                      <span style="font-size: 18px; margin-right: 10px"
                        >时间段二</span
                      >
                      <el-time-picker
                        is-range
                        arrow-control
                        @change="changeTime"
                        v-model="time2"
                        range-separator="至"
                        start-placeholder="开始时间"
                        end-placeholder="结束时间"
                        placeholder="选择时间范围"
                        value-format="HH:mm:ss"
                      >
                      </el-time-picker>
                    </div>
                    <div style="margin-right: 10px">
                      <span style="font-size: 18px; margin-right: 10px"
                        >时间段三</span
                      >
                      <el-time-picker
                        is-range
                        arrow-control
                        @change="changeTime"
                        v-model="time3"
                        range-separator="至"
                        start-placeholder="开始时间"
                        end-placeholder="结束时间"
                        placeholder="选择时间范围"
                        value-format="HH:mm:ss"
                      >
                      </el-time-picker>
                    </div>
                  </div>
                </el-form-item>
                <el-form-item label="服务形式">
                  <el-checkbox-group v-model="checkList">
                    <el-checkbox
                      v-for="(item, index) in checkboxlist"
                      :key="index"
                      :label="item.value"
                    >
                      {{ item.label }}</el-checkbox
                    >
                  </el-checkbox-group>
                </el-form-item>
              </el-form>
            </div>
          </div>
          <div class="examine-jic">
            <div class="headline">
              <div>变量匹配量参</div>
            </div>
            <div class="examine-jic">
              <div class="jic-value">
                <el-row :gutter="20">
                  <el-table :data="variableList" style="width: 100%">
                    <el-table-column
                      prop="name"
                      align="center"
                      label="变量名称"
                    >
                    </el-table-column>
                    <el-table-column prop="value" align="center" label="匹配符">
                    </el-table-column>
                    <el-table-column label="替换值" align="center">
                      <template slot-scope="scope">
                        <el-input
                          :disabled="scope.row.default"
                          v-model="scope.row.fill"
                          placeholder="请输入内容"
                        ></el-input>
                      </template>
                    </el-table-column>
                    <el-table-column label="操作" align="center">
                      <template slot-scope="scope">
                        <!-- <el-button
                          size="mini"
                          @click="variableEdit(scope.$index, scope.row)"
                          >编辑</el-button
                        > -->
                        <el-button
                          size="mini"
                          type="danger"
                          @click="variableDelete(scope.$index, scope.row)"
                          >删除</el-button
                        >
                      </template>
                    </el-table-column>
                  </el-table>
                </el-row>
              </div>
            </div>
          </div>
        </div>
        <el-button type="success" @click="nextstep('ruleForm')">{{
          quote ? "立即创建" : "任务详情配置"
        }}</el-button>
        <el-button @click="resetForm('ruleForm')">重置</el-button>
      </div>
      <!-- ä»»åŠ¡è¯¦æƒ… -->
      <div v-if="Editprogress == 2">
        <el-alert title="在本阶段选择随访病人" type="success" effect="dark">
        </el-alert>
        <div class="leftvlue-jbxx">
          <div class="examine-jic">
            <div class="headline">
              <div>患者列表</div>
            </div>
            <div class="examine-jic">
              <div class="jic-value">
                <el-row :gutter="20">
                  <!--用户数据-->
                  <el-row :gutter="10" class="mb8">
                    <el-col :span="1.5">
                      <el-select
                        v-model="patientqueryParams.allhosp"
                        placeholder="请选择新增类型"
                      >
                        <el-option
                          v-for="item in taskoptions"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value"
                        >
                        </el-option>
                      </el-select>
                    </el-col>
                    <el-col :span="1.5">
                      <el-button
                        type="primary"
                        plain
                        icon="el-icon-plus"
                        size="medium"
                        :disabled="!patientqueryParams.allhosp"
                        @click="handleAddpatient"
                        >新增</el-button
                      >
                    </el-col>
                    <el-col :span="1.5">
                      <el-button
                        type="danger"
                        plain
                        icon="el-icon-delete"
                        size="medium"
                        :disabled="multiple"
                        @click="handleDelete"
                        >删除</el-button
                      >
                    </el-col>
                    <!-- <el-col :span="1.5"> </el-col> -->
                  </el-row>
                  <!-- é€‰ä¸­æ‚£è€…列表 -->
                  <SFtable
                    @details="detailhz"
                    @handleUpdate="handleUpdate"
                    :currentList="overallCase"
                    :tableLabel="tableLabelhz"
                    :serialnumber="false"
                    :searchTrue="true"
                    :multiplechoice="false"
                    :controlxz="false"
                    :typeinfo="2"
                  />
                  <pagination
                    v-show="total > 0"
                    :total="total"
                    :page.sync="topqueryParams.pageNum"
                    :limit.sync="topqueryParams.pageSize"
                    @pagination="getList"
                  />
                </el-row>
              </div>
            </div>
          </div>
        </div>
        <el-button type="primary" @click="laststep()">上一步</el-button>
        <el-button type="success" @click="submitForm('ruleForm')">{{
          quote ? "立即创建" : "确认任务配置"
        }}</el-button>
        <el-button @click="resetForm('ruleForm')">重置</el-button>
      </div>
    </div>
    <!-- æ·»åŠ æ‚£è€… -->
    <el-dialog
      title="选择患者"
      :visible.sync="dialogVisiblepatient"
      width="70%"
      :before-close="handleClosehz"
      :close-on-click-modal="false"
    >
      <div class="examine-jic">
        <div class="jic-value">
          <el-row :gutter="20">
            <!--用户数据-->
            <el-form
              :model="patientqueryParams"
              ref="queryForm"
              size="small"
              :inline="true"
              v-show="showSearch"
              label-width="98px"
            >
              <el-form-item label="患者名称:">
                <el-input
                  v-model="patientqueryParams.name"
                  @keyup.enter.native="handleQuery"
                ></el-input>
              </el-form-item>
              <el-form-item label="创建时间">
                <el-date-picker
                  v-model="dateRange"
                  style="width: 240px"
                  value-format="yyyy-MM-dd"
                  type="daterange"
                  range-separator="-"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                ></el-date-picker>
              </el-form-item>
              <el-form-item>
                <el-button
                  type="primary"
                  icon="el-icon-search"
                  size="medium"
                  @click="handleQuery"
                  >搜索</el-button
                >
                <el-button
                  icon="el-icon-refresh"
                  size="medium"
                  @click="resetQuery"
                  >重置</el-button
                >
              </el-form-item>
            </el-form>
            <!-- é€‰æ‹©æ‚£è€…列表 -->
            <SFtable
              ref="multipleTable"
              @handleUpdate="handleUpdate"
              @handleSelectionChange="handleSelectionChange"
              :currentList="patientuserList"
              :tableLabel="tableLabelhz"
              :serialnumber="false"
              :center="false"
              :typeinfo="3"
            />
          </el-row>
          <pagination
            v-show="patienttotal > 0"
            :total="patienttotal"
            :page.sync="patientqueryParams.pageNum"
            :limit.sync="patientqueryParams.pageSize"
            @pagination="handleAddpatient"
          />
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisiblepatient = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="AddDispatchpatients"
          >确定添加</el-button
        >
      </span>
    </el-dialog>
    <el-dialog title="模板预览" :visible.sync="previewtf" width="60%">
      <div class="preview-left">
        <!-- å•选 -->
        <div
          class="scriptTopic-dev"
          v-for="(item, index) in questionList"
          :key="item.aaa"
        >
          <div class="dev-text">
            {{ index + 1 }}、<span>{{ item.scriptContent }}</span>
          </div>
          <div class="dev-xx" v-if="item.valueType == 1">
            <el-radio-group v-model="item.radio">
              <el-radio
                v-for="(items, index) in item.ivrLibaScriptTargetoptionList"
                :key="items.id"
                :label="items.id"
                >{{ items.targetvalue }}
              </el-radio>
            </el-radio-group>
          </div>
          <div v-else>
            <el-input
              type="textarea"
              placeholder="未获取到信息"
              v-model.sync="item.scriptResult"
              :rows="2"
            />
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="previewGo">前往模板详情修改</el-button>
        <el-button type="primary" @click="previewFn">确认使用</el-button>
      </span>
    </el-dialog>
    <el-drawer
      title="随访内容列表"
      :visible.sync="drawermb"
      direction="rtl"
      size="50%"
    >
      <div class="headline"></div>
      <div class="examine-jic">
        <div class="jic-value">
          <el-row :gutter="20">
            <!--用户数据-->
            <el-form
              :model="topqueryParams"
              ref="queryForm"
              size="small"
              :inline="true"
              v-show="showSearch"
              label-width="98px"
            >
              <el-form-item label="随访名称">
                <el-input v-model="topqueryParams.templateName"></el-input>
              </el-form-item>
              <el-form-item label="适用科室" prop="status">
                <el-select v-model="topqueryParams.topicd" placeholder="请选择">
                  <el-option
                    v-for="item in topicoptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="随访模板分类" prop="region">
                <el-select
                  v-model="topqueryParams.assortid"
                  size="medium"
                  filterable
                  placeholder="请选择分类"
                >
                  <el-option-group
                    v-for="group in indexAssortlist"
                    :key="group.id"
                    :label="group.indexAssortName"
                  >
                    <el-option
                      v-for="item in group.ivrLibaTemplateAssortList"
                      :key="item.id"
                      :label="item.indexAssortName"
                      :value="item.id"
                    >
                    </el-option>
                  </el-option-group>
                </el-select>
              </el-form-item>
              <el-form-item>
                <el-button
                  type="primary"
                  icon="el-icon-search"
                  size="medium"
                  @click="handleQuery"
                  >搜索</el-button
                >
                <el-button
                  icon="el-icon-refresh"
                  size="medium"
                  @click="resetQuery"
                  >重置</el-button
                >
              </el-form-item>
            </el-form>
            <el-divider></el-divider>
            <!-- é€‰æ‹©æ¨¡æ¿åˆ—表 -->
            <SFtable
              @selectfn="selectfn"
              :currentList="userList"
              :tableLabel="tableLabel"
              :controlsc="false"
              :multiplechoice="false"
              :typeinfo="1"
            />
            <pagination
              v-show="total > 0"
              :total="total"
              :page.sync="topqueryParams.pageNum"
              :limit.sync="topqueryParams.pageSize"
              @pagination="Acquisitiontype"
            />
          </el-row>
        </div>
      </div>
    </el-drawer>
  </div>
</template>
<script>
import { messagelistpatient } from "@/api/patient/homepage";
import store from "@/store";
import {
  getTaskpatient,
  getlibrarylist,
  getFollowuplist,
  getQtemplatelist,
  TaskTemplatecomit,
  getTaskInfo,
  gethetaskinfo,
  delhetaskinfo,
  Editsingletask,
  getvFollowup,
  getFollowupclassify,
} from "@/api/AiCentre/index";
import { listDept } from "@/api/system/dept";
import SFtable from "@/components/SFtable"; //表格组件
export default {
  name: "serviceDetailsa",
  data() {
    const endDate = new Date();
    const startDate = new Date();
    startDate.setDate(endDate.getDate() - 7); // è®¾ç½®å¼€å§‹æ—¥æœŸä¸ºå½“前日期前7天
    return {
      title: "随访内容列表",
      currenttype: 1, //1随访2问卷3通知宣教
      id: "", //
      previewid: "", //任务模板传递id
      libName: "",
      overallCase: [], //选择患者总
      // æ—¥æœŸèŒƒå›´
      dateRange: [startDate, endDate],
      allpids: [],
      libId: null, //模板库模板id
      nhh: null, //是否依照新增
      Editprogress: 1, //编辑进度
      drawermb: false, //选择模板弹窗
      previewtf: false, //预览
      loading: false, // é®ç½©å±‚
      patientloading: false, // é®ç½©å±‚
      dialogVisiblepatient: false, //添加患者弹框
      radio: 1,
      checkboxlist: [],
      tableLabel: [],
      questionList: [],
      // æ‚£è€…表单
      tableLabelhz: [
        { label: "患者名称", width: "", prop: "name" },
        { label: "性别", width: "", prop: "sex" },
        { label: "年龄", width: "", prop: "age" },
        { label: "就诊科室", width: "", prop: "deptName" },
        { label: "入院日期", width: "", prop: "birthdate" },
        { label: "创建人(缺)", width: "", prop: "update_by" },
      ],
      tableLabelmz: [
        { label: "随访名称", width: "", prop: "templateName" },
        { label: "主要内容", width: "", prop: "note" },
        { label: "修改日期", width: "", prop: "updateTime" },
        { label: "创建人(缺)", width: "", prop: "updateBy" },
      ],
      // æœåŠ¡å½¢å¼
      preachform: [
        { label: "线下", value: 1 },
        { label: "电话", value: 2 },
        { label: "小程序", value: 3 },
        { label: "短信", value: 4 },
        { label: "微信公众", value: 5 },
        { label: "钉钉", value: 6 },
        { label: "智能机器人", value: 7 },
      ],
      // æ—¶é—´å¤„理
      daytime: [], //日期
      applydaytime: [], //计算日期
      time1: "", //上午时间段
      time2: "", //下午时间段
      time3: "", //晚上时间段
      time4: "", //晚上时间段
      topqueryParams: {
        pageNum: 1, //
        pageSize: 10,
      },
      checkList: [],
      deliverytopqueryParams: {
        pageNum: 1, //
        pageSize: 10,
      },
      patientqueryParams: {
        pageNum: 1, //
        pageSize: 10,
      },
      topicoptions: [{ children: [{ children: [] }] }],
      showSearch: true, //
      total: 0, //
      sontotal: 0, //
      patienttotal: 0, //
      // é€‰ä¸­æ•°ç»„
      ids: [],
      // éžå•个禁用
      single: true,
      // éžå¤šä¸ªç¦ç”¨
      multiple: true,
      // ç”¨æˆ·è¡¨æ ¼æ•°æ®
      userList: [], //模板列表
      patientuserList: [], //选择患者列表
      sonuserList: [], //选中患者列表
      delvariableList: [], //删除变量临时存储
      indexAssortlist: [],
      variableList: [
        {
          name: "姓名",
          value: "${name}",
          fill: "派发时自动匹配",
          default: true,
        },
        {
          name: "地址",
          value: "${dzz}",
          fill: "派发时自动匹配",
          default: true,
        },
        {
          name: "电话",
          value: "${dhh}",
          fill: "派发时自动匹配",
          default: true,
        },
      ], //变量列表
      transitionList: [
        {
          name: "姓名",
          value: "${name}",
          fill: "派发时自动匹配",
          default: true,
        },
        {
          name: "地址",
          value: "${dzz}",
          fill: "派发时自动匹配",
          default: true,
        },
        {
          name: "电话",
          value: "${dhh}",
          fill: "派发时自动匹配",
          default: true,
        },
      ],
      variableListTime: [],
      tasktopic: null, //新增类型
      SelectPatientslist: [],
      form: {
        patTaskRelevances: [],
        sendType: 1,
        templatename: "",
        templateid: null,
        libtemplateid: null,
      },
      taskoptions: [
        {
          value: "1",
          label: "出院病人",
        },
        {
          value: "2",
          label: "门诊病人",
        },
        {
          value: "3",
          label: "体检病人",
        },
      ],
      quote: false,
      serviceType:null,
    };
  },
  components: { SFtable },
  created() {
    this.id = this.$route.query.id;
    this.form.type = this.$route.query.type;
    this.serviceType = Number(this.$route.query.serviceType);
    this.form.serviceType = Number(this.$route.query.serviceType);
    this.form.nhh = this.$route.query.nhh;
    this.listDept();
    this.Acquisitiontype();
    this.Getdetails();
  },
  methods: {
    // {
    //   å§“名: { "${name}": "龙傲天" },
    //   åœ°å€: { "${dzz}": "龙宫" },
    //   ç”µè¯: { "${dhh}": "八个八" },
    // }
    // å˜é‡è½¬æ¢å¯¹è±¡è½¬æ•°ç»„
    convertFormat1ToFormat2(data) {
      let result = [];
      for (let key in data) {
        let innerKey = Object.keys(data[key])[0];
        result.push({
          name: key,
          value: innerKey,
          fill: data[key][innerKey],
        });
      }
      return result;
    },
    // æ•°ç»„转对象
    convertFormat2ToFormat1(data) {
      let result = {};
      data.forEach((item) => {
        let innerObj = {};
        innerObj[item.value] = item.fill;
        result[item.name] = innerObj;
      });
      return result;
    },
    // èŽ·å–å½“å‰ç±»åž‹
    Acquisitiontype() {
      let queryParams = {
        pageNum: this.topqueryParams.pageNum,
        pageSize: this.topqueryParams.pageSize,
        isavailable: "",
      };
      this.currenttype = this.$route.query.type;
      // å‡ºé™¢ã€é—¨è¯Šã€ä¸“病随访
      this.title = "随访内容列表";
      this.tableLabel = this.tableLabelmz;
      if (this.form.serviceType == 2 || this.form.serviceType == 3) {
        this.checkboxlist = [
          {
            value: "1",
            label: "人工",
          },
          {
            value: "3",
            label: "电话",
          },
          {
            value: "4",
            label: "短信",
          },
          {
            value: "5",
            label: "微信公众号",
          },
          {
            value: "6",
            label: "微信小程序",
          },
          {
            value: "8",
            label: "智能机器人",
          },
        ];
      } else if (this.form.serviceType == 5) {
        this.checkboxlist = [
          {
            value: "3",
            label: "电话",
          },
          {
            value: "4",
            label: "短信",
          },
          {
            value: "5",
            label: "微信公众号",
          },
          {
            value: "6",
            label: "微信小程序",
          },
          {
            value: "8",
            label: "智能机器人",
          },
        ];
      }
      getFollowuplist(queryParams).then((response) => {
        this.userList = response.rows;
        this.total = response.total;
      });
    },
    nextstep() {
      if (this.Editprogress <= 3) {
        return this.Editprogress++;
      }
    },
    // ä¿å­˜
    submitForm(formName) {
      this.form.preachform = this.checkList.join(",");
      // this.formatFn(1);
      if (!this.form.patTaskRelevances[0]) {
        this.$modal.msgError("请选择病人");
        return;
      }
      const filteredArray = this.variableList.filter(
        (item) =>
          item.name !== "姓名" && item.name !== "电话" && item.name !== "地址"
      );
      console.log(filteredArray, "存前变量");
      this.form.textParam = this.convertFormat2ToFormat1(filteredArray);
      if (this.form.taskid) {
        this.form.isoperation = 2;
      } else {
        this.form.isoperation = 1;
      }
      this.form.serviceType=this.serviceType;
      Editsingletask(this.form).then((res) => {
        if (res.code == 200) {
          if (this.form.taskid) {
            this.$modal.msgSuccess("新增成功");
          } else {
            this.$modal.msgSuccess("修改成功");
          }
          this.$router.push({
            path: "/followvisit/tasklist",
            query: { tasktopic: this.form.serviceType },
          });
        }
      });
    },
    // ----------------------表格子组件事件
    // ç¡®è®¤é€‰æ‹©æ¨¡æ¿æ”¾å…¥ä»»åŠ¡æ¨¡æ¿
    selectfn(row, type) {
      // æ¨¡æ¿æƒ…况下获取模板信息
      console.log(row, "选择模板");
      this.libName = row.templateName;
      this.libId = row.id;
      getvFollowup({ id: row.id }).then((res) => {
        if (res.code == 200) {
          this.Tasktemplate = res.data;
          const data = res.data;
          this.questionList = data.ivrLibaTemplateScriptVOList;
          this.previewtf = true;
          this.previewid = data.id;
          console.log(this.questionList, "questionList");
          this.Variablehandling(data.ivrLibaTemplateScriptVOList, 1);
        }
      });
    },
    // å¤„理问题层变量
    Variablehandling(arr, type) {
      let Variablist = [];
      this.variableList = []; //变量列表
      if (type == 1) {
        console.log(arr);
        // å¾ªçŽ¯é—®é¢˜
        arr.forEach((res) => {
          console.log(JSON.parse(res.otherdata), "ss");
          // å¾ªçޝ选项
          JSON.parse(res.otherdata).forEach((item) => {
            if (item.default != 1) {
              Variablist.push({
                value: item.variate,
                fill: "",
                name: item.variatename,
              });
            }
          });
        });
        const Aarr = Variablist.filter(
          (obj, index, self) =>
            index ===
            self.findIndex((t) => t.name === obj.name && t.value === obj.value)
        );
        this.variableList = this.transitionList.concat(Aarr);
        console.log(this.variableList, "variableList");
        // this.form.textParam = this.convertFormat2ToFormat1(this.variableList);
      }
    },
    // å­ä»»åŠ¡äºŒçº§å¼¹æ¡†
    handleAddpatient(row) {
      console.log(this.overallCase, "ssaaa");
      this.allpids = [];
      this.overallCase.forEach((item) => {
        this.allpids.push(item.patid);
      });
      if (this.patientqueryParams.allhosp == 1) {
        this.tableLabelhz = [
          { label: "患者名称", width: "", prop: "name" },
          { label: "性别", width: "", prop: "sex" },
          { label: "年龄", width: "", prop: "age" },
          { label: "主任医师", width: "", prop: "drname" },
          { label: "就诊科室", width: "", prop: "deptName" },
          { label: "入院日期", width: "", prop: "birthdate" },
          { label: "创建人", width: "", prop: "createBy" },
        ];
      } else if (this.patientqueryParams.allhosp == 2) {
        this.tableLabelhz = [
          { label: "患者名称", width: "", prop: "name" },
          { label: "性别", width: "", prop: "sex" },
          { label: "年龄", width: "", prop: "age" },
          { label: "诊断", width: "", prop: "diagname" },
          { label: "就诊科室", width: "", prop: "deptName" },
          { label: "入院日期", width: "", prop: "birthdate" },
          { label: "创建人", width: "", prop: "createBy" },
        ];
      }
      if (this.allpids[0]) {
        this.patientqueryParams.pids = this.allpids;
        console.log(this.patientqueryParams.pids);
      } else {
        this.patientqueryParams.pids = null;
      }
      getTaskpatient(
        this.addDateRange(this.patientqueryParams, this.dateRange)
      ).then((response) => {
        this.patientuserList = response.rows;
        this.patienttotal = response.total;
        this.loading = false;
        this.Restorecheck();
      });
      this.dialogVisiblepatient = true;
    },
    handleUpdate() {},
    handleDelete() {},
    handleExport() {},
    // é€‰ä¸­æ‚£è€…表
    handlePitchionChange() {},
    // é€‰æ‹©æ‚£è€…表数据
    handleSelectionChange(selection) {
      console.log("多选患者");
      this.SelectPatientslist = selection;
      this.multiple = !selection.length;
      // èµ‹å€¼ç»™æ•´ä½“选中数组
      this.SelectPatientslist.forEach((item) => {
        const isExist = this.overallCase.find((obj) => obj.name == item.name);
        if (!isExist) {
          console.log(this.patientqueryParams.allhosp, "allhosp");
          item.isoperation = 1;
          item.patid = item.id;
          item.hospType = this.patientqueryParams.allhosp;
          this.overallCase.push(item);
          this.form.patTaskRelevances.push(item);
          console.log(this.overallCase, "this.overallCase");
        }
      });
    },
    // åˆ‡æ¢é¡µåŽæ¢å¤é€‰ä¸­
    Restorecheck() {
      console.log(this.overallCase, "this.overallCase");
      const allid = this.overallCase.map((item) => item.id);
      const overlap = this.patientuserList.filter((value) => {
        return allid.includes(value.id);
      });
      console.log(overlap, "overlap");
      // ä¿æŒids和当前页面的同步性
      this.SelectPatientslist = overlap;
      console.log(this.SelectPatientslist, "进入分页SelectPatientslist");
      this.toggleSelection(overlap);
    },
    // æŒ‚载选择状态
    toggleSelection(rows) {
      if (rows) {
        this.decision = true;
        this.$nextTick(() => {
          rows.forEach((row) => {
            this.$refs.multipleTable.toggleRowSelection(row, true);
          });
          this.decision = false;
        });
        console.log(123);
      } else {
        this.$refs.multipleTable.clearSelection();
      }
    },
    // åˆ é™¤é€‰ä¸­æ‚£è€…
    detailhz(row, info) {
      this.$modal
        .confirm('是否确认删除患者"' + row.name + '"的服务项?')
        .then(() => {
          let indexa = this.overallCase.indexOf(row);
          let indexb = this.form.patTaskRelevances.indexOf(row);
          this.overallCase.splice(indexa, 1);
          this.form.patTaskRelevances[indexb].isoperation = 3;
          this.$modal.msgSuccess("删除成功");
        });
    },
    getList() {},
    handleQuery() {
      this.handleAddpatient();
    },
    resetQuery() {
      this.dateRange = [];
      // æŸ¥è¯¢å‚æ•°
      this.queryParams = {
        pageNum: 1,
        pageSize: 10,
        userName: undefined,
        phonenumber: undefined,
        status: undefined,
        deptId: undefined,
      };
    },
    handleClosehz() {
      this.dialogVisiblepatient = false;
    },
    // ä¸Šä¸€æ­¥
    laststep() {
      this.Editprogress--;
    },
    // æäº¤è¡¨å•
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
    // é¢„览模板
    PreviewTemplate() {},
    Acknowledgereference() {
      this.quote = true;
    },
    // èŽ·å–è¯¦æƒ…
    Getdetails() {
      if (this.id) {
        getTaskInfo({ taskid: this.id }).then((res) => {
          let filteredArray = "";
          console.log(2233);
          if (res.code == 200) {
            this.form = res.data;
      this.form.serviceType=this.serviceType;
            this.overallCase = this.form.patTaskRelevances.concat();
            this.checkList = this.form.preachform.split(",");
            console.log(this.form.showDate, "this.form");
            this.daytime = this.form.showDate.split(",");
            this.changeTimeday(this.daytime);
            if (this.form.showTimeMorn) {
              if (this.form.sendType == 3) {
                this.time4 = this.form.showTimeMorn;
              } else {
                this.time1 = this.form.showTimeMorn.split(",");
              }
            }
            if (this.form.showTimeNoon)
              this.time2 = this.form.showTimeNoon.split(",");
            if (this.form.showTimeNight)
              this.time3 = this.form.showTimeNight.split(",");
            console.log(1122);
            filteredArray = this.convertFormat1ToFormat2(this.form.textParam);
            this.variableList = this.transitionList.concat(filteredArray);
          } else {
            this.$modal.msgError(res.code);
          }
        });
      }
      getFollowupclassify({}).then((res) => {
        this.indexAssortlist = res.rows;
      });
    },
    // èŽ·å–ç§‘å®¤åˆ—è¡¨
    listDept() {
      listDept().then((res) => {
        this.topicoptions = this.handleTree(res.data, "deptId");
        console.log(this.topicoptions, "topicoptions");
      });
    },
    // æ–°å¢žæ´¾é€æ‚£è€…
    AddDispatchpatients() {
      // this.SelectPatientslist.forEach((item) => {
      //   item.isoperation = 1;
      // });
      // this.form.patTaskRelevances.push(...this.SelectPatientslist);
      // this.overallCase.push(...this.SelectPatientslist);
      this.dialogVisiblepatient = false;
    },
    variableDelete(index, row) {
      this.variableList.splice(index, 1);
      row.isoperation = 3;
      this.delvariableList.push(row);
      console.log(index, row);
    },
    // æ—¶é—´----------
    changeTime(row) {
      console.log(row, "时间");
      this.processingTime();
    },
    Totaldate(row) {
      console.log(row, "时间");
      this.form.sendTimeslot = [{ begantime: row, endtime: row, xh: 1 }];
      this.form.showTimeMorn = row;
      console.log(this.form.sendTimeslot, "时间");
    },
    changeTimeday(row) {
      console.log(row, "日期");
      const startDate = new Date(row[0]);
      const endDate = new Date(row[1]);
      this.applydaytime = this.getDates(startDate, endDate);
      if (!top) {
        this.processingTime();
      }
    },
    getDates(startDate, endDate) {
      const dates = [];
      let currentDate = new Date(startDate);
      while (currentDate <= endDate) {
        dates.push(this.$moment(currentDate).format("YYYY-MM-DD"));
        currentDate.setDate(currentDate.getDate() + 1);
      }
      return dates;
    },
    // æ—¶é—´æœ€ç»ˆå¤„理方法
    processingTime() {
      const combinedData = [];
      let serialnumber = 1;
      if (this.time3[0]) {
        serialnumber = 3;
      } else if (this.time2[0]) {
        serialnumber = 2;
      } else if (this.time1[0]) {
        serialnumber = 1;
      } else {
        return;
      }
      for (let i = 0; i < this.applydaytime.length; i++) {
        combinedData.push({
          begantime: `${this.applydaytime[i]} ${this.time1[0]}`,
          endtime: `${this.applydaytime[i]} ${this.time1[1]}`,
          xh: serialnumber * i + 1,
        });
        if (serialnumber >= 2) {
          combinedData.push({
            begantime: `${this.applydaytime[i]} ${this.time2[0]}`,
            endtime: `${this.applydaytime[i]} ${this.time2[1]}`,
            xh: serialnumber * i + 2,
          });
        }
        if (serialnumber >= 3) {
          combinedData.push({
            begantime: `${this.applydaytime[i]} ${this.time3[0]}`,
            endtime: `${this.applydaytime[i]} ${this.time3[1]}`,
            xh: serialnumber * i + 3,
          });
        }
      }
      this.form.sendTimeslot = combinedData;
      // å±•示数据临时存储日期、早、中、晚
      console.log(this.daytime);
      this.form.showDate = this.daytime.join(",");
      if (this.time1) this.form.showTimeMorn = this.time1.join(",");
      if (this.time2) this.form.showTimeNoon = this.time2.join(",");
      if (this.time3) this.form.showTimeNight = this.time3.join(",");
      console.log(combinedData, "combinedData");
    },
    // æŸ¥çœ‹æ¨¡æ¿
    previewGo() {
      this.$router.push({
        path: "/knowledge/tpuconfigurat/",
        query: { id: this.previewid, task: true, data: this.form },
      });
    },
    previewFn() {
      let id = this.Tasktemplate.id;
      this.Tasktemplate.id = null;
      this.Tasktemplate.ivrLibaTemplateScriptVOList.forEach((item) => {
        item.ivrTaskScriptTargetoptionList = item.ivrLibaScriptTargetoptionList;
      });
      console.log(this.Tasktemplate.ivrLibaTemplateScriptVOList);
      this.Tasktemplate.ivrTaskTemplateScriptVOList =
        this.Tasktemplate.ivrLibaTemplateScriptVOList;
      this.Tasktemplate.ivrLibaTemplateTagList = null;
      this.Tasktemplate.tempDetpRelevances = null;
      this.Tasktemplate.libtemplateid = id;
      this.Tasktemplate.isoperation = 1;
      this.Tasktemplate.libtemplatename = this.Tasktemplate.templatename;
      console.log(this.libName, this.libId);
      TaskTemplatecomit(this.Tasktemplate).then((response) => {
        console.log(response);
        this.previewtf = false;
        this.form.templateid = response.data;
        this.form.libtemplateid = this.libId;
        this.form.templatename = this.libName;
        console.log(this.form.templatename, "ss");
        this.$modal.msgSuccess("选择模板成功", this.form.templatename);
      });
    },
    // å¤„理服务形式
    formatFn(type) {
      console.log(this.preachform, "preachform");
      console.log(this.checkList, "checklist");
      let list = [];
      let formlist = [];
      if (type == 1) {
        this.preachform.forEach((item) => {
          this.checkList.forEach((obj) => {
            if (item.label == obj) {
              list.push(item.value);
            }
          });
        });
        this.form.preachform = list.join(",");
      } else {
        console.log(this.form.preachform, "this.form.preachform");
        formlist = this.form.preachform.split(",");
        console.log(11);
        this.preachform.forEach((item) => {
          formlist.forEach((obj) => {
            if (item.value == obj) {
              list.push(item.label);
            }
          });
        });
        this.checkList = list;
      }
    },
  },
};
</script>
<style lang="scss" scoped>
.Questionnairemanagement {
}
.leftvlue-jbxx {
  margin-top: 10px;
}
.sidecolumn {
  width: 100%;
  // min-height: 12vh;
  margin: 20px;
  margin-bottom: 0;
  padding: 30px;
  background: #edf1f7;
  border: 1px solid #dcdfe6;
  -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
    0 0 6px 0 rgba(0, 0, 0, 0.04);
}
.leftvlue {
  //   display: flex;
  //   flex: 1;
  width: 100%;
  margin-top: 20px;
  //   margin: 20px;
  padding: 30px;
  background: #ffff;
  border: 1px solid #dcdfe6;
  -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
    0 0 6px 0 rgba(0, 0, 0, 0.04);
}
.examine-jic {
  margin: 20px;
  .headline {
    font-size: 24px;
    border-left: 5px solid #41a1be;
    padding-left: 5px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    .Add-details {
      font-size: 18px;
      color: #02a7f0;
      cursor: pointer;
    }
  }
  .jic-value {
    font-size: 20px;
    border-top: 1px solid #a7abac;
    padding: 10px;
    margin-bottom: 10px;
    .details-jic {
      padding: 10px 15px;
      border: 1px solid #dcdfe6;
      -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
        0 0 6px 0 rgba(0, 0, 0, 0.04);
      .details-title {
        display: flex;
        justify-content: space-between;
        margin-bottom: 10px;
        div:nth-child(2) {
          color: #02a7f0;
          cursor: pointer;
        }
      }
      .details-renw {
        background: #e4ebfc;
        padding: 15px 5px;
        border-radius: 5px;
        margin-bottom: 20px;
      }
    }
  }
}
// .leftvlue-jbxx {
//   margin-bottom: 50px;
//   font-size: 20px;
//   span {
//     position: absolute;
//     right: 80px;
//   }
//   .demo-cascader {
//     margin-right: 20px;
//   }
//   .PreviewTemplate {
//     color: #02a7f0;
//     cursor: pointer;
//     font-size: 20px;
//     margin: 0 20px;
//   }
// }
.preview-left {
  margin: 20px;
  //   margin: 20px;
  padding: 30px;
  background: #ffff;
  border: 1px solid #dcdfe6;
  -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
    0 0 6px 0 rgba(0, 0, 0, 0.04);
  .scriptTopic-dev {
    margin-bottom: 25px;
    font-size: 20px !important;
    .dev-text {
      margin-bottom: 10px;
    }
  }
}
.jic-value {
  font-size: 20px;
  border-top: 1px solid #a7abac;
  padding: 10px;
  margin-bottom: 10px;
  .details-jic {
    padding: 10px 15px;
    border: 1px solid #dcdfe6;
    -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
      0 0 6px 0 rgba(0, 0, 0, 0.04);
    .details-title {
      display: flex;
      justify-content: space-between;
      margin-bottom: 10px;
      div:nth-child(2) {
        color: #02a7f0;
        cursor: pointer;
      }
    }
    .details-renw {
      background: #e4ebfc;
      padding: 15px 5px;
      border-radius: 5px;
      margin-bottom: 20px;
    }
  }
}
::v-deep .addtopic-input {
  input {
    background: #02a7f0;
    color: #edf1f7;
    width: 150px;
  }
}
::v-deep.el-step.is-vertical .el-step__title {
  font-size: 25px;
}
::v-deep.el-row {
  margin-bottom: 10px;
}
// ::v-deep.el-input--medium {
//   font-size: 24px !important;
// }
::v-deep.ruleFormaa.el-select {
  display: inline-block;
  position: relative;
  width: 700px;
}
.el-select__tags {
  font-size: 20px;
  max-width: 888px !important;
}
::v-deep.el-radio__inner {
  width: 22px;
  height: 22px;
}
// ::v-deep.scriptTopic-dev.el-radio__label {
//   font-size: 24px;
// }
::v-deep.el-radio-group {
  span {
    font-size: 24px;
  }
}
::v-deep.el-input.is-disabled .el-input__inner {
  background-color: #f5f7fa;
  border-color: #dfe4ed;
  color: rgb(253, 66, 66);
  cursor: not-allowed;
}
::v-deep.el-checkbox-group {
  span {
    font-size: 24px;
  }
}
</style>
src/views/patient/propaganda/particty.vue
@@ -30,50 +30,78 @@
              <div>基础信息</div>
            </div>
            <div class="jic-value">
              <el-form ref="form" :model="form" label-width="105px">
              <el-form
                ref="form"
                :model="form"
                :rules="rules"
                label-width="125px"
              >
                <el-row :gutter="20">
                  <el-col :span="12"
                    ><el-form-item label="任务名称">
                    ><el-form-item label="任务名称" prop="taskName">
                      <el-input
                        style="width: 220px"
                        v-model="form.taskName"
                        placeholder="请输入任务名称"
                      /> </el-form-item
                  ></el-col>
                  <el-col :span="8"
                    ><el-form-item label="模板名称">
                      <el-input
                        style="width: 220px"
                        :disabled="true"
                        v-model="form.templatename"
                        placeholder="点击右侧选择"
                      /> </el-form-item
                  <el-col :span="12"
                    ><el-form-item label="任务类型">
                      <el-select
                        v-model="serviceType"
                        placeholder="请选择新增类型"
                      >
                        <el-option
                          v-for="item in tasktypes"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value"
                        >
                        </el-option>
                      </el-select> </el-form-item
                  ></el-col>
                  <el-col :span="4">
                    <el-button
                      type="primary"
                      icon="el-icon-edit"
                      @click="drawermb = true"
                      circle
                    ></el-button>
                  </el-col>
                </el-row>
                <el-form-item label="任务描述">
                <el-form-item label="任务描述" prop="taskDesc">
                  <el-input
                    type="textarea"
                    v-model="form.taskDesc"
                    placeholder="请输入任务描述"
                  />
                </el-form-item>
                <el-form-item label="发送设置:">
                  <el-radio-group v-model="form.sendType">
                    <el-radio :label="1">时间段发送</el-radio>
                    <el-radio :label="3">时间点发送</el-radio>
                    <el-radio :label="2">即刻发送</el-radio>
                <el-form-item label="服务形式">
                  <el-checkbox-group v-model="checkList">
                    <el-checkbox
                      v-for="(item, index) in checkboxlist"
                      :key="index"
                      :label="item.value"
                    >
                      {{ item.label }}</el-checkbox
                    >
                  </el-checkbox-group>
                </el-form-item>
                <el-form-item label="是否长期" prop="longTask">
                  <el-radio-group v-model="form.longTask">
                    <el-radio :label="0">普通任务</el-radio>
                    <el-radio :label="1">长期任务</el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label="发送日期:" v-if="form.sendType == 1">
                <el-form-item
                  label="执行设置"
                  prop="sendType"
                  v-if="!form.longTask"
                >
                  <el-radio-group v-model="form.sendType">
                    <el-radio :label="1">时间段执行</el-radio>
                    <el-radio :label="3">时间点执行</el-radio>
                    <el-radio :label="2">即刻执行</el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item
                  label="执行日期"
                  v-if="form.sendType == 1 && !form.longTask"
                  prop="daytime"
                >
                  <el-date-picker
                    v-model="daytime"
                    @change="changeTimeday"
@@ -86,7 +114,11 @@
                  </el-date-picker>
                </el-form-item>
                <el-form-item label="发送时间点:" v-if="form.sendType == 3">
                <el-form-item
                  label="执行时间点"
                  v-if="form.sendType == 3 && !form.longTask"
                  prop="daytime"
                >
                  <div style="display: flex">
                    <div style="margin-right: 10px">
                      <el-date-picker
@@ -101,12 +133,14 @@
                  </div>
                </el-form-item>
                <el-form-item label="发送时间段:" v-if="form.sendType == 1">
                <el-form-item
                  label="执行时间段"
                  v-if="form.sendType == 1 && !form.longTask"
                  prop="daytime"
                >
                  <div style="display: flex">
                    <div style="margin-right: 10px">
                      <span style="font-size: 18px; margin-right: 10px"
                        >时间段一</span
                      >
                      <span style="font-size: 18px; margin-right: 10px">①</span>
                      <el-time-picker
                        is-range
                        arrow-control
@@ -121,9 +155,7 @@
                      </el-time-picker>
                    </div>
                    <div style="margin-right: 10px">
                      <span style="font-size: 18px; margin-right: 10px"
                        >时间段二</span
                      >
                      <span style="font-size: 18px; margin-right: 10px">②</span>
                      <el-time-picker
                        is-range
                        arrow-control
@@ -138,9 +170,7 @@
                      </el-time-picker>
                    </div>
                    <div style="margin-right: 10px">
                      <span style="font-size: 18px; margin-right: 10px"
                        >时间段三</span
                      >
                      <span style="font-size: 18px; margin-right: 10px">③</span>
                      <el-time-picker
                        is-range
                        arrow-control
@@ -156,26 +186,122 @@
                    </div>
                  </div>
                </el-form-item>
                <el-form-item label="服务形式">
                  <el-checkbox-group v-model="checkList">
                    <el-checkbox
                      v-for="(item, index) in checkboxlist"
                      :key="index"
                      :label="item.value"
                <el-row>
                  <el-col :span="20"
                    ><el-form-item label="适用科室" prop="region">
                      <el-select
                        v-model="form.deptcode"
                        style="width: 400px"
                        size="medium"
                        filterable
                        placeholder="请选择科室"
                      >
                        <el-option
                          class="ruleFormaa"
                          v-for="item in belongDepts"
                          :key="item.deptCode"
                          :label="item.deptName"
                          :value="item.deptCode"
                        >
                        </el-option>
                      </el-select> </el-form-item
                  ></el-col>
                </el-row>
                <el-row>
                  <el-col :span="20"
                    ><el-form-item label="适用病区" prop="region">
                      <!-- <el-cascader
                      style="width: 400px"
                      v-model="form.leavehospitaldistrictcode"
                      :options="topicoptions"
                      :props="propstask"
                      :show-all-levels="false"
                      clearable
                    >
                      {{ item.label }}</el-checkbox
                    >
                  </el-checkbox-group>
                </el-form-item>
                      <template slot-scope="{ node, data }">
                        <span>{{ data.deptName }}</span>
                        <span v-if="!node.isLeaf">
                          ({{ data.children.length }})
                        </span>
                      </template>
                    </el-cascader> -->
                      <el-select
                        v-model="form.leavehospitaldistrictcode"
                        style="width: 400px"
                        size="medium"
                        filterable
                        placeholder="请选择病区"
                      >
                        <el-option
                          class="ruleFormaa"
                          v-for="item in belongWards"
                          :key="item.districtCode"
                          :label="item.districtName"
                          :value="item.districtCode"
                        >
                        </el-option>
                      </el-select> </el-form-item
                  ></el-col>
                </el-row>
                <el-row>
                  <el-col :span="12"
                    ><el-form-item label="开场白" prop="kcb">
                      <el-input
                        type="textarea"
                        :rows="3"
                        v-model="form.kcb"
                        placeholder="请输入开场白"
                      /> </el-form-item
                  ></el-col>
                  <el-col :span="12"
                    ><el-form-item label="结束语" prop="jsy">
                      <el-input
                        type="textarea"
                        :rows="3"
                        v-model="form.jsy"
                        placeholder="请输入结束语"
                      /> </el-form-item
                  ></el-col>
                </el-row>
              </el-form>
            </div>
          </div>
          <div class="examine-jic">
            <div class="headline">
              <div>变量匹配量参</div>
              <div>任务使用模板</div>
              <div style="margin-left: 20px">
                <el-form ref="forms">
                  <el-form-item label="">
                    <el-input
                      style="width: 300px"
                      :disabled="true"
                      v-model="form.templatename"
                      placeholder="请点击右侧选择"
                    />
                    <el-button
                      style="margin-left: 10px"
                      type="primary"
                      icon="el-icon-edit"
                      @click="drawermb = true"
                      circle
                    ></el-button>
                    <el-button
                      v-if="form.templatename"
                      type="success"
                      icon="el-icon-search"
                      @click="previewfnmb"
                      circle
                    ></el-button>
                  </el-form-item>
                </el-form>
              </div>
            </div>
            <div class="examine-jic">
              <div class="jic-value">
                <div style="margin-bottom: 10px">模板中使用的变量:</div>
                <el-row :gutter="20">
                  <el-table :data="variableList" style="width: 100%">
                    <el-table-column
@@ -221,10 +347,9 @@
        }}</el-button>
        <el-button @click="resetForm('ruleForm')">重置</el-button>
      </div>
      <!-- ä»»åŠ¡è¯¦æƒ… -->
      <div v-if="Editprogress == 2">
        <el-alert title="在本阶段选择随访病人" type="success" effect="dark">
        <el-alert title="在本阶段选择宣教病人" type="success" effect="dark">
        </el-alert>
        <div class="leftvlue-jbxx">
          <div class="examine-jic">
@@ -234,8 +359,6 @@
            <div class="examine-jic">
              <div class="jic-value">
                <el-row :gutter="20">
                  <!--用户数据-->
                  <el-row :gutter="10" class="mb8">
                    <el-col :span="1.5">
                      <el-select
@@ -251,6 +374,7 @@
                        </el-option>
                      </el-select>
                    </el-col>
                    <el-col :span="1.5">
                      <el-button
                        type="primary"
@@ -258,12 +382,12 @@
                        icon="el-icon-plus"
                        size="medium"
                        :disabled="!patientqueryParams.allhosp"
                        @click="handleAddpatient"
                        @click="handleQuery"
                        >新增</el-button
                      >
                    </el-col>
                    <el-col :span="1.5">
                    <!-- <el-col :span="1.5">
                      <el-button
                        type="danger"
                        plain
@@ -273,7 +397,7 @@
                        @click="handleDelete"
                        >删除</el-button
                      >
                    </el-col>
                    </el-col> -->
                    <!-- <el-col :span="1.5"> </el-col> -->
                  </el-row>
@@ -282,7 +406,7 @@
                    @details="detailhz"
                    @handleUpdate="handleUpdate"
                    :currentList="overallCase"
                    :tableLabel="tableLabelhz"
                    :tableLabel="tableLabelhzwb"
                    :serialnumber="false"
                    :searchTrue="true"
                    :multiplechoice="false"
@@ -328,23 +452,24 @@
              v-show="showSearch"
              label-width="98px"
            >
              <el-form-item label="患者名称:">
              <el-form-item label="患者:">
                <el-input
                  v-model="patientqueryParams.name"
                  @keyup.enter.native="handleQuery"
                ></el-input>
              </el-form-item>
              <el-form-item label="创建时间">
                <el-date-picker
                  v-model="dateRange"
                  style="width: 240px"
                  value-format="yyyy-MM-dd"
                  type="daterange"
                  range-separator="-"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                ></el-date-picker>
              </el-form-item>
              <el-select
                v-model="patientqueryParams.searchscope"
                placeholder="请选择患者范围"
              >
                <el-option
                  v-for="item in source"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
              <el-form-item>
                <el-button
@@ -358,7 +483,7 @@
                  icon="el-icon-refresh"
                  size="medium"
                  @click="resetQuery"
                  >重置</el-button
                  >取消创建</el-button
                >
              </el-form-item>
            </el-form>
@@ -390,41 +515,270 @@
        >
      </span>
    </el-dialog>
    <el-dialog title="模板预览" :visible.sync="previewtf" width="60%">
      <div class="preview-left">
        <!-- å•选 -->
        <div
          class="scriptTopic-dev"
          v-for="(item, index) in questionList"
          :key="item.aaa"
        >
          <div class="dev-text">
            {{ index + 1 }}、<span>{{ item.scriptContent }}</span>
          </div>
    <!-- æ¨¡æ¿é¢„览 -->
    <el-dialog title="模板预览" :visible.sync="previewtf" width="70%">
      <el-tabs type="border-card">
        <el-tab-pane label="模板基础数据"
          ><div class="preview-left">
            <el-form :model="objyl" label-width="100px" class="demo-objyl">
              <el-row :gutter="10">
                <el-col :span="14">
                  <el-form-item label="随访分类" prop="assortid">
                    <el-select
                      v-model="objyl.assortid"
                      size="medium"
                      filterable
                      placeholder="请选择分类"
                    >
                      <el-option-group
                        v-for="group in optionsclass"
                        :key="group.id"
                        :label="group.indexAssortName"
                      >
                        <el-option
                          v-for="item in group.ivrLibaTemplateAssortList"
                          :key="item.id"
                          :label="item.indexAssortName"
                          :value="item.id"
                        >
                        </el-option>
                      </el-option-group>
                    </el-select>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="14">
                  <el-form-item label="可用状态" prop="isenable">
                    <el-radio-group v-model="objyl.usestate">
                      <el-radio
                        v-for="(item, index) in usable"
                        :label="item.value"
                        >{{ item.label }}</el-radio
                      >
                    </el-radio-group>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="版本号" prop="name">
                    <el-input
                      v-model="objyl.version"
                      placeholder="默认1.0"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-form-item label="随访标题" prop="templateName">
                <div style="width: 400px">
                  <el-input v-model="objyl.templateName"></el-input>
                </div>
              </el-form-item>
              <el-form-item label="随访方式" prop="suitway">
                <el-select
                  style="width: 400px"
                  v-model="objyl.suitway"
                  size="medium"
                  multiple
                  filterable
                  placeholder="请选择分类"
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in mode"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
              <el-row :gutter="20" v-if="form.longTask">
                <el-col :span="14">
                  <el-form-item label="长期任务" prop="longTemp">
                    <el-radio-group v-model="objyl.longTemp">
                      <el-radio
                        v-for="(item, index) in longtype"
                        :label="item.value"
                        >{{ item.label }}</el-radio
                      >
                    </el-radio-group>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="任务周期" prop="name">
                    <el-input
                      v-model="objyl.sendDay"
                      placeholder="默认5天后"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="20"
                  ><el-form-item label="适用科室" prop="region">
                    <el-select
                      style="width: 400px"
                      v-model="tempDetpRelevanceslist"
                      size="medium"
                      multiple
                      filterable
                      placeholder="请选择科室"
                    >
                      <el-option
                        class="ruleFormaa"
                        v-for="item in belongDepts"
                        :key="item.deptCode"
                        :label="item.deptName"
                        :value="item.deptCode"
                      >
                      </el-option>
                    </el-select> </el-form-item
                ></el-col>
              </el-row>
              <el-row>
                <el-col :span="20"
                  ><el-form-item label="适用病区" prop="region">
                    <el-select
                      v-model="tempbelongWards"
                      style="width: 400px"
                      size="medium"
                      multiple
                      filterable
                      placeholder="请选择科室"
                    >
                      <el-option
                        class="ruleFormaa"
                        v-for="item in belongWards"
                        :key="item.districtCode"
                        :label="item.districtName"
                        :value="item.districtCode"
                      >
                      </el-option>
                    </el-select> </el-form-item
                ></el-col>
              </el-row>
          <div class="dev-xx" v-if="item.valueType == 1">
            <el-radio-group v-model="item.radio">
              <el-radio
                v-for="(items, index) in item.ivrLibaScriptTargetoptionList"
                :key="items.id"
                :label="items.id"
                >{{ items.targetvalue }}
              </el-radio>
            </el-radio-group>
          </div>
          <div v-else>
            <el-input
              type="textarea"
              placeholder="未获取到信息"
              v-model.sync="item.scriptResult"
              :rows="2"
            />
          </div>
        </div>
      </div>
              <div class="xinz-infs">
                <el-form-item>
                  <template #label>
                    é€‚用疾病
                    <el-tooltip
                      class="item"
                      effect="light"
                      content="选择好适用疾病后,可以方便您通过疾病诊断查找到对应的病人!"
                      placement="top-start"
                    >
                      <i class="el-icon-warning-outline"></i>
                    </el-tooltip>
                  </template>
                  <el-tag
                    v-for="tag in illnesslist"
                    :key="tag.icdid"
                    type="warning"
                    :disable-transitions="false"
                  >
                    {{ tag.icdname }}
                  </el-tag>
                  <!-- <el-tag v-if="hasMore" type="info">+{{ remaining }} more</el-tag> -->
                </el-form-item>
              </div>
              <el-form-item label="随访描述" prop="description">
                <el-input
                  type="textarea"
                  :rows="2"
                  placeholder="请输入内容"
                  v-model="objyl.description"
                >
                </el-input
              ></el-form-item>
              <el-form-item label="随访结束语" prop="conclusion">
                <el-input
                  type="textarea"
                  :rows="2"
                  placeholder="请输入内容"
                  v-model="objyl.conclusion"
                >
                </el-input
              ></el-form-item>
            </el-form></div
        ></el-tab-pane>
        <el-tab-pane label="问题展示"
          ><div class="preview-left">
            <div v-for="item in questionList">
              <!-- å•选 -->
              <div
                class="scriptTopic-dev"
                :key="item.sort"
                v-if="item.scriptType == 1"
              >
                <div class="dev-text">
                  {{ item.sort }}、[单选]<span>{{ item.scriptContent }}</span>
                </div>
                <div class="dev-xx">
                  <el-radio-group v-model="item.remark">
                    <el-radio
                      v-for="(
                        items, index
                      ) in item.ivrLibaScriptTargetoptionList"
                      :key="index"
                      :label="index"
                      >{{ items.targetvalue }}</el-radio
                    >
                  </el-radio-group>
                </div>
              </div>
              <!-- å¤šé€‰ -->
              <div
                class="scriptTopic-dev"
                :key="item.sort"
                v-if="item.scriptType == 2"
              >
                <div class="dev-text">
                  {{ item.sort }}、[多选]<span>{{ item.scriptContent }}</span>
                </div>
                <div class="dev-xx">
                  <el-checkbox-group v-model="qremark">
                    <el-checkbox
                      v-for="(
                        items, index
                      ) in item.ivrLibaScriptTargetoptionList"
                      :key="index"
                      :label="index"
                    >
                      {{ items.targetvalue }}
                    </el-checkbox>
                  </el-checkbox-group>
                </div>
              </div>
              <!-- å¡«ç©º -->
              <div
                class="scriptTopic-dev"
                :key="item.sort"
                v-if="item.scriptType == 4"
              >
                <div class="dev-text">
                  {{ item.sort }}、[问答]<span>{{ item.scriptContent }}</span>
                </div>
                <div class="dev-xx">
                  <el-input
                    placeholder="请输入答案"
                    v-model="item.radioas"
                    clearable
                  >
                  </el-input>
                </div>
              </div>
            </div></div
        ></el-tab-pane>
      </el-tabs>
      <span slot="footer" class="dialog-footer">
        <el-button @click="previewGo">前往模板详情修改</el-button>
        <el-button type="primary" @click="previewFn">确认使用</el-button>
        <!-- <el-button @click="previewGo">保存模板详情修改</el-button> -->
        <el-button type="primary" @click="Departmenttreatment"
          >保存使用</el-button
        >
      </span>
    </el-dialog>
    <el-drawer
@@ -450,46 +804,23 @@
              <el-form-item label="随访名称">
                <el-input v-model="topqueryParams.templateName"></el-input>
              </el-form-item>
              <el-form-item label="适用科室" prop="status">
                <el-select v-model="topqueryParams.topicd" placeholder="请选择">
              <!-- <el-form-item label="适用形式" prop="status">
                <el-select v-model="topqueryParams.topica" placeholder="请选择">
                  <el-option
                    v-for="item in topicoptions"
                    v-for="item in taskoptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="随访模板分类" prop="region">
                <el-select
                  v-model="topqueryParams.assortid"
                  size="medium"
                  filterable
                  placeholder="请选择分类"
                >
                  <el-option-group
                    v-for="group in indexAssortlist"
                    :key="group.id"
                    :label="group.indexAssortName"
                  >
                    <el-option
                      v-for="item in group.ivrLibaTemplateAssortList"
                      :key="item.id"
                      :label="item.indexAssortName"
                      :value="item.id"
                    >
                    </el-option>
                  </el-option-group>
                </el-select>
              </el-form-item>
              </el-form-item> -->
              <el-form-item>
                <el-button
                  type="primary"
                  icon="el-icon-search"
                  size="medium"
                  @click="handleQuery"
                  @click="handleQuerymb"
                  >搜索</el-button
                >
                <el-button
@@ -506,6 +837,7 @@
              @selectfn="selectfn"
              :currentList="userList"
              :tableLabel="tableLabel"
              :serialnumber="false"
              :controlsc="false"
              :multiplechoice="false"
              :typeinfo="1"
@@ -531,37 +863,37 @@
  getTaskpatient,
  getlibrarylist,
  getFollowuplist,
  getQtemplatelist,
  TaskTemplatecomit,
  getTaskInfo,
  gethetaskinfo,
  delhetaskinfo,
  Editsingletask,
  getvFollowup,
  Taskparticty,
  deleteTaskparticty,
  getTaskInfo,
  getTaskparticty,
  depthospgetson,
  getillness,
  Editsingletask,
  getFollowupclassify,
  depthospgetsonlist,
} from "@/api/AiCentre/index";
import { listDept } from "@/api/system/dept";
import SFtable from "@/components/SFtable"; //表格组件
export default {
  name: "serviceDetailsa",
  name: "ServiceDetails",
  data() {
    const endDate = new Date();
    const startDate = new Date();
    startDate.setDate(endDate.getDate() - 7); // è®¾ç½®å¼€å§‹æ—¥æœŸä¸ºå½“前日期前7天
    return {
      title: "随访内容列表",
      currenttype: 1, //1随访2问卷3通知宣教
      title: "宣教内容列表",
      currenttype: 1, //1宣教2门诊3出院4复诊5体检6随访
      id: "", //
      previewid: "", //任务模板传递id
      libName: "",
      objyl: {},
      overallCase: [], //选择患者总
      // æ—¥æœŸèŒƒå›´
      dateRange: [startDate, endDate],
      allpids: [],
      appraiselist: [],
      optionsclass: [],
      illnesslist: [],
      mode: [],
      libId: null, //模板库模板id
      nhh: null, //是否依照新增
      Editprogress: 1, //编辑进度
      drawermb: false, //选择模板弹窗
      previewtf: false, //预览
@@ -572,32 +904,66 @@
      checkboxlist: [],
      tableLabel: [],
      questionList: [],
      usable: [
        { value: "0", label: "可用" },
        { value: "1", label: "停用" },
      ],
      required: [
        { value: "1", label: "必填" },
        { value: "2", label: "不必填" },
      ],
      props: { multiple: true, value: "deptCode", label: "deptName" },
      propstask: { value: "deptCode", label: "deptName" },
      // æ‚£è€…表单
      tableLabelhz: [
        { label: "患者名称", width: "", prop: "name" },
        { label: "出院日期", width: "150", prop: "inhosptime" },
        { label: "患者", width: "", prop: "name" },
        { label: "身份证", width: "200", prop: "idcardno" },
        { label: "性别", width: "", prop: "sex" },
        { label: "年龄", width: "", prop: "age" },
        { label: "就诊科室", width: "", prop: "deptName" },
        { label: "入院日期", width: "", prop: "birthdate" },
        { label: "创建人(缺)", width: "", prop: "update_by" },
        { label: "责任护士", width: "", prop: "nurseName" },
        { label: "主治医生", width: "", prop: "drname" },
        { label: "科室", width: "240", prop: "dept" },
        { label: "病区", width: "240", prop: "leavehospitaldistrictname" },
      ],
      // æ‚£è€…表单
      tableLabelhzwb: [
        { label: "出院日期", width: "150", prop: "endtime" },
        { label: "患者", width: "", prop: "name" },
        { label: "身份证", width: "200", prop: "sfzh" },
        { label: "性别", width: "", prop: "sex" },
        { label: "年龄", width: "", prop: "age" },
        { label: "出院天数", width: "", prop: "endDay" },
        { label: "责任护士", width: "", prop: "nurseName" },
        { label: "主治医生", width: "", prop: "drname" },
        { label: "科室", width: "180", prop: "deptName" },
        { label: "病区", width: "150", prop: "leavehospitaldistrictname" },
      ],
      tableLabelmz: [
        { label: "随访名称", width: "", prop: "templateName" },
        { label: "主要内容", width: "", prop: "note" },
      tableLabelwj: [
        { label: "模板标题", width: "", prop: "templateName" },
        { label: "随访描述", width: "", prop: "note" },
        { label: "修改日期", width: "", prop: "updateTime" },
        { label: "创建人(缺)", width: "", prop: "updateBy" },
        { label: "创建人", width: "", prop: "createBy" },
      ],
      // æœåŠ¡å½¢å¼
      // å˜é‡
      tableLabelvariable: [
        { label: "变量名称", width: "", prop: "variablename" },
        { label: "匹配符", width: "", prop: "character" },
        { label: "替换值", width: "", prop: "Replacementvalue" },
      ],
      preachform: [
        { label: "线下", value: 1 },
        { label: "电话", value: 2 },
        { label: "小程序", value: 3 },
        { label: "多媒体", value: 1 },
        { label: "纸质", value: 2 },
        { label: "电话", value: 3 },
        { label: "短信", value: 4 },
        { label: "微信公众", value: 5 },
        { label: "钉钉", value: 6 },
        { label: "智能机器人", value: 7 },
        { label: "微信公众号", value: 5 },
        { label: "微信小程序", value: 6 },
        { label: "支付宝", value: 7 },
        { label: "智能小程序", value: 8 },
        { label: "钉钉", value: 9 },
        { label: "线下(纸质)", value: 10 },
        { label: "线上(短信/钉钉的文本、随访链接)", value: 11 },
      ],
      // æ—¶é—´å¤„理
      daytime: [], //日期
@@ -618,6 +984,7 @@
      patientqueryParams: {
        pageNum: 1, //
        pageSize: 10,
        topica: 1, //0全部1科室2病区
      },
      topicoptions: [{ children: [{ children: [] }] }],
      showSearch: true, //
@@ -632,11 +999,14 @@
      multiple: true,
      // ç”¨æˆ·è¡¨æ ¼æ•°æ®
      userList: [], //模板列表
      multiplechoice: [], //多选结果
      patientuserList: [], //选择患者列表
      sonuserList: [], //选中患者列表
      delvariableList: [], //删除变量临时存储
      indexAssortlist: [],
      longtype: [
        { value: 0, label: "普通任务" },
        { value: 1, label: "长期任务" },
      ],
      variableList: [
        {
          name: "姓名",
@@ -683,14 +1053,21 @@
      form: {
        patTaskRelevances: [],
        sendType: 1,
        longTask: 0,
        templatename: "",
        templateid: null,
        libtemplateid: null,
        kcb: "亲爱的患者/家属,您好!我们是浙中医大二院的医护人员,为了更好地了解您的康复情况,请您抽一点宝贵时间,观看这份宣教资讯。",
        jsy: "请您注意休息和营养,生活上要劳逸结合,适当锻炼,戒烟限酒,保持心情舒畅,定期复诊。那本次宣教内容就到这里,祝您身体健康!",
      },
      taskoptions: [
        {
          value: "1",
          label: "出院病人",
        },
        {
          value: "4",
          label: "在院病人",
        },
        {
          value: "2",
@@ -701,22 +1078,111 @@
          label: "体检病人",
        },
      ],
      quote: false,
      serviceType:null,
      source: [
        {
          value: 0,
          label: "所属患者",
        },
        {
          value: 1,
          label: "科室患者",
        },
        {
          value: 2,
          label: "病区患者",
        },
      ],
      tasktypes: [
        {
          value: 1,
          label: "监测评估",
        },
        {
          value: 2,
          label: "出院随访",
        },
        {
          value: 3,
          label: "门诊随访",
        },
        {
          value: 4,
          label: "宣教关怀",
        },
        {
          value: 5,
          label: "复诊管理",
        },
        {
          value: 6,
          label: "满意度调查",
        },
        {
          value: 7,
          label: "患者报告",
        },
        {
          value: 8,
          label: "其他通知",
        },
      ],
      // ç§‘室/病区
      belongWards: [],
      belongWards: [],
      deptlist: [],
      hosplist: [],
      tempDetpRelevanceslist: [], //科室数据
      tempDetpRelevanceslistform: [], //科室数据
      tempbelongWards: [], //病区数据
      tempbelongWardsform: [], //病区数据
      rules: {
        taskName: [
          { required: true, message: "任务名称不能为空", trigger: "blur" },
          {
            min: 2,
            max: 30,
            message: "任务名称长度必须介于 2 å’Œ 30 ä¹‹é—´",
            trigger: "blur",
          },
        ],
        sendType: [
          { required: true, message: "发送设置不能为空", trigger: "blur" },
        ],
      },
      // ç§‘室院区查询入参
      queryParamsdept: {
        tempid: "",
        type: 11,
      },
      quote: false,
      serviceType: null,
    };
  },
  components: { SFtable },
  created() {
    this.appraiselist = store.getters.appraiselist;
    this.belongWards = store.getters.belongWards;
    this.belongDepts = store.getters.belongDepts;
    this.mode = store.getters.Askmode;
    this.id = this.$route.query.id;
    this.newadd = this.$route.query.newadd;
    this.form.type = this.$route.query.type;
    this.form.typename = this.$route.query.typename;
    this.serviceType = Number(this.$route.query.serviceType);
    this.form.serviceType = Number(this.$route.query.serviceType);
    this.form.nhh = this.$route.query.nhh;
    this.listDept();
    this.Acquisitiontype();
    this.Getdetails();
    this.getFollowupclassify();
  },
  activated() {
    if (this.id != this.$route.query.id) {
      this.Acquisitiontype();
      this.Getdetails();
      this.getFollowupclassify();
    }
  },
  methods: {
@@ -753,13 +1219,79 @@
      let queryParams = {
        pageNum: this.topqueryParams.pageNum,
        pageSize: this.topqueryParams.pageSize,
        isavailable: "",
        isenable: "",
      };
      this.currenttype = this.$route.query.type;
      // å‡ºé™¢ã€é—¨è¯Šã€ä¸“病随访
      this.title = "随访内容列表";
      this.tableLabel = this.tableLabelmz;
      if (this.form.serviceType == 2 || this.form.serviceType == 3) {
      this.tableLabel = this.tableLabelwj;
      if (this.form.serviceType == 1) {
        this.checkboxlist = [
          {
            value: "1",
            label: "人工",
          },
          {
            value: "2",
            label: "纸质",
          },
          {
            value: "5",
            label: "微信公众号",
          },
        ];
      } else if (this.form.serviceType == 6) {
        this.checkboxlist = [
          {
            value: "3",
            label: "电话",
          },
          {
            value: "4",
            label: "短信",
          },
          {
            value: "5",
            label: "微信公众号",
          },
          {
            value: "6",
            label: "微信小程序",
          },
          {
            value: "8",
            label: "智能机器人",
          },
        ];
      } else if (this.form.serviceType == 7 || this.form.serviceType == 5) {
        this.checkboxlist = [
          {
            value: "1",
            label: "人工",
          },
          {
            value: "2",
            label: "纸质",
          },
          {
            value: "3",
            label: "电话",
          },
          {
            value: "4",
            label: "短信",
          },
          {
            value: "5",
            label: "微信公众号",
          },
          {
            value: "6",
            label: "微信小程序",
          },
        ];
      } else if (this.form.serviceType == 2 || this.form.serviceType == 3) {
        this.checkboxlist = [
          {
            value: "1",
@@ -787,69 +1319,83 @@
            label: "智能机器人",
          },
        ];
      } else if (this.form.serviceType == 5) {
        this.checkboxlist = [
          {
            value: "3",
            label: "电话",
          },
          {
            value: "4",
            label: "短信",
          },
          {
            value: "5",
            label: "微信公众号",
          },
          {
            value: "6",
            label: "微信小程序",
          },
          {
            value: "8",
            label: "智能机器人",
          },
        ];
      }
      getFollowuplist(queryParams).then((response) => {
      getFollowuplist(this.topqueryParams).then((response) => {
        this.userList = response.rows;
        this.total = response.total;
      });
    },
    nextstep() {
      if (this.Editprogress <= 3) {
        return this.Editprogress++;
      }
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.Editprogress <= 3) {
            return this.Editprogress++;
          }
        } else {
          this.$modal.msgError("表单内容未完善,请检查");
        }
      });
    },
    // ä¿å­˜
    submitForm(formName) {
      this.form.preachform = this.checkList.join(",");
      // this.formatFn(1);
      if (!this.form.patTaskRelevances[0]) {
      if (this.time4 && this.form.sendType == 3)
        this.form.showTimeMorn = this.time4;
      this.form.sendTimeslot = [
        {
          begantime: this.time4,
          endtime: "",
          xh: 1,
        },
      ];
      if (this.checkList[0]) {
        this.form.preachform = this.checkList.join(",");
      } else {
        this.$modal.msgError("请选择服务类型");
        return;
      }
      if (!this.form.patTaskRelevances[0] && !this.form.longTask) {
        this.$modal.msgError("请选择病人");
        return;
      }
      if (!this.form.templatename) {
        this.$modal.msgError("未选择模板");
        return;
      }
      if ((this.form.sendType == 1 && this.time1) || this.form.sendType == 2) {
      } else if (
        (this.form.sendType == 3 && this.time4) ||
        this.form.longTask
      ) {
      } else {
        return this.$modal.msgError("时间信息缺失");
      }
      const filteredArray = this.variableList.filter(
        (item) =>
          item.name !== "姓名" && item.name !== "电话" && item.name !== "地址"
      );
      console.log(filteredArray, "存前变量");
      this.form.textParam = this.convertFormat2ToFormat1(filteredArray);
      if (this.form.taskid) {
        this.form.isoperation = 2;
      } else {
        this.form.isoperation = 1;
      }
      this.form.serviceType=this.serviceType;
      if (!this.form.type) {
        this.form.type = this.$route.query.type;
      }
      this.form.serviceType = this.serviceType;
      this.form.leaveldeptcodes = store.getters.belongDepts.map(
        (obj) => obj.deptCode
      );
      this.form.leavehospitaldistrictcodes = store.getters.belongWards.map(
        (obj) => obj.districtCode
      );
      Editsingletask(this.form).then((res) => {
        if (res.code == 200) {
          if (this.form.taskid) {
            this.$modal.msgSuccess("新增成功");
          } else {
            this.$modal.msgSuccess("修改成功");
          } else {
            this.puttaskid(res.data);
            this.$modal.msgSuccess("新增成功");
          }
          this.$router.push({
            path: "/followvisit/tasklist",
@@ -858,34 +1404,95 @@
        }
      });
    },
    // ----------------------表格子组件事件
    // ç¡®è®¤é€‰æ‹©æ¨¡æ¿æ”¾å…¥ä»»åŠ¡æ¨¡æ¿
    selectfn(row, type) {
      // æ¨¡æ¿æƒ…况下获取模板信息
      console.log(row, "选择模板");
      this.libName = row.templateName;
      this.libId = row.id;
      getvFollowup({ id: row.id }).then((res) => {
    // ç»™ä»»åŠ¡æ¨¡æ¿èµ‹å€¼ä»»åŠ¡id
    puttaskid(data) {
      getTaskparticty(this.form.templateid).then((res) => {
        if (res.code == 200) {
          this.Tasktemplate = res.data;
          const data = res.data;
          this.questionList = data.ivrLibaTemplateScriptVOList;
          this.previewtf = true;
          this.previewid = data.id;
          console.log(this.questionList, "questionList");
          this.Variablehandling(data.ivrLibaTemplateScriptVOList, 1);
          this.objyl = res.data;
          this.objyl.isoperation = 2;
          this.objyl.taskid = data.taskId;
          Taskparticty(this.objyl).then((response) => {
            this.previewtf = false;
            this.form.libtemplateid = this.objyl.id;
            this.form.templateid = response.data;
            // this.putbelongDepts(response.data);
            this.form.templatename = this.objyl.templateName;
            this.$modal.msgSuccess("选择模板成功");
          });
        }
      });
    },
    // ----------------------表格子组件事件
    // é€‰æ‹©é¢„览
    selectfn(row, type) {
      // æ¨¡æ¿æƒ…况下获取模板信息
      if (type == 1) {
        this.libName = row.templateName;
        this.libId = row.id;
        this.questionList = row.ivrLibaTemplateScriptVOList;
        getvFollowup({ id: row.id }).then((res) => {
          if (res.code == 200) {
            this.objyl = res.data;
            if (this.form.longTask) {
              this.objyl.longTemp = 1;
            }
            this.queryParamsdept.type = 1;
            this.queryParamsdept.tempid = row.id;
            this.listDept();
            this.objyl.suitway = this.objyl.suitway.split(",");
            this.questionList = res.data.ivrLibaTemplateScriptVOList;
            this.getillness(row.id);
        console.log(res.data, "11");
            this.Variablehandling(res.data.ivrLibaTemplateScriptVOList, 1);
            this.previewtf = true;
          }
        });
        this.previewid = row.id;
      } else if (type == 2) {
      } else if (type == 3) {
      }
    },
    // é¢„览
    previewfnmb() {
      getTaskparticty(this.form.templateid).then((res) => {
        if (res.code == 200) {
          this.objyl = res.data;
          if (this.objyl.suitway)
            this.objyl.suitway = this.objyl.suitway.split(",");
          this.queryParamsdept.tempid = this.form.templateid;
          this.queryParamsdept.type = 11;
          this.getillness(this.form.libtemplateid);
          // æ‰§è¡ŒèŽ·å–è¯¥ä»»åŠ¡æ¨¡æ¿id
          this.listDept();
          this.previewtf = true;
          getvFollowup({ id: this.form.libtemplateid }).then((res) => {
            if (res.code == 200) {
              this.questionList = res.data.ivrLibaTemplateScriptVOList;
              this.objyl.ivrLibaTemplateScriptVOList =
                res.data.ivrLibaTemplateScriptVOList;
            }
          });
        }
      });
    },
    getillness(id) {
      if (id) {
        getillness({ outid: id, type: 5 }).then((res) => {
          this.illnesslist = res.rows;
          this.illnesslist.forEach((item) => {
            item.icdname = item.icd10name;
          });
        });
      }
    },
    // å¤„理问题层变量
    Variablehandling(arr, type) {
      let Variablist = [];
      this.variableList = []; //变量列表
      if (type == 1) {
        console.log(arr);
        // å¾ªçŽ¯é—®é¢˜
        arr.forEach((res) => {
          console.log(JSON.parse(res.otherdata), "ss");
          // å¾ªçޝ选项
          JSON.parse(res.otherdata).forEach((item) => {
            if (item.default != 1) {
@@ -902,50 +1509,81 @@
            index ===
            self.findIndex((t) => t.name === obj.name && t.value === obj.value)
        );
        this.variableList = this.transitionList.concat(Aarr);
        console.log(this.variableList, "variableList");
        // this.form.textParam = this.convertFormat2ToFormat1(this.variableList);
      }
    },
    // å­ä»»åŠ¡äºŒçº§å¼¹æ¡†
    handleAddpatient(row) {
      console.log(this.overallCase, "ssaaa");
      this.allpids = [];
      this.overallCase.forEach((item) => {
        this.allpids.push(item.patid);
      });
      if (this.patientqueryParams.allhosp == 1) {
        this.tableLabelhz = [
          { label: "患者名称", width: "", prop: "name" },
          // { label: "入院日期", width: "170", prop: "starttime" },
          { label: "出院日期", width: "150", prop: "endtime" },
          { label: "患者", width: "", prop: "name" },
          { label: "身份证", width: "200", prop: "idcardno" },
          { label: "性别", width: "", prop: "sex" },
          { label: "年龄", width: "", prop: "age" },
          { label: "主任医师", width: "", prop: "drname" },
          { label: "就诊科室", width: "", prop: "deptName" },
          { label: "入院日期", width: "", prop: "birthdate" },
          { label: "创建人", width: "", prop: "createBy" },
          { label: "出院天数", width: "", prop: "endDay" },
          { label: "责任护士", width: "", prop: "nurseName" },
          { label: "医生", width: "", prop: "drname" },
          { label: "科室", width: "180", prop: "dept" },
          { label: "病区", width: "150", prop: "leavehospitaldistrictname" },
        ];
      } else if (this.patientqueryParams.allhosp == 2) {
      } else if (this.patientqueryParams.allhosp == 4) {
        this.tableLabelhz = [
          { label: "患者名称", width: "", prop: "name" },
          { label: "入院日期", width: "150", prop: "starttime" },
          { label: "患者", width: "", prop: "name" },
          { label: "身份证", width: "200", prop: "idcardno" },
          { label: "性别", width: "", prop: "sex" },
          { label: "年龄", width: "", prop: "age" },
          { label: "诊断", width: "", prop: "diagname" },
          { label: "就诊科室", width: "", prop: "deptName" },
          { label: "入院日期", width: "", prop: "birthdate" },
          { label: "创建人", width: "", prop: "createBy" },
          { label: "出院天数", width: "", prop: "endDay" },
          { label: "责任护士", width: "", prop: "nurseName" },
          { label: "医生", width: "", prop: "drname" },
          { label: "科室", width: "180", prop: "dept" },
          { label: "病区", width: "150", prop: "leavehospitaldistrictname" },
        ];
      }
      if (this.allpids[0]) {
        this.patientqueryParams.pids = this.allpids;
        console.log(this.patientqueryParams.pids);
      } else {
        this.patientqueryParams.pids = null;
      }
      // ç±»åž‹åˆ¤æ–­
      if (this.patientqueryParams.allhosp == 1) {
        this.patientqueryParams.cry = 1;
      } else if (this.patientqueryParams.allhosp == 4) {
        this.patientqueryParams.cry = 0;
      }
      // æ¥æºåˆ¤æ–­
      getTaskpatient(
        this.addDateRange(this.patientqueryParams, this.dateRange)
      ).then((response) => {
      if (this.patientqueryParams.searchscope == 1) {
        this.patientqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
          (obj) => obj.deptCode
        );
        this.patientqueryParams.leavehospitaldistrictcodes = [];
      } else if (this.patientqueryParams.searchscope == 2) {
        this.patientqueryParams.leavehospitaldistrictcodes =
          store.getters.belongWards.map((obj) => obj.districtCode);
        this.patientqueryParams.leaveldeptcodes = [];
      } else {
        this.patientqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
          (obj) => obj.deptCode
        );
        this.patientqueryParams.leavehospitaldistrictcodes =
          store.getters.belongWards.map((obj) => obj.districtCode);
      }
      getTaskpatient(this.patientqueryParams).then((response) => {
        this.patientuserList = response.rows;
        this.patientuserList.forEach((item) => {
          if (item.endtime) {
            item.endDay = this.daysBetween(item.endtime);
          }
        });
        this.patienttotal = response.total;
        this.loading = false;
        this.Restorecheck();
@@ -955,41 +1593,36 @@
    handleUpdate() {},
    handleDelete() {},
    handleExport() {},
    // é€‰ä¸­æ‚£è€…表
    handlePitchionChange() {},
    // é€‰æ‹©æ‚£è€…表数据
    handleSelectionChange(selection) {
      console.log("多选患者");
      this.SelectPatientslist = selection;
      this.SelectPatientslist = structuredClone(selection);
      this.multiple = !selection.length;
      // èµ‹å€¼ç»™æ•´ä½“选中数组
      this.SelectPatientslist.forEach((item) => {
        const isExist = this.overallCase.find((obj) => obj.name == item.name);
        if (!isExist) {
          console.log(this.patientqueryParams.allhosp, "allhosp");
          item.isoperation = 1;
          item.patid = item.id;
          item.hospType = this.patientqueryParams.allhosp;
          item.sfzh = item.idcardno;
          item.deptCode = item.deptcode;
          item.deptName = item.dept;
          item.admindate = item.inhosptime;
          item.sfzh = item.idcardno;
          this.overallCase.push(item);
          this.form.patTaskRelevances.push(item);
          console.log(this.overallCase, "this.overallCase");
        }
      });
    },
    // åˆ‡æ¢é¡µåŽæ¢å¤é€‰ä¸­
    Restorecheck() {
      console.log(this.overallCase, "this.overallCase");
      const allid = this.overallCase.map((item) => item.id);
      const allid = this.overallCase.map((item) => item.patid);
      const overlap = this.patientuserList.filter((value) => {
        return allid.includes(value.id);
        return allid.includes(value.patid);
      });
      console.log(overlap, "overlap");
      // ä¿æŒids和当前页面的同步性
      this.SelectPatientslist = overlap;
      console.log(this.SelectPatientslist, "进入分页SelectPatientslist");
      this.toggleSelection(overlap);
    },
    // æŒ‚载选择状态
@@ -1002,7 +1635,6 @@
          });
          this.decision = false;
        });
        console.log(123);
      } else {
        this.$refs.multipleTable.clearSelection();
      }
@@ -1021,19 +1653,26 @@
    },
    getList() {},
    handleQuery() {
      if (this.patientqueryParams.topica == 0) {
        this.patientqueryParams.leavehospitaldistrictcodes =
          store.getters.leavehospitaldistrictcodes;
        this.patientqueryParams.leaveldeptcodes = store.getters.leaveldeptcodes;
      } else if (this.patientqueryParams.topica == 1) {
        this.patientqueryParams.leavehospitaldistrictcodes = null;
        this.patientqueryParams.leaveldeptcodes = store.getters.leaveldeptcodes;
      } else if (this.patientqueryParams.topica == 2) {
        this.patientqueryParams.leavehospitaldistrictcodes =
          store.getters.leavehospitaldistrictcodes;
        this.patientqueryParams.leaveldeptcodes = null;
      }
      this.handleAddpatient();
    },
    resetQuery() {
      this.dateRange = [];
      // æŸ¥è¯¢å‚æ•°
      this.queryParams = {
        pageNum: 1,
        pageSize: 10,
        userName: undefined,
        phonenumber: undefined,
        status: undefined,
        deptId: undefined,
      };
    resetQuery() {},
    handleQuerymb() {
      getFollowuplist(this.topqueryParams).then((response) => {
        this.userList = response.rows;
        this.total = response.total;
      });
    },
    handleClosehz() {
      this.dialogVisiblepatient = false;
@@ -1053,18 +1692,36 @@
    },
    // èŽ·å–è¯¦æƒ…
    Getdetails() {
      this.form = {
        patTaskRelevances: [],
        sendType: 1,
        templatename: "",
        templateid: null,
        libtemplateid: null,
        kcb: "亲爱的患者/家属,您好!我们是浙中医大二院的医护人员,为了更好地了解您的康复情况,请您抽一点宝贵时间,完成这份随访随访。",
        jsy: "请您注意休息和营养,生活上要劳逸结合,适当锻炼,戒烟限酒,保持心情舒畅,定期复诊。那本次回访就到这里,祝您身体健康!",
      };
      this.questionList = [];
      if (this.id) {
        getTaskInfo({ taskid: this.id }).then((res) => {
          let filteredArray = "";
          console.log(2233);
          if (res.code == 200) {
            this.form = res.data;
      this.form.serviceType=this.serviceType;
            this.form.serviceType = this.serviceType;
            this.form.patTaskRelevances = this.form.patTaskRelevances
              ? this.form.patTaskRelevances
              : [];
            this.overallCase = this.form.patTaskRelevances.concat();
            this.checkList = this.form.preachform.split(",");
            console.log(this.form.showDate, "this.form");
            this.daytime = this.form.showDate.split(",");
            this.changeTimeday(this.daytime);
            this.overallCase.forEach((item) => {
              if (item.endtime) {
                item.endDay = this.daysBetween(item.endtime);
              }
            });
            if (this.form.showDate)
              this.daytime = this.form.showDate.split(",");
            if (this.form.showTimeMorn) {
              if (this.form.sendType == 3) {
                this.time4 = this.form.showTimeMorn;
@@ -1076,23 +1733,54 @@
              this.time2 = this.form.showTimeNoon.split(",");
            if (this.form.showTimeNight)
              this.time3 = this.form.showTimeNight.split(",");
            console.log(1122);
            filteredArray = this.convertFormat1ToFormat2(this.form.textParam);
            this.variableList = this.transitionList.concat(filteredArray);
          } else {
            this.$modal.msgError(res.code);
          }
          if (this.newadd) {
            this.neWaddfn();
          }
        });
      }
      getFollowupclassify({}).then((res) => {
        this.indexAssortlist = res.rows;
      });
    },
    // ä¾ç…§æ–°å¢žæ—¶å¤„理
    neWaddfn() {
      this.id = null;
      this.form.taskName = "";
      this.form.taskid = null;
      this.overallCase = [];
      this.form.patTaskRelevances = [];
      this.daytime = []; //日期
      this.applydaytime = []; //计算日期
      this.time1 = ""; //上午时间段
      this.time2 = ""; //下午时间段
      this.time3 = ""; //晚上时间段
      this.time4 = ""; //晚上时间段
    },
    // èŽ·å–ç§‘å®¤åˆ—è¡¨
    listDept() {
      listDept().then((res) => {
        this.topicoptions = this.handleTree(res.data, "deptId");
        console.log(this.topicoptions, "topicoptions");
      this.tempDetpRelevanceslist = [];
      this.tempbelongWards = [];
      depthospgetsonlist(this.queryParamsdept).then((res) => {
        if (res.code == 200) {
          let arr = res.rows;
          arr.forEach((item) => {
            if (item.deptType == 1) {
              this.deptlist.push(item);
              this.tempDetpRelevanceslist.push(item.deptCode);
            } else if (item.deptType == 2) {
              this.hosplist.push(item);
              this.tempbelongWards.push(item.deptCode);
            }
          });
        }
      });
    },
    getFollowupclassify() {
      getFollowupclassify({}).then((res) => {
        this.optionsclass = res.rows;
      });
    },
    // æ–°å¢žæ´¾é€æ‚£è€…
@@ -1109,27 +1797,20 @@
      this.variableList.splice(index, 1);
      row.isoperation = 3;
      this.delvariableList.push(row);
      console.log(index, row);
    },
    // æ—¶é—´----------
    changeTime(row) {
      console.log(row, "时间");
      this.processingTime();
    },
    Totaldate(row) {
      console.log(row, "时间");
      this.form.sendTimeslot = [{ begantime: row, endtime: row, xh: 1 }];
      this.form.showTimeMorn = row;
      console.log(this.form.sendTimeslot, "时间");
    },
    changeTimeday(row) {
      console.log(row, "日期");
      const startDate = new Date(row[0]);
      const endDate = new Date(row[1]);
      this.applydaytime = this.getDates(startDate, endDate);
      if (!top) {
        this.processingTime();
      }
      this.processingTime();
    },
    getDates(startDate, endDate) {
      const dates = [];
@@ -1179,52 +1860,71 @@
      }
      this.form.sendTimeslot = combinedData;
      // å±•示数据临时存储日期、早、中、晚
      console.log(this.daytime);
      this.form.showDate = this.daytime.join(",");
      if (this.time1) this.form.showTimeMorn = this.time1.join(",");
      if (this.time2) this.form.showTimeNoon = this.time2.join(",");
      if (this.time3) this.form.showTimeNight = this.time3.join(",");
      console.log(combinedData, "combinedData");
    },
    // æŸ¥çœ‹æ¨¡æ¿
    previewGo() {
      this.$router.push({
        path: "/knowledge/tpuconfigurat/",
        query: { id: this.previewid, task: true, data: this.form },
      });
    },
    // ä¿å­˜/更新任务模板
    previewFn() {
      let id = this.Tasktemplate.id;
      this.Tasktemplate.id = null;
      this.Tasktemplate.ivrLibaTemplateScriptVOList.forEach((item) => {
        item.ivrTaskScriptTargetoptionList = item.ivrLibaScriptTargetoptionList;
      if (Array.isArray(this.objyl.suitway)) {
        this.objyl.suitway = this.objyl.suitway.join(",");
      }
      this.objyl.ivrLibaTemplateScriptVOList.forEach((item) => {
        item.svyTaskTemplateTargetoptions = item.ivrLibaScriptTargetoptionList;
      });
      console.log(this.Tasktemplate.ivrLibaTemplateScriptVOList);
      this.Tasktemplate.ivrTaskTemplateScriptVOList =
        this.Tasktemplate.ivrLibaTemplateScriptVOList;
      this.Tasktemplate.ivrLibaTemplateTagList = null;
      this.Tasktemplate.tempDetpRelevances = null;
      this.Tasktemplate.libtemplateid = id;
      this.Tasktemplate.isoperation = 1;
      this.Tasktemplate.libtemplatename = this.Tasktemplate.templatename;
      console.log(this.libName, this.libId);
      TaskTemplatecomit(this.Tasktemplate).then((response) => {
        console.log(response);
        this.previewtf = false;
        this.form.templateid = response.data;
        this.form.libtemplateid = this.libId;
        this.form.templatename = this.libName;
        console.log(this.form.templatename, "ss");
        this.$modal.msgSuccess("选择模板成功", this.form.templatename);
      this.objyl.svyTaskTemplateScriptVOS =
        this.objyl.ivrLibaTemplateScriptVOList;
      this.objyl.isoperation = 1;
      if (this.form.templateid) {
        deleteTaskparticty(this.form.templateid).then((res) => {
          if (res.code == 200) {
              Taskparticty(this.objyl).then((response) => {
                this.previewtf = false;
                this.form.libtemplateid = this.objyl.id;
                this.form.templateid = response.data;
                this.putbelongDepts(response.data);
                this.form.templatename = this.objyl.templateName;
                this.$modal.msgSuccess("选择模板成功");
              });
          }
        });
      } else {
        Taskparticty(this.objyl).then((response) => {
          this.previewtf = false;
          this.form.libtemplateid = this.objyl.id;
          this.form.templateid = response.data;
          this.putbelongDepts(response.data);
          this.form.templatename = this.objyl.templateName;
          this.$modal.msgSuccess("选择模板成功");
        });
      }
    },
    // ä¿å­˜ç§‘室/病区
    putbelongDepts(id) {
      this.tempDetpRelevanceslistform.forEach((item) => {
        item.tempid = id;
      });
      this.tempbelongWardsform.forEach((item) => {
        item.tempid = id;
      });
      depthospgetson(this.tempDetpRelevanceslistform).then((res) => {
        if (res.code == 200) {
          this.$modal.msgSuccess("科室更新成功");
          this.tempDetpRelevanceslistform = [];
        }
      });
      depthospgetson(this.tempbelongWardsform).then((res) => {
        if (res.code == 200) {
          this.$modal.msgSuccess("病区更新成功");
          this.tempbelongWardsform = [];
        }
      });
    },
    // å¤„理服务形式
    formatFn(type) {
      console.log(this.preachform, "preachform");
      console.log(this.checkList, "checklist");
      let list = [];
      let formlist = [];
      if (type == 1) {
@@ -1235,6 +1935,7 @@
            }
          });
        });
        console.log(list, "list");
        this.form.preachform = list.join(",");
      } else {
        console.log(this.form.preachform, "this.form.preachform");
@@ -1249,6 +1950,33 @@
        });
        this.checkList = list;
      }
    },
    // ç§‘室处理
    Departmenttreatment() {
      this.tempDetpRelevanceslist.forEach((item) => {
        this.tempDetpRelevanceslistform.push({
          deptType: 1,
          longTemp: this.form.longTask,
          deptCode: item,
          tempid: null,
          type: 11,
        });
      });
      this.tempbelongWards.forEach((item) => {
        this.tempbelongWardsform.push({
          deptType: 2,
          longTemp: this.form.longTask,
          deptCode: item,
          tempid: null,
          type: 11,
        });
      });
      console.log(33);
      setTimeout(() => {
        this.previewFn();
      }, 1000);
    },
  },
};
@@ -1287,11 +2015,12 @@
  margin: 20px;
  .headline {
    font-size: 24px;
    height: 40px;
    border-left: 5px solid #41a1be;
    padding-left: 5px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    // justify-content: space-between;
    .Add-details {
      font-size: 18px;
      color: #02a7f0;
@@ -1326,6 +2055,14 @@
    }
  }
}
.xinz-infs {
  font-size: 18px;
  line-height: 48px;
  .el-tag + .el-tag {
    margin-left: 10px;
  }
}
// .leftvlue-jbxx {
//   margin-bottom: 50px;
//   font-size: 20px;
@@ -1348,9 +2085,9 @@
  //   margin: 20px;
  padding: 30px;
  background: #ffff;
  border: 1px solid #dcdfe6;
  -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
    0 0 6px 0 rgba(0, 0, 0, 0.04);
  // border: 1px solid #dcdfe6;
  // -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
  //   0 0 6px 0 rgba(0, 0, 0, 0.04);
  .scriptTopic-dev {
    margin-bottom: 25px;
    font-size: 20px !important;
@@ -1415,12 +2152,12 @@
  width: 22px;
  height: 22px;
}
// ::v-deep.scriptTopic-dev.el-radio__label {
// ::v-deep.topic-dev.el-radio__label {
//   font-size: 24px;
// }
::v-deep.el-radio-group {
  span {
    font-size: 24px;
    font-size: 18px;
  }
}
::v-deep.el-input.is-disabled .el-input__inner {
@@ -1431,7 +2168,7 @@
}
::v-deep.el-checkbox-group {
  span {
    font-size: 24px;
    font-size: 18px;
  }
}
</style>
src/views/repositoryai/templateku/configurat/index.vue
@@ -253,40 +253,52 @@
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="适用科室" prop="region">
            <el-cascader
              style="width: 500px"
              v-model="tempDetpRelevanceslist"
              :options="deptList"
              :props="props"
              :show-all-levels="false"
              clearable
            >
              <template slot-scope="{ node, data }">
                <span>{{ data.deptName }}</span>
                <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
              </template>
            </el-cascader>
          </el-form-item>
          <el-form-item label="通用库" prop="region">
            <el-select
              style="width: 500px"
              v-model="ruleForm.submoduleID"
              size="medium"
              multiple
              filterable
              placeholder="请选择库(多选)"
            >
              <el-option
                class="ruleFormaa"
                v-for="item in generallist"
                :key="item.id"
                :label="item.extName"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-row>
            <el-col :span="20"
              ><el-form-item label="适用科室" prop="region">
                <el-select
                  v-model="tempDetpRelevanceslist"
                  @remove-tag="removetag"
                  style="width: 55vw"
                  size="medium"
                  multiple
                  filterable
                  placeholder="请选择科室"
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in belongDepts"
                    :key="item.deptCode"
                    :label="item.deptName"
                    :value="item.deptCode"
                  >
                  </el-option>
                </el-select> </el-form-item
            ></el-col>
          </el-row>
          <el-row>
            <el-col :span="20"
              ><el-form-item label="适用病区" prop="region">
                <el-select
                  v-model="tempbelongWards"
                  @remove-tag="removehpsp"
                  style="width: 55vw"
                  size="medium"
                  multiple
                  filterable
                  placeholder="请选择科室"
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in belongWards"
                    :key="item.districtCode"
                    :label="item.districtName"
                    :value="item.districtCode"
                  >
                  </el-option>
                </el-select> </el-form-item
            ></el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="随访前处理" prop="name">
@@ -1366,6 +1378,7 @@
  getFollowuplist,
  deltargetillness,
  getillnesslist,
  depthospgetsonlist ,
  illnesslistget,
  getillness,
  getgenerallist,
@@ -1417,6 +1430,10 @@
      optionstag: [],
      prefollowuplist: [],
      postfollowuplist: [],
      tempDetpRelevanceslist: [], //科室数据
      tempDetpRelevanceslistform: [], //科室数据
      tempbelongWards: [], //病区数据
      tempbelongWardsform: [], //病区数据
      generallist: [
        { value: "1", label: "随访通用库一" },
        { value: "2", label: "随访二库" },
@@ -1477,6 +1494,8 @@
      addvalue: "添加题目",
      // é¢˜ç›®è¡¨æ ¼æ•°æ®
      userList: [],
      belongWards: [],
      belongDepts: [],
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
@@ -1490,11 +1509,19 @@
    };
  },
  activated() {
    console.log(this.id);
    console.log(this.$route.query.id);
    if (this.id != this.$route.query.id) {
      console.log(1);
      this.RoutingDataProcessing();
      this.gettabList();
      this.getvFollowup();
      this.auxiliary();
    }else{
      this.tempDetpRelevanceslistform = [];
      this.tempbelongWardsform = [];
    }
  },
@@ -1511,6 +1538,8 @@
    this.languagelist = store.getters.languagelist;
    this.courtyardlist = store.getters.courtyardlist;
    this.precedencetype = store.getters.precedencetype;
    this.belongWards = store.getters.belongWards;
    this.belongDepts = store.getters.belongDepts;
  },
  mounted() {},
  computed: {
@@ -1560,16 +1589,13 @@
            this.ruleForm.submoduleID = this.ruleForm.submoduleID.map((res) => {
              return Number(res);
            });
            console.log(
              this.ruleForm.submoduleID,
              "this.ruleForm.submoduleID取"
            );
            this.dynamicTags = this.ruleForm.ivrLibaTemplateTagList;
            this.dynamicTags = this.ruleForm.ivrLibaTemplateTagList.map(
              this.processElement
            );
            console.log(this.ruleForm.suitway);
            this.sortFn();
          }
        });
        getillness({ outid: this.id, type: 3 }).then((res) => {
@@ -1578,6 +1604,19 @@
            item.icdname = item.icd10name;
          });
        });
      } else {
        this.ruleForm = {
          templateName: "",
          ivrLibaTemplateTagList: [],
          ivrLibaTemplateScriptVOList: [],
          tempDetpRelevances: [],
        };
        this.deptOptions = [];
        this.optionsillness = [];
        this.illnesslistapi = [];
        this.illnesslist = [];
        this.dynamicTags = [];
        this.tempDetpRelevanceslist = [];
      }
      listDept(this.queryParams).then((response) => {
@@ -1589,8 +1628,21 @@
      // åˆ†ç±»
      getFollowupclassify({}).then((res) => {
        this.indexAssortlist = res.rows;
        if (this.$route.query.assortid) {
          this.ruleForm.assortid = Number(this.$route.query.assortid);
      });
      this.tempDetpRelevanceslist = [];
      this.tempbelongWards = [];
      depthospgetsonlist(this.queryParamsdept).then((res) => {
        if (res.code == 200) {
          let arr = res.rows;
          arr.forEach((item) => {
            if (item.deptType == 1) {
              this.deptlist.push(item);
              this.tempDetpRelevanceslist.push(item.deptCode);
            } else if (item.deptType == 2) {
              this.hosplist.push(item);
              this.tempbelongWards.push(item.deptCode);
            }
          });
        }
      });
      // ç§‘室
@@ -1630,9 +1682,9 @@
        this.ruleForm.assortid = -1;
      }
      this.ruleForm.labelInfo = JSON.stringify(this.dynamicTags);
      this.ruleForm.suitway = this.ruleForm.suitway.join(",");
      this.ruleForm.campus = this.ruleForm.campus.join(",");
      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) => {
@@ -1684,38 +1736,54 @@
    // ç§‘室处理
    Departmenttreatment() {
      this.$modal.loading("正在修正保存数据,请稍候...");
      this.ruleForm.deptNames = JSON.stringify(this.tempDetpRelevanceslist);
      this.ruleForm.ivrLibaTemplateScriptVOList =
        this.ruleForm.ivrLibaTemplateScriptVOList.concat(this.delScriptVOList);
      const result = this.tempDetpRelevanceslist.map(
        (subArr) => subArr[subArr.length - 1]
      );
      // id数组查数组对象
      result.forEach((item) => {
        const condition = this.ruleForm.tempDetpRelevances.some(
          (obj) => obj.deptId === item
        );
        if (!condition) {
          listDept({ deptId: item }).then((res) => {
            res.data[0].type = 2;
            this.ruleForm.tempDetpRelevances.push(res.data[0]);
      this.tempDetpRelevanceslist.forEach((item) => {
        console.log(item);
        let result = this.deptlist.some((obj) => obj.deptCode == item);
        console.log(this.result, "result");
        if (!result) {
          this.tempDetpRelevanceslistform.push({
            deptType: 1,
            longTemp: this.ruleForm.longTemp,
            deptCode: item,
            tempid: this.id,
            type: 1,
          });
        }
      });
      console.log(this.ruleForm.tempDetpRelevances);
      // æ•°ç»„对象查id数组
      this.ruleForm.tempDetpRelevances.forEach((item) => {
        const condition = result.some((obj) => obj === item.deptId);
        if (!condition) {
          const index = this.ruleForm.tempDetpRelevances.indexOf(item);
          this.ruleForm.tempDetpRelevances[index].delFlag = 1;
      this.tempbelongWards.forEach((item) => {
        let result = this.hosplist.some((obj) => obj.deptCode == item);
        if (!result) {
          this.tempbelongWardsform.push({
            deptType: 2,
            longTemp: this.ruleForm.longTemp,
            deptCode: item,
            tempid: this.id,
            type: 1,
          });
        }
      });
      console.log(this.ruleForm.tempDetpRelevances);
      setTimeout(() => {
        this.submitForm();
      }, 1000);
      // this.submitForm();
    },
     // ä¿å­˜ç§‘室/病区
     putbelongDepts(id) {
      if (this.tempDetpRelevanceslistform.length > 0) {
        depthospgetson(this.tempDetpRelevanceslistform).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("科室新增成功");
          }
        });
      }
      if (this.tempbelongWardsform.length > 0) {
        depthospgetson(this.tempbelongWardsform).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("院区新增成功");
          }
        });
      }
    },
    // ä¸‹ä¸€æ­¥
    nextstep() {
@@ -1860,7 +1928,6 @@
      });
    },
    addtopic(row) {
      console.log(row);
      if (
        this.ruleForm.ivrLibaTemplateScriptVOList.some(
          (obj) => obj.scriptTopic == row.scriptTopic
@@ -1878,6 +1945,7 @@
        });
        this.ruleForm.ivrLibaTemplateScriptVOList.push(res.data);
        this.sortFn();
        this.$forceUpdate();
        this.$modal.msgSuccess("添加成功");
      });
    },
@@ -1943,7 +2011,8 @@
    sortFn() {
      this.ruleForm.ivrLibaTemplateScriptVOList.forEach((item, index) => {
        item.sort = Number(index) + 1;
        console.log(1);
        console.log(this.ruleForm.ivrLibaTemplateScriptVOList.length);
        console.log(item.sort);
        if (item.sort == this.ruleForm.ivrLibaTemplateScriptVOList.length) {
          item.nextScriptno = 0;
@@ -1987,7 +2056,31 @@
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
  // ç§‘室删除触发
  removetag(row) {
      let result = this.deptlist
        .filter((item) => item.deptCode == row)
        .map((item) => item.id);
      console.log(result.length);
      if (result.length) {
        depthospgetsondel(result).then((res) => {
          if (res.code) {
          }
        });
      }
    },
    // åˆ é™¤åˆ é™¤è§¦å‘
    removehpsp(row) {
      let result = this.hosplist
        .filter((item) => item.deptCode == row)
        .map((item) => item.id);
        if (result.length) {
          depthospgetsondel(result).then((res) => {
            if (res.code) {
            }
          });
        }
    },
    // é¢„览---------------
    preview() {
      console.log(this.ruleForm);
src/views/system/user/index.vue
@@ -871,9 +871,11 @@
    submitForm: function () {
      this.form.hospInfo = JSON.stringify(this.form.deptCodes);
      this.form.deptInfo = JSON.stringify(this.form.wardCodes);
      if (this.form.deptCodes.length)
      this.form.deptCodes = this.form.deptCodes.map(
        (subArr) => subArr[subArr.length - 1]
      );
      if (this.form.wardCodes.length)
      this.form.wardCodes = this.form.wardCodes.map(
        (subArr) => subArr[subArr.length - 1]
      );
vue.config.js
@@ -36,7 +36,7 @@
      // detail: https://cli.vuejs.org/config/#devserver-proxy
      [process.env.VUE_APP_BASE_API]: {
        // target: `http://192.168.168.60:8095`,
        target: `http://192.168.1.10:8095`,
        target: `http://192.168.2.10:8095`,
        // target:`http://localhost:8095`,
        // target: `http://192.168.101.135:8095`,
        // target: `http://192.168.101.166:8093`,