diff --git a/src/api/wms/supplierUser/index.ts b/src/api/wms/supplierUser/index.ts new file mode 100644 index 000000000..bdb7c5b75 --- /dev/null +++ b/src/api/wms/supplierUser/index.ts @@ -0,0 +1,54 @@ +import request from '@/config/axios' + +export interface SupplierUserVO { + id: number + userId: number + supplierCode: string + status: string + deletionTime: Date + deleterId: string + extraProperties: string + concurrencyStamp: number + remark: string +} + +// 查询供应商用户关联信息列表 +export const getSupplierUserPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/supplier-user/senior', data }) + } else { + return await request.get({ url: `/wms/supplier-user/page`, params }) + } +} + +// 查询供应商用户关联信息详情 +export const getSupplierUser = async (id: number) => { + return await request.get({ url: `/wms/supplier-user/get?id=` + id }) +} + +// 新增供应商用户关联信息 +export const createSupplierUser = async (data: SupplierUserVO) => { + return await request.post({ url: `/wms/supplier-user/create`, data }) +} + +// 修改供应商用户关联信息 +export const updateSupplierUser = async (data: SupplierUserVO) => { + return await request.put({ url: `/wms/supplier-user/update`, data }) +} + +// 删除供应商用户关联信息 +export const deleteSupplierUser = async (id: number) => { + return await request.delete({ url: `/wms/supplier-user/delete?id=` + id }) +} + +// 导出供应商用户关联信息 Excel +export const exportSupplierUser = async (params) => { + return await request.download({ url: `/wms/supplier-user/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/wms/supplier-user/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/wms/basicDataManage/systemSetting/supplierUser/index.vue b/src/views/wms/basicDataManage/systemSetting/supplierUser/index.vue new file mode 100644 index 000000000..3d28b0a2a --- /dev/null +++ b/src/views/wms/basicDataManage/systemSetting/supplierUser/index.vue @@ -0,0 +1,246 @@ + + + diff --git a/src/views/wms/basicDataManage/systemSetting/supplierUser/supplierUser.data.ts b/src/views/wms/basicDataManage/systemSetting/supplierUser/supplierUser.data.ts new file mode 100644 index 000000000..cb37abf69 --- /dev/null +++ b/src/views/wms/basicDataManage/systemSetting/supplierUser/supplierUser.data.ts @@ -0,0 +1,169 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import * as UserApi from "@/api/system/user"; +import * as SupplierApi from '@/api/wms/supplier' +import {Supplier} from "@/views/wms/basicDataManage/supplierManage/supplier/supplier.data"; + +export const User = useCrudSchemas(reactive([ + { + label: 'ID', + field: 'id', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '用户名称', + field: 'username', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '昵称', + field: 'nickname', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '部门', + field: 'deptId', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '邮箱', + field: 'email', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '电话', + field: 'mobile', + sort: 'custom', + table: { + width: 150 + } + } +])) + + +// 表单校验 +export const SupplierUserRules = reactive({ + userId: [required], + supplierCode: [required], + status: [required], + concurrencyStamp: [required], +}) + +export const SupplierUser = useCrudSchemas(reactive([ + { + label: 'ID', + field: 'id', + sort: 'custom', + isForm: false, + }, + { + label: '用户ID', + field: 'userId', + sort: 'custom', + isSearch: true, + tableForm:{ + isInpuFocusShow: true, + searchListPlaceholder: '请选用户信息', + searchField: 'id', + searchTitle: '用户信息', + searchAllSchemas: User.allSchemas, + searchPage: UserApi.getUserPage + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, + searchListPlaceholder: '请选用户信息', + searchField: 'id', + searchTitle: '用户信息', + searchAllSchemas: User.allSchemas, + searchPage: UserApi.getUserPage + } + } + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + isSearch: true, + tableForm:{ + isInpuFocusShow: true, + searchListPlaceholder: '请选供应商信息', + searchField: 'code', + searchTitle: '供应商信息', + searchAllSchemas: Supplier.allSchemas, + searchPage: SupplierApi.getSupplierPage + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, + searchListPlaceholder: '请选供应商信息', + searchField: 'code', + searchTitle: '供应商信息', + searchAllSchemas: Supplier.allSchemas, + searchPage: SupplierApi.getSupplierPage + } + } + }, + { + label: '状态', + field: 'status', + sort: 'custom', + dictType: DICT_TYPE.ITEM_STATUS, + dictClass: 'string', + isSearch: false, + form: { + component: 'Switch', + value: 'ENABLE', + componentProps: { + inactiveValue: 'DISABLE', + activeValue: 'ENABLE' + } + }, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + isForm: false, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150, + fixed: 'right' + } + } +])) + + +