qhw-dev-0927
杨世强 1 year ago
parent 1a968ebe48
commit 8655c2ed97

@ -0,0 +1,31 @@
import { defHttp } from '@/utils/http/axios'
// 查询业务线/仓库列表
export function getBusinessWarehousePage(params) {
return defHttp.get({ url: '/xxjj/business-warehouse/page', params })
}
// 查询业务线/仓库详情
export function getBusinessWarehouse(id: number) {
return defHttp.get({ url: '/xxjj/business-warehouse/get?id=' + id })
}
// 新增业务线/仓库
export function createBusinessWarehouse(data) {
return defHttp.post({ url: '/xxjj/business-warehouse/create', data })
}
// 修改业务线/仓库
export function updateBusinessWarehouse(data) {
return defHttp.put({ url: '/xxjj/business-warehouse/update', data })
}
// 删除业务线/仓库
export function deleteBusinessWarehouse(id: number) {
return defHttp.delete({ url: '/xxjj/business-warehouse/delete?id=' + id })
}
// 导出业务线/仓库 Excel
export function exportBusinessWarehouse(params) {
return defHttp.download({ url: '/xxjj/business-warehouse/export-excel', params }, '业务线/仓库.xls')
}

@ -152,4 +152,8 @@ export enum DICT_TYPE {
PROMOTION_COUPON_TAKE_TYPE = 'promotion_coupon_take_type', // 优惠劵的领取方式 PROMOTION_COUPON_TAKE_TYPE = 'promotion_coupon_take_type', // 优惠劵的领取方式
PROMOTION_ACTIVITY_STATUS = 'promotion_activity_status', // 优惠活动的状态 PROMOTION_ACTIVITY_STATUS = 'promotion_activity_status', // 优惠活动的状态
PROMOTION_CONDITION_TYPE = 'promotion_condition_type', // 营销的条件类型枚举 PROMOTION_CONDITION_TYPE = 'promotion_condition_type', // 营销的条件类型枚举
// ============= BUSINESSLINE 模块=================
BUSINESS_TYPE = 'business_type', //业务线类型
DIFF_FLAG = 'diff_flag',
} }

