tengxi 1 year ago
commit 30e63f041f

@ -25,7 +25,12 @@ export function deleteBusinessWarehouse(id: number) {
return defHttp.delete({ url: '/system/business-warehouse/delete?id=' + id }) return defHttp.delete({ url: '/system/business-warehouse/delete?id=' + id })
} }
// 导出业务线/仓库 Excel // 导出业务线 Excel
export function exportBusinessWarehouse(params) { export function exportBusinessWarehouse(params) {
return defHttp.download({ url: '/xxjj/business-warehouse/export-excel', params }, '业务线/仓库.xls') return defHttp.download({ url: '/system/business-warehouse/export-excel', params }, '业务线.xls')
} }
// 查询业务线(精简)列表
export function listSimpleBusiness() {
return defHttp.get({ url: '/system/business-warehouse/list-all-simple' })
}

@ -156,9 +156,11 @@ export enum DICT_TYPE {
// ============= BUSINESSLINE 模块================= // ============= BUSINESSLINE 模块=================
BUSINESS_TYPE = 'business_type', //业务线类型 BUSINESS_TYPE = 'business_type', //业务线类型
DIFF_FLAG = 'diff_flag', DIFF_FLAG = 'diff_flag',
CLASS_STATUS = 'class_status', //类别状态
DUTY_TYPE = 'duty_type', //业务线的所属分类
BUSINESS_ORGANIZATION_TYPE = 'business_organization_type', //业务组织类型
// ============= ENTERPRISEBRANCHING 模块================= // ============= ENTERPRISEBRANCHING 模块=================
ENTERPRISE_TYPE = 'enterprise_type', //业务线类型 ENTERPRISE_TYPE = 'enterprise_type', //业务线类型
CLASS_STATUS = 'class_status',
} }

@ -0,0 +1,57 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="isUpdate ? t('action.edit') : t('action.create')" @ok="handleSubmit">
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, unref } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { BasicForm, useForm } from '@/components/Form'
import { BasicModal, useModalInner } from '@/components/Modal'
import { createFormSchema, updateFormSchema } from './businessOrganization.data'
import { createBusinessWarehouse, getBusinessWarehouse, updateBusinessWarehouse } from '@/api/xxjj/businessWarehouse'
defineOptions({ name: 'BusinessOrganizationModal' })
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
const [registerForm, { setFieldsValue, resetFields, resetSchema, validate }] = useForm({
labelWidth: 120,
baseColProps: { span: 24 },
schemas: createFormSchema,
showActionButtonGroup: false,
actionColOptions: { span: 23 }
})
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields()
setModalProps({ confirmLoading: false })
isUpdate.value = !!data?.isUpdate
if (unref(isUpdate)) {
resetSchema(updateFormSchema)
const res = await getBusinessWarehouse(data.record.id)
setFieldsValue({ ...res })
}
})
async function handleSubmit() {
try {
const values = await validate()
setModalProps({ confirmLoading: true })
if (unref(isUpdate)) {
await updateBusinessWarehouse(values)
} else {
await createBusinessWarehouse(values)
}
closeModal()
emit('success')
createMessage.success(t('common.saveSuccessText'))
} finally {
setModalProps({ confirmLoading: false })
}
}
</script>

