WXL
2024-09-04 7eaee92ee52e1501480adbbe8a1af9ddecc04275
src/views/patient/propaganda/particty.vue
@@ -7,14 +7,13 @@
          <el-step
            icon="el-icon-edit"
            title="基础信息"
            description="选择模版、形式等基础信息"
            description="选择模板、形式等基础信息"
          ></el-step>
          <el-step
            icon="el-icon-user"
            title="任务主体"
            description="在本部选择服务患者"
          ></el-step>
          <el-step icon="el-icon-user" title="模版确认"></el-step>
        </el-steps>
      </div>
    </div>
@@ -22,7 +21,7 @@
    <div class="leftvlue" style="margin: 0 20px">
      <!-- 基本信息 -->
      <div v-if="Editprogress == 1">
        <el-alert title="选择模版、形式等基础信息" type="success" effect="dark">
        <el-alert title="选择模板、形式等基础信息" type="success" effect="dark">
        </el-alert>
        <div class="leftvlue-jbxx">
          <!-- 基础信息 -->
@@ -42,7 +41,7 @@
                      /> </el-form-item
                  ></el-col>
                  <el-col :span="8"
                    ><el-form-item label="模版名称">
                    ><el-form-item label="模板名称">
                      <el-input
                        style="width: 220px"
                        :disabled="true"
@@ -67,7 +66,7 @@
                    placeholder="请输入任务描述"
                  />
                </el-form-item>
                <el-form-item label="发送设置:" v-if="currenttype != 2">
                <el-form-item label="发送设置:">
                  <el-radio-group v-model="form.sendType">
                    <el-radio :label="1">时间段发送</el-radio>
                    <el-radio :label="3">时间点发送</el-radio>
@@ -335,6 +334,17 @@
                  @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
@@ -348,7 +358,7 @@
                  icon="el-icon-refresh"
                  size="medium"
                  @click="resetQuery"
                  >取消创建</el-button
                  >重置</el-button
                >
              </el-form-item>
            </el-form>
@@ -380,7 +390,7 @@
        >
      </span>
    </el-dialog>
    <el-dialog title="模版预览" :visible.sync="previewtf" width="60%">
    <el-dialog title="模板预览" :visible.sync="previewtf" width="60%">
      <div class="preview-left">
        <!-- 单选 -->
        <div
@@ -413,7 +423,7 @@
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="previewGo">前往模版详情修改</el-button>
        <el-button @click="previewGo">前往模板详情修改</el-button>
        <el-button type="primary" @click="previewFn">确认使用</el-button>
      </span>
    </el-dialog>
@@ -437,17 +447,8 @@
              v-show="showSearch"
              label-width="98px"
            >
              <el-form-item
                label="随访主题"
                v-if="currenttype == 1 || currenttype == 8"
              >
                <el-input v-model="topqueryParams.name"></el-input>
              </el-form-item>
              <el-form-item
                label="随访名称"
                v-if="currenttype == 2 || currenttype == 3 || currenttype == 7"
              >
                <el-input v-model="topqueryParams.name"></el-input>
              <el-form-item label="随访名称">
                <el-input v-model="topqueryParams.templateName"></el-input>
              </el-form-item>
              <el-form-item label="适用科室" prop="status">
@@ -459,6 +460,28 @@
                    :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>
@@ -478,7 +501,7 @@
              </el-form-item>
            </el-form>
            <el-divider></el-divider>
            <!-- 选择模版列表 -->
            <!-- 选择模板列表 -->
            <SFtable
              @selectfn="selectfn"
              :currentList="userList"
