WXL
2024-04-15 e98f65f2a02e82b02d327506d592564f78f4ecf7
src/views/patient/propaganda/particty.vue
@@ -11,8 +11,8 @@
          ></el-step>
          <el-step
            icon="el-icon-user"
            title="宣教对象"
            description="在本部选择宣教病人"
            title="任主体"
            description="在本部选择服务患者"
          ></el-step>
          <el-step icon="el-icon-user" title="模版确认"></el-step>
        </el-steps>
@@ -49,10 +49,7 @@
                    <el-radio :label="3">即刻发送</el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item
                  label="发送日期:"
                  v-if="currenttype != 2 && form.sendType == 1"
                >
                <el-form-item label="发送日期:" v-if="form.sendType == 1">
                  <el-date-picker
                    v-model="daytime"
                    @change="changeTimeday"
@@ -64,10 +61,7 @@
                  >
                  </el-date-picker>
                </el-form-item>
                <el-form-item
                  label="发送时间段:"
                  v-if="currenttype != 2 && form.sendType == 1"
                >
                <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"
@@ -75,6 +69,7 @@
                      >
                      <el-time-picker
                        is-range
                        arrow-control
                        @change="changeTime"
                        v-model="time1"
                        range-separator="至"
@@ -91,6 +86,7 @@
                      >
                      <el-time-picker
                        is-range
                        arrow-control
                        @change="changeTime"
                        v-model="time2"
                        range-separator="至"
@@ -107,6 +103,7 @@
                      >
                      <el-time-picker
                        is-range
                        arrow-control
                        @change="changeTime"
                        v-model="time3"
                        range-separator="至"
@@ -334,21 +331,18 @@
                <el-row :gutter="20">
                  <el-table :data="variableList" style="width: 100%">
                    <el-table-column
                      prop="variablename"
                      prop="name"
                      align="center"
                      label="变量名称"
                    >
                    </el-table-column>
                    <el-table-column
                      prop="character"
                      align="center"
                      label="匹配符"
                    >
                    <el-table-column prop="value" align="center" label="匹配符">
                    </el-table-column>
                    <el-table-column label="替换值" align="center">
                      <template slot-scope="scope">
                        <el-input
                          v-model="scope.row.Replacementvalue"
                          :disabled="scope.row.default"
                          v-model="scope.row.fill"
                          placeholder="请输入内容"
                        ></el-input>
                      </template>