@ -0,0 +1,258 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { listSimpleBusiness } from '@/api/xxjj/businessWarehouse'
export const columns: BasicColumn[] = [
{
title: '业务线名称',
dataIndex: 'name',
width: 160
},
{
title: '类型',
dataIndex: 'type',
width: 180,
customRender: ({ text }) => {
return useRender.renderDict(text, DICT_TYPE.BUSINESS_ORGANIZATION_TYPE)
}
},
{
title: '状态',
dataIndex: 'type',
width: 180,
customRender: ({ text }) => {
return useRender.renderDict(text, DICT_TYPE.CLASS_STATUS)
}
},
{
title: '成员数量',
dataIndex: 'employeeNum',
width: 160
},
{
title: '主管人员',
dataIndex: 'belongUserId',
width: 160
},
{
title: '描述',
dataIndex: 'description',
width: 160
},
{
title: '更新时间',
dataIndex: 'updateTime',
width: 180,
customRender: ({ text }) => {
return useRender.renderDate(text)
}
},
]
export const searchFormSchema: FormSchema[] = [
{
label: '业务线名称',
field: 'name',
component: 'Input',
colProps: { span: 8 }
},
// {
// label: '类型',
// field: 'type',
// component: 'Select',
// componentProps: {
// options: getDictOptions(DICT_TYPE.BUSINESS_ORGANIZATION_TYPE)
// },
// colProps: { span: 8 }
// },
// {
// label: '所属行业',
// field: 'industry',
// component: 'Select',
// componentProps: {
// options: getDictOptions(DICT_TYPE.DUTY_TYPE)
// },
// colProps: { span: 8 }
// },
// {
// label: '成立时间',
// field: 'establishDate',
// component: 'RangePicker',
// colProps: { span: 8 }
// },
// {
// label: '归属人员',
// field: 'belongUserId',
// component: 'Input',
// colProps: { span: 8 }
// },
// {
// label: '品牌/业务线/事业群名称',
// field: 'brandName',
// component: 'Input',
// colProps: { span: 8 }
// },
// {
// label: '业务线仓库区分(0业务线,1仓库)',
// field: 'diffFlag',
// component: 'Select',
// componentProps: {
// options: getDictOptions(DICT_TYPE.DIFF_FLAG)
// },
// colProps: { span: 8 }
// },
]
export const createFormSchema: FormSchema[] = [
{
label: '编号',
field: 'id',
show: false,
component: 'Input'
},
{
label: '业务组织编号',
field: 'businessCode',
required: true,
component: 'Input'
},
{
label: '业务组织名称',
field: 'name',
required: true,
component: 'Input'
},
{
label: '业务组织简称',
field: 'businessSimple',
component: 'Input'
},
{
label: '业务组织简称',
field: 'businessSimple',
component: 'Input'
},
{
label: '隶属业务线',
field: 'parentId',
required: true,
component: 'ApiTreeSelect',
componentProps: {
api: () => listSimpleBusiness(),
fieldNames: {
label: 'name',
key: 'id',
value: 'id',
},
handleTree: 'id',
},
},
{
label: '类型',
field: 'type',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.BUSINESS_ORGANIZATION_TYPE, 'number')
}
},
{
label: '所在城市',
field: 'city',
component: 'Input'
},
{
label: '成立时间',
field: 'establishDate',
component: 'DatePicker'
},
{
label: '归属人员',
field: 'belongUserId',
component: 'Input'
},
{
label: '介绍',
field: 'description',
component: 'InputTextArea'
},
{
label: '区分标志',
field: 'diffFlag',
required: true,
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.DIFF_FLAG, 'number')
}
},
]
export const updateFormSchema: FormSchema[] = [
{
label: '编号',
field: 'id',
show: false,
component: 'Input'
},
{
label: '业务线编号',
field: 'businessCode',
required: true,
component: 'Input'
},
{
label: '业务线名称',
field: 'name',
required: true,
component: 'Input'
},
{
label: '业务线简称',
field: 'businessSimple',
component: 'Input'
},
{
label: '类型',
field: 'type',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.BUSINESS_ORGANIZATION_TYPE, 'number')
}
},
{
label: '所属行业',
field: 'industry',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.DUTY_TYPE, 'number')
}
},
{
label: '所在城市',
field: 'city',
component: 'Input'
},
{
label: '成立时间',
field: 'establishDate',
component: 'DatePicker'
},
{
label: '介绍',
field: 'description',
component: 'InputTextArea'
},
{
label: '归属人员',
field: 'belongUserId',
component: 'Input'
},
{
label: '区分标志',
field: 'diffFlag',
required: true,
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.DIFF_FLAG, 'number')
}
},
]

@ -0,0 +1,92 @@
<template>
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" v-auth="['system:business-warehouse:create']" :preIcon="IconEnum.ADD" @click="handleCreate">
{{ t('action.create') }}
</a-button>
<a-button type="warning" v-auth="['system:business-warehouse:export']" :preIcon="IconEnum.EXPORT" @click="handleExport">
{{ t('action.export') }}
</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: IconEnum.EDIT, label: t('action.edit'), auth: 'system:business-warehouse:update', onClick: handleEdit.bind(null, record) },
{
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
auth: 'system:business-warehouse:delete',
popConfirm: {
title: t('common.delMessage'),
placement: 'left',
confirm: handleDelete.bind(null, record)
}
}
]"
/>
</template>
</template>
</BasicTable>
<BusinessOrganizationModal @register="registerModal" @success="reload()" />
</div>
</template>
<script lang="ts" setup>
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import BusinessOrganizationModal from './BusinessOrganizationModal.vue'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteBusinessWarehouse, exportBusinessWarehouse, getBusinessWarehousePage } from '@/api/xxjj/businessWarehouse'
import { columns, searchFormSchema } from './businessOrganization.data'
defineOptions({ name: 'BusinessOrganization' })
const { t } = useI18n()
const { createConfirm, createMessage } = useMessage()
const [registerModal, { openModal }] = useModal()
const [registerTable, { getForm, reload }] = useTable({
title: '业务线列表',
api: getBusinessWarehousePage,
columns,
formConfig: { labelWidth: 120, schemas: searchFormSchema },
useSearchForm: true,
showTableSetting: true,
actionColumn: {
width: 140,
title: t('common.action'),
dataIndex: 'action',
fixed: 'right'
}
})
function handleCreate() {
openModal(true, { isUpdate: false })
}
function handleEdit(record: Recordable) {
openModal(true, { record, isUpdate: true })
}
async function handleExport() {
createConfirm({
title: t('common.exportTitle'),
iconType: 'warning',
content: t('common.exportMessage'),
async onOk() {
await exportBusinessWarehouse(getForm().getFieldsValue())
createMessage.success(t('common.exportSuccessText'))
}
})
}
async function handleDelete(record: Recordable) {
await deleteBusinessWarehouse(record.id)
createMessage.success(t('common.delSuccessText'))
reload()
}
</script>

