|
@@ -0,0 +1,274 @@
|
|
|
+<template>
|
|
|
+ <div class="dictionary-container">
|
|
|
+ <Row :gutter="10">
|
|
|
+ <Col span="8">
|
|
|
+ <Card title="组织机构">
|
|
|
+ <Tree :data="treeData" :load-data="loadTreeData" @on-select-change="getTableData" style="overflow: auto;height: calc(100vh - 166px);"></Tree>
|
|
|
+ </Card>
|
|
|
+ </Col>
|
|
|
+ <Col span="16">
|
|
|
+ <Card title="系统参数">
|
|
|
+ <Checkbox v-model="dictionaryForm.allCompany">此设置应用整个物业公司</Checkbox>
|
|
|
+ <div class="dictionary-title">流程管理</div>
|
|
|
+ <Table border :columns="tableColumns" :data="tableData" :height="tableHeight" :loading="tableLoading" class="dictionary-table">
|
|
|
+ <template slot-scope="{ row }" slot="approvalState">
|
|
|
+ <Switch v-model="row.approvalState">
|
|
|
+ <span slot="open">需要审核</span>
|
|
|
+ <span slot="close">不需要审核</span>
|
|
|
+ </Switch>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row }" slot="approvalChannels">
|
|
|
+ <Select v-model="row.approvalChannels" :clearable="false" v-if="row.approvalState">
|
|
|
+ <Option v-for="item in processList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
+ </Select>
|
|
|
+ <span v-else>无</span>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row }" slot="processCoding" v-if="row.approvalState">
|
|
|
+ <Input v-model="row.processCoding" placeholder="请输入流程编码"/>
|
|
|
+ </template>
|
|
|
+ </Table>
|
|
|
+ <div class="dictionary-title">其他参数</div>
|
|
|
+ <div class="dictionary-form">
|
|
|
+ <div class="dictionary-form-item" v-for="(item, index) in otherTableData" :key="index">
|
|
|
+ <div class="form-item-title">{{item.moduleName}}</div>
|
|
|
+ <div class="form-item-content">
|
|
|
+ <Switch size="large" v-model="item.approvalState">
|
|
|
+ <span slot="open">需要</span>
|
|
|
+ <span slot="close">不需要</span>
|
|
|
+ </Switch>
|
|
|
+ <Input v-model="item.bulletFrame" placeholder="请输入弹出对话框内容" style="flex:1" v-if="item.approvalState && item.Classification == 2" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="dictionary-handle">
|
|
|
+ <Button type="primary" size="large" @click="submitForm" :disabled="!dictionaryForm.projectId">保存</Button>
|
|
|
+ </div>
|
|
|
+ </Card>
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+ import {getAreaList, getProjectList, getApproveSetting, saveApproveSetting} from "../../service/getData";
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: 'dictionary',
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ treeData: [],
|
|
|
+ typeList: ['decorationActivit', 'decorateOther', 'decorationNoOther'],
|
|
|
+ processList: [
|
|
|
+ {label: '一碑流程中心', value: 'ebeiSystem'}
|
|
|
+ ],
|
|
|
+ tableColumns: [
|
|
|
+ {title: '序号', type: 'index', width: 60, align: 'center'},
|
|
|
+ {title: '模块名称', key: 'moduleName', minWidth: 150, align: 'center'},
|
|
|
+ {title: '启动流程审核', slot: 'approvalState', width: 120, align: 'center'},
|
|
|
+ {title: '对接流程', slot: 'approvalChannels', minWidth: 150, align: 'center'},
|
|
|
+ {title: '流程编码', slot: 'processCoding', minWidth: 150, align: 'center'},
|
|
|
+ ],
|
|
|
+ tableData: [],
|
|
|
+ tableLoading: false,
|
|
|
+ tableHeight: 200,
|
|
|
+ otherTableData: [],
|
|
|
+ dictionaryForm: {
|
|
|
+ allCompany: false,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ this.resizePage()
|
|
|
+ window.addEventListener('resize', this.resizePage)
|
|
|
+ getAreaList(localStorage.user_id).then((res) => {
|
|
|
+ this.treeData = res.items.map(item=>{
|
|
|
+ return {
|
|
|
+ value: item.areaId,
|
|
|
+ title: item.areaName,
|
|
|
+ loading: false,
|
|
|
+ children: []
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 动态获取表格高度
|
|
|
+ resizePage () {
|
|
|
+ this.tableHeight = window.innerHeight - 464
|
|
|
+ },
|
|
|
+ // 懒加载树形结构
|
|
|
+ loadTreeData (item, callback) {
|
|
|
+ getProjectList(localStorage.user_id, item.value).then((res) => {
|
|
|
+ callback(res.items.map(site=>{
|
|
|
+ return {
|
|
|
+ areaId: item.value,
|
|
|
+ value: site.projectId,
|
|
|
+ title: site.projectName,
|
|
|
+ }
|
|
|
+ }));
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取表格数据
|
|
|
+ getTableData(treeArr, item){
|
|
|
+ if (item.areaId){
|
|
|
+ this.tableData = []
|
|
|
+ this.otherTableData = []
|
|
|
+ let otherTableData = []
|
|
|
+ this.tableLoading = true
|
|
|
+ this.typeList.forEach((site, index) => {
|
|
|
+ getApproveSetting({
|
|
|
+ companyId: localStorage.companyId,
|
|
|
+ projectId: item.value,
|
|
|
+ userName: localStorage['user_name'],
|
|
|
+ dictCode: site
|
|
|
+ }).then((res) => {
|
|
|
+ this.tableLoading = false
|
|
|
+ if (res.status == 200) {
|
|
|
+ if (index == 0){
|
|
|
+ this.tableData = res.data.map(site => {
|
|
|
+ return {
|
|
|
+ ...site,
|
|
|
+ projectId: item.value,
|
|
|
+ approvalState: true,
|
|
|
+ approvalChannels: 'ebeiSystem',
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ otherTableData = otherTableData.concat(res.data.map(site => {
|
|
|
+ return {
|
|
|
+ ...site,
|
|
|
+ projectId: item.value,
|
|
|
+ approvalState: true,
|
|
|
+ }
|
|
|
+ }))
|
|
|
+ this.otherTableData = otherTableData
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$Notice.error({
|
|
|
+ title: '获取' + (index == 0 ? '流程管理' : '其他参数') + '失败',
|
|
|
+ desc: res.message,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 提交表单
|
|
|
+ submitForm(){
|
|
|
+ saveApproveSetting({
|
|
|
+ companyId: this.dictionaryForm.allCompany ? localStorage.companyId : null,
|
|
|
+ userName: localStorage['user_name'],
|
|
|
+ list: this.tableData.concat(this.otherTableData).map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ approvalState: item.approvalState ? 1 : 0,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.$Notice.success({
|
|
|
+ title: '提示',
|
|
|
+ desc: '保存系统参数成功',
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$Notice.error({
|
|
|
+ title: '保存系统参数失败',
|
|
|
+ desc: res.message,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="less">
|
|
|
+ .dictionary-container{
|
|
|
+ padding: 0px!important;
|
|
|
+ background: #f4f6fa;
|
|
|
+ height: calc(100vh - 70px);
|
|
|
+ .dictionary-title{
|
|
|
+ height: 22px;
|
|
|
+ padding-left: 5px;
|
|
|
+ margin: 12px 0;
|
|
|
+ border-left: 4px solid #4683dd;
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ .dictionary-table{
|
|
|
+ /deep/.ivu-switch{
|
|
|
+ width: 100px;
|
|
|
+ .ivu-switch-inner{
|
|
|
+ width: 68px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /deep/.ivu-switch:after{
|
|
|
+ transform: translateX(0%);
|
|
|
+ transition: transform .2s ease-in-out, left .2s ease-in-out, width .2s ease-in-out;
|
|
|
+ }
|
|
|
+ /deep/.ivu-switch-checked:after{
|
|
|
+ left: 97px;
|
|
|
+ transform: translateX(-100%);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .dictionary-form{
|
|
|
+ height: 140px;
|
|
|
+ overflow: auto;
|
|
|
+ .dictionary-form-item{
|
|
|
+ border: 1px solid #cccccc;
|
|
|
+ border-top-width: 0;
|
|
|
+ display: flex;
|
|
|
+ .form-item-title{
|
|
|
+ width: 180px;
|
|
|
+ padding: 20px;
|
|
|
+ border-right: 1px solid #cccccc;
|
|
|
+ background: #f4f6fa;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+ .form-item-content{
|
|
|
+ height: 68px;
|
|
|
+ padding: 20px;
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ /deep/.ivu-switch{
|
|
|
+ width: 80px;
|
|
|
+ margin-right: 20px;
|
|
|
+ .ivu-switch-inner{
|
|
|
+ width: 48px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .ivu-switch:after{
|
|
|
+ transform: translateX(0%);
|
|
|
+ transition: transform .2s ease-in-out, left .2s ease-in-out, width .2s ease-in-out;
|
|
|
+ }
|
|
|
+ .ivu-switch-large.ivu-switch-checked:after{
|
|
|
+ left: 77px;
|
|
|
+ transform: translateX(-100%);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .dictionary-form-item:first-child{
|
|
|
+ border-top-width: 1px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .dictionary-handle{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ margin-top: 12px;
|
|
|
+ /deep/.ivu-btn-large {
|
|
|
+ padding: 6px 15px 6px 15px!important;
|
|
|
+ font-size: 14px!important;
|
|
|
+ border-radius: 4px!important;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|