From 0a7e873c662c937d1a05b63bcc9057e7540fc147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E5=BC=BA?= <1959055484@qq.com> Date: Mon, 16 Sep 2024 00:11:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/base/supplier/supplierApi.js | 28 +++ src/api/base/supplier/supplierCategoryApi.js | 32 +++ .../supplier/columns/supplierColumn.js | 52 +++++ .../basicData/supplier/detail/index.vue | 182 +++++++++++++++ .../supplier/detail/supplierCategoryForm.vue | 90 ++++++++ .../supplier/formFields/detailFields.js | 213 ++++++++++++++++++ .../supplier/formFields/drawerForm.js | 58 +++++ .../supplier/formFields/searchFields.js | 13 ++ .../basicData/supplier/index.vue | 199 ++++++++++++++++ 9 files changed, 867 insertions(+) create mode 100644 src/api/base/supplier/supplierApi.js create mode 100644 src/api/base/supplier/supplierCategoryApi.js create mode 100644 src/views/productionBusiness/basicData/supplier/columns/supplierColumn.js create mode 100644 src/views/productionBusiness/basicData/supplier/detail/index.vue create mode 100644 src/views/productionBusiness/basicData/supplier/detail/supplierCategoryForm.vue create mode 100644 src/views/productionBusiness/basicData/supplier/formFields/detailFields.js create mode 100644 src/views/productionBusiness/basicData/supplier/formFields/drawerForm.js create mode 100644 src/views/productionBusiness/basicData/supplier/formFields/searchFields.js create mode 100644 src/views/productionBusiness/basicData/supplier/index.vue diff --git a/src/api/base/supplier/supplierApi.js b/src/api/base/supplier/supplierApi.js new file mode 100644 index 0000000..9d63432 --- /dev/null +++ b/src/api/base/supplier/supplierApi.js @@ -0,0 +1,28 @@ +import { baseRequest } from '@/utils/request' + +const request = (url, ...arg) => baseRequest(`/base/supplier/` + url, ...arg) + +/** + * 供应商Api接口管理器 + * + * @author Luck + * @date 2024/09/13 22:24 + **/ +export default { + // 获取供应商分页 + supplierPage(data) { + return request('page', data, 'get') + }, + // 提交供应商表单 edit为true时为编辑,默认为新增 + supplierSubmitForm(data, edit = false) { + return request(edit ? 'edit' : 'add', data) + }, + // 删除供应商 + supplierDelete(data) { + return request('delete', data) + }, + // 获取供应商详情 + supplierDetail(data) { + return request('detail', data, 'get') + } +} diff --git a/src/api/base/supplier/supplierCategoryApi.js b/src/api/base/supplier/supplierCategoryApi.js new file mode 100644 index 0000000..4a2f74b --- /dev/null +++ b/src/api/base/supplier/supplierCategoryApi.js @@ -0,0 +1,32 @@ +import { baseRequest } from '@/utils/request' + +const request = (url, ...arg) => baseRequest(`/base/supplierCategory/` + url, ...arg) + +/** + * 供应商分类Api接口管理器 + * + * @author Luck + * @date 2024/09/13 22:18 + **/ +export default { + // 获取供应商分类分页 + supplierCategoryPage(data) { + return request('page', data, 'get') + }, + // 获取树结构 + supplierCategoryTree(data) { + return request('tree', data, 'get') + }, + // 提交供应商分类表单 edit为true时为编辑,默认为新增 + supplierCategorySubmitForm(data, edit = false) { + return request(edit ? 'edit' : 'add', data) + }, + // 删除供应商分类 + supplierCategoryDelete(data) { + return request('delete', data) + }, + // 获取供应商分类详情 + supplierCategoryDetail(data) { + return request('detail', data, 'get') + } +} diff --git a/src/views/productionBusiness/basicData/supplier/columns/supplierColumn.js b/src/views/productionBusiness/basicData/supplier/columns/supplierColumn.js new file mode 100644 index 0000000..cfebc22 --- /dev/null +++ b/src/views/productionBusiness/basicData/supplier/columns/supplierColumn.js @@ -0,0 +1,52 @@ +export const tableColumns = [ + { + title: '编码', + dataIndex: 'number', + align: 'center', + resizable: true, + width: 300, + ellipsis: true + }, + { + title: '名称', + dataIndex: 'name', + align: 'center', + resizable: true, + width: 300, + ellipsis: true + }, + { + title: '分类', + dataIndex: 'categoryName', + align: 'center', + resizable: true, + width: 300, + ellipsis: true + }, + { + title: '可用状态', + dataIndex: 'enabledState', + align: 'center', + resizable: true, + width: 100, + ellipsis: true + }, + { + title: '联系人', + dataIndex: 'contacts', + align: 'center', + resizable: true, + width: 100, + ellipsis: true + }, + { + title: '创建时间', + dataIndex: 'createTime', + sorter: true, + sortDirections: ['descend', 'ascend'], + align: 'center', + resizable: true, + width: 300, + ellipsis: true + } +] diff --git a/src/views/productionBusiness/basicData/supplier/detail/index.vue b/src/views/productionBusiness/basicData/supplier/detail/index.vue new file mode 100644 index 0000000..0e55398 --- /dev/null +++ b/src/views/productionBusiness/basicData/supplier/detail/index.vue @@ -0,0 +1,182 @@ + + + diff --git a/src/views/productionBusiness/basicData/supplier/detail/supplierCategoryForm.vue b/src/views/productionBusiness/basicData/supplier/detail/supplierCategoryForm.vue new file mode 100644 index 0000000..4d3da1d --- /dev/null +++ b/src/views/productionBusiness/basicData/supplier/detail/supplierCategoryForm.vue @@ -0,0 +1,90 @@ + + + diff --git a/src/views/productionBusiness/basicData/supplier/formFields/detailFields.js b/src/views/productionBusiness/basicData/supplier/formFields/detailFields.js new file mode 100644 index 0000000..b6e5d5f --- /dev/null +++ b/src/views/productionBusiness/basicData/supplier/formFields/detailFields.js @@ -0,0 +1,213 @@ +import { required } from '@/utils/formRules' +import tool from '@/utils/tool' + +export const formRules = { + name: [required('请输入名称')] +} + +export const formItems = reactive([ + { + label: '编码:', + name: 'number', + type: 'a-input', + span: 8, + attrs: { + placeholder: '请输入编码若留空由系统自动生成', + allowClear: true + } + }, + { + label: '名称:', + name: 'name', + type: 'a-input', + span: 8, + rules: [required('请输入名称')], + attrs: { + placeholder: '请输入名称', + allowClear: true + } + }, + { + label: '简称:', + name: 'shortName', + type: 'a-input', + span: 8, + attrs: { + placeholder: '请输入简称', + allowClear: true + } + }, + { + label: '可用状态:', + name: 'enabledState', + type: 'a-select', + span: 8, + attrs: { + placeholder: '请选择可用状态', + options: tool.dictList('COMMON_STATUS') + }, + defaultValue: 'ENABLE' + }, + { + label: '品牌:', + name: 'brandId', + type: 'a-select', + span: 8, + // rules: [required('请选择品牌')], + attrs: { + placeholder: '请选择品牌', + options: tool.dictList('COMMON_STATUS'), + fieldNames: { + label: 'name', + value: 'id' + } + } + }, + { + label: '供应商分类:', + name: 'categoryId', + type: 'a-tree-select', + span: 8, + rules: [required('请选择分类')], + attrs: { + placeholder: '请选择分类', + allowClear: true, + fieldNames: { + children: 'children', + label: 'name', + value: 'id' + } + } + }, + { + label: '省:', + name: 'province', + span: 8, + // rules: [required('请选择省')], + isUseSlot: true, + slotName: 'provinceSlot', + attrs: { + placeholder: '请选择省' + } + }, + { + label: '市:', + name: 'city', + span: 8, + // rules: [required('请选择市')], + isUseSlot: true, + slotName: 'citySlot' + }, + { + label: '区:', + name: 'county', + // rules: [required('请选择区')], + isUseSlot: true, + slotName: 'countySlot', + span: 8 + }, + { + label: '详细地址:', + name: 'address', + type: 'a-textarea', + span: 8, + attrs: { + placeholder: '请输入详细地址', + allowClear: true, + fieldNames: { + children: 'children', + label: 'name', + value: 'id' + } + } + }, + { + label: '备注:', + name: 'remarks', + type: 'a-textarea', + span: 8, + attrs: { + placeholder: '请输入备注', + allowClear: true + } + } +]) + +export const baseFormItems = [ + { + label: '联系人:', + name: 'contacts', + type: 'a-input', + span: 6, + attrs: { + placeholder: '请选择类型' + } + }, + { + label: '手机:', + name: 'phone', + type: 'a-input', + span: 6, + attrs: { + placeholder: '请选择类型' + } + }, + { + label: '固话:', + name: 'tel', + type: 'a-input', + span: 6, + attrs: { + placeholder: '请选择类型' + } + }, + { + label: '传真:', + name: 'fax', + type: 'a-input', + span: 6, + attrs: { + placeholder: '请选择类型' + } + }, + { + label: '电子邮箱:', + name: 'email', + type: 'a-input', + span: 6, + attrs: { + placeholder: '请输入备注', + allowClear: true + } + }, + { + label: 'QQ:', + name: 'qq', + type: 'a-input', + span: 6, + attrs: { + placeholder: '请输入备注', + allowClear: true + } + }, + { + label: '微信:', + name: 'wechat', + type: 'a-input', + span: 6, + attrs: { + placeholder: '请输入备注', + allowClear: true + } + }, + { + label: '联系地址:', + name: 'contactAddress', + type: 'a-input', + span: 6, + attrs: { + placeholder: '请输入备注', + allowClear: true + } + } +] diff --git a/src/views/productionBusiness/basicData/supplier/formFields/drawerForm.js b/src/views/productionBusiness/basicData/supplier/formFields/drawerForm.js new file mode 100644 index 0000000..eba08aa --- /dev/null +++ b/src/views/productionBusiness/basicData/supplier/formFields/drawerForm.js @@ -0,0 +1,58 @@ +import { required } from '@/utils/formRules' + +export const drawerForm = reactive([ + { + label: '名称:', + name: 'name', + type: 'a-input', + span: 12, + attrs: { + placeholder: '请输入名称', + allowClear: true + } + }, + { + label: '编码:', + name: 'number', + type: 'a-input', + span: 12, + isUseSlot: true, + slotName: 'numberSlot', + attrs: { + placeholder: '请输入编码', + allowClear: true + } + }, + { + label: '上级分类:', + name: 'parentId', + type: 'a-tree-select', + span: 12, + attrs: { + placeholder: '请选择上级客户', + allowClear: true, + treeData: [], + fieldNames: { + children: 'children', + label: 'name', + value: 'id' + } + } + }, + { + label: '排序码:', + name: 'sortCode', + type: 'a-input-number', + span: 12, + attrs: { + placeholder: '请输入排序码', + allowClear: true + }, + defaultValue: 10 + } +]) + +export const formRules = { + name: [required('请输入名称')], + parentId: [required('请选择上级')] +} diff --git a/src/views/productionBusiness/basicData/supplier/formFields/searchFields.js b/src/views/productionBusiness/basicData/supplier/formFields/searchFields.js new file mode 100644 index 0000000..ee4b197 --- /dev/null +++ b/src/views/productionBusiness/basicData/supplier/formFields/searchFields.js @@ -0,0 +1,13 @@ +import tool from '@/utils/tool' + +export const searchFields = [ + { name: 'name', label: '名称', component: 'a-input', props: { placeholder: '请输入名称' } }, + { name: 'number', label: '编码', component: 'a-input', props: { placeholder: '请输入编码' } }, + { + name: 'enabledState', + label: '可用状态', + component: 'a-select', + props: { placeholder: '请选择状态', options: tool.dictList('COMMON_STATUS') } + } + +] diff --git a/src/views/productionBusiness/basicData/supplier/index.vue b/src/views/productionBusiness/basicData/supplier/index.vue new file mode 100644 index 0000000..867390a --- /dev/null +++ b/src/views/productionBusiness/basicData/supplier/index.vue @@ -0,0 +1,199 @@ + + + + +