@@ -650,11 +644,12 @@
  getlibrarylist,
  getFollowuplist,
  getQtemplatelist,
  edithetask,
  getTaskInfo,
  addhetask,
  gethetaskinfo,
  delhetaskinfo,
  Editsingletask,
  getvFollowup,
} from "@/api/AiCentre/index";
import SFtable from "@/components/SFtable"; //表格组件
@@ -687,38 +682,38 @@
        { label: "宣教描述", width: "", prop: "note" },
        { label: "宣教形式", width: "", prop: "playType" },
        { label: "适用方式", width: "", prop: "suitway" },
        { label: "创建日期", width: "", prop: "uploadTime" },
        { label: "修改日期", width: "", prop: "uploadTime" },
        { label: "创建人(缺)", width: "", prop: "update_by" },
      ],
      tableLabelmz: [
        { label: "随访名称", width: "118", prop: "templateName" },
        { label: "随访模版", width: "130", prop: "impTemplate" },
        { label: "创建日期", width: "136", prop: "uploadTime" },
        { label: "创建人(缺)", width: "130", prop: "update_by" },
        { label: "随访名称", width: "", prop: "templateName" },
        { label: "主要内容", width: "", prop: "note" },
        { label: "修改日期", width: "", prop: "updateTime" },
        { label: "创建人(缺)", width: "", prop: "update_by" },
      ],
      tableLabelcy: [
        { label: "随访名称", width: "118", prop: "templateName" },
        { label: "随访计划", width: "130", prop: "impTemplate" },
        { label: "创建日期", width: "136", prop: "uploadTime" },
        { label: "创建人(缺)", width: "130", prop: "update_by" },
        { label: "随访名称", width: "", prop: "templateName" },
        { label: "随访计划", width: "", prop: "impTemplate" },
        { label: "修改日期", width: "", prop: "uploadTime" },
        { label: "创建人(缺)", width: "", prop: "update_by" },
      ],
      tableLabelfz: [
        { label: "通知名称", width: "118", prop: "templateName" },
        { label: "通知模版", width: "130", prop: "impTemplate" },
        { label: "创建日期", width: "136", prop: "uploadTime" },
        { label: "创建人(缺)", width: "130", prop: "update_by" },
        { label: "通知名称", width: "", prop: "templateName" },
        { label: "通知模版", width: "", prop: "impTemplate" },
        { label: "修改日期", width: "", prop: "uploadTime" },
        { label: "创建人(缺)", width: "", prop: "update_by" },
      ],
      tableLabeltj: [
        { label: "通知名称", width: "118", prop: "name" },
        { label: "通知模版", width: "130", prop: "impTemplate" },
        { label: "创建日期", width: "136", prop: "uploadTime" },
        { label: "创建人(缺)", width: "130", prop: "update_by" },
        { label: "通知名称", width: "", prop: "name" },
        { label: "通知模版", width: "", prop: "impTemplate" },
        { label: "修改日期", width: "", prop: "uploadTime" },
        { label: "创建人(缺)", width: "", prop: "update_by" },
      ],
      tableLabelwj: [
        { label: "问卷名称", width: "118", prop: "name" },
        { label: "问卷模版", width: "130", prop: "impTemplate" },
        { label: "创建日期", width: "136", prop: "uploadTime" },
        { label: "创建人(缺)", width: "130", prop: "update_by" },
        { label: "问卷名称", width: "", prop: "name" },
        { label: "问卷模版", width: "", prop: "impTemplate" },
        { label: "修改日期", width: "", prop: "uploadTime" },
        { label: "创建人(缺)", width: "", prop: "update_by" },
      ],
      // 变量
      tableLabelvariable: [
@@ -762,21 +757,44 @@
      sonuserList: [], //选中患者列表
      variableList: [
        {
          variablename: "姓名",
          character: "${name}",
          Replacementvalue: "龙傲天",
          name: "姓名",
          value: "${name}",
          fill: "派发时自动匹配",
          default: true,
        },
        {
          variablename: "地址",
          character: "${dzz}",
          Replacementvalue: "龙宫",
          name: "地址",
          value: "${dzz}",
          fill: "派发时自动匹配",
          default: true,
        },
        {
          variablename: "电话",
          character: "${dhh}",
          Replacementvalue: "八个八",
          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: [],
@@ -809,8 +827,7 @@
  created() {
    this.id = this.$route.query.id;
    this.form.type = this.$route.query.type;
    this.Addsubtask();
    this.Getsubtask();
    this.Getdetails();
    this.Acquisitiontype();
  },
@@ -930,17 +947,19 @@
    // 保存
    submitForm(formName) {
      this.form.serviceform = this.checkList.join(",");
      this.form.textParam = {
        姓名: { "${name}": "龙傲天" },
        地址: { "${dzz}": "龙宫" },
        电话: { "${dhh}": "八个八" },
      };
      const filteredArray = this.variableList.filter(
        (item) =>
          item.name !== "姓名" && item.name !== "电话" && item.name !== "地址"
      );
      console.log(filteredArray, "存前变量");
      this.form.textParam = this.convertFormat2ToFormat1(filteredArray);
      if (this.form.id) {
        this.form.isoperation = 2;
      } else {
        this.form.isoperation = 1;
      }
      Editsingletask(this.form).then((response) => {
      Editsingletask(this.form).then((res) => {
        if (res.code == 200) {
          if (this.form.id) {
            this.$modal.msgSuccess("新增成功");
@@ -961,15 +980,60 @@
      // });
    },
    // ----------------------表格子组件事件
    // 选择
    // 选择模版
    selectfn(row, type) {
      console.log(row);
      console.log(type);
      // 模版情况下获取模版信息
      if (type == 1) {
        this.form.templatename = row.preachname;
        this.form.templateid = row.templateid;
        if (
          this.currenttype == 2 ||
          this.currenttype == 4 ||
          this.currenttype == 3
        ) {
          this.form.templatename = row.templateName;
          this.form.templateid = row.id;
        } else if (this.currenttype == 1) {
          this.form.templatename = row.preachname;
          this.form.templateid = row.id;
        }
        getvFollowup({ id: row.id }).then((res) => {
          if (res.code == 200) {
            const data = res.data;
            this.Variablehandling(data.ivrLibaTemplateScriptVOList, 1);
          }
        });
      } else if (type == 2) {
      } else if (type == 3) {
      }
    },
    // 处理问题层变量
    Variablehandling(arr, type) {
      let Variablist = [];
      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,
              });
            }
          });
        });
        console.log(Variablist, "Variablist");
        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);
        // this.form.textParam = this.convertFormat2ToFormat1(this.variableList);
      }
    },
    // 子任务二级弹框
@@ -1014,12 +1078,22 @@
    Acknowledgereference() {
      this.quote = true;
    },
    // 新增子任务
    Addsubtask() {
      this.topqueryParams.pguid = 2;
      // addsvr_prjtask(this.topqueryParams).then((res) => {
      //   console.log(res);
      // });
    // 获取详情
    Getdetails() {
      if (this.id) {
        getTaskInfo({ taskid: this.id }).then((res) => {
          const filteredArray = "";
          if (res.code == 200) {
            this.form = res.data;
            this.checkList = this.form.serviceform.split(",");
            filteredArray = this.convertFormat1ToFormat2(this.form.textParam);
            this.variableList = this.transitionList.concat(filteredArray);
          } else {
            this.$modal.msgError(res.code);
          }
          console.log(res);
        });
      }
    },
    // 新增派送患者
    AddDispatchpatients() {
@@ -1030,16 +1104,6 @@
      this.dialogVisiblepatient = false;
    },
    // 查询子任务列表
    Getsubtask() {
      this.topqueryParams.pguid = 2;
      console.log(this.topqueryParams, "aa");
      messagelistpatient(this.topqueryParams).then((res) => {
        this.userList = res.rows;
        this.total = res.total;
        console.log(this.userList, "ss");
      });
    },
    // 变量---------------
    variableEdit(index, row) {
      console.log(index, row);
@@ -1105,6 +1169,11 @@
        }
      }
      this.form.sendTimeslot = combinedData;
      // 展示数据临时存储日期、早、中、晚
      this.form.sendlimitabegin = this.daytime.join(",");
      this.form.sendlimitaend = this.time1.join(",");
      this.form.sendlimitnbegin = this.time2.join(",");
      this.form.sendlimitnend = this.time3.join(",");
      console.log(combinedData, "combinedData");
    },
  },