qianxj
2023-03-21 a8c0f417a9cc2e7d683947b270114ba88b2213af
update svytopic
已修改1个文件
112 ■■■■■ 文件已修改
ruoyi-ui/src/smartor/dataobject/dw_svytopic_maint.vue 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/smartor/dataobject/dw_svytopic_maint.vue
@@ -69,61 +69,83 @@
  </div>
</template>
<script>
import { listSvytopic, getSvytopic, delSvytopic, addSvytopic, updateSvytopic } from "@/api/smartor/svytopic";
export default {
  components: {},
  props: [],
  name: "SvytopicBase",
  dicts: ['sys_yes_no'],
  data() {
    return {
      formData: {
        field101: undefined,
      },
      total: 0,
      // 弹出层标题
      title: "",
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        field101: [{
          required: true,
          message: '请选择下拉选择',
          trigger: 'change'
        }],
      },
      field101Options: [{
        "label": "单选项",
        "value": 1
      },
      {
        "label": "多选项",
        "value": 2
      },
      {
        "label": "直接填写",
        "value": 3
      },
      {
        "label": "日期范围",
        "value": 4
      },
      {
        "label": "数值范围",
        "value": 5
      }
        delFlag: [
          { required: true, message: " 删除标记 不能为空", trigger: "change" }
        ],
        isupload: [
          { required: true, message: " 上传标记 不能为空", trigger: "change" }
      ],
    }
    };
  },
  computed: {},
  watch: {},
  created() { },
  mounted() { },
  created() {
  },
  methods: {
    submitForm1() {
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    // 表单重置
    reset() {
      this.form = {
        topicid: null,
        oldid: null,
        svyid: null,
        topictype: null,
        topiccode: null,
        topic: null,
        sort: null,
        ismandatory: null,
        ishide: null,
        delFlag: null,
        orgid: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        isupload: null,
        uploadTime: null
      };
      this.resetForm("form");
    },
    resetForm1() {
      this.$refs['elForm'].resetFields()
     /** 修改按钮操作 */
    Retrieve(topicid) {
      this.reset();
      getSvytopic(topicid).then(response => {
        this.form = response.data;
        this.title = "修改问卷题目";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.topicid != null) {
            updateSvytopic(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addSvytopic(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
  }
}
      });
    },
  }
};
</script>
<style></style>