@@ -515,26 +538,32 @@
  delhetaskinfo,
  Editsingletask,
  getvFollowup,
  getFollowupclassify,
} from "@/api/AiCentre/index";
import { listDept } from "@/api/system/dept";
import SFtable from "@/components/SFtable"; //表格组件
export default {
  name: "ServiceDetails",
  name: "serviceDetailsa",
  data() {
    const endDate = new Date();
    const startDate = new Date();
    startDate.setDate(endDate.getDate() - 7); // 设置开始日期为当前日期前7天
    return {
      title: "随访内容列表",
      currenttype: 1, //1随访2门诊3出院4复诊5体检6问卷
      currenttype: 1, //1随访2问卷3通知宣教
      id: "", //
      previewid: "", //任务模版传递id
      previewid: "", //任务模板传递id
      libName: "",
      overallCase: [], //选择患者总
      // 日期范围
      dateRange: [startDate, endDate],
      allpids: [],
      libId: null, //模板库模版id
      libId: null, //模板库模板id
      nhh: null, //是否依照新增
      Editprogress: 1, //编辑进度
      drawermb: false, //选择模版弹窗
      drawermb: false, //选择模板弹窗
      previewtf: false, //预览
      loading: false, // 遮罩层
      patientloading: false, // 遮罩层
@@ -545,12 +574,11 @@
      questionList: [],
      // 患者表单
      tableLabelhz: [
        { label: "序号", width: "", prop: "patid" },
        { label: "患者名称", width: "", prop: "name" },
        { label: "性别", width: "", prop: "sex" },
        { label: "年龄", width: "", prop: "age" },
        { label: "就诊科室", width: "", prop: "deptName" },
        { label: "入院日期", width: "", prop: "inhosptime" },
        { label: "入院日期", width: "", prop: "birthdate" },
        { label: "创建人(缺)", width: "", prop: "update_by" },
      ],
@@ -603,10 +631,12 @@
      // 非多个禁用
      multiple: true,
      // 用户表格数据
      userList: [], //模版列表
      userList: [], //模板列表
      patientuserList: [], //选择患者列表
      sonuserList: [], //选中患者列表
      delvariableList: [], //删除变量临时存储
      indexAssortlist: [],
      variableList: [
        {
          name: "姓名",
@@ -672,6 +702,8 @@
        },
      ],
      quote: false,
      serviceType:null,
    };
  },
  components: { SFtable },
@@ -679,6 +711,7 @@
  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();
@@ -723,7 +756,6 @@
        isavailable: "",
      };
      this.currenttype = this.$route.query.type;
      console.log(this.currenttype, "1");
      // 出院、门诊、专病随访
      this.title = "随访内容列表";
      this.tableLabel = this.tableLabelmz;
