commit 0679d14ec579f83af0926678a6f21008667d45d3 Author: songguoqiang <765017469@qq.com> Date: Mon Nov 13 13:25:55 2023 +0800 项目初始化 diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..dccf841 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +root = true + +[*] +charset=utf-8 +end_of_line=lf +insert_final_newline=true +indent_style=space +indent_size=2 +max_line_length = 100 + +[*.{yml,yaml,json}] +indent_style = space +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab diff --git a/.env b/.env new file mode 100644 index 0000000..2308eb6 --- /dev/null +++ b/.env @@ -0,0 +1,17 @@ +# 标题 +VITE_APP_TITLE=闻荫管理系统 + +# 项目本地运行端口号 +VITE_PORT=80 + +# open 运行 npm run dev 时自动打开浏览器 +VITE_OPEN=true + +# 租户开关 +VITE_APP_TENANT_ENABLE=true + +# 验证码的开关 +VITE_APP_CAPTCHA_ENABLE=true + +# 百度统计 +VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..78976cd --- /dev/null +++ b/.env.development @@ -0,0 +1,37 @@ +# 开发环境 +NODE_ENV=development + +VITE_DEV=false + +# 请求路径 +VITE_BASE_URL='http://localhost:12080' + +# 上传路径 +VITE_UPLOAD_URL='http://localhost:12080/admin-api/infra/file/upload' + +# 接口前缀 +VITE_API_BASEPATH=/dev-api + +# 接口地址 +VITE_API_URL=/admin-api + +# 打包路径 +VITE_BASE_PATH=/ + +# 是否删除debugger +VITE_DROP_DEBUGGER=true + +# 是否删除console.log +VITE_DROP_CONSOLE=false + +# 是否sourcemap +VITE_SOURCEMAP=false + +# 输出路径 +VITE_OUT_DIR=dist + +# 自定义接口路径 +VITE_INTERFACE_URL='http://localhost:12080/magic/web/index.html' + +# 积木报表请求路径 +VITE_JMREPORT_BASE_URL='http://localhost:12080' \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..8e25d23 --- /dev/null +++ b/.env.production @@ -0,0 +1,34 @@ +# 生产环境 +NODE_ENV=production + +VITE_DEV=false + +# 请求路径 +VITE_BASE_URL='http://localhost:12080' + +# 上传路径 +VITE_UPLOAD_URL='http://localhost:12080/admin-api/infra/file/upload' + +# 接口前缀 +VITE_API_BASEPATH= + +# 接口地址 +VITE_API_URL=/admin-api + +# 是否删除debugger +VITE_DROP_DEBUGGER=true + +# 是否删除console.log +VITE_DROP_CONSOLE=true + +# 是否sourcemap +VITE_SOURCEMAP=false + +# 打包路径 +VITE_BASE_PATH=/ + +# 输出路径 +VITE_OUT_DIR=dist-pro + +# 积木报表请求路径 +VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25110' diff --git a/.env.test b/.env.test new file mode 100644 index 0000000..84edcdf --- /dev/null +++ b/.env.test @@ -0,0 +1,37 @@ +# 生产环境 +NODE_ENV=test + +VITE_DEV=false + +# 请求路径 +VITE_BASE_URL='http://dev.ccwin-in.com:25100/api' + +# 上传路径 +VITE_UPLOAD_URL='http://dev.ccwin-in.com:25100/api/admin-api/infra/file/upload' + +# 接口前缀 +VITE_API_BASEPATH= + +# 接口地址 +VITE_API_URL=/admin-api + +# 是否删除debugger +VITE_DROP_DEBUGGER=true + +# 是否删除console.log +VITE_DROP_CONSOLE=true + +# 是否sourcemap +VITE_SOURCEMAP=false + +# 打包路径 +VITE_BASE_PATH=/ + +# 输出路径 +VITE_OUT_DIR=dist-test + +# 自定义接口路径 +VITE_INTERFACE_URL='http://dev.ccwin-in.com:25110/magic/web/index.html' + +# 积木报表请求路径 +VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25110' diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..1e85c0f --- /dev/null +++ b/.eslintignore @@ -0,0 +1,8 @@ +/build/ +/config/ +/dist/ +/*.js +/test/unit/coverage/ +/node_modules/* +/dist* +/src/main.ts diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json new file mode 100644 index 0000000..024c96a --- /dev/null +++ b/.eslintrc-auto-import.json @@ -0,0 +1,259 @@ +{ + "globals": { + "EffectScope": true, + "ElMessage": true, + "ElMessageBox": true, + "ElTag": true, + "asyncComputed": true, + "autoResetRef": true, + "computed": true, + "computedAsync": true, + "computedEager": true, + "computedInject": true, + "computedWithControl": true, + "controlledComputed": true, + "controlledRef": true, + "createApp": true, + "createEventHook": true, + "createGlobalState": true, + "createInjectionState": true, + "createReactiveFn": true, + "createSharedComposable": true, + "createUnrefFn": true, + "customRef": true, + "debouncedRef": true, + "debouncedWatch": true, + "defineAsyncComponent": true, + "defineComponent": true, + "eagerComputed": true, + "effectScope": true, + "extendRef": true, + "getCurrentInstance": true, + "getCurrentScope": true, + "h": true, + "ignorableWatch": true, + "inject": true, + "isDefined": true, + "isProxy": true, + "isReactive": true, + "isReadonly": true, + "isRef": true, + "makeDestructurable": true, + "markRaw": true, + "nextTick": true, + "onActivated": true, + "onBeforeMount": true, + "onBeforeUnmount": true, + "onBeforeUpdate": true, + "onClickOutside": true, + "onDeactivated": true, + "onErrorCaptured": true, + "onKeyStroke": true, + "onLongPress": true, + "onMounted": true, + "onRenderTracked": true, + "onRenderTriggered": true, + "onScopeDispose": true, + "onServerPrefetch": true, + "onStartTyping": true, + "onUnmounted": true, + "onUpdated": true, + "pausableWatch": true, + "provide": true, + "reactify": true, + "reactifyObject": true, + "reactive": true, + "reactiveComputed": true, + "reactiveOmit": true, + "reactivePick": true, + "readonly": true, + "ref": true, + "refAutoReset": true, + "refDebounced": true, + "refDefault": true, + "refThrottled": true, + "refWithControl": true, + "resolveComponent": true, + "resolveRef": true, + "resolveUnref": true, + "shallowReactive": true, + "shallowReadonly": true, + "shallowRef": true, + "syncRef": true, + "syncRefs": true, + "templateRef": true, + "throttledRef": true, + "throttledWatch": true, + "toRaw": true, + "toReactive": true, + "toRef": true, + "toRefs": true, + "triggerRef": true, + "tryOnBeforeMount": true, + "tryOnBeforeUnmount": true, + "tryOnMounted": true, + "tryOnScopeDispose": true, + "tryOnUnmounted": true, + "unref": true, + "unrefElement": true, + "until": true, + "useActiveElement": true, + "useArrayEvery": true, + "useArrayFilter": true, + "useArrayFind": true, + "useArrayFindIndex": true, + "useArrayJoin": true, + "useArrayMap": true, + "useArrayReduce": true, + "useArraySome": true, + "useAsyncQueue": true, + "useAsyncState": true, + "useAttrs": true, + "useBase64": true, + "useBattery": true, + "useBluetooth": true, + "useBreakpoints": true, + "useBroadcastChannel": true, + "useBrowserLocation": true, + "useCached": true, + "useClipboard": true, + "useColorMode": true, + "useConfirmDialog": true, + "useCounter": true, + "useCssModule": true, + "useCssVar": true, + "useCssVars": true, + "useCurrentElement": true, + "useCycleList": true, + "useDark": true, + "useDateFormat": true, + "useDebounce": true, + "useDebounceFn": true, + "useDebouncedRefHistory": true, + "useDeviceMotion": true, + "useDeviceOrientation": true, + "useDevicePixelRatio": true, + "useDevicesList": true, + "useDisplayMedia": true, + "useDocumentVisibility": true, + "useDraggable": true, + "useDropZone": true, + "useElementBounding": true, + "useElementByPoint": true, + "useElementHover": true, + "useElementSize": true, + "useElementVisibility": true, + "useEventBus": true, + "useEventListener": true, + "useEventSource": true, + "useEyeDropper": true, + "useFavicon": true, + "useFetch": true, + "useFileDialog": true, + "useFileSystemAccess": true, + "useFocus": true, + "useFocusWithin": true, + "useFps": true, + "useFullscreen": true, + "useGamepad": true, + "useGeolocation": true, + "useIdle": true, + "useImage": true, + "useInfiniteScroll": true, + "useIntersectionObserver": true, + "useInterval": true, + "useIntervalFn": true, + "useKeyModifier": true, + "useLastChanged": true, + "useLocalStorage": true, + "useMagicKeys": true, + "useManualRefHistory": true, + "useMediaControls": true, + "useMediaQuery": true, + "useMemoize": true, + "useMemory": true, + "useMounted": true, + "useMouse": true, + "useMouseInElement": true, + "useMousePressed": true, + "useMutationObserver": true, + "useNavigatorLanguage": true, + "useNetwork": true, + "useNow": true, + "useObjectUrl": true, + "useOffsetPagination": true, + "useOnline": true, + "usePageLeave": true, + "useParallax": true, + "usePermission": true, + "usePointer": true, + "usePointerSwipe": true, + "usePreferredColorScheme": true, + "usePreferredDark": true, + "usePreferredLanguages": true, + "useRafFn": true, + "useRefHistory": true, + "useResizeObserver": true, + "useRoute": true, + "useRouter": true, + "useScreenOrientation": true, + "useScreenSafeArea": true, + "useScriptTag": true, + "useScroll": true, + "useScrollLock": true, + "useSessionStorage": true, + "useShare": true, + "useSlots": true, + "useSpeechRecognition": true, + "useSpeechSynthesis": true, + "useStepper": true, + "useStorage": true, + "useStorageAsync": true, + "useStyleTag": true, + "useSupported": true, + "useSwipe": true, + "useTemplateRefsList": true, + "useTextDirection": true, + "useTextSelection": true, + "useTextareaAutosize": true, + "useThrottle": true, + "useThrottleFn": true, + "useThrottledRefHistory": true, + "useTimeAgo": true, + "useTimeout": true, + "useTimeoutFn": true, + "useTimeoutPoll": true, + "useTimestamp": true, + "useTitle": true, + "useToggle": true, + "useTransition": true, + "useUrlSearchParams": true, + "useUserMedia": true, + "useVModel": true, + "useVModels": true, + "useVibrate": true, + "useVirtualList": true, + "useWakeLock": true, + "useWebNotification": true, + "useWebSocket": true, + "useWebWorker": true, + "useWebWorkerFn": true, + "useWindowFocus": true, + "useWindowScroll": true, + "useWindowSize": true, + "watch": true, + "watchArray": true, + "watchAtMost": true, + "watchDebounced": true, + "watchEffect": true, + "watchIgnorable": true, + "watchOnce": true, + "watchPausable": true, + "watchPostEffect": true, + "watchSyncEffect": true, + "watchThrottled": true, + "watchTriggerable": true, + "watchWithFilter": true, + "whenever": true + } +} diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..3e4af63 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,72 @@ +// @ts-check +const { defineConfig } = require('eslint-define-config') +module.exports = defineConfig({ + root: true, + env: { + browser: true, + node: true, + es6: true + }, + parser: 'vue-eslint-parser', + plugins: ['vue'], + parserOptions: { + parser: '@typescript-eslint/parser', + ecmaVersion: 2020, + sourceType: 'module', + jsxPragma: 'React', + ecmaFeatures: { + jsx: true + } + }, + extends: [ + 'plugin:vue/vue3-recommended', + 'plugin:@typescript-eslint/recommended', + // 'prettier', + // 'plugin:prettier/recommended', + '@unocss' + ], + rules: { + 'vue/script-setup-uses-vars': 'error', + 'vue/no-reserved-component-names': 'off', + 'vue/no-setup-props-destructure': 'off', + '@typescript-eslint/ban-ts-ignore': 'off', + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-empty-function': 'off', + 'vue/custom-event-name-casing': 'off', + 'no-use-before-define': 'off', + '@typescript-eslint/no-use-before-define': 'off', + '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/ban-types': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-unused-vars': 'off', + 'no-unused-vars': 'off', + 'space-before-function-paren': 'off', + + 'vue/attributes-order': 'off', + 'vue/one-component-per-file': 'off', + 'vue/html-closing-bracket-newline': 'off', + 'vue/max-attributes-per-line': 'off', + 'vue/multiline-html-element-content-newline': 'off', + 'vue/singleline-html-element-content-newline': 'off', + 'vue/attribute-hyphenation': 'off', + 'vue/require-default-prop': 'off', + 'vue/require-explicit-emits': 'off', + 'vue/html-self-closing': [ + 'error', + { + html: { + void: 'always', + normal: 'never', + component: 'always' + }, + svg: 'always', + math: 'always' + } + ], + 'vue/multi-word-component-names': 'off', + 'vue/no-v-html': 'off' + } +}) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0f033cc --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +node_modules +.DS_Store +dist +dist-ssr +*.local +/dist* +*-lock.* +pnpm-debug +auto-*.d.ts +.idea +.history diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..f68ea86 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,11 @@ +/node_modules/** +/dist/ +/dist* +/public/* +/docs/* +/vite.config.ts +/src/types/env.d.ts +/src/types/auto-components.d.ts +/src/types/auto-imports.d.ts +/docs/**/* +CHANGELOG diff --git a/.stylelintignore b/.stylelintignore new file mode 100644 index 0000000..aa605b4 --- /dev/null +++ b/.stylelintignore @@ -0,0 +1,6 @@ +/dist/* +/public/* +public/* +/dist* +/src/types/env.d.ts +/docs/**/* diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9861118 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021-present Archer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..36ce53a --- /dev/null +++ b/README.md @@ -0,0 +1,235 @@ +**严肃声明:现在、未来都不会有商业版本,所有代码全部开源!!** + +**「我喜欢写代码,乐此不疲」** +**「我喜欢做开源,以此为乐」** + +我 ?? 在上海艰苦奋斗,早中晚在 top3 大厂认真搬砖,夜里为开源做贡献。 + +如果这个项目让你有所收获,记得 Star 关注哦,这对我是非常不错的鼓励与支持。 + +## ?? 新手必读 + +* nodejs > 16.18.0 && pnpm > 8.6.0 (强制使用pnpm) +* 演示地址【Vue3 + element-plus】: +* 演示地址【Vue3 + vben(ant-design-vue)】: +* 演示地址【Vue2 + element-ui】: +* 启动文档: +* 视频教程: + +## ?? 平台简介 + +**闻荫**,以开发者为中心,打造中国第一流的快速开发平台,全部开源,个人与企业可 100% 免费使用。 + +* 采用 [vue-element-plus-admin](https://gitee.com/kailong110120130/vue-element-plus-admin) 实现 +* 改换 saas,自动引入等功能 +* 使用 Element Plus 免费开源的中后台模版,具备如下特性: + +![首页](public/home.png) + +* **最新技术栈**:使用 Vue3、Vite4 等前端前沿技术开发 +* **TypeScript**: 应用程序级 JavaScript 的语言 +* **主题**: 可配置的主题 +* **国际化**:内置完善的国际化方案 +* **权限**:内置完善的动态路由权限生成方案 +* **组件**:二次封装了多个常用的组件 +* **示例**:内置丰富的示例 + +## 技术栈 + +| 框架 | 说明 | 版本 | +|----------------------------------------------------------------------|------------------|--------| +| [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.3.4 | +| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 4.4.9 | +| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.3.14 | +| [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 5.2.2 | +| [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.1.6 | +| [vueuse](https://vueuse.org/) | 常用工具集 | 10.4.1 | +| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.4.1 | +| [vue-router](https://router.vuejs.org/) | Vue 路由 | 4.2.5 | +| [unocss](https://uno.antfu.me/) | 原子 css | 0.56.1 | +| [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 3.1.1 | +| [wangeditor](https://www.wangeditor.com/) | 富文本编辑器 | 5.1.23 | + +## 开发工具 + +推荐 VS Code 开发,配合插件如下: + +| 插件名 | 功能 | +|-------------------------------|--------------------------| +| TypeScript Vue Plugin (Volar) | 用于 TypeScript 的 Vue 插件 | +| Vue Language Features (Volar) | Vue3.0 语法支持 | +| unocss | unocss for vscode | +| Iconify IntelliSense | Iconify 预览和搜索 | +| i18n Ally | 国际化智能提示 | +| Stylelint | Css 格式化 | +| Prettier | 代码格式化 | +| ESLint | 脚本代码检查 | +| DotENV | env 文件高亮 | + +## 内置功能 + +系统内置多种多种业务功能,可以用于快速你的业务系统: + +* 系统功能 +* 基础设施 +* 工作流程 +* 支付系统 +* 会员中心 +* 数据报表 +* 商城系统 +* 微信公众号 + +### 系统功能 + +| | 功能 | 描述 | +|-----|-------|---------------------------------| +| | 用户管理 | 用户是系统操作者,该功能主要完成系统用户配置 | +| ⭐️ | 在线用户 | 当前系统中活跃用户状态监控,支持手动踢下线 | +| | 角色管理 | 角色菜单权限分配、设置角色按机构进行数据范围权限划分 | +| | 菜单管理 | 配置系统菜单、操作权限、按钮权限标识等,本地缓存提供性能 | +| | 部门管理 | 配置系统组织机构(公司、部门、小组),树结构展现支持数据权限 | +| | 岗位管理 | 配置系统用户所属担任职务 | +| ?? | 租户管理 | 配置系统租户,支持 SaaS 场景下的多租户功能 | +| ?? | 租户套餐 | 配置租户套餐,自定每个租户的菜单、操作、按钮的权限 | +| | 字典管理 | 对系统中经常使用的一些较为固定的数据进行维护 | +| ?? | 短信管理 | 短信渠道、短息模板、短信日志,对接阿里云、腾讯云等主流短信平台 | +| ?? | 邮件管理 | 邮箱账号、邮件模版、邮件发送日志,支持所有邮件平台 | +| ?? | 站内信 | 系统内的消息通知,提供站内信模版、站内信消息 | +| ?? | 操作日志 | 系统正常操作日志记录和查询,集成 Swagger 生成日志内容 | +| ⭐️ | 登录日志 | 系统登录日志记录查询,包含登录异常 | +| ?? | 错误码管理 | 系统所有错误码的管理,可在线修改错误提示,无需重启服务 | +| | 通知公告 | 系统通知公告信息发布维护 | +| ?? | 敏感词 | 配置系统敏感词,支持标签分组 | +| ?? | 应用管理 | 管理 SSO 单点登录的应用,支持多种 OAuth2 授权方式 | +| ?? | 地区管理 | 展示省份、城市、区镇等城市信息,支持 IP 对应城市 | + +### 工作流程 + +| | 功能 | 描述 | +|-----|-------|----------------------------------------| +| ?? | 流程模型 | 配置工作流的流程模型,支持文件导入与在线设计流程图,提供 7 种任务分配规则 | +| ?? | 流程表单 | 拖动表单元素生成相应的工作流表单,覆盖 Element UI 所有的表单组件 | +| ?? | 用户分组 | 自定义用户分组,可用于工作流的审批分组 | +| ?? | 我的流程 | 查看我发起的工作流程,支持新建、取消流程等操作,高亮流程图、审批时间线 | +| ?? | 待办任务 | 查看自己【未】审批的工作任务,支持通过、不通过、转发、委派、退回等操作 | +| ?? | 已办任务 | 查看自己【已】审批的工作任务,未来会支持回退操作 | +| ?? | OA 请假 | 作为业务自定义接入工作流的使用示例,只需创建请求对应的工作流程,即可进行审批 | + +### 支付系统 + +| | 功能 | 描述 | +|-----|------|---------------------------| +| ?? | 商户信息 | 管理商户信息,支持 Saas 场景下的多商户功能 | +| ?? | 应用信息 | 配置商户的应用信息,对接支付宝、微信等多个支付渠道 | +| ?? | 支付订单 | 查看用户发起的支付宝、微信等的【支付】订单 | +| ?? | 退款订单 | 查看用户发起的支付宝、微信等的【退款】订单 | + +ps:核心功能已经实现,正在对接微信小程序中... + +### 基础设施 + +| | 功能 | 描述 | +|-----|----------|----------------------------------------------| +| ?? | 代码生成 | 前后端代码的生成(Java、Vue、SQL、单元测试),支持 CRUD 下载 | +| ?? | 系统接口 | 基于 Swagger 自动生成相关的 RESTful API 接口文档 | +| ?? | 数据库文档 | 基于 Screw 自动生成数据库文档,支持导出 Word、HTML、MD 格式 | +| | 表单构建 | 拖动表单元素生成相应的 HTML 代码,支持导出 JSON、Vue 文件 | +| ?? | 配置管理 | 对系统动态配置常用参数,支持 SpringBoot 加载 | +| ⭐️ | 定时任务 | 在线(添加、修改、删除)任务调度包含执行结果日志 | +| ?? | 文件服务 | 支持将文件存储到 S3(MinIO、阿里云、腾讯云、七牛云)、本地、FTP、数据库等 | +| ?? | API 日志 | 包括 RESTful API 访问日志、异常日志两部分,方便排查 API 相关的问题 | +| | MySQL 监控 | 监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈 | +| | Redis 监控 | 监控 Redis 数据库的使用情况,使用的 Redis Key 管理 | +| ?? | 消息队列 | 基于 Redis 实现消息队列,Stream 提供集群消费,Pub/Sub 提供广播消费 | +| ?? | Java 监控 | 基于 Spring Boot Admin 实现 Java 应用的监控 | +| ?? | 链路追踪 | 接入 SkyWalking 组件,实现链路追踪 | +| ?? | 日志中心 | 接入 SkyWalking 组件,实现日志中心 | +| ?? | 分布式锁 | 基于 Redis 实现分布式锁,满足并发场景 | +| ?? | 幂等组件 | 基于 Redis 实现幂等组件,解决重复请求问题 | +| ?? | 服务保障 | 基于 Resilience4j 实现服务的稳定性,包括限流、熔断等功能 | +| ?? | 日志服务 | 轻量级日志中心,查看远程服务器的日志 | +| ?? | 单元测试 | 基于 JUnit + Mockito 实现单元测试,保证功能的正确性、代码的质量等 | + +### 数据报表 + +| | 功能 | 描述 | +|-----|-------|--------------------| +| ?? | 报表设计器 | 支持数据报表、图形报表、打印设计等 | +| ?? | 大屏设计器 | 拖拽生成数据大屏,内置几十种图表组件 | + +### 微信公众号 + +| | 功能 | 描述 | +|-----|--------|-------------------------------| +| ?? | 账号管理 | 配置接入的微信公众号,可支持多个公众号 | +| ?? | 数据统计 | 统计公众号的用户增减、累计用户、消息概况、接口分析等数据 | +| ?? | 粉丝管理 | 查看已关注、取关的粉丝列表,可对粉丝进行同步、打标签等操作 | +| ?? | 消息管理 | 查看粉丝发送的消息列表,可主动回复粉丝消息 | +| ?? | 自动回复 | 自动回复粉丝发送的消息,支持关注回复、消息回复、关键字回复 | +| ?? | 标签管理 | 对公众号的标签进行创建、查询、修改、删除等操作 | +| ?? | 菜单管理 | 自定义公众号的菜单,也可以从公众号同步菜单 | +| ?? | 素材管理 | 管理公众号的图片、语音、视频等素材,支持在线播放语音、视频 | +| ?? | 图文草稿箱 | 新增常用的图文素材到草稿箱,可发布到公众号 | +| ?? | 图文发表记录 | 查看已发布成功的图文素材,支持删除操作 | + +### 商城系统 + +建设中... + +![功能图](http://static.iocoder.cn/mall%20%E5%8A%9F%E8%83%BD%E5%9B%BE-min.png) + +![GIF 图-耐心等待](https://raw.githubusercontent.com/YunaiV/Blog/master/Mall/onemall-admin-min.gif) + +![GIF 图-耐心等待](https://raw.githubusercontent.com/YunaiV/Blog/master/Mall/onemall-h5-min.gif) + +## ?? 演示图 + +### 系统功能 + +| 模块 | biu | biu | biu | +|------------|--------------------------------------------------------------------|------------------------------------------------------------------|------------------------------------------------------------------| +| 登录 & 首页 | ![登录](https://static.iocoder.cn/images/ruoyi-vue-pro/登录.jpg?imageView2/2/format/webp/w/1280) | ![首页](https://static.iocoder.cn/images/ruoyi-vue-pro/首页.jpg?imageView2/2/format/webp/w/1280) | ![个人中心](https://static.iocoder.cn/images/ruoyi-vue-pro/个人中心.jpg?imageView2/2/format/webp/w/1280) | +| 用户 & 应用 | ![用户管理](https://static.iocoder.cn/images/ruoyi-vue-pro/用户管理.jpg?imageView2/2/format/webp/w/1280) | ![令牌管理](https://static.iocoder.cn/images/ruoyi-vue-pro/令牌管理.jpg?imageView2/2/format/webp/w/1280) | ![应用管理](https://static.iocoder.cn/images/ruoyi-vue-pro/应用管理.jpg?imageView2/2/format/webp/w/1280) | +| 租户 & 套餐 | ![租户管理](https://static.iocoder.cn/images/ruoyi-vue-pro/租户管理.jpg?imageView2/2/format/webp/w/1280) | ![租户套餐](https://static.iocoder.cn/images/ruoyi-vue-pro/租户套餐.png) | - | +| 部门 & 岗位 | ![部门管理](https://static.iocoder.cn/images/ruoyi-vue-pro/部门管理.jpg?imageView2/2/format/webp/w/1280) | ![岗位管理](https://static.iocoder.cn/images/ruoyi-vue-pro/岗位管理.jpg?imageView2/2/format/webp/w/1280) | - | +| 菜单 & 角色 | ![菜单管理](https://static.iocoder.cn/images/ruoyi-vue-pro/菜单管理.jpg?imageView2/2/format/webp/w/1280) | ![角色管理](https://static.iocoder.cn/images/ruoyi-vue-pro/角色管理.jpg?imageView2/2/format/webp/w/1280) | - | +| 审计日志 | ![操作日志](https://static.iocoder.cn/images/ruoyi-vue-pro/操作日志.jpg?imageView2/2/format/webp/w/1280) | ![登录日志](https://static.iocoder.cn/images/ruoyi-vue-pro/登录日志.jpg?imageView2/2/format/webp/w/1280) | - | +| 短信 | ![短信渠道](https://static.iocoder.cn/images/ruoyi-vue-pro/短信渠道.jpg?imageView2/2/format/webp/w/1280) | ![短信模板](https://static.iocoder.cn/images/ruoyi-vue-pro/短信模板.jpg?imageView2/2/format/webp/w/1280) | ![短信日志](https://static.iocoder.cn/images/ruoyi-vue-pro/短信日志.jpg?imageView2/2/format/webp/w/1280) | +| 字典 & 敏感词 | ![字典类型](https://static.iocoder.cn/images/ruoyi-vue-pro/字典类型.jpg?imageView2/2/format/webp/w/1280) | ![字典数据](https://static.iocoder.cn/images/ruoyi-vue-pro/字典数据.jpg?imageView2/2/format/webp/w/1280) | ![敏感词](https://static.iocoder.cn/images/ruoyi-vue-pro/敏感词.jpg?imageView2/2/format/webp/w/1280) | +| 错误码 & 通知 | ![错误码管理](https://static.iocoder.cn/images/ruoyi-vue-pro/错误码管理.jpg?imageView2/2/format/webp/w/1280) | ![通知公告](https://static.iocoder.cn/images/ruoyi-vue-pro/通知公告.jpg?imageView2/2/format/webp/w/1280) | - | + +### 工作流程 + +| 模块 | biu | biu | biu | +|---------|------------------------------------------------------------------------|------------------------------------------------------------------------|------------------------------------------------------------------------| +| 流程模型 | ![流程模型-列表](https://static.iocoder.cn/images/ruoyi-vue-pro/流程模型-列表.jpg?imageView2/2/format/webp/w/1280) | ![流程模型-设计](https://static.iocoder.cn/images/ruoyi-vue-pro/流程模型-设计.jpg?imageView2/2/format/webp/w/1280) | ![流程模型-定义](https://static.iocoder.cn/images/ruoyi-vue-pro/流程模型-定义.jpg?imageView2/2/format/webp/w/1280) | +| 表单 & 分组 | ![流程表单](https://static.iocoder.cn/images/ruoyi-vue-pro/流程表单.jpg?imageView2/2/format/webp/w/1280) | ![用户分组](https://static.iocoder.cn/images/ruoyi-vue-pro/用户分组.jpg?imageView2/2/format/webp/w/1280) | - | +| 我的流程 | ![我的流程-列表](https://static.iocoder.cn/images/ruoyi-vue-pro/我的流程-列表.jpg?imageView2/2/format/webp/w/1280) | ![我的流程-发起](https://static.iocoder.cn/images/ruoyi-vue-pro/我的流程-发起.jpg?imageView2/2/format/webp/w/1280) | ![我的流程-详情](https://static.iocoder.cn/images/ruoyi-vue-pro/我的流程-详情.jpg?imageView2/2/format/webp/w/1280) | +| 待办 & 已办 | ![任务列表-审批](https://static.iocoder.cn/images/ruoyi-vue-pro/任务列表-审批.jpg?imageView2/2/format/webp/w/1280) | ![任务列表-待办](https://static.iocoder.cn/images/ruoyi-vue-pro/任务列表-待办.jpg?imageView2/2/format/webp/w/1280) | ![任务列表-已办](https://static.iocoder.cn/images/ruoyi-vue-pro/任务列表-已办.jpg?imageView2/2/format/webp/w/1280) | +| OA 请假 | ![OA请假-列表](https://static.iocoder.cn/images/ruoyi-vue-pro/OA请假-列表.jpg?imageView2/2/format/webp/w/1280) | ![OA请假-发起](https://static.iocoder.cn/images/ruoyi-vue-pro/OA请假-发起.jpg?imageView2/2/format/webp/w/1280) | ![OA请假-详情](https://static.iocoder.cn/images/ruoyi-vue-pro/OA请假-详情.jpg?imageView2/2/format/webp/w/1280) | + +### 基础设施 + +| 模块 | biu | biu | biu | +|---------------|----------------------------------------------------------------------|--------------------------------------------------------------------|------------------------------------------------------------------| +| 代码生成 | ![代码生成](https://static.iocoder.cn/images/ruoyi-vue-pro/代码生成.jpg?imageView2/2/format/webp/w/1280) | ![生成效果](https://static.iocoder.cn/images/ruoyi-vue-pro/生成效果.jpg?imageView2/2/format/webp/w/1280) | - | +| 文档 | ![系统接口](https://static.iocoder.cn/images/ruoyi-vue-pro/系统接口.jpg?imageView2/2/format/webp/w/1280) | ![数据库文档](https://static.iocoder.cn/images/ruoyi-vue-pro/数据库文档.jpg?imageView2/2/format/webp/w/1280) | - | +| 文件 & 配置 | ![文件配置](https://static.iocoder.cn/images/ruoyi-vue-pro/文件配置.jpg?imageView2/2/format/webp/w/1280) | ![文件管理](https://static.iocoder.cn/images/ruoyi-vue-pro/文件管理2.jpg?imageView2/2/format/webp/w/1280) | ![配置管理](https://static.iocoder.cn/images/ruoyi-vue-pro/配置管理.jpg?imageView2/2/format/webp/w/1280) | +| 定时任务 | ![定时任务](https://static.iocoder.cn/images/ruoyi-vue-pro/定时任务.jpg?imageView2/2/format/webp/w/1280) | ![任务日志](https://static.iocoder.cn/images/ruoyi-vue-pro/任务日志.jpg?imageView2/2/format/webp/w/1280) | - | +| API 日志 | ![访问日志](https://static.iocoder.cn/images/ruoyi-vue-pro/访问日志.jpg?imageView2/2/format/webp/w/1280) | ![错误日志](https://static.iocoder.cn/images/ruoyi-vue-pro/错误日志.jpg?imageView2/2/format/webp/w/1280) | - | +| MySQL & Redis | ![MySQL](https://static.iocoder.cn/images/ruoyi-vue-pro/MySQL.jpg?imageView2/2/format/webp/w/1280) | ![Redis](https://static.iocoder.cn/images/ruoyi-vue-pro/Redis.jpg?imageView2/2/format/webp/w/1280) | - | +| 监控平台 | ![Java监控](https://static.iocoder.cn/images/ruoyi-vue-pro/Java监控.jpg?imageView2/2/format/webp/w/1280) | ![链路追踪](https://static.iocoder.cn/images/ruoyi-vue-pro/链路追踪.jpg?imageView2/2/format/webp/w/1280) | ![日志中心](https://static.iocoder.cn/images/ruoyi-vue-pro/日志中心.jpg?imageView2/2/format/webp/w/1280) | + +### 支付系统 + +| 模块 | biu | biu | biu | +|---------|------------------------------------------------------------------|------------------------------------------------------------------------|------------------------------------------------------------------------| +| 商家 & 应用 | ![商户信息](https://static.iocoder.cn/images/ruoyi-vue-pro/商户信息.jpg?imageView2/2/format/webp/w/1280) | ![应用信息-列表](https://static.iocoder.cn/images/ruoyi-vue-pro/应用信息-列表.jpg?imageView2/2/format/webp/w/1280) | ![应用信息-编辑](https://static.iocoder.cn/images/ruoyi-vue-pro/应用信息-编辑.jpg?imageView2/2/format/webp/w/1280) | +| 支付 & 退款 | ![支付订单](https://static.iocoder.cn/images/ruoyi-vue-pro/支付订单.jpg?imageView2/2/format/webp/w/1280) | ![退款订单](https://static.iocoder.cn/images/ruoyi-vue-pro/退款订单.jpg?imageView2/2/format/webp/w/1280) | --- | + +### 数据报表 + +| 模块 | biu | biu | biu | +|-------|--------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------| +| 报表设计器 | ![数据报表](https://static.iocoder.cn/images/ruoyi-vue-pro/报表设计器-数据报表.jpg?imageView2/2/format/webp/w/1280) | ![图形报表](https://static.iocoder.cn/images/ruoyi-vue-pro/报表设计器-图形报表.jpg?imageView2/2/format/webp/w/1280) | ![报表设计器-打印设计](https://static.iocoder.cn/images/ruoyi-vue-pro/报表设计器-打印设计.jpg?imageView2/2/format/webp/w/1280) | +| 大屏设计器 | ![大屏列表](https://static.iocoder.cn/images/ruoyi-vue-pro/大屏设计器-列表.jpg?imageView2/2/format/webp/w/1280) | ![大屏预览](https://static.iocoder.cn/images/ruoyi-vue-pro/大屏设计器-预览.jpg?imageView2/2/format/webp/w/1280) | ![大屏编辑](https://static.iocoder.cn/images/ruoyi-vue-pro/大屏设计器-编辑.jpg?imageView2/2/format/webp/w/1280) | diff --git a/build/vite/index.ts b/build/vite/index.ts new file mode 100644 index 0000000..0206710 --- /dev/null +++ b/build/vite/index.ts @@ -0,0 +1,107 @@ +import { resolve } from 'path' +import Vue from '@vitejs/plugin-vue' +import VueJsx from '@vitejs/plugin-vue-jsx' +import progress from 'vite-plugin-progress' +import EslintPlugin from 'vite-plugin-eslint' +import PurgeIcons from 'vite-plugin-purge-icons' +import { ViteEjsPlugin } from 'vite-plugin-ejs' +// @ts-ignore +import ElementPlus from 'unplugin-element-plus/vite' +import AutoImport from 'unplugin-auto-import/vite' +import Components from 'unplugin-vue-components/vite' +import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' +import viteCompression from 'vite-plugin-compression' +import topLevelAwait from 'vite-plugin-top-level-await' +import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite' +import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' +import UnoCSS from 'unocss/vite' + +export function createVitePlugins() { + const root = process.cwd() + + // 路径查找 + function pathResolve(dir: string) { + return resolve(root, '.', dir) + } + + return [ + Vue(), + VueJsx(), + UnoCSS(), + progress(), + PurgeIcons(), + ElementPlus({}), + AutoImport({ + include: [ + /\.[tj]sx?$/, // .ts, .tsx, .js, .jsx + /\.vue$/, + /\.vue\?vue/, // .vue + /\.md$/ // .md + ], + imports: [ + 'vue', + 'vue-router', + // 可额外添加需要 autoImport 的组件 + { + '@/hooks/web/useI18n': ['useI18n'], + '@/hooks/web/useMessage': ['useMessage'], + '@/hooks/web/useTable': ['useTable'], + '@/hooks/web/useCrudSchemas': ['useCrudSchemas'], + '@/utils/formRules': ['required'], + '@/utils/dict': ['DICT_TYPE'] + } + ], + dts: 'src/types/auto-imports.d.ts', + resolvers: [ElementPlusResolver()], + eslintrc: { + enabled: false, // Default `false` + filepath: './.eslintrc-auto-import.json', // Default `./.eslintrc-auto-import.json` + globalsPropValue: true // Default `true`, (true | false | 'readonly' | 'readable' | 'writable' | 'writeable') + } + }), + Components({ + // 要搜索组件的目录的相对路径 + dirs: ['src/components'], + // 组件的有效文件扩展名 + extensions: ['vue', 'md'], + // 搜索子目录 + deep: true, + include: [/\.vue$/, /\.vue\?vue/], + // 生成自定义 `auto-components.d.ts` 全局声明 + dts: 'src/types/auto-components.d.ts', + // 自定义组件的解析器 + resolvers: [ElementPlusResolver()], + exclude: [/[\\/]node_modules[\\/]/] + }), + EslintPlugin({ + cache: false, + include: ['src/**/*.vue', 'src/**/*.ts', 'src/**/*.tsx'] // 检查的文件 + }), + VueI18nPlugin({ + runtimeOnly: true, + compositionOnly: true, + include: [resolve(__dirname, 'src/locales/**')] + }), + createSvgIconsPlugin({ + iconDirs: [pathResolve('src/assets/svgs')], + symbolId: 'icon-[dir]-[name]', + svgoOptions: true + }), + viteCompression({ + verbose: true, // 是否在控制台输出压缩结果 + disable: false, // 是否禁用 + threshold: 10240, // 体积大于 threshold 才会被压缩,单位 b + algorithm: 'gzip', // 压缩算法,可选 [ 'gzip' , 'brotliCompress' ,'deflate' , 'deflateRaw'] + ext: '.gz', // 生成的压缩包后缀 + deleteOriginFile: false //压缩后是否删除源文件 + }), + ViteEjsPlugin(), + topLevelAwait({ + // https://juejin.cn/post/7152191742513512485 + // The export name of top-level await promise for each chunk module + promiseExportName: '__tla', + // The function to generate import names of top-level await promise in each chunk module + promiseImportName: (i) => `__tla_${i}` + }) + ] +} diff --git a/build/vite/optimize.ts b/build/vite/optimize.ts new file mode 100644 index 0000000..3dda50b --- /dev/null +++ b/build/vite/optimize.ts @@ -0,0 +1,112 @@ +const include = [ + 'qs', + 'url', + 'vue', + 'sass', + 'mitt', + 'axios', + 'pinia', + 'dayjs', + 'qrcode', + 'unocss', + 'vue-router', + 'vue-types', + 'vue-i18n', + 'crypto-js', + 'cropperjs', + 'lodash-es', + 'nprogress', + 'web-storage-cache', + '@iconify/iconify', + '@vueuse/core', + '@zxcvbn-ts/core', + 'echarts/core', + 'echarts/charts', + 'echarts/components', + 'echarts/renderers', + 'echarts-wordcloud', + '@wangeditor/editor', + '@wangeditor/editor-for-vue', + 'element-plus', + 'element-plus/es', + 'element-plus/es/locale/lang/zh-cn', + 'element-plus/es/locale/lang/en', + 'element-plus/es/components/avatar/style/css', + 'element-plus/es/components/space/style/css', + 'element-plus/es/components/backtop/style/css', + 'element-plus/es/components/form/style/css', + 'element-plus/es/components/radio-group/style/css', + 'element-plus/es/components/radio/style/css', + 'element-plus/es/components/checkbox/style/css', + 'element-plus/es/components/checkbox-group/style/css', + 'element-plus/es/components/switch/style/css', + 'element-plus/es/components/time-picker/style/css', + 'element-plus/es/components/date-picker/style/css', + 'element-plus/es/components/descriptions/style/css', + 'element-plus/es/components/descriptions-item/style/css', + 'element-plus/es/components/link/style/css', + 'element-plus/es/components/tooltip/style/css', + 'element-plus/es/components/drawer/style/css', + 'element-plus/es/components/dialog/style/css', + 'element-plus/es/components/checkbox-button/style/css', + 'element-plus/es/components/option-group/style/css', + 'element-plus/es/components/radio-button/style/css', + 'element-plus/es/components/cascader/style/css', + 'element-plus/es/components/color-picker/style/css', + 'element-plus/es/components/input-number/style/css', + 'element-plus/es/components/rate/style/css', + 'element-plus/es/components/select-v2/style/css', + 'element-plus/es/components/tree-select/style/css', + 'element-plus/es/components/slider/style/css', + 'element-plus/es/components/time-select/style/css', + 'element-plus/es/components/autocomplete/style/css', + 'element-plus/es/components/image-viewer/style/css', + 'element-plus/es/components/upload/style/css', + 'element-plus/es/components/col/style/css', + 'element-plus/es/components/form-item/style/css', + 'element-plus/es/components/alert/style/css', + 'element-plus/es/components/breadcrumb/style/css', + 'element-plus/es/components/select/style/css', + 'element-plus/es/components/input/style/css', + 'element-plus/es/components/breadcrumb-item/style/css', + 'element-plus/es/components/tag/style/css', + 'element-plus/es/components/pagination/style/css', + 'element-plus/es/components/table/style/css', + 'element-plus/es/components/table-v2/style/css', + 'element-plus/es/components/table-column/style/css', + 'element-plus/es/components/card/style/css', + 'element-plus/es/components/row/style/css', + 'element-plus/es/components/button/style/css', + 'element-plus/es/components/menu/style/css', + 'element-plus/es/components/sub-menu/style/css', + 'element-plus/es/components/menu-item/style/css', + 'element-plus/es/components/option/style/css', + 'element-plus/es/components/dropdown/style/css', + 'element-plus/es/components/dropdown-menu/style/css', + 'element-plus/es/components/dropdown-item/style/css', + 'element-plus/es/components/skeleton/style/css', + 'element-plus/es/components/skeleton/style/css', + 'element-plus/es/components/backtop/style/css', + 'element-plus/es/components/menu/style/css', + 'element-plus/es/components/sub-menu/style/css', + 'element-plus/es/components/menu-item/style/css', + 'element-plus/es/components/dropdown/style/css', + 'element-plus/es/components/tree/style/css', + 'element-plus/es/components/dropdown-menu/style/css', + 'element-plus/es/components/dropdown-item/style/css', + 'element-plus/es/components/badge/style/css', + 'element-plus/es/components/breadcrumb/style/css', + 'element-plus/es/components/breadcrumb-item/style/css', + 'element-plus/es/components/image/style/css', + 'element-plus/es/components/collapse-transition/style/css', + 'element-plus/es/components/timeline/style/css', + 'element-plus/es/components/timeline-item/style/css', + 'element-plus/es/components/collapse/style/css', + 'element-plus/es/components/collapse-item/style/css', + 'element-plus/es/components/button-group/style/css', + 'element-plus/es/components/text/style/css' +] + +const exclude = ['@iconify/json'] + +export { include, exclude } diff --git a/index.html b/index.html new file mode 100644 index 0000000..2fe32f5 --- /dev/null +++ b/index.html @@ -0,0 +1,152 @@ + + + + + + + + + + + %VITE_APP_TITLE% + + +
+ +
+
+
+ +
%VITE_APP_TITLE%
+
+
+
+
+
+
+
+
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..62dc388 --- /dev/null +++ b/package.json @@ -0,0 +1,133 @@ +{ + "name": "yudao-ui-admin-vue3", + "version": "1.8.2-snapshot", + "description": "基于vue3、vite4、element-plus、typesScript", + "author": "xingyu", + "private": false, + "scripts": { + "dev": "vite", + "test": "vite build --mode test", + "prod": "vite build --mode production", + "preview": "vite preview", + "lint": "eslint --fix --ext .js,.vue src" + }, + "dependencies": { + "@element-plus/icons-vue": "^2.1.0", + "@form-create/designer": "^3.1.3", + "@form-create/element-ui": "^3.1.24", + "@iconify/iconify": "^3.1.1", + "@videojs-player/vue": "^1.0.0", + "@vueuse/core": "^10.4.1", + "@wangeditor/editor": "^5.1.23", + "@wangeditor/editor-for-vue": "^5.1.10", + "@zxcvbn-ts/core": "^3.0.4", + "animate.css": "^4.1.1", + "axios": "^1.5.0", + "benz-amr-recorder": "^1.1.5", + "bpmn-js-token-simulation": "^0.10.0", + "camunda-bpmn-moddle": "^7.0.1", + "cropperjs": "^1.6.1", + "crypto-js": "^4.1.1", + "dayjs": "^1.11.10", + "diagram-js": "^12.3.0", + "echarts": "^5.4.3", + "echarts-wordcloud": "^2.1.0", + "element-plus": "2.3.14", + "fast-xml-parser": "^4.3.0", + "highlight.js": "^11.8.0", + "intro.js": "^7.2.0", + "jsencrypt": "^3.3.2", + "lodash-es": "^4.17.21", + "min-dash": "^4.1.1", + "mitt": "^3.0.1", + "nprogress": "^0.2.0", + "pinia": "^2.1.6", + "qrcode": "^1.5.3", + "qs": "^6.11.2", + "sortablejs": "^1.15.0", + "steady-xml": "^0.1.0", + "url": "^0.11.3", + "video.js": "^7.21.5", + "vue": "^3.3.4", + "vue-dompurify-html": "^4.1.4", + "vue-i18n": "^9.4.1", + "vue-router": "^4.2.5", + "vue-types": "^5.1.1", + "vuedraggable": "^4.1.0", + "web-storage-cache": "^1.1.1", + "xml-js": "^1.6.11" + }, + "devDependencies": { + "@commitlint/cli": "^17.7.1", + "@commitlint/config-conventional": "^17.7.0", + "@iconify/json": "^2.2.119", + "@intlify/unplugin-vue-i18n": "^1.2.0", + "@purge-icons/generated": "^0.9.0", + "@types/intro.js": "^5.1.1", + "@types/lodash-es": "^4.17.9", + "@types/node": "^20.6.0", + "@types/nprogress": "^0.2.0", + "@types/qrcode": "^1.5.2", + "@types/qs": "^6.9.8", + "@typescript-eslint/eslint-plugin": "^6.7.2", + "@typescript-eslint/parser": "^6.7.2", + "@unocss/eslint-config": "^0.56.1", + "@unocss/transformer-variant-group": "^0.56.1", + "@vitejs/plugin-legacy": "^4.1.1", + "@vitejs/plugin-vue": "^4.3.4", + "@vitejs/plugin-vue-jsx": "^3.0.2", + "@vue-macros/volar": "^0.14.3", + "autoprefixer": "^10.4.16", + "bpmn-js": "8.9.0", + "bpmn-js-properties-panel": "0.46.0", + "consola": "^3.2.3", + "eslint": "^8.49.0", + "eslint-config-prettier": "^9.0.0", + "eslint-define-config": "^1.23.0", + "eslint-plugin-prettier": "^5.0.0", + "eslint-plugin-vue": "^9.17.0", + "lint-staged": "^14.0.1", + "postcss": "^8.4.30", + "postcss-html": "^1.5.0", + "postcss-scss": "^4.0.8", + "prettier": "^3.0.3", + "rimraf": "^5.0.1", + "rollup": "^3.29.2", + "sass": "^1.68.0", + "stylelint": "^15.10.3", + "stylelint-config-html": "^1.1.0", + "stylelint-config-recommended": "^13.0.0", + "stylelint-config-standard": "^34.0.0", + "stylelint-order": "^6.0.3", + "terser": "^5.20.0", + "typescript": "5.2.2", + "unocss": "^0.56.1", + "unplugin-auto-import": "^0.16.6", + "unplugin-element-plus": "^0.8.0", + "unplugin-vue-components": "^0.25.2", + "vite": "4.4.9", + "vite-plugin-compression": "^0.5.1", + "vite-plugin-ejs": "^1.6.4", + "vite-plugin-eslint": "^1.8.1", + "vite-plugin-progress": "^0.0.7", + "vite-plugin-purge-icons": "^0.9.2", + "vite-plugin-svg-icons": "^2.0.1", + "vite-plugin-top-level-await": "^1.3.1", + "vue-eslint-parser": "^9.3.1", + "vue-tsc": "^1.8.13" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://gitee.com/yudaocode/yudao-ui-admin-vue3" + }, + "bugs": { + "url": "https://gitee.com/yudaocode/yudao-ui-admin-vue3/issues" + }, + "homepage": "https://gitee.com/yudaocode/yudao-ui-admin-vue3", + "packageManager": "pnpm@8.6.0", + "engines": { + "node": ">= 16.0.0", + "pnpm": ">=8.6.0" + } +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..961986e --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + autoprefixer: {} + } +} diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 0000000..b014bbf --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,22 @@ +module.exports = { + printWidth: 100, // 每行代码长度(默认80) + tabWidth: 2, // 每个tab相当于多少个空格(默认2)ab进行缩进(默认false) + useTabs: false, // 是否使用tab + semi: false, // 声明结尾使用分号(默认true) + vueIndentScriptAndStyle: false, + singleQuote: true, // 使用单引号(默认false) + quoteProps: 'as-needed', + bracketSpacing: true, // 对象字面量的大括号间使用空格(默认true) + trailingComma: 'none', // 多行使用拖尾逗号(默认none) + jsxSingleQuote: false, + // 箭头函数参数括号 默认avoid 可选 avoid| always + // avoid 能省略括号的时候就省略 例如x => x + // always 总是有括号 + arrowParens: 'always', + insertPragma: false, + requirePragma: false, + proseWrap: 'never', + htmlWhitespaceSensitivity: 'strict', + endOfLine: 'auto', + rangeStart: 0 +} diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..5a7de08 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/home.png b/public/home.png new file mode 100644 index 0000000..ccd4145 Binary files /dev/null and b/public/home.png differ diff --git a/public/logo.gif b/public/logo.gif new file mode 100644 index 0000000..fdbd32c Binary files /dev/null and b/public/logo.gif differ diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..c0d50c3 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,75 @@ + + + diff --git a/src/api/bpm/activity/index.ts b/src/api/bpm/activity/index.ts new file mode 100644 index 0000000..870d0d6 --- /dev/null +++ b/src/api/bpm/activity/index.ts @@ -0,0 +1,8 @@ +import request from '@/config/axios' + +export const getActivityList = async (params) => { + return await request.get({ + url: '/bpm/activity/list', + params + }) +} diff --git a/src/api/bpm/definition/index.ts b/src/api/bpm/definition/index.ts new file mode 100644 index 0000000..c0e51fa --- /dev/null +++ b/src/api/bpm/definition/index.ts @@ -0,0 +1,21 @@ +import request from '@/config/axios' + +export const getProcessDefinitionBpmnXML = async (id: number) => { + return await request.get({ + url: '/bpm/process-definition/get-bpmn-xml?id=' + id + }) +} + +export const getProcessDefinitionPage = async (params) => { + return await request.get({ + url: '/bpm/process-definition/page', + params + }) +} + +export const getProcessDefinitionList = async (params) => { + return await request.get({ + url: '/bpm/process-definition/list', + params + }) +} diff --git a/src/api/bpm/form/index.ts b/src/api/bpm/form/index.ts new file mode 100644 index 0000000..142ed24 --- /dev/null +++ b/src/api/bpm/form/index.ts @@ -0,0 +1,56 @@ +import request from '@/config/axios' + +export type FormVO = { + id: number + name: string + conf: string + fields: string[] + status: number + remark: string + createTime: string +} + +// 创建工作流的表单定义 +export const createForm = async (data: FormVO) => { + return await request.post({ + url: '/bpm/form/create', + data: data + }) +} + +// 更新工作流的表单定义 +export const updateForm = async (data: FormVO) => { + return await request.put({ + url: '/bpm/form/update', + data: data + }) +} + +// 删除工作流的表单定义 +export const deleteForm = async (id: number) => { + return await request.delete({ + url: '/bpm/form/delete?id=' + id + }) +} + +// 获得工作流的表单定义 +export const getForm = async (id: number) => { + return await request.get({ + url: '/bpm/form/get?id=' + id + }) +} + +// 获得工作流的表单定义分页 +export const getFormPage = async (params) => { + return await request.get({ + url: '/bpm/form/page', + params + }) +} + +// 获得动态表单的精简列表 +export const getSimpleFormList = async () => { + return await request.get({ + url: '/bpm/form/list-all-simple' + }) +} diff --git a/src/api/bpm/leave/index.ts b/src/api/bpm/leave/index.ts new file mode 100644 index 0000000..d4fe8d5 --- /dev/null +++ b/src/api/bpm/leave/index.ts @@ -0,0 +1,27 @@ +import request from '@/config/axios' + +export type LeaveVO = { + id: number + result: number + type: number + reason: string + processInstanceId: string + startTime: string + endTime: string + createTime: string +} + +// 创建请假申请 +export const createLeave = async (data: LeaveVO) => { + return await request.post({ url: '/bpm/oa/leave/create', data: data }) +} + +// 获得请假申请 +export const getLeave = async (id: number) => { + return await request.get({ url: '/bpm/oa/leave/get?id=' + id }) +} + +// 获得请假申请分页 +export const getLeavePage = async (params: PageParam) => { + return await request.get({ url: '/bpm/oa/leave/page', params }) +} diff --git a/src/api/bpm/model/index.ts b/src/api/bpm/model/index.ts new file mode 100644 index 0000000..2e1d4e6 --- /dev/null +++ b/src/api/bpm/model/index.ts @@ -0,0 +1,59 @@ +import request from '@/config/axios' + +export type ProcessDefinitionVO = { + id: string + version: number + deploymentTIme: string + suspensionState: number +} + +export type ModelVO = { + id: number + formName: string + key: string + name: string + description: string + category: string + formType: number + formId: number + formCustomCreatePath: string + formCustomViewPath: string + processDefinition: ProcessDefinitionVO + status: number + remark: string + createTime: string + bpmnXml: string +} + +export const getModelPage = async (params) => { + return await request.get({ url: '/bpm/model/page', params }) +} + +export const getModel = async (id: number) => { + return await request.get({ url: '/bpm/model/get?id=' + id }) +} + +export const updateModel = async (data: ModelVO) => { + return await request.put({ url: '/bpm/model/update', data: data }) +} + +// 任务状态修改 +export const updateModelState = async (id: number, state: number) => { + const data = { + id: id, + state: state + } + return await request.put({ url: '/bpm/model/update-state', data: data }) +} + +export const createModel = async (data: ModelVO) => { + return await request.post({ url: '/bpm/model/create', data: data }) +} + +export const deleteModel = async (id: number) => { + return await request.delete({ url: '/bpm/model/delete?id=' + id }) +} + +export const deployModel = async (id: number) => { + return await request.post({ url: '/bpm/model/deploy?id=' + id }) +} diff --git a/src/api/bpm/processInstance/index.ts b/src/api/bpm/processInstance/index.ts new file mode 100644 index 0000000..10cd3bc --- /dev/null +++ b/src/api/bpm/processInstance/index.ts @@ -0,0 +1,41 @@ +import request from '@/config/axios' + +export type Task = { + id: string + name: string +} + +export type ProcessInstanceVO = { + id: number + name: string + processDefinitionId: string + category: string + result: number + tasks: Task[] + fields: string[] + status: number + remark: string + businessKey: string + createTime: string + endTime: string +} + +export const getMyProcessInstancePage = async (params) => { + return await request.get({ url: '/bpm/process-instance/my-page', params }) +} + +export const createProcessInstance = async (data) => { + return await request.post({ url: '/bpm/process-instance/create', data: data }) +} + +export const cancelProcessInstance = async (id: number, reason: string) => { + const data = { + id: id, + reason: reason + } + return await request.delete({ url: '/bpm/process-instance/cancel', data: data }) +} + +export const getProcessInstance = async (id: number) => { + return await request.get({ url: '/bpm/process-instance/get?id=' + id }) +} diff --git a/src/api/bpm/task/index.ts b/src/api/bpm/task/index.ts new file mode 100644 index 0000000..e6478d3 --- /dev/null +++ b/src/api/bpm/task/index.ts @@ -0,0 +1,53 @@ +import request from '@/config/axios' + +export type TaskVO = { + id: number +} + +export const getTodoTaskPage = async (params) => { + return await request.get({ url: '/bpm/task/todo-page', params }) +} + +export const getDoneTaskPage = async (params) => { + return await request.get({ url: '/bpm/task/done-page', params }) +} + +export const completeTask = async (data) => { + return await request.put({ url: '/bpm/task/complete', data }) +} + +export const approveTask = async (data) => { + return await request.put({ url: '/bpm/task/approve', data }) +} + +export const rejectTask = async (data) => { + return await request.put({ url: '/bpm/task/reject', data }) +} +export const backTask = async (data) => { + return await request.put({ url: '/bpm/task/back', data }) +} + +export const updateTaskAssignee = async (data) => { + return await request.put({ url: '/bpm/task/update-assignee', data }) +} + +export const getTaskListByProcessInstanceId = async (processInstanceId) => { + return await request.get({ + url: '/bpm/task/list-by-process-instance-id?processInstanceId=' + processInstanceId + }) +} + +// 导出任务 +export const exportTask = async (params) => { + return await request.download({ url: '/bpm/task/export', params }) +} + +// 获取所有可回退的节点 +export const getReturnList = async (params) => { + return await request.get({ url: '/bpm/task/get-return-list', params }) +} + +// 回退 +export const returnTask = async (data) => { + return await request.put({ url: '/bpm/task/return', data }) +} diff --git a/src/api/bpm/taskAssignRule/index.ts b/src/api/bpm/taskAssignRule/index.ts new file mode 100644 index 0000000..5fbe342 --- /dev/null +++ b/src/api/bpm/taskAssignRule/index.ts @@ -0,0 +1,29 @@ +import request from '@/config/axios' + +export type TaskAssignVO = { + id: number + modelId: string + processDefinitionId: string + taskDefinitionKey: string + taskDefinitionName: string + options: string[] + type: number +} + +export const getTaskAssignRuleList = async (params) => { + return await request.get({ url: '/bpm/task-assign-rule/list', params }) +} + +export const createTaskAssignRule = async (data: TaskAssignVO) => { + return await request.post({ + url: '/bpm/task-assign-rule/create', + data: data + }) +} + +export const updateTaskAssignRule = async (data: TaskAssignVO) => { + return await request.put({ + url: '/bpm/task-assign-rule/update', + data: data + }) +} diff --git a/src/api/bpm/userGroup/index.ts b/src/api/bpm/userGroup/index.ts new file mode 100644 index 0000000..035762b --- /dev/null +++ b/src/api/bpm/userGroup/index.ts @@ -0,0 +1,47 @@ +import request from '@/config/axios' + +export type UserGroupVO = { + id: number + name: string + description: string + memberUserIds: number[] + status: number + remark: string + createTime: string +} + +// 创建用户组 +export const createUserGroup = async (data: UserGroupVO) => { + return await request.post({ + url: '/bpm/user-group/create', + data: data + }) +} + +// 更新用户组 +export const updateUserGroup = async (data: UserGroupVO) => { + return await request.put({ + url: '/bpm/user-group/update', + data: data + }) +} + +// 删除用户组 +export const deleteUserGroup = async (id: number) => { + return await request.delete({ url: '/bpm/user-group/delete?id=' + id }) +} + +// 获得用户组 +export const getUserGroup = async (id: number) => { + return await request.get({ url: '/bpm/user-group/get?id=' + id }) +} + +// 获得用户组分页 +export const getUserGroupPage = async (params) => { + return await request.get({ url: '/bpm/user-group/page', params }) +} + +// 获取用户组精简信息列表 +export const getSimpleUserGroupList = async (): Promise => { + return await request.get({ url: '/bpm/user-group/list-all-simple' }) +} diff --git a/src/api/infra/apiAccessLog/index.ts b/src/api/infra/apiAccessLog/index.ts new file mode 100644 index 0000000..c6b4b45 --- /dev/null +++ b/src/api/infra/apiAccessLog/index.ts @@ -0,0 +1,30 @@ +import request from '@/config/axios' + +export interface ApiAccessLogVO { + id: number + traceId: string + userId: number + userType: number + applicationName: string + requestMethod: string + requestParams: string + requestUrl: string + userIp: string + userAgent: string + beginTime: Date + endTIme: Date + duration: number + resultCode: number + resultMsg: string + createTime: Date +} + +// 查询列表API 访问日志 +export const getApiAccessLogPage = (params: PageParam) => { + return request.get({ url: '/infra/api-access-log/page', params }) +} + +// 导出API 访问日志 +export const exportApiAccessLog = (params) => { + return request.download({ url: '/infra/api-access-log/export-excel', params }) +} diff --git a/src/api/infra/apiErrorLog/index.ts b/src/api/infra/apiErrorLog/index.ts new file mode 100644 index 0000000..59ee214 --- /dev/null +++ b/src/api/infra/apiErrorLog/index.ts @@ -0,0 +1,48 @@ +import request from '@/config/axios' + +export interface ApiErrorLogVO { + id: number + traceId: string + userId: number + userType: number + applicationName: string + requestMethod: string + requestParams: string + requestUrl: string + userIp: string + userAgent: string + exceptionTime: Date + exceptionName: string + exceptionMessage: string + exceptionRootCauseMessage: string + exceptionStackTrace: string + exceptionClassName: string + exceptionFileName: string + exceptionMethodName: string + exceptionLineNumber: number + processUserId: number + processStatus: number + processTime: Date + resultCode: number + createTime: Date +} + +// 查询列表API 访问日志 +export const getApiErrorLogPage = (params: PageParam) => { + return request.get({ url: '/infra/api-error-log/page', params }) +} + +// 更新 API 错误日志的处理状态 +export const updateApiErrorLogPage = (id: number, processStatus: number) => { + return request.put({ + url: '/infra/api-error-log/update-status?id=' + id + '&processStatus=' + processStatus + }) +} + +// 导出API 访问日志 +export const exportApiErrorLog = (params) => { + return request.download({ + url: '/infra/api-error-log/export-excel', + params + }) +} diff --git a/src/api/infra/codegen/index.ts b/src/api/infra/codegen/index.ts new file mode 100644 index 0000000..64701ef --- /dev/null +++ b/src/api/infra/codegen/index.ts @@ -0,0 +1,123 @@ +import request from '@/config/axios' + +export type CodegenTableVO = { + id: number + tableId: number + isParentMenuIdValid: boolean + dataSourceConfigId: number + scene: number + tableName: string + tableComment: string + remark: string + moduleName: string + businessName: string + className: string + classComment: string + author: string + createTime: Date + updateTime: Date + templateType: number + parentMenuId: number +} + +export type CodegenColumnVO = { + id: number + tableId: number + columnName: string + dataType: string + columnComment: string + nullable: number + primaryKey: number + autoIncrement: string + ordinalPosition: number + javaType: string + javaField: string + dictType: string + example: string + createOperation: number + updateOperation: number + listOperation: number + listOperationCondition: string + listOperationResult: number + htmlType: string +} + +export type DatabaseTableVO = { + name: string + comment: string +} + +export type CodegenDetailVO = { + table: CodegenTableVO + columns: CodegenColumnVO[] +} + +export type CodegenPreviewVO = { + filePath: string + code: string +} + +export type CodegenUpdateReqVO = { + table: CodegenTableVO | any + columns: CodegenColumnVO[] +} + +export type CodegenCreateListReqVO = { + dataSourceConfigId: number + tableNames: string[] +} + +// 查询列表代码生成表定义 +export const getCodegenTablePage = (params: PageParam) => { + return request.get({ url: '/infra/codegen/table/page', params }) +} + +// 查询详情代码生成表定义 +export const getCodegenTable = (id: number) => { + return request.get({ url: '/infra/codegen/detail?tableId=' + id }) +} + +// 新增代码生成表定义 +export const createCodegenTable = (data: CodegenCreateListReqVO) => { + return request.post({ url: '/infra/codegen/create', data }) +} + +// 修改代码生成表定义 +export const updateCodegenTable = (data: CodegenUpdateReqVO) => { + return request.put({ url: '/infra/codegen/update', data }) +} + +// 基于数据库的表结构,同步数据库的表和字段定义 +export const syncCodegenFromDB = (id: number) => { + return request.put({ url: '/infra/codegen/sync-from-db?tableId=' + id }) +} + +// 基于 SQL 建表语句,同步数据库的表和字段定义 +export const syncCodegenFromSQL = (id: number, sql: string) => { + return request.put({ url: '/infra/codegen/sync-from-sql?tableId=' + id + '&sql=' + sql }) +} + +// 预览生成代码 +export const previewCodegen = (id: number) => { + return request.get({ url: '/infra/codegen/preview?tableId=' + id }) +} + +// 下载生成代码 +export const downloadCodegen = (id: number) => { + return request.download({ url: '/infra/codegen/download?tableId=' + id }) +} + +// 获得表定义 +export const getSchemaTableList = (params) => { + return request.get({ url: '/infra/codegen/db/table/list', params }) +} + +// 基于数据库的表结构,创建代码生成器的表定义 +export const createCodegenList = (data) => { + return request.post({ url: '/infra/codegen/create-list', data }) +} + +// 删除代码生成表定义 +export const deleteCodegenTable = (id: number) => { + return request.delete({ url: '/infra/codegen/delete?tableId=' + id }) +} diff --git a/src/api/infra/config/index.ts b/src/api/infra/config/index.ts new file mode 100644 index 0000000..5ef59f3 --- /dev/null +++ b/src/api/infra/config/index.ts @@ -0,0 +1,48 @@ +import request from '@/config/axios' + +export interface ConfigVO { + id: number | undefined + category: string + name: string + key: string + value: string + type: number + visible: boolean + remark: string + createTime: Date +} + +// 查询参数列表 +export const getConfigPage = (params: PageParam) => { + return request.get({ url: '/infra/config/page', params }) +} + +// 查询参数详情 +export const getConfig = (id: number) => { + return request.get({ url: '/infra/config/get?id=' + id }) +} + +// 根据参数键名查询参数值 +export const getConfigKey = (configKey: string) => { + return request.get({ url: '/infra/config/get-value-by-key?key=' + configKey }) +} + +// 新增参数 +export const createConfig = (data: ConfigVO) => { + return request.post({ url: '/infra/config/create', data }) +} + +// 修改参数 +export const updateConfig = (data: ConfigVO) => { + return request.put({ url: '/infra/config/update', data }) +} + +// 删除参数 +export const deleteConfig = (id: number) => { + return request.delete({ url: '/infra/config/delete?id=' + id }) +} + +// 导出参数 +export const exportConfig = (params) => { + return request.download({ url: '/infra/config/export', params }) +} diff --git a/src/api/infra/dataSourceConfig/index.ts b/src/api/infra/dataSourceConfig/index.ts new file mode 100644 index 0000000..b413f34 --- /dev/null +++ b/src/api/infra/dataSourceConfig/index.ts @@ -0,0 +1,35 @@ +import request from '@/config/axios' + +export interface DataSourceConfigVO { + id: number | undefined + name: string + url: string + username: string + password: string + createTime?: Date +} + +// 新增数据源配置 +export const createDataSourceConfig = (data: DataSourceConfigVO) => { + return request.post({ url: '/infra/data-source-config/create', data }) +} + +// 修改数据源配置 +export const updateDataSourceConfig = (data: DataSourceConfigVO) => { + return request.put({ url: '/infra/data-source-config/update', data }) +} + +// 删除数据源配置 +export const deleteDataSourceConfig = (id: number) => { + return request.delete({ url: '/infra/data-source-config/delete?id=' + id }) +} + +// 查询数据源配置详情 +export const getDataSourceConfig = (id: number) => { + return request.get({ url: '/infra/data-source-config/get?id=' + id }) +} + +// 查询数据源配置列表 +export const getDataSourceConfigList = () => { + return request.get({ url: '/infra/data-source-config/list' }) +} diff --git a/src/api/infra/dbDoc/index.ts b/src/api/infra/dbDoc/index.ts new file mode 100644 index 0000000..1a1a36b --- /dev/null +++ b/src/api/infra/dbDoc/index.ts @@ -0,0 +1,16 @@ +import request from '@/config/axios' + +// 导出Html +export const exportHtml = () => { + return request.download({ url: '/infra/db-doc/export-html' }) +} + +// 导出Word +export const exportWord = () => { + return request.download({ url: '/infra/db-doc/export-word' }) +} + +// 导出Markdown +export const exportMarkdown = () => { + return request.download({ url: '/infra/db-doc/export-markdown' }) +} diff --git a/src/api/infra/file/index.ts b/src/api/infra/file/index.ts new file mode 100644 index 0000000..f64bc0d --- /dev/null +++ b/src/api/infra/file/index.ts @@ -0,0 +1,17 @@ +import request from '@/config/axios' + +export interface FilePageReqVO extends PageParam { + path?: string + type?: string + createTime?: Date[] +} + +// 查询文件列表 +export const getFilePage = (params: FilePageReqVO) => { + return request.get({ url: '/infra/file/page', params }) +} + +// 删除文件 +export const deleteFile = (id: number) => { + return request.delete({ url: '/infra/file/delete?id=' + id }) +} diff --git a/src/api/infra/fileConfig/index.ts b/src/api/infra/fileConfig/index.ts new file mode 100644 index 0000000..b72f18b --- /dev/null +++ b/src/api/infra/fileConfig/index.ts @@ -0,0 +1,61 @@ +import request from '@/config/axios' + +export interface FileClientConfig { + basePath: string + host?: string + port?: number + username?: string + password?: string + mode?: string + endpoint?: string + bucket?: string + accessKey?: string + accessSecret?: string + domain: string +} + +export interface FileConfigVO { + id: number + name: string + storage: any + master: boolean + visible: boolean + config: FileClientConfig + remark: string + createTime: Date +} + +// 查询文件配置列表 +export const getFileConfigPage = (params: PageParam) => { + return request.get({ url: '/infra/file-config/page', params }) +} + +// 查询文件配置详情 +export const getFileConfig = (id: number) => { + return request.get({ url: '/infra/file-config/get?id=' + id }) +} + +// 更新文件配置为主配置 +export const updateFileConfigMaster = (id: number) => { + return request.put({ url: '/infra/file-config/update-master?id=' + id }) +} + +// 新增文件配置 +export const createFileConfig = (data: FileConfigVO) => { + return request.post({ url: '/infra/file-config/create', data }) +} + +// 修改文件配置 +export const updateFileConfig = (data: FileConfigVO) => { + return request.put({ url: '/infra/file-config/update', data }) +} + +// 删除文件配置 +export const deleteFileConfig = (id: number) => { + return request.delete({ url: '/infra/file-config/delete?id=' + id }) +} + +// 测试文件配置 +export const testFileConfig = (id: number) => { + return request.get({ url: '/infra/file-config/test?id=' + id }) +} diff --git a/src/api/infra/job/index.ts b/src/api/infra/job/index.ts new file mode 100644 index 0000000..033b2cb --- /dev/null +++ b/src/api/infra/job/index.ts @@ -0,0 +1,63 @@ +import request from '@/config/axios' + +export interface JobVO { + id: number + name: string + status: number + handlerName: string + handlerParam: string + cronExpression: string + retryCount: number + retryInterval: number + monitorTimeout: number + createTime: Date +} + +// 任务列表 +export const getJobPage = (params: PageParam) => { + return request.get({ url: '/infra/job/page', params }) +} + +// 任务详情 +export const getJob = (id: number) => { + return request.get({ url: '/infra/job/get?id=' + id }) +} + +// 新增任务 +export const createJob = (data: JobVO) => { + return request.post({ url: '/infra/job/create', data }) +} + +// 修改定时任务调度 +export const updateJob = (data: JobVO) => { + return request.put({ url: '/infra/job/update', data }) +} + +// 删除定时任务调度 +export const deleteJob = (id: number) => { + return request.delete({ url: '/infra/job/delete?id=' + id }) +} + +// 导出定时任务调度 +export const exportJob = (params) => { + return request.download({ url: '/infra/job/export-excel', params }) +} + +// 任务状态修改 +export const updateJobStatus = (id: number, status: number) => { + const params = { + id, + status + } + return request.put({ url: '/infra/job/update-status', params }) +} + +// 定时任务立即执行一次 +export const runJob = (id: number) => { + return request.put({ url: '/infra/job/trigger?id=' + id }) +} + +// 获得定时任务的下 n 次执行时间 +export const getJobNextTimes = (id: number) => { + return request.get({ url: '/infra/job/get_next_times?id=' + id }) +} diff --git a/src/api/infra/jobLog/index.ts b/src/api/infra/jobLog/index.ts new file mode 100644 index 0000000..f429cd9 --- /dev/null +++ b/src/api/infra/jobLog/index.ts @@ -0,0 +1,33 @@ +import request from '@/config/axios' + +export interface JobLogVO { + id: number + jobId: number + handlerName: string + handlerParam: string + cronExpression: string + executeIndex: string + beginTime: string + endTime: string + duration: string + status: number + createTime: string +} + +// 任务日志列表 +export const getJobLogPage = (params: PageParam) => { + return request.get({ url: '/infra/job-log/page', params }) +} + +// 任务日志详情 +export const getJobLog = (id: number) => { + return request.get({ url: '/infra/job-log/get?id=' + id }) +} + +// 导出定时任务日志 +export const exportJobLog = (params) => { + return request.download({ + url: '/infra/job-log/export-excel', + params + }) +} diff --git a/src/api/infra/redis/index.ts b/src/api/infra/redis/index.ts new file mode 100644 index 0000000..f27be77 --- /dev/null +++ b/src/api/infra/redis/index.ts @@ -0,0 +1,8 @@ +import request from '@/config/axios' + +/** + * 获取redis 监控信息 + */ +export const getCache = () => { + return request.get({ url: '/infra/redis/get-monitor-info' }) +} diff --git a/src/api/infra/redis/types.ts b/src/api/infra/redis/types.ts new file mode 100644 index 0000000..548bfe9 --- /dev/null +++ b/src/api/infra/redis/types.ts @@ -0,0 +1,176 @@ +export interface RedisMonitorInfoVO { + info: RedisInfoVO + dbSize: number + commandStats: RedisCommandStatsVO[] +} + +export interface RedisInfoVO { + io_threaded_reads_processed: string + tracking_clients: string + uptime_in_seconds: string + cluster_connections: string + current_cow_size: string + maxmemory_human: string + aof_last_cow_size: string + master_replid2: string + mem_replication_backlog: string + aof_rewrite_scheduled: string + total_net_input_bytes: string + rss_overhead_ratio: string + hz: string + current_cow_size_age: string + redis_build_id: string + errorstat_BUSYGROUP: string + aof_last_bgrewrite_status: string + multiplexing_api: string + client_recent_max_output_buffer: string + allocator_resident: string + mem_fragmentation_bytes: string + aof_current_size: string + repl_backlog_first_byte_offset: string + tracking_total_prefixes: string + redis_mode: string + redis_git_dirty: string + aof_delayed_fsync: string + allocator_rss_bytes: string + repl_backlog_histlen: string + io_threads_active: string + rss_overhead_bytes: string + total_system_memory: string + loading: string + evicted_keys: string + maxclients: string + cluster_enabled: string + redis_version: string + repl_backlog_active: string + mem_aof_buffer: string + allocator_frag_bytes: string + io_threaded_writes_processed: string + instantaneous_ops_per_sec: string + used_memory_human: string + total_error_replies: string + role: string + maxmemory: string + used_memory_lua: string + rdb_current_bgsave_time_sec: string + used_memory_startup: string + used_cpu_sys_main_thread: string + lazyfree_pending_objects: string + aof_pending_bio_fsync: string + used_memory_dataset_perc: string + allocator_frag_ratio: string + arch_bits: string + used_cpu_user_main_thread: string + mem_clients_normal: string + expired_time_cap_reached_count: string + unexpected_error_replies: string + mem_fragmentation_ratio: string + aof_last_rewrite_time_sec: string + master_replid: string + aof_rewrite_in_progress: string + lru_clock: string + maxmemory_policy: string + run_id: string + latest_fork_usec: string + tracking_total_items: string + total_commands_processed: string + expired_keys: string + errorstat_ERR: string + used_memory: string + module_fork_in_progress: string + errorstat_WRONGPASS: string + aof_buffer_length: string + dump_payload_sanitizations: string + mem_clients_slaves: string + keyspace_misses: string + server_time_usec: string + executable: string + lazyfreed_objects: string + db0: string + used_memory_peak_human: string + keyspace_hits: string + rdb_last_cow_size: string + aof_pending_rewrite: string + used_memory_overhead: string + active_defrag_hits: string + tcp_port: string + uptime_in_days: string + used_memory_peak_perc: string + current_save_keys_processed: string + blocked_clients: string + total_reads_processed: string + expire_cycle_cpu_milliseconds: string + sync_partial_err: string + used_memory_scripts_human: string + aof_current_rewrite_time_sec: string + aof_enabled: string + process_supervised: string + master_repl_offset: string + used_memory_dataset: string + used_cpu_user: string + rdb_last_bgsave_status: string + tracking_total_keys: string + atomicvar_api: string + allocator_rss_ratio: string + client_recent_max_input_buffer: string + clients_in_timeout_table: string + aof_last_write_status: string + mem_allocator: string + used_memory_scripts: string + used_memory_peak: string + process_id: string + master_failover_state: string + errorstat_NOAUTH: string + used_cpu_sys: string + repl_backlog_size: string + connected_slaves: string + current_save_keys_total: string + gcc_version: string + total_system_memory_human: string + sync_full: string + connected_clients: string + module_fork_last_cow_size: string + total_writes_processed: string + allocator_active: string + total_net_output_bytes: string + pubsub_channels: string + current_fork_perc: string + active_defrag_key_hits: string + rdb_changes_since_last_save: string + instantaneous_input_kbps: string + used_memory_rss_human: string + configured_hz: string + expired_stale_perc: string + active_defrag_misses: string + used_cpu_sys_children: string + number_of_cached_scripts: string + sync_partial_ok: string + used_memory_lua_human: string + rdb_last_save_time: string + pubsub_patterns: string + slave_expires_tracked_keys: string + redis_git_sha1: string + used_memory_rss: string + rdb_last_bgsave_time_sec: string + os: string + mem_not_counted_for_evict: string + active_defrag_running: string + rejected_connections: string + aof_rewrite_buffer_length: string + total_forks: string + active_defrag_key_misses: string + allocator_allocated: string + aof_base_size: string + instantaneous_output_kbps: string + second_repl_offset: string + rdb_bgsave_in_progress: string + used_cpu_user_children: string + total_connections_received: string + migrate_cached_sockets: string +} + +export interface RedisCommandStatsVO { + command: string + calls: number + usec: number +} diff --git a/src/api/login/index.ts b/src/api/login/index.ts new file mode 100644 index 0000000..444f0f2 --- /dev/null +++ b/src/api/login/index.ts @@ -0,0 +1,72 @@ +import request from '@/config/axios' +import { getRefreshToken } from '@/utils/auth' +import type { UserLoginVO } from './types' + +export interface SmsCodeVO { + mobile: string + scene: number +} + +export interface SmsLoginVO { + mobile: string + code: string +} + +// 登录 +export const login = (data: UserLoginVO) => { + return request.post({ url: '/system/auth/login', data }) +} + +// 刷新访问令牌 +export const refreshToken = () => { + return request.post({ url: '/system/auth/refresh-token?refreshToken=' + getRefreshToken() }) +} + +// 使用租户名,获得租户编号 +export const getTenantIdByName = (name: string) => { + return request.get({ url: '/system/tenant/get-id-by-name?name=' + name }) +} + +// 登出 +export const loginOut = () => { + return request.post({ url: '/system/auth/logout' }) +} + +// 获取用户权限信息 +export const getInfo = () => { + return request.get({ url: '/system/auth/get-permission-info' }) +} + +//获取登录验证码 +export const sendSmsCode = (data: SmsCodeVO) => { + return request.post({ url: '/system/auth/send-sms-code', data }) +} + +// 短信验证码登录 +export const smsLogin = (data: SmsLoginVO) => { + return request.post({ url: '/system/auth/sms-login', data }) +} + +// 社交授权的跳转 +export const socialAuthRedirect = (type: number, redirectUri: string) => { + return request.get({ + url: '/system/auth/social-auth-redirect?type=' + type + '&redirectUri=' + redirectUri + }) +} +// 获取验证图片以及 token +export const getCode = (data) => { + return request.postOriginal({ url: 'system/captcha/get', data }) +} + +// 滑动或者点选验证 +export const reqCheck = (data) => { + return request.postOriginal({ url: 'system/captcha/check', data }) +} + +// 获取验证码 +export const getCodeImg = () => { + return request.get({ + url: 'system/captcha/captchaImage', headers: { + isToken: false + }}) +} \ No newline at end of file diff --git a/src/api/login/oauth2/index.ts b/src/api/login/oauth2/index.ts new file mode 100644 index 0000000..aef1820 --- /dev/null +++ b/src/api/login/oauth2/index.ts @@ -0,0 +1,41 @@ +import request from '@/config/axios' + +// 获得授权信息 +export const getAuthorize = (clientId: string) => { + return request.get({ url: '/system/oauth2/authorize?clientId=' + clientId }) +} + +// 发起授权 +export const authorize = ( + responseType: string, + clientId: string, + redirectUri: string, + state: string, + autoApprove: boolean, + checkedScopes: string[], + uncheckedScopes: string[] +) => { + // 构建 scopes + const scopes = {} + for (const scope of checkedScopes) { + scopes[scope] = true + } + for (const scope of uncheckedScopes) { + scopes[scope] = false + } + // 发起请求 + return request.post({ + url: '/system/oauth2/authorize', + headers: { + 'Content-type': 'application/x-www-form-urlencoded' + }, + params: { + response_type: responseType, + client_id: clientId, + redirect_uri: redirectUri, + state: state, + auto_approve: autoApprove, + scope: JSON.stringify(scopes) + } + }) +} diff --git a/src/api/login/types.ts b/src/api/login/types.ts new file mode 100644 index 0000000..b2173f7 --- /dev/null +++ b/src/api/login/types.ts @@ -0,0 +1,28 @@ +export type UserLoginVO = { + username: string + password: string + captchaVerification: string +} + +export type TokenType = { + id: number // 编号 + accessToken: string // 访问令牌 + refreshToken: string // 刷新令牌 + userId: number // 用户编号 + userType: number //用户类型 + clientId: string //客户端编号 + expiresTime: number //过期时间 +} + +export type UserVO = { + id: number + username: string + nickname: string + deptId: number + email: string + mobile: string + sex: number + avatar: string + loginIp: string + loginDate: string +} diff --git a/src/api/redis/index.ts b/src/api/redis/index.ts new file mode 100644 index 0000000..b716359 --- /dev/null +++ b/src/api/redis/index.ts @@ -0,0 +1,21 @@ +import request from '@/config/axios' + +export interface RedisVO { + key: string + value: string +} + +// 加入缓存 +export const addRedis = async (data:RedisVO) => { + return await request.post({ url: `/infra/redis/set`, data }) +} + +// 获取缓存 +export const getRedis = async (key) => { + return await request.get({ url: `/infra/redis/get?key=` + key}) +} + +// 删除物料清单 +export const deleteRedis = async (key) => { + return await request.delete({ url: `/infra/redis/delete?key=` + key}) +} \ No newline at end of file diff --git a/src/api/system/area/index.ts b/src/api/system/area/index.ts new file mode 100644 index 0000000..b7da941 --- /dev/null +++ b/src/api/system/area/index.ts @@ -0,0 +1,19 @@ +import request from '@/config/axios' + +// 获得地区树 +export const getAreaTree = async () => { + return await request.get({ url: '/system/area/tree' }) +} + +export const getChildrenArea = async (id: number) => { + return await request.get({ url: '/system/area/get-children?id=' + id }) +} + +export const getAreaListByIds = async (ids) => { + return await request.get({ url: '/system/area/get-by-ids?ids=' + ids }) +} + +// 获得 IP 对应的地区名 +export const getAreaByIp = async (ip: string) => { + return await request.get({ url: '/system/area/get-by-ip?ip=' + ip }) +} diff --git a/src/api/system/dept/index.ts b/src/api/system/dept/index.ts new file mode 100644 index 0000000..d995f13 --- /dev/null +++ b/src/api/system/dept/index.ts @@ -0,0 +1,43 @@ +import request from '@/config/axios' + +export interface DeptVO { + id?: number + name: string + parentId: number + status: number + sort: number + leaderUserId: number + phone: string + email: string + createTime: Date +} + +// 查询部门(精简)列表 +export const getSimpleDeptList = async (): Promise => { + return await request.get({ url: '/system/dept/list-all-simple' }) +} + +// 查询部门列表 +export const getDeptPage = async (params: PageParam) => { + return await request.get({ url: '/system/dept/list', params }) +} + +// 查询部门详情 +export const getDept = async (id: number) => { + return await request.get({ url: '/system/dept/get?id=' + id }) +} + +// 新增部门 +export const createDept = async (data: DeptVO) => { + return await request.post({ url: '/system/dept/create', data: data }) +} + +// 修改部门 +export const updateDept = async (params: DeptVO) => { + return await request.put({ url: '/system/dept/update', data: params }) +} + +// 删除部门 +export const deleteDept = async (id: number) => { + return await request.delete({ url: '/system/dept/delete?id=' + id }) +} diff --git a/src/api/system/dict/dict.data.ts b/src/api/system/dict/dict.data.ts new file mode 100644 index 0000000..87e7dce --- /dev/null +++ b/src/api/system/dict/dict.data.ts @@ -0,0 +1,49 @@ +import request from '@/config/axios' + +export type DictDataVO = { + id: number | undefined + sort: number | undefined + label: string + value: string + dictType: string + status: number + colorType: string + cssClass: string + remark: string + createTime: Date +} + +// 查询字典数据(精简)列表 +export const listSimpleDictData = () => { + return request.get({ url: '/system/dict-data/list-all-simple' }) +} + +// 查询字典数据列表 +export const getDictDataPage = (params: PageParam) => { + return request.get({ url: '/system/dict-data/page', params }) +} + +// 查询字典数据详情 +export const getDictData = (id: number) => { + return request.get({ url: '/system/dict-data/get?id=' + id }) +} + +// 新增字典数据 +export const createDictData = (data: DictDataVO) => { + return request.post({ url: '/system/dict-data/create', data }) +} + +// 修改字典数据 +export const updateDictData = (data: DictDataVO) => { + return request.put({ url: '/system/dict-data/update', data }) +} + +// 删除字典数据 +export const deleteDictData = (id: number) => { + return request.delete({ url: '/system/dict-data/delete?id=' + id }) +} + +// 导出字典类型数据 +export const exportDictData = (params) => { + return request.get({ url: '/system/dict-data/export', params }) +} diff --git a/src/api/system/dict/dict.type.ts b/src/api/system/dict/dict.type.ts new file mode 100644 index 0000000..ed2969f --- /dev/null +++ b/src/api/system/dict/dict.type.ts @@ -0,0 +1,44 @@ +import request from '@/config/axios' + +export type DictTypeVO = { + id: number | undefined + name: string + type: string + status: number + remark: string + createTime: Date +} + +// 查询字典(精简)列表 +export const getSimpleDictTypeList = () => { + return request.get({ url: '/system/dict-type/list-all-simple' }) +} + +// 查询字典列表 +export const getDictTypePage = (params: PageParam) => { + return request.get({ url: '/system/dict-type/page', params }) +} + +// 查询字典详情 +export const getDictType = (id: number) => { + return request.get({ url: '/system/dict-type/get?id=' + id }) +} + +// 新增字典 +export const createDictType = (data: DictTypeVO) => { + return request.post({ url: '/system/dict-type/create', data }) +} + +// 修改字典 +export const updateDictType = (data: DictTypeVO) => { + return request.put({ url: '/system/dict-type/update', data }) +} + +// 删除字典 +export const deleteDictType = (id: number) => { + return request.delete({ url: '/system/dict-type/delete?id=' + id }) +} +// 导出字典类型 +export const exportDictType = (params) => { + return request.get({ url: '/system/dict-type/export', params }) +} diff --git a/src/api/system/errorCode/index.ts b/src/api/system/errorCode/index.ts new file mode 100644 index 0000000..8a86a63 --- /dev/null +++ b/src/api/system/errorCode/index.ts @@ -0,0 +1,40 @@ +import request from '@/config/axios' + +export interface ErrorCodeVO { + id: number | undefined + type: number + applicationName: string + code: number | undefined + message: string + memo: string + createTime: Date +} + +// 查询错误码列表 +export const getErrorCodePage = (params: PageParam) => { + return request.get({ url: '/system/error-code/page', params }) +} + +// 查询错误码详情 +export const getErrorCode = (id: number) => { + return request.get({ url: '/system/error-code/get?id=' + id }) +} + +// 新增错误码 +export const createErrorCode = (data: ErrorCodeVO) => { + return request.post({ url: '/system/error-code/create', data }) +} + +// 修改错误码 +export const updateErrorCode = (data: ErrorCodeVO) => { + return request.put({ url: '/system/error-code/update', data }) +} + +// 删除错误码 +export const deleteErrorCode = (id: number) => { + return request.delete({ url: '/system/error-code/delete?id=' + id }) +} +// 导出错误码 +export const excelErrorCode = (params) => { + return request.download({ url: '/system/error-code/export-excel', params }) +} diff --git a/src/api/system/loginLog/index.ts b/src/api/system/loginLog/index.ts new file mode 100644 index 0000000..f275c3e --- /dev/null +++ b/src/api/system/loginLog/index.ts @@ -0,0 +1,24 @@ +import request from '@/config/axios' + +export interface LoginLogVO { + id: number + logType: number + traceId: number + userId: number + userType: number + username: string + status: number + userIp: string + userAgent: string + createTime: Date +} + +// 查询登录日志列表 +export const getLoginLogPage = (params: PageParam) => { + return request.get({ url: '/system/login-log/page', params }) +} + +// 导出登录日志 +export const exportLoginLog = (params) => { + return request.download({ url: '/system/login-log/export', params }) +} diff --git a/src/api/system/mail/account/index.ts b/src/api/system/mail/account/index.ts new file mode 100644 index 0000000..9e10c92 --- /dev/null +++ b/src/api/system/mail/account/index.ts @@ -0,0 +1,41 @@ +import request from '@/config/axios' + +export interface MailAccountVO { + id: number + mail: string + username: string + password: string + host: string + port: number + sslEnable: boolean +} + +// 查询邮箱账号列表 +export const getMailAccountPage = async (params: PageParam) => { + return await request.get({ url: '/system/mail-account/page', params }) +} + +// 查询邮箱账号详情 +export const getMailAccount = async (id: number) => { + return await request.get({ url: '/system/mail-account/get?id=' + id }) +} + +// 新增邮箱账号 +export const createMailAccount = async (data: MailAccountVO) => { + return await request.post({ url: '/system/mail-account/create', data }) +} + +// 修改邮箱账号 +export const updateMailAccount = async (data: MailAccountVO) => { + return await request.put({ url: '/system/mail-account/update', data }) +} + +// 删除邮箱账号 +export const deleteMailAccount = async (id: number) => { + return await request.delete({ url: '/system/mail-account/delete?id=' + id }) +} + +// 获得邮箱账号精简列表 +export const getSimpleMailAccountList = async () => { + return request.get({ url: '/system/mail-account/list-all-simple' }) +} diff --git a/src/api/system/mail/log/index.ts b/src/api/system/mail/log/index.ts new file mode 100644 index 0000000..13172a7 --- /dev/null +++ b/src/api/system/mail/log/index.ts @@ -0,0 +1,30 @@ +import request from '@/config/axios' + +export interface MailLogVO { + id: number + userId: number + userType: number + toMail: string + accountId: number + fromMail: string + templateId: number + templateCode: string + templateNickname: string + templateTitle: string + templateContent: string + templateParams: string + sendStatus: number + sendTime: Date + sendMessageId: string + sendException: string +} + +// 查询邮件日志列表 +export const getMailLogPage = async (params: PageParam) => { + return await request.get({ url: '/system/mail-log/page', params }) +} + +// 查询邮件日志详情 +export const getMailLog = async (id: number) => { + return await request.get({ url: '/system/mail-log/get?id=' + id }) +} diff --git a/src/api/system/mail/template/index.ts b/src/api/system/mail/template/index.ts new file mode 100644 index 0000000..fb7ce5e --- /dev/null +++ b/src/api/system/mail/template/index.ts @@ -0,0 +1,50 @@ +import request from '@/config/axios' + +export interface MailTemplateVO { + id: number + name: string + code: string + accountId: number + nickname: string + title: string + content: string + params: string + status: number + remark: string +} + +export interface MailSendReqVO { + mail: string + templateCode: string + templateParams: Map +} + +// 查询邮件模版列表 +export const getMailTemplatePage = async (params: PageParam) => { + return await request.get({ url: '/system/mail-template/page', params }) +} + +// 查询邮件模版详情 +export const getMailTemplate = async (id: number) => { + return await request.get({ url: '/system/mail-template/get?id=' + id }) +} + +// 新增邮件模版 +export const createMailTemplate = async (data: MailTemplateVO) => { + return await request.post({ url: '/system/mail-template/create', data }) +} + +// 修改邮件模版 +export const updateMailTemplate = async (data: MailTemplateVO) => { + return await request.put({ url: '/system/mail-template/update', data }) +} + +// 删除邮件模版 +export const deleteMailTemplate = async (id: number) => { + return await request.delete({ url: '/system/mail-template/delete?id=' + id }) +} + +// 发送邮件 +export const sendMail = (data: MailSendReqVO) => { + return request.post({ url: '/system/mail-template/send-mail', data }) +} diff --git a/src/api/system/menu/index.ts b/src/api/system/menu/index.ts new file mode 100644 index 0000000..4bb9a87 --- /dev/null +++ b/src/api/system/menu/index.ts @@ -0,0 +1,49 @@ +import request from '@/config/axios' + +export interface MenuVO { + id: number + name: string + permission: string + type: number + sort: number + parentId: number + path: string + icon: string + component: string + componentName?: string + status: number + visible: boolean + keepAlive: boolean + alwaysShow?: boolean + createTime: Date +} + +// 查询菜单(精简)列表 +export const getSimpleMenusList = () => { + return request.get({ url: '/system/menu/list-all-simple' }) +} + +// 查询菜单列表 +export const getMenuList = (params) => { + return request.get({ url: '/system/menu/list', params }) +} + +// 获取菜单详情 +export const getMenu = (id: number) => { + return request.get({ url: '/system/menu/get?id=' + id }) +} + +// 新增菜单 +export const createMenu = (data: MenuVO) => { + return request.post({ url: '/system/menu/create', data }) +} + +// 修改菜单 +export const updateMenu = (data: MenuVO) => { + return request.put({ url: '/system/menu/update', data }) +} + +// 删除菜单 +export const deleteMenu = (id: number) => { + return request.delete({ url: '/system/menu/delete?id=' + id }) +} diff --git a/src/api/system/notice/index.ts b/src/api/system/notice/index.ts new file mode 100644 index 0000000..62bf525 --- /dev/null +++ b/src/api/system/notice/index.ts @@ -0,0 +1,37 @@ +import request from '@/config/axios' + +export interface NoticeVO { + id: number | undefined + title: string + type: number + content: string + status: number + remark: string + creator: string + createTime: Date +} + +// 查询公告列表 +export const getNoticePage = (params: PageParam) => { + return request.get({ url: '/system/notice/page', params }) +} + +// 查询公告详情 +export const getNotice = (id: number) => { + return request.get({ url: '/system/notice/get?id=' + id }) +} + +// 新增公告 +export const createNotice = (data: NoticeVO) => { + return request.post({ url: '/system/notice/create', data }) +} + +// 修改公告 +export const updateNotice = (data: NoticeVO) => { + return request.put({ url: '/system/notice/update', data }) +} + +// 删除公告 +export const deleteNotice = (id: number) => { + return request.delete({ url: '/system/notice/delete?id=' + id }) +} diff --git a/src/api/system/notify/message/index.ts b/src/api/system/notify/message/index.ts new file mode 100644 index 0000000..29036b9 --- /dev/null +++ b/src/api/system/notify/message/index.ts @@ -0,0 +1,48 @@ +import request from '@/config/axios' +import qs from 'qs' + +export interface NotifyMessageVO { + id: number + userId: number + userType: number + templateId: number + templateCode: string + templateNickname: string + templateContent: string + templateType: number + templateParams: string + readStatus: boolean + readTime: Date +} + +// 查询站内信消息列表 +export const getNotifyMessagePage = async (params: PageParam) => { + return await request.get({ url: '/system/notify-message/page', params }) +} + +// 获得我的站内信分页 +export const getMyNotifyMessagePage = async (params: PageParam) => { + return await request.get({ url: '/system/notify-message/my-page', params }) +} + +// 批量标记已读 +export const updateNotifyMessageRead = async (ids) => { + return await request.put({ + url: '/system/notify-message/update-read?' + qs.stringify({ ids: ids }, { indices: false }) + }) +} + +// 标记所有站内信为已读 +export const updateAllNotifyMessageRead = async () => { + return await request.put({ url: '/system/notify-message/update-all-read' }) +} + +// 获取当前用户的最新站内信列表 +export const getUnreadNotifyMessageList = async () => { + return await request.get({ url: '/system/notify-message/get-unread-list' }) +} + +// 获得当前用户的未读站内信数量 +export const getUnreadNotifyMessageCount = async () => { + return await request.get({ url: '/system/notify-message/get-unread-count' }) +} diff --git a/src/api/system/notify/template/index.ts b/src/api/system/notify/template/index.ts new file mode 100644 index 0000000..cd0e122 --- /dev/null +++ b/src/api/system/notify/template/index.ts @@ -0,0 +1,49 @@ +import request from '@/config/axios' + +export interface NotifyTemplateVO { + id?: number + name: string + nickname: string + code: string + content: string + type: number + params: string + status: number + remark: string +} + +export interface NotifySendReqVO { + userId: number | null + templateCode: string + templateParams: Map +} + +// 查询站内信模板列表 +export const getNotifyTemplatePage = async (params: PageParam) => { + return await request.get({ url: '/system/notify-template/page', params }) +} + +// 查询站内信模板详情 +export const getNotifyTemplate = async (id: number) => { + return await request.get({ url: '/system/notify-template/get?id=' + id }) +} + +// 新增站内信模板 +export const createNotifyTemplate = async (data: NotifyTemplateVO) => { + return await request.post({ url: '/system/notify-template/create', data }) +} + +// 修改站内信模板 +export const updateNotifyTemplate = async (data: NotifyTemplateVO) => { + return await request.put({ url: '/system/notify-template/update', data }) +} + +// 删除站内信模板 +export const deleteNotifyTemplate = async (id: number) => { + return await request.delete({ url: '/system/notify-template/delete?id=' + id }) +} + +// 发送站内信 +export const sendNotify = (data: NotifySendReqVO) => { + return request.post({ url: '/system/notify-template/send-notify', data }) +} diff --git a/src/api/system/oauth2/client.ts b/src/api/system/oauth2/client.ts new file mode 100644 index 0000000..6f71aca --- /dev/null +++ b/src/api/system/oauth2/client.ts @@ -0,0 +1,47 @@ +import request from '@/config/axios' + +export interface OAuth2ClientVO { + id: number + clientId: string + secret: string + name: string + logo: string + description: string + status: number + accessTokenValiditySeconds: number + refreshTokenValiditySeconds: number + redirectUris: string[] + autoApprove: boolean + authorizedGrantTypes: string[] + scopes: string[] + authorities: string[] + resourceIds: string[] + additionalInformation: string + isAdditionalInformationJson: boolean + createTime: Date +} + +// 查询 OAuth2 客户端的列表 +export const getOAuth2ClientPage = (params: PageParam) => { + return request.get({ url: '/system/oauth2-client/page', params }) +} + +// 查询 OAuth2 客户端的详情 +export const getOAuth2Client = (id: number) => { + return request.get({ url: '/system/oauth2-client/get?id=' + id }) +} + +// 新增 OAuth2 客户端 +export const createOAuth2Client = (data: OAuth2ClientVO) => { + return request.post({ url: '/system/oauth2-client/create', data }) +} + +// 修改 OAuth2 客户端 +export const updateOAuth2Client = (data: OAuth2ClientVO) => { + return request.put({ url: '/system/oauth2-client/update', data }) +} + +// 删除 OAuth2 +export const deleteOAuth2Client = (id: number) => { + return request.delete({ url: '/system/oauth2-client/delete?id=' + id }) +} diff --git a/src/api/system/oauth2/token.ts b/src/api/system/oauth2/token.ts new file mode 100644 index 0000000..ac89ae8 --- /dev/null +++ b/src/api/system/oauth2/token.ts @@ -0,0 +1,22 @@ +import request from '@/config/axios' + +export interface OAuth2TokenVO { + id: number + accessToken: string + refreshToken: string + userId: number + userType: number + clientId: string + createTime: Date + expiresTime: Date +} + +// 查询 token列表 +export const getAccessTokenPage = (params: PageParam) => { + return request.get({ url: '/system/oauth2-token/page', params }) +} + +// 删除 token +export const deleteAccessToken = (accessToken: string) => { + return request.delete({ url: '/system/oauth2-token/delete?accessToken=' + accessToken }) +} diff --git a/src/api/system/operatelog/index.ts b/src/api/system/operatelog/index.ts new file mode 100644 index 0000000..848a533 --- /dev/null +++ b/src/api/system/operatelog/index.ts @@ -0,0 +1,33 @@ +import request from '@/config/axios' + +export type OperateLogVO = { + id: number + userNickname: string + traceId: string + userId: number + module: string + name: string + type: number + content: string + exts: Map + requestMethod: string + requestUrl: string + userIp: string + userAgent: string + javaMethod: string + javaMethodArgs: string + startTime: Date + duration: number + resultCode: number + resultMsg: string + resultData: string +} + +// 查询操作日志列表 +export const getOperateLogPage = (params: PageParam) => { + return request.get({ url: '/system/operate-log/page', params }) +} +// 导出操作日志 +export const exportOperateLog = (params) => { + return request.download({ url: '/system/operate-log/export', params }) +} diff --git a/src/api/system/permission/index.ts b/src/api/system/permission/index.ts new file mode 100644 index 0000000..b3c7696 --- /dev/null +++ b/src/api/system/permission/index.ts @@ -0,0 +1,42 @@ +import request from '@/config/axios' + +export interface PermissionAssignUserRoleReqVO { + userId: number + roleIds: number[] +} + +export interface PermissionAssignRoleMenuReqVO { + roleId: number + menuIds: number[] +} + +export interface PermissionAssignRoleDataScopeReqVO { + roleId: number + dataScope: number + dataScopeDeptIds: number[] +} + +// 查询角色拥有的菜单权限 +export const getRoleMenuList = async (roleId: number) => { + return await request.get({ url: '/system/permission/list-role-menus?roleId=' + roleId }) +} + +// 赋予角色菜单权限 +export const assignRoleMenu = async (data: PermissionAssignRoleMenuReqVO) => { + return await request.post({ url: '/system/permission/assign-role-menu', data }) +} + +// 赋予角色数据权限 +export const assignRoleDataScope = async (data: PermissionAssignRoleDataScopeReqVO) => { + return await request.post({ url: '/system/permission/assign-role-data-scope', data }) +} + +// 查询用户拥有的角色数组 +export const getUserRoleList = async (userId: number) => { + return await request.get({ url: '/system/permission/list-user-roles?userId=' + userId }) +} + +// 赋予用户角色 +export const assignUserRole = async (data: PermissionAssignUserRoleReqVO) => { + return await request.post({ url: '/system/permission/assign-user-role', data }) +} diff --git a/src/api/system/post/index.ts b/src/api/system/post/index.ts new file mode 100644 index 0000000..405db38 --- /dev/null +++ b/src/api/system/post/index.ts @@ -0,0 +1,46 @@ +import request from '@/config/axios' + +export interface PostVO { + id?: number + name: string + code: string + sort: number + status: number + remark: string + createTime?: Date +} + +// 查询岗位列表 +export const getPostPage = async (params: PageParam) => { + return await request.get({ url: '/system/post/page', params }) +} + +// 获取岗位精简信息列表 +export const getSimplePostList = async (): Promise => { + return await request.get({ url: '/system/post/list-all-simple' }) +} + +// 查询岗位详情 +export const getPost = async (id: number) => { + return await request.get({ url: '/system/post/get?id=' + id }) +} + +// 新增岗位 +export const createPost = async (data: PostVO) => { + return await request.post({ url: '/system/post/create', data }) +} + +// 修改岗位 +export const updatePost = async (data: PostVO) => { + return await request.put({ url: '/system/post/update', data }) +} + +// 删除岗位 +export const deletePost = async (id: number) => { + return await request.delete({ url: '/system/post/delete?id=' + id }) +} + +// 导出岗位 +export const exportPost = async (params) => { + return await request.download({ url: '/system/post/export', params }) +} diff --git a/src/api/system/role/index.ts b/src/api/system/role/index.ts new file mode 100644 index 0000000..93636ff --- /dev/null +++ b/src/api/system/role/index.ts @@ -0,0 +1,61 @@ +import request from '@/config/axios' + +export interface RoleVO { + id: number + name: string + code: string + sort: number + status: number + type: number + dataScope: number + dataScopeDeptIds: number[] + createTime: Date +} + +export interface UpdateStatusReqVO { + id: number + status: number +} + +// 查询角色列表 +export const getRolePage = async (params: PageParam) => { + return await request.get({ url: '/system/role/page', params }) +} + +// 查询角色(精简)列表 +export const getSimpleRoleList = async (): Promise => { + return await request.get({ url: '/system/role/list-all-simple' }) +} + +// 查询角色详情 +export const getRole = async (id: number) => { + return await request.get({ url: '/system/role/get?id=' + id }) +} + +// 新增角色 +export const createRole = async (data: RoleVO) => { + return await request.post({ url: '/system/role/create', data }) +} + +// 修改角色 +export const updateRole = async (data: RoleVO) => { + return await request.put({ url: '/system/role/update', data }) +} + +// 修改角色状态 +export const updateRoleStatus = async (data: UpdateStatusReqVO) => { + return await request.put({ url: '/system/role/update-status', data }) +} + +// 删除角色 +export const deleteRole = async (id: number) => { + return await request.delete({ url: '/system/role/delete?id=' + id }) +} + +// 导出角色 +export const exportRole = (params) => { + return request.download({ + url: '/system/role/export-excel', + params + }) +} diff --git a/src/api/system/sensitiveWord/index.ts b/src/api/system/sensitiveWord/index.ts new file mode 100644 index 0000000..1116226 --- /dev/null +++ b/src/api/system/sensitiveWord/index.ts @@ -0,0 +1,58 @@ +import request from '@/config/axios' +import qs from 'qs' + +export interface SensitiveWordVO { + id: number + name: string + status: number + description: string + tags: string[] + createTime: Date +} + +export interface SensitiveWordTestReqVO { + text: string + tag: string[] +} + +// 查询敏感词列表 +export const getSensitiveWordPage = (params: PageParam) => { + return request.get({ url: '/system/sensitive-word/page', params }) +} + +// 查询敏感词详情 +export const getSensitiveWord = (id: number) => { + return request.get({ url: '/system/sensitive-word/get?id=' + id }) +} + +// 新增敏感词 +export const createSensitiveWord = (data: SensitiveWordVO) => { + return request.post({ url: '/system/sensitive-word/create', data }) +} + +// 修改敏感词 +export const updateSensitiveWord = (data: SensitiveWordVO) => { + return request.put({ url: '/system/sensitive-word/update', data }) +} + +// 删除敏感词 +export const deleteSensitiveWord = (id: number) => { + return request.delete({ url: '/system/sensitive-word/delete?id=' + id }) +} + +// 导出敏感词 +export const exportSensitiveWord = (params) => { + return request.download({ url: '/system/sensitive-word/export-excel', params }) +} + +// 获取所有敏感词的标签数组 +export const getSensitiveWordTagList = () => { + return request.get({ url: '/system/sensitive-word/get-tags' }) +} + +// 获得文本所包含的不合法的敏感词数组 +export const validateText = (query: SensitiveWordTestReqVO) => { + return request.get({ + url: '/system/sensitive-word/validate-text?' + qs.stringify(query, { arrayFormat: 'repeat' }) + }) +} diff --git a/src/api/system/serialNumber/index.ts b/src/api/system/serialNumber/index.ts new file mode 100644 index 0000000..33fa754 --- /dev/null +++ b/src/api/system/serialNumber/index.ts @@ -0,0 +1,42 @@ +import request from '@/config/axios' + +export interface SerialNumberVO { + id: number + ruleCode: string + ruleName: string + prefix: string + pattern: string + length: byte + separator: string + remark: string +} + +// 查询流水号规则列表 +export const getSerialNumberPage = async (params) => { + return await request.get({ url: `/system/serial-number/page`, params }) +} + +// 查询流水号规则详情 +export const getSerialNumber = async (id: number) => { + return await request.get({ url: `/system/serial-number/get?id=` + id }) +} + +// 新增流水号规则 +export const createSerialNumber = async (data: SerialNumberVO) => { + return await request.post({ url: `/system/serial-number/create`, data }) +} + +// 修改流水号规则 +export const updateSerialNumber = async (data: SerialNumberVO) => { + return await request.put({ url: `/system/serial-number/update`, data }) +} + +// 删除流水号规则 +export const deleteSerialNumber = async (id: number) => { + return await request.delete({ url: `/system/serial-number/delete?id=` + id }) +} + +// 导出流水号规则 Excel +export const exportSerialNumber = async (params) => { + return await request.download({ url: `/system/serial-number/export-excel`, params }) +} diff --git a/src/api/system/sms/smsChannel/index.ts b/src/api/system/sms/smsChannel/index.ts new file mode 100644 index 0000000..f335628 --- /dev/null +++ b/src/api/system/sms/smsChannel/index.ts @@ -0,0 +1,43 @@ +import request from '@/config/axios' + +export interface SmsChannelVO { + id: number + code: string + status: number + signature: string + remark: string + apiKey: string + apiSecret: string + callbackUrl: string + createTime: Date +} + +// 查询短信渠道列表 +export const getSmsChannelPage = (params: PageParam) => { + return request.get({ url: '/system/sms-channel/page', params }) +} + +// 获得短信渠道精简列表 +export function getSimpleSmsChannelList() { + return request.get({ url: '/system/sms-channel/list-all-simple' }) +} + +// 查询短信渠道详情 +export const getSmsChannel = (id: number) => { + return request.get({ url: '/system/sms-channel/get?id=' + id }) +} + +// 新增短信渠道 +export const createSmsChannel = (data: SmsChannelVO) => { + return request.post({ url: '/system/sms-channel/create', data }) +} + +// 修改短信渠道 +export const updateSmsChannel = (data: SmsChannelVO) => { + return request.put({ url: '/system/sms-channel/update', data }) +} + +// 删除短信渠道 +export const deleteSmsChannel = (id: number) => { + return request.delete({ url: '/system/sms-channel/delete?id=' + id }) +} diff --git a/src/api/system/sms/smsLog/index.ts b/src/api/system/sms/smsLog/index.ts new file mode 100644 index 0000000..3d54fac --- /dev/null +++ b/src/api/system/sms/smsLog/index.ts @@ -0,0 +1,39 @@ +import request from '@/config/axios' + +export interface SmsLogVO { + id: number | null + channelId: number | null + channelCode: string + templateId: number | null + templateCode: string + templateType: number | null + templateContent: string + templateParams: Map | null + apiTemplateId: string + mobile: string + userId: number | null + userType: number | null + sendStatus: number | null + sendTime: Date | null + sendCode: number | null + sendMsg: string + apiSendCode: string + apiSendMsg: string + apiRequestId: string + apiSerialNo: string + receiveStatus: number | null + receiveTime: Date | null + apiReceiveCode: string + apiReceiveMsg: string + createTime: Date | null +} + +// 查询短信日志列表 +export const getSmsLogPage = (params: PageParam) => { + return request.get({ url: '/system/sms-log/page', params }) +} + +// 导出短信日志 +export const exportSmsLog = (params) => { + return request.download({ url: '/system/sms-log/export-excel', params }) +} diff --git a/src/api/system/sms/smsTemplate/index.ts b/src/api/system/sms/smsTemplate/index.ts new file mode 100644 index 0000000..35cb489 --- /dev/null +++ b/src/api/system/sms/smsTemplate/index.ts @@ -0,0 +1,60 @@ +import request from '@/config/axios' + +export interface SmsTemplateVO { + id: number | null + type: number | null + status: number + code: string + name: string + content: string + remark: string + apiTemplateId: string + channelId: number | null + channelCode?: string + params?: string[] + createTime?: Date +} + +export interface SendSmsReqVO { + mobile: string + templateCode: string + templateParams: Map +} + +// 查询短信模板列表 +export const getSmsTemplatePage = (params: PageParam) => { + return request.get({ url: '/system/sms-template/page', params }) +} + +// 查询短信模板详情 +export const getSmsTemplate = (id: number) => { + return request.get({ url: '/system/sms-template/get?id=' + id }) +} + +// 新增短信模板 +export const createSmsTemplate = (data: SmsTemplateVO) => { + return request.post({ url: '/system/sms-template/create', data }) +} + +// 修改短信模板 +export const updateSmsTemplate = (data: SmsTemplateVO) => { + return request.put({ url: '/system/sms-template/update', data }) +} + +// 删除短信模板 +export const deleteSmsTemplate = (id: number) => { + return request.delete({ url: '/system/sms-template/delete?id=' + id }) +} + +// 导出短信模板 +export const exportSmsTemplate = (params) => { + return request.download({ + url: '/system/sms-template/export-excel', + params + }) +} + +// 发送短信 +export const sendSms = (data: SendSmsReqVO) => { + return request.post({ url: '/system/sms-template/send-sms', data }) +} diff --git a/src/api/system/tenant/index.ts b/src/api/system/tenant/index.ts new file mode 100644 index 0000000..176c375 --- /dev/null +++ b/src/api/system/tenant/index.ts @@ -0,0 +1,62 @@ +import request from '@/config/axios' + +export interface TenantVO { + id: number + name: string + contactName: string + contactMobile: string + status: number + domain: string + packageId: number + username: string + password: string + expireTime: Date + accountCount: number + createTime: Date +} + +export interface TenantPageReqVO extends PageParam { + name?: string + contactName?: string + contactMobile?: string + status?: number + createTime?: Date[] +} + +export interface TenantExportReqVO { + name?: string + contactName?: string + contactMobile?: string + status?: number + createTime?: Date[] +} + +// 查询租户列表 +export const getTenantPage = (params: TenantPageReqVO) => { + return request.get({ url: '/system/tenant/page', params }) +} + +// 查询租户详情 +export const getTenant = (id: number) => { + return request.get({ url: '/system/tenant/get?id=' + id }) +} + +// 新增租户 +export const createTenant = (data: TenantVO) => { + return request.post({ url: '/system/tenant/create', data }) +} + +// 修改租户 +export const updateTenant = (data: TenantVO) => { + return request.put({ url: '/system/tenant/update', data }) +} + +// 删除租户 +export const deleteTenant = (id: number) => { + return request.delete({ url: '/system/tenant/delete?id=' + id }) +} + +// 导出租户 +export const exportTenant = (params: TenantExportReqVO) => { + return request.download({ url: '/system/tenant/export-excel', params }) +} diff --git a/src/api/system/tenantPackage/index.ts b/src/api/system/tenantPackage/index.ts new file mode 100644 index 0000000..01d139e --- /dev/null +++ b/src/api/system/tenantPackage/index.ts @@ -0,0 +1,42 @@ +import request from '@/config/axios' + +export interface TenantPackageVO { + id: number + name: string + status: number + remark: string + creator: string + updater: string + updateTime: string + menuIds: number[] + createTime: Date +} + +// 查询租户套餐列表 +export const getTenantPackagePage = (params: PageParam) => { + return request.get({ url: '/system/tenant-package/page', params }) +} + +// 获得租户 +export const getTenantPackage = (id: number) => { + return request.get({ url: '/system/tenant-package/get?id=' + id }) +} + +// 新增租户套餐 +export const createTenantPackage = (data: TenantPackageVO) => { + return request.post({ url: '/system/tenant-package/create', data }) +} + +// 修改租户套餐 +export const updateTenantPackage = (data: TenantPackageVO) => { + return request.put({ url: '/system/tenant-package/update', data }) +} + +// 删除租户套餐 +export const deleteTenantPackage = (id: number) => { + return request.delete({ url: '/system/tenant-package/delete?id=' + id }) +} +// 获取租户套餐精简信息列表 +export const getTenantPackageList = () => { + return request.get({ url: '/system/tenant-package/get-simple-list' }) +} diff --git a/src/api/system/user/index.ts b/src/api/system/user/index.ts new file mode 100644 index 0000000..6224f0e --- /dev/null +++ b/src/api/system/user/index.ts @@ -0,0 +1,76 @@ +import request from '@/config/axios' + +export interface UserVO { + id: number + username: string + nickname: string + deptId: number + postIds: string[] + email: string + mobile: string + sex: number + avatar: string + loginIp: string + status: number + remark: string + loginDate: Date + createTime: Date +} + +// 查询用户管理列表 +export const getUserPage = (params: PageParam) => { + return request.get({ url: '/system/user/page', params }) +} + +// 查询用户详情 +export const getUser = (id: number) => { + return request.get({ url: '/system/user/get?id=' + id }) +} + +// 新增用户 +export const createUser = (data: UserVO) => { + return request.post({ url: '/system/user/create', data }) +} + +// 修改用户 +export const updateUser = (data: UserVO) => { + return request.put({ url: '/system/user/update', data }) +} + +// 删除用户 +export const deleteUser = (id: number) => { + return request.delete({ url: '/system/user/delete?id=' + id }) +} + +// 导出用户 +export const exportUser = (params) => { + return request.download({ url: '/system/user/export', params }) +} + +// 下载用户导入模板 +export const importUserTemplate = () => { + return request.download({ url: '/system/user/get-import-template' }) +} + +// 用户密码重置 +export const resetUserPwd = (id: number, password: string) => { + const data = { + id, + password + } + return request.put({ url: '/system/user/update-password', data: data }) +} + +// 用户状态修改 +export const updateUserStatus = (id: number, status: number) => { + const data = { + id, + status + } + return request.put({ url: '/system/user/update-status', data: data }) +} + +// 获取用户精简信息列表 +export const getSimpleUserList = (): Promise => { + return request.get({ url: '/system/user/list-all-simple' }) +} diff --git a/src/api/system/user/profile.ts b/src/api/system/user/profile.ts new file mode 100644 index 0000000..b2623c8 --- /dev/null +++ b/src/api/system/user/profile.ts @@ -0,0 +1,77 @@ +import request from '@/config/axios' + +export interface ProfileDept { + id: number + name: string +} +export interface ProfileRole { + id: number + name: string +} +export interface ProfilePost { + id: number + name: string +} +export interface SocialUser { + id: number + type: number + openid: string + token: string + rawTokenInfo: string + nickname: string + avatar: string + rawUserInfo: string + code: string + state: string +} +export interface ProfileVO { + id: number + username: string + nickname: string + dept: ProfileDept + roles: ProfileRole[] + posts: ProfilePost[] + socialUsers: SocialUser[] + email: string + mobile: string + sex: number + avatar: string + status: number + remark: string + loginIp: string + loginDate: Date + createTime: Date +} + +export interface UserProfileUpdateReqVO { + nickname: string + email: string + mobile: string + sex: number +} + +// 查询用户个人信息 +export const getUserProfile = () => { + return request.get({ url: '/system/user/profile/get' }) +} + +// 修改用户个人信息 +export const updateUserProfile = (data: UserProfileUpdateReqVO) => { + return request.put({ url: '/system/user/profile/update', data }) +} + +// 用户密码重置 +export const updateUserPassword = (oldPassword: string, newPassword: string) => { + return request.put({ + url: '/system/user/profile/update-password', + data: { + oldPassword: oldPassword, + newPassword: newPassword + } + }) +} + +// 用户头像上传 +export const uploadAvatar = (data) => { + return request.upload({ url: '/system/user/profile/update-avatar', data: data }) +} diff --git a/src/api/system/user/socialUser.ts b/src/api/system/user/socialUser.ts new file mode 100644 index 0000000..79f4d40 --- /dev/null +++ b/src/api/system/user/socialUser.ts @@ -0,0 +1,31 @@ +import request from '@/config/axios' + +// 社交绑定,使用 code 授权码 +export const socialBind = (type, code, state) => { + return request.post({ + url: '/system/social-user/bind', + data: { + type, + code, + state + } + }) +} + +// 取消社交绑定 +export const socialUnbind = (type, openid) => { + return request.delete({ + url: '/system/social-user/unbind', + data: { + type, + openid + } + }) +} + +// 社交授权的跳转 +export const socialAuthRedirect = (type, redirectUri) => { + return request.get({ + url: '/system/auth/social-auth-redirect?type=' + type + '&redirectUri=' + redirectUri + }) +} diff --git a/src/assets/imgs/avatar.gif b/src/assets/imgs/avatar.gif new file mode 100644 index 0000000..fdbd32c Binary files /dev/null and b/src/assets/imgs/avatar.gif differ diff --git a/src/assets/imgs/avatar.jpg b/src/assets/imgs/avatar.jpg new file mode 100644 index 0000000..d46a70a Binary files /dev/null and b/src/assets/imgs/avatar.jpg differ diff --git a/src/assets/imgs/code.png b/src/assets/imgs/code.png new file mode 100644 index 0000000..ac4c16f Binary files /dev/null and b/src/assets/imgs/code.png differ diff --git a/src/assets/imgs/logo.png b/src/assets/imgs/logo.png new file mode 100644 index 0000000..87c1d32 Binary files /dev/null and b/src/assets/imgs/logo.png differ diff --git a/src/assets/imgs/logo1.png b/src/assets/imgs/logo1.png new file mode 100644 index 0000000..572b2e0 Binary files /dev/null and b/src/assets/imgs/logo1.png differ diff --git a/src/assets/imgs/logo_w.png b/src/assets/imgs/logo_w.png new file mode 100644 index 0000000..5d8b3fe Binary files /dev/null and b/src/assets/imgs/logo_w.png differ diff --git a/src/assets/imgs/profile.jpg b/src/assets/imgs/profile.jpg new file mode 100644 index 0000000..e4bcf87 Binary files /dev/null and b/src/assets/imgs/profile.jpg differ diff --git a/src/assets/imgs/wechat.png b/src/assets/imgs/wechat.png new file mode 100644 index 0000000..6afc5e4 Binary files /dev/null and b/src/assets/imgs/wechat.png differ diff --git a/src/assets/svgs/403.svg b/src/assets/svgs/403.svg new file mode 100644 index 0000000..4500596 --- /dev/null +++ b/src/assets/svgs/403.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/404.svg b/src/assets/svgs/404.svg new file mode 100644 index 0000000..5244d8d --- /dev/null +++ b/src/assets/svgs/404.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/500.svg b/src/assets/svgs/500.svg new file mode 100644 index 0000000..9c02092 --- /dev/null +++ b/src/assets/svgs/500.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/icon.svg b/src/assets/svgs/icon.svg new file mode 100644 index 0000000..7024bec --- /dev/null +++ b/src/assets/svgs/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/login-bg.svg b/src/assets/svgs/login-bg.svg new file mode 100644 index 0000000..bbe06c1 --- /dev/null +++ b/src/assets/svgs/login-bg.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/login-box-bg.svg b/src/assets/svgs/login-box-bg.svg new file mode 100644 index 0000000..ab10040 --- /dev/null +++ b/src/assets/svgs/login-box-bg.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/member_balance.svg b/src/assets/svgs/member_balance.svg new file mode 100644 index 0000000..5395b23 --- /dev/null +++ b/src/assets/svgs/member_balance.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/member_expenditure_balance.svg b/src/assets/svgs/member_expenditure_balance.svg new file mode 100644 index 0000000..02d498c --- /dev/null +++ b/src/assets/svgs/member_expenditure_balance.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/member_level.svg b/src/assets/svgs/member_level.svg new file mode 100644 index 0000000..cbcc686 --- /dev/null +++ b/src/assets/svgs/member_level.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/member_point.svg b/src/assets/svgs/member_point.svg new file mode 100644 index 0000000..b849ddb --- /dev/null +++ b/src/assets/svgs/member_point.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/member_recharge_balance.svg b/src/assets/svgs/member_recharge_balance.svg new file mode 100644 index 0000000..7519bb2 --- /dev/null +++ b/src/assets/svgs/member_recharge_balance.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/message.svg b/src/assets/svgs/message.svg new file mode 100644 index 0000000..14ca817 --- /dev/null +++ b/src/assets/svgs/message.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/money.svg b/src/assets/svgs/money.svg new file mode 100644 index 0000000..c1580de --- /dev/null +++ b/src/assets/svgs/money.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/alipay_app.svg b/src/assets/svgs/pay/icon/alipay_app.svg new file mode 100644 index 0000000..ebf1188 --- /dev/null +++ b/src/assets/svgs/pay/icon/alipay_app.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/alipay_bar.svg b/src/assets/svgs/pay/icon/alipay_bar.svg new file mode 100644 index 0000000..eb1e1e8 --- /dev/null +++ b/src/assets/svgs/pay/icon/alipay_bar.svg @@ -0,0 +1,2 @@ + diff --git a/src/assets/svgs/pay/icon/alipay_pc.svg b/src/assets/svgs/pay/icon/alipay_pc.svg new file mode 100644 index 0000000..2a75277 --- /dev/null +++ b/src/assets/svgs/pay/icon/alipay_pc.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/alipay_qr.svg b/src/assets/svgs/pay/icon/alipay_qr.svg new file mode 100644 index 0000000..4833750 --- /dev/null +++ b/src/assets/svgs/pay/icon/alipay_qr.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/alipay_wap.svg b/src/assets/svgs/pay/icon/alipay_wap.svg new file mode 100644 index 0000000..87075db --- /dev/null +++ b/src/assets/svgs/pay/icon/alipay_wap.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/mock.svg b/src/assets/svgs/pay/icon/mock.svg new file mode 100644 index 0000000..27b09ea --- /dev/null +++ b/src/assets/svgs/pay/icon/mock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/wx_app.svg b/src/assets/svgs/pay/icon/wx_app.svg new file mode 100644 index 0000000..ad40b2a --- /dev/null +++ b/src/assets/svgs/pay/icon/wx_app.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/wx_bar.svg b/src/assets/svgs/pay/icon/wx_bar.svg new file mode 100644 index 0000000..11292e6 --- /dev/null +++ b/src/assets/svgs/pay/icon/wx_bar.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/wx_lite.svg b/src/assets/svgs/pay/icon/wx_lite.svg new file mode 100644 index 0000000..0c925cf --- /dev/null +++ b/src/assets/svgs/pay/icon/wx_lite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/wx_native.svg b/src/assets/svgs/pay/icon/wx_native.svg new file mode 100644 index 0000000..bf3ba2b --- /dev/null +++ b/src/assets/svgs/pay/icon/wx_native.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/pay/icon/wx_pub.svg b/src/assets/svgs/pay/icon/wx_pub.svg new file mode 100644 index 0000000..3a6d15b --- /dev/null +++ b/src/assets/svgs/pay/icon/wx_pub.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/assets/svgs/peoples.svg b/src/assets/svgs/peoples.svg new file mode 100644 index 0000000..aab852e --- /dev/null +++ b/src/assets/svgs/peoples.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/shopping.svg b/src/assets/svgs/shopping.svg new file mode 100644 index 0000000..f395bc7 --- /dev/null +++ b/src/assets/svgs/shopping.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/Annex/index.ts b/src/components/Annex/index.ts new file mode 100644 index 0000000..d0456f9 --- /dev/null +++ b/src/components/Annex/index.ts @@ -0,0 +1,3 @@ +import Annex from './src/Annex.vue' + +export { Annex } diff --git a/src/components/Annex/src/Annex.vue b/src/components/Annex/src/Annex.vue new file mode 100644 index 0000000..4cae5c2 --- /dev/null +++ b/src/components/Annex/src/Annex.vue @@ -0,0 +1,127 @@ + + + + + + + diff --git a/src/components/Backtop/index.ts b/src/components/Backtop/index.ts new file mode 100644 index 0000000..96de88d --- /dev/null +++ b/src/components/Backtop/index.ts @@ -0,0 +1,3 @@ +import Backtop from './src/Backtop.vue' + +export { Backtop } diff --git a/src/components/Backtop/src/Backtop.vue b/src/components/Backtop/src/Backtop.vue new file mode 100644 index 0000000..5d79f51 --- /dev/null +++ b/src/components/Backtop/src/Backtop.vue @@ -0,0 +1,17 @@ + + + diff --git a/src/components/BasicForm/index.ts b/src/components/BasicForm/index.ts new file mode 100644 index 0000000..131ef9d --- /dev/null +++ b/src/components/BasicForm/index.ts @@ -0,0 +1,3 @@ +import BasicForm from './src/BasicForm.vue' + +export { BasicForm } diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue new file mode 100644 index 0000000..5e4d26b --- /dev/null +++ b/src/components/BasicForm/src/BasicForm.vue @@ -0,0 +1,407 @@ + + + diff --git a/src/components/Card/index.ts b/src/components/Card/index.ts new file mode 100644 index 0000000..f4c0d86 --- /dev/null +++ b/src/components/Card/index.ts @@ -0,0 +1,3 @@ +import CardTitle from './src/CardTitle.vue' + +export { CardTitle } diff --git a/src/components/Card/src/CardTitle.vue b/src/components/Card/src/CardTitle.vue new file mode 100644 index 0000000..5b122f4 --- /dev/null +++ b/src/components/Card/src/CardTitle.vue @@ -0,0 +1,37 @@ + + + + + diff --git a/src/components/ChangeRecord/index.ts b/src/components/ChangeRecord/index.ts new file mode 100644 index 0000000..f0a3509 --- /dev/null +++ b/src/components/ChangeRecord/index.ts @@ -0,0 +1,3 @@ +import ChangeRecord from './src/ChangeRecord.vue' + +export { ChangeRecord } diff --git a/src/components/ChangeRecord/src/ChangeRecord.vue b/src/components/ChangeRecord/src/ChangeRecord.vue new file mode 100644 index 0000000..a7de4f9 --- /dev/null +++ b/src/components/ChangeRecord/src/ChangeRecord.vue @@ -0,0 +1,128 @@ + + + + + + + diff --git a/src/components/ConfigGlobal/index.ts b/src/components/ConfigGlobal/index.ts new file mode 100644 index 0000000..dda2462 --- /dev/null +++ b/src/components/ConfigGlobal/index.ts @@ -0,0 +1,3 @@ +import ConfigGlobal from './src/ConfigGlobal.vue' + +export { ConfigGlobal } diff --git a/src/components/ConfigGlobal/src/ConfigGlobal.vue b/src/components/ConfigGlobal/src/ConfigGlobal.vue new file mode 100644 index 0000000..a087396 --- /dev/null +++ b/src/components/ConfigGlobal/src/ConfigGlobal.vue @@ -0,0 +1,63 @@ + + + diff --git a/src/components/ContentDetailWrap/index.ts b/src/components/ContentDetailWrap/index.ts new file mode 100644 index 0000000..1871cac --- /dev/null +++ b/src/components/ContentDetailWrap/index.ts @@ -0,0 +1,3 @@ +import ContentDetailWrap from './src/ContentDetailWrap.vue' + +export { ContentDetailWrap } diff --git a/src/components/ContentDetailWrap/src/ContentDetailWrap.vue b/src/components/ContentDetailWrap/src/ContentDetailWrap.vue new file mode 100644 index 0000000..a9eacc0 --- /dev/null +++ b/src/components/ContentDetailWrap/src/ContentDetailWrap.vue @@ -0,0 +1,58 @@ + + + diff --git a/src/components/ContentWrap/index.ts b/src/components/ContentWrap/index.ts new file mode 100644 index 0000000..8c22cc8 --- /dev/null +++ b/src/components/ContentWrap/index.ts @@ -0,0 +1,3 @@ +import ContentWrap from './src/ContentWrap.vue' + +export { ContentWrap } diff --git a/src/components/ContentWrap/src/ContentWrap.vue b/src/components/ContentWrap/src/ContentWrap.vue new file mode 100644 index 0000000..e3bd597 --- /dev/null +++ b/src/components/ContentWrap/src/ContentWrap.vue @@ -0,0 +1,34 @@ + + + diff --git a/src/components/CountTo/index.ts b/src/components/CountTo/index.ts new file mode 100644 index 0000000..2119f02 --- /dev/null +++ b/src/components/CountTo/index.ts @@ -0,0 +1,3 @@ +import CountTo from './src/CountTo.vue' + +export { CountTo } diff --git a/src/components/CountTo/src/CountTo.vue b/src/components/CountTo/src/CountTo.vue new file mode 100644 index 0000000..1b1131a --- /dev/null +++ b/src/components/CountTo/src/CountTo.vue @@ -0,0 +1,182 @@ + + + diff --git a/src/components/Crontab/index.ts b/src/components/Crontab/index.ts new file mode 100644 index 0000000..6beeef8 --- /dev/null +++ b/src/components/Crontab/index.ts @@ -0,0 +1,2 @@ +import Crontab from './src/Crontab.vue' +export { Crontab } diff --git a/src/components/Crontab/src/Crontab.vue b/src/components/Crontab/src/Crontab.vue new file mode 100644 index 0000000..90b40b2 --- /dev/null +++ b/src/components/Crontab/src/Crontab.vue @@ -0,0 +1,1011 @@ + + + + diff --git a/src/components/Cropper/index.ts b/src/components/Cropper/index.ts new file mode 100644 index 0000000..8fcc618 --- /dev/null +++ b/src/components/Cropper/index.ts @@ -0,0 +1,4 @@ +import CropperImage from './src/Cropper.vue' +import CropperAvatar from './src/CropperAvatar.vue' + +export { CropperImage, CropperAvatar } diff --git a/src/components/Cropper/src/CopperModal.vue b/src/components/Cropper/src/CopperModal.vue new file mode 100644 index 0000000..27052b8 --- /dev/null +++ b/src/components/Cropper/src/CopperModal.vue @@ -0,0 +1,261 @@ + + + diff --git a/src/components/Cropper/src/Cropper.vue b/src/components/Cropper/src/Cropper.vue new file mode 100644 index 0000000..871aed8 --- /dev/null +++ b/src/components/Cropper/src/Cropper.vue @@ -0,0 +1,183 @@ + + + diff --git a/src/components/Cropper/src/CropperAvatar.vue b/src/components/Cropper/src/CropperAvatar.vue new file mode 100644 index 0000000..55a7d34 --- /dev/null +++ b/src/components/Cropper/src/CropperAvatar.vue @@ -0,0 +1,142 @@ + + + diff --git a/src/components/Cropper/src/types.ts b/src/components/Cropper/src/types.ts new file mode 100644 index 0000000..bcad3b4 --- /dev/null +++ b/src/components/Cropper/src/types.ts @@ -0,0 +1,8 @@ +import type Cropper from 'cropperjs' + +export interface CropendResult { + imgBase64: string + imgInfo: Cropper.Data +} + +export type { Cropper } diff --git a/src/components/Descriptions/index.ts b/src/components/Descriptions/index.ts new file mode 100644 index 0000000..243bc39 --- /dev/null +++ b/src/components/Descriptions/index.ts @@ -0,0 +1,4 @@ +import Descriptions from './src/Descriptions.vue' +import DescriptionsItemLabel from './src/DescriptionsItemLabel.vue' + +export { Descriptions, DescriptionsItemLabel } diff --git a/src/components/Descriptions/src/Descriptions.vue b/src/components/Descriptions/src/Descriptions.vue new file mode 100644 index 0000000..c27c26b --- /dev/null +++ b/src/components/Descriptions/src/Descriptions.vue @@ -0,0 +1,168 @@ + + + + + diff --git a/src/components/Descriptions/src/DescriptionsItemLabel.vue b/src/components/Descriptions/src/DescriptionsItemLabel.vue new file mode 100644 index 0000000..4efb2fb --- /dev/null +++ b/src/components/Descriptions/src/DescriptionsItemLabel.vue @@ -0,0 +1,29 @@ + + + + + diff --git a/src/components/Detail/index.ts b/src/components/Detail/index.ts new file mode 100644 index 0000000..d3fcb5c --- /dev/null +++ b/src/components/Detail/index.ts @@ -0,0 +1,3 @@ +import Detail from './src/Detail.vue' + +export { Detail } diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue new file mode 100644 index 0000000..9066457 --- /dev/null +++ b/src/components/Detail/src/Detail.vue @@ -0,0 +1,376 @@ + + + + + diff --git a/src/components/Dialog/index.ts b/src/components/Dialog/index.ts new file mode 100644 index 0000000..1655dad --- /dev/null +++ b/src/components/Dialog/index.ts @@ -0,0 +1,3 @@ +import Dialog from './src/Dialog.vue' + +export { Dialog } diff --git a/src/components/Dialog/src/Dialog.vue b/src/components/Dialog/src/Dialog.vue new file mode 100644 index 0000000..a1eb550 --- /dev/null +++ b/src/components/Dialog/src/Dialog.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/src/components/DictTag/index.ts b/src/components/DictTag/index.ts new file mode 100644 index 0000000..4db2742 --- /dev/null +++ b/src/components/DictTag/index.ts @@ -0,0 +1,3 @@ +import DictTag from './src/DictTag.vue' + +export { DictTag } diff --git a/src/components/DictTag/src/DictTag.vue b/src/components/DictTag/src/DictTag.vue new file mode 100644 index 0000000..db37f71 --- /dev/null +++ b/src/components/DictTag/src/DictTag.vue @@ -0,0 +1,60 @@ + diff --git a/src/components/DocAlert/index.vue b/src/components/DocAlert/index.vue new file mode 100644 index 0000000..3a3feab --- /dev/null +++ b/src/components/DocAlert/index.vue @@ -0,0 +1,34 @@ + + + diff --git a/src/components/Echart/index.ts b/src/components/Echart/index.ts new file mode 100644 index 0000000..4822092 --- /dev/null +++ b/src/components/Echart/index.ts @@ -0,0 +1,3 @@ +import Echart from './src/Echart.vue' + +export { Echart } diff --git a/src/components/Echart/src/Echart.vue b/src/components/Echart/src/Echart.vue new file mode 100644 index 0000000..fd3342d --- /dev/null +++ b/src/components/Echart/src/Echart.vue @@ -0,0 +1,115 @@ + + + diff --git a/src/components/Editor/index.ts b/src/components/Editor/index.ts new file mode 100644 index 0000000..3fbf0a9 --- /dev/null +++ b/src/components/Editor/index.ts @@ -0,0 +1,8 @@ +import Editor from './src/Editor.vue' +import { IDomEditor } from '@wangeditor/editor' + +export interface EditorExpose { + getEditorRef: () => Promise +} + +export { Editor } diff --git a/src/components/Editor/src/Editor.vue b/src/components/Editor/src/Editor.vue new file mode 100644 index 0000000..ec40bca --- /dev/null +++ b/src/components/Editor/src/Editor.vue @@ -0,0 +1,202 @@ + + + + + diff --git a/src/components/Error/index.ts b/src/components/Error/index.ts new file mode 100644 index 0000000..a52c6f9 --- /dev/null +++ b/src/components/Error/index.ts @@ -0,0 +1,3 @@ +import Error from './src/Error.vue' + +export { Error } diff --git a/src/components/Error/src/Error.vue b/src/components/Error/src/Error.vue new file mode 100644 index 0000000..3fd7a17 --- /dev/null +++ b/src/components/Error/src/Error.vue @@ -0,0 +1,58 @@ + + + diff --git a/src/components/Form/index.ts b/src/components/Form/index.ts new file mode 100644 index 0000000..484c7a2 --- /dev/null +++ b/src/components/Form/index.ts @@ -0,0 +1,15 @@ +import Form from './src/Form.vue' +import { ElForm } from 'element-plus' +import { FormSchema, FormSetPropsType } from '@/types/form' + +export interface FormExpose { + setValues: (data: Recordable) => void + setProps: (props: Recordable) => void + delSchema: (field: string) => void + addSchema: (formSchema: FormSchema, index?: number) => void + setSchema: (schemaProps: FormSetPropsType[]) => void + formModel: Recordable + getElFormRef: () => ComponentRef +} + +export { Form } diff --git a/src/components/Form/src/Form.vue b/src/components/Form/src/Form.vue new file mode 100644 index 0000000..78b8fb2 --- /dev/null +++ b/src/components/Form/src/Form.vue @@ -0,0 +1,309 @@ + + + diff --git a/src/components/Form/src/componentMap.ts b/src/components/Form/src/componentMap.ts new file mode 100644 index 0000000..5af9b40 --- /dev/null +++ b/src/components/Form/src/componentMap.ts @@ -0,0 +1,55 @@ +import type { Component } from 'vue' +import { + ElCascader, + ElCheckboxGroup, + ElColorPicker, + ElDatePicker, + ElInput, + ElInputNumber, + ElRadioGroup, + ElRate, + ElSelect, + ElSelectV2, + ElTreeSelect, + ElSlider, + ElSwitch, + ElTimePicker, + ElTimeSelect, + ElTransfer, + ElAutocomplete, + ElDivider +} from 'element-plus' +import { InputPassword } from '@/components/InputPassword' +import { Editor } from '@/components/Editor' +import { UploadImg, UploadImgs, UploadFile } from '@/components/UploadFile' +import { ComponentName } from '@/types/components' + +const componentMap: Recordable = { + Radio: ElRadioGroup, + Checkbox: ElCheckboxGroup, + CheckboxButton: ElCheckboxGroup, + Input: ElInput, + Autocomplete: ElAutocomplete, + InputNumber: ElInputNumber, + Select: ElSelect, + Cascader: ElCascader, + Switch: ElSwitch, + Slider: ElSlider, + TimePicker: ElTimePicker, + DatePicker: ElDatePicker, + Rate: ElRate, + ColorPicker: ElColorPicker, + Transfer: ElTransfer, + Divider: ElDivider, + TimeSelect: ElTimeSelect, + SelectV2: ElSelectV2, + TreeSelect: ElTreeSelect, + RadioButton: ElRadioGroup, + InputPassword: InputPassword, + Editor: Editor, + UploadImg: UploadImg, + UploadImgs: UploadImgs, + UploadFile: UploadFile +} + +export { componentMap } diff --git a/src/components/Form/src/components/useRenderCheckbox.tsx b/src/components/Form/src/components/useRenderCheckbox.tsx new file mode 100644 index 0000000..e151839 --- /dev/null +++ b/src/components/Form/src/components/useRenderCheckbox.tsx @@ -0,0 +1,26 @@ +import { FormSchema } from '@/types/form' +import { ElCheckbox, ElCheckboxButton } from 'element-plus' +import { defineComponent } from 'vue' + +export const useRenderCheckbox = () => { + const renderCheckboxOptions = (item: FormSchema) => { + // 如果有别名,就取别名 + const labelAlias = item?.componentProps?.optionsAlias?.labelField + const valueAlias = item?.componentProps?.optionsAlias?.valueField + const Com = (item.component === 'Checkbox' ? ElCheckbox : ElCheckboxButton) as ReturnType< + typeof defineComponent + > + return item?.componentProps?.options?.map((option) => { + const { ...other } = option + return ( + + {option[labelAlias || 'label']} + + ) + }) + } + + return { + renderCheckboxOptions + } +} diff --git a/src/components/Form/src/components/useRenderRadio.tsx b/src/components/Form/src/components/useRenderRadio.tsx new file mode 100644 index 0000000..d1005ca --- /dev/null +++ b/src/components/Form/src/components/useRenderRadio.tsx @@ -0,0 +1,26 @@ +import { FormSchema } from '@/types/form' +import { ElRadio, ElRadioButton } from 'element-plus' +import { defineComponent } from 'vue' + +export const useRenderRadio = () => { + const renderRadioOptions = (item: FormSchema) => { + // 如果有别名,就取别名 + const labelAlias = item?.componentProps?.optionsAlias?.labelField + const valueAlias = item?.componentProps?.optionsAlias?.valueField + const Com = (item.component === 'Radio' ? ElRadio : ElRadioButton) as ReturnType< + typeof defineComponent + > + return item?.componentProps?.options?.map((option) => { + const { ...other } = option + return ( + + {option[labelAlias || 'label']} + + ) + }) + } + + return { + renderRadioOptions + } +} diff --git a/src/components/Form/src/components/useRenderSelect.tsx b/src/components/Form/src/components/useRenderSelect.tsx new file mode 100644 index 0000000..59b72e6 --- /dev/null +++ b/src/components/Form/src/components/useRenderSelect.tsx @@ -0,0 +1,57 @@ +import { FormSchema } from '@/types/form' +import { ComponentOptions } from '@/types/components' +import { ElOption, ElOptionGroup } from 'element-plus' +import { getSlot } from '@/utils/tsxHelper' +import { Slots } from 'vue' + +export const useRenderSelect = (slots: Slots) => { + // 渲染 select options + const renderSelectOptions = (item: FormSchema) => { + // 如果有别名,就取别名 + const labelAlias = item?.componentProps?.optionsAlias?.labelField + return item?.componentProps?.options?.map((option) => { + if (option?.options?.length) { + return ( + + {() => { + return option?.options?.map((v) => { + return renderSelectOptionItem(item, v) + }) + }} + + ) + } else { + return renderSelectOptionItem(item, option) + } + }) + } + + // 渲染 select option item + const renderSelectOptionItem = (item: FormSchema, option: ComponentOptions) => { + // 如果有别名,就取别名 + const labelAlias = item?.componentProps?.optionsAlias?.labelField + const valueAlias = item?.componentProps?.optionsAlias?.valueField + + const { label, value, ...other } = option + + return ( + + {{ + default: () => + // option 插槽名规则,{field}-option + item?.componentProps?.optionsSlot + ? getSlot(slots, `${item.field}-option`, { item: option }) + : undefined + }} + + ) + } + + return { + renderSelectOptions + } +} diff --git a/src/components/Form/src/helper.ts b/src/components/Form/src/helper.ts new file mode 100644 index 0000000..cdfc8ca --- /dev/null +++ b/src/components/Form/src/helper.ts @@ -0,0 +1,148 @@ +import type { Slots } from 'vue' +import { getSlot } from '@/utils/tsxHelper' +import { PlaceholderModel } from './types' +import { FormSchema } from '@/types/form' +import { ColProps } from '@/types/components' + +/** + * + * @param schema 对应组件数据 + * @returns 返回提示信息对象 + * @description 用于自动设置placeholder + */ +export const setTextPlaceholder = (schema: FormSchema): PlaceholderModel => { + const { t } = useI18n() + const textMap = ['Input', 'Autocomplete', 'InputNumber', 'InputPassword'] + const selectMap = ['Select', 'SelectV2', 'TimePicker', 'DatePicker', 'TimeSelect', 'TimeSelect'] + if (textMap.includes(schema?.component as string)) { + return { + placeholder: t('common.inputText') + schema.label + } + } + if (selectMap.includes(schema?.component as string)) { + // 一些范围选择器 + const twoTextMap = ['datetimerange', 'daterange', 'monthrange', 'datetimerange', 'daterange'] + if ( + twoTextMap.includes( + (schema?.componentProps?.type || schema?.componentProps?.isRange) as string + ) + ) { + return { + startPlaceholder: t('common.startTimeText'), + endPlaceholder: t('common.endTimeText'), + rangeSeparator: '-' + } + } else { + return { + placeholder: t('common.selectText') + schema.label + } + } + } + return {} +} + +/** + * + * @param col 内置栅格 + * @returns 返回栅格属性 + * @description 合并传入进来的栅格属性 + */ +export const setGridProp = (col: ColProps = {}): ColProps => { + const colProps: ColProps = { + // 如果有span,代表用户优先级更高,所以不需要默认栅格 + ...(col.span + ? {} + : { + xs: 24, + sm: 12, + md: 12, + lg: 12, + xl: 12 + }), + ...col + } + return colProps +} + +/** + * + * @param item 传入的组件属性 + * @returns 默认添加 clearable 属性 + */ +export const setComponentProps = (item: FormSchema): Recordable => { + const notNeedClearable = ['ColorPicker'] + const componentProps: Recordable = notNeedClearable.includes(item.component as string) + ? { ...item.componentProps } + : { + clearable: true, + ...item.componentProps + } + // 需要删除额外的属性 + delete componentProps?.slots + return componentProps +} + +/** + * + * @param slots 插槽 + * @param slotsProps 插槽属性 + * @param field 字段名 + */ +export const setItemComponentSlots = ( + slots: Slots, + slotsProps: Recordable = {}, + field: string +): Recordable => { + const slotObj: Recordable = {} + for (const key in slotsProps) { + if (slotsProps[key]) { + // 由于组件有可能重复,需要有一个唯一的前缀 + slotObj[key] = (data: Recordable) => { + return getSlot(slots, `${field}-${key}`, data) + } + } + } + return slotObj +} + +/** + * + * @param schema Form表单结构化数组 + * @param formModel FormModel + * @returns FormModel + * @description 生成对应的formModel + */ +export const initModel = (schema: FormSchema[], formModel: Recordable) => { + const model: Recordable = { ...formModel } + schema.map((v) => { + // 如果是hidden,就删除对应的值 + if (v.hidden) { + delete model[v.field] + } else if (v.component && v.component !== 'Divider') { + const hasField = Reflect.has(model, v.field) + // 如果先前已经有值存在,则不进行重新赋值,而是采用现有的值 + model[v.field] = hasField ? model[v.field] : v.value !== void 0 ? v.value : '' + } + }) + return model +} + +/** + * @param slots 插槽 + * @param field 字段名 + * @returns 返回FormIiem插槽 + */ +export const setFormItemSlots = (slots: Slots, field: string): Recordable => { + const slotObj: Recordable = {} + if (slots[`${field}-error`]) { + slotObj['error'] = (data: Recordable) => { + return getSlot(slots, `${field}-error`, data) + } + } + if (slots[`${field}-label`]) { + slotObj['label'] = (data: Recordable) => { + return getSlot(slots, `${field}-label`, data) + } + } + return slotObj +} diff --git a/src/components/Form/src/types.ts b/src/components/Form/src/types.ts new file mode 100644 index 0000000..dcd01e7 --- /dev/null +++ b/src/components/Form/src/types.ts @@ -0,0 +1,17 @@ +import { FormSchema } from '@/types/form' + +export interface PlaceholderModel { + placeholder?: string + startPlaceholder?: string + endPlaceholder?: string + rangeSeparator?: string +} + +export type FormProps = { + schema?: FormSchema[] + isCol?: boolean + model?: Recordable + autoSetPlaceholder?: boolean + isCustom?: boolean + labelWidth?: string | number +} & Recordable diff --git a/src/components/Highlight/index.ts b/src/components/Highlight/index.ts new file mode 100644 index 0000000..3e2d9ed --- /dev/null +++ b/src/components/Highlight/index.ts @@ -0,0 +1,3 @@ +import Highlight from './src/Highlight.vue' + +export { Highlight } diff --git a/src/components/Highlight/src/Highlight.vue b/src/components/Highlight/src/Highlight.vue new file mode 100644 index 0000000..ef923a9 --- /dev/null +++ b/src/components/Highlight/src/Highlight.vue @@ -0,0 +1,65 @@ + diff --git a/src/components/Icon/index.ts b/src/components/Icon/index.ts new file mode 100644 index 0000000..33d1de3 --- /dev/null +++ b/src/components/Icon/index.ts @@ -0,0 +1,4 @@ +import Icon from './src/Icon.vue' +import IconSelect from './src/IconSelect.vue' + +export { Icon, IconSelect } diff --git a/src/components/Icon/src/Icon.vue b/src/components/Icon/src/Icon.vue new file mode 100644 index 0000000..00dfa5d --- /dev/null +++ b/src/components/Icon/src/Icon.vue @@ -0,0 +1,85 @@ + + + diff --git a/src/components/Icon/src/IconSelect.vue b/src/components/Icon/src/IconSelect.vue new file mode 100644 index 0000000..d4a5b07 --- /dev/null +++ b/src/components/Icon/src/IconSelect.vue @@ -0,0 +1,229 @@ + + + + + diff --git a/src/components/Icon/src/data.ts b/src/components/Icon/src/data.ts new file mode 100644 index 0000000..2a4ed5a --- /dev/null +++ b/src/components/Icon/src/data.ts @@ -0,0 +1,1961 @@ +export const IconJson = { + 'ep:': [ + 'add-location', + 'aim', + 'alarm-clock', + 'apple', + 'arrow-down', + 'arrow-down-bold', + 'arrow-left', + 'arrow-left-bold', + 'arrow-right', + 'arrow-right-bold', + 'arrow-up', + 'arrow-up-bold', + 'avatar', + 'back', + 'baseball', + 'basketball', + 'bell', + 'bell-filled', + 'bicycle', + 'bottom', + 'bottom-left', + 'bottom-right', + 'bowl', + 'box', + 'briefcase', + 'brush', + 'brush-filled', + 'burger', + 'calendar', + 'camera', + 'camera-filled', + 'caret-bottom', + 'caret-left', + 'caret-right', + 'caret-top', + 'cellphone', + 'chat-dot-round', + 'chat-dot-square', + 'chat-line-round', + 'chat-line-square', + 'chat-round', + 'chat-square', + 'check', + 'checked', + 'cherry', + 'chicken', + 'circle-check', + 'circle-check-filled', + 'circle-close', + 'circle-close-filled', + 'circle-plus', + 'circle-plus-filled', + 'clock', + 'close', + 'close-bold', + 'cloudy', + 'coffee', + 'coffee-cup', + 'coin', + 'cold-drink', + 'collection', + 'collection-tag', + 'comment', + 'compass', + 'connection', + 'coordinate', + 'copy-document', + 'cpu', + 'credit-card', + 'crop', + 'd-arrow-left', + 'd-arrow-right', + 'd-caret', + 'data-analysis', + 'data-board', + 'data-line', + 'delete', + 'delete-filled', + 'delete-location', + 'dessert', + 'discount', + 'dish', + 'dish-dot', + 'document', + 'document-add', + 'document-checked', + 'document-copy', + 'document-delete', + 'document-remove', + 'download', + 'drizzling', + 'edit', + 'edit-pen', + 'eleme', + 'eleme-filled', + 'expand', + 'failed', + 'female', + 'files', + 'film', + 'filter', + 'finished', + 'first-aid-kit', + 'flag', + 'fold', + 'folder', + 'folder-add', + 'folder-checked', + 'folder-delete', + 'folder-opened', + 'folder-remove', + 'food', + 'football', + 'fork-spoon', + 'fries', + 'full-screen', + 'goblet', + 'goblet-full', + 'goblet-square', + 'goblet-square-full', + 'goods', + 'goods-filled', + 'grape', + 'grid', + 'guide', + 'headset', + 'help', + 'help-filled', + 'histogram', + 'home-filled', + 'hot-water', + 'house', + 'ice-cream', + 'ice-cream-round', + 'ice-cream-square', + 'ice-drink', + 'ice-tea', + 'info-filled', + 'iphone', + 'key', + 'knife-fork', + 'lightning', + 'link', + 'list', + 'loading', + 'location', + 'location-filled', + 'location-information', + 'lock', + 'lollipop', + 'magic-stick', + 'magnet', + 'male', + 'management', + 'map-location', + 'medal', + 'menu', + 'message', + 'message-box', + 'mic', + 'microphone', + 'milk-tea', + 'minus', + 'money', + 'monitor', + 'moon', + 'moon-night', + 'more', + 'more-filled', + 'mostly-cloudy', + 'mouse', + 'mug', + 'mute', + 'mute-notification', + 'no-smoking', + 'notebook', + 'notification', + 'odometer', + 'office-building', + 'open', + 'operation', + 'opportunity', + 'orange', + 'paperclip', + 'partly-cloudy', + 'pear', + 'phone', + 'phone-filled', + 'picture', + 'picture-filled', + 'picture-rounded', + 'pie-chart', + 'place', + 'platform', + 'plus', + 'pointer', + 'position', + 'postcard', + 'pouring', + 'present', + 'price-tag', + 'printer', + 'promotion', + 'question-filled', + 'rank', + 'reading', + 'reading-lamp', + 'refresh', + 'refresh-left', + 'refresh-right', + 'refrigerator', + 'remove', + 'remove-filled', + 'right', + 'scale-to-original', + 'school', + 'scissor', + 'search', + 'select', + 'sell', + 'semi-select', + 'service', + 'set-up', + 'setting', + 'share', + 'ship', + 'shop', + 'shopping-bag', + 'shopping-cart', + 'shopping-cart-full', + 'smoking', + 'soccer', + 'sold-out', + 'sort', + 'sort-down', + 'sort-up', + 'stamp', + 'star', + 'star-filled', + 'stopwatch', + 'success-filled', + 'sugar', + 'suitcase', + 'sunny', + 'sunrise', + 'sunset', + 'switch', + 'switch-button', + 'takeaway-box', + 'ticket', + 'tickets', + 'timer', + 'toilet-paper', + 'tools', + 'top', + 'top-left', + 'top-right', + 'trend-charts', + 'trophy', + 'turn-off', + 'umbrella', + 'unlock', + 'upload', + 'upload-filled', + 'user', + 'user-filled', + 'van', + 'video-camera', + 'video-camera-filled', + 'video-pause', + 'video-play', + 'view', + 'wallet', + 'wallet-filled', + 'warning', + 'warning-filled', + 'watch', + 'watermelon', + 'wind-power', + 'zoom-in', + 'zoom-out' + ], + 'fa:': [ + '500px', + 'address-book', + 'address-book-o', + 'address-card', + 'address-card-o', + 'adjust', + 'adn', + 'align-center', + 'align-justify', + 'align-left', + 'amazon', + 'ambulance', + 'american-sign-language-interpreting', + 'anchor', + 'android', + 'angellist', + 'angle-double-left', + 'angle-double-up', + 'angle-down', + 'angle-left', + 'angle-up', + 'apple', + 'archive', + 'area-chart', + 'arrow-circle-left', + 'arrow-circle-o-left', + 'arrow-circle-o-up', + 'arrow-circle-up', + 'arrow-left', + 'arrow-up', + 'arrows', + 'arrows-alt', + 'arrows-h', + 'arrows-v', + 'assistive-listening-systems', + 'asterisk', + 'at', + 'audio-description', + 'automobile', + 'backward', + 'balance-scale', + 'ban', + 'bandcamp', + 'bank', + 'bar-chart', + 'barcode', + 'bars', + 'bath', + 'battery', + 'battery-0', + 'battery-1', + 'battery-2', + 'battery-3', + 'bed', + 'beer', + 'behance', + 'behance-square', + 'bell', + 'bell-o', + 'bell-slash', + 'bell-slash-o', + 'bicycle', + 'binoculars', + 'birthday-cake', + 'bitbucket', + 'bitbucket-square', + 'bitcoin', + 'black-tie', + 'blind', + 'bluetooth', + 'bluetooth-b', + 'bold', + 'bolt', + 'bomb', + 'book', + 'bookmark', + 'bookmark-o', + 'braille', + 'briefcase', + 'bug', + 'building', + 'building-o', + 'bullhorn', + 'bullseye', + 'bus', + 'buysellads', + 'cab', + 'calculator', + 'calendar', + 'calendar-check-o', + 'calendar-minus-o', + 'calendar-o', + 'calendar-plus-o', + 'calendar-times-o', + 'camera', + 'camera-retro', + 'caret-down', + 'caret-left', + 'caret-square-o-left', + 'caret-square-o-up', + 'caret-up', + 'cart-arrow-down', + 'cart-plus', + 'cc', + 'cc-amex', + 'cc-diners-club', + 'cc-discover', + 'cc-jcb', + 'cc-mastercard', + 'cc-paypal', + 'cc-stripe', + 'cc-visa', + 'certificate', + 'chain', + 'chain-broken', + 'check', + 'check-circle', + 'check-circle-o', + 'check-square', + 'check-square-o', + 'chevron-circle-left', + 'chevron-circle-up', + 'chevron-down', + 'chevron-left', + 'chevron-up', + 'child', + 'chrome', + 'circle', + 'circle-o', + 'circle-o-notch', + 'circle-thin', + 'clipboard', + 'clock-o', + 'clone', + 'close', + 'cloud', + 'cloud-download', + 'cloud-upload', + 'cny', + 'code', + 'code-fork', + 'codepen', + 'codiepie', + 'coffee', + 'cog', + 'cogs', + 'columns', + 'comment', + 'comment-o', + 'commenting', + 'commenting-o', + 'comments', + 'comments-o', + 'compass', + 'compress', + 'connectdevelop', + 'contao', + 'copy', + 'copyright', + 'creative-commons', + 'credit-card', + 'credit-card-alt', + 'crop', + 'crosshairs', + 'css3', + 'cube', + 'cubes', + 'cut', + 'cutlery', + 'dashboard', + 'dashcube', + 'database', + 'deaf', + 'dedent', + 'delicious', + 'desktop', + 'deviantart', + 'diamond', + 'digg', + 'dollar', + 'dot-circle-o', + 'download', + 'dribbble', + 'drivers-license', + 'drivers-license-o', + 'dropbox', + 'drupal', + 'edge', + 'edit', + 'eercast', + 'eject', + 'ellipsis-h', + 'ellipsis-v', + 'empire', + 'envelope', + 'envelope-o', + 'envelope-open', + 'envelope-open-o', + 'envelope-square', + 'envira', + 'eraser', + 'etsy', + 'eur', + 'exchange', + 'exclamation', + 'exclamation-circle', + 'exclamation-triangle', + 'expand', + 'expeditedssl', + 'external-link', + 'external-link-square', + 'eye', + 'eye-slash', + 'eyedropper', + 'fa', + 'facebook', + 'facebook-official', + 'facebook-square', + 'fast-backward', + 'fax', + 'feed', + 'female', + 'fighter-jet', + 'file', + 'file-archive-o', + 'file-audio-o', + 'file-code-o', + 'file-excel-o', + 'file-image-o', + 'file-movie-o', + 'file-o', + 'file-pdf-o', + 'file-powerpoint-o', + 'file-text', + 'file-text-o', + 'file-word-o', + 'film', + 'filter', + 'fire', + 'fire-extinguisher', + 'firefox', + 'first-order', + 'flag', + 'flag-checkered', + 'flag-o', + 'flask', + 'flickr', + 'floppy-o', + 'folder', + 'folder-o', + 'folder-open', + 'folder-open-o', + 'font', + 'fonticons', + 'fort-awesome', + 'forumbee', + 'foursquare', + 'free-code-camp', + 'frown-o', + 'futbol-o', + 'gamepad', + 'gavel', + 'gbp', + 'genderless', + 'get-pocket', + 'gg', + 'gg-circle', + 'gift', + 'git', + 'git-square', + 'github', + 'github-alt', + 'github-square', + 'gitlab', + 'gittip', + 'glass', + 'glide', + 'glide-g', + 'globe', + 'google', + 'google-plus', + 'google-plus-circle', + 'google-plus-square', + 'google-wallet', + 'graduation-cap', + 'grav', + 'group', + 'h-square', + 'hacker-news', + 'hand-grab-o', + 'hand-lizard-o', + 'hand-o-left', + 'hand-o-up', + 'hand-paper-o', + 'hand-peace-o', + 'hand-pointer-o', + 'hand-scissors-o', + 'hand-spock-o', + 'handshake-o', + 'hashtag', + 'hdd-o', + 'header', + 'headphones', + 'heart', + 'heart-o', + 'heartbeat', + 'history', + 'home', + 'hospital-o', + 'hourglass', + 'hourglass-1', + 'hourglass-2', + 'hourglass-3', + 'hourglass-o', + 'houzz', + 'html5', + 'i-cursor', + 'id-badge', + 'ils', + 'image', + 'imdb', + 'inbox', + 'indent', + 'industry', + 'info', + 'info-circle', + 'inr', + 'instagram', + 'internet-explorer', + 'intersex', + 'ioxhost', + 'italic', + 'joomla', + 'jsfiddle', + 'key', + 'keyboard-o', + 'krw', + 'language', + 'laptop', + 'lastfm', + 'lastfm-square', + 'leaf', + 'leanpub', + 'lemon-o', + 'level-up', + 'life-bouy', + 'lightbulb-o', + 'line-chart', + 'linkedin', + 'linkedin-square', + 'linode', + 'linux', + 'list', + 'list-alt', + 'list-ol', + 'list-ul', + 'location-arrow', + 'lock', + 'long-arrow-left', + 'long-arrow-up', + 'low-vision', + 'magic', + 'magnet', + 'mail-forward', + 'mail-reply', + 'mail-reply-all', + 'male', + 'map', + 'map-marker', + 'map-o', + 'map-pin', + 'map-signs', + 'mars', + 'mars-double', + 'mars-stroke', + 'mars-stroke-h', + 'mars-stroke-v', + 'maxcdn', + 'meanpath', + 'medium', + 'medkit', + 'meetup', + 'meh-o', + 'mercury', + 'microchip', + 'microphone', + 'microphone-slash', + 'minus', + 'minus-circle', + 'minus-square', + 'minus-square-o', + 'mixcloud', + 'mobile', + 'modx', + 'money', + 'moon-o', + 'motorcycle', + 'mouse-pointer', + 'music', + 'neuter', + 'newspaper-o', + 'object-group', + 'object-ungroup', + 'odnoklassniki', + 'odnoklassniki-square', + 'opencart', + 'openid', + 'opera', + 'optin-monster', + 'pagelines', + 'paint-brush', + 'paper-plane', + 'paper-plane-o', + 'paperclip', + 'paragraph', + 'pause', + 'pause-circle', + 'pause-circle-o', + 'paw', + 'paypal', + 'pencil', + 'pencil-square', + 'percent', + 'phone', + 'phone-square', + 'pie-chart', + 'pied-piper', + 'pied-piper-alt', + 'pied-piper-pp', + 'pinterest', + 'pinterest-p', + 'pinterest-square', + 'plane', + 'play', + 'play-circle', + 'play-circle-o', + 'plug', + 'plus', + 'plus-circle', + 'plus-square', + 'plus-square-o', + 'podcast', + 'power-off', + 'print', + 'product-hunt', + 'puzzle-piece', + 'qq', + 'qrcode', + 'question', + 'question-circle', + 'question-circle-o', + 'quora', + 'quote-left', + 'quote-right', + 'ra', + 'random', + 'ravelry', + 'recycle', + 'reddit', + 'reddit-alien', + 'reddit-square', + 'refresh', + 'registered', + 'renren', + 'repeat', + 'retweet', + 'road', + 'rocket', + 'rotate-left', + 'rouble', + 'rss-square', + 'safari', + 'scribd', + 'search', + 'search-minus', + 'search-plus', + 'sellsy', + 'server', + 'share-alt', + 'share-alt-square', + 'share-square', + 'share-square-o', + 'shield', + 'ship', + 'shirtsinbulk', + 'shopping-bag', + 'shopping-basket', + 'shopping-cart', + 'shower', + 'sign-in', + 'sign-language', + 'sign-out', + 'signal', + 'simplybuilt', + 'sitemap', + 'skyatlas', + 'skype', + 'slack', + 'sliders', + 'slideshare', + 'smile-o', + 'snapchat', + 'snapchat-ghost', + 'snapchat-square', + 'snowflake-o', + 'sort', + 'sort-alpha-asc', + 'sort-alpha-desc', + 'sort-amount-asc', + 'sort-amount-desc', + 'sort-asc', + 'sort-numeric-asc', + 'sort-numeric-desc', + 'soundcloud', + 'space-shuttle', + 'spinner', + 'spoon', + 'spotify', + 'square', + 'square-o', + 'stack-exchange', + 'stack-overflow', + 'star', + 'star-half', + 'star-half-empty', + 'star-o', + 'steam', + 'steam-square', + 'step-backward', + 'stethoscope', + 'sticky-note', + 'sticky-note-o', + 'stop', + 'stop-circle', + 'stop-circle-o', + 'street-view', + 'strikethrough', + 'stumbleupon', + 'stumbleupon-circle', + 'subscript', + 'subway', + 'suitcase', + 'sun-o', + 'superpowers', + 'superscript', + 'table', + 'tablet', + 'tag', + 'tags', + 'tasks', + 'telegram', + 'television', + 'tencent-weibo', + 'terminal', + 'text-height', + 'text-width', + 'th', + 'th-large', + 'th-list', + 'themeisle', + 'thermometer', + 'thermometer-0', + 'thermometer-1', + 'thermometer-2', + 'thermometer-3', + 'thumb-tack', + 'thumbs-down', + 'thumbs-o-up', + 'thumbs-up', + 'ticket', + 'times-circle', + 'times-circle-o', + 'times-rectangle', + 'times-rectangle-o', + 'tint', + 'toggle-off', + 'toggle-on', + 'trademark', + 'train', + 'transgender-alt', + 'trash', + 'trash-o', + 'tree', + 'trello', + 'tripadvisor', + 'trophy', + 'truck', + 'try', + 'tty', + 'tumblr', + 'tumblr-square', + 'twitch', + 'twitter', + 'twitter-square', + 'umbrella', + 'underline', + 'universal-access', + 'unlock', + 'unlock-alt', + 'upload', + 'usb', + 'user', + 'user-circle', + 'user-circle-o', + 'user-md', + 'user-o', + 'user-plus', + 'user-secret', + 'user-times', + 'venus', + 'venus-double', + 'venus-mars', + 'viacoin', + 'viadeo', + 'viadeo-square', + 'video-camera', + 'vimeo', + 'vimeo-square', + 'vine', + 'vk', + 'volume-control-phone', + 'volume-down', + 'volume-off', + 'volume-up', + 'wechat', + 'weibo', + 'whatsapp', + 'wheelchair', + 'wheelchair-alt', + 'wifi', + 'wikipedia-w', + 'window-maximize', + 'window-minimize', + 'window-restore', + 'windows', + 'wordpress', + 'wpbeginner', + 'wpexplorer', + 'wpforms', + 'wrench', + 'xing', + 'xing-square', + 'y-combinator', + 'yahoo', + 'yelp', + 'yoast', + 'youtube', + 'youtube-play', + 'youtube-square' + ], + 'fa-solid:': [ + 'abacus', + 'ad', + 'address-book', + 'address-card', + 'adjust', + 'air-freshener', + 'align-center', + 'align-justify', + 'align-left', + 'align-right', + 'allergies', + 'ambulance', + 'american-sign-language-interpreting', + 'anchor', + 'angle-double-down', + 'angle-double-left', + 'angle-double-right', + 'angle-double-up', + 'angle-down', + 'angle-left', + 'angle-right', + 'angle-up', + 'angry', + 'ankh', + 'apple-alt', + 'archive', + 'archway', + 'arrow-alt-circle-down', + 'arrow-alt-circle-left', + 'arrow-alt-circle-right', + 'arrow-alt-circle-up', + 'arrow-circle-down', + 'arrow-circle-left', + 'arrow-circle-right', + 'arrow-circle-up', + 'arrow-down', + 'arrow-left', + 'arrow-right', + 'arrow-up', + 'arrows-alt', + 'arrows-alt-h', + 'arrows-alt-v', + 'assistive-listening-systems', + 'asterisk', + 'at', + 'atlas', + 'atom', + 'audio-description', + 'award', + 'baby', + 'baby-carriage', + 'backspace', + 'backward', + 'bacon', + 'bacteria', + 'bacterium', + 'bahai', + 'balance-scale', + 'balance-scale-left', + 'balance-scale-right', + 'ban', + 'band-aid', + 'barcode', + 'bars', + 'baseball-ball', + 'basketball-ball', + 'bath', + 'battery-empty', + 'battery-full', + 'battery-half', + 'battery-quarter', + 'battery-three-quarters', + 'bed', + 'beer', + 'bell', + 'bell-slash', + 'bezier-curve', + 'bible', + 'bicycle', + 'biking', + 'binoculars', + 'biohazard', + 'birthday-cake', + 'blender', + 'blender-phone', + 'blind', + 'blog', + 'bold', + 'bolt', + 'bomb', + 'bone', + 'bong', + 'book', + 'book-dead', + 'book-medical', + 'book-open', + 'book-reader', + 'bookmark', + 'border-all', + 'border-none', + 'border-style', + 'bowling-ball', + 'box', + 'box-open', + 'box-tissue', + 'boxes', + 'braille', + 'brain', + 'bread-slice', + 'briefcase', + 'briefcase-medical', + 'broadcast-tower', + 'broom', + 'brush', + 'bug', + 'building', + 'bullhorn', + 'bullseye', + 'burn', + 'bus', + 'bus-alt', + 'business-time', + 'calculator', + 'calculator-alt', + 'calendar', + 'calendar-alt', + 'calendar-check', + 'calendar-day', + 'calendar-minus', + 'calendar-plus', + 'calendar-times', + 'calendar-week', + 'camera', + 'camera-retro', + 'campground', + 'candy-cane', + 'cannabis', + 'capsules', + 'car', + 'car-alt', + 'car-battery', + 'car-crash', + 'car-side', + 'caravan', + 'caret-down', + 'caret-left', + 'caret-right', + 'caret-square-down', + 'caret-square-left', + 'caret-square-right', + 'caret-square-up', + 'caret-up', + 'carrot', + 'cart-arrow-down', + 'cart-plus', + 'cash-register', + 'cat', + 'certificate', + 'chair', + 'chalkboard', + 'chalkboard-teacher', + 'charging-station', + 'chart-area', + 'chart-bar', + 'chart-line', + 'chart-pie', + 'check', + 'check-circle', + 'check-double', + 'check-square', + 'cheese', + 'chess', + 'chess-bishop', + 'chess-board', + 'chess-king', + 'chess-knight', + 'chess-pawn', + 'chess-queen', + 'chess-rook', + 'chevron-circle-down', + 'chevron-circle-left', + 'chevron-circle-right', + 'chevron-circle-up', + 'chevron-down', + 'chevron-left', + 'chevron-right', + 'chevron-up', + 'child', + 'church', + 'circle', + 'circle-notch', + 'city', + 'clinic-medical', + 'clipboard', + 'clipboard-check', + 'clipboard-list', + 'clock', + 'clone', + 'closed-captioning', + 'cloud', + 'cloud-download-alt', + 'cloud-meatball', + 'cloud-moon', + 'cloud-moon-rain', + 'cloud-rain', + 'cloud-showers-heavy', + 'cloud-sun', + 'cloud-sun-rain', + 'cloud-upload-alt', + 'cocktail', + 'code', + 'code-branch', + 'coffee', + 'cog', + 'cogs', + 'coins', + 'columns', + 'comment', + 'comment-alt', + 'comment-dollar', + 'comment-dots', + 'comment-medical', + 'comment-slash', + 'comments', + 'comments-dollar', + 'compact-disc', + 'compass', + 'compress', + 'compress-alt', + 'compress-arrows-alt', + 'concierge-bell', + 'cookie', + 'cookie-bite', + 'copy', + 'copyright', + 'couch', + 'credit-card', + 'crop', + 'crop-alt', + 'cross', + 'crosshairs', + 'crow', + 'crown', + 'crutch', + 'cube', + 'cubes', + 'cut', + 'database', + 'deaf', + 'democrat', + 'desktop', + 'dharmachakra', + 'diagnoses', + 'dice', + 'dice-d20', + 'dice-d6', + 'dice-five', + 'dice-four', + 'dice-one', + 'dice-six', + 'dice-three', + 'dice-two', + 'digital-tachograph', + 'directions', + 'disease', + 'divide', + 'dizzy', + 'dna', + 'dog', + 'dollar-sign', + 'dolly', + 'dolly-flatbed', + 'donate', + 'door-closed', + 'door-open', + 'dot-circle', + 'dove', + 'download', + 'drafting-compass', + 'dragon', + 'draw-polygon', + 'drum', + 'drum-steelpan', + 'drumstick-bite', + 'dumbbell', + 'dumpster', + 'dumpster-fire', + 'dungeon', + 'edit', + 'egg', + 'eject', + 'ellipsis-h', + 'ellipsis-v', + 'empty-set', + 'envelope', + 'envelope-open', + 'envelope-open-text', + 'envelope-square', + 'equals', + 'eraser', + 'ethernet', + 'euro-sign', + 'exchange-alt', + 'exclamation', + 'exclamation-circle', + 'exclamation-triangle', + 'expand', + 'expand-alt', + 'expand-arrows-alt', + 'external-link-alt', + 'external-link-square-alt', + 'eye', + 'eye-dropper', + 'eye-slash', + 'fan', + 'fast-backward', + 'fast-forward', + 'faucet', + 'fax', + 'feather', + 'feather-alt', + 'female', + 'fighter-jet', + 'file', + 'file-alt', + 'file-archive', + 'file-audio', + 'file-code', + 'file-contract', + 'file-csv', + 'file-download', + 'file-excel', + 'file-export', + 'file-image', + 'file-import', + 'file-invoice', + 'file-invoice-dollar', + 'file-medical', + 'file-medical-alt', + 'file-pdf', + 'file-powerpoint', + 'file-prescription', + 'file-signature', + 'file-upload', + 'file-video', + 'file-word', + 'fill', + 'fill-drip', + 'film', + 'filter', + 'fingerprint', + 'fire', + 'fire-alt', + 'fire-extinguisher', + 'first-aid', + 'fish', + 'fist-raised', + 'flag', + 'flag-checkered', + 'flag-usa', + 'flask', + 'flushed', + 'folder', + 'folder-minus', + 'folder-open', + 'folder-plus', + 'font', + 'football-ball', + 'forward', + 'frog', + 'frown', + 'frown-open', + 'function', + 'funnel-dollar', + 'futbol', + 'gamepad', + 'gas-pump', + 'gavel', + 'gem', + 'genderless', + 'ghost', + 'gift', + 'gifts', + 'glass-cheers', + 'glass-martini', + 'glass-martini-alt', + 'glass-whiskey', + 'glasses', + 'globe', + 'globe-africa', + 'globe-americas', + 'globe-asia', + 'globe-europe', + 'golf-ball', + 'gopuram', + 'graduation-cap', + 'greater-than', + 'greater-than-equal', + 'grimace', + 'grin', + 'grin-alt', + 'grin-beam', + 'grin-beam-sweat', + 'grin-hearts', + 'grin-squint', + 'grin-squint-tears', + 'grin-stars', + 'grin-tears', + 'grin-tongue', + 'grin-tongue-squint', + 'grin-tongue-wink', + 'grin-wink', + 'grip-horizontal', + 'grip-lines', + 'grip-lines-vertical', + 'grip-vertical', + 'guitar', + 'h-square', + 'hamburger', + 'hammer', + 'hamsa', + 'hand-holding', + 'hand-holding-heart', + 'hand-holding-medical', + 'hand-holding-usd', + 'hand-holding-water', + 'hand-lizard', + 'hand-middle-finger', + 'hand-paper', + 'hand-peace', + 'hand-point-down', + 'hand-point-left', + 'hand-point-right', + 'hand-point-up', + 'hand-pointer', + 'hand-rock', + 'hand-scissors', + 'hand-sparkles', + 'hand-spock', + 'hands', + 'hands-helping', + 'hands-wash', + 'handshake', + 'handshake-alt-slash', + 'handshake-slash', + 'hanukiah', + 'hard-hat', + 'hashtag', + 'hat-cowboy', + 'hat-cowboy-side', + 'hat-wizard', + 'hdd', + 'head-side-cough', + 'head-side-cough-slash', + 'head-side-mask', + 'head-side-virus', + 'heading', + 'headphones', + 'headphones-alt', + 'headset', + 'heart', + 'heart-broken', + 'heartbeat', + 'helicopter', + 'highlighter', + 'hiking', + 'hippo', + 'history', + 'hockey-puck', + 'holly-berry', + 'home', + 'horse', + 'horse-head', + 'hospital', + 'hospital-alt', + 'hospital-symbol', + 'hospital-user', + 'hot-tub', + 'hotdog', + 'hotel', + 'hourglass', + 'hourglass-end', + 'hourglass-half', + 'hourglass-start', + 'house-damage', + 'house-user', + 'hryvnia', + 'i-cursor', + 'ice-cream', + 'icicles', + 'icons', + 'id-badge', + 'id-card', + 'id-card-alt', + 'igloo', + 'image', + 'images', + 'inbox', + 'indent', + 'industry', + 'infinity', + 'info', + 'info-circle', + 'integral', + 'intersection', + 'italic', + 'jedi', + 'joint', + 'journal-whills', + 'kaaba', + 'key', + 'keyboard', + 'khanda', + 'kiss', + 'kiss-beam', + 'kiss-wink-heart', + 'kiwi-bird', + 'lambda', + 'landmark', + 'language', + 'laptop', + 'laptop-code', + 'laptop-house', + 'laptop-medical', + 'laugh', + 'laugh-beam', + 'laugh-squint', + 'laugh-wink', + 'layer-group', + 'leaf', + 'lemon', + 'less-than', + 'less-than-equal', + 'level-down-alt', + 'level-up-alt', + 'life-ring', + 'lightbulb', + 'link', + 'lira-sign', + 'list', + 'list-alt', + 'list-ol', + 'list-ul', + 'location-arrow', + 'lock', + 'lock-open', + 'long-arrow-alt-down', + 'long-arrow-alt-left', + 'long-arrow-alt-right', + 'long-arrow-alt-up', + 'low-vision', + 'luggage-cart', + 'lungs', + 'lungs-virus', + 'magic', + 'magnet', + 'mail-bulk', + 'male', + 'map', + 'map-marked', + 'map-marked-alt', + 'map-marker', + 'map-marker-alt', + 'map-pin', + 'map-signs', + 'marker', + 'mars', + 'mars-double', + 'mars-stroke', + 'mars-stroke-h', + 'mars-stroke-v', + 'mask', + 'medal', + 'medkit', + 'meh', + 'meh-blank', + 'meh-rolling-eyes', + 'memory', + 'menorah', + 'mercury', + 'meteor', + 'microchip', + 'microphone', + 'microphone-alt', + 'microphone-alt-slash', + 'microphone-slash', + 'microscope', + 'minus', + 'minus-circle', + 'minus-square', + 'mitten', + 'mobile', + 'mobile-alt', + 'money-bill', + 'money-bill-alt', + 'money-bill-wave', + 'money-bill-wave-alt', + 'money-check', + 'money-check-alt', + 'monument', + 'moon', + 'mortar-pestle', + 'mosque', + 'motorcycle', + 'mountain', + 'mouse', + 'mouse-pointer', + 'mug-hot', + 'music', + 'network-wired', + 'neuter', + 'newspaper', + 'not-equal', + 'notes-medical', + 'object-group', + 'object-ungroup', + 'oil-can', + 'om', + 'omega', + 'otter', + 'outdent', + 'pager', + 'paint-brush', + 'paint-roller', + 'palette', + 'pallet', + 'paper-plane', + 'paperclip', + 'parachute-box', + 'paragraph', + 'parking', + 'passport', + 'pastafarianism', + 'paste', + 'pause', + 'pause-circle', + 'paw', + 'peace', + 'pen', + 'pen-alt', + 'pen-fancy', + 'pen-nib', + 'pen-square', + 'pencil-alt', + 'pencil-ruler', + 'people-arrows', + 'people-carry', + 'pepper-hot', + 'percent', + 'percentage', + 'person-booth', + 'phone', + 'phone-alt', + 'phone-slash', + 'phone-square', + 'phone-square-alt', + 'phone-volume', + 'photo-video', + 'pi', + 'piggy-bank', + 'pills', + 'pizza-slice', + 'place-of-worship', + 'plane', + 'plane-arrival', + 'plane-departure', + 'plane-slash', + 'play', + 'play-circle', + 'plug', + 'plus', + 'plus-circle', + 'plus-square', + 'podcast', + 'poll', + 'poll-h', + 'poo', + 'poo-storm', + 'poop', + 'portrait', + 'pound-sign', + 'power-off', + 'pray', + 'praying-hands', + 'prescription', + 'prescription-bottle', + 'prescription-bottle-alt', + 'print', + 'procedures', + 'project-diagram', + 'pump-medical', + 'pump-soap', + 'puzzle-piece', + 'qrcode', + 'question', + 'question-circle', + 'quidditch', + 'quote-left', + 'quote-right', + 'quran', + 'radiation', + 'radiation-alt', + 'rainbow', + 'random', + 'receipt', + 'record-vinyl', + 'recycle', + 'redo', + 'redo-alt', + 'registered', + 'remove-format', + 'reply', + 'reply-all', + 'republican', + 'restroom', + 'retweet', + 'ribbon', + 'ring', + 'road', + 'robot', + 'rocket', + 'route', + 'rss', + 'rss-square', + 'ruble-sign', + 'ruler', + 'ruler-combined', + 'ruler-horizontal', + 'ruler-vertical', + 'running', + 'rupee-sign', + 'sad-cry', + 'sad-tear', + 'satellite', + 'satellite-dish', + 'save', + 'school', + 'screwdriver', + 'scroll', + 'sd-card', + 'search', + 'search-dollar', + 'search-location', + 'search-minus', + 'search-plus', + 'seedling', + 'server', + 'shapes', + 'share', + 'share-alt', + 'share-alt-square', + 'share-square', + 'shekel-sign', + 'shield-alt', + 'shield-virus', + 'ship', + 'shipping-fast', + 'shoe-prints', + 'shopping-bag', + 'shopping-basket', + 'shopping-cart', + 'shower', + 'shuttle-van', + 'sigma', + 'sign', + 'sign-in-alt', + 'sign-language', + 'sign-out-alt', + 'signal', + 'signal-alt', + 'signal-alt-slash', + 'signal-slash', + 'signature', + 'sim-card', + 'sink', + 'sitemap', + 'skating', + 'skiing', + 'skiing-nordic', + 'skull', + 'skull-crossbones', + 'slash', + 'sleigh', + 'sliders-h', + 'smile', + 'smile-beam', + 'smile-wink', + 'smog', + 'smoking', + 'smoking-ban', + 'sms', + 'snowboarding', + 'snowflake', + 'snowman', + 'snowplow', + 'soap', + 'socks', + 'solar-panel', + 'sort', + 'sort-alpha-down', + 'sort-alpha-down-alt', + 'sort-alpha-up', + 'sort-alpha-up-alt', + 'sort-amount-down', + 'sort-amount-down-alt', + 'sort-amount-up', + 'sort-amount-up-alt', + 'sort-down', + 'sort-numeric-down', + 'sort-numeric-down-alt', + 'sort-numeric-up', + 'sort-numeric-up-alt', + 'sort-up', + 'spa', + 'space-shuttle', + 'spell-check', + 'spider', + 'spinner', + 'splotch', + 'spray-can', + 'square', + 'square-full', + 'square-root', + 'square-root-alt', + 'stamp', + 'star', + 'star-and-crescent', + 'star-half', + 'star-half-alt', + 'star-of-david', + 'star-of-life', + 'step-backward', + 'step-forward', + 'stethoscope', + 'sticky-note', + 'stop', + 'stop-circle', + 'stopwatch', + 'stopwatch-20', + 'store', + 'store-alt', + 'store-alt-slash', + 'store-slash', + 'stream', + 'street-view', + 'strikethrough', + 'stroopwafel', + 'subscript', + 'subway', + 'suitcase', + 'suitcase-rolling', + 'sun', + 'superscript', + 'surprise', + 'swatchbook', + 'swimmer', + 'swimming-pool', + 'synagogue', + 'sync', + 'sync-alt', + 'syringe', + 'table', + 'table-tennis', + 'tablet', + 'tablet-alt', + 'tablets', + 'tachometer-alt', + 'tag', + 'tags', + 'tally', + 'tape', + 'tasks', + 'taxi', + 'teeth', + 'teeth-open', + 'temperature-high', + 'temperature-low', + 'tenge', + 'terminal', + 'text-height', + 'text-width', + 'th', + 'th-large', + 'th-list', + 'theater-masks', + 'thermometer', + 'thermometer-empty', + 'thermometer-full', + 'thermometer-half', + 'thermometer-quarter', + 'thermometer-three-quarters', + 'theta', + 'thumbs-down', + 'thumbs-up', + 'thumbtack', + 'ticket-alt', + 'tilde', + 'times', + 'times-circle', + 'tint', + 'tint-slash', + 'tired', + 'toggle-off', + 'toggle-on', + 'toilet', + 'toilet-paper', + 'toilet-paper-slash', + 'toolbox', + 'tools', + 'tooth', + 'torah', + 'torii-gate', + 'tractor', + 'trademark', + 'traffic-light', + 'trailer', + 'train', + 'tram', + 'transgender', + 'transgender-alt', + 'trash', + 'trash-alt', + 'trash-restore', + 'trash-restore-alt', + 'tree', + 'trophy', + 'truck', + 'truck-loading', + 'truck-monster', + 'truck-moving', + 'truck-pickup', + 'tshirt', + 'tty', + 'tv', + 'umbrella', + 'umbrella-beach', + 'underline', + 'undo', + 'undo-alt', + 'union', + 'universal-access', + 'university', + 'unlink', + 'unlock', + 'unlock-alt', + 'upload', + 'user', + 'user-alt', + 'user-alt-slash', + 'user-astronaut', + 'user-check', + 'user-circle', + 'user-clock', + 'user-cog', + 'user-edit', + 'user-friends', + 'user-graduate', + 'user-injured', + 'user-lock', + 'user-md', + 'user-minus', + 'user-ninja', + 'user-nurse', + 'user-plus', + 'user-secret', + 'user-shield', + 'user-slash', + 'user-tag', + 'user-tie', + 'user-times', + 'users', + 'users-cog', + 'users-slash', + 'utensil-spoon', + 'utensils', + 'value-absolute', + 'vector-square', + 'venus', + 'venus-double', + 'venus-mars', + 'vest', + 'vest-patches', + 'vial', + 'vials', + 'video', + 'video-slash', + 'vihara', + 'virus', + 'virus-slash', + 'viruses', + 'voicemail', + 'volleyball-ball', + 'volume', + 'volume-down', + 'volume-mute', + 'volume-off', + 'volume-slash', + 'volume-up', + 'vote-yea', + 'vr-cardboard', + 'walking', + 'wallet', + 'warehouse', + 'water', + 'wave-square', + 'weight', + 'weight-hanging', + 'wheelchair', + 'wifi', + 'wifi-slash', + 'wind', + 'window-close', + 'window-maximize', + 'window-minimize', + 'window-restore', + 'wine-bottle', + 'wine-glass', + 'wine-glass-alt', + 'won-sign', + 'wrench', + 'x-ray', + 'yen-sign', + 'yin-yang' + ] +} diff --git a/src/components/ImageViewer/index.ts b/src/components/ImageViewer/index.ts new file mode 100644 index 0000000..3868135 --- /dev/null +++ b/src/components/ImageViewer/index.ts @@ -0,0 +1,33 @@ +import ImageViewer from './src/ImageViewer.vue' +import { isClient } from '@/utils/is' +import { createVNode, render, VNode } from 'vue' +import { ImageViewerProps } from './src/types' + +let instance: Nullable = null + +export function createImageViewer(options: ImageViewerProps) { + if (!isClient) return + const { + urlList, + initialIndex = 0, + infinite = true, + hideOnClickModal = false, + appendToBody = false, + zIndex = 2000, + show = true + } = options + + const propsData: Partial = {} + const container = document.createElement('div') + propsData.urlList = urlList + propsData.initialIndex = initialIndex + propsData.infinite = infinite + propsData.hideOnClickModal = hideOnClickModal + propsData.appendToBody = appendToBody + propsData.zIndex = zIndex + propsData.show = show + + document.body.appendChild(container) + instance = createVNode(ImageViewer, propsData) + render(instance, container) +} diff --git a/src/components/ImageViewer/src/ImageViewer.vue b/src/components/ImageViewer/src/ImageViewer.vue new file mode 100644 index 0000000..5c4921e --- /dev/null +++ b/src/components/ImageViewer/src/ImageViewer.vue @@ -0,0 +1,35 @@ + + + diff --git a/src/components/ImageViewer/src/types.ts b/src/components/ImageViewer/src/types.ts new file mode 100644 index 0000000..1932d74 --- /dev/null +++ b/src/components/ImageViewer/src/types.ts @@ -0,0 +1,9 @@ +export interface ImageViewerProps { + urlList?: string[] + zIndex?: number + initialIndex?: number + infinite?: boolean + hideOnClickModal?: boolean + appendToBody?: boolean + show?: boolean +} diff --git a/src/components/ImportForm/index.ts b/src/components/ImportForm/index.ts new file mode 100644 index 0000000..9eed682 --- /dev/null +++ b/src/components/ImportForm/index.ts @@ -0,0 +1,3 @@ +import ImportForm from './src/ImportForm.vue' + +export { ImportForm } diff --git a/src/components/ImportForm/src/ImportForm.vue b/src/components/ImportForm/src/ImportForm.vue new file mode 100644 index 0000000..a2bfd46 --- /dev/null +++ b/src/components/ImportForm/src/ImportForm.vue @@ -0,0 +1,259 @@ + + + + + diff --git a/src/components/Infotip/index.ts b/src/components/Infotip/index.ts new file mode 100644 index 0000000..413fa5f --- /dev/null +++ b/src/components/Infotip/index.ts @@ -0,0 +1,3 @@ +import Infotip from './src/Infotip.vue' + +export { Infotip } diff --git a/src/components/Infotip/src/Infotip.vue b/src/components/Infotip/src/Infotip.vue new file mode 100644 index 0000000..0afd692 --- /dev/null +++ b/src/components/Infotip/src/Infotip.vue @@ -0,0 +1,54 @@ + + + diff --git a/src/components/InputPassword/index.ts b/src/components/InputPassword/index.ts new file mode 100644 index 0000000..1dcc38e --- /dev/null +++ b/src/components/InputPassword/index.ts @@ -0,0 +1,3 @@ +import InputPassword from './src/InputPassword.vue' + +export { InputPassword } diff --git a/src/components/InputPassword/src/InputPassword.vue b/src/components/InputPassword/src/InputPassword.vue new file mode 100644 index 0000000..b8c93e7 --- /dev/null +++ b/src/components/InputPassword/src/InputPassword.vue @@ -0,0 +1,152 @@ + + + + + diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue new file mode 100644 index 0000000..b88997b --- /dev/null +++ b/src/components/Pagination/index.vue @@ -0,0 +1,87 @@ + + + diff --git a/src/components/Qrcode/index.ts b/src/components/Qrcode/index.ts new file mode 100644 index 0000000..ce46161 --- /dev/null +++ b/src/components/Qrcode/index.ts @@ -0,0 +1,3 @@ +import Qrcode from './src/Qrcode.vue' + +export { Qrcode } diff --git a/src/components/Qrcode/src/Qrcode.vue b/src/components/Qrcode/src/Qrcode.vue new file mode 100644 index 0000000..f0ce7b7 --- /dev/null +++ b/src/components/Qrcode/src/Qrcode.vue @@ -0,0 +1,253 @@ + + + + + diff --git a/src/components/Remarks/index.ts b/src/components/Remarks/index.ts new file mode 100644 index 0000000..d715496 --- /dev/null +++ b/src/components/Remarks/index.ts @@ -0,0 +1,3 @@ +import Remarks from './src/Remarks.vue' + +export { Remarks } diff --git a/src/components/Remarks/src/Remarks.vue b/src/components/Remarks/src/Remarks.vue new file mode 100644 index 0000000..f73c66c --- /dev/null +++ b/src/components/Remarks/src/Remarks.vue @@ -0,0 +1,119 @@ + + + + + + + diff --git a/src/components/RouterSearch/index.vue b/src/components/RouterSearch/index.vue new file mode 100644 index 0000000..c12385a --- /dev/null +++ b/src/components/RouterSearch/index.vue @@ -0,0 +1,76 @@ + + + diff --git a/src/components/Search/index.ts b/src/components/Search/index.ts new file mode 100644 index 0000000..fcc6f16 --- /dev/null +++ b/src/components/Search/index.ts @@ -0,0 +1,3 @@ +import Search from './src/Search.vue' + +export { Search } diff --git a/src/components/Search/src/Search.vue b/src/components/Search/src/Search.vue new file mode 100644 index 0000000..eef62c1 --- /dev/null +++ b/src/components/Search/src/Search.vue @@ -0,0 +1,158 @@ + + + diff --git a/src/components/SearchHigh/index.ts b/src/components/SearchHigh/index.ts new file mode 100644 index 0000000..a559d09 --- /dev/null +++ b/src/components/SearchHigh/index.ts @@ -0,0 +1,3 @@ +import SearchHigh from './src/SearchHigh.vue' + +export { SearchHigh } diff --git a/src/components/SearchHigh/src/SearchHigh.vue b/src/components/SearchHigh/src/SearchHigh.vue new file mode 100644 index 0000000..d93afba --- /dev/null +++ b/src/components/SearchHigh/src/SearchHigh.vue @@ -0,0 +1,316 @@ + + + \ No newline at end of file diff --git a/src/components/SearchTable/index.ts b/src/components/SearchTable/index.ts new file mode 100644 index 0000000..2828959 --- /dev/null +++ b/src/components/SearchTable/index.ts @@ -0,0 +1,3 @@ +import SearchTable from './src/SearchTable.vue' + +export { SearchTable } diff --git a/src/components/SearchTable/src/SearchTable.vue b/src/components/SearchTable/src/SearchTable.vue new file mode 100644 index 0000000..139627b --- /dev/null +++ b/src/components/SearchTable/src/SearchTable.vue @@ -0,0 +1,91 @@ + + + \ No newline at end of file diff --git a/src/components/Sticky/index.ts b/src/components/Sticky/index.ts new file mode 100644 index 0000000..5e1de45 --- /dev/null +++ b/src/components/Sticky/index.ts @@ -0,0 +1,3 @@ +import Sticky from './src/Sticky.vue' + +export { Sticky } diff --git a/src/components/Sticky/src/Sticky.vue b/src/components/Sticky/src/Sticky.vue new file mode 100644 index 0000000..b958544 --- /dev/null +++ b/src/components/Sticky/src/Sticky.vue @@ -0,0 +1,143 @@ + + diff --git a/src/components/Table/index.ts b/src/components/Table/index.ts new file mode 100644 index 0000000..689f64a --- /dev/null +++ b/src/components/Table/index.ts @@ -0,0 +1,12 @@ +import Table from './src/Table.vue' +import { ElTable } from 'element-plus' +import { TableSetPropsType } from '@/types/table' + +export interface TableExpose { + setProps: (props: Recordable) => void + setColumn: (columnProps: TableSetPropsType[]) => void + selections: Recordable[] + elTableRef: ComponentRef +} + +export { Table } diff --git a/src/components/Table/src/Table.vue b/src/components/Table/src/Table.vue new file mode 100644 index 0000000..19f3f63 --- /dev/null +++ b/src/components/Table/src/Table.vue @@ -0,0 +1,331 @@ + + diff --git a/src/components/Table/src/helper.ts b/src/components/Table/src/helper.ts new file mode 100644 index 0000000..d8b34a8 --- /dev/null +++ b/src/components/Table/src/helper.ts @@ -0,0 +1,8 @@ +export const setIndex = (reserveIndex: boolean, index: number, size: number, current: number) => { + const newIndex = index + 1 + if (reserveIndex) { + return size * (current - 1) + newIndex + } else { + return newIndex + } +} diff --git a/src/components/Table/src/types.ts b/src/components/Table/src/types.ts new file mode 100644 index 0000000..1c7ff76 --- /dev/null +++ b/src/components/Table/src/types.ts @@ -0,0 +1,26 @@ +import { Pagination, TableColumn } from '@/types/table' + +export type TableProps = { + pageSize?: number + currentPage?: number + // 是否多选 + selection?: boolean + // 是否所有的超出隐藏,优先级低于schema中的showOverflowTooltip, + showOverflowTooltip?: boolean + // 表头 + columns?: TableColumn[] + // 是否展示分页 + pagination?: Pagination | undefined + // 仅对 type=selection 的列有效,类型为 Boolean,为 true 则会在数据更新之后保留之前选中的数据(需指定 row-key) + reserveSelection?: boolean + // 加载状态 + loading?: boolean + // 是否叠加索引 + reserveIndex?: boolean + // 对齐方式 + align?: 'left' | 'center' | 'right' + // 表头对齐方式 + headerAlign?: 'left' | 'center' | 'right' + data?: Recordable + expand?: boolean +} & Recordable diff --git a/src/components/TableForm/index.ts b/src/components/TableForm/index.ts new file mode 100644 index 0000000..d0456f9 --- /dev/null +++ b/src/components/TableForm/index.ts @@ -0,0 +1,3 @@ +import Annex from './src/Annex.vue' + +export { Annex } diff --git a/src/components/TableForm/src/TableForm.vue b/src/components/TableForm/src/TableForm.vue new file mode 100644 index 0000000..13528fd --- /dev/null +++ b/src/components/TableForm/src/TableForm.vue @@ -0,0 +1,443 @@ + + + + + + + diff --git a/src/components/TableHead/index.ts b/src/components/TableHead/index.ts new file mode 100644 index 0000000..7fc036b --- /dev/null +++ b/src/components/TableHead/index.ts @@ -0,0 +1,3 @@ +import TableHead from './src/TableHead.vue' + +export { TableHead } diff --git a/src/components/TableHead/src/TableHead.vue b/src/components/TableHead/src/TableHead.vue new file mode 100644 index 0000000..241d344 --- /dev/null +++ b/src/components/TableHead/src/TableHead.vue @@ -0,0 +1,170 @@ + + + \ No newline at end of file diff --git a/src/components/Tabs/index.ts b/src/components/Tabs/index.ts new file mode 100644 index 0000000..d0456f9 --- /dev/null +++ b/src/components/Tabs/index.ts @@ -0,0 +1,3 @@ +import Annex from './src/Annex.vue' + +export { Annex } diff --git a/src/components/Tabs/src/Tabs.vue b/src/components/Tabs/src/Tabs.vue new file mode 100644 index 0000000..aa64661 --- /dev/null +++ b/src/components/Tabs/src/Tabs.vue @@ -0,0 +1,60 @@ + + + + + + + diff --git a/src/components/Tooltip/index.ts b/src/components/Tooltip/index.ts new file mode 100644 index 0000000..ab66ddf --- /dev/null +++ b/src/components/Tooltip/index.ts @@ -0,0 +1,3 @@ +import Tooltip from './src/Tooltip.vue' + +export { Tooltip } diff --git a/src/components/Tooltip/src/Tooltip.vue b/src/components/Tooltip/src/Tooltip.vue new file mode 100644 index 0000000..7490bd7 --- /dev/null +++ b/src/components/Tooltip/src/Tooltip.vue @@ -0,0 +1,17 @@ + + diff --git a/src/components/UploadFile/index.ts b/src/components/UploadFile/index.ts new file mode 100644 index 0000000..97c1d66 --- /dev/null +++ b/src/components/UploadFile/index.ts @@ -0,0 +1,5 @@ +import UploadImg from './src/UploadImg.vue' +import UploadImgs from './src/UploadImgs.vue' +import UploadFile from './src/UploadFile.vue' + +export { UploadImg, UploadImgs, UploadFile } diff --git a/src/components/UploadFile/src/UploadFile.vue b/src/components/UploadFile/src/UploadFile.vue new file mode 100644 index 0000000..4067be5 --- /dev/null +++ b/src/components/UploadFile/src/UploadFile.vue @@ -0,0 +1,177 @@ + + + diff --git a/src/components/UploadFile/src/UploadImg.vue b/src/components/UploadFile/src/UploadImg.vue new file mode 100644 index 0000000..100736b --- /dev/null +++ b/src/components/UploadFile/src/UploadImg.vue @@ -0,0 +1,272 @@ + + + + diff --git a/src/components/UploadFile/src/UploadImgs.vue b/src/components/UploadFile/src/UploadImgs.vue new file mode 100644 index 0000000..7470c9b --- /dev/null +++ b/src/components/UploadFile/src/UploadImgs.vue @@ -0,0 +1,310 @@ + + + + diff --git a/src/components/Verifition/index.ts b/src/components/Verifition/index.ts new file mode 100644 index 0000000..bcfe6d9 --- /dev/null +++ b/src/components/Verifition/index.ts @@ -0,0 +1,3 @@ +import Verify from './src/Verify.vue' + +export { Verify } diff --git a/src/components/Verifition/src/Verify.vue b/src/components/Verifition/src/Verify.vue new file mode 100644 index 0000000..b7b5048 --- /dev/null +++ b/src/components/Verifition/src/Verify.vue @@ -0,0 +1,441 @@ + + + diff --git a/src/components/Verifition/src/Verify/VerifyPoints.vue b/src/components/Verifition/src/Verify/VerifyPoints.vue new file mode 100644 index 0000000..9d04f29 --- /dev/null +++ b/src/components/Verifition/src/Verify/VerifyPoints.vue @@ -0,0 +1,250 @@ + + diff --git a/src/components/Verifition/src/Verify/VerifySlide.vue b/src/components/Verifition/src/Verify/VerifySlide.vue new file mode 100644 index 0000000..8b448b0 --- /dev/null +++ b/src/components/Verifition/src/Verify/VerifySlide.vue @@ -0,0 +1,376 @@ + + diff --git a/src/components/Verifition/src/Verify/index.ts b/src/components/Verifition/src/Verify/index.ts new file mode 100644 index 0000000..0daa63a --- /dev/null +++ b/src/components/Verifition/src/Verify/index.ts @@ -0,0 +1,4 @@ +import VerifySlide from './VerifySlide.vue' +import VerifyPoints from './VerifyPoints.vue' + +export { VerifySlide, VerifyPoints } diff --git a/src/components/Verifition/src/utils/ase.ts b/src/components/Verifition/src/utils/ase.ts new file mode 100644 index 0000000..d2e6b98 --- /dev/null +++ b/src/components/Verifition/src/utils/ase.ts @@ -0,0 +1,14 @@ +import CryptoJS from 'crypto-js' +/** + * @word 要加密的内容 + * @keyWord String 服务器随机返回的关键字 + * */ +export function aesEncrypt(word, keyWord = 'XwKsGlMcdPMEhR1B') { + const key = CryptoJS.enc.Utf8.parse(keyWord) + const srcs = CryptoJS.enc.Utf8.parse(word) + const encrypted = CryptoJS.AES.encrypt(srcs, key, { + mode: CryptoJS.mode.ECB, + padding: CryptoJS.pad.Pkcs7 + }) + return encrypted.toString() +} diff --git a/src/components/Verifition/src/utils/util.ts b/src/components/Verifition/src/utils/util.ts new file mode 100644 index 0000000..15c1627 --- /dev/null +++ b/src/components/Verifition/src/utils/util.ts @@ -0,0 +1,97 @@ +export function resetSize(vm) { + let img_width, img_height, bar_width, bar_height //图片的宽度、高度,移动条的宽度、高度 + const EmployeeWindow = window as any + const parentWidth = vm.$el.parentNode.offsetWidth || EmployeeWindow.offsetWidth + const parentHeight = vm.$el.parentNode.offsetHeight || EmployeeWindow.offsetHeight + if (vm.imgSize.width.indexOf('%') != -1) { + img_width = (parseInt(vm.imgSize.width) / 100) * parentWidth + 'px' + } else { + img_width = vm.imgSize.width + } + + if (vm.imgSize.height.indexOf('%') != -1) { + img_height = (parseInt(vm.imgSize.height) / 100) * parentHeight + 'px' + } else { + img_height = vm.imgSize.height + } + + if (vm.barSize.width.indexOf('%') != -1) { + bar_width = (parseInt(vm.barSize.width) / 100) * parentWidth + 'px' + } else { + bar_width = vm.barSize.width + } + + if (vm.barSize.height.indexOf('%') != -1) { + bar_height = (parseInt(vm.barSize.height) / 100) * parentHeight + 'px' + } else { + bar_height = vm.barSize.height + } + + return { imgWidth: img_width, imgHeight: img_height, barWidth: bar_width, barHeight: bar_height } +} + +export const _code_chars = [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 'a', + 'b', + 'c', + 'd', + 'e', + 'f', + 'g', + 'h', + 'i', + 'j', + 'k', + 'l', + 'm', + 'n', + 'o', + 'p', + 'q', + 'r', + 's', + 't', + 'u', + 'v', + 'w', + 'x', + 'y', + 'z', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F', + 'G', + 'H', + 'I', + 'J', + 'K', + 'L', + 'M', + 'N', + 'O', + 'P', + 'Q', + 'R', + 'S', + 'T', + 'U', + 'V', + 'W', + 'X', + 'Y', + 'Z' +] +export const _code_color1 = ['#fffff0', '#f0ffff', '#f0fff0', '#fff0f0'] +export const _code_color2 = ['#FF0033', '#006699', '#993366', '#FF9900', '#66CC66', '#FF33CC'] diff --git a/src/components/XButton/index.ts b/src/components/XButton/index.ts new file mode 100644 index 0000000..d573b85 --- /dev/null +++ b/src/components/XButton/index.ts @@ -0,0 +1,5 @@ +import XButton from './src/XButton.vue' +import XTextButton from './src/XTextButton.vue' +import ButtonBase from './src/ButtonBase.vue' + +export { XButton, XTextButton, ButtonBase } diff --git a/src/components/XButton/src/ButtonBase.vue b/src/components/XButton/src/ButtonBase.vue new file mode 100644 index 0000000..90ed9a2 --- /dev/null +++ b/src/components/XButton/src/ButtonBase.vue @@ -0,0 +1,38 @@ + + \ No newline at end of file diff --git a/src/components/XButton/src/XButton.vue b/src/components/XButton/src/XButton.vue new file mode 100644 index 0000000..40cba1a --- /dev/null +++ b/src/components/XButton/src/XButton.vue @@ -0,0 +1,50 @@ + + + + diff --git a/src/components/XButton/src/XTextButton.vue b/src/components/XButton/src/XTextButton.vue new file mode 100644 index 0000000..b1a922b --- /dev/null +++ b/src/components/XButton/src/XTextButton.vue @@ -0,0 +1,49 @@ + + + + diff --git a/src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue b/src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue new file mode 100644 index 0000000..885a7ce --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue @@ -0,0 +1,704 @@ + + + diff --git a/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue b/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue new file mode 100644 index 0000000..e2cd467 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue @@ -0,0 +1,635 @@ + + + + + diff --git a/src/components/bpmnProcessDesigner/package/designer/index.ts b/src/components/bpmnProcessDesigner/package/designer/index.ts new file mode 100644 index 0000000..8522846 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/index.ts @@ -0,0 +1,8 @@ +import MyProcessDesigner from './ProcessDesigner.vue' + +MyProcessDesigner.install = function (Vue) { + Vue.component(MyProcessDesigner.name, MyProcessDesigner) +} + +// 流程图的设计器,可编辑 +export default MyProcessDesigner diff --git a/src/components/bpmnProcessDesigner/package/designer/index2.ts b/src/components/bpmnProcessDesigner/package/designer/index2.ts new file mode 100644 index 0000000..ebe8ca7 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/index2.ts @@ -0,0 +1,8 @@ +import MyProcessViewer from './ProcessViewer.vue' + +MyProcessViewer.install = function (Vue) { + Vue.component(MyProcessViewer.name, MyProcessViewer) +} + +// 流程图的查看器,不可编辑 +export default MyProcessViewer diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/content-pad/contentPadProvider.js b/src/components/bpmnProcessDesigner/package/designer/plugins/content-pad/contentPadProvider.js new file mode 100644 index 0000000..8783493 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/content-pad/contentPadProvider.js @@ -0,0 +1,423 @@ +import { assign, forEach, isArray } from 'min-dash' + +import { is } from 'bpmn-js/lib/util/ModelUtil' + +import { isExpanded, isEventSubProcess } from 'bpmn-js/lib/util/DiUtil' + +import { isAny } from 'bpmn-js/lib/features/modeling/util/ModelingUtil' + +import { getChildLanes } from 'bpmn-js/lib/features/modeling/util/LaneUtil' + +import { hasPrimaryModifier } from 'diagram-js/lib/util/Mouse' + +/** + * A provider for BPMN 2.0 elements context pad + */ +export default function ContextPadProvider( + config, + injector, + eventBus, + contextPad, + modeling, + elementFactory, + connect, + create, + popupMenu, + canvas, + rules, + translate +) { + config = config || {} + + contextPad.registerProvider(this) + + this._contextPad = contextPad + + this._modeling = modeling + + this._elementFactory = elementFactory + this._connect = connect + this._create = create + this._popupMenu = popupMenu + this._canvas = canvas + this._rules = rules + this._translate = translate + + if (config.autoPlace !== false) { + this._autoPlace = injector.get('autoPlace', false) + } + + eventBus.on('create.end', 250, function (event) { + const context = event.context, + shape = context.shape + + if (!hasPrimaryModifier(event) || !contextPad.isOpen(shape)) { + return + } + + const entries = contextPad.getEntries(shape) + + if (entries.replace) { + entries.replace.action.click(event, shape) + } + }) +} + +ContextPadProvider.$inject = [ + 'config.contextPad', + 'injector', + 'eventBus', + 'contextPad', + 'modeling', + 'elementFactory', + 'connect', + 'create', + 'popupMenu', + 'canvas', + 'rules', + 'translate', + 'elementRegistry' +] + +ContextPadProvider.prototype.getContextPadEntries = function (element) { + const contextPad = this._contextPad, + modeling = this._modeling, + elementFactory = this._elementFactory, + connect = this._connect, + create = this._create, + popupMenu = this._popupMenu, + canvas = this._canvas, + rules = this._rules, + autoPlace = this._autoPlace, + translate = this._translate + + const actions = {} + + if (element.type === 'label') { + return actions + } + + const businessObject = element.businessObject + + function startConnect(event, element) { + connect.start(event, element) + } + + function removeElement() { + modeling.removeElements([element]) + } + + function getReplaceMenuPosition(element) { + const Y_OFFSET = 5 + + const diagramContainer = canvas.getContainer(), + pad = contextPad.getPad(element).html + + const diagramRect = diagramContainer.getBoundingClientRect(), + padRect = pad.getBoundingClientRect() + + const top = padRect.top - diagramRect.top + const left = padRect.left - diagramRect.left + + const pos = { + x: left, + y: top + padRect.height + Y_OFFSET + } + + return pos + } + + /** + * Create an append action + * + * @param {string} type + * @param {string} className + * @param {string} [title] + * @param {Object} [options] + * + * @return {Object} descriptor + */ + function appendAction(type, className, title, options) { + if (typeof title !== 'string') { + options = title + title = translate('Append {type}', { type: type.replace(/^bpmn:/, '') }) + } + + function appendStart(event, element) { + const shape = elementFactory.createShape(assign({ type: type }, options)) + create.start(event, shape, { + source: element + }) + } + + const append = autoPlace + ? function (event, element) { + const shape = elementFactory.createShape(assign({ type: type }, options)) + + autoPlace.append(element, shape) + } + : appendStart + + return { + group: 'model', + className: className, + title: title, + action: { + dragstart: appendStart, + click: append + } + } + } + + function splitLaneHandler(count) { + return function (event, element) { + // actual split + modeling.splitLane(element, count) + + // refresh context pad after split to + // get rid of split icons + contextPad.open(element, true) + } + } + + if (isAny(businessObject, ['bpmn:Lane', 'bpmn:Participant']) && isExpanded(businessObject)) { + const childLanes = getChildLanes(element) + + assign(actions, { + 'lane-insert-above': { + group: 'lane-insert-above', + className: 'bpmn-icon-lane-insert-above', + title: translate('Add Lane above'), + action: { + click: function (event, element) { + modeling.addLane(element, 'top') + } + } + } + }) + + if (childLanes.length < 2) { + if (element.height >= 120) { + assign(actions, { + 'lane-divide-two': { + group: 'lane-divide', + className: 'bpmn-icon-lane-divide-two', + title: translate('Divide into two Lanes'), + action: { + click: splitLaneHandler(2) + } + } + }) + } + + if (element.height >= 180) { + assign(actions, { + 'lane-divide-three': { + group: 'lane-divide', + className: 'bpmn-icon-lane-divide-three', + title: translate('Divide into three Lanes'), + action: { + click: splitLaneHandler(3) + } + } + }) + } + } + + assign(actions, { + 'lane-insert-below': { + group: 'lane-insert-below', + className: 'bpmn-icon-lane-insert-below', + title: translate('Add Lane below'), + action: { + click: function (event, element) { + modeling.addLane(element, 'bottom') + } + } + } + }) + } + + if (is(businessObject, 'bpmn:FlowNode')) { + if (is(businessObject, 'bpmn:EventBasedGateway')) { + assign(actions, { + 'append.receive-task': appendAction( + 'bpmn:ReceiveTask', + 'bpmn-icon-receive-task', + translate('Append ReceiveTask') + ), + 'append.message-intermediate-event': appendAction( + 'bpmn:IntermediateCatchEvent', + 'bpmn-icon-intermediate-event-catch-message', + translate('Append MessageIntermediateCatchEvent'), + { eventDefinitionType: 'bpmn:MessageEventDefinition' } + ), + 'append.timer-intermediate-event': appendAction( + 'bpmn:IntermediateCatchEvent', + 'bpmn-icon-intermediate-event-catch-timer', + translate('Append TimerIntermediateCatchEvent'), + { eventDefinitionType: 'bpmn:TimerEventDefinition' } + ), + 'append.condition-intermediate-event': appendAction( + 'bpmn:IntermediateCatchEvent', + 'bpmn-icon-intermediate-event-catch-condition', + translate('Append ConditionIntermediateCatchEvent'), + { eventDefinitionType: 'bpmn:ConditionalEventDefinition' } + ), + 'append.signal-intermediate-event': appendAction( + 'bpmn:IntermediateCatchEvent', + 'bpmn-icon-intermediate-event-catch-signal', + translate('Append SignalIntermediateCatchEvent'), + { eventDefinitionType: 'bpmn:SignalEventDefinition' } + ) + }) + } else if ( + isEventType(businessObject, 'bpmn:BoundaryEvent', 'bpmn:CompensateEventDefinition') + ) { + assign(actions, { + 'append.compensation-activity': appendAction( + 'bpmn:Task', + 'bpmn-icon-task', + translate('Append compensation activity'), + { + isForCompensation: true + } + ) + }) + } else if ( + !is(businessObject, 'bpmn:EndEvent') && + !businessObject.isForCompensation && + !isEventType(businessObject, 'bpmn:IntermediateThrowEvent', 'bpmn:LinkEventDefinition') && + !isEventSubProcess(businessObject) + ) { + assign(actions, { + 'append.end-event': appendAction( + 'bpmn:EndEvent', + 'bpmn-icon-end-event-none', + translate('Append EndEvent') + ), + 'append.gateway': appendAction( + 'bpmn:ExclusiveGateway', + 'bpmn-icon-gateway-none', + translate('Append Gateway') + ), + 'append.append-task': appendAction( + 'bpmn:UserTask', + 'bpmn-icon-user-task', + translate('Append Task') + ), + 'append.intermediate-event': appendAction( + 'bpmn:IntermediateThrowEvent', + 'bpmn-icon-intermediate-event-none', + translate('Append Intermediate/Boundary Event') + ) + }) + } + } + + if (!popupMenu.isEmpty(element, 'bpmn-replace')) { + // Replace menu entry + assign(actions, { + replace: { + group: 'edit', + className: 'bpmn-icon-screw-wrench', + title: '修改类型', + action: { + click: function (event, element) { + const position = assign(getReplaceMenuPosition(element), { + cursor: { x: event.x, y: event.y } + }) + + popupMenu.open(element, 'bpmn-replace', position) + } + } + } + }) + } + + if ( + isAny(businessObject, [ + 'bpmn:FlowNode', + 'bpmn:InteractionNode', + 'bpmn:DataObjectReference', + 'bpmn:DataStoreReference' + ]) + ) { + assign(actions, { + 'append.text-annotation': appendAction('bpmn:TextAnnotation', 'bpmn-icon-text-annotation'), + + connect: { + group: 'connect', + className: 'bpmn-icon-connection-multi', + title: translate( + 'Connect using ' + + (businessObject.isForCompensation ? '' : 'Sequence/MessageFlow or ') + + 'Association' + ), + action: { + click: startConnect, + dragstart: startConnect + } + } + }) + } + + if (isAny(businessObject, ['bpmn:DataObjectReference', 'bpmn:DataStoreReference'])) { + assign(actions, { + connect: { + group: 'connect', + className: 'bpmn-icon-connection-multi', + title: translate('Connect using DataInputAssociation'), + action: { + click: startConnect, + dragstart: startConnect + } + } + }) + } + + if (is(businessObject, 'bpmn:Group')) { + assign(actions, { + 'append.text-annotation': appendAction('bpmn:TextAnnotation', 'bpmn-icon-text-annotation') + }) + } + + // delete element entry, only show if allowed by rules + let deleteAllowed = rules.allowed('elements.delete', { elements: [element] }) + + if (isArray(deleteAllowed)) { + // was the element returned as a deletion candidate? + deleteAllowed = deleteAllowed[0] === element + } + + if (deleteAllowed) { + assign(actions, { + delete: { + group: 'edit', + className: 'bpmn-icon-trash', + title: translate('Remove'), + action: { + click: removeElement + } + } + }) + } + + return actions +} + +// helpers ///////// + +function isEventType(eventBo, type, definition) { + const isType = eventBo.$instanceOf(type) + let isDefinition = false + + const definitions = eventBo.eventDefinitions || [] + forEach(definitions, function (def) { + if (def.$type === definition) { + isDefinition = true + } + }) + + return isType && isDefinition +} diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/content-pad/index.js b/src/components/bpmnProcessDesigner/package/designer/plugins/content-pad/index.js new file mode 100644 index 0000000..80009ef --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/content-pad/index.js @@ -0,0 +1,6 @@ +import CustomContextPadProvider from './contentPadProvider' + +export default { + __init__: ['contextPadProvider'], + contextPadProvider: ['type', CustomContextPadProvider] +} diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/defaultEmpty.js b/src/components/bpmnProcessDesigner/package/designer/plugins/defaultEmpty.js new file mode 100644 index 0000000..f3bc894 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/defaultEmpty.js @@ -0,0 +1,24 @@ +export default (key, name, type) => { + if (!type) type = 'camunda' + const TYPE_TARGET = { + activiti: 'http://activiti.org/bpmn', + camunda: 'http://bpmn.io/schema/bpmn', + flowable: 'http://flowable.org/bpmn' + } + return ` + + + + + + + +` +} diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/activitiDescriptor.json b/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/activitiDescriptor.json new file mode 100644 index 0000000..db5e490 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/activitiDescriptor.json @@ -0,0 +1,994 @@ +{ + "name": "Activiti", + "uri": "http://activiti.org/bpmn", + "prefix": "activiti", + "xml": { + "tagAlias": "lowerCase" + }, + "associations": [], + "types": [ + { + "name": "Definitions", + "isAbstract": true, + "extends": ["bpmn:Definitions"], + "properties": [ + { + "name": "diagramRelationId", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "InOutBinding", + "superClass": ["Element"], + "isAbstract": true, + "properties": [ + { + "name": "source", + "isAttr": true, + "type": "String" + }, + { + "name": "sourceExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "target", + "isAttr": true, + "type": "String" + }, + { + "name": "businessKey", + "isAttr": true, + "type": "String" + }, + { + "name": "local", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "variables", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "In", + "superClass": ["InOutBinding"], + "meta": { + "allowedIn": ["bpmn:CallActivity"] + } + }, + { + "name": "Out", + "superClass": ["InOutBinding"], + "meta": { + "allowedIn": ["bpmn:CallActivity"] + } + }, + { + "name": "AsyncCapable", + "isAbstract": true, + "extends": ["bpmn:Activity", "bpmn:Gateway", "bpmn:Event"], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncBefore", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncAfter", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "exclusive", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "JobPriorized", + "isAbstract": true, + "extends": ["bpmn:Process", "activiti:AsyncCapable"], + "properties": [ + { + "name": "jobPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "SignalEventDefinition", + "isAbstract": true, + "extends": ["bpmn:SignalEventDefinition"], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + } + ] + }, + { + "name": "ErrorEventDefinition", + "isAbstract": true, + "extends": ["bpmn:ErrorEventDefinition"], + "properties": [ + { + "name": "errorCodeVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "errorMessageVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Error", + "isAbstract": true, + "extends": ["bpmn:Error"], + "properties": [ + { + "name": "activiti:errorMessage", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "PotentialStarter", + "superClass": ["Element"], + "properties": [ + { + "name": "resourceAssignmentExpression", + "type": "bpmn:ResourceAssignmentExpression" + } + ] + }, + { + "name": "FormSupported", + "isAbstract": true, + "extends": ["bpmn:StartEvent", "bpmn:UserTask"], + "properties": [ + { + "name": "formHandlerClass", + "isAttr": true, + "type": "String" + }, + { + "name": "formKey", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TemplateSupported", + "isAbstract": true, + "extends": ["bpmn:Process", "bpmn:FlowElement"], + "properties": [ + { + "name": "modelerTemplate", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Initiator", + "isAbstract": true, + "extends": ["bpmn:StartEvent"], + "properties": [ + { + "name": "initiator", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ScriptTask", + "isAbstract": true, + "extends": ["bpmn:ScriptTask"], + "properties": [ + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Process", + "isAbstract": true, + "extends": ["bpmn:Process"], + "properties": [ + { + "name": "candidateStarterGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateStarterUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "versionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "historyTimeToLive", + "isAttr": true, + "type": "String" + }, + { + "name": "isStartableInTasklist", + "isAttr": true, + "type": "Boolean", + "default": true + }, + { + "name": "executionListener", + "isAbstract": true, + "type": "Expression" + } + ] + }, + { + "name": "EscalationEventDefinition", + "isAbstract": true, + "extends": ["bpmn:EscalationEventDefinition"], + "properties": [ + { + "name": "escalationCodeVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FormalExpression", + "isAbstract": true, + "extends": ["bpmn:FormalExpression"], + "properties": [ + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "multiinstance_type", + "superClass": ["Element"] + }, + { + "name": "multiinstance_condition", + "superClass": ["Element"] + }, + { + "name": "Assignable", + "extends": ["bpmn:UserTask"], + "properties": [ + { + "name": "assignee", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "dueDate", + "isAttr": true, + "type": "String" + }, + { + "name": "followUpDate", + "isAttr": true, + "type": "String" + }, + { + "name": "priority", + "isAttr": true, + "type": "String" + }, + { + "name": "multiinstance_condition", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "CallActivity", + "extends": ["bpmn:CallActivity"], + "properties": [ + { + "name": "calledElementBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "calledElementVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementVersionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "caseRef", + "isAttr": true, + "type": "String" + }, + { + "name": "caseBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "caseVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "caseTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingClass", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingDelegateExpression", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ServiceTaskLike", + "extends": [ + "bpmn:ServiceTask", + "bpmn:BusinessRuleTask", + "bpmn:SendTask", + "bpmn:MessageEventDefinition" + ], + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "DmnCapable", + "extends": ["bpmn:BusinessRuleTask"], + "properties": [ + { + "name": "decisionRef", + "isAttr": true, + "type": "String" + }, + { + "name": "decisionRefBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "decisionRefVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "mapDecisionResult", + "isAttr": true, + "type": "String", + "default": "resultList" + }, + { + "name": "decisionRefTenantId", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ExternalCapable", + "extends": ["activiti:ServiceTaskLike"], + "properties": [ + { + "name": "type", + "isAttr": true, + "type": "String" + }, + { + "name": "topic", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TaskPriorized", + "extends": ["bpmn:Process", "activiti:ExternalCapable"], + "properties": [ + { + "name": "taskPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Properties", + "superClass": ["Element"], + "meta": { + "allowedIn": ["*"] + }, + "properties": [ + { + "name": "values", + "type": "Property", + "isMany": true + } + ] + }, + { + "name": "Property", + "superClass": ["Element"], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "value", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "Connector", + "superClass": ["Element"], + "meta": { + "allowedIn": ["activiti:ServiceTaskLike"] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + } + ] + }, + { + "name": "InputOutput", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:FlowNode", "activiti:Connector"] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + }, + { + "name": "inputParameters", + "isMany": true, + "type": "InputParameter" + }, + { + "name": "outputParameters", + "isMany": true, + "type": "OutputParameter" + } + ] + }, + { + "name": "InputOutputParameter", + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "InputOutputParameterDefinition", + "isAbstract": true + }, + { + "name": "List", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "items", + "isMany": true, + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Map", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "entries", + "isMany": true, + "type": "Entry" + } + ] + }, + { + "name": "Entry", + "properties": [ + { + "name": "key", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Value", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "id", + "isAttr": true, + "type": "String" + }, + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Script", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "scriptFormat", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Field", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "activiti:ServiceTaskLike", + "activiti:ExecutionListener", + "activiti:TaskListener" + ] + }, + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "expression", + "type": "String" + }, + { + "name": "stringValue", + "isAttr": true, + "type": "String" + }, + { + "name": "string", + "type": "String" + } + ] + }, + { + "name": "InputParameter", + "superClass": ["InputOutputParameter"] + }, + { + "name": "OutputParameter", + "superClass": ["InputOutputParameter"] + }, + { + "name": "Collectable", + "isAbstract": true, + "extends": ["bpmn:MultiInstanceLoopCharacteristics"], + "superClass": ["activiti:AsyncCapable"], + "properties": [ + { + "name": "collection", + "isAttr": true, + "type": "String" + }, + { + "name": "elementVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FailedJobRetryTimeCycle", + "superClass": ["Element"], + "meta": { + "allowedIn": ["activiti:AsyncCapable", "bpmn:MultiInstanceLoopCharacteristics"] + }, + "properties": [ + { + "name": "body", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "ExecutionListener", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "bpmn:Task", + "bpmn:ServiceTask", + "bpmn:UserTask", + "bpmn:BusinessRuleTask", + "bpmn:ScriptTask", + "bpmn:ReceiveTask", + "bpmn:ManualTask", + "bpmn:ExclusiveGateway", + "bpmn:SequenceFlow", + "bpmn:ParallelGateway", + "bpmn:InclusiveGateway", + "bpmn:EventBasedGateway", + "bpmn:StartEvent", + "bpmn:IntermediateCatchEvent", + "bpmn:IntermediateThrowEvent", + "bpmn:EndEvent", + "bpmn:BoundaryEvent", + "bpmn:CallActivity", + "bpmn:SubProcess", + "bpmn:Process" + ] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "TaskListener", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:UserTask"] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "FormProperty", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:StartEvent", "bpmn:UserTask"] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "required", + "type": "String", + "isAttr": true + }, + { + "name": "readable", + "type": "String", + "isAttr": true + }, + { + "name": "writable", + "type": "String", + "isAttr": true + }, + { + "name": "variable", + "type": "String", + "isAttr": true + }, + { + "name": "expression", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "default", + "type": "String", + "isAttr": true + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "FormProperty", + "superClass": ["Element"], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "label", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "defaultValue", + "type": "String", + "isAttr": true + }, + { + "name": "properties", + "type": "Properties" + }, + { + "name": "validation", + "type": "Validation" + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "Validation", + "superClass": ["Element"], + "properties": [ + { + "name": "constraints", + "type": "Constraint", + "isMany": true + } + ] + }, + { + "name": "Constraint", + "superClass": ["Element"], + "properties": [ + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "config", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "ConditionalEventDefinition", + "isAbstract": true, + "extends": ["bpmn:ConditionalEventDefinition"], + "properties": [ + { + "name": "variableName", + "isAttr": true, + "type": "String" + }, + { + "name": "variableEvent", + "isAttr": true, + "type": "String" + } + ] + } + ], + "emumerations": [] +} diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/camundaDescriptor.json b/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/camundaDescriptor.json new file mode 100644 index 0000000..79b86bc --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/camundaDescriptor.json @@ -0,0 +1,1010 @@ +{ + "name": "Camunda", + "uri": "http://camunda.org/schema/1.0/bpmn", + "prefix": "camunda", + "xml": { + "tagAlias": "lowerCase" + }, + "associations": [], + "types": [ + { + "name": "Definitions", + "isAbstract": true, + "extends": ["bpmn:Definitions"], + "properties": [ + { + "name": "diagramRelationId", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "InOutBinding", + "superClass": ["Element"], + "isAbstract": true, + "properties": [ + { + "name": "source", + "isAttr": true, + "type": "String" + }, + { + "name": "sourceExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "target", + "isAttr": true, + "type": "String" + }, + { + "name": "businessKey", + "isAttr": true, + "type": "String" + }, + { + "name": "local", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "variables", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "In", + "superClass": ["InOutBinding"], + "meta": { + "allowedIn": ["bpmn:CallActivity", "bpmn:SignalEventDefinition"] + } + }, + { + "name": "Out", + "superClass": ["InOutBinding"], + "meta": { + "allowedIn": ["bpmn:CallActivity"] + } + }, + { + "name": "AsyncCapable", + "isAbstract": true, + "extends": ["bpmn:Activity", "bpmn:Gateway", "bpmn:Event"], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncBefore", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncAfter", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "exclusive", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "JobPriorized", + "isAbstract": true, + "extends": ["bpmn:Process", "camunda:AsyncCapable"], + "properties": [ + { + "name": "jobPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "SignalEventDefinition", + "isAbstract": true, + "extends": ["bpmn:SignalEventDefinition"], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + } + ] + }, + { + "name": "ErrorEventDefinition", + "isAbstract": true, + "extends": ["bpmn:ErrorEventDefinition"], + "properties": [ + { + "name": "errorCodeVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "errorMessageVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Error", + "isAbstract": true, + "extends": ["bpmn:Error"], + "properties": [ + { + "name": "camunda:errorMessage", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "PotentialStarter", + "superClass": ["Element"], + "properties": [ + { + "name": "resourceAssignmentExpression", + "type": "bpmn:ResourceAssignmentExpression" + } + ] + }, + { + "name": "FormSupported", + "isAbstract": true, + "extends": ["bpmn:StartEvent", "bpmn:UserTask"], + "properties": [ + { + "name": "formHandlerClass", + "isAttr": true, + "type": "String" + }, + { + "name": "formKey", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TemplateSupported", + "isAbstract": true, + "extends": ["bpmn:Process", "bpmn:FlowElement"], + "properties": [ + { + "name": "modelerTemplate", + "isAttr": true, + "type": "String" + }, + { + "name": "modelerTemplateVersion", + "isAttr": true, + "type": "Integer" + } + ] + }, + { + "name": "Initiator", + "isAbstract": true, + "extends": ["bpmn:StartEvent"], + "properties": [ + { + "name": "initiator", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ScriptTask", + "isAbstract": true, + "extends": ["bpmn:ScriptTask"], + "properties": [ + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Process", + "isAbstract": true, + "extends": ["bpmn:Process"], + "properties": [ + { + "name": "candidateStarterGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateStarterUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "versionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "historyTimeToLive", + "isAttr": true, + "type": "String" + }, + { + "name": "isStartableInTasklist", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "EscalationEventDefinition", + "isAbstract": true, + "extends": ["bpmn:EscalationEventDefinition"], + "properties": [ + { + "name": "escalationCodeVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FormalExpression", + "isAbstract": true, + "extends": ["bpmn:FormalExpression"], + "properties": [ + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Assignable", + "extends": ["bpmn:UserTask"], + "properties": [ + { + "name": "assignee", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "dueDate", + "isAttr": true, + "type": "String" + }, + { + "name": "followUpDate", + "isAttr": true, + "type": "String" + }, + { + "name": "priority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "CallActivity", + "extends": ["bpmn:CallActivity"], + "properties": [ + { + "name": "calledElementBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "calledElementVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementVersionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "caseRef", + "isAttr": true, + "type": "String" + }, + { + "name": "caseBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "caseVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "caseTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingClass", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingDelegateExpression", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ServiceTaskLike", + "extends": [ + "bpmn:ServiceTask", + "bpmn:BusinessRuleTask", + "bpmn:SendTask", + "bpmn:MessageEventDefinition" + ], + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "DmnCapable", + "extends": ["bpmn:BusinessRuleTask"], + "properties": [ + { + "name": "decisionRef", + "isAttr": true, + "type": "String" + }, + { + "name": "decisionRefBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "decisionRefVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "mapDecisionResult", + "isAttr": true, + "type": "String", + "default": "resultList" + }, + { + "name": "decisionRefTenantId", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ExternalCapable", + "extends": ["camunda:ServiceTaskLike"], + "properties": [ + { + "name": "type", + "isAttr": true, + "type": "String" + }, + { + "name": "topic", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TaskPriorized", + "extends": ["bpmn:Process", "camunda:ExternalCapable"], + "properties": [ + { + "name": "taskPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Properties", + "superClass": ["Element"], + "meta": { + "allowedIn": ["*"] + }, + "properties": [ + { + "name": "values", + "type": "Property", + "isMany": true + } + ] + }, + { + "name": "Property", + "superClass": ["Element"], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "value", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "Connector", + "superClass": ["Element"], + "meta": { + "allowedIn": ["camunda:ServiceTaskLike"] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + } + ] + }, + { + "name": "InputOutput", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:FlowNode", "camunda:Connector"] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + }, + { + "name": "inputParameters", + "isMany": true, + "type": "InputParameter" + }, + { + "name": "outputParameters", + "isMany": true, + "type": "OutputParameter" + } + ] + }, + { + "name": "InputOutputParameter", + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "InputOutputParameterDefinition", + "isAbstract": true + }, + { + "name": "List", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "items", + "isMany": true, + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Map", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "entries", + "isMany": true, + "type": "Entry" + } + ] + }, + { + "name": "Entry", + "properties": [ + { + "name": "key", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Value", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "id", + "isAttr": true, + "type": "String" + }, + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Script", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "scriptFormat", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Field", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "camunda:ServiceTaskLike", + "camunda:ExecutionListener", + "camunda:TaskListener" + ] + }, + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "expression", + "type": "String" + }, + { + "name": "stringValue", + "isAttr": true, + "type": "String" + }, + { + "name": "string", + "type": "String" + } + ] + }, + { + "name": "InputParameter", + "superClass": ["InputOutputParameter"] + }, + { + "name": "OutputParameter", + "superClass": ["InputOutputParameter"] + }, + { + "name": "Collectable", + "isAbstract": true, + "extends": ["bpmn:MultiInstanceLoopCharacteristics"], + "superClass": ["camunda:AsyncCapable"], + "properties": [ + { + "name": "collection", + "isAttr": true, + "type": "String" + }, + { + "name": "elementVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FailedJobRetryTimeCycle", + "superClass": ["Element"], + "meta": { + "allowedIn": ["camunda:AsyncCapable", "bpmn:MultiInstanceLoopCharacteristics"] + }, + "properties": [ + { + "name": "body", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "ExecutionListener", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "bpmn:Task", + "bpmn:ServiceTask", + "bpmn:UserTask", + "bpmn:BusinessRuleTask", + "bpmn:ScriptTask", + "bpmn:ReceiveTask", + "bpmn:ManualTask", + "bpmn:ExclusiveGateway", + "bpmn:SequenceFlow", + "bpmn:ParallelGateway", + "bpmn:InclusiveGateway", + "bpmn:EventBasedGateway", + "bpmn:StartEvent", + "bpmn:IntermediateCatchEvent", + "bpmn:IntermediateThrowEvent", + "bpmn:EndEvent", + "bpmn:BoundaryEvent", + "bpmn:CallActivity", + "bpmn:SubProcess", + "bpmn:Process" + ] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "TaskListener", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:UserTask"] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + }, + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "eventDefinitions", + "type": "bpmn:TimerEventDefinition", + "isMany": true + } + ] + }, + { + "name": "FormProperty", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:StartEvent", "bpmn:UserTask"] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "required", + "type": "String", + "isAttr": true + }, + { + "name": "readable", + "type": "String", + "isAttr": true + }, + { + "name": "writable", + "type": "String", + "isAttr": true + }, + { + "name": "variable", + "type": "String", + "isAttr": true + }, + { + "name": "expression", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "default", + "type": "String", + "isAttr": true + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "FormData", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:StartEvent", "bpmn:UserTask"] + }, + "properties": [ + { + "name": "fields", + "type": "FormField", + "isMany": true + }, + { + "name": "businessKey", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "FormField", + "superClass": ["Element"], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "label", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "defaultValue", + "type": "String", + "isAttr": true + }, + { + "name": "properties", + "type": "Properties" + }, + { + "name": "validation", + "type": "Validation" + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "Validation", + "superClass": ["Element"], + "properties": [ + { + "name": "constraints", + "type": "Constraint", + "isMany": true + } + ] + }, + { + "name": "Constraint", + "superClass": ["Element"], + "properties": [ + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "config", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "ConditionalEventDefinition", + "isAbstract": true, + "extends": ["bpmn:ConditionalEventDefinition"], + "properties": [ + { + "name": "variableName", + "isAttr": true, + "type": "String" + }, + { + "name": "variableEvents", + "isAttr": true, + "type": "String" + } + ] + } + ], + "emumerations": [] +} diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/flowableDescriptor.json b/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/flowableDescriptor.json new file mode 100644 index 0000000..7fe7ad1 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/flowableDescriptor.json @@ -0,0 +1,1207 @@ +{ + "name": "Flowable", + "uri": "http://flowable.org/bpmn", + "prefix": "flowable", + "xml": { + "tagAlias": "lowerCase" + }, + "associations": [], + "types": [ + { + "name": "InOutBinding", + "superClass": ["Element"], + "isAbstract": true, + "properties": [ + { + "name": "source", + "isAttr": true, + "type": "String" + }, + { + "name": "sourceExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "target", + "isAttr": true, + "type": "String" + }, + { + "name": "businessKey", + "isAttr": true, + "type": "String" + }, + { + "name": "local", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "variables", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "In", + "superClass": ["InOutBinding"], + "meta": { + "allowedIn": ["bpmn:CallActivity"] + } + }, + { + "name": "Out", + "superClass": ["InOutBinding"], + "meta": { + "allowedIn": ["bpmn:CallActivity"] + } + }, + { + "name": "AsyncCapable", + "isAbstract": true, + "extends": ["bpmn:Activity", "bpmn:Gateway", "bpmn:Event"], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncBefore", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncAfter", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "exclusive", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "JobPriorized", + "isAbstract": true, + "extends": ["bpmn:Process", "flowable:AsyncCapable"], + "properties": [ + { + "name": "jobPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "SignalEventDefinition", + "isAbstract": true, + "extends": ["bpmn:SignalEventDefinition"], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + } + ] + }, + { + "name": "ErrorEventDefinition", + "isAbstract": true, + "extends": ["bpmn:ErrorEventDefinition"], + "properties": [ + { + "name": "errorCodeVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "errorMessageVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Error", + "isAbstract": true, + "extends": ["bpmn:Error"], + "properties": [ + { + "name": "flowable:errorMessage", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "PotentialStarter", + "superClass": ["Element"], + "properties": [ + { + "name": "resourceAssignmentExpression", + "type": "bpmn:ResourceAssignmentExpression" + } + ] + }, + { + "name": "FormSupported", + "isAbstract": true, + "extends": ["bpmn:StartEvent", "bpmn:UserTask"], + "properties": [ + { + "name": "formHandlerClass", + "isAttr": true, + "type": "String" + }, + { + "name": "formKey", + "isAttr": true, + "type": "String" + }, + { + "name": "formType", + "isAttr": true, + "type": "String" + }, + { + "name": "formReadOnly", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "formInit", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "TemplateSupported", + "isAbstract": true, + "extends": ["bpmn:Process", "bpmn:FlowElement"], + "properties": [ + { + "name": "modelerTemplate", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Initiator", + "isAbstract": true, + "extends": ["bpmn:StartEvent"], + "properties": [ + { + "name": "initiator", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ScriptTask", + "isAbstract": true, + "extends": ["bpmn:ScriptTask"], + "properties": [ + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Process", + "isAbstract": true, + "extends": ["bpmn:Process"], + "properties": [ + { + "name": "candidateStarterGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateStarterUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "versionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "historyTimeToLive", + "isAttr": true, + "type": "String" + }, + { + "name": "isStartableInTasklist", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "EscalationEventDefinition", + "isAbstract": true, + "extends": ["bpmn:EscalationEventDefinition"], + "properties": [ + { + "name": "escalationCodeVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FormalExpression", + "isAbstract": true, + "extends": ["bpmn:FormalExpression"], + "properties": [ + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Assignable", + "extends": ["bpmn:UserTask"], + "properties": [ + { + "name": "assignee", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "dueDate", + "isAttr": true, + "type": "String" + }, + { + "name": "followUpDate", + "isAttr": true, + "type": "String" + }, + { + "name": "priority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Assignee", + "supperClass": "Element", + "meta": { + "allowedIn": ["*"] + }, + "properties": [ + { + "name": "label", + "type": "String", + "isAttr": true + }, + { + "name": "viewId", + "type": "Number", + "isAttr": true + } + ] + }, + { + "name": "CallActivity", + "extends": ["bpmn:CallActivity"], + "properties": [ + { + "name": "calledElementBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "calledElementVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementVersionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "caseRef", + "isAttr": true, + "type": "String" + }, + { + "name": "caseBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "caseVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "caseTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingClass", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingDelegateExpression", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ServiceTaskLike", + "extends": [ + "bpmn:ServiceTask", + "bpmn:BusinessRuleTask", + "bpmn:SendTask", + "bpmn:MessageEventDefinition" + ], + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "DmnCapable", + "extends": ["bpmn:BusinessRuleTask"], + "properties": [ + { + "name": "decisionRef", + "isAttr": true, + "type": "String" + }, + { + "name": "decisionRefBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "decisionRefVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "mapDecisionResult", + "isAttr": true, + "type": "String", + "default": "resultList" + }, + { + "name": "decisionRefTenantId", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ExternalCapable", + "extends": ["flowable:ServiceTaskLike"], + "properties": [ + { + "name": "type", + "isAttr": true, + "type": "String" + }, + { + "name": "topic", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TaskPriorized", + "extends": ["bpmn:Process", "flowable:ExternalCapable"], + "properties": [ + { + "name": "taskPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Properties", + "superClass": ["Element"], + "meta": { + "allowedIn": ["*"] + }, + "properties": [ + { + "name": "values", + "type": "Property", + "isMany": true + } + ] + }, + { + "name": "Property", + "superClass": ["Element"], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "value", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "Button", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:UserTask"] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "code", + "type": "String", + "isAttr": true + }, + { + "name": "isHide", + "type": "String", + "isAttr": true + }, + { + "name": "next", + "type": "String", + "isAttr": true + }, + { + "name": "sort", + "type": "Integer", + "isAttr": true + } + ] + }, + { + "name": "Assignee", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:UserTask"] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "value", + "type": "String", + "isAttr": true + }, + { + "name": "condition", + "type": "String", + "isAttr": true + }, + { + "name": "operationType", + "type": "String", + "isAttr": true + }, + { + "name": "sort", + "type": "Integer", + "isAttr": true + } + ] + }, + { + "name": "Connector", + "superClass": ["Element"], + "meta": { + "allowedIn": ["flowable:ServiceTaskLike"] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + } + ] + }, + { + "name": "InputOutput", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:FlowNode", "flowable:Connector"] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + }, + { + "name": "inputParameters", + "isMany": true, + "type": "InputParameter" + }, + { + "name": "outputParameters", + "isMany": true, + "type": "OutputParameter" + } + ] + }, + { + "name": "InputOutputParameter", + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "InputOutputParameterDefinition", + "isAbstract": true + }, + { + "name": "List", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "items", + "isMany": true, + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Map", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "entries", + "isMany": true, + "type": "Entry" + } + ] + }, + { + "name": "Entry", + "properties": [ + { + "name": "key", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Value", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "id", + "isAttr": true, + "type": "String" + }, + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Script", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "scriptFormat", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Field", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "flowable:ServiceTaskLike", + "flowable:ExecutionListener", + "flowable:TaskListener" + ] + }, + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "expression", + "type": "String" + }, + { + "name": "stringValue", + "isAttr": true, + "type": "String" + }, + { + "name": "string", + "type": "String" + } + ] + }, + { + "name": "ChildField", + "superClass": ["Element"], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "required", + "type": "String", + "isAttr": true + }, + { + "name": "readable", + "type": "String", + "isAttr": true + }, + { + "name": "writable", + "type": "String", + "isAttr": true + }, + { + "name": "variable", + "type": "String", + "isAttr": true + }, + { + "name": "expression", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "default", + "type": "String", + "isAttr": true + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "InputParameter", + "superClass": ["InputOutputParameter"] + }, + { + "name": "OutputParameter", + "superClass": ["InputOutputParameter"] + }, + { + "name": "Collectable", + "isAbstract": true, + "extends": ["bpmn:MultiInstanceLoopCharacteristics"], + "superClass": ["flowable:AsyncCapable"], + "properties": [ + { + "name": "collection", + "isAttr": true, + "type": "String" + }, + { + "name": "elementVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FailedJobRetryTimeCycle", + "superClass": ["Element"], + "meta": { + "allowedIn": ["flowable:AsyncCapable", "bpmn:MultiInstanceLoopCharacteristics"] + }, + "properties": [ + { + "name": "body", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "ExecutionListener", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "bpmn:Task", + "bpmn:ServiceTask", + "bpmn:UserTask", + "bpmn:BusinessRuleTask", + "bpmn:ScriptTask", + "bpmn:ReceiveTask", + "bpmn:ManualTask", + "bpmn:ExclusiveGateway", + "bpmn:SequenceFlow", + "bpmn:ParallelGateway", + "bpmn:InclusiveGateway", + "bpmn:EventBasedGateway", + "bpmn:StartEvent", + "bpmn:IntermediateCatchEvent", + "bpmn:IntermediateThrowEvent", + "bpmn:EndEvent", + "bpmn:BoundaryEvent", + "bpmn:CallActivity", + "bpmn:SubProcess", + "bpmn:Process" + ] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "TaskListener", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:UserTask"] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "FormProperty", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:StartEvent", "bpmn:UserTask"] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "required", + "type": "String", + "isAttr": true + }, + { + "name": "readable", + "type": "String", + "isAttr": true + }, + { + "name": "writable", + "type": "String", + "isAttr": true + }, + { + "name": "variable", + "type": "String", + "isAttr": true + }, + { + "name": "expression", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "default", + "type": "String", + "isAttr": true + }, + { + "name": "values", + "type": "Value", + "isMany": true + }, + { + "name": "children", + "type": "ChildField", + "isMany": true + }, + { + "name": "extensionElements", + "type": "bpmn:ExtensionElements", + "isMany": true + } + ] + }, + { + "name": "FormData", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:StartEvent", "bpmn:UserTask"] + }, + "properties": [ + { + "name": "fields", + "type": "FormField", + "isMany": true + }, + { + "name": "businessKey", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "FormField", + "superClass": ["Element"], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "label", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "defaultValue", + "type": "String", + "isAttr": true + }, + { + "name": "properties", + "type": "Properties" + }, + { + "name": "validation", + "type": "Validation" + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "Validation", + "superClass": ["Element"], + "properties": [ + { + "name": "constraints", + "type": "Constraint", + "isMany": true + } + ] + }, + { + "name": "Constraint", + "superClass": ["Element"], + "properties": [ + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "config", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "ConditionalEventDefinition", + "isAbstract": true, + "extends": ["bpmn:ConditionalEventDefinition"], + "properties": [ + { + "name": "variableName", + "isAttr": true, + "type": "String" + }, + { + "name": "variableEvent", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Condition", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:SequenceFlow"] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "field", + "type": "String", + "isAttr": true + }, + { + "name": "compare", + "type": "String", + "isAttr": true + }, + { + "name": "value", + "type": "String", + "isAttr": true + }, + { + "name": "logic", + "type": "String", + "isAttr": true + }, + { + "name": "sort", + "type": "Integer", + "isAttr": true + } + ] + } + ], + "emumerations": [] +} diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/activiti/activitiExtension.js b/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/activiti/activitiExtension.js new file mode 100644 index 0000000..56ef38a --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/activiti/activitiExtension.js @@ -0,0 +1,83 @@ +'use strict' + +import { some } from 'min-dash' + +// const some = require('min-dash').some +// const some = some + +const ALLOWED_TYPES = { + FailedJobRetryTimeCycle: [ + 'bpmn:StartEvent', + 'bpmn:BoundaryEvent', + 'bpmn:IntermediateCatchEvent', + 'bpmn:Activity' + ], + Connector: ['bpmn:EndEvent', 'bpmn:IntermediateThrowEvent'], + Field: ['bpmn:EndEvent', 'bpmn:IntermediateThrowEvent'] +} + +function is(element, type) { + return element && typeof element.$instanceOf === 'function' && element.$instanceOf(type) +} + +function exists(element) { + return element && element.length +} + +function includesType(collection, type) { + return ( + exists(collection) && + some(collection, function (element) { + return is(element, type) + }) + ) +} + +function anyType(element, types) { + return some(types, function (type) { + return is(element, type) + }) +} + +function isAllowed(propName, propDescriptor, newElement) { + const name = propDescriptor.name, + types = ALLOWED_TYPES[name.replace(/activiti:/, '')] + + return name === propName && anyType(newElement, types) +} + +function ActivitiModdleExtension(eventBus) { + eventBus.on( + 'property.clone', + function (context) { + const newElement = context.newElement, + propDescriptor = context.propertyDescriptor + + this.canCloneProperty(newElement, propDescriptor) + }, + this + ) +} + +ActivitiModdleExtension.$inject = ['eventBus'] + +ActivitiModdleExtension.prototype.canCloneProperty = function (newElement, propDescriptor) { + if (isAllowed('activiti:FailedJobRetryTimeCycle', propDescriptor, newElement)) { + return ( + includesType(newElement.eventDefinitions, 'bpmn:TimerEventDefinition') || + includesType(newElement.eventDefinitions, 'bpmn:SignalEventDefinition') || + is(newElement.loopCharacteristics, 'bpmn:MultiInstanceLoopCharacteristics') + ) + } + + if (isAllowed('activiti:Connector', propDescriptor, newElement)) { + return includesType(newElement.eventDefinitions, 'bpmn:MessageEventDefinition') + } + + if (isAllowed('activiti:Field', propDescriptor, newElement)) { + return includesType(newElement.eventDefinitions, 'bpmn:MessageEventDefinition') + } +} + +// module.exports = ActivitiModdleExtension; +export default ActivitiModdleExtension diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/activiti/index.js b/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/activiti/index.js new file mode 100644 index 0000000..c22ca34 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/activiti/index.js @@ -0,0 +1,11 @@ +/* + * @author igdianov + * address https://github.com/igdianov/activiti-bpmn-moddle + * */ + +import activitiExtension from './activitiExtension' + +export default { + __init__: ['ActivitiModdleExtension'], + ActivitiModdleExtension: ['type', activitiExtension] +} diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/camunda/extension.js b/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/camunda/extension.js new file mode 100644 index 0000000..b8c37a5 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/camunda/extension.js @@ -0,0 +1,151 @@ +'use strict' + +import { isFunction, isObject, some } from 'min-dash' + +// const isFunction = isFunction, +// isObject = isObject, +// some = some +// const isFunction = require('min-dash').isFunction, +// isObject = require('min-dash').isObject, +// some = require('min-dash').some + +const WILDCARD = '*' + +function CamundaModdleExtension(eventBus) { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const self = this + + eventBus.on('moddleCopy.canCopyProperty', function (context) { + const property = context.property, + parent = context.parent + + return self.canCopyProperty(property, parent) + }) +} + +CamundaModdleExtension.$inject = ['eventBus'] + +/** + * Check wether to disallow copying property. + */ +CamundaModdleExtension.prototype.canCopyProperty = function (property, parent) { + // (1) check wether property is allowed in parent + if (isObject(property) && !isAllowedInParent(property, parent)) { + return false + } + + // (2) check more complex scenarios + + if (is(property, 'camunda:InputOutput') && !this.canHostInputOutput(parent)) { + return false + } + + if (isAny(property, ['camunda:Connector', 'camunda:Field']) && !this.canHostConnector(parent)) { + return false + } + + if (is(property, 'camunda:In') && !this.canHostIn(parent)) { + return false + } +} + +CamundaModdleExtension.prototype.canHostInputOutput = function (parent) { + // allowed in camunda:Connector + const connector = getParent(parent, 'camunda:Connector') + + if (connector) { + return true + } + + // special rules inside bpmn:FlowNode + const flowNode = getParent(parent, 'bpmn:FlowNode') + + if (!flowNode) { + return false + } + + if (isAny(flowNode, ['bpmn:StartEvent', 'bpmn:Gateway', 'bpmn:BoundaryEvent'])) { + return false + } + + return !(is(flowNode, 'bpmn:SubProcess') && flowNode.get('triggeredByEvent')) +} + +CamundaModdleExtension.prototype.canHostConnector = function (parent) { + const serviceTaskLike = getParent(parent, 'camunda:ServiceTaskLike') + + if (is(serviceTaskLike, 'bpmn:MessageEventDefinition')) { + // only allow on throw and end events + return getParent(parent, 'bpmn:IntermediateThrowEvent') || getParent(parent, 'bpmn:EndEvent') + } + + return true +} + +CamundaModdleExtension.prototype.canHostIn = function (parent) { + const callActivity = getParent(parent, 'bpmn:CallActivity') + + if (callActivity) { + return true + } + + const signalEventDefinition = getParent(parent, 'bpmn:SignalEventDefinition') + + if (signalEventDefinition) { + // only allow on throw and end events + return getParent(parent, 'bpmn:IntermediateThrowEvent') || getParent(parent, 'bpmn:EndEvent') + } + + return true +} + +// module.exports = CamundaModdleExtension; +export default CamundaModdleExtension + +// helpers ////////// + +function is(element, type) { + return element && isFunction(element.$instanceOf) && element.$instanceOf(type) +} + +function isAny(element, types) { + return some(types, function (t) { + return is(element, t) + }) +} + +function getParent(element, type) { + if (!type) { + return element.$parent + } + + if (is(element, type)) { + return element + } + + if (!element.$parent) { + return + } + + return getParent(element.$parent, type) +} + +function isAllowedInParent(property, parent) { + // (1) find property descriptor + const descriptor = property.$type && property.$model.getTypeDescriptor(property.$type) + + const allowedIn = descriptor && descriptor.meta && descriptor.meta.allowedIn + + if (!allowedIn || isWildcard(allowedIn)) { + return true + } + + // (2) check wether property has parent of allowed type + return some(allowedIn, function (type) { + return getParent(parent, type) + }) +} + +function isWildcard(allowedIn) { + return allowedIn.indexOf(WILDCARD) !== -1 +} diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/camunda/index.js b/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/camunda/index.js new file mode 100644 index 0000000..1da1bc7 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/camunda/index.js @@ -0,0 +1,8 @@ +'use strict' + +import extension from './extension' + +export default { + __init__: ['camundaModdleExtension'], + camundaModdleExtension: ['type', extension] +} diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/flowable/flowableExtension.js b/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/flowable/flowableExtension.js new file mode 100644 index 0000000..3dcea67 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/flowable/flowableExtension.js @@ -0,0 +1,83 @@ +'use strict' + +import { some } from 'min-dash' + +// const some = some +// const some = require('min-dash').some + +const ALLOWED_TYPES = { + FailedJobRetryTimeCycle: [ + 'bpmn:StartEvent', + 'bpmn:BoundaryEvent', + 'bpmn:IntermediateCatchEvent', + 'bpmn:Activity' + ], + Connector: ['bpmn:EndEvent', 'bpmn:IntermediateThrowEvent'], + Field: ['bpmn:EndEvent', 'bpmn:IntermediateThrowEvent'] +} + +function is(element, type) { + return element && typeof element.$instanceOf === 'function' && element.$instanceOf(type) +} + +function exists(element) { + return element && element.length +} + +function includesType(collection, type) { + return ( + exists(collection) && + some(collection, function (element) { + return is(element, type) + }) + ) +} + +function anyType(element, types) { + return some(types, function (type) { + return is(element, type) + }) +} + +function isAllowed(propName, propDescriptor, newElement) { + const name = propDescriptor.name, + types = ALLOWED_TYPES[name.replace(/flowable:/, '')] + + return name === propName && anyType(newElement, types) +} + +function FlowableModdleExtension(eventBus) { + eventBus.on( + 'property.clone', + function (context) { + const newElement = context.newElement, + propDescriptor = context.propertyDescriptor + + this.canCloneProperty(newElement, propDescriptor) + }, + this + ) +} + +FlowableModdleExtension.$inject = ['eventBus'] + +FlowableModdleExtension.prototype.canCloneProperty = function (newElement, propDescriptor) { + if (isAllowed('flowable:FailedJobRetryTimeCycle', propDescriptor, newElement)) { + return ( + includesType(newElement.eventDefinitions, 'bpmn:TimerEventDefinition') || + includesType(newElement.eventDefinitions, 'bpmn:SignalEventDefinition') || + is(newElement.loopCharacteristics, 'bpmn:MultiInstanceLoopCharacteristics') + ) + } + + if (isAllowed('flowable:Connector', propDescriptor, newElement)) { + return includesType(newElement.eventDefinitions, 'bpmn:MessageEventDefinition') + } + + if (isAllowed('flowable:Field', propDescriptor, newElement)) { + return includesType(newElement.eventDefinitions, 'bpmn:MessageEventDefinition') + } +} + +// module.exports = FlowableModdleExtension; +export default FlowableModdleExtension diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/flowable/index.js b/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/flowable/index.js new file mode 100644 index 0000000..6d59b67 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/flowable/index.js @@ -0,0 +1,10 @@ +/* + * @author igdianov + * address https://github.com/igdianov/activiti-bpmn-moddle + * */ +import flowableExtension from './flowableExtension' + +export default { + __init__: ['FlowableModdleExtension'], + FlowableModdleExtension: ['type', flowableExtension] +} diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/palette/CustomPalette.js b/src/components/bpmnProcessDesigner/package/designer/plugins/palette/CustomPalette.js new file mode 100644 index 0000000..5e2803b --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/palette/CustomPalette.js @@ -0,0 +1,221 @@ +import PaletteProvider from 'bpmn-js/lib/features/palette/PaletteProvider' +import { assign } from 'min-dash' + +export default function CustomPalette( + palette, + create, + elementFactory, + spaceTool, + lassoTool, + handTool, + globalConnect, + translate +) { + PaletteProvider.call( + this, + palette, + create, + elementFactory, + spaceTool, + lassoTool, + handTool, + globalConnect, + translate, + 2000 + ) +} + +const F = function () {} // 核心,利用空对象作为中介; +F.prototype = PaletteProvider.prototype // 核心,将父类的原型赋值给空对象F; + +// 利用中介函数重写原型链方法 +F.prototype.getPaletteEntries = function () { + const actions = {}, + create = this._create, + elementFactory = this._elementFactory, + spaceTool = this._spaceTool, + lassoTool = this._lassoTool, + handTool = this._handTool, + globalConnect = this._globalConnect, + translate = this._translate + + function createAction(type, group, className, title, options) { + function createListener(event) { + const shape = elementFactory.createShape(assign({ type: type }, options)) + + if (options) { + shape.businessObject.di.isExpanded = options.isExpanded + } + + create.start(event, shape) + } + + const shortType = type.replace(/^bpmn:/, '') + + return { + group: group, + className: className, + title: title || translate('Create {type}', { type: shortType }), + action: { + dragstart: createListener, + click: createListener + } + } + } + + function createSubprocess(event) { + const subProcess = elementFactory.createShape({ + type: 'bpmn:SubProcess', + x: 0, + y: 0, + isExpanded: true + }) + + const startEvent = elementFactory.createShape({ + type: 'bpmn:StartEvent', + x: 40, + y: 82, + parent: subProcess + }) + + create.start(event, [subProcess, startEvent], { + hints: { + autoSelect: [startEvent] + } + }) + } + + function createParticipant(event) { + create.start(event, elementFactory.createParticipantShape()) + } + + assign(actions, { + 'hand-tool': { + group: 'tools', + className: 'bpmn-icon-hand-tool', + title: '激活抓手工具', + // title: translate("Activate the hand tool"), + action: { + click: function (event) { + handTool.activateHand(event) + } + } + }, + 'lasso-tool': { + group: 'tools', + className: 'bpmn-icon-lasso-tool', + title: translate('Activate the lasso tool'), + action: { + click: function (event) { + lassoTool.activateSelection(event) + } + } + }, + 'space-tool': { + group: 'tools', + className: 'bpmn-icon-space-tool', + title: translate('Activate the create/remove space tool'), + action: { + click: function (event) { + spaceTool.activateSelection(event) + } + } + }, + 'global-connect-tool': { + group: 'tools', + className: 'bpmn-icon-connection-multi', + title: translate('Activate the global connect tool'), + action: { + click: function (event) { + globalConnect.toggle(event) + } + } + }, + 'tool-separator': { + group: 'tools', + separator: true + }, + 'create.start-event': createAction( + 'bpmn:StartEvent', + 'event', + 'bpmn-icon-start-event-none', + translate('Create StartEvent') + ), + 'create.intermediate-event': createAction( + 'bpmn:IntermediateThrowEvent', + 'event', + 'bpmn-icon-intermediate-event-none', + translate('Create Intermediate/Boundary Event') + ), + 'create.end-event': createAction( + 'bpmn:EndEvent', + 'event', + 'bpmn-icon-end-event-none', + translate('Create EndEvent') + ), + 'create.exclusive-gateway': createAction( + 'bpmn:ExclusiveGateway', + 'gateway', + 'bpmn-icon-gateway-none', + translate('Create Gateway') + ), + 'create.user-task': createAction( + 'bpmn:UserTask', + 'activity', + 'bpmn-icon-user-task', + translate('Create User Task') + ), + 'create.data-object': createAction( + 'bpmn:DataObjectReference', + 'data-object', + 'bpmn-icon-data-object', + translate('Create DataObjectReference') + ), + 'create.data-store': createAction( + 'bpmn:DataStoreReference', + 'data-store', + 'bpmn-icon-data-store', + translate('Create DataStoreReference') + ), + 'create.subprocess-expanded': { + group: 'activity', + className: 'bpmn-icon-subprocess-expanded', + title: translate('Create expanded SubProcess'), + action: { + dragstart: createSubprocess, + click: createSubprocess + } + }, + 'create.participant-expanded': { + group: 'collaboration', + className: 'bpmn-icon-participant', + title: translate('Create Pool/Participant'), + action: { + dragstart: createParticipant, + click: createParticipant + } + }, + 'create.group': createAction( + 'bpmn:Group', + 'artifact', + 'bpmn-icon-group', + translate('Create Group') + ) + }) + + return actions +} + +CustomPalette.$inject = [ + 'palette', + 'create', + 'elementFactory', + 'spaceTool', + 'lassoTool', + 'handTool', + 'globalConnect', + 'translate' +] + +CustomPalette.prototype = new F() // 核心,将 F的实例赋值给子类; +CustomPalette.prototype.constructor = CustomPalette // 修复子类CustomPalette的构造器指向,防止原型链的混乱; diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/palette/index.js b/src/components/bpmnProcessDesigner/package/designer/plugins/palette/index.js new file mode 100644 index 0000000..8e4f3ac --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/palette/index.js @@ -0,0 +1,22 @@ +// import PaletteModule from "diagram-js/lib/features/palette"; +// import CreateModule from "diagram-js/lib/features/create"; +// import SpaceToolModule from "diagram-js/lib/features/space-tool"; +// import LassoToolModule from "diagram-js/lib/features/lasso-tool"; +// import HandToolModule from "diagram-js/lib/features/hand-tool"; +// import GlobalConnectModule from "diagram-js/lib/features/global-connect"; +// import translate from "diagram-js/lib/i18n/translate"; +// +// import PaletteProvider from "./paletteProvider"; +// +// export default { +// __depends__: [PaletteModule, CreateModule, SpaceToolModule, LassoToolModule, HandToolModule, GlobalConnectModule, translate], +// __init__: ["paletteProvider"], +// paletteProvider: ["type", PaletteProvider] +// }; + +import CustomPalette from './CustomPalette' + +export default { + __init__: ['paletteProvider'], + paletteProvider: ['type', CustomPalette] +} diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/palette/paletteProvider.js b/src/components/bpmnProcessDesigner/package/designer/plugins/palette/paletteProvider.js new file mode 100644 index 0000000..7098981 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/palette/paletteProvider.js @@ -0,0 +1,213 @@ +import { assign } from 'min-dash' + +/** + * A palette provider for BPMN 2.0 elements. + */ +export default function PaletteProvider( + palette, + create, + elementFactory, + spaceTool, + lassoTool, + handTool, + globalConnect, + translate +) { + this._palette = palette + this._create = create + this._elementFactory = elementFactory + this._spaceTool = spaceTool + this._lassoTool = lassoTool + this._handTool = handTool + this._globalConnect = globalConnect + this._translate = translate + + palette.registerProvider(this) +} + +PaletteProvider.$inject = [ + 'palette', + 'create', + 'elementFactory', + 'spaceTool', + 'lassoTool', + 'handTool', + 'globalConnect', + 'translate' +] + +PaletteProvider.prototype.getPaletteEntries = function () { + const actions = {}, + create = this._create, + elementFactory = this._elementFactory, + spaceTool = this._spaceTool, + lassoTool = this._lassoTool, + handTool = this._handTool, + globalConnect = this._globalConnect, + translate = this._translate + + function createAction(type, group, className, title, options) { + function createListener(event) { + const shape = elementFactory.createShape(assign({ type: type }, options)) + + if (options) { + shape.businessObject.di.isExpanded = options.isExpanded + } + + create.start(event, shape) + } + + const shortType = type.replace(/^bpmn:/, '') + + return { + group: group, + className: className, + title: title || translate('Create {type}', { type: shortType }), + action: { + dragstart: createListener, + click: createListener + } + } + } + + function createSubprocess(event) { + const subProcess = elementFactory.createShape({ + type: 'bpmn:SubProcess', + x: 0, + y: 0, + isExpanded: true + }) + + const startEvent = elementFactory.createShape({ + type: 'bpmn:StartEvent', + x: 40, + y: 82, + parent: subProcess + }) + + create.start(event, [subProcess, startEvent], { + hints: { + autoSelect: [startEvent] + } + }) + } + + function createParticipant(event) { + create.start(event, elementFactory.createParticipantShape()) + } + + assign(actions, { + 'hand-tool': { + group: 'tools', + className: 'bpmn-icon-hand-tool', + title: translate('Activate the hand tool'), + action: { + click: function (event) { + handTool.activateHand(event) + } + } + }, + 'lasso-tool': { + group: 'tools', + className: 'bpmn-icon-lasso-tool', + title: translate('Activate the lasso tool'), + action: { + click: function (event) { + lassoTool.activateSelection(event) + } + } + }, + 'space-tool': { + group: 'tools', + className: 'bpmn-icon-space-tool', + title: translate('Activate the create/remove space tool'), + action: { + click: function (event) { + spaceTool.activateSelection(event) + } + } + }, + 'global-connect-tool': { + group: 'tools', + className: 'bpmn-icon-connection-multi', + title: translate('Activate the global connect tool'), + action: { + click: function (event) { + globalConnect.toggle(event) + } + } + }, + 'tool-separator': { + group: 'tools', + separator: true + }, + 'create.start-event': createAction( + 'bpmn:StartEvent', + 'event', + 'bpmn-icon-start-event-none', + translate('Create StartEvent') + ), + 'create.intermediate-event': createAction( + 'bpmn:IntermediateThrowEvent', + 'event', + 'bpmn-icon-intermediate-event-none', + translate('Create Intermediate/Boundary Event') + ), + 'create.end-event': createAction( + 'bpmn:EndEvent', + 'event', + 'bpmn-icon-end-event-none', + translate('Create EndEvent') + ), + 'create.exclusive-gateway': createAction( + 'bpmn:ExclusiveGateway', + 'gateway', + 'bpmn-icon-gateway-none', + translate('Create Gateway') + ), + 'create.user-task': createAction( + 'bpmn:UserTask', + 'activity', + 'bpmn-icon-user-task', + translate('Create User Task') + ), + 'create.data-object': createAction( + 'bpmn:DataObjectReference', + 'data-object', + 'bpmn-icon-data-object', + translate('Create DataObjectReference') + ), + 'create.data-store': createAction( + 'bpmn:DataStoreReference', + 'data-store', + 'bpmn-icon-data-store', + translate('Create DataStoreReference') + ), + 'create.subprocess-expanded': { + group: 'activity', + className: 'bpmn-icon-subprocess-expanded', + title: translate('Create expanded SubProcess'), + action: { + dragstart: createSubprocess, + click: createSubprocess + } + }, + 'create.participant-expanded': { + group: 'collaboration', + className: 'bpmn-icon-participant', + title: translate('Create Pool/Participant'), + action: { + dragstart: createParticipant, + click: createParticipant + } + }, + 'create.group': createAction( + 'bpmn:Group', + 'artifact', + 'bpmn-icon-group', + translate('Create Group') + ) + }) + + return actions +} diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/translate/customTranslate.js b/src/components/bpmnProcessDesigner/package/designer/plugins/translate/customTranslate.js new file mode 100644 index 0000000..c1b99e1 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/translate/customTranslate.js @@ -0,0 +1,44 @@ +// import translations from "./zh"; +// +// export default function customTranslate(template, replacements) { +// replacements = replacements || {}; +// +// // Translate +// template = translations[template] || template; +// +// // Replace +// return template.replace(/{([^}]+)}/g, function(_, key) { +// let str = replacements[key]; +// if ( +// translations[replacements[key]] !== null && +// translations[replacements[key]] !== "undefined" +// ) { +// // eslint-disable-next-line no-mixed-spaces-and-tabs +// str = translations[replacements[key]]; +// // eslint-disable-next-line no-mixed-spaces-and-tabs +// } +// return str || "{" + key + "}"; +// }); +// } + +export default function customTranslate(translations) { + return function (template, replacements) { + replacements = replacements || {} + // Translate + template = translations[template] || template + + // Replace + return template.replace(/{([^}]+)}/g, function (_, key) { + let str = replacements[key] + if ( + translations[replacements[key]] !== null && + translations[replacements[key]] !== undefined + ) { + // eslint-disable-next-line no-mixed-spaces-and-tabs + str = translations[replacements[key]] + // eslint-disable-next-line no-mixed-spaces-and-tabs + } + return str || '{' + key + '}' + }) + } +} diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/translate/zh.js b/src/components/bpmnProcessDesigner/package/designer/plugins/translate/zh.js new file mode 100644 index 0000000..777db3e --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/translate/zh.js @@ -0,0 +1,240 @@ +/** + * This is a sample file that should be replaced with the actual translation. + * + * Checkout https://github.com/bpmn-io/bpmn-js-i18n for a list of available + * translations and labels to translate. + */ +export default { + // 添加部分 + 'Append EndEvent': '追加结束事件', + 'Append Gateway': '追加网关', + 'Append Task': '追加任务', + 'Append Intermediate/Boundary Event': '追加中间抛出事件/边界事件', + + 'Activate the global connect tool': '激活全局连接工具', + 'Append {type}': '添加 {type}', + 'Add Lane above': '在上面添加道', + 'Divide into two Lanes': '分割成两个道', + 'Divide into three Lanes': '分割成三个道', + 'Add Lane below': '在下面添加道', + 'Append compensation activity': '追加补偿活动', + 'Change type': '修改类型', + 'Connect using Association': '使用关联连接', + 'Connect using Sequence/MessageFlow or Association': '使用顺序/消息流或者关联连接', + 'Connect using DataInputAssociation': '使用数据输入关联连接', + Remove: '移除', + 'Activate the hand tool': '激活抓手工具', + 'Activate the lasso tool': '激活套索工具', + 'Activate the create/remove space tool': '激活创建/删除空间工具', + 'Create expanded SubProcess': '创建扩展子过程', + 'Create IntermediateThrowEvent/BoundaryEvent': '创建中间抛出事件/边界事件', + 'Create Pool/Participant': '创建池/参与者', + 'Parallel Multi Instance': '并行多重事件', + 'Sequential Multi Instance': '时序多重事件', + DataObjectReference: '数据对象参考', + DataStoreReference: '数据存储参考', + Loop: '循环', + 'Ad-hoc': '即席', + 'Create {type}': '创建 {type}', + Task: '任务', + 'Send Task': '发送任务', + 'Receive Task': '接收任务', + 'User Task': '用户任务', + 'Manual Task': '手工任务', + 'Business Rule Task': '业务规则任务', + 'Service Task': '服务任务', + 'Script Task': '脚本任务', + 'Call Activity': '调用活动', + 'Sub Process (collapsed)': '子流程(折叠的)', + 'Sub Process (expanded)': '子流程(展开的)', + 'Start Event': '开始事件', + StartEvent: '开始事件', + 'Intermediate Throw Event': '中间事件', + 'End Event': '结束事件', + EndEvent: '结束事件', + 'Create StartEvent': '创建开始事件', + 'Create EndEvent': '创建结束事件', + 'Create Task': '创建任务', + 'Create User Task': '创建用户任务', + 'Create Gateway': '创建网关', + 'Create DataObjectReference': '创建数据对象', + 'Create DataStoreReference': '创建数据存储', + 'Create Group': '创建分组', + 'Create Intermediate/Boundary Event': '创建中间/边界事件', + 'Message Start Event': '消息开始事件', + 'Timer Start Event': '定时开始事件', + 'Conditional Start Event': '条件开始事件', + 'Signal Start Event': '信号开始事件', + 'Error Start Event': '错误开始事件', + 'Escalation Start Event': '升级开始事件', + 'Compensation Start Event': '补偿开始事件', + 'Message Start Event (non-interrupting)': '消息开始事件(非中断)', + 'Timer Start Event (non-interrupting)': '定时开始事件(非中断)', + 'Conditional Start Event (non-interrupting)': '条件开始事件(非中断)', + 'Signal Start Event (non-interrupting)': '信号开始事件(非中断)', + 'Escalation Start Event (non-interrupting)': '升级开始事件(非中断)', + 'Message Intermediate Catch Event': '消息中间捕获事件', + 'Message Intermediate Throw Event': '消息中间抛出事件', + 'Timer Intermediate Catch Event': '定时中间捕获事件', + 'Escalation Intermediate Throw Event': '升级中间抛出事件', + 'Conditional Intermediate Catch Event': '条件中间捕获事件', + 'Link Intermediate Catch Event': '链接中间捕获事件', + 'Link Intermediate Throw Event': '链接中间抛出事件', + 'Compensation Intermediate Throw Event': '补偿中间抛出事件', + 'Signal Intermediate Catch Event': '信号中间捕获事件', + 'Signal Intermediate Throw Event': '信号中间抛出事件', + 'Message End Event': '消息结束事件', + 'Escalation End Event': '定时结束事件', + 'Error End Event': '错误结束事件', + 'Cancel End Event': '取消结束事件', + 'Compensation End Event': '补偿结束事件', + 'Signal End Event': '信号结束事件', + 'Terminate End Event': '终止结束事件', + 'Message Boundary Event': '消息边界事件', + 'Message Boundary Event (non-interrupting)': '消息边界事件(非中断)', + 'Timer Boundary Event': '定时边界事件', + 'Timer Boundary Event (non-interrupting)': '定时边界事件(非中断)', + 'Escalation Boundary Event': '升级边界事件', + 'Escalation Boundary Event (non-interrupting)': '升级边界事件(非中断)', + 'Conditional Boundary Event': '条件边界事件', + 'Conditional Boundary Event (non-interrupting)': '条件边界事件(非中断)', + 'Error Boundary Event': '错误边界事件', + 'Cancel Boundary Event': '取消边界事件', + 'Signal Boundary Event': '信号边界事件', + 'Signal Boundary Event (non-interrupting)': '信号边界事件(非中断)', + 'Compensation Boundary Event': '补偿边界事件', + 'Exclusive Gateway': '互斥网关', + 'Parallel Gateway': '并行网关', + 'Inclusive Gateway': '相容网关', + 'Complex Gateway': '复杂网关', + 'Event based Gateway': '事件网关', + Transaction: '转运', + 'Sub Process': '子流程', + 'Event Sub Process': '事件子流程', + 'Collapsed Pool': '折叠池', + 'Expanded Pool': '展开池', + + // Errors + 'no parent for {element} in {parent}': '在{parent}里,{element}没有父类', + 'no shape type specified': '没有指定的形状类型', + 'flow elements must be children of pools/participants': '流元素必须是池/参与者的子类', + 'out of bounds release': 'out of bounds release', + 'more than {count} child lanes': '子道大于{count} ', + 'element required': '元素不能为空', + 'diagram not part of bpmn:Definitions': '流程图不符合bpmn规范', + 'no diagram to display': '没有可展示的流程图', + 'no process or collaboration to display': '没有可展示的流程/协作', + 'element {element} referenced by {referenced}#{property} not yet drawn': + '由{referenced}#{property}引用的{element}元素仍未绘制', + 'already rendered {element}': '{element} 已被渲染', + 'failed to import {element}': '导入{element}失败', + //属性面板的参数 + Id: '编号', + Name: '名称', + General: '常规', + Details: '详情', + 'Message Name': '消息名称', + Message: '消息', + Initiator: '创建者', + 'Asynchronous Continuations': '持续异步', + 'Asynchronous Before': '异步前', + 'Asynchronous After': '异步后', + 'Job Configuration': '工作配置', + Exclusive: '排除', + 'Job Priority': '工作优先级', + 'Retry Time Cycle': '重试时间周期', + Documentation: '文档', + 'Element Documentation': '元素文档', + 'History Configuration': '历史配置', + 'History Time To Live': '历史的生存时间', + Forms: '表单', + 'Form Key': '表单key', + 'Form Fields': '表单字段', + 'Business Key': '业务key', + 'Form Field': '表单字段', + ID: '编号', + Type: '类型', + Label: '名称', + 'Default Value': '默认值', + 'Default Flow': '默认流转路径', + 'Conditional Flow': '条件流转路径', + 'Sequence Flow': '普通流转路径', + Validation: '校验', + 'Add Constraint': '添加约束', + Config: '配置', + Properties: '属性', + 'Add Property': '添加属性', + Value: '值', + Listeners: '监听器', + 'Execution Listener': '执行监听', + 'Event Type': '事件类型', + 'Listener Type': '监听器类型', + 'Java Class': 'Java类', + Expression: '表达式', + 'Must provide a value': '必须提供一个值', + 'Delegate Expression': '代理表达式', + Script: '脚本', + 'Script Format': '脚本格式', + 'Script Type': '脚本类型', + 'Inline Script': '内联脚本', + 'External Script': '外部脚本', + Resource: '资源', + 'Field Injection': '字段注入', + Extensions: '扩展', + 'Input/Output': '输入/输出', + 'Input Parameters': '输入参数', + 'Output Parameters': '输出参数', + Parameters: '参数', + 'Output Parameter': '输出参数', + 'Timer Definition Type': '定时器定义类型', + 'Timer Definition': '定时器定义', + Date: '日期', + Duration: '持续', + Cycle: '循环', + Signal: '信号', + 'Signal Name': '信号名称', + Escalation: '升级', + Error: '错误', + 'Link Name': '链接名称', + Condition: '条件名称', + 'Variable Name': '变量名称', + 'Variable Event': '变量事件', + 'Specify more than one variable change event as a comma separated list.': + '多个变量事件以逗号隔开', + 'Wait for Completion': '等待完成', + 'Activity Ref': '活动参考', + 'Version Tag': '版本标签', + Executable: '可执行文件', + 'External Task Configuration': '扩展任务配置', + 'Task Priority': '任务优先级', + External: '外部', + Connector: '连接器', + 'Must configure Connector': '必须配置连接器', + 'Connector Id': '连接器编号', + Implementation: '实现方式', + 'Field Injections': '字段注入', + Fields: '字段', + 'Result Variable': '结果变量', + Topic: '主题', + 'Configure Connector': '配置连接器', + 'Input Parameter': '输入参数', + Assignee: '代理人', + 'Candidate Users': '候选用户', + 'Candidate Groups': '候选组', + 'Due Date': '到期时间', + 'Follow Up Date': '跟踪日期', + Priority: '优先级', + 'The follow up date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)': + '跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00', + 'The due date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)': + '跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00', + Variables: '变量', + 'Candidate Starter Configuration': '候选人起动器配置', + 'Candidate Starter Groups': '候选人起动器组', + 'This maps to the process definition key.': '这映射到流程定义键。', + 'Candidate Starter Users': '候选人起动器的用户', + 'Specify more than one user as a comma separated list.': '指定多个用户作为逗号分隔的列表。', + 'Tasklist Configuration': 'Tasklist配置', + Startable: '启动', + 'Specify more than one group as a comma separated list.': '指定多个组作为逗号分隔的列表。' +} diff --git a/src/components/bpmnProcessDesigner/package/index.ts b/src/components/bpmnProcessDesigner/package/index.ts new file mode 100644 index 0000000..ce44a3c --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/index.ts @@ -0,0 +1,11 @@ +import MyProcessDesigner from './designer' +import MyProcessPenal from './penal' +import MyProcessViewer from './designer/index2' + +import './theme/index.scss' +import 'bpmn-js/dist/assets/diagram-js.css' +import 'bpmn-js/dist/assets/bpmn-font/css/bpmn.css' +import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css' +import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css' + +export { MyProcessDesigner, MyProcessPenal, MyProcessViewer } diff --git a/src/components/bpmnProcessDesigner/package/palette/ProcessPalette.vue b/src/components/bpmnProcessDesigner/package/palette/ProcessPalette.vue new file mode 100644 index 0000000..ba97d96 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/palette/ProcessPalette.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue b/src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue new file mode 100644 index 0000000..377592f --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue @@ -0,0 +1,211 @@ + + diff --git a/src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue b/src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue new file mode 100644 index 0000000..639c1cb --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue @@ -0,0 +1,184 @@ + + diff --git a/src/components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue b/src/components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue new file mode 100644 index 0000000..345670a --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue @@ -0,0 +1,191 @@ + + + diff --git a/src/components/bpmnProcessDesigner/package/penal/form/ElementForm.vue b/src/components/bpmnProcessDesigner/package/penal/form/ElementForm.vue new file mode 100644 index 0000000..da1d1ae --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/penal/form/ElementForm.vue @@ -0,0 +1,465 @@ + + + diff --git a/src/components/bpmnProcessDesigner/package/penal/index.js b/src/components/bpmnProcessDesigner/package/penal/index.js new file mode 100644 index 0000000..7fa5617 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/penal/index.js @@ -0,0 +1,7 @@ +import MyPropertiesPanel from './PropertiesPanel.vue' + +MyPropertiesPanel.install = function (Vue) { + Vue.component(MyPropertiesPanel.name, MyPropertiesPanel) +} + +export default MyPropertiesPanel diff --git a/src/components/bpmnProcessDesigner/package/penal/listeners/ElementListeners.vue b/src/components/bpmnProcessDesigner/package/penal/listeners/ElementListeners.vue new file mode 100644 index 0000000..45ee8f9 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/penal/listeners/ElementListeners.vue @@ -0,0 +1,403 @@ + + diff --git a/src/components/bpmnProcessDesigner/package/penal/listeners/UserTaskListeners.vue b/src/components/bpmnProcessDesigner/package/penal/listeners/UserTaskListeners.vue new file mode 100644 index 0000000..9464883 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/penal/listeners/UserTaskListeners.vue @@ -0,0 +1,451 @@ + + diff --git a/src/components/bpmnProcessDesigner/package/penal/listeners/template.js b/src/components/bpmnProcessDesigner/package/penal/listeners/template.js new file mode 100644 index 0000000..430dc64 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/penal/listeners/template.js @@ -0,0 +1,178 @@ +export const template = (isTaskListener) => { + return ` +
+ + + + + + + + +
+ 添加监听器 +
+ + + + + + + + + + + + + + + + + + + + + + + + + + ${ + isTaskListener + ? "" + + "" + + "" + + "" + + "" + + "" + + '' + + '' + + "" + + "" + + '' + : '' + } + + +

+ 注入字段: + 添加字段 +

+ + + + + + + + + + +
+ 取 消 + 保 存 +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ ` +} diff --git a/src/components/bpmnProcessDesigner/package/penal/listeners/utilSelf.ts b/src/components/bpmnProcessDesigner/package/penal/listeners/utilSelf.ts new file mode 100644 index 0000000..5f46abd --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/penal/listeners/utilSelf.ts @@ -0,0 +1,62 @@ +// 初始化表单数据 +export function initListenerForm(listener) { + let self = { + ...listener + } + if (listener.script) { + self = { + ...listener, + ...listener.script, + scriptType: listener.script.resource ? 'externalScript' : 'inlineScript' + } + } + if (listener.event === 'timeout' && listener.eventDefinitions) { + if (listener.eventDefinitions.length) { + let k = '' + for (const key in listener.eventDefinitions[0]) { + console.log(listener.eventDefinitions, key) + if (key.indexOf('time') !== -1) { + k = key + self.eventDefinitionType = key.replace('time', '').toLowerCase() + } + } + console.log(k) + self.eventTimeDefinitions = listener.eventDefinitions[0][k].body + } + } + return self +} + +export function initListenerType(listener) { + let listenerType + if (listener.class) listenerType = 'classListener' + if (listener.expression) listenerType = 'expressionListener' + if (listener.delegateExpression) listenerType = 'delegateExpressionListener' + if (listener.script) listenerType = 'scriptListener' + return { + ...JSON.parse(JSON.stringify(listener)), + ...(listener.script ?? {}), + listenerType: listenerType + } +} + +export const listenerType = { + classListener: 'Java 类', + expressionListener: '表达式', + delegateExpressionListener: '代理表达式', + scriptListener: '脚本' +} + +export const eventType = { + create: '创建', + assignment: '指派', + complete: '完成', + delete: '删除', + update: '更新', + timeout: '超时' +} + +export const fieldType = { + string: '字符串', + expression: '表达式' +} diff --git a/src/components/bpmnProcessDesigner/package/penal/multi-instance/ElementMultiInstance.vue b/src/components/bpmnProcessDesigner/package/penal/multi-instance/ElementMultiInstance.vue new file mode 100644 index 0000000..28db5aa --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/penal/multi-instance/ElementMultiInstance.vue @@ -0,0 +1,254 @@ + + + diff --git a/src/components/bpmnProcessDesigner/package/penal/other/ElementOtherConfig.vue b/src/components/bpmnProcessDesigner/package/penal/other/ElementOtherConfig.vue new file mode 100644 index 0000000..05532c6 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/penal/other/ElementOtherConfig.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/components/bpmnProcessDesigner/package/penal/properties/ElementProperties.vue b/src/components/bpmnProcessDesigner/package/penal/properties/ElementProperties.vue new file mode 100644 index 0000000..494b3d9 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/penal/properties/ElementProperties.vue @@ -0,0 +1,169 @@ + + + diff --git a/src/components/bpmnProcessDesigner/package/penal/signal-message/SignalAndMessage.vue b/src/components/bpmnProcessDesigner/package/penal/signal-message/SignalAndMessage.vue new file mode 100644 index 0000000..f38f31c --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/penal/signal-message/SignalAndMessage.vue @@ -0,0 +1,113 @@ + + diff --git a/src/components/bpmnProcessDesigner/package/penal/task/ElementTask.vue b/src/components/bpmnProcessDesigner/package/penal/task/ElementTask.vue new file mode 100644 index 0000000..33a12a7 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/penal/task/ElementTask.vue @@ -0,0 +1,86 @@ + + + diff --git a/src/components/bpmnProcessDesigner/package/penal/task/task-components/ReceiveTask.vue b/src/components/bpmnProcessDesigner/package/penal/task/task-components/ReceiveTask.vue new file mode 100644 index 0000000..83ed24e --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/penal/task/task-components/ReceiveTask.vue @@ -0,0 +1,125 @@ + + + diff --git a/src/components/bpmnProcessDesigner/package/penal/task/task-components/ScriptTask.vue b/src/components/bpmnProcessDesigner/package/penal/task/task-components/ScriptTask.vue new file mode 100644 index 0000000..683fef3 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/penal/task/task-components/ScriptTask.vue @@ -0,0 +1,99 @@ + + + diff --git a/src/components/bpmnProcessDesigner/package/penal/task/task-components/UserTask.vue b/src/components/bpmnProcessDesigner/package/penal/task/task-components/UserTask.vue new file mode 100644 index 0000000..7b793db --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/penal/task/task-components/UserTask.vue @@ -0,0 +1,98 @@ + + + diff --git a/src/components/bpmnProcessDesigner/package/theme/element-variables.scss b/src/components/bpmnProcessDesigner/package/theme/element-variables.scss new file mode 100644 index 0000000..49bd326 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/theme/element-variables.scss @@ -0,0 +1,70 @@ +/* 改变主题色变量 */ +$--color-primary: #1890ff; +$--color-danger: #ff4d4f; + +/* 改变 icon 字体路径变量,必需 */ +$--font-path: '~element-ui/lib/theme-chalk/fonts'; + +@import '~element-ui/packages/theme-chalk/src/index'; + +.el-table td, +.el-table th { + color: #333; +} +.el-drawer__header { + padding: 16px 16px 8px 16px; + margin: 0; + line-height: 24px; + font-size: 18px; + color: #303133; + box-sizing: border-box; + border-bottom: 1px solid #e8e8e8; +} +div[class^='el-drawer']:focus, +span:focus { + outline: none; +} +.el-drawer__body { + box-sizing: border-box; + padding: 16px; + width: 100%; + overflow-y: auto; +} + +.el-dialog { + margin-top: 50vh !important; + transform: translateY(-50%); + overflow: hidden; +} +.el-dialog__wrapper { + overflow: hidden; + max-height: 100vh; +} +.el-dialog__header { + padding: 16px 16px 8px 16px; + box-sizing: border-box; + border-bottom: 1px solid #e8e8e8; +} +.el-dialog__body { + padding: 16px; + max-height: 80vh; + box-sizing: border-box; + overflow-y: auto; +} +.el-dialog__footer { + padding: 16px; + box-sizing: border-box; + border-top: 1px solid #e8e8e8; +} +.el-dialog__close { + font-weight: 600; +} +.el-select { + width: 100%; +} +.el-divider:not(.el-divider--horizontal) { + margin: 0 8px; +} +.el-divider.el-divider--horizontal { + margin: 16px 0; +} diff --git a/src/components/bpmnProcessDesigner/package/theme/index.scss b/src/components/bpmnProcessDesigner/package/theme/index.scss new file mode 100644 index 0000000..2e60fad --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/theme/index.scss @@ -0,0 +1,2 @@ +@import './process-designer.scss'; +@import './process-panel.scss'; diff --git a/src/components/bpmnProcessDesigner/package/theme/process-designer.scss b/src/components/bpmnProcessDesigner/package/theme/process-designer.scss new file mode 100644 index 0000000..6af945d --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/theme/process-designer.scss @@ -0,0 +1,161 @@ +@import 'bpmn-js-token-simulation/assets/css/bpmn-js-token-simulation.css'; +@import 'bpmn-js-token-simulation/assets/css/font-awesome.min.css'; +@import 'bpmn-js-token-simulation/assets/css/normalize.css'; + +// 边框被 token-simulation 样式覆盖了 +.djs-palette { + background: var(--palette-background-color); + border: solid 1px var(--palette-border-color) !important; + border-radius: 2px; +} + +.my-process-designer { + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + box-sizing: border-box; + .my-process-designer__header { + width: 100%; + min-height: 36px; + .el-button { + text-align: center; + } + .el-button-group { + margin: 4px; + } + .el-tooltip__popper { + .el-button { + width: 100%; + text-align: left; + padding-left: 8px; + padding-right: 8px; + } + .el-button:hover { + background: rgba(64, 158, 255, 0.8); + color: #ffffff; + } + } + .align { + position: relative; + i { + &:after { + content: '|'; + position: absolute; + // transform: rotate(90deg) translate(200%, 60%); + transform: rotate(180deg) translate(271%, -10%); + } + } + } + .align.align-left i { + transform: rotate(90deg); + } + .align.align-right i { + transform: rotate(-90deg); + } + .align.align-top i { + transform: rotate(180deg); + } + .align.align-bottom i { + transform: rotate(0deg); + } + .align.align-center i { + transform: rotate(0deg); + &:after { + // transform: rotate(90deg) translate(0, 60%); + transform: rotate(0deg) translate(-0%, -5%); + } + } + .align.align-middle i { + transform: rotate(-90deg); + &:after { + // transform: rotate(90deg) translate(0, 60%); + transform: rotate(0deg) translate(0, -10%); + } + } + } + .my-process-designer__container { + display: inline-flex; + width: 100%; + flex: 1; + .my-process-designer__canvas { + flex: 1; + height: 100%; + position: relative; + background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImEiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTTAgMTBoNDBNMTAgMHY0ME0wIDIwaDQwTTIwIDB2NDBNMCAzMGg0ME0zMCAwdjQwIiBmaWxsPSJub25lIiBzdHJva2U9IiNlMGUwZTAiIG9wYWNpdHk9Ii4yIi8+PHBhdGggZD0iTTQwIDBIMHY0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIi8+PC9wYXR0ZXJuPjwvZGVmcz48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2EpIi8+PC9zdmc+') + repeat !important; + div.toggle-mode { + display: none; + } + } + .my-process-designer__property-panel { + height: 100%; + overflow: scroll; + overflow-y: auto; + z-index: 10; + * { + box-sizing: border-box; + } + } + svg { + width: 100%; + height: 100%; + min-height: 100%; + overflow: hidden; + } + } +} + +//侧边栏配置 +// .djs-palette .two-column .open { +.open { + // .djs-palette.open { + .djs-palette-entries { + div[class^='bpmn-icon-']:before, + div[class*='bpmn-icon-']:before { + line-height: unset; + } + div.entry { + position: relative; + } + div.entry:hover { + &::after { + width: max-content; + content: attr(title); + vertical-align: text-bottom; + position: absolute; + right: -10px; + top: 0; + bottom: 0; + overflow: hidden; + transform: translateX(100%); + font-size: 0.5em; + display: inline-block; + text-decoration: inherit; + font-variant: normal; + text-transform: none; + background: #fafafa; + box-shadow: 0 0 6px #eeeeee; + border: 1px solid #cccccc; + box-sizing: border-box; + padding: 0 16px; + border-radius: 4px; + z-index: 100; + } + } + } +} +pre { + margin: 0; + height: 100%; + overflow: hidden; + max-height: calc(80vh - 32px); + overflow-y: auto; +} +.hljs { + word-break: break-word; + white-space: pre-wrap; +} +.hljs * { + font-family: Consolas, Monaco, monospace; +} diff --git a/src/components/bpmnProcessDesigner/package/theme/process-panel.scss b/src/components/bpmnProcessDesigner/package/theme/process-panel.scss new file mode 100644 index 0000000..f840cdd --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/theme/process-panel.scss @@ -0,0 +1,107 @@ +.process-panel__container { + box-sizing: border-box; + padding: 0 8px; + border-left: 1px solid #eeeeee; + box-shadow: 0 0 8px #cccccc; + max-height: 100%; + overflow-y: scroll; +} +.panel-tab__title { + font-weight: 600; + padding: 0 8px; + font-size: 1.1em; + line-height: 1.2em; + i { + margin-right: 8px; + font-size: 1.2em; + } +} +.panel-tab__content { + width: 100%; + box-sizing: border-box; + border-top: 1px solid #eeeeee; + padding: 8px 16px; + .panel-tab__content--title { + display: flex; + justify-content: space-between; + padding-bottom: 8px; + span { + flex: 1; + text-align: left; + } + } +} +.element-property { + width: 100%; + display: flex; + align-items: flex-start; + margin: 8px 0; + .element-property__label { + display: block; + width: 90px; + text-align: right; + overflow: hidden; + padding-right: 12px; + line-height: 32px; + font-size: 14px; + box-sizing: border-box; + } + .element-property__value { + flex: 1; + line-height: 32px; + } + .el-form-item { + width: 100%; + margin-bottom: 0; + padding-bottom: 18px; + } +} +.list-property { + flex-direction: column; + .element-listener-item { + width: 100%; + display: inline-grid; + grid-template-columns: 16px auto 32px 32px; + grid-column-gap: 8px; + } + .element-listener-item + .element-listener-item { + margin-top: 8px; + } +} +.listener-filed__title { + display: inline-flex; + width: 100%; + justify-content: space-between; + align-items: center; + margin-top: 0; + span { + width: 200px; + text-align: left; + font-size: 14px; + } + i { + margin-right: 8px; + } +} +.element-drawer__button { + margin-top: 8px; + width: 100%; + display: inline-flex; + justify-content: space-around; +} +.element-drawer__button > .el-button { + width: 100%; +} + +.el-collapse-item__content { + padding-bottom: 0; +} +.el-input.is-disabled .el-input__inner { + color: #999999; +} +.el-form-item.el-form-item--mini { + margin-bottom: 0; + & + .el-form-item { + margin-top: 16px; + } +} diff --git a/src/components/bpmnProcessDesigner/package/utils.ts b/src/components/bpmnProcessDesigner/package/utils.ts new file mode 100644 index 0000000..bb6c5d5 --- /dev/null +++ b/src/components/bpmnProcessDesigner/package/utils.ts @@ -0,0 +1,77 @@ +import { toRaw } from 'vue' +const bpmnInstances = () => (window as any)?.bpmnInstances +// 创建监听器实例 +export function createListenerObject(options, isTask, prefix) { + const listenerObj = Object.create(null) + listenerObj.event = options.event + isTask && (listenerObj.id = options.id) // 任务监听器特有的 id 字段 + switch (options.listenerType) { + case 'scriptListener': + listenerObj.script = createScriptObject(options, prefix) + break + case 'expressionListener': + listenerObj.expression = options.expression + break + case 'delegateExpressionListener': + listenerObj.delegateExpression = options.delegateExpression + break + default: + listenerObj.class = options.class + } + // 注入字段 + if (options.fields) { + listenerObj.fields = options.fields.map((field) => { + return createFieldObject(field, prefix) + }) + } + // 任务监听器的 定时器 设置 + if (isTask && options.event === 'timeout' && !!options.eventDefinitionType) { + const timeDefinition = bpmnInstances().moddle.create('bpmn:FormalExpression', { + body: options.eventTimeDefinitions + }) + const TimerEventDefinition = bpmnInstances().moddle.create('bpmn:TimerEventDefinition', { + id: `TimerEventDefinition_${uuid(8)}`, + [`time${options.eventDefinitionType.replace(/^\S/, (s) => s.toUpperCase())}`]: timeDefinition + }) + listenerObj.eventDefinitions = [TimerEventDefinition] + } + return bpmnInstances().moddle.create( + `${prefix}:${isTask ? 'TaskListener' : 'ExecutionListener'}`, + listenerObj + ) +} + +// 创建 监听器的注入字段 实例 +export function createFieldObject(option, prefix) { + const { name, fieldType, string, expression } = option + const fieldConfig = fieldType === 'string' ? { name, string } : { name, expression } + return bpmnInstances().moddle.create(`${prefix}:Field`, fieldConfig) +} + +// 创建脚本实例 +export function createScriptObject(options, prefix) { + const { scriptType, scriptFormat, value, resource } = options + const scriptConfig = + scriptType === 'inlineScript' ? { scriptFormat, value } : { scriptFormat, resource } + return bpmnInstances().moddle.create(`${prefix}:Script`, scriptConfig) +} + +// 更新元素扩展属性 +export function updateElementExtensions(element, extensionList) { + const extensions = bpmnInstances().moddle.create('bpmn:ExtensionElements', { + values: extensionList + }) + bpmnInstances().modeling.updateProperties(toRaw(element), { + extensionElements: extensions + }) +} + +// 创建一个id +export function uuid(length = 8, chars?) { + let result = '' + const charsString = chars || '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' + for (let i = length; i > 0; --i) { + result += charsString[Math.floor(Math.random() * charsString.length)] + } + return result +} diff --git a/src/components/bpmnProcessDesigner/src/highlight/index.js b/src/components/bpmnProcessDesigner/src/highlight/index.js new file mode 100644 index 0000000..5df38c9 --- /dev/null +++ b/src/components/bpmnProcessDesigner/src/highlight/index.js @@ -0,0 +1,5 @@ +const hljs = require('highlight.js/lib/core') +hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml')) +hljs.registerLanguage('json', require('highlight.js/lib/languages/json')) + +module.exports = hljs diff --git a/src/components/bpmnProcessDesigner/src/modules/custom-renderer/CustomRenderer.js b/src/components/bpmnProcessDesigner/src/modules/custom-renderer/CustomRenderer.js new file mode 100644 index 0000000..e876031 --- /dev/null +++ b/src/components/bpmnProcessDesigner/src/modules/custom-renderer/CustomRenderer.js @@ -0,0 +1,14 @@ +import BpmnRenderer from 'bpmn-js/lib/draw/BpmnRenderer' + +export default function CustomRenderer(config, eventBus, styles, pathMap, canvas, textRenderer) { + BpmnRenderer.call(this, config, eventBus, styles, pathMap, canvas, textRenderer, 2000) + + this.handlers['label'] = function () { + return null + } +} + +const F = function () {} // 核心,利用空对象作为中介; +F.prototype = BpmnRenderer.prototype // 核心,将父类的原型赋值给空对象F; +CustomRenderer.prototype = new F() // 核心,将 F的实例赋值给子类; +CustomRenderer.prototype.constructor = CustomRenderer // 修复子类CustomRenderer的构造器指向,防止原型链的混乱; diff --git a/src/components/bpmnProcessDesigner/src/modules/custom-renderer/index.js b/src/components/bpmnProcessDesigner/src/modules/custom-renderer/index.js new file mode 100644 index 0000000..79d8bd0 --- /dev/null +++ b/src/components/bpmnProcessDesigner/src/modules/custom-renderer/index.js @@ -0,0 +1,6 @@ +import CustomRenderer from './CustomRenderer' + +export default { + __init__: ['customRenderer'], + customRenderer: ['type', CustomRenderer] +} diff --git a/src/components/bpmnProcessDesigner/src/modules/rules/CustomRules.js b/src/components/bpmnProcessDesigner/src/modules/rules/CustomRules.js new file mode 100644 index 0000000..9fa1d14 --- /dev/null +++ b/src/components/bpmnProcessDesigner/src/modules/rules/CustomRules.js @@ -0,0 +1,16 @@ +import BpmnRules from 'bpmn-js/lib/features/rules/BpmnRules' +import inherits from 'inherits' + +export default function CustomRules(eventBus) { + BpmnRules.call(this, eventBus) +} + +inherits(CustomRules, BpmnRules) + +CustomRules.prototype.canDrop = function () { + return false +} + +CustomRules.prototype.canMove = function () { + return false +} diff --git a/src/components/bpmnProcessDesigner/src/modules/rules/index.js b/src/components/bpmnProcessDesigner/src/modules/rules/index.js new file mode 100644 index 0000000..12cf05a --- /dev/null +++ b/src/components/bpmnProcessDesigner/src/modules/rules/index.js @@ -0,0 +1,6 @@ +import CustomRules from './CustomRules' + +export default { + __init__: ['customRules'], + customRules: ['type', CustomRules] +} diff --git a/src/components/bpmnProcessDesigner/src/translations.ts b/src/components/bpmnProcessDesigner/src/translations.ts new file mode 100644 index 0000000..5f9b9a5 --- /dev/null +++ b/src/components/bpmnProcessDesigner/src/translations.ts @@ -0,0 +1,25 @@ +/** + * This is a sample file that should be replaced with the actual translation. + * + * Checkout https://github.com/bpmn-io/bpmn-js-i18n for a list of available + * translations and labels to translate. + */ +export default { + 'Exclusive Gateway': 'Exklusives Gateway', + 'Parallel Gateway': 'Paralleles Gateway', + 'Inclusive Gateway': 'Inklusives Gateway', + 'Complex Gateway': 'Komplexes Gateway', + 'Event based Gateway': 'Ereignis-basiertes Gateway', + 'Message Start Event': '消息启动事件', + 'Timer Start Event': '定时启动事件', + 'Conditional Start Event': '条件启动事件', + 'Signal Start Event': '信号启动事件', + 'Error Start Event': '错误启动事件', + 'Escalation Start Event': '升级启动事件', + 'Compensation Start Event': '补偿启动事件', + 'Message Start Event (non-interrupting)': '消息启动事件 (非中断)', + 'Timer Start Event (non-interrupting)': '定时启动事件 (非中断)', + 'Conditional Start Event (non-interrupting)': '条件启动事件 (非中断)', + 'Signal Start Event (non-interrupting)': '信号启动事件 (非中断)', + 'Escalation Start Event (non-interrupting)': '升级启动事件 (非中断)' +} diff --git a/src/components/bpmnProcessDesigner/src/utils/directive/clickOutSide.js b/src/components/bpmnProcessDesigner/src/utils/directive/clickOutSide.js new file mode 100644 index 0000000..bb71d44 --- /dev/null +++ b/src/components/bpmnProcessDesigner/src/utils/directive/clickOutSide.js @@ -0,0 +1,39 @@ +//outside.js + +const ctx = '@@clickoutsideContext' + +export default { + bind(el, binding, vnode) { + const ele = el + const documentHandler = (e) => { + if (!vnode.context || ele.contains(e.target)) { + return false + } + // 调用指令回调 + if (binding.expression) { + vnode.context[el[ctx].methodName](e) + } else { + el[ctx].bindingFn(e) + } + } + // 将方法添加到ele + ele[ctx] = { + documentHandler, + methodName: binding.expression, + bindingFn: binding.value + } + + setTimeout(() => { + document.addEventListener('touchstart', documentHandler) // 为document绑定事件 + }) + }, + update(el, binding) { + const ele = el + ele[ctx].methodName = binding.expression + ele[ctx].bindingFn = binding.value + }, + unbind(el) { + document.removeEventListener('touchstart', el[ctx].documentHandler) // 解绑 + delete el[ctx] + } +} diff --git a/src/components/bpmnProcessDesigner/src/utils/index.js b/src/components/bpmnProcessDesigner/src/utils/index.js new file mode 100644 index 0000000..7d970ec --- /dev/null +++ b/src/components/bpmnProcessDesigner/src/utils/index.js @@ -0,0 +1,10 @@ +export function debounce(fn, delay = 500) { + let timer + return function (...args) { + if (timer) { + clearTimeout(timer) + timer = null + } + timer = setTimeout(fn.bind(this, ...args), delay) + } +} diff --git a/src/components/bpmnProcessDesigner/src/utils/xml2json.js b/src/components/bpmnProcessDesigner/src/utils/xml2json.js new file mode 100644 index 0000000..fe1a52f --- /dev/null +++ b/src/components/bpmnProcessDesigner/src/utils/xml2json.js @@ -0,0 +1,50 @@ +function xmlStr2XmlObj(xmlStr) { + let xmlObj = {} + if (document.all) { + const xmlDom = new window.ActiveXObject('Microsoft.XMLDOM') + xmlDom.loadXML(xmlStr) + xmlObj = xmlDom + } else { + xmlObj = new DOMParser().parseFromString(xmlStr, 'text/xml') + } + return xmlObj +} + +function xml2json(xml) { + try { + let obj = {} + if (xml.children.length > 0) { + for (let i = 0; i < xml.children.length; i++) { + const item = xml.children.item(i) + const nodeName = item.nodeName + if (typeof obj[nodeName] == 'undefined') { + obj[nodeName] = xml2json(item) + } else { + if (typeof obj[nodeName].push == 'undefined') { + const old = obj[nodeName] + obj[nodeName] = [] + obj[nodeName].push(old) + } + obj[nodeName].push(xml2json(item)) + } + } + } else { + obj = xml.textContent + } + return obj + } catch (e) { + console.log(e.message) + } +} + +function xmlObj2json(xml) { + const xmlObj = xmlStr2XmlObj(xml) + console.log(xmlObj) + let jsonObj = {} + if (xmlObj.childNodes.length > 0) { + jsonObj = xml2json(xmlObj) + } + return jsonObj +} + +export default xmlObj2json diff --git a/src/components/iFrame/index.ts b/src/components/iFrame/index.ts new file mode 100644 index 0000000..9f8cf24 --- /dev/null +++ b/src/components/iFrame/index.ts @@ -0,0 +1,3 @@ +import IFrame from './src/IFrame.vue' + +export { IFrame } diff --git a/src/components/iFrame/src/IFrame.vue b/src/components/iFrame/src/IFrame.vue new file mode 100644 index 0000000..85b3e3c --- /dev/null +++ b/src/components/iFrame/src/IFrame.vue @@ -0,0 +1,68 @@ + + diff --git a/src/components/index.ts b/src/components/index.ts new file mode 100644 index 0000000..4d030c3 --- /dev/null +++ b/src/components/index.ts @@ -0,0 +1,6 @@ +import type { App } from 'vue' +import { Icon } from './Icon' + +export const setupGlobCom = (app: App): void => { + app.component('Icon', Icon) +} diff --git a/src/components/rowDrop/index.vue b/src/components/rowDrop/index.vue new file mode 100644 index 0000000..e75fb9d --- /dev/null +++ b/src/components/rowDrop/index.vue @@ -0,0 +1,205 @@ + + + \ No newline at end of file diff --git a/src/config/axios/config.ts b/src/config/axios/config.ts new file mode 100644 index 0000000..bdca649 --- /dev/null +++ b/src/config/axios/config.ts @@ -0,0 +1,28 @@ +const config: { + base_url: string + result_code: number | string + default_headers: AxiosHeaders + request_timeout: number +} = { + /** + * api请求基础路径 + */ + base_url: import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL, + /** + * 接口成功返回状态码 + */ + result_code: 200, + + /** + * 接口请求超时时间 + */ + request_timeout: 60000, + + /** + * 默认接口请求类型 + * 可选值:application/x-www-form-urlencoded multipart/form-data + */ + default_headers: 'application/json' +} + +export { config } diff --git a/src/config/axios/errorCode.ts b/src/config/axios/errorCode.ts new file mode 100644 index 0000000..94d719f --- /dev/null +++ b/src/config/axios/errorCode.ts @@ -0,0 +1,6 @@ +export default { + '401': '认证失败,无法访问系统资源', + '403': '当前操作没有权限', + '404': '访问资源不存在', + default: '系统未知错误,请反馈给管理员' +} diff --git a/src/config/axios/index.ts b/src/config/axios/index.ts new file mode 100644 index 0000000..919b501 --- /dev/null +++ b/src/config/axios/index.ts @@ -0,0 +1,55 @@ +import { service } from './service' + +import { config } from './config' +import { useCache } from '@/hooks/web/useCache' + +const { default_headers } = config +const { wsCache } = useCache() +console.log('lang='+wsCache.get('lang')); +const language = wsCache.get('lang') +const request = (option: any) => { + const { url, method, params, data, headersType, responseType, ...config } = option + return service({ + url: url, + method, + params, + data, + ...config, + responseType: responseType, + headers: { + 'Content-Type': headersType || default_headers, + 'language': language + } + }) +} +export default { + get: async (option: any) => { + const res = await request({ method: 'GET', ...option }) + return res.data as unknown as T + }, + post: async (option: any) => { + const res = await request({ method: 'POST', ...option }) + return res.data as unknown as T + }, + postOriginal: async (option: any) => { + const res = await request({ method: 'POST', ...option }) + return res + }, + delete: async (option: any) => { + const res = await request({ method: 'DELETE', ...option }) + return res.data as unknown as T + }, + put: async (option: any) => { + const res = await request({ method: 'PUT', ...option }) + return res.data as unknown as T + }, + download: async (option: any) => { + const res = await request({ method: 'GET', responseType: 'blob', ...option }) + return res as unknown as Promise + }, + upload: async (option: any) => { + option.headersType = 'multipart/form-data' + const res = await request({ method: 'POST', ...option }) + return res as unknown as Promise + } +} diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts new file mode 100644 index 0000000..1a4741b --- /dev/null +++ b/src/config/axios/service.ts @@ -0,0 +1,239 @@ +import axios, { + AxiosError, + AxiosInstance, + AxiosRequestHeaders, + AxiosResponse, + InternalAxiosRequestConfig +} from 'axios' + +import { ElMessage, ElMessageBox, ElNotification } from 'element-plus' +import qs from 'qs' +import { config } from '@/config/axios/config' +import { getAccessToken, getRefreshToken, getTenantId, removeToken, setToken } from '@/utils/auth' +import errorCode from './errorCode' + +import { resetRouter } from '@/router' +import { useCache } from '@/hooks/web/useCache' + +const tenantEnable = import.meta.env.VITE_APP_TENANT_ENABLE +const { result_code, base_url, request_timeout } = config + +// 需要忽略的提示。忽略后,自动 Promise.reject('error') +const ignoreMsgs = [ + '无效的刷新令牌', // 刷新令牌被删除时,不用提示 + '刷新令牌已过期' // 使用刷新令牌,刷新获取新的访问令牌时,结果因为过期失败,此时需要忽略。否则,会导致继续 401,无法跳转到登出界面 +] +// 是否显示重新登录 +export const isRelogin = { show: false } +// Axios 无感知刷新令牌,参考 https://www.dashingdog.cn/article/11 与 https://segmentfault.com/a/1190000020210980 实现 +// 请求队列 +let requestList: any[] = [] +// 是否正在刷新中 +let isRefreshToken = false +// 请求白名单,无须token的接口 +const whiteList: string[] = ['/login', '/refresh-token'] + +// 创建axios实例 +const service: AxiosInstance = axios.create({ + baseURL: base_url, // api 的 base_url + timeout: request_timeout, // 请求超时时间 + withCredentials: false // 禁用 Cookie 等信息 +}) + +// request拦截器 +service.interceptors.request.use( + (config: InternalAxiosRequestConfig) => { + // 是否需要设置 token + let isToken = (config!.headers || {}).isToken === false + whiteList.some((v) => { + if (config.url) { + config.url.indexOf(v) > -1 + return (isToken = false) + } + }) + if (getAccessToken() && !isToken) { + ;(config as Recordable).headers.Authorization = 'Bearer ' + getAccessToken() // 让每个请求携带自定义token + } + // 设置租户 + if (tenantEnable && tenantEnable === 'true') { + const tenantId = getTenantId() + if (tenantId) (config as Recordable).headers['tenant-id'] = tenantId + } + const params = config.params || {} + const data = config.data || false + if ( + config.method?.toUpperCase() === 'POST' && + (config.headers as AxiosRequestHeaders)['Content-Type'] === + 'application/x-www-form-urlencoded' + ) { + config.data = qs.stringify(data) + } + // get参数编码 + if (config.method?.toUpperCase() === 'GET' && params) { + let url = config.url + '?' + for (const propName of Object.keys(params)) { + const value = params[propName] + if (value !== void 0 && value !== null && typeof value !== 'undefined') { + if (typeof value === 'object') { + for (const val of Object.keys(value)) { + const params = propName + '[' + val + ']' + const subPart = encodeURIComponent(params) + '=' + url += subPart + encodeURIComponent(value[val]) + '&' + } + } else { + url += `${propName}=${encodeURIComponent(value)}&` + } + } + } + // 给 get 请求加上时间戳参数,避免从缓存中拿数据 + // const now = new Date().getTime() + // params = params.substring(0, url.length - 1) + `?_t=${now}` + url = url.slice(0, -1) + config.params = {} + config.url = url + } + return config + }, + (error: AxiosError) => { + // Do something with request error + console.log(error) // for debug + Promise.reject(error) + } +) + +// response 拦截器 +service.interceptors.response.use( + async (response: AxiosResponse) => { + const { data } = response + const config = response.config + if (!data) { + // 返回“[HTTP]请求没有返回值”; + throw new Error() + } + const { t } = useI18n() + // 未设置状态码则默认成功状态 + const code = data.code || result_code + // 二进制数据则直接返回 + if ( + response.request.responseType === 'blob' || + response.request.responseType === 'arraybuffer' + ) { + return response.data + } + // 获取错误信息 + const msg = data.msg || errorCode[code] || errorCode['default'] + if (ignoreMsgs.indexOf(msg) !== -1) { + // 如果是忽略的错误码,直接返回 msg 异常 + return Promise.reject(msg) + } else if (code === 401) { + // 如果未认证,并且未进行刷新令牌,说明可能是访问令牌过期了 + if (!isRefreshToken) { + isRefreshToken = true + // 1. 如果获取不到刷新令牌,则只能执行登出操作 + if (!getRefreshToken()) { + return handleAuthorized() + } + // 2. 进行刷新访问令牌 + try { + const refreshTokenRes = await refreshToken() + // 2.1 刷新成功,则回放队列的请求 + 当前请求 + setToken((await refreshTokenRes).data.data) + config.headers!.Authorization = 'Bearer ' + getAccessToken() + requestList.forEach((cb: any) => { + cb() + }) + requestList = [] + return service(config) + } catch (e) { + // 为什么需要 catch 异常呢?刷新失败时,请求因为 Promise.reject 触发异常。 + // 2.2 刷新失败,只回放队列的请求 + requestList.forEach((cb: any) => { + cb() + }) + // 提示是否要登出。即不回放当前请求!不然会形成递归 + return handleAuthorized() + } finally { + requestList = [] + isRefreshToken = false + } + } else { + // 添加到队列,等待刷新获取到新的令牌 + return new Promise((resolve) => { + requestList.push(() => { + config.headers!.Authorization = 'Bearer ' + getAccessToken() // 让每个请求携带自定义token 请根据实际情况自行修改 + resolve(service(config)) + }) + }) + } + } else if (code === 500) { + ElMessage.error(t('sys.api.errMsg500')) + return Promise.reject(new Error(msg)) + } else if (code === 901) { + ElMessage.error({ + offset: 300, + dangerouslyUseHTMLString: true, + message: + '
' + + t('sys.api.errMsg901') + + '
' + + '
 
' + + '
参考 https://doc.iocoder.cn/ 教程
' + + '
 
' + + '
5 分钟搭建本地环境
' + }) + return Promise.reject(new Error(msg)) + } else if (code !== 200) { + if (msg === '无效的刷新令牌') { + // hard coding:忽略这个提示,直接登出 + console.log(msg) + } else { + ElNotification.error({ title: msg }) + } + return Promise.reject('error') + } else { + return data + } + }, + (error: AxiosError) => { + console.log('err' + error) // for debug + let { message } = error + const { t } = useI18n() + if (message === 'Network Error') { + message = t('sys.api.errorMessage') + } else if (message.includes('timeout')) { + message = t('sys.api.apiTimeoutMessage') + } else if (message.includes('Request failed with status code')) { + message = t('sys.api.apiRequestFailed') + message.substr(message.length - 3) + } + ElMessage.error(message) + return Promise.reject(error) + } +) + +const refreshToken = async () => { + axios.defaults.headers.common['tenant-id'] = getTenantId() + return await axios.post(base_url + '/system/auth/refresh-token?refreshToken=' + getRefreshToken()) +} +const handleAuthorized = () => { + const { t } = useI18n() + if (!isRelogin.show) { + isRelogin.show = true + ElMessageBox.confirm(t('sys.api.timeoutMessage'), t('common.confirmTitle'), { + showCancelButton: false, + closeOnClickModal: false, + showClose: false, + confirmButtonText: t('login.relogin'), + type: 'warning' + }).then(() => { + const { wsCache } = useCache() + resetRouter() // 重置静态路由表 + wsCache.clear() + removeToken() + isRelogin.show = false + // 干掉token后再走一次路由让它过router.beforeEach的校验 + window.location.href = window.location.href + }) + } + return Promise.reject(t('sys.api.timeoutMessage')) +} +export { service } diff --git a/src/directives/index.ts b/src/directives/index.ts new file mode 100644 index 0000000..89cc8ba --- /dev/null +++ b/src/directives/index.ts @@ -0,0 +1,13 @@ +import type { App } from 'vue' +import { hasRole } from './permission/hasRole' +import { hasPermi } from './permission/hasPermi' + +/** + * 导出指令:v-xxx + * @methods hasRole 用户权限,用法: v-hasRole + * @methods hasPermi 按钮权限,用法: v-hasPermi + */ +export const setupAuth = (app: App) => { + hasRole(app) + hasPermi(app) +} diff --git a/src/directives/permission/hasPermi.ts b/src/directives/permission/hasPermi.ts new file mode 100644 index 0000000..d86d2f5 --- /dev/null +++ b/src/directives/permission/hasPermi.ts @@ -0,0 +1,27 @@ +import type { App } from 'vue' +import { CACHE_KEY, useCache } from '@/hooks/web/useCache' + +const { t } = useI18n() // 国际化 + +export function hasPermi(app: App) { + app.directive('hasPermi', (el, binding) => { + const { wsCache } = useCache() + const { value } = binding + const all_permission = '*:*:*' + const permissions = wsCache.get(CACHE_KEY.USER).permissions + + if (value && value instanceof Array && value.length > 0) { + const permissionFlag = value + + const hasPermissions = permissions.some((permission: string) => { + return all_permission === permission || permissionFlag.includes(permission) + }) + + if (!hasPermissions) { + el.parentNode && el.parentNode.removeChild(el) + } + } else { + throw new Error(t('permission.hasPermission')) + } + }) +} diff --git a/src/directives/permission/hasRole.ts b/src/directives/permission/hasRole.ts new file mode 100644 index 0000000..31a352a --- /dev/null +++ b/src/directives/permission/hasRole.ts @@ -0,0 +1,27 @@ +import type { App } from 'vue' +import { CACHE_KEY, useCache } from '@/hooks/web/useCache' + +const { t } = useI18n() // 国际化 + +export function hasRole(app: App) { + app.directive('hasRole', (el, binding) => { + const { wsCache } = useCache() + const { value } = binding + const super_admin = 'admin' + const roles = wsCache.get(CACHE_KEY.USER).roles + + if (value && value instanceof Array && value.length > 0) { + const roleFlag = value + + const hasRole = roles.some((role: string) => { + return super_admin === role || roleFlag.includes(role) + }) + + if (!hasRole) { + el.parentNode && el.parentNode.removeChild(el) + } + } else { + throw new Error(t('permission.hasRole')) + } + }) +} diff --git a/src/hooks/event/useScrollTo.ts b/src/hooks/event/useScrollTo.ts new file mode 100644 index 0000000..92aec87 --- /dev/null +++ b/src/hooks/event/useScrollTo.ts @@ -0,0 +1,60 @@ +export interface ScrollToParams { + el: HTMLElement + to: number + position: string + duration?: number + callback?: () => void +} + +const easeInOutQuad = (t: number, b: number, c: number, d: number) => { + t /= d / 2 + if (t < 1) { + return (c / 2) * t * t + b + } + t-- + return (-c / 2) * (t * (t - 2) - 1) + b +} +const move = (el: HTMLElement, position: string, amount: number) => { + el[position] = amount +} + +export function useScrollTo({ + el, + position = 'scrollLeft', + to, + duration = 500, + callback +}: ScrollToParams) { + const isActiveRef = ref(false) + const start = el[position] + const change = to - start + const increment = 20 + let currentTime = 0 + + function animateScroll() { + if (!unref(isActiveRef)) { + return + } + currentTime += increment + const val = easeInOutQuad(currentTime, start, change, duration) + move(el, position, val) + if (currentTime < duration && unref(isActiveRef)) { + requestAnimationFrame(animateScroll) + } else { + if (callback) { + callback() + } + } + } + + function run() { + isActiveRef.value = true + animateScroll() + } + + function stop() { + isActiveRef.value = false + } + + return { start: run, stop } +} diff --git a/src/hooks/web/useCache.ts b/src/hooks/web/useCache.ts new file mode 100644 index 0000000..6d2a931 --- /dev/null +++ b/src/hooks/web/useCache.ts @@ -0,0 +1,27 @@ +/** + * 配置浏览器本地存储的方式,可直接存储对象数组。 + */ + +import WebStorageCache from 'web-storage-cache' + +type CacheType = 'localStorage' | 'sessionStorage' + +export const CACHE_KEY = { + IS_DARK: 'isDark', + USER: 'user', + LANG: 'lang', + THEME: 'theme', + LAYOUT: 'layout', + ROLE_ROUTERS: 'roleRouters', + DICT_CACHE: 'dictCache' +} + +export const useCache = (type: CacheType = 'localStorage') => { + const wsCache: WebStorageCache = new WebStorageCache({ + storage: type + }) + + return { + wsCache + } +} diff --git a/src/hooks/web/useConfigGlobal.ts b/src/hooks/web/useConfigGlobal.ts new file mode 100644 index 0000000..afb3db3 --- /dev/null +++ b/src/hooks/web/useConfigGlobal.ts @@ -0,0 +1,9 @@ +import { ConfigGlobalTypes } from '@/types/configGlobal' + +export const useConfigGlobal = () => { + const configGlobal = inject('configGlobal', {}) as ConfigGlobalTypes + + return { + configGlobal + } +} diff --git a/src/hooks/web/useCrudSchemas.ts b/src/hooks/web/useCrudSchemas.ts new file mode 100644 index 0000000..b39d045 --- /dev/null +++ b/src/hooks/web/useCrudSchemas.ts @@ -0,0 +1,374 @@ +import { reactive } from 'vue' +import { AxiosPromise } from 'axios' +import { findIndex } from '@/utils' +import { eachTree, filter, treeMap } from '@/utils/tree' +import { getBoolDictOptions, getDictOptions, getIntDictOptions } from '@/utils/dict' + +import { FormSchema } from '@/types/form' +import { TableColumn } from '@/types/table' +import { DescriptionsSchema } from '@/types/descriptions' +import { TableFormColumn } from '@/types/tableForm' +import { ComponentOptions, ComponentProps } from '@/types/components' +import { DictTag } from '@/components/DictTag' +import { cloneDeep, merge } from 'lodash-es' + +export type CrudSchema = Omit & { + isSearch?: boolean // 是否在查询显示 + search?: CrudSearchParams // 查询的详细配置 + isTable?: boolean // 是否在列表显示 + table?: CrudTableParams // 列表的详细配置 + isForm?: boolean // 是否在表单显示 + form?: CrudFormParams // 表单的详细配置 + isDetail?: boolean // 是否在详情显示 + detail?: CrudDescriptionsParams // 详情的详细配置 + isTableForm?: boolean // 是否在表格嵌套表单显示 + tableForm?: CrudTableFormParams // 表格嵌套表单的详细配置 + children?: CrudSchema[] + dictType?: string // 字典类型 + dictClass?: 'string' | 'number' | 'boolean' // 字典数据类型 string | number | boolean +} + +type CrudSearchParams = { + // 是否显示在查询项 + show?: boolean + // 接口 + api?: () => Promise + // 搜索字段 + field?: string +} & Omit + +type CrudTableParams = { + // 是否显示表头 + show?: boolean + // 列宽配置 + width?: number | string + // 列是否固定在左侧或者右侧 + fixed?: 'left' | 'right' +} & Omit +type CrudFormParams = { + // 是否显示表单项 + show?: boolean + // 接口 + api?: () => Promise +} & Omit + +type CrudDescriptionsParams = { + // 是否显示表单项 + show?: boolean +} & Omit + +type CrudTableFormParams = { + // 是否显示表单项 + show?: boolean +} & Omit +interface AllSchemas { + searchSchema: FormSchema[] + tableColumns: TableColumn[] + formSchema: FormSchema[] + detailSchema: DescriptionsSchema[] + tableFormColumns: TableFormColumn[] +} + +const { t } = useI18n() + +// 过滤所有结构 +export const useCrudSchemas = ( + crudSchema: CrudSchema[] +): { + allSchemas: AllSchemas +} => { + // 所有结构数据 + const allSchemas = reactive({ + searchSchema: [], + tableColumns: [], + formSchema: [], + detailSchema: [], + tableFormColumns:[] + }) + + const searchSchema = filterSearchSchema(crudSchema, allSchemas) + allSchemas.searchSchema = searchSchema || [] + + const tableColumns = filterTableSchema(crudSchema) + allSchemas.tableColumns = tableColumns || [] + + const formSchema = filterFormSchema(crudSchema, allSchemas) + allSchemas.formSchema = formSchema + + const detailSchema = filterDescriptionsSchema(crudSchema) + allSchemas.detailSchema = detailSchema + + const tableFormColumns= filterTableFormSchema(crudSchema) + allSchemas.tableFormColumns =tableFormColumns || [] + return { + allSchemas + } +} + +// 过滤 Search 结构 +const filterSearchSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): FormSchema[] => { + const searchSchema: FormSchema[] = [] + + // 获取字典列表队列 + const searchRequestTask: Array<() => Promise> = [] + eachTree(crudSchema, (schemaItem: CrudSchema) => { + // 判断是否显示 + if (schemaItem?.isSearch || schemaItem.search?.show) { + let component = schemaItem?.search?.component || 'Input' + const options: ComponentOptions[] = [] + let comonentProps: ComponentProps = {} + if (schemaItem.dictType) { + const allOptions: ComponentOptions = { label: '全部', value: '' } + options.push(allOptions) + getDictOptions(schemaItem.dictType).forEach((dict) => { + options.push(dict) + }) + comonentProps = { + options: options + } + if (!schemaItem.search?.component) component = 'Select' + } + + // updated by AKing: 解决了当使用默认的dict选项时,form中事件不能触发的问题 + const searchSchemaItem = merge( + { + // 默认为 input + component, + ...schemaItem.search, + field: schemaItem.field, + label: schemaItem.search?.label || schemaItem.label + }, + { componentProps: comonentProps } + ) + if (searchSchemaItem.api) { + searchRequestTask.push(async () => { + const res = await (searchSchemaItem.api as () => AxiosPromise)() + if (res) { + const index = findIndex(allSchemas.searchSchema, (v: FormSchema) => { + return v.field === searchSchemaItem.field + }) + if (index !== -1) { + allSchemas.searchSchema[index]!.componentProps!.options = filterOptions( + res, + searchSchemaItem.componentProps.optionsAlias?.labelField + ) + } + } + }) + } + // 删除不必要的字段 + delete searchSchemaItem.show + + searchSchema.push(searchSchemaItem) + } + }) + for (const task of searchRequestTask) { + task() + } + return searchSchema +} + +// 过滤 table 结构 +const filterTableSchema = (crudSchema: CrudSchema[]): TableColumn[] => { + const tableColumns = treeMap(crudSchema, { + conversion: (schema: CrudSchema) => { + if (schema?.isTable !== false && schema?.table?.show !== false) { + // add by 芋艿:增加对 dict 字典数据的支持 + if (!schema.formatter && schema.dictType) { + schema.formatter = (_: Recordable, __: TableColumn, cellValue: any) => { + return h(DictTag, { + type: schema.dictType!, // ! 表示一定不为空 + value: cellValue + }) + } + } + return { + ...schema.table, + ...schema + } + } + } + }) + + // 第一次过滤会有 undefined 所以需要二次过滤 + return filter(tableColumns as TableColumn[], (data) => { + if (data.children === void 0) { + delete data.children + } + return !!data.field + }) +} +// 过滤 tableForm 结构 +const filterTableFormSchema = (crudSchema: CrudSchema[]): TableFormColumn[] => { + const tableFormColumns = treeMap(crudSchema, { + conversion: (schema: CrudSchema) => { + if (schema?.isTableForm !== false && schema?.tableForm?.show !== false) { + // add by 芋艿:增加对 dict 字典数据的支持 + if (!schema.formatter && schema.dictType) { + schema.formatter = (_: Recordable, __: TableFormColumn, cellValue: any) => { + return h(DictTag, { + type: schema.dictType!, // ! 表示一定不为空 + value: cellValue + }) + } + } + return { + ...schema.tableForm, + ...schema + } + } + } + }) + + // 第一次过滤会有 undefined 所以需要二次过滤 + return filter(tableFormColumns as TableFormColumn[], (data) => { + if (data.children === void 0) { + delete data.children + } + return !!data.field + }) +} +// 过滤 form 结构 +const filterFormSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): FormSchema[] => { + const formSchema: FormSchema[] = [] + + // 获取字典列表队列 + const formRequestTask: Array<() => Promise> = [] + + eachTree(crudSchema, (schemaItem: CrudSchema) => { + // 判断是否显示 + if (schemaItem?.isForm !== false && schemaItem?.form?.show !== false) { + let component = schemaItem?.form?.component || 'Input' + let defaultValue: any = '' + if (schemaItem.form?.value) { + defaultValue = schemaItem.form?.value + } else { + if (component === 'InputNumber') { + defaultValue = 0 + } + } + let comonentProps: ComponentProps = {} + if (schemaItem.dictType) { + const options: ComponentOptions[] = [] + if (schemaItem.dictClass && schemaItem.dictClass === 'number') { + getIntDictOptions(schemaItem.dictType).forEach((dict) => { + options.push(dict) + }) + } else if (schemaItem.dictClass && schemaItem.dictClass === 'boolean') { + getBoolDictOptions(schemaItem.dictType).forEach((dict) => { + options.push(dict) + }) + } else { + getDictOptions(schemaItem.dictType).forEach((dict) => { + options.push(dict) + }) + } + comonentProps = { + options: options + } + if (!(schemaItem.form && schemaItem.form.component)) component = 'Select' + } + + // updated by AKing: 解决了当使用默认的dict选项时,form中事件不能触发的问题 + const formSchemaItem = merge( + { + // 默认为 input + component, + value: defaultValue, + ...schemaItem.form, + field: schemaItem.field, + label: schemaItem.form?.label || schemaItem.label + }, + { componentProps: comonentProps } + ) + + if (formSchemaItem.api) { + formRequestTask.push(async () => { + const res = await (formSchemaItem.api as () => AxiosPromise)() + if (res) { + const index = findIndex(allSchemas.formSchema, (v: FormSchema) => { + return v.field === formSchemaItem.field + }) + if (index !== -1) { + allSchemas.formSchema[index]!.componentProps!.options = filterOptions( + res, + formSchemaItem.componentProps.optionsAlias?.labelField + ) + } + } + }) + } + + // 删除不必要的字段 + delete formSchemaItem.show + + formSchema.push(formSchemaItem) + } + }) + + for (const task of formRequestTask) { + task() + } + return formSchema +} + +// 过滤 descriptions 结构 +const filterDescriptionsSchema = (crudSchema: CrudSchema[]): DescriptionsSchema[] => { + const descriptionsSchema: FormSchema[] = [] + + eachTree(crudSchema, (schemaItem: CrudSchema) => { + // 判断是否显示 + if (schemaItem?.isDetail !== false && schemaItem.detail?.show !== false) { + const descriptionsSchemaItem = { + ...schemaItem.detail, + field: schemaItem.field, + label: schemaItem.detail?.label || schemaItem.label + } + if (schemaItem.dictType) { + descriptionsSchemaItem.dictType = schemaItem.dictType + } + if (schemaItem.detail?.dateFormat || schemaItem.formatter == 'formatDate') { + // 优先使用 detail 下的配置,如果没有默认为 YYYY-MM-DD HH:mm:ss + descriptionsSchemaItem.dateFormat = schemaItem?.detail?.dateFormat + ? schemaItem?.detail?.dateFormat + : 'YYYY-MM-DD HH:mm:ss' + } + + // 删除不必要的字段 + delete descriptionsSchemaItem.show + + descriptionsSchema.push(descriptionsSchemaItem) + } + }) + + return descriptionsSchema +} + +// 给options添加国际化 +const filterOptions = (options: Recordable, labelField?: string) => { + return options?.map((v: Recordable) => { + if (labelField) { + v['labelField'] = t(v.labelField) + } else { + v['label'] = t(v.label) + } + return v + }) +} + +// 将 tableColumns 指定 fields 放到最前面 +export const sortTableColumns = (tableColumns: TableColumn[], field: string) => { + const fieldIndex = tableColumns.findIndex((item) => item.field === field) + const fieldColumn = cloneDeep(tableColumns[fieldIndex]) + tableColumns.splice(fieldIndex, 1) + // 添加到开头 + tableColumns.unshift(fieldColumn) +} +// 将 tableColumns 指定 fields 放到最前面 +export const sortTableFormColumns = (tableFormColumns: TableFormColumn[], field: string) => { + const fieldIndex = tableFormColumns.findIndex((item) => item.field === field) + const fieldColumn = cloneDeep(tableFormColumns[fieldIndex]) + tableFormColumns.splice(fieldIndex, 1) + // 添加到开头 + tableFormColumns.unshift(fieldColumn) +} diff --git a/src/hooks/web/useDesign.ts b/src/hooks/web/useDesign.ts new file mode 100644 index 0000000..8ee3b38 --- /dev/null +++ b/src/hooks/web/useDesign.ts @@ -0,0 +1,18 @@ +import variables from '@/styles/global.module.scss' + +export const useDesign = () => { + const scssVariables = variables + + /** + * @param scope 类名 + * @returns 返回空间名-类名 + */ + const getPrefixCls = (scope: string) => { + return `${scssVariables.namespace}-${scope}` + } + + return { + variables: scssVariables, + getPrefixCls + } +} diff --git a/src/hooks/web/useEmitt.ts b/src/hooks/web/useEmitt.ts new file mode 100644 index 0000000..d4efea7 --- /dev/null +++ b/src/hooks/web/useEmitt.ts @@ -0,0 +1,22 @@ +import mitt from 'mitt' + +interface Option { + name: string // 事件名称 + callback: Fn // 回调 +} + +const emitter = mitt() + +export const useEmitt = (option?: Option) => { + if (option) { + emitter.on(option.name, option.callback) + + onBeforeUnmount(() => { + emitter.off(option.name) + }) + } + + return { + emitter + } +} diff --git a/src/hooks/web/useForm.ts b/src/hooks/web/useForm.ts new file mode 100644 index 0000000..53a8a94 --- /dev/null +++ b/src/hooks/web/useForm.ts @@ -0,0 +1,94 @@ +import type { Form, FormExpose } from '@/components/Form' +import type { ElForm } from 'element-plus' +import type { FormProps } from '@/components/Form/src/types' +import { FormSchema, FormSetPropsType } from '@/types/form' + +export const useForm = (props?: FormProps) => { + // From实例 + const formRef = ref() + + // ElForm实例 + const elFormRef = ref>() + + /** + * @param ref Form实例 + * @param elRef ElForm实例 + */ + const register = (ref: typeof Form & FormExpose, elRef: ComponentRef) => { + formRef.value = ref + elFormRef.value = elRef + } + + const getForm = async () => { + await nextTick() + const form = unref(formRef) + if (!form) { + console.error('The form is not registered. Please use the register method to register') + } + return form + } + + // 一些内置的方法 + const methods: { + setProps: (props: Recordable) => void + setValues: (data: Recordable) => void + getFormData: () => Promise + setSchema: (schemaProps: FormSetPropsType[]) => void + addSchema: (formSchema: FormSchema, index?: number) => void + delSchema: (field: string) => void + } = { + setProps: async (props: FormProps = {}) => { + const form = await getForm() + form?.setProps(props) + if (props.model) { + form?.setValues(props.model) + } + }, + + setValues: async (data: Recordable) => { + const form = await getForm() + form?.setValues(data) + }, + + /** + * @param schemaProps 需要设置的schemaProps + */ + setSchema: async (schemaProps: FormSetPropsType[]) => { + const form = await getForm() + form?.setSchema(schemaProps) + }, + + /** + * @param formSchema 需要新增数据 + * @param index 在哪里新增 + */ + addSchema: async (formSchema: FormSchema, index?: number) => { + const form = await getForm() + form?.addSchema(formSchema, index) + }, + + /** + * @param field 删除哪个数据 + */ + delSchema: async (field: string) => { + const form = await getForm() + form?.delSchema(field) + }, + + /** + * @returns form data + */ + getFormData: async (): Promise => { + const form = await getForm() + return form?.formModel as T + } + } + + props && methods.setProps(props) + + return { + register, + elFormRef, + methods + } +} diff --git a/src/hooks/web/useI18n.ts b/src/hooks/web/useI18n.ts new file mode 100644 index 0000000..d1ab70f --- /dev/null +++ b/src/hooks/web/useI18n.ts @@ -0,0 +1,53 @@ +import { i18n } from '@/plugins/vueI18n' + +type I18nGlobalTranslation = { + (key: string): string + (key: string, locale: string): string + (key: string, locale: string, list: unknown[]): string + (key: string, locale: string, named: Record): string + (key: string, list: unknown[]): string + (key: string, named: Record): string +} + +type I18nTranslationRestParameters = [string, any] + +const getKey = (namespace: string | undefined, key: string) => { + if (!namespace) { + return key + } + if (key.startsWith(namespace)) { + return key + } + return `${namespace}.${key}` +} + +export const useI18n = ( + namespace?: string +): { + t: I18nGlobalTranslation +} => { + const normalFn = { + t: (key: string) => { + return getKey(namespace, key) + } + } + + if (!i18n) { + return normalFn + } + + const { t, ...methods } = i18n.global + + const tFn: I18nGlobalTranslation = (key: string, ...arg: any[]) => { + if (!key) return '' + if (!key.includes('.') && !namespace) return key + //@ts-ignore + return t(getKey(namespace, key), ...(arg as I18nTranslationRestParameters)) + } + return { + ...methods, + t: tFn + } +} + +export const t = (key: string) => key diff --git a/src/hooks/web/useIcon.ts b/src/hooks/web/useIcon.ts new file mode 100644 index 0000000..3500204 --- /dev/null +++ b/src/hooks/web/useIcon.ts @@ -0,0 +1,8 @@ +import { h } from 'vue' +import type { VNode } from 'vue' +import { Icon } from '@/components/Icon' +import { IconTypes } from '@/types/icon' + +export const useIcon = (props: IconTypes): VNode => { + return h(Icon, props) +} diff --git a/src/hooks/web/useIntro.ts b/src/hooks/web/useIntro.ts new file mode 100644 index 0000000..7fe0084 --- /dev/null +++ b/src/hooks/web/useIntro.ts @@ -0,0 +1,47 @@ +import introJs from 'intro.js' +import { IntroJs, Step, Options } from 'intro.js' +import 'intro.js/introjs.css' + +import { useDesign } from '@/hooks/web/useDesign' + +export const useIntro = (setps?: Step[], options?: Options) => { + const { t } = useI18n() + + const { variables } = useDesign() + + const defaultSetps: Step[] = setps || [ + { + element: `#${variables.namespace}-menu`, + title: t('common.menu'), + intro: t('common.menuDes'), + position: 'right' + }, + { + element: `#${variables.namespace}-tool-header`, + title: t('common.tool'), + intro: t('common.toolDes'), + position: 'left' + }, + { + element: `#${variables.namespace}-tags-view`, + title: t('common.tagsView'), + intro: t('common.tagsViewDes'), + position: 'bottom' + } + ] + + const defaultOptions: Options = options || { + prevLabel: t('common.prevLabel'), + nextLabel: t('common.nextLabel'), + skipLabel: t('common.skipLabel'), + doneLabel: t('common.doneLabel') + } + + const introRef: IntroJs = introJs() + + introRef.addSteps(defaultSetps).setOptions(defaultOptions) + + return { + introRef + } +} diff --git a/src/hooks/web/useLocale.ts b/src/hooks/web/useLocale.ts new file mode 100644 index 0000000..c65070e --- /dev/null +++ b/src/hooks/web/useLocale.ts @@ -0,0 +1,35 @@ +import { i18n } from '@/plugins/vueI18n' +import { useLocaleStoreWithOut } from '@/store/modules/locale' +import { setHtmlPageLang } from '@/plugins/vueI18n/helper' + +const setI18nLanguage = (locale: LocaleType) => { + const localeStore = useLocaleStoreWithOut() + + if (i18n.mode === 'legacy') { + i18n.global.locale = locale + } else { + ;(i18n.global.locale as any).value = locale + } + localeStore.setCurrentLocale({ + lang: locale + }) + setHtmlPageLang(locale) +} + +export const useLocale = () => { + // Switching the language will change the locale of useI18n + // And submit to configuration modification + const changeLocale = async (locale: LocaleType) => { + const globalI18n = i18n.global + + const langModule = await import(`../../locales/${locale}.ts`) + + globalI18n.setLocaleMessage(locale, langModule.default) + + setI18nLanguage(locale) + } + + return { + changeLocale + } +} diff --git a/src/hooks/web/useMessage.ts b/src/hooks/web/useMessage.ts new file mode 100644 index 0000000..ac2b552 --- /dev/null +++ b/src/hooks/web/useMessage.ts @@ -0,0 +1,95 @@ +import { ElMessage, ElMessageBox, ElNotification } from 'element-plus' +import { useI18n } from './useI18n' +export const useMessage = () => { + const { t } = useI18n() + return { + // 消息提示 + info(content: string) { + ElMessage.info(content) + }, + // 错误消息 + error(content: string) { + ElMessage.error(content) + }, + // 成功消息 + success(content: string) { + ElMessage.success(content) + }, + // 警告消息 + warning(content: string) { + ElMessage.warning(content) + }, + // 弹出提示 + alert(content: string) { + ElMessageBox.alert(content, t('common.confirmTitle')) + }, + // 错误提示 + alertError(content: string) { + ElMessageBox.alert(content, t('common.confirmTitle'), { type: 'error' }) + }, + // 成功提示 + alertSuccess(content: string) { + ElMessageBox.alert(content, t('common.confirmTitle'), { type: 'success' }) + }, + // 警告提示 + alertWarning(content: string) { + ElMessageBox.alert(content, t('common.confirmTitle'), { type: 'warning' }) + }, + // 通知提示 + notify(content: string) { + ElNotification.info(content) + }, + // 错误通知 + notifyError(content: string) { + ElNotification.error(content) + }, + // 成功通知 + notifySuccess(content: string) { + ElNotification.success(content) + }, + // 警告通知 + notifyWarning(content: string) { + ElNotification.warning(content) + }, + // 确认窗体 + confirm(content: string, tip?: string) { + return ElMessageBox.confirm(content, tip ? tip : t('common.confirmTitle'), { + confirmButtonText: t('common.ok'), + cancelButtonText: t('common.cancel'), + type: 'warning' + }) + }, + // 删除窗体 + delConfirm(content?: string, tip?: string) { + return ElMessageBox.confirm( + content ? content : t('common.delMessage'), + tip ? tip : t('common.confirmTitle'), + { + confirmButtonText: t('common.ok'), + cancelButtonText: t('common.cancel'), + type: 'warning' + } + ) + }, + // 导出窗体 + exportConfirm(content?: string, tip?: string) { + return ElMessageBox.confirm( + content ? content : t('common.exportMessage'), + tip ? tip : t('common.confirmTitle'), + { + confirmButtonText: t('common.ok'), + cancelButtonText: t('common.cancel'), + type: 'warning' + } + ) + }, + // 提交内容 + prompt(content: string, tip: string) { + return ElMessageBox.prompt(content, tip, { + confirmButtonText: t('common.ok'), + cancelButtonText: t('common.cancel'), + type: 'warning' + }) + } + } +} diff --git a/src/hooks/web/useNProgress.ts b/src/hooks/web/useNProgress.ts new file mode 100644 index 0000000..6d8c0b9 --- /dev/null +++ b/src/hooks/web/useNProgress.ts @@ -0,0 +1,33 @@ +import { useCssVar } from '@vueuse/core' +import type { NProgressOptions } from 'nprogress' +import NProgress from 'nprogress' +import 'nprogress/nprogress.css' + +const primaryColor = useCssVar('--el-color-primary', document.documentElement) + +export const useNProgress = () => { + NProgress.configure({ showSpinner: false } as NProgressOptions) + + const initColor = async () => { + await nextTick() + const bar = document.getElementById('nprogress')?.getElementsByClassName('bar')[0] as ElRef + if (bar) { + bar.style.background = unref(primaryColor.value) + } + } + + initColor() + + const start = () => { + NProgress.start() + } + + const done = () => { + NProgress.done() + } + + return { + start, + done + } +} diff --git a/src/hooks/web/usePageLoading.ts b/src/hooks/web/usePageLoading.ts new file mode 100644 index 0000000..bb89457 --- /dev/null +++ b/src/hooks/web/usePageLoading.ts @@ -0,0 +1,18 @@ +import { useAppStoreWithOut } from '@/store/modules/app' + +const appStore = useAppStoreWithOut() + +export const usePageLoading = () => { + const loadStart = () => { + appStore.setPageLoading(true) + } + + const loadDone = () => { + appStore.setPageLoading(false) + } + + return { + loadStart, + loadDone + } +} diff --git a/src/hooks/web/useTable.ts b/src/hooks/web/useTable.ts new file mode 100644 index 0000000..5ff8a51 --- /dev/null +++ b/src/hooks/web/useTable.ts @@ -0,0 +1,238 @@ +import download from '@/utils/download' +import { Table, TableExpose } from '@/components/Table' +import { ElMessage, ElMessageBox, ElTable } from 'element-plus' +import { computed, nextTick, reactive, ref, unref, watch } from 'vue' +import type { TableProps } from '@/components/Table/src/types' + +import { TableSetPropsType } from '@/types/table' + +const { t } = useI18n() +interface ResponseType { + list: T[] + total?: number +} + +interface UseTableConfig { + getListApi: (option: any) => Promise + delListApi?: (option: any) => Promise + exportListApi?: (option: any) => Promise + // 返回数据格式配置 + response?: ResponseType + // 默认传递的参数 + defaultParams?: Recordable + props?: TableProps +} + +interface TableObject { + pageSize: number + currentPage: number + total: number + tableList: T[] + params: any + loading: boolean + exportLoading: boolean + currentRow: Nullable + sort: any +} + +export const useTable = (config?: UseTableConfig) => { + const tableObject = reactive>({ + // 页数 + pageSize: 10, + // 当前页 + currentPage: 1, + // 总条数 + total: 10, + // 表格数据 + tableList: [], + // AxiosConfig 配置 + params: { + ...(config?.defaultParams || {}) + }, + // 加载中 + loading: true, + // 导出加载中 + exportLoading: false, + // 当前行的数据 + currentRow: null, + // 排序 + sort: { + order: '', // 排序规则 + prop: '' // 排序字段 + }, + }) + + const paramsObj = computed(() => { + return { + ...tableObject.params, + pageSize: tableObject.pageSize, + pageNo: tableObject.currentPage, + sort: tableObject.sort.prop, + by: tableObject.sort.order == 'descending'?'DESC':'ASC' + } + }) + + watch( + () => tableObject.currentPage, + () => { + methods.getList() + } + ) + + watch( + () => tableObject.pageSize, + () => { + // 当前页不为1时,修改页数后会导致多次调用getList方法 + if (tableObject.currentPage === 1) { + methods.getList() + } else { + tableObject.currentPage = 1 + methods.getList() + } + } + ) + + watch( + () => tableObject.sort, + () => { + methods.getList() + } + ) + + // Table实例 + const tableRef = ref() + + // ElTable实例 + const elTableRef = ref>() + + const register = (ref: typeof Table & TableExpose, elRef: ComponentRef) => { + tableRef.value = ref + elTableRef.value = elRef + } + + const getTable = async () => { + await nextTick() + const table = unref(tableRef) + if (!table) { + console.error('The table is not registered. Please use the register method to register') + } + return table + } + + const delData = async (ids: string | number | string[] | number[]) => { + let idsLength = 1 + if (ids instanceof Array) { + idsLength = ids.length + await Promise.all( + ids.map(async (id: string | number) => { + await (config?.delListApi && config?.delListApi(id)) + }) + ) + } else { + await (config?.delListApi && config?.delListApi(ids)) + } + ElMessage.success(t('common.delSuccess')) + + // 计算出临界点 + tableObject.currentPage = + tableObject.total % tableObject.pageSize === idsLength || tableObject.pageSize === 1 + ? tableObject.currentPage > 1 + ? tableObject.currentPage - 1 + : tableObject.currentPage + : tableObject.currentPage + await methods.getList() + } + + const methods = { + getList: async () => { + tableObject.loading = true + const res = await config?.getListApi(unref(paramsObj)).finally(() => { + tableObject.loading = false + }) + if (res) { + tableObject.tableList = (res as unknown as ResponseType).list + tableObject.total = (res as unknown as ResponseType).total ?? 0 + } + }, + setProps: async (props: TableProps = {}) => { + const table = await getTable() + table?.setProps(props) + }, + setColumn: async (columnProps: TableSetPropsType[]) => { + const table = await getTable() + table?.setColumn(columnProps) + }, + getSelections: async () => { + const table = await getTable() + return (table?.selections || []) as T[] + }, + // 与Search组件结合 + setSearchParams: (data: Recordable) => { + tableObject.params = Object.assign(tableObject.params, { + pageSize: tableObject.pageSize, + pageNo: 1, + ...data + }) + // 页码不等于1时更新页码重新获取数据,页码等于1时重新获取数据 + if (tableObject.currentPage !== 1) { + tableObject.currentPage = 1 + } else { + methods.getList() + } + }, + // 删除数据 + delList: async ( + ids: string | number | string[] | number[], + multiple: boolean, + message = true + ) => { + const tableRef = await getTable() + if (multiple) { + if (!tableRef?.selections.length) { + ElMessage.warning(t('common.delNoData')) + return + } + } + if (message) { + ElMessageBox.confirm(t('common.delMessage'), t('common.confirmTitle'), { + confirmButtonText: t('common.ok'), + cancelButtonText: t('common.cancel'), + type: 'warning' + }).then(async () => { + await delData(ids) + }) + } else { + await delData(ids) + } + }, + // 导出列表 + exportList: async (fileName: string) => { + tableObject.exportLoading = true + ElMessageBox.confirm(t('common.exportMessage'), t('common.confirmTitle'), { + confirmButtonText: t('common.ok'), + cancelButtonText: t('common.cancel'), + type: 'warning' + }) + .then(async () => { + const res = await config?.exportListApi?.(unref(paramsObj) as unknown as T) + if (res) { + download.excel(res as unknown as Blob, fileName) + } + }) + .finally(() => { + tableObject.exportLoading = false + }) + } + } + + config?.props && methods.setProps(config.props) + + return { + register, + elTableRef, + tableObject, + methods, + // add by 芋艿:返回 tableMethods 属性,和 tableObject 更统一 + tableMethods: methods + } +} diff --git a/src/hooks/web/useTimeAgo.ts b/src/hooks/web/useTimeAgo.ts new file mode 100644 index 0000000..a6da281 --- /dev/null +++ b/src/hooks/web/useTimeAgo.ts @@ -0,0 +1,49 @@ +import { useTimeAgo as useTimeAgoCore, UseTimeAgoMessages } from '@vueuse/core' +import { useLocaleStoreWithOut } from '@/store/modules/locale' + +const TIME_AGO_MESSAGE_MAP: { + 'zh-CN': UseTimeAgoMessages + en: UseTimeAgoMessages +} = { + // @ts-ignore + 'zh-CN': { + justNow: '刚刚', + past: (n) => (n.match(/\d/) ? `${n}前` : n), + future: (n) => (n.match(/\d/) ? `${n}后` : n), + month: (n, past) => (n === 1 ? (past ? '上个月' : '下个月') : `${n} 个月`), + year: (n, past) => (n === 1 ? (past ? '去年' : '明年') : `${n} 年`), + day: (n, past) => (n === 1 ? (past ? '昨天' : '明天') : `${n} 天`), + week: (n, past) => (n === 1 ? (past ? '上周' : '下周') : `${n} 周`), + hour: (n) => `${n} 小时`, + minute: (n) => `${n} 分钟`, + second: (n) => `${n} 秒` + }, + // @ts-ignore + en: { + justNow: 'just now', + past: (n) => (n.match(/\d/) ? `${n} ago` : n), + future: (n) => (n.match(/\d/) ? `in ${n}` : n), + month: (n, past) => + n === 1 ? (past ? 'last month' : 'next month') : `${n} month${n > 1 ? 's' : ''}`, + year: (n, past) => + n === 1 ? (past ? 'last year' : 'next year') : `${n} year${n > 1 ? 's' : ''}`, + day: (n, past) => (n === 1 ? (past ? 'yesterday' : 'tomorrow') : `${n} day${n > 1 ? 's' : ''}`), + week: (n, past) => + n === 1 ? (past ? 'last week' : 'next week') : `${n} week${n > 1 ? 's' : ''}`, + hour: (n) => `${n} hour${n > 1 ? 's' : ''}`, + minute: (n) => `${n} minute${n > 1 ? 's' : ''}`, + second: (n) => `${n} second${n > 1 ? 's' : ''}` + } +} + +export const useTimeAgo = (time: Date | number | string) => { + const localeStore = useLocaleStoreWithOut() + + const currentLocale = computed(() => localeStore.getCurrentLocale) + + const timeAgo = useTimeAgoCore(time, { + messages: TIME_AGO_MESSAGE_MAP[unref(currentLocale).lang] + }) + + return timeAgo +} diff --git a/src/hooks/web/useTitle.ts b/src/hooks/web/useTitle.ts new file mode 100644 index 0000000..020a9b7 --- /dev/null +++ b/src/hooks/web/useTitle.ts @@ -0,0 +1,24 @@ +import { watch, ref } from 'vue' +import { isString } from '@/utils/is' +import { useAppStoreWithOut } from '@/store/modules/app' + +const appStore = useAppStoreWithOut() + +export const useTitle = (newTitle?: string) => { + const { t } = useI18n() + const title = ref( + newTitle ? `${appStore.getTitle} - ${t(newTitle as string)}` : appStore.getTitle + ) + + watch( + title, + (n, o) => { + if (isString(n) && n !== o && document) { + document.title = n + } + }, + { immediate: true } + ) + + return title +} diff --git a/src/hooks/web/useValidator.ts b/src/hooks/web/useValidator.ts new file mode 100644 index 0000000..0c16fa3 --- /dev/null +++ b/src/hooks/web/useValidator.ts @@ -0,0 +1,62 @@ +const { t } = useI18n() + +type Callback = (error?: string | Error | undefined) => void + +interface LengthRange { + min: number + max: number + message: string +} + +export const useValidator = () => { + const required = (message?: string) => { + return { + required: true, + message: message || t('common.required') + } + } + + const lengthRange = (val: any, callback: Callback, options: LengthRange) => { + const { min, max, message } = options + if (val.length < min || val.length > max) { + callback(new Error(message)) + } else { + callback() + } + } + + const notSpace = (val: any, callback: Callback, message: string) => { + // 用户名不能有空格 + if (val.indexOf(' ') !== -1) { + callback(new Error(message)) + } else { + callback() + } + } + + const notSpecialCharacters = (val: any, callback: Callback, message: string) => { + // 密码不能是特殊字符 + if (/[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/gi.test(val)) { + callback(new Error(message)) + } else { + callback() + } + } + + // 两个字符串是否想等 + const isEqual = (val1: string, val2: string, callback: Callback, message: string) => { + if (val1 === val2) { + callback() + } else { + callback(new Error(message)) + } + } + + return { + required, + lengthRange, + notSpace, + notSpecialCharacters, + isEqual + } +} diff --git a/src/hooks/web/useWatermark.ts b/src/hooks/web/useWatermark.ts new file mode 100644 index 0000000..4a31359 --- /dev/null +++ b/src/hooks/web/useWatermark.ts @@ -0,0 +1,55 @@ +const domSymbol = Symbol('watermark-dom') + +export function useWatermark(appendEl: HTMLElement | null = document.body) { + let func: Fn = () => {} + const id = domSymbol.toString() + const clear = () => { + const domId = document.getElementById(id) + if (domId) { + const el = appendEl + el && el.removeChild(domId) + } + window.removeEventListener('resize', func) + } + const createWatermark = (str: string) => { + clear() + + const can = document.createElement('canvas') + can.width = 300 + can.height = 240 + + const cans = can.getContext('2d') + if (cans) { + cans.rotate((-20 * Math.PI) / 120) + cans.font = '15px Vedana' + cans.fillStyle = 'rgba(0, 0, 0, 0.15)' + cans.textAlign = 'left' + cans.textBaseline = 'middle' + cans.fillText(str, can.width / 20, can.height) + } + + const div = document.createElement('div') + div.id = id + div.style.pointerEvents = 'none' + div.style.top = '0px' + div.style.left = '0px' + div.style.position = 'absolute' + div.style.zIndex = '100000000' + div.style.width = document.documentElement.clientWidth + 'px' + div.style.height = document.documentElement.clientHeight + 'px' + div.style.background = 'url(' + can.toDataURL('image/png') + ') left top repeat' + const el = appendEl + el && el.appendChild(div) + return id + } + + function setWatermark(str: string) { + createWatermark(str) + func = () => { + createWatermark(str) + } + window.addEventListener('resize', func) + } + + return { setWatermark, clear } +} diff --git a/src/layout/Layout.vue b/src/layout/Layout.vue new file mode 100644 index 0000000..420341e --- /dev/null +++ b/src/layout/Layout.vue @@ -0,0 +1,78 @@ + + + diff --git a/src/layout/components/AppView.vue b/src/layout/components/AppView.vue new file mode 100644 index 0000000..ffdf11f --- /dev/null +++ b/src/layout/components/AppView.vue @@ -0,0 +1,61 @@ + + + diff --git a/src/layout/components/Breadcrumb/index.ts b/src/layout/components/Breadcrumb/index.ts new file mode 100644 index 0000000..93ffe70 --- /dev/null +++ b/src/layout/components/Breadcrumb/index.ts @@ -0,0 +1,3 @@ +import Breadcrumb from './src/Breadcrumb.vue' + +export { Breadcrumb } diff --git a/src/layout/components/Breadcrumb/src/Breadcrumb.vue b/src/layout/components/Breadcrumb/src/Breadcrumb.vue new file mode 100644 index 0000000..de03665 --- /dev/null +++ b/src/layout/components/Breadcrumb/src/Breadcrumb.vue @@ -0,0 +1,128 @@ + + + diff --git a/src/layout/components/Breadcrumb/src/helper.ts b/src/layout/components/Breadcrumb/src/helper.ts new file mode 100644 index 0000000..fb3ec19 --- /dev/null +++ b/src/layout/components/Breadcrumb/src/helper.ts @@ -0,0 +1,31 @@ +import { pathResolve } from '@/utils/routerHelper' +import type { RouteMeta } from 'vue-router' + +export const filterBreadcrumb = ( + routes: AppRouteRecordRaw[], + parentPath = '' +): AppRouteRecordRaw[] => { + const res: AppRouteRecordRaw[] = [] + + for (const route of routes) { + const meta = route?.meta as RouteMeta + if (meta.hidden && !meta.canTo) { + continue + } + + const data: AppRouteRecordRaw = + !meta.alwaysShow && route.children?.length === 1 + ? { ...route.children[0], path: pathResolve(route.path, route.children[0].path) } + : { ...route } + + data.path = pathResolve(parentPath, data.path) + + if (data.children) { + data.children = filterBreadcrumb(data.children, data.path) + } + if (data) { + res.push(data) + } + } + return res +} diff --git a/src/layout/components/Collapse/index.ts b/src/layout/components/Collapse/index.ts new file mode 100644 index 0000000..73f65a3 --- /dev/null +++ b/src/layout/components/Collapse/index.ts @@ -0,0 +1,3 @@ +import Collapse from './src/Collapse.vue' + +export { Collapse } diff --git a/src/layout/components/Collapse/src/Collapse.vue b/src/layout/components/Collapse/src/Collapse.vue new file mode 100644 index 0000000..ecb6890 --- /dev/null +++ b/src/layout/components/Collapse/src/Collapse.vue @@ -0,0 +1,36 @@ + + + diff --git a/src/layout/components/ContextMenu/index.ts b/src/layout/components/ContextMenu/index.ts new file mode 100644 index 0000000..2a7c1f0 --- /dev/null +++ b/src/layout/components/ContextMenu/index.ts @@ -0,0 +1,10 @@ +import ContextMenu from './src/ContextMenu.vue' +import { ElDropdown } from 'element-plus' +import type { RouteLocationNormalizedLoaded } from 'vue-router' + +export interface ContextMenuExpose { + elDropdownMenuRef: ComponentRef + tagItem: RouteLocationNormalizedLoaded +} + +export { ContextMenu } diff --git a/src/layout/components/ContextMenu/src/ContextMenu.vue b/src/layout/components/ContextMenu/src/ContextMenu.vue new file mode 100644 index 0000000..90eea4c --- /dev/null +++ b/src/layout/components/ContextMenu/src/ContextMenu.vue @@ -0,0 +1,76 @@ + + + diff --git a/src/layout/components/Footer/index.ts b/src/layout/components/Footer/index.ts new file mode 100644 index 0000000..bd052e0 --- /dev/null +++ b/src/layout/components/Footer/index.ts @@ -0,0 +1,3 @@ +import Footer from './src/Footer.vue' + +export { Footer } diff --git a/src/layout/components/Footer/src/Footer.vue b/src/layout/components/Footer/src/Footer.vue new file mode 100644 index 0000000..c350e38 --- /dev/null +++ b/src/layout/components/Footer/src/Footer.vue @@ -0,0 +1,24 @@ + + + diff --git a/src/layout/components/LocaleDropdown/index.ts b/src/layout/components/LocaleDropdown/index.ts new file mode 100644 index 0000000..d02e640 --- /dev/null +++ b/src/layout/components/LocaleDropdown/index.ts @@ -0,0 +1,3 @@ +import LocaleDropdown from './src/LocaleDropdown.vue' + +export { LocaleDropdown } diff --git a/src/layout/components/LocaleDropdown/src/LocaleDropdown.vue b/src/layout/components/LocaleDropdown/src/LocaleDropdown.vue new file mode 100644 index 0000000..95132db --- /dev/null +++ b/src/layout/components/LocaleDropdown/src/LocaleDropdown.vue @@ -0,0 +1,52 @@ + + + diff --git a/src/layout/components/Logo/index.ts b/src/layout/components/Logo/index.ts new file mode 100644 index 0000000..1c4224c --- /dev/null +++ b/src/layout/components/Logo/index.ts @@ -0,0 +1,3 @@ +import Logo from './src/Logo.vue' + +export { Logo } diff --git a/src/layout/components/Logo/src/Logo.vue b/src/layout/components/Logo/src/Logo.vue new file mode 100644 index 0000000..474388d --- /dev/null +++ b/src/layout/components/Logo/src/Logo.vue @@ -0,0 +1,88 @@ + + + diff --git a/src/layout/components/Menu/index.ts b/src/layout/components/Menu/index.ts new file mode 100644 index 0000000..a6ec696 --- /dev/null +++ b/src/layout/components/Menu/index.ts @@ -0,0 +1,3 @@ +import Menu from './src/Menu.vue' + +export { Menu } diff --git a/src/layout/components/Menu/src/Menu.vue b/src/layout/components/Menu/src/Menu.vue new file mode 100644 index 0000000..9033616 --- /dev/null +++ b/src/layout/components/Menu/src/Menu.vue @@ -0,0 +1,290 @@ + + + + + diff --git a/src/layout/components/Menu/src/components/useRenderMenuItem.tsx b/src/layout/components/Menu/src/components/useRenderMenuItem.tsx new file mode 100644 index 0000000..17a520a --- /dev/null +++ b/src/layout/components/Menu/src/components/useRenderMenuItem.tsx @@ -0,0 +1,59 @@ +import { ElSubMenu, ElMenuItem } from 'element-plus' +import type { RouteMeta } from 'vue-router' +import { hasOneShowingChild } from '../helper' +import { isUrl } from '@/utils/is' +import { useRenderMenuTitle } from './useRenderMenuTitle' +import { useDesign } from '@/hooks/web/useDesign' +import { pathResolve } from '@/utils/routerHelper' + +export const useRenderMenuItem = ( + // allRouters: AppRouteRecordRaw[] = [], + menuMode: 'vertical' | 'horizontal' +) => { + const renderMenuItem = (routers: AppRouteRecordRaw[], parentPath = '/') => { + return routers.map((v) => { + const meta = (v.meta ?? {}) as RouteMeta + if (!meta.hidden) { + const { oneShowingChild, onlyOneChild } = hasOneShowingChild(v.children, v) + const fullPath = isUrl(v.path) ? v.path : pathResolve(parentPath, v.path) // getAllParentPath(allRouters, v.path).join('/') + + const { renderMenuTitle } = useRenderMenuTitle() + + if ( + oneShowingChild && + (!onlyOneChild?.children || onlyOneChild?.noShowingChildren) && + !meta?.alwaysShow + ) { + return ( + + {{ + default: () => renderMenuTitle(onlyOneChild ? onlyOneChild?.meta : meta) + }} + + ) + } else { + const { getPrefixCls } = useDesign() + + const preFixCls = getPrefixCls('menu-popper') + return ( + + {{ + title: () => renderMenuTitle(meta), + default: () => renderMenuItem(v.children!, fullPath) + }} + + ) + } + } + }) + } + + return { + renderMenuItem + } +} diff --git a/src/layout/components/Menu/src/components/useRenderMenuTitle.tsx b/src/layout/components/Menu/src/components/useRenderMenuTitle.tsx new file mode 100644 index 0000000..fc30b90 --- /dev/null +++ b/src/layout/components/Menu/src/components/useRenderMenuTitle.tsx @@ -0,0 +1,22 @@ +import type { RouteMeta } from 'vue-router' +import { Icon } from '@/components/Icon' + +export const useRenderMenuTitle = () => { + const renderMenuTitle = (meta: RouteMeta) => { + const { t } = useI18n() + const { title = 'Please set title', icon } = meta + + return icon ? ( + <> + + {t(title as string)} + + ) : ( + {t(title as string)} + ) + } + + return { + renderMenuTitle + } +} diff --git a/src/layout/components/Menu/src/helper.ts b/src/layout/components/Menu/src/helper.ts new file mode 100644 index 0000000..c26f5f4 --- /dev/null +++ b/src/layout/components/Menu/src/helper.ts @@ -0,0 +1,54 @@ +import type { RouteMeta } from 'vue-router' +import { findPath } from '@/utils/tree' + +type OnlyOneChildType = AppRouteRecordRaw & { noShowingChildren?: boolean } + +interface HasOneShowingChild { + oneShowingChild?: boolean + onlyOneChild?: OnlyOneChildType +} + +export const getAllParentPath = (treeData: T[], path: string) => { + const menuList = findPath(treeData, (n) => n.path === path) as AppRouteRecordRaw[] + return (menuList || []).map((item) => item.path) +} + +export const hasOneShowingChild = ( + children: AppRouteRecordRaw[] = [], + parent: AppRouteRecordRaw +): HasOneShowingChild => { + const onlyOneChild = ref() + + const showingChildren = children.filter((v) => { + const meta = (v.meta ?? {}) as RouteMeta + if (meta.hidden) { + return false + } else { + // Temp set(will be used if only has one showing child) + onlyOneChild.value = v + return true + } + }) + + // When there is only one child router, the child router is displayed by default + if (showingChildren.length === 1) { + return { + oneShowingChild: true, + onlyOneChild: unref(onlyOneChild) + } + } + + // Show parent if there are no child router to display + if (!showingChildren.length) { + onlyOneChild.value = { ...parent, path: '', noShowingChildren: true } + return { + oneShowingChild: true, + onlyOneChild: unref(onlyOneChild) + } + } + + return { + oneShowingChild: false, + onlyOneChild: unref(onlyOneChild) + } +} diff --git a/src/layout/components/Message/index.ts b/src/layout/components/Message/index.ts new file mode 100644 index 0000000..dfe0207 --- /dev/null +++ b/src/layout/components/Message/index.ts @@ -0,0 +1,3 @@ +import Message from './src/Message.vue' + +export { Message } diff --git a/src/layout/components/Message/src/Message.vue b/src/layout/components/Message/src/Message.vue new file mode 100644 index 0000000..28f796b --- /dev/null +++ b/src/layout/components/Message/src/Message.vue @@ -0,0 +1,125 @@ + + + diff --git a/src/layout/components/Screenfull/index.ts b/src/layout/components/Screenfull/index.ts new file mode 100644 index 0000000..faec2d8 --- /dev/null +++ b/src/layout/components/Screenfull/index.ts @@ -0,0 +1,3 @@ +import Screenfull from './src/Screenfull.vue' + +export { Screenfull } diff --git a/src/layout/components/Screenfull/src/Screenfull.vue b/src/layout/components/Screenfull/src/Screenfull.vue new file mode 100644 index 0000000..4c045f2 --- /dev/null +++ b/src/layout/components/Screenfull/src/Screenfull.vue @@ -0,0 +1,32 @@ + + + diff --git a/src/layout/components/Setting/index.ts b/src/layout/components/Setting/index.ts new file mode 100644 index 0000000..b64c9ad --- /dev/null +++ b/src/layout/components/Setting/index.ts @@ -0,0 +1,3 @@ +import Setting from './src/Setting.vue' + +export { Setting } diff --git a/src/layout/components/Setting/src/Setting.vue b/src/layout/components/Setting/src/Setting.vue new file mode 100644 index 0000000..e1908b6 --- /dev/null +++ b/src/layout/components/Setting/src/Setting.vue @@ -0,0 +1,299 @@ + + + + + diff --git a/src/layout/components/Setting/src/components/ColorRadioPicker.vue b/src/layout/components/Setting/src/components/ColorRadioPicker.vue new file mode 100644 index 0000000..fcc5e75 --- /dev/null +++ b/src/layout/components/Setting/src/components/ColorRadioPicker.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/src/layout/components/Setting/src/components/InterfaceDisplay.vue b/src/layout/components/Setting/src/components/InterfaceDisplay.vue new file mode 100644 index 0000000..ebbbf4b --- /dev/null +++ b/src/layout/components/Setting/src/components/InterfaceDisplay.vue @@ -0,0 +1,224 @@ + + + diff --git a/src/layout/components/Setting/src/components/LayoutRadioPicker.vue b/src/layout/components/Setting/src/components/LayoutRadioPicker.vue new file mode 100644 index 0000000..801686c --- /dev/null +++ b/src/layout/components/Setting/src/components/LayoutRadioPicker.vue @@ -0,0 +1,172 @@ + + + + + diff --git a/src/layout/components/SizeDropdown/index.ts b/src/layout/components/SizeDropdown/index.ts new file mode 100644 index 0000000..516488d --- /dev/null +++ b/src/layout/components/SizeDropdown/index.ts @@ -0,0 +1,3 @@ +import SizeDropdown from './src/SizeDropdown.vue' + +export { SizeDropdown } diff --git a/src/layout/components/SizeDropdown/src/SizeDropdown.vue b/src/layout/components/SizeDropdown/src/SizeDropdown.vue new file mode 100644 index 0000000..3e15224 --- /dev/null +++ b/src/layout/components/SizeDropdown/src/SizeDropdown.vue @@ -0,0 +1,40 @@ + + + diff --git a/src/layout/components/TabMenu/index.ts b/src/layout/components/TabMenu/index.ts new file mode 100644 index 0000000..b5fd71c --- /dev/null +++ b/src/layout/components/TabMenu/index.ts @@ -0,0 +1,3 @@ +import TabMenu from './src/TabMenu.vue' + +export { TabMenu } diff --git a/src/layout/components/TabMenu/src/TabMenu.vue b/src/layout/components/TabMenu/src/TabMenu.vue new file mode 100644 index 0000000..c4f63a3 --- /dev/null +++ b/src/layout/components/TabMenu/src/TabMenu.vue @@ -0,0 +1,240 @@ + + + diff --git a/src/layout/components/TabMenu/src/helper.ts b/src/layout/components/TabMenu/src/helper.ts new file mode 100644 index 0000000..cce3932 --- /dev/null +++ b/src/layout/components/TabMenu/src/helper.ts @@ -0,0 +1,51 @@ +import { getAllParentPath } from '@/layout/components/Menu/src/helper' +import type { RouteMeta } from 'vue-router' +import { isUrl } from '@/utils/is' +import { cloneDeep } from 'lodash-es' + +export type TabMapTypes = { + [key: string]: string[] +} + +export const tabPathMap = reactive({}) + +export const initTabMap = (routes: AppRouteRecordRaw[]) => { + for (const v of routes) { + const meta = (v.meta ?? {}) as RouteMeta + if (!meta?.hidden) { + tabPathMap[v.path] = [] + } + } +} + +export const filterMenusPath = ( + routes: AppRouteRecordRaw[], + allRoutes: AppRouteRecordRaw[] +): AppRouteRecordRaw[] => { + const res: AppRouteRecordRaw[] = [] + for (const v of routes) { + let data: Nullable = null + const meta = (v.meta ?? {}) as RouteMeta + if (!meta.hidden || meta.canTo) { + const allParentPath = getAllParentPath(allRoutes, v.path) + + const fullPath = isUrl(v.path) ? v.path : allParentPath.join('/') + + data = cloneDeep(v) + data.path = fullPath + if (v.children && data) { + data.children = filterMenusPath(v.children, allRoutes) + } + + if (data) { + res.push(data) + } + + if (allParentPath.length && Reflect.has(tabPathMap, allParentPath[0])) { + tabPathMap[allParentPath[0]].push(fullPath) + } + } + } + + return res +} diff --git a/src/layout/components/TagsView/index.ts b/src/layout/components/TagsView/index.ts new file mode 100644 index 0000000..30e604a --- /dev/null +++ b/src/layout/components/TagsView/index.ts @@ -0,0 +1,3 @@ +import TagsView from './src/TagsView.vue' + +export { TagsView } diff --git a/src/layout/components/TagsView/src/TagsView.vue b/src/layout/components/TagsView/src/TagsView.vue new file mode 100644 index 0000000..7db0cf6 --- /dev/null +++ b/src/layout/components/TagsView/src/TagsView.vue @@ -0,0 +1,585 @@ + + + + + diff --git a/src/layout/components/TagsView/src/helper.ts b/src/layout/components/TagsView/src/helper.ts new file mode 100644 index 0000000..22f6a50 --- /dev/null +++ b/src/layout/components/TagsView/src/helper.ts @@ -0,0 +1,21 @@ +import type { RouteMeta, RouteLocationNormalizedLoaded } from 'vue-router' +import { pathResolve } from '@/utils/routerHelper' + +export const filterAffixTags = (routes: AppRouteRecordRaw[], parentPath = '') => { + let tags: RouteLocationNormalizedLoaded[] = [] + routes.forEach((route) => { + const meta = route.meta as RouteMeta + const tagPath = pathResolve(parentPath, route.path) + if (meta?.affix) { + tags.push({ ...route, path: tagPath, fullPath: tagPath } as RouteLocationNormalizedLoaded) + } + if (route.children) { + const tempTags: RouteLocationNormalizedLoaded[] = filterAffixTags(route.children, tagPath) + if (tempTags.length >= 1) { + tags = [...tags, ...tempTags] + } + } + }) + + return tags +} diff --git a/src/layout/components/ThemeSwitch/index.ts b/src/layout/components/ThemeSwitch/index.ts new file mode 100644 index 0000000..823a276 --- /dev/null +++ b/src/layout/components/ThemeSwitch/index.ts @@ -0,0 +1,3 @@ +import ThemeSwitch from './src/ThemeSwitch.vue' + +export { ThemeSwitch } diff --git a/src/layout/components/ThemeSwitch/src/ThemeSwitch.vue b/src/layout/components/ThemeSwitch/src/ThemeSwitch.vue new file mode 100644 index 0000000..39a8cfd --- /dev/null +++ b/src/layout/components/ThemeSwitch/src/ThemeSwitch.vue @@ -0,0 +1,46 @@ + + + + diff --git a/src/layout/components/ToolHeader.vue b/src/layout/components/ToolHeader.vue new file mode 100644 index 0000000..ec7882d --- /dev/null +++ b/src/layout/components/ToolHeader.vue @@ -0,0 +1,90 @@ + + + diff --git a/src/layout/components/UserInfo/index.ts b/src/layout/components/UserInfo/index.ts new file mode 100644 index 0000000..c3a34ab --- /dev/null +++ b/src/layout/components/UserInfo/index.ts @@ -0,0 +1,3 @@ +import UserInfo from './src/UserInfo.vue' + +export { UserInfo } diff --git a/src/layout/components/UserInfo/src/UserInfo.vue b/src/layout/components/UserInfo/src/UserInfo.vue new file mode 100644 index 0000000..3c03ea7 --- /dev/null +++ b/src/layout/components/UserInfo/src/UserInfo.vue @@ -0,0 +1,78 @@ + + + diff --git a/src/layout/components/useRenderLayout.tsx b/src/layout/components/useRenderLayout.tsx new file mode 100644 index 0000000..46a1e60 --- /dev/null +++ b/src/layout/components/useRenderLayout.tsx @@ -0,0 +1,306 @@ +import { computed } from 'vue' +import { useAppStore } from '@/store/modules/app' +import { Menu } from '@/layout/components/Menu' +import { TabMenu } from '@/layout/components/TabMenu' +import { TagsView } from '@/layout/components/TagsView' +import { Logo } from '@/layout/components/Logo' +import AppView from './AppView.vue' +import ToolHeader from './ToolHeader.vue' +import { ElScrollbar } from 'element-plus' +import { useDesign } from '@/hooks/web/useDesign' + +const { getPrefixCls } = useDesign() + +const prefixCls = getPrefixCls('layout') + +const appStore = useAppStore() + +const pageLoading = computed(() => appStore.getPageLoading) + +// 标签页 +const tagsView = computed(() => appStore.getTagsView) + +// 菜单折叠 +const collapse = computed(() => appStore.getCollapse) + +// logo +const logo = computed(() => appStore.logo) + +// 固定头部 +const fixedHeader = computed(() => appStore.getFixedHeader) + +// 是否是移动端 +const mobile = computed(() => appStore.getMobile) + +// 固定菜单 +const fixedMenu = computed(() => appStore.getFixedMenu) + +export const useRenderLayout = () => { + const renderClassic = () => { + return ( + <> +
+ {logo.value ? ( + + ) : undefined} + +
+
+ +
+ + + {tagsView.value ? ( + + ) : undefined} +
+ + +
+
+ + ) + } + + const renderTopLeft = () => { + return ( + <> +
+ {logo.value ? : undefined} + + +
+
+ +
+ + {tagsView.value ? ( + + ) : undefined} + + + +
+
+ + ) + } + + const renderTop = () => { + return ( + <> +
+ {logo.value ? : undefined} + + +
+
+ + {tagsView.value ? ( + + ) : undefined} + + + +
+ + ) + } + + const renderCutMenu = () => { + return ( + <> +
+ {logo.value ? : undefined} + + +
+
+ +
+ + {tagsView.value ? ( + + ) : undefined} + + + +
+
+ + ) + } + + return { + renderClassic, + renderTopLeft, + renderTop, + renderCutMenu + } +} diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts new file mode 100644 index 0000000..4f4d489 --- /dev/null +++ b/src/locales/en-US.ts @@ -0,0 +1,447 @@ +export default { + common: { + inputText: 'Please input', + selectText: 'Please select', + startTimeText: 'Start time', + endTimeText: 'End time', + login: 'Login', + required: 'This is required', + loginOut: 'Login out', + document: 'Document', + profile: 'User Center', + reminder: 'Reminder', + loginOutMessage: 'Exit the system?', + back: 'Back', + ok: 'OK', + save: 'Save', + cancel: 'Cancel', + close: 'Close', + reload: 'Reload current', + success: 'Success', + closeTab: 'Close current', + closeTheLeftTab: 'Close left', + closeTheRightTab: 'Close right', + closeOther: 'Close other', + closeAll: 'Close all', + prevLabel: 'Prev', + nextLabel: 'Next', + skipLabel: 'Jump', + doneLabel: 'End', + menu: 'Menu', + menuDes: 'Menu bar rendered in routed structure', + collapse: 'Collapse', + collapseDes: 'Expand and zoom the menu bar', + tagsView: 'Tags view', + tagsViewDes: 'Used to record routing history', + tool: 'Tool', + toolDes: 'Used to set up custom systems', + query: 'Query', + reset: 'Reset', + shrink: 'Put away', + expand: 'Expand', + confirmTitle: 'System Hint', + exportMessage: 'Whether to confirm export data item?', + importMessage: 'Whether to confirm import data item?', + createSuccess: 'Create Success', + updateSuccess: 'Update Success', + delMessage: 'Delete the selected data?', + delDataMessage: 'Delete the data?', + delNoData: 'Please select the data to delete', + delSuccess: 'Deleted successfully', + index: 'Index', + status: 'Status', + createTime: 'Create Time', + updateTime: 'Update Time', + copy: 'Copy', + copySuccess: 'Copy Success', + copyError: 'Copy Error' + }, + error: { + noPermission: `Sorry, you don't have permission to access this page.`, + pageError: 'Sorry, the page you visited does not exist.', + networkError: 'Sorry, the server reported an error.', + returnToHome: 'Return to home' + }, + permission: { + hasPermission: `Please set the operation permission label value`, + hasRole: `Please set the role permission tag value` + }, + setting: { + projectSetting: 'Project setting', + theme: 'Theme', + layout: 'Layout', + systemTheme: 'System theme', + menuTheme: 'Menu theme', + interfaceDisplay: 'Interface display', + breadcrumb: 'Breadcrumb', + breadcrumbIcon: 'Breadcrumb icon', + collapseMenu: 'Collapse menu', + hamburgerIcon: 'Hamburger icon', + screenfullIcon: 'Screenfull icon', + sizeIcon: 'Size icon', + localeIcon: 'Locale icon', + messageIcon: 'Message icon', + tagsView: 'Tags view', + logo: 'Logo', + greyMode: 'Grey mode', + fixedHeader: 'Fixed header', + headerTheme: 'Header theme', + cutMenu: 'Cut Menu', + copy: 'Copy', + clearAndReset: 'Clear cache and reset', + copySuccess: 'Copy success', + copyFailed: 'Copy failed', + footer: 'Footer', + uniqueOpened: 'Unique opened', + tagsViewIcon: 'Tags view icon', + reExperienced: 'Please exit the login experience again', + fixedMenu: 'Fixed menu' + }, + size: { + default: 'Default', + large: 'Large', + small: 'Small' + }, + login: { + welcome: 'Welcome to the system', + message: 'Backstage management system', + tenantname: 'TenantName', + username: 'Username', + password: 'Password', + code: 'verification code', + login: 'Sign in', + relogin: 'Sign in again', + otherLogin: 'Sign in with', + register: 'Register', + checkPassword: 'Confirm password', + remember: 'Remember me', + hasUser: 'Existing account? Go to login', + forgetPassword: 'Forget password?', + tenantNamePlaceholder: 'Please Enter Tenant Name', + usernamePlaceholder: 'Please Enter Username', + passwordPlaceholder: 'Please Enter Password', + codePlaceholder: 'Please Enter Verification Code', + mobileTitle: 'Mobile sign in', + mobileNumber: 'Mobile Number', + mobileNumberPlaceholder: 'Plaease Enter Mobile Number', + backLogin: 'back', + getSmsCode: 'Get SMS Code', + btnMobile: 'Mobile sign in', + btnQRCode: 'QR code sign in', + qrcode: 'Scan the QR code to log in', + btnRegister: 'Sign up', + SmsSendMsg: 'code has been sent' + }, + captcha: { + verification: 'Please complete security verification', + slide: 'Swipe right to complete verification', + point: 'Please click', + success: 'Verification succeeded', + fail: 'verification failed' + }, + router: { + login: 'Login', + home: 'Home', + analysis: 'Analysis', + workplace: 'Workplace' + }, + analysis: { + newUser: 'New user', + unreadInformation: 'Unread information', + transactionAmount: 'Transaction amount', + totalShopping: 'Total Shopping', + monthlySales: 'Monthly sales', + userAccessSource: 'User access source', + january: 'January', + february: 'February', + march: 'March', + april: 'April', + may: 'May', + june: 'June', + july: 'July', + august: 'August', + september: 'September', + october: 'October', + november: 'November', + december: 'December', + estimate: 'Estimate', + actual: 'Actual', + directAccess: 'Airect access', + mailMarketing: 'Mail marketing', + allianceAdvertising: 'Alliance advertising', + videoAdvertising: 'Video advertising', + searchEngines: 'Search engines', + weeklyUserActivity: 'Weekly user activity', + activeQuantity: 'Active quantity', + monday: 'Monday', + tuesday: 'Tuesday', + wednesday: 'Wednesday', + thursday: 'Thursday', + friday: 'Friday', + saturday: 'Saturday', + sunday: 'Sunday' + }, + workplace: { + welcome: 'Hello', + happyDay: 'Wish you happy every day!', + toady: `It's sunny today`, + notice: 'Announcement', + project: 'Project', + access: 'Project access', + toDo: 'To do', + introduction: 'A serious introduction', + shortcutOperation: 'Quick entry', + operation: 'Operation', + index: 'Index', + personal: 'Personal', + team: 'Team', + quote: 'Quote', + contribution: 'Contribution', + hot: 'Hot', + yield: 'Yield', + dynamic: 'Dynamic', + push: 'push', + follow: 'Follow' + }, + form: { + input: 'Input', + inputNumber: 'InputNumber', + default: 'Default', + icon: 'Icon', + mixed: 'Mixed', + textarea: 'Textarea', + slot: 'Slot', + position: 'Position', + autocomplete: 'Autocomplete', + select: 'Select', + selectGroup: 'Select Group', + selectV2: 'SelectV2', + cascader: 'Cascader', + switch: 'Switch', + rate: 'Rate', + colorPicker: 'Color Picker', + transfer: 'Transfer', + render: 'Render', + radio: 'Radio', + button: 'Button', + checkbox: 'Checkbox', + slider: 'Slider', + datePicker: 'Date Picker', + shortcuts: 'Shortcuts', + today: 'Today', + yesterday: 'Yesterday', + aWeekAgo: 'A week ago', + week: 'Week', + year: 'Year', + month: 'Month', + dates: 'Dates', + daterange: 'Date Range', + monthrange: 'Month Range', + dateTimePicker: 'DateTimePicker', + dateTimerange: 'Datetime Range', + timePicker: 'Time Picker', + timeSelect: 'Time Select', + inputPassword: 'input Password', + passwordStrength: 'Password Strength', + operate: 'operate', + change: 'Change', + restore: 'Restore', + disabled: 'Disabled', + disablement: 'Disablement', + delete: 'Delete', + add: 'Add', + setValue: 'Set value', + resetValue: 'Reset value', + set: 'Set', + subitem: 'Subitem', + formValidation: 'Form validation', + verifyReset: 'Verify reset', + remark: 'Remark' + }, + watermark: { + watermark: 'Watermark' + }, + table: { + table: 'Table', + index: 'Index', + title: 'Title', + author: 'Author', + createTime: 'Create time', + action: 'Action', + pagination: 'pagination', + reserveIndex: 'Reserve index', + restoreIndex: 'Restore index', + showSelections: 'Show selections', + hiddenSelections: 'Restore selections', + showExpandedRows: 'Show expanded rows', + hiddenExpandedRows: 'Hidden expanded rows', + header: 'Header' + }, + action: { + create: 'Create', + add: 'Add', + del: 'Delete', + delete: 'Delete', + edit: 'Edit', + update: 'Update', + preview: 'Preview', + more: 'More', + sync: 'Sync', + save: 'Save', + detail: 'Detail', + export: 'Export', + import: 'Import', + generate: 'Generate', + logout: 'Login Out', + test: 'Test', + typeCreate: 'Dict Type Create', + typeUpdate: 'Dict Type Eidt', + dataCreate: 'Dict Data Create', + dataUpdate: 'Dict Data Eidt', + fileUpload: 'File Upload' + }, + dialog: { + dialog: 'Dialog', + open: 'Open', + close: 'Close' + }, + sys: { + api: { + operationFailed: 'Operation failed', + errorTip: 'Error Tip', + errorMessage: 'The operation failed, the system is abnormal!', + timeoutMessage: 'Login timed out, please log in again!', + apiTimeoutMessage: 'The interface request timed out, please refresh the page and try again!', + apiRequestFailed: 'The interface request failed, please try again later!', + networkException: 'network anomaly', + networkExceptionMsg: + 'Please check if your network connection is normal! The network is abnormal', + + errMsg401: 'The user does not have permission (token, user name, password error)!', + errMsg403: 'The user is authorized, but access is forbidden!', + errMsg404: 'Network request error, the resource was not found!', + errMsg405: 'Network request error, request method not allowed!', + errMsg408: 'Network request timed out!', + errMsg500: 'Server error, please contact the administrator!', + errMsg501: 'The network is not implemented!', + errMsg502: 'Network Error!', + errMsg503: 'The service is unavailable, the server is temporarily overloaded or maintained!', + errMsg504: 'Network timeout!', + errMsg505: 'The http version does not support the request!', + errMsg901: 'Demo mode, no write operations are possible!' + }, + app: { + logoutTip: 'Reminder', + logoutMessage: 'Confirm to exit the system?', + menuLoading: 'Menu loading...' + }, + exception: { + backLogin: 'Back Login', + backHome: 'Back Home', + subTitle403: "Sorry, you don't have access to this page.", + subTitle404: 'Sorry, the page you visited does not exist.', + subTitle500: 'Sorry, the server is reporting an error.', + noDataTitle: 'No data on the current page.', + networkErrorTitle: 'Network Error', + networkErrorSubTitle: + 'Sorry, Your network connection has been disconnected, please check your network!' + }, + lock: { + unlock: 'Click to unlock', + alert: 'Lock screen password error', + backToLogin: 'Back to login', + entry: 'Enter the system', + placeholder: 'Please enter the lock screen password or user password' + }, + login: { + backSignIn: 'Back sign in', + mobileSignInFormTitle: 'Mobile sign in', + qrSignInFormTitle: 'Qr code sign in', + signInFormTitle: 'Sign in', + signUpFormTitle: 'Sign up', + forgetFormTitle: 'Reset password', + + signInTitle: 'Backstage management system', + signInDesc: 'Enter your personal details and get started!', + policy: 'I agree to the xxx Privacy Policy', + scanSign: `scanning the code to complete the login`, + + loginButton: 'Sign in', + registerButton: 'Sign up', + rememberMe: 'Remember me', + forgetPassword: 'Forget Password?', + otherSignIn: 'Sign in with', + + // notify + loginSuccessTitle: 'Login successful', + loginSuccessDesc: 'Welcome back', + + // placeholder + accountPlaceholder: 'Please input username', + passwordPlaceholder: 'Please input password', + smsPlaceholder: 'Please input sms code', + mobilePlaceholder: 'Please input mobile', + policyPlaceholder: 'Register after checking', + diffPwd: 'The two passwords are inconsistent', + + userName: 'Username', + password: 'Password', + confirmPassword: 'Confirm Password', + email: 'Email', + smsCode: 'SMS code', + mobile: 'Mobile' + } + }, + profile: { + user: { + title: 'Personal Information', + username: 'User Name', + nickname: 'Nick Name', + mobile: 'Phone Number', + email: 'User Mail', + dept: 'Department', + posts: 'Position', + roles: 'Own Role', + sex: 'Sex', + man: 'Man', + woman: 'Woman', + createTime: 'Created Date' + }, + info: { + title: 'Basic Information', + basicInfo: 'Basic Information', + resetPwd: 'Reset Password', + userSocial: 'Social Information' + }, + rules: { + nickname: 'Please Enter User Nickname', + mail: 'Please Input The Email Address', + truemail: 'Please Input The Correct Email Address', + phone: 'Please Enter The Phone Number', + truephone: 'Please Enter The Correct Phone Number' + }, + password: { + oldPassword: 'Old PassWord', + newPassword: 'New Password', + confirmPassword: 'Confirm Password', + oldPwdMsg: 'Please Enter Old Password', + newPwdMsg: 'Please Enter New Password', + cfPwdMsg: 'Please Enter Confirm Password', + diffPwd: 'The Passwords Entered Twice No Match' + } + }, + cropper: { + selectImage: 'Select Image', + uploadSuccess: 'Uploaded success!', + modalTitle: 'Avatar upload', + okText: 'Confirm and upload', + btn_reset: 'Reset', + btn_rotate_left: 'Counterclockwise rotation', + btn_rotate_right: 'Clockwise rotation', + btn_scale_x: 'Flip horizontal', + btn_scale_y: 'Flip vertical', + btn_zoom_in: 'Zoom in', + btn_zoom_out: 'Zoom out', + preview: 'Preivew' + } +} diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts new file mode 100644 index 0000000..cc4bb47 --- /dev/null +++ b/src/locales/zh-CN.ts @@ -0,0 +1,440 @@ +export default { + common: { + inputText: '请输入', + selectText: '请选择', + startTimeText: '开始时间', + endTimeText: '结束时间', + login: '登录', + required: '该项为必填项', + loginOut: '退出系统', + document: '项目文档', + profile: '个人中心', + reminder: '温馨提示', + loginOutMessage: '是否退出本系统?', + back: '返回', + ok: '确定', + save: '保存', + cancel: '取消', + close: '关闭', + reload: '重新加载', + success: '成功', + closeTab: '关闭标签页', + closeTheLeftTab: '关闭左侧标签页', + closeTheRightTab: '关闭右侧标签页', + closeOther: '关闭其他标签页', + closeAll: '关闭全部标签页', + prevLabel: '上一步', + nextLabel: '下一步', + skipLabel: '跳过', + doneLabel: '结束', + menu: '菜单', + menuDes: '以路由的结构渲染的菜单栏', + collapse: '展开缩收', + collapseDes: '展开和缩放菜单栏', + tagsView: '标签页', + tagsViewDes: '用于记录路由历史记录', + tool: '工具', + toolDes: '用于设置定制系统', + query: '查询', + reset: '重置', + shrink: '收起', + expand: '展开', + confirmTitle: '系统提示', + exportMessage: '是否确认导出数据项?', + importMessage: '是否确认导入数据项?', + createSuccess: '新增成功', + updateSuccess: '修改成功', + delMessage: '是否删除所选中数据?', + delDataMessage: '是否删除数据?', + delNoData: '请选择需要删除的数据', + delSuccess: '删除成功', + index: '序号', + status: '状态', + createTime: '创建时间', + updateTime: '更新时间', + copy: '复制', + copySuccess: '复制成功', + copyError: '复制失败' + }, + error: { + noPermission: `抱歉,您无权访问此页面。`, + pageError: '抱歉,您访问的页面不存在。', + networkError: '抱歉,服务器报告错误。', + returnToHome: '返回首页' + }, + permission: { + hasPermission: `请设置操作权限标签值`, + hasRole: `请设置角色权限标签值` + }, + setting: { + projectSetting: '项目配置', + theme: '主题', + layout: '布局', + systemTheme: '系统主题', + menuTheme: '菜单主题', + interfaceDisplay: '界面显示', + breadcrumb: '面包屑', + breadcrumbIcon: '面包屑图标', + collapseMenu: '折叠菜单', + hamburgerIcon: '折叠图标', + screenfullIcon: '全屏图标', + sizeIcon: '尺寸图标', + localeIcon: '多语言图标', + messageIcon: '消息图标', + tagsView: '标签页', + logo: '标志', + greyMode: '灰色模式', + fixedHeader: '固定头部', + headerTheme: '头部主题', + cutMenu: '切割菜单', + copy: '拷贝', + clearAndReset: '清除缓存并且重置', + copySuccess: '拷贝成功', + copyFailed: '拷贝失败', + footer: '页脚', + uniqueOpened: '菜单手风琴', + tagsViewIcon: '标签页图标', + reExperienced: '请重新退出登录体验', + fixedMenu: '固定菜单' + }, + size: { + default: '默认', + large: '大', + small: '小' + }, + login: { + welcome: '欢迎使用本系统', + message: '开箱即用的中后台管理系统', + tenantname: '租户名称', + username: '用户名', + password: '密码', + code: '验证码', + login: '登录', + relogin: '重新登录', + otherLogin: '其他登录方式', + register: '注册', + checkPassword: '确认密码', + remember: '记住我', + hasUser: '已有账号?去登录', + forgetPassword: '忘记密码?', + tenantNamePlaceholder: '请输入租户名称', + usernamePlaceholder: '请输入用户名', + passwordPlaceholder: '请输入密码', + codePlaceholder: '请输入验证码', + mobileTitle: '手机登录', + mobileNumber: '手机号码', + mobileNumberPlaceholder: '请输入手机号码', + backLogin: '返回', + getSmsCode: '获取验证码', + btnMobile: '手机登录', + btnQRCode: '二维码登录', + qrcode: '扫描二维码登录', + btnRegister: '注册', + SmsSendMsg: '验证码已发送' + }, + captcha: { + verification: '请完成安全验证', + slide: '向右滑动完成验证', + point: '请依次点击', + success: '验证成功', + fail: '验证失败' + }, + router: { + login: '登录', + home: '首页', + analysis: '分析页', + workplace: '工作台' + }, + analysis: { + newUser: '新增用户', + unreadInformation: '未读消息', + transactionAmount: '成交金额', + totalShopping: '购物总量', + monthlySales: '每月销售额', + userAccessSource: '用户访问来源', + january: '一月', + february: '二月', + march: '三月', + april: '四月', + may: '五月', + june: '六月', + july: '七月', + august: '八月', + september: '九月', + october: '十月', + november: '十一月', + december: '十二月', + estimate: '预计', + actual: '实际', + directAccess: '直接访问', + mailMarketing: '邮件营销', + allianceAdvertising: '联盟广告', + videoAdvertising: '视频广告', + searchEngines: '搜索引擎', + weeklyUserActivity: '每周用户活跃量', + activeQuantity: '活跃量', + monday: '周一', + tuesday: '周二', + wednesday: '周三', + thursday: '周四', + friday: '周五', + saturday: '周六', + sunday: '周日' + }, + workplace: { + welcome: '你好', + happyDay: '祝你开心每一天!', + toady: '今日晴', + notice: '通知公告', + project: '项目数', + access: '项目访问', + toDo: '待办', + introduction: '一个正经的简介', + shortcutOperation: '快捷入口', + operation: '操作', + index: '指数', + personal: '个人', + team: '团队', + quote: '引用', + contribution: '贡献', + hot: '热度', + yield: '产量', + dynamic: '动态', + push: '推送', + follow: '关注' + }, + form: { + input: '输入框', + inputNumber: '数字输入框', + default: '默认', + icon: '图标', + mixed: '复合型', + textarea: '多行文本', + slot: '插槽', + position: '位置', + autocomplete: '自动补全', + select: '选择器', + selectGroup: '选项分组', + selectV2: '虚拟列表选择器', + cascader: '级联选择器', + switch: '开关', + rate: '评分', + colorPicker: '颜色选择器', + transfer: '穿梭框', + render: '渲染器', + radio: '单选框', + button: '按钮', + checkbox: '多选框', + slider: '滑块', + datePicker: '日期选择器', + shortcuts: '快捷选项', + today: '今天', + yesterday: '昨天', + aWeekAgo: '一周前', + week: '周', + year: '年', + month: '月', + dates: '日期', + daterange: '日期范围', + monthrange: '月份范围', + dateTimePicker: '日期时间选择器', + dateTimerange: '日期时间范围', + timePicker: '时间选择器', + timeSelect: '时间选择', + inputPassword: '密码输入框', + passwordStrength: '密码强度', + operate: '操作', + change: '更改', + restore: '还原', + disabled: '禁用', + disablement: '解除禁用', + delete: '删除', + add: '添加', + setValue: '设置值', + resetValue: '重置值', + set: '设置', + subitem: '子项', + formValidation: '表单验证', + verifyReset: '验证重置', + remark: '备注' + }, + watermark: { + watermark: '水印' + }, + table: { + table: '表格', + index: '序号', + title: '标题', + author: '作者', + createTime: '创建时间', + action: '操作', + pagination: '分页', + reserveIndex: '叠加序号', + restoreIndex: '还原序号', + showSelections: '显示多选', + hiddenSelections: '隐藏多选', + showExpandedRows: '显示展开行', + hiddenExpandedRows: '隐藏展开行', + header: '头部' + }, + action: { + create: '新增', + add: '新增', + del: '删除', + delete: '删除', + edit: '编辑', + update: '编辑', + preview: '预览', + more: '更多', + sync: '同步', + save: '保存', + detail: '详情', + export: '导出', + import: '导入', + generate: '生成', + logout: '强制退出', + test: '测试', + typeCreate: '字典类型新增', + typeUpdate: '字典类型编辑', + dataCreate: '字典数据新增', + dataUpdate: '字典数据编辑' + }, + dialog: { + dialog: '弹窗', + open: '打开', + close: '关闭' + }, + sys: { + api: { + operationFailed: '操作失败', + errorTip: '错误提示', + errorMessage: '操作失败,系统异常!', + timeoutMessage: '登录超时,请重新登录!', + apiTimeoutMessage: '接口请求超时,请刷新页面重试!', + apiRequestFailed: '请求出错,请稍候重试', + networkException: '网络异常', + networkExceptionMsg: '网络异常,请检查您的网络连接是否正常!', + errMsg401: '用户没有权限(令牌、用户名、密码错误)!', + errMsg403: '用户得到授权,但是访问是被禁止的。!', + errMsg404: '网络请求错误,未找到该资源!', + errMsg405: '网络请求错误,请求方法未允许!', + errMsg408: '网络请求超时!', + errMsg500: '服务器错误,请联系管理员!', + errMsg501: '网络未实现!', + errMsg502: '网络错误!', + errMsg503: '服务不可用,服务器暂时过载或维护!', + errMsg504: '网络超时!', + errMsg505: 'http版本不支持该请求!', + errMsg901: '演示模式,无法进行写操作!' + }, + app: { + logoutTip: '温馨提醒', + logoutMessage: '是否确认退出系统?', + menuLoading: '菜单加载中...' + }, + exception: { + backLogin: '返回登录', + backHome: '返回首页', + subTitle403: '抱歉,您无权访问此页面。', + subTitle404: '抱歉,您访问的页面不存在。', + subTitle500: '抱歉,服务器报告错误。', + noDataTitle: '当前页无数据', + networkErrorTitle: '网络错误', + networkErrorSubTitle: '抱歉,您的网络连接已断开,请检查您的网络!' + }, + lock: { + unlock: '点击解锁', + alert: '锁屏密码错误', + backToLogin: '返回登录', + entry: '进入系统', + placeholder: '请输入锁屏密码或者用户密码' + }, + login: { + backSignIn: '返回', + signInFormTitle: '登录', + ssoFormTitle: '三方授权', + mobileSignInFormTitle: '手机登录', + qrSignInFormTitle: '二维码登录', + signUpFormTitle: '注册', + forgetFormTitle: '重置密码', + signInTitle: '开箱即用的中后台管理系统', + signInDesc: '输入您的个人详细信息开始使用!', + policy: '我同意xxx隐私政策', + scanSign: `扫码后点击"确认",即可完成登录`, + loginButton: '登录', + registerButton: '注册', + rememberMe: '记住我', + forgetPassword: '忘记密码?', + otherSignIn: '其他登录方式', + // notify + loginSuccessTitle: '登录成功', + loginSuccessDesc: '欢迎回来', + // placeholder + accountPlaceholder: '请输入账号', + passwordPlaceholder: '请输入密码', + smsPlaceholder: '请输入验证码', + mobilePlaceholder: '请输入手机号码', + policyPlaceholder: '勾选后才能注册', + diffPwd: '两次输入密码不一致', + userName: '账号', + password: '密码', + confirmPassword: '确认密码', + email: '邮箱', + smsCode: '短信验证码', + mobile: '手机号码' + } + }, + profile: { + user: { + title: '个人信息', + username: '用户名称', + nickname: '用户昵称', + mobile: '手机号码', + email: '用户邮箱', + dept: '所属部门', + posts: '所属岗位', + roles: '所属角色', + sex: '性别', + man: '男', + woman: '女', + createTime: '创建日期' + }, + info: { + title: '基本信息', + basicInfo: '基本资料', + resetPwd: '修改密码', + userSocial: '社交信息' + }, + rules: { + nickname: '请输入用户昵称', + mail: '请输入邮箱地址', + truemail: '请输入正确的邮箱地址', + phone: '请输入正确的手机号码', + truephone: '请输入正确的手机号码' + }, + password: { + oldPassword: '旧密码', + newPassword: '新密码', + confirmPassword: '确认密码', + oldPwdMsg: '请输入旧密码', + newPwdMsg: '请输入新密码', + cfPwdMsg: '请输入确认密码', + pwdRules: '长度在 6 到 20 个字符', + diffPwd: '两次输入密码不一致' + } + }, + cropper: { + selectImage: '选择图片', + uploadSuccess: '上传成功', + modalTitle: '头像上传', + okText: '确认并上传', + btn_reset: '重置', + btn_rotate_left: '逆时针旋转', + btn_rotate_right: '顺时针旋转', + btn_scale_x: '水平翻转', + btn_scale_y: '垂直翻转', + btn_zoom_in: '放大', + btn_zoom_out: '缩小', + preview: '预览' + } +} diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..f040f2b --- /dev/null +++ b/src/main.ts @@ -0,0 +1,73 @@ +// 引入unocss css +import '@/plugins/unocss' + +// 导入全局的svg图标 +import '@/plugins/svgIcon' + +// 初始化多语言 +import { setupI18n } from '@/plugins/vueI18n' + +// 引入状态管理 +import { setupStore } from '@/store' + +// 全局组件 +import { setupGlobCom } from '@/components' + +// 引入 element-plus +import { setupElementPlus } from '@/plugins/elementPlus' + +// 引入 form-create +import { setupFormCreate } from '@/plugins/formCreate' + +// 引入全局样式 +import '@/styles/index.scss' + +// 引入动画 +import '@/plugins/animate.css' + +// 路由 +import router, { setupRouter } from '@/router' + +// 权限 +import { setupAuth } from '@/directives' + +import { createApp } from 'vue' + +import App from './App.vue' + +import './permission' + +import '@/plugins/tongji' // 百度统计 +import Logger from '@/utils/Logger' + +import VueDOMPurifyHTML from 'vue-dompurify-html' // 解决v-html 的安全隐患 + +// 创建实例 +const setupAll = async () => { + const app = createApp(App) + + await setupI18n(app) + + setupStore(app) + + setupGlobCom(app) + + setupElementPlus(app) + + setupFormCreate(app) + + setupRouter(app) + + setupAuth(app) + + await router.isReady() + + app.use(VueDOMPurifyHTML) + + app.mount('#app') + app.config.warnHandler = () => null; +} + +setupAll() + +Logger.prettyPrimary(`欢迎使用`, import.meta.env.VITE_APP_TITLE) diff --git a/src/permission.ts b/src/permission.ts new file mode 100644 index 0000000..0698dc8 --- /dev/null +++ b/src/permission.ts @@ -0,0 +1,70 @@ +import router from './router' +import type { RouteRecordRaw } from 'vue-router' +import { isRelogin } from '@/config/axios/service' +import { getAccessToken } from '@/utils/auth' +import { useTitle } from '@/hooks/web/useTitle' +import { useNProgress } from '@/hooks/web/useNProgress' +import { usePageLoading } from '@/hooks/web/usePageLoading' +import { useDictStoreWithOut } from '@/store/modules/dict' +import { useUserStoreWithOut } from '@/store/modules/user' +import { usePermissionStoreWithOut } from '@/store/modules/permission' + +const { start, done } = useNProgress() + +const { loadStart, loadDone } = usePageLoading() +// 路由不重定向白名单 +const whiteList = [ + '/login', + '/social-login', + '/auth-redirect', + '/bind', + '/register', + '/oauthLogin/gitee' +] + +// 路由加载前 +router.beforeEach(async (to, from, next) => { + start() + loadStart() + if (getAccessToken()) { + if (to.path === '/login') { + next({ path: '/' }) + } else { + // 获取所有字典 + const dictStore = useDictStoreWithOut() + const userStore = useUserStoreWithOut() + const permissionStore = usePermissionStoreWithOut() + if (!dictStore.getIsSetDict) { + await dictStore.setDictMap() + } + if (!userStore.getIsSetUser) { + isRelogin.show = true + await userStore.setUserInfoAction() + isRelogin.show = false + // 后端过滤菜单 + await permissionStore.generateRoutes() + permissionStore.getAddRouters.forEach((route) => { + router.addRoute(route as unknown as RouteRecordRaw) // 动态添加可访问路由表 + }) + const redirectPath = from.query.redirect || to.path + const redirect = decodeURIComponent(redirectPath as string) + const nextData = to.path === redirect ? { ...to, replace: true } : { path: redirect } + next(nextData) + } else { + next() + } + } + } else { + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页 + } + } +}) + +router.afterEach((to) => { + useTitle(to?.meta?.title as string) + done() // 结束Progress + loadDone() +}) diff --git a/src/plugins/animate.css/index.ts b/src/plugins/animate.css/index.ts new file mode 100644 index 0000000..3e93451 --- /dev/null +++ b/src/plugins/animate.css/index.ts @@ -0,0 +1 @@ +import 'animate.css' diff --git a/src/plugins/echarts/index.ts b/src/plugins/echarts/index.ts new file mode 100644 index 0000000..bfccbb4 --- /dev/null +++ b/src/plugins/echarts/index.ts @@ -0,0 +1,45 @@ +import * as echarts from 'echarts/core' + +import { + BarChart, + LineChart, + PieChart, + MapChart, + PictorialBarChart, + RadarChart, + GaugeChart +} from 'echarts/charts' + +import { + TitleComponent, + TooltipComponent, + GridComponent, + PolarComponent, + AriaComponent, + ParallelComponent, + LegendComponent, + ToolboxComponent +} from 'echarts/components' + +import { CanvasRenderer } from 'echarts/renderers' + +echarts.use([ + LegendComponent, + TitleComponent, + TooltipComponent, + ToolboxComponent, + GridComponent, + PolarComponent, + AriaComponent, + ParallelComponent, + BarChart, + LineChart, + PieChart, + MapChart, + CanvasRenderer, + PictorialBarChart, + RadarChart, + GaugeChart +]) + +export default echarts diff --git a/src/plugins/elementPlus/index.ts b/src/plugins/elementPlus/index.ts new file mode 100644 index 0000000..0ae2a8b --- /dev/null +++ b/src/plugins/elementPlus/index.ts @@ -0,0 +1,17 @@ +import type { App } from 'vue' +// 需要全局引入一些组件,如ElScrollbar,不然一些下拉项样式有问题 +import { ElLoading, ElScrollbar, ElButton } from 'element-plus' + +const plugins = [ElLoading] + +const components = [ElScrollbar, ElButton] + +export const setupElementPlus = (app: App) => { + plugins.forEach((plugin) => { + app.use(plugin) + }) + + components.forEach((component) => { + app.component(component.name, component) + }) +} diff --git a/src/plugins/formCreate/index.ts b/src/plugins/formCreate/index.ts new file mode 100644 index 0000000..a6cb821 --- /dev/null +++ b/src/plugins/formCreate/index.ts @@ -0,0 +1,43 @@ +import type { App } from 'vue' +// 👇使用 form-create 需额外全局引入 element plus 组件 +import { + ElAside, + ElPopconfirm, + ElHeader, + ElMain, + ElContainer, + ElDivider, + ElTransfer, + ElAlert, + ElTabs, + ElTable, + ElTableColumn, + ElTabPane +} from 'element-plus' + +import formCreate from '@form-create/element-ui' +import install from '@form-create/element-ui/auto-import' + +const components = [ + ElAside, + ElPopconfirm, + ElHeader, + ElMain, + ElContainer, + ElDivider, + ElTransfer, + ElAlert, + ElTabs, + ElTable, + ElTableColumn, + ElTabPane +] + +// 参考 http://www.form-create.com/v3/element-ui/auto-import.html 文档 +export const setupFormCreate = (app: App) => { + components.forEach((component) => { + app.component(component.name, component) + }) + formCreate.use(install) + app.use(formCreate) +} diff --git a/src/plugins/svgIcon/index.ts b/src/plugins/svgIcon/index.ts new file mode 100644 index 0000000..b5b7f70 --- /dev/null +++ b/src/plugins/svgIcon/index.ts @@ -0,0 +1,3 @@ +import 'virtual:svg-icons-register' + +import '@purge-icons/generated' diff --git a/src/plugins/tongji/index.ts b/src/plugins/tongji/index.ts new file mode 100644 index 0000000..ec261a1 --- /dev/null +++ b/src/plugins/tongji/index.ts @@ -0,0 +1,23 @@ +import router from '@/router' + +// 用于 router push +window._hmt = window._hmt || [] +// HM_ID +const HM_ID = import.meta.env.VITE_APP_BAIDU_CODE +;(function () { + // 有值的时候,才开启 + if (!HM_ID) { + return + } + const hm = document.createElement('script') + hm.src = 'https://hm.baidu.com/hm.js?' + HM_ID + const s = document.getElementsByTagName('script')[0] + s.parentNode.insertBefore(hm, s) +})() + +router.afterEach(function (to) { + if (!HM_ID) { + return + } + _hmt.push(['_trackPageview', to.fullPath]) +}) diff --git a/src/plugins/unocss/index.ts b/src/plugins/unocss/index.ts new file mode 100644 index 0000000..d366b5a --- /dev/null +++ b/src/plugins/unocss/index.ts @@ -0,0 +1 @@ +import 'virtual:uno.css' diff --git a/src/plugins/vueI18n/helper.ts b/src/plugins/vueI18n/helper.ts new file mode 100644 index 0000000..da6bc8c --- /dev/null +++ b/src/plugins/vueI18n/helper.ts @@ -0,0 +1,3 @@ +export const setHtmlPageLang = (locale: LocaleType) => { + document.querySelector('html')?.setAttribute('lang', locale) +} diff --git a/src/plugins/vueI18n/index.ts b/src/plugins/vueI18n/index.ts new file mode 100644 index 0000000..f845b13 --- /dev/null +++ b/src/plugins/vueI18n/index.ts @@ -0,0 +1,42 @@ +import type { App } from 'vue' +import { createI18n } from 'vue-i18n' +import { useLocaleStoreWithOut } from '@/store/modules/locale' +import type { I18n, I18nOptions } from 'vue-i18n' +import { setHtmlPageLang } from './helper' + +export let i18n: ReturnType + +const createI18nOptions = async (): Promise => { + const localeStore = useLocaleStoreWithOut() + const locale = localeStore.getCurrentLocale + const localeMap = localeStore.getLocaleMap + const defaultLocal = await import(`../../locales/${locale.lang}.ts`) + const message = defaultLocal.default ?? {} + + setHtmlPageLang(locale.lang) + + localeStore.setCurrentLocale({ + lang: locale.lang + // elLocale: elLocal + }) + + return { + legacy: false, + locale: locale.lang, + fallbackLocale: locale.lang, + messages: { + [locale.lang]: message + }, + availableLocales: localeMap.map((v) => v.lang), + sync: true, + silentTranslationWarn: true, + missingWarn: false, + silentFallbackWarn: true + } +} + +export const setupI18n = async (app: App) => { + const options = await createI18nOptions() + i18n = createI18n(options) as I18n + app.use(i18n) +} diff --git a/src/router/index.ts b/src/router/index.ts new file mode 100644 index 0000000..8f66ca3 --- /dev/null +++ b/src/router/index.ts @@ -0,0 +1,28 @@ +import type { App } from 'vue' +import type { RouteRecordRaw } from 'vue-router' +import { createRouter, createWebHistory } from 'vue-router' +import remainingRouter from './modules/remaining' + +// 创建路由实例 +const router = createRouter({ + history: createWebHistory(), // createWebHashHistory URL带#,createWebHistory URL不带# + strict: true, + routes: remainingRouter as RouteRecordRaw[], + scrollBehavior: () => ({ left: 0, top: 0 }) +}) + +export const resetRouter = (): void => { + const resetWhiteNameList = ['Redirect', 'Login', 'NoFind', 'Root'] + router.getRoutes().forEach((route) => { + const { name } = route + if (name && !resetWhiteNameList.includes(name as string)) { + router.hasRoute(name) && router.removeRoute(name) + } + }) +} + +export const setupRouter = (app: App) => { + app.use(router) +} + +export default router diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts new file mode 100644 index 0000000..2c2ecf2 --- /dev/null +++ b/src/router/modules/remaining.ts @@ -0,0 +1,369 @@ +import { Layout } from '@/utils/routerHelper' + +const { t } = useI18n() +/** + * redirect: noredirect 当设置 noredirect 的时候该路由在面包屑导航中不可被点击 + * name:'router-name' 设定路由的名字,一定要填写不然使用时会出现各种问题 + * meta : { + hidden: true 当设置 true 的时候该路由不会再侧边栏出现 如404,login等页面(默认 false) + + alwaysShow: true 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式, + 只有一个时,会将那个子路由当做根路由显示在侧边栏, + 若你想不管路由下面的 children 声明的个数都显示你的根路由, + 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则, + 一直显示根路由(默认 false) + + title: 'title' 设置该路由在侧边栏和面包屑中展示的名字 + + icon: 'svg-name' 设置该路由的图标 + + noCache: true 如果设置为true,则不会被 缓存(默认 false) + + breadcrumb: false 如果设置为false,则不会在breadcrumb面包屑中显示(默认 true) + + affix: true 如果设置为true,则会一直固定在tag项中(默认 false) + + noTagsView: true 如果设置为true,则不会出现在tag中(默认 false) + + activeMenu: '/dashboard' 显示高亮的路由路径 + + followAuth: '/dashboard' 跟随哪个路由进行权限过滤 + + canTo: true 设置为true即使hidden为true,也依然可以进行路由跳转(默认 false) + } + **/ +const remainingRouter: AppRouteRecordRaw[] = [ + { + path: '/redirect', + component: Layout, + name: 'Redirect', + children: [ + { + path: '/redirect/:path(.*)', + name: 'Redirect', + component: () => import('@/views/Redirect/Redirect.vue'), + meta: {} + } + ], + meta: { + hidden: true, + noTagsView: true + } + }, + { + path: '/', + component: Layout, + redirect: '/index', + name: 'Home', + meta: {}, + children: [ + { + path: 'index', + component: () => import('@/views/Home/Index.vue'), + name: 'Index', + meta: { + title: t('router.home'), + icon: 'ep:home-filled', + noCache: false, + affix: true + } + } + ] + }, + { + path: '/user', + component: Layout, + name: 'UserInfo', + meta: { + hidden: true + }, + children: [ + { + path: 'profile', + component: () => import('@/views/Profile/Index.vue'), + name: 'Profile', + meta: { + canTo: true, + hidden: true, + noTagsView: false, + icon: 'ep:user', + title: t('common.profile') + } + }, + { + path: 'notify-message', + component: () => import('@/views/system/notify/my/index.vue'), + name: 'MyNotifyMessage', + meta: { + canTo: true, + hidden: true, + noTagsView: false, + icon: 'ep:message', + title: '我的站内信' + } + } + ] + }, + + { + path: '/dict', + component: Layout, + name: 'dict', + meta: { + hidden: true + }, + children: [ + { + path: 'type/data/:dictType', + component: () => import('@/views/system/dict/data/index.vue'), + name: 'SystemDictData', + meta: { + title: '字典数据', + noCache: true, + hidden: true, + canTo: true, + icon: '', + activeMenu: '/system/dict' + } + } + ] + }, + + { + path: '/codegen', + component: Layout, + name: 'CodegenEdit', + meta: { + hidden: true + }, + children: [ + { + path: 'edit', + component: () => import('@/views/infra/codegen/EditTable.vue'), + name: 'InfraCodegenEditTable', + meta: { + noCache: true, + hidden: true, + canTo: true, + icon: 'ep:edit', + title: '修改生成配置', + activeMenu: 'infra/codegen/index' + } + } + ] + }, + { + path: '/job', + component: Layout, + name: 'JobL', + meta: { + hidden: true + }, + children: [ + { + path: 'job-log', + component: () => import('@/views/infra/job/logger/index.vue'), + name: 'InfraJobLog', + meta: { + noCache: true, + hidden: true, + canTo: true, + icon: 'ep:edit', + title: '调度日志', + activeMenu: 'infra/job/index' + } + } + ] + }, + { + path: '/login', + component: () => import('@/views/Login/Login.vue'), + name: 'Login', + meta: { + hidden: true, + title: t('router.login'), + noTagsView: true + } + }, + { + path: '/sso', + component: () => import('@/views/Login/Login.vue'), + name: 'SSOLogin', + meta: { + hidden: true, + title: t('router.login'), + noTagsView: true + } + }, + { + path: '/403', + component: () => import('@/views/Error/403.vue'), + name: 'NoAccess', + meta: { + hidden: true, + title: '403', + noTagsView: true + } + }, + { + path: '/404', + component: () => import('@/views/Error/404.vue'), + name: 'NoFound', + meta: { + hidden: true, + title: '404', + noTagsView: true + } + }, + { + path: '/500', + component: () => import('@/views/Error/500.vue'), + name: 'Error', + meta: { + hidden: true, + title: '500', + noTagsView: true + } + }, + { + path: '/bpm', + component: Layout, + name: 'bpm', + meta: { + hidden: true + }, + children: [ + { + path: '/manager/form/edit', + component: () => import('@/views/bpm/form/editor/index.vue'), + name: 'BpmFormEditor', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '设计流程表单', + activeMenu: '/bpm/manager/form' + } + }, + { + path: '/manager/model/edit', + component: () => import('@/views/bpm/model/editor/index.vue'), + name: 'BpmModelEditor', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '设计流程', + activeMenu: '/bpm/manager/model' + } + }, + { + path: '/manager/definition', + component: () => import('@/views/bpm/definition/index.vue'), + name: 'BpmProcessDefinition', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '流程定义', + activeMenu: '/bpm/manager/model' + } + }, + { + path: '/manager/task-assign-rule', + component: () => import('@/views/bpm/taskAssignRule/index.vue'), + name: 'BpmTaskAssignRuleList', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '任务分配规则' + } + }, + { + path: '/process-instance/create', + component: () => import('@/views/bpm/processInstance/create/index.vue'), + name: 'BpmProcessInstanceCreate', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '发起流程', + activeMenu: 'bpm/processInstance/create' + } + }, + { + path: '/process-instance/detail', + component: () => import('@/views/bpm/processInstance/detail/index.vue'), + name: 'BpmProcessInstanceDetail', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '流程详情', + activeMenu: 'bpm/processInstance/detail' + } + }, + { + path: '/bpm/oa/leave/create', + component: () => import('@/views/bpm/oa/leave/create.vue'), + name: 'OALeaveCreate', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '发起 OA 请假', + activeMenu: '/bpm/oa/leave' + } + }, + { + path: '/bpm/oa/leave/detail', + component: () => import('@/views/bpm/oa/leave/detail.vue'), + name: 'OALeaveDetail', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '查看 OA 请假', + activeMenu: '/bpm/oa/leave' + } + } + ] + }, + { + path: '/wms', + component: Layout, + name: 'wms', + meta: { + hidden: true + }, + children: [ + // { + // path: '/wms/itembasic-manage/itembasic-detail', + // component: () => import('@/views/wms/itembasic/ItembasicDetail.vue'), + // name: 'ItembasicDetail', + // meta: { + // noCache: true, + // hidden: true, + // canTo: true, + // title: '物品详情', + // activeMenu: '/wms/itembasic-manage/itembasic' + // } + // }, + // { + // path: '/wms/itempackaging-manage/itempackaging-detail', + // component: () => import('@/views/wms/itempackaging/ItempackagingDetail.vue'), + // name: 'ItempackagingDetail', + // meta: { + // noCache: true, + // hidden: true, + // canTo: true, + // title: '包装详情', + // activeMenu: '/wms/itempackaging-manage/itempackaging' + // } + // } + ] + } +] + +export default remainingRouter diff --git a/src/store/index.ts b/src/store/index.ts new file mode 100644 index 0000000..65964ea --- /dev/null +++ b/src/store/index.ts @@ -0,0 +1,10 @@ +import type { App } from 'vue' +import { createPinia } from 'pinia' + +const store = createPinia() + +export const setupStore = (app: App) => { + app.use(store) +} + +export { store } diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts new file mode 100644 index 0000000..b06b659 --- /dev/null +++ b/src/store/modules/app.ts @@ -0,0 +1,274 @@ +import { defineStore } from 'pinia' +import { store } from '../index' +import { setCssVar, humpToUnderline } from '@/utils' +import { ElMessage } from 'element-plus' +import { CACHE_KEY, useCache } from '@/hooks/web/useCache' +import { ElementPlusSize } from '@/types/elementPlus' +import { LayoutType } from '@/types/layout' +import { ThemeTypes } from '@/types/theme' + +const { wsCache } = useCache() + +interface AppState { + breadcrumb: boolean + breadcrumbIcon: boolean + collapse: boolean + uniqueOpened: boolean + hamburger: boolean + screenfull: boolean + size: boolean + locale: boolean + message: boolean + tagsView: boolean + tagsViewIcon: boolean + logo: boolean + fixedHeader: boolean + greyMode: boolean + pageLoading: boolean + layout: LayoutType + title: string + userInfo: string + isDark: boolean + currentSize: ElementPlusSize + sizeMap: ElementPlusSize[] + mobile: boolean + footer: boolean + theme: ThemeTypes + fixedMenu: boolean +} + +export const useAppStore = defineStore('app', { + state: (): AppState => { + return { + userInfo: 'userInfo', // 登录信息存储字段-建议每个项目换一个字段,避免与其他项目冲突 + sizeMap: ['default', 'large', 'small'], + mobile: false, // 是否是移动端 + title: import.meta.env.VITE_APP_TITLE, // 标题 + pageLoading: false, // 路由跳转loading + + breadcrumb: true, // 面包屑 + breadcrumbIcon: true, // 面包屑图标 + collapse: false, // 折叠菜单 + uniqueOpened: true, // 是否只保持一个子菜单的展开 + hamburger: true, // 折叠图标 + screenfull: true, // 全屏图标 + size: true, // 尺寸图标 + locale: true, // 多语言图标 + message: true, // 消息图标 + tagsView: true, // 标签页 + tagsViewIcon: true, // 是否显示标签图标 + logo: true, // logo + fixedHeader: true, // 固定toolheader + footer: false, // 显示页脚 + greyMode: false, // 是否开始灰色模式,用于特殊悼念日 + fixedMenu: wsCache.get('fixedMenu') || false, // 是否固定菜单 + + layout: wsCache.get(CACHE_KEY.LAYOUT) || 'classic', // layout布局 + isDark: wsCache.get(CACHE_KEY.IS_DARK) || false, // 是否是暗黑模式 + currentSize: wsCache.get('default') || 'default', // 组件尺寸 + theme: wsCache.get(CACHE_KEY.THEME) || { + // 主题色 + elColorPrimary: '#409eff', + // 左侧菜单边框颜色 + leftMenuBorderColor: 'inherit', + // 左侧菜单背景颜色 + leftMenuBgColor: '#001529', + // 左侧菜单浅色背景颜色 + leftMenuBgLightColor: '#0f2438', + // 左侧菜单选中背景颜色 + leftMenuBgActiveColor: 'var(--el-color-primary)', + // 左侧菜单收起选中背景颜色 + leftMenuCollapseBgActiveColor: 'var(--el-color-primary)', + // 左侧菜单字体颜色 + leftMenuTextColor: '#bfcbd9', + // 左侧菜单选中字体颜色 + leftMenuTextActiveColor: '#fff', + // logo字体颜色 + logoTitleTextColor: '#fff', + // logo边框颜色 + logoBorderColor: 'inherit', + // 头部背景颜色 + topHeaderBgColor: '#fff', + // 头部字体颜色 + topHeaderTextColor: 'inherit', + // 头部悬停颜色 + topHeaderHoverColor: '#f6f6f6', + // 头部边框颜色 + topToolBorderColor: '#eee' + } + } + }, + getters: { + getBreadcrumb(): boolean { + return this.breadcrumb + }, + getBreadcrumbIcon(): boolean { + return this.breadcrumbIcon + }, + getCollapse(): boolean { + return this.collapse + }, + getUniqueOpened(): boolean { + return this.uniqueOpened + }, + getHamburger(): boolean { + return this.hamburger + }, + getScreenfull(): boolean { + return this.screenfull + }, + getSize(): boolean { + return this.size + }, + getLocale(): boolean { + return this.locale + }, + getMessage(): boolean { + return this.message + }, + getTagsView(): boolean { + return this.tagsView + }, + getTagsViewIcon(): boolean { + return this.tagsViewIcon + }, + getLogo(): boolean { + return this.logo + }, + getFixedHeader(): boolean { + return this.fixedHeader + }, + getGreyMode(): boolean { + return this.greyMode + }, + getFixedMenu(): boolean { + return this.fixedMenu + }, + getPageLoading(): boolean { + return this.pageLoading + }, + getLayout(): LayoutType { + return this.layout + }, + getTitle(): string { + return this.title + }, + getUserInfo(): string { + return this.userInfo + }, + getIsDark(): boolean { + return this.isDark + }, + getCurrentSize(): ElementPlusSize { + return this.currentSize + }, + getSizeMap(): ElementPlusSize[] { + return this.sizeMap + }, + getMobile(): boolean { + return this.mobile + }, + getTheme(): ThemeTypes { + return this.theme + }, + getFooter(): boolean { + return this.footer + } + }, + actions: { + setBreadcrumb(breadcrumb: boolean) { + this.breadcrumb = breadcrumb + }, + setBreadcrumbIcon(breadcrumbIcon: boolean) { + this.breadcrumbIcon = breadcrumbIcon + }, + setCollapse(collapse: boolean) { + this.collapse = collapse + }, + setUniqueOpened(uniqueOpened: boolean) { + this.uniqueOpened = uniqueOpened + }, + setHamburger(hamburger: boolean) { + this.hamburger = hamburger + }, + setScreenfull(screenfull: boolean) { + this.screenfull = screenfull + }, + setSize(size: boolean) { + this.size = size + }, + setLocale(locale: boolean) { + this.locale = locale + }, + setMessage(message: boolean) { + this.message = message + }, + setTagsView(tagsView: boolean) { + this.tagsView = tagsView + }, + setTagsViewIcon(tagsViewIcon: boolean) { + this.tagsViewIcon = tagsViewIcon + }, + setLogo(logo: boolean) { + this.logo = logo + }, + setFixedHeader(fixedHeader: boolean) { + this.fixedHeader = fixedHeader + }, + setGreyMode(greyMode: boolean) { + this.greyMode = greyMode + }, + setFixedMenu(fixedMenu: boolean) { + wsCache.set('fixedMenu', fixedMenu) + this.fixedMenu = fixedMenu + }, + setPageLoading(pageLoading: boolean) { + this.pageLoading = pageLoading + }, + setLayout(layout: LayoutType) { + if (this.mobile && layout !== 'classic') { + ElMessage.warning('移动端模式下不支持切换其他布局') + return + } + this.layout = layout + wsCache.set(CACHE_KEY.LAYOUT, this.layout) + }, + setTitle(title: string) { + this.title = title + }, + setIsDark(isDark: boolean) { + this.isDark = isDark + if (this.isDark) { + document.documentElement.classList.add('dark') + document.documentElement.classList.remove('light') + } else { + document.documentElement.classList.add('light') + document.documentElement.classList.remove('dark') + } + wsCache.set(CACHE_KEY.IS_DARK, this.isDark) + }, + setCurrentSize(currentSize: ElementPlusSize) { + this.currentSize = currentSize + wsCache.set('currentSize', this.currentSize) + }, + setMobile(mobile: boolean) { + this.mobile = mobile + }, + setTheme(theme: ThemeTypes) { + this.theme = Object.assign(this.theme, theme) + wsCache.set(CACHE_KEY.THEME, this.theme) + }, + setCssVarTheme() { + for (const key in this.theme) { + setCssVar(`--${humpToUnderline(key)}`, this.theme[key]) + } + }, + setFooter(footer: boolean) { + this.footer = footer + } + } +}) + +export const useAppStoreWithOut = () => { + return useAppStore(store) +} diff --git a/src/store/modules/dict.ts b/src/store/modules/dict.ts new file mode 100644 index 0000000..822547b --- /dev/null +++ b/src/store/modules/dict.ts @@ -0,0 +1,104 @@ +import { defineStore } from 'pinia' +import { store } from '../index' +// @ts-ignore +import { DictDataVO } from '@/api/system/dict/types' +import { CACHE_KEY, useCache } from '@/hooks/web/useCache' +const { wsCache } = useCache('sessionStorage') +import { listSimpleDictData } from '@/api/system/dict/dict.data' + +export interface DictValueType { + value: any + label: string + clorType?: string + cssClass?: string +} +export interface DictTypeType { + dictType: string + dictValue: DictValueType[] +} +export interface DictState { + dictMap: Map + isSetDict: boolean +} + +export const useDictStore = defineStore('dict', { + state: (): DictState => ({ + dictMap: new Map(), + isSetDict: false + }), + getters: { + getDictMap(): Recordable { + const dictMap = wsCache.get(CACHE_KEY.DICT_CACHE) + if (dictMap) { + this.dictMap = dictMap + } + return this.dictMap + }, + getIsSetDict(): boolean { + return this.isSetDict + } + }, + actions: { + async setDictMap() { + const dictMap = wsCache.get(CACHE_KEY.DICT_CACHE) + if (dictMap) { + this.dictMap = dictMap + this.isSetDict = true + } else { + const res = await listSimpleDictData() + // 设置数据 + const dictDataMap = new Map() + res.forEach((dictData: DictDataVO) => { + // 获得 dictType 层级 + const enumValueObj = dictDataMap[dictData.dictType] + if (!enumValueObj) { + dictDataMap[dictData.dictType] = [] + } + // 处理 dictValue 层级 + dictDataMap[dictData.dictType].push({ + value: dictData.value, + label: dictData.label, + colorType: dictData.colorType, + cssClass: dictData.cssClass + }) + }) + this.dictMap = dictDataMap + this.isSetDict = true + wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期 + } + }, + getDictByType(type: string) { + if (!this.isSetDict) { + this.setDictMap() + } + return this.dictMap[type] + }, + async resetDict() { + wsCache.delete(CACHE_KEY.DICT_CACHE) + const res = await listSimpleDictData() + // 设置数据 + const dictDataMap = new Map() + res.forEach((dictData: DictDataVO) => { + // 获得 dictType 层级 + const enumValueObj = dictDataMap[dictData.dictType] + if (!enumValueObj) { + dictDataMap[dictData.dictType] = [] + } + // 处理 dictValue 层级 + dictDataMap[dictData.dictType].push({ + value: dictData.value, + label: dictData.label, + colorType: dictData.colorType, + cssClass: dictData.cssClass + }) + }) + this.dictMap = dictDataMap + this.isSetDict = true + wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期 + } + } +}) + +export const useDictStoreWithOut = () => { + return useDictStore(store) +} diff --git a/src/store/modules/locale.ts b/src/store/modules/locale.ts new file mode 100644 index 0000000..c0a020d --- /dev/null +++ b/src/store/modules/locale.ts @@ -0,0 +1,59 @@ +import { defineStore } from 'pinia' +import { store } from '../index' +import zhCn from 'element-plus/es/locale/lang/zh-cn' +import en from 'element-plus/es/locale/lang/en' +import { CACHE_KEY, useCache } from '@/hooks/web/useCache' +import { LocaleDropdownType } from '@/types/localeDropdown' + +const { wsCache } = useCache() + +const elLocaleMap = { + 'zh-CN': zhCn, + en: en +} +interface LocaleState { + currentLocale: LocaleDropdownType + localeMap: LocaleDropdownType[] +} + +export const useLocaleStore = defineStore('locales', { + state: (): LocaleState => { + return { + currentLocale: { + lang: wsCache.get(CACHE_KEY.LANG) || 'zh-CN', + elLocale: elLocaleMap[wsCache.get(CACHE_KEY.LANG) || 'zh-CN'] + }, + // 多语言 + localeMap: [ + { + lang: 'zh-CN', + name: '简体中文' + }, + { + lang: 'en-US', + name: 'English' + } + ] + } + }, + getters: { + getCurrentLocale(): LocaleDropdownType { + return this.currentLocale + }, + getLocaleMap(): LocaleDropdownType[] { + return this.localeMap + } + }, + actions: { + setCurrentLocale(localeMap: LocaleDropdownType) { + // this.locale = Object.assign(this.locale, localeMap) + this.currentLocale.lang = localeMap?.lang + this.currentLocale.elLocale = elLocaleMap[localeMap?.lang] + wsCache.set(CACHE_KEY.LANG, localeMap?.lang) + } + } +}) + +export const useLocaleStoreWithOut = () => { + return useLocaleStore(store) +} diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts new file mode 100644 index 0000000..c729cea --- /dev/null +++ b/src/store/modules/permission.ts @@ -0,0 +1,67 @@ +import { defineStore } from 'pinia' +import { store } from '../index' +import { cloneDeep } from 'lodash-es' +import remainingRouter from '@/router/modules/remaining' +import { flatMultiLevelRoutes, generateRoute } from '@/utils/routerHelper' +import { CACHE_KEY, useCache } from '@/hooks/web/useCache' + +const { wsCache } = useCache() + +export interface PermissionState { + routers: AppRouteRecordRaw[] + addRouters: AppRouteRecordRaw[] + menuTabRouters: AppRouteRecordRaw[] +} + +export const usePermissionStore = defineStore('permission', { + state: (): PermissionState => ({ + routers: [], + addRouters: [], + menuTabRouters: [] + }), + getters: { + getRouters(): AppRouteRecordRaw[] { + return this.routers + }, + getAddRouters(): AppRouteRecordRaw[] { + return flatMultiLevelRoutes(cloneDeep(this.addRouters)) + }, + getMenuTabRouters(): AppRouteRecordRaw[] { + return this.menuTabRouters + } + }, + actions: { + async generateRoutes(): Promise { + return new Promise(async (resolve) => { + // 获得菜单列表,它在登录的时候,setUserInfoAction 方法中已经进行获取 + let res: AppCustomRouteRecordRaw[] = [] + if (wsCache.get(CACHE_KEY.ROLE_ROUTERS)) { + res = wsCache.get(CACHE_KEY.ROLE_ROUTERS) as AppCustomRouteRecordRaw[] + } + const routerMap: AppRouteRecordRaw[] = generateRoute(res) + // 动态路由,404一定要放到最后面 + this.addRouters = routerMap.concat([ + { + path: '/:path(.*)*', + redirect: '/404', + name: '404Page', + meta: { + hidden: true, + breadcrumb: false + } + } + ]) + // 渲染菜单的所有路由 + this.routers = cloneDeep(remainingRouter).concat(routerMap) + resolve() + }) + }, + setMenuTabRouters(routers: AppRouteRecordRaw[]): void { + this.menuTabRouters = routers + } + } +}) + +export const usePermissionStoreWithOut = () => { + return usePermissionStore(store) +} diff --git a/src/store/modules/tagsView.ts b/src/store/modules/tagsView.ts new file mode 100644 index 0000000..a60d0e4 --- /dev/null +++ b/src/store/modules/tagsView.ts @@ -0,0 +1,140 @@ +import router from '@/router' +import type { RouteLocationNormalizedLoaded } from 'vue-router' +import { getRawRoute } from '@/utils/routerHelper' +import { defineStore } from 'pinia' +import { store } from '../index' +import { findIndex } from '@/utils' + +export interface TagsViewState { + visitedViews: RouteLocationNormalizedLoaded[] + cachedViews: Set +} + +export const useTagsViewStore = defineStore('tagsView', { + state: (): TagsViewState => ({ + visitedViews: [], + cachedViews: new Set() + }), + getters: { + getVisitedViews(): RouteLocationNormalizedLoaded[] { + return this.visitedViews + }, + getCachedViews(): string[] { + return Array.from(this.cachedViews) + } + }, + actions: { + // 新增缓存和tag + addView(view: RouteLocationNormalizedLoaded): void { + this.addVisitedView(view) + this.addCachedView() + }, + // 新增tag + addVisitedView(view: RouteLocationNormalizedLoaded) { + if (this.visitedViews.some((v) => v.path === view.path)) return + if (view.meta?.noTagsView) return + this.visitedViews.push( + Object.assign({}, view, { + title: view.meta?.title || 'no-name' + }) + ) + }, + // 新增缓存 + addCachedView() { + const cacheMap: Set = new Set() + for (const v of this.visitedViews) { + const item = getRawRoute(v) + const needCache = !item.meta?.noCache + if (!needCache) { + continue + } + const name = item.name as string + cacheMap.add(name) + } + if (Array.from(this.cachedViews).sort().toString() === Array.from(cacheMap).sort().toString()) + return + this.cachedViews = cacheMap + }, + // 删除某个 + delView(view: RouteLocationNormalizedLoaded) { + this.delVisitedView(view) + this.delCachedView() + }, + // 删除tag + delVisitedView(view: RouteLocationNormalizedLoaded) { + for (const [i, v] of this.visitedViews.entries()) { + if (v.path === view.path) { + this.visitedViews.splice(i, 1) + break + } + } + }, + // 删除缓存 + delCachedView() { + const route = router.currentRoute.value + const index = findIndex(this.getCachedViews, (v) => v === route.name) + if (index > -1) { + this.cachedViews.delete(this.getCachedViews[index]) + } + }, + // 删除所有缓存和tag + delAllViews() { + this.delAllVisitedViews() + this.delCachedView() + }, + // 删除所有tag + delAllVisitedViews() { + // const affixTags = this.visitedViews.filter((tag) => tag.meta.affix) + this.visitedViews = [] + }, + // 删除其他 + delOthersViews(view: RouteLocationNormalizedLoaded) { + this.delOthersVisitedViews(view) + this.addCachedView() + }, + // 删除其他tag + delOthersVisitedViews(view: RouteLocationNormalizedLoaded) { + this.visitedViews = this.visitedViews.filter((v) => { + return v?.meta?.affix || v.path === view.path + }) + }, + // 删除左侧 + delLeftViews(view: RouteLocationNormalizedLoaded) { + const index = findIndex( + this.visitedViews, + (v) => v.path === view.path + ) + if (index > -1) { + this.visitedViews = this.visitedViews.filter((v, i) => { + return v?.meta?.affix || v.path === view.path || i > index + }) + this.addCachedView() + } + }, + // 删除右侧 + delRightViews(view: RouteLocationNormalizedLoaded) { + const index = findIndex( + this.visitedViews, + (v) => v.path === view.path + ) + if (index > -1) { + this.visitedViews = this.visitedViews.filter((v, i) => { + return v?.meta?.affix || v.path === view.path || i < index + }) + this.addCachedView() + } + }, + updateVisitedView(view: RouteLocationNormalizedLoaded) { + for (let v of this.visitedViews) { + if (v.path === view.path) { + v = Object.assign(v, view) + break + } + } + } + } +}) + +export const useTagsViewStoreWithOut = () => { + return useTagsViewStore(store) +} diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts new file mode 100644 index 0000000..2f54e5e --- /dev/null +++ b/src/store/modules/user.ts @@ -0,0 +1,91 @@ +import { store } from '../index' +import { defineStore } from 'pinia' +import { getAccessToken, removeToken } from '@/utils/auth' +import { CACHE_KEY, useCache } from '@/hooks/web/useCache' +import { getInfo, loginOut } from '@/api/login' +import { getUserProfile } from '@/api/system/user/profile' + +const { wsCache } = useCache() + +interface UserVO { + id: number + avatar: string + nickname: string +} +interface UserInfoVO { + permissions: string[] + roles: string[] + isSetUser: boolean + user: UserVO + userSelfInfo:object +} + +export const useUserStore = defineStore('admin-user', { + state: (): UserInfoVO => ({ + permissions: [], + roles: [], + isSetUser: false, + user: { + id: 0, + avatar: '', + nickname: '' + }, + userSelfInfo:{} + }), + getters: { + getPermissions(): string[] { + return this.permissions + }, + getRoles(): string[] { + return this.roles + }, + getIsSetUser(): boolean { + return this.isSetUser + }, + getUser(): UserVO { + return this.user + }, + getUserSelfInfo(): UserVO { + return this.userSelfInfo + } + }, + actions: { + async setUserInfoAction() { + if (!getAccessToken()) { + this.resetState() + return null + } + let userInfo = wsCache.get(CACHE_KEY.USER) + if (!userInfo) { + userInfo = await getInfo() + } + this.userSelfInfo = await getUserProfile() + this.permissions = userInfo.permissions + this.roles = userInfo.roles + this.user = userInfo.user + this.isSetUser = true + wsCache.set(CACHE_KEY.USER, userInfo) + wsCache.set(CACHE_KEY.ROLE_ROUTERS, userInfo.menus) + }, + async loginOut() { + await loginOut() + removeToken() + wsCache.clear() + this.resetState() + }, + resetState() { + this.permissions = [] + this.roles = [] + this.isSetUser = false + this.user = { + id: 0, + avatar: '', + nickname: '' + } + } + } +}) + +export const useUserStoreWithOut = () => { + return useUserStore(store) +} diff --git a/src/styles/global.module.scss b/src/styles/global.module.scss new file mode 100644 index 0000000..8448a92 --- /dev/null +++ b/src/styles/global.module.scss @@ -0,0 +1,6 @@ +@import './variables.scss'; +// 导出变量 +:export { + namespace: $namespace; + elNamespace: $elNamespace; +} diff --git a/src/styles/index.scss b/src/styles/index.scss new file mode 100644 index 0000000..0952bd0 --- /dev/null +++ b/src/styles/index.scss @@ -0,0 +1,35 @@ +@import './var.css'; +@import 'element-plus/theme-chalk/dark/css-vars.css'; + +.reset-margin [class*='el-icon'] + span { + margin-left: 2px !important; +} + +// 解决抽屉弹出时,body宽度变化的问题 +.el-popup-parent--hidden { + width: 100% !important; +} + +// 解决表格内容超过表格总宽度后,横向滚动条前端顶不到表格边缘的问题 +.el-scrollbar__bar { + display: flex; + justify-content: flex-start; +} + +/* nprogress 适配 element-plus 的主题色 */ +#nprogress { + & .bar { + background-color: var(--el-color-primary) !important; + } + + & .peg { + box-shadow: + 0 0 10px var(--el-color-primary), + 0 0 5px var(--el-color-primary) !important; + } + + & .spinner-icon { + border-top-color: var(--el-color-primary); + border-left-color: var(--el-color-primary); + } +} diff --git a/src/styles/theme.scss b/src/styles/theme.scss new file mode 100644 index 0000000..39b03b3 --- /dev/null +++ b/src/styles/theme.scss @@ -0,0 +1,6 @@ +// .text-color { +// color: var(--el-text-color-regular); +// } +// .dark .dark\:text-color { +// color: rgba(255, 255, 255, var(--dark-text-color)); +// } diff --git a/src/styles/var.css b/src/styles/var.css new file mode 100644 index 0000000..63459ba --- /dev/null +++ b/src/styles/var.css @@ -0,0 +1,66 @@ +:root { + --login-bg-color: #293146; + + --left-menu-max-width: 200px; + + --left-menu-min-width: 64px; + + --left-menu-bg-color: #001529; + + --left-menu-bg-light-color: #0f2438; + + --left-menu-bg-active-color: var(--el-color-primary); + + --left-menu-text-color: #bfcbd9; + + --left-menu-text-active-color: #fff; + + --left-menu-collapse-bg-active-color: var(--el-color-primary); + /* left menu end */ + + /* logo start */ + --logo-height: 50px; + + --logo-title-text-color: #fff; + /* logo end */ + + /* header start */ + --top-header-bg-color: '#fff'; + + --top-header-text-color: 'inherit'; + + --top-header-hover-color: #f6f6f6; + + --top-tool-height: var(--logo-height); + + --top-tool-p-x: 0; + + --tags-view-height: 35px; + /* header start */ + + /* tab menu start */ + --tab-menu-max-width: 80px; + + --tab-menu-min-width: 30px; + + --tab-menu-collapse-height: 36px; + /* tab menu end */ + + --app-content-padding: 20px; + + --app-content-bg-color: #f5f7f9; + + --app-footer-height: 50px; + + --transition-time-02: 0.2s; +} + +.dark { + --app-content-bg-color: var(--el-bg-color); +} + +html, +body { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} diff --git a/src/styles/variables.scss b/src/styles/variables.scss new file mode 100644 index 0000000..00b66f1 --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,4 @@ +// 命名空间 +$namespace: v; +// el命名空间 +$elNamespace: el; diff --git a/src/types/components.d.ts b/src/types/components.d.ts new file mode 100644 index 0000000..8de1f33 --- /dev/null +++ b/src/types/components.d.ts @@ -0,0 +1,56 @@ +export type ComponentName = + | 'Radio' + | 'RadioButton' + | 'Checkbox' + | 'CheckboxButton' + | 'Input' + | 'Autocomplete' + | 'InputNumber' + | 'Select' + | 'Cascader' + | 'Switch' + | 'Slider' + | 'TimePicker' + | 'DatePicker' + | 'Rate' + | 'ColorPicker' + | 'Transfer' + | 'Divider' + | 'TimeSelect' + | 'SelectV2' + | 'TreeSelect' + | 'InputPassword' + | 'Editor' + | 'UploadImg' + | 'UploadImgs' + | 'UploadFile' + +export type ColProps = { + span?: number + xs?: number + sm?: number + md?: number + lg?: number + xl?: number + tag?: string +} + +export type ComponentOptions = { + label?: string + value?: FormValueType + disabled?: boolean + key?: string | number + children?: ComponentOptions[] + options?: ComponentOptions[] +} & Recordable + +export type ComponentOptionsAlias = { + labelField?: string + valueField?: string +} + +export type ComponentProps = { + optionsAlias?: ComponentOptionsAlias + options?: ComponentOptions[] + optionsSlot?: boolean +} & Recordable diff --git a/src/types/configGlobal.d.ts b/src/types/configGlobal.d.ts new file mode 100644 index 0000000..f6d7b3c --- /dev/null +++ b/src/types/configGlobal.d.ts @@ -0,0 +1,4 @@ +import { ElementPlusSize } from './elementPlus' +export interface ConfigGlobalTypes { + size?: ElementPlusSize +} diff --git a/src/types/contextMenu.d.ts b/src/types/contextMenu.d.ts new file mode 100644 index 0000000..0738d0e --- /dev/null +++ b/src/types/contextMenu.d.ts @@ -0,0 +1,7 @@ +export type contextMenuSchema = { + disabled?: boolean + divided?: boolean + icon?: string + label: string + command?: (item: contextMenuSchema) => void +} diff --git a/src/types/descriptions.d.ts b/src/types/descriptions.d.ts new file mode 100644 index 0000000..35c0b81 --- /dev/null +++ b/src/types/descriptions.d.ts @@ -0,0 +1,13 @@ +export interface DescriptionsSchema { + span?: number // 占多少分 + field: string // 字段名 + label?: string // label名 + width?: string | number + minWidth?: string | number + align?: 'left' | 'center' | 'right' + labelAlign?: 'left' | 'center' | 'right' + className?: string + labelClassName?: string + dateFormat?: string // add by 星语:支持时间的格式化 + dictType?: string // add by 星语:支持 dict 字典数据 +} diff --git a/src/types/elementPlus.d.ts b/src/types/elementPlus.d.ts new file mode 100644 index 0000000..2c6b76e --- /dev/null +++ b/src/types/elementPlus.d.ts @@ -0,0 +1,3 @@ +export type ElementPlusSize = 'default' | 'small' | 'large' + +export type ElementPlusInfoType = 'success' | 'info' | 'warning' | 'danger' diff --git a/src/types/form.d.ts b/src/types/form.d.ts new file mode 100644 index 0000000..980c8cc --- /dev/null +++ b/src/types/form.d.ts @@ -0,0 +1,44 @@ +import type { CSSProperties } from 'vue' +import { ColProps, ComponentProps, ComponentName } from '@/types/components' +import type { AxiosPromise } from 'axios' + +export type FormSetPropsType = { + field: string + path: string + value: any +} + +export type FormValueType = string | number | string[] | number[] | boolean | undefined | null + +export type FormItemProps = { + labelWidth?: string | number + required?: boolean + rules?: Recordable + error?: string + showMessage?: boolean + inlineMessage?: boolean + style?: CSSProperties +} + +export type FormSchema = { + // 唯一值 + field: string + // 标题 + label?: string + // 提示 + labelMessage?: string + // col组件属性 + colProps?: ColProps + // 表单组件属性,slots对应的是表单组件的插槽,规则:${field}-xxx,具体可以查看element-plus文档 + componentProps?: { slots?: Recordable } & ComponentProps + // formItem组件属性 + formItemProps?: FormItemProps + // 渲染的组件 + component?: ComponentName + // 初始值 + value?: FormValueType + // 是否隐藏 + hidden?: boolean + // 远程加载下拉项 + api?: () => AxiosPromise +} diff --git a/src/types/icon.d.ts b/src/types/icon.d.ts new file mode 100644 index 0000000..d1ffcdb --- /dev/null +++ b/src/types/icon.d.ts @@ -0,0 +1,5 @@ +export interface IconTypes { + size?: number + color?: string + icon: string +} diff --git a/src/types/infoTip.d.ts b/src/types/infoTip.d.ts new file mode 100644 index 0000000..6eff083 --- /dev/null +++ b/src/types/infoTip.d.ts @@ -0,0 +1,4 @@ +export interface TipSchema { + label: string + keys?: string[] +} diff --git a/src/types/layout.d.ts b/src/types/layout.d.ts new file mode 100644 index 0000000..cad3e2a --- /dev/null +++ b/src/types/layout.d.ts @@ -0,0 +1 @@ +export type LayoutType = 'classic' | 'topLeft' | 'top' | 'cutMenu' diff --git a/src/types/localeDropdown.d.ts b/src/types/localeDropdown.d.ts new file mode 100644 index 0000000..c749dce --- /dev/null +++ b/src/types/localeDropdown.d.ts @@ -0,0 +1,10 @@ +export interface Language { + el: Recordable + name: string +} + +export interface LocaleDropdownType { + lang: LocaleType + name?: string + elLocale?: Language +} diff --git a/src/types/qrcode.d.ts b/src/types/qrcode.d.ts new file mode 100644 index 0000000..86cdf0b --- /dev/null +++ b/src/types/qrcode.d.ts @@ -0,0 +1,9 @@ +export interface QrcodeLogo { + src?: string + logoSize?: number + bgColor?: string + borderSize?: number + crossOrigin?: string + borderRadius?: number + logoRadius?: number +} diff --git a/src/types/table.d.ts b/src/types/table.d.ts new file mode 100644 index 0000000..9cb4205 --- /dev/null +++ b/src/types/table.d.ts @@ -0,0 +1,44 @@ +export type TableColumn = { + field: string + label?: string + width?: number | string + fixed?: 'left' | 'right' + children?: TableColumn[] +} & Recordable + +export type VxeTableColumn = { + field: string + title?: string + children?: TableColumn[] +} & Recordable + +export type TableSlotDefault = { + row: Recordable + column: TableColumn + $index: number +} & Recordable + +export interface Pagination { + small?: boolean + background?: boolean + pageSize?: number + defaultPageSize?: number + total?: number + pageCount?: number + pagerCount?: number + currentPage?: number + defaultCurrentPage?: number + layout?: string + pageSizes?: number[] + popperClass?: string + prevText?: string + nextText?: string + disabled?: boolean + hideOnSinglePage?: boolean +} + +export interface TableSetPropsType { + field: string + path: string + value: any +} diff --git a/src/types/tableForm.d.ts b/src/types/tableForm.d.ts new file mode 100644 index 0000000..598deb8 --- /dev/null +++ b/src/types/tableForm.d.ts @@ -0,0 +1,44 @@ +import type { CSSProperties } from 'vue' +import { ColProps, ComponentProps, ComponentName } from '@/types/components' +import type { AxiosPromise } from 'axios' + +export type TableFormSetPropsType = { + field: string + path: string + value: any +} + +export type TableFormValueType = string | number | string[] | number[] | boolean | undefined | null + +export type TableFormItemProps = { + labelWidth?: string | number + required?: boolean + rules?: Recordable + error?: string + showMessage?: boolean + inlineMessage?: boolean + style?: CSSProperties +} + +export type TableFormSchema = { + // 唯一值 + field: string + // 标题 + label?: string + // 提示 + labelMessage?: string + // col组件属性 + colProps?: ColProps + // 表单组件属性,slots对应的是表单组件的插槽,规则:${field}-xxx,具体可以查看element-plus文档 + componentProps?: { slots?: Recordable } & ComponentProps + // formItem组件属性 + formItemProps?: FormItemProps + // 渲染的组件 + component?: ComponentName + // 初始值 + value?: FormValueType + // 是否隐藏 + hidden?: boolean + // 远程加载下拉项 + api?: () => AxiosPromise +} diff --git a/src/types/theme.d.ts b/src/types/theme.d.ts new file mode 100644 index 0000000..ad649b0 --- /dev/null +++ b/src/types/theme.d.ts @@ -0,0 +1,16 @@ +export type ThemeTypes = { + elColorPrimary?: string + leftMenuBorderColor?: string + leftMenuBgColor?: string + leftMenuBgLightColor?: string + leftMenuBgActiveColor?: string + leftMenuCollapseBgActiveColor?: string + leftMenuTextColor?: string + leftMenuTextActiveColor?: string + logoTitleTextColor?: string + logoBorderColor?: string + topHeaderBgColor?: string + topHeaderTextColor?: string + topHeaderHoverColor?: string + topToolBorderColor?: string +} diff --git a/src/utils/Logger.ts b/src/utils/Logger.ts new file mode 100644 index 0000000..ca58df2 --- /dev/null +++ b/src/utils/Logger.ts @@ -0,0 +1,100 @@ +const isArray = function (obj: any): boolean { + return Object.prototype.toString.call(obj) === '[object Array]' +} + +const Logger = () => {} + +Logger.typeColor = function (type: string) { + let color = '' + switch (type) { + case 'primary': + color = '#2d8cf0' + break + case 'success': + color = '#19be6b' + break + case 'info': + color = '#909399' + break + case 'warn': + color = '#ff9900' + break + case 'error': + color = '#f03f14' + break + default: + color = '#35495E' + break + } + return color +} + +Logger.print = function (type = 'default', text: any, back = false) { + if (typeof text === 'object') { + // 如果是對象則調用打印對象方式 + isArray(text) ? console.table(text) : console.dir(text) + return + } + if (back) { + // 如果是打印帶背景圖的 + console.log( + `%c ${text} `, + `background:${Logger.typeColor(type)}; padding: 2px; border-radius: 4px; color: #fff;` + ) + } else { + console.log( + `%c ${text} `, + `border: 1px solid ${Logger.typeColor(type)}; + padding: 2px; border-radius: 4px; + color: ${Logger.typeColor(type)};` + ) + } +} + +Logger.printBack = function (type = 'primary', text) { + this.print(type, text, true) +} + +Logger.pretty = function (type = 'primary', title, text) { + if (typeof text === 'object') { + console.group('Console Group', title) + console.log( + `%c ${title}`, + `background:${Logger.typeColor(type)};border:1px solid ${Logger.typeColor(type)}; + padding: 1px; border-radius: 4px; color: #fff;` + ) + isArray(text) ? console.table(text) : console.dir(text) + console.groupEnd() + return + } + console.log( + `%c ${title} %c ${text} %c`, + `background:${Logger.typeColor(type)};border:1px solid ${Logger.typeColor(type)}; + padding: 1px; border-radius: 4px 0 0 4px; color: #fff;`, + `border:1px solid ${Logger.typeColor(type)}; + padding: 1px; border-radius: 0 4px 4px 0; color: ${Logger.typeColor(type)};`, + 'background:transparent' + ) +} + +Logger.prettyPrimary = function (title, ...text) { + text.forEach((t) => this.pretty('primary', title, t)) +} + +Logger.prettySuccess = function (title, ...text) { + text.forEach((t) => this.pretty('success', title, t)) +} + +Logger.prettyWarn = function (title, ...text) { + text.forEach((t) => this.pretty('warn', title, t)) +} + +Logger.prettyError = function (title, ...text) { + text.forEach((t) => this.pretty('error', title, t)) +} + +Logger.prettyInfo = function (title, ...text) { + text.forEach((t) => this.pretty('info', title, t)) +} + +export default Logger diff --git a/src/utils/auth.ts b/src/utils/auth.ts new file mode 100644 index 0000000..7da49b0 --- /dev/null +++ b/src/utils/auth.ts @@ -0,0 +1,92 @@ +import { useCache } from '@/hooks/web/useCache' +import { TokenType } from '@/api/login/types' +import { decrypt, encrypt } from '@/utils/jsencrypt' + +const { wsCache } = useCache() + +const AccessTokenKey = 'ACCESS_TOKEN' +const RefreshTokenKey = 'REFRESH_TOKEN' + +// 获取token +export const getAccessToken = () => { + // 此处与TokenKey相同,此写法解决初始化时Cookies中不存在TokenKey报错 + return wsCache.get(AccessTokenKey) ? wsCache.get(AccessTokenKey) : wsCache.get('ACCESS_TOKEN') +} + +// 刷新token +export const getRefreshToken = () => { + return wsCache.get(RefreshTokenKey) +} + +// 设置token +export const setToken = (token: TokenType) => { + wsCache.set(RefreshTokenKey, token.refreshToken) + wsCache.set(AccessTokenKey, token.accessToken) +} + +// 删除token +export const removeToken = () => { + wsCache.delete(AccessTokenKey) + wsCache.delete(RefreshTokenKey) +} + +/** 格式化token(jwt格式) */ +export const formatToken = (token: string): string => { + return 'Bearer ' + token +} +// ========== 账号相关 ========== + +const LoginFormKey = 'LOGINFORM' + +export type LoginFormType = { + tenantName: string + username: string + password: string + rememberMe: boolean +} + +export const getLoginForm = () => { + const loginForm: LoginFormType = wsCache.get(LoginFormKey) + if (loginForm) { + loginForm.password = decrypt(loginForm.password) as string + } + return loginForm +} + +export const setLoginForm = (loginForm: LoginFormType) => { + loginForm.password = encrypt(loginForm.password) as string + wsCache.set(LoginFormKey, loginForm, { exp: 30 * 24 * 60 * 60 }) +} + +export const removeLoginForm = () => { + wsCache.delete(LoginFormKey) +} + +// ========== 租户相关 ========== + +const TenantIdKey = 'TENANT_ID' +const TenantNameKey = 'TENANT_NAME' + +export const getTenantName = () => { + return wsCache.get(TenantNameKey) +} + +export const setTenantName = (username: string) => { + wsCache.set(TenantNameKey, username, { exp: 30 * 24 * 60 * 60 }) +} + +export const removeTenantName = () => { + wsCache.delete(TenantNameKey) +} + +export const getTenantId = () => { + return wsCache.get(TenantIdKey) +} + +export const setTenantId = (username: string) => { + wsCache.set(TenantIdKey, username) +} + +export const removeTenantId = () => { + wsCache.delete(TenantIdKey) +} diff --git a/src/utils/color.ts b/src/utils/color.ts new file mode 100644 index 0000000..6888583 --- /dev/null +++ b/src/utils/color.ts @@ -0,0 +1,153 @@ +/** + * 判断是否 十六进制颜色值. + * 输入形式可为 #fff000 #f00 + * + * @param String color 十六进制颜色值 + * @return Boolean + */ +export const isHexColor = (color: string) => { + const reg = /^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/ + return reg.test(color) +} + +/** + * RGB 颜色值转换为 十六进制颜色值. + * r, g, 和 b 需要在 [0, 255] 范围内 + * + * @return String 类似#ff00ff + * @param r + * @param g + * @param b + */ +export const rgbToHex = (r: number, g: number, b: number) => { + // tslint:disable-next-line:no-bitwise + const hex = ((r << 16) | (g << 8) | b).toString(16) + return '#' + new Array(Math.abs(hex.length - 7)).join('0') + hex +} + +/** + * Transform a HEX color to its RGB representation + * @param {string} hex The color to transform + * @returns The RGB representation of the passed color + */ +export const hexToRGB = (hex: string, opacity?: number) => { + let sHex = hex.toLowerCase() + if (isHexColor(hex)) { + if (sHex.length === 4) { + let sColorNew = '#' + for (let i = 1; i < 4; i += 1) { + sColorNew += sHex.slice(i, i + 1).concat(sHex.slice(i, i + 1)) + } + sHex = sColorNew + } + const sColorChange: number[] = [] + for (let i = 1; i < 7; i += 2) { + sColorChange.push(parseInt('0x' + sHex.slice(i, i + 2))) + } + return opacity + ? 'RGBA(' + sColorChange.join(',') + ',' + opacity + ')' + : 'RGB(' + sColorChange.join(',') + ')' + } + return sHex +} + +export const colorIsDark = (color: string) => { + if (!isHexColor(color)) return + const [r, g, b] = hexToRGB(color) + .replace(/(?:\(|\)|rgb|RGB)*/g, '') + .split(',') + .map((item) => Number(item)) + return r * 0.299 + g * 0.578 + b * 0.114 < 192 +} + +/** + * Darkens a HEX color given the passed percentage + * @param {string} color The color to process + * @param {number} amount The amount to change the color by + * @returns {string} The HEX representation of the processed color + */ +export const darken = (color: string, amount: number) => { + color = color.indexOf('#') >= 0 ? color.substring(1, color.length) : color + amount = Math.trunc((255 * amount) / 100) + return `#${subtractLight(color.substring(0, 2), amount)}${subtractLight( + color.substring(2, 4), + amount + )}${subtractLight(color.substring(4, 6), amount)}` +} + +/** + * Lightens a 6 char HEX color according to the passed percentage + * @param {string} color The color to change + * @param {number} amount The amount to change the color by + * @returns {string} The processed color represented as HEX + */ +export const lighten = (color: string, amount: number) => { + color = color.indexOf('#') >= 0 ? color.substring(1, color.length) : color + amount = Math.trunc((255 * amount) / 100) + return `#${addLight(color.substring(0, 2), amount)}${addLight( + color.substring(2, 4), + amount + )}${addLight(color.substring(4, 6), amount)}` +} + +/* Suma el porcentaje indicado a un color (RR, GG o BB) hexadecimal para aclararlo */ +/** + * Sums the passed percentage to the R, G or B of a HEX color + * @param {string} color The color to change + * @param {number} amount The amount to change the color by + * @returns {string} The processed part of the color + */ +const addLight = (color: string, amount: number) => { + const cc = parseInt(color, 16) + amount + const c = cc > 255 ? 255 : cc + return c.toString(16).length > 1 ? c.toString(16) : `0${c.toString(16)}` +} + +/** + * Calculates luminance of an rgb color + * @param {number} r red + * @param {number} g green + * @param {number} b blue + */ +const luminanace = (r: number, g: number, b: number) => { + const a = [r, g, b].map((v) => { + v /= 255 + return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4) + }) + return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722 +} + +/** + * Calculates contrast between two rgb colors + * @param {string} rgb1 rgb color 1 + * @param {string} rgb2 rgb color 2 + */ +const contrast = (rgb1: string[], rgb2: number[]) => { + return ( + (luminanace(~~rgb1[0], ~~rgb1[1], ~~rgb1[2]) + 0.05) / + (luminanace(rgb2[0], rgb2[1], rgb2[2]) + 0.05) + ) +} + +/** + * Determines what the best text color is (black or white) based con the contrast with the background + * @param hexColor - Last selected color by the user + */ +export const calculateBestTextColor = (hexColor: string) => { + const rgbColor = hexToRGB(hexColor.substring(1)) + const contrastWithBlack = contrast(rgbColor.split(','), [0, 0, 0]) + + return contrastWithBlack >= 12 ? '#000000' : '#FFFFFF' +} + +/** + * Subtracts the indicated percentage to the R, G or B of a HEX color + * @param {string} color The color to change + * @param {number} amount The amount to change the color by + * @returns {string} The processed part of the color + */ +const subtractLight = (color: string, amount: number) => { + const cc = parseInt(color, 16) - amount + const c = cc < 0 ? 0 : cc + return c.toString(16).length > 1 ? c.toString(16) : `0${c.toString(16)}` +} diff --git a/src/utils/constants.ts b/src/utils/constants.ts new file mode 100644 index 0000000..2624d92 --- /dev/null +++ b/src/utils/constants.ts @@ -0,0 +1,360 @@ +/** + * Created by 闻荫源码 + * + * 枚举类 + */ + +// 全局通用状态枚举 +export const CommonStatusEnum = { + ENABLE: 0, // 开启 + DISABLE: 1 // 禁用 +} + +/** + * 菜单的类型枚举 + */ +export const SystemMenuTypeEnum = { + DIR: 1, // 目录 + MENU: 2, // 菜单 + BUTTON: 3 // 按钮 +} + +/** + * 角色的类型枚举 + */ +export const SystemRoleTypeEnum = { + SYSTEM: 1, // 内置角色 + CUSTOM: 2 // 自定义角色 +} + +/** + * 数据权限的范围枚举 + */ +export const SystemDataScopeEnum = { + ALL: 1, // 全部数据权限 + DEPT_CUSTOM: 2, // 指定部门数据权限 + DEPT_ONLY: 3, // 部门数据权限 + DEPT_AND_CHILD: 4, // 部门及以下数据权限 + DEPT_SELF: 5 // 仅本人数据权限 +} + +/** + * 代码生成模板类型 + */ +export const InfraCodegenTemplateTypeEnum = { + CRUD: 1, // 基础 CRUD + TREE: 2, // 树形 CRUD + SUB: 3 // 主子表 CRUD +} + +/** + * 任务状态的枚举 + */ +export const InfraJobStatusEnum = { + INIT: 0, // 初始化中 + NORMAL: 1, // 运行中 + STOP: 2 // 暂停运行 +} + +/** + * API 异常数据的处理状态 + */ +export const InfraApiErrorLogProcessStatusEnum = { + INIT: 0, // 未处理 + DONE: 1, // 已处理 + IGNORE: 2 // 已忽略 +} + +/** + * 用户的社交平台的类型枚举 + */ +export const SystemUserSocialTypeEnum = { + DINGTALK: { + title: '钉钉', + type: 20, + source: 'dingtalk', + img: 'https://s1.ax1x.com/2022/05/22/OzMDRs.png' + }, + WECHAT_ENTERPRISE: { + title: '企业微信', + type: 30, + source: 'wechat_enterprise', + img: 'https://s1.ax1x.com/2022/05/22/OzMrzn.png' + } +} + +/** + * 支付渠道枚举 + */ +export const PayChannelEnum = { + WX_PUB: { + code: 'wx_pub', + name: '微信 JSAPI 支付' + }, + WX_LITE: { + code: 'wx_lite', + name: '微信小程序支付' + }, + WX_APP: { + code: 'wx_app', + name: '微信 APP 支付' + }, + WX_BAR: { + code: 'wx_bar', + name: '微信条码支付' + }, + ALIPAY_PC: { + code: 'alipay_pc', + name: '支付宝 PC 网站支付' + }, + ALIPAY_WAP: { + code: 'alipay_wap', + name: '支付宝 WAP 网站支付' + }, + ALIPAY_APP: { + code: 'alipay_app', + name: '支付宝 APP 支付' + }, + ALIPAY_QR: { + code: 'alipay_qr', + name: '支付宝扫码支付' + }, + ALIPAY_BAR: { + code: 'alipay_bar', + name: '支付宝条码支付' + }, + MOCK: { + code: 'mock', + name: '模拟支付' + } +} + +/** + * 支付的展示模式每局 + */ +export const PayDisplayModeEnum = { + URL: { + mode: 'url' + }, + IFRAME: { + mode: 'iframe' + }, + FORM: { + mode: 'form' + }, + QR_CODE: { + mode: 'qr_code' + }, + APP: { + mode: 'app' + } +} + +/** + * 支付类型枚举 + */ +export const PayType = { + WECHAT: 'WECHAT', + ALIPAY: 'ALIPAY', + MOCK: 'MOCK' +} + +/** + * 支付订单状态枚举 + */ +export const PayOrderStatusEnum = { + WAITING: { + status: 0, + name: '未支付' + }, + SUCCESS: { + status: 10, + name: '已支付' + }, + CLOSED: { + status: 20, + name: '未支付' + } +} + +/** + * 商品 SPU 状态 + */ +export const ProductSpuStatusEnum = { + RECYCLE: { + status: -1, + name: '回收站' + }, + DISABLE: { + status: 0, + name: '下架' + }, + ENABLE: { + status: 1, + name: '上架' + } +} + +/** + * 优惠劵模板的有限期类型的枚举 + */ +export const CouponTemplateValidityTypeEnum = { + DATE: { + type: 1, + name: '固定日期可用' + }, + TERM: { + type: 2, + name: '领取之后可用' + } +} + +/** + * 优惠劵模板的领取方式的枚举 + */ +export const CouponTemplateTakeTypeEnum = { + USER: { + type: 1, + name: '直接领取' + }, + ADMIN: { + type: 2, + name: '指定发放' + }, + REGISTER: { + type: 3, + name: '新人券' + } +} + +/** + * 营销的商品范围枚举 + */ +export const PromotionProductScopeEnum = { + ALL: { + scope: 1, + name: '通用劵' + }, + SPU: { + scope: 2, + name: '商品劵' + }, + CATEGORY: { + scope: 3, + name: '品类劵' + } +} + +/** + * 营销的条件类型枚举 + */ +export const PromotionConditionTypeEnum = { + PRICE: { + type: 10, + name: '满 N 元' + }, + COUNT: { + type: 20, + name: '满 N 件' + } +} + +/** + * 优惠类型枚举 + */ +export const PromotionDiscountTypeEnum = { + PRICE: { + type: 1, + name: '满减' + }, + PERCENT: { + type: 2, + name: '折扣' + } +} + +/** + * 分销关系绑定模式枚举 + */ +export const BrokerageBindModeEnum = { + ANYTIME: { + mode: 0, + name: '没有推广人' + }, + REGISTER: { + mode: 1, + name: '新用户' + } +} +/** + * 分佣模式枚举 + */ +export const BrokerageEnabledConditionEnum = { + ALL: { + condition: 0, + name: '人人分销' + }, + ADMIN: { + condition: 1, + name: '指定分销' + } +} +/** + * 佣金记录业务类型枚举 + */ +export const BrokerageRecordBizTypeEnum = { + ORDER: { + type: 1, + name: '获得推广佣金' + }, + WITHDRAW: { + type: 2, + name: '提现申请' + } +} +/** + * 佣金提现状态枚举 + */ +export const BrokerageWithdrawStatusEnum = { + AUDITING: { + status: 0, + name: '审核中' + }, + AUDIT_SUCCESS: { + status: 10, + name: '审核通过' + }, + AUDIT_FAIL: { + status: 20, + name: '审核不通过' + }, + WITHDRAW_SUCCESS: { + status: 11, + name: '提现成功' + }, + WITHDRAW_FAIL: { + status: 21, + name: '提现失败' + } +} +/** + * 佣金提现类型枚举 + */ +export const BrokerageWithdrawTypeEnum = { + WALLET: { + type: 1, + name: '钱包' + }, + BANK: { + type: 2, + name: '银行卡' + }, + WECHAT: { + type: 3, + name: '微信' + }, + ALIPAY: { + type: 4, + name: '支付宝' + } +} diff --git a/src/utils/dict.ts b/src/utils/dict.ts new file mode 100644 index 0000000..48718c9 --- /dev/null +++ b/src/utils/dict.ts @@ -0,0 +1,269 @@ +/** + * 数据字典工具类 + */ +import { useDictStoreWithOut } from '@/store/modules/dict' +import { ElementPlusInfoType } from '@/types/elementPlus' + +const dictStore = useDictStoreWithOut() + +/** + * 获取 dictType 对应的数据字典数组 + * + * @param dictType 数据类型 + * @returns {*|Array} 数据字典数组 + */ +export interface DictDataType { + dictType: string + label: string + value: string | number | boolean + colorType: ElementPlusInfoType | '' + cssClass: string +} + +export const getDictOptions = (dictType: string) => { + return dictStore.getDictByType(dictType) || [] +} + +export const getIntDictOptions = (dictType: string) => { + const dictOption: DictDataType[] = [] + const dictOptions: DictDataType[] = getDictOptions(dictType) + dictOptions.forEach((dict: DictDataType) => { + dictOption.push({ + ...dict, + value: parseInt(dict.value + '') + }) + }) + return dictOption +} + +export const getStrDictOptions = (dictType: string) => { + const dictOption: DictDataType[] = [] + const dictOptions: DictDataType[] = getDictOptions(dictType) + dictOptions.forEach((dict: DictDataType) => { + dictOption.push({ + ...dict, + value: dict.value + '' + }) + }) + return dictOption +} + +export const getBoolDictOptions = (dictType: string) => { + const dictOption: DictDataType[] = [] + const dictOptions: DictDataType[] = getDictOptions(dictType) + dictOptions.forEach((dict: DictDataType) => { + dictOption.push({ + ...dict, + value: dict.value + '' === 'true' + }) + }) + return dictOption +} + +/** + * 获取指定字典类型的指定值对应的字典对象 + * @param dictType 字典类型 + * @param value 字典值 + * @return DictDataType 字典对象 + */ +export const getDictObj = (dictType: string, value: any): DictDataType | undefined => { + const dictOptions: DictDataType[] = getDictOptions(dictType) + for (const dict of dictOptions) { + if (dict.value === value + '') { + return dict + } + } +} + +/** + * 获得字典数据的文本展示 + * + * @param dictType 字典类型 + * @param value 字典数据的值 + * @return 字典名称 + */ +export const getDictLabel = (dictType: string, value: any): string => { + const dictOptions: DictDataType[] = getDictOptions(dictType) + const dictLabel = ref('') + dictOptions.forEach((dict: DictDataType) => { + if (dict.value === value + '') { + dictLabel.value = dict.label + } + }) + return dictLabel.value +} + +export enum DICT_TYPE { + USER_TYPE = 'user_type', + COMMON_STATUS = 'common_status', + SYSTEM_TENANT_PACKAGE_ID = 'system_tenant_package_id', + TERMINAL = 'terminal', // 终端 + + // ========== SYSTEM 模块 ========== + SYSTEM_USER_SEX = 'system_user_sex', + SYSTEM_MENU_TYPE = 'system_menu_type', + SYSTEM_ROLE_TYPE = 'system_role_type', + SYSTEM_DATA_SCOPE = 'system_data_scope', + SYSTEM_NOTICE_TYPE = 'system_notice_type', + SYSTEM_OPERATE_TYPE = 'system_operate_type', + SYSTEM_LOGIN_TYPE = 'system_login_type', + SYSTEM_LOGIN_RESULT = 'system_login_result', + SYSTEM_SMS_CHANNEL_CODE = 'system_sms_channel_code', + SYSTEM_SMS_TEMPLATE_TYPE = 'system_sms_template_type', + SYSTEM_SMS_SEND_STATUS = 'system_sms_send_status', + SYSTEM_SMS_RECEIVE_STATUS = 'system_sms_receive_status', + SYSTEM_ERROR_CODE_TYPE = 'system_error_code_type', + SYSTEM_OAUTH2_GRANT_TYPE = 'system_oauth2_grant_type', + SYSTEM_MAIL_SEND_STATUS = 'system_mail_send_status', + SYSTEM_NOTIFY_TEMPLATE_TYPE = 'system_notify_template_type', + + // ========== INFRA 模块 ========== + INFRA_BOOLEAN_STRING = 'infra_boolean_string', + INFRA_JOB_STATUS = 'infra_job_status', + INFRA_JOB_LOG_STATUS = 'infra_job_log_status', + INFRA_API_ERROR_LOG_PROCESS_STATUS = 'infra_api_error_log_process_status', + INFRA_CONFIG_TYPE = 'infra_config_type', + INFRA_CODEGEN_TEMPLATE_TYPE = 'infra_codegen_template_type', + INFRA_CODEGEN_FRONT_TYPE = 'infra_codegen_front_type', + INFRA_CODEGEN_SCENE = 'infra_codegen_scene', + INFRA_FILE_STORAGE = 'infra_file_storage', + + // ========== BPM 模块 ========== + BPM_MODEL_CATEGORY = 'bpm_model_category', + BPM_MODEL_FORM_TYPE = 'bpm_model_form_type', + BPM_TASK_ASSIGN_RULE_TYPE = 'bpm_task_assign_rule_type', + BPM_PROCESS_INSTANCE_STATUS = 'bpm_process_instance_status', + BPM_PROCESS_INSTANCE_RESULT = 'bpm_process_instance_result', + BPM_TASK_ASSIGN_SCRIPT = 'bpm_task_assign_script', + BPM_OA_LEAVE_TYPE = 'bpm_oa_leave_type', + + // ========== PAY 模块 ========== + PAY_CHANNEL_CODE = 'pay_channel_code', // 支付渠道编码类型 + PAY_ORDER_STATUS = 'pay_order_status', // 商户支付订单状态 + PAY_REFUND_STATUS = 'pay_refund_status', // 退款订单状态 + PAY_NOTIFY_STATUS = 'pay_notify_status', // 商户支付回调状态 + PAY_NOTIFY_TYPE = 'pay_notify_type', // 商户支付回调状态 + + // ========== MP 模块 ========== + MP_AUTO_REPLY_REQUEST_MATCH = 'mp_auto_reply_request_match', // 自动回复请求匹配类型 + MP_MESSAGE_TYPE = 'mp_message_type', // 消息类型 + + // ========== MALL - 会员模块 ========== + MEMBER_POINT_BIZ_TYPE = 'member_point_biz_type', // 积分的业务类型 + MEMBER_EXPERIENCE_BIZ_TYPE = 'member_experience_biz_type', // 会员经验业务类型 + + // ========== MALL - 商品模块 ========== + PRODUCT_UNIT = 'product_unit', // 商品单位 + PRODUCT_SPU_STATUS = 'product_spu_status', //商品状态 + + // ========== MALL - 交易模块 ========== + EXPRESS_CHARGE_MODE = 'trade_delivery_express_charge_mode', //快递的计费方式 + TRADE_AFTER_SALE_STATUS = 'trade_after_sale_status', // 售后 - 状态 + TRADE_AFTER_SALE_WAY = 'trade_after_sale_way', // 售后 - 方式 + TRADE_AFTER_SALE_TYPE = 'trade_after_sale_type', // 售后 - 类型 + TRADE_ORDER_TYPE = 'trade_order_type', // 订单 - 类型 + TRADE_ORDER_STATUS = 'trade_order_status', // 订单 - 状态 + TRADE_ORDER_ITEM_AFTER_SALE_STATUS = 'trade_order_item_after_sale_status', // 订单项 - 售后状态 + TRADE_DELIVERY_TYPE = 'trade_delivery_type', // 配送方式 + BROKERAGE_ENABLED_CONDITION = 'brokerage_enabled_condition', // 分佣模式 + BROKERAGE_BIND_MODE = 'brokerage_bind_mode', // 分销关系绑定模式 + BROKERAGE_BANK_NAME = 'brokerage_bank_name', // 佣金提现银行 + BROKERAGE_WITHDRAW_TYPE = 'brokerage_withdraw_type', // 佣金提现类型 + BROKERAGE_RECORD_BIZ_TYPE = 'brokerage_record_biz_type', // 佣金业务类型 + BROKERAGE_RECORD_STATUS = 'brokerage_record_status', // 佣金状态 + BROKERAGE_WITHDRAW_STATUS = 'brokerage_withdraw_status', // 佣金提现状态 + + // ========== MALL - 营销模块 ========== + PROMOTION_DISCOUNT_TYPE = 'promotion_discount_type', // 优惠类型 + PROMOTION_PRODUCT_SCOPE = 'promotion_product_scope', // 营销的商品范围 + PROMOTION_COUPON_TEMPLATE_VALIDITY_TYPE = 'promotion_coupon_template_validity_type', // 优惠劵模板的有限期类型 + PROMOTION_COUPON_STATUS = 'promotion_coupon_status', // 优惠劵的状态 + PROMOTION_COUPON_TAKE_TYPE = 'promotion_coupon_take_type', // 优惠劵的领取方式 + PROMOTION_ACTIVITY_STATUS = 'promotion_activity_status', // 优惠活动的状态 + PROMOTION_CONDITION_TYPE = 'promotion_condition_type', // 营销的条件类型枚举 + + // ========== 业务 - WMS ========== + ITEM_STATUS = 'item_status', // 物品状态 + ITEM_TYPE = 'item_type', // 物品类型 + UOM = 'uom', // 计量单位 + ABC_CLASS = 'abc_class', // ABC类 + TRUE_FALSE = 'true_false', // 是否 + ITEM_GROUP = 'item_group', // 物品分组 + ITEM_CATEGORY = 'Item_category', // 物品种类 + ITEM_COLOR = 'item_color', // 物品颜色 + ITEM_CONFIGURATION = 'item_configuration', // 物品配置 + EQ_LEVEL = 'eq_level', // 质量等级 + CURRENCY = 'currency', // 货币 + SUPPLIER_TYPE = 'supplier_type', // 供应商类型 + CUSTOMER_TYPE = 'customer_type', // 客户类型 + OWNER_TYPE = 'owner_type', // 货主类型 + CARRIER_TYPE = 'carrier_type', // 承运商类型 + INSPECT_TYPE = 'inspect_type', // 检验类型 + NEXT_ACTION = 'next_action', // 下一步检验动作 + SAMPLE_METHOD = 'sample_method', // 抽检方式 + WAREHOUSE_TYPE = 'warehouse_type', // 仓库类型 + DOCK_TYPE = 'dock_type', // 月台类型 + AREA_TYPE = 'area_type', // 库区类型 + INVENTORY_STATUS = 'inventory_status', // 库存状态 + ERP_LOCATION = 'erp_location', // ERP库位 + LOCATION_TYPE = 'location_type', // 库位类型 + WORKSHOP_TYPE = 'workshop_type', // 车间类型 + PRODUCTION_LINE_TYPE = 'production_line_type', // 生产线类型 + WORK_STATION_TYPE = 'work_station_type', // 工位类型 + PROCESS_TYPE = 'process_type', // 工序类型 + LOCATION_SCOPE_TYPE = 'location_scope_type', // 库位维度 + STORAGE_TYPE = 'storage_type', // 存储类型 + ITEM_SCOPE_TYPE = 'item_scope_type', // 物品维度 + BATCH_TYPE = 'batch_type', // 批次类型 + BATCH_DIRECTION = 'batch_direction', // 批次方向 + MANAGEMENT_MODE = 'management_mode', // 管理模式 + DOCUMENT_TYPE = 'document_type', // 单据分类 + REQEUST_MODE = 'reqeust_mode', // 申请模式 + TIME_UNIT = 'time_unit', // 时间单位 + COUNT_TYPE = 'count_type', // 盘点类型 + BARCODE_PREFIX = 'barcode_prefix', // 条码前缀 + SETTLEMENT_TYPE = 'settlement_type', // 结算类型 + FROZEN_REASON = 'frozen_reason', // 冻结原因 + INVENTORY_ACTION = 'inventory_action', // 库存动作 + CONTAINER_TYPE = 'container_type', // 器具类型 + CONTAINER_CONTENT_TYPE = 'container_content_type', // 器具内容类型 + RESET_PERIOD = 'reset_period', // 重置周期 + INTERFACE_TYPE = 'interface_type', // 接口类型 + PURCHASE_ORDER_TYPE = 'purchase_order_type', // 采购订单类型 + PURCHASE_ORDER_STATUS = 'purchase_order_status', // 采购订单状态 + PURCHASE_ORDER_DETAIL_STATUS = 'purchase_order_detail_status', // 采购订单明细状态 + SALE_ORDER_TYPE = 'sale_order_type', // 销售订单类型 + SALE_ORDER_STATUS = 'sale_order_status', // 销售订单状态 + SALE_ORDER_DETAIL_STATUS = 'sale_order_detail_status', // 销售订单明细状态 + WORK_ORDER_TYPE = 'work_order_type', // 生产订单类型 + WORK_ORDER_STATUS = 'work_order_status', // 生产订单状态 + WORK_ORDER_DETAIL_STATUS = 'work_order_detail_status', // 生产订单明细状态 + PURCHASE_PLAN_STATUS = 'purchase_plan_status', // 要货计划状态 + PURCHASE_PLAN_DETAIL_STATUS = 'purchase_plan_detail_status', // 要货计划明细状态 + PRODUCTION_PLAN_STATUS = 'production_plan_status', // 生产计划状态 + PRODUCTION_PLAN_DETAIL_STATUS = 'production_plan_detail_status', // 生产计划明细状态 + PREPARE_TO_ISSUE_PLAN_STATUS = 'prepare_to_issue_plan_status', // 备料计划状态 + PREPARE_TO_ISSUE_PLAN_DETAIL_STATUS = 'prepare_to_issue_plan_detail_status', // 备料计划明细状态 + DELIVER_PLAN_STATUS = 'deliver_plan_status', // 发货计划状态 + DELIVER_DETAIL_STATUS = 'deliver_detail_status', // 发货计划明细状态 + PREPARE_TO_DELIVER_PLAN_STATUS = 'prepare_to_deliver_plan_status', // 备货计划状态 + PREPARE_TO_DELIVER_PLAN_DETAIL_STATUS = 'prepare_to_deliver_plan_detail_status', // 备货计划明细状态 + COUNT_PLAN_STATUS = 'count_plan_status', // 盘点计划状态 + COUNT_DIMENSION = 'count_dimension', // 盘点维度 + REQUEST_STATUS = 'request_status', // 申请状态 + UNPLANNED_RECEIPT_REASON = 'unplanned_receipt_reason', // 计划外入库原因 + UNPLANNED_ISSUE_REASON = 'unplanned_issue_reason', // 计划外出库原因 + SCRAP_REASON = 'scrap_reason', // 报废出库原因 + COUNT_STAGE = 'count_stage', // 盘点阶段 + JOB_STATUS = 'job_status', // 任务状态 + RECORD_STATUS = 'record_status', // 记录状态 + PURCHASE_RETURN_REASON = 'purchase_return_reason', // 采购退货原因 + INSPECT_FAILED_REASON = 'inspect_failed_reason', // 检验不合格原因 + INSPECT_RESULT = 'inspect_result', // 检验结果 + STRATEGY_TYPE = 'strategy_type', // 策略类型 + STRATEGY_PARAM_OPEARTOR = 'strategy_param_opeartor', // 策略参数操作符 + DATA_TYPE = 'data_type', // 数据类型 + PACK_UNIT = 'pack_unit', // 包装单位 + DETAIL_STATUS = 'detail_status' // 明细状态 + +} diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts new file mode 100644 index 0000000..ee76609 --- /dev/null +++ b/src/utils/disposition/defaultButtons.ts @@ -0,0 +1,339 @@ +// 页面基础按钮样式 +/** + * 如果需要更改配置,格式如:defaultExportBtn({label:'自定义'}) + * @param {*} option + * @returns + */ + +// 新增按钮 +export function defaultAddBtn(option:any) { + return __defaultBtnOption(option,{ + label: '新增', + name: 'add', + hide: false, + type: 'primary', + icon: 'ep:plus', + color: '', + hasPermi: '' + }) +} + +// 导入按钮 +export function defaultImportBtn(option:any) { + return __defaultBtnOption(option,{ + label: '导入', + name: 'import', + hide: false, + type: 'warning', + icon: 'ep:upload', + color: '', + hasPermi: '' + }) +} + +// 导出按钮 +export function defaultExportBtn(option:any) { + return __defaultBtnOption(option,{ + label: '导出', + name: 'export', + hide: false, + type: 'success', + icon: 'ep:download', + color: '', + hasPermi: '' + }) +} + +// 字段设置 +// export function defaultFieldSettingBtn(option:any) { +// // todo:监听已经配置过的字段按钮更改状态特殊显示 +// const routeName = route.name +// let _local = localStorage.getItem('tableColumns_' + this.$store.getters.name.userName + '_' + routeName) +// let _type = '' +// let _num = 0 +// if(_local){ +// JSON.parse(_local).forEach((item: any) => { +// if(item.istrue == true){ +// _num ++ +// } +// }); +// if(_num >= JSON.parse(_local).length){ +// _type = '' +// }else{ +// _type= 'warning' +// } +// } +// return __defaultBtnOption(option,{ +// type: _type, +// plain: true, +// icon: "el-icon-setting", +// label: "字段设置", +// name: "field", +// size: "small", +// float: 'right', +// class: "rowDropNotHideItem" +// }) +// } + +// 刷新按钮 +export function defaultFreshBtn(option:any) { + return __defaultBtnOption(option,{ + label: '刷新', + name: 'refresh', + hide: false, + type: 'primary', + icon: 'ep:refresh', + color: '', + float:'right', + hasPermi: '' + }) +} + +// 重置按钮 +export function defaultResetBtn(option:any) { + return __defaultBtnOption(option,{ + label: '重置', + name: 'reset', + hide: false, + type: 'info', + icon: '', + color: '', + float:'right', + hasPermi: '' + }) +} + +// 字段设置 +export function defaultSetBtn(option:any) { + return __defaultBtnOption(option,{ + label: '设置', + name: 'set', + hide: false, + type: 'info', + icon: 'ep:setting', + color: '', + float:'right', + hasPermi: '' + }) +} + +// 筛选按钮 +export function defaultFilterBtn(option:any) { + return __defaultBtnOption(option,{ + label: '筛选', + name: 'filtrate', + hide: false, + type: 'info', + icon: 'ep:operation', + color: '', + float:'right', + hasPermi: '' + }) +} + +// 筛选——查询按钮 +export function defaultSearchBtn(option:any) { + return __defaultBtnOption(option,{ + label: '搜索', + name: 'search', + hide: false, + type: 'primary', + icon: '', + color: '', + float:'right', + hasPermi: '' + }) +} + +// 筛选——重置按钮 +export function defaultSearchResetBtn(option:any) { + return __defaultBtnOption(option,{ + label: '重置', + name: 'searchReset', + hide: false, + type: 'info', + icon: '', + color: '', + float:'right', + hasPermi: '' + }) +} + +// form表单-保存按钮 +export function formSaveBtn(option:any) { + return __defaultBtnOption(option,{ + label: '保存', + name: 'save', + hide: false, + type: 'primary', + icon: 'ep:select', + color: '', + float:'right', + hasPermi: '' + }) +} + +// form表单-关闭按钮 +export function formCloseBtn(option:any) { + return __defaultBtnOption(option,{ + label: '关闭', + name: 'close', + hide: false, + icon: 'ep:close', + color: '', + float:'right', + hasPermi: '' + }) +} + +// drawer抽屉头部-编辑按钮 +export function drawerEditBtn(option:any) { + return __defaultBtnOption(option,{ + label: '编辑', + name: 'edit', + hide: false, + type: 'warning', + icon: 'ep:editPen', + color: '', + hasPermi: '' + }) +} + +// drawer抽屉头部-删除按钮 +export function drawerDeleteBtn(option:any) { + return __defaultBtnOption(option,{ + label: '删除', + name: 'delete', + hide: false, + type: 'danger', + icon: 'ep:delete', + color: '', + hasPermi: '' + }) +} + +// 主列表-详情按钮 +// export function mainListDetailBtn(option:any) { +// return __defaultBtnOption(option,{ +// label: '详情', +// name: 'detail', +// hide: false, +// type: 'primary', +// color: '', +// link: true, // 文本展现按钮 +// hasPermi: '' +// }) +// } + +// 主列表-编辑按钮 +export function mainListEditBtn(option:any) { + return __defaultBtnOption(option,{ + label: '编辑', + name: 'edit', + hide: false, + type: 'warning', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + +// 主列表-删除按钮 +export function mainListDeleteBtn(option:any) { + return __defaultBtnOption(option,{ + label: '删除', + name: 'delete', + hide: false, + type: 'danger', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + +// 主列表-申请流程-关闭按钮 +export function mainListCloseBtn(option:any) { + return __defaultBtnOption(option,{ + label: '关闭', + name: 'mainClose', + hide: false, + type: 'danger', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + +// 主列表-申请流程-重新添加按钮 +export function mainListReAddBtn(option:any) { + return __defaultBtnOption(option,{ + label: '重新添加', + name: 'mainReAdd', + hide: false, + type: 'danger', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + +// 主列表-申请流程-提交审批按钮 +export function mainListSubmitBtn(option:any) { + return __defaultBtnOption(option,{ + label: '提交审批', + name: 'mainSubmit', + hide: false, + type: 'danger', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + +// 主列表-申请流程-驳回按钮 +export function mainListTurnDownBtn(option:any) { + return __defaultBtnOption(option,{ + label: '驳回', + name: 'mainTurnDown', + hide: false, + type: 'danger', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + +// 主列表-申请流程-审批通过按钮 +export function mainListApproveBtn(option:any) { + return __defaultBtnOption(option,{ + label: '审批通过', + name: 'mainApprove', + hide: false, + type: 'danger', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + +// 默认按钮规则 +function __defaultBtnOption(option:any,specific:any){ + return { + type:option && option.type ? option.type : specific.type, + plain:option && option.plain ? option.plain : specific.plain, + icon:option && option.icon ? option.icon : specific.icon, + label:option && option.label ? option.label : specific.label, + name:option && option.name ? option.name : specific.name, + size:option && option.size ? option.size : specific.size, + float:option && option.float ? option.float : (specific.float || null), + url:option && option.url ? option.url : (specific.url || null), + background:option && option.background ? option.background : (specific.background || null), + class:option && option.class ? option.class : specific.class, + color:option && option.color ? option.color : specific.color, + hide:option && option.hide ? option.hide : specific.hide, + link:option && option.link ? option.link : specific.link, + hasPermi:option && option.hasPermi ? option.hasPermi : specific.hasPermi, + ...option + } +} + diff --git a/src/utils/disposition/formFields.ts b/src/utils/disposition/formFields.ts new file mode 100644 index 0000000..a98d5ad --- /dev/null +++ b/src/utils/disposition/formFields.ts @@ -0,0 +1,1954 @@ +/** + * @returns {Array} 基础物料信息 + */ + export const ItemBasic = [ + { label: "物料代码", prop: 'code' }, + { label: "物料名称", prop: "name" }, + { label: "描述1", prop: "desc1" }, + { label: "描述2", prop: "desc2" }, + { type: "filter", label: "状态", prop: "status", filters: "itemStatus" }, + { label: "计量单位", prop: 'basicUom' }, + { type: "filter", label: "ABC类", prop: 'abcClass', filters: "abcClass" }, + { type: "filter", label: "制造件", prop: "canMake", filters: "whetherOrNot" }, + { type: "filter", label: "采购件", prop: "canBuy", filters: "whetherOrNot" }, + { label: "产品类", prop: 'productLine' }, + { label: "有效值", prop: "validity" }, + { type: "filter", label: "有效期", prop: "validityUnit", filters: "validityUnit" }, + // { type: "filter", label: "管理类型", prop: "manageType", filters: "manageType" }, + { label: "类型", prop: 'type' }, + { label: "种类", prop: 'category' }, + { label: "分组", prop: 'group' }, + { label: "颜色", prop: 'color' }, + { label: "配置", prop: 'configuration' }, + { label: "项目", prop: 'project' }, + { label: "版本", prop: 'version' }, + { label: "工程变更", prop: 'eco' }, + { label: "E-LEVEL等级", prop: 'elevel' }, + { type: "filter", label: "是否虚拟物料", prop: "isPhantom", filters: "whetherOrNot" }, + { type: "filter", label: "是否是下线结算件", prop: "isOfflineSettlement", filters: "whetherOrNot" }, + { type: "filter", label: "是否自动回冲", prop: "isAutoBackFlush", filters: "whetherOrNot" }, + { label: "特性", prop: 'characteristic' }, + { label: "管理类型", prop: 'remark' }, + ] + +/** + * @returns {Array} 物品质量信息 + */ + export const ItemQuality = [ + { label: "itemCode", prop: "itemCode" }, + { label: "物料名称", prop: 'name' }, + { label: "供应商代码", prop: 'supplierCode' }, + { type: "filter", label: "检验类型", prop: 'inspectType', filters: "inspectType" }, + { label: "检验周期-按到货频次", prop: 'inspFrequency' }, + { label: "检验周期天数", prop: 'inspFreqDays' }, + { type: "filter", label: "按批次选择抽检数量", prop: 'sampleByBatch', filters: "whetherOrNot" }, + { label: "抽检数量", prop: 'sampleQty' }, + { type: "filter", label: "状态", prop: "status", filters: "openToClose" }, + { label: "检验百分比", prop: 'samplePercent' }, + { type: "filter", label: "是否是破坏性检验", prop: 'destructive', filters: "whetherOrNot" }, + { type: "filter", label: "退货方法", prop: 'returnMethod', filters: "returnMethodType" }, + { label: "描述", prop: "description" }, + ] + +/** + * @returns {Array} 物品分类信息 + */ + export const ItemCategory = [ + { label: "itemCode", prop: 'itemCode', }, + { label: "分类编号", prop: "categoryCode", }, + { label: "分类值", prop: "value", }, + { label: "备注", prop: 'remark', }, + ] + +/** + * @returns {Array} 物品包装 + */ + export const ItemPack = [ + { label: "包装代码", prop: 'packCode', }, + { label: "包装名称", prop: "packName" }, + { label: '物料代码', prop: "itemCode", }, + { label: "是否标准包装", type: "filter", prop: 'isStdPack', filters: "whetherOrNot" }, + { label: '标包编号', prop: "stdPackCode", }, + { label: "包装数量",type: "object", prop: "packQty", showProp: "qty" }, + { label: "物料单位",type: "object", prop: "packQty", showProp: "uom" }, + { label: "转换率", prop: "conversionRate", }, + { label: "备注", prop: 'remark', colSpan: 12 }, + ] + +/** + * @returns {Array} 物品质检标准 + */ + export const AQL = [ + { label: "itemCode", prop: "itemCode", }, + { label: "供应商代码", prop: "supplierCode", }, + { label: "数量上限", prop: 'ceilingQty', }, + { label: "数量下限", prop: "floorQty", }, + { type: "filter", label: "使用百分比", prop: 'isUsePercent', filters: "whetherOrNot" }, + { label: "抽检百分比", prop: 'samplePercent', }, + { label: "抽检数量", prop: 'sampleQty', }, + { label: "备注", prop: "remark", }, + ] + +/** + * @returns {Array} 物料清单 + */ + export const Bom = [ + { label: "父物料号", prop: "product", }, + { label: "子物料号", prop: 'component', }, + { type: "object", label: "子物料用量", prop: 'perQty', showProp: "qty", }, + { type: "object", label: "子物料用量单位", prop: 'perQty', showProp: "uom", }, + // { type: "rangeDateTime", label: "时间窗口", prop: "timeRange", startDate: "beginTime", endDate: "endTime", colSpan: 24 }, + { type: "objectDateTime", label: "开始时间", prop: "timeRange", showProp: "beginTime", }, + { type: "objectDateTime", label: "结束时间", prop: "timeRange", showProp: "endTime", }, + { label: "ERP工序", prop: "erpOp", }, + { label: "制造工序", prop: "mfgOp", }, + { label: "层级", prop: "layer" }, + // { type: "input", label: "层级", valueType: Number, prop: "layer", }, + { type: "filter", label: "配送方式", prop: "distributionType", filters: "distributionType" }, + { type: "filter", label: "取整方式", prop: "truncType", filters: "truncType" }, + { type: "filter", label: "计划拆分规则", prop: "plannedSplitRule", filters: "plannedSplitRule" }, + { label: "备注", prop: 'remark', }, + ] + +/** + * @returns {Array} 客户 + */ + export const Customer = [ + { label: "客户代码", prop: "code", }, + { label: "客户名称", prop: 'name', }, + { label: "国家", prop: "country", }, + { label: "城市", prop: "city", }, + { label: "地址", prop: "address", }, + { label: "联系人", prop: "contacts", }, + { label: "电话", prop: "phone", }, + { label: "传真", prop: "fax", }, + { label: "邮编", prop: "postID", }, + { label: "货币", prop: "currency", }, + { label: "备注", prop: 'remark', }, + ] + +/** + * @returns {Array} 客户物品 + */ + export const CustomerItem = [ + { label: "客户代码", prop: 'customerCode', }, + { label: "itemCode", prop: "itemCode", }, + { label: "客户物料代码", prop: "customerItemCode", }, + { label: "版本", prop: "version", }, + { type: "objectDateTime", label: "开始时间", prop: "timeRange", showProp: "beginTime" }, + { type: "objectDateTime", label: "结束时间", prop: "timeRange", showProp: "endTime" }, + { label: "备注", prop: 'remark', }, + ] + +/** + * @returns {Array} 客户地址 + */ + export const CustomerAddress = [ + { label: "客户地址代码", prop: "code", }, + { label: "客户地址名称", prop: 'name', }, + { label: "客户代码", prop: 'customerCode', }, + { label: "库位编号", prop: 'locationCode', }, + { label: "城市", prop: "city", }, + { label: "地址", prop: "address", }, + { label: "联系人", prop: "contact", }, + { label: "描述", prop: "desc", }, + { label: "备注", prop: 'remark', }, + ] + +/** + * @returns {Array} 项目 + */ + export const Project = [ + { label: "客户代码", prop: "customerCode"}, + { label: "项目代码", prop: "code"}, + { label: "项目名称", prop: 'name'}, + { type: "objectDateTime", label: "开始时间", prop: "timeRange", showProp: "beginTime", colSpan: 12 }, + { type: "objectDateTime", label: "结束时间", prop: "timeRange", showProp: "endTime", colSpan: 12 }, + { label: "描述", prop: "description", }, + { label: "备注", prop: 'remark', }, + ] + +/** + * @returns {Array} 供应商 + */ + export const Supplier = [ + { label: "供应商代码", prop: "code"}, + { label: "供应商名称", prop: "name"}, + { type: "filter",label: "状态", prop: "isActive", filters: "openToCloseBit"}, + { type: "filter",label: "类型", prop: "type", filters: "supplierType"}, + { label: "国家", prop: "country"}, + { label: "城市", prop: "city"}, + { label: "地址", prop: "address"}, + { label: "联系人", prop: 'contacts'}, + { label: "电话", prop: 'phone'}, + { label: "传真", prop: 'fax'}, + { label: "邮编", prop: 'postID'}, + { label: "银行", prop: 'bank'}, + { label: "货币", prop: 'currency'}, + { label: "备注", prop: 'remark'}, + ] + +/** + * @returns {Array} 供应商物品 + */ + export const SupplierItem = [ + { label: "供应商代码", prop: 'supplierCode' }, + { label: "itemCode", prop: "itemCode" }, + { label: "供应商物料代码", prop: "supplierItemCode" }, + { label: "供应商物料名称", prop: "itemName" }, + { label: "每托数量", prop: "qtyPerPallet" }, + { type: "object", label: "包装数量", prop: "supplierPackQty", showProp: "qty" }, + { type: "object", label: "包装单位", prop: "supplierPackQty", showProp: "uom" }, + { label: "版本", prop: "version" }, + { label: "备注", prop: 'remark' }, + ] + +/** + * @returns {Array} 供应商时间窗口 + */ + export const SupplierTime = [ + { label: "供应商代码", prop: 'supplierCode', }, + { label: "供应商名称", prop: 'supplierName', }, + { label: "时间窗口", prop: "timeSlot", }, + { label: "当前时间", prop: "week", }, + { label: "备注", prop: 'remark', }, + ] + +/** + * @returns {Array} 分类 + */ + export const Category = [ + { label: "分类编号", prop: "code" }, + { label: "分类名称", prop: 'name' }, + { label: "描述", prop: "description" }, + { label: "备注", prop: 'remark' } + ] + +/** + * @returns {Array} 计量单位 + */ + export const Uom = [ + { label: "计量单位编号", prop: "code", }, + { label: "计量单位名称", prop: 'name', }, + { type: "filter", label: "类型", prop: "type", filters: "uomType", }, + { label: "描述", prop: "description", }, + { label: "备注", prop: 'remark', }, + ] + +/** + * @returns {Array} 收货口 + */ + export const Dock = [ + { label: "收货口编号", prop: "code" }, + { label: "默认库位编号", prop: "defaultLocationCode" }, + { label: "收货口名称", prop: 'name' }, + { label: "描述", prop: "description" }, + { label: "备注", prop: 'remark' } + ] + +/** + * @returns {Array} 区域 + */ + export const Area = [ + { label: "区域代码", prop: "code", }, + { label: "区域名称", prop: 'name', }, + { type: "filter", label: "是否功能区", prop: "isFunctional", filters: "whetherOrNot" }, + { type: "filter", label: "类型", prop: "areaType", filters: "areaType" }, + { label: "描述", prop: "description", }, + { label: "备注", prop: 'remark', }, + ] + +/** + * @returns {Array} 库位组 + */ + export const LocationGroup = [ + { label: "区域代码", prop: "areaCode", }, + { type: "filter", label: "类型", prop: "groupType", filters: "locationType", }, + { type: "filter", label: "状态", prop: "defaultInventoryStatus", filters: "inventoryStage", }, + { label: "拣料优先级", prop: "pickPriority", }, + { label: "编号", prop: "code", }, + { label: "名称", prop: 'name', }, + { label: "描述", prop: "description", }, + { label: "溢流库位组", prop: "overflowLocationGroup", }, + { type: "objectFilter", label: "是否混物品", prop: "locSwitch", showProp: "enableMixItem", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否混批次", prop: "locSwitch", showProp: "enableMixLot", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否混状态", prop: "locSwitch", showProp: "enableMixStatus", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否负库存", prop: "locSwitch", showProp: "enableNegative", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否保留零库存", prop: "locSwitch", showProp: "enableKeepZero", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否机会盘点", prop: "locSwitch", showProp: "enableOpportunityCount", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否领料", prop: "locSwitch", showProp: "enablePick", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否过量领料", prop: "locSwitch", showProp: "enableOverPick", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否整包存储", prop: "locSwitch", showProp: "enableWholeStore", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否散件存储", prop: "locSwitch", showProp: "enableBreakStore", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否发出", prop: "locSwitch", showProp: "enableShip", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否接收", prop: "locSwitch", showProp: "enableReceive", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否退货给供应商", prop: "locSwitch", showProp: "enableReturnToSupplier", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否接收客户退货", prop: "locSwitch", showProp: "enableReturnFromCustomer", filters: "whetherOrNot", }, + { label: "备注", prop: 'remark', }, + ] + +/** + * @returns {Array} 工位组 + */ + export const WorkGroup = [ + { label: "工作组代码", prop: "code" }, + { label: "工作组名称", prop: 'name' }, + { label: "描述", prop: "description" }, + { label: "仓库代码", prop: "warehouseCode" }, + { label: "备注", prop: 'remark' } + ] +/** + * @returns {Array} 库位 + */ + export const Location = [ + { label: "库位代码", prop: "code", }, + { label: "库位名称", prop: "name", }, + { label: "区域代码", prop: "areaCode", }, + { label: "库位组代码", prop: "locationGroupCode", }, + { label: "工作组代码", prop: "workGroupCode", }, + { type: "object", label: "库位数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "库位数量单位", prop: "qty", showProp: "uom", }, + { type: "filter", label: "类型", prop: "type", filters: "locationType", }, + { label: "行号", prop: "rowCode", }, + { label: "列号", prop: "columnCode", }, + { type: "filter", label: "默认库存状态", prop: "defaultInventoryStatus", filters: "inventoryStage", }, + { label: "拣料优先级", prop: "pickPriority", }, + { label: "拣料顺序", prop: "pickOrder", }, + { label: "货架号", prop: "shelfCode", }, + { label: "ERP系统库位编号", prop: "erpLocationCode", }, + { type: "objectFilter", label: "是否混物品", prop: "locSwitch", showProp: "enableMixItem", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否混批次", prop: "locSwitch", showProp: "enableMixLot", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否混状态", prop: "locSwitch", showProp: "enableMixStatus", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否负库存", prop: "locSwitch", showProp: "enableNegative", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否保留零库存", prop: "locSwitch", showProp: "enableKeepZero", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否盘点", prop: "locSwitch", showProp: "enableOpportunityCount", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否领料", prop: "locSwitch", showProp: "enablePick", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否过量领料", prop: "locSwitch", showProp: "enableOverPick", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否整包存储", prop: "locSwitch", showProp: "enableWholeStore", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否散件存储", prop: "locSwitch", showProp: "enableBreakStore", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否发出", prop: "locSwitch", showProp: "enableShip", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否接收", prop: "locSwitch", showProp: "enableReceive", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否退货给供应商", prop: "locSwitch", showProp: "enableReturnToSupplier", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否接收客户退货", prop: "locSwitch", showProp: "enableReturnFromCustomer", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否拆箱", prop: "locSwitch", showProp: "enableSplitBox", filters: "whetherOrNot", }, + { type: "objectFilter", label: "是否拆托", prop: "locSwitch", showProp: "enableSplitPallet", filters: "whetherOrNot", }, + { label: "描述", prop: "description", }, + { label: "备注", prop: 'remark', }, + ] + + /** + * @returns {Array} ERP库位 + */ + export const ERPLocation = [ + { label: "ERP库位代码", prop: "code" }, + { label: "ERP库位名称", prop: "name" }, + { label: "仓库代码", prop: "warehouseCode" }, + { type: "filter", label: "类型", prop: "type", filters: "locationType" }, +] + +/** + * @returns {Array} 库位零件关系 + */ + export const ItemStoreRelation = [ + { label: "itemCode", prop: "itemCode", options: "itemBasic" }, + { type: "filter", label: "储存关系类型", prop: "storeRelationType", filters: "storeRelationType", }, + { type: "filter", label: "是否可用", prop: "enabled", filters: "whetherOrNot", }, + { type: "filter", label: "是否定制位置", prop: "isFixed", filters: "whetherOrNot", }, + { label: "主存储容量", prop: "umQty", }, + { label: "主存储单位", prop: "storeUM", }, + { label: "次要存储容量", prop: "altUmQty", }, + { label: "次要存储单位", prop: "altUm", }, + { type: "filter", label: "存储单位", prop: "pramaryUM", filters: "pramaryUm" }, + { label: "值", prop: "storeValue", }, + { label: "备注", prop: 'remark', }, + ] + +/** + * @returns {Array} 库位可用容量 + */ + export const InventoryLocationCapacity = [ + { label: "可用容量(%)", prop: "availableCapacity", }, + { type: "filter", label: "是否无穷大", prop: "isInfinity", filters: "whetherOrNot" }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: 'remark', }, + ] + + /** + * @returns {Array} 物品安全库存 + */ + export const ItemSafetyStock = [ + { label: "物料代码", prop: "itemCode", }, + { label: "仓库代码", prop: "warehouseCode" }, + { type: "filter", label: "存储关系类型", prop: "storeRelationType", filters: "storeRelationType", }, + { label: "值", prop: "storeValue" }, + { label: "最大库存", prop: "maxStock" }, + { label: "最小库存", prop: "minStock" }, + { label: "安全库存", prop: "safetyStock" }, + { label: "补料点", prop: "feedLine" }, + { label: "补料数量", prop: "feedQty" }, + { label: "补料单位", prop: "feedUM" }, +] + +/** + * @returns {Array} 物品安全库存 + */ + export const ItemSafetyStockQuery = [ + { + label: "物料代码", + prop: "itemCode", + fixed: "left", + type: "name", + }, + { label: "仓库代码", prop: "warehouseCode" }, + { type: "filter", label: "存储关系类型", prop: "storeRelationType", filters: "storeRelationType", }, + { label: "值", prop: "storeValue" }, + { label: "最大库存", prop: "maxStock" }, + { label: "最小库存", prop: "minStock" }, + { label: "安全库存", prop: "safetyStock" }, + { label: "补料点", prop: "feedLine" }, + { label: "补料数量", prop: "feedQty" }, + { label: "补料单位", prop: "feedUM" }, +] + +/** + * @returns {Array} 车间 + */ + export const Workshop = [ + { label: "车间代码", prop: "code" }, + { label: "车间名称", prop: 'name' }, + { label: "描述", prop: "description" }, + { label: "备注", prop: 'remark' }, + ] + +/** + * @returns {Array} 生产线 + */ + export const ProductionLine = [ + { label: "生产线代码", prop: "code" }, + { label: "生产线名称", prop: 'name' }, + { label: "类型", prop: "type" }, + { label: "车间代码", prop: "workshopCode" }, + { label: "成品库位", prop: "productLocation" }, + { label: "描述", prop: "description" }, + { label: "备注", prop: 'remark' } + ] +/** + * @returns {Array} 生产线零件关系 + */ + export const ProdLineItem = [ + { label: "物料代码", prop: "itemCode", }, + { label: "生产线编号", prop: "prodLineCode", }, + { label: "生产线名称", prop: "prodLineName", }, + { label: "车间代码", prop: "workshopCode", }, + { label: "原料库位", prop: "rawLocation" }, + { label: "成品ERP库位", prop: "productErpLocationCode" }, + { label: "备注", prop: "remark", }, + ] +/** + * @returns {Array} 班组 + */ + export const Team = [ + { label: "班组代码", prop: "code" }, + { label: "班组名称", prop: 'name' }, + { label: "成员", prop: "members" }, + { label: "描述", prop: "description" }, + { label: "备注", prop: 'remark' }, + ] +/** + * @returns {Array} 班次 + */ + export const Shift = [ + { type: "input", label: "班次代码", prop: "code", }, + { type: "input", label: "班次名称", prop: "name", }, + { type: "filter", label: "结束到下一天", prop: "endAtNextDay", filters: "whetherOrNot", }, + { label: "描述", prop: "description", }, + { type: "objectDateTime", label: "开始时间", prop: "timeRange", showProp: "beginTime", }, + { type: "objectDateTime", label: "结束时间", prop: "timeRange", showProp: "endTime", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 日历 + */ + export const Calendar = [ + { label: "模块", prop: "module", }, + { type: "filter", label: "状态", prop: "status", filters: "calendarStatus" }, + { label: "编号", prop: "code", }, + { label: "名称", prop: 'name', }, + { label: "描述", prop: "description", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 配置 + */ + export const Configuration = [ + { label: "键", prop: "key", }, + { label: "值", prop: "value", }, + { label: "描述", prop: "description", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 采购订单 + */ + export const PurchaseOrder = [ + { label: "采购订单号", prop: 'number' }, + { label: "供应商编号", prop: "supplierCode", }, + { label: "仓库", prop: "warehouseCode", }, + { label: "订单类型", prop: "poType", }, + { label: "订单状态", prop: "status", }, + { type: "filter", label: "是否寄存订单", prop: "isConsignment", filters: "whetherOrNot" }, + { type: "dateTime", label: "订单日期", prop: "orderDate", }, + { type: "dateTime", label: "截止日期", prop: "dueDate", }, + { label: "版本", prop: "version", }, + { label: "税率", prop: "taxRate", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 销售订单 + */ + export const SaleOrder = [ + { label: "销售订单号", prop: "number", }, + { label: "客户代码", prop: "customerCode", }, + // { label: "父物料号", prop: "product", }, + // { label: "子物料号", prop: 'component', }, + { label: "版本", prop: "version", }, + { label: "工序", prop: "op", }, + { label: "层级", prop: "layer", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 供应商发货通知 + */ + export const SupplierAsn = [ + { label: "要货计划单号", prop: "rpNumber" }, + { label: "供应商代码", prop: "supplierCode" }, + { label: "状态", prop: "status", type: "filter", filters: "supplierStatus" }, + { type: "object", label: "客户名称", prop: 'contacts',showProp: 'name' }, + { label: "车牌号", prop: "truckNumber" }, + { label: "仓库代码", prop: "warehouseCode" }, + { label: "收货口代码", prop: "dockCode" }, + { label: "发货日期", prop: 'shipDate', type:'dateTime' }, + { label: "到货日期", prop: 'dueDate', type:'dateTime' }, + { label: "时间窗口", prop: 'timeWindow' }, + { label: "公司", prop: 'company' }, + { label: "创建时间", prop: 'creationTime', type:'dateTime' }, + ] +/** + * @returns {Array} 客户发货通知 + */ + export const CustomerAsn = [ + { label: "编号", prop: "id", }, + { label: "父物料号", prop: "product", }, + { label: "子物料号", prop: 'component', }, + { label: "版本", prop: "version", }, + { label: "工序", prop: "op", }, + { label: "层级", prop: "layer", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 到货通知 + */ + export const ArriveNotice = [ + { label: "仓库", prop: "warehouseCode" }, + { label: "收货口", prop: "dockCode" }, + { label: "到货单号", prop: "number" }, + { type: "dateTime", label: "到货时间", prop: "arriveTime" }, + { label: "发货单号", prop: "asnNumber" }, + { label: "要货计划单号", prop: "rpNumber" }, + { label: "订单号", prop: "poNumber" }, + { label: "供应商编号", prop: "supplierCode" }, + { label: "状态", type: "filter", filters: "arriveNoticeStatus", prop: "status", }, + { type: "dateTime", label: "创建时间", prop: "creationTime" }, + { label: "备注", prop: "remark" }, + ] + /** + * @returns {Array} 采购收货记录 + */ + export const PurchaseReceiptNote = [ + { label: "编号", prop: "id", }, + { label: "供应商单号", prop: "supplierCode", }, + { label: "到货单号", prop: 'arriveNoticeNumber', }, + { label: "发货单号", prop: "asnNumber", }, + { label: "收货单号", prop: "number", }, + { label: "要货计划单号", prop: "rpNumber", }, + { type: "dateTime", label: "收货时间", prop: "receiveTime", }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: 'remark', }, +] + /** + * @returns {Array} 收货异常记录 + */ + export const ReceiptAbnormalNote = [ + { label: "收货单号", prop: 'receiptNumber', }, + { label: "发货单号", prop: "asnNumber", }, + { label: "供应商编号", prop: 'supplierCode', }, + { label: "箱标签", prop: 'packingCode', }, + { label: "托标签", prop: 'containerCode',}, + { label: "异常类型", prop: 'abnormalType', }, + { label: "itemCode", prop: 'itemCode',}, + { label: "批次编号", prop: 'batchCode',}, + { label: "备注", prop: 'remark', }, +] + /** + * @returns {Array} 采购退货记录 + */ + export const PurchaseReturnNote = [ + { label: "退货单号", prop: "number", }, + { label: "供应商单号", prop: "supplierCode", }, + // { label: "到货单号", prop: 'arriveNumber', }, + // { label: "发货单号", prop: "asnNumber", }, + // { label: "收货单号", prop: "receiptNumber", }, + // { label: "要货计划单号", prop: "rpNumber", }, + // { label: "收货时间", prop: "receiveTime", }, + { type: "dateTime", label: "退货时间", prop: "returnTime", }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: 'remark', }, +] + /** + * @returns {Array} 上架记录 + */ + export const PutawayNote = [ + { label: "编号", prop: "id", }, + { label: "上架记录单号", prop: "number", }, + { label: "任务ID", prop: 'jobNumber',}, + // { label: "供应商编号", prop: 'supplierCode',}, + // { label: "操作员", prop: 'worker',}, + // { label: "检验单号", prop: 'inspectNumber',}, + // { label: "收费单号", prop: 'receiptNumber',}, + // { label: "到货单号", prop: 'arriveNoticeNumber',}, + // { label: "发货单号", prop: 'asnNumber',}, + // { label: "要货计划单号", prop: 'rpNumber',}, + // { label: "完工收货单号", prop: 'productReceiptNumber',}, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: "remark", }, +] + /** + * @returns {Array} 要料申请 + */ + export const MaterialRequest = [ + { label: "编号", prop: "id", }, + { label: "要料申请单号", prop: "number", }, + { label: "车间", prop: "workshop", }, + { label: "任务状态", type: "filter", filters: "requestStatus", prop: "status", }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: 'remark', }, +] + /** + * @returns {Array} 发料记录 + */ + export const IssueNote = [ + { label: "编号", prop: "id", }, + { label: "发料记录单号", prop: "number", }, + { label: "任务ID", prop: 'jobNumber',}, + { label: "操作员", prop: 'worker',}, + { label: "车间", prop: 'workshop',}, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: "remark", }, +] + /** + * @returns {Array} 计划外入库记录 + */ + export const UnplannedReceiptNote = [ + { type: "input", label: "编号", prop: "id" }, + // { label: "计划外入库单号", prop: "unplannedReceiptNumber", }, + { label: "流水单号", prop: "seqNo" }, + // { label: "备注", prop: 'remark', }, +] + /** + * @returns {Array} 计划外出库记录 + */ + export const UnplannedIssueNote = [ + { type: "input", label: "编号", prop: "id" }, + // { label: "计划外出库单号", prop: "unplannedIssueNumber", }, + { label: "流水单号", prop: "seqNo" }, + // { label: "备注", prop: 'remark', }, +] + /** + * @returns {Array} 隔离记录 + */ + export const IsolationNote = [ + { label: "编号", prop: "id", }, + { label: "隔离记录单号", prop: "number", }, + { label: "任务ID", prop: "jobNumber",}, + { label: "操作员", prop: "worker",}, + { label: "备注", prop: 'remark', }, +] + /** + * @returns {Array} 工单号维护 + */ + export const WorkOrder = [ + { label: "工单号", prop: "workNumberValue" }, + { type: "filter", label: "类型", prop: "workOrderType", filters: "workOrderType" }, + { type: "filter", label: "状态", prop: "status", filters: "workOrderStatus" }, + { label: "描述", prop: "description" }, + { label: "备注", prop: 'remark' }, + ] + /** + * @returns {Array} 报废记录 + */ + export const ScrapNote = [ + { label: "编号", prop: "id", }, + { label: "报废记录单号", prop: "number",}, + // { label: "部门", prop: 'department' }, + { label: "工单号", prop: 'workOrder' }, + // { label: "流水号", prop: 'seqNo' }, + { label: "操作员", prop: "worker",}, + { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 发货计划 + */ + export const DeliverPlan = [ + { label: "编号", prop: "id", }, + { label: "客户", prop: "customer", }, + // { label: "项目", prop: "project", }, + // { label: "销售订单号", prop: "soNumber", }, + { type: "dateTime", label: "计划日期", prop: "planDate", }, + { type: "dateTime", label: "计划时间", prop: "planTime", }, + { label: "发货计划单号", prop: "number", }, + { type: "filter", filters: "DeliverPlanStatus", label: "状态", prop: "status", }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { type: "filter", label: "发货方式", prop: "shipVia", filters: "DeliverPlanTransport" }, + { type: "filter", label: "运输方式", prop: "modeOfTransport", filters: "DeliverPlanTransport" }, + { type: "filter", label: "承运商", prop: "carrier", filters: "DeliverPlanFreightTJ" }, + // { label: "承运商参考", prop: "carrierShipmentRef" }, + { label: "车辆", prop: "vehicleID" }, + { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 发货申请 + */ + export const DeliverRequest = [ + { label: "编号", prop: "id", }, + { label: "发货申请单号", prop: "number", }, + { label: "客户", prop: "customer", }, + { label: "任务状态", type: "filter", filters: "requestStatus", prop: "status", }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 发货记录 + */ +export const DeliverNote = [ + { label: "编号", prop: "id", }, + { label: "发货记录单号", prop: "number", }, + { label: "任务ID", prop: 'jobNumber', }, + { label: "操作员", prop: 'worker',}, + { label: "客户", prop: 'customer',}, + { label: "客户地址", prop: 'customerAddressCode',}, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: "remark", }, +] + +/** + * @returns {Array} 仓库管理-发运管理-发货记录(天津) + */ + export const WareHouseTransferNote = [ + { label: "ID", prop: "id", }, + { label: "调拨发货单号", prop: "number", }, + { label: "操作员", prop: "worker", }, + { label: "任务ID", prop: "jobNumber", }, + { label: "供应商编号", prop: "supplierCode", }, + { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 发货任务(天津) + */ + export const Shipments = [ + { label: "发货任务编号", prop: "number", }, + { label: "器具类型", prop: "position", filters: "InstrumentsLXStatus" , type: "filter" }, + { label: "器具数量", prop: 'containerQty', }, + { label: "操作员", prop: 'worker',}, + { label: "客户", prop: 'customer',}, + { label: "客户地址", prop: 'customerAddressCode',}, + { label: "项目", prop: "projectCode", }, + { label: "计划时间", prop: "planTime", }, + { label: "备注", prop: "remark", }, +] + +/** + * @returns {Array} 器具查询(天津) + */ + export const Instruments = [ + {label: "器具编号",prop: "containerCode"}, + { label: "排序号", prop: "seqNo"}, + { type: "filter", label: "状态", prop: "businessStatus", filters: "instrumentsStatus" }, + { label: "成品库位编号", prop: "locationCode"}, + { type: "filter", label: "类型", prop: "type", filters: "InstrumentsLXStatus" }, + { label: "产品数量", prop: "capacity"}, + { label: "项目编号", prop: "projectCode"}, + { label: "备注", prop: 'remark' } +] + +/** + * @returns {Array} 收货记录(天津) + */ + export const ReceivingRecords = [ + { label: "ID", prop: "id", }, + { label: "收货记录单号", prop: "number"}, + { label: "生产线编码", prop: "prodLine" }, + { label: "成品库位编码", prop: "locationCode" }, + { label: "原料库位编码", prop: "rawLocation" }, + { label: "收货时间", prop: "completeTime", type: "dateTime" }, + { label: "操作员", prop: "worker" }, +] + +/** + * @returns {Array} 发货记录(天津) + */ + export const DeliveryRecord = [ + { label: "ID", prop: "id", }, + { label: "发货记录单号", prop: "number"}, + { label: "任务编号", prop: "jobNumber" }, + { label: "操作员", prop: "worker" }, + { label: "客户", prop: "customer" }, + { label: "客户地址", prop: "customerAddressCode"}, + { label: "项目", prop: "projectCode" }, + { label: "发货日期", prop: "deliverTime", type: "dateTime" }, + { label: "备注", prop: "remark" } +] + +/** + * @returns {Array} 仓库管理-发运管理-回收记录(天津) + */ + export const JisProductRecycleNote = [ + { + label: "回收单号", + prop: "number", + fixed: "left", + type: "name", + width: "300px" + }, + { label: "生产计划单号", prop: "productionPlanNumber"}, + { label: "操作员", prop: "worker" }, + { label: "仓库", prop: "warehouseCode"}, + { label: "收货库位", prop: "locationCode"}, + { label: "原料库位", prop: "rawLocation"}, + { label: "生产线", prop: "prodLine"}, + { label: "车间", prop: "workshop"}, + { label: "班次", prop: "shift"}, + { label: "回收时间", prop: "recycleTime", type: "dateTime"}, + { label: "备注", prop: 'remark' } +] +/** + * @returns {Array} 仓库管理-发运管理-退库记录(天津) + */ + export const JisProductReturnNote = [ + { + label: "退库单号", + prop: "number", + fixed: "left", + type: "name", + width: "300px" + }, + { label: "发货任务编号", prop: "jobNumber" }, + { label: "客户", prop: "customer"}, + { label: "从库位", prop: "fromLocationCode"}, + { label: "到库位", prop: "toLocationCode"}, + { label: "从仓库", prop: "fromWarehouseCode"}, + { label: "到仓库", prop: "toWarehouseCode"}, + { label: "操作员", prop: "worker" }, + { label: "创建时间", prop: "creationTime", type: "dateTime"}, + { label: "备注", prop: 'remark' } +] +/** + * @returns {Array} 仓库管理-发运管理-库存调整记录(天津) + */ + export const JisProductTransferNote = [ + { + label: "库存调整单号", + prop: "number", + fixed: "left", + type: "name", + width: "300px" + }, + { label: "从库位", prop: "fromLocationCode"}, + { label: "到库位", prop: "toLocationCode"}, + { label: "从仓库", prop: "fromWarehouseCode"}, + { label: "到仓库", prop: "toWarehouseCode"}, + { label: "操作员", prop: "worker"}, + { label: "创建时间", prop: "creationTime", type: "dateTime"}, +] +/** + * @returns {Array} 盘点计划 + */ + export const CountPlan = [ + { label: "盘点计划单号", prop: "number", }, + // { type: "filter", filters: "checkType", label: "类型", prop: "type", }, + // { type: "filter", filters: "checkStage", label: "阶段", prop: "stage", }, + { type: "filter", filters: "CheckPlanStatus", label: "状态", prop: "status", }, + { label: "描述", prop: "descrpiton", }, + { type: "dateTime", label: "开始时间", prop: "beginTime", }, + { type: "dateTime", label: "结束时间", prop: "endTime", }, + { label: "地点", prop: "company", }, + { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 调整库存 + */ + export const CountPlanAdjust = [ + { label: "盘点报告单号", prop: "number", }, + { label: "盘点计划单号", prop: "countPlanNumber", }, + { type: "filter", filters: "CheckPlanStatus", label: "状态", prop: "status", }, + // { type: "filter", filters: "stageType", label: "阶段", prop: "stage", }, + { type: "dateTime", label: "开始时间", prop: "beginTime", }, + { type: "dateTime", label: "结束时间", prop: "endTime", }, + +] + +/** + * @returns {Array} 盘点记录 + */ + export const CountNote = [ + { label: "盘点报告单号", prop: "number", }, + { type: "input", label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 盘点差异调整记录 + */ + export const CountAdjustNote = [ + { label: "盘点差异调整记录单号", prop: "number", }, + { label: "盘点记录单号", prop: 'countNoteNumber', }, + { label: "盘点计划单号", prop: 'countPlanNumber', }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: "remark", }, +] + +/** + * @returns {Array} 库存余额 + */ + export const InventoryBalance = [ + { label: "itemCode", prop: 'itemCode' }, + { type: "object", label: "物料名称", prop: "item", showProp: "name" }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1" }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2" }, + { label: "库位代码", prop: "locationCode" }, + { type: "filter", label: "库存状态", prop: "status", filters: "inventoryStage" }, + { label: "批次", prop: 'lot' }, + { label: "箱标签", prop: 'packingCode' }, + { label: "托盘标签", prop: 'containerCode' }, + { type: "object", label: "库存数量", prop: "qty", showProp: "qty" }, + { type: "object", label: "计量单位", prop: "qty", showProp: "uom" }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "object", label: "库区", prop: "location", showProp: "area", }, + { type: "object", label: "库位组", prop: "location", showProp: "group", }, + { type: "dateTime", label: "入库时间", prop: "putInTime", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate" }, + { type: "objectDateTime", label: "过期日期", prop: "batch", showProp: "expireDate" }, + { type: "dateTime", label: "上次盘点时间", prop: "lastCountTime", }, + { label: "上次盘点单号", prop: "lastCountPlanNumber", }, + { label: "上次盘点标签号", prop: "lastCountLabel", }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { type: "filter", label: "是否可用", prop: "isActive", filters: "whetherOrNot", }, +] + +/** +* @returns {Array} ERP库存余额 +*/ +export const ERPInventoryBalance = [ + { label: "itemCode", prop: "itemCode" }, + { label: "库位代码", prop: "locationCode", }, + { label: "库存状态", prop: "status", }, + { label: "批次", prop: "lot", }, + { type: "object", label: "库存数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "计量单位", prop: "qty", showProp: "uom", }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { type: "dateTime", label: "最后修改时间", prop: "lastModificationTime", }, +] + +/** + * @returns {Array} 库存事务 + */ + export const InventoryTransaction = [ + { label: "事务编号", prop: "transNumber" }, + { type: "filter", filters: "TransType", label: "事务分类", prop: "transType" }, + { type: "filter", filters: "TransSubType", label: "事务类型", prop: "transSubType" }, + { type: "filter", filters: "transInOutStatus", label: "出库/入库", prop: "transInOut" }, + { type: "object", label: "事务数量", prop: "qty", showProp: "qty" }, + { label: "批次", prop: "lot" }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch" }, + { label: "箱标签", prop: "packingCode" }, + { label: "托标签", prop: "containerCode" }, + { label: "itemCode", prop: "itemCode", }, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "计量单位", prop: "qty", showProp: "uom" }, + { type: "filter", filters: "inventoryStage", label: "库存状态", prop: "inventoryStatus" }, + { label: "仓库代码", prop: "warehouseCode" }, + { type: "dateTime", label: "事务日期", prop: "transTime" }, + { type: "dateTime", label: "生效日期", prop: "activeDate" }, + { label: "操作员", prop: "worker" }, + { label: "任务编号", prop: "jobNumber" }, + { label: "单据编号", prop: "docNumber" }, + { type: "dateTime", label: "上次修改时间", prop: "lastModificationTime" }, + { label: "库位代码", prop: "locationCode" }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate" }, + { label: "管理类型", prop: "manageType" } +] + +/** + * @returns {Array} 库存快照 + */ + export const InventorySnapshot = [ + { label: "父物料号", prop: "product", }, + { label: "子物料号", prop: 'component',}, + { label: "版本", prop: "version", }, + { label: "工序", prop: "op", }, + { label: "层级", prop: "layer", }, + { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 库存转移日志 + */ + export const InventoryTransferLog = [ + { label: "库存转移编号", prop: "transferNumber", }, + { label: "操作员", prop: "worker", }, + { label: "箱标签", prop: "toPackingCode", }, + { label: "从库位代码", prop: "fromLocationCode", }, + { label: "到库位代码", prop: "toLocationCode", }, + { label: "从托盘标签", prop: "fromContainerCode", }, + { label: "到托盘标签", prop: "toContainerCode", }, + { type: "filter", filters: "TransType", label: "事务类型", prop: "transType", }, + { type: "filter", filters: "TransSubType", label: "事务替代类型", prop: "transSubType", }, + { label: "从事务编号", prop: "formTransNumber", }, + { label: "到事务编号", prop: "toTransNumber", }, + { type: "filter", filters: "inventoryStage", label: "从状态", prop: "fromStatus", }, + { type: "filter", filters: "inventoryStage", label: "到状态", prop: "toStatus", }, + { label: "itemCode", prop: "itemCode" }, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "到货数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "到货单位", prop: "qty", showProp: "uom", }, + { label: "批次", prop: 'lot', }, + { type: "object", label: "从批次", prop: "fromBatch", showProp: "supplierBatch", }, + { type: "object", label: "到批次", prop: "toBatch", showProp: "supplierBatch", }, + { label: "备注", prop: 'remark', }, + { type: "dateTime", label: "事务时间", prop: "transferTime", }, + { type: "dateTime", label: "生效日期", prop: "activeDate", }, +] + +/** + * @returns {Array} 库存转移记录 + */ +export const InventoryTransferNote = [ + { + label: "库存转移编号", prop: "number" }, + { type: "dateTime", label: "创建时间", prop: "creationTime" }, + { label: "操作员", prop: "worker" }, + { label: "备注", prop: 'remark' }, +] + +/** + * @returns {Array} 转合格 + */ +export const InventoryTransferLogHegeZBuHeGe = [ + { label: "库存转移编号", prop: "transferNumber", }, + { label: "操作员", prop: "worker", }, + { label: "箱标签", prop: "toPackingCode", }, + { label: "从库位代码", prop: "fromLocationCode", }, + { label: "到库位代码", prop: "toLocationCode", }, + { label: "从托盘标签", prop: "fromContainerCode", }, + { label: "到托盘标签", prop: "toContainerCode", }, + { type: "filter", filters: "TransType", label: "事务类型", prop: "transType", }, + { type: "filter", filters: "TransSubType", label: "事务替代类型", prop: "transSubType", }, + { label: "从事务编号", prop: "formTransNumber", }, + { label: "到事务编号", prop: "toTransNumber", }, + { type: "filter", filters: "requestStatus", label: "从状态", prop: "fromStatus", }, + { type: "filter", filters: "requestStatus", label: "到状态", prop: "toStatus", }, + { label: "itemCode", prop: "itemCode" }, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "到货数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "到货单位", prop: "qty", showProp: "uom", }, + { label: "批次", prop: 'lot', }, + { type: "object", label: "从批次", prop: "fromBatch", showProp: "supplierBatch", }, + { type: "object", label: "到批次", prop: "toBatch", showProp: "supplierBatch", }, + { label: "备注", prop: 'remark', }, + { type: "dateTime", label: "事务时间", prop: "transferTime", }, + { type: "dateTime", label: "生效日期", prop: "activeDate", }, +] + +/** + * @returns {Array} 已占用库存 + */ + export const InventoryOccupied = [ + { label: "itemCode", prop: "itemCode" }, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "任务编号", prop: "jobNumber" }, + { label: "箱标签", prop: "packingCode", }, + { label: "托标签", prop: "containerCode", }, + { label: "库位代码", prop: "locationCode", }, + { type: "object", label: "占用数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "object", label: "仓库编号", prop: "location", showProp: "warehouse" }, + { type: "object", label: "库位组编号", prop: "location", showProp: "group" }, + { type: "object", label: "区域编号", prop: "location", showProp: "area" }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { type: "filter", filters: "taskStatus", label: "状态", prop: "status", }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 预填充库存 + */ + export const InventoryPredictable = [ + { label: "itemCode", prop: "itemCode", }, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "任务编号", prop: "jobNumber" }, + { label: "箱标签", prop: "packingCode", }, + { label: "托标签", prop: "containerCode", }, + { label: "库位代码", prop: "locationCode", }, + { type: "object", label: "占用数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "object", label: "仓库编号", prop: "location", showProp: "warehouse" }, + { type: "object", label: "库位组编号", prop: "location", showProp: "group" }, + { type: "object", label: "区域编号", prop: "location", showProp: "area" }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { type: "filter", filters: "taskStatus", label: "状态", prop: "status", }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 生产计划 + */ + export const ProductionPlan = [ + { label: "生产计划单号", prop: "number", }, + { label: "生产线", prop: "prodLine", }, + { label: "车间", prop: "workshop", }, + { label: "班组", prop: "team", }, + { label: "班次", prop: "shift", }, + { type: "filter", filters: "ProductionPlanStatus", label: "状态", prop: "status", }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { type: "dateTime", label: "计划日期", prop: "planDate", }, +] + +/** + * @returns {Array} 备料计划 + */ + export const PreparationPlan = [ + { label: "生产计划单号", prop: "productionPlanNumber", }, + { label: "生产线", prop: "prodLine", }, + { label: "车间", prop: "workshop", }, + { label: "班次", prop: "shift", }, + { label: "班组", prop: "team", }, + { label: "状态", type: "filter", filters: "requestStatus", prop: "status", }, + { type: "dateTime", label: "计划时间", prop: "planTime", }, +] + +/** + * @returns {Array} 退料 + */ + export const MaterialReturn = [ + { label: "库存转移编号", prop: "transferNumber", }, + { label: "操作员", prop: "worker", }, + { label: "箱标签", prop: "toPackingCode", }, + { label: "从库位代码", prop: "fromLocationCode", }, + { label: "到库位代码", prop: "toLocationCode", }, + { label: "从托盘标签", prop: "fromContainerCode", }, + { label: "到托盘标签", prop: "toContainerCode", }, + { type: "filter", filters: "TransType", label: "事务类型", prop: "transType", }, + { type: "filter", filters: "TransSubType", label: "事务替代类型", prop: "transSubType", }, + { label: "从事务编号", prop: "formTransNumber", }, + { label: "到事务编号", prop: "toTransNumber", }, + { type: "filter", filters: "requestStatus", label: "从状态", prop: "fromStatus", }, + { type: "filter", filters: "requestStatus", label: "到状态", prop: "toStatus", }, + { label: "itemCode", prop: "itemCode" }, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "到货数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "到货单位", prop: "qty", showProp: "uom", }, + { label: "批次", prop: 'lot', }, + { type: "object", label: "从批次", prop: "fromBatch", showProp: "supplierBatch", }, + { type: "object", label: "到批次", prop: "toBatch", showProp: "supplierBatch", }, + { label: "备注", prop: 'remark', }, + { type: "dateTime", label: "事务时间", prop: "transferTime", }, + { type: "dateTime", label: "生效日期", prop: "activeDate", }, +] + +/** + * @returns {Array} 完工收货记录 + */ + export const ProductReceiptNote = [ + { label: "完工收货记录单号", prop: "number", }, + { label: "生产计划单号", prop: 'productionPlanNumber', }, + { type: "dateTime", label: "完工时间", prop: 'completeTime', }, + { label: "车间", prop: 'workShop', }, + { label: "操作员", prop: 'worker',}, + { label: "公司", prop: "company", }, +] + +/** + * @returns {Array} 下线结算记录 + */ + export const OfflineSettlementNote = [ + // { label: "编号", prop: "id", }, + { label: "下线结算记录单号", prop: "number", }, + { label: "业务单号", prop: 'productReceiptNumber', }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: "remark", }, +] + +/** + * @returns {Array} 追溯记录 + */ + export const TracebackNote = [ + // { label: "编号", prop: "id", }, + { label: "追溯单号", prop: "number" }, + { label: "物料代码", prop: "itemCode" }, + { label: "物料名称", type: "object", prop: "item", showProp: "name" }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1" }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2" }, + { label: "箱标签", prop: "packingCode" }, + { type: "object", label: "产品数量", prop: "qty", showProp: "qty" }, + { type: "object", label: "单位", prop: "qty", showProp: "uom" }, + { label: "批次", prop: "lot" }, + + { label: "车间", prop: "workshop", }, + { label: "生产线", prop: "prodLine", }, + { label: "班次", prop: "shift", }, + { label: "库位编号", prop: "locationCode" }, + // { type: "dateTime", label: "库位编号", prop: "completeTime" }, + // { type: "object", label: "产品批次", prop: "batch", showProp: "supplierBatch", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 成品回收记录 + */ + export const ProductRecycleNote = [ + { label: "成品回收单号", prop: "number", }, + { type: "dateTime", label: "回收时间", prop: 'recycleTime', }, + { label: "车间", prop: 'workshop', }, + { label: "班次", prop: 'shift', }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: "remark", }, +] + +/** + * @returns {Array} 退库记录 + */ + export const StockReturnNote = [ + { label: "退库记录单号", prop: "number", }, + { type: "dateTime", label: "退料时间", prop: 'returnTime', }, + { label: "车间", prop: 'workshop', }, + { label: "任务ID", prop: 'jobNumber',}, + { label: "操作员", prop: 'worker',}, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: "remark", }, +] + +/** + * @returns {Array} 客户退货记录 + */ + export const CustomerReturnNote = [ + { label: "编号", prop: "id", }, + { label: "退货记录单号", prop: "number", }, + { type: "dateTime", label: "退货时间", prop: 'returnTime', }, + { label: "客户", prop: 'customer', }, + { label: "任务ID", prop: 'jobNumber',}, + { label: "操作员", prop: 'worker',}, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: "remark", }, +] + +/** + * @returns {Array} 返修记录 + */ +export const ReworkNote = [ + { + label: "工单号", + prop: "number", + fixed: "left", + }, + { label: "物料代码", prop: 'itemCode' }, + // { label: "部门", prop: 'department' }, + // { label: "工单号", prop: 'workOrder' }, + // { label: "流水号", prop: 'seqNo' }, + { label: "目标物料代码", prop: 'toItemCode' }, + { label: "目标物料名称", prop: 'toItemName' }, + { label: "目标物料描述1", prop: 'toItemDesc1' }, + { label: "目标物料描述2", prop: 'toItemDesc2' }, + { label: "目标数量", prop: 'toQtyQty' }, + { label: "目标单位", prop: 'toQtyUom' }, + { label: "目标库位", prop: 'toLocationCode' }, + { label: "目标批次", prop: 'toLot' }, + { label: "生产线", prop: 'prodLine' }, + { label: "库位", prop: 'locationCode' }, + { label: "仓库", prop: 'warehouseCode' }, + { label: "操作员", prop: 'worker' }, + { type: "dateTime", label: "创建时间", prop: "creationTime",}, + { label: "备注", prop: "remark",}, +] + +/** + * @returns {Array} 报检单 + */ + export const InspectNotice = [ + { label: "检验单号", prop: "number", }, + { label: "操作员", prop: "worker", }, + { label: "收货单号", prop: "receiptNumber", }, + { label: "到货单号", prop: "arriveNoticeNumber", }, + { label: "发货单号", prop: "asnNumber", }, + { label: "要货计划单号", prop: "rpNumber", }, + { label: "订单号", prop: "poNumber", }, + { label: "供应商编号", prop: "supplierCode", }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 检验记录 + */ + export const InspectNote = [ + { label: "检验单号", prop: "number", }, + { label: "收货记录单号", prop: "receiptNumber", }, + { label: "到货单号", prop: "arriveNoticeNumber", }, + { label: "发货单号", prop: "asnNumber", }, + { label: "要货计划单号", prop: "rpNumber", }, + { label: "供应商代码", prop: "supplierCode", }, + { label: "操作员", prop: "worker", }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, +] + +/** + * @returns {Array} 质量异常记录 + */ + export const InspectAbnormalNote = [ + { label: "编号", prop: "id", }, + { label: "质量异常记录单号", prop: "number", }, + { label: "操作员", prop: "worker", }, + { label: "检验单号", prop: 'inspectNumber', }, + { label: "收货单号", prop: 'receiptNumber', }, + { label: "供应商编号", prop: 'supplierCode', }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: "remark", }, +] + +/** + * @returns {Array} 采购收货任务 + */ + export const PurchaseReceiptJob = [ + { label: "收货任务编号", prop: "number", }, + { label: "到货单号", prop: "arriveNoticeNumber", }, + { label: "任务状态", type: "filter", filters: "taskStatus", prop: "jobStatus", }, + { label: "要货计划单号", prop: "rpNumber", }, + // { label: "采购订单号", prop: "poNumber", }, + { label: "供应商代码", prop: "supplierCode" }, + { label: "供应商名称", prop: "supplierName" }, + { label: "时间窗口", prop: "timeWindow" }, + { label: "承接者用户名", prop: "acceptUserName", }, + { type: "dateTime", label: "承接者时间", prop: "acceptTime", }, + { label: "完成者用户名", prop: "completeUserName", }, + { type: "dateTime", label: "完成时间", prop: "completeTime", }, + { label: "操作员", prop: "worker", }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + // { label: "承接者用户名", prop: "acceptUserName", }, + // { type: "dateTime", label: "承接者时间", prop: "acceptTime", }, + // { label: "完成者用户名", prop: "completeUserName", }, + // { type: "dateTime", label: "完成时间", prop: "completeTime", }, + // { label: "到货单号", prop: "arriveNoticeNumber", }, + // { label: "要货计划单号", prop: "rpNumber", }, + // { label: "订单号", prop: "poNumber", }, + // { label: "供应商编号", prop: "supplierCode" }, + // { label: "供应商名称", prop: "supplierName" }, + // { label: "时间窗口", prop: "timeWindow" }, + // { label: "上游任务编号", prop: "upStreamJobNumber",}, + // { label: "工作组", prop: "workGroupCode",}, + // { type: "filter", filters: "taskType", label: "任务类型", prop: "jobType", }, + // { label: "任务状态", type: "filter", filters: "taskStatus", prop: "jobStatus", }, + // { type: "dateTime", label: "创建时间", prop: "creationTime", }, + // { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 采购退货任务 + */ + export const PurchaseReturnJob = [ + { label: "任务编号", prop: "number", }, + { label: "承接者用户名", prop: "acceptUserName", }, + { type: "dateTime", label: "承接者时间", prop: "acceptTime", }, + { label: "完成者用户名", prop: "completeUserName", }, + { type: "dateTime", label: "完成时间", prop: "completeTime", }, + { type: "filter", filters: "taskType", label: "任务类型", prop: "jobType", }, + { label: "任务状态", type: "filter", filters: "taskStatus", prop: "jobStatus", }, + { label: "到货单号", prop: "arriveNoticeNumber", }, + { label: "收货单号", prop: "purchaseReceiptNumber", }, + { label: "发货单号", prop: "asnNumber", }, + { label: "订单号", prop: "poNumber", }, + { label: "供应商编码", prop: "supplierCode", }, + { label: "工作组", prop: 'workGroupCode', }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 上架任务 + */ + export const PutawayJob = [ + { label: "任务编号", prop: "number", }, + { label: "到货单号", prop: "arriveNoticeNumber", }, + { label: "完工收货单号", prop: "productReceiptNumber", }, + // { label: "收货单号", prop: "receiptNumber", }, + { label: "任务状态", type: "filter", filters: "taskStatus", prop: "jobStatus", }, + // { label: "要货计划单号", prop: "rpNumber", }, + // { label: "发货单号", prop: "asnNumber", }, + // { label: "承接者用户名", prop: "acceptUserName", }, + // { label: "完成者用户名", prop: "completeUserName", }, + // { label: "供应商代码", prop: "supplierCode" }, + // { label: "供应商名称", prop: "supplierName" }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { type: "dateTime", label: "承接者时间", prop: "acceptTime", }, + { type: "dateTime", label: "完成时间", prop: "completeTime", }, + + // { label: "承接者用户名", prop: "acceptUserName", }, + // { type: "dateTime", label: "承接者时间", prop: "acceptTime", }, + // { label: "完成者用户名", prop: "completeUserName", }, + // { type: "dateTime", label: "完成时间", prop: "completeTime", }, + // { type: "filter", filters: "taskType", label: "任务类型", prop: "jobType", }, + // { label: "任务状态", type: "filter", filters: "taskStatus", prop: "jobStatus", }, + // { type: "dateTime", label: "创建时间", prop: "creationTime", }, + // { label: "到货单号", prop: "arriveNoticeNumber", }, + // { label: "收货单号", prop: "receiptNumber", }, + // { label: "发货单号", prop: "asnNumber", }, + // { label: "完工收货单号", prop: "productReceiptNumber", }, + // { label: "要货计划单号", prop: "rpNumber", }, + // { label: "备注", prop: 'remark', }, +] + + +/** + * @returns {Array} 检验任务 + */ + export const InspectJob = [ + { label: "任务编号", prop: "number", }, + { label: "到货单号", prop: "arriveNoticeNumber", }, + { label: "检验单号", prop: "inspectNumber", }, + { label: "任务状态", type: "filter", filters: "taskStatus", prop: "jobStatus", }, + { label: "承接者用户名", prop: "acceptUserName", }, + { label: "完成者用户名", prop: "completeUserName", }, + { type: "dateTime", label: "承接者时间", prop: "acceptTime", }, + { type: "dateTime", label: "完成时间", prop: "completeTime", }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + + // { label: "承接者用户名", prop: "acceptUserName", }, + // { type: "dateTime", label: "承接者时间", prop: "acceptTime", }, + // { label: "完成者用户名", prop: "completeUserName", }, + // { type: "dateTime", label: "完成时间", prop: "completeTime", }, + // { type: "filter", filters: "taskType", label: "任务类型", prop: "jobType", }, + // { label: "任务状态", type: "filter", filters: "taskStatus", prop: "jobStatus", }, + // { type: "dateTime", label: "创建时间", prop: "creationTime", }, + // { label: "到货单号", prop: "arriveNoticeNumber", }, + // { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 发料任务 + */ + export const IssueJob = [ + { label: "任务编号", prop: "number", }, + { label: "任务状态", type: "filter", filters: "taskStatus", prop: "jobStatus", }, + { label: "要货单号", prop: "materialRequestNumber", }, + { label: "承接者用户名", prop: "acceptUserName", }, + { label: "完成者用户名", prop: "completeUserName", }, + { type: "dateTime", label: "承接者时间", prop: "acceptTime", }, + { type: "dateTime", label: "完成时间", prop: "completeTime", }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + + // { type: "filter", filters: "taskType", label: "任务类型", prop: "jobType", }, + // { label: "任务状态", type: "filter", filters: "taskStatus", prop: "jobStatus", }, + // { label: "承接者用户名", prop: "acceptUserName", }, + // { type: "dateTime", label: "承接者时间", prop: "acceptTime", }, + // { label: "完成者用户名", prop: "completeUserName", }, + // { type: "dateTime", label: "完成时间", prop: "completeTime", }, + // { label: "工作组", prop: "workGroupCode", }, + // { label: "生产线", prop: "prodLine", }, + // { label: "车间", prop: "workshop", }, + // { label: "要货单号", prop: "materialRequestNumber", }, + // { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 完工收货任务 + */ + export const ProductReceiveJob = [ + { label: "任务编号", prop: "number", }, + { label: "承接者用户名", prop: "acceptUserName", }, + { type: "dateTime", label: "承接者时间", prop: "acceptTime", }, + { label: "完成者用户名", prop: "completeUserName", }, + { type: "dateTime", label: "完成时间", prop: "completeTime", }, + { type: "filter", filters: "taskType", label: "任务类型", prop: "jobType", }, + { label: "任务状态", type: "filter", filters: "taskStatus", prop: "jobStatus", }, + { type: "dateTime", label: "创建时间", prop: "creationTime", }, + { label: "生产计划单号", prop: "productionPlanNumber", }, + { label: "车间", prop: "workshop", }, + { label: "班次", prop: "shift", }, + { label: "工作组", prop: "workGroupCode", }, + { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 发货任务 + */ + export const DeliverJob = [ + { label: "任务编号", prop: "number", }, + { label: "发货计划单号", prop: "deliverPlanNumber" }, + { type: "dateTime", label: "发货计划时间", prop: "deliverPlanTime" }, + { label: "承接者用户名", prop: "acceptUserName", }, + { type: "dateTime", label: "承接者时间", prop: "acceptTime", }, + { label: "完成者用户名", prop: "completeUserName", }, + { type: "dateTime", label: "完成时间", prop: "completeTime", }, + { type: "filter", filters: "taskStatus", label: "任务状态", prop: "jobStatus", }, + { type: "filter", filters: "taskType", label: "任务类型", prop: "jobType", }, + { label: "发货请求单号", prop: "deliverRequestNumber", }, + { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 校验任务 + */ + export const CheckJob = [ + { label: "任务编号", prop: "number", }, + { label: "承接者用户名", prop: "acceptUserName", }, + { type: "dateTime", label: "承接者时间", prop: "acceptTime", }, + { label: "完成者用户名", prop: "completeUserName", }, + { type: "dateTime", label: "完成时间", prop: "completeTime", }, + { type: "filter", filters: "taskStatus", label: "任务状态", prop: "jobStatus", }, + { type: "filter", filters: "taskType", label: "任务类型", prop: "jobType", }, + { label: "到货单号", prop: "arriveNoticeNumber", }, + { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 盘点任务 + */ + export const CountJob = [ + { label: "任务编号", prop: "number", }, + { label: "承接者用户名", prop: "acceptUserName", }, + { type: "dateTime", label: "承接者时间", prop: "acceptTime", }, + { label: "完成者用户名", prop: "completeUserName", }, + { type: "dateTime", label: "完成时间", prop: "completeTime", }, + { type: "filter", filters: "taskStatus", label: "任务状态", prop: "jobStatus", }, + { type: "filter", filters: "taskType", label: "任务类型", prop: "jobType", }, + // { type: "filter", filters: "checkStage", label: "阶段", prop: "countStage", }, + { type: "dateTime", label: "承接时间", prop: "acceptTime", }, + { label: "到货单号", prop: "arriveNoticeNumber", }, + { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 消息管理-消息类型 + */ + export const MessageType = [ + { label: "消息类别代码", prop: "messageTypeCode" }, + { label: "消息类别名称", prop: "messageTypeName" }, + { label: "备注", prop: 'remark' } +] + +/** + * @returns {Array} 供应商考核看板-供应商考核记录 + */ + export const SupplierAssessmentNote = [ + { + label: "供应商代码", + prop: "supplierCode", + fixed: "left", + type: "name" + }, + { label: "供应商名称", prop: "supplierName" }, + { label: "ASN单号", prop: 'asnNumber' }, + { label: "ASN发货时间", prop: 'asnShippingTime', type:'dateTime' }, + { type: "filter", label: "考核内容", prop: "reason", filters: "reasonStatus" }, + { label: "扣分分数", prop: 'scope' }, + { label: "扣分时间", prop: 'evaluationTime', type:'dateTime' }, + { label: "备注", prop: 'remark' }, +] + +/** + * @returns {Array} 供应商考核看板-汇总报表 + */ + export const SupplierAssessmentReportForm = [ + { label: "供应商代码", prop: "supplierCode" }, + { label: "供应商名称", prop: "supplierName" }, + { label: "扣分总数", prop: 'summaryOfScores' }, + { label: "扣分次数", prop: 'countOfScores' }, + { label: "送货总数", prop: 'countOfAsn' }, + { label: "出错率", prop: 'errorRate' }, +] + +/** + * @returns {Array} JIS信息查询 + */ + export const JISMessageQuery = [ + { + label: "单据号", + prop: "number", + fixed: "left", + }, + { label: "产品号", prop: "productNo" }, + { label: "项目号", prop: 'program' }, + { label: "位置", prop: 'position' }, + { label: "FATA", prop: 'fata' }, + { label: "配置号", prop: 'configuration' }, + { label: "器具号", prop: 'containerCode' }, + { label: "完工单号", prop: 'receiptNumber' }, +] + +/** + * @returns {Array} 鸿翔外库jis发货 + */ + export const OuterJisDeliverNote = [ + { label: "单据号", prop: "number" }, + { label: "发货单号", prop: "deliverNumber" }, + { label: "仓库", prop: 'warehouseCode' }, + { label: "操作员", prop: 'worker' }, + { label: "创建时间", prop: 'creationTime', type:'dateTime' }, +] + +/** + * @returns {Array} 发货记录 + */ +export const OuterPillarDeliverNote = [ + { label: "单据号", prop: "number" }, + { label: "发货单号", prop: "deliverNumber" }, + { label: "仓库", prop: 'warehouseCode' }, + { label: "操作员", prop: 'worker' }, + { label: "创建时间", prop: 'creationTime', type:'dateTime' }, +] + +/** + * @returns {Array} 鸿翔外库jis换件 + */ + export const OuterJisReplaceNote = [ + { + label: "单据号", + prop: "number", + fixed: "left", + type: "name" + }, + { label: "项目号", prop: "projectCode" }, + { label: "位置", prop: 'position' }, + { label: "配置号", prop: 'l7Part' }, + { label: "物品描述", prop: 'itemName' }, + { label: "备品生产号", prop: 'sparesNumber' }, + { label: "备品批次", prop: 'sparesLot' }, + { label: "目标生产号", prop: 'targetNumber' }, + { label: "目标批次", prop: 'targetLot' }, + { label: "备品批次", prop: 'sparesLot' }, + { label: "说明", prop: 'description' }, + { label: "换件用户", prop: 'replacePeople' }, + { label: "换件时间", prop: 'replaceDate', type:'dateTime' }, + { label: "创建时间", prop: 'creationTime', type:'dateTime' }, + { label: "操作员", prop: 'worker' }, +] + + +/** + * @returns {Array} 鸿翔外库jis计划外入库 + */ + export const OuterJisUnplannedReceiptNote = [ + { + label: "单据号", + prop: "number", + fixed: "left", + type: "name" + }, + { label: "计划外入库单号", prop: "outerUnplannedReceiptNumber" }, + { label: "仓库", prop: 'warehouseCode' }, + { label: "创建时间", prop: 'creationTime', type:'dateTime' }, +] + +/** + * @returns {Array} 鸿翔外库jis计划外出库 + */ + export const OuterJisUnplannedIssueNote = [ + { + label: "单据号", + prop: "number", + fixed: "left", + type: "name" + }, + { label: "计划外出库单号", prop: "outerUnplannedIssueNumber" }, + { label: "仓库", prop: 'warehouseCode' }, + { label: "创建时间", prop: 'creationTime', type:'dateTime' }, +] + +/** + * @returns {Array} 消息收货日志 + */ + export const MessageReceiveAppService = [ + { + label: "id", + prop: "id", + fixed: "left", + type: "name" + }, + { label: "创建时间", prop: "creationTime", showProp: true }, + { label: "creatorId", prop: "creatorId", showProp: true }, + { label: "跟踪编号", prop: "traceId", showProp: true }, + { label: "errorCode", prop: "errorCode", showProp: true }, + { label: "电报文件名称", prop: "messageFileName", showProp: true }, + { label: "文件类型", prop: "messageFileType", showProp: true }, + { type: "filter", label: "状态", prop: "receiveStatus", filters: "receiveStatus" }, + { label: "receiveTime", prop: "receiveTime", showProp: true }, + { label: "lastUpdateTime", prop: "lastUpdateTime", showProp: true }, + { label: "errorCount", prop: "errorCount", showProp: true }, + { label: "operateType", prop: "operateType", showProp: true }, + { label: "报文内容JSON", prop: "messageContent", showProp: true }, + { label: "errorMessage", prop: "errorMessage", showProp: true }, +] + +/** + * @returns {Array} Part接口日志 + */ + export const PartAppService = [ + { + label: "跟踪编号", + prop: "traceId", + }, + { label: "公司", prop: "company" }, + { label: "工厂", prop: 'site' }, + { label: "物料号", prop: 'code' }, + { label: "物流名称", prop: 'name' }, + { label: "描述1", prop: 'desc1' }, + { label: "描述2", prop: 'desc2' }, + { label: "物料状态", prop: 'status' }, + { label: "允许制造", prop: 'canMake' }, + { label: "允许采购", prop: 'canBuy' }, + { label: "计量单位", prop: 'um' }, + { label: "ABC类", prop: 'abcClass' }, + { label: "产品类", prop: 'prodKind' }, + { label: "零件类型", prop: 'partType' }, + { label: "零件种类", prop: 'partCatalog' }, + { label: "零件分组", prop: 'partGroup' }, + { label: "虚零件", prop: 'isPhantom' }, + { label: "颜色", prop: 'color' }, + { label: "配置", prop: 'config' }, + { label: "项目", prop: 'project' }, + { label: "版本", prop: 'version' }, + { label: "工程变更通知单", prop: 'eco' }, + { label: "标包计量单位", prop: 'stdPackUm' }, + { label: "标包数量", prop: 'stdPackQty' }, + { label: "替代计量单位", prop: 'extPackUm' }, + { label: "替代包装数量", prop: 'extPackQty' }, + { label: "备注", prop: 'remark' }, +] + +/** + * @returns {Array} WMS&QAD接口日志 + */ + export const OutgoingDataAppService = [ + { + label: "id", + prop: "id", + }, + { label: "创建时间", prop: "creationTime", type:'dateTime', showProp: true }, + { label: "数据编号", prop: "number", showProp: true }, + { label: "数据类型", prop: "dataType", showProp: true }, + { label: "生效日期", prop: "effectiveDate", type:'dateTime', showProp: true }, + { label: "status", prop: "status", showProp: true }, + { label: "errorCode", prop: "errorCode", showProp: true }, + { label: "来源系统", prop: "source", showProp: true }, + { label: "写入时间", prop: "writeTime", type:'dateTime', showProp: true }, + { label: "写入者", prop: "writer", showProp: true }, + { label: "错误信息", prop: "errorMessage", showProp: true }, + { label: "数据内容", prop: "dataContent", showProp: true }, +] + +/** + * @returns {Array} WMS&QAD接口历史日志 + */ + export const OutgoingDataHistoryAppService = [ + { + label: "id", + prop: "id", + }, + { label: "创建时间", prop: "creationTime", type:'dateTime', showProp: true }, + { label: "creatorId", prop: "creatorId", showProp: true }, + { label: "数据编号", prop: "number", showProp: true }, + { label: "数据类型", prop: "dataType", showProp: true }, + { label: "生效日期", prop: "effectiveDate", type:'dateTime', showProp: true }, + { type: "filter", label: "状态", prop: "status", filters: "OutgoingDataHistoryAppStatus" }, + { type: "filter", label: "是否错误", prop: "errorCode", filters: "errorCodeStatus" }, + { label: "错误代码", prop: "errorCode", showProp: true }, + { label: "来源系统", prop: "source", showProp: true }, + { label: "写入时间", prop: "writeTime", type:'dateTime', showProp: true }, + { label: "写入者", prop: "writer", showProp: true }, + { label: "错误信息", prop: "errorMessage", showProp: true }, + { label: "数据内容", prop: "dataContent", showProp: true }, +] + +/** + * @returns {Array} Bom接口日志 + */ + export const BomAppService = [ + { + label: "id", + prop: "id", + }, + { label: "创建时间", prop: "creationTime", type:'dateTime', showProp: true }, + { label: "creatorId", prop: 'creatorId', showProp: true }, + { label: "跟踪编号", prop: 'traceId', showProp: true }, + { label: "errorCode", prop: 'errorCode', showProp: true }, + { label: "errorMessage", prop: 'errorMessage', showProp: true }, + { label: "公司", prop: 'company', showProp: true }, + { label: "父物料号", prop: 'parentCode', showProp: true }, + { label: "子物料号", prop: 'componentCode', showProp: true }, + { label: "用量", prop: 'perQty', showProp: true }, + { label: "参考号", prop: 'reference', showProp: true }, + { label: "开始日期", prop: 'startDate', type:'dateTime', showProp: true }, + { label: "结束日期", prop: 'endDate', type:'dateTime', showProp: true }, + { label: "类型", prop: 'type', showProp: true }, + { label: "工序", prop: 'op', showProp: true }, + { label: "废品率", prop: 'scrapPct', showProp: true }, + { label: "序号", prop: 'seqNumber', showProp: true }, + { label: "分组", prop: 'optionGroup', showProp: true }, + { label: "工序", prop: 'process', showProp: true }, + { label: "备注", prop: 'remark', showProp: true }, +] + +/** + * @returns {Array} 单块门板-发货记录 + */ +export const SingleDoorPanelDeliverNote = [ + { label: "发货记录单号", prop: "number", }, + { label: "操作员", prop: 'worker' }, + { label: "仓库", prop: 'warehouseCode' }, + { label: "任务ID", prop: 'jobNumber' }, + { label: "客户", prop: 'customer' }, + { label: "客户地址代码", prop: 'customerAddressCode' }, + { label: "项目号", prop: "projectCode" }, + { label: "发货时间", prop: "deliverTime", type: "dateTime" }, + { label: "到货时间", prop: "arrivalTime", type: "dateTime" }, + { label: "项目名称", prop: "projectName" }, + { label: "客户名称", prop: "customerName" }, + { label: "客户联系人", prop: "customerContact" }, + { label: "客户电话", prop: "customerPhone" }, + { label: "包装箱容量/箱", prop: "totalPackCapacity" }, + { label: "客户地址", prop: "customerAddress" }, + { label: "发货人姓名", prop: "deliverPeopleName" }, + { label: "备注", prop: "remark" }, +] + +/** + * @returns {Array} 单块门板-完工收货记录 + */ +export const SingleDoorPanelProductReceiptNote = [ + { label: "完工收货单号", prop: "number", }, + { label: "生产计划单号", prop: 'productionPlanNumber' }, + { label: "任务ID", prop: 'jobNumber' }, + { type: "dateTime", label: "完工时间", prop: 'completeTime' }, + { label: "车间", prop: 'workshop' }, + { label: "生产线", prop: 'prodLine' }, + { label: "收货库位", prop: 'locationCode' }, + { label: "原料库位", prop: 'rawLocation' }, + { label: "仓库", prop: 'warehouseCode' }, + { label: "操作员", prop: 'worker' }, +] + +/** + * @returns {Array} 单块门板-完工调整记录 + */ +export const SingleDoorPanelProductAdjust = [ + { label: "完工调整单号", prop: "number" }, + { label: "产品号", prop: 'productNo',}, + { label: "项目号", prop: 'projectCode',}, + { label: "位置", prop: 'position',}, + { label: "箱码", prop: 'packingCode',}, + { label: "配置码", prop: 'itemCode',}, + { label: "操作员", prop: 'worker',}, + { label: "任务ID", prop: 'jobNumber',}, + { label: "生产线", prop: 'prodLine',}, + { label: "批次", prop: 'lot',}, + { label: "原料库位", prop: 'rawLocation',}, + { label: "成品库位", prop: 'productLocation',}, +] + +/** + * @returns {Array} 单块门板-库移记录 + */ +export const SingleDoorPanelProductTransferNote = [ + { label: "转移发货单号", prop: "number", }, + { label: "来源库位", prop: "fromLocationCode", }, + { label: "目标库位", prop: "toLocationCode", }, + { label: "来源仓库", prop: "fromWarehouseCode", }, + { label: "目标仓库", prop: "toWarehouseCode", }, + { label: "操作员", prop: "worker", }, + { label: "任务ID", prop: "jobNumber", }, + // { label: "供应商编号", prop: "supplierCode", }, + { label: "备注", prop: "remark",}, +] + +/** + * @returns {Array} 单块门板-客户退货记录 + */ +export const SingleDoorPanelCustomerReturnNote = [ + { label: "客户退货单号", prop: "number" }, + { label: "收货库位", prop: 'locationCode' }, + { label: "退货时间", prop: "returnTime", type: "dateTime" }, + { label: "操作员", prop: 'worker' }, + { label: "仓库", prop: 'warehouseCode' }, + // { label: "任务ID", prop: 'jobNumber' }, + { label: "备注", prop: "remark" }, +] + +/** + * @returns {Array} 调拨发货记录 + */ +export const PillarDeliverNote = [ + { label: "ID", prop: "id", }, + { label: "调拨发货单号", prop: "number", }, + { label: "仓库", prop: "warehouseCode", }, + { label: "操作员", prop: "worker", }, + { label: "客户", prop: "customer", }, + { label: "客户地址", prop: "customerAddressCode", }, + { label: "销售订单号", prop: "soNumber", }, + { label: "发货方式", prop: "shipVia", }, + { label: "运输方式", prop: "modeOfTransport", }, + { label: "承运商", prop: "carrier", }, + { label: "承运商参考", prop: "carrierShipmentRef", }, + { label: "车辆", prop: "vehicleID", }, + { label: "备注", prop: "remark",}, +] + +/** + * @returns {Array} 标签信息 + */ +export const labelInfo = [ + { label: "箱码", prop: "packingCode" }, + { label: "物料代码", prop: "itemCode" }, + { label: "物料名称", prop: "item", showProp: 'name', type:'object' }, + { label: "物料描述1", prop: "item", showProp: 'desc1', type:'object' }, + { label: "物料描述2", prop: "item", showProp: 'desc2', type:'object' }, + { label: "批次", prop: "lot" }, + { label: "数量", prop: "qty", showProp: 'qty', type:'object' }, + { label: "单位", prop: "qty", showProp: 'uom', type:'object' }, + { label: "标包数量", prop: "planQty", showProp: 'qty', type:'object' }, + { label: "完整条码文本", prop: "fullBarcodeString" }, + { label: "供应商代码", prop: 'supplierCode' }, + { label: "供应商名称", prop: 'supplierName' }, + { label: "采购单号", prop: "asnNumber" }, + { label: "发货单号", prop: "deliverNumber" }, + { label: "生产线", prop: "prodLine" }, + { label: "生产计划编号", prop: "productionPlanNumber" }, + { label: "完工时间", prop: 'completeTime', type: "dateTime" }, + { label: "流水号", prop: "lsh" }, + { label: "客户物料号", prop: "customerItemCode" }, +] \ No newline at end of file diff --git a/src/utils/disposition/tableColumns.ts b/src/utils/disposition/tableColumns.ts new file mode 100644 index 0000000..3e54710 --- /dev/null +++ b/src/utils/disposition/tableColumns.ts @@ -0,0 +1,73186 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter,formatGetTime } from '@/utils/formatTime' +import * as getRequestsettingApi from '@/api/wms/requestsetting/index.ts' +// import BasicForm from '@/components/BasicForm/src/BasicForm.vue' +// import { h } from 'vue' + +// 获取当前操作人的部门 +import { useUserStore } from '@/store/modules/user' +const userStore = useUserStore() +const userDept = userStore.userSelfInfo.dept + + +// console.log(12, h(BasicForm)) +// const BasicFormType = h(BasicForm).type +// const { formLoading } = BasicFormType.setup +// console.log(12, formLoading) +// BasicFormType.setup.opensearchTable('asnNumber', 'asnNumber') + + +// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 +const queryParams = { + pageSize:10, + pageNo:1, + code:'PurchaseClaimRequest' +} + const data = await getRequestsettingApi.getRequestsettingPage(queryParams) + const requestsettingData =data?.list[0]||{} + +/** + * @returns {Array} 基础物料信息 + */ +export const Itembasic = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + isSearch: true, + table: { + width: 150, + fixed: 'left' + }, + // tableForm:{ + // minWidth:200, + // sortable:false + // } + }, + { + label: '名称', + field: 'name', + sort: 'custom', + isSearch: true, + table: { + width: 150 + }, + }, + { + label: '描述1', + field: 'desc1', + sort: 'custom', + table: { + width: 150 + } , + // isTableForm:false + }, + { + label: '描述2', + field: 'desc2', + sort: 'custom', + table: { + width: 150 + } , + }, + { + label: '状态', + field: 'status', + sort: 'custom', + dictType: DICT_TYPE.ITEM_STATUS, + dictClass: 'string', + isForm: true, + isSearch: true, + isTable: true, + table: { + width: 100 + } , + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '计量单位', + field: 'uom', + sort: 'custom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 120 + } , + }, + { + label: '替代计量单位', + field: 'altUom', + sort: 'custom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isTable: true, + table: { + width: 150 + } , + }, + { + label: '是否标包', + field: 'isStdPack', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + // colorType: 'danger', + isTable: true, + table: { + width: 120 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + // tableForm:{ + // width: 180, + // type:'Radio', + // } + }, + { + label: '可采购', + field: 'enableBuy', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + table: { + width: 100 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '可制造', + field: 'enableMake', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + table: { + width: 100 + } , + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '可委外加工', + field: 'enableOutsourcing', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + table: { + width: 120 + } , + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '回收件', + field: 'isRecycled', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + table: { + width: 100 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '虚零件', + field: 'isPhantom', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + table: { + width: 100 + } , + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: 'ABC类', + field: 'abcClass', + sort: 'custom', + dictType: DICT_TYPE.ABC_CLASS, + dictClass: 'string', + isTable: true, + table: { + width: 100 + } , + }, + { + label: '类型', + field: 'type', + sort: 'custom', + dictType: DICT_TYPE.ITEM_TYPE, + dictClass: 'string', + isTable: true, + table: { + width: 100 + } , + }, + { + label: '种类', + field: 'category', + sort: 'custom', + dictType: DICT_TYPE.ITEM_CATEGORY, + dictClass: 'string', + isTable: true, + table: { + width: 100 + } , + }, + { + label: '分组', + field: 'itemGroup', + sort: 'custom', + dictType: DICT_TYPE.ITEM_GROUP, + dictClass: 'string', + isTable: true, + table: { + width: 100 + } , + }, + { + label: '颜色', + field: 'color', + sort: 'custom', + dictType: DICT_TYPE.ITEM_COLOR, + dictClass: 'string', + isTable: true, + table: { + width: 100 + } , + }, + { + label: '配置', + field: 'configuration', + sort: 'custom', + dictType: DICT_TYPE.ITEM_CONFIGURATION, + dictClass: 'string', + isTable: true, + table: { + width: 100 + } , + }, + { + label: '项目', + field: 'project', + sort: 'custom', + table: { + width: 100 + } , + }, + { + label: '质量等级', + field: 'eqLevel', + sort: 'custom', + dictType: DICT_TYPE.EQ_LEVEL, + dictClass: 'string', + isTable: true, + table: { + width: 120 + } , + }, + { + label: '有效天数', + field: 'validityDays', + sort: 'custom', + table: { + width: 120 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + table: { + width: 120 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + sort: 'custom', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + } , + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + // tableForm:{ + // width: 200, + // type:'FormDateTime', + // } + }, + { + label: '失效时间', + field: 'expireTime', + sort: 'custom', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + } , + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + isTable: true, + formatter: dateFormatter, + isForm: false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + } , + }, + { + label: '创建者', + field: 'creator', + isForm: false, + isTable: false + }, + { label: '备注', field: 'remark', sort: 'custom', isTable: false}, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150, + fixed: 'right' + }, + } +])) + +// 表单校验 +export const ItembasicRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + name: [ + { required: true, message: '请输入名称', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + uom: [ + { required: true, message: '请选择计量单位', trigger: 'change' } + ], + altUom: [ + { required: true, message: '请选择替代计量单位', trigger: 'change' } + ], + isStdPack: [ + { required: true, message: '请选择是否标包', trigger: 'change' } + ], + enableBuy: [ + { required: true, message: '请选择是否可采购', trigger: 'change' } + ], + enableMake: [ + { required: true, message: '请选择是否可制造', trigger: 'change' } + ], + enableOutsourcing: [ + { required: true, message: '请选择是否可委外加工', trigger: 'change' } + ], + isRecycled: [ + { required: true, message: '请选择回收件', trigger: 'change' } + ], + isPhantom: [ + { required: true, message: '请选择虚零件', trigger: 'change' } + ], + abcClass: [ + { required: true, message: '请选择ABC类', trigger: 'change' } + ], + type: [ + { required: true, message: '请选择类型', trigger: 'change' } + ], + category: [ + { required: true, message: '请选择种类', trigger: 'change' } + ], + itemGroup: [ + { required: true, message: '请选择分组', trigger: 'change' } + ], + color: [ + { required: true, message: '请选择颜色', trigger: 'change' } + ], + configuration: [ + { required: true, message: '请选择配置', trigger: 'change' } + ], + project: [ + { required: true, message: '请输入项目', trigger: 'blur' } + ], + eqLevel: [ + { required: true, message: '请选择质量等级', trigger: 'change' } + ], + validityDays: [ + { required: true, message: '请输入有效天数', trigger: 'change' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + activeTime: [ + { required: true, message: '请输入生效时间', trigger: 'change' } + ], + expireTime: [ + { required: true, message: '请输入失效时间', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 基础包装信息 + */ +export const Itempackaging = useCrudSchemas(reactive([ + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + isSearch: true, + table: { + width: 150, + fixed: 'left' + } + }, + { + label: '计量单位', + field: 'uom', + sort: 'custom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 120 + } + }, + { + label: '包装单位', + field: 'stdPackUnit', + sort: 'custom', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 120 + } + }, + { + label: '包装数量', + field: 'stdPackQty', + sort: 'custom', + isSearch: true, + table: { + width: 120 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '替代包装单位1', + field: 'altPackUnit1', + sort: 'custom', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isTable: true, + table: { + width: 150 + } + }, + { + label: '替代包装量1', + field: 'altPackQty1', + sort: 'custom', + table: { + width: 130 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '替代包装量2', + field: 'altPackQty2', + sort: 'custom', + table: { + width: 130 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '替代包装单位3', + field: 'altPackUnit3', + sort: 'custom', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isTable: true, + table: { + width: 150 + } + }, + { + label: '替代包装量3', + field: 'altPackQty3', + sort: 'custom', + table: { + width: 130 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '替代包装单位4', + field: 'altPackUnit4', + sort: 'custom', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + table: { + width: 150 + } + }, + { + label: '替代包装量4', + field: 'altPackQty4', + sort: 'custom', + table: { + width: 130 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + table: { + width: 120 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '生效时间', + field: 'activeTime', + sort: 'custom', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '失效时间', + field: 'expireTime', + sort: 'custom', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + isForm: false, + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + } + }, + { + label: '创建者', + field: 'creator', + isForm: false, + isTable: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) + +// 表单校验 +export const ItempackagingRules = reactive({ + itemCode: [{ required: true, message: '物品代码不能为空', trigger: 'blur' }], + uom: [{ required: true, message: '计量单位不能为空', trigger: 'change' }], + stdPackUnit: [{ required: true, message: '包装单位不能为空', trigger: 'change' }], + stdPackQty: [{ required: true, message: '包装数量不能为空', trigger: 'blur' }], + available: [{ required: true, message: '是否可用不能为空', trigger: 'change' }] +}) + +/** + * @returns {Array} 基础物料清单 +*/ +export const Bom = useCrudSchemas(reactive([ + { + label: '父物料代码', + field: 'productItemCode', + isSearch: true, + sort: 'custom', + table: { + width: 150, + fixed: 'left' + } + }, + { + label: '子物料代码', + field: 'componentItemCode', + isSearch: true, + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '子物料计量单位', + field: 'componentUom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + sort: 'custom', + isSearch: true, + isTable: true, + table: { + width: 150 + } + }, + { + label: '子物料数量', + field: 'componentQty', + isSearch: true, + sort: 'custom', + form: { + component: 'InputNumber', + }, + table: { + width: 120 + } + }, + { + label: '工序代码', + field: 'processCode', + sort: 'custom', + table: { + width: 120 + } + }, + { + label: '版本', + field: 'version', + sort: 'custom' + }, + { + label: '层级', + field: 'layer', + sort: 'custom', + // form: { + // component: 'Input', + // componentProps: { + // // focus: ()=>{console.log('111111111111111111111')}, + // modelValue: '11111' + // } + // } + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + sort: 'custom', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + sort: 'custom', + formatter : dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + table: { + width: 120 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + sort: 'custom', + formatter: dateFormatter, + isForm: false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + } + }, + { + label: '创建者', + field: 'creator', + isForm: false, + isTable: false + }, + { label: '备注', field: 'remark', isTable: false }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150, + fixed: 'right' + } + } +])) + +//表单校验 +export const BomRules = reactive({ + productItemCode: [ + { required: true, message: '请输入父物料代码', trigger: 'blur' } + ], + componentItemCode: [ + { required: true, message: '请输入子物料代码', trigger: 'blur' } + ], + componentUom: [ + { required: true, message: '请选择子物料计量单位', trigger: 'change' } + ], + componentQty: [ + { required: true, message: '请输入子物料数量', trigger: 'blur' } + ], + processCode: [ + { required: true, message: '请输入工序代码', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 基础标准成本价格单 + */ +export const Stdcostprice = useCrudSchemas(reactive([ + { + label: '供应商代码', + field: 'supplierCode', + isSearch: true, + sort: 'custom', + table: { + width: 150, + fixed: 'left' + } + }, + { + label: '物料代码', + field: 'itemCode', + isSearch: true, + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '货币', + field: 'currency', + dictType: DICT_TYPE.CURRENCY, + dictClass: 'string', + sort: 'custom', + isSearch : true, + isTable : true + }, + { + label: '价格', + field: 'price', + sort: 'custom', + isSearch: true + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 120 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + sort: 'custom', + formatter : dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + sort: 'custom', + formatter : dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '创建时间', + field: 'createTime', + isForm: false, + sort: 'custom', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '创建者', + field: 'creator', + isForm: false, + isTable: false + }, + { + label: '备注', + field: 'remark', + isTable: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150, + fixed: 'right' + } + } +])) + +//表单校验 +export const StdcostpriceRules = reactive({ + supplierCode: [ + { required: true, message: '请输入供应商代码', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物料代码', trigger: 'blur' } + ], + currency: [ + { required: true, message: '请选择货币', trigger: 'change' } + ], + price: [ + { required: true, message: '请输入价格', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 生产线物料关系 + */ +export const Productionlineitem = useCrudSchemas(reactive([ + { + label: '完工收货库位', + field: 'fgLocationCode', + isSearch: true, + sort: 'custom', + table: { + width: 150, + fixed: 'left' + } + }, + { + label: '产线代码' , + field: 'productionLineCode', + isSearch: true, + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '物品代码', + field: 'itemCode', + isSearch: true, + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + sort: 'custom', + isSearch: true, + isTable: true, + table: { + width: 120 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '生效时间', + field: 'activeTime', + sort: 'custom', + formatter : dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '失效时间', + field: 'expireTime', + sort: 'custom', + formatter : dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label:'备注', + field: 'remark', + isTable: false + }, + { + label: '创建时间', + field: 'createTime', + isForm: false, + formatter: dateFormatter, + detail: { + dateFormat : 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '创建者', + field: 'creator', + isForm: false, + isTable: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150, + fixed: 'right' + } + } +])) + +//表单校验 +export const ProductionlineitemRules = reactive({ + fgLocationCode: [ + { required: true, message: '请输入完工收货库位', trigger: 'blur' } + ], + productionLineCode: [ + { required: true, message: '请输入产线代码', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物品代码', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 供应商 + */ +export const Supplier = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + isSearch: true, + table: { + width: 150 + } + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '简称', + field: 'shortName', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '地址', + field: 'address', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '国家', + field: 'country', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '城市', + field: 'city', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '电话', + field: 'phone', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '传真', + field: 'fax', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '邮编', + field: 'postId', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '联系人', + field: 'contacts', + sort: 'custom', + table: { + width: 150 + } + }, + { + label:'银行', + field: 'bank', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '币种', + field: 'currency', + sort: 'custom', + dictType: DICT_TYPE.CURRENCY, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 150 + } + }, + { + label: '税率', + field: 'taxRate', + sort: 'custom', + form: { + component: 'InputNumber', + }, + table: { + width: 150 + } + }, + { + label: '类型', + field: 'type', + sort: 'custom', + dictType: DICT_TYPE.SUPPLIER_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 150 + } + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + table: { + width: 150 + } + }, + { + label: '生效时间', + field: 'activeTime', + sort: 'custom', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + table: { + width: 180 + } + }, + { + label: '失效时间', + field: 'expireTime', + sort: 'custom', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + table: { + width: 180 + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isTable: false, + isForm: false, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + isTable: false, + isForm: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + table: { + width: 180 + } + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + isTable: false, + isForm: false, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const SupplierRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + shortName: [ + { required: true, message: '请输入简称', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 供应商物品 + */ +export const Supplieritem = useCrudSchemas(reactive([ + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + isSearch: true, + table: { + width: 150 + } + }, + { + label: '供应商物料代码', + field: 'supplierItemCode', + sort: 'custom', + isSearch: true, + table: { + width: 150 + } + }, + { + label: '供应商计量单位', + field: 'supplierUom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '转换率', + field: 'convertRate', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '供应商包装单位', + field: 'packUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '供应商包装量', + field: 'packQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '供应商替代包装单位', + field: 'altPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '供应商替代包装量', + field: 'altPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '每器具包装数', + field: 'packQtyOfContainer', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '默认收货仓库', + field: 'defaultWarehouseCode', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '默认收货库位', + field: 'defaultLocationCode', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '结算方式', + field: 'settlementType', + dictType: DICT_TYPE.SETTLEMENT_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + table: { + width: 150 + } + }, + { + label: '生效时间', + field: 'activeTime', + formatter: dateFormatter, + isTable: true, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + isForm: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '创建者', + field: 'creator', + isTable: true, + isForm: false, + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const SupplieritemRules = reactive({ + supplierCode: [ + { required: true, message: '请输入供应商代码', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物料代码', trigger: 'blur' } + ], + packUnit: [ + { required: true, message: '请选择供应商包装单位', trigger: 'change' } + ], + packQty: [ + { required: true, message: '请输入供应商包装量', trigger: 'blur' } + ], + packQtyOfContainer: [ + { required: true, message: '请输入每器具包装数', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 采购价格单 + */ +export const Purchaseprice = useCrudSchemas(reactive([ + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + isSearch: true, + table: { + width: 150 + } + }, + { + label: '货币', + field: 'currency', + dictType: DICT_TYPE.CURRENCY, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '价格', + field: 'price', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + details: { + dateFormatter: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + details: { + dateFormatter: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + isTable: false, + isForm:false, + formatter: dateFormatter, + details: { + dateFormatter: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '创建者', + field: 'creator', + isTable: false, + isForm:false, + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const PurchasepriceRules = reactive({ + supplierCode: [ + { required: true, message: '请输入供应商代码', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物品代码', trigger: 'blur' } + ], + currency: [ + { required: true, message: '请选择货币', trigger: 'change' } + ], + price: [ + { required: true, message: '请输入价格', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 客户 + */ +export const Customer = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '简称', + field: 'shortName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label:'地址', + field: 'address', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '国家', + field: 'country', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '城市', + field: 'city', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '电话', + field: 'phone', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '传真', + field: 'fax', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '邮编', + field: 'postId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '联系人', + field: 'contacts', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '银行', + field: 'bank', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '币种', + field: 'currency', + dictType: DICT_TYPE.CURRENCY, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '税率', + field: 'taxRate', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '类型', + field: 'type', + dictType: DICT_TYPE.CUSTOMER_TYPE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + isTable: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isForm: false + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isForm: false, + isTable: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const CustomerRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + shortName: [ + { required: true, message: '请输入简称', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 客户月台 + */ +export const Customerdock = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '描述', + field: 'description', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '城市', + field: 'city', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '地址', + field: 'address', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '联系人姓名', + field: 'contactPerson', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '联系人电话', + field: 'contactPhone', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '仓库', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '默认库位', + field: 'defaultLocationCode', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + isTable: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + isSearch: false, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isForm: false, + }, + { + label: '创建者', + field: 'creator', + isSearch: false, + isTable: false, + isForm: false, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const CustomerdockRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + customerCode: [ + { required: true, message: '请输入客户代码', trigger: 'blur' } + ], + defaultLocationCode: [ + { required: true, message: '请输入默认库位', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 客户物品 + */ +export const Customeritem = useCrudSchemas(reactive([ + { + label: '客户代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '客户物料代码', + field: 'customerItemCode', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '客户计量单位', + field: 'cusotmerUom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '转换率', + field: 'convertRate', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '客户包装单位', + field: 'packUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户包装量', + field: 'packQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '客户替代包装单位', + field: 'altPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户替代包装量', + field: 'altPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '每器具包装数', + field: 'packQtyOfContainer', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + isSearch: true + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isTable: false, + isForm: false + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const CustomeritemRules = reactive({ + customerCode: [ + { required: true, message: '请输入客户代码', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物品代码', trigger: 'blur' } + ], + packUnit: [ + { required: true, message: '请选择客户包装单位', trigger: 'change' } + ], + packQty: [ + { required: true, message: '请输入客户包装量', trigger: 'blur' } + ], + packQtyOfContainer: [ + { required: true, message: '请输入每器具包装数', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 项目 + */ +export const Project = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '客户代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isTable: false, + isForm: false, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const ProjectRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 销售价格单 + */ +export const Saleprice = useCrudSchemas(reactive([ + { + label: '客户代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '货币', + field: 'currency', + dictType: DICT_TYPE.CURRENCY, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '价格', + field: 'price', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isForm: false, + isTable: false, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isForm: false, + isTable: false, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const SalepriceRules = reactive({ + customercode: [ + { required: true, message: '请输入客户代码', trigger: 'blur' } + ], + itemcode: [ + { required: true, message: '请输入物料代码', trigger: 'blur' } + ], + currency: [ + { required: true, message: '请选择货币', trigger: 'change' } + ], + price: [ + { required: true, message: '请输入价格', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 仓库 + */ +export const Warehouse = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '描述', + field: 'description', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '类型', + field: 'type', + dictType: DICT_TYPE.WAREHOUSE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isTable: false, + isForm: false + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const WarehouseRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 月台 + */ +export const Dock = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '城市', + field: 'city', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '地址', + field: 'address', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '类型', + field: 'type', + dictType: DICT_TYPE.DOCK_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '默认库位代码', + field: 'defaultLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '联系人姓名', + field: 'contactPerson', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '联系人电话', + field: 'contactPhone', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isTable: false, + isForm: false + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const DockRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + type: [ + { required: true, message: '请输入类型', trigger: 'change' } + ], + warehouseCode: [ + { required: true, message: '请输入仓库代码', trigger: 'blur' } + ], + defaultLocationCode: [ + { required: true, message: '请输入默认库位代码', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 库区 + */ +export const Area = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '类型', + field: 'type', + dictType: DICT_TYPE.AREA_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否是功能区', + field: 'isFunctional', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isTable: false, + isForm: false + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const AreaRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + warehouseCode: [ + { required: true, message: '请输入仓库代码', trigger: 'blur' } + ], + isFunctional: [ + { required: true, message: '请选择是否是功能区', trigger: 'change' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 库位组 + */ +export const Locationgroup = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '区域代码', + field: 'areaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isForm: false, + isTable: false + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isForm: false, + isTable: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const LocationgroupRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + warehouseCode: [ + { required: true, message: '请输入仓库代码', trigger: 'blur' } + ], + areaCode: [ + { required: true, message: '请输入区域代码', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 库位 + */ +export const Location = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '区域代码', + field: 'areaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位组代码', + field: 'locationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: 'ERP库位代码', + field: 'erpLocationCode', + dictType: DICT_TYPE.ERP_LOCATION, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '类型', + field: 'type', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '巷道', + field: 'aisle', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货架', + field: 'shelf', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '行', + field: 'locationRow', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '列', + field: 'locationColum', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '拣料优先级', + field: 'pickPriority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '最大承重', + field: 'maxWeight', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '最大面积', + field: 'maxArea', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '最大体积', + field: 'maxVolume', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '用户组代码', + field: 'userGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isForm: false, + isTable: false + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isForm: false, + isTable: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const LocationRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + warehouseCode: [ + { required: true, message: '请输入仓库代码', trigger: 'blur' } + ], + areaCode: [ + { required: true, message: '请输入库区代码', trigger: 'blur' } + ], + locationGroupCode: [ + { required: true, message: '请输入库位组代码', trigger: 'blur' } + ], + erpLocationCode: [ + { required: true, message: '请选择ERP库位代码', trigger: 'change' } + ], + type: [ + { required: true, message: '请选择类型', trigger: 'change' } + ], + pickPriority: [ + { required: true, message: '请输入拣料优先级', trigger: 'blur' } + ], + userGroupCode: [ + { required: true, message: '请输入用户组代码', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 车间 + */ +export const Workshop = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '类型', + field: 'type', + dictType: DICT_TYPE.WORKSHOP_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isForm: false, + isTable: false + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isForm: false, + isTable: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const WorkshopRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 生产线 + */ +export const Productionline = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '类型', + field: 'type', + dictType: DICT_TYPE.PRODUCTION_LINE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '原料库位', + field: 'rawLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '成品库位', + field: 'fgLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isTable: false, + isForm: false + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const ProductionlineRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + workshopCode: [ + { required: true, message: '请输入车间代码', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 工位 + */ +export const Workstation = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '类型', + field: 'type', + dictType: DICT_TYPE.WORK_STATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '原料库位', + field: 'rawLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '成品库位', + field: 'fgLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isForm: false, + isTable: false, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isForm: false, + isTable: false, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单检验 +export const WorkstationRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + workshopCode: [ + { required: true, message: '请输入车间代码', trigger: 'blur' } + ], + productionLineCode: [ + { required: true, message: '请输入生产线代码', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 工序 + */ +export const Process = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '类型', + field: 'type', + dictType: DICT_TYPE.PROCESS_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isTable: false, + isForm: false + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单检验 +export const ProcessRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + workshopCode: [ + { required: true, message: '请输入车间代码', trigger: 'blur' } + ], + productionLineCode: [ + { required: true, message: '请输入生产线代码', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 系统日历 + */ +export const Systemcalendar = useCrudSchemas(reactive([ + { + label: '模块', + field: 'module', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '开始时间', + field: 'startTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isSearch: true, + }, + { + label: '结束时间', + field: 'stopTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isSearch: true, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isTable: false, + isForm: false + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const SystemcalendarRules = reactive({ + module: [ + { required: true, message: '请输入模块', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 账期日历 + */ +export const Accountcalendar = useCrudSchemas(reactive([ + { + label: '年', + field: 'year', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '月', + field: 'month', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '描述', + field: 'descriiption', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '开始时间', + field: 'beginTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isSearch: true, + }, + { + label: '结束时间', + field: 'endTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isSearch: true, + }, + { + label: '转换生效时间', + field: 'converttotime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isSearch: true, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isTable: false, + isForm: false + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const AccountcalendarRules = reactive({ + year: [ + { required: true, message: '请输入年', trigger: 'blur' } + ], + month: [ + { required: true, message: '请输入月', trigger: 'blur' } + ], + beginTime: [ + { required: true, message: '请输入开始时间', trigger: 'blur' } + ], + endTime: [ + { required: true, message: '请输入结束时间', trigger: 'blur' } + ], + converttotime: [ + { required: true, message: '请输入转换生效时间', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 货币转换 + */ +export const Currencyexchange = useCrudSchemas(reactive([ + { + label: '货币', + field: 'currency', + dictType: DICT_TYPE.CURRENCY, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '基础货币', + field: 'basiccurrency', + dictType: DICT_TYPE.CURRENCY, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '比率', + field: 'rate', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isSearch: true + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isForm: false, + isTable: false, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isForm: false, + isTable: false, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const CurrencyexchangeRules = reactive({ + currency: [ + { required: true, message: '请选择货币', trigger: 'change' } + ], + basiccurrency: [ + { required: true, message: '请选择基础货币', trigger: 'change' } + ], + rate: [ + { required: true, message: '请输入比率', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 货主 + */ +export const Owner = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '简称', + field: 'shortName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '地址', + field: 'address', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '国家', + field: 'country', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '城市', + field: 'city', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '电话', + field: 'phone', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '传真', + field: 'fax', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '邮编', + field: 'postId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '联系人', + field: 'contacts', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '银行', + field: 'bank', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '币种', + field: 'currency', + dictType: DICT_TYPE.CURRENCY, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '税率', + field: 'taxRate', + form: { + component: 'InputNumber', + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '类型', + field: 'type', + dictType: DICT_TYPE.OWNER_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isForm: false, + isTable: false, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isForm: false, + isTable: false, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const OwnerRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + shortName: [ + { required: true, message: '请输入简称', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 承运商 + */ +export const Carrier = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '简称', + field: 'shortName', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '地址', + field: 'address', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '国家', + field: 'country', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '城市', + field: 'city', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '电话', + field: 'phone', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '传真', + field: 'fax', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '邮编', + field: 'postId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '联系人', + field: 'contacts', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '银行', + field: 'bank', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '币种', + field: 'currency', + dictType: DICT_TYPE.CURRENCY, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '税率', + field: 'taxRate', + form: { + component: 'InputNumber', + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '类型', + field: 'type', + dictType: DICT_TYPE.CARRIER_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isForm: false, + isTable: false, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isForm: false, + isTable: false, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const CarrierRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + shortName: [ + { required: true, message: '请输入简称', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 班次 + */ +export const Shift = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '开始时间', + field: 'beginTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '结束时间', + field: 'entTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isSearch: true, + }, + { + label: '是否跨天', + field: 'endAtNextDay', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isForm: false, + isTable: false, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isForm: false, + isTable: false, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const ShiftRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + beginTime: [ + { required: true, message: '请输入开始时间', trigger: 'blur' } + ], + entTime: [ + { required: true, message: '请输入结束时间', trigger: 'blur' } + ], + endAtNextDay: [ + { required: true, message: '请选择是否跨天', trigger: 'change' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 班组 + */ +export const Team = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '成员', + field: 'members', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isForm: false, + isTable: false, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isForm: false, + isTable: false, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const TeamRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 策略 + */ +export const Strategy = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '描述', + field: 'description', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '类型', + field: 'type', + dictType: DICT_TYPE.STRATEGY_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '是否生效', + field: 'isActive', + dictType: DICT_TYPE.STRATEGY_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'creationTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isTable: false, + isForm: false + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const StrategyRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + type: [ + { required: true, message: '请选择类型', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 规则 + */ +export const Rule = useCrudSchemas(reactive([ + { + label: '策略代码', + field: 'strategyCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '条件', + field: 'condition', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '配置', + field: 'configuration', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const RuleRules = reactive({ + strategyCode: [ + { required: true, message: '请输入策略代码', trigger: 'blur' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + configuration: [ + { required: true, message: '请输入配置', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 条件 + */ +export const Condition = useCrudSchemas(reactive([ + { + label: '策略代码', + field: 'strategyCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '规则代码', + field: 'ruleCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '参数', + field: 'paramCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '操作符', + field: 'operator', + dictType: DICT_TYPE.STRATEGY_PARAM_OPEARTOR, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '值', + field: 'value', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '条件分组', + field: 'groupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const ConditionRules = reactive({ + strategyCode: [ + { required: true, message: '请输入策略代码', trigger: 'blur' } + ], + ruleCode: [ + { required: true, message: '请输入规则代码', trigger: 'blur' } + ], + paramCode: [ + { required: true, message: '请输入参数', trigger: 'blur' } + ], + operator: [ + { required: true, message: '请选择操作符', trigger: 'change' } + ], + value: [ + { required: true, message: '请输入值', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 配置 + */ +export const Configuration = useCrudSchemas(reactive([ + { + label: '策略代码', + field: 'strategyCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '规则代码', + field: 'ruleCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '配置名称', + field: 'configurationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '描述', + field: 'description', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '配置值', + field: 'configurationValue', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '配置分组', + field: 'groupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const ConfigurationRules = reactive({ + strategyCode: [ + { required: true, message: '请输入策略代码', trigger: 'blur' } + ], + ruleCode: [ + { required: true, message: '请输入规则代码', trigger: 'blur' } + ], + configurationCode: [ + { required: true, message: '请输入配置名称', trigger: 'blur' } + ], + configurationValue: [ + { required: true, message: '请输入配置值', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 配置设置 + */ +export const Configurationsetting = useCrudSchemas(reactive([ + { + label: '策略类型', + field: 'strategyType', + dictType: DICT_TYPE.STRATEGY_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '配置代码', + field: 'configurationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '配置名称', + field: 'configurationName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数据类型', + field: 'dataType', + dictType: DICT_TYPE.DATA_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '值范围', + field: 'valueScope', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '关联到', + field: 'relatedTo', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '描述', + field: 'description', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '必填', + field: 'isRequired', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const ConfigurationsettingRules = reactive({ + strategyType: [ + { required: true, message: '请选择策略类型', trigger: 'change' } + ], + configurationCode: [ + { required: true, message: '请输入配置代码', trigger: 'blur' } + ], + configurationName: [ + { required: true, message: '请输入配置名称', trigger: 'blur' } + ], + isRequired: [ + { required: true, message: '请选择必填', trigger: 'change' } + ], + dataType: [ + { required: true, message: '请选择数据类型', trigger: 'change' } + ], + valueScope: [ + { required: true, message: '请输入值范围', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 参数设置 + */ +export const Paramsetting = useCrudSchemas(reactive([ + { + label: '策略类型', + field: 'strategyType', + dictType: DICT_TYPE.STRATEGY_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '参数代码', + field: 'paramCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '参数名称', + field: 'paramName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '可用操作符', + field: 'usableOpeartors', + dictType: DICT_TYPE.STRATEGY_PARAM_OPEARTOR, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数据类型', + field: 'dataType', + dictType: DICT_TYPE.DATA_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '值范围', + field: 'valueScope', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '关联到', + field: 'relatedTo', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '描述', + field: 'description', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '必填', + field: 'isRequired', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const ParamsettingRules = reactive({ + strategyType: [ + { required: true, message: '请选择策略类型', trigger: 'change' } + ], + paramCode: [ + { required: true, message: '请输入参数代码', trigger: 'blur' } + ], + usableOpeartors: [ + { required: true, message: '请选择可用操作符', trigger: 'change' } + ], + isRequired: [ + { required: true, message: '请选择必填', trigger: 'change' } + ], + dataType: [ + { required: true, message: '请选择数据类型', trigger: 'change' } + ], + valueScope: [ + { required: true, message: '请输入值范围', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 事务类型 + */ +export const Transactiontype = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '描述', + field: 'description', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存动作', + field: 'inventoryAction', + dictType: DICT_TYPE.INVENTORY_ACTION, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '允许负数', + field: 'allowNegative', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '是否软删除', + field: 'isSoftDeleted', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + isTable: false, + isForm: false, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const TransactiontypeRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + name: [ + { required: true, message: '请输入名称', trigger: 'blur' } + ], + inventoryAction: [ + { required: true, message: '请选择库存动作', trigger: 'change' } + ], + allowNegative: [ + { required: true, message: '请选择允许复数', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 业务类型 + */ +export const Businesstype = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '描述', + field: 'description', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '可用物品类型范围', + field: 'itemTypes', + dictType: DICT_TYPE.ITEM_TYPE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '可用物品状态范围', + field: 'itemStatuses', + dictType: DICT_TYPE.ITEM_STATUS, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '出库库位类型范围', + field: 'outLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '入库库位类型范围', + field: 'inLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '出库库区范围', + field: 'outAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库库区范围', + field: 'inAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库库存状态范围', + field: 'outInventoryStatuses', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '入库库存状态范围', + field: 'inInventoryStatuses', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否使用在途库', + field: 'useOnTheWay', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '在途库区', + field: 'onTheWayArea', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + isTable: false, + isForm: false, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + isTable: false, + isForm: false, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const BusinesstypeRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + name: [ + { required: true, message: '请输入名称', trigger: 'blur' } + ], + itemTypes: [ + { required: true, message: '请选择可用物品类型范围', trigger: 'change' } + ], + itemStatuses: [ + { required: true, message: '请选择可用物品状态范围', trigger: 'change' } + ], + outTransactionType: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransactionType: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + useOnTheWay: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 单据设置 + */ +export const Documentsetting = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '描述', + field: 'description', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据类型', + field: 'type', + dictType: DICT_TYPE.DOCUMENT_TYPE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '号码前缀', + field: 'numberPrefix', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '号码时间格式', + field: 'dateFormat', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '号码流水长度', + field: 'serialLength', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '号码分隔符', + field: 'separatorStr', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '流水重置周期', + field: 'resetPeriod', + dictType: DICT_TYPE.RESET_PERIOD, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + formatter: dateFormatter, + isForm: false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + isTable: false, + isForm: false, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const DocumentsettingRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + name: [ + { required: true, message: '请输入名称', trigger: 'blur' } + ], + type: [ + { required: true, message: '请选择单据类型', trigger: 'change' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + numberPrefix: [ + { required: true, message: '请输入号码前缀', trigger: 'blur' } + ], + dateFormat: [ + { required: true, message: '请输入号码时间格式', trigger: 'blur' } + ], + serialLength: [ + { required: true, message: '请输入号码流水长度', trigger: 'blur' } + ], + resetPeriod: [ + { required: true, message: '请选择流水重置周期', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 申请设置 + */ +export const Requestsetting = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '申请模式', + field: 'requestMode', + dictType: DICT_TYPE.REQEUST_MODE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '自动执行', + field: 'autoExecute', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '跳过任务直接删生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + isTable: false, + isForm: false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '备注', + field: 'remark', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '创建者', + field: 'creator', + isTable: false, + isForm: false, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const RequestsettingRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + requestMode: [ + { required: true, message: '请选择申请模式', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 任务设置 + */ +export const Jobsetting = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '有效分钟', + field: 'validMinutes', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '允许修改批次', + field: 'allowModifyBach', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '允许修改包装号', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '是否软删除', + field: 'isSoftDeleted', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + isForm: false, + isTable: false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + isTable: false, + isForm: false, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 150 + } + } +])) + +//表单校验 +export const JobsettingRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + validMinutes: [ + { required: true, message: '请输入有效分钟', trigger: 'blur' } + ], + autoComplete: [ + { required: true, message: '请选择是否自动完成', trigger: 'change' } + ], + allowModifyLocation: [ + { required: true, message: '请选择是否允许修改库位', trigger: 'change' } + ], + allowModifyQty: [ + { required: true, message: '请选择是否允许修改数量', trigger: 'change' } + ], + allowBiggerQty: [ + { required: true, message: '请选择是否允许大于推荐数量', trigger: 'change' } + ], + allowSmallerQty: [ + { required: true, message: '请选择是否允许小于推荐数量', trigger: 'change' } + ], + allowModifyInventoryStatus: [ + { required: true, message: '请选择是否允许修改库存状态', trigger: 'change' } + ], + allowContinuousScanning: [ + { required: true, message: '请选择是否允许连续扫描', trigger: 'change' } + ], + allowPartialComplete: [ + { required: true, message: '请选择是否允许部分完成', trigger: 'change' } + ], + allowModifyBach: [ + { required: true, message: '请选择是否允许修改批次', trigger: 'change' } + ], + allowModifyPackingNumber: [ + { required: true, message: '请选择是否允许修改包装号', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 记录设置 + */ +export const Recordsetting = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '创建时间', + field: 'createTime', + isTable: false, + formatter: dateFormatter, + isForm: false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + isTable: false, + isForm: false, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150 + } + } +])) + +//表单校验 +export const RecordsettingRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 库位容量 + */ +export const Locationcapacity = useCrudSchemas(reactive([ + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '已用容量百分比', + field: 'usedCapacity', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '可用容量百分比', + field: 'availableCapacity', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '可承受过载容量百分比', + field: 'bearableOverloadCapacity', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否无限容量', + field: 'isInfinity', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, +])) + +/** + * @returns {Array} 包装 + */ +export const Package = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '替代批次', + field: 'altBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产日期', + field: 'produceDate', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '有效期', + field: 'validityDays', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '失效日期', + field: 'expireDate', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '替代计量单位', + field: 'altUom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '替代计量数量', + field: 'altQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '转换率', + field: 'convertRate', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '标包数量', + field: 'stdPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '标包单位', + field: 'stdPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '月台代码', + field: 'toDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商物品代码', + field: 'supplierItemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '采购订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '采购订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '采购计划单号', + field: 'rpNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货单号', + field: 'asnNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产订单号', + field: 'woNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产订单行', + field: 'woLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班组代码', + field: 'teamCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班次代码', + field: 'shiftCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户月台代码', + field: 'customerDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户物品代码', + field: 'customerItemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '销售订单号', + field: 'soNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '销售订单行', + field: 'soLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '质量等级', + field: 'eqLevel', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货主', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '重量', + field: 'weight', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '面积', + field: 'area', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '体积', + field: 'volume', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, +])) + +/** + * @returns {Array} 器具主表 + */ +export const ContainerMain = useCrudSchemas(reactive([ + { + label: '号码', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '类型', + field: 'type', + dictType: DICT_TYPE.CONTAINER_TYPE, + dictClass: 'string', + isTable: true, + isForm: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '总容量', + field: 'capacity', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '状态', + field: 'status', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + } +])) + +/** + * @returns {Array} 器具子表 + */ +export const ContainerDetail = useCrudSchemas(reactive([ + { + label: '内容物类型', + field: 'containerContentType', + dictType: DICT_TYPE.CONTAINER_CONTENT_TYPE, + dictClass: 'string', + isTable: true, + isForm: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '内容物号', + field: 'contentNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isTable: true, + isForm: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isTable: true, + isForm: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +/** + * @returns {Array} 预计出库存 + */ +export const Expectout = useCrudSchemas(reactive([ + { + label: '任务号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +/** + * @returns {Array} 预计入库存 + */ +export const Expectin = useCrudSchemas(reactive([ + { + label: '任务号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +/** + * @returns {Array} 库存余额 + */ +export const Balance = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具代码', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '替代批次', + field: 'altBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货日期', + field: 'arriveDate', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '生产日期', + field: 'produceDate', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '失效日期', + field: 'expireDate', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位组代码', + field: 'locationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库区代码', + field: 'areaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: 'ERP库位代码', + field: 'erpLocationCode', + dictType: DICT_TYPE.ERP_LOCATION, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '锁定数量', + field: 'lockedQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '可用数量', + field: 'usableQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '单价', + field: 'singlePrice', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '金额', + field: 'amount', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '入库时间', + field: 'putInTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '是否冻结', + field: 'frozen', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '冻结原因', + field: 'frozenReason', + dictType: DICT_TYPE.FROZEN_REASON, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后事务号', + field: 'lastTransNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '重量', + field: 'weight', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '面积', + field: 'area', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '体积', + field: 'volume', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, +])) + +/** + * @returns {Array} 库存事务 + */ +export const Transaction = useCrudSchemas(reactive([ + { + label: '事务号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '事务类型', + field: 'transactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存动作', + field: 'inventoryAction', + dictType: DICT_TYPE.INVENTORY_ACTION, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '操作员', + field: 'worker', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '记录号', + field: 'recordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '单价', + field: 'singlePrice', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '金额', + field: 'amount', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '替代批次', + field: 'altBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货日期', + field: 'arriveDate', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '生产日期', + field: 'produceDate', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '失效日期', + field: 'expireDate', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库区代码', + field: 'areaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位组代码', + field: 'locationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: 'ERP库位代码', + field: 'erpLocationCode', + dictType: DICT_TYPE.ERP_LOCATION, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +/** + * @returns {Array} 库存转移日志 + */ +export const Transferlog = useCrudSchemas(reactive([ + { + label: '日志号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '事务类型', + field: 'transactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '操作员', + field: 'worker', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'recordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '替代批次', + field: 'altBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货日期', + field: 'arriveDate', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '生产日期', + field: 'produceDate', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '失效日期', + field: 'expireDate', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '从事务号', + field: 'fomTransactionNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'fromBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库存状态', + field: 'fromInventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从ERP库位代码', + field: 'fromErpLocationCode', + dictType: DICT_TYPE.ERP_LOCATION, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到事务号', + field: 'toTransactionNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'toBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库存状态', + field: 'toInventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到ERP库位代码', + field: 'toErpLocationCode', + dictType: DICT_TYPE.ERP_LOCATION, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +/** + * @returns {Array} 标签定义 + */ +export const Labeltype = useCrudSchemas(reactive([ + { + label: '标签类型', + field: 'labelType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '描述', + field: 'description', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数据协议', + field: 'dataProtocol', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '拆分方法', + field: 'splitMehod', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数据头', + field: 'header', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '版本号', + field: 'version', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '分隔符', + field: 'separators', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '校验方法', + field: 'validateMethod', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '校验数', + field: 'validateNumber', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '加密方法', + field: 'encyptEthod', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '压缩方法', + field: 'compressMethod', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '模板名称', + field: 'templateName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '模板文件', + field: 'templateFile', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '标签代码', + field: 'labelCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否加密', + field: 'isEncypt', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '是否压缩', + field: 'isCompress', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, +])) + +/** + * @returns {Array} 条码片段 + */ +export const Barcode = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '描述', + field: 'description', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '顺序', + field: 'order', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '长度', + field: 'length', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '前缀长度', + field: 'prefixLenght', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '前缀字符', + field: 'prefixChar', + dictType: DICT_TYPE.BARCODE_PREFIX, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '实体属性', + field: 'entityProperties', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '加密方法', + field: 'encyptMethod', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '主表ID', + field: 'masterId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '截断尾部空格', + field: 'trimEnd', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '是否加密', + field: 'isEncypt', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, +])) + +/** + * @returns {Array} 采购订单主表 + */ +export const PurchaseMain = useCrudSchemas(reactive([ + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单类型', + field: 'type', + dictType: DICT_TYPE.PURCHASE_ORDER_TYPE, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.PURCHASE_ORDER_STATUS, + dictClass: 'string', + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单日期', + field: 'orderDate', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '截止日期', + field: 'dueDate', + isTable: true, + formatter: dateFormatter, + detail:{ + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '版本', + field: 'version', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '税率', + field: 'taxRate', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '联系人姓名', + field: 'contactName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '联系人电话', + field: 'contactPhone', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '联系人电子邮件', + field: 'contactEmail', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否寄存订单', + field: 'isConsignment', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '当前阶段', + field: 'currentStage', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + } +])) + +/** + * @returns {Array} 采购订单子表 + */ +export const PurchaseDetail = useCrudSchemas(reactive([ + { + label: '行号', + field: 'lineNumber' + }, + { + label: 'ERP库位', + field: 'erpLocationCode' + }, + { + label: '项目代码', + field: 'projectCode' + }, + { + label: '标包数量', + field: 'stdPackQty' + }, + { + label: '标包单位', + field: 'stdPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '供应商计量数量', + field: 'supplierQty' + }, + { + label: '供应商计量单位', + field: 'supplierUom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '转换率', + field: 'convertRate' + }, + { + label: '已发货数量', + field: 'shippedQty' + }, + { + label: '已收货数量', + field: 'receivedQty' + }, + { + label: '已退货数量', + field: 'returnedQty' + }, + { + label: '已上架数量', + field: 'putawayQty' + }, + { + label: '超收百分比', + field: 'overReceivingPercent' + }, + { + label: '单价', + field: 'singlePrice' + }, + { + label: '金额', + field: 'amount' + }, + { + label: '订单数量', + field: 'orderQty' + }, + { + lable: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '单据号', + field: 'nuumber' + }, + { + label: '物品代码', + field: 'itemCode' + }, + { + label: 'status', + field: '明细状态', + dictType: DICT_TYPE.PURCHASE_ORDER_DETAIL_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '备注', + fielc: 'remark' + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '创建者', + field: 'creator', + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '最后更新者', + field: 'updater', + }, + { + label: '最后更新时间', + field: 'updateTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + } +])) + +/** + * @returns {Array} 采购索赔申请主表 + */ +export const PurchaseclaimRequestMain = useCrudSchemas(reactive([ + { + label: '单据号', + field: 'number', + isForm:false, + table: { + width: 150 + } + }, + { + label: '发货单号', + field: 'asnNumber', + table: { + width: 150 + } + }, + { + label: '要货计划单号', + field: 'ppNumber', + form:{ + componentProps:{ + disabled:true, + } + }, + table: { + width: 150 + } + }, + { + label: '供应商代码', + field: 'supplierCode', + form:{ + componentProps:{ + disabled:true, + } + }, + table: { + width: 150 + } + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + value:'1', + componentProps:{ + disabled:true, + } + }, + table: { + width: 100 + } + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + } + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + } + }, + { + label: '部门', + field: 'departmentCode', + form: { + value:userDept.name, + componentProps:{ + disabled:true, + } + }, + table: { + width: 100 + } + }, + { + label: '业务类型', + field: 'businessType', + form:{ + value:'PurchaseClaim', + componentProps:{ + disabled:true, + } + }, + table: { + width: 130 + } + }, + { + label: '备注', + field: 'remark', + isTable: false + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 100 + }, + form:{ + component:'Switch', + value:requestsettingData.autoCommit, + componentProps:{ + disabled:true, + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 100 + }, + form:{ + component:'Switch', + value:requestsettingData.autoAgree, + componentProps:{ + disabled:true, + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoExecute', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 100 + }, + form:{ + component:'Switch', + value:requestsettingData.autoExecute, + componentProps:{ + disabled:true, + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: false, + isTable: true, + table: { + width: 120 + }, + form:{ + component:'Switch', + value:requestsettingData.available, + componentProps:{ + disabled:true, + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '创建者', + field: 'creator', + isForm:false, + table: { + width: 120 + } + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + formatter: dateFormatter, + isForm:false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + } + }, + { + label: '最后更新者', + field: 'updater', + isForm:false, + table: { + width: 120 + } + }, + { + label: '最后更新时间', + field: 'updateTime', + isTable: true, + formatter: dateFormatter, + isForm:false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + } + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 300 + } + } +])) +// 表单校验 +export const PurchaseclaimRequestMainRules = reactive({ + asnNumber: [ + { required: true, message: '请输入发货单号', trigger: 'blur' } + ], + ppNumber: [ + { required: true, message: '请输入要货计划单号', trigger: 'blur' } + ], + supplierCode: [ + { required: true, message: '请输入供应商代码', trigger: 'change' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请选择申请时间', trigger: 'change' } + ], + dueTime: [ + { required: true, message: '请选择截止时间', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请选择部门', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 采购索赔申请子表 + */ +export const PurchaseclaimRequestDetail = useCrudSchemas(reactive([ + { + label: '订单号', + field: 'poNumber', + tableForm:{ + isInpuFocusShow: true + }, + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + table: { + width: 150 + }, + }, + { + label: '替代批次', + field: 'altBatch', + table: { + width: 150 + }, + }, + { + label: '原因', + field: 'reason', + // dictType: DICT_TYPE.PURCHASE_RETURN_REASON, + dictClass: 'string', + table: { + width: 150 + }, + }, + { + label: '单价', + field: 'singlePrice', + table: { + width: 150 + }, + }, + { + label: '金额', + field: 'amount', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + table: { + width: 150 + }, + form:{ + componentProps:{ + disabled:true, + } + }, + isTableForm:false, + // tableForm:{ + // disabled:true, + // } + }, + { + label: '物品代码', + field: 'itemCode', + table: { + width: 150 + }, + + }, + { + label: '物品名称', + field: 'itemName', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + sort: 'custom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 120 + } , + }, + { + label: '备注', + field: 'remark', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + isTableForm:false, + table: { + width: 150 + }, + isForm:false + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + isTableForm:false, + table: { + width: 150 + }, + isForm:false + }, + { + label: '最后更新者', + field: 'updater', + isTableForm:false, + table: { + width: 150 + }, + isForm:false + }, + { + label: '最后更新时间', + field: 'updateTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + isTableForm:false, + table: { + width: 150 + }, + isForm:false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150, + fixed: 'right' + }, + isTableForm:false, + } +])) +// 表单校验 +export const PurchaseclaimRequestDetailRules = reactive({ + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + altBatch: [ + { required: true, message: '请输入替代批次', trigger: 'blur' } + ], + poNumber: [ + { required: true, message: '请输入订单号', trigger: 'change' } + ], + poLine: [ + { required: true, message: '请输入订单行', trigger: 'change' } + ], + singlePrice: [ + { required: true, message: '请输入单价', trigger: 'change' } + ], + amount: [ + { required: true, message: '请输入金额', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'change' } + ], + itemCode: [ + { required: true, message: '请输入物品代码', trigger: 'change' } + ], + projectCode: [ + { required: true, message: '请输入项目代码', trigger: 'change' } + ], + qty: [ + { required: true, message: '请输入数量', trigger: 'change' } + ], + uom: [ + { required: true, message: '请输入计量单位', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 采购索赔记录主表 + */ +export const PurchaseclaimRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber' + }, + { + label: '发货单号', + field: 'asnNumber' + }, + { + label: '要货计划单号', + field: 'ppNumber' + }, + { + label: '供应商代码', + field: 'supplierCode' + }, + { + label: '出库事务类型', + field: 'outTransactionType' + }, + { + label: '入库事务类型', + field: 'inTransactionType' + }, + { + label: '执行时间', + field: 'executeTime', + isTable: true, + formatter: dateFormatter, + deatil: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '生效日期', + field: 'activeDate', + isTable: true, + formatter: dateFormatter, + deatil: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '申请时间', + field: 'requestTime', + isTable: true, + formatter: dateFormatter, + deatil: { + dateFormatter: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '截止时间', + field: 'dueTime', + isTable: true, + formatter: dateFormatter, + deatil: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '部门', + field: 'departmentCode' + }, + { + label: '代码', + field: 'code' + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 150 + }, + form:{ + component:'Switch', + componentProps:{ + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '创建者', + field: 'creator', + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, +])) + +/** + * @returns {Array} 采购索赔记录子表 + */ + +export const PurchaseclaimRecordDetail = useCrudSchemas(reactive([ + { + label: '批次', + field: 'batch' + }, + { + label: '替代批次', + field: 'altBatch' + }, + { + label: '订单号', + field: 'poNumber' + }, + { + label: '订单行', + field: 'poLine' + }, + { + label: '原因', + field: 'reason', + isSearch: true, + isTable: true, + dictType: DICT_TYPE.PURCHASE_RETURN_REASON, + dictClass: 'string' + }, + { + label: '单价', + field: 'singlePrice' + }, + { + label: '金额', + field: 'amount' + }, + { + label: '单据号', + field: 'number' + }, + { + label: '代码', + field: 'code' + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '任务明细ID', + field: 'jobDetailId' + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 150 + }, + form:{ + component:'Switch', + componentProps:{ + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '创建者', + field: 'creator', + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, +])) + +/** + * @returns {Array} 供应商发票申请主表 + */ +export const SupplierinvoiceRequestMain = useCrudSchemas(reactive([ + { + label: '供应商代码', + field: 'supplierCode' + }, + { + label: '调增金额', + field: 'adjustAmount' + }, + { + label: '单据号', + field: 'number' + }, + { + label: 'businessType', + field: '业务类型' + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '部门', + field: 'departmentCode' + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '备注', + field: 'remark' + }, + { + label: '创建者', + field: 'creator', + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '最后更新者', + field: 'updater', + }, + { + label: '最后更新时间', + field: 'updateTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '自动执行', + field: 'autoExecute', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '跳过任务直接删生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true + } +])) + +/** + * @returns {Array} 供应商发票申请子表 + */ +export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive([ + { + label: '收货单号', + field: 'recordNumber' + }, + { + label: '货主代码', + field: 'ownerCode' + }, + { + label: '包装号', + field: 'packingNumber' + }, + { + label: '器具号', + field: 'containerNumber' + }, + { + label: '批次', + field: 'batch' + }, + { + label: '替代批次', + field: 'altBatch' + }, + { + label: '订单号', + field: 'poNumber' + }, + { + label: '订单行', + field: 'poLine' + }, + { + label: '标包数量', + field: 'stdPackQty' + }, + { + label: '标包单位', + field: 'stdPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '供应商计量数量', + field: 'supplierPackQty' + }, + { + label: '供应商计量单位', + field: 'supplierPackUnit', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '转换率', + field: 'convertRate' + }, + { + label: '单价', + field: 'singlePrice' + }, + { + label: '金额', + field: 'amount' + }, + { + label: '单据号', + field: 'number' + }, + { + label: '物品代码', + field: 'itemCode' + }, + { + label: '备注', + field: 'remark' + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '创建者', + field: 'creator' + }, +])) + +/** + * @returns {Array} 供应商发票记录主表 + */ +export const SupplierinvoiceRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber' + }, + { + label: '供应商代码', + field: 'supplierCode' + }, + { + label: '调增金额', + field: 'adjustAmount' + }, + { + label: '单据号', + field:'number' + }, + { + label: '业务类型', + field:'businessType' + }, + { + label: '出库事务类型', + field: 'outTransactionType' + }, + { + label: '入库事务类型', + field: 'inTransactionType' + }, + { + label: '执行时间', + field: 'executeTime', + isTable: true, + formatter: dateFormatter, + deatil: { + dateFormatter: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '生效日期', + field: 'activeDate', + isTable: true, + formatter: dateFormatter, + deatil: { + dateFormatter: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '申请时间', + field: 'requestTime', + isTable: true, + formatter: dateFormatter, + deatil: { + dateFormatter: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '截止时间', + field: 'dueTime', + isTable: true, + formatter: dateFormatter, + deatil: { + dateFormatter: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '部门', + field: 'departmentCode' + }, + { + label: '代码', + field: 'code' + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '创建者', + field: 'creator', + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, +])) + +/** + * @returns {Array} 供应商发票记录子表 + */ +export const SupplierinvoiceRecordDetail = useCrudSchemas(reactive([ + { + label: '收货单号', + field: 'recordNumber' + }, + { + label: '包装号', + field: 'packingNumber' + }, + { + label: '器具号', + field: 'containerNumber' + }, + { + label: '批次', + field: 'batch' + }, + { + label: '替代批次', + field: 'altBatch' + }, + { + label: '订单号', + field: 'poNumber' + }, + { + label: '订单行', + field: 'poLine' + }, + { + label: '标包数量', + field: 'stdPackQty' + }, + { + label: '标包单位', + field: 'stdPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '供应商计量数量', + field: 'supplierPackQty' + }, + { + label: '供应商计量单位', + field: 'supplierPackUnit', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '转换率', + field: 'convertRate' + }, + { + label: '单价', + field: 'singlePrice' + }, + { + label: '金额', + field: 'amount' + }, + { + label: '单据号', + field: 'number' + }, + { + label: '物品代码', + field: 'itemCode' + }, + { + label: '备注', + field: 'remark' + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '创建者', + field: 'creator' + }, + { + label: '物品名称', + field: 'itemName' + }, + { + label: '物品描述1', + field: 'itemDesc1' + }, + { + label: '物品描述2', + field: 'itemDesc2' + }, + { + label: '项目代码', + field: 'projectCode' + }, + { + label: '数量', + field: 'qty' + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '代码', + field: 'code' + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '任务明细ID', + field: 'jobDetailId' + }, +])) + +/** + * @returns {Array} 要货预测主表 + */ +export const DemandforecastingMain = useCrudSchemas(reactive([ + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '版本号', + field: 'version', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发布时间', + field: 'publishTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '开始时间', + field: 'beginTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '结束时间', + field: 'endTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, +])) + +//表单校验 +export const DemandforecastingMainRules = reactive({ + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 要货预测子表 + */ +export const DemandforecastingDetail = useCrudSchemas(reactive([ + { + label: '预测时间类型', + field: 'predictTimeType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '预测日期', + field: 'predictTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计划数量', + field: 'planQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + } +])) + +//表单校验 +export const DemandforecastingDetailRules = reactive({ + predictTimeType: [ + { required: true, message: '请选择预测时间类型', trigger: 'change' } + ], + predictTime: [ + { required: true, message: '请输入预测时间', trigger: 'change' } + ], + planQty: [ + { required: true, message: '请输入计划数量', trigger: 'blur' } + ], + uom: [ + { required: true, message: '请选择计量单位', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'change' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 要货计划主表 + */ +export const PurchasePlanMain = useCrudSchemas(reactive([ + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '时间窗口', + field: 'timeWindow', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '月台代码', + field: 'dockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '开始时间', + field: 'beginTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '结束时间', + field: 'endTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + } +])) + +//表单校验 +export const PurchasePlanMainRules = reactive({ + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 要货计划子表 + */ +export const PurchasePlanDetail = useCrudSchemas(reactive([ + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '已发货数量', + field: 'shippedQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '计划数量', + field: 'planQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + }, + { + label: '计量单位', + field: 'uom', + sort: 'custom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 150 + } + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '最后更新时间', + field: 'updateTime', + sort: 'custom', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const PurchasePlanDetailRules = reactive({ + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + poNumber: [ + { required: true, message: '请选择采购订单号', trigger: 'change' } + ], + shippedQty: [ + { required: true, message: '请输入已发货数量', trigger: 'blur' } + ], + uom: [ + { required: true, message: '请选择计量单位', trigger: 'change' } + ], + planQty: [ + { required: true, message: '请输入计划数量', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 供应商发货申请主表 + */ +export const SupplierdeliverRequestMain = useCrudSchemas(reactive([ + { + label: '要货计划单号', + field: 'ppNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货单号', + field: 'asnNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '联系人姓名', + field: 'contactName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '联系人电话', + field: 'contactPhone', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '联系人电子邮件', + field: 'contactEmail', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到月台代码', + field: 'toDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '时间窗口', + field: 'timeWindow', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计划到货时间', + field: 'planArriveTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detaul: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detaul: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoExecute', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + } +])) + +//表单校验 +export const SupplierdeliverRequestMainRules = reactive({ + supplierCode: [ + { required: true, message: '请输入供应商代码', trigger: 'blur' } + ], + fromWarehouseCode: [ + { required: true, message: '请输入从仓库代码', trigger: 'blur' } + ], + toWarehouseCode: [ + { required: true, message: '请输入到仓库代码', trigger: 'blur' } + ], + toDockCode: [ + { required: true, message: '请输入到月台代码', trigger: 'change' } + ], + planArriveTime: [ + { required: true, message: '请输入计划到货时间', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 供应商发货申请子表 + */ +export const SupplierdeliverRequestDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '替代批次', + field: 'altBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货日期', + field: 'produceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生产日期', + field: 'expireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '过期日期', + field: 'expireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '标包数量', + field: 'stdPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '标包单位', + field: 'stdPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商计量数量', + field: 'supplierPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '供应商计量单位', + field: 'supplierPackUnit', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '转换率', + field: 'convertRate', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const SupplierdeliverRequestDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请输入包装号', trigger: 'blur' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + produceDate: [ + { required: true, message: '请输入生产日期', trigger: 'blur' } + ], + expireDate: [ + { required: true, message: '请输入过期日期', trigger: 'blur' } + ], + stdPackQty: [ + { required: true, message: '请输入标包数量', trigger: 'blur' } + ], + poNumber: [ + { required: true, message: '请输入订单号', trigger: 'blur' } + ], + poLine: [ + { required: true, message: '请输入订单行', trigger: 'blur' } + ], + stdPackUnit: [ + { required: true, message: '请选择标包单位', trigger: 'change' } + ], + convertRate: [ + { required: true, message: '请输入转换率', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物品代码', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 供应商发货记录主表 + */ +export const SupplierdeliverRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '要货计划单号', + field: 'ppNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货单号', + field: 'asnNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '联系人姓名', + field: 'contactName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '联系人电话', + field: 'contactPhone', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '联系人电子邮件', + field: 'contactEmail', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到月台代码', + field: 'toDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '时间窗口', + field: 'timeWindow', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计划到货时间', + field: 'planArriveTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransaction', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransaction', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const SupplierdeliverRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请输入申请单号', trigger: 'blur' } + ], + supplierCode: [ + { required: true, message: '请输入供应商代码', trigger: 'blur' } + ], + fromWarehouseCode: [ + { required: true, message: '请输入从仓库代码', trigger: 'blur' } + ], + toWarehouseCode: [ + { required: true, message: '请输入到仓库代码', trigger: 'blur' } + ], + toDockCode: [ + { required: true, message: '请输入到月台代码', trigger: 'blur' } + ], + planArriveTime: [ + { required: true, message: '请输入计划到货时间', trigger: 'blur' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'blur' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'blur' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 供应商发货记录子表 + */ +export const SupplierdeliverRecordDetail = useCrudSchemas(reactive([ + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'fromBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'toBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '替代批次', + field: 'altBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货日期', + field: 'arriveDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生产日期', + field: 'produceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '过期日期', + field: 'expireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '标包数量', + field: 'stdPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '标包单位', + field: 'stdPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商计量数量', + field: 'supplierQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '供应商计量单位', + field: 'supplierUom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const SupplierdeliverRecordDetailRules = reactive({ + fromPackingNumber: [ + { required: true, message: '请输入从包装号', trigger: 'blur' } + ], + toPackingNumber: [ + { required: true, message: '请输入到包装号', trigger: 'blur' } + ], + fromBatch: [ + { required: true, message: '请输入从批次', trigger: 'blur' } + ], + toBatch: [ + { required: true, message: '请输入到批次', trigger: 'blur' } + ], + arriveDate: [ + { required: true, message: '请输入到货日期', trigger: 'blur' } + ], + produceDate: [ + { required: true, message: '请输入生产日期', trigger: 'blur' } + ], + expireDate: [ + { required: true, message: '请输入到货日期', trigger: 'blur' } + ], + poNumber: [ + { required: true, message: '请输入订单号', trigger: 'blur' } + ], + poLine: [ + { required: true, message: '请输入订单行', trigger: 'blur' } + ], + stdPackQty: [ + { required: true, message: '请输入标包数量', trigger: 'blur' } + ], + stdPackUnit: [ + { required: true, message: '请选择标包单位', trigger: 'blur' } + ], + toLocationCode: [ + { required: true, message: '请输入到库位代码', trigger: 'blur' } + ], + toLocationGroupCode: [ + { required: true, message: '请输入到库位组代码', trigger: 'change' } + ], + toAreaCode: [ + { required: true, message: '请输入到库区代码', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物品代码', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 采购收货申请主表 + */ +export const PurchasereceiptRequestMain = useCrudSchemas(reactive([ + { + label: '发货单号', + field: 'asnNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '要货计划单号', + field: 'ppNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到月台代码', + field: 'toDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoExecute', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const PurchasereceiptRequestMainRules = reactive({ + supplierCode: [ + { required: true, message: '请输入供应商代码', trigger: 'blur' } + ], + toWarehouseCode: [ + { required: true, message: '请输入到仓库代码', trigger: 'blur' } + ], + toLocationTypes: [ + { required: true, message: '请输入到库位类型范围', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], + +}) + +/** + * @returns {Array} 采购收货申请子表 + */ +export const PurchasereceiptRequestDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '替代批次', + field: 'altBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货日期', + field: 'arriveDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生产日期', + field: 'produceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '过期日期', + field: 'expireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '标包数量', + field: 'stdPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '标包单位', + field: 'stdPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商计量数量', + field: 'supplierPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '供应商计量单位', + field: 'supplierPackUnit', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '转换率', + field: 'convertRate', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + } +])) + +//表单校验 +export const PurchasereceiptRequestDetailRuels = reactive({ + packingNumber: [ + { required: true, message: '请输入包装号', trigger: 'blur' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + produceDate: [ + { required: true, message: '请输入生产日期', trigger: 'blur' } + ], + arriveDate: [ + { required: true, message: '请输入到货日期', trigger: 'blur' } + ], + expireDate: [ + { required: true, message: '请输入过期日期', trigger: 'blur' } + ], + stdPackQty: [ + { required: true, message: '请输入标包数量', trigger: 'blur' } + ], + poNumber: [ + { required: true, message: '请输入订单号', trigger: 'blur' } + ], + poLine: [ + { required: true, message: '请输入订单行', trigger: 'blur' } + ], + stdPackUnit: [ + { required: true, message: '请选择标包单位', trigger: 'change' } + ], + convertRate: [ + { required: true, message: '请输入转换率', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物品代码', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 采购收货任务主表 + */ +export const PurchasereceiptJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货单号', + field: 'asnNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '要货计划单号', + field: 'ppNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到月台代码', + field: 'toDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + sort: 'custom', + table: { + width: 180 + }, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + sort: 'custom', + table: { + width: 180 + }, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '岗位', + field: 'userPositionCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 180 + }, + } +])) + +//表单校验 +export const PurchasereceiptJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + supplierCode: [ + { required: true, message: '请选择供应商代码', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 采购收货任务子表 + */ +export const PurchasereceiptJobDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '替代批次', + field: 'altBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货日期', + field: 'arriveDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生产日期', + field: 'produceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '过期日期', + field: 'expireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '标包数量', + field: 'stdPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '标包单位', + field: 'stdPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商计量数量', + field: 'supplierQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '供应商计量单位', + field: 'supplierUom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '转换率', + field: 'convertRate', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + fiield: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, +])) + +//表单校验 +export const PurchasereceiptJobDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + arriveDate: [ + { required: true, message: '请输入到货日期', trigger: 'change' } + ], + produceDate: [ + { required: true, message: '请输入生产日期', trigger: 'change' } + ], + expireDate: [ + { required: true, message: '请输入过期日期', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + poNumber: [ + { required: true, message: '请选择订单号', trigger: 'change' } + ], + poLine: [ + { required: true, message: '请输入订单行', trigger: 'blur' } + ], + stdPackQty: [ + { required: true, message: '请输入标包数量', trigger: 'blur' } + ], + stdPackUnit: [ + { required: true, message: '请选择标包单位', trigger: 'change' } + ], + convertRate: [ + { required: true, message: '请输入转换率', trigger: 'blur' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 采购收货记录主表 + */ +export const PurchasereceiptRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货单号', + field: 'asnNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '要货计划单号', + field: 'ppNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到月台代码', + field: 'toDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransaction', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransaction', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + } +])) + +/** + * @returns {Array} 采购收货记录子表 + */ +export const PurchasereceiptRecordDetail = useCrudSchemas(reactive([ + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'fromBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'toBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '替代批次', + field: 'altBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货日期', + field: 'arriveDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生产日期', + field: 'produceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '过期日期', + field: 'expireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '标包数量', + field: 'stdPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '标包单位', + field: 'stdPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商计量数量', + field: 'supplierQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '供应商计量单位', + field: 'supplierUom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '转换率', + field: 'convertRate', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '目检结果', + field: 'visualInspectResult', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '目检照片', + field: 'visualInspectPhotos', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '不合格原因', + field: 'failedReason', + dictType: DICT_TYPE.PURCHASE_RETURN_REASON, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单价', + field: 'singlePrice', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '金额', + field: 'amount', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + } +])) + +/** + * @returns {Array} 采购退货申请主表 + */ +export const PurchasereturnRequestMain = useCrudSchemas(reactive([ + { + label: '采购收货记录单号', + field: 'purchaseReceiptRecordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货单号', + field: 'asnNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '要货计划单号', + field: 'ppNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从月台代码', + field: 'fromDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoExecute', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const PurchasereturnRequestMainRules = reactive({ + supplierCode: [ + { required: true, message: '请输入供应商代码', trigger: 'blur' } + ], + fromWarehouseCode: [ + { required: true, message: '请输入从仓库代码', trigger: 'blur' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 采购退货申请子表 + */ +export const PurchasereturnRequestDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '替代批次', + field: 'altBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '原因', + field: 'reason', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + } +])) + +//表单校验 +export const PurchasereturnRequestDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请输入包装号', trigger: 'blur' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + poNumber: [ + { required: true, message: '请输入订单号', trigger: 'blur' } + ], + poLine: [ + { required: true, message: '请输入订单行', trigger: 'blur' } + ], + reason: [ + { required: true, message: '请选择原因', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物品代码', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 采购退货任务主表 + */ +export const PurchasereturnJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '采购收货记录单号', + field: 'purchaseReceiptRecordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货单号', + field: 'asnNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '要货计划单号', + field: 'ppNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货月台', + field: 'deliverDock', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从月台代码', + field: 'fromDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + } +])) + +//表单校验 +export const PurchasereturnJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + supplierCode: [ + { required: true, message: '请选择供应商代码', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 采购退货任务子表 + */ +export const PurchasereturnJobDetail = useCrudSchemas(reactive([ + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '替代批次', + field: 'altBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '原因', + field: 'reason', + dictType: DICT_TYPE.PURCHASE_RETURN_REASON, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + } +])) + +//表单校验 +export const PurchasereturnJobDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + poNumber: [ + { required: true, message: '请选择订单号', trigger: 'change' } + ], + poLine: [ + { required: true, message: '请输入订单行', trigger: 'blur' } + ], + reason: [ + { required: true, message: '请选择原因', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 采购退货记录主表 + */ +export const PurchasereturnRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '采购收货记录单号', + field: 'purchaseReceiptRecordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货单号', + field: 'asnNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '要货计划单号', + field: 'ppNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从月台代码', + field: 'fromDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'available', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + } +])) + +//表单校验 +export const PurchasereturnRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + supplierCode: [ + { required: true, message: '请选择供应商代码', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请选择创建时间', trigger: 'change' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 采购退货记录子表 + */ +export const PurchasereturnRecordDetail = useCrudSchemas(reactive([ + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'fromBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'toBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '替代批次', + field: 'altBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poline', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '原因', + field: 'reason', + dictType: DICT_TYPE.PURCHASE_RETURN_REASON, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单价', + field: 'singlePrice', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '金额', + field: 'amount', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const PurchasereturnRecordDetailRules = reactive({ + fromPackingNumber: [ + { required: true, message: '请选择从包装号', trigger: 'change' } + ], + toPackingNumber: [ + { required: true, message: '请选择到包装号', trigger: 'change' } + ], + fromBatch: [ + { required: true, message: '请输入从批次', trigger: 'blur' } + ], + toBatch: [ + { required: true, message: '请输入到批次', trigger: 'blur' } + ], + reason: [ + { required: true, message: '请选择原因', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + poNumber: [ + { required: true, message: '请选择订单号', trigger: 'change' } + ], + poline: [ + { required: true, message: '请选择订单行', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 检验申请主表 + */ +export const InspectRequestMain = useCrudSchemas(reactive([ + { + label: '采购收货记录单号', + field: 'purchaseReceiptRecordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemcode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '检验类型', + field: 'inspectType', + dictType: DICT_TYPE.INSPECT_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '下一步检验动作', + field: 'nextAction', + dictType: DICT_TYPE.NEXT_ACTION, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '抽检方式', + field: 'sampleMethod', + dictType: DICT_TYPE.SAMPLE_METHOD, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '收货数量', + field: 'receiveQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '样品数量', + field: 'sampleQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoExecute', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const InspectRequestMainRules = reactive({ + purchaseReceiptRecordNumber: [ + { required: true, message: '请输入采购收货记录单号', trigger: 'blur' } + ], + supplierCode: [ + { required: true, message: '请输入供应商代码', trigger: 'blur' } + ], + fromWarehouseCode: [ + { required: true, message: '请输入从仓库代码', trigger: 'blur' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + poNumber: [ + { required: true, message: '请输入订单号', trigger: 'blur' } + ], + poLine: [ + { required: true, message: '请输入订单行', trigger: 'blur' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inspectType: [ + { required: true, message: '请选择检验类型', trigger: 'change' } + ], + nextAction: [ + { required: true, message: '请选择下一步检验动作', trigger: 'change' } + ], + receiveQty: [ + { required: true, message: '请输入收货数量', trigger: 'blur' } + ], + sampleQty: [ + { required: true, message: '请输入样品数量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 检验申请子表 + */ +export const InspectRequestDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + } +])) + +//表单校验 +export const InspectRequestDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请输入包装号', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请输入库位代码', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物品代码', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 检验任务主表 + */ +export const InspectJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '采购收货记录单号', + field: 'purchaseReceiptRecordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'update', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人用户名', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人用户名', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '检验类型', + field: 'inspectType', + dictType: DICT_TYPE.INSPECT_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '下一步检验动作', + field: 'nextAction', + dictType: DICT_TYPE.NEXT_ACTION, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '抽检方式', + field: 'sampleMethod', + dictType: DICT_TYPE.SAMPLE_METHOD, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '收货数量', + field: 'receiveQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '样品数量', + field: 'sampleQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '货主代码', + field: 'owner', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const InspectJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + purchaseReceiptRecordNumber: [ + { required: true, message: '请输入选择采购收货记录单号', trigger: 'change' } + ], + supplierCode: [ + { required: true, message: '请选择供应商代码', trigger: 'change' } + ], + warehouseCode: [ + { required: true, message: '请选择仓库代码', trigger: 'change' } + ], + poNumber: [ + { required: true, message: '请选择订单号', trigger: 'change' } + ], + poLine: [ + { required: true, message: '请选择订单行', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inspectType: [ + { required: true, message: '请选择检验类型', trigger: 'change' } + ], + nextAction: [ + { required: true, message: '请选择下一步检验动作', trigger: 'change' } + ], + receiveQty: [ + { required: true, message: '请输入收货数量', trigger: 'blur' } + ], + sampleQty: [ + { required: true, message: '请输入样品数量', trigger: 'blur' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 检验任务子表 + */ +export const InspectJobDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const InspectJobDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 检验记录主表 + */ +export const InspectRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '采购收货记录单号', + field: 'purchaseReceiptRecordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter : dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter : dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter : dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter : dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + isSearch: true, + isTable: true, + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter : dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '检验类型', + field: 'inspectType', + isSearch: true, + isTable: true, + dictType: DICT_TYPE.INSPECT_TYPE, + dictClass: 'string', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '下一步检验动作', + field: 'nextAction', + isSearch: true, + isTable: true, + dictType: DICT_TYPE.NEXT_ACTION, + dictClass: 'string', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '抽检方式', + field: 'sampleMethod', + isSearch: true, + isTable: true, + dictType: DICT_TYPE.SAMPLE_METHOD, + dictClass: 'string', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + isSearch: true, + isTable: true, + dictType: DICT_TYPE.UOM, + dictClass: 'string', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '收货数量', + field: 'receiveQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '样品数量', + field: 'sampleQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '合格数量', + field: 'batchGoodQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '不合格数量', + field: 'batchFaildQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '破坏数量', + field: 'batchCrackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '最终不合格数量', + field: 'batchNotPassedQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + isSearch: true, + isTable: true, + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + isSearch: true, + isTable: true, + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const InspectRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + purchaseReceiptRecordNumber: [ + { required: true, message: '请选择采购收货记录单号', trigger: 'change' } + ], + supplierCode: [ + { required: true, message: '请选择供应商代码', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + poNumber: [ + { required: true, message: '请选择订单号', trigger: 'change' } + ], + poLine: [ + { required: true, message: '请选择订单行', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inspectType: [ + { required: true, message: '请选择检验类型', trigger: 'change' } + ], + nextAction: [ + { required: true, message: '请选择下一步检验动作', trigger: 'change' } + ], + receiveQty: [ + { required: true, message: '请选择收货数量', trigger: 'blur' } + ], + sampleQty: [ + { required: true, message: '请输入样品数量', trigger: 'blur' } + ], + batchGoodQty: [ + { required: true, message: '请输入合格数量', trigger: 'blur' } + ], + batchFaildQty: [ + { required: true, message: '请输入不合格数量', trigger: 'blur' } + ], + batchCrackQty: [ + { required: true, message: '请输入破坏数量', trigger: 'blur' } + ], + batchNotPassedQty: [ + { required: true, message: '请输入最终不合格数量', trigger: 'blur' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 检验记录子表 + */ +export const InspectRecordDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '样品数量', + field: 'sampleQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '合格数量', + field: 'goodQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '不合格数量', + field: 'failedQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '破坏数量', + field: 'crackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '最终不合格数量', + field: 'notPassedQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '不合格原因', + field: 'failedReason', + dictType: DICT_TYPE.INSPECT_FAILED_REASON, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '异常照片', + field: 'photos', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '检验人', + field: 'inspectUser', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '检验结果', + field: 'inspectResult', + dictType: DICT_TYPE.INSPECT_RESULT, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '外观', + field: 'appearance', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '尺寸', + field: 'volume', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '重量', + field: 'weight', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '其他属性', + field: 'otherProperties', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'creationTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const InspectRecordDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + sampleQty: [ + { required: true, message: '请输入样品数量', trigger: 'blur' } + ], + goodQty: [ + { required: true, message: '请输入合格数量', trigger: 'blur' } + ], + failedQty: [ + { required: true, message: '请输入不合格数量', trigger: 'blur' } + ], + crackQty: [ + { required: true, message: '请输入破坏数量', trigger: 'blur' } + ], + notPassedQty: [ + { required: true, message: '请输入最终不合格数量', trigger: 'blur' } + ], + inspectResult: [ + { required: true, message: '请选择检验结果', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 上架申请主表 + */ +export const PutawayRequestMain = useCrudSchemas(reactive([ + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const PutawayRequestMainRules = reactive({ + fromWarehouseCode: [ + { required: true, message: '请输入从仓库代码', trigger: 'blur' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请输入到仓库代码', trigger: 'blur' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 上架申请子表 + */ +export const PutawayRequestDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const PutawayRequestDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请输入包装号', trigger: 'blur' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请输入从库位代码', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物品代码', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 上架任务主表 + */ +export const PutawayJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'update', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人用户名', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人用户名', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const PutawayJobMainRulee = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 上架任务子表 + */ +export const PutawayJobDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemdesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const PutawayJobDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 上架记录主表 + */ +export const PutawayRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const PutawayRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 上架记录子表 + */ +export const PutawayRecordDetail = useCrudSchemas(reactive([ + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'fromBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'toBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const PutawayRecordDetailRules = reactive({ + fromPackingNumber: [ + { required: true, message: '请选择从包装号', trigger: 'change' } + ], + toPackingNumber: [ + { required: true, message: '请选择到包装号', trigger: 'change' } + ], + fromBatch: [ + { required: true, message: '请输入从批次', trigger: 'blur' } + ], + toBatch: [ + { required: true, message: '请输入到批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + toLocationGroupCode: [ + { required: true, message: '请选择到库位组代码', trigger: 'change' } + ], + toAreaCode: [ + { required: true, message: '请选择到库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 备料计划主表 + */ +export const PreparetoissueMain = useCrudSchemas(reactive([ + { + label: '生产计划单号', + field: 'productionPlanNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车间', + field: 'workshop', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产线', + field: 'prodLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班次', + field: 'shift', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班组', + field: 'team', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计划日期', + field: 'planDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '开始时间', + field: 'beginTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '结束时间', + field: 'endTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const PreparetoissueMainRules = reactive({ + workshop: [ + { required: true, message: '请选择车间', trigger: 'change' } + ], + prodLine: [ + { required: true, message: '请选择生产线', trigger: 'change' } + ], + shift: [ + { required: true, message: '请选择班次', trigger: 'change' } + ], + team: [ + { required: true, message: '请选择班组', trigger: 'change' } + ], + planDate: [ + { required: true, message: '请输入计划日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 备料计划子表 + */ +export const PreparetoissueDetail = useCrudSchemas(reactive([ + { + label: '目标库位', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工位', + field: 'workStation', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计划数量', + field: 'planQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const PreparetoissueDetailRules = reactive({ + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + uom: [ + { required: true, message: '请选择计量单位', trigger: 'change' } + ], + planQty: [ + { required: true, message: '请输入计划数量', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 补料申请主表 + */ +export const RepleinshRequestMain = useCrudSchemas(reactive([ + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const RepleinshRequestMainRules = reactive({ + fromWarehouseCode: [ + { required: true, message: '请输入从仓库代码', trigger: 'blur' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请输入到仓库代码', trigger: 'blur' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 补料申请子表 + */ +export const RepleinshRequestDetail = useCrudSchemas(reactive([ + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const RepleinshRequestDetailRules = reactive({ + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请输入到库位代码', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物品代码', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 补料任务主表 + */ +export const RepleinshJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'update', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人用户名', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人用户名', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const RepleinshJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 补料任务子表 + */ +export const RepleinshJobDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemdesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const RepleinshJobDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 补料记录主表 + */ +export const RepleinshRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const RepleinshRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 补料记录子表 + */ +export const RepleinshRecordDetail = useCrudSchemas(reactive([ + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'fromBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'toBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const RepleinshRecordDetailRules = reactive({ + fromPackingNumber: [ + { required: true, message: '请选择从包装号', trigger: 'change' } + ], + toPackingNumber: [ + { required: true, message: '请选择到包装号', trigger: 'change' } + ], + fromBatch: [ + { required: true, message: '请输入从批次', trigger: 'blur' } + ], + toBatch: [ + { required: true, message: '请输入到批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + toLocationGroupCode: [ + { required: true, message: '请选择到库位组代码', trigger: 'change' } + ], + toAreaCode: [ + { required: true, message: '请选择到库区代码', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 拣料申请主表 + */ +export const PickRequestMain = useCrudSchemas(reactive([ + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const PickRequestMainRules = reactive({ + fromWarehouseCode: [ + { required: true, message: '请输入从仓库代码', trigger: 'blur' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请输入到仓库代码', trigger: 'blur' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 拣料申请子表 + */ +export const PickRequestDetail = useCrudSchemas(reactive([ + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const PickRequestDetailRules = reactive({ + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请输入到库位代码', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物品代码', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 拣料任务主表 + */ +export const PickJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'update', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人用户名', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人用户名', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const PickJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 拣料任务子表 + */ +export const PickJobDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemdesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const PickJobDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 拣料记录主表 + */ +export const PickRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const PickRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 拣料记录子表 + */ +export const PickRecordDetail = useCrudSchemas(reactive([ + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'fromBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'toBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const PickRecordDetailRules = reactive({ + fromPackingNumber: [ + { required: true, message: '请选择从包装号', trigger: 'change' } + ], + toPackingNumber: [ + { required: true, message: '请选择到包装号', trigger: 'change' } + ], + fromBatch: [ + { required: true, message: '请输入从批次', trigger: 'blur' } + ], + toBatch: [ + { required: true, message: '请输入到批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + toLocationGroupCode: [ + { required: true, message: '请选择到库位组代码', trigger: 'change' } + ], + toAreaCode: [ + { required: true, message: '请选择到库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 发料申请主表 + */ +export const IssueRequestMain = useCrudSchemas(reactive([ + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '使用在途库', + field: 'useOnTheWayLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +export const IssueRequestMainRules = reactive({ + fromWarehouseCode: [ + { required: true, message: '请输入从仓库代码', trigger: 'blur' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请输入到仓库代码', trigger: 'blur' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 发料申请子表 + */ +export const IssueRequestDetail = useCrudSchemas(reactive([ + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工位代码', + field: 'workStationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const IssueRequestDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请输入包装号', trigger: 'blur' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请输入到库位代码', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物品代码', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 发料任务主表 + */ +export const IssueJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车间代码', + field: 'workShopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'update', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人用户名', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人用户名', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '使用在途库', + field: 'useOnTheWayLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const IssueJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 发料任务子表 + */ +export const IssueJobDetail = useCrudSchemas(reactive([ + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工位代码', + field: 'workStationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '在途库库位', + field: 'onTheWayLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemmDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '标包数量', + field: 'stdPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '标包单位', + field: 'stdPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商计量数量', + field: 'supplierQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '供应商计量单位', + field: 'supplierUom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const IssueJobDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 发料记录主表 + */ +export const IssueRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '使用在途库', + field: 'useOnTheWayLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const IssueRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择库位类型范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 发料记录子表 + */ +export const IssueRecordDetail = useCrudSchemas(reactive([ + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工位代码', + field: 'workStationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '在途库库位', + field: 'onTheWayLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'fromBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'toBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const IssueRecordDetailRules = reactive({ + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromPackingNumber: [ + { required: true, message: '请选择从包装号', trigger: 'change' } + ], + fromBatch: [ + { required: true, message: '请输入从批次', trigger: 'blur' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + toPackingNumber: [ + { required: true, message: '请选择到包装号', trigger: 'change' } + ], + toBatch: [ + { required: true, message: '请输入到批次', trigger: 'blur' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + toLocationGroupCode: [ + { required: true, message: '请选择到库位组代码', trigger: 'change' } + ], + toAreaCode: [ + { required: true, message: '请选择到库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 生产收料任务主表 + */ +export const ProductionreceiptJobMain = useCrudSchemas(reactive([ + { + label: '发料任务单号', + field: 'issueJobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'update', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '使用在途库', + field: 'useOnTheWayLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductionreceiptJobMainRules = reactive({ + issueJobNumber: [ + { required: true, message: '请选择发料任务单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 生产收料任务子表 + */ +export const ProductionreceiptJobDetail = useCrudSchemas(reactive([ + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工位代码', + field: 'workStationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '在途库库位', + field: 'onTheWayLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formater: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const ProductionreceiptJobDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 生产收料记录主表 + */ +export const ProductionreceiptRecordMain = useCrudSchemas(reactive([ + { + label: '发料任务单号', + field: 'issueJobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detai: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detai: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detai: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detai: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detai: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '使用在途库', + field: 'useOnTheWayLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + } +])) + +//表单校验 +export const ProductionreceiptRecordMainRules = reactive({ + issueJobNumber: [ + { required: true, message: '请选择发料任务单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 生产收料记录子表 + */ +export const ProductionreceiptRecordDetail = useCrudSchemas(reactive([ + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工位代码', + field: 'workStationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '在途库库位', + field: 'onTheWayLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'fromBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'toBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const ProductionreceiptRecordDetailRules = reactive({ + fromPackingNumber: [ + { required: true, message: '请选择从包装号', trigger: 'change' } + ], + toPackingNumber: [ + { required: true, message: '请选择到包装号', trigger: 'change' } + ], + fromBatch: [ + { required: true, message: '请输入从批次', trigger: 'blur' } + ], + toBatch: [ + { required: true, message: '请输入到批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请输入到库位代码', trigger: 'change' } + ], + toLocationGroupCode: [ + { required: true, message: '请选择到库位组代码', trigger: 'change' } + ], + toAreaCode: [ + { required: true, message: '请选择到库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 上线结算申请主表 + */ +export const OnlinesettlementRequestMain = useCrudSchemas(reactive([ + { + label: '发料记录单号', + field: 'issueRecordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoExecute', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const OnlinesettlementRequestMainRules = reactive({ + issueRecordNumber: [ + { required: true, message: '请输入发料记录单号', trigger: 'blur' } + ], + warehouseCode: [ + { required: true, message: '请输入仓库代码', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 上线结算申请子表 + */ +export const OnlinesettlementRequestDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const OnlinesettlementRequestDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + locationCode: [ + { required: true, message: '请选择库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 上线结算记录主表 + */ +export const OnlinesettlementRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发料记录单号', + field: 'issueRecordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const OnlinesettlementRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + issueRecordNumber: [ + { required: true, message: '请选择发料记录单号', trigger: 'change' } + ], + warehouseCode: [ + { required: true, message: '请选择仓库代码', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 上线结算记录子表 + */ +export const OnlinesettlementRecordDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位组代码', + field: 'locationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库区代码', + field: 'areaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const OnlinesettlementRecordDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + locationCode: [ + { required: true, message: '请选择库位代码', trigger: 'change' } + ], + locationGroupCode: [ + { required: true, message: '请选择库位组代码', trigger: 'change' } + ], + areaCode: [ + { required: true, message: '请选择库区代码', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 生产退料申请主表 + */ +export const ProductionreturnRequestMain = useCrudSchemas(reactive([ + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoExecute', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductionreturnRequestMainRules = reactive({ + fromWarehouseCode: [ + { required: true, message: '请输入从仓库代码', trigger: 'blur' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请输入到仓库代码', trigger: 'blur' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 生产退料申请子表 + */ +export const ProductionreturnRequestDetail = useCrudSchemas(reactive([ + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工位代码', + field: 'workStationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + } +])) + +//表单校验 +export const ProductionreturnRequestDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请输入包装号', trigger: 'blur' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请输入从库位代码', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物品代码', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 生产退料任务主表 + */ +export const ProductionreturnJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductionreturnJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 生产退料任务子表 + */ +export const ProductionreturnJobDetail = useCrudSchemas(reactive([ + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工位代码', + field: 'workStationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const ProductionreturnJobDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 生产退料记录主表 + */ +export const ProductionreturnRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductionreturnRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 生产退料记录子表 + */ +export const ProductionreturnRecordDetail = useCrudSchemas(reactive([ + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工位代码', + field: 'workStationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从包装号', + field: 'frompackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromcontainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'frombatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromlocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromlocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromareaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'topackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'tocontainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'tobatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const ProductionreturnRecordDetailRules = reactive({ + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + frompackingNumber: [ + { required: true, message: '请选择从包装号', trigger: 'change' } + ], + frombatch: [ + { required: true, message: '请输入从批次', trigger: 'change' } + ], + fromlocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromlocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromareaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + topackingNumber: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + tobatch: [ + { required: true, message: '请输入到批次', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + toLocationGroupCode: [ + { required: true, message: '请选择到库位组代码', trigger: 'change' } + ], + toAreaCode: [ + { required: true, message: '请选择到库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 生产订单主表 + */ +export const WorkMain = useCrudSchemas(reactive([ + { + label: '供应商代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单类型', + field: 'type', + dictType: DICT_TYPE.WORK_ORDER_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单日期', + field: 'orderDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止日期', + field: 'dueDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '版本', + field: 'version', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '当前阶段', + field: 'currentStage', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true + }, +])) + +//表单校验 +export const WorkMainRules = reactive({ + customerCode: [ + { required: true, message: '请选择客户代码', trigger: 'change' } + ], + type: [ + { required: true, message: '请选择订单类型', trigger: 'change' } + ], + orderDate: [ + { required: true, message: '请输入订单日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 生产订单子表 + */ +export const WorkDetail = useCrudSchemas(reactive([ + { + label: '行号', + field: 'lineNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完工数量', + field: 'finishedQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单数量', + field: 'orderQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const WorkDetailRules = reactive({ + lineNumber: [ + { required: true, message: '请输入行号', trigger: 'change' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + uom: [ + { required: true, message: '请选择计量单位', trigger: 'change' } + ], + planQty: [ + { required: true, message: '请输入计划数量', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 生产计划主表 + */ +export const ProductionMain = useCrudSchemas(reactive([ + { + label: '顺序', + field: 'displayOrder', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车间', + field: 'workshop', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产线', + field: 'productionLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班次', + field: 'shift', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班组', + field: 'team', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计划日期', + field: 'planDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remrk', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '开始时间', + field: 'beginTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '结束时间', + field: 'endTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductionMainRules = reactive({ + displayOrder: [ + { required: true, message: '请输入顺序', trigger: 'blur' } + ], + workshop: [ + { required: true, message: '请选择车间', trigger: 'change' } + ], + productionLine: [ + { required: true, message: '请选择生产线', trigger: 'change' } + ], + shift: [ + { required: true, message: '请选择班次', trigger: 'change' } + ], + team: [ + { required: true, message: '请选择班组', trigger: 'change' } + ], + planDate: [ + { required: true, message: '请输入计划日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 生产计划子表 + */ +export const ProductionDeatil = useCrudSchemas(reactive([ + { + label: '订单号', + field: 'woNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'woLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: 'Bom版本', + field: 'bomVersion', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '合格数量', + field: 'goodQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '不合格数量', + field: 'notGoodQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计划数量', + field: 'planQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductionDeatilRules = reactive({ + woNumber: [ + { required: true, message: '请选择订单号', trigger: 'change' } + ], + bomVersion: [ + { required: true, message: '请输入Bom版本', trigger: 'blur' } + ], + goodQty: [ + { required: true, message: '请输入合格数量', trigger: 'blur' } + ], + notGoodQty: [ + { required: true, message: '请输入不合格数量', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + uom: [ + { required: true, message: '请选择计量单位', trigger: 'change' } + ], + planQty: [ + { required: true, message: '请输入计划数量', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品收货申请主表 + */ +export const ProductreceiptRequestMain = useCrudSchemas(reactive([ + { + label: '生产计划单号', + field: 'productionPlanNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班组', + field: 'team', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班次', + field: 'shift', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoExecute', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductreceiptRequestMainRules = reactive({ + toWarehouseCode: [ + { required: true, message: '请输入到仓库代码', trigger: 'blur' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + toAreaCodes: [ + { required: true, message: '请输入到库区代码范围', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品收货申请子表 + */ +export const ProductreceiptRequestDetail = useCrudSchemas(reactive([ + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工位代码', + field: 'workStationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工序代码', + field: 'processCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产日期', + field: 'produceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '过期日期', + field: 'expireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'woNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'woLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '标包数量', + field: 'stdPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '标包单位', + field: 'stdPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + } +])) + +//表单校验 +export const ProductreceiptRequestDetailRules = reactive({ + productionLineCode: [ + { required: true, message: '请选择生产线代码', trigger: 'change' } + ], + packingNumber: [ + { required: true, message: '请输入包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + produceDate: [ + { required: true, message: '请选择生产日期', trigger: 'change' } + ], + expireDate: [ + { required: true, message: '请选择过期日期', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + woNumber: [ + { required: true, message: '请输入订单号', trigger: 'blur' } + ], + woLine: [ + { required: true, message: '请输入订单行', trigger: 'blur' } + ], + stdPackQty: [ + { required: true, message: '请输入标包数量', trigger: 'blur' } + ], + stdPackUnit: [ + { required: true, message: '请选择标包单位', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物品代码', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品收货申请子表 + */ +export const BackflushRequestDetailb = useCrudSchemas(reactive([ + { + label: '工序代码', + field: 'processCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: 'BOM版本', + field: 'bomVersion', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + } +])) + +//表单校验 +export const BackflushRequestDetailbRules = reactive({ + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品收货任务主表 + */ +export const ProductreceiptJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产线代码', + field: 'productionPlanNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班组', + field: 'team', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班次', + field: 'shift', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductreceiptJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + toAreaCodes: [ + { required: true, message: '请选择到库区代码范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品收货任务子表 + */ +export const ProductreceiptJobDetail = useCrudSchemas(reactive([ + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工位代码', + field: 'workStationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工序代码', + field: 'processCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产日期', + field: 'produceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '过期日期', + field: 'expireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'woNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'woLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '标包数量', + field: 'stdPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '标包单位', + field: 'stdPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const ProductreceiptJobDetailRules = reactive({ + productionLineCode: [ + { required: true, message: '请选择生产线代码', trigger: 'change' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + produceDate: [ + { required: true, message: '请输入生产日期', trigger: 'change' } + ], + expireDate: [ + { required: true, message: '请输入过期日期', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + woNumber: [ + { required: true, message: '请选择订单号', trigger: 'change' } + ], + woLine: [ + { required: true, message: '请输入订单行', trigger: 'blur' } + ], + stdPackQty: [ + { required: true, message: '请输入标包数量', trigger: 'blur' } + ], + stdPackUnit: [ + { required: true, message: '请选择标包单位', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品收货记录主表 + */ +export const ProductreceiptRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产计划单号', + field: 'productionPlanNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班组', + field: 'team', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班次', + field: 'shift', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductreceiptRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + toAreaCodes: [ + { required: true, message: '请选择到库区代码范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品收货记录子表 + */ +export const ProductreceiptRecordDetail = useCrudSchemas(reactive([ + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工位代码', + field: 'workStationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工序代码', + field: 'processCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产日期', + field: 'produceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '过期日期', + field: 'expireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'woNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'woLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '标包数量', + field: 'stdPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '标包单位', + field: 'stdPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const ProductreceiptRecordDetailRules = reactive({ + productionLineCode: [ + { required: true, message: '请选择生产线代码', trigger: 'change' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + produceDate: [ + { required: true, message: '请输入生产日期', trigger: 'change' } + ], + expireDate: [ + { required: true, message: '请输入到货日期', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + toLocationGroupCode: [ + { required: true, message: '请选择到库位组代码', trigger: 'change' } + ], + toAreaCode: [ + { required: true, message: '请选择到库区代码', trigger: 'change' } + ], + woNumber: [ + { required: true, message: '请选择订单号', trigger: 'change' } + ], + woLine: [ + { required: true, message: '请输入订单行', trigger: 'blur' } + ], + stdPackQty: [ + { required: true, message: '请输入标包数量', trigger: 'blur' } + ], + stdPackUnit: [ + { required: true, message: '请选择标包单位', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品收货记录子表 + */ +export const BackflushRecordDetailb = useCrudSchemas(reactive([ + { + label: '工序代码', + field: 'processCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: 'BOM版本', + field: 'bomVersion', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const BackflushRecordDetailbRules = reactive({ + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择到库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品拆解申请主表 + */ +export const ProductdismantleRequestMain = useCrudSchemas(reactive([ + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班组', + field: 'team', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班次', + field: 'shift', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoExecute', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductdismantleRequestMainRules = reactive({ + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品拆解申请子表 + */ +export const ProductdismantleRequestDetaila = useCrudSchemas(reactive([ + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工位代码', + field: 'workStationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工序代码', + field: 'processCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产日期', + field: 'produceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '过期日期', + field: 'expireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '标包数量', + field: 'stdPackQty', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '标包单位', + field: 'stdPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + } +])) + +//表单校验 +export const ProductdismantleRequestDetailaRules = reactive({ + productionLineCode: [ + { required: true, message: '请选择生产线代码', trigger: 'change' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + produceDate: [ + { required: true, message: '请选择生产日期', trigger: 'change' } + ], + expireDate: [ + { required: true, message: '请选择到货日期', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + stdPackQty: [ + { required: true, message: '请输入标包数量', trigger: 'blur' } + ], + stdPackUnit: [ + { required: true, message: '请选择标包单位', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品拆解申请子表 + */ +export const DismantleRequestDetailb = useCrudSchemas(reactive([ + { + label: '工序代码', + field: 'processCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: 'BOM版本', + field: 'bomVersion', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + } +])) + +//表单校验 +export const DismantleRequestDetailbRules = reactive({ + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品拆解任务主表 + */ +export const ProductdismantleJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班组', + field: 'team', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班次', + field: 'shift', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductdismantleJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品拆解任务子表 + */ +export const ProductdismantleJobDetail = useCrudSchemas(reactive([ + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工位代码', + field: 'workStationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工序代码', + field: 'processCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产日期', + field: 'produceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '过期日期', + field: 'expireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '标包数量', + field: 'stdPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '标包单位', + field: 'stdPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const ProductdismantleJobDetailRules = reactive({ + productionLineCode: [ + { required: true, message: '请选择生产线代码', trigger: 'change' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + produceDate: [ + { required: true, message: '请输入生产日期', trigger: 'change' } + ], + expireDate: [ + { required: true, message: '请输入过期日期', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + stdPackQty: [ + { required: true, message: '请输入标包数量', trigger: 'blur' } + ], + stdPackUnit: [ + { required: true, message: '请选择标包单位', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品拆解记录主表 + */ +export const ProductdismantleRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班组', + field: 'team', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班次', + field: 'shift', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductdismantleRecordMainRuels = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品拆解记录子表 + */ +export const ProductdismantleRecordDetaila = useCrudSchemas(reactive([ + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工位代码', + field: 'workStationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工序代码', + field: 'processCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产日期', + field: 'produceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '过期日期', + field: 'expireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const ProductdismantleRecordDetailaRules = reactive({ + productionLineCode: [ + { required: true, message: '请选择生产线代码', trigger: 'change' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + produceDate: [ + { required: true, message: '请输入生产日期', trigger: 'change' } + ], + expireDate: [ + { required: true, message: '请输入过期日期', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品拆解记录子表 + */ +export const DismantleRecordDetailb = useCrudSchemas(reactive([ + { + label: '工序代码', + field: 'processCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: 'BOM版本', + field: 'bomVersion', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const DismantleRecordDetailbRules = reactive({ + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + toLocationGroupCode: [ + { required: true, message: '请选择到库位组代码', trigger: 'change' } + ], + toAreaCode: [ + { required: true, message: '请选择到库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品返修申请主表 + */ +export const ProductrepairRequestMain = useCrudSchemas(reactive([ + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班组', + field: 'team', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班次', + field: 'shift', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoExecute', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductrepairRequestMainRules = reactive({ + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品返修申请子表 + */ +export const ProductrepairRequestDetaila = useCrudSchemas(reactive([ + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工位代码', + field: 'workStationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工序代码', + field: 'processCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + } +])) + +//表单校验 +export const ProductrepairRequestDetailaRules = reactive({ + productionLineCode: [ + { required: true, message: '请选择生产线代码', trigger: 'change' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请输入库存状态', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品返修申请子表 + */ +export const ConsumereRequestDetailb = useCrudSchemas(reactive([ + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + } +])) + +//表单校验 +export const ConsumereRequestDetailbRules = reactive({ + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品返修记录主表 + */ +export const ProductrepairRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班组', + field: 'team', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '班次', + field: 'shift', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductrepairRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品返修记录子表 + */ +export const ProductrepairRecordDetail = useCrudSchemas(reactive([ + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工位代码', + field: 'workStationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工序代码', + field: 'processCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '生产日期', + field: 'produceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '过期日期', + field: 'expireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const ProductrepairRecordDetailRules = reactive({ + productionLineCode: [ + { required: true, message: '请选择生产线代码', trigger: 'change' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + produceDate: [ + { required: true, message: '请输入生产日期', trigger: 'change' } + ], + expireDate: [ + { required: true, message: '请输入过期日期', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + toLocationGroupCode: [ + { required: true, message: '请选择到库位组代码', trigger: 'change' } + ], + toAreaCode: [ + { required: true, message: '请选择到库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品返修记录子表 + */ +export const ConsumeRecordDetailb = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const ConsumeRecordDetailbRules = reactive({ + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品报废申请主表 + */ +export const ProductscrapRequestMain = useCrudSchemas(reactive([ + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductscrapRequestMainRules = reactive({ + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品报废申请子表 + */ +export const ProductscrapRequestDetail = useCrudSchemas(reactive([ + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '原因', + field: 'reason', + dictType: DICT_TYPE.SCRAP_REASON, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const ProductscrapRequestDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品报废任务主表 + */ +export const ProductscrapJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + form: { + component: 'InputNumber', + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级增量', + field: 'priorityIncrement', + form: { + component: 'InputNumber', + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductscrapJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品报废任务子表 + */ +export const ProductscrapJobDetail = useCrudSchemas(reactive([ + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '原因', + field: 'reason', + dictType: DICT_TYPE.SCRAP_REASON, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, +])) + +//表单校验 +export const ProductscrapJobDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品报废记录主表 + */ +export const ProductscrapRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductscrapRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品报废记录子表 + */ +export const ProductscrapRecordDetail = useCrudSchemas(reactive([ + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '原因', + field: 'reason', + dictType: DICT_TYPE.SCRAP_REASON, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单价', + field: 'singlePrice', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '金额', + field: 'amount', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const ProductscrapRecordDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品上架申请主表 + */ +export const ProductputawayRequestMain = useCrudSchemas(reactive([ + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductputawayRequestMainRules = reactive({ + fromWarehouseCode: [ + { required: true, message: '请输入从仓库代码', trigger: 'blur' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请输入到仓库代码', trigger: 'blur' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品上架申请子表 + */ +export const ProductputawayRequestDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const ProductputawayRequestDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请输入包装号', trigger: 'blur' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请输入从库位代码', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物品代码', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品上架任务主表 + */ +export const ProductputawayJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'update', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + form: { + component: 'InputNumber', + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级增量', + field: 'priorityIncrement', + form: { + component: 'InputNumber', + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人用户名', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人用户名', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductputawayJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品上架任务子表 + */ +export const ProductputawayJobDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemdesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const ProductputawayJobDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品上架记录主表 + */ +export const ProductputawayRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ProductputawayRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 制品上架记录子表 + */ +export const ProductputawayRecordDetail = useCrudSchemas(reactive([ + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'fromBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'toBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const ProductputawayRecordDetailRules = reactive({ + fromPackingNumber: [ + { required: true, message: '请选择从包装号', trigger: 'change' } + ], + toPackingNumber: [ + { required: true, message: '请选择到包装号', trigger: 'change' } + ], + fromBatch: [ + { required: true, message: '请输入从批次', trigger: 'blur' } + ], + toBatch: [ + { required: true, message: '请输入到批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + toLocationGroupCode: [ + { required: true, message: '请选择到库位组代码', trigger: 'change' } + ], + toAreaCode: [ + { required: true, message: '请选择到库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 下线结算申请主表 + */ +export const OfflinesettlementRequestMain = useCrudSchemas(reactive([ + { + label: '制品收货记录单号', + field: 'productReceiptRecordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const OfflinesettlementRequestMainRules = reactive({ + productReceiptRecordNumber: [ + { required: true, message: '请选择制品收货记录单号', trigger: 'change' } + ], + warehouseCode: [ + { required: true, message: '请选择仓库代码', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 下线结算申请子表 + */ +export const OfflinesettlementRequestDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const OfflinesettlementRequestDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + locationCode: [ + { required: true, message: '请选择库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 下线结算记录主表 + */ +export const OfflinesettlementRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '制品收货记录单号', + field: 'productReceiptRecordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const OfflinesettlementRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + productReceiptRecordNumber: [ + { required: true, message: '请选择制品收货记录单号', trigger: 'change' } + ], + warehouseCode: [ + { required: true, message: '请选择仓库代码', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 下线结算记录子表 + */ +export const OfflinesettlementRecordDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位组代码', + field: 'locationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库区代码', + field: 'areaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const OfflinesettlementRecordDetailRules= reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + locationCode: [ + { required: true, message: '请选择库位代码', trigger: 'change' } + ], + locationGroupCode: [ + { required: true, message: '请选择库位组代码', trigger: 'change' } + ], + areaCode: [ + { required: true, message: '请选择库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 销售订单主表 + */ +export const SaleMain = useCrudSchemas(reactive([ + { + label: '客户代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + }, + + }, + { + label: '订单类型', + field: 'type', + dictType: DICT_TYPE.SALE_ORDER_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单日期', + field: 'orderDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止日期', + field: 'dueDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '版本', + field: 'version', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '税率', + field: 'taxRate', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '联系人姓名', + field: 'contactName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '联系人电话', + field: 'contactPhone', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '联系人电子邮件', + field: 'contactEmail', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '当前阶段', + field: 'currentStage', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const SaleMainRules = reactive({ + customerCode: [ + { required: true, message: '请选择客户代码', trigger: 'change' } + ], + type: [ + { required: true, message: '请选择订单类型', trigger: 'change' } + ], + orderDate: [ + { required: true, message: '请输入订单日期', trigger: 'change' } + ], + taxRate: [ + { required: true, message: '请输入税率', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 销售订单子表 + */ +export const SaleDetail = useCrudSchemas(reactive([ + { + label: '行号', + field: 'lineNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '标包数量', + field: 'stdPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '标包单位', + field: 'stdPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户计量数量', + field: 'customerPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '客户计量单位', + field: 'customerPackUnit', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '转换率', + field: 'convertRate', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '已发货数量', + field: 'shippedQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '已收货数量', + field: 'receivedQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '已退货数量', + field: 'returnedQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '单价', + field: 'singlePrice', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '金额', + field: 'amount', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单数量', + field: 'orderQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const SaleDetailRules = reactive({ + lineNumber: [ + { required: true, message: '请输入行号', trigger: 'blur' } + ], + stdPackQty: [ + { required: true, message: '请输入标包数量', trigger: 'blur' } + ], + stdPackUnit: [ + { required: true, message: '请选择标包单位', trigger: 'change' } + ], + convertRate: [ + { required: true, message: '请输入转换率', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + uom: [ + { required: true, message: '请选择计量单位', trigger: 'change' } + ], + planQty: [ + { required: true, message: '请输入计划数量', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 发货计划主表 + */ +export const DeliverPlanMain = useCrudSchemas(reactive([ + { + label: '客户代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计划日期', + field: 'planDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '开始时间', + field: 'beginTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '结束时间', + field: 'endTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const DeliverPlanMainRules = reactive({ + customerCode: [ + { required: true, message: '请选择客户代码', trigger: 'change' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 发货计划子表 + */ +export const DeliverPlanDetail = useCrudSchemas(reactive([ + { + label: '销售订单号', + field: 'soNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '销售订单行', + field: 'soLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户月台', + field: 'customerDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目', + field: 'project', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计划数量', + field: 'planQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + } +])) + +//表单校验 +export const DeliverPlanDetailRules = reactive({ + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + uom: [ + { required: true, message: '请选择计量单位', trigger: 'change' } + ], + planQty: [ + { required: true, message: '请输入计划数量', trigger: 'blur' } + ], + soNumber: [ + { required: true, message: '请选择销售订单号', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 发货申请主表 + */ +export const DeliverRequestMain = useCrudSchemas(reactive([ + { + label: '发货计划单号', + field: 'deliverPlanNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户发货单号', + field: 'customerDeliverNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户月台代码', + field: 'customerDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从月台代码', + field: 'fromDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const DeliverRequestMainRueles = reactive({ + customerCode: [ + { required: true, message: '请选择客户代码', trigger: 'change' } + ], + customerDockCode: [ + { required: true, message: '请选择客户月台代码', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 发货申请子表 + */ +export const DeliverRequestDetail = useCrudSchemas(reactive([ + { + label: '销售订单号', + field: 'soNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '销售订单行', + field: 'soLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const DeliverRequestDetailRules = reactive({ + soNumber: [ + { required: true, message: '请选择销售订单号', trigger: 'change' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 发货任务主表 + */ +export const DeliverJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货计划单号', + field: 'deliverPlanNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户发货单号', + field: 'customerDeliverNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户月台代码', + field: 'customerDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货月台', + field: 'deliverDock', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从月台代码', + field: 'fromDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const DeliverJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + customerCode: [ + { required: true, message: '请选择客户代码', trigger: 'change' } + ], + customerDockCode: [ + { required: true, message: '请选择客户月台代码', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请输入从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 发货任务子表 + */ +export const DeliverJobDetail = useCrudSchemas(reactive([ + { + label: '销售订单号', + field: 'soNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '销售订单行', + field: 'soLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemdesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const DeliverJobDetailRules = reactive({ + soNumber: [ + { required: true, message: '请选择销售订单号', trigger: 'change' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 发货记录主表 + */ +export const DeliverRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货计划单号', + field: 'deliverPlanNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户发货单号', + field: 'customerDeliverNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户月台代码', + field: 'customerDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从月台代码', + field: 'fromDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const DeliverRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + customerCode: [ + { required: true, message: '请选择客户代码', trigger: 'change' } + ], + customerDockCode: [ + { required: true, message: '请选择客户月台代码', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 发货记录子表 + */ +export const DeliverRecordDetail = useCrudSchemas(reactive([ + { + label: '销售订单号', + field: 'soNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '销售订单行', + field: 'soLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单价', + field: 'singlePrice', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '金额', + field: 'amount', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const DeliverRecordDetailRules = reactive({ + soNumber: [ + { required: true, message: '请选择销售订单号', trigger: 'change' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + toLocationGroupCode: [ + { required: true, message: '请选择到库位组代码', trigger: 'change' } + ], + toAreaCode: [ + { required: true, message: '请选择到库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 客户收货申请主表 + */ +export const CustomerreceiptRequestMain = useCrudSchemas(reactive([ + { + label: '发货申请单号', + field: 'deliverRequestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货计划单号', + field: 'deliverPlanNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户月台代码', + field: 'customerDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const CustomerreceiptRequestMainRules = reactive({ + customerCode: [ + { required: true, message: '请选择客户代码', trigger: 'change' } + ], + customerDockCode: [ + { required: true, message: '请选择客户月台代码', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 客户收货申请子表 + */ +export const CustomerreceiptRequestDetail = useCrudSchemas(reactive([ + { + label: '销售订单号', + field: 'soNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '销售订单行', + field: 'soLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const CustomerreceiptRequestDetailRules = reactive({ + soNumber: [ + { required: true, message: '请选择销售订单号', trigger: 'change' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请选择批次', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 客户收货记录主表 + */ +export const CustomerreceiptRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货记录单号', + field: 'deliverRecordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货计划单号', + field: 'deliverPlanNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户月台代码', + field: 'customerDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const CustomerreceiptRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + customerCode: [ + { required: true, message: '请选择客户代码', trigger: 'change' } + ], + customerDockCode: [ + { required: true, message: '请选择客户月台代码', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 客户收货记录子表 + */ +export const CustomerreceiptRecordDetail = useCrudSchemas(reactive([ + { + label: '销售订单号', + field: 'soNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '销售订单行', + field: 'soLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'fromBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单价', + field: 'singlePrice', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '金额', + field: 'amount', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'toBatch', + sort: 'custom', + table: { + width: 150 + }, + } +])) + +//表单校验 +export const CustomerreceiptRecordDetailRules = reactive({ + soNumber: [ + { required: true, message: '请选择销售订单号', trigger: 'blur' } + ], + fromPackingNumber: [ + { required: true, message: '请选择从包装号', trigger: 'blur' } + ], + toPackingNumber: [ + { required: true, message: '请选择到包装号', trigger: 'blur' } + ], + fromBatch: [ + { required: true, message: '请输入从批次', trigger: 'blur' } + ], + toBatch: [ + { required: true, message: '请输入到批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'blur' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'blur' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'blur' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'blur' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'blur' } + ], + toLocationGroupCode: [ + { required: true, message: '请选择到库位组代码', trigger: 'blur' } + ], + toAreaCode: [ + { required: true, message: '请选择到库区代码', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 客户退货申请主表 + */ +export const CustomerreturnRequestMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货记录单号', + field: 'deliverRecordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货计划单号', + field: 'deliverPlanNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户月台代码', + field: 'customerDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到月台代码', + field: 'toDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const CustomerreturnRequestMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + customerCode: [ + { required: true, message: '请选择客户代码', trigger: 'change' } + ], + customerDockCode: [ + { required: true, message: '请选择客户月台代码', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + toAreaCodes: [ + { required: true, message: '请选择到库区代码范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 客户退货申请子表 + */ +export const CustomerreturnRequestDetail = useCrudSchemas(reactive([ + { + label: '销售订单号', + field: 'soNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '销售订单行', + field: 'soLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const CustomerreturnRequestDetailRules = reactive({ + soNumber: [ + { required: true, message: '请选择销售订单号', trigger: 'change' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 客户退货任务主表 + */ +export const CustomerreturnJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货记录单号', + field: 'deliverRecordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货计划单号', + field: 'deliverPlanNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户月台代码', + field: 'customerDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '收货月台', + field: 'receiptDock', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到月台代码', + field: 'toDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const CustomerreturnJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + customerCode: [ + { required: true, message: '请选择客户代码', trigger: 'change' } + ], + customerDockCode: [ + { required: true, message: '请选择客户月台代码', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请输入从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + toAreaCodes: [ + { required: true, message: '请选择到库区代码范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 客户退货任务子表 + */ +export const CustomerreturnJobDetail = useCrudSchemas(reactive([ + { + label: '销售订单号', + field: 'soNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '销售订单行', + field: 'soLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemdesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const CustomerreturnJobDetailRules = reactive({ + soNumber: [ + { required: true, message: '请选择销售订单号', trigger: 'change' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 客户退货记录主表 + */ +export const CustomerreturnRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货记录单号', + field: 'deliverRecordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货计划单号', + field: 'deliverPlanNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户月台代码', + field: 'customerDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到月台代码', + field: 'toDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const CustomerreturnRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + customerCode: [ + { required: true, message: '请选择客户代码', trigger: 'change' } + ], + customerDockCode: [ + { required: true, message: '请选择客户月台代码', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + toAreaCodes: [ + { required: true, message: '请选择到库区代码范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 客户退货记录子表 + */ +export const CustomerreturnRecordDetail = useCrudSchemas(reactive([ + { + label: '销售订单号', + field: 'soNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '销售订单行', + field: 'soLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'fromBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单价', + field: 'singlePrice', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '金额', + field: 'amount', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'toBatch', + sort: 'custom', + table: { + width: 150 + }, + } +])) + +//表单校验 +export const CustomerreturnRecordDetailRules = reactive({ + soNumber: [ + { required: true, message: '请选择销售订单号', trigger: 'change' } + ], + fromPackingNumber: [ + { required: true, message: '请选择从包装号', trigger: 'change' } + ], + toPackingNumber: [ + { required: true, message: '请选择到包装号', trigger: 'change' } + ], + fromBatch: [ + { required: true, message: '请输入从批次', trigger: 'blur' } + ], + toBatch: [ + { required: true, message: '请输入到批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + toLocationGroupCode: [ + { required: true, message: '请选择到库位组代码', trigger: 'change' } + ], + toAreaCode: [ + { required: true, message: '请选择库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 客户结算申请主表 + */ +export const CustomersettleRequestMain = useCrudSchemas(reactive([ + { + label: '发货记录单号', + field: 'deliverRecordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货计划单号', + field: 'deliverPlanNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const CustomersettleRequestMainRules = reactive({ + customerCode: [ + { required: true, message: '请选择客户代码', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 客户结算申请子表 + */ +export const CustomersettleRequestDetail = useCrudSchemas(reactive([ + { + label: '销售订单号', + field: 'soNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '销售订单行', + field: 'soLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const CustomersettleRequestDetailRules = reactive({ + soNumber: [ + { required: true, message: '请选择销售订单号', trigger: 'change' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 客户结算记录主表 + */ +export const CustomersettleRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货记录单号', + field: 'deliverRecordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货计划单号', + field: 'deliverPlanNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '客户代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const CustomersettleRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + customerCode: [ + { required: true, message: '请选择客户代码', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 客户结算记录子表 + */ +export const CustomersettleRecordDetail = useCrudSchemas(reactive([ + { + label: '销售订单号', + field: 'soNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '销售订单行', + field: 'soLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGruopCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单价', + field: 'singlePrice', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '金额', + field: 'amount', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + isTable: true, + isSearch: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const CustomersettleRecordDetailRules = reactive({ + soNumber: [ + { required: true, message: '请选择销售订单号', trigger: 'change' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGruopCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 库存初始化申请主表 + */ +export const InventoryinitRequestMain = useCrudSchemas(reactive([ + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'creationTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const InventoryinitRequestMainRules = reactive({ + warehouseCode: [ + { required: true, message: '请选择仓库代码', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 库存初始化申请子表 + */ +export const InventoryinitRequestDetail = useCrudSchemas(reactive([ + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '替代批次', + field: 'altBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货日期', + field: 'arriveDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生产日期', + field: 'produceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '过期日期', + field: 'expireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位组代码', + field: 'locationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库区代码', + field: 'areaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '标包数量', + field: 'stdPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '标包单位', + field: 'stdPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const InventoryinitRequestDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + arriveDate: [ + { required: true, message: '请选择到货日期', trigger: 'change' } + ], + produceDate: [ + { required: true, message: '请选择生产日期', trigger: 'change' } + ], + expireDate: [ + { required: true, message: '请选择过期日期', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + locationCode: [ + { required: true, message: '请选择库位代码', trigger: 'change' } + ], + locationGroupCode: [ + { required: true, message: '请选择库位组代码', trigger: 'change' } + ], + areaCode: [ + { required: true, message: '请选择库区代码', trigger: 'change' } + ], + stdPackQty: [ + { required: true, message: '请输入标包数量', trigger: 'blur' } + ], + stdPackUnit: [ + { required: true, message: '请选择标包单位', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 库存初始化记录主表 + */ +export const InventoryinitRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const InventoryinitRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + warehouseCode: [ + { required: true, message: '请选择仓库代码', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 库存初始化记录子表 + */ +export const InventoryinitRecordDetail = useCrudSchemas(reactive([ + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '替代批次', + field: 'altBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货日期', + field: 'arriveDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生产日期', + field: 'produceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '过期日期', + field: 'expireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位组代码', + field: 'locationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库区代码', + field: 'areaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '标包数量', + field: 'stdPackQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '标包单位', + field: 'stdPackUnit', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单价', + field: 'singlePrice', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '金额', + field: 'amount', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const InventoryinitRecordDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + arriveDate: [ + { required: true, message: '请输入到货日期', trigger: 'change' } + ], + produceDate: [ + { required: true, message: '请输入生产日期', trigger: 'change' } + ], + expireDate: [ + { required: true, message: '请输入过期日期', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + locationCode: [ + { required: true, message: '请选择库位代码', trigger: 'change' } + ], + locationGroupCode: [ + { required: true, message: '请选择库位组代码', trigger: 'change' } + ], + areaCode: [ + { required: true, message: '请选择库区代码', trigger: 'change' } + ], + stdPackQty: [ + { required: true, message: '请输入标包数量', trigger: 'blur' } + ], + stdPackUnit: [ + { required: true, message: '请选择标包单位', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 库存转移申请主表 + */ +export const InventorymoveRequestMain = useCrudSchemas(reactive([ + { + label: '从仓库代码', + field: 'fromWarehouseOde', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '使用在途库', + field: 'useOnTheWayLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const InventorymoveRequestMainRules = reactive({ + fromWarehouseOde: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 库存转移申请子表 + */ +export const InventorymoveRequestDetail = useCrudSchemas(reactive([ + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'fromBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库存状态', + field: 'fromInventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'toBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库存状态', + field: 'toInventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, +])) + +//表单校验 +export const InventorymoveRequestDetailRules = reactive({ + fromPackingNumber: [ + { required: true, message: '请选择从包装号', trigger: 'change' } + ], + fromBatch: [ + { required: true, message: '请输入从批次', trigger: 'blur' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromInventoryStatus: [ + { required: true, message: '请选择从库存状态', trigger: 'change' } + ], + toPackingNumber: [ + { required: true, message: '请选择到包装号', trigger: 'change' } + ], + toBatch: [ + { required: true, message: '请输入到批次', trigger: 'blur' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + toInventoryStatus: [ + { required: true, message: '请选择到库存状态', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 库存转移任务主表 + */ +export const InventorymoveJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '使用在途库', + field: 'useOnTheWayLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const InventorymoveJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 库存转移任务子表 + */ +export const InventorymoveJobDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createtime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const InventorymoveJobDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 库存转移记录主表 + */ +export const InventorymoveRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '使用在途库', + field: 'useOnTheWayLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const InventorymoveRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 库存转移记录子表 + */ +export const InventorymoveRecordDetail = useCrudSchemas(reactive([ + { + label: '在途库库位', + field: 'onTheWayLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'fromBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库存状态', + field: 'fromInventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'toBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库存状态', + field: 'toInventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const InventorymoveRecordDetailRules = reactive({ + fromPackingNumber: [ + { required: true, message: '请选择从包装号', trigger: 'change' } + ], + fromBatch: [ + { required: true, message: '请输入从批次', trigger: 'blur' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + fromInventoryStatus: [ + { required: true, message: '请选择从库存状态', trigger: 'change' } + ], + toPackingNumber: [ + { required: true, message: '请选择到包装号', trigger: 'change' } + ], + toBatch: [ + { required: true, message: '请输入到批次', trigger: 'blur' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + toLocationGroupCode: [ + { required: true, message: '请选择到库位组代码', trigger: 'change' } + ], + toAreaCode: [ + { required: true, message: '请选择到库区代码', trigger: 'change' } + ], + toInventoryStatus: [ + { required: true, message: '请选择到库存状态', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 库存修改申请主表 + */ +export const InventorychangeRequestMain = useCrudSchemas(reactive([ + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const InventorychangeRequestMainRules = reactive({ + warehouseCode: [ + { required: true, message: '请选择仓库代码', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 库存修改申请子表 + */ +export const InventorychangeRequestDetail = useCrudSchemas(reactive([ + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位组代码', + field: 'locationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库区代码', + field: 'areaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从数量', + field: 'fromQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'fromBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从替代批次', + field: 'fromAltbatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从到货日期', + field: 'fromArriveDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从生产日期', + field: 'fromProduceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从过期日期', + field: 'fromExpireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库存状态', + field: 'frominventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到数量', + field: 'toQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'toBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到替代批次', + field: 'toAltBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到到货日期', + field: 'toArrivdAte', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '到生产日期', + field: 'toProduceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '到过期日期', + field: 'toExpireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '到库存状态', + field: 'toInventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, +])) + +//表单校验 +export const InventorychangeRequestDetailRules = reactive({ + locationCode: [ + { required: true, message: '请选择库位代码', trigger: 'change' } + ], + locationGroupCode: [ + { required: true, message: '请选择库位组代码', trigger: 'change' } + ], + areaCode: [ + { required: true, message: '请选择库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 库存修改记录主表 + */ +export const InventorychangeRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const InventorychangeRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + warehouseCode: [ + { required: true, message: '请选择仓库代码', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 库存修改记录子表 + */ +export const InventorychangeRecordDetail = useCrudSchemas(reactive([ + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位组代码', + field: 'locationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库区代码', + field: 'areaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从数量', + field: 'fromQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'fromBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从替代批次', + field: 'fromAltbatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从到货日期', + field: 'fromArriveDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从生产日期', + field: 'fromProduceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从过期日期', + field: 'fromExpireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库存状态', + field: 'frominventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到数量', + field: 'toQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'toBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到替代批次', + field: 'toAltBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到到货日期', + field: 'toArrivdAte', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '到生产日期', + field: 'toProduceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '到过期日期', + field: 'toExpireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '到库存状态', + field: 'toInventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const InventorychangeRecordDetailRules = reactive({ + locationCode: [ + { required: true, message: '请选择库位代码', trigger: 'change' } + ], + locationGroupCode: [ + { required: true, message: '请选择库位组代码', trigger: 'change' } + ], + areaCode: [ + { required: true, message: '请选择库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 调拨出库申请主表 + */ +export const TransferissueRequestMain = useCrudSchemas(reactive([ + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从月台代码', + field: 'fromDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const TransferissueRequestMainRules = reactive({ + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + toAreaCodes: [ + { required: true, message: '请选择到库区代码范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 调拨出库申请子表 + */ +export const TransferissueRequestDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, +])) + +//表单校验 +export const TransferissueRequestDetailRules = reactive({ + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 调拨出库任务主表 + */ +export const TransferissueJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '发货月台', + field: 'deliverDock', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从月台代码', + field: 'fromDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const TransferissueJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + toAreaCodes: [ + { required: true, message: '请选择到库区代码范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 调拨出库任务子表 + */ +export const TransferissueJobDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + form: { + component: 'InputNumber', + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const TransferissueJobDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 调拨出库记录主表 + */ +export const TransferissueRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从月台代码', + field: 'fromDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const TransferissueRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + toAreaCodes: [ + { required: true, message: '请选择到库区代码范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 调拨出库记录子表 + */ +export const TransferissueRecordDetail = useCrudSchemas(reactive([ + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'fromBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'toBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const TransferissueRecordDetailRules = reactive({ + fromPackingNumber: [ + { required: true, message: '请选择从包装号', trigger: 'change' } + ], + toPackingNumber: [ + { required: true, message: '请选择到包装号', trigger: 'change' } + ], + fromBatch: [ + { required: true, message: '请输入从批次', trigger: 'blur' } + ], + toBatch: [ + { required: true, message: '请输入到批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + toLocationGroupCode: [ + { required: true, message: '请选择到库位组代码', trigger: 'change' } + ], + toAreaCode: [ + { required: true, message: '请选择到库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 调拨入库申请主表 + */ +export const TransferreceiptRequestMain = useCrudSchemas(reactive([ + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到月台代码', + field: 'toDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const TransferreceiptRequestMainRules = reactive({ + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + toAreaCodes: [ + { required: true, message: '请选择到库区代码范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 调拨入库申请子表 + */ +export const TransferreceiptRequestDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, +])) + +//表单校验 +export const TransferreceiptRequestDetailRules = reactive({ + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 调拨入库任务主表 + */ +export const TransferreceiptJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到月台代码', + field: 'toDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const TransferreceiptJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + toAreaCodes: [ + { required: true, message: '请选择到库区代码范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 调拨入库任务子表 + */ +export const TransferreceiptJobDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const TransferreceiptJobDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 调拨入库记录主表 + */ +export const TransferreceiptRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '收货月台', + field: 'receiptDock', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承运商', + field: 'carrierCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '运输方式', + field: 'transferMode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '车牌号', + field: 'vehiclePlateNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到月台代码', + field: 'toDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const TransferreceiptRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + toAreaCodes: [ + { required: true, message: '请选择到库区代码范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 调拨入库记录子表 + */ +export const TransferreceiptRecordDetail = useCrudSchemas(reactive([ + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从批次', + field: 'fromBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到批次', + field: 'toBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const TransferreceiptRecordDetailRules = reactive({ + fromPackingNumber: [ + { required: true, message: '请选择从包装号', trigger: 'change' } + ], + toPackingNumber: [ + { required: true, message: '请选择到包装号', trigger: 'change' } + ], + fromBatch: [ + { required: true, message: '请输入从批次', trigger: 'blur' } + ], + toBatch: [ + { required: true, message: '请输入到批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + toLocationGroupCode: [ + { required: true, message: '请选择到库位组代码', trigger: 'change' } + ], + toAreaCode: [ + { required: true, message: '请选择到库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 计划外出库申请主表 + */ +export const UnplannedissueRequestMain = useCrudSchemas(reactive([ + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const UnplannedissueRequestMainRules = reactive({ + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 计划外出库申请子表 + */ +export const UnplannedissueRequestDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '原因', + field: 'reason', + dictType: DICT_TYPE.UNPLANNED_ISSUE_REASON, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + }, +])) + +//表单校验 +export const UnplannedissueRequestDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 计划外出库任务主表 + */ +export const UnplannedissueJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const UnplannedissueJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 计划外出库任务子表 + */ +export const UnplannedissueJobDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '原因', + field: 'reason', + dictType: DICT_TYPE.UNPLANNED_ISSUE_REASON, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const UnplannedissueJobDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 计划外出库记录主表 + */ +export const UnplannedissueRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从月台代码', + field: 'fromDockCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const UnplannedissueRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 计划外出库记录子表 + */ +export const UnplannedissueRecordDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '原因', + field: 'reason', + dictType: DICT_TYPE.UNPLANNED_ISSUE_REASON, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单价', + field: 'singlePrice', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '金额', + field: 'amount', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const UnplannedissueRecordDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 计划外入库申请主表 + */ +export const UnplannedreceiptRequestMain = useCrudSchemas(reactive([ + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const UnplannedreceiptRequestMainRules = reactive({ + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + toAreaCodes: [ + { required: true, message: '请选择到库区代码范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 计划外入库申请子表 + */ +export const UnplannedreceiptRequestDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '替代批次', + field: 'altBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货日期', + field: 'arriveDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生产日期', + field: 'produceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '过期日期', + field: 'expireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货主代码', + field: 'toOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '原因', + field: 'reason', + dictType: DICT_TYPE.UNPLANNED_RECEIPT_REASON, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, +])) + +//表单校验 +export const UnplannedreceiptRequestDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + arriveDate: [ + { required: true, message: '请选择到货日期', trigger: 'change' } + ], + produceDate: [ + { required: true, message: '请选择生产日期', trigger: 'change' } + ], + expireDate: [ + { required: true, message: '请选择过期日期', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 计划外入库任务主表 + */ +export const UnplannedreceiptJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const UnplannedreceiptJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + toAreaCodes: [ + { required: true, message: '请选择到库区代码范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 计划外入库任务子表 + */ +export const UnplannedreceiptJobDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '替代批次', + field: 'altBatch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '原因', + field: 'reason', + dictType: DICT_TYPE.UNPLANNED_RECEIPT_REASON, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货日期', + field: 'arriveDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生产日期', + field: 'produceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '过期日期', + field: 'expireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, +])) + +//表单校验 +export const UnplannedreceiptJobDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + arriveDate: [ + { required: true, message: '请输入到货日期', trigger: 'change' } + ], + produceDate: [ + { required: true, message: '请输入生产日期', trigger: 'change' } + ], + expireDate: [ + { required: true, message: '请输入从过期日期', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 计划外入库记录主表 + */ +export const UnplannedreceiptRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到仓库代码', + field: 'toWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码范围', + field: 'toAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const UnplannedreceiptRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'change' } + ], + toLocationTypes: [ + { required: true, message: '请选择到库位类型范围', trigger: 'change' } + ], + toAreaCodes: [ + { required: true, message: '请选择到库区代码范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 计划外入库记录子表 + */ +export const UnplannedreceiptRecordDetail = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到货日期', + field: 'arriveDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生产日期', + field: 'produceDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '过期日期', + field: 'expireDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位组代码', + field: 'toLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库区代码', + field: 'toAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '原因', + field: 'reason', + dictType: DICT_TYPE.UNPLANNED_RECEIPT_REASON, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单价', + field: 'singlePrice', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '金额', + field: 'amount', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const UnplannedreceiptRecordDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'change' } + ], + toLocationGroupCode: [ + { required: true, message: '请选择到库位组代码', trigger: 'change' } + ], + toAreaCode: [ + { required: true, message: '请选择到库区代码', trigger: 'change' } + ], + arriveDate: [ + { required: true, message: '请输入到货日期', trigger: 'change' } + ], + produceDate: [ + { required: true, message: '请选择生产日期', trigger: 'change' } + ], + expireDate: [ + { required: true, message: '请选择过期日期', trigger: 'change' } + ] +}) + +/** + * @returns {Array} 报废出库申请主表 + */ +export const ScrapRequestMain = useCrudSchemas(reactive([ + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, +])) + +//表单校验 +export const ScrapRequestMainRules = reactive({ + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 报废出库申请子表 + */ +export const ScrapRequestDetail = useCrudSchemas(reactive([ + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '原因', + field: 'reason', + dictType: DICT_TYPE.SCRAP_REASON, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const ScrapRequestDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 报废出库任务主表 + */ +export const ScrapJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, +])) + +//表单校验 +export const ScrapJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 报废出库任务子表 + */ +export const ScrapJobDetail = useCrudSchemas(reactive([ + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '原因', + field: 'reason', + dictType: DICT_TYPE.SCRAP_REASON, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, +])) + +//表单校验 +export const ScrapJobDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 报废出库记录主表 + */ +export const ScrapRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从仓库代码', + field: 'fromWarehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, +])) + +//表单校验 +export const ScrapRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + fromWarehouseCode: [ + { required: true, message: '请选择从仓库代码', trigger: 'change' } + ], + fromLocationTypes: [ + { required: true, message: '请选择从库位类型范围', trigger: 'change' } + ], + fromAreaCodes: [ + { required: true, message: '请选择从库区代码范围', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 报废出库记录子表 + */ +export const ScrapRecordDetail = useCrudSchemas(reactive([ + { + label: '从货主代码', + field: 'fromOwnerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库位组代码', + field: 'fromLocationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码', + field: 'fromAreaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '原因', + field: 'reason', + dictType: DICT_TYPE.SCRAP_REASON, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单价', + field: 'singlePrice', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '金额', + field: 'amount', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const ScrapRecordDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + fromLocationCode: [ + { required: true, message: '请选择从库位代码', trigger: 'change' } + ], + fromLocationGroupCode: [ + { required: true, message: '请选择从库位组代码', trigger: 'change' } + ], + fromAreaCode: [ + { required: true, message: '请选择从库区代码', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 盘点计划主表 + */ +export const CountPlanMain = useCrudSchemas(reactive([ + { + label: '盘点类型', + field: 'type', + dictType: DICT_TYPE.COUNT_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行周期', + field: 'crontab', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '维度', + field: 'dimension', + dictType: DICT_TYPE.COUNT_DIMENSION, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '限值', + field: 'limitedValue', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '物品忽略名单', + field: 'ignoreListOfItem', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位忽略名单', + field: 'ignoreListOfLocation', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '盘点范围列表', + field: 'scopeList', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '快照盘点', + field: 'isSnapshot', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '冻结盘点', + field: 'isFreeze', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '盘点空库位', + field: 'isCountEmptyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '盘点零库存', + field: 'isCountZeroInventory', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '盘点负库存', + field: 'isCountNegativeInventory', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '明盘', + field: 'isOpenCount', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '开始时间', + field: 'beginTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '结束时间', + field: 'endTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.COUNT_PLAN_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, +])) + +//表单校验 +export const CountPlanMainRules = reactive({ + type: [ + { required: true, message: '请选择盘点类型', trigger: 'change' } + ], + isSnapshot: [ + { required: true, message: '请选择快照盘点', trigger: 'change' } + ], + isFreeze: [ + { required: true, message: '请选择冻结盘点', trigger: 'change' } + ], + isCountEmptyLocation: [ + { required: true, message: '请选择盘点空库位', trigger: 'change' } + ], + isCountZeroInventory: [ + { required: true, message: '请选择盘点零库存', trigger: 'change' } + ], + isCountNegativeInventory: [ + { required: true, message: '请选择盘点负库存', trigger: 'change' } + ], + isOpenCount: [ + { required: true, message: '请选择明盘', trigger: 'change' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 盘点计划子表 + */ +export const CountPlanDetail = useCrudSchemas(([ + { + label: '盘点范围类型', + field: 'type', + dictType: DICT_TYPE.COUNT_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '盘点范围值', + field: 'value', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计划数量', + field: 'planQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const CountPlanDetailRules = reactive({ + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + uom: [ + { required: true, message: '请选择计量单位', trigger: 'change' } + ], + planQty: [ + { required: true, message: '请输入计划数量', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 盘点申请主表 + */ +export const CountRequestMain = useCrudSchemas(([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计划单号', + field: 'planNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '阶段', + field: 'stage', + dictType: DICT_TYPE.COUNT_STAGE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const CountRequestMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + stage: [ + { required: true, message: '请选择阶段', trigger: 'change' } + ], + warehouseCode: [ + { required: true, message: '请选择仓库代码', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + + +/** + * @returns {Array} 盘点申请子表 + */ +export const CountRequestDetail = useCrudSchemas(reactive([ + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从包装号', + field: 'fromPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从器具号', + field: 'fromContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到包装号', + field: 'toPackingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到器具号', + field: 'toContainerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '盘点明细号', + field: 'countDetailNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const CountRequestDetailRules = reactive({ + countDetailNumber: [ + { required: true, message: '请输入盘点明细号', trigger: 'blur' } + ], + fromPackingNumber: [ + { required: true, message: '请选择从包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + locationCode: [ + { required: true, message: '请选择库位代码', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 盘点任务主表 + */ +export const CountJobMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计划单号', + field: 'planNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '阶段', + field: 'stage', + dictType: DICT_TYPE.COUNT_STAGE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '要求截止时间', + field: 'requestDueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '过期时间', + field: 'expiredTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'jobStageStatus', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '优先级增量', + field: 'priorityIncrement', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接人', + field: 'acceptUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '承接时间', + field: 'acceptTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '完成人', + field: 'completeUserId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '完成时间', + field: 'completeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '从库位类型范围', + field: 'fromLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '到库位类型范围', + field: 'toLocationTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '从库区代码范围', + field: 'fromAreaCodes', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动完成', + field: 'autoComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '允许修改库位', + field: 'allowModifyLocation', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '允许修改数量', + field: 'allowModifyQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '允许大于推荐数量', + field: 'allowBiggerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '允许小于推荐数量', + field: 'allowSmallerQty', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '允许修改库存状态', + field: 'allowModifyInventoryStatus', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '允许连续扫描', + field: 'allowContinuousScanning', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '允许部分完成', + field: 'allowPartialComplete', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '允许修改批次', + field: 'allowModifyBatch', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '允许修改箱码', + field: 'allowModifyPackingNumber', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const CountJobMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + stage: [ + { required: true, message: '请选择阶段', trigger: 'change' } + ], + warehouseCode: [ + { required: true, message: '请选择仓库代码', trigger: 'change' } + ], + locationCode: [ + { required: true, message: '请选择库位代码', trigger: 'change' } + ], + requestTime: [ + { required: true, message: '请输入申请时间', trigger: 'change' } + ], + requestDueTime: [ + { required: true, message: '请输入要求截止时间', trigger: 'change' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + jobStageStatus: [ + { required: true, message: '请选择阶段状态', trigger: 'change' } + ], + priority: [ + { required: true, message: '请输入优先级', trigger: 'blur' } + ], + priorityIncrement: [ + { required: true, message: '请输入优先级增量', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + userPositionCode: [ + { required: true, message: '请输入岗位', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 盘点任务子表 + */ +export const CountJobDetail = useCrudSchemas(reactive([ + { + label: '盘点明细号', + field: 'countDetailNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, +])) + +//表单校验 +export const CountJobDetailRules = reactive({ + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + countDetailNumber: [ + { required: true, message: '输入盘点明细号', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 盘点记录主表 + */ +export const CountRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务单号', + field: 'jobNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计划单号', + field: 'planNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '阶段', + field: 'stage', + dictType: DICT_TYPE.COUNT_STAGE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const CountRecordMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + jobNumber: [ + { required: true, message: '请选择任务单号', trigger: 'change' } + ], + stage: [ + { required: true, message: '请选择阶段', trigger: 'change' } + ], + warehouseCode: [ + { required: true, message: '请选择仓库代码', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 盘点记录子表 + */ +export const CountRecordDetail = useCrudSchemas(reactive([ + { + label: '盘点明细号', + field: 'countDetailNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位组代码', + field: 'locationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库区代码', + field: 'areaCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '盘点数量', + field: 'countQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '盘点时间', + field: 'countTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '盘点人', + field: 'countUser', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '盘点描述', + field: 'countDescription', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const CountRecordDetailRules = reactive({ + countDetailNumber: [ + { required: true, message: '请输入盘点明细号', trigger: 'blur' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + locationCode: [ + { required: true, message: '请选择库位代码', trigger: 'change' } + ], + locationGroupCode: [ + { required: true, message: '请选择库位组代码', trigger: 'change' } + ], + areaCode: [ + { required: true, message: '请选择库区代码', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + countQty: [ + { required: true, message: '请输入盘点数量', trigger: 'blur' } + ], + countTime: [ + { required: true, message: '请输入盘点时间', trigger: 'change' } + ], + countUser: [ + { required: true, message: '请输入盘点人', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 盘点调整申请主表 + */ +export const CountadjustRequestMain = useCrudSchemas(([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '盘点记录单号', + field: 'countRecordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动执行', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const CountadjustRequestMainRules = reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + warehouseCode: [ + { required: true, message: '请选择仓库代码', trigger: 'change' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 盘点调整申请子表 + */ +export const CountadjustRequestDetail = useCrudSchemas(reactive([ + { + label: '盘点明细号', + field: 'countDetailNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存数量', + field: 'inventoryQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '盘点数量', + field: 'countQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '调整数量', + field: 'adjustQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const CountadjustRequestDetailRules = reactive({ + countDetailNumber: [ + { required: true, message: '请输入盘点明细号', trigger: 'blur' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + locationCode: [ + { required: true, message: '请选择库位代码', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + inventoryQty: [ + { required: true, message: '请输入库存数量', trigger: 'blur' } + ], + countQty: [ + { required: true, message: '请输入盘点数量', trigger: 'blur' } + ], + adjustQty: [ + { required: true, message: '请输入调整数量', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 盘点调整记录主表 + */ +export const CountadjustRecordMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '盘点记录单号', + field: 'countRecordNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '出库事务类型', + field: 'outTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '入库事务类型', + field: 'inTransactionType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '执行时间', + field: 'executeTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '生效日期', + field: 'activeDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const CountadjustRecordMainRules =reactive({ + requestNumber: [ + { required: true, message: '请选择申请单号', trigger: 'change' } + ], + warehouseCode: [ + { required: true, message: '请选择仓库代码', trigger: 'change' } + ], + outTransaction: [ + { required: true, message: '请输入出库事务类型', trigger: 'blur' } + ], + inTransaction: [ + { required: true, message: '请输入入库事务类型', trigger: 'blur' } + ], + executeTime: [ + { required: true, message: '请输入执行时间', trigger: 'change' } + ], + activeDate: [ + { required: true, message: '请输入生效日期', trigger: 'change' } + ], + available: [ + { required: true, message: '请输入是否可用', trigger: 'blur' } + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + interfaceType: [ + { required: true, message: '请选择接口类型', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 盘点调整记录子表 + */ +export const CountadjustRecordDetail = useCrudSchemas(reactive([ + { + label: '盘点明细号', + field: 'countDetailNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '盘点数量', + field: 'countQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '库存数量', + field: 'inventoryQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '调整数量', + field: 'adjustQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物品描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '任务明细ID', + field: 'jobDetailId', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '接口类型', + field: 'interfaceType', + dictType: DICT_TYPE.INTERFACE_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, +])) + +//表单校验 +export const CountadjustRecordDetailRules =reactive({ + countDetailNumber: [ + { required: true, message: '请输入盘点明细号', trigger: 'blur' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + locationCode: [ + { required: true, message: '请选择库位代码', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + countQty: [ + { required: true, message: '请输入盘点数量', trigger: 'blur' } + ], + adjustQty: [ + { required: true, message: '请输入调整数量', trigger: 'blur' } + ], + inventoryQty: [ + { required: true, message: '请输入库存数量', trigger: 'blur' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + createTime: [ + { required: true, message: '请输入创建时间', trigger: 'blur' } + ], + creator: [ + { required: true, message: '请输入创建者', trigger: 'blur' } + ], +}) \ No newline at end of file diff --git a/src/utils/disposition/tableDetailsColumns.ts b/src/utils/disposition/tableDetailsColumns.ts new file mode 100644 index 0000000..f42b294 --- /dev/null +++ b/src/utils/disposition/tableDetailsColumns.ts @@ -0,0 +1,1431 @@ +/** + * @returns {Array} 采购订单 + */ + export const PurchaseOrder = [ + { label: "itemCode", prop: "itemCode", fixed: "left" }, + { type:"object", label: "物料名称", prop: "item", showProp:"name", }, + { type:"object", label: "物料描述1", prop: "item", showProp:"desc1", }, + { type:"object", label: "物料描述2", prop: "item", showProp:"desc2", }, + { label: "订单号", prop: "number", }, + { label: "订单行", prop: "poLine", }, + { type:"object", label: "数量", prop: "qty", showProp:"qty", }, + { type:"object", label: "单位", prop: "qty", showProp:"uom", }, + { type:"object", label: "标包数量", prop: "stdPack", showProp:"packQty", }, + { type:"object", label: "标包单位", prop: "stdPack", showProp:"packUom", }, + { label: "转换率", prop: 'convertRate', }, + { type: "filter", label: "是否寄存订单", prop: "isConsignment", filters: "whetherOrNot" }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 销售订单 + */ + export const SaleOrder = [ + { label: "销售订单号", prop: "number", fixed: "left",}, + { label: "订单行", prop: "soLine", }, + { label: "itemCode", prop: "itemCode", }, + { type:"object", label: "物料名称", prop: "item", showProp:"name", }, + { type:"object", label: "物料描述1", prop: "item", showProp:"desc1", }, + { type:"object", label: "物料描述2", prop: "item", showProp:"desc2", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 供应商发货通知 + */ + export const SupplierAsn = [ + { label: "订单号", prop: "poNumber", fixed: "left", width: "200px" }, + { label: "订单行", prop: "poLine", width: "200px" }, + { label: "箱标签", prop: "packingCode", width: "200px" }, + { label: "itemCode", prop: "itemCode", width: "200px" }, + { type: "object", label: "物品名称", prop: "item", showProp: "name", width: "200px" }, + { type: "object", label: "物品描述1", prop: "item", showProp: "desc1", width: "200px" }, + { type: "object", label: "物品描述2", prop: "item", showProp: "desc2", width: "200px" }, + // { type: "object", label: "到货数量", prop: "qty", showProp: "qty", width: "200px" }, + { type: "object", label: "发货数量", prop: "qty", showProp: "qty", width: "200px" }, + { type: "object", label: "计量单位", prop: "qty", showProp: "uom", width: "200px" }, + { label: "托标签", prop: "containerCode", width: "200px" }, + { label: "批次", prop: "lot", width: "200px" }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", width: "200px" }, + { label: "E-LEVEL等级", prop: "itemEqLevel", width: "200px" }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", width: "200px" }, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty", width: "200px" }, + { type: "object", label: "标包计量单位", prop: "stdPack", showProp: "packUom", width: "200px" }, + ] +/** + * @returns {Array} 客户发货通知 + */ + export const CustomerAsn = [ + { label: "订单号", prop: "poNumber", fixed: "left", }, + { label: "订单行", prop: "poLine", }, + { label: "箱标签", prop: "packingCode", }, + { label: "itemCode", prop: "itemCode", }, + { type: "object", label: "物品名称", prop: "item", showProp: "name", }, + { type: "object", label: "物品描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物品描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "发货数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "计量单位", prop: "qty", showProp: "uom", }, + { label: "托标签", prop: "containerCode", }, + { label: "批次", prop: "lot", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "object", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { type: "object", label: "标包计量单位", prop: "stdPack", showProp: "packUom", }, + ] +/** + * @returns {Array} 到货通知 + */ + export const ArriveNotice = [ + { label: "itemCode", prop: "itemCode",fixed:"left", }, + { type: "object", label: "物品名称", prop: "item", showProp: "name", }, + { type: "object", valueType: Number, label: "到货数量", prop: "qty", showProp: "qty", }, + { type: "object", valueType: Number, label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { label: "每托数量", prop: "qtyPerPallet", }, + { type: "object", label: "计量单位", prop: "qty", showProp: "uom", }, + { type: "object", label: "物品描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物品描述2", prop: "item", showProp: "desc2", }, + { label: "批次", prop: "lot", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { label: "订单号", prop: "poNumber", }, + { label: "订单行", prop: "poLine", }, + { label: "箱标签", prop: "packingCode", }, + { label: "托标签", prop: "containerCode", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 采购收货记录 + */ + export const PurchaseReceiptNote = [ + { label: "itemCode", prop: "itemCode",fixed: "left", }, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + // { type: "object", label: "到货数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "收货数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { label: "订单号", prop: "poNumber", }, + { label: "订单行", prop: "poLine", }, + { label: "箱标签", prop: "packingCode", }, + { label: "托标签", prop: "containerCode", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "包装单位", prop: "qty", showProp: "uom", }, + { type: "object", label: "标包单位", prop: "stdPack", showProp: "packUom", }, + { label: "E-LEVEL等级", prop: "labelEqLevel" }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 收购异常记录 + */ + export const ReceiptAbnormalNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left", }, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + // { type: "object", label: "到货数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "收货数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "包装单位", prop: "qty", showProp: "uom", }, + { type: "object", label: "标包单位", prop: "stdPack", showProp: "packUom", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 采购退货记录 + */ + export const PurchaseReturnNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left", }, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "箱标签", prop: "packingCode"}, + { label: "退货库位", prop: "locationCode"}, + { label: "发货单号", prop: "asnNumber" }, + { type: "object", label: "退货数量", prop: "qty", showProp: "qty", }, + { label: "批次", prop: "lot" }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty", }, + // { type: "object", label: "包装单位", prop: "qty", showProp: "uom", }, + { type: "object", label: "标包单位", prop: "stdPack", showProp: "packUom", }, + // { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 上架记录 + */ + export const PutawayNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left", }, + { label: "箱标签", prop: "toPackingCode", }, + { type: "object", valueType: Number, label: "上架数量", prop: "qty", showProp: "qty", }, + { type: "object", valueType: Number, label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "备料单位", prop: "qty", showProp: "uom", }, + { label: "目标库位", prop: "toLocationCode", }, + { label: "来源库位", prop: "fromLocationCode", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 要料申请 + */ + export const MaterialRequest = [ + { label: "itemCode", prop: "itemCode",fixed: "left", }, + { type: "object", valueType: Number, label: "要料数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "要料单位", prop: "qty", showProp: "uom", }, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { type: "object", label: "计量单位", prop: "stdPack", showProp: "packQty", }, + { label: "请求库位", prop: "requestLocationCode", }, + { label: "目标库位", prop: "toLocationCode", }, + { type: "dateTime", label: "过期日期", prop: "expiredTime", }, + { type: "object", label: "物品名称", prop: "item", showProp: "name", }, + { type: "object", label: "物品描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物品描述2", prop: "item", showProp: "desc2", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 发料记录 + */ + export const IssueNote = [ + { label: "itemCode", prop: "itemCode",fixed: "left", }, + // { label: "箱标签", type: "input", prop: "packingCode", }, + { type: "object", valueType: Number, label: "发料数量", prop: "qty", showProp: "qty", }, + { type: "object", valueType: Number, label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "发料单位", prop: "qty", showProp: "uom", }, + { label: "请求库位", prop: "fromRequestLocationCode", }, + { label: "目标库位", prop: "toLocationCode", }, + { label: "来源库位", prop: "fromLocationCode", }, + { type: "dateTime", label: "发料时间", prop: "issueTime", }, + { type: "dateTime", label: "过期时间", prop: "expiredTime", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "生产线", prop: "prodLine", }, + { label: "工作中心", prop: "workCenter", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 计划外入库记录 + */ + export const UnplannedReceiptNote = [ + { label: "itemCode", prop: "itemCode",fixed: "left", }, + // { label: "箱标签", type: "input", prop: "packingCode", }, + { type: "object", valueType: Number, label: "入库数量", prop: "qty", showProp: "qty", }, + { type: "object", valueType: Number, label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "入库单位", prop: "qty", showProp: "uom", }, + { label: "库位编号", prop: "locationCode", }, + { label: "箱标签", prop: "packingCode", }, + { label: "托标签", prop: "containerCode", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { label: "供应商代码", prop: 'supplierCode', }, + { label: "原因代码", prop: 'reasonCode', }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 计划外出库记录 + */ + export const UnplannedIssueNote = [ + { label: "itemCode", prop: "itemCode",fixed: "left", }, + // { label: "箱标签", type: "input", prop: "packingCode", }, + { type: "object", valueType: Number, label: "出库数量", prop: "qty", showProp: "qty", }, + { type: "object", valueType: Number, label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "出库单位", prop: "qty", showProp: "uom", }, + { label: "库位编号", prop: "locationCode", }, + { label: "箱标签", prop: "packingCode", }, + { label: "托标签", prop: "containerCode", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { label: "供应商代码", prop: 'supplierCode', }, + { label: "原因代码", prop: 'reasonCode', }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 隔离记录 + */ + export const IsolationNote = [ + { label: "itemCode", prop: "itemCode",fixed: "left", }, + // { label: "箱标签", type: "input", prop: "packingCode", }, + { type: "object", valueType: Number, label: "隔离数量", prop: "qty", showProp: "qty", }, + { type: "object", valueType: Number, label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "隔离单位", prop: "qty", showProp: "uom", }, + { label: "来源库位", prop: "fromLocationCode", }, + { label: "目标库位", prop: "toLocationCode", }, + { label: "来源箱标签", prop: "fromPackingCode", }, + { label: "目标箱标签", prop: "toPackingCode", }, + { label: "来源托标签", prop: "fromContainerCode", }, + { label: "来源托标签", prop: "toContainerCode", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 报废记录 + */ + export const ScrapNote = [ + { label: "itemCode", prop: "itemCode",fixed: "left", }, + // { label: "箱标签", type: "input", prop: "packingCode", }, + { type: "object", valueType: Number, label: "报废数量", prop: "qty", showProp: "qty", }, + { type: "object", valueType: Number, label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "报废单位", prop: "qty", showProp: "uom", }, + { label: "来源库位", prop: "fromLocationCode", }, + { label: "目标库位", prop: "toLocationCode", }, + { label: "来源箱标签", prop: "fromPackingCode", }, + { label: "目标箱标签", prop: "toPackingCode", }, + { label: "来源托标签", prop: "fromContainerCode", }, + { label: "来源托标签", prop: "toContainerCode", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 发货计划 + */ + export const DeliverPlan = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + // { type: "object", label: "到货数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "发货数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { type: "object", label: "包装单位", prop: "qty", showProp: "uom", }, + { type: "object", label: "标包单位", prop: "stdPack", showProp: "packUom", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "项目", prop: "project", }, + { label: "销售订单号", prop: "soNumber", }, + { label: "订单行", prop: "soLine", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 发货申请 + */ + export const DeliverRequest = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { type: "object", label: "发货数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { label: "目标库位", prop: "toLocationCode", }, + { type: "dateTime", label: "过期时间", prop: "expiredTime", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 发货记录 + */ + export const DeliverNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + // { label: "箱标签", type: "input", prop: "packingCode", }, + { type: "object", valueType: Number, label: "发货数量", prop: "qty", showProp: "qty", }, + { type: "object", valueType: Number, label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "发货单位", prop: "qty", showProp: "uom", }, + { label: "目标库位", prop: "toLocationCode", }, + { label: "来源库位", prop: "fromLocationCode", }, + { type: "dateTime", label: "发货时间", prop: "deliverTime", }, + { type: "dateTime", label: "过期时间", prop: "expiredTime", }, + { label: "来源箱标签", prop: "fromPackingCode", }, + { label: "目标箱标签", prop: "toPackingCode", }, + { label: "来源托标签", prop: "fromContainerCode", }, + { label: "目标托标签", prop: "toContainerCode", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 盘点计划 + */ + export const CountPlan = [ + { label: "itemCode", prop: "itemCode", fixed: "left", }, + // { type: "filter", filters: "checkStage", label: "阶段", prop: "stage",}, + // { label: "最终盘点数量", prop: "finalCountQty", }, + // { type: "object", label: "最终盘点数量单位", prop: "finalCountQty", showProp: "uom", }, + // { label: "盘点差异数量", prop: "diffQty" }, + { type: "object", label: "库存数量", prop: "inventoryQty", showProp: "qty", }, + { type: "object", label: "库存数量单位", prop: "inventoryQty", showProp: "uom", }, + { type: "filter", label: "库存状态", prop: "inventoryStatus", filters: "inventoryStage", }, + { label: "库位", prop: "locationCode", }, + { type: "filter", label: "明细状态", prop: "detailStatus", filters: "DetailStatus", }, + // { type: "object", label: "初盘数量", prop: "firstCount", showProp: "qty", }, + // { type: "objectDateTime", label: "初盘时间", prop: "firstCount", showProp: "time", }, + // { type: "object", label: "重盘数量", prop: "repeatCount", showProp: "qty", }, + // { type: "objectDateTime", label: "重盘时间", prop: "repeatCount", showProp: "time", }, + // { type: "object", label: "监盘数量", prop: "auditCount", showProp: "qty", }, + // { type: "objectDateTime", label: "监盘时间", prop: "auditCount", showProp: "time", }, + { label: "箱标签", prop: "packingCode", }, + { label: "托盘标签", prop: "palletLabel", }, + // { label: "盘点标签", prop: "countLabel", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + // { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { label: "批次", prop: "lot", }, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "备注", prop: 'remark', }, + ] + + /** + * @returns {Array} 调整库存 + */ + export const CountPlanAdjust = [ + { label: "盘点计划单号", prop: "countPlanNumber", fixed: "left", }, + // { type: "filter", filters: "stageType", label: "阶段", prop: "stage",}, + { label: "itemCode", prop: "itemCode", }, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "盘点数量", prop: "finalCountQty" }, + { label: "盘点差异数量", prop: "diffQty" }, + { type: "filter", label: "明细状态", prop: "detailStatus", filters: "DetailStatus", }, + { type: "object", label: "库存数量", prop: "inventoryQty", showProp: "qty", }, + // { type: "object", label: "初盘数量", prop: "firstCount", showProp: "qty", }, + // { type: "objectDateTime", label: "初盘时间", prop: "firstCount", showProp: "time", }, + // { type: "object", label: "重盘数量", prop: "repeatCount", showProp: "qty", }, + // { type: "objectDateTime", label: "重盘时间", prop: "repeatCount", showProp: "time", }, + // { type: "object", label: "监盘数量", prop: "auditCount", showProp: "qty", }, + // { type: "objectDateTime", label: "监盘时间", prop: "auditCount", showProp: "time", }, + // { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { label: "批次", prop: "lot", }, + // { label: "盘点标签", prop: "containerCode", }, + { label: "箱标签", prop: "packingCode", }, + { label: "库位编号", prop: "locationCode", }, + { type: "object", label: "库存单位", prop: "inventoryQty", showProp: "uom", }, + //{ label: "公司", prop: "company", }, + { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 盘点记录 + */ + export const CountNote = [ + { label: "盘点计划单号", prop: "countPlanNumber", fixed: "left", }, + // { type: "filter", filters: "checkStage", label: "阶段", prop: "stage",}, + { label: "itemCode", prop: "itemCode", }, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "盘点数量", prop: "finalCountQty" }, + { label: "盘点差异数量", prop: "diffQty" }, + { type: "filter", label: "明细状态", prop: "detailStatus", filters: "DetailStatus", }, + { type: "object", label: "库存数量", prop: "inventoryQty", showProp: "qty", }, + // { type: "object", label: "初盘数量", prop: "firstCount", showProp: "qty", }, + // { type: "objectDateTime", label: "初盘时间", prop: "firstCount", showProp: "time", }, + // { type: "object", label: "重盘数量", prop: "repeatCount", showProp: "qty", }, + // { type: "objectDateTime", label: "重盘时间", prop: "repeatCount", showProp: "time", }, + // { type: "object", label: "监盘数量", prop: "auditCount", showProp: "qty", }, + // { type: "objectDateTime", label: "监盘时间", prop: "auditCount", showProp: "time", }, + // { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { label: "批次", prop: "lot", }, + // { label: "盘点标签", prop: "containerCode", }, + { label: "箱标签", prop: "packingCode", }, + { label: "库位编号", prop: "locationCode", }, + { type: "object", label: "库存单位", prop: "inventoryQty", showProp: "uom", }, + //{ label: "公司", prop: "company", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 盘点差异调整记录 + */ + export const CountAdjustNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left", }, + // { type: "filter", filters: "checkStage", label: "阶段", prop: "stage",}, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", width: "300px" }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", width: "300px" }, + { label: "库位编号", prop: "locationCode", width: "200px" }, + // { type: "object", valueType: Number, label: "发货数量", prop: "InventoryQty", showProp: "qty", width: "100px" }, + { type: "object", label: "物料名称", prop: "item", showProp: "name", width: "150px" }, + // { type: "object", label: "发货单位", prop: "InventoryQty", showProp: "uom", width: "100px" }, + { label: "盘点差异数量", prop: "diffQty" }, + // { type: "filter", label: "明细状态", prop: "detailStatus", filters: "DetailStatus", width: "100px" }, + { label: "批次", prop: "lot", width: "100px" }, + { label: "库位编号", prop: "locationCode", width: "100px" }, + { label: "盘点数量", prop: "countQty", width: "100px" }, + { label: "调整数量", prop: "adjustQty", width: "100px" }, + { label: "箱标签", prop: "packingCode", }, + { label: "托标签", prop: "containerCode", }, + // { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { label: "原因编号", prop: "reasonCode", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 生产计划 + */ + export const ProductionPlan = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { type: "object", label: "物料名称", prop: "item", showProp: "name",}, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", valueType: Number, label: "计划数量", prop: "planQty", showProp: "qty", }, + // { label: "合格数量", prop: "goodQty", }, + // { label: "不合格数量", prop: "noGoodQty", }, + { type: "object", label: "计划单位", prop: "planQty", showProp: "uom", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "object", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { label: "Bom版本", prop: "bomVersion", }, + // { type: "input", label: "", prop: "bomVersion", }, + { label: "备注", prop: "remark", }, + ] +/** + * @returns {Array} 备料计划 + */ + export const PreparationPlan = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "备料数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "备料单位", prop: "qty", showProp: "uom", }, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "qty", }, + { type: "object", label: "标包单位", prop: "stdPack", showProp: "uom", }, + { label: "目标库位", prop: "toLocationCode", }, + { label: "工作中心", prop: "workStation", }, + { type: "dateTime", label: "最晚时间", prop: "latestTime", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 完工收货记录 + */ + export const ProductReceiptNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { type: "object", label: "物料名称", prop: "item", showProp: "name", width: "150px" }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", width: "300px" }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", width: "300px" }, + { label: "库位编号", prop: "locationCode", }, + { label: "原料库位", prop: "rawLocation", width: "100px" }, + { type: "object", valueType: Number, label: "完工收货数量", prop: "qty", showProp: "qty", width: "100px" }, + { type: "object", valueType: Number, label: "标包数量", prop: "stdPack", showProp: "packQty", width: "100px" }, + { type: "object", label: "完工收货单位", prop: "qty", showProp: "uom", width: "100px" }, + { label: "箱标签", prop: "packingCode", }, + { label: "托标签", prop: "containerCode", }, + { label: "批次", prop: "lot", width: "100px" }, + { label: "生产线", prop: "prodLine", width: "100px" }, + { label: "Bom版本", prop: "bomVersion", width: "100px" }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { label: "原因编号", prop: "reasonCode", width: "100px" }, + { label: "备注", prop: 'remark', width: "300px" }, + ] +/** + * @returns {Array} 下线结算记录 + */ + export const OfflineSettlementNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { type: "object", label: "物料名称", prop: "item", showProp: "name",}, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", valueType: Number, label: "下线结算数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "下线结算单位", prop: "qty", showProp: "uom", }, + { label: "库位编号", prop: "locationCode", }, + { label: "箱标签", prop: "packingCode", }, + { label: "托标签", prop: "containerCode", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + // { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + // { type: "dateTime", label: "生产日期", prop: "creationTime" }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 追溯记录 + */ + export const TracebackNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { type: "object", label: "物料名称", prop: "item", showProp: "name",}, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", valueType: Number, label: "消耗数量", prop: "rawQty", showProp: "qty", }, + { type: "object", label: "标包单位", prop: "rawQty", showProp: "uom", }, + { label: "来源库位代码", prop: "rawLocation", }, + { label: "箱标签", prop: "packingCode", }, + { label: "托标签", prop: "rawContainerCode", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + // { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + // { type: "dateTime", label: "生产日期", prop: "creationTime", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 成品回收记录 + */ + export const ProductRecycleNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "库位编号", prop: "locationCode", }, + { label: "原料库位编号", prop: "rawLocation", }, + { type: "object", valueType: Number, label: "成品回收数量", prop: "qty", showProp: "qty", }, + { type: "object", valueType: Number, label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { label: "批次", prop: "lot", }, + { type: "object", label: "成品回收单位", prop: "qty", showProp: "uom", }, + { label: "箱标签", prop: "packingCode", }, + { label: "托标签", prop: "containerCode", }, + { label: "生产线", prop: "prodLine", }, + { label: "Bom版本", prop: "bomVersion", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 退库记录 + */ + export const StockReturnNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", valueType: Number, label: "退库数量", prop: "qty", showProp: "qty", }, + { type: "object", valueType: Number, label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { type: "object", label: "退库单位", prop: "qty", showProp: "uom", }, + { label: "来源库位", prop: "fromLocationCode", }, + { label: "目标库位", prop: "toLocationCode", }, + { label: "来源箱标签", prop: "fromPackingCode", }, + { label: "目标箱标签", prop: "toPackingCode", }, + { label: "来源托标签", prop: "fromContainerCode", }, + { label: "目标托标签", prop: "toContainerCode", }, + { label: "生产线", prop: "prodLine", }, + { label: "工作中心", prop: "workCenter", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 客户退库记录 + */ + export const CustomerReturnNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", valueType: Number, label: "退货数量", prop: "qty", showProp: "qty", }, + { type: "object", valueType: Number, label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { type: "object", label: "退货单位", prop: "qty", showProp: "uom", }, + { label: "来源库位", prop: "fromLocationCode", }, + { label: "目标库位", prop: "toLocationCode", }, + { label: "来源箱标签", prop: "fromPackingCode", }, + { label: "目标箱标签", prop: "toPackingCode", }, + { label: "来源托标签", prop: "fromContainerCode", }, + { label: "目标托标签", prop: "toContainerCode", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { label: "备注", prop: 'remark', }, + ] + /** + * @returns {Array} 调拨发货 + */ + export const WareHouseTransferNote = [ + { label: "物品编号", prop: "itemCode", fixed: "left",}, + { type: "object", label: "物品名称", prop: "item", showProp: "name", }, + { type: "object", label: "物品描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物品描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { label: "目标库位", prop: "toLocationCode", }, + { label: "来源库位", prop: "fromLocationCode", }, + { label: "目标仓库", prop: "toWarehouseCode", }, + { label: "来源仓库", prop: "fromWarehouseCode", }, + { type: "filter", filters: "requestStatus", label: "从状态", prop: "fromStatus",}, + { type: "filter", filters: "requestStatus", label: "到状态", prop: "toStatus",}, + { label: "原因", prop: "reason",}, +] + +/** + * @returns {Array} 返修记录 + */ + export const ReworkNote = [ + { label: "工单号", prop: "number", fixed: "left" }, + { label: "物料代码", prop: 'itemCode' }, + { label: "物料名称", prop: 'item', showProp: 'name', type: "object" }, + { label: "描述1", prop: 'item', showProp: 'desc1', type: "object" }, + { label: "描述1", prop: 'item', showProp: 'desc1', type: "object" }, + { label: "批次", prop: 'lot' }, + { label: "箱标签", prop: 'packingCode' }, + { label: "单位", prop: 'qty', showProp: 'uom', type: "object" }, + { label: "数量", prop: 'qty', showProp: 'qty', type: "object" }, + { label: "库位代码", prop: 'locationCode' }, + { label: "仓库", prop: 'warehouseCode' }, + { label: "操作员", prop: 'worker' }, + { label: "任务ID", prop: 'jobNumber',}, + { type: "dateTime", label: "创建时间", prop: "creationTime",}, + { label: "备注", prop: "remark",}, + ] + +/** + * @returns {Array} 报检单 + */ + export const InspectNotice = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "箱标签", prop: "packingCode",}, + { label: "托标签", prop: "containerCode",}, + { label: "批次", prop: "lot" }, + { label: "库位代码", prop: "locationCode",}, + // { label: "抽检百分比", prop: "samplePercent",}, + // { label: "检验数量", prop: "inspectQty",}, + { type: "object", label: "收货数量", prop: "receiveQty", showProp: "qty", }, + { type: "object", label: "收货单位", prop: "receiveQty", showProp: "uom",}, + { type: "filter", filters: "inspectType", label: "检验类型", prop: "inspectType",}, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty",}, + { type: "object", label: "标包单位", prop: "stdPack", showProp: "packUom",}, + { label: "订单号", prop: "poNumber",}, + // { label: "订单行", prop: "poLine",}, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + ] +/** + * @returns {Array} 检验记录 + */ + export const InspectNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "检验数量", prop: "inspectQty",}, + { label: "合格数量", prop: "goodQty",}, + { label: "不合格数量", prop: "failedQty",}, + { label: "不合格原因", prop: "failedReason",}, + { label: "破坏数量", prop: "crackQty",}, + { type: "object", label: "收货数量", prop: "receiveQty", showProp: "qty", }, + { type: "object", label: "收货单位", prop: "receiveQty", showProp: "uom",}, + { type: "filter", filters: "taskType", label: "检验类型", prop: "inspectType",}, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty",}, + { type: "object", label: "标包单位", prop: "stdPack", showProp: "packUom",}, + { label: "库位代码", prop: "locationCode",}, + { label: "箱标签", prop: "packingCode",}, + { label: "托标签", prop: "containerCode",}, + { label: "批次", prop: "lot", }, + { label: "订单号", prop: "poNumber",}, + { label: "订单行", prop: "poLine",}, + { label: "备注", prop: 'remark', }, + ] +/** + * @returns {Array} 质量异常记录 + */ + export const InspectAbnormalNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "质量异常数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { type: "object", label: "质量异常单位", prop: "qty", showProp: "uom", }, + { label: "异常类型", prop: "abnormalType", }, + { label: "箱标签", prop: "packingCode",}, + { label: "托标签", prop: "containerCode",}, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { label: "备注", prop: 'remark', }, + ] + /** + * @returns {Array} 采购收货任务 + */ + export const PurchaseReceiptJob = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "实际收货数量", prop: "handledQty", showProp: "qty", }, + { type: "object", label: "推荐收货数量", prop: "recommendQty", showProp: "qty", }, + { type: "object", label: "收货单位", prop: "recommendQty", showProp: "uom",}, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty",}, + { type: "object", label: "标包单位", prop: "stdPack", showProp: "packUom",}, + { label: "实际库位", prop: "handledLocationCode",}, + { label: "推荐库位", prop: "recommendLocationCode",}, + { label: "实际箱标签", prop: "handledPackingCode", }, + { label: "推荐箱标签", prop: "recommendPackingCode",}, + { label: "实际托标签", prop: "handledContainerCode",}, + { label: "推荐托标签", prop: "recommendContainerCode",}, + { type: "object", label: "实际供应商批次", prop: "handledBatch", showProp: "supplierBatch",}, + { type: "object", label: "推荐供应商批次", prop: "recommendBatch", showProp: "supplierBatch",}, + { label: "订单号", prop: "poNumber",}, + { label: "订单行", prop: "poLine",}, + { label: "E-LEVEL等级", prop: "labelEqLevel" }, + // { label: "备注", prop: 'remark', }, + // { type: "input", label: "目标库位", prop: "toLocation",}, +] + /** + * @returns {Array} 采购退货任务 + */ + export const PurchaseReturnJob = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { label: "实际箱标签", prop: "handledPackingCode", }, + { label: "推荐箱标签", prop: "recommendPackingCode",}, + { type: "object", label: "实际收货数量", prop: "handledQty", showProp: "qty", }, + { type: "object", label: "推荐收货数量", prop: "recommendQty", showProp: "qty", }, + { type: "object", label: "收货单位", prop: "recommendQty", showProp: "uom",}, + { label: "实际库位", prop: "handledLocationCode",}, + // { type: "input", label: "目标库位", prop: "toLocation",}, + { label: "推荐库位", prop: "recommendLocationCode",}, + { label: "实际托标签", prop: "handledContainerCode",}, + { label: "推荐托标签", prop: "recommendContainerCode",}, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "包装数量", prop: "stdPack", showProp: "packQty",}, + { type: "object", label: "包装单位", prop: "stdPack", showProp: "packUom",}, + { type: "object", label: "实际供应商批次", prop: "handledBatch", showProp: "supplierBatch",}, + { type: "object", label: "推荐供应商批次", prop: "recommendBatch", showProp: "supplierBatch",}, + { label: "订单号", prop: "poNumber",}, + { label: "订单行", prop: "poLine",}, + { label: "备注", prop: 'remark', }, +] + /** + * @returns {Array} 上架任务 + */ + export const PutawayJob = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "实际箱标签", prop: "handledPackingCode",}, + { label: "推荐箱标签", prop: "recommendPackingCode",}, + { label: "实际托标签", prop: "handledContainerCode",}, + { label: "推荐托标签", prop: "recommendContainerCode",}, + { type: "object", label: "实际上架数量", prop: "handledQty", showProp: "qty", }, + { type: "object", label: "推荐上架数量", prop: "recommendQty", showProp: "qty", }, + { label: "实际库位", prop: "handledLocationCode",}, + { label: "推荐库位", prop: "recommendLocationCode",}, + // { type: "object", label: "实际供应商批次", prop: "handledBatch", showProp: "supplierBatch",}, + // { type: "object", label: "推荐供应商批次", prop: "recommendBatch", showProp: "supplierBatch",}, + { label: "库存状态", type: "filter", filters: "inventoryStage", prop: "status", }, + { type: "object", label: "收货单位", prop: "recommendQty", showProp: "uom",}, + { type: "object", label: "包装数量", prop: "stdPack", showProp: "packQty",}, + { type: "object", label: "包装单位", prop: "stdPack", showProp: "packUom",}, + { label: "订单号", prop: "poNumber",}, + { label: "订单行", prop: "poLine",}, + // { label: "从库位", prop: "fromLocationCode",}, + // { type: "input", label: "目标库位", prop: "toLocation",}, + // { type: "object", label: "实际收货数量", prop: "handledQty", showProp: "qty", }, + // { type: "object", label: "推荐收货数量", prop: "recommendQty", showProp: "qty", }, + // { label: "备注", prop: 'remark', }, +] + /** + * @returns {Array} 检验任务 + */ + export const InspectJob = [ + { label: "itemCode", prop: "itemCode", fixed:"left", }, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "实际箱标签",prop: "handledPackingCode",}, + { label: "推荐箱标签", prop: "recommendPackingCode",}, + { label: "实际托标签", prop: "handledContainerCode",}, + { label: "推荐托标签", prop: "recommendContainerCode",}, + { type: "filter", filters: "inspectType", label: "检验类型", prop: "inspectType",}, + { type: "object", label: "收货数量", prop: "receiveQty", showProp: "qty", }, + { label: "检验数量", prop: "inspectQty",}, + { label: "合格数量", prop: "goodQty",}, + { label: "不合格数量", prop: "failedQty",}, + { label: "最终不合格数量", prop: "notPassedQty",}, + { label: "破坏数量", prop: "crackQty",}, + { type: "object", label: "收货单位", prop: "receiveQty", showProp: "uom",}, + { label: "实际库位", prop: "handledLocationCode",}, + { label: "推荐库位", prop: "recommendLocationCode",}, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch",}, + { label: "备注", prop: 'remark', }, + // { type: "object", label: "收货单位", prop: "receiveQty", showProp: "uom",}, + // { label: "箱标签", prop: "packingCode",}, + // { label: "托标签", prop: "handledContainerCode",}, + // { label: "不合格原因", prop: "failedReason",}, + // { type: "object", label: "到货数量", prop: "handledQty", showProp: "qty",}, + // { type: "object", label: "到货单位", prop: "handledQty", showProp: "uom",}, + // { type: "object", label: "包装数量", prop: "stdPack", showProp: "packQty",}, + // { type: "object", label: "包装单位", prop: "stdPack", showProp: "packUom",}, + // { label: "订单号", prop: "poNumber",}, + // { label: "订单行", prop: "poLine",}, + +] + /** + * @returns {Array} 发料任务 + */ + export const IssueJob = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "实际箱标签", prop: "handledPackingCode",}, + { label: "推荐箱标签", prop: "recommendPackingCode",}, + { label: "请求库位", prop: "fromRequestLocationCode", }, + { type: "object", label: "实际数量", prop: "handledQty", showProp: "qty", }, + { type: "object", label: "实际单位", prop: "handledQty", showProp: "uom",}, + { type: "object", label: "推荐数量", prop: "recommendQty", showProp: "qty", }, + { type: "object", label: "推荐单位", prop: "recommendQty", showProp: "uom",}, + { label: "实际库位", prop: "handledLocationCode",}, + { label: "到库位", prop: "toLocationCode",}, + { label: "推荐库位", prop: "recommendLocationCode",}, + { label: "实际批次", prop: "handledLot",}, + { label: "推荐批次", prop: "recommendLot",}, + // { type: "object", label: "实际批次", prop: "handledBatch", showProp: "supplierBatch",}, + { type: "objectDateTime", label: "实际生产日期", prop: "handledBatch", showProp: "produceDate",}, + // { type: "object", label: "推荐批次", prop: "recommendBatch", showProp: "supplierBatch",}, + { type: "objectDateTime", label: "推荐生产日期", prop: "recommendBatch", showProp: "produceDate",}, + // { label: "箱标签", prop: "packingCode",}, + { label: "托标签", prop: "containerCode",}, + { type: "object", label: "包装数量", prop: "stdPack", showProp: "packQty",}, + { type: "object", label: "包装单位", prop: "stdPack", showProp: "packUom",}, + { label: "订单号", prop: "poNumber",}, + { label: "订单行", prop: "poLine",}, + { label: "备注", prop: 'remark', }, +] + /** + * @returns {Array} 收料任务 + */ + export const IssueAcceptJob = [ + { label: "实际箱标签", prop: "handledPackingCode", fixed: "left",}, + { label: "itemCode", prop: "itemCode",}, + { label: "推荐箱标签", prop: "recommendPackingCode",}, + { type: "object", label: "实际库位数量", prop: "handledQty", showProp: "qty", }, + { type: "object", label: "实际库位单位", prop: "handledQty", showProp: "uom",}, + { label: "实际库位", prop: "handledLocationCode",}, + { label: "目标库位", prop: "toLocation",}, + { label: "推荐库位", prop: "recommendLocationCode",}, + { label: "托标签", prop: "containerCode",}, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + // { type: "object", label: "到货数量", prop: "handledQty", showProp: "qty",}, + // { type: "object", label: "到货单位", prop: "handledQty", showProp: "uom",}, + { type: "object", label: "包装数量", prop: "stdPack", showProp: "packQty",}, + { type: "object", label: "包装单位", prop: "stdPack", showProp: "packUom",}, + { type: "object", label: "批次", prop: "batch", showProp: "supplierBatch",}, + { label: "订单号", prop: "poNumber",}, + { label: "订单行", prop: "poLine",}, + { label: "备注", prop: 'remark', }, +] + /** + * @returns {Array} 完工收货任务 + */ + export const ProductReceiveJob = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { label: "箱标签", prop: "packingCode",}, + { type: "object", label: "收货数量", prop: "handledQty", showProp: "qty", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + { label: "实际库位", prop: "handledLocationCode",}, + // { label: "目标库位", prop: "toLocation",}, + { label: "推荐库位", prop: "recommendLocationCode",}, + { type: "object", label: "收货单位", prop: "handledQty", showProp: "uom",}, + // { label: "箱标签", prop: "packingCode",}, + { label: "托标签", prop: "containerCode",}, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + // { type: "object", label: "到货数量", prop: "handledQty", showProp: "qty",}, + // { type: "object", label: "到货单位", prop: "handledQty", showProp: "uom",}, + { type: "object", label: "包装数量", prop: "stdPack", showProp: "packQty",}, + { type: "object", label: "包装单位", prop: "stdPack", showProp: "packUom",}, + { label: "订单号", prop: "poNumber",}, + { label: "订单行", prop: "poLine",}, + { label: "备注", prop: 'remark', }, +] + /** + * @returns {Array} 发货任务 + */ + export const DeliverJob = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { label: "实际箱标签", prop: "handledPackingCode", }, + { label: "推荐箱标签", prop: "recommendPackingCode",}, + { type: "object", label: "实际数量", prop: "handledQty", showProp: "qty", }, + { type: "object", label: "实际单位", prop: "handledQty", showProp: "uom",}, + { type: "object", label: "推荐数量", prop: "recommendQty", showProp: "qty", }, + // { type: "object", label: "推荐单位", prop: "recomendQty", showProp: "uom",}, + // { label: "实际库位", prop: "handledLocationCode",}, + // { label: "推荐库位", prop: "recommendLocationCode",}, + { label: "从库位", prop: "fromLocationCode",}, + { type: "object", label: "实际批次", prop: "handledBatch", showProp: "supplierBatch", }, + { type: "objectDateTime", label: "实际日期", prop: "handledBatch", showProp: "produceDate",}, + { type: "object", label: "推荐批次", prop: "recommendBatch", showProp: "supplierBatch", }, + { type: "object", label: "推荐日期", prop: "recommendBatch", showProp: "produceDate",}, + { label: "托标签", prop: "containerCode",}, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + // { type: "object", label: "到货数量", prop: "handledQty", showProp: "qty",}, + // { type: "object", label: "到货单位", prop: "handledQty", showProp: "uom",}, + { type: "object", label: "包装数量", prop: "stdPack", showProp: "packQty",}, + { type: "object", label: "包装单位", prop: "stdPack", showProp: "packUom",}, + { label: "备注", prop: 'remark', }, +] + /** + * @returns {Array} 校验任务 + */ + export const CheckJob = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { label: "实际箱标签", prop: "packingCode",}, + { type: "object", label: "库存数量", prop: "inventoryQty", showProp: "qty", }, + { type: "object", label: "库存单位", prop: "inventoryQty", showProp: "uom",}, + { label: "实际库位", prop: "locationCode",}, + { label: "托标签", prop: "containerCode",}, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "包装数量", prop: "stdPack", showProp: "packQty",}, + { type: "object", label: "包装单位", prop: "stdPack", showProp: "packUom",}, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch",}, + { label: "订单号", prop: "poNumber",}, + { label: "订单行", prop: "poLine",}, + { label: "备注", prop: 'remark', }, +] + /** + * @returns {Array} 盘点任务 + */ + export const CountJob = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { label: "箱标签", prop: "packingCode",}, + { type: "object", label: "实际数量", prop: "countQty", showProp: "qty", }, + { type: "object", label: "实际单位", prop: "countQty", showProp: "uom",}, + { type: "object", label: "库存数量", prop: "inventoryQty", showProp: "qty", }, + { type: "object", label: "库存单位", prop: "inventoryQty", showProp: "uom",}, + { label: "库位编号", prop: "locationCode",}, + { type: "filter", label: "库存状态", prop: "status", filters:"inventoryStage"}, + { type: "object", label: "包装数量", prop: "stdPack", showProp: "packQty",}, + { type: "object", label: "包装单位", prop: "stdPack", showProp: "packUom",}, + { label: "托标签", prop: "containerCode",}, + //{ label: "物料代码", prop: "itemCode",}, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + // { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch",}, + { label: "批次", prop: "lot", }, + { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 仓库管理-发运管理-发货任务(天津) + */ + export const Shipments = [ + {label: "器具编号",prop: "containerCode", width: "300px"}, + { label: "产品数量", prop: "itemQty" }, + { label: "来源库位", prop: "fromLocationCode"}, + { label: "目标库位", prop: "toLocationCode"}, + // { type: "filter", label: "发货状态", prop: "status", filters: "ShipmentsTjStatus",}, + { label: "备注", prop: 'remark' } +] + +/** + * @returns {Array} 仓库管理-发运管理-器具查询(天津) + */ + export const Instruments = [ + {label: "器具编号",prop: "containerCode"}, + { label: "序号", prop: "seqNo" }, + { label: "生产线编码", prop: "productNo"}, + { label: "项目号", prop: "projectCode", }, + { label: "配置码", prop: "itemCode" }, + { label: "批次", prop: "lot"}, + { label: "箱码", prop: "packingCode" }, + { label: "位置", prop: "position" }, + { label: "库存状态", type: "filter", filters: "inventoryStage", prop: "status", }, + { label: "备注", prop: 'remark' } +] + +/** + * @returns {Array} 仓库管理-发运管理-收货记录(天津) + */ +export const ReceivingRecords = [ + { label: "序号", prop: "seqNo" }, + { label: "配置码", prop: "itemCode" }, + {label: "器具编号",prop: "containerCode", width: "300px"}, + { type: "object", label: "名称", prop: "item", showProp: "name" }, + { label: "生产线编码", prop: "prodLine"}, + { label: "生产码", prop: "productNo", }, + { label: "项目号", prop: "projectCode", }, + { label: "批次", prop: "lot"}, + { label: "收货库位", prop: "locationCode" }, +] + +/** + * @returns {Array} 仓库管理-发运管理-发货记录(天津) + */ + export const DeliveryRecord = [ + {label: "器具编号",prop: "toContainerCode", width: "300px"}, + // { label: "序号", prop: "seqNo" }, + { label: "配置码", prop: "itemCode" }, + { type: "object", label: "名称", prop: "item", showProp: "name" }, + { label: "生产码", prop: "productNo", }, + { label: "项目号", prop: "projectCode", }, + { label: "批次", prop: "toLot"}, + { label: "来源库位", prop: "fromLocationCode" }, + { label: "目标库位", prop: "toLocationCode" }, + { label: "备注", prop: 'remark' } +] + +/** + * @returns {Array} 仓库管理-发运管理-回收记录(天津) + */ + export const JisProductRecycleNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { type: "object", label: "物品名称", prop: "item", showProp: "name", }, + { type: "object", label: "物品描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物品描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { label: "箱标签", prop: "packingCode"}, + { label: "托标签", prop: "containerCode"}, + { label: "仓库", prop: "warehouseCode"}, + { label: "库位", prop: "locationCode"}, + { label: "批次", prop: "lot"}, + { label: "生产计划单号", prop: "productionPlanNumber"}, + { label: "产品号", prop: "productNo" }, + { label: "项目号", prop: "projectCode" }, + { label: "原料库位", prop: "rawLocation"}, + { label: "生产线", prop: "prodLine"}, +] +/** + * @returns {Array} 仓库管理-发运管理-退库记录(天津) + */ + export const JisProductReturnNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { type: "object", label: "物品名称", prop: "item", showProp: "name", }, + { type: "object", label: "物品描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物品描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "数量", prop: "qty", showProp: "qty", }, + // { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { label: "产品号", prop: "productNo" }, + { label: "项目号", prop: "projectCode" }, + { label: "原因", prop: "reason" }, +] +/** + * @returns {Array} 仓库管理-发运管理-库存转移记录(天津) + */ + export const JisProductTransferNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { type: "object", label: "物品名称", prop: "item", showProp: "name", }, + { type: "object", label: "物品描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物品描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "数量", prop: "qty", showProp: "qty", }, + { label: "批次", prop: "lot" }, + { label: "产品号", prop: "productNo" }, + { label: "项目号", prop: "projectCode" }, + { label: "原因", prop: "reason" }, +] +/** + * @returns {Array} 供应商考核看板-汇总报表 + */ + export const SupplierAssessmentReportForm = [ + { label: "供应商代码", prop: "supplierCode" }, + { label: "供应商名称", prop: "supplierName" }, + { label: "ASN单号", prop: 'asnNumber' }, + { label: "ASN发货时间", prop: 'asnShippingTime', type:'dateTime' }, + // { label: "考核内容", prop: 'reason' }, + { type: "filter", label: "考核内容", prop: "reason", filters: "reasonStatus" }, + { label: "扣分分数", prop: 'scope' }, + { label: "扣分时间", prop: 'evaluationTime', type:'dateTime' }, + { label: "备注", prop: 'remark' }, +] + +/** + * @returns {Array} JIS信息查询 + */ + export const JISMessageQuery = [ + { label: "物品代码", prop: "itemCode", }, + { label: "物品名称",type: "object", prop: "item", showProp: "name" }, + { label: "物品描述",type: "object", prop: "item", showProp: "desc1" }, + { label: "产品号", prop: "productNo" }, + { label: "项目号", prop: 'program' }, + { label: "位置", prop: 'position' }, + { label: "FATA", prop: 'fata' }, + { label: "配置号", prop: 'configuration' }, + { label: "L7零件", prop: 'l7Part' }, + { type: "filter", label: "是否自动回冲", prop: "isAutoBackFlush", filters: "whetherOrNot" }, + { label: "数量", prop: 'qty' }, +] + +/** + * @returns {Array} 鸿翔外库jis发货 + */ + export const OuterJisDeliverNote = [ + { label: "单据号", prop: "number" }, + { label: "物品代码", prop: "itemCode" }, + { label: "发货单号", prop: 'deliverNumber' }, + { label: "生产号", prop: 'productionNumber' }, + { label: "REV", prop: 'rev' }, + { label: "配置号", prop: 'l7Part' }, + { label: "流水号", prop: 'serialNumber' }, + { label: "物品描述", prop: 'itemName' }, + { label: "位置", prop: 'position' }, + { label: "数量", prop: 'qty' }, + { label: "站别名", prop: 'siteNickName' }, + { label: "发货用户", prop: 'deliverPeople' }, + { label: "发货时间", prop: 'deliverDate', type:'dateTime' }, + { label: "收货方", prop: 'shipToOrDock' }, + { label: "发货方式", prop: 'shipVia' }, + { label: "运输方式", prop: 'modeOfTransport' }, + { label: "承运商", prop: 'carrier' }, + { label: "承运商参考", prop: 'carrierShipmentRef' }, + { label: "车辆", prop: 'vehicleID' }, + { label: "销售订单号", prop: 'order' }, + { label: "销售订单行", prop: 'line' }, + { label: "车型年份", prop: 'modelYear' }, + { label: "客户地址编码", prop: 'customerAddressCode' }, +] + +/** + * @returns {Array} 发货记录 + */ +export const OuterPillarDeliverNote = [ + { label: "单据号", prop: "number" }, + { label: "物品代码", prop: "itemCode" }, + { label: "发货单号", prop: 'deliverNumber' }, + // { label: "生产号", prop: 'productionNumber' }, + // { label: "REV", prop: 'rev' }, + // { label: "配置号", prop: 'l7Part' }, + // { label: "流水号", prop: 'serialNumber' }, + { label: "物品描述1", prop: 'item', showProp:'desc1', type: "object" }, + { label: "物品描述2", prop: 'item', showProp:'desc2', type: "object" }, + { label: "来源库位", prop: 'locationCode' }, + { label: "发货数量", prop: 'qty', showProp: 'qty', type: 'object' }, + // { label: "位置", prop: 'position' }, + // { label: "数量", prop: 'qty' }, + // { label: "站别名", prop: 'siteNickName' }, + // { label: "发货用户", prop: 'deliverPeople' }, + { label: "发货时间", prop: 'deliverDate', type:'dateTime' }, + { label: "收货方", prop: 'shipToOrDock' }, + { label: "发货方式", prop: 'shipVia' }, + { label: "运输方式", prop: 'modeOfTransport' }, + { label: "承运商", prop: 'carrier' }, + { label: "承运商参考", prop: 'carrierShipmentRef' }, + { label: "车辆", prop: 'vehicleID' }, + { label: "销售订单号", prop: 'order' }, + { label: "销售订单行", prop: 'line' }, + // { label: "车型年份", prop: 'modelYear' }, + { label: "客户地址编码", prop: 'customerAddressCode' }, +] + +/** + * @returns {Array} 鸿翔外库jis计划外入库 + */ + export const OuterJisUnplannedReceiptNote = [ + { label: "单据号", prop: "number" }, + { label: "物品代码", prop: "itemCode" }, + { label: "物品描述", prop: 'itemName' }, + { label: "计划外入库单号", prop: 'outerUnplannedReceiptNumber' }, + { label: "单据类型", prop: 'documentType' }, + { label: "生产号", prop: 'productionNumber' }, + { label: "REV", prop: 'rev' }, + { label: "配置号", prop: 'l7Part' }, + { label: "条码", prop: 'barCode' }, + { label: "批次", prop: 'lot' }, + { label: "数量", prop: 'qty' }, + { label: "库位", prop: 'locationCode' }, + { label: "用户", prop: 'unplannedReceiptPeople' }, + { label: "用户姓名", prop: 'unplannedReceiptPeopleName' }, + { label: "计划外入库时间", prop: 'unplannedReceiptDate', type:'dateTime' }, +] + + + +/** + * @returns {Array} 鸿翔外库jis计划外出库 + */ + export const OuterJisUnplannedIssueNote = [ + { label: "单据号", prop: "number" }, + { label: "物品代码", prop: "itemCode" }, + { label: "物品描述", prop: 'itemName' }, + { label: "计划外出库单号", prop: 'outerUnplannedIssueNumber' }, + { label: "单据类型", prop: 'documentType' }, + { label: "生产号", prop: 'productionNumber' }, + { label: "REV", prop: 'rev' }, + { label: "配置号", prop: 'l7Part' }, + { label: "条码", prop: 'barCode' }, + { label: "批次", prop: 'lot' }, + { label: "数量", prop: 'qty' }, + { label: "库位", prop: 'locationCode' }, + { label: "用户", prop: 'unplannedIssuePeople' }, + { label: "用户姓名", prop: 'unplannedIssuePeopleName' }, + { label: "计划外出库时间", prop: 'unplannedIssueDate', type:'dateTime' }, +] + +/** + * @returns {Array} 单块门板-发货记录 + */ +export const SingleDoorPanelDeliverNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left" }, + { type: "object", label: "物料名称", prop: "item", showProp: "name" }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1" }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2" }, + { label: "目标批次", prop: "toLot" }, + { label: "来源批次", prop: "fromLot" }, + { label: "来源箱标签", prop: "fromPackingCode" }, + { label: "目标箱标签", prop: "toPackingCode" }, + { label: "来源托标签", prop: "fromContainerCode" }, + { label: "来源托标签", prop: "toContainerCode" }, + { type: "object", label: "发货数量", prop: "qty", showProp: "qty" }, + { type: "object", label: "发货单位", prop: "qty", showProp: "uom" }, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty" }, + { label: "目标库位", prop: "toLocationCode" }, + { label: "来源库位", prop: "fromLocationCode" }, + { label: "目标仓库", prop: "toWarehouseCode" }, + { label: "来源仓库", prop: "fromWarehouseCode" }, + { type: "dateTime", label: "发货时间", prop: "deliverTime" }, + { type: "dateTime", label: "过期时间", prop: "expiredTime" }, + { label: "产品号", prop: "productNo" }, + { label: "项目号", prop: "projectCode" }, + { label: "位置", prop: "position" }, + { label: "包装箱容量/箱", prop: "packCapacity" }, + { label: "上线类型", prop: "onlineType" }, + { label: "阶段", prop: "stage" }, + { label: "用途", prop: "usedFor" }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch" }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate" }, + { label: "备注", prop: 'remark' }, +] + +/** + * @returns {Array} 单块门板-完工收货记录 + */ +export const SingleDoorPanelProductReceiptNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left" }, + { type: "object", label: "物料名称", prop: "item", showProp: "name" }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1" }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2" }, + { label: "批次", prop: "lot" }, + { label: "箱标签", prop: "packingCode" }, + { label: "托标签", prop: "containerCode" }, + { type: "object", label: "完工收货数量", prop: "qty", showProp: "qty" }, + { type: "object", label: "完工单位", prop: "qty", showProp: "uom" }, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty" }, + { type: "object", label: "标包单位", prop: "stdPack", showProp: "packUom" }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch" }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate" }, + { label: "库位", prop: "locationCode" }, + { label: "原料库位", prop: "rawLocation" }, + { label: "生产线", prop: "prodLine" }, + { label: "Bom版本", prop: "bomVersion" }, + { label: "产品号", prop: "productNo" }, + { label: "项目号", prop: "projectCode" }, + { label: "位置", prop: "position" }, + { label: "仓库", prop: "warehouseCode", }, + { label: "备注", prop: 'remark' }, +] + +/** + * @returns {Array} 单块门板-完工调整记录 + */ +export const SingleDoorPanelProductAdjust = [ + { label: "完工调整单号", prop: "number" }, + { label: "物料代码", prop: 'itemCode',}, + { label: "批次", prop: 'lot',}, + { label: "箱标签", prop: 'packingCode',}, + { label: "托标签", prop: 'containerCode',}, + { label: "仓库代码", prop: 'warehouseCode',}, + { label: "数量", prop: 'qty', showProp: 'qty', type: 'object'}, + { label: "单位", prop: 'qty', showProp: 'uom', type: 'object'}, + { label: "标包数量", prop: 'stdPack', showProp: 'packQty', type: 'object'}, + { label: "标包单位", prop: 'stdPack', showProp: 'packUom', type: 'object'}, + { label: "库位代码", prop: 'locationCode',}, +] + + /** + * @returns {Array} 单块门板-库移记录 + */ + export const SingleDoorPanelProductTransferNote = [ + { label: "物品编号", prop: "itemCode", fixed: "left" }, + { type: "object", label: "物品名称", prop: "item", showProp: "name" }, + { type: "object", label: "物品描述1", prop: "item", showProp: "desc1" }, + { type: "object", label: "物品描述2", prop: "item", showProp: "desc2" }, + { label: "批次", prop: "lot" }, + { label: "箱标签", prop: "packingCode" }, + { label: "托标签", prop: "containerCode" }, + { type: "object", label: "数量", prop: "qty", showProp: "qty" }, + { type: "object", label: "单位", prop: "qty", showProp: "uom" }, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty" }, + { type: "object", label: "标包单位", prop: "stdPack", showProp: "packUom" }, + { label: "目标仓库", prop: "toWarehouseCode" }, + { label: "来源仓库", prop: "fromWarehouseCode" }, + { label: "产品号", prop: "productNo" }, + { label: "项目号", prop: "projectCode" }, + { label: "位置", prop: "position" }, + { label: "原因", prop: "reason" }, + ] + + /** + * @returns {Array} 单块门板-客户退货记录 + */ +export const SingleDoorPanelCustomerReturnNote = [ + { label: "客户退货单号", prop: "number" }, + { label: "物料代码", prop: 'itemCode' }, + { label: "批次", prop: 'lot' }, + { label: "箱标签", prop: 'packingCode' }, + { label: "托标签", prop: 'containerCode' }, + { label: "仓库代码", prop: 'warehouseCode' }, + { label: "数量", prop: 'qty', showProp: 'qty', type: 'object' }, + { label: "单位", prop: 'qty', showProp: 'uom', type: 'object' }, + { label: "标包数量", prop: 'stdPack', showProp: 'packQty', type: 'object' }, + { label: "标包单位", prop: 'stdPack', showProp: 'packUom', type: 'object' }, + { label: "库位代码", prop: 'locationCode' }, + // { label: "生产线", prop: 'prodLine' }, + // { label: "Bom版本", prop: "bomVersion" }, + { label: "产品号", prop: "productNo" }, + { label: "项目号", prop: "projectCode" }, + { label: "位置", prop: "position" }, +] + + /** + * @returns {Array} 调拨发货记录 + */ + export const PillarDeliverNote = [ + { label: "物品编号", prop: "itemCode", fixed: "left",}, + { type: "object", label: "物品名称", prop: "item", showProp: "name", }, + { type: "object", label: "物品描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物品描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { label: "目标批次", prop: "toLot", }, + { label: "来源批次", prop: "fromLot", }, + { label: "目标库位", prop: "toLocationCode", }, + { label: "来源库位", prop: "fromLocationCode", }, + { label: "目标仓库", prop: "toWarehouseCode", }, + { label: "来源仓库", prop: "fromWarehouseCode", }, + { type: "filter", filters: "requestStatus", label: "从状态", prop: "fromStatus",}, + { type: "filter", filters: "requestStatus", label: "到状态", prop: "toStatus",}, + { label: "发货时间", prop: "deliverTime", type: "dateTime" }, + { label: "过期时间", prop: "expiredTime", type: "dateTime" }, + { label: "销售订单号", prop: "soNumber", }, + { label: "订单行", prop: "soLine", }, + { label: "原因", prop: "reason",}, +] + +/** + * @returns {Array} 库存转移日志 + */ +export const InventoryTransferNote = [ + { label: "转移编号", prop: "number", }, + { label: "从箱标签", prop: "fromPackingCode", }, + { label: "到箱标签", prop: "toPackingCode", }, + { label: "从库位代码", prop: "fromLocationCode", }, + { label: "到库位代码", prop: "toLocationCode", }, + { label: "从托盘标签", prop: "fromContainerCode", }, + { label: "到托盘标签", prop: "toContainerCode", }, + { type: "filter", filters: "inventoryStage", label: "从状态", prop: "fromStatus", }, + { type: "filter", filters: "inventoryStage", label: "到状态", prop: "toStatus", }, + { label: "itemCode", prop: "itemCode" }, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "object", label: "到货数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "到货单位", prop: "qty", showProp: "uom", }, + { label: "从批次", prop: "fromLot" }, + { label: "到批次", prop: "toLot" }, + { label: "备注", prop: 'remark', }, + // { type: "filter", filters: "TransType", label: "事务类型", prop: "transType", }, + // { type: "filter", filters: "TransSubType", label: "事务替代类型", prop: "transSubType", }, + // { label: "从事务编号", prop: "formTransNumber", }, + // { label: "到事务编号", prop: "toTransNumber", }, + // { type: "dateTime", label: "事务时间", prop: "transferTime", }, + // { type: "dateTime", label: "生效日期", prop: "activeDate", }, +] \ No newline at end of file diff --git a/src/utils/disposition/tableSummaryColumns.ts b/src/utils/disposition/tableSummaryColumns.ts new file mode 100644 index 0000000..580b2f7 --- /dev/null +++ b/src/utils/disposition/tableSummaryColumns.ts @@ -0,0 +1,100 @@ + /** + * @returns {Array} 检验任务 + */ + export const InspectJob = [ + { label: "itemCode", prop: "itemCode", fixed:"left", }, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { type: "filter", filters: "inspectType", label: "检验类型", prop: "inspectType",}, + { label: "检验数量", prop: "inspectQty",}, + { label: "合格数量", prop: "goodQty",}, + { label: "不合格数量", prop: "failedQty",}, + { label: "最终不合格数量", prop: "notPassedQty",}, + { label: "不合格原因", prop: "failedReason",}, + { label: "破坏数量", prop: "crackQty",}, + { type: "object", label: "收货数量", prop: "receiveQty", showProp: "qty", }, + { type: "object", label: "收货单位", prop: "receiveQty", showProp: "uom",}, + { type: "object", label: "包装数量", prop: "stdPack", showProp: "packQty",}, + { type: "object", label: "包装单位", prop: "stdPack", showProp: "packUom",}, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch",}, + { label: "订单号", prop: "poNumber",}, + { label: "订单行", prop: "poLine",}, + // { label: "itemCode", prop: "itemCode",}, + // { type: "filter", filters: "inspectType", label: "检验类型", prop: "inspectType",}, + // { label: "检验数量", prop: "inspectQty",}, + // { label: "合格数量", prop: "goodQty",}, + // { label: "不合格数量", prop: "failedQty",}, + // { label: "最终不合格数量", prop: "notPassedQty",}, + // { label: "实际库位", prop: "handledLocationCode",}, + // { label: "推荐库位", prop: "recommendLocationCode",}, + // { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + // { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + // { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + // { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch",}, + // { label: "备注", prop: 'remark', }, +] + +/** + * @returns {Array} 报检单 + */ + export const InspectNotice = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { label: "物料名称", type: "object", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "批次", prop: "lot" }, + { label: "抽检百分比", prop: "samplePercent",}, + { label: "检验数量", prop: "inspectQty",}, + { type: "object", label: "收货数量", prop: "receiveQty", showProp: "qty", }, + { type: "object", label: "收货单位", prop: "receiveQty", showProp: "uom",}, + // { type: "filter", filters: "inspectType", label: "检验类型", prop: "inspectType",}, + { type: "object", label: "包装数量", prop: "stdPack", showProp: "packQty",}, + { type: "object", label: "包装单位", prop: "stdPack", showProp: "packUom",}, + // { label: "订单号", prop: "poNumber",}, + // { label: "订单行", prop: "poLine",}, + // { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "objectDateTime", label: "生产日期", prop: "batch", showProp: "produceDate", }, + ] + + /** + * @returns {Array} 检验记录 + */ + export const InspectNote = [ + { label: "itemCode", prop: "itemCode", fixed: "left",}, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "检验数量", prop: "inspectQty",}, + { label: "合格数量", prop: "goodQty",}, + { label: "不合格数量", prop: "failedQty",}, + { label: "破坏数量", prop: "crackQty",}, + { type: "object", label: "收货数量", prop: "receiveQty", showProp: "qty", }, + { type: "object", label: "收货单位", prop: "receiveQty", showProp: "uom",}, + { type: "filter", filters: "taskType", label: "检验类型", prop: "inspectType",}, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty",}, + { type: "object", label: "标包单位", prop: "stdPack", showProp: "packUom",}, + { label: "批次", prop: "lot", }, + ] + + /** + * @returns {Array} 检验记录 + */ + export const PurchaseReceiptNote = [ + { label: "itemCode", prop: "itemCode",fixed: "left", }, + { type: "object", label: "物料名称", prop: "item", showProp: "name", }, + { type: "object", label: "物料描述1", prop: "item", showProp: "desc1", }, + { type: "object", label: "物料描述2", prop: "item", showProp: "desc2", }, + { label: "总数", prop: "summary" }, + { type: "object", label: "收货数量", prop: "qty", showProp: "qty", }, + { type: "object", label: "标包数量", prop: "stdPack", showProp: "packQty", }, + { label: "订单号", prop: "poNumber", }, + { label: "订单行", prop: "poLine", }, + { label: "箱标签", prop: "packingCode", }, + { label: "托标签", prop: "containerCode", }, + { type: "object", label: "供应商批次", prop: "batch", showProp: "supplierBatch", }, + { type: "object", label: "包装单位", prop: "qty", showProp: "uom", }, + { type: "object", label: "标包单位", prop: "stdPack", showProp: "packUom", }, + { label: "E-LEVEL等级", prop: "labelEqLevel" }, + { label: "备注", prop: 'remark', }, + ] \ No newline at end of file diff --git a/src/utils/disposition/tabsList.ts b/src/utils/disposition/tabsList.ts new file mode 100644 index 0000000..f9415ba --- /dev/null +++ b/src/utils/disposition/tabsList.ts @@ -0,0 +1,31 @@ +// 页面tabs标签 +export const ItemBasicTabsList = [{ + label: "供应商物品", + prop: 'SupplierItems', +}, +{ + label: "客户物品", + prop: 'CustomerItems', +}, +{ + label: "采购订单", + prop: 'PurchaseOrder', +}, +{ + label: "要货计划", + prop: 'PurchasingPlan', +}, +{ + label: "库存余额", + prop: 'InventoryBalance', +}, +{ + label: "预计入库存", + prop: 'ExpectedIn', +},{ + label: "预计出库存", + prop: 'ExpectedOut', +}, + +] + diff --git a/src/utils/domUtils.ts b/src/utils/domUtils.ts new file mode 100644 index 0000000..dbc1989 --- /dev/null +++ b/src/utils/domUtils.ts @@ -0,0 +1,289 @@ +import { isServer } from './is' +const ieVersion = isServer ? 0 : Number((document as any).documentMode) +const SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g +const MOZ_HACK_REGEXP = /^moz([A-Z])/ + +export interface ViewportOffsetResult { + left: number + top: number + right: number + bottom: number + rightIncludeBody: number + bottomIncludeBody: number +} + +/* istanbul ignore next */ +const trim = function (string: string) { + return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '') +} + +/* istanbul ignore next */ +const camelCase = function (name: string) { + return name + .replace(SPECIAL_CHARS_REGEXP, function (_, __, letter, offset) { + return offset ? letter.toUpperCase() : letter + }) + .replace(MOZ_HACK_REGEXP, 'Moz$1') +} + +/* istanbul ignore next */ +export function hasClass(el: Element, cls: string) { + if (!el || !cls) return false + if (cls.indexOf(' ') !== -1) { + throw new Error('className should not contain space.') + } + if (el.classList) { + return el.classList.contains(cls) + } else { + return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1 + } +} + +/* istanbul ignore next */ +export function addClass(el: Element, cls: string) { + if (!el) return + let curClass = el.className + const classes = (cls || '').split(' ') + + for (let i = 0, j = classes.length; i < j; i++) { + const clsName = classes[i] + if (!clsName) continue + + if (el.classList) { + el.classList.add(clsName) + } else if (!hasClass(el, clsName)) { + curClass += ' ' + clsName + } + } + if (!el.classList) { + el.className = curClass + } +} + +/* istanbul ignore next */ +export function removeClass(el: Element, cls: string) { + if (!el || !cls) return + const classes = cls.split(' ') + let curClass = ' ' + el.className + ' ' + + for (let i = 0, j = classes.length; i < j; i++) { + const clsName = classes[i] + if (!clsName) continue + + if (el.classList) { + el.classList.remove(clsName) + } else if (hasClass(el, clsName)) { + curClass = curClass.replace(' ' + clsName + ' ', ' ') + } + } + if (!el.classList) { + el.className = trim(curClass) + } +} + +export function getBoundingClientRect(element: Element): DOMRect | number { + if (!element || !element.getBoundingClientRect) { + return 0 + } + return element.getBoundingClientRect() +} + +/** + * 获取当前元素的left、top偏移 + * left:元素最左侧距离文档左侧的距离 + * top:元素最顶端距离文档顶端的距离 + * right:元素最右侧距离文档右侧的距离 + * bottom:元素最底端距离文档底端的距离 + * rightIncludeBody:元素最左侧距离文档右侧的距离 + * bottomIncludeBody:元素最底端距离文档最底部的距离 + * + * @description: + */ +export function getViewportOffset(element: Element): ViewportOffsetResult { + const doc = document.documentElement + + const docScrollLeft = doc.scrollLeft + const docScrollTop = doc.scrollTop + const docClientLeft = doc.clientLeft + const docClientTop = doc.clientTop + + const pageXOffset = window.pageXOffset + const pageYOffset = window.pageYOffset + + const box = getBoundingClientRect(element) + + const { left: retLeft, top: rectTop, width: rectWidth, height: rectHeight } = box as DOMRect + + const scrollLeft = (pageXOffset || docScrollLeft) - (docClientLeft || 0) + const scrollTop = (pageYOffset || docScrollTop) - (docClientTop || 0) + const offsetLeft = retLeft + pageXOffset + const offsetTop = rectTop + pageYOffset + + const left = offsetLeft - scrollLeft + const top = offsetTop - scrollTop + + const clientWidth = window.document.documentElement.clientWidth + const clientHeight = window.document.documentElement.clientHeight + return { + left: left, + top: top, + right: clientWidth - rectWidth - left, + bottom: clientHeight - rectHeight - top, + rightIncludeBody: clientWidth - left, + bottomIncludeBody: clientHeight - top + } +} + +/* istanbul ignore next */ +export const on = function ( + element: HTMLElement | Document | Window, + event: string, + handler: EventListenerOrEventListenerObject +): void { + if (element && event && handler) { + element.addEventListener(event, handler, false) + } +} + +/* istanbul ignore next */ +export const off = function ( + element: HTMLElement | Document | Window, + event: string, + handler: any +): void { + if (element && event && handler) { + element.removeEventListener(event, handler, false) + } +} + +/* istanbul ignore next */ +export const once = function (el: HTMLElement, event: string, fn: EventListener): void { + const listener = function (this: any, ...args: unknown[]) { + if (fn) { + // @ts-ignore + fn.apply(this, args) + } + off(el, event, listener) + } + on(el, event, listener) +} + +/* istanbul ignore next */ +export const getStyle = + ieVersion < 9 + ? function (element: Element | any, styleName: string) { + if (isServer) return + if (!element || !styleName) return null + styleName = camelCase(styleName) + if (styleName === 'float') { + styleName = 'styleFloat' + } + try { + switch (styleName) { + case 'opacity': + try { + return element.filters.item('alpha').opacity / 100 + } catch (e) { + return 1.0 + } + default: + return element.style[styleName] || element.currentStyle + ? element.currentStyle[styleName] + : null + } + } catch (e) { + return element.style[styleName] + } + } + : function (element: Element | any, styleName: string) { + if (isServer) return + if (!element || !styleName) return null + styleName = camelCase(styleName) + if (styleName === 'float') { + styleName = 'cssFloat' + } + try { + const computed = (document as any).defaultView.getComputedStyle(element, '') + return element.style[styleName] || computed ? computed[styleName] : null + } catch (e) { + return element.style[styleName] + } + } + +/* istanbul ignore next */ +export function setStyle(element: Element | any, styleName: any, value: any) { + if (!element || !styleName) return + + if (typeof styleName === 'object') { + for (const prop in styleName) { + if (Object.prototype.hasOwnProperty.call(styleName, prop)) { + setStyle(element, prop, styleName[prop]) + } + } + } else { + styleName = camelCase(styleName) + if (styleName === 'opacity' && ieVersion < 9) { + element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')' + } else { + element.style[styleName] = value + } + } +} + +/* istanbul ignore next */ +export const isScroll = (el: Element, vertical: any) => { + if (isServer) return + + const determinedDirection = vertical !== null || vertical !== undefined + const overflow = determinedDirection + ? vertical + ? getStyle(el, 'overflow-y') + : getStyle(el, 'overflow-x') + : getStyle(el, 'overflow') + + return overflow.match(/(scroll|auto)/) +} + +/* istanbul ignore next */ +export const getScrollContainer = (el: Element, vertical?: any) => { + if (isServer) return + + let parent: any = el + while (parent) { + if ([window, document, document.documentElement].includes(parent)) { + return window + } + if (isScroll(parent, vertical)) { + return parent + } + parent = parent.parentNode + } + + return parent +} + +/* istanbul ignore next */ +export const isInContainer = (el: Element, container: any) => { + if (isServer || !el || !container) return false + + const elRect = el.getBoundingClientRect() + let containerRect + + if ([window, document, document.documentElement, null, undefined].includes(container)) { + containerRect = { + top: 0, + right: window.innerWidth, + bottom: window.innerHeight, + left: 0 + } + } else { + containerRect = container.getBoundingClientRect() + } + + return ( + elRect.top < containerRect.bottom && + elRect.bottom > containerRect.top && + elRect.right > containerRect.left && + elRect.left < containerRect.right + ) +} diff --git a/src/utils/download.ts b/src/utils/download.ts new file mode 100644 index 0000000..ab20014 --- /dev/null +++ b/src/utils/download.ts @@ -0,0 +1,38 @@ +const download0 = (data: Blob, fileName: string, mineType: string) => { + // 创建 blob + const blob = new Blob([data], { type: mineType }) + // 创建 href 超链接,点击进行下载 + window.URL = window.URL || window.webkitURL + const href = URL.createObjectURL(blob) + const downA = document.createElement('a') + downA.href = href + downA.download = fileName + downA.click() + // 销毁超连接 + window.URL.revokeObjectURL(href) +} + +const download = { + // 下载 Excel 方法 + excel: (data: Blob, fileName: string) => { + download0(data, fileName, 'application/vnd.ms-excel') + }, + // 下载 Word 方法 + word: (data: Blob, fileName: string) => { + download0(data, fileName, 'application/msword') + }, + // 下载 Zip 方法 + zip: (data: Blob, fileName: string) => { + download0(data, fileName, 'application/zip') + }, + // 下载 Html 方法 + html: (data: Blob, fileName: string) => { + download0(data, fileName, 'text/html') + }, + // 下载 Markdown 方法 + markdown: (data: Blob, fileName: string) => { + download0(data, fileName, 'text/markdown') + } +} + +export default download diff --git a/src/utils/filt.ts b/src/utils/filt.ts new file mode 100644 index 0000000..b1a7b2c --- /dev/null +++ b/src/utils/filt.ts @@ -0,0 +1,157 @@ +export const openWindow = ( + url: string, + opt?: { + target?: '_self' | '_blank' | string + noopener?: boolean + noreferrer?: boolean + } +) => { + const { target = '__blank', noopener = true, noreferrer = true } = opt || {} + const feature: string[] = [] + + noopener && feature.push('noopener=yes') + noreferrer && feature.push('noreferrer=yes') + + window.open(url, target, feature.join(',')) +} + +/** + * @description: base64 to blob + */ +export const dataURLtoBlob = (base64Buf: string): Blob => { + const arr = base64Buf.split(',') + const typeItem = arr[0] + const mime = typeItem.match(/:(.*?);/)![1] + const bstr = window.atob(arr[1]) + let n = bstr.length + const u8arr = new Uint8Array(n) + while (n--) { + u8arr[n] = bstr.charCodeAt(n) + } + return new Blob([u8arr], { type: mime }) +} + +/** + * img url to base64 + * @param url + */ +export const urlToBase64 = (url: string, mineType?: string): Promise => { + return new Promise((resolve, reject) => { + let canvas = document.createElement('CANVAS') as Nullable + const ctx = canvas!.getContext('2d') + + const img = new Image() + img.crossOrigin = '' + img.onload = function () { + if (!canvas || !ctx) { + return reject() + } + canvas.height = img.height + canvas.width = img.width + ctx.drawImage(img, 0, 0) + const dataURL = canvas.toDataURL(mineType || 'image/png') + canvas = null + resolve(dataURL) + } + img.src = url + }) +} + +/** + * Download online pictures + * @param url + * @param filename + * @param mime + * @param bom + */ +export const downloadByOnlineUrl = ( + url: string, + filename: string, + mime?: string, + bom?: BlobPart +) => { + urlToBase64(url).then((base64) => { + downloadByBase64(base64, filename, mime, bom) + }) +} + +/** + * Download pictures based on base64 + * @param buf + * @param filename + * @param mime + * @param bom + */ +export const downloadByBase64 = (buf: string, filename: string, mime?: string, bom?: BlobPart) => { + const base64Buf = dataURLtoBlob(buf) + downloadByData(base64Buf, filename, mime, bom) +} + +/** + * Download according to the background interface file stream + * @param {*} data + * @param {*} filename + * @param {*} mime + * @param {*} bom + */ +export const downloadByData = (data: BlobPart, filename: string, mime?: string, bom?: BlobPart) => { + const blobData = typeof bom !== 'undefined' ? [bom, data] : [data] + const blob = new Blob(blobData, { type: mime || 'application/octet-stream' }) + + const blobURL = window.URL.createObjectURL(blob) + const tempLink = document.createElement('a') + tempLink.style.display = 'none' + tempLink.href = blobURL + tempLink.setAttribute('download', filename) + if (typeof tempLink.download === 'undefined') { + tempLink.setAttribute('target', '_blank') + } + document.body.appendChild(tempLink) + tempLink.click() + document.body.removeChild(tempLink) + window.URL.revokeObjectURL(blobURL) +} + +/** + * Download file according to file address + * @param {*} sUrl + */ +export const downloadByUrl = ({ + url, + target = '_blank', + fileName +}: { + url: string + target?: '_self' | '_blank' + fileName?: string +}): boolean => { + const isChrome = window.navigator.userAgent.toLowerCase().indexOf('chrome') > -1 + const isSafari = window.navigator.userAgent.toLowerCase().indexOf('safari') > -1 + + if (/(iP)/g.test(window.navigator.userAgent)) { + console.error('Your browser does not support download!') + return false + } + if (isChrome || isSafari) { + const link = document.createElement('a') + link.href = url + link.target = target + + if (link.download !== undefined) { + link.download = fileName || url.substring(url.lastIndexOf('/') + 1, url.length) + } + + if (document.createEvent) { + const e = document.createEvent('MouseEvents') + e.initEvent('click', true, true) + link.dispatchEvent(e) + return true + } + } + if (url.indexOf('?') === -1) { + url += '?download' + } + + openWindow(url, { target }) + return true +} diff --git a/src/utils/formCreate.ts b/src/utils/formCreate.ts new file mode 100644 index 0000000..6d7dbc7 --- /dev/null +++ b/src/utils/formCreate.ts @@ -0,0 +1,54 @@ +/** + * 针对 https://github.com/xaboy/form-create-designer 封装的工具类 + */ + +// 编码表单 Conf +export const encodeConf = (designerRef: object) => { + // @ts-ignore + return JSON.stringify(designerRef.value.getOption()) +} + +// 编码表单 Fields +export const encodeFields = (designerRef: object) => { + // @ts-ignore + const rule = designerRef.value.getRule() + const fields: string[] = [] + rule.forEach((item) => { + fields.push(JSON.stringify(item)) + }) + return fields +} + +// 解码表单 Fields +export const decodeFields = (fields: string[]) => { + const rule: object[] = [] + fields.forEach((item) => { + rule.push(JSON.parse(item)) + }) + return rule +} + +// 设置表单的 Conf 和 Fields +export const setConfAndFields = (designerRef: object, conf: string, fields: string) => { + // @ts-ignore + designerRef.value.setOption(JSON.parse(conf)) + // @ts-ignore + designerRef.value.setRule(decodeFields(fields)) +} + +// 设置表单的 Conf 和 Fields +export const setConfAndFields2 = ( + detailPreview: object, + conf: string, + fields: string, + value?: object +) => { + // @ts-ignore + detailPreview.value.option = JSON.parse(conf) + // @ts-ignore + detailPreview.value.rule = decodeFields(fields) + if (value) { + // @ts-ignore + detailPreview.value.value = value + } +} diff --git a/src/utils/formRules.ts b/src/utils/formRules.ts new file mode 100644 index 0000000..2989867 --- /dev/null +++ b/src/utils/formRules.ts @@ -0,0 +1,7 @@ +const { t } = useI18n() + +// 必填项 +export const required = { + required: true, + message: t('common.required') +} diff --git a/src/utils/formatTime.ts b/src/utils/formatTime.ts new file mode 100644 index 0000000..e2b0e59 --- /dev/null +++ b/src/utils/formatTime.ts @@ -0,0 +1,232 @@ +import dayjs from 'dayjs' + +/** + * 时间日期转换 + * @param date 当前时间,new Date() 格式 + * @param format 需要转换的时间格式字符串 + * @description format 字符串随意,如 `YYYY-mm、YYYY-mm-dd` + * @description format 季度:"YYYY-mm-dd HH:MM:SS QQQQ" + * @description format 星期:"YYYY-mm-dd HH:MM:SS WWW" + * @description format 几周:"YYYY-mm-dd HH:MM:SS ZZZ" + * @description format 季度 + 星期 + 几周:"YYYY-mm-dd HH:MM:SS WWW QQQQ ZZZ" + * @returns 返回拼接后的时间字符串 + */ +export function formatDate(date: Date | number, format?: string): string { + // 日期不存在,则返回空 + if (!date) { + return '' + } + // 日期存在,则进行格式化 + if (format === undefined) { + format = 'YYYY-MM-DD HH:mm:ss' + } + return dayjs(date).format(format) +} + +/** + * 获取当前的日期+时间 + */ +export function getNowDateTime() { + return dayjs() +} + +/** + * 获取当前日期是第几周 + * @param dateTime 当前传入的日期值 + * @returns 返回第几周数字值 + */ +export function getWeek(dateTime: Date): number { + const temptTime = new Date(dateTime.getTime()) + // 周几 + const weekday = temptTime.getDay() || 7 + // 周1+5天=周六 + temptTime.setDate(temptTime.getDate() - weekday + 1 + 5) + let firstDay = new Date(temptTime.getFullYear(), 0, 1) + const dayOfWeek = firstDay.getDay() + let spendDay = 1 + if (dayOfWeek != 0) spendDay = 7 - dayOfWeek + 1 + firstDay = new Date(temptTime.getFullYear(), 0, 1 + spendDay) + const d = Math.ceil((temptTime.valueOf() - firstDay.valueOf()) / 86400000) + return Math.ceil(d / 7) +} + +/** + * 将时间转换为 `几秒前`、`几分钟前`、`几小时前`、`几天前` + * @param param 当前时间,new Date() 格式或者字符串时间格式 + * @param format 需要转换的时间格式字符串 + * @description param 10秒: 10 * 1000 + * @description param 1分: 60 * 1000 + * @description param 1小时: 60 * 60 * 1000 + * @description param 24小时:60 * 60 * 24 * 1000 + * @description param 3天: 60 * 60* 24 * 1000 * 3 + * @returns 返回拼接后的时间字符串 + */ +export function formatPast(param: string | Date, format = 'YYYY-mm-dd HH:MM:SS'): string { + // 传入格式处理、存储转换值 + let t: any, s: number + // 获取js 时间戳 + let time: number = new Date().getTime() + // 是否是对象 + typeof param === 'string' || 'object' ? (t = new Date(param).getTime()) : (t = param) + // 当前时间戳 - 传入时间戳 + time = Number.parseInt(`${time - t}`) + if (time < 10000) { + // 10秒内 + return '刚刚' + } else if (time < 60000 && time >= 10000) { + // 超过10秒少于1分钟内 + s = Math.floor(time / 1000) + return `${s}秒前` + } else if (time < 3600000 && time >= 60000) { + // 超过1分钟少于1小时 + s = Math.floor(time / 60000) + return `${s}分钟前` + } else if (time < 86400000 && time >= 3600000) { + // 超过1小时少于24小时 + s = Math.floor(time / 3600000) + return `${s}小时前` + } else if (time < 259200000 && time >= 86400000) { + // 超过1天少于3天内 + s = Math.floor(time / 86400000) + return `${s}天前` + } else { + // 超过3天 + const date = typeof param === 'string' || 'object' ? new Date(param) : param + return formatDate(date, format) + } +} + +/** + * 时间问候语 + * @param param 当前时间,new Date() 格式 + * @description param 调用 `formatAxis(new Date())` 输出 `上午好` + * @returns 返回拼接后的时间字符串 + */ +export function formatAxis(param: Date): string { + const hour: number = new Date(param).getHours() + if (hour < 6) return '凌晨好' + else if (hour < 9) return '早上好' + else if (hour < 12) return '上午好' + else if (hour < 14) return '中午好' + else if (hour < 17) return '下午好' + else if (hour < 19) return '傍晚好' + else if (hour < 22) return '晚上好' + else return '夜里好' +} + +/** + * 将毫秒,转换成时间字符串。例如说,xx 分钟 + * + * @param ms 毫秒 + * @returns {string} 字符串 + */ +export function formatPast2(ms) { + const day = Math.floor(ms / (24 * 60 * 60 * 1000)) + const hour = Math.floor(ms / (60 * 60 * 1000) - day * 24) + const minute = Math.floor(ms / (60 * 1000) - day * 24 * 60 - hour * 60) + const second = Math.floor(ms / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60) + if (day > 0) { + return day + '天' + hour + '小时' + minute + '分钟' + } + if (hour > 0) { + return hour + '小时' + minute + '分钟' + } + if (minute > 0) { + return minute + '分钟' + } + if (second > 0) { + return second + '秒' + } else { + return 0 + '秒' + } +} + +/** + * element plus 的时间 Formatter 实现,使用 YYYY-MM-DD HH:mm:ss 格式 + * + * @param row 行数据 + * @param column 字段 + * @param cellValue 字段值 + */ +// @ts-ignore +export const dateFormatter = (row, column, cellValue) => { + if (!cellValue) { + return + } + return formatDate(cellValue) +} +// 获取时间戳 +export const formatGetTime = (row, column, cellValue) => { + console.log(cellValue.getTime()) + // if (!cellValue) { + // return + // } + // const time = new Date(cellValue).getTime() + // return time +} + +/** + * element plus 的时间 Formatter 实现,使用 YYYY-MM-DD 格式 + * + * @param row 行数据 + * @param column 字段 + * @param cellValue 字段值 + */ +// @ts-ignore +export const dateFormatter2 = (row, column, cellValue) => { + if (!cellValue) { + return + } + return formatDate(cellValue, 'YYYY-MM-DD') +} + +/** + * 设置起始日期,时间为00:00:00 + * @param param 传入日期 + * @returns 带时间00:00:00的日期 + */ +export function beginOfDay(param: Date) { + return new Date(param.getFullYear(), param.getMonth(), param.getDate(), 0, 0, 0) +} + +/** + * 设置结束日期,时间为23:59:59 + * @param param 传入日期 + * @returns 带时间23:59:59的日期 + */ +export function endOfDay(param: Date) { + return new Date(param.getFullYear(), param.getMonth(), param.getDate(), 23, 59, 59) +} + +/** + * 计算两个日期间隔天数 + * @param param1 日期1 + * @param param2 日期2 + */ +export function betweenDay(param1: Date, param2: Date) { + param1 = convertDate(param1) + param2 = convertDate(param2) + // 计算差值 + return Math.floor((param2.getTime() - param1.getTime()) / (24 * 3600 * 1000)) +} + +/** + * 日期计算 + * @param param1 日期 + * @param param2 添加的时间 + */ +export function addTime(param1: Date, param2: number) { + param1 = convertDate(param1) + return new Date(param1.getTime() + param2) +} + +/** + * 日期转换 + * @param param 日期 + */ +export function convertDate(param: Date | string) { + if (typeof param === 'string') { + return new Date(param) + } + return param +} diff --git a/src/utils/formatter.ts b/src/utils/formatter.ts new file mode 100644 index 0000000..7c6e39f --- /dev/null +++ b/src/utils/formatter.ts @@ -0,0 +1,12 @@ +import { fenToYuan } from '@/utils' +import { TableColumnCtx } from 'element-plus' + +// 格式化金额【分转元】 +export const fenToYuanFormat = ( + row: any, + column: TableColumnCtx, + cellValue: any, + index: number +) => { + return `¥${fenToYuan(cellValue)}` +} diff --git a/src/utils/index.ts b/src/utils/index.ts new file mode 100644 index 0000000..0c00c25 --- /dev/null +++ b/src/utils/index.ts @@ -0,0 +1,245 @@ +/** + * + * @param component 需要注册的组件 + * @param alias 组件别名 + * @returns any + */ +export const withInstall = (component: T, alias?: string) => { + const comp = component as any + comp.install = (app: any) => { + app.component(comp.name || comp.displayName, component) + if (alias) { + app.config.globalProperties[alias] = component + } + } + return component as T & Plugin +} + +/** + * @param str 需要转下划线的驼峰字符串 + * @returns 字符串下划线 + */ +export const humpToUnderline = (str: string): string => { + return str.replace(/([A-Z])/g, '-$1').toLowerCase() +} + +/** + * @param str 需要转驼峰的下划线字符串 + * @returns 字符串驼峰 + */ +export const underlineToHump = (str: string): string => { + if (!str) return '' + return str.replace(/\-(\w)/g, (_, letter: string) => { + return letter.toUpperCase() + }) +} + +export const setCssVar = (prop: string, val: any, dom = document.documentElement) => { + dom.style.setProperty(prop, val) +} + +/** + * 查找数组对象的某个下标 + * @param {Array} ary 查找的数组 + * @param {Functon} fn 判断的方法 + */ +// eslint-disable-next-line +export const findIndex = (ary: Array, fn: Fn): number => { + if (ary.findIndex) { + return ary.findIndex(fn) + } + let index = -1 + ary.some((item: T, i: number, ary: Array) => { + const ret: T = fn(item, i, ary) + if (ret) { + index = i + return ret + } + }) + return index +} + +export const trim = (str: string) => { + return str.replace(/(^\s*)|(\s*$)/g, '') +} + +/** + * @param {Date | number | string} time 需要转换的时间 + * @param {String} fmt 需要转换的格式 如 yyyy-MM-dd、yyyy-MM-dd HH:mm:ss + */ +export const formatTime = (time: Date | number | string, fmt: string) => { + if (!time) return '' + else { + const date = new Date(time) + const o = { + 'M+': date.getMonth() + 1, + 'd+': date.getDate(), + 'H+': date.getHours(), + 'm+': date.getMinutes(), + 's+': date.getSeconds(), + 'q+': Math.floor((date.getMonth() + 3) / 3), + S: date.getMilliseconds() + } + if (/(y+)/.test(fmt)) { + fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)) + } + for (const k in o) { + if (new RegExp('(' + k + ')').test(fmt)) { + fmt = fmt.replace( + RegExp.$1, + RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length) + ) + } + } + return fmt + } +} + +/** + * 生成随机字符串 + */ +export const toAnyString = () => { + const str: string = 'xxxxx-xxxxx-4xxxx-yxxxx-xxxxx'.replace(/[xy]/g, (c: string) => { + const r: number = (Math.random() * 16) | 0 + const v: number = c === 'x' ? r : (r & 0x3) | 0x8 + return v.toString() + }) + return str +} + +export const generateUUID = () => { + if (typeof crypto === 'object') { + if (typeof crypto.randomUUID === 'function') { + return crypto.randomUUID() + } + if (typeof crypto.getRandomValues === 'function' && typeof Uint8Array === 'function') { + const callback = (c: any) => { + const num = Number(c) + return (num ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (num / 4)))).toString( + 16 + ) + } + return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, callback) + } + } + let timestamp = new Date().getTime() + let performanceNow = + (typeof performance !== 'undefined' && performance.now && performance.now() * 1000) || 0 + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { + let random = Math.random() * 16 + if (timestamp > 0) { + random = (timestamp + random) % 16 | 0 + timestamp = Math.floor(timestamp / 16) + } else { + random = (performanceNow + random) % 16 | 0 + performanceNow = Math.floor(performanceNow / 16) + } + return (c === 'x' ? random : (random & 0x3) | 0x8).toString(16) + }) +} + +/** + * element plus 的文件大小 Formatter 实现 + * + * @param row 行数据 + * @param column 字段 + * @param cellValue 字段值 + */ +// @ts-ignore +export const fileSizeFormatter = (row, column, cellValue) => { + const fileSize = cellValue + const unitArr = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] + const srcSize = parseFloat(fileSize) + const index = Math.floor(Math.log(srcSize) / Math.log(1024)) + const size = srcSize / Math.pow(1024, index) + const sizeStr = size.toFixed(2) //保留的小数位数 + return sizeStr + ' ' + unitArr[index] +} + +/** + * 将值复制到目标对象,且以目标对象属性为准,例:target: {a:1} source:{a:2,b:3} 结果为:{a:2} + * @param target 目标对象 + * @param source 源对象 + */ +export const copyValueToTarget = (target, source) => { + const newObj = Object.assign({}, target, source) + // 删除多余属性 + Object.keys(newObj).forEach((key) => { + // 如果不是target中的属性则删除 + if (Object.keys(target).indexOf(key) === -1) { + delete newObj[key] + } + }) + // 更新目标对象值 + Object.assign(target, newObj) +} + +/** + * 将一个整数转换为分数保留两位小数 + * @param num + */ +export const formatToFraction = (num: number | string | undefined): number => { + if (typeof num === 'undefined') return 0 + const parsedNumber = typeof num === 'string' ? parseFloat(num) : num + return parseFloat((parsedNumber / 100).toFixed(2)) +} + +/** + * 将一个数转换为 1.00 这样 + * 数据呈现的时候使用 + * + * @param num 整数 + */ +export const floatToFixed2 = (num: number | string | undefined): string => { + let str = '0.00' + if (typeof num === 'undefined') { + return str + } + const f = formatToFraction(num) + const decimalPart = f.toString().split('.')[1] + const len = decimalPart ? decimalPart.length : 0 + switch (len) { + case 0: + str = f.toString() + '.00' + break + case 1: + str = f.toString() + '0' + break + } + return str +} + +/** + * 将一个分数转换为整数 + * @param num + */ +export const convertToInteger = (num: number | string | undefined): number => { + if (typeof num === 'undefined') return 0 + const parsedNumber = typeof num === 'string' ? parseFloat(num) : num + // TODO 分转元后还有小数则四舍五入 + return Math.round(parsedNumber * 100) +} + +/** + * 元转分 + */ +export const yuanToFen = (amount: string | number): number => { + return Math.round(Number(amount) * 100) +} + +/** + * 分转元 + */ +export const fenToYuan = (amount: string | number): number => { + return Number((Number(amount) / 100).toFixed(2)) +} + +// el-button 点击后强制失去焦点(颜色不恢复问题处理) 调用位置:绑定在el-button的点击事件 +export function clearButtonBlurHandle (e:any) { + if(!e || JSON.stringify(e) == '{}' || !e.target)return + let target = e.target; + if(target.nodeName == 'SPAN' || target.nodeName == 'I'){ + target = e.target.parentNode; + } + target.blur(); +} \ No newline at end of file diff --git a/src/utils/is.ts b/src/utils/is.ts new file mode 100644 index 0000000..3752985 --- /dev/null +++ b/src/utils/is.ts @@ -0,0 +1,105 @@ +// copy to vben-admin + +const toString = Object.prototype.toString + +export const is = (val: unknown, type: string) => { + return toString.call(val) === `[object ${type}]` +} + +export const isDef = (val?: T): val is T => { + return typeof val !== 'undefined' +} + +export const isUnDef = (val?: T): val is T => { + return !isDef(val) +} + +export const isObject = (val: any): val is Record => { + return val !== null && is(val, 'Object') +} + +export const isEmpty = (val: T): val is T => { + if (isArray(val) || isString(val)) { + return val.length === 0 + } + + if (val instanceof Map || val instanceof Set) { + return val.size === 0 + } + + if (isObject(val)) { + return Object.keys(val).length === 0 + } + + return false +} + +export const isDate = (val: unknown): val is Date => { + return is(val, 'Date') +} + +export const isNull = (val: unknown): val is null => { + return val === null +} + +export const isNullAndUnDef = (val: unknown): val is null | undefined => { + return isUnDef(val) && isNull(val) +} + +export const isNullOrUnDef = (val: unknown): val is null | undefined => { + return isUnDef(val) || isNull(val) +} + +export const isNumber = (val: unknown): val is number => { + return is(val, 'Number') +} + +export const isPromise = (val: unknown): val is Promise => { + return is(val, 'Promise') && isObject(val) && isFunction(val.then) && isFunction(val.catch) +} + +export const isString = (val: unknown): val is string => { + return is(val, 'String') +} + +export const isFunction = (val: unknown): val is Function => { + return typeof val === 'function' +} + +export const isBoolean = (val: unknown): val is boolean => { + return is(val, 'Boolean') +} + +export const isRegExp = (val: unknown): val is RegExp => { + return is(val, 'RegExp') +} + +export const isArray = (val: any): val is Array => { + return val && Array.isArray(val) +} + +export const isWindow = (val: any): val is Window => { + return typeof window !== 'undefined' && is(val, 'Window') +} + +export const isElement = (val: unknown): val is Element => { + return isObject(val) && !!val.tagName +} + +export const isMap = (val: unknown): val is Map => { + return is(val, 'Map') +} + +export const isServer = typeof window === 'undefined' + +export const isClient = !isServer + +export const isUrl = (path: string): boolean => { + const reg = + /(((^https?:(?:\/\/)?)(?:[-:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&%@.\w_]*)#?(?:[\w]*))?)$/ + return reg.test(path) +} + +export const isDark = (): boolean => { + return window.matchMedia('(prefers-color-scheme: dark)').matches +} diff --git a/src/utils/jsencrypt.ts b/src/utils/jsencrypt.ts new file mode 100644 index 0000000..374d5f6 --- /dev/null +++ b/src/utils/jsencrypt.ts @@ -0,0 +1,31 @@ +import { JSEncrypt } from 'jsencrypt' + +// 密钥对生成 http://web.chacuo.net/netrsakeypair + +const publicKey = + 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdH\n' + + 'nzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==' + +const privateKey = + 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY\n' + + '7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKN\n' + + 'PuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gA\n' + + 'kM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWow\n' + + 'cSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99Ecv\n' + + 'DQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthh\n' + + 'YhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3\n' + + 'UP8iWi1Qw0Y=' + +// 加密 +export const encrypt = (txt: string) => { + const encryptor = new JSEncrypt() + encryptor.setPublicKey(publicKey) // 设置公钥 + return encryptor.encrypt(txt) // 对数据进行加密 +} + +// 解密 +export const decrypt = (txt: string) => { + const encryptor = new JSEncrypt() + encryptor.setPrivateKey(privateKey) // 设置私钥 + return encryptor.decrypt(txt) // 对数据进行解密 +} diff --git a/src/utils/permission.ts b/src/utils/permission.ts new file mode 100644 index 0000000..a63ee62 --- /dev/null +++ b/src/utils/permission.ts @@ -0,0 +1,45 @@ +import { CACHE_KEY, useCache } from '@/hooks/web/useCache' + +const { t } = useI18n() // 国际化 + +/** + * 字符权限校验 + * @param {Array} value 校验值 + * @returns {Boolean} + */ +export function checkPermi(value: string[]) { + if (value && value instanceof Array && value.length > 0) { + const { wsCache } = useCache() + const permissionDatas = value + const all_permission = '*:*:*' + const permissions = wsCache.get(CACHE_KEY.USER).permissions + const hasPermission = permissions.some((permission) => { + return all_permission === permission || permissionDatas.includes(permission) + }) + return !!hasPermission + } else { + console.error(t('permission.hasPermission')) + return false + } +} + +/** + * 角色权限校验 + * @param {string[]} value 校验值 + * @returns {Boolean} + */ +export function checkRole(value: string[]) { + if (value && value instanceof Array && value.length > 0) { + const { wsCache } = useCache() + const permissionRoles = value + const super_admin = 'admin' + const roles = wsCache.get(CACHE_KEY.USER).roles + const hasRole = roles.some((role) => { + return super_admin === role || permissionRoles.includes(role) + }) + return !!hasRole + } else { + console.error(t('permission.hasRole')) + return false + } +} diff --git a/src/utils/propTypes.ts b/src/utils/propTypes.ts new file mode 100644 index 0000000..fb8f84e --- /dev/null +++ b/src/utils/propTypes.ts @@ -0,0 +1,28 @@ +import { createTypes, VueTypesInterface, VueTypeValidableDef } from 'vue-types' +import { CSSProperties } from 'vue' + +// 自定义扩展vue-types +type PropTypes = VueTypesInterface & { + readonly style: VueTypeValidableDef +} + +const propTypes = createTypes({ + func: undefined, + bool: undefined, + string: undefined, + number: undefined, + object: undefined, + integer: undefined +}) as PropTypes + +// 需要自定义扩展的类型 +// see: https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#the-extend-method +// propTypes.extend([ +// { +// name: 'style', +// getter: true, +// type: [String, Object], +// default: undefined +// } +// ]) +export { propTypes } diff --git a/src/utils/routerHelper.ts b/src/utils/routerHelper.ts new file mode 100644 index 0000000..a682565 --- /dev/null +++ b/src/utils/routerHelper.ts @@ -0,0 +1,238 @@ +import type { RouteLocationNormalized, Router, RouteRecordNormalized } from 'vue-router' +import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router' +import { isUrl } from '@/utils/is' +import { cloneDeep, omit } from 'lodash-es' + +const modules = import.meta.glob('../views/**/*.{vue,tsx}') +/** + * 注册一个异步组件 + * @param componentPath 例:/bpm/oa/leave/detail + */ +export const registerComponent = (componentPath: string) => { + for (const item in modules) { + if (item.includes(componentPath)) { + // 使用异步组件的方式来动态加载组件 + // @ts-ignore + return defineAsyncComponent(modules[item]) + } + } +} +/* Layout */ +export const Layout = () => import('@/layout/Layout.vue') + +export const getParentLayout = () => { + return () => + new Promise((resolve) => { + resolve({ + name: 'ParentLayout' + }) + }) +} + +// 按照路由中meta下的rank等级升序来排序路由 +export const ascending = (arr: any[]) => { + arr.forEach((v) => { + if (v?.meta?.rank === null) v.meta.rank = undefined + if (v?.meta?.rank === 0) { + if (v.name !== 'home' && v.path !== '/') { + console.warn('rank only the home page can be 0') + } + } + }) + return arr.sort((a: { meta: { rank: number } }, b: { meta: { rank: number } }) => { + return a?.meta?.rank - b?.meta?.rank + }) +} + +export const getRawRoute = (route: RouteLocationNormalized): RouteLocationNormalized => { + if (!route) return route + const { matched, ...opt } = route + return { + ...opt, + matched: (matched + ? matched.map((item) => ({ + meta: item.meta, + name: item.name, + path: item.path + })) + : undefined) as RouteRecordNormalized[] + } +} + +// 后端控制路由生成 +export const generateRoute = (routes: AppCustomRouteRecordRaw[]): AppRouteRecordRaw[] => { + const res: AppRouteRecordRaw[] = [] + const modulesRoutesKeys = Object.keys(modules) + for (const route of routes) { + const meta = { + title: route.name, + icon: route.icon, + hidden: !route.visible, + noCache: !route.keepAlive, + alwaysShow: + route.children && + route.children.length === 1 && + (route.alwaysShow !== undefined ? route.alwaysShow : true) + } + // 路由地址转首字母大写驼峰,作为路由名称,适配keepAlive + let data: AppRouteRecordRaw = { + path: route.path, + name: + route.componentName && route.componentName.length > 0 + ? route.componentName + : toCamelCase(route.path, true), + redirect: route.redirect, + meta: meta + } + //处理顶级非目录路由 + if (!route.children && route.parentId == 0 && route.component) { + data.component = Layout + data.meta = {} + data.name = toCamelCase(route.path, true) + 'Parent' + data.redirect = '' + meta.alwaysShow = true + const childrenData: AppRouteRecordRaw = { + path: '', + name: toCamelCase(route.path, true), + redirect: route.redirect, + meta: meta + } + const index = route?.component + ? modulesRoutesKeys.findIndex((ev) => ev.includes(route.component)) + : modulesRoutesKeys.findIndex((ev) => ev.includes(route.path)) + childrenData.component = modules[modulesRoutesKeys[index]] + data.children = [childrenData] + } else { + // 目录 + if (route.children) { + data.component = Layout + data.redirect = getRedirect(route.path, route.children) + // 外链 + } else if (isUrl(route.path)) { + data = { + path: '/external-link', + component: Layout, + meta: { + name: route.name + }, + children: [data] + } as AppRouteRecordRaw + // 菜单 + } else { + // 对后端传component组件路径和不传做兼容(如果后端传component组件路径,那么path可以随便写,如果不传,component组件路径会根path保持一致) + const index = route?.component + ? modulesRoutesKeys.findIndex((ev) => ev.includes(route.component)) + : modulesRoutesKeys.findIndex((ev) => ev.includes(route.path)) + data.component = modules[modulesRoutesKeys[index]] + } + if (route.children) { + data.children = generateRoute(route.children) + } + } + res.push(data as AppRouteRecordRaw) + } + return res +} +export const getRedirect = (parentPath: string, children: AppCustomRouteRecordRaw[]) => { + if (!children || children.length == 0) { + return parentPath + } + const path = generateRoutePath(parentPath, children[0].path) + // 递归子节点 + if (children[0].children) return getRedirect(path, children[0].children) +} +const generateRoutePath = (parentPath: string, path: string) => { + if (parentPath.endsWith('/')) { + parentPath = parentPath.slice(0, -1) // 移除默认的 / + } + if (!path.startsWith('/')) { + path = '/' + path + } + return parentPath + path +} +export const pathResolve = (parentPath: string, path: string) => { + if (isUrl(path)) return path + const childPath = path.startsWith('/') || !path ? path : `/${path}` + return `${parentPath}${childPath}`.replace(/\/\//g, '/') +} + +// 路由降级 +export const flatMultiLevelRoutes = (routes: AppRouteRecordRaw[]) => { + const modules: AppRouteRecordRaw[] = cloneDeep(routes) + for (let index = 0; index < modules.length; index++) { + const route = modules[index] + if (!isMultipleRoute(route)) { + continue + } + promoteRouteLevel(route) + } + return modules +} + +// 层级是否大于2 +const isMultipleRoute = (route: AppRouteRecordRaw) => { + if (!route || !Reflect.has(route, 'children') || !route.children?.length) { + return false + } + + const children = route.children + + let flag = false + for (let index = 0; index < children.length; index++) { + const child = children[index] + if (child.children?.length) { + flag = true + break + } + } + return flag +} + +// 生成二级路由 +const promoteRouteLevel = (route: AppRouteRecordRaw) => { + let router: Router | null = createRouter({ + routes: [route as RouteRecordRaw], + history: createWebHashHistory() + }) + + const routes = router.getRoutes() + addToChildren(routes, route.children || [], route) + router = null + + route.children = route.children?.map((item) => omit(item, 'children')) +} + +// 添加所有子菜单 +const addToChildren = ( + routes: RouteRecordNormalized[], + children: AppRouteRecordRaw[], + routeModule: AppRouteRecordRaw +) => { + for (let index = 0; index < children.length; index++) { + const child = children[index] + const route = routes.find((item) => item.name === child.name) + if (!route) { + continue + } + routeModule.children = routeModule.children || [] + if (!routeModule.children.find((item) => item.name === route.name)) { + routeModule.children?.push(route as unknown as AppRouteRecordRaw) + } + if (child.children?.length) { + addToChildren(routes, child.children, routeModule) + } + } +} +const toCamelCase = (str: string, upperCaseFirst: boolean) => { + str = (str || '') + .replace(/-(.)/g, function (group1: string) { + return group1.toUpperCase() + }) + .replaceAll('-', '') + + if (upperCaseFirst && str) { + str = str.charAt(0).toUpperCase() + str.slice(1) + } + + return str +} diff --git a/src/utils/tree.ts b/src/utils/tree.ts new file mode 100644 index 0000000..c8503f5 --- /dev/null +++ b/src/utils/tree.ts @@ -0,0 +1,399 @@ +interface TreeHelperConfig { + id: string + children: string + pid: string +} + +const DEFAULT_CONFIG: TreeHelperConfig = { + id: 'id', + children: 'children', + pid: 'pid' +} +export const defaultProps = { + children: 'children', + label: 'name', + value: 'id', + isLeaf: 'leaf' +} + +const getConfig = (config: Partial) => Object.assign({}, DEFAULT_CONFIG, config) + +// tree from list +export const listToTree = (list: any[], config: Partial = {}): T[] => { + const conf = getConfig(config) as TreeHelperConfig + const nodeMap = new Map() + const result: T[] = [] + const { id, children, pid } = conf + + for (const node of list) { + node[children] = node[children] || [] + nodeMap.set(node[id], node) + } + for (const node of list) { + const parent = nodeMap.get(node[pid]) + ;(parent ? parent.children : result).push(node) + } + return result +} + +export const treeToList = (tree: any, config: Partial = {}): T => { + config = getConfig(config) + const { children } = config + const result: any = [...tree] + for (let i = 0; i < result.length; i++) { + if (!result[i][children!]) continue + result.splice(i + 1, 0, ...result[i][children!]) + } + return result +} + +export const findNode = ( + tree: any, + func: Fn, + config: Partial = {} +): T | null => { + config = getConfig(config) + const { children } = config + const list = [...tree] + for (const node of list) { + if (func(node)) return node + node[children!] && list.push(...node[children!]) + } + return null +} + +export const findNodeAll = ( + tree: any, + func: Fn, + config: Partial = {} +): T[] => { + config = getConfig(config) + const { children } = config + const list = [...tree] + const result: T[] = [] + for (const node of list) { + func(node) && result.push(node) + node[children!] && list.push(...node[children!]) + } + return result +} + +export const findPath = ( + tree: any, + func: Fn, + config: Partial = {} +): T | T[] | null => { + config = getConfig(config) + const path: T[] = [] + const list = [...tree] + const visitedSet = new Set() + const { children } = config + while (list.length) { + const node = list[0] + if (visitedSet.has(node)) { + path.pop() + list.shift() + } else { + visitedSet.add(node) + node[children!] && list.unshift(...node[children!]) + path.push(node) + if (func(node)) { + return path + } + } + } + return null +} + +export const findPathAll = (tree: any, func: Fn, config: Partial = {}) => { + config = getConfig(config) + const path: any[] = [] + const list = [...tree] + const result: any[] = [] + const visitedSet = new Set(), + { children } = config + while (list.length) { + const node = list[0] + if (visitedSet.has(node)) { + path.pop() + list.shift() + } else { + visitedSet.add(node) + node[children!] && list.unshift(...node[children!]) + path.push(node) + func(node) && result.push([...path]) + } + } + return result +} + +export const filter = ( + tree: T[], + func: (n: T) => boolean, + config: Partial = {} +): T[] => { + config = getConfig(config) + const children = config.children as string + + function listFilter(list: T[]) { + return list + .map((node: any) => ({ ...node })) + .filter((node) => { + node[children] = node[children] && listFilter(node[children]) + return func(node) || (node[children] && node[children].length) + }) + } + + return listFilter(tree) +} + +export const forEach = ( + tree: T[], + func: (n: T) => any, + config: Partial = {} +): void => { + config = getConfig(config) + const list: any[] = [...tree] + const { children } = config + for (let i = 0; i < list.length; i++) { + // func 返回true就终止遍历,避免大量节点场景下无意义循环,引起浏览器卡顿 + if (func(list[i])) { + return + } + children && list[i][children] && list.splice(i + 1, 0, ...list[i][children]) + } +} + +/** + * @description: Extract tree specified structure + */ +export const treeMap = ( + treeData: T[], + opt: { children?: string; conversion: Fn } +): T[] => { + return treeData.map((item) => treeMapEach(item, opt)) +} + +/** + * @description: Extract tree specified structure + */ +export const treeMapEach = ( + data: any, + { children = 'children', conversion }: { children?: string; conversion: Fn } +) => { + const haveChildren = Array.isArray(data[children]) && data[children].length > 0 + const conversionData = conversion(data) || {} + if (haveChildren) { + return { + ...conversionData, + [children]: data[children].map((i: number) => + treeMapEach(i, { + children, + conversion + }) + ) + } + } else { + return { + ...conversionData + } + } +} + +/** + * 递归遍历树结构 + * @param treeDatas 树 + * @param callBack 回调 + * @param parentNode 父节点 + */ +export const eachTree = (treeDatas: any[], callBack: Fn, parentNode = {}) => { + treeDatas.forEach((element) => { + const newNode = callBack(element, parentNode) || element + if (element.children) { + eachTree(element.children, callBack, newNode) + } + }) +} + +/** + * 构造树型结构数据 + * @param {*} data 数据源 + * @param {*} id id字段 默认 'id' + * @param {*} parentId 父节点字段 默认 'parentId' + * @param {*} children 孩子节点字段 默认 'children' + */ +export const handleTree = (data: any[], id?: string, parentId?: string, children?: string) => { + if (!Array.isArray(data)) { + console.warn('data must be an array') + return [] + } + const config = { + id: id || 'id', + parentId: parentId || 'parentId', + childrenList: children || 'children' + } + + const childrenListMap = {} + const nodeIds = {} + const tree: any[] = [] + + for (const d of data) { + const parentId = d[config.parentId] + if (childrenListMap[parentId] == null) { + childrenListMap[parentId] = [] + } + nodeIds[d[config.id]] = d + childrenListMap[parentId].push(d) + } + + for (const d of data) { + const parentId = d[config.parentId] + if (nodeIds[parentId] == null) { + tree.push(d) + } + } + + for (const t of tree) { + adaptToChildrenList(t) + } + + function adaptToChildrenList(o) { + if (childrenListMap[o[config.id]] !== null) { + o[config.childrenList] = childrenListMap[o[config.id]] + } + if (o[config.childrenList]) { + for (const c of o[config.childrenList]) { + adaptToChildrenList(c) + } + } + } + + return tree +} + +/** + * 构造树型结构数据 + * @param {*} data 数据源 + * @param {*} id id字段 默认 'id' + * @param {*} parentId 父节点字段 默认 'parentId' + * @param {*} children 孩子节点字段 默认 'children' + * @param {*} rootId 根Id 默认 0 + */ +// @ts-ignore +export const handleTree2 = (data, id, parentId, children, rootId) => { + id = id || 'id' + parentId = parentId || 'parentId' + // children = children || 'children' + rootId = + rootId || + Math.min( + ...data.map((item) => { + return item[parentId] + }) + ) || + 0 + // 对源数据深度克隆 + const cloneData = JSON.parse(JSON.stringify(data)) + // 循环所有项 + const treeData = cloneData.filter((father) => { + const branchArr = cloneData.filter((child) => { + // 返回每一项的子级数组 + return father[id] === child[parentId] + }) + branchArr.length > 0 ? (father.children = branchArr) : '' + // 返回第一层 + return father[parentId] === rootId + }) + return treeData !== '' ? treeData : data +} + +/** + * 校验选中的节点,是否为指定 level + * + * @param tree 要操作的树结构数据 + * @param nodeId 需要判断在什么层级的数据 + * @param level 检查的级别, 默认检查到二级 + * @return true 是;false 否 + */ +export const checkSelectedNode = (tree: any[], nodeId: any, level = 2): boolean => { + if (typeof tree === 'undefined' || !Array.isArray(tree) || tree.length === 0) { + console.warn('tree must be an array') + return false + } + + // 校验是否是一级节点 + if (tree.some((item) => item.id === nodeId)) { + return false + } + + // 递归计数 + let count = 1 + + // 深层次校验 + function performAThoroughValidation(arr: any[]): boolean { + count += 1 + for (const item of arr) { + if (item.id === nodeId) { + return true + } else if (typeof item.children !== 'undefined' && item.children.length !== 0) { + if (performAThoroughValidation(item.children)) { + return true + } + } + } + return false + } + + for (const item of tree) { + count = 1 + if (performAThoroughValidation(item.children)) { + // 找到后对比是否是期望的层级 + if (count >= level) { + return true + } + } + } + + return false +} + +/** + * 获取节点的完整结构 + * @param tree 树数据 + * @param nodeId 节点 id + */ +export const treeToString = (tree: any[], nodeId) => { + if (typeof tree === 'undefined' || !Array.isArray(tree) || tree.length === 0) { + console.warn('tree must be an array') + return '' + } + // 校验是否是一级节点 + const node = tree.find((item) => item.id === nodeId) + if (typeof node !== 'undefined') { + return node.name + } + let str = '' + + function performAThoroughValidation(arr) { + for (const item of arr) { + if (item.id === nodeId) { + str += `/${item.name}` + return true + } else if (typeof item.children !== 'undefined' && item.children.length !== 0) { + str += `/${item.name}` + if (performAThoroughValidation(item.children)) { + return true + } + } + } + return false + } + + for (const item of tree) { + str = `${item.name}` + if (performAThoroughValidation(item.children)) { + break + } + } + return str +} diff --git a/src/utils/tsxHelper.ts b/src/utils/tsxHelper.ts new file mode 100644 index 0000000..6087fa3 --- /dev/null +++ b/src/utils/tsxHelper.ts @@ -0,0 +1,16 @@ +import { Slots } from 'vue' +import { isFunction } from '@/utils/is' + +export const getSlot = (slots: Slots, slot = 'default', data?: Recordable) => { + // Reflect.has 判断一个对象是否存在某个属性 + if (!slots || !Reflect.has(slots, slot)) { + return null + } + if (!isFunction(slots[slot])) { + console.error(`${slot} is not a function!`) + return null + } + const slotFn = slots[slot] + if (!slotFn) return null + return slotFn(data) +} diff --git a/src/utils/validator.ts b/src/utils/validator.ts new file mode 100644 index 0000000..0b805cb --- /dev/null +++ b/src/utils/validator.ts @@ -0,0 +1,760 @@ +//校验学校编码 只能为数字 +export function validateCode(rule, value, callback) { + if (!value) { + return callback(new Error('学校编码不能为空')) + } else { + const codeReg = /^[0-9]+$/ + const codeMax = /^\d{0,5}$/ + if (codeReg.test(value)) { + if (codeMax.test(value)) { + callback() + } else { + callback(new Error('学校编码不能大于5位')) + } + + } else { + callback(new Error('请输入正确的学校编码,只能是数字')) + } + } +} + +//校验邮箱 +export function validateEmail(rule, value, callback) { + if (value) { + const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/ + if (mailReg.test(value)) { + callback() + } else { + callback(new Error('请输入正确的邮箱格式')) + } + } else { + callback() + } +} + +//校验英文 +export function validateEng(rule, value, callback) { + if (value) { + const mailReg = /^[A-Za-z\-\&\(\)\Ⅰ\Ⅱ\Ⅲ\Ⅳ\Ⅴ\Ⅵ\Ⅶ\Ⅷ\Ⅸ\Ⅹ\s]+$/; + if (mailReg.test(value)) { + callback() + } else { + callback(new Error('请输入正确的英文名字')) + } + } else { + callback() + } +} + +//校验姓名拼音 +export function validateEngName(rule, value, callback) { + if (value) { + const EngNameReg = /^[A-Za-z \(\)\s]+$/ + if (EngNameReg.test(value)) { + callback() + } else { + callback(new Error('请输入正确的姓名拼音')) + } + } else { + callback() + } +} + +//校验手机号码 +export function validateHanset(rule, value, callback) { + if (value) { + // const regs =/^[1][3,4,5,6,7,8,9][0-9]{9}$/; + // const regs = /^1[3|4|5|7|8][0-9]\d{8}$/ + const regs = /^1[3-9]\d{9}$/ + if (regs.test(value)) { + callback() + } else { + return callback(new Error('请输入正确的手机号')) + } + } else { + callback() + } +} + +//校验座机电话 +export function validatePhone(rule, value, callback) { + if (value) { + //const reg = /^1[3|4|5|7|8][0-9]\d{8}$/ + // const regs = /^([0-9]{3,4}-)?[0-9]{7,8}$/; + const regs = /^((0\d{2,3}-\d{7,8}))$/; + if (regs.test(value)) { + callback() + } else { + return callback(new Error('请输入正确的座机号')) + } + } else { + callback() + } +} + +//校验家庭电话 手机或者座机 +export function validateFamilyPhone(rule, value, callback) { + if (value) { + const isPhone = /^([0-9]{3,4}-)?[0-9]{7,8}$/; + // const isMob = /^((\+?86)|(\+86))?(13[0123456789][0-9]{8}|15[0123456789][0-9]{8}|17[0123456789][0-9]{8}|18[0123456789][0-9]{8}|147[0-9]{8}|1349[0-9]{7})$/; + const isMob = /^1[3-9]\d{9}$/ + if (isPhone.test(value) || isMob.test(value)) { + callback() + } else { + return callback(new Error('请输入正确的手机或者座机电话')) + } + } else { + callback() + } +} + +// 校验只能为中文 +export function validateChinese(rule, value, callback) { + if (value) { + const chineseReg = /^[\u4E00-\u9FA5]+$/ + if (chineseReg.test(value)) { + callback() + } else { + callback(new Error('请输入简介,只能为中文')) + } + } else { + callback() + } +} + +// 校验名称既能为中文也可以为英文 +export function validateName(rule, value, callback) { + if (value) { + const chineseReg = /^[\u4E00-\u9FA5]+$/ + const engLish = /^[A-Za-z]+$/ + if (chineseReg.test(value) || engLish.test(value)) { + callback() + } else { + callback(new Error('请输入正确的中文或者英文名称')) + } + } else { + callback() + } +} + +// 校验负责人既能为中文也可以为英文 +export function validateChargeperson(rule, value, callback) { + if (value) { + const chineseReg = /^[\u4E00-\u9FA5]+$/ + const engLish = /^[A-Za-z]+$/ + if (chineseReg.test(value) || engLish.test(value)) { + callback() + } else { + callback(new Error('请输入正确的负责人(中英文都可以)')) + } + } else { + callback() + } +} + +//校验学校名称不能为空 +export function validateXXMC(rule, value, callback) { + if (!value) { + return callback(new Error('案例名称不能为空')) + } else { + const chineseReg = /^[\u4E00-\u9FA5]+$/ + if (chineseReg.test(value)) { + callback() + } else { + callback(new Error('请输入正确的案例名称,只能是汉字')) + } + } +} + +//校验中英文数字和下划线都可以 +export function validateZYS(rule, value, callback) { + if (value) { + //const postReg =/^[\u4e00-\u9fa5_a-zA-Z0-9_]{4,10}+$/ + const Reg = /^[\u4e00-\u9fa5a-zA-Z0-9]+$/ + if (Reg.test(value)) { + callback() + } else { + callback(new Error('请输入正确的名称')) + } + } else { + callback() + } +} + +// 校验邮政编码 +export function validatePostCode(rule, value, callback) { + if (value) { + const postReg = /^[1-9]\d{5}$/ + if (postReg.test(value)) { + callback() + } else { + callback(new Error('请输入正确的邮政编码')) + } + } else { + callback() + } +} + +// 数字 +export function validateNum(rule, value, callback) { + if (value) { + const numReg = /^[\d]+$/ + if (numReg.test(value)) { + callback() + } else { + callback(new Error('请输入数字')) + } + } else { + callback() + } +} + +//数字和小数点 +export function validateNumDot(rule, value, callback) { + if (value) { + const numReg = /^\d+$|^\d+\.\d+$/g + if (numReg.test(value)) { + callback() + } else { + callback(new Error('请输入数字或小数点')) + } + } else { + callback() + } +} + +// 组织机构代码 +export function validateOrganization(rule, value, callback) { + if (value) { + const orgReg = /^[A-Za-z0-9]\w{14}$/g + if (orgReg.test(value)) { + callback() + } else { + callback(new Error('请输入组织机构代码')) + } + } else { + callback() + } + +} + +// 传真 +export function validateFax(rule, value, callback) { + if (value) { + const faxReg = /^(\d{3,4}-)?\d{7,8}$/ + if (faxReg.test(value)) { + callback() + } else { + callback(new Error('请输入正确的传真')) + } + } else { + callback() + } +} + +// 主页地址 +export function validateHome(rule, value, callback) { + if (value) { + const homeReg = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\*\+,;=.]+$/ + if (homeReg.test(value)) { + callback() + } else { + return callback(new Error('请输入正确的主页地址')) + } + } else { + callback() + } +} + +// 学分 小数,且保留最多三位小数 +export function validateXf(rule, value, callback) { + if (!value) { + return callback(new Error('学分不能为空')) + } else { + const numReg = /^[0-9]+\.[0-9]{0,3}$/ + if (numReg.test(value)) { + callback() + } else { + callback(new Error('请输入小数,且小数点后最多三位')) + } + } +} + +// 数字格式 小数点后一位 +export function validateOneNum(rule, value, callback) { + if (value) { + const numReg = /^\d+(\.\d+)?$/ + const numOneReg = /^\d*\.{0,1}\d{0,1}$/ + if (numReg.test(value)) { + if (numOneReg.test(value)) { + callback() + } else { + callback(new Error('小数点后最多1位')) + } + } else { + callback(new Error('请输入数字')) + } + } + callback() +} + +// 数字格式 小数点后两位 +export function validateTwoNum(rule, value, callback) { + if (value) { + const numReg = /^\d+(\.\d+)?$/ + const numTwoReg = /^\d*\.{0,2}\d{0,2}$/ + if (numReg.test(value)) { + if (numTwoReg.test(value)) { + callback() + } else { + callback(new Error('小数点后最多2位')) + } + } else { + callback(new Error('请输入数字')) + } + } + callback() +} + + +// 数字格式 小数点后两位 小数点前保留五位 +export function validateTwoNumThree(rule, value, callback) { + if (value) { + if (Number(value) > 10000) {// 校验value值不能大于10000 + callback(new Error('数值过大,请重新输入')) + } + + const numReg = /^\d+(\.\d+)?$/ + const numTwoReg = /^\d*\.{0,2}\d{0,2}$/ + if (numReg.test(value)) { + if (numTwoReg.test(value)) { + callback() + } else { + callback(new Error('小数点后最多2位')) + } + } else { + callback(new Error('请输入数字')) + } + } + + callback() +} + +// 数字格式 小数点后三位 +export function validateThreeNum(rule, value, callback) { + if (value) { + const numReg = /^\d+(\.\d+)?$/ + const numTwoReg = /^\d*\.{0,3}\d{0,3}$/ + if (numReg.test(value)) { + if (numTwoReg.test(value)) { + callback() + } else { + callback(new Error('小数点后最多3位')) + } + } else { + callback(new Error('请输入数字')) + } + } + callback() + // if (!value) { + // return callback(new Error('字段不能为空')) + // } else { + // const numReg = /^\d+(\.\d+)?$/ + // const numTwoReg = /^\d*\.{0,3}\d{0,3}$/ + // if (numReg.test(value)) { + // if (numTwoReg.test(value)) { + // callback() + // } else { + // callback(new Error('小数点后最多3位')) + // } + // } else { + // callback(new Error('请输入数字')) + // } + // } +} + +//校验年份必须为4位数字 +export function validateNF(rule, value, callback) { + if (value) { + const NFReg = /^\d{4}$/ + if (NFReg.test(value)) { + callback() + } else { + callback(new Error('请输入4位数字')) + } + } else { + callback() + } +} + +//校验年份必须为4位数字 +export function validateXQ(rule, value, callback) { + if (value) { + const NFReg = /^\d{5}$/ + if (NFReg.test(value)) { + callback() + } else { + callback(new Error('请输入5位数字')) + } + } else { + callback() + } +} + +//校验分数最大值 +export function validateMaxNumber(rule, value, callback) { + if (parseInt(value) <= 200) { + callback() + } else { + callback(new Error('分数不能大于200')) + } + +} + +//校验正整数 +export function validateInteger(rule, value, callback) { + if (value) { + const integerReg = /^[+]{0,1}(\d+)$/ + if (integerReg.test(value)) { + callback() + } else { + callback(new Error('请输入正确的整数')) + } + } else { + callback() + } +} + +//校验整数 +export function validateroundNumber(rule, value, callback) { + if (value) { + const numReg = /^[1-9]\d*$/ + if (numReg.test(value)) { + callback() + } else { + callback(new Error('请输入正确的整数')) + } + } else { + callback() + } +} +//校验身份证号 +export function validateCard(rule, value, callback) { + if (value) { + const cardBoolean = IdCardValidate(value); + // const cardReg =/(^\d{18}$)|(^\d{17}(\d|X|x)$)/ + // if (cardReg.test(value)) { + if (cardBoolean) { + callback() + } else { + callback(new Error('请输入正确的身份证号')) + } + } else { + callback() + } +} + +//身份证:身份证校验 +function IdCardValidate(code) { + let tip = ""; + if (code != "") { + const city = { + 11: "北京", + 12: "天津", + 13: "河北", + 14: "山西", + 15: "内蒙古", + 21: "辽宁", + 22: "吉林", + 23: "黑龙江 ", + 31: "上海", + 32: "江苏", + 33: "浙江", + 34: "安徽", + 35: "福建", + 36: "江西", + 37: "山东", + 41: "河南", + 42: "湖北 ", + 43: "湖南", + 44: "广东", + 45: "广西", + 46: "海南", + 50: "重庆", + 51: "四川", + 52: "贵州", + 53: "云南", + 54: "西藏 ", + 61: "陕西", + 62: "甘肃", + 63: "青海", + 64: "宁夏", + 65: "新疆", + 71: "台湾", + 81: "香港", + 82: "澳门", + 91: "国外 " + }; + + let pass = true; + + //是否为空 + if (code === '') { + tip = "请输入身份证号,身份证号不能为空"; + pass = false; + } + //校验长度,类型 + else if (isCardNo(code) === false) { + tip = "您输入的身份证号码不正确,请重新输入"; + pass = false; + } + //检查省份 + else if (checkProvince(code, city) === false) { + tip = "您输入的身份证号码不正确,请重新输入"; + pass = false; + } + //校验生日 + else if (checkBirthday(code) === false) { + tip = "您输入的身份证号码生日不正确,请重新输入"; + pass = false; + } else { + //18位身份证需要验证最后一位校验位 + if (code.length == 18) { + code = code.split(''); + //∑(ai×Wi)(mod 11) + //加权因子 + const factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; + //校验位 + const parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2]; + let sum = 0; + let ai = 0; + let wi = 0; + for (let i = 0; i < 17; i++) { + ai = code[i]; + wi = factor[i]; + sum += ai * wi; + } + const last = parity[sum % 11]; + if (parity[sum % 11] != code[17]) { + tip = "身份证格式错误"; + pass = false; + } + } + } + return pass; + } +} + +//身份证:检查身份证号码是否符合规范,包括长度,类型 +function isCardNo(card) { + //身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X + const reg = /(^\d{15}$)|(^\d{17}(\d|X)$)/; + if (reg.test(card) === false) { + return false; + } + return true; +}; + +//身份证:取身份证前两位,校验省份 +function checkProvince(card, city) { + const province = card.substr(0, 2); + if (city[province] == undefined) { + return false; + } + return true; +}; + +//身份证:检查生日是否正确 +function checkBirthday(card) { + const len = card.length; + //身份证15位时,次序为省(3位)市(3位)年(2位)月(2位)日(2位)校验位(3位),皆为数字 + if (len == '15') { + const re_fifteen = /^(\d{6})(\d{2})(\d{2})(\d{2})(\d{3})$/; + const arr_data = card.match(re_fifteen); + const year = arr_data[2]; + const month = arr_data[3]; + const day = arr_data[4]; + const birthday = new Date('19' + year + '/' + month + '/' + day); + return verifyBirthday('19' + year, month, day, birthday); + } + //身份证18位时,次序为省(3位)市(3位)年(4位)月(2位)日(2位)校验位(4位),校验位末尾可能为X + if (len == '18') { + const re_eighteen = /^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/; + const arr_data = card.match(re_eighteen); + const year = arr_data[2]; + const month = arr_data[3]; + const day = arr_data[4]; + const birthday = new Date(year + '/' + month + '/' + day); + return verifyBirthday(year, month, day, birthday); + } + return false; +}; + +//身份证:校验日期 +function verifyBirthday(year, month, day, birthday) { + const now = new Date(); + const now_year = now.getFullYear(); + //年月日是否合理 + if (birthday.getFullYear() == year && (birthday.getMonth() + 1) == month && birthday.getDate() == day) { + //判断年份的范围(3岁到100岁之间) + const time = now_year - year; + if (time >= 3 && time <= 100) { + return true; + } + return false; + } + return false;By18Val +}; + +/** + * 判断身份证号码为18位时最后的验证位是否正确 + * @param a_idCard 身份证号码数组 + * @return + */ +function isTrueValidateCodeBy18IdCard(a_idCard) { + const By18Val = a_idCard[17].toLowerCase(); // 获取第十八位值 + const numReg = /^[1-9]\d*$/ + let numVal = false; // 校验第十八位是否为整数 + if (numReg.test(Number(By18Val))) { + numVal = true + } else { + numVal = false + } + if (By18Val == 'x' || By18Val == 'X' || numVal) { + return true + } else { + return false + } +} + +/** + * 验证身份证号码前两位,省级编码的准确性 + * @param AddressNum + * @constructor + */ +function IdCardValidateAddress(AddressNum) { + const city = { + 11: "北京", + 12: "天津", + 13: "河北", + 14: "山西", + 15: "内蒙古", + 21: "辽宁", + 22: "吉林", + 23: "黑龙江 ", + 31: "上海", + 32: "江苏", + 33: "浙江", + 34: "安徽", + 35: "福建", + 36: "江西", + 37: "山东", + 41: "河南", + 42: "湖北 ", + 43: "湖南", + 44: "广东", + 45: "广西", + 46: "海南", + 50: "重庆", + 51: "四川", + 52: "贵州", + 53: "云南", + 54: "西藏 ", + 61: "陕西", + 62: "甘肃", + 63: "青海", + 64: "宁夏", + 65: "新疆", + 71: "台湾", + 81: "香港", + 82: "澳门", + 91: "国外 " + }; + if (city[AddressNum.substr(0, 2)]) { + return true + } else { + return false + } +} + +/** + * 验证18位数身份证号码中的生日是否是有效生日 + * @param idCard 18位书身份证字符串 + * @return + */ +function isValidityBrithBy18IdCard(idCard18) { + const year = idCard18.substring(6, 10); + const month = idCard18.substring(10, 12); + const day = idCard18.substring(12, 14); + const temp_date = new Date(year, parseFloat(month) - 1, parseFloat(day)); + // 这里用getFullYear()获取年份,避免千年虫问题 + if (temp_date.getFullYear() != parseFloat(year) + || temp_date.getMonth() != parseFloat(month) - 1 + || temp_date.getDate() != parseFloat(day)) { + return false; + } else { + return true; + } +} + +/** + * 验证15位数身份证号码中的生日是否是有效生日 + * @param idCard15 15位书身份证字符串 + * @return + */ +function isValidityBrithBy15IdCard(idCard15) { + const year = idCard15.substring(6, 8); + const month = idCard15.substring(8, 10); + const day = idCard15.substring(10, 12); + const temp_date = new Date(year, parseFloat(month) - 1, parseFloat(day)); + // 对于老身份证中的你年龄则不需考虑千年虫问题而使用getYear()方法 + if (temp_date.getYear() != parseFloat(year) + || temp_date.getMonth() != parseFloat(month) - 1 + || temp_date.getDate() != parseFloat(day)) { + return false; + } else { + return true; + } +} + +/** + * 去掉字符串头尾空格 + * @param str + * @returns {*} + */ +function trim(str) { + return str.replace(/(^\s*)|(\s*$)/g, ""); +} + + +export default { + validateCode, + validateEmail, + validateEng, + validatePhone, + validateChinese, + validatePostCode, + validateNum, + validateNumDot, + validateZYS, + validateOrganization, + validateFax, + validateHome, + validateXXMC, + validateXf, + validateOneNum, + validateMaxNumber, + validateTwoNum, + validateTwoNumThree, + validateThreeNum, + validateInteger, + validateNF, + validateXQ, + validateroundNumber, + validateEngName, + validateCard, + validateHanset, + validateFamilyPhone, + validateName, + validateChargeperson, +} diff --git a/src/views/Home/Index.vue b/src/views/Home/Index.vue new file mode 100644 index 0000000..121ec6a --- /dev/null +++ b/src/views/Home/Index.vue @@ -0,0 +1,381 @@ + + diff --git a/src/views/Home/Index2.vue b/src/views/Home/Index2.vue new file mode 100644 index 0000000..c9429ab --- /dev/null +++ b/src/views/Home/Index2.vue @@ -0,0 +1,319 @@ + + + + diff --git a/src/views/Home/echarts-data.ts b/src/views/Home/echarts-data.ts new file mode 100644 index 0000000..56093f4 --- /dev/null +++ b/src/views/Home/echarts-data.ts @@ -0,0 +1,308 @@ +import { EChartsOption } from 'echarts' + +const { t } = useI18n() + +export const lineOptions: EChartsOption = { + title: { + text: t('analysis.monthlySales'), + left: 'center' + }, + xAxis: { + data: [ + t('analysis.january'), + t('analysis.february'), + t('analysis.march'), + t('analysis.april'), + t('analysis.may'), + t('analysis.june'), + t('analysis.july'), + t('analysis.august'), + t('analysis.september'), + t('analysis.october'), + t('analysis.november'), + t('analysis.december') + ], + boundaryGap: false, + axisTick: { + show: false + } + }, + grid: { + left: 20, + right: 20, + bottom: 20, + top: 80, + containLabel: true + }, + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'cross' + }, + padding: [5, 10] + }, + yAxis: { + axisTick: { + show: false + } + }, + legend: { + data: [t('analysis.estimate'), t('analysis.actual')], + top: 50 + }, + series: [ + { + name: t('analysis.estimate'), + smooth: true, + type: 'line', + data: [100, 120, 161, 134, 105, 160, 165, 114, 163, 185, 118, 123], + animationDuration: 2800, + animationEasing: 'cubicInOut' + }, + { + name: t('analysis.actual'), + smooth: true, + type: 'line', + itemStyle: {}, + data: [120, 82, 91, 154, 162, 140, 145, 250, 134, 56, 99, 123], + animationDuration: 2800, + animationEasing: 'quadraticOut' + } + ] +} + +export const pieOptions: EChartsOption = { + title: { + text: t('analysis.userAccessSource'), + left: 'center' + }, + tooltip: { + trigger: 'item', + formatter: '{a}
{b} : {c} ({d}%)' + }, + legend: { + orient: 'vertical', + left: 'left', + data: [ + t('analysis.directAccess'), + t('analysis.mailMarketing'), + t('analysis.allianceAdvertising'), + t('analysis.videoAdvertising'), + t('analysis.searchEngines') + ] + }, + series: [ + { + name: t('analysis.userAccessSource'), + type: 'pie', + radius: '55%', + center: ['50%', '60%'], + data: [ + { value: 335, name: t('analysis.directAccess') }, + { value: 310, name: t('analysis.mailMarketing') }, + { value: 234, name: t('analysis.allianceAdvertising') }, + { value: 135, name: t('analysis.videoAdvertising') }, + { value: 1548, name: t('analysis.searchEngines') } + ] + } + ] +} + +export const barOptions: EChartsOption = { + title: { + text: t('analysis.weeklyUserActivity'), + left: 'center' + }, + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'shadow' + } + }, + grid: { + left: 50, + right: 20, + bottom: 20 + }, + xAxis: { + type: 'category', + data: [ + t('analysis.monday'), + t('analysis.tuesday'), + t('analysis.wednesday'), + t('analysis.thursday'), + t('analysis.friday'), + t('analysis.saturday'), + t('analysis.sunday') + ], + axisTick: { + alignWithLabel: true + } + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: t('analysis.activeQuantity'), + data: [13253, 34235, 26321, 12340, 24643, 1322, 1324], + type: 'bar' + } + ] +} + +export const radarOption: EChartsOption = { + legend: { + data: [t('workplace.personal'), t('workplace.team')] + }, + radar: { + // shape: 'circle', + indicator: [ + { name: t('workplace.quote'), max: 65 }, + { name: t('workplace.contribution'), max: 160 }, + { name: t('workplace.hot'), max: 300 }, + { name: t('workplace.yield'), max: 130 }, + { name: t('workplace.follow'), max: 100 } + ] + }, + series: [ + { + name: `xxx${t('workplace.index')}`, + type: 'radar', + data: [ + { + value: [42, 30, 20, 35, 80], + name: t('workplace.personal') + }, + { + value: [50, 140, 290, 100, 90], + name: t('workplace.team') + } + ] + } + ] +} + +export const wordOptions = { + series: [ + { + type: 'wordCloud', + gridSize: 2, + sizeRange: [12, 50], + rotationRange: [-90, 90], + shape: 'pentagon', + width: 600, + height: 400, + drawOutOfBound: true, + textStyle: { + color: function () { + return ( + 'rgb(' + + [ + Math.round(Math.random() * 160), + Math.round(Math.random() * 160), + Math.round(Math.random() * 160) + ].join(',') + + ')' + ) + } + }, + emphasis: { + textStyle: { + shadowBlur: 10, + shadowColor: '#333' + } + }, + data: [ + { + name: 'Sam S Club', + value: 10000, + textStyle: { + color: 'black' + }, + emphasis: { + textStyle: { + color: 'red' + } + } + }, + { + name: 'Macys', + value: 6181 + }, + { + name: 'Amy Schumer', + value: 4386 + }, + { + name: 'Jurassic World', + value: 4055 + }, + { + name: 'Charter Communications', + value: 2467 + }, + { + name: 'Chick Fil A', + value: 2244 + }, + { + name: 'Planet Fitness', + value: 1898 + }, + { + name: 'Pitch Perfect', + value: 1484 + }, + { + name: 'Express', + value: 1112 + }, + { + name: 'Home', + value: 965 + }, + { + name: 'Johnny Depp', + value: 847 + }, + { + name: 'Lena Dunham', + value: 582 + }, + { + name: 'Lewis Hamilton', + value: 555 + }, + { + name: 'KXAN', + value: 550 + }, + { + name: 'Mary Ellen Mark', + value: 462 + }, + { + name: 'Farrah Abraham', + value: 366 + }, + { + name: 'Rita Ora', + value: 360 + }, + { + name: 'Serena Williams', + value: 282 + }, + { + name: 'NCAA baseball tournament', + value: 273 + }, + { + name: 'Point Break', + value: 265 + } + ] + } + ] +} diff --git a/src/views/Home/types.ts b/src/views/Home/types.ts new file mode 100644 index 0000000..e6313d3 --- /dev/null +++ b/src/views/Home/types.ts @@ -0,0 +1,55 @@ +export type WorkplaceTotal = { + project: number + access: number + todo: number +} + +export type Project = { + name: string + icon: string + message: string + personal: string + time: Date | number | string +} + +export type Notice = { + title: string + type: string + keys: string[] + date: Date | number | string +} + +export type Shortcut = { + name: string + icon: string + url: string +} + +export type RadarData = { + personal: number + team: number + max: number + name: string +} +export type AnalysisTotalTypes = { + users: number + messages: number + moneys: number + shoppings: number +} + +export type UserAccessSource = { + value: number + name: string +} + +export type WeeklyUserActivity = { + value: number + name: string +} + +export type MonthlySales = { + name: string + estimate: number + actual: number +} diff --git a/src/views/Login/Login.vue b/src/views/Login/Login.vue new file mode 100644 index 0000000..a0025ab --- /dev/null +++ b/src/views/Login/Login.vue @@ -0,0 +1,104 @@ + + + + diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue new file mode 100644 index 0000000..9499f49 --- /dev/null +++ b/src/views/Login/components/LoginForm.vue @@ -0,0 +1,278 @@ + + + + diff --git a/src/views/Login/components/LoginFormTitle.vue b/src/views/Login/components/LoginFormTitle.vue new file mode 100644 index 0000000..cdf4fac --- /dev/null +++ b/src/views/Login/components/LoginFormTitle.vue @@ -0,0 +1,26 @@ + + diff --git a/src/views/Login/components/MobileForm.vue b/src/views/Login/components/MobileForm.vue new file mode 100644 index 0000000..ebb36b8 --- /dev/null +++ b/src/views/Login/components/MobileForm.vue @@ -0,0 +1,225 @@ + + + + diff --git a/src/views/Login/components/QrCodeForm.vue b/src/views/Login/components/QrCodeForm.vue new file mode 100644 index 0000000..31d2845 --- /dev/null +++ b/src/views/Login/components/QrCodeForm.vue @@ -0,0 +1,30 @@ + + diff --git a/src/views/Login/components/RegisterForm.vue b/src/views/Login/components/RegisterForm.vue new file mode 100644 index 0000000..23b3bd4 --- /dev/null +++ b/src/views/Login/components/RegisterForm.vue @@ -0,0 +1,142 @@ + + diff --git a/src/views/Login/components/SSOLogin.vue b/src/views/Login/components/SSOLogin.vue new file mode 100644 index 0000000..f31ab0e --- /dev/null +++ b/src/views/Login/components/SSOLogin.vue @@ -0,0 +1,199 @@ + + diff --git a/src/views/Login/components/index.ts b/src/views/Login/components/index.ts new file mode 100644 index 0000000..204ad73 --- /dev/null +++ b/src/views/Login/components/index.ts @@ -0,0 +1,8 @@ +import LoginForm from './LoginForm.vue' +import MobileForm from './MobileForm.vue' +import LoginFormTitle from './LoginFormTitle.vue' +import RegisterForm from './RegisterForm.vue' +import QrCodeForm from './QrCodeForm.vue' +import SSOLoginVue from './SSOLogin.vue' + +export { LoginForm, MobileForm, LoginFormTitle, RegisterForm, QrCodeForm, SSOLoginVue } diff --git a/src/views/Login/components/useLogin.ts b/src/views/Login/components/useLogin.ts new file mode 100644 index 0000000..b4a02f8 --- /dev/null +++ b/src/views/Login/components/useLogin.ts @@ -0,0 +1,42 @@ +import { Ref } from 'vue' + +export enum LoginStateEnum { + LOGIN, + REGISTER, + RESET_PASSWORD, + MOBILE, + QR_CODE, + SSO +} + +const currentState = ref(LoginStateEnum.LOGIN) + +export function useLoginState() { + function setLoginState(state: LoginStateEnum) { + currentState.value = state + } + const getLoginState = computed(() => currentState.value) + + function handleBackLogin() { + setLoginState(LoginStateEnum.LOGIN) + } + + return { + setLoginState, + getLoginState, + handleBackLogin + } +} + +export function useFormValid(formRef: Ref) { + async function validForm() { + const form = unref(formRef) + if (!form) return + const data = await form.validate() + return data as T + } + + return { + validForm + } +} diff --git a/src/views/Profile/Index.vue b/src/views/Profile/Index.vue new file mode 100644 index 0000000..e813f04 --- /dev/null +++ b/src/views/Profile/Index.vue @@ -0,0 +1,64 @@ + + + diff --git a/src/views/Profile/components/BasicInfo.vue b/src/views/Profile/components/BasicInfo.vue new file mode 100644 index 0000000..e2189b1 --- /dev/null +++ b/src/views/Profile/components/BasicInfo.vue @@ -0,0 +1,92 @@ + + diff --git a/src/views/Profile/components/ProfileUser.vue b/src/views/Profile/components/ProfileUser.vue new file mode 100644 index 0000000..b493499 --- /dev/null +++ b/src/views/Profile/components/ProfileUser.vue @@ -0,0 +1,99 @@ + + + + diff --git a/src/views/Profile/components/ResetPwd.vue b/src/views/Profile/components/ResetPwd.vue new file mode 100644 index 0000000..477be91 --- /dev/null +++ b/src/views/Profile/components/ResetPwd.vue @@ -0,0 +1,73 @@ + + diff --git a/src/views/Profile/components/UserAvatar.vue b/src/views/Profile/components/UserAvatar.vue new file mode 100644 index 0000000..c20168f --- /dev/null +++ b/src/views/Profile/components/UserAvatar.vue @@ -0,0 +1,39 @@ + + + + diff --git a/src/views/Profile/components/UserSocial.vue b/src/views/Profile/components/UserSocial.vue new file mode 100644 index 0000000..2f021ab --- /dev/null +++ b/src/views/Profile/components/UserSocial.vue @@ -0,0 +1,94 @@ + + diff --git a/src/views/Profile/components/index.ts b/src/views/Profile/components/index.ts new file mode 100644 index 0000000..9e1883c --- /dev/null +++ b/src/views/Profile/components/index.ts @@ -0,0 +1,7 @@ +import BasicInfo from './BasicInfo.vue' +import ProfileUser from './ProfileUser.vue' +import ResetPwd from './ResetPwd.vue' +import UserAvatarVue from './UserAvatar.vue' +import UserSocial from './UserSocial.vue' + +export { BasicInfo, ProfileUser, ResetPwd, UserAvatarVue, UserSocial } diff --git a/src/views/Redirect/Redirect.vue b/src/views/Redirect/Redirect.vue new file mode 100644 index 0000000..f7717ce --- /dev/null +++ b/src/views/Redirect/Redirect.vue @@ -0,0 +1,28 @@ + + diff --git a/src/views/bpm/definition/index.vue b/src/views/bpm/definition/index.vue new file mode 100644 index 0000000..1c179e7 --- /dev/null +++ b/src/views/bpm/definition/index.vue @@ -0,0 +1,174 @@ + + + diff --git a/src/views/bpm/form/editor/index.vue b/src/views/bpm/form/editor/index.vue new file mode 100644 index 0000000..b7c45ca --- /dev/null +++ b/src/views/bpm/form/editor/index.vue @@ -0,0 +1,119 @@ + + diff --git a/src/views/bpm/form/index.vue b/src/views/bpm/form/index.vue new file mode 100644 index 0000000..0c9f2f8 --- /dev/null +++ b/src/views/bpm/form/index.vue @@ -0,0 +1,165 @@ + + + diff --git a/src/views/bpm/group/UserGroupForm.vue b/src/views/bpm/group/UserGroupForm.vue new file mode 100644 index 0000000..35d833e --- /dev/null +++ b/src/views/bpm/group/UserGroupForm.vue @@ -0,0 +1,132 @@ + + diff --git a/src/views/bpm/group/index.vue b/src/views/bpm/group/index.vue new file mode 100644 index 0000000..307df71 --- /dev/null +++ b/src/views/bpm/group/index.vue @@ -0,0 +1,149 @@ + + + diff --git a/src/views/bpm/model/ModelForm.vue b/src/views/bpm/model/ModelForm.vue new file mode 100644 index 0000000..0bd5409 --- /dev/null +++ b/src/views/bpm/model/ModelForm.vue @@ -0,0 +1,230 @@ + + diff --git a/src/views/bpm/model/ModelImportForm.vue b/src/views/bpm/model/ModelImportForm.vue new file mode 100644 index 0000000..74f10ff --- /dev/null +++ b/src/views/bpm/model/ModelImportForm.vue @@ -0,0 +1,140 @@ + + diff --git a/src/views/bpm/model/editor/index.vue b/src/views/bpm/model/editor/index.vue new file mode 100644 index 0000000..f5c0ec6 --- /dev/null +++ b/src/views/bpm/model/editor/index.vue @@ -0,0 +1,105 @@ + + + + diff --git a/src/views/bpm/model/index.vue b/src/views/bpm/model/index.vue new file mode 100644 index 0000000..a1a609f --- /dev/null +++ b/src/views/bpm/model/index.vue @@ -0,0 +1,314 @@ + + + diff --git a/src/views/bpm/oa/leave/create.vue b/src/views/bpm/oa/leave/create.vue new file mode 100644 index 0000000..a47228c --- /dev/null +++ b/src/views/bpm/oa/leave/create.vue @@ -0,0 +1,89 @@ + + diff --git a/src/views/bpm/oa/leave/detail.vue b/src/views/bpm/oa/leave/detail.vue new file mode 100644 index 0000000..87036d8 --- /dev/null +++ b/src/views/bpm/oa/leave/detail.vue @@ -0,0 +1,51 @@ + + diff --git a/src/views/bpm/oa/leave/index.vue b/src/views/bpm/oa/leave/index.vue new file mode 100644 index 0000000..d232400 --- /dev/null +++ b/src/views/bpm/oa/leave/index.vue @@ -0,0 +1,175 @@ + + diff --git a/src/views/bpm/processInstance/create/index.vue b/src/views/bpm/processInstance/create/index.vue new file mode 100644 index 0000000..a10e020 --- /dev/null +++ b/src/views/bpm/processInstance/create/index.vue @@ -0,0 +1,133 @@ + + diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceBpmnViewer.vue b/src/views/bpm/processInstance/detail/ProcessInstanceBpmnViewer.vue new file mode 100644 index 0000000..0a2057d --- /dev/null +++ b/src/views/bpm/processInstance/detail/ProcessInstanceBpmnViewer.vue @@ -0,0 +1,57 @@ + + + diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceTaskList.vue b/src/views/bpm/processInstance/detail/ProcessInstanceTaskList.vue new file mode 100644 index 0000000..ec87104 --- /dev/null +++ b/src/views/bpm/processInstance/detail/ProcessInstanceTaskList.vue @@ -0,0 +1,97 @@ + + diff --git a/src/views/bpm/processInstance/detail/TaskReturnDialogForm.vue b/src/views/bpm/processInstance/detail/TaskReturnDialogForm.vue new file mode 100644 index 0000000..f93bf2c --- /dev/null +++ b/src/views/bpm/processInstance/detail/TaskReturnDialogForm.vue @@ -0,0 +1,90 @@ + + diff --git a/src/views/bpm/processInstance/detail/TaskUpdateAssigneeForm.vue b/src/views/bpm/processInstance/detail/TaskUpdateAssigneeForm.vue new file mode 100644 index 0000000..6adf1de --- /dev/null +++ b/src/views/bpm/processInstance/detail/TaskUpdateAssigneeForm.vue @@ -0,0 +1,83 @@ + + diff --git a/src/views/bpm/processInstance/detail/index.vue b/src/views/bpm/processInstance/detail/index.vue new file mode 100644 index 0000000..fbadad4 --- /dev/null +++ b/src/views/bpm/processInstance/detail/index.vue @@ -0,0 +1,285 @@ + + diff --git a/src/views/bpm/processInstance/index.vue b/src/views/bpm/processInstance/index.vue new file mode 100644 index 0000000..e2fc270 --- /dev/null +++ b/src/views/bpm/processInstance/index.vue @@ -0,0 +1,186 @@ + + diff --git a/src/views/bpm/task/done/TaskDetail.vue b/src/views/bpm/task/done/TaskDetail.vue new file mode 100644 index 0000000..5bc06f1 --- /dev/null +++ b/src/views/bpm/task/done/TaskDetail.vue @@ -0,0 +1,51 @@ + + diff --git a/src/views/bpm/task/done/index.vue b/src/views/bpm/task/done/index.vue new file mode 100644 index 0000000..24d62db --- /dev/null +++ b/src/views/bpm/task/done/index.vue @@ -0,0 +1,125 @@ + + diff --git a/src/views/bpm/task/todo/index.vue b/src/views/bpm/task/todo/index.vue new file mode 100644 index 0000000..5dc164e --- /dev/null +++ b/src/views/bpm/task/todo/index.vue @@ -0,0 +1,112 @@ + + + diff --git a/src/views/bpm/taskAssignRule/TaskAssignRuleForm.vue b/src/views/bpm/taskAssignRule/TaskAssignRuleForm.vue new file mode 100644 index 0000000..9b215e0 --- /dev/null +++ b/src/views/bpm/taskAssignRule/TaskAssignRuleForm.vue @@ -0,0 +1,250 @@ + + diff --git a/src/views/bpm/taskAssignRule/index.vue b/src/views/bpm/taskAssignRule/index.vue new file mode 100644 index 0000000..0fe9bde --- /dev/null +++ b/src/views/bpm/taskAssignRule/index.vue @@ -0,0 +1,136 @@ + + diff --git a/src/views/error/403.vue b/src/views/error/403.vue new file mode 100644 index 0000000..a3ec487 --- /dev/null +++ b/src/views/error/403.vue @@ -0,0 +1,8 @@ + + diff --git a/src/views/error/404.vue b/src/views/error/404.vue new file mode 100644 index 0000000..f6a08de --- /dev/null +++ b/src/views/error/404.vue @@ -0,0 +1,7 @@ + + diff --git a/src/views/error/500.vue b/src/views/error/500.vue new file mode 100644 index 0000000..998487d --- /dev/null +++ b/src/views/error/500.vue @@ -0,0 +1,7 @@ + + diff --git a/src/views/infra/apiAccessLog/ApiAccessLogDetail.vue b/src/views/infra/apiAccessLog/ApiAccessLogDetail.vue new file mode 100644 index 0000000..43a34dc --- /dev/null +++ b/src/views/infra/apiAccessLog/ApiAccessLogDetail.vue @@ -0,0 +1,67 @@ + + + diff --git a/src/views/infra/apiAccessLog/index.vue b/src/views/infra/apiAccessLog/index.vue new file mode 100644 index 0000000..2306a39 --- /dev/null +++ b/src/views/infra/apiAccessLog/index.vue @@ -0,0 +1,167 @@ + + diff --git a/src/views/infra/apiErrorLog/ApiErrorLogDetail.vue b/src/views/infra/apiErrorLog/ApiErrorLogDetail.vue new file mode 100644 index 0000000..7340ca8 --- /dev/null +++ b/src/views/infra/apiErrorLog/ApiErrorLogDetail.vue @@ -0,0 +1,81 @@ + + diff --git a/src/views/infra/apiErrorLog/index.vue b/src/views/infra/apiErrorLog/index.vue new file mode 100644 index 0000000..4e6c41e --- /dev/null +++ b/src/views/infra/apiErrorLog/index.vue @@ -0,0 +1,249 @@ + + + diff --git a/src/views/infra/build/index.vue b/src/views/infra/build/index.vue new file mode 100644 index 0000000..11bfc99 --- /dev/null +++ b/src/views/infra/build/index.vue @@ -0,0 +1,143 @@ + + diff --git a/src/views/infra/codegen/PreviewCode.vue b/src/views/infra/codegen/PreviewCode.vue new file mode 100644 index 0000000..b04775e --- /dev/null +++ b/src/views/infra/codegen/PreviewCode.vue @@ -0,0 +1,222 @@ + + + diff --git a/src/views/infra/codegen/components/BasicInfoForm.vue b/src/views/infra/codegen/components/BasicInfoForm.vue new file mode 100644 index 0000000..1859300 --- /dev/null +++ b/src/views/infra/codegen/components/BasicInfoForm.vue @@ -0,0 +1,87 @@ + + diff --git a/src/views/infra/codegen/components/ColumInfoForm.vue b/src/views/infra/codegen/components/ColumInfoForm.vue new file mode 100644 index 0000000..737c2e2 --- /dev/null +++ b/src/views/infra/codegen/components/ColumInfoForm.vue @@ -0,0 +1,153 @@ + + diff --git a/src/views/infra/codegen/components/GenerateInfoForm.vue b/src/views/infra/codegen/components/GenerateInfoForm.vue new file mode 100644 index 0000000..744edfe --- /dev/null +++ b/src/views/infra/codegen/components/GenerateInfoForm.vue @@ -0,0 +1,391 @@ + + diff --git a/src/views/infra/codegen/components/index.ts b/src/views/infra/codegen/components/index.ts new file mode 100644 index 0000000..1634a76 --- /dev/null +++ b/src/views/infra/codegen/components/index.ts @@ -0,0 +1,4 @@ +import BasicInfoForm from './BasicInfoForm.vue' +import ColumInfoForm from './ColumInfoForm.vue' +import GenerateInfoForm from './GenerateInfoForm.vue' +export { BasicInfoForm, ColumInfoForm, GenerateInfoForm } diff --git a/src/views/infra/codegen/editTable.vue b/src/views/infra/codegen/editTable.vue new file mode 100644 index 0000000..9c4e765 --- /dev/null +++ b/src/views/infra/codegen/editTable.vue @@ -0,0 +1,83 @@ + + diff --git a/src/views/infra/codegen/importTable.vue b/src/views/infra/codegen/importTable.vue new file mode 100644 index 0000000..6cd4610 --- /dev/null +++ b/src/views/infra/codegen/importTable.vue @@ -0,0 +1,151 @@ + + diff --git a/src/views/infra/codegen/index.vue b/src/views/infra/codegen/index.vue new file mode 100644 index 0000000..4f99ce8 --- /dev/null +++ b/src/views/infra/codegen/index.vue @@ -0,0 +1,258 @@ + + diff --git a/src/views/infra/config/ConfigForm.vue b/src/views/infra/config/ConfigForm.vue new file mode 100644 index 0000000..19b5bf1 --- /dev/null +++ b/src/views/infra/config/ConfigForm.vue @@ -0,0 +1,131 @@ + + diff --git a/src/views/infra/config/index.vue b/src/views/infra/config/index.vue new file mode 100644 index 0000000..82554cb --- /dev/null +++ b/src/views/infra/config/index.vue @@ -0,0 +1,169 @@ + + diff --git a/src/views/infra/customInterface/index.vue b/src/views/infra/customInterface/index.vue new file mode 100644 index 0000000..9359223 --- /dev/null +++ b/src/views/infra/customInterface/index.vue @@ -0,0 +1,21 @@ +