@ -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,425 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
title: '业务id',
dataIndex: 'id',
width: 160
},
{
title: '业务线编号',
dataIndex: 'businessCode',
width: 160
},
{
title: '业务线简称',
dataIndex: 'businessSimple',
width: 160
},
{
title: '传真',
dataIndex: 'fax',
width: 160
},
{
title: '网址',
dataIndex: 'url',
width: 160
},
{
title: '介绍',
dataIndex: 'description',
width: 160
},
{
title: '创建时间',
dataIndex: 'createTime',
width: 180,
customRender: ({ text }) => {
return useRender.renderDate(text)
}
},
{
title: '业务线名称',
dataIndex: 'name',
width: 160
},
{
title: '业务线LOGO',
dataIndex: 'businessLogo',
width: 160
},
{
title: '父id',
dataIndex: 'parentId',
width: 160
},
{
title: '类型',
dataIndex: 'type',
width: 180,
customRender: ({ text }) => {
return useRender.renderDict(text, DICT_TYPE.BUSINESS_TYPE)
}
},
{
title: '所属行业',
dataIndex: 'industry',
width: 180,
customRender: ({ text }) => {
return useRender.renderDict(text, DICT_TYPE.DUTY_TYPE)
}
},
{
title: '所在城市',
dataIndex: 'city',
width: 160
},
{
title: '成立时间',
dataIndex: 'establishDate',
width: 180,
customRender: ({ text }) => {
return useRender.renderDate(text)
}
},
{
title: '归属人员',
dataIndex: 'belongUserId',
width: 160
},
{
title: '品牌/业务线/事业群名称',
dataIndex: 'brandName',
width: 160
},
{
title: '电话',
dataIndex: 'phone',
width: 160
},
{
title: '业务线仓库区分(0业务线,1仓库)',
dataIndex: 'diffFlag',
width: 180,
customRender: ({ text }) => {
return useRender.renderDict(text, DICT_TYPE.DIFF_FLAG)
}
},
]
export const searchFormSchema: FormSchema[] = [
// {
// label: '业务线编号',
// field: 'businessCode',
// component: 'Input',
// colProps: { span: 8 }
// },
// {
// label: '业务线简称',
// field: 'businessSimple',
// component: 'Input',
// colProps: { span: 8 }
// },
// {
// label: '传真',
// field: 'fax',
// component: 'Input',
// colProps: { span: 8 }
// },
// {
// label: '网址',
// field: 'url',
// component: 'Input',
// colProps: { span: 8 }
// },
// {
// label: '介绍',
// field: 'description',
// colProps: { span: 8 }
// },
// {
// label: '创建时间',
// field: 'createTime',
// component: 'RangePicker',
// colProps: { span: 8 }
// },
{
label: '业务线名称',
field: 'name',
component: 'Input',
colProps: { span: 8 }
},
// {
// label: '业务线LOGO',
// field: 'businessLogo',
// component: 'Input',
// colProps: { span: 8 }
// },
// {
// label: '父id',
// field: 'parentId',
// 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: 'city',
// component: 'Input',
// 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: '电话',
// field: 'phone',
// 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: 'businessSimple',
component: 'Input'
},
{
label: '传真',
field: 'fax',
component: 'Input'
},
{
label: '网址',
field: 'url',
component: 'Input'
},
{
label: '介绍',
field: 'description',
component: 'InputTextArea'
},
{
label: '业务线名称',
field: 'name',
required: true,
component: 'Input'
},
{
label: '业务线LOGO',
field: 'businessLogo',
component: 'Input'
},
{
label: '父id',
field: 'parentId',
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: 'belongUserId',
component: 'Input'
},
{
label: '品牌/业务线/事业群名称',
field: 'brandName',
component: 'Input'
},
{
label: '电话',
field: 'phone',
component: 'Input'
},
{
label: '业务线仓库区分(0业务线,1仓库)',
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: 'businessSimple',
component: 'Input'
},
{
label: '传真',
field: 'fax',
component: 'Input'
},
{
label: '网址',
field: 'url',
component: 'Input'
},
{
label: '介绍',
field: 'description',
component: 'InputTextArea'
},
{
label: '业务线名称',
field: 'name',
required: true,
component: 'Input'
},
{
label: '业务线LOGO',
field: 'businessLogo',
component: 'Input'
},
{
label: '父id',
field: 'parentId',
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: 'belongUserId',
component: 'Input'
},
{
label: '品牌/业务线/事业群名称',
field: 'brandName',
component: 'Input'
},
{
label: '电话',
field: 'phone',
component: 'Input'
},
{
label: '业务线仓库区分(0业务线,1仓库)',
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="['xxjj:business-warehouse:create']" :preIcon="IconEnum.ADD" @click="handleCreate">
{{ t('action.create') }}
</a-button>
<a-button type="warning" v-auth="['xxjj: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: 'xxjj:business-warehouse:update', onClick: handleEdit.bind(null, record) },
{
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
auth: 'xxjj: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 { 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'
defineOptions({ name: 'BusinessWarehouse' })
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>

@ -30,6 +30,11 @@
<artifactId>yunxi-spring-boot-starter-biz-operatelog</artifactId> <artifactId>yunxi-spring-boot-starter-biz-operatelog</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.yunxi.scm</groupId>
<artifactId>yunxi-spring-boot-starter-biz-tenant</artifactId>
</dependency>
<!-- Web 相关 --> <!-- Web 相关 -->
<dependency> <dependency>
<groupId>com.yunxi.scm</groupId> <groupId>com.yunxi.scm</groupId>

@ -38,6 +38,9 @@ public class BusinessWarehouseBaseVO {
@Schema(description = "类型") @Schema(description = "类型")
private String type; private String type;
@Schema(description = "状态")
private String status;
@Schema(description = "所属行业") @Schema(description = "所属行业")
private String industry; private String industry;
@ -66,7 +69,7 @@ public class BusinessWarehouseBaseVO {
@Schema(description = "介绍", example = "你猜") @Schema(description = "介绍", example = "你猜")
private String description; private String description;
@Schema(description = "介绍", example = "你猜") @Schema(description = "区分标志", example = "你猜")
private String diffFlag; private String diffFlag;
} }

@ -41,6 +41,9 @@ public class BusinessWarehouseExcelVO {
@ExcelProperty("类型") @ExcelProperty("类型")
private String type; private String type;
@ExcelProperty("状态")
private String status;
@ExcelProperty(value = "所属行业", converter = DictConvert.class) @ExcelProperty(value = "所属行业", converter = DictConvert.class)
@DictFormat("duty_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 @DictFormat("duty_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
private String industry; private String industry;

@ -31,6 +31,9 @@ public class BusinessWarehouseExportReqVO {
@Schema(description = "类型", example = "1") @Schema(description = "类型", example = "1")
private String type; private String type;
@Schema(description = "状态", example = "1")
private String status;
@Schema(description = "所属行业") @Schema(description = "所属行业")
private String industry; private String industry;

@ -33,6 +33,9 @@ public class BusinessWarehousePageReqVO extends PageParam {
@Schema(description = "类型", example = "1") @Schema(description = "类型", example = "1")
private String type; private String type;
@Schema(description = "状态", example = "1")
private String status;
@Schema(description = "所属行业") @Schema(description = "所属行业")
private String industry; private String industry;

@ -1,5 +1,6 @@
package com.yunxi.scm.module.xxjj.dal.dataobject.businesswarehouse; package com.yunxi.scm.module.xxjj.dal.dataobject.businesswarehouse;
import com.yunxi.scm.framework.tenant.core.db.TenantBaseDO;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -21,7 +22,7 @@ import com.yunxi.scm.framework.mybatis.core.dataobject.BaseDO;
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class BusinessWarehouseDO extends BaseDO { public class BusinessWarehouseDO extends TenantBaseDO {
/** /**
* id * id
@ -52,6 +53,10 @@ public class BusinessWarehouseDO extends BaseDO {
* *
*/ */
private String type; private String type;
/**
*
*/
private String status;
/** /**
* *
* *

@ -25,6 +25,7 @@ public interface BusinessWarehouseMapper extends BaseMapperX<BusinessWarehouseDO
.eqIfPresent(BusinessWarehouseDO::getBusinessLogo, reqVO.getBusinessLogo()) .eqIfPresent(BusinessWarehouseDO::getBusinessLogo, reqVO.getBusinessLogo())
.eqIfPresent(BusinessWarehouseDO::getParentId, reqVO.getParentId()) .eqIfPresent(BusinessWarehouseDO::getParentId, reqVO.getParentId())
.eqIfPresent(BusinessWarehouseDO::getType, reqVO.getType()) .eqIfPresent(BusinessWarehouseDO::getType, reqVO.getType())
.eqIfPresent(BusinessWarehouseDO::getStatus, reqVO.getStatus())
.eqIfPresent(BusinessWarehouseDO::getIndustry, reqVO.getIndustry()) .eqIfPresent(BusinessWarehouseDO::getIndustry, reqVO.getIndustry())
.eqIfPresent(BusinessWarehouseDO::getCity, reqVO.getCity()) .eqIfPresent(BusinessWarehouseDO::getCity, reqVO.getCity())
.betweenIfPresent(BusinessWarehouseDO::getEstablishDate, reqVO.getEstablishDate()) .betweenIfPresent(BusinessWarehouseDO::getEstablishDate, reqVO.getEstablishDate())
@ -46,6 +47,7 @@ public interface BusinessWarehouseMapper extends BaseMapperX<BusinessWarehouseDO
.eqIfPresent(BusinessWarehouseDO::getBusinessLogo, reqVO.getBusinessLogo()) .eqIfPresent(BusinessWarehouseDO::getBusinessLogo, reqVO.getBusinessLogo())
.eqIfPresent(BusinessWarehouseDO::getParentId, reqVO.getParentId()) .eqIfPresent(BusinessWarehouseDO::getParentId, reqVO.getParentId())
.eqIfPresent(BusinessWarehouseDO::getType, reqVO.getType()) .eqIfPresent(BusinessWarehouseDO::getType, reqVO.getType())
.eqIfPresent(BusinessWarehouseDO::getStatus, reqVO.getStatus())
.eqIfPresent(BusinessWarehouseDO::getIndustry, reqVO.getIndustry()) .eqIfPresent(BusinessWarehouseDO::getIndustry, reqVO.getIndustry())
.eqIfPresent(BusinessWarehouseDO::getCity, reqVO.getCity()) .eqIfPresent(BusinessWarehouseDO::getCity, reqVO.getCity())
.betweenIfPresent(BusinessWarehouseDO::getEstablishDate, reqVO.getEstablishDate()) .betweenIfPresent(BusinessWarehouseDO::getEstablishDate, reqVO.getEstablishDate())

Loading…
Cancel
Save