@@ -733,7 +765,6 @@
            value: "1",
            label: "人工",
          },
          {
            value: "3",
            label: "电话",
@@ -787,6 +818,7 @@
        this.total = response.total;
      });
    },
    nextstep() {
      if (this.Editprogress <= 3) {
        return this.Editprogress++;
@@ -795,7 +827,6 @@
    // 保存
    submitForm(formName) {
      this.form.preachform = this.checkList.join(",");
      // this.formatFn(1);
      if (!this.form.patTaskRelevances[0]) {
        this.$modal.msgError("请选择病人");
@@ -812,6 +843,7 @@
      } else {
        this.form.isoperation = 1;
      }
      this.form.serviceType=this.serviceType;
      Editsingletask(this.form).then((res) => {
        if (res.code == 200) {
          if (this.form.taskid) {
@@ -819,15 +851,18 @@
          } else {
            this.$modal.msgSuccess("修改成功");
          }
          this.$router.go(-1);
          this.$router.push({
            path: "/followvisit/tasklist",
            query: { tasktopic: this.form.serviceType },
          });
        }
      });
    },
    // ----------------------表格子组件事件
    // 确认选择模版放入任务模版
    // 确认选择模板放入任务模板
    selectfn(row, type) {
      // 模版情况下获取模版信息
      console.log(row, "选择模版");
      // 模板情况下获取模板信息
      console.log(row, "选择模板");
      this.libName = row.templateName;
      this.libId = row.id;
      getvFollowup({ id: row.id }).then((res) => {
@@ -881,24 +916,22 @@
      });
      if (this.patientqueryParams.allhosp == 1) {
        this.tableLabelhz = [
          { label: "序号", width: "", prop: "patid" },
          { label: "患者名称", width: "", prop: "name" },
          { label: "性别", width: "", prop: "sex" },
          { label: "年龄", width: "", prop: "age" },
          { label: "主任医师", width: "", prop: "drname" },
          { label: "就诊科室", width: "", prop: "deptName" },
          { label: "入院日期", width: "", prop: "inhosptime" },
          { label: "入院日期", width: "", prop: "birthdate" },
          { label: "创建人", width: "", prop: "createBy" },
        ];
      } else if (this.patientqueryParams.allhosp == 2) {
        this.tableLabelhz = [
          { label: "序号", width: "", prop: "patid" },
          { label: "患者名称", width: "", prop: "name" },
          { label: "性别", width: "", prop: "sex" },
          { label: "年龄", width: "", prop: "age" },
          { label: "诊断", width: "", prop: "diagname" },
          { label: "就诊科室", width: "", prop: "deptName" },
          { label: "入院日期", width: "", prop: "inhosptime" },
          { label: "入院日期", width: "", prop: "birthdate" },
          { label: "创建人", width: "", prop: "createBy" },
        ];
      }
@@ -909,8 +942,9 @@
        this.patientqueryParams.pids = null;
      }
      getTaskpatient(this.patientqueryParams).then((response) => {
        console.log(response);
      getTaskpatient(
        this.addDateRange(this.patientqueryParams, this.dateRange)
      ).then((response) => {
        this.patientuserList = response.rows;
        this.patienttotal = response.total;
        this.loading = false;
@@ -935,6 +969,7 @@
        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);
@@ -988,7 +1023,18 @@
    handleQuery() {
      this.handleAddpatient();
    },
    resetQuery() {},
    resetQuery() {
      this.dateRange = [];
      // 查询参数
      this.queryParams = {
        pageNum: 1,
        pageSize: 10,
        userName: undefined,
        phonenumber: undefined,
        status: undefined,
        deptId: undefined,
      };
    },
    handleClosehz() {
      this.dialogVisiblepatient = false;
    },
@@ -1000,7 +1046,7 @@
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
    // 预览模版
    // 预览模板
    PreviewTemplate() {},
    Acknowledgereference() {
      this.quote = true;
@@ -1013,6 +1059,7 @@
          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");
@@ -1037,6 +1084,9 @@
          }
        });
      }
      getFollowupclassify({}).then((res) => {
        this.indexAssortlist = res.rows;
      });
    },
    // 获取科室列表
    listDept() {
@@ -1129,6 +1179,7 @@
      }
      this.form.sendTimeslot = combinedData;
      // 展示数据临时存储日期、早、中、晚
      console.log(this.daytime);
      this.form.showDate = this.daytime.join(",");
      if (this.time1) this.form.showTimeMorn = this.time1.join(",");
@@ -1136,18 +1187,21 @@
      if (this.time3) this.form.showTimeNight = this.time3.join(",");
      console.log(combinedData, "combinedData");
    },
    // 查看模版
    // 查看模板
    previewGo() {
      this.$router.push({
        path: "/knowledge/templateku/configurat/",
        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.ivrTaskScriptTargetoptionList =
        this.Tasktemplate.ivrLibaTemplateScriptVOList.ivrLibaScriptTargetoptionList;
      this.Tasktemplate.ivrLibaTemplateScriptVOList.forEach((item) => {
        item.ivrTaskScriptTargetoptionList = item.ivrLibaScriptTargetoptionList;
      });
      console.log(this.Tasktemplate.ivrLibaTemplateScriptVOList);
      this.Tasktemplate.ivrTaskTemplateScriptVOList =
        this.Tasktemplate.ivrLibaTemplateScriptVOList;
      this.Tasktemplate.ivrLibaTemplateTagList = null;
@@ -1164,7 +1218,7 @@
        this.form.libtemplateid = this.libId;
        this.form.templatename = this.libName;
        console.log(this.form.templatename, "ss");
        this.$modal.msgSuccess("选择模版成功", this.form.templatename);
        this.$modal.msgSuccess("选择模板成功", this.form.templatename);
      });
    },
    // 处理服务形式