sqywDetail.vue 9.37 KB
<template>
  <div>
    <ul class="edit-title-list" v-if="djlxList.length > 0">
      <li v-for="(item, index) in djlxList" @click="handleTitleSelct(item, index)" :key="index"
        :class="{ active: index == tn }">
        {{ item.nodename }}
      </li>
    </ul>
    <div class="contentBox">
      <el-form :model="form" v-show="n == 0" label-width="135px" ref="ruleForm">
        <el-row>
          <el-col :span="8">
            <el-form-item label="申请分类">
              <el-select v-model="form.ywDetail.sqfl" disabled placeholder="请选择" class="width100">
                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="登记业务编码">
              <el-input v-model="form.ywDetail.djywbm" disabled></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="登记业务名称">
              <el-input v-model="form.ywDetail.djywmc" disabled></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="发起业务单元类型">
              <el-select v-model="form.ywDetail.fqywdylx" disabled placeholder="请选择" class="width100">
                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="是否启用" prop="enabled">
              <el-radio-group v-model="form.ywDetail.enabled">
                <el-radio label="1">启用</el-radio>
                <el-radio label="0">禁用</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="业务流程ID" prop="flowid">
              <el-input v-model="form.ywDetail.flowid"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="登记原因设置" prop="sfqydjyymb">
              <el-radio-group v-model="form.ywDetail.sfqydjyymb">
                <el-radio label="1">启用</el-radio>
                <el-radio label="0">禁用</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="登记情形及材料">
              <el-input v-model="form.ywDetail.djqxcl" placeholder="仅支持execl文件导入"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="1">
            <el-upload ref="upload" :action="imgUploadUrl" :limit="1" accept=".xls, .xlsx" :show-file-list="false"
              :disabled="requested" :file-list="fileList" :before-upload="uploadRecord" :on-success="handleSuccess">
              <el-button type="primary" icon="el-icon-upload" :loading="requested">上传材料</el-button>
            </el-upload>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="登记原因模板" prop="djyy">
              <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="form.ywDetail.djyy">
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <el-collapse class="modifycollapse" accordion>
        <el-collapse-item title="登记情形设置" name="1">
          <lb-table :column="djqxCol" border :pagination="false" heightNumSetting :data="form.djqx">
          </lb-table>
        </el-collapse-item>
        <el-collapse-item title="材料信息设置" name="2">
          <lb-table :column="clxxCol" border heightNumSetting :pagination="false" :data="form.clxx">
          </lb-table>
        </el-collapse-item>
        <el-collapse-item title="刷选权利设置" name="3" v-if="form.ywDetail.sfsxql == '1'">
          <div class="dyztsd-title">
            <b>请勾选需要查询的权利信息</b>
            <div>
              <el-button type="text" @click="handleSelectall">选择全部
              </el-button>
              <el-button type="text" @click="handleInvert">清除全部</el-button>
            </div>
          </div>
          <el-divider></el-divider>
          <ul class="qlxx-list">
            <li v-for="(item, index) in form.sxql" :key="index">
              <el-checkbox v-model="item.checked">{{
                item.sxzdmc
              }}</el-checkbox>
            </li>
          </ul>
        </el-collapse-item>
        <el-collapse-item title="办理状态设置" name="4">
          <ul class="screen-list">
            <li v-for="(item, index) in form.sxzt" :key="index">
              <div class="screen-list-left">
                {{ item.sxzdmc }}
                <el-checkbox v-model="item.checked">禁止办理</el-checkbox>
              </div>
            </li>
          </ul>
        </el-collapse-item>
      </el-collapse>
    </div>
    <div slot="footer" class="dialog_footer text-center">
      <el-button @click="cancelDialog">取 消</el-button>
      <el-button type="primary" @click="submit" plain>提 交</el-button>
    </div>
  </div>
