WXL
2024-09-04 44fe7b7d69118a4d03bed8dadcf9b6bba1416f9d
src/views/patient/propaganda/QuestionnaireTask.vue
@@ -7,7 +7,7 @@
          <el-step
            icon="el-icon-edit"
            title="基础信息"
            description="选择模版、形式等基础信息"
            description="选择模板、形式等基础信息"
          ></el-step>
          <el-step
            icon="el-icon-user"
@@ -21,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">
          <!-- 基础信息 -->
@@ -40,23 +40,6 @@
                        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="任务描述">
@@ -167,6 +150,33 @@
                    >
                  </el-checkbox-group>
                </el-form-item>
                <el-row :gutter="20">
                  <el-col :span="10"
                    ><el-form-item label="模板名称">
                      <el-input
                        style="width: 300px"
                        :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-button
                    v-if="this.form.libtemplateid"
                      type="success"
                      icon="el-icon-search"
                      @click="previewfnmb"
                      circle
                    ></el-button>
                  </el-col>
                </el-row>
              </el-form>
            </div>
          </div>
@@ -376,7 +386,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
@@ -437,7 +447,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>
@@ -462,17 +472,10 @@
              label-width="98px"
            >
              <el-form-item label="问卷名称">
                <el-input
                  v-model="topqueryParams.name"
                ></el-input> </el-form-item
              ><el-form-item label="通知名称">
                <el-input v-model="topqueryParams.name"></el-input>
              </el-form-item>
              <el-form-item label="问卷主题">
                <el-input v-model="topqueryParams.name"></el-input>
                <el-input v-model="topqueryParams.svyname"></el-input>
              </el-form-item>
              <el-form-item label="问卷类型" prop="status">
              <!-- <el-form-item label="问卷类型" prop="status">
                <el-select v-model="topqueryParams.topic" placeholder="请选择">
                  <el-option
                    v-for="item in taskoptions"
@@ -482,7 +485,7 @@
                  >
                  </el-option>
                </el-select>
              </el-form-item>
              </el-form-item> -->
              <el-form-item label="适用形式" prop="status">
                <el-select v-model="topqueryParams.topica" placeholder="请选择">
                  <el-option
@@ -495,7 +498,7 @@
                </el-select>
              </el-form-item>
              <el-form-item label="适用科室" prop="status">
              <!-- <el-form-item label="适用科室" prop="status">
                <el-select v-model="topqueryParams.topicd" placeholder="请选择">
                  <el-option
                    v-for="item in topicoptions"
@@ -505,13 +508,13 @@
                  >
                  </el-option>
                </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
@@ -523,7 +526,7 @@
              </el-form-item>
            </el-form>
            <el-divider></el-divider>
            <!-- 选择模版列表 -->
            <!-- 选择模板列表 -->
            <SFtable
              @selectfn="selectfn"
              :currentList="userList"
@@ -572,13 +575,13 @@
      title: "宣教内容列表",
      currenttype: 1, //1宣教2门诊3出院4复诊5体检6问卷
      id: "", //
      previewid: "", //任务模版传递id
      previewid: "", //任务模板传递id
      libName: "",
      overallCase: [], //选择患者总
      allpids: [],
      libId: null, //模板库模版id
      libId: null, //模板库模板id
      Editprogress: 1, //编辑进度
      drawermb: false, //选择模版弹窗
      drawermb: false, //选择模板弹窗
      previewtf: false, //预览
      loading: false, // 遮罩层
      patientloading: false, // 遮罩层
@@ -656,7 +659,7 @@
      // 非多个禁用
      multiple: true,
      // 用户表格数据
      userList: [], //模版列表
      userList: [], //模板列表
      multiplechoice: [], //多选结果
      patientuserList: [], //选择患者列表
      sonuserList: [], //选中患者列表
@@ -726,6 +729,7 @@
        },
      ],
      quote: false,
      serviceType:null,
    };
  },
  components: { SFtable },
@@ -734,10 +738,18 @@
    this.id = this.$route.query.id;
    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.listDept();
    this.Acquisitiontype();
    this.Getdetails();
  },
  activated() {
    if (this.id != this.$route.query.id) {
      this.listDept();
      this.Acquisitiontype();
      this.Getdetails();
    }
  },
  methods: {
@@ -789,6 +801,10 @@
          {
            value: "2",
            label: "纸质",
          },
          {
            value: "5",
            label: "微信公众号",
          },
        ];
      } else if (this.form.serviceType == 6) {
@@ -842,8 +858,36 @@
            label: "微信小程序",
          },
        ];
      } else 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: "智能机器人",
          },
        ];
      }
      getQtemplatelist(queryParams).then((response) => {
      getQtemplatelist(this.topqueryParams).then((response) => {
        this.userList = response.rows;
        this.total = response.total;
      });
@@ -875,6 +919,7 @@
      if (!this.form.type) {
        this.form.type = this.$route.query.type;
      }
      this.form.serviceType=this.serviceType;
      Editsingletask(this.form).then((res) => {
        if (res.code == 200) {
          if (this.form.taskid) {
@@ -890,13 +935,13 @@
      });
    },
    // ----------------------表格子组件事件
    // 确认选择模版放入任务模版
    // 确认选择模板放入任务模板
    selectfn(row, type) {
      // 模版情况下获取模版信息
      // 模板情况下获取模板信息
      if (type == 1) {
        this.libName = row.svyname;
        this.libId = row.svyid;
        console.log(row, "row");
        this.Tasktemplate = row;
        this.questionList = row.svyTemplateLibScripts;
        this.previewtf = true;
@@ -905,6 +950,19 @@
      } else if (type == 2) {
      } else if (type == 3) {
      }
    },
    // 预览
    previewfnmb() {
      console.log(this.form);
      getQtemplatelist({ svyid: this.form.libtemplateid }).then((res) => {
        if (res.code == 200) {
          console.log();
          this.questionList = res.rows[0].svyTemplateLibScripts;
          this.previewtf = true;
        }
      });
    },
    // 处理问题层变量
    Variablehandling(arr, type) {
@@ -1045,6 +1103,12 @@
      this.handleAddpatient();
    },
    resetQuery() {},
    handleQuerymb() {
      getQtemplatelist(this.topqueryParams).then((response) => {
        this.userList = response.rows;
        this.total = response.total;
      });
    },
    handleClosehz() {
      this.dialogVisiblepatient = false;
    },
@@ -1056,20 +1120,27 @@
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
    // 预览模版
    // 预览模板
    PreviewTemplate() {},
    Acknowledgereference() {
      this.quote = true;
    },
    // 获取详情
    Getdetails() {
      this.form= {
        patTaskRelevances: [],
        sendType: 1,
        templatename: "",
        templateid: null,
        libtemplateid: null,
      };
      this.questionList=[];
      if (this.id) {
        Questionnairetaskget({ 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.patTaskRelevances = this.form.patTaskRelevances
              ? this.form.patTaskRelevances
              : [];
@@ -1192,7 +1263,7 @@
      if (this.time3) this.form.showTimeNight = this.time3.join(",");
      console.log(combinedData, "combinedData");
    },
    // 查看模版
    // 查看模板
    previewGo() {
      this.$router.push({
        path: "/knowledge/tpuconfigurat/",
@@ -1212,12 +1283,11 @@
      this.Tasktemplate.templateid = id;
      this.Tasktemplate.isoperation = 1;
      TaskQuestioncomit(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;
        this.$modal.msgSuccess("选择模版成功");
        this.$modal.msgSuccess("选择模板成功");
      });
    },
    // 处理服务形式