HandleForm.vue 9.02 KB
<template>
    <el-dialog
      title="巡查处理"
      :close-on-click-modal="false"
      :visible.sync="visible"
      class="NCC-dialog NCC-dialog_center"
      lock-scroll
      width="60%"
      v-loading="loading"
    >
      <el-row :gutter="15" class="NCC-dialog-content">
        <el-col :span="10" style="border-right: 1px solid #e6e6e6; height: 400px;">
            <el-row>
              <el-col :span="24" class="form_title"> 巡查上报详情 </el-col>
              <el-col :span="24">
                <div class="form-item">
                  <div class="label w-100">问题来源:</div>
                  {{ dataForm.reportSourceName || "--" }}
                </div>
              </el-col>
              <el-col :span="24">
                <div class="form-item">
                  <div class="label w-100">应用名称:</div>
                  {{ dataForm.platformNameStr || "--" }}
                </div>
              </el-col>
              <el-col :span="24">
                <div class="form-item">
                  <div class="label w-100">应用类型:</div>
                  {{ dataForm.platformTypeStr || "--" }}
                </div>
              </el-col>
              <el-col :span="24">
                <div class="form-item">
                  <div class="label w-100">问题类型:</div>
                  {{ dataForm.questionType || "--" }}
                </div>
              </el-col>
              <template v-if="dataForm.questionType == '错误表述'">
                <el-col :span="24">
                  <div class="form-item">
                    <div class="label w-100">正确描述:</div>
                    {{ dataForm.accurateDescription || "--" }}
                  </div>
                </el-col>
                <el-col :span="24">
                  <div class="form-item">
                    <div class="label w-100">错误描述:</div>
                    {{ dataForm.incorrectDescription || "--" }}
                  </div>
                </el-col>
              </template>
              <el-col :span="24">
                <div class="form-item">
                  <div class="label w-100">问题内容:</div>
                  {{ dataForm.questionContent || "--" }}
                </div>
              </el-col>
              <el-col :span="24">
                <div class="form-item">
                  <div class="label w-100">关键词</div>
                  {{ dataForm.questionClass || "--" }}
                </div>
              </el-col>
              <el-col :span="24">
                <div class="form-item">
                  <div class="label w-100">研判意见:</div>
                  {{ dataForm.judgmentOpinions || "--" }}
                </div>
              </el-col>
            </el-row>
        </el-col>
        <el-col :span="14">
          <el-row>
            <el-col :span="24" class="form_title"> 巡查处理 </el-col>
            <el-form
              ref="suggestionForm"
              :rules="rules"
              :model="suggestionForm"
              size="small"
              label-width="100px"
              label-position="right"
            >
              <el-col :span="24">
                <el-form-item label="处理结果" prop="disposalSuggestions">
                  <el-input
                    v-model="suggestionForm.disposalSuggestions"
                    placeholder="请输入处理结果"
                    show-word-limit
                    :style="{ width: '100%' }"
                    type="textarea"
                    :autosize="{ minRows: 4, maxRows: 4 }"
                    maxlength="200"
                  >
                  </el-input>
                </el-form-item>
              </el-col>
            </el-form>
          </el-row>
        </el-col>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="visible = false">取 消</el-button>
        <el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading">确 定</el-button>
      </span>
    </el-dialog>
  </template>
  <script>
  import request from "@/utils/request";
  import infoMixin from "@/mixins/info";
  import { dynamicText } from "@/filters/index";
  import { getDictionaryDataSelector } from "@/api/systemData/dictionary";
  import { getDetail, disposalSuggestions } from "@/api/systemData/dataInterface";
  export default {
    components: {},
    mixins: [infoMixin], 
    props: [],
    data() {
      return {
        loading: true,
        visible: false,
        isDetail: true,
        dataForm: {
          id: undefined,
          platformName: undefined,
          platformType: undefined,
          questionType: undefined,
          questionClass: undefined,
          questionContent: undefined,
          link: undefined,
          obtainEvidence: [],
          annex: [],
        },
        sourceOptions: [
          { fullName: "市网信办线索", id: "市网信办线索" },
          { fullName: "自主巡查发现", id: "自主巡查发现" },
        ],
        platformTypeOptions: [],
        questionTypeOptions: [],
        questionClassOptions: [
          { fullName: "选项一", id: "1" },
          { fullName: "选项二", id: "2" },
        ],
        stageOptions: [
          { fullName: "选项一", id: "1" },
          { fullName: "选项二", id: "2" },
        ],
  
        suggestionForm: {
          disposalSuggestions: "", //处置建议
          judgmentOpinions: "", //判断意见
          reviewType: "", //判断分类
          deadline: "",
          area: '',
          disposalSuggestions: '', // 处置建议
        },
        rules: {
          disposalSuggestions: [
            { required: true, message: "请输入处理说明", trigger: "blur" },
          ],
        },
        showSuggsetion: false,
        showarea: false,
        judgmentClassOption: [],
        areaOptions: [],
        btnLoading: false,
      };
    },
    computed: {
      isSHILevel() {
        // 判断角色是否为‘市级办公室’
        return this.$store.state.user.islader;
      },
    },
    watch: {},
    created() {
      this.getSourceOptions();
      // this.getplatformTypeOptions();
      // this.getquestionTypeOptions();
      // this.getjudgmentClassOptions();
    },
    mounted() {},
    methods: {
      async getSourceOptions() {
        let { data } = await request({
          url: `/Extend/baseinspectionreport/GetReportSourceList`,
          method: "GET",
        });
        this.sourceOptions = data;
      },
      getplatformTypeOptions() {
        getDictionaryDataSelector("576279943168656645").then((res) => {
          this.platformTypeOptions = res.data.list;
        });
      },
      getquestionTypeOptions() {
        getDictionaryDataSelector("577006814432855301").then((res) => {
          this.questionTypeOptions = res.data.list;
        });
      },
      getjudgmentClassOptions() {
        request({
          url: `/Extend/BaseInspectionReport/GetReviewTypeList`,
          method: 'GET',
        }).then(res => {
          this.judgmentClassOption = res.data;
        })
      },
      goBack() {
        this.$emit("refresh");
      },
      init(id, isDetail) {
        this.dataForm.id = id || 0;
        this.visible = true;
        this.showSuggsetion = false;
        this.$nextTick(async () => {
          this.$refs["suggestionForm"].resetFields();
          if (this.dataForm.id) {
            this.loading = true;
            let res = await getDetail(this.dataForm.id);
            this.dataForm = res.data;
            this.loading = false;
            this.dataForm.reportSourceName = this.sourceOptions.find(v => v.Id == this.dataForm.reportSource).FullName;
            this.dataForm.areaName = dynamicText(res.data.areaId, this.areaOptions);
            this.suggestionForm.area = res.data.areaId
            if (!this.dataForm.obtainEvidence) this.dataForm.obtainEvidence = [];
            if (!this.dataForm.annex) this.dataForm.annex = [];
          }
        });
      },
      judgmentClassChange(v) {
        this.suggestionForm.judgmentOpinions = '';
        this.showSuggsetion = Boolean(v == "590769458901943557" || v == "590769521820697861"); // 进一步处置,不采纳
        this.showarea = Boolean(v == "590769199001896197" || v == "590769458901943557"); // 执法,进一步处置
      },
      dataFormSubmit() {
        this.$refs["suggestionForm"].validate(async (valid) => {
          if (valid) {
            let obj = {
              ...this.suggestionForm,
              id: this.dataForm.id,
            };
            this.btnLoading = true;
            let res = await disposalSuggestions(obj);
            if(res.code != 200) return this.btnLoading = false;
            this.$message({
              message: res.msg,
              type: "success",
              duration: 1000,
              onClose: () => {
                (this.visible = false), this.$emit("refresh", true);
              },
            });
          }
        });
      },
    },
  };
  </script>
  <style lang="scss" scoped>
  .form_title {
    line-height: 30px;
    padding-left: 40px;
    color: #409eff;
  }
  </style>