update 企业管理-单位/开票信息增加是否打包企业功能
This commit is contained in:
@@ -159,6 +159,8 @@ const memberCopy = (params) => getAction('', params)
|
||||
const workingGroupEditAccount = (param) => getAction('/project/payWorkingGroupSubitem/editAccount', param)
|
||||
// 获取所有起草组项目
|
||||
const getAllDraftProjects = (params) => getAction('/drafting/payDraftingGroup/listAll', params)
|
||||
// 企业管理-单位/开票信息-更改是否打包企业
|
||||
const updatePackageEnterprise = (params) => postAction('/company/payCompanyManagement/updatePackageEnterprise', params)
|
||||
|
||||
export {
|
||||
getWorkingGroupById,
|
||||
@@ -242,5 +244,6 @@ export {
|
||||
memberCopy,
|
||||
|
||||
workingGroupEditAccount,
|
||||
getAllDraftProjects
|
||||
getAllDraftProjects,
|
||||
updatePackageEnterprise
|
||||
}
|
||||
|
||||
@@ -70,6 +70,10 @@
|
||||
<template slot="switch" slot-scope="text, record">
|
||||
<a-switch :checked="text === 'true'" @change="(val) => onSwitchChange(val, record)" />
|
||||
</template>
|
||||
<!-- 是否为打包企业 -->
|
||||
<template slot="packageEnterprise" slot-scope="text, record">
|
||||
<a-switch :checked="text === 'true'" @change="(val) => onSwitchChangePackageEnterprise(val, record)" />
|
||||
</template>
|
||||
|
||||
<span slot="action" class="action-span-cell" slot-scope="text, record">
|
||||
<a @click="handleAudit(record.id)" v-if="record.status===2"
|
||||
@@ -91,16 +95,33 @@ import JEllipsis from '@comp/jero/JEllipsis'
|
||||
import BusinessManagementModule from './modules/BusinessManagementModule'
|
||||
import PageHeaderTitle from '@comp/layouts/PageHeaderTitle'
|
||||
import IconImg from '@/assets/imgs/icon/icon_company_management.png'
|
||||
import { aduitCompany, checkContactByCompany, updateInternalEnterprise } from '../../api/incomePaymentsApi'
|
||||
import {
|
||||
aduitCompany,
|
||||
checkContactByCompany,
|
||||
updateInternalEnterprise,
|
||||
updatePackageEnterprise
|
||||
} from '../../api/incomePaymentsApi'
|
||||
import { getAction } from '../../api/manage'
|
||||
import { judgeGlobalPermission } from '../../utils/hasPermission'
|
||||
const otherColumnItem = {
|
||||
// 其他列,如果需要判断权限permission里加,不需要判断权限就写false
|
||||
const otherColumns = [
|
||||
{
|
||||
permission: 'company:updateInternalEnterprise',
|
||||
title: '是否是内部企业',
|
||||
align: 'center',
|
||||
width: 150,
|
||||
dataIndex: 'internalEnterprise',
|
||||
scopedSlots: { customRender: 'switch' }
|
||||
},
|
||||
{
|
||||
permission: 'company:updatePackageEnterprise',
|
||||
title: '是否为打包企业',
|
||||
align: 'center',
|
||||
width: 150,
|
||||
dataIndex: 'packageEnterprise',
|
||||
scopedSlots: { customRender: 'packageEnterprise' }
|
||||
}
|
||||
]
|
||||
|
||||
export default {
|
||||
name: 'BusinessManagement',
|
||||
@@ -323,12 +344,39 @@ export default {
|
||||
this.isLoading = false
|
||||
})
|
||||
},
|
||||
// 修改是否为打包企业
|
||||
onSwitchChangePackageEnterprise (val, record) {
|
||||
let params = {
|
||||
id: record.id,
|
||||
packageEnterprise: val
|
||||
}
|
||||
this.isLoading = true
|
||||
updatePackageEnterprise(params).then(res => {
|
||||
if(res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.loadData()
|
||||
} else {
|
||||
this.$message.error(res.message)
|
||||
this.isLoading = false
|
||||
}
|
||||
}, () => {
|
||||
this.isLoading = false
|
||||
})
|
||||
},
|
||||
// 加载数据字典的方法,此处做其他数据的处理
|
||||
initDictConfig() {
|
||||
let hasPermission = judgeGlobalPermission('company:updateInternalEnterprise')
|
||||
if(hasPermission) {
|
||||
this.columns.splice(this.columns.length - 1, 0, otherColumnItem)
|
||||
}
|
||||
// 遍历其他列,如果需要权限则判断权限
|
||||
otherColumns.forEach(col => {
|
||||
// permission 如果是false 则不判断权限
|
||||
if (col.permission === false) {
|
||||
this.columns.splice(this.columns.length - 1, 0, col)
|
||||
return
|
||||
}
|
||||
let hasPermission = judgeGlobalPermission(col.permission)
|
||||
if(hasPermission) {
|
||||
this.columns.splice(this.columns.length - 1, 0, col)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user