WXL (wul)
2 天以前 d54ac083e2992a5613f5cb22849db9742dbe9a9b
src/views/patient/propaganda/particty.vue
@@ -442,7 +442,7 @@
        <el-button type="success" @click="nextstep('ruleForm')">{{
          quote ? "立即创建" : "任务详情配置"
        }}</el-button>
        <el-button @click="resetForm('ruleForm')">重置</el-button>
        <!-- <el-button @click="resetForm('ruleForm')">重置</el-button> -->
      </div>
      <!-- 任务详情 -->
      <div v-if="Editprogress == 2">
@@ -523,10 +523,13 @@
          </div>
        </div>
        <el-button type="primary" @click="laststep()">上一步</el-button>
        <el-button type="success" @click="submitForm('11')">{{
          quote ? "立即创建" : "确认任务配置"
        }}</el-button>
        <el-button @click="resetForm('ruleForm')">重置</el-button>
        <el-button
          :loading="submitLoading"
          type="success"
          @click="submitForm('11')"
          >{{ quote ? "立即创建" : "确认任务配置" }}</el-button
        >
        <!-- <el-button @click="resetForm('ruleForm')">重置</el-button> -->
      </div>
    </div>
    <!-- 添加患者 -->
@@ -934,6 +937,7 @@
      libName: "",
      username: "",
      templateor: false,
      submitLoading: false, // 控制按钮加载状态
      objyl: {},
      overallCase: [], //选择患者总
      allpids: [],
@@ -981,6 +985,7 @@
        { label: "电话号码", width: "180", prop: "telcode" },
        { label: "性别", width: "", prop: "sex" },
        { label: "年龄", width: "", prop: "age" },
        { label: "电话", width: "180", prop: "telcode" },
        { label: "责任护士", width: "", prop: "nurseName" },
        { label: "主治医生", width: "", prop: "drname" },
        { label: "科室", width: "240", prop: "dept" },
@@ -994,6 +999,7 @@
        { label: "电话号码", width: "180", prop: "telcode" },
        { label: "性别", width: "", prop: "sex" },
        { label: "年龄", width: "", prop: "age" },
        { label: "电话", width: "180", prop: "telcode" },
        { label: "出院天数", width: "", prop: "endDay" },
        { label: "责任护士", width: "", prop: "nurseName" },
        { label: "主治医生", width: "", prop: "drname" },
