Ovwp.vue 7.05 KB
<template>
  <div class="eibs-tab">
    <div class="m-table-search">
      <el-row>
        <c-col :span="12" style="padding-right: 20px">
          <c-col :span="24">
            <el-form-item label="参数类型">
              <c-select :disabled="isFenh" v-model="model.sefgrp.rec.pratyp" :code="codes.csleix" style="width:100%" placeholder="请输入" @change="searchPtapChange">
              </c-select>
            </el-form-item>
          </c-col>
          <c-col :span="24">
            <el-form-item label="优惠类型">
              <c-select disabled v-model="model.sefgrp.rec.rattyp" :code="codes.yhleix" style="width:100%" placeholder="请输入">
              </c-select>
            </el-form-item>
          </c-col>
        </c-col>
        <c-col :span="12" style="padding-left: 20px">
          <c-col :span="24" v-if="model.sefgrp.rec.pratyp == '2'">
            <m-ptap :model="model" :disabled="true" :noEditNameAndAddress="true" :isAdrblk="false" :haveAdrLabel="true" :noRef="true" :isAdrVisible="false" chooseLanguage="CN" :argadr="{ title: '申请人', grp: 'sefgrp', rol: 'apl' }" ptytyp="C">
            </m-ptap>
          </c-col>
          <c-col :span="24">
            <span style="float: right">
              <el-button size="small" @click="handleReset">重置</el-button>
              <el-button type="primary" icon="el-icon-search" size="small" @click="handleSearch">查询
              </el-button>
            </span>
          </c-col>
        </c-col>
      </el-row>
    </div>
    <el-row>
      <el-col :span="24">
        <c-button @click="handleAdd" class="medium_bcs" size="medium" style="margin-left: 0" type="primary">添加
        </c-button>
      </el-col>
    </el-row>
    <div style="height: 90%">
      <c-col :span="24">
        <el-tabs class="y-tabs">
          <el-table :data="this.model.stmData.data" :columns="this.model.stmData.columns" :showButtonFlg="true" :highlight-current-row="true" @selection-change="handleSelectionChange">
            <!-- <el-table-column :selectable="selectableFn" type="selection" width="55">
            </el-table-column> -->
            <el-table-column prop="sefheptyp" label="优惠类型" width="120px" :formatter="formatSefheptyp">
            </el-table-column>
            <el-table-column v-for="(item, key) in this.model.stmData.columns" :key="key" :label="item.label" :prop="item.prop" :min-width="item.width"></el-table-column>
            <!-- 自定义组件里加了最右边的一列”操作“ -->
            <el-table-column fixed="right" prop="op" label="操作" width="140px">
              <template slot-scope="scope">
                <c-button style="margin-right: 7px" size="small" type="primary" @click="handleEdit(scope.row)">编辑
                </c-button>
                <c-button style="margin-left: 0px" size="small" @click="handleDetails(scope.row)" slot="reference">详情
                </c-button>
              </template>
            </el-table-column>
          </el-table>
          <div class="pagination-box">
            <el-pagination style="margin-right: 30px;" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="model.pagination.pageIndex" :page-sizes="[10, 20, 50, 100, 500]" :page-size="model.pagination.pageSize" layout="sizes, prev, pager, next" :total="model.pagination.total">
            </el-pagination>
          </div>
        </el-tabs>
      </c-col>
      <el-dialog v-if="this.model.initdialog" :visible.sync="model.initdialog" title="新增" append-to-body width="60%">
        <el-form ref="addForm" :rules="rules" :model="model" :validate-on-rule-change="false" label-width="95px">
          <c-content>
            <m-ovwp1 :model="model" :codes="codes" />
          </c-content>
        </el-form>
        <span slot="footer" class="dialog-footer">
          <el-button type="primary" :disabled="isFenh&&this.model.dialogData.sigflg != '0'" @click="saveSefrat">保存</el-button>
          <el-button type="text" @click="closeDialog">取消</el-button>
        </span>
      </el-dialog>
      <el-dialog v-if="this.model.editdialog" :visible.sync="model.editdialog" title="编辑" append-to-body width="60%">
        <el-form ref="editForm" :rules="rules" :model="model" :validate-on-rule-change="false" label-width="95px">
          <c-content>
            <m-ovwp1 :model="model" :codes="codes" />
          </c-content>
        </el-form>
        <span slot="footer" class="dialog-footer">
          <el-button type="primary" :disabled="isFenh&&this.model.dialogData.sigflg != '0'" @click="saveEdit">保存</el-button>
          <el-button type="text" @click="closeEditDialog">取消</el-button>
        </span>
      </el-dialog>
      <el-dialog v-if="this.model.detaildialog" :visible.sync="model.detaildialog" title="详情" append-to-body width="60%">
        <el-form :rules="rules" :validate-on-rule-change="false" :model="model" label-width="95px">
          <c-content>
            <m-ovwp1 :model="model" :codes="codes" />
          </c-content>
        </el-form>
        <span slot="footer" class="dialog-footer">
          <el-button type="text" @click="closeDetailDialog">取消</el-button>
        </span>
      </el-dialog>
    </div>
  </div>

</template>
<script>
import Api from "~/service/Api";
import CodeTable from "~/config/CodeTable";
import Check from "../model/check";
import event from "../event";
import Pts from "~/components/business/commonModel/Pts";

import Ovwp1 from "./Ovwp1";
import Rskmgt from "./Rskmgt";
import Mptap from "./Ptap";

export default {
  name: "Ovwp",
  components: {
    "m-ovwp1": Ovwp1,
    "m-rskmgt": Rskmgt,
    "m-ptap": Mptap
  },
  inject: ["root"],
  props: ["model", "codes", "rules"],
  mixins: [event],
  data() {
    return {
      activeNames: ["ovwp1", "rskmgt"],
      multipleSelection: [],
      multipleSelectionObj: [],
      multipleStatusSelection: [],
      multipleSelectionRow: {},
      codeMap: {
        '1': "固定点数优惠",
        '2': "按比例优惠",
        '': "无优惠",
      }
    };
  },
  computed: {
    isFenh() {
      return JSON.parse(window.sessionStorage.currentOrg).level != "0";
    }
  },
  methods: {
    searchPtapChange() {
      this.model.sefgrp.apl = {
        pts: new Pts().data,
        namelc: "", //  名称		.jsdgrp.apl.namelc
        adrelc: "", //  地址		.jsdgrp.apl.adrelc
        dbfadrblkcn: "" //  Chinese address		.jsdgrp.apl.dbfadrblkcn
      };
    }
  },
  created() {
    let bchLev = JSON.parse(window.sessionStorage.currentOrg).level;
    if (bchLev != "0") {
      this.model.sefgrp.rec.pratyp = "2";
    } else {
      this.model.sefgrp.rec.pratyp = "0";
    }
    this.handleSearch();
  }
};
</script>
<style>
.pagination-box {
  width: 100%;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
  background: #fff;
  margin-top: 5px;
}
.btn-group-wrap {
  max-height: 200px;
  width: 100%;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.btn-item {
  margin-bottom: 10px;
  margin-right: 10px;
}
.medium_bcs {
  border-radius: 5px;
}
</style>