yxh
yxh
2023-03-24 8b50c0466a9453472871da617abc647c39b903dc
ruoyi-ui/src/views/smartor/svytopicoption/index.vue
@@ -5,7 +5,7 @@
        <el-input v-model="queryParams.optioncontent" placeholder="请输入 选项内容 " clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=" 归宿机构 " prop="orgid">
      <el-form-item label=" 归属机构 " prop="orgid">
        <el-input v-model="queryParams.orgid" placeholder="请输入 机构ID " clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item>
@@ -36,13 +36,20 @@
    <el-table v-loading="loading" :data="svytopicoptionList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label=" 题目类型 " width="150" align="center" prop="topictype" />
      <el-table-column label=" 适用题目类型 " width="150" align="center" prop="topictype">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.svy_topictype" :value="scope.row.topictype" />
        </template></el-table-column>
      <el-table-column label=" 选项内容 " width="200" align="center" prop="optioncontent" />
      <el-table-column label=" 提示 " width="200" align="center" prop="prompt" />
      <el-table-column label=" 分数 " width="55" align="center" prop="score" />
      <el-table-column label=" 验证规则 " width="250" align="center" prop="verifyrule" />
      <el-table-column label=" 是否存在明细 " width="150" align="center" prop="isexistdetail" />
      <el-table-column label=" 归属机构 " width="200" align="center" prop="orgid" />
      <el-table-column label=" 所属院区 " width="200" align="center" prop="orgid">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_patientfrom" :value="scope.row.orgid" />
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
@@ -149,9 +156,11 @@
<script>
import { listSvytopicoption, getSvytopicoption, delSvytopicoption, addSvytopicoption, updateSvytopicoption } from "@/api/smartor/svytopicoption";
import maintdlg from  "@/smartor/dataobject/dw_svytopicoption_maint.vue";
export default {
  name: "Svytopicoption",
  dicts: ['svy_topictype'],
  data() {
    return {
      // 遮罩层
@@ -168,11 +177,7 @@
      total: 0,
      // 问卷问题选项表格数据
      svytopicoptionList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
       // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
@@ -202,21 +207,17 @@
        isupload: null,
        uploadTime: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        delFlag: [
          { required: true, message: " 删除标记 不能为空", trigger: "blur" }
        ],
        isupload: [
          { required: true, message: " 上传标记 不能为空", trigger: "blur" }
        ],
      }
    };
  },
  components:
  {
    maintdlg: maintdlg //()=>import("@/smartor/dataobject/dw_svytopicoption_maint")
  },
  created() {
    this.getList();
     this.getList();
   },
  mounted() {
  },
  methods: {
    /** 查询问卷问题选项列表 */
@@ -227,48 +228,6 @@
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        optionid: null,
        topicid: null,
        svyid: null,
        topictype: null,
        optioncode: null,
        optioncontent: null,
        isexistdetail: null,
        detailismandatory: null,
        isexceptionitem: null,
        istrack: null,
        score: null,
        prompt: null,
        jump: null,
        parentoptionid: null,
        ismutex: null,
        verifyrule: null,
        sort: null,
        verificationtype: null,
        isrange: null,
        minrange: null,
        maxrange: null,
        rangelength: null,
        orgid: null,
        oldid: null,
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        isupload: null,
        uploadTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
@@ -288,40 +247,16 @@
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加问卷问题选项";
      this.$refs["maint"].handleUpdate(null)
      return
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const optionid = row.optionid || this.ids
      getSvytopicoption(optionid).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改问卷问题选项";
      });
      this.$refs["maint"].handleUpdate(optionid)
      return
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.optionid != null) {
            updateSvytopicoption(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addSvytopicoption(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const optionids = row.optionid || this.ids;