|
|
|
@ -37,7 +37,7 @@ |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<el-table |
|
|
|
:height="this.height - 270" |
|
|
|
:height="this.height - 300" |
|
|
|
:data="dataList" |
|
|
|
ref="mainTable" |
|
|
|
highlight-current-row |
|
|
|
@ -139,6 +139,44 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-tab-pane> |
|
|
|
<!-- 审批步骤页签 --> |
|
|
|
<el-tab-pane label="审批步骤" name="auth_rule_step" style="height: 100%"> |
|
|
|
<el-button type="primary" @click="ruleStepAddModal" style="margin-top: -5px">新增</el-button> |
|
|
|
<el-table |
|
|
|
:height="this.height - 278" |
|
|
|
:data="ruleStepDataList" |
|
|
|
ref="ruleStepTable" |
|
|
|
highlight-current-row |
|
|
|
border |
|
|
|
style="width: 100%; margin-top: 5px"> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in ruleStepColumnList" :key="index" |
|
|
|
:sortable="item.columnSortable" |
|
|
|
:prop="item.columnProp" |
|
|
|
:header-align="item.headerAlign" |
|
|
|
:show-overflow-tooltip="item.showOverflowTooltip" |
|
|
|
:align="item.align" |
|
|
|
:fixed="item.fixed==''?false:item.fixed" |
|
|
|
:min-width="item.columnWidth" |
|
|
|
:label="item.columnLabel"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span> |
|
|
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
fixed="right" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
width="160" |
|
|
|
label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-link style="cursor: pointer" @click="ruleStepUpdateModal(scope.row)">修改</el-link> |
|
|
|
<el-link style="cursor: pointer" @click="ruleStepDelModal(scope.row)">删除</el-link> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
|
|
|
|
<el-dialog :title="modalData.title" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="600px"> |
|
|
|
@ -197,6 +235,73 @@ |
|
|
|
<el-button type="primary" @click="modalFlag = false">关闭</el-button> |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog :title="ruleStepModalData.title" :close-on-click-modal="false" v-drag :visible.sync="ruleStepModalFlag" width="476px"> |
|
|
|
<el-form :inline="true" label-position="top" :model="ruleStepModalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
|
|
|
<el-form-item label="规则编码" prop="ruleNo"> |
|
|
|
<el-input v-model="ruleStepModalData.ruleNo" :disabled="true" style="width: 110px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="规则描述" prop="ruleDesc"> |
|
|
|
<el-input v-model="ruleStepModalData.ruleDesc" :disabled="true" style="width: 315px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="ruleStepModalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
|
|
|
<el-form-item label="步骤号" prop="stepNo" :rules="rules.stepNo"> |
|
|
|
<el-input v-model="ruleStepModalData.stepNo" :disabled="ruleStepModalDisableFlag" style="width: 110px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="类型" prop="authTypeDb" :rules="rules.authTypeDb"> |
|
|
|
<el-select clearable v-model="ruleStepModalData.authTypeDb" style="width: 145px" @blur="clearRuleStepModalData"> |
|
|
|
<el-option label="审批人" value="U"></el-option> |
|
|
|
<el-option label="审批组" value="G"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label=" " prop="firstStepFlag"> |
|
|
|
<el-checkbox v-model="ruleStepModalData.firstStepFlag" :disabled="this.ruleStepModalData.lastStepFlag === 'Y'" :true-label="'Y'" :false-label="'N'" style="width: 110px;margin-left: 35px"> |
|
|
|
首步骤 |
|
|
|
</el-checkbox> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="ruleStepModalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
|
|
|
<el-form-item prop="authUserNo" :rules="rules.authUserNo"> |
|
|
|
<span slot="label" style="" v-if="this.ruleStepModalData.authTypeDb !== 'G' && this.ruleStepModalData.authTypeDb !== '审批组'"> |
|
|
|
<a herf="#" @click="getBaseList(2003)">审批人</a> |
|
|
|
</span> |
|
|
|
<span slot="label" style="margin-left: -4px" v-if="this.ruleStepModalData.authTypeDb === 'G' || this.ruleStepModalData.authTypeDb === '审批组'"> |
|
|
|
审批人 |
|
|
|
</span> |
|
|
|
<el-input v-model="ruleStepModalData.authUserNo" :disabled="this.ruleStepModalData.authTypeDb === 'G' || this.ruleStepModalData.authTypeDb === '审批组'" @blur="authUserNoBlur" style="width: 110px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="审批人姓名" prop="userDisplay" :rules="rules.userDisplay"> |
|
|
|
<el-input v-model="ruleStepModalData.userDisplay" disabled style="width: 145px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label=" " prop="lastStepFlag"> |
|
|
|
<el-checkbox v-model="ruleStepModalData.lastStepFlag" :disabled="this.ruleStepModalData.firstStepFlag === 'Y'" :true-label="'Y'" :false-label="'N'" style="width: 110px;margin-left: 35px"> |
|
|
|
末步骤 |
|
|
|
</el-checkbox> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="ruleStepModalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
|
|
|
<el-form-item prop="authGroupNo" :rules="rules.authGroupNo"> |
|
|
|
<span slot="label" style="" v-if="this.ruleStepModalData.authTypeDb !== 'U' && this.ruleStepModalData.authTypeDb !== '审批人'"> |
|
|
|
<a herf="#" @click="getBaseList(218)">审批组编码</a> |
|
|
|
</span> |
|
|
|
<span slot="label" style="margin-left: -4px" v-if="this.ruleStepModalData.authTypeDb === 'U' || this.ruleStepModalData.authTypeDb === '审批人'"> |
|
|
|
审批组编码 |
|
|
|
</span> |
|
|
|
<el-input v-model="ruleStepModalData.authGroupNo" :disabled="this.ruleStepModalData.authTypeDb === 'U' || this.ruleStepModalData.authTypeDb === '审批人'" @blur="authGroupNoBlur" style="width: 110px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="审批组名称" prop="groupDesc" :rules="rules.groupDesc"> |
|
|
|
<el-input v-model="ruleStepModalData.groupDesc" disabled style="width: 315px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-footer style="height:30px;margin-top: 5px;text-align:center"> |
|
|
|
<el-button type="primary" @click="ruleStepSaveData">保存</el-button> |
|
|
|
<el-button type="primary" @click="ruleStepModalFlag = false">关闭</el-button> |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -206,10 +311,19 @@ import { |
|
|
|
authRuleSearch, // 审批规则信息列表查询 |
|
|
|
authRuleSave, // 审批规则信息新增 |
|
|
|
authRuleEdit, // 审批规则信息编辑 |
|
|
|
authRuleDelete // 审批规则信息删除 |
|
|
|
authRuleDelete, // 审批规则信息删除 |
|
|
|
authRuleStepSearch, // 审批规则步骤信息列表查询 |
|
|
|
authRuleStepSave, // 审批规则步骤信息新增 |
|
|
|
authRuleStepEdit, // 审批规则步骤信息编辑 |
|
|
|
authRuleStepDelete, // 审批规则步骤信息删除 |
|
|
|
} from '@/api/auth/auth' |
|
|
|
import Chooselist from '@/views/modules/common/Chooselist_eam' |
|
|
|
import {authBusinessSearch, authGroupSearch} from "../../../api/auth/auth"; |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
Chooselist |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
// 导出 |
|
|
|
@ -271,8 +385,33 @@ export default { |
|
|
|
createDate: '', |
|
|
|
updateDate: '' |
|
|
|
}, |
|
|
|
ruleStepModalData: { |
|
|
|
flag: '', |
|
|
|
title: '', |
|
|
|
bu: '', |
|
|
|
site: this.$store.state.user.site, |
|
|
|
userName: this.$store.state.user.name, |
|
|
|
buNo: '', |
|
|
|
authStepId: '', |
|
|
|
authRuleId: '', |
|
|
|
ruleNo: '', |
|
|
|
ruleDesc: '', |
|
|
|
stepNo: 0, |
|
|
|
authTypeDb: '', |
|
|
|
authUserNo: '', |
|
|
|
userDisplay: '', |
|
|
|
authGroupNo: '', |
|
|
|
groupDesc: '', |
|
|
|
firstStepFlag: '', |
|
|
|
lastStepFlag: '', |
|
|
|
createBy: '', |
|
|
|
updateBy: '', |
|
|
|
createDate: '', |
|
|
|
updateDate: '' |
|
|
|
}, |
|
|
|
// ======== 数据列表 ======== |
|
|
|
dataList: [], |
|
|
|
ruleStepDataList: [], |
|
|
|
// 展示列集 |
|
|
|
columnList: [ |
|
|
|
{ |
|
|
|
@ -509,6 +648,224 @@ export default { |
|
|
|
columnWidth: 100 |
|
|
|
}, |
|
|
|
], |
|
|
|
ruleStepColumnList: [ |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 601005, |
|
|
|
serialNumber: '601005Table2StepNo', |
|
|
|
tableId: "601005Table2", |
|
|
|
tableName: "审批规则步骤表", |
|
|
|
columnProp: 'stepNo', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: '步骤号', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 60 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 601005, |
|
|
|
serialNumber: '601005Table2AuthTypeDb', |
|
|
|
tableId: "601005Table2", |
|
|
|
tableName: "审批规则步骤表", |
|
|
|
columnProp: 'authTypeDb', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: '类型', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 90 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 601005, |
|
|
|
serialNumber: '601005Table2AuthUserNo', |
|
|
|
tableId: "601005Table2", |
|
|
|
tableName: "审批规则步骤表", |
|
|
|
columnProp: 'authUserNo', |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: '审批人', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 601005, |
|
|
|
serialNumber: '601005Table2UserDisplay', |
|
|
|
tableId: "601005Table2", |
|
|
|
tableName: "审批规则步骤表", |
|
|
|
columnProp: 'userDisplay', |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: '审批人姓名', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 601005, |
|
|
|
serialNumber: '601005Table2AuthGroupNo', |
|
|
|
tableId: "601005Table2", |
|
|
|
tableName: "审批规则步骤表", |
|
|
|
columnProp: 'authGroupNo', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: '审批组编码', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 120 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 601005, |
|
|
|
serialNumber: '601005Table2GroupDesc', |
|
|
|
tableId: "601005Table2", |
|
|
|
tableName: "审批规则步骤表", |
|
|
|
columnProp: 'groupDesc', |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: '审批组名称', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 120 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 601005, |
|
|
|
serialNumber: '601005Table2FirstStepFlag', |
|
|
|
tableId: "601005Table2", |
|
|
|
tableName: "审批规则步骤表", |
|
|
|
columnProp: 'firstStepFlag', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: '首步骤', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 50 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 601005, |
|
|
|
serialNumber: '601005Table2LastStepFlag', |
|
|
|
tableId: "601005Table2", |
|
|
|
tableName: "审批规则步骤表", |
|
|
|
columnProp: 'lastStepFlag', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: '末步骤', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 50 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 601005, |
|
|
|
serialNumber: '601005Table2CreateDate', |
|
|
|
tableId: "601005Table2", |
|
|
|
tableName: "审批规则步骤表", |
|
|
|
columnProp: 'createDate', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: '创建时间', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 170 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 601005, |
|
|
|
serialNumber: '601005Table2CreateBy', |
|
|
|
tableId: "601005Table2", |
|
|
|
tableName: "审批规则步骤表", |
|
|
|
columnProp: 'createBy', |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: '创建人', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 601005, |
|
|
|
serialNumber: '601005Table2UpdateDate', |
|
|
|
tableId: "601005Table2", |
|
|
|
tableName: "审批规则步骤表", |
|
|
|
columnProp: 'updateDate', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: '更新时间', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 170 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 601005, |
|
|
|
serialNumber: '601005Table2UpdateBy', |
|
|
|
tableId: "601005Table2", |
|
|
|
tableName: "审批规则步骤表", |
|
|
|
columnProp: 'updateBy', |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: '更新人', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
}, |
|
|
|
], |
|
|
|
rules: { |
|
|
|
bu: [ |
|
|
|
{ |
|
|
|
@ -551,7 +908,49 @@ export default { |
|
|
|
message: ' ', |
|
|
|
trigger: 'change' |
|
|
|
} |
|
|
|
] |
|
|
|
], |
|
|
|
stepNo:[ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: 'change' |
|
|
|
} |
|
|
|
], |
|
|
|
authTypeDb:[ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: 'change' |
|
|
|
} |
|
|
|
], |
|
|
|
authUserNo:[ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: 'change' |
|
|
|
} |
|
|
|
], |
|
|
|
userDisplay:[ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: 'change' |
|
|
|
} |
|
|
|
], |
|
|
|
authGroupNo:[ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: 'change' |
|
|
|
} |
|
|
|
], |
|
|
|
groupDesc:[ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: 'change' |
|
|
|
} |
|
|
|
], |
|
|
|
}, |
|
|
|
// ======== 模态框开关控制 ======== |
|
|
|
authSearch: false, |
|
|
|
@ -559,7 +958,9 @@ export default { |
|
|
|
authUpdate: false, |
|
|
|
authDelete: false, |
|
|
|
modalFlag: false, |
|
|
|
ruleStepModalFlag: false, |
|
|
|
modalDisableFlag: false, |
|
|
|
ruleStepModalDisableFlag: false, |
|
|
|
menuId: this.$route.meta.menuId, |
|
|
|
}; |
|
|
|
}, |
|
|
|
@ -576,6 +977,12 @@ export default { |
|
|
|
this.modalData.ruleNo = this.modalData.ruleNo.toUpperCase() |
|
|
|
} |
|
|
|
}, |
|
|
|
ruleStepModalData: { |
|
|
|
deep: true, |
|
|
|
handler: function (newV, oldV) { |
|
|
|
this.ruleStepModalData.authGroupNo = this.ruleStepModalData.authGroupNo.toUpperCase() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
this.$nextTick(() => { |
|
|
|
@ -613,6 +1020,36 @@ export default { |
|
|
|
this.getDataList() |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取基础数据列表S |
|
|
|
getBaseList (val,type) { |
|
|
|
this.tagNo = val |
|
|
|
this.$nextTick(() => { |
|
|
|
let strVal = '' |
|
|
|
let conSql = '' |
|
|
|
if (val === 2003 ) { |
|
|
|
strVal = this.ruleStepModalData.authUserNo |
|
|
|
conSql = " and br.site = '" + this.$store.state.user.site + "'" |
|
|
|
this.$refs.baseList.init(val, strVal, conSql) |
|
|
|
} |
|
|
|
if (val === 218 ) { |
|
|
|
strVal = this.ruleStepModalData.authGroupNo |
|
|
|
this.$refs.baseList.init(val, strVal) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
/* 列表方法的回调 */ |
|
|
|
getBaseData (val) { |
|
|
|
if (this.tagNo === 2003) { |
|
|
|
this.ruleStepModalData.authUserNo = val.username |
|
|
|
this.ruleStepModalData.userDisplay = val.user_display |
|
|
|
} |
|
|
|
if (this.tagNo === 218) { |
|
|
|
this.ruleStepModalData.authGroupNo = val.group_no |
|
|
|
this.ruleStepModalData.groupDesc = val.group_desc |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取数据列表 |
|
|
|
getDataList () { |
|
|
|
if (this.searchData.bu != null && this.searchData.bu !== '') { |
|
|
|
@ -646,6 +1083,24 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取数据列表 |
|
|
|
getRuleStepDataList () { |
|
|
|
authRuleStepSearch(this.ruleCurrentRow).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.ruleStepDataList = data.list |
|
|
|
// 设置选中行 |
|
|
|
this.$refs.ruleStepTable.setCurrentRow(this.ruleStepDataList[0]) |
|
|
|
for (let i = 0; i < this.ruleStepDataList.length; i++) { |
|
|
|
if (this.ruleStepDataList[i].authTypeDb === 'U') { |
|
|
|
this.ruleStepDataList[i].authTypeDb = '审批人' |
|
|
|
} else { |
|
|
|
this.ruleStepDataList[i].authTypeDb = '审批组' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
addModal () { |
|
|
|
this.modalData = { |
|
|
|
flag: '1', |
|
|
|
@ -665,6 +1120,37 @@ export default { |
|
|
|
this.modalFlag = true |
|
|
|
}, |
|
|
|
|
|
|
|
ruleStepAddModal () { |
|
|
|
this.ruleStepModalData = { |
|
|
|
flag: '1', |
|
|
|
title: '审批规则步骤新增', |
|
|
|
bu: this.userBuList[0].buNo, |
|
|
|
buNo: '', |
|
|
|
authRuleId: this.ruleCurrentRow.authRuleId, |
|
|
|
ruleNo: this.ruleCurrentRow.ruleNo, |
|
|
|
ruleDesc: this.ruleCurrentRow.ruleDesc, |
|
|
|
stepNo: 10, |
|
|
|
authTypeDb: 'U', |
|
|
|
authUserNo: '', |
|
|
|
userDisplay: '', |
|
|
|
authGroupNo: '', |
|
|
|
groupDesc: '', |
|
|
|
firstStepFlag: 'N', |
|
|
|
lastStepFlag: 'N', |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
} |
|
|
|
// 遍历数据列表,判断步骤号,每次新增步骤号+10 |
|
|
|
let stepNoList = [] |
|
|
|
for (let i = 0; i < this.ruleStepDataList.length; i++) { |
|
|
|
stepNoList.push(this.ruleStepDataList[i].stepNo) |
|
|
|
} |
|
|
|
if (stepNoList.length > 0) { |
|
|
|
this.ruleStepModalData.stepNo = Math.max.apply(null, stepNoList) + 10 |
|
|
|
} |
|
|
|
this.ruleStepModalDisableFlag = false |
|
|
|
this.ruleStepModalFlag = true |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 审批规则信息编辑模态框 |
|
|
|
* @param row |
|
|
|
@ -703,6 +1189,36 @@ export default { |
|
|
|
this.modalFlag = true |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 审批规则步骤信息编辑模态框 |
|
|
|
* @param row |
|
|
|
*/ |
|
|
|
ruleStepUpdateModal (row) { |
|
|
|
this.ruleStepModalData = { |
|
|
|
flag: '2', |
|
|
|
title: '审批规则步骤编辑', |
|
|
|
site: row.site, |
|
|
|
authStepId: row.authStepId, |
|
|
|
authRuleId: row.authRuleId, |
|
|
|
ruleNo: row.ruleNo, |
|
|
|
ruleDesc: row.ruleDesc, |
|
|
|
stepNo: row.stepNo, |
|
|
|
authTypeDb: row.authTypeDb, |
|
|
|
authUserNo: row.authUserNo, |
|
|
|
userDisplay: row.userDisplay, |
|
|
|
authGroupNo: row.authGroupNo, |
|
|
|
groupDesc: row.groupDesc, |
|
|
|
firstStepFlag: row.firstStepFlag, |
|
|
|
lastStepFlag: row.lastStepFlag, |
|
|
|
createBy: row.createBy, |
|
|
|
createDate: row.createDate, |
|
|
|
updateBy: this.$store.state.user.name, |
|
|
|
updateDate: '' |
|
|
|
} |
|
|
|
this.ruleStepModalDisableFlag = true |
|
|
|
this.ruleStepModalFlag = true |
|
|
|
}, |
|
|
|
|
|
|
|
// ======== 新增/编辑/删除方法 ======== |
|
|
|
/** |
|
|
|
* 审批规则信息新增/编辑 |
|
|
|
@ -779,6 +1295,118 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 审批规则步骤信息新增/编辑 |
|
|
|
*/ |
|
|
|
ruleStepSaveData () { |
|
|
|
if (this.ruleStepModalData.stepNo === '' || this.ruleStepModalData.stepNo == null) { |
|
|
|
this.$message.warning('请填写步骤号!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.ruleStepModalData.authTypeDb === '' || this.ruleStepModalData.authTypeDb == null) { |
|
|
|
this.$message.warning('请选择类型!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.ruleStepModalData.authTypeDb === 'U' || this.ruleStepModalData.authTypeDb === '审批人') { |
|
|
|
if (this.ruleStepModalData.authUserNo === '' || this.ruleStepModalData.authUserNo == null) { |
|
|
|
this.$message.warning('请填写审批人!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.ruleStepModalData.userDisplay === '' || this.ruleStepModalData.userDisplay == null) { |
|
|
|
this.$alert('该审批人不存在,请重新输入审批人用户名!', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
type: 'warning' |
|
|
|
}) |
|
|
|
return; |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (this.ruleStepModalData.authGroupNo === '' || this.ruleStepModalData.authGroupNo == null) { |
|
|
|
this.$message.warning('请填写审批组编码!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.ruleStepModalData.groupDesc === '' || this.ruleStepModalData.groupDesc == null) { |
|
|
|
this.$alert('该审批组不存在,请重新输入审批组编码!', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
type: 'warning' |
|
|
|
}) |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
// 判断步骤号是否为整十的倍数 |
|
|
|
if (this.ruleStepModalData.stepNo % 10 !== 0) { |
|
|
|
this.$alert('步骤号必须为整十的倍数(如10、20、30)!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.ruleStepDataList != null && this.ruleStepDataList.length > 0) { |
|
|
|
for (let i = 0; i < this.ruleStepDataList.length; i++) { |
|
|
|
if(this.ruleStepModalData.firstStepFlag === 'Y' && this.ruleStepDataList[i].firstStepFlag === 'Y') { |
|
|
|
this.$alert('该审批步骤下已存在首步骤!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
if(this.ruleStepModalData.lastStepFlag === 'Y' && this.ruleStepDataList[i].lastStepFlag === 'Y') { |
|
|
|
this.$alert('该审批步骤下已存在末步骤!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.ruleStepModalData.firstStepFlag === 'Y') { |
|
|
|
this.ruleStepModalData.lastStepFlag = 'N' |
|
|
|
} else if (this.ruleStepModalData.lastStepFlag === 'Y') { |
|
|
|
this.ruleStepModalData.firstStepFlag = 'N' |
|
|
|
} else { |
|
|
|
this.ruleStepModalData.firstStepFlag = 'N' |
|
|
|
this.ruleStepModalData.lastStepFlag = 'N' |
|
|
|
} |
|
|
|
if (this.ruleStepModalData.flag === '1') { |
|
|
|
this.ruleStepModalData.buNo = this.ruleStepModalData.bu.split('_')[1] |
|
|
|
this.ruleStepModalData.site = this.$store.state.user.site |
|
|
|
authRuleStepSave(this.ruleStepModalData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.getRuleStepDataList() |
|
|
|
this.ruleStepModalFlag = false |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => {} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
if (this.ruleStepModalData.authTypeDb === '审批人') { |
|
|
|
this.ruleStepModalData.authTypeDb = 'U' |
|
|
|
} else { |
|
|
|
this.ruleStepModalData.authTypeDb = 'G' |
|
|
|
} |
|
|
|
authRuleStepEdit(this.ruleStepModalData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.getRuleStepDataList() |
|
|
|
this.ruleStepModalFlag = false |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => {} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 审批规则信息删除 |
|
|
|
*/ |
|
|
|
@ -808,6 +1436,79 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 审批规则步骤信息删除 |
|
|
|
*/ |
|
|
|
ruleStepDelModal (row) { |
|
|
|
this.$confirm(`是否删除这条审批规则步骤信息?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
authRuleStepDelete(row).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.getRuleStepDataList() |
|
|
|
this.partSelections = [] |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => {} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
clearRuleStepModalData () { |
|
|
|
this.ruleStepModalData.authUserNo = '' |
|
|
|
this.ruleStepModalData.userDisplay = '' |
|
|
|
this.ruleStepModalData.authGroupNo = '' |
|
|
|
this.ruleStepModalData.groupDesc = '' |
|
|
|
}, |
|
|
|
|
|
|
|
authUserNoBlur () { |
|
|
|
let params = { |
|
|
|
username: this.ruleStepModalData.authUserNo, |
|
|
|
site: this.$store.state.user.site, |
|
|
|
limit: 1, |
|
|
|
page: 1 |
|
|
|
} |
|
|
|
authBusinessSearch(params).then(({data}) => { |
|
|
|
if (data.code === 0) { |
|
|
|
this.ruleStepModalData.userDisplay = data.page.list[0].userDisplay |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
authGroupNoBlur () { |
|
|
|
let params = { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
groupNo: this.ruleStepModalData.authGroupNo, |
|
|
|
active: 'Y', |
|
|
|
limit: 1, |
|
|
|
page: 1 |
|
|
|
} |
|
|
|
authGroupSearch(params).then(({data}) => { |
|
|
|
if (data.code === 0) { |
|
|
|
this.ruleStepModalData.groupDesc = data.page.list[0].groupDesc |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// ======== 列表操作方法 ======== |
|
|
|
/** |
|
|
|
* 单机选中审批规则信息 |
|
|
|
@ -833,6 +1534,9 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
refreshCurrentTabTable () { |
|
|
|
if (this.activeTable == 'auth_rule_step') { |
|
|
|
this.getRuleStepDataList() |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
|