@ -0,0 +1,42 @@
<script lang="ts" setup>
import { onMounted, ref } from 'vue'
import type { TreeItem } from '@/components/Tree'
import { BasicTree } from '@/components/Tree'
import { listSimpleDept } from '@/api/system/dept'
import { listSimpleBusiness } from '@/api/xxjj/businessWarehouse'
import { handleTree } from '@/utils/tree'
defineOptions({ name: 'SystemDeptTree' })
const emit = defineEmits(['select'])
const treeData = ref<TreeItem[]>([])
async function fetch() {
const res = await listSimpleBusiness()
treeData.value = handleTree(res, 'id')
}
function handleSelect(keys) {
emit('select', keys[0])
}
onMounted(() => {
fetch()
})
</script>
<template>
<div class="m-4 mr-0 overflow-hidden">
<BasicTree
title="业务线列表"
toolbar
search
tree-wrapper-class-name="h-[calc(100%-35px)] overflow-auto"
:click-row-to-expand="false"
:tree-data="treeData"
:field-names="{ key: 'id', title: 'name' }"
@select="handleSelect"
/>
</div>
</template>

@ -0,0 +1,57 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="isUpdate ? t('action.edit') : t('action.create')" @ok="handleSubmit">
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, unref } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { BasicForm, useForm } from '@/components/Form'
import { BasicModal, useModalInner } from '@/components/Modal'
import { createFormSchema, updateFormSchema } from './businessWarehouse.data'
import { createBusinessWarehouse, getBusinessWarehouse, updateBusinessWarehouse } from '@/api/xxjj/businessWarehouse'
defineOptions({ name: 'BusinessWarehouseModal' })
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
const [registerForm, { setFieldsValue, resetFields, resetSchema, validate }] = useForm({
labelWidth: 120,
baseColProps: { span: 24 },
schemas: createFormSchema,
showActionButtonGroup: false,
actionColOptions: { span: 23 }
})
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields()
setModalProps({ confirmLoading: false })
isUpdate.value = !!data?.isUpdate
if (unref(isUpdate)) {
resetSchema(updateFormSchema)
const res = await getBusinessWarehouse(data.record.id)
setFieldsValue({ ...res })
}
})
async function handleSubmit() {
try {
const values = await validate()
setModalProps({ confirmLoading: true })
if (unref(isUpdate)) {
await updateBusinessWarehouse(values)
} else {
await createBusinessWarehouse(values)
}
closeModal()
emit('success')
createMessage.success(t('common.saveSuccessText'))
} finally {
setModalProps({ confirmLoading: false })
}
}
</script>

