diff --git a/.vscode/settings.json b/.vscode/settings.json index 74ab52a74e1c37891acefa1b13277448fd904cd9..7d79e11189feb0550183c68e471559d9db4be233 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -101,6 +101,7 @@ "cSpell.words": [ "brotli", "browserslist", + "CGDD", "codemirror", "commitlint", "cropperjs", @@ -108,14 +109,20 @@ "echarts", "esnext", "esno", + "FIXCHAR", + "gencode", "iconify", + "INPUTCHAR", "INTLIFY", "lintstagedrc", "logicflow", + "NOWDATE", "nprogress", + "parttype", "pinia", "pnpm", "qrcode", + "SERIALNO", "sider", "sortablejs", "stylelint", diff --git a/package-lock.json b/package-lock.json index ca57a5217e52e2e23f3c01410c0748eda006275b..bcefa119749bc313b0af8f8c23aca31257143b66 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "yudao-ui-admin-vue3", - "version": "2.5.0-snapshot", + "version": "2025.09-snapshot", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "yudao-ui-admin-vue3", - "version": "2.5.0-snapshot", + "version": "2025.09-snapshot", "license": "MIT", "dependencies": { - "@element-plus/icons-vue": "^2.1.0", + "@element-plus/icons-vue": "2.3.2", "@form-create/designer": "^3.2.6", "@form-create/element-ui": "^3.2.11", "@iconify/iconify": "^3.1.1", @@ -20,7 +20,7 @@ "@wangeditor/editor-for-vue": "^5.1.10", "@zxcvbn-ts/core": "^3.0.4", "animate.css": "^4.1.1", - "axios": "^1.6.8", + "axios": "1.9.0", "benz-amr-recorder": "^1.1.5", "bpmn-js-token-simulation": "^0.36.0", "camunda-bpmn-moddle": "^7.0.1", @@ -31,10 +31,11 @@ "driver.js": "^1.3.1", "echarts": "^5.5.0", "echarts-wordcloud": "^2.1.0", - "element-plus": "2.9.1", + "element-plus": "2.11.1", "fast-xml-parser": "^4.3.2", "highlight.js": "^11.9.0", "jsencrypt": "^3.3.2", + "jsoneditor": "^10.1.3", "lodash-es": "^4.17.21", "markdown-it": "^14.1.0", "markmap-common": "^0.16.0", @@ -51,7 +52,6 @@ "sortablejs": "^1.15.3", "steady-xml": "^0.1.0", "url": "^0.11.3", - "v3-jsoneditor": "^0.0.6", "video.js": "^7.21.5", "vue": "3.5.12", "vue-dompurify-html": "^4.1.4", @@ -69,6 +69,7 @@ "@iconify/json": "^2.2.187", "@intlify/unplugin-vue-i18n": "^2.0.0", "@purge-icons/generated": "^0.9.0", + "@types/jsoneditor": "^9.9.5", "@types/lodash-es": "^4.17.12", "@types/node": "^20.11.21", "@types/nprogress": "^0.2.3", @@ -2310,9 +2311,9 @@ } }, "node_modules/@element-plus/icons-vue": { - "version": "2.3.1", - "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz", - "integrity": "sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==", + "version": "2.3.2", + "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.2.tgz", + "integrity": "sha512-OzIuTaIfC8QXEPmJvB4Y4kw34rSXdCJzxcD1kFStBvr8bK6X1zQAYDo0CNMjojnfTqRQCJ0I7prlErcoRiET2A==", "license": "MIT", "peerDependencies": { "vue": "^3.2.0" @@ -4492,6 +4493,13 @@ "node": ">=10.13.0" } }, + "node_modules/@types/ace": { + "version": "0.0.52", + "resolved": "https://registry.npmmirror.com/@types/ace/-/ace-0.0.52.tgz", + "integrity": "sha512-YPF9S7fzpuyrxru+sG/rrTpZkC6gpHBPF14W3x70kqVOD+ks6jkYLapk4yceh36xej7K4HYxcyz9ZDQ2lTvwgQ==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/conventional-commits-parser": { "version": "5.0.1", "resolved": "https://registry.npmmirror.com/@types/conventional-commits-parser/-/conventional-commits-parser-5.0.1.tgz", @@ -4792,6 +4800,41 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/jsoneditor": { + "version": "9.9.6", + "resolved": "https://registry.npmmirror.com/@types/jsoneditor/-/jsoneditor-9.9.6.tgz", + "integrity": "sha512-SJ29nWBIhnhtU5n72wxhPiuUVd8cnDHd7ZYMqVkzWtdRxTUdS8+oy1pg66yhmM1kcuanX3xmAAKfcyhhBnHEjQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/ace": "*", + "ajv": "^6.12.0" + } + }, + "node_modules/@types/jsoneditor/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmmirror.com/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@types/jsoneditor/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmmirror.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/lodash": { "version": "4.17.16", "resolved": "https://registry.npmmirror.com/@types/lodash/-/lodash-4.17.16.tgz", @@ -9424,9 +9467,9 @@ "license": "ISC" }, "node_modules/element-plus": { - "version": "2.9.1", - "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.9.1.tgz", - "integrity": "sha512-9Agqf/jt4Ugk7EZ6C5LME71sgkvauPCsnvJN12Xid2XVobjufxMGpRE4L7pS4luJMOmFAH3J0NgYEGZT5r+NDg==", + "version": "2.11.1", + "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.11.1.tgz", + "integrity": "sha512-weYFIniyNXTAe9vJZnmZpYzurh4TDbdKhBsJwhbzuo0SDZ8PLwHVll0qycJUxc6SLtH+7A9F7dvdDh5CnqeIVA==", "license": "MIT", "dependencies": { "@ctrl/tinycolor": "^3.4.1", @@ -11866,20 +11909,19 @@ } }, "node_modules/jsoneditor": { - "version": "9.10.5", - "resolved": "https://registry.npmmirror.com/jsoneditor/-/jsoneditor-9.10.5.tgz", - "integrity": "sha512-fVZ0NMt+zm4rqTKBv2x7zPdLeaRyKo1EjJkaR1QjK4gEM1rMwICILYSW1OPxSc1qqyAoDaA/eeNrluKoxOocCA==", + "version": "10.4.1", + "resolved": "https://registry.npmmirror.com/jsoneditor/-/jsoneditor-10.4.1.tgz", + "integrity": "sha512-89ao8IOKq6yTY+LSNw7FHoqcNrkATZN9W1u476P9ofGLSN/V0l2Je0MWG8HrYKMYqriJEpXmlsGT1CZbr99GWg==", "license": "Apache-2.0", "dependencies": { - "ace-builds": "^1.31.1", + "ace-builds": "^1.36.2", "ajv": "^6.12.6", "javascript-natural-sort": "^0.7.1", "jmespath": "^0.16.0", "json-source-map": "^0.6.1", - "jsonrepair": "3.1.0", - "mobius1-selectr": "^2.4.13", + "jsonrepair": "^3.8.1", "picomodal": "^3.0.0", - "vanilla-picker": "^2.12.2" + "vanilla-picker": "^2.12.3" } }, "node_modules/jsoneditor/node_modules/ajv": { @@ -11928,9 +11970,9 @@ "license": "MIT" }, "node_modules/jsonrepair": { - "version": "3.1.0", - "resolved": "https://registry.npmmirror.com/jsonrepair/-/jsonrepair-3.1.0.tgz", - "integrity": "sha512-idqReg23J0PVRAADmZMc5xQM3xeOX5bTB6OTyMnzq33IXJXmn9iJuWIEvGmrN80rQf4d7uLTMEDwpzujNcI0Rg==", + "version": "3.13.0", + "resolved": "https://registry.npmmirror.com/jsonrepair/-/jsonrepair-3.13.0.tgz", + "integrity": "sha512-5YRzlAQ7tuzV1nAJu3LvDlrKtBFIALHN2+a+I1MGJCt3ldRDBF/bZuvIPzae8Epot6KBXd0awRZZcuoeAsZ/mw==", "license": "ISC", "bin": { "jsonrepair": "bin/cli.js" @@ -13025,12 +13067,6 @@ "dev": true, "license": "MIT" }, - "node_modules/mobius1-selectr": { - "version": "2.4.13", - "resolved": "https://registry.npmmirror.com/mobius1-selectr/-/mobius1-selectr-2.4.13.tgz", - "integrity": "sha512-Mk9qDrvU44UUL0EBhbAA1phfQZ7aMZPjwtL7wkpiBzGh8dETGqfsh50mWoX9EkjDlkONlErWXArHCKfoxVg0Bw==", - "license": "MIT" - }, "node_modules/moddle": { "version": "6.2.3", "resolved": "https://registry.npmmirror.com/moddle/-/moddle-6.2.3.tgz", @@ -16489,19 +16525,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/v3-jsoneditor": { - "version": "0.0.6", - "resolved": "https://registry.npmmirror.com/v3-jsoneditor/-/v3-jsoneditor-0.0.6.tgz", - "integrity": "sha512-9G0sXWXUn67SBkn46ycWfwPwjuJu/lcsQaNzMtXAR2/95hMV21WfcRNsqJ+vVVrSHQehohB/9fVLwYEXz0u/KA==", - "license": "MIT", - "dependencies": { - "jsoneditor": "^9.10.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/pratik227" - } - }, "node_modules/vanilla-picker": { "version": "2.12.3", "resolved": "https://registry.npmmirror.com/vanilla-picker/-/vanilla-picker-2.12.3.tgz", diff --git a/src/api/infra/autocode/gencode/index.ts b/src/api/infra/autocode/gencode/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..d1afc64e2b9e823f763868788a875ad1934fd7c4 --- /dev/null +++ b/src/api/infra/autocode/gencode/index.ts @@ -0,0 +1,7 @@ +import request from '@/config/axios' + +// 自动生成编码规则 API +export const genCodeApi = { + genCodeApi: async (ruleCode: string) => { + return await request.get({ url: `/infra/auto-code/get/` + ruleCode }) } +} diff --git a/src/api/infra/autocode/part/index.ts b/src/api/infra/autocode/part/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..537895afe30c569e835ee39d8d468fc5ef6c37bf --- /dev/null +++ b/src/api/infra/autocode/part/index.ts @@ -0,0 +1,54 @@ +import request from '@/config/axios' + +// 编码生成规则组成 VO +export interface AutoCodePartVO { + partId: number // 分段ID + ruleId: number // 规则ID + partIndex: number // 分段序号 + partType: string // 分段类型,INPUTCHAR:输入字符,NOWDATE:当前日期时间,FIXCHAR:固定字符,SERIALNO:流水号 + partCode: string // 分段编号 + partName: string // 分段名称 + partLength: number // 分段长度 + dateFormat: string // 日期格式化 + inputCharacter: string // 输入字符 + fixCharacter: string // 固定字符 + serialStartNo: number // 流水号起始值 + serialStep: number // 流水号步长 + serialNowNo: number // 流水号当前值 + cycleFlag: number // 流水号是否循环 + cycleMethod: string // 循环方式,YEAR:按年,MONTH:按月,DAY:按天,HOUR:按小时,MINUTE:按分钟,OTHER:按传入字符变 + remark: string // 备注 +} + +// 编码生成规则组成 API +export const AutoCodePartApi = { + // 查询编码生成规则组成分页 + getAutoCodePartPage: async (params: any) => { + return await request.get({ url: `/infra/auto-code-part/page`, params }) + }, + + // 查询编码生成规则组成详情 + getAutoCodePart: async (partId: number) => { + return await request.get({ url: `/infra/auto-code-part/get?partId=` + partId }) + }, + + // 新增编码生成规则组成 + createAutoCodePart: async (data: AutoCodePartVO) => { + return await request.post({ url: `/infra/auto-code-part/create`, data }) + }, + + // 修改编码生成规则组成 + updateAutoCodePart: async (data: AutoCodePartVO) => { + return await request.put({ url: `/infra/auto-code-part/update`, data }) + }, + + // 删除编码生成规则组成 + deleteAutoCodePart: async (partId: number) => { + return await request.delete({ url: `/infra/auto-code-part/delete?partId=` + partId }) + }, + + // 导出编码生成规则组成 Excel + exportAutoCodePart: async (params) => { + return await request.download({ url: `/infra/auto-code-part/export-excel`, params }) + } +} \ No newline at end of file diff --git a/src/api/infra/autocode/rule/index.ts b/src/api/infra/autocode/rule/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..072b3d702ae20e81741d1f171b4ecb90c18e34c1 --- /dev/null +++ b/src/api/infra/autocode/rule/index.ts @@ -0,0 +1,48 @@ +import request from '@/config/axios' + +// 编码生成规则 VO +export interface AutoCodeRuleVO { + ruleId: number // 规则ID + ruleCode: string // 规则编码 + ruleName: string // 规则名称 + ruleDesc: string // 描述 + maxLength: number // 最大长度 + isPadded: number // 是否补齐 + paddedChar: string // 补齐字符 + paddedMethod: string // 补齐方式 + status: number // 是否启用 + remark: string // 备注 +} + +// 编码生成规则 API +export const AutoCodeRuleApi = { + // 查询编码生成规则分页 + getAutoCodeRulePage: async (params: any) => { + return await request.get({ url: `/infra/auto-code-rule/page`, params }) + }, + + // 查询编码生成规则详情 + getAutoCodeRule: async (ruleId: number) => { + return await request.get({ url: `/infra/auto-code-rule/get?ruleId=` + ruleId }) + }, + + // 新增编码生成规则 + createAutoCodeRule: async (data: AutoCodeRuleVO) => { + return await request.post({ url: `/infra/auto-code-rule/create`, data }) + }, + + // 修改编码生成规则 + updateAutoCodeRule: async (data: AutoCodeRuleVO) => { + return await request.put({ url: `/infra/auto-code-rule/update`, data }) + }, + + // 删除编码生成规则 + deleteAutoCodeRule: async (ruleId: number) => { + return await request.delete({ url: `/infra/auto-code-rule/delete?ruleId=` + ruleId }) + }, + + // 导出编码生成规则 Excel + exportAutoCodeRule: async (params) => { + return await request.download({ url: `/infra/auto-code-rule/export-excel`, params }) + } +} \ No newline at end of file diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 794778cad18ed8850aa9694b585eac503305138f..45499a372832b97339c63cb0f6f2832b55f5c8e5 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -127,7 +127,29 @@ const remainingRouter: AppRouteRecordRaw[] = [ } ] }, - + { + path: '/autocode', + component: Layout, + name: 'part', + meta: { + hidden: true + }, + children: [ + { + path: 'part/data/:ruleId', + component: () => import('@/views/infra/autocode/data/index.vue'), + name: 'AutoCodePart', + meta: { + title: '规则组成', + noCache: true, + hidden: true, + canTo: true, + icon: '', + activeMenu: '/infra/autocode' + } + } + ] + }, { path: '/codegen', component: Layout, diff --git a/src/utils/dict.ts b/src/utils/dict.ts index b4f0c5870ef5cb992ff7e3896721851f1e046397..e5cc93820fb31496b051bc6243881e8146a13117 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -141,6 +141,8 @@ export enum DICT_TYPE { INFRA_CODEGEN_SCENE = 'infra_codegen_scene', INFRA_FILE_STORAGE = 'infra_file_storage', INFRA_OPERATE_TYPE = 'infra_operate_type', + INFRA_AUTOCODE_PARTTYPE = 'infra_autocode_parttype', + INFRA_AUTOCODE_CYCLEMETHOD = 'infra_autocode_cyclemethod', // ========== BPM 模块 ========== BPM_MODEL_TYPE = 'bpm_model_type', diff --git a/src/views/erp/purchase/order/PurchaseOrderForm.vue b/src/views/erp/purchase/order/PurchaseOrderForm.vue index a7a6eecd62bad962e577a87fbfaa7ca6e73388b4..466c7161699e9b2928e06e1ec078a4df7b2f87cb 100644 --- a/src/views/erp/purchase/order/PurchaseOrderForm.vue +++ b/src/views/erp/purchase/order/PurchaseOrderForm.vue @@ -11,7 +11,17 @@ - + + + + + + @@ -140,6 +150,7 @@ import PurchaseOrderItemForm from './components/PurchaseOrderItemForm.vue' import { SupplierApi, SupplierVO } from '@/api/erp/purchase/supplier' import { erpPriceInputFormatter, erpPriceMultiply } from '@/utils' import * as UserApi from '@/api/system/user' +import { genCodeApi } from '@/api/infra/autocode/gencode' import { AccountApi, AccountVO } from '@/api/erp/finance/account' /** ERP 销售订单表单 */ @@ -152,6 +163,8 @@ const dialogVisible = ref(false) // 弹窗的是否展示 const dialogTitle = ref('') // 弹窗的标题 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 const formType = ref('') // 表单的类型:create - 新增;update - 修改;detail - 详情 +const autoGenFlag = ref(true) // 自动生成 + const formData = ref({ id: undefined, supplierId: undefined, @@ -207,9 +220,15 @@ const open = async (type: string, id?: number) => { formLoading.value = true try { formData.value = await PurchaseOrderApi.getPurchaseOrder(id) + autoGenFlag.value = !formData.value.no } finally { formLoading.value = false } + } else { + // 新增时自动生成订单单号 + if (autoGenFlag.value) { + await handleAutoGenChange(true) + } } // 加载供应商列表 supplierList.value = await SupplierApi.getSupplierSimpleList() @@ -249,6 +268,17 @@ const submitForm = async () => { } } +/** 自动生成开关变化 */ +const handleAutoGenChange = async (autoGenFlag: boolean) => { + if (autoGenFlag) { + await genCodeApi.genCodeApi('ERP_CGDD_CODE').then((res) => { + formData.value.no = res + }) + } else { + formData.value.no = undefined + } +} + /** 重置表单 */ const resetForm = () => { formData.value = { @@ -264,6 +294,7 @@ const resetForm = () => { depositPrice: 0, items: [] } + autoGenFlag.value = true formRef.value?.resetFields() } diff --git a/src/views/infra/autocode/AutoCodeRuleForm.vue b/src/views/infra/autocode/AutoCodeRuleForm.vue new file mode 100644 index 0000000000000000000000000000000000000000..fe7d816d0590525758285afcaca8575eeabdd277 --- /dev/null +++ b/src/views/infra/autocode/AutoCodeRuleForm.vue @@ -0,0 +1,175 @@ + + + diff --git a/src/views/infra/autocode/data/AutoCodePartForm.vue b/src/views/infra/autocode/data/AutoCodePartForm.vue new file mode 100644 index 0000000000000000000000000000000000000000..cdc2ccca164146cadfbb023744ec9ba9c9e9c775 --- /dev/null +++ b/src/views/infra/autocode/data/AutoCodePartForm.vue @@ -0,0 +1,255 @@ + + + diff --git a/src/views/infra/autocode/data/index.vue b/src/views/infra/autocode/data/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..3688a9014fa5038a302e4343cd2c8d5b94d82900 --- /dev/null +++ b/src/views/infra/autocode/data/index.vue @@ -0,0 +1,185 @@ + + + diff --git a/src/views/infra/autocode/index.vue b/src/views/infra/autocode/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..9d9fdd201e2bf7bdfde5a12e7be2614764d7e488 --- /dev/null +++ b/src/views/infra/autocode/index.vue @@ -0,0 +1,191 @@ + + +