From 5e7b7df95019f849523b52f8d3b341df10a9abad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=99=88=E8=96=AA=E5=90=8D?= <942005050@qq.com>
Date: Mon, 25 Mar 2024 10:18:12 +0800
Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A1=E5=88=92=E6=8B=86?=
=?UTF-8?q?=E5=88=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/wms/productionMain/index.ts | 73 +-
src/components/ImportForm/src/ImportForm.vue | 11 +-
src/utils/dict.ts | 1 +
src/views/login/components/LoginForm.vue | 3 +
.../productionplan/productionMain/index.vue | 5 +-
.../productionMain/productionMain.data.ts | 18 +
.../productionMainAssemble/index.vue | 492 ++++++++++
.../productionMainAssemble.data.ts | 894 ++++++++++++++++++
.../productionMainAssembleSparePart/index.vue | 492 ++++++++++
.../productionMainAssembleSparePart.data.ts | 894 ++++++++++++++++++
.../productionMainPredictSparePart/index.vue | 492 ++++++++++
.../productionMainPredictSparePart.data.ts | 894 ++++++++++++++++++
12 files changed, 4264 insertions(+), 5 deletions(-)
create mode 100644 src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue
create mode 100644 src/views/wms/productionManage/productionplan/productionMainAssemble/productionMainAssemble.data.ts
create mode 100644 src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue
create mode 100644 src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/productionMainAssembleSparePart.data.ts
create mode 100644 src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue
create mode 100644 src/views/wms/productionManage/productionplan/productionMainPredictSparePart/productionMainPredictSparePart.data.ts
diff --git a/src/api/wms/productionMain/index.ts b/src/api/wms/productionMain/index.ts
index a2e2fb76e..9e4fed120 100644
--- a/src/api/wms/productionMain/index.ts
+++ b/src/api/wms/productionMain/index.ts
@@ -24,6 +24,43 @@ export interface ProductionMainVO {
// 查询生产计划主列表
export const getProductionMainPage = async (params) => {
+ params.planType = 'predict'
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/wms/production-main/senior', data })
+ } else {
+ return await request.get({ url: `/wms/production-main/page`, params })
+ }
+}
+
+// 查询 —— 装配 主列表
+export const getProductionMainAssemblePage = async (params) => {
+ params.planType = 'assemble'
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/wms/production-main/senior', data })
+ } else {
+ return await request.get({ url: `/wms/production-main/page`, params })
+ }
+}
+
+// 查询 —— 预生产备件 主列表
+export const getProductionMainPredictSparePartPage = async (params) => {
+ params.planType = 'predictSparePart'
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/wms/production-main/senior', data })
+ } else {
+ return await request.get({ url: `/wms/production-main/page`, params })
+ }
+}
+
+// 查询 —— 装配备件 主列表
+export const getProductionMainASparePartPage = async (params) => {
+ params.planType = 'assembleSparePart'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
@@ -58,8 +95,42 @@ export const deleteProductionMain = async (id: number) => {
return await request.delete({ url: `/wms/production-main/delete?id=` + id })
}
-// 导出生产计划主 Excel
+// 导出预生产计划主 Excel
export const exportProductionMain = async (params) => {
+ params.planType = 'predict'
+ if (params.isSearch) {
+ const data = {...params}
+ return await request.downloadPost({ url: `/wms/production-main/export-excel-senior`, data })
+ } else {
+ return await request.download({ url: `/wms/production-main/export-excel`, params })
+ }
+}
+
+// 导出装配计划主 Excel
+export const exportProductionMainAssemble = async (params) => {
+ params.planType = 'assemble'
+ if (params.isSearch) {
+ const data = {...params}
+ return await request.downloadPost({ url: `/wms/production-main/export-excel-senior`, data })
+ } else {
+ return await request.download({ url: `/wms/production-main/export-excel`, params })
+ }
+}
+
+// 导出装配备件计划主 Excel
+export const exportProductionMainPredictSparePart = async (params) => {
+ params.planType = 'predictSparePart'
+ if (params.isSearch) {
+ const data = {...params}
+ return await request.downloadPost({ url: `/wms/production-main/export-excel-senior`, data })
+ } else {
+ return await request.download({ url: `/wms/production-main/export-excel`, params })
+ }
+}
+
+// 导出预生产备件计划主 Excel
+export const exportProductionMainAssembleSparePart = async (params) => {
+ params.planType = 'assembleSparePart'
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/production-main/export-excel-senior`, data })
diff --git a/src/components/ImportForm/src/ImportForm.vue b/src/components/ImportForm/src/ImportForm.vue
index d7dcd44d0..29ed5d067 100644
--- a/src/components/ImportForm/src/ImportForm.vue
+++ b/src/components/ImportForm/src/ImportForm.vue
@@ -14,6 +14,7 @@
updatePart +
'&outFile=' +
outFile +
+ '&extend=' + extend +
'&fromInventoryStatus=' + fromInventoryStatus +
'&toInventoryStatus=' + toInventoryStatus
"
@@ -171,13 +172,19 @@ const props = defineProps({
required: false,
default: false
},
- // 库存修改 扩展额外属性
+ // 扩展额外属性
+ extend: {
+ type: String,
+ required: false,
+ default: ''
+ },
+ // 库存修改 扩展额外属性 TODO: 后续优化 业务限定属性应转为统一的额外扩展属性 此处不应该出现业务相关属性 cxm
fromInventoryStatus: {
type: String,
required: false,
default: ''
},
- // 库存修改 扩展额外属性
+ // 库存修改 扩展额外属性 TODO: 后续优化 业务限定属性应转为统一的额外扩展属性 此处不应该出现业务相关属性 cxm
toInventoryStatus: {
type: String,
required: false,
diff --git a/src/utils/dict.ts b/src/utils/dict.ts
index 4dc76cd96..a55244551 100644
--- a/src/utils/dict.ts
+++ b/src/utils/dict.ts
@@ -276,4 +276,5 @@ export enum DICT_TYPE {
PACK_UNIT_TYPE = 'pack_unit_type', // 包装规格类型
TRANSFER_REASON = 'transfer_reason', // 调拨出入库原因
PURCHASERECEIPT_SOURCE_TYPE="purchasereceipt_source_type",//采购收货数据来源
+ PLAN_PRODUCTION_TYPE = "plan_production_type" // 生产计划类型
}
diff --git a/src/views/login/components/LoginForm.vue b/src/views/login/components/LoginForm.vue
index 6c235f45a..f442aaef1 100644
--- a/src/views/login/components/LoginForm.vue
+++ b/src/views/login/components/LoginForm.vue
@@ -182,6 +182,7 @@ const getCookie = () => {
const loading = ref() // ElLoading.service 返回的实例
// 登录
const handleLogin = async (params) => {
+ console.log('登录-185')
loginLoading.value = true
try {
await getTenantId()
@@ -191,6 +192,7 @@ const handleLogin = async (params) => {
}
const res = await LoginApi.login(loginData.loginForm)
if (!res) {
+ console.log('登录-195')
getCode()
return
}
@@ -219,6 +221,7 @@ const handleLogin = async (params) => {
const { wsCache } = useCache()
wsCache.set(CACHE_KEY.DEPT, await DeptApi.getSimpleDeptList())
} finally {
+ console.log('登录-224')
getCode()
loginLoading.value = false
loading.value.close()
diff --git a/src/views/wms/productionManage/productionplan/productionMain/index.vue b/src/views/wms/productionManage/productionplan/productionMain/index.vue
index 088faf7b7..a622c2c4e 100644
--- a/src/views/wms/productionManage/productionplan/productionMain/index.vue
+++ b/src/views/wms/productionManage/productionplan/productionMain/index.vue
@@ -72,7 +72,7 @@
+ @success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" :extend="'predict'" />
diff --git a/src/views/wms/productionManage/productionplan/productionMainAssemble/productionMainAssemble.data.ts b/src/views/wms/productionManage/productionplan/productionMainAssemble/productionMainAssemble.data.ts
new file mode 100644
index 000000000..585255287
--- /dev/null
+++ b/src/views/wms/productionManage/productionplan/productionMainAssemble/productionMainAssemble.data.ts
@@ -0,0 +1,894 @@
+import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
+import { dateFormatter,dateFormatter2 } from '@/utils/formatTime'
+import * as WorkMainApi from '@/api/wms/workMain'
+import * as WorkDetailApi from '@/api/wms/workDetail'
+import { WorkDetail, WorkMain } from '../workMain/workMain.data'
+import * as WorkshopApi from '@/api/wms/workshop'
+import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
+import * as ProductionlineApi from '@/api/wms/productionline'
+import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
+import * as ShiftApi from '@/api/wms/shift'
+import { Shift } from '@/views/wms/basicDataManage/orderManage/shift/shift.data'
+import * as TeamApi from '@/api/wms/team'
+import { Team } from '@/views/wms/basicDataManage/orderManage/team/team.data'
+import * as ProductionlineitemApi from '@/api/wms/productionlineitem'
+import { Productionlineitem } from '@/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data'
+import * as BomApi from '@/api/wms/bom'
+import { Bom } from '@/views/wms/basicDataManage/itemManage/bom/bom.data'
+
+import * as getPlansettingApi from '@/api/wms/plansetting/index'
+
+const { t } = useI18n() // 国际化
+
+// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
+const queryParams = {
+ pageSize:10,
+ pageNo:1,
+ code:'ProductionPlan'
+}
+ const data = await getPlansettingApi.getPlansettingPage(queryParams)
+ const plansettingData =data?.list[0]||{}
+
+/**
+ * @returns {Array} 生产计划主表
+ */
+export const ProductionMain = useCrudSchemas(reactive([
+ {
+ label: '单据号',
+ field: 'number',
+ sort: 'custom',
+ table: {
+ width: 180,
+ fixed: 'left'
+ },
+ isForm: false,
+ isSearch: true,
+ },
+ {
+ label: '状态',
+ field: 'status',
+ sort: 'custom',
+ dictType: DICT_TYPE.PLAN_STATUS,
+ dictClass: 'string',
+ isTable: true,
+ table: {
+ width: 150
+ },
+ // form: {
+ // value: '1',
+ // componentProps: {
+ // disabled: true
+ // }
+ // },
+ isForm:false,
+ isSearch: true,
+ },
+ {
+ label: '顺序',
+ field: 'displayOrder',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ componentProps: {
+ maxlength: 50
+ }
+ }
+ },
+ {
+ label: '车间',
+ field: 'workshop',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true,
+ searchListPlaceholder: '请选择车间',
+ searchField: 'code',
+ searchTitle: '车间信息',
+ searchAllSchemas: Workshop.allSchemas,
+ searchPage: WorkshopApi.getWorkshopPage,
+ searchCondition:[{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }]
+ }
+ }
+ },
+ {
+ label: '生产线',
+ field: 'productionLine',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true,
+ searchListPlaceholder: '请选择生产线',
+ searchField: 'code',
+ searchTitle: '生产线信息',
+ searchAllSchemas: Productionline.allSchemas,
+ searchPage: ProductionlineApi.getProductionlinePage,
+ searchCondition:[{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ },{
+ key: 'workshopCode',
+ value: 'workshop',
+ message: '请填写车间代码!',
+ isMainValue: true
+ }]
+ }
+ }
+ },
+ {
+ label: '班次',
+ field: 'shift',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true,
+ searchListPlaceholder: '请选择班次',
+ searchField: 'code',
+ searchTitle: '班次信息',
+ searchAllSchemas: Shift.allSchemas,
+ searchPage: ShiftApi.getShiftPage,
+ searchCondition:[{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }]
+ }
+ }
+ },
+ {
+ label: '班组',
+ field: 'team',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true,
+ searchListPlaceholder: '请选择班组',
+ searchField: 'code',
+ searchTitle: '班组信息',
+ searchAllSchemas: Team.allSchemas,
+ searchPage: TeamApi.getTeamPage,
+ searchCondition:[{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }]
+ }
+ }
+ },
+ {
+ label: '计划日期',
+ field: 'planDate',
+ formatter: dateFormatter2,
+ detail: {
+ dateFormat: 'YYYY-MM-DD'
+ },
+ sort: 'custom',
+ table: {
+ width: 120
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ style: {width: '100%'},
+ type: 'date',
+ dateFormat: 'YYYY-MM-DD',
+ valueFormat: 'x',
+ }
+ },
+ },
+ {
+ label: '开始时间',
+ field: 'beginTime',
+ formatter: dateFormatter,
+ detail: {
+ dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ },
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ style: {width: '100%'},
+ 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: {
+ style: {width: '100%'},
+ type: 'datetime',
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
+ }
+ },
+ },
+ {
+ label: '业务类型',
+ field: 'businessType',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ value: 'ProductReceipt',
+ componentProps: {
+ disabled: true
+ }
+ },
+ isForm: false,
+ },
+ {
+ label: '计划类型',
+ field: 'planType',
+ dictType: DICT_TYPE.PLAN_PRODUCTION_TYPE,
+ dictClass: 'string',
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'Select',
+ value: 'assemble',
+ componentProps: {
+ disabled: true
+ }
+ }
+ },
+ {
+ label: '备注',
+ field: 'remark',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isTable: false,
+ },
+ {
+ 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: 'autoCommit',
+ dictType: DICT_TYPE.TRUE_FALSE,
+ dictClass: 'string',
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'Switch',
+ value: plansettingData.autoCommit,
+ componentProps: {
+ inactiveValue: 'FALSE',
+ activeValue: 'TRUE',
+ disabled: true
+ }
+ }
+ },
+ {
+ label: '自动通过',
+ field: 'autoAgree',
+ dictType: DICT_TYPE.TRUE_FALSE,
+ dictClass: 'string',
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'Switch',
+ value: plansettingData.autoAgree,
+ componentProps: {
+ inactiveValue: 'FALSE',
+ activeValue: 'TRUE',
+ disabled: true
+ }
+ }
+ },
+ {
+ label: '自动执行',
+ field: 'autoExecute',
+ dictType: DICT_TYPE.TRUE_FALSE,
+ dictClass: 'string',
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'Switch',
+ value: plansettingData.autoExecute,
+ componentProps: {
+ inactiveValue: 'FALSE',
+ activeValue: 'TRUE',
+ disabled: true
+ }
+ }
+ },
+
+ // {
+ // label: '开始时间',
+ // field: 'beginTime',
+ // formatter: dateFormatter,
+ // detail: {
+ // dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ // },
+ // sort: 'custom',
+ // table: {
+ // width: 180
+ // },
+ // form: {
+ // component: 'DatePicker',
+ // componentProps: {
+ // style: {width: '100%'},
+ // type: 'datetime',
+ // dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ // valueFormat: 'x',
+ // }
+ // },
+ // isForm: false,
+ // },
+ // {
+ // label: '结束时间',
+ // field: 'endTime',
+ // formatter: dateFormatter,
+ // detail: {
+ // dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ // },
+ // sort: 'custom',
+ // table: {
+ // width: 180
+ // },
+ // form: {
+ // component: 'DatePicker',
+ // componentProps: {
+ // style: {width: '100%'},
+ // type: 'datetime',
+ // dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ // valueFormat: 'x',
+ // }
+ // },
+ // isForm: false,
+ // },
+ // {
+ // label: '订单号',
+ // field: 'woNumber',
+ // sort: 'custom',
+ // table: {
+ // width: 150
+ // },
+ // form: {
+ // // labelMessage: '信息提示说明!!!',
+ // componentProps: {
+ // isSearchList: true,
+ // searchListPlaceholder: '请选择订单号',
+ // searchField: 'number',
+ // searchTitle: '生产订单信息',
+ // searchAllSchemas: WorkMain.allSchemas,
+ // searchPage: WorkMainApi.getWorkMainPage
+ // }
+ // },
+ // isTable: false,
+ // isForm: false,
+ // },
+ // {
+ // label: '订单行',
+ // field: 'woLine',
+ // sort: 'custom',
+ // table: {
+ // width: 150
+ // },
+ // form: {
+ // // labelMessage: '信息提示说明!!!',
+ // componentProps: {
+ // isSearchList: true,
+ // searchListPlaceholder: '请选择订单行',
+ // searchField: 'lineNumber',
+ // searchTitle: '生产订单信息',
+ // searchAllSchemas: WorkDetail.allSchemas,
+ // searchPage: WorkDetailApi.getWorkDetailPage
+ // }
+ // },
+ // isTable: false,
+ // isForm: false,
+ // },
+ {
+ label: '创建者',
+ field: 'creator',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isForm: false,
+ },
+ {
+ label: '创建时间',
+ field: 'createTime',
+ formatter: dateFormatter,
+ detail: {
+ dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ },
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ style: {width: '100%'},
+ type: 'datetime',
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
+ }
+ },
+ isForm: false,
+ },
+ {
+ label: '最后更新者',
+ field: 'updater',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isForm: false,
+ },
+ {
+ label: '最后更新时间',
+ field: 'updateTime',
+ formatter: dateFormatter,
+ detail: {
+ dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ },
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ style: {width: '100%'},
+ type: 'datetime',
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
+ }
+ },
+ isForm: false,
+ },
+ {
+ label: '操作',
+ field: 'action',
+ isDetail: false,
+ isForm: false ,
+ table: {
+ width: 220,
+ fixed: 'right'
+ },
+ }
+]))
+
+//表单校验
+export const ProductionMainRules = reactive({
+ displayOrder: [
+ { required: true, message: '请输入顺序', trigger: 'blur' },
+ // { max: 50, message: '不得超过50个字符', 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: 'blur' }
+ ],
+ available: [
+ { required: true, message: '请选择是否可用', trigger: 'change' }
+ ],
+ status: [
+ { required: true, message: '请选择状态', trigger: 'change' }
+ ],
+ beginTime: [
+ { required: true, message: '请输入开始时间', trigger: 'blur' }
+ ],
+ endTime: [
+ { required: true, message: '请输入结束时间', trigger: 'blur' }
+ ],
+ remark: [
+ { max: 50, message: '不得超过50个字符', trigger: 'blur' }
+ ],
+})
+
+/**
+ * @returns {Array} 生产计划子表
+ */
+export const ProductionDetail = useCrudSchemas(reactive([
+ {
+ label: '物料代码',
+ field: 'itemCode',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true, // 开启查询弹窗
+ searchListPlaceholder: '请选择物料代码', // 输入框占位文本
+ searchField: 'itemCode', // 查询弹窗赋值字段
+ searchTitle: '生产线物料关系信息', // 查询弹窗标题
+ searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
+ searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
+ searchCondition: [{
+ key:'productionLineCode',
+ value:'productionLine',
+ message: '请填写生产线代码!',
+ isMainValue: true
+ },{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }],
+ }
+ },
+ tableForm:{
+ isInpuFocusShow: true,
+ searchListPlaceholder: '请选择物料代码', // 输入框占位文本
+ searchField: 'itemCode', // 查询弹窗赋值字段
+ searchTitle: '生产线物料关系信息', // 查询弹窗标题
+ searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
+ searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
+ searchCondition: [{
+ key:'productionLineCode',
+ value:'productionLine',
+ message: '请填写生产线代码!',
+ isMainValue: true
+ },{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }],
+ },
+ },
+ {
+ label: 'Bom版本',
+ field: 'bomVersion',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true, // 开启查询弹窗
+ searchListPlaceholder: '请选择Bom版本', // 输入框占位文本
+ searchField: 'version', // 查询弹窗赋值字段
+ searchTitle: '物料清单信息', // 查询弹窗标题
+ searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类
+ searchPage: BomApi.getBomPage, // 查询弹窗所需分页方法
+ searchCondition: [{
+ key:'productItemCode',
+ value:'itemCode',
+ message: '请填写物料代码!',
+ isMainValue: true
+ },{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }]
+ }
+ },
+ tableForm:{
+ isInpuFocusShow: true,
+ searchListPlaceholder: '请选择Bom版本', // 输入框占位文本
+ searchField: 'version', // 查询弹窗赋值字段
+ searchTitle: '物料清单信息', // 查询弹窗标题
+ searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类
+ searchPage: BomApi.getBomPage, // 查询弹窗所需分页方法
+ searchCondition: [{
+ key:'productItemCode',
+ value:'itemCode',
+ message: '请填写物料代码!',
+ isMainValue: true
+ },{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }]
+ },
+ },
+ {
+ label: '合格数量',
+ field: 'goodQty',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'InputNumber',
+ componentProps: {
+ min: 1,
+ precision: 6
+ }
+ },
+ tableForm: {
+ type: 'InputNumber',
+ min: 1,
+ precision: 6
+ },
+ isTableForm: false,
+ isForm: false
+ },
+ {
+ label: '不合格数量',
+ field: 'notGoodQty',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'InputNumber',
+ componentProps: {
+ min: 1,
+ precision: 6
+ }
+ },
+ tableForm: {
+ type: 'InputNumber',
+ min: 1,
+ precision: 6
+ },
+ isTableForm: false,
+ isForm: false
+ },
+ {
+ label: '单据号',
+ field: 'number',
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ isTableForm: false,
+ form: {
+ componentProps: {
+ disabled: true
+ }
+ }
+ },
+ {
+ 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: {
+ style: {width: '100%'},
+ type: 'datetime',
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
+ }
+ },
+ isTableForm: false,
+ isForm: false,
+ },
+ {
+ label: '创建者',
+ field: 'creator',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isTableForm: false,
+ isForm: false,
+ },
+ {
+ label: '计划数量',
+ field: 'planQty',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'InputNumber',
+ componentProps: {
+ min: 0,
+ precision: 6
+ }
+ },
+ tableForm: {
+ type: 'InputNumber',
+ min: 0,
+ precision: 6
+ },
+ },
+ {
+ label: '计量单位',
+ field: 'uom',
+ dictType: DICT_TYPE.UOM,
+ dictClass: 'string',
+ isSearch: true,
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ tableForm:{
+ type: 'Select'
+ }
+ },
+ {
+ label: '最后更新时间',
+ field: 'updateTime',
+ formatter: dateFormatter,
+ detail: {
+ dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ },
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ style: {width: '100%'},
+ type: 'datetime',
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
+ }
+ },
+ isTableForm: false,
+ isForm: false,
+ },
+ {
+ label: '最后更新者',
+ field: 'updater',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isTableForm: false,
+ isForm: false,
+ },
+ {
+ 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'
+ }
+ },
+ tableForm: {
+ type: 'Select',
+ default: 'TRUE'
+ },
+ // isTableForm: false,
+ // isForm: false
+ },
+ {
+ label: '操作',
+ field: 'action',
+ isDetail: false,
+ isForm: false ,
+ table: {
+ width: 150,
+ fixed: 'right'
+ },
+ isTableForm:false,
+ }
+]))
+
+//表单校验
+export const ProductionDetailRules = reactive({
+ 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' }
+ ],
+ itemCode: [
+ { required: true, message: '请选择物料代码', trigger: 'change' }
+ ],
+ remark: [
+ { max: 50, message: '不得超过50个字符', trigger: 'blur' }
+ ],
+})
diff --git a/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue b/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue
new file mode 100644
index 000000000..3f5092e1a
--- /dev/null
+++ b/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue
@@ -0,0 +1,492 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.number }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/productionMainAssembleSparePart.data.ts b/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/productionMainAssembleSparePart.data.ts
new file mode 100644
index 000000000..75a66d8d8
--- /dev/null
+++ b/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/productionMainAssembleSparePart.data.ts
@@ -0,0 +1,894 @@
+import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
+import { dateFormatter,dateFormatter2 } from '@/utils/formatTime'
+import * as WorkMainApi from '@/api/wms/workMain'
+import * as WorkDetailApi from '@/api/wms/workDetail'
+import { WorkDetail, WorkMain } from '../workMain/workMain.data'
+import * as WorkshopApi from '@/api/wms/workshop'
+import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
+import * as ProductionlineApi from '@/api/wms/productionline'
+import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
+import * as ShiftApi from '@/api/wms/shift'
+import { Shift } from '@/views/wms/basicDataManage/orderManage/shift/shift.data'
+import * as TeamApi from '@/api/wms/team'
+import { Team } from '@/views/wms/basicDataManage/orderManage/team/team.data'
+import * as ProductionlineitemApi from '@/api/wms/productionlineitem'
+import { Productionlineitem } from '@/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data'
+import * as BomApi from '@/api/wms/bom'
+import { Bom } from '@/views/wms/basicDataManage/itemManage/bom/bom.data'
+
+import * as getPlansettingApi from '@/api/wms/plansetting/index'
+
+const { t } = useI18n() // 国际化
+
+// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
+const queryParams = {
+ pageSize:10,
+ pageNo:1,
+ code:'ProductionPlan'
+}
+ const data = await getPlansettingApi.getPlansettingPage(queryParams)
+ const plansettingData =data?.list[0]||{}
+
+/**
+ * @returns {Array} 生产计划主表
+ */
+export const ProductionMain = useCrudSchemas(reactive([
+ {
+ label: '单据号',
+ field: 'number',
+ sort: 'custom',
+ table: {
+ width: 180,
+ fixed: 'left'
+ },
+ isForm: false,
+ isSearch: true,
+ },
+ {
+ label: '状态',
+ field: 'status',
+ sort: 'custom',
+ dictType: DICT_TYPE.PLAN_STATUS,
+ dictClass: 'string',
+ isTable: true,
+ table: {
+ width: 150
+ },
+ // form: {
+ // value: '1',
+ // componentProps: {
+ // disabled: true
+ // }
+ // },
+ isForm:false,
+ isSearch: true,
+ },
+ {
+ label: '顺序',
+ field: 'displayOrder',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ componentProps: {
+ maxlength: 50
+ }
+ }
+ },
+ {
+ label: '车间',
+ field: 'workshop',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true,
+ searchListPlaceholder: '请选择车间',
+ searchField: 'code',
+ searchTitle: '车间信息',
+ searchAllSchemas: Workshop.allSchemas,
+ searchPage: WorkshopApi.getWorkshopPage,
+ searchCondition:[{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }]
+ }
+ }
+ },
+ {
+ label: '生产线',
+ field: 'productionLine',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true,
+ searchListPlaceholder: '请选择生产线',
+ searchField: 'code',
+ searchTitle: '生产线信息',
+ searchAllSchemas: Productionline.allSchemas,
+ searchPage: ProductionlineApi.getProductionlinePage,
+ searchCondition:[{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ },{
+ key: 'workshopCode',
+ value: 'workshop',
+ message: '请填写车间代码!',
+ isMainValue: true
+ }]
+ }
+ }
+ },
+ {
+ label: '班次',
+ field: 'shift',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true,
+ searchListPlaceholder: '请选择班次',
+ searchField: 'code',
+ searchTitle: '班次信息',
+ searchAllSchemas: Shift.allSchemas,
+ searchPage: ShiftApi.getShiftPage,
+ searchCondition:[{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }]
+ }
+ }
+ },
+ {
+ label: '班组',
+ field: 'team',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true,
+ searchListPlaceholder: '请选择班组',
+ searchField: 'code',
+ searchTitle: '班组信息',
+ searchAllSchemas: Team.allSchemas,
+ searchPage: TeamApi.getTeamPage,
+ searchCondition:[{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }]
+ }
+ }
+ },
+ {
+ label: '计划日期',
+ field: 'planDate',
+ formatter: dateFormatter2,
+ detail: {
+ dateFormat: 'YYYY-MM-DD'
+ },
+ sort: 'custom',
+ table: {
+ width: 120
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ style: {width: '100%'},
+ type: 'date',
+ dateFormat: 'YYYY-MM-DD',
+ valueFormat: 'x',
+ }
+ },
+ },
+ {
+ label: '开始时间',
+ field: 'beginTime',
+ formatter: dateFormatter,
+ detail: {
+ dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ },
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ style: {width: '100%'},
+ 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: {
+ style: {width: '100%'},
+ type: 'datetime',
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
+ }
+ },
+ },
+ {
+ label: '业务类型',
+ field: 'businessType',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ value: 'ProductReceipt',
+ componentProps: {
+ disabled: true
+ }
+ },
+ isForm: false,
+ },
+ {
+ label: '计划类型',
+ field: 'planType',
+ dictType: DICT_TYPE.PLAN_PRODUCTION_TYPE,
+ dictClass: 'string',
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'Select',
+ value: 'assembleSparePart',
+ componentProps: {
+ disabled: true
+ }
+ }
+ },
+ {
+ label: '备注',
+ field: 'remark',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isTable: false,
+ },
+ {
+ 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: 'autoCommit',
+ dictType: DICT_TYPE.TRUE_FALSE,
+ dictClass: 'string',
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'Switch',
+ value: plansettingData.autoCommit,
+ componentProps: {
+ inactiveValue: 'FALSE',
+ activeValue: 'TRUE',
+ disabled: true
+ }
+ }
+ },
+ {
+ label: '自动通过',
+ field: 'autoAgree',
+ dictType: DICT_TYPE.TRUE_FALSE,
+ dictClass: 'string',
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'Switch',
+ value: plansettingData.autoAgree,
+ componentProps: {
+ inactiveValue: 'FALSE',
+ activeValue: 'TRUE',
+ disabled: true
+ }
+ }
+ },
+ {
+ label: '自动执行',
+ field: 'autoExecute',
+ dictType: DICT_TYPE.TRUE_FALSE,
+ dictClass: 'string',
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'Switch',
+ value: plansettingData.autoExecute,
+ componentProps: {
+ inactiveValue: 'FALSE',
+ activeValue: 'TRUE',
+ disabled: true
+ }
+ }
+ },
+
+ // {
+ // label: '开始时间',
+ // field: 'beginTime',
+ // formatter: dateFormatter,
+ // detail: {
+ // dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ // },
+ // sort: 'custom',
+ // table: {
+ // width: 180
+ // },
+ // form: {
+ // component: 'DatePicker',
+ // componentProps: {
+ // style: {width: '100%'},
+ // type: 'datetime',
+ // dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ // valueFormat: 'x',
+ // }
+ // },
+ // isForm: false,
+ // },
+ // {
+ // label: '结束时间',
+ // field: 'endTime',
+ // formatter: dateFormatter,
+ // detail: {
+ // dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ // },
+ // sort: 'custom',
+ // table: {
+ // width: 180
+ // },
+ // form: {
+ // component: 'DatePicker',
+ // componentProps: {
+ // style: {width: '100%'},
+ // type: 'datetime',
+ // dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ // valueFormat: 'x',
+ // }
+ // },
+ // isForm: false,
+ // },
+ // {
+ // label: '订单号',
+ // field: 'woNumber',
+ // sort: 'custom',
+ // table: {
+ // width: 150
+ // },
+ // form: {
+ // // labelMessage: '信息提示说明!!!',
+ // componentProps: {
+ // isSearchList: true,
+ // searchListPlaceholder: '请选择订单号',
+ // searchField: 'number',
+ // searchTitle: '生产订单信息',
+ // searchAllSchemas: WorkMain.allSchemas,
+ // searchPage: WorkMainApi.getWorkMainPage
+ // }
+ // },
+ // isTable: false,
+ // isForm: false,
+ // },
+ // {
+ // label: '订单行',
+ // field: 'woLine',
+ // sort: 'custom',
+ // table: {
+ // width: 150
+ // },
+ // form: {
+ // // labelMessage: '信息提示说明!!!',
+ // componentProps: {
+ // isSearchList: true,
+ // searchListPlaceholder: '请选择订单行',
+ // searchField: 'lineNumber',
+ // searchTitle: '生产订单信息',
+ // searchAllSchemas: WorkDetail.allSchemas,
+ // searchPage: WorkDetailApi.getWorkDetailPage
+ // }
+ // },
+ // isTable: false,
+ // isForm: false,
+ // },
+ {
+ label: '创建者',
+ field: 'creator',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isForm: false,
+ },
+ {
+ label: '创建时间',
+ field: 'createTime',
+ formatter: dateFormatter,
+ detail: {
+ dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ },
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ style: {width: '100%'},
+ type: 'datetime',
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
+ }
+ },
+ isForm: false,
+ },
+ {
+ label: '最后更新者',
+ field: 'updater',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isForm: false,
+ },
+ {
+ label: '最后更新时间',
+ field: 'updateTime',
+ formatter: dateFormatter,
+ detail: {
+ dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ },
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ style: {width: '100%'},
+ type: 'datetime',
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
+ }
+ },
+ isForm: false,
+ },
+ {
+ label: '操作',
+ field: 'action',
+ isDetail: false,
+ isForm: false ,
+ table: {
+ width: 220,
+ fixed: 'right'
+ },
+ }
+]))
+
+//表单校验
+export const ProductionMainRules = reactive({
+ displayOrder: [
+ { required: true, message: '请输入顺序', trigger: 'blur' },
+ // { max: 50, message: '不得超过50个字符', 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: 'blur' }
+ ],
+ available: [
+ { required: true, message: '请选择是否可用', trigger: 'change' }
+ ],
+ status: [
+ { required: true, message: '请选择状态', trigger: 'change' }
+ ],
+ beginTime: [
+ { required: true, message: '请输入开始时间', trigger: 'blur' }
+ ],
+ endTime: [
+ { required: true, message: '请输入结束时间', trigger: 'blur' }
+ ],
+ remark: [
+ { max: 50, message: '不得超过50个字符', trigger: 'blur' }
+ ],
+})
+
+/**
+ * @returns {Array} 生产计划子表
+ */
+export const ProductionDetail = useCrudSchemas(reactive([
+ {
+ label: '物料代码',
+ field: 'itemCode',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true, // 开启查询弹窗
+ searchListPlaceholder: '请选择物料代码', // 输入框占位文本
+ searchField: 'itemCode', // 查询弹窗赋值字段
+ searchTitle: '生产线物料关系信息', // 查询弹窗标题
+ searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
+ searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
+ searchCondition: [{
+ key:'productionLineCode',
+ value:'productionLine',
+ message: '请填写生产线代码!',
+ isMainValue: true
+ },{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }],
+ }
+ },
+ tableForm:{
+ isInpuFocusShow: true,
+ searchListPlaceholder: '请选择物料代码', // 输入框占位文本
+ searchField: 'itemCode', // 查询弹窗赋值字段
+ searchTitle: '生产线物料关系信息', // 查询弹窗标题
+ searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
+ searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
+ searchCondition: [{
+ key:'productionLineCode',
+ value:'productionLine',
+ message: '请填写生产线代码!',
+ isMainValue: true
+ },{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }],
+ },
+ },
+ {
+ label: 'Bom版本',
+ field: 'bomVersion',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true, // 开启查询弹窗
+ searchListPlaceholder: '请选择Bom版本', // 输入框占位文本
+ searchField: 'version', // 查询弹窗赋值字段
+ searchTitle: '物料清单信息', // 查询弹窗标题
+ searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类
+ searchPage: BomApi.getBomPage, // 查询弹窗所需分页方法
+ searchCondition: [{
+ key:'productItemCode',
+ value:'itemCode',
+ message: '请填写物料代码!',
+ isMainValue: true
+ },{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }]
+ }
+ },
+ tableForm:{
+ isInpuFocusShow: true,
+ searchListPlaceholder: '请选择Bom版本', // 输入框占位文本
+ searchField: 'version', // 查询弹窗赋值字段
+ searchTitle: '物料清单信息', // 查询弹窗标题
+ searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类
+ searchPage: BomApi.getBomPage, // 查询弹窗所需分页方法
+ searchCondition: [{
+ key:'productItemCode',
+ value:'itemCode',
+ message: '请填写物料代码!',
+ isMainValue: true
+ },{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }]
+ },
+ },
+ {
+ label: '合格数量',
+ field: 'goodQty',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'InputNumber',
+ componentProps: {
+ min: 1,
+ precision: 6
+ }
+ },
+ tableForm: {
+ type: 'InputNumber',
+ min: 1,
+ precision: 6
+ },
+ isTableForm: false,
+ isForm: false
+ },
+ {
+ label: '不合格数量',
+ field: 'notGoodQty',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'InputNumber',
+ componentProps: {
+ min: 1,
+ precision: 6
+ }
+ },
+ tableForm: {
+ type: 'InputNumber',
+ min: 1,
+ precision: 6
+ },
+ isTableForm: false,
+ isForm: false
+ },
+ {
+ label: '单据号',
+ field: 'number',
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ isTableForm: false,
+ form: {
+ componentProps: {
+ disabled: true
+ }
+ }
+ },
+ {
+ 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: {
+ style: {width: '100%'},
+ type: 'datetime',
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
+ }
+ },
+ isTableForm: false,
+ isForm: false,
+ },
+ {
+ label: '创建者',
+ field: 'creator',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isTableForm: false,
+ isForm: false,
+ },
+ {
+ label: '计划数量',
+ field: 'planQty',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'InputNumber',
+ componentProps: {
+ min: 0,
+ precision: 6
+ }
+ },
+ tableForm: {
+ type: 'InputNumber',
+ min: 0,
+ precision: 6
+ },
+ },
+ {
+ label: '计量单位',
+ field: 'uom',
+ dictType: DICT_TYPE.UOM,
+ dictClass: 'string',
+ isSearch: true,
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ tableForm:{
+ type: 'Select'
+ }
+ },
+ {
+ label: '最后更新时间',
+ field: 'updateTime',
+ formatter: dateFormatter,
+ detail: {
+ dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ },
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ style: {width: '100%'},
+ type: 'datetime',
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
+ }
+ },
+ isTableForm: false,
+ isForm: false,
+ },
+ {
+ label: '最后更新者',
+ field: 'updater',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isTableForm: false,
+ isForm: false,
+ },
+ {
+ 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'
+ }
+ },
+ tableForm: {
+ type: 'Select',
+ default: 'TRUE'
+ },
+ // isTableForm: false,
+ // isForm: false
+ },
+ {
+ label: '操作',
+ field: 'action',
+ isDetail: false,
+ isForm: false ,
+ table: {
+ width: 150,
+ fixed: 'right'
+ },
+ isTableForm:false,
+ }
+]))
+
+//表单校验
+export const ProductionDetailRules = reactive({
+ 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' }
+ ],
+ itemCode: [
+ { required: true, message: '请选择物料代码', trigger: 'change' }
+ ],
+ remark: [
+ { max: 50, message: '不得超过50个字符', trigger: 'blur' }
+ ],
+})
diff --git a/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue b/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue
new file mode 100644
index 000000000..c49c0cd21
--- /dev/null
+++ b/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue
@@ -0,0 +1,492 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.number }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/productionMainPredictSparePart.data.ts b/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/productionMainPredictSparePart.data.ts
new file mode 100644
index 000000000..1e21d37e5
--- /dev/null
+++ b/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/productionMainPredictSparePart.data.ts
@@ -0,0 +1,894 @@
+import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
+import { dateFormatter,dateFormatter2 } from '@/utils/formatTime'
+import * as WorkMainApi from '@/api/wms/workMain'
+import * as WorkDetailApi from '@/api/wms/workDetail'
+import { WorkDetail, WorkMain } from '../workMain/workMain.data'
+import * as WorkshopApi from '@/api/wms/workshop'
+import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
+import * as ProductionlineApi from '@/api/wms/productionline'
+import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
+import * as ShiftApi from '@/api/wms/shift'
+import { Shift } from '@/views/wms/basicDataManage/orderManage/shift/shift.data'
+import * as TeamApi from '@/api/wms/team'
+import { Team } from '@/views/wms/basicDataManage/orderManage/team/team.data'
+import * as ProductionlineitemApi from '@/api/wms/productionlineitem'
+import { Productionlineitem } from '@/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data'
+import * as BomApi from '@/api/wms/bom'
+import { Bom } from '@/views/wms/basicDataManage/itemManage/bom/bom.data'
+
+import * as getPlansettingApi from '@/api/wms/plansetting/index'
+
+const { t } = useI18n() // 国际化
+
+// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
+const queryParams = {
+ pageSize:10,
+ pageNo:1,
+ code:'ProductionPlan'
+}
+ const data = await getPlansettingApi.getPlansettingPage(queryParams)
+ const plansettingData =data?.list[0]||{}
+
+/**
+ * @returns {Array} 生产计划主表
+ */
+export const ProductionMain = useCrudSchemas(reactive([
+ {
+ label: '单据号',
+ field: 'number',
+ sort: 'custom',
+ table: {
+ width: 180,
+ fixed: 'left'
+ },
+ isForm: false,
+ isSearch: true,
+ },
+ {
+ label: '状态',
+ field: 'status',
+ sort: 'custom',
+ dictType: DICT_TYPE.PLAN_STATUS,
+ dictClass: 'string',
+ isTable: true,
+ table: {
+ width: 150
+ },
+ // form: {
+ // value: '1',
+ // componentProps: {
+ // disabled: true
+ // }
+ // },
+ isForm:false,
+ isSearch: true,
+ },
+ {
+ label: '顺序',
+ field: 'displayOrder',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ componentProps: {
+ maxlength: 50
+ }
+ }
+ },
+ {
+ label: '车间',
+ field: 'workshop',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true,
+ searchListPlaceholder: '请选择车间',
+ searchField: 'code',
+ searchTitle: '车间信息',
+ searchAllSchemas: Workshop.allSchemas,
+ searchPage: WorkshopApi.getWorkshopPage,
+ searchCondition:[{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }]
+ }
+ }
+ },
+ {
+ label: '生产线',
+ field: 'productionLine',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true,
+ searchListPlaceholder: '请选择生产线',
+ searchField: 'code',
+ searchTitle: '生产线信息',
+ searchAllSchemas: Productionline.allSchemas,
+ searchPage: ProductionlineApi.getProductionlinePage,
+ searchCondition:[{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ },{
+ key: 'workshopCode',
+ value: 'workshop',
+ message: '请填写车间代码!',
+ isMainValue: true
+ }]
+ }
+ }
+ },
+ {
+ label: '班次',
+ field: 'shift',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true,
+ searchListPlaceholder: '请选择班次',
+ searchField: 'code',
+ searchTitle: '班次信息',
+ searchAllSchemas: Shift.allSchemas,
+ searchPage: ShiftApi.getShiftPage,
+ searchCondition:[{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }]
+ }
+ }
+ },
+ {
+ label: '班组',
+ field: 'team',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true,
+ searchListPlaceholder: '请选择班组',
+ searchField: 'code',
+ searchTitle: '班组信息',
+ searchAllSchemas: Team.allSchemas,
+ searchPage: TeamApi.getTeamPage,
+ searchCondition:[{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }]
+ }
+ }
+ },
+ {
+ label: '计划日期',
+ field: 'planDate',
+ formatter: dateFormatter2,
+ detail: {
+ dateFormat: 'YYYY-MM-DD'
+ },
+ sort: 'custom',
+ table: {
+ width: 120
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ style: {width: '100%'},
+ type: 'date',
+ dateFormat: 'YYYY-MM-DD',
+ valueFormat: 'x',
+ }
+ },
+ },
+ {
+ label: '开始时间',
+ field: 'beginTime',
+ formatter: dateFormatter,
+ detail: {
+ dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ },
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ style: {width: '100%'},
+ 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: {
+ style: {width: '100%'},
+ type: 'datetime',
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
+ }
+ },
+ },
+ {
+ label: '业务类型',
+ field: 'businessType',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ value: 'ProductReceipt',
+ componentProps: {
+ disabled: true
+ }
+ },
+ isForm: false,
+ },
+ {
+ label: '计划类型',
+ field: 'planType',
+ dictType: DICT_TYPE.PLAN_PRODUCTION_TYPE,
+ dictClass: 'string',
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'Select',
+ value: 'predictSparePart',
+ componentProps: {
+ disabled: true
+ }
+ }
+ },
+ {
+ label: '备注',
+ field: 'remark',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isTable: false,
+ },
+ {
+ 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: 'autoCommit',
+ dictType: DICT_TYPE.TRUE_FALSE,
+ dictClass: 'string',
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'Switch',
+ value: plansettingData.autoCommit,
+ componentProps: {
+ inactiveValue: 'FALSE',
+ activeValue: 'TRUE',
+ disabled: true
+ }
+ }
+ },
+ {
+ label: '自动通过',
+ field: 'autoAgree',
+ dictType: DICT_TYPE.TRUE_FALSE,
+ dictClass: 'string',
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'Switch',
+ value: plansettingData.autoAgree,
+ componentProps: {
+ inactiveValue: 'FALSE',
+ activeValue: 'TRUE',
+ disabled: true
+ }
+ }
+ },
+ {
+ label: '自动执行',
+ field: 'autoExecute',
+ dictType: DICT_TYPE.TRUE_FALSE,
+ dictClass: 'string',
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'Switch',
+ value: plansettingData.autoExecute,
+ componentProps: {
+ inactiveValue: 'FALSE',
+ activeValue: 'TRUE',
+ disabled: true
+ }
+ }
+ },
+
+ // {
+ // label: '开始时间',
+ // field: 'beginTime',
+ // formatter: dateFormatter,
+ // detail: {
+ // dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ // },
+ // sort: 'custom',
+ // table: {
+ // width: 180
+ // },
+ // form: {
+ // component: 'DatePicker',
+ // componentProps: {
+ // style: {width: '100%'},
+ // type: 'datetime',
+ // dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ // valueFormat: 'x',
+ // }
+ // },
+ // isForm: false,
+ // },
+ // {
+ // label: '结束时间',
+ // field: 'endTime',
+ // formatter: dateFormatter,
+ // detail: {
+ // dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ // },
+ // sort: 'custom',
+ // table: {
+ // width: 180
+ // },
+ // form: {
+ // component: 'DatePicker',
+ // componentProps: {
+ // style: {width: '100%'},
+ // type: 'datetime',
+ // dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ // valueFormat: 'x',
+ // }
+ // },
+ // isForm: false,
+ // },
+ // {
+ // label: '订单号',
+ // field: 'woNumber',
+ // sort: 'custom',
+ // table: {
+ // width: 150
+ // },
+ // form: {
+ // // labelMessage: '信息提示说明!!!',
+ // componentProps: {
+ // isSearchList: true,
+ // searchListPlaceholder: '请选择订单号',
+ // searchField: 'number',
+ // searchTitle: '生产订单信息',
+ // searchAllSchemas: WorkMain.allSchemas,
+ // searchPage: WorkMainApi.getWorkMainPage
+ // }
+ // },
+ // isTable: false,
+ // isForm: false,
+ // },
+ // {
+ // label: '订单行',
+ // field: 'woLine',
+ // sort: 'custom',
+ // table: {
+ // width: 150
+ // },
+ // form: {
+ // // labelMessage: '信息提示说明!!!',
+ // componentProps: {
+ // isSearchList: true,
+ // searchListPlaceholder: '请选择订单行',
+ // searchField: 'lineNumber',
+ // searchTitle: '生产订单信息',
+ // searchAllSchemas: WorkDetail.allSchemas,
+ // searchPage: WorkDetailApi.getWorkDetailPage
+ // }
+ // },
+ // isTable: false,
+ // isForm: false,
+ // },
+ {
+ label: '创建者',
+ field: 'creator',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isForm: false,
+ },
+ {
+ label: '创建时间',
+ field: 'createTime',
+ formatter: dateFormatter,
+ detail: {
+ dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ },
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ style: {width: '100%'},
+ type: 'datetime',
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
+ }
+ },
+ isForm: false,
+ },
+ {
+ label: '最后更新者',
+ field: 'updater',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isForm: false,
+ },
+ {
+ label: '最后更新时间',
+ field: 'updateTime',
+ formatter: dateFormatter,
+ detail: {
+ dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ },
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ style: {width: '100%'},
+ type: 'datetime',
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
+ }
+ },
+ isForm: false,
+ },
+ {
+ label: '操作',
+ field: 'action',
+ isDetail: false,
+ isForm: false ,
+ table: {
+ width: 220,
+ fixed: 'right'
+ },
+ }
+]))
+
+//表单校验
+export const ProductionMainRules = reactive({
+ displayOrder: [
+ { required: true, message: '请输入顺序', trigger: 'blur' },
+ // { max: 50, message: '不得超过50个字符', 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: 'blur' }
+ ],
+ available: [
+ { required: true, message: '请选择是否可用', trigger: 'change' }
+ ],
+ status: [
+ { required: true, message: '请选择状态', trigger: 'change' }
+ ],
+ beginTime: [
+ { required: true, message: '请输入开始时间', trigger: 'blur' }
+ ],
+ endTime: [
+ { required: true, message: '请输入结束时间', trigger: 'blur' }
+ ],
+ remark: [
+ { max: 50, message: '不得超过50个字符', trigger: 'blur' }
+ ],
+})
+
+/**
+ * @returns {Array} 生产计划子表
+ */
+export const ProductionDetail = useCrudSchemas(reactive([
+ {
+ label: '物料代码',
+ field: 'itemCode',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true, // 开启查询弹窗
+ searchListPlaceholder: '请选择物料代码', // 输入框占位文本
+ searchField: 'itemCode', // 查询弹窗赋值字段
+ searchTitle: '生产线物料关系信息', // 查询弹窗标题
+ searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
+ searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
+ searchCondition: [{
+ key:'productionLineCode',
+ value:'productionLine',
+ message: '请填写生产线代码!',
+ isMainValue: true
+ },{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }],
+ }
+ },
+ tableForm:{
+ isInpuFocusShow: true,
+ searchListPlaceholder: '请选择物料代码', // 输入框占位文本
+ searchField: 'itemCode', // 查询弹窗赋值字段
+ searchTitle: '生产线物料关系信息', // 查询弹窗标题
+ searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
+ searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
+ searchCondition: [{
+ key:'productionLineCode',
+ value:'productionLine',
+ message: '请填写生产线代码!',
+ isMainValue: true
+ },{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }],
+ },
+ },
+ {
+ label: 'Bom版本',
+ field: 'bomVersion',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true, // 开启查询弹窗
+ searchListPlaceholder: '请选择Bom版本', // 输入框占位文本
+ searchField: 'version', // 查询弹窗赋值字段
+ searchTitle: '物料清单信息', // 查询弹窗标题
+ searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类
+ searchPage: BomApi.getBomPage, // 查询弹窗所需分页方法
+ searchCondition: [{
+ key:'productItemCode',
+ value:'itemCode',
+ message: '请填写物料代码!',
+ isMainValue: true
+ },{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }]
+ }
+ },
+ tableForm:{
+ isInpuFocusShow: true,
+ searchListPlaceholder: '请选择Bom版本', // 输入框占位文本
+ searchField: 'version', // 查询弹窗赋值字段
+ searchTitle: '物料清单信息', // 查询弹窗标题
+ searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类
+ searchPage: BomApi.getBomPage, // 查询弹窗所需分页方法
+ searchCondition: [{
+ key:'productItemCode',
+ value:'itemCode',
+ message: '请填写物料代码!',
+ isMainValue: true
+ },{
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }]
+ },
+ },
+ {
+ label: '合格数量',
+ field: 'goodQty',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'InputNumber',
+ componentProps: {
+ min: 1,
+ precision: 6
+ }
+ },
+ tableForm: {
+ type: 'InputNumber',
+ min: 1,
+ precision: 6
+ },
+ isTableForm: false,
+ isForm: false
+ },
+ {
+ label: '不合格数量',
+ field: 'notGoodQty',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'InputNumber',
+ componentProps: {
+ min: 1,
+ precision: 6
+ }
+ },
+ tableForm: {
+ type: 'InputNumber',
+ min: 1,
+ precision: 6
+ },
+ isTableForm: false,
+ isForm: false
+ },
+ {
+ label: '单据号',
+ field: 'number',
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ isTableForm: false,
+ form: {
+ componentProps: {
+ disabled: true
+ }
+ }
+ },
+ {
+ 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: {
+ style: {width: '100%'},
+ type: 'datetime',
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
+ }
+ },
+ isTableForm: false,
+ isForm: false,
+ },
+ {
+ label: '创建者',
+ field: 'creator',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isTableForm: false,
+ isForm: false,
+ },
+ {
+ label: '计划数量',
+ field: 'planQty',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'InputNumber',
+ componentProps: {
+ min: 0,
+ precision: 6
+ }
+ },
+ tableForm: {
+ type: 'InputNumber',
+ min: 0,
+ precision: 6
+ },
+ },
+ {
+ label: '计量单位',
+ field: 'uom',
+ dictType: DICT_TYPE.UOM,
+ dictClass: 'string',
+ isSearch: true,
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ tableForm:{
+ type: 'Select'
+ }
+ },
+ {
+ label: '最后更新时间',
+ field: 'updateTime',
+ formatter: dateFormatter,
+ detail: {
+ dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ },
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ style: {width: '100%'},
+ type: 'datetime',
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
+ }
+ },
+ isTableForm: false,
+ isForm: false,
+ },
+ {
+ label: '最后更新者',
+ field: 'updater',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isTableForm: false,
+ isForm: false,
+ },
+ {
+ 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'
+ }
+ },
+ tableForm: {
+ type: 'Select',
+ default: 'TRUE'
+ },
+ // isTableForm: false,
+ // isForm: false
+ },
+ {
+ label: '操作',
+ field: 'action',
+ isDetail: false,
+ isForm: false ,
+ table: {
+ width: 150,
+ fixed: 'right'
+ },
+ isTableForm:false,
+ }
+]))
+
+//表单校验
+export const ProductionDetailRules = reactive({
+ 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' }
+ ],
+ itemCode: [
+ { required: true, message: '请选择物料代码', trigger: 'change' }
+ ],
+ remark: [
+ { max: 50, message: '不得超过50个字符', trigger: 'blur' }
+ ],
+})