|
@@ -0,0 +1,259 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <el-card class="fiche">
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList">收起</right-toolbar>
|
|
|
+ <span style="margin-bottom: 10px;color:#333333;font:14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial,sans-serif">所选条件:</span>
|
|
|
+ <div style="float: right;margin-right:1%">
|
|
|
+ <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" style="float: ;">重置</el-button>
|
|
|
+ </div>
|
|
|
+ <hr style="margin-top: 16px;">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+
|
|
|
+ <el-form-item label="业务名称" prop="papBusinessName">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.papBusinessName"
|
|
|
+ placeholder="请输入业务名称"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ maxlength="20"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ </el-card>
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ size="mini"
|
|
|
+ @click="handleAdd"
|
|
|
+ v-hasPermi="['approval:approval:add']"
|
|
|
+ >新增</el-button>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+ <el-table stripe v-loading="loading" :data="approvalList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column label="序号" type="index" width="55" align="center" fixed>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="业务名称" align="center" prop="papBusinessName" width="140" :show-overflow-tooltip="true" fixed/>
|
|
|
+ <el-table-column label="类型" align="center" :formatter="typeFormat" prop="cifType" />
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ v-hasPermi="['approval:approval:edit']"
|
|
|
+ >修改</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 添加或修改信息对话框 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body :before-close = "cancel">
|
|
|
+ <el-form ref="form" :disabled="disabled" :model="form" :rules="rules" label-width="80px" class="demo-form-inline" :inline="true">
|
|
|
+
|
|
|
+ <el-form-item label="业务名称" prop="papBusinessName">
|
|
|
+ <el-input v-model.trim="form.papBusinessName" placeholder="请输入业务名称" maxlength="30" style="width: 200px"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="表名称" prop="papTableName">
|
|
|
+ <el-input v-model.trim="form.papTableName" placeholder="请输入表名称" maxlength="30" style="width: 200px"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="类型" prop="papType">
|
|
|
+ <el-select v-model="form.papType" placeholder="请选择类型" style="width: 200px">
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in papTypeOptions"
|
|
|
+ :key="index"
|
|
|
+ :label="item.dictLabel"
|
|
|
+ :value="item.dictValue"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="链接" prop="papUrl">
|
|
|
+ <el-input v-model.trim="form.papUrl" placeholder="请输入链接" maxlength="100" style="width: 200px"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {listApproval,addApporval,approvalDetail,updateApproval} from "@/api/approval/approval";
|
|
|
+export default {
|
|
|
+ name: "approval",
|
|
|
+ components: {},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 审批信息表格数据
|
|
|
+ approvalList: [],
|
|
|
+ // 审批类型数据字典
|
|
|
+ papTypeOptions: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ sealOpen: false,
|
|
|
+ // 查询参数:
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ papBusinessName:''
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ disabled: true,
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ papBusinessName: [
|
|
|
+ { required: true, message: '请输入业务名称', trigger: ["blur",'change'] },
|
|
|
+ ],
|
|
|
+ papTableName: [
|
|
|
+ { required: true, message: '请输入表名称', trigger: 'blur'},
|
|
|
+ ],
|
|
|
+ papType: [
|
|
|
+ { required: true, message: '请选择类型', trigger: 'blur'},
|
|
|
+ ],
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ // 远程搜索
|
|
|
+ options: [],
|
|
|
+ value: [],
|
|
|
+ list: [],
|
|
|
+ loading: false,
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
+ this.getDicts("pub_approval_type").then((response) => {
|
|
|
+ this.papTypeOptions = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ /** 查询信息列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listApproval(this.queryParams).then(response => {
|
|
|
+ this.approvalList = response.data.records;
|
|
|
+ this.total = response.data.total;
|
|
|
+ this.loading = false;
|
|
|
+ }).catch(()=>{
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.sealOpen = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ papId: null,
|
|
|
+ papBusinessName: null,
|
|
|
+ papTableName: null,
|
|
|
+ papType: null,
|
|
|
+ papUrl: null
|
|
|
+ };
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map(item => item.papId)
|
|
|
+ this.single = selection.length!==1
|
|
|
+ this.multiple = !selection.length
|
|
|
+ },
|
|
|
+ /** 类型字典 */
|
|
|
+ typeFormat(row, column){
|
|
|
+ return this.selectDictLabel(this.papTypeOptions, row.papType);
|
|
|
+ },
|
|
|
+ /** 新增按钮操作 */
|
|
|
+ handleAdd() {
|
|
|
+ this.reset();
|
|
|
+ this.open = true;
|
|
|
+ this.disabled = false;
|
|
|
+ this.title = "添加审批设置信息";
|
|
|
+ },
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ handleUpdate(row) {
|
|
|
+ this.reset();
|
|
|
+ const papId = row.papId || this.papId;
|
|
|
+ this.disabled = false;
|
|
|
+ approvalDetail(papId).then(response => {
|
|
|
+ this.open = true;
|
|
|
+ this.form = response.data;
|
|
|
+ this.title = "修改审批设置信息";
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.papId != null) {
|
|
|
+ updateApproval(this.form).then(response => {
|
|
|
+ this.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addApporval(this.form).then(response => {
|
|
|
+ this.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|