</template>
<script>
import { mapGetters } from "vuex";
import { upward, down } from "@/utils/operation";
import { getDjlxInfo, getSqdjywDetail, saveSqdjyw } from "@/api/system.js";
import { datas, sendThis } from "./sqywDetail";
export default {
  name: "componentDialog",
  props: {
    formData: {
      type: Object,
      default: () => { }
    }
  },
  data () {
    return {
      tn: 0,
      n: 0,
      djlxList: [],
      title: "",
      activeName: "1",
      form: {},
      djqxCol: datas.djqxCol(),
      clxxCol: datas.clxxCol(),
    };
  },
  computed: {
    ...mapGetters(["dictData"]),
  },
  mounted () {
    sendThis(this)
    this.init()
  },
  methods: {
    //页面初始化
    init () {
      this.tn = 0;
      getDjlxInfo(this.formData.bsmSqyw).then((res) => {
        let { result } = res;
        this.djlxList = result ? result : [];
        if (this.djlxList.length > 0) {
          this.getDetail(this.djlxList[0].bsmSqyw);
        } else {
          this.getDetail(this.formData.bsmSqyw);
        }
      })
    },
    //tab选项卡事件
    handleTitleSelct (obj, index) {
      this.n = 0;
      this.tn = index;
      this.getDetail(this.djlxList[index].bsmSqyw);
    },
    //获取业务具体明细内容
    getDetail (bsmSqyw) {
      getSqdjywDetail(bsmSqyw).then((res) => {
        if (res.code === 200) {
          this.form = res.result;
        } else {
          this.$alert(res.message);
        }
      });
    },
    //提交保存数据
    submit () {
      let that = this;
      saveSqdjyw(this.form).then((res) => {
        if (res.code == 200) {
          that.$message({
            message: "修改成功",
            type: "success",
          });
          // that.$emit('input', false)
        }
      });
    },
    //修改父组件传过来的值
    cancelDialog () {
      this.$emit("update:dialogVisible", false);
    },
    // 上移下移
    moveUpward (index, row, type) {
      if (type == "clxx") {
        upward(index, this.form.clxx);
      } else {
        upward(index, this.form.djqx);
      }
    },
    moveDown (index, row, type) {
      if (type == "clxx") {
        down(index, this.form.clxx);
      } else {
        down(index, this.form.djqx);
      }
    },
    addDjqx () {
      this.form.djqx.push({
        nodecode: "",
        nodename: "",
        enabled: "1",
        djyy: "",
        sfqydjyymb: "0",
      });
    },
    removeDjqx (index, row) {
      this.form.djqx.splice(index, 1);
    },
    addClxx () {
      this.form.clxx.push({
        isrequired: "1",
        djqxbm: "",
        clbm: "",
        clmc: "",
        cllx: "",
        sfggcl: "1",
      });
    },
    removeClxx (index, row) {
      this.form.clxx.splice(index, 1);
    },
  },
};
</script>
<style lang='scss' scoped>
@import "~@/styles/mixin.scss";
@import "~@/styles/dialogBox.scss";
@import "~@/styles/collapse.scss";
@import "~@/styles/dialogBoxheader.scss";

.contentBox {
  height: 75vh;
  overflow-y: scroll;
}

.el-radio-group {
  white-space: nowrap;
}

.form {
  background: #eee;
  padding: 0 10px;
}

.edit-title-list {
  @include flex;

  li {
    flex: 1;
    @include flex-center;
    border: 1px solid $borderColor;
    line-height: 36px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;

    &:hover {
      @extend .active;
    }
  }
}

.active {
  background: $light-blue !important;
  color: #fff;
}

.dyztsd-title {
  @include flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 20px;
}

.qlxx-list {
  @include flex;
  flex-wrap: wrap;
  padding-left: 20px;

  li {
    width: 25%;
    margin-bottom: 15px;
  }
}

.screen-list {
  @include flex;
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid $borderColor;
  border-bottom: none;

  li {
    @include flex;
    align-items: center;
    width: 25%;
    line-height: 50px;
    border-bottom: 1px solid $borderColor;
    padding-left: 20px;
  }

  &-left {
    margin-right: 20px;
    width: 160px;
    white-space: nowrap;
  }

  li:nth-child(odd) {
    border-right: 1px solid $borderColor;
  }
}
</style>