@ -0,0 +1,250 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
title: '业务线名称',
dataIndex: 'name',
width: 160
},
{
title: '类型',
dataIndex: 'type',
width: 180,
customRender: ({ text }) => {
return useRender.renderDict(text, DICT_TYPE.BUSINESS_TYPE)
}
},
{
title: '状态',
dataIndex: 'type',
width: 180,
customRender: ({ text }) => {
return useRender.renderDict(text, DICT_TYPE.CLASS_STATUS)
}
},
{
title: '关联机构',
dataIndex: 'institutionNum',
width: 160
},
{
title: '成员数量',
dataIndex: 'employeeNum',
width: 160
},
{
title: '主管人员',
dataIndex: 'belongUserId',
width: 160
},
{
title: '介绍',
dataIndex: 'description',
width: 160
},
{
title: '更新时间',
dataIndex: 'updateTime',
width: 180,
customRender: ({ text }) => {
return useRender.renderDate(text)
}
},
]
export const searchFormSchema: FormSchema[] = [
{
label: '业务线名称',
field: 'name',
component: 'Input',
colProps: { span: 8 }
},
// {
// label: '类型',
// field: 'type',
// component: 'Select',
// componentProps: {
// options: getDictOptions(DICT_TYPE.BUSINESS_TYPE)
// },
// colProps: { span: 8 }
// },
// {
// label: '所属行业',
// field: 'industry',
// component: 'Select',
// componentProps: {
// options: getDictOptions(DICT_TYPE.DUTY_TYPE)
// },
// colProps: { span: 8 }
// },
// {
// label: '成立时间',
// field: 'establishDate',
// component: 'RangePicker',
// colProps: { span: 8 }
// },
// {
// label: '归属人员',
// field: 'belongUserId',
// component: 'Input',
// colProps: { span: 8 }
// },
// {
// label: '品牌/业务线/事业群名称',
// field: 'brandName',
// component: 'Input',
// colProps: { span: 8 }
// },
// {
// label: '业务线仓库区分(0业务线,1仓库)',
// field: 'diffFlag',
// component: 'Select',
// componentProps: {
// options: getDictOptions(DICT_TYPE.DIFF_FLAG)
// },
// colProps: { span: 8 }
// },
]
export const createFormSchema: FormSchema[] = [
{
label: '编号',
field: 'id',
show: false,
component: 'Input'
},
{
label: '业务线编号',
field: 'businessCode',
required: true,
component: 'Input'
},
{
label: '业务线名称',
field: 'name',
required: true,
component: 'Input'
},
{
label: '业务线简称',
field: 'businessSimple',
component: 'Input'
},
{
label: '类型',
field: 'type',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.BUSINESS_TYPE, 'number')
}
},
{
label: '所属行业',
field: 'industry',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.DUTY_TYPE, 'number')
}
},
{
label: '所在城市',
field: 'city',
component: 'Input'
},
{
label: '成立时间',
field: 'establishDate',
component: 'DatePicker'
},
{
label: '介绍',
field: 'description',
component: 'InputTextArea'
},
{
label: '归属人员',
field: 'belongUserId',
component: 'Input'
},
{
label: '区分标志',
field: 'diffFlag',
required: true,
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.DIFF_FLAG, 'number')
}
},
]
export const updateFormSchema: FormSchema[] = [
{
label: '编号',
field: 'id',
show: false,
component: 'Input'
},
{
label: '业务线编号',
field: 'businessCode',
required: true,
component: 'Input'
},
{
label: '业务线名称',
field: 'name',
required: true,
component: 'Input'
},
{
label: '业务线简称',
field: 'businessSimple',
component: 'Input'
},
{
label: '类型',
field: 'type',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.BUSINESS_TYPE, 'number')
}
},
{
label: '所属行业',
field: 'industry',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.DUTY_TYPE, 'number')
}
},
{
label: '所在城市',
field: 'city',
component: 'Input'
},
{
label: '成立时间',
field: 'establishDate',
component: 'DatePicker'
},
{
label: '介绍',
field: 'description',
component: 'InputTextArea'
},
{
label: '归属人员',
field: 'belongUserId',
component: 'Input'
},
{
label: '区分标志',
field: 'diffFlag',
required: true,
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.DIFF_FLAG, 'number')
}
},
]

@ -0,0 +1,102 @@
<template>
<div class="flex">
<BusinessTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
<BasicTable class="w-3/4 xl:w-4/5" :search-info="searchInfo" @register="registerTable">
<template #toolbar>
<a-button type="primary" v-auth="['system:business-warehouse:create']" :preIcon="IconEnum.ADD" @click="handleCreate">
{{ t('action.create') }}
</a-button>
<a-button type="warning" v-auth="['system:business-warehouse:export']" :preIcon="IconEnum.EXPORT" @click="handleExport">
{{ t('action.export') }}
</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: IconEnum.EDIT, label: t('action.edit'), auth: 'system:business-warehouse:update', onClick: handleEdit.bind(null, record) },
{
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
auth: 'system:business-warehouse:delete',
popConfirm: {
title: t('common.delMessage'),
placement: 'left',
confirm: handleDelete.bind(null, record)
}
}
]"
/>
</template>
</template>
</BasicTable>
<BusinessWarehouseModal @register="registerModal" @success="reload()" />
</div>
</template>
<script lang="ts" setup>
import { reactive } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import BusinessWarehouseModal from './BusinessWarehouseModal.vue'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteBusinessWarehouse, exportBusinessWarehouse, getBusinessWarehousePage } from '@/api/xxjj/businessWarehouse'
import { columns, searchFormSchema } from './businessWarehouse.data'
import BusinessTree from './BusinessTree.vue'
defineOptions({ name: 'BusinessWarehouse' })
const { t } = useI18n()
const { createConfirm, createMessage } = useMessage()
const [registerModal, { openModal }] = useModal()
const searchInfo = reactive<Recordable>({})
const [registerTable, { getForm, reload }] = useTable({
title: '业务线/仓库列表',
api: getBusinessWarehousePage,
columns,
formConfig: { labelWidth: 120, schemas: searchFormSchema },
useSearchForm: true,
showTableSetting: true,
actionColumn: {
width: 140,
title: t('common.action'),
dataIndex: 'action',
fixed: 'right'
}
})
function handleCreate() {
openModal(true, { isUpdate: false })
}
function handleEdit(record: Recordable) {
openModal(true, { record, isUpdate: true })
}
async function handleExport() {
createConfirm({
title: t('common.exportTitle'),
iconType: 'warning',
content: t('common.exportMessage'),
async onOk() {
await exportBusinessWarehouse(getForm().getFieldsValue())
createMessage.success(t('common.exportSuccessText'))
}
})
}
async function handleDelete(record: Recordable) {
await deleteBusinessWarehouse(record.id)
createMessage.success(t('common.delSuccessText'))
reload()
}
/** 点击部门操作 */
function handleSelect(deptId = '') {
searchInfo.deptId = deptId
reload()
}
</script>

