WXL
2024-06-12 b33fce1b1bbad04a2a6b4812e0fb438b8a52b8e5
src/views/patient/propaganda/particty.vue
@@ -69,7 +69,8 @@
                <el-form-item label="发送设置:" v-if="currenttype != 2">
                  <el-radio-group v-model="form.sendType">
                    <el-radio :label="1">时间段发送</el-radio>
                    <el-radio :label="3">即刻发送</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">
@@ -84,6 +85,22 @@
                  >
                  </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">
@@ -780,12 +797,24 @@
        { label: "匹配符", width: "", prop: "character" },
        { label: "替换值", width: "", prop: "Replacementvalue" },
      ],
      preachform: [
        { label: "多媒体", value: 1 },
        { label: "纸质", value: 2 },
        { label: "电话", value: 3 },
        { label: "短信", value: 4 },
        { label: "微信公众号", value: 5 },
        { label: "微信小程序", value: 6 },
        { label: "支付宝", value: 7 },
        { label: "智能小程序", value: 8 },
        { label: "钉钉", value: 9 },
      ],
      // 时间处理
      daytime: [], //日期
      applydaytime: [], //计算日期
      time1: "", //上午时间段
      time2: "", //下午时间段
      time3: "", //晚上时间段
      time4: "", //晚上时间段
      topqueryParams: {
        pageNum: 1, //
        pageSize: 10,
@@ -859,7 +888,6 @@
      tasktopic: null, //新增类型
      SelectPatientslist: [],
      form: {
        serviceform: [],
        patTaskRelevances: [],
        sendType: 1,
        templatename: "",
@@ -935,10 +963,7 @@
        // 医技宣教,普通宣教
        this.title = "宣教内容列表";
        this.tableLabel = this.tableLabelxj;
        this.checkboxlist = [
          "线下(口头宣教、电视宣教、纸质)",
          "线上(短信/钉钉的文本、图文链接)",
        ];
        this.checkboxlist = ["多媒体", "纸质"];
        getlibrarylist(queryParams).then((response) => {
          this.userList = response.rows;
          this.total = response.total;
@@ -951,7 +976,7 @@
        // 出院、门诊、专病随访
        this.title = "随访内容列表";
        this.tableLabel = this.tableLabelmz;
        this.checkboxlist = ["线下", "AI语音外呼", "人工电话"];
        this.checkboxlist = ["纸质", "多媒体", "电话", "微信公众号"];
        getFollowuplist(queryParams).then((response) => {
          this.userList = response.rows;
          this.total = response.total;
@@ -985,7 +1010,8 @@
    },
    // 保存
    submitForm(formName) {
      this.form.serviceform = this.checkList.join(",");
      // this.form.preachform = this.checkList.join(",");
      this.formatFn(1);
      this.form.hospType = this.currenttype;
      const filteredArray = this.variableList.filter(
        (item) =>
@@ -1078,8 +1104,12 @@
      this.overallCase.forEach((item) => {
        this.allpids.push(item.patid);
      });
      this.patientqueryParams.pids = this.allpids;
      console.log(this.patientqueryParams.pids);
      if (this.allpids[0]) {
        this.patientqueryParams.pids = this.allpids;
        console.log(this.patientqueryParams.pids);
      } else {
        this.patientqueryParams.pids = null;
      }
      getTaskpatient(this.patientqueryParams).then((response) => {
        console.log(response);
@@ -1177,19 +1207,26 @@
      if (this.id) {
        getTaskInfo({ taskid: this.id }).then((res) => {
          let filteredArray = "";
          console.log(2233);
          if (res.code == 200) {
            this.form = res.data;
            this.overallCase = this.form.patTaskRelevances.concat();
            this.checkList = this.form.serviceform.split(",");
            this.formatFn(2);
            console.log(this.form.showDate, "this.form");
            this.daytime = this.form.showDate.split(",");
            if (this.form.showTimeMorn)
              this.time1 = this.form.showTimeMorn.split(",");
            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);
            console.log(filteredArray, "filteredArray");
            this.variableList = this.transitionList.concat(filteredArray);
          } else {
            this.$modal.msgError(res.code);
@@ -1224,6 +1261,12 @@
    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) {
      const startDate = new Date(row[0]);
@@ -1314,6 +1357,35 @@
        this.$modal.msgSuccess("选择模版成功");
      });
    },
    // 处理服务形式
    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>