qinxianzhangyao
2024-05-30 f4e73f262cd8fe054b84d5e99f083fba913e7c94
src/views/hosp/surveyTemplate/index.vue
@@ -47,9 +47,20 @@
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate1"
          v-hasPermi="['hosp:surveyTemplate:edit']"
          >标题修改
        </el-button>
      </el-col>
      <el-col :span="1.5" v-if="details">
        <el-button
          type="primary"
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['hosp:surveyTemplate:edit']"
          >修改
          >详情修改
        </el-button>
      </el-col>
      <el-col :span="1.5">
@@ -194,7 +205,7 @@
            />
          </el-select>
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" placeholder="请输入备注" />
        </el-form-item>
@@ -204,8 +215,8 @@
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
     <!-- 问卷详情抽屉 -->
     <el-drawer
    <!-- 问卷详情抽屉 -->
    <el-drawer
      title="问卷详情"
      :visible.sync="drawer"
      :with-header="true"
@@ -308,7 +319,7 @@
  getneedDesign,
  getcanDelete,
  updateQybz,
  getQuesByMid
  getQuesByMid,
} from "@/api/hosp/surveyTemplate";
import { Message } from "element-ui";
export default {
@@ -332,12 +343,12 @@
      }
    };
    return {
      inpu:"",
      inpu: "",
      num: 0,
      myscore: null,
      // 遮罩层
      loading: true,
      drawer:false,
      drawer: false,
      previewKey: +new Date(),
      previewDialogVisible: false,
      // 选中数组
@@ -363,6 +374,7 @@
      // 是否显示弹出层
      open: false,
      DaTianYa: false,
      details: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
@@ -437,9 +449,21 @@
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      console.log(selection);
      this.ids = selection.map((item) => item.mid);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
      if (selection.length != 0) {
        selection.forEach((item) => {
          if (item.designId != null) {
            this.details = true;
          } else {
            this.details = false;
          }
        });
      } else {
        this.details = false;
      }
    },
    handleTjSurveyTempQuesSelectionChange(selection) {
      this.selectionList = [];
@@ -449,7 +473,7 @@
    handleAdd() {
      this.reset();
      this.title = "添加问卷模板";
      getneedDesign().then((res) => {
        if (res.msg == "false") {
          this.DaTianYa = false;
@@ -504,19 +528,18 @@
        if (response.data.designId == null) {
          this.drawer = true;
          getQuesByMid(mid)
          .then((res) => {
            res.data.sort(
              (a, b) =>
                new Date(a.createTime).getTime() -
                new Date(b.createTime).getTime()
            ); //这是升序,倒序的话翻过来
            this.intList = res.data;
          })
          .catch((err) => {
            // 通过catch捕获错误消息
            return err;
          });
            .then((res) => {
              res.data.sort(
                (a, b) =>
                  new Date(a.createTime).getTime() -
                  new Date(b.createTime).getTime()
              ); //这是升序,倒序的话翻过来
              this.intList = res.data;
            })
            .catch((err) => {
              // 通过catch捕获错误消息
              return err;
            });
        } else {
          this.$router.push({
            query: { key: response.data.designId },
@@ -546,7 +569,6 @@
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const mid = row.mid || this.ids;
      getSurveyTemplate(mid).then((response) => {
        this.form = response.data;
@@ -563,6 +585,21 @@
          this.form.type = 1;
          this.toProjectHandle(this.form, "editor");
        }
      });
    },
    /** 修改按钮操作 */
    handleUpdate1(row) {
      this.reset();
      const mid = row.mid || this.ids;
      getSurveyTemplate(mid).then((response) => {
        this.form = response.data;
        if (response.data.tjSurveyTempQuesList.length >= 1) {
          this.form.tjSurveyTempQuesList = response.data.tjSurveyTempQuesList;
        }
        this.DaTianYa = false;
        this.title = "修改问卷模板";
        this.open = true;
      });
    },
    /** 提交按钮 */
@@ -582,7 +619,6 @@
              } else {
                this.toProjectHandle(response.data, "editor");
              }
              this.open = false;
              this.getList();
            });