@ -21,7 +21,7 @@ const isUpdate = ref(true)
const [registerForm, { setFieldsValue, resetFields, resetSchema, validate }] = useForm({ const [registerForm, { setFieldsValue, resetFields, resetSchema, validate }] = useForm({
labelWidth: 120, labelWidth: 120,
baseColProps: { span: 24 }, baseColProps: { span: 12 },
schemas: createFormSchema, schemas: createFormSchema,
showActionButtonGroup: false, showActionButtonGroup: false,
actionColOptions: { span: 23 } actionColOptions: { span: 23 }

@ -120,26 +120,6 @@ export const createFormSchema: FormSchema[] = [
required: true, required: true,
component: 'Input' component: 'Input'
}, },
{
label: '业务线简称',
field: 'businessSimple',
component: 'Input'
},
{
label: '传真',
field: 'fax',
component: 'Input'
},
{
label: '网址',
field: 'url',
component: 'Input'
},
{
label: '介绍',
field: 'description',
component: 'InputTextArea'
},
{ {
label: '业务线名称', label: '业务线名称',
field: 'name', field: 'name',
@ -147,17 +127,8 @@ export const createFormSchema: FormSchema[] = [
component: 'Input' component: 'Input'
}, },
{ {
label: '业务线LOGO', label: '业务线简称',
field: 'businessLogo', field: 'businessSimple',
component: 'FileUpload',
componentProps: {
fileType: 'file',
maxCount: 1
}
},
{
label: '父id',
field: 'parentId',
component: 'Input' component: 'Input'
}, },
{ {
@ -187,22 +158,17 @@ export const createFormSchema: FormSchema[] = [
component: 'DatePicker' component: 'DatePicker'
}, },
{ {
label: '归属人员', label: '介绍',
field: 'belongUserId', field: 'description',
component: 'Input' component: 'InputTextArea'
},
{
label: '品牌/业务线/事业群名称',
field: 'brandName',
component: 'Input'
}, },
{ {
label: '电话', label: '归属人员',
field: 'phone', field: 'belongUserId',
component: 'Input' component: 'Input'
}, },
{ {
label: '业务线仓库区分(0业务线,1仓库)', label: '区分标志',
field: 'diffFlag', field: 'diffFlag',
required: true, required: true,
component: 'Select', component: 'Select',
@ -225,11 +191,6 @@ export const updateFormSchema: FormSchema[] = [
required: true, required: true,
component: 'Input' component: 'Input'
}, },
{
label: '业务线简称',
field: 'businessSimple',
component: 'Input'
},
{ {
label: '业务线名称', label: '业务线名称',
field: 'name', field: 'name',
@ -237,13 +198,8 @@ export const updateFormSchema: FormSchema[] = [
component: 'Input' component: 'Input'
}, },
{ {
label: '业务线LOGO', label: '业务线简称',
field: 'businessLogo', field: 'businessSimple',
component: 'Upload'
},
{
label: '父id',
field: 'parentId',
component: 'Input' component: 'Input'
}, },
{ {
@ -272,38 +228,18 @@ export const updateFormSchema: FormSchema[] = [
field: 'establishDate', field: 'establishDate',
component: 'DatePicker' component: 'DatePicker'
}, },
{
label: '归属人员',
field: 'belongUserId',
component: 'Input'
},
{
label: '品牌/业务线/事业群名称',
field: 'brandName',
component: 'Input'
},
{
label: '电话',
field: 'phone',
component: 'Input'
},
{
label: '传真',
field: 'fax',
component: 'Input'
},
{
label: '网址',
field: 'url',
component: 'Input'
},
{ {
label: '介绍', label: '介绍',
field: 'description', field: 'description',
component: 'InputTextArea' component: 'InputTextArea'
}, },
{ {
label: '业务线仓库区分(0业务线,1仓库)', label: '归属人员',
field: 'belongUserId',
component: 'Input'
},
{
label: '区分标志',
field: 'diffFlag', field: 'diffFlag',
required: true, required: true,
component: 'Select', component: 'Select',

@ -2,10 +2,10 @@
<div> <div>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" v-auth="['xxjj:business-warehouse:create']" :preIcon="IconEnum.ADD" @click="handleCreate"> <a-button type="primary" v-auth="['system:business-warehouse:create']" :preIcon="IconEnum.ADD" @click="handleCreate">
{{ t('action.create') }} {{ t('action.create') }}
</a-button> </a-button>
<a-button type="warning" v-auth="['xxjj:business-warehouse:export']" :preIcon="IconEnum.EXPORT" @click="handleExport"> <a-button type="warning" v-auth="['system:business-warehouse:export']" :preIcon="IconEnum.EXPORT" @click="handleExport">
{{ t('action.export') }} {{ t('action.export') }}
</a-button> </a-button>
</template> </template>
@ -13,12 +13,12 @@
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<TableAction <TableAction
:actions="[ :actions="[
{ icon: IconEnum.EDIT, label: t('action.edit'), auth: 'xxjj:business-warehouse:update', onClick: handleEdit.bind(null, record) }, { icon: IconEnum.EDIT, label: t('action.edit'), auth: 'system:business-warehouse:update', onClick: handleEdit.bind(null, record) },
{ {
icon: IconEnum.DELETE, icon: IconEnum.DELETE,
color: 'error', color: 'error',
label: t('action.delete'), label: t('action.delete'),
auth: 'xxjj:business-warehouse:delete', auth: 'system:business-warehouse:delete',
popConfirm: { popConfirm: {
title: t('common.delMessage'), title: t('common.delMessage'),
placement: 'left', placement: 'left',

@ -0,0 +1,18 @@
package com.yunxi.scm.module.system.enums.business;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum BusinessEnum {
ENABLE("0"), // 启用
DISABLE("1"); // 禁用
/**
*
*/
private final String status;
}

@ -1,5 +1,11 @@
package com.yunxi.scm.module.system.controller.admin.businesswarehouse; package com.yunxi.scm.module.system.controller.admin.businesswarehouse;
import com.yunxi.scm.framework.common.enums.CommonStatusEnum;
import com.yunxi.scm.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
import com.yunxi.scm.module.system.controller.admin.dept.vo.dept.DeptSimpleRespVO;
import com.yunxi.scm.module.system.convert.dept.DeptConvert;
import com.yunxi.scm.module.system.dal.dataobject.dept.DeptDO;
import com.yunxi.scm.module.system.enums.business.BusinessEnum;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@ -99,4 +105,17 @@ public class BusinessWarehouseController {
ExcelUtils.write(response, "业务线表.xls", "数据", BusinessWarehouseExcelVO.class, datas); ExcelUtils.write(response, "业务线表.xls", "数据", BusinessWarehouseExcelVO.class, datas);
} }
@GetMapping("/list-all-simple")
@Operation(summary = "获取业务线精简信息列表", description = "只包含被开启的业务线,主要用于前端的下拉选项")
@PreAuthorize("@ss.hasPermission('system:business-warehouse:list-all-simple')")
public CommonResult<List<BusinessSimpleRespVo>> getSimpleBusinessList() {
// 获得业务线列表,只要开启状态的
BusinessWarehousePageReqVO pageReqVO = new BusinessWarehousePageReqVO();
// pageReqVO.setStatus(BusinessEnum.ENABLE.getStatus());
// pageReqVO.setDiffFlag("0");
List<BusinessWarehouseDO> list = businessWarehouseService.getBusinessSimpleList(pageReqVO);
return success(BusinessWarehouseConvert.INSTANCE.convertList03(list));
}
} }

@ -0,0 +1,21 @@
package com.yunxi.scm.module.system.controller.admin.businesswarehouse.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@Schema(description = "管理后台 - 业务线表精简信息 Response VO")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BusinessSimpleRespVo {
@Schema(description = "业务线编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "业务线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
private String name;
@Schema(description = "父部门 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long parentId;
}

@ -16,4 +16,7 @@ public class BusinessWarehouseRespVO extends BusinessWarehouseBaseVO {
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime; private LocalDateTime createTime;
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime updateTime;
} }

@ -25,8 +25,12 @@ public interface BusinessWarehouseConvert {
BusinessWarehouseRespVO convert(BusinessWarehouseDO bean); BusinessWarehouseRespVO convert(BusinessWarehouseDO bean);
BusinessSimpleRespVo convert03(BusinessWarehouseDO bean);
List<BusinessWarehouseRespVO> convertList(List<BusinessWarehouseDO> list); List<BusinessWarehouseRespVO> convertList(List<BusinessWarehouseDO> list);
List<BusinessSimpleRespVo> convertList03(List<BusinessWarehouseDO> list);
PageResult<BusinessWarehouseRespVO> convertPage(PageResult<BusinessWarehouseDO> page); PageResult<BusinessWarehouseRespVO> convertPage(PageResult<BusinessWarehouseDO> page);
List<BusinessWarehouseExcelVO> convertList02(List<BusinessWarehouseDO> list); List<BusinessWarehouseExcelVO> convertList02(List<BusinessWarehouseDO> list);

@ -5,7 +5,9 @@ import java.util.*;
import com.yunxi.scm.framework.common.pojo.PageResult; import com.yunxi.scm.framework.common.pojo.PageResult;
import com.yunxi.scm.framework.mybatis.core.query.LambdaQueryWrapperX; import com.yunxi.scm.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yunxi.scm.framework.mybatis.core.mapper.BaseMapperX; import com.yunxi.scm.framework.mybatis.core.mapper.BaseMapperX;
import com.yunxi.scm.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
import com.yunxi.scm.module.system.dal.dataobject.businesswarehouse.BusinessWarehouseDO; import com.yunxi.scm.module.system.dal.dataobject.businesswarehouse.BusinessWarehouseDO;
import com.yunxi.scm.module.system.dal.dataobject.dept.DeptDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import com.yunxi.scm.module.system.controller.admin.businesswarehouse.vo.*; import com.yunxi.scm.module.system.controller.admin.businesswarehouse.vo.*;
@ -67,4 +69,10 @@ public interface BusinessWarehouseMapper extends BaseMapperX<BusinessWarehouseDO
.orderByDesc(BusinessWarehouseDO::getId)); .orderByDesc(BusinessWarehouseDO::getId));
} }
default List<BusinessWarehouseDO> simpleBusiness(BusinessWarehousePageReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<BusinessWarehouseDO>()
.eqIfPresent(BusinessWarehouseDO::getStatus, reqVO.getStatus())
.eqIfPresent(BusinessWarehouseDO::getDiffFlag, reqVO.getDiffFlag()));
}
} }

@ -67,4 +67,9 @@ public interface BusinessWarehouseService {
*/ */
List<BusinessWarehouseDO> getBusinessWarehouseList(BusinessWarehouseExportReqVO exportReqVO); List<BusinessWarehouseDO> getBusinessWarehouseList(BusinessWarehouseExportReqVO exportReqVO);
/**
* 线
* */
List<BusinessWarehouseDO> getBusinessSimpleList(BusinessWarehousePageReqVO pageReqVO);
} }

@ -79,4 +79,9 @@ public class BusinessWarehouseServiceImpl implements BusinessWarehouseService {
return businessWarehouseMapper.selectList(exportReqVO); return businessWarehouseMapper.selectList(exportReqVO);
} }
@Override
public List<BusinessWarehouseDO> getBusinessSimpleList(BusinessWarehousePageReqVO pageReqVO) {
return businessWarehouseMapper.simpleBusiness(pageReqVO);
}
} }

@ -1,5 +1,5 @@
server: server:
port: 48080 port: 8091
--- #################### 数据库相关配置 #################### --- #################### 数据库相关配置 ####################
@ -37,38 +37,48 @@ spring:
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒 time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒 min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒 max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
validation-query: SELECT 1 # 配置检测连接是否有效 validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
test-while-idle: true test-while-idle: true
test-on-borrow: false test-on-borrow: false
test-on-return: false test-on-return: false
primary: master primary: master
datasource: datasource:
master: master:
name: yxsass name: yxscm
url: jdbc:mysql://112.124.64.122:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true url: jdbc:mysql://222.71.165.188:3309/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
driver-class-name: com.mysql.jdbc.Driver # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例
username: yxsass # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.master.name} # PostgreSQL 连接的示例
password: jxjitjjxJFNM5YNW # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改 # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.master.name} # SQLServer 连接的示例
name: yxsass username: root
url: jdbc:mysql://112.124.64.122:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true password: linus,.123
driver-class-name: com.mysql.jdbc.Driver # username: sa
username: yxsass # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W
password: jxjitjjxJFNM5YNW slave: # 模拟从库,可根据自己需要修改
name: yxscm
url: jdbc:mysql://222.71.165.188:3309/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
# url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例
# url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例
# url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
# url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.slave.name} # SQLServer 连接的示例
username: root
password: linus,.123
# username: sa
# password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
redis: redis:
host: 400-infra.server.iocoder.cn # 地址 host: 127.0.0.1 # 地址
port: 6379 # 端口 port: 6379 # 端口
database: 1 # 数据库索引 database: 0 # 数据库索引
# password: 123456 # 密码,建议生产环境开启 password: 'qweasd,.123' # 密码,建议生产环境开启
--- #################### 定时任务相关配置 #################### --- #################### 定时任务相关配置 ####################
# Quartz 配置项,对应 QuartzProperties 配置类 # Quartz 配置项,对应 QuartzProperties 配置类
spring: spring:
quartz: quartz:
auto-startup: true # 测试环境,需要开启 Job auto-startup: false # 本地开发环境,尽量不要开启 Job
scheduler-name: schedulerName # Scheduler 名字。默认为 schedulerName scheduler-name: schedulerName # Scheduler 名字。默认为 schedulerName
job-store-type: jdbc # Job 存储器类型。默认为 memory 表示内存,可选 jdbc 使用数据库。 job-store-type: jdbc # Job 存储器类型。默认为 memory 表示内存,可选 jdbc 使用数据库。
wait-for-jobs-to-complete-on-shutdown: true # 应用关闭时,是否等待定时任务执行完成。默认为 false ,建议设置为 true wait-for-jobs-to-complete-on-shutdown: true # 应用关闭时,是否等待定时任务执行完成。默认为 false ,建议设置为 true
@ -127,7 +137,7 @@ spring:
admin: admin:
# Spring Boot Admin Client 客户端的相关配置 # Spring Boot Admin Client 客户端的相关配置
client: client:
url: http://127.0.0.1:${server.port}/${spring.boot.admin.context-path} # 设置 Spring Boot Admin Server 地址 url: http://222.71.165.187:${server.port}/${spring.boot.admin.context-path} # 设置 Spring Boot Admin Server 地址
instance: instance:
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME] service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
# Spring Boot Admin Server 服务端的相关配置 # Spring Boot Admin Server 服务端的相关配置
@ -137,11 +147,25 @@ spring:
logging: logging:
file: file:
name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径
level:
--- #################### 微信公众号相关配置 #################### # 配置自己写的 MyBatis Mapper 打印日志
wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档 com.yunxi.scm.module.bpm.dal.mysql: debug
mp: com.yunxi.scm.module.infra.dal.mysql: debug
# 公众号配置(必填) com.yunxi.scm.module.infra.dal.mysql.job.JobLogMapper: INFO # 配置 JobLogMapper 的日志级别为 info
com.yunxi.scm.module.pay.dal.mysql: debug
com.yunxi.scm.module.pay.dal.mysql.notify.PayNotifyTaskMapper: INFO # 配置 JobLogMapper 的日志级别为 info
com.yunxi.scm.module.system.dal.mysql: debug
com.yunxi.scm.module.tool.dal.mysql: debug
com.yunxi.scm.module.member.dal.mysql: debug
com.yunxi.scm.module.trade.dal.mysql: debug
com.yunxi.scm.module.promotion.dal.mysql: debug
com.yunxi.scm.module.demo.dal.mysql: debug # demo模块 MyBatis 操作日志
debug: false
--- #################### 微信公众号、小程序相关配置 ####################
wx:
mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
app-id: wx041349c6f39b268b app-id: wx041349c6f39b268b
secret: 5abee519483bc9f8cb37ce280e814bd0 secret: 5abee519483bc9f8cb37ce280e814bd0
# 存储配置,解决 AccessToken 的跨节点的共享 # 存储配置,解决 AccessToken 的跨节点的共享
@ -150,8 +174,8 @@ wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-sta
key-prefix: wx # Redis Key 的前缀 key-prefix: wx # Redis Key 的前缀
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台 http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档 miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档
appid: wx63c280fe3248a3e7 appid: wx62056c0d5e8db250
secret: 6f270509224a7ae1296bbf1c8cb97aed secret: 333ae72f41552af1e998fe1f54e1584a
config-storage: config-storage:
type: RedisTemplate # 采用 RedisTemplate 操作 Redis会自动从 Spring 中获取 type: RedisTemplate # 采用 RedisTemplate 操作 Redis会自动从 Spring 中获取
key-prefix: wa # Redis Key 的前缀 key-prefix: wa # Redis Key 的前缀
@ -161,6 +185,10 @@ wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-sta
# 芋道配置项,设置当前项目所有自定义的配置 # 芋道配置项,设置当前项目所有自定义的配置
yunxi: yunxi:
captcha:
enable: false # 本地环境,暂时关闭图片验证码,方便登录等接口的测试;
security:
mock-enable: true
xss: xss:
enable: false enable: false
exclude-urls: # 如下两个 url仅仅是为了演示去掉配置也没关系 exclude-urls: # 如下两个 url仅仅是为了演示去掉配置也没关系
@ -169,7 +197,11 @@ yunxi:
pay: pay:
order-notify-url: http://yunai.natapp1.cc/admin-api/pay/notify/order # 支付渠道的【支付】回调地址 order-notify-url: http://yunai.natapp1.cc/admin-api/pay/notify/order # 支付渠道的【支付】回调地址
refund-notify-url: http://yunai.natapp1.cc/admin-api/pay/notify/refund # 支付渠道的【退款】回调地址 refund-notify-url: http://yunai.natapp1.cc/admin-api/pay/notify/refund # 支付渠道的【退款】回调地址
demo: true # 开启演示模式 access-log: # 访问日志的配置项
enable: false
error-code: # 错误码相关配置项
enable: false
demo: false # 关闭演示模式
justauth: justauth:
enabled: true enabled: true
@ -183,15 +215,14 @@ justauth:
client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw
agent-id: 1000004 agent-id: 1000004
ignore-check-redirect-uri: true ignore-check-redirect-uri: true
WECHAT_MINI_APP: # 微信小程序
client-id: ${wx.miniapp.appid}
client-secret: ${wx.miniapp.secret}
ignore-check-redirect-uri: true
ignore-check-state: true # 微信小程序,不会使用到 state所以不进行校验
cache: cache:
type: REDIS type: REDIS
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE:: prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟 timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
wx:
mp:
useRedis: false
defaultContent: \u60A8\u597D\uFF0C\u6709\u4EC0\u4E48\u95EE\u9898\uFF1F
redisConfig:
host: 127.0.0.1
port: 6379
password:

Loading…
Cancel
Save