@@ -1435,105 +1441,120 @@
    },
    // 保存
    submitForm(type) {
      if (this.templateor && type) this.templateor = false;
      if (this.time4 && this.form.sendType == 3)
        this.form.showTimeMorn = this.time4;
      this.form.sendTimeslot = [
        {
          begantime: this.time4,
          endtime: "",
          xh: 1,
        },
      ];
      if (this.form.appltype == 1) {
        this.leavehospitaldistrictcodes = [];
        this.operationcodes = [];
        this.illnesscodes = [];
      } else if (this.form.appltype == 2) {
        this.deptcodesWards = [];
        this.operationcodes = [];
        this.illnesscodes = [];
      } else if (this.form.appltype == 3) {
        this.deptcodesWards = [];
        this.leavehospitaldistrictcodes = [];
        this.operationcodes = [];
      } else if (this.form.appltype == 4) {
        this.deptcodesWards = [];
        this.illnesscodes = [];
        this.leavehospitaldistrictcodes = [];
      }
      if (this.checkList) {
        this.form.preachform = this.checkList.join(",");
        this.form.preachformList = this.selectedOrder;
      } else {
        this.$modal.msgError("请选择服务类型");
      if (this.submitLoading) {
        return;
      }
      if (
        this.deptcodesWards[0] ||
        this.leavehospitaldistrictcodes[0] ||
        this.diagglist[0] ||
        this.operationcodes[0] ||
        this.form.longTask == 2 ||
        this.serviceType == 14
      ) {
      } else {
        this.$modal.msgError("请选择任务关联条件");
        return;
      }
      // if (!this.form.patTaskRelevances[0] && !this.form.longTask) {
      //   this.$modal.msgError("请选择病人");
      //   return;
      // }
      if (!this.form.templatename && !this.templateor) {
        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 !== "地址"
      );
      this.form.textParam = this.convertFormat2ToFormat1(filteredArray);
      if (this.form.taskid) {
        this.form.isoperation = 2;
      } else {
        this.form.isoperation = 1;
      }
      if (!this.form.type) {
        this.form.type = this.$route.query.type;
      }
      this.form.serviceType = this.serviceType;
      this.form.deptcode = this.deptcodesWards.join(",");
      this.form.leavehospitaldistrictcode =
        this.leavehospitaldistrictcodes.join(",");
      this.form.opcode = this.operationcodes.join(",");
      this.form.icd10code = this.diagglist
        .map((item) => item.icdcode)
        .join(",");
      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 },
          });
      // 第二步:开启加载状态,禁用按钮
      this.submitLoading = true;
      try {
        if (this.templateor && type) this.templateor = false;
        if (this.time4 && this.form.sendType == 3)
          this.form.showTimeMorn = this.time4;
        this.form.sendTimeslot = [
          {
            begantime: this.time4,
            endtime: "",
            xh: 1,
          },
        ];
        if (this.form.appltype == 1) {
          this.leavehospitaldistrictcodes = [];
          this.operationcodes = [];
          this.illnesscodes = [];
        } else if (this.form.appltype == 2) {
          this.deptcodesWards = [];
          this.operationcodes = [];
          this.illnesscodes = [];
        } else if (this.form.appltype == 3) {
          this.deptcodesWards = [];
          this.leavehospitaldistrictcodes = [];
          this.operationcodes = [];
        } else if (this.form.appltype == 4) {
          this.deptcodesWards = [];
          this.illnesscodes = [];
          this.leavehospitaldistrictcodes = [];
        }
      });
        if (this.checkList) {
          this.form.preachform = this.checkList.join(",");
          this.form.preachformList = this.selectedOrder;
        } else {
          this.$modal.msgError("请选择服务类型");
          return;
        }
        if (
          this.deptcodesWards[0] ||
          this.leavehospitaldistrictcodes[0] ||
          this.diagglist[0] ||
          this.operationcodes[0] ||
          this.form.longTask == 2 ||
          this.serviceType == 3
        ) {
        } else {
          this.$modal.msgError("请选择任务关联条件");
          return;
        }
        // if (!this.form.patTaskRelevances[0] && !this.form.longTask) {
        //   this.$modal.msgError("请选择病人");
        //   return;
        // }
        if (!this.form.templatename && !this.templateor) {
          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 !== "地址"
        );
        this.form.textParam = this.convertFormat2ToFormat1(filteredArray);
        if (this.form.taskid) {
          this.form.isoperation = 2;
        } else {
          this.form.isoperation = 1;
        }
        if (!this.form.type) {
          this.form.type = this.$route.query.type;
        }
        this.form.serviceType = this.serviceType;
        this.form.deptcode = this.deptcodesWards.join(",");
        this.form.leavehospitaldistrictcode =
          this.leavehospitaldistrictcodes.join(",");
        this.form.opcode = this.operationcodes.join(",");
        this.form.icd10code = this.diagglist
          .map((item) => item.icdcode)
          .join(",");
        Editsingletask(this.form).then((res) => {
          if (res.code == 200) {
            if (this.form.taskid) {
              this.$modal.msgSuccess("修改成功");
            } else {
              this.$modal.msgSuccess("新增成功");
            }
            this.submitLoading = false;
            this.$router.push({
              path: "/followvisit/tasklist",
              query: { tasktopic: this.form.serviceType },
            });
          }
        });
      } catch (error) {
        this.submitLoading = false;
      } finally {
        // 第四步:无论成功或失败,最终都关闭加载状态
      }
    },
    // ----------------------表格子组件事件
@@ -1645,6 +1666,7 @@
          { label: "电话号码", width: "180", prop: "telcode" },
          { label: "性别", width: "", prop: "sex" },
          { label: "年龄", width: "", prop: "age" },
          { label: "电话", width: "180", prop: "telcode" },
          { label: "出院天数", width: "", prop: "endDay" },
          { label: "责任护士", width: "", prop: "nurseName" },
          { label: "医生", width: "", prop: "drname" },
@@ -1659,6 +1681,7 @@
          { label: "电话号码", width: "180", prop: "telcode" },
          { label: "性别", width: "", prop: "sex" },
          { label: "年龄", width: "", prop: "age" },
          { label: "电话", width: "180", prop: "telcode" },
          { label: "出院天数", width: "", prop: "endDay" },
          { label: "责任护士", width: "", prop: "nurseName" },
          { label: "医生", width: "", prop: "drname" },
@@ -1673,6 +1696,7 @@
          { label: "电话号码", width: "180", prop: "telcode" },
          { label: "性别", width: "", prop: "sex" },
          { label: "年龄", width: "", prop: "age" },
          { label: "电话", width: "180", prop: "telcode" },
          { label: "出院天数", width: "", prop: "endDay" },
          { label: "责任护士", width: "", prop: "nurseName" },
          { label: "医生", width: "", prop: "drname" },