Browse Source

1、增加月度计划主表管理功能

master_hella_20240701
bjang03 8 months ago
parent
commit
4fc4829929
  1. 3
      src/views/mes/workstation/components/Detail.vue
  2. 13
      src/views/mes/workstation/index.vue
  3. 85
      src/views/mes/workstation/workstation.data.ts

3
src/views/mes/workstation/components/Detail.vue

@ -655,13 +655,12 @@ const openForm = async (type: string, row?: number) => {
}
// form
const submitForm = async (formType, data) => {
console.log('submitForm',data)
try {
// detailValidate
const rs = (await props.detailValidate) ? await props.detailValidate(data) : true
if (!rs) return
if (formType === 'create') {
await props.apiCreate(data)
await props.apiCreate(data.list.split(","))
message.success(t('common.createSuccess'))
} else {
await props.apiUpdate(data)

13
src/views/mes/workstation/index.vue

@ -58,7 +58,7 @@
:apiDelete="tabsDeleteApi"
:allSchemas="Workstation.allSchemas"
:detailAllSchemas="detailAllSchemas"
:searchTableSchema="popList.allSchemas"
:searchTableSchema="tmpPopList"
:detailAllSchemasRules="WorkstationRules"
:apiPage="apiPage"
:tabs="TabsList"
@ -70,7 +70,7 @@
/>
<BasicForm
ref="teamListRef"
:formAllSchemas="popList.allSchemas"
:formAllSchemas="tmpPopList"
:isBusiness="false"
/>
<!-- 导入 -->
@ -86,7 +86,7 @@ import {
TabsList,
Team,
Workstation,
WorkstationRules, popList
WorkstationRules, teamPopList,equipmentPopList,processPopList,stepPopList
} from './workstation.data'
import * as WorkstationApi from '@/api/mes/workstation'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -273,6 +273,7 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
const detailAllSchemas = ref(Team.allSchemas)
const apiPage = ref(WorkstationApi.getTeamPage)
const tableKey = ref("Team");
let tmpPopList = teamPopList.allSchemas
// tabs
const changeTabs = (data) =>{
tableKey.value = data.prop
@ -281,23 +282,25 @@ const changeTabs = (data) =>{
detailAllSchemas.value = Team.allSchemas
tabsDeleteApi = WorkstationApi.deleteTeamRelation
tabsCreateApi = WorkstationApi.createTeamRelation
tmpPopList = teamPopList.allSchemas
}else if(data.prop == 'Equipment'){
apiPage.value = WorkstationApi.getEquipmentPage
detailAllSchemas.value = Equipment.allSchemas
tabsDeleteApi = WorkstationApi.deleteEquipmentRelation
tabsCreateApi = WorkstationApi.createEquipmentRelation
tmpPopList = equipmentPopList.allSchemas
}else if(data.prop == 'Process'){
apiPage.value = WorkstationApi.getProcessPage
detailAllSchemas.value = Process.allSchemas
tabsDeleteApi = WorkstationApi.deleteProcessRelation
tabsCreateApi = WorkstationApi.createProcessRelation
tmpPopList = processPopList.allSchemas
}else if(data.prop == 'Opersteps'){
apiPage.value = WorkstationApi.getOperstepsPage
detailAllSchemas.value = Opersteps.allSchemas
tabsDeleteApi = WorkstationApi.deleteOperstepsRelation
tabsCreateApi = WorkstationApi.createOperstepsRelation
tmpPopList = stepPopList.allSchemas
}
}
const teamListRef = ref()

85
src/views/mes/workstation/workstation.data.ts

@ -214,19 +214,19 @@ export const Opersteps = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm:true,
}
]))
export const popList = useCrudSchemas(reactive<CrudSchema[]>([
export const teamPopList = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '多选列表',
field: 'popCheckList',
label: '选择班组',
field: 'list',
sort: 'custom',
isSearch: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择仓库代码', // 输入框占位文本
searchListPlaceholder: '请选择选择班组', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '仓库信息', // 查询弹窗标题
searchTitle: '选择班组', // 查询弹窗标题
searchAllSchemas: Team.allSchemas, // 查询弹窗所需类
searchPage: WorkstationApi.checkTeamPageList, // 查询弹窗所需分页方法
searchCondition: [{
@ -238,3 +238,78 @@ export const popList = useCrudSchemas(reactive<CrudSchema[]>([
}
}
]))
export const equipmentPopList = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '选择设备',
field: 'list',
sort: 'custom',
isSearch: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
multiple:true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '选择设备', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '选择设备', // 查询弹窗标题
searchAllSchemas: Team.allSchemas, // 查询弹窗所需类
searchPage: WorkstationApi.checkEquipmentPageList, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
}
]))
export const processPopList = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '选择工序',
field: 'list',
sort: 'custom',
isSearch: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
multiple:true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '选择工序', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '选择工序', // 查询弹窗标题
searchAllSchemas: Team.allSchemas, // 查询弹窗所需类
searchPage: WorkstationApi.checkProcessPageList, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
}
]))
export const stepPopList = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '选择操作步骤',
field: 'list',
sort: 'custom',
isSearch: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
multiple:true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '选择操作步骤', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '选择操作步骤', // 查询弹窗标题
searchAllSchemas: Team.allSchemas, // 查询弹窗所需类
searchPage: WorkstationApi.checkOperstepsPageList, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
}
]))

Loading…
Cancel
Save