Browse Source

1、增加工位操作步骤关联

master_hella_20240701
bjang03 8 months ago
parent
commit
86d7eab3aa
  1. 76
      src/api/mes/workstation/index.ts
  2. 23
      src/views/mes/workstation/components/Detail.vue
  3. 160
      src/views/mes/workstation/components/TableHead.vue
  4. 59
      src/views/mes/workstation/index.vue
  5. 6
      src/views/mes/workstation/workstation.data.ts

76
src/api/mes/workstation/index.ts

@ -62,7 +62,6 @@ export const getTeamPage = async (params) => {
}
// 查询选择班组列表
export const checkTeamPageList = async (params) => {
console.log(goalParams.workstationCode)
params.workstationCode = goalParams.workstationCode
if (params.isSearch) {
delete params.isSearch
@ -73,18 +72,18 @@ export const checkTeamPageList = async (params) => {
}
}
// 添加班组关联
export const createTeamRelation = async (workstationCode,teamCodes:string[]) => {
export const createTeamRelation = async (teamCodes:string[]) => {
const data = {
workstationCode : workstationCode,
workstationCode : goalParams.workstationCode,
teamCodes : teamCodes
}
return await request.post({ url: `/mes/team/createRelation`, data })
}
// 删除班组关联
export const deleteTeamRelation = async (workstationCode,teamCodes:string[]) => {
export const deleteTeamRelation = async (teamCodes:string[]) => {
const data = {
workstationCode : workstationCode,
workstationCode : goalParams.workstationCode,
teamCodes : teamCodes
}
return await request.post({ url: `/mes/team/deleteRelation`, data })
@ -113,89 +112,92 @@ export const checkEquipmentPageList = async (params) => {
}
}
// 添加设备关联
export const createEquipmentRelation = async (workstationCode,equipmentCodes:string[]) => {
export const createEquipmentRelation = async (equipmentCodes:string[]) => {
const data = {
workstationCode : workstationCode,
workstationCode : goalParams.workstationCode,
equipmentCodes : equipmentCodes
}
return await request.post({ url: `/mes/team/createRelation`, data })
return await request.post({ url: `/mes/equipment/createRelation`, data })
}
// 删除设备关联
export const deleteEquipmentRelation = async (workstationCode,equipmentCodes:string[]) => {
export const deleteEquipmentRelation = async (equipmentCodes:string[]) => {
debugger
const data = {
workstationCode : workstationCode,
workstationCode : goalParams.workstationCode,
equipmentCodes : equipmentCodes
}
return await request.post({ url: `/mes/team/deleteRelation`, data })
return await request.post({ url: `/mes/equipment/deleteRelation`, data })
}
export const getProcessPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/production-process/senior', data })
return await request.post({ url: '/mes/workstation-process/senior', data })
} else {
return await request.get({ url: `/mes/production-process/pageListByWorkstationCode`, params })
return await request.get({ url: `/mes/workstation-process/pageListByWorkstationCode`, params })
}
}
export const checkProcessPageList = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/production-process/senior', data })
return await request.post({ url: '/mes/workstation-process/senior', data })
} else {
return await request.get({ url: `/mes/production-process/pageCheckListByWorkstationCode`, params })
return await request.get({ url: `/mes/workstation-process/pageCheckListByWorkstationCode`, params })
}
}
// 添加工序关联
export const createProcessRelation = async (workstationCode,processCodes:string[]) => {
export const createProcessRelation = async (processCodes:string[]) => {
const data = {
workstationCode : workstationCode,
workstationCode : goalParams.workstationCode,
processCodes : processCodes
}
return await request.post({ url: `/mes/production-process/createRelation`, data })
return await request.post({ url: `/mes/workstation-process/createRelation`, data })
}
// 删除工序关联
export const deleteProcessRelation = async (workstationCode,processCodes:string[]) => {
export const deleteProcessRelation = async (processCodes:string[]) => {
const data = {
workstationCode : workstationCode,
workstationCode : goalParams.workstationCode,
processCodes : processCodes
}
return await request.post({ url: `/mes/production-process/deleteRelation`, data })
return await request.post({ url: `/mes/workstation-process/deleteRelation`, data })
}
export const getProductionPage = async (params) => {
export const getOperstepsPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/production-process/senior', data })
return await request.post({ url: '/mes/workstation-process/senior', data })
} else {
return await request.get({ url: `/mes/production-process/pageListByWorkstationCode`, params })
return await request.get({ url: `/mes/workstation-process/pageListByWorkstationCode`, params })
}
}
export const checkProductionPageList = async (params) => {
export const checkOperstepsPageList = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/production-process/senior', data })
return await request.post({ url: '/mes/workstation-process/senior', data })
} else {
return await request.get({ url: `/mes/production-process/pageCheckListByWorkstationCode`, params })
return await request.get({ url: `/mes/workstation-process/pageCheckListByWorkstationCode`, params })
}
}
// 添加产品关联
export const createProductionRelation = async (workstationCode,productionCodes:string[]) => {
// 添加工序关联
export const createOperstepsRelation = async (processCodes:string[]) => {
const data = {
workstationCode : workstationCode,
productionCodes : productionCodes
workstationCode : goalParams.workstationCode,
processCodes : processCodes
}
return await request.post({ url: `/mes/production-process/createRelation`, data })
return await request.post({ url: `/mes/workstation-process/createRelation`, data })
}
// 删除产品关联
export const deleteProductionRelation = async (workstationCode,productionCodes:string[]) => {
// 删除工序关联
export const deleteOperstepsRelation = async (processCodes:string[]) => {
const data = {
workstationCode : workstationCode,
productionCodes : productionCodes
workstationCode : goalParams.workstationCode,
processCodes : processCodes
}
return await request.post({ url: `/mes/production-process/deleteRelation`, data })
return await request.post({ url: `/mes/workstation-process/deleteRelation`, data })
}

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

@ -138,6 +138,7 @@
@onBlur="onBlur"
@formFormDateChange="formFormDateChange"
/>
</div>
</template>
@ -150,7 +151,7 @@ import * as RemarkApi from '@/api/wms/remark'
import * as FileApi from '@/api/wms/file'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import TableHead from './TableHead.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import DetailTable from '@/components/DetailTable/src/DetailTable.vue'
defineOptions({ name: 'Detail' })
@ -163,7 +164,7 @@ const routeName = ref()
routeName.value = route.name
routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail'
const updateKey = ref(0)
const addRef = ref()
const props = defineProps({
//
tabs: {
@ -429,6 +430,12 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
}
HeadButttondata.value = [...detailButtonFilter,...detailButtonAdd]
//
if (routeName.value.indexOf('Job') > -1) {
HeadButttondata.value = [
defaultButtons.defaultFilterBtn(null) //
]
}
let detailButtonEdit: any = []
let detailButtonDelete: any = []
@ -506,6 +513,12 @@ const buttonBaseClick = (val, item) => {
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') {
//
getList()
@ -529,7 +542,7 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if (val == 'delete') {
//
handleDelete(row.id)
handleDelete(row.code)
} else {
emit('tableFormButton',val, row)
}
@ -584,7 +597,7 @@ const handleDelete = async (id: number) => {
await message.delConfirm()
tableObject.loading = true
//
await props.apiDelete(id)
await props.apiDelete([id])
tableObject.loading = false
message.success(t('common.delSuccess'))
//
@ -638,7 +651,7 @@ const openImage=(item)=>{
/**
* 监听失焦事件
* @param field 当前操作字段
* @param e
* @param e
*/
const onBlur = (field, e) => {
emit('onBlur', field, e)

160
src/views/mes/workstation/components/TableHead.vue

@ -1,160 +0,0 @@
<template>
<div class="tableNavBtnsContent" ref="tableNavBtnsContent_Ref">
<div class="searchBox">
<div class="tableNavLeftBtns">
<ButtonBase
:Butttondata="buttonsLeft"
@button-base-click="buttonBaseClick"
/>
</div>
<div class="tableNavRightBtns">
<!-- 右侧按钮 -->
<ButtonBase :Butttondata="buttonsRight" @button-base-click="buttonBaseClick" @updata-table-columns="updataTableColumns"
:allSchemas="allSchemas" ref="rowDropRef"/>
</div>
</div>
<slot></slot>
</div>
<!-- 字段设置弹窗 -->
<!-- <rowDrop
ref="rowDropRef"
@updata-table-columns="updataTableColumns"
:allSchemas="allSchemas"
/> -->
<!-- 高级筛选 -->
<SearchHigh
ref="searchHigh_Ref"
class="searchHighClass"
:routeName="routeName"
:masterId="masterId"
:showPrimaryBaseButton="false"
@search-form-click="searchFormClick"
:isHighExcludePrimary="false"
:primarySearchCustomButton="[]"
:highSearchCustomButton="[]"
:allSchemas="allSchemas"
/>
</template>
<script setup>
import ButtonBase from '@/components/XButton/src/ButtonBase.vue'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import rowDrop from "@/components/rowDrop/index.vue"
const props = defineProps({
HeadButttondata: {
type: Array,
default: () => {
return []
}
},
// name
routeName: {
type: String,
default: ''
},
//
masterId: {
type: String,
default: ''
},
allSchemas: {
type: Object,
default: null
}
})
const buttonsLeft = ref([])
const buttonsRight = ref([])
const tableNavBtnsContent_Ref = ref()
//
const updataTableColumns = (val) => {
emit('updataTableColumns', val)
}
// const defaultButtons = inject('global').defaultButtons
//
const buttonsLeftOrRight = () => {
buttonsRight.value = []
buttonsLeft.value = []
// ()
// let _primarySearchOption = primarySearch[props.vueName]
// let _highSearchOption = highSearch[props.vueName]
// if(_primarySearchOption || _highSearchOption){
// buttonsRight.value.push(defaultButtons.defaultFilterBtn())
// }
//
props.HeadButttondata.forEach(item=>{
if(item.float && item.float == 'right'){
buttonsRight.value.push(item)
}else{
buttonsLeft.value.push(item)
}
})
}
buttonsLeftOrRight()
watch(
() => props.HeadButttondata,
() => {
buttonsLeftOrRight()
}
)
//
const emit = defineEmits([
'buttonBaseClick',
'updataTableColumns',
'searchFormClick'
])
//
const rowDropRef = ref()
const buttonBaseClick = (val, item) => {
//
if (val == 'set') {
rowDropRef.value.popoverVisible = !rowDropRef.value.popoverVisible
} else if (val == 'filtrate') {
searchHigh_Ref.value.popoverVisible = true
} else {
emit('buttonBaseClick', val, item)
}
}
const quicklySearchDom_Ref = ref()
//
const searchHigh_Ref = ref(false)
//
const searchFormClick = (searchData) => {
emit('searchFormClick', searchData)
searchHigh_Ref.value.popoverVisible = false
}
defineExpose({
tableNavBtnsContent_Ref,
quicklySearchDom_Ref
})
</script>
<style lang="scss" scoped>
.tableNavBtnsContent{
padding-bottom: 10px;
.searchBox{
display: flex;
justify-content: space-between;
}
.tableNavLeftBtns{
display: flex;
margin-left: -5px;
}
.tableNavRightBtns{
display: flex;
margin-left: 10px;
margin-right: -5px;
}
}
</style>

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

@ -58,9 +58,12 @@
:detailAllSchemasRules="WorkstationRules"
:apiPage="apiPage"
:tabs="TabsList"
:apiDelete=tabsDeleteApi
@changeTabs="changeTabs"
:buttondataTable="buttondataTable"
@tableFormButton="tableFormButton"
:detailButtonIsShowAdd="true"
:detailButtonIsShowDelete="true"
:detailButtonIsShowEdit="false"
/>
<!-- 记录子包装弹窗 -->
<BasicForm
@ -94,10 +97,10 @@
:isShowFooterButtton="false"
/>
<BasicForm
ref="productionListRef"
ref="operstepsListRef"
@success="getList"
:tableAllSchemas="Production.allSchemas"
:tableData="selectProductionListTableData.tableList"
:tableAllSchemas="Opersteps.allSchemas"
:tableData="selectOperstepsListTableData.tableList"
:isBusiness="true"
:isShowButton="false"
:isShowReduceButton="false"
@ -112,7 +115,7 @@ import download from '@/utils/download'
import {
Equipment,
Process,
Production,
Opersteps,
TabsList,
Team,
Workstation,
@ -122,12 +125,13 @@ import * as WorkstationApi from '@/api/mes/workstation'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from './components/Detail.vue'
import {
goalParams,
} from "@/api/mes/workstation";
import Detail from './components/Detail.vue'
import * as PurchaseDetailApi from "@/api/wms/purchaseDetail";
defineOptions({ name: 'Workstation' })
let tabsDeleteApi = WorkstationApi.deleteTeamRelation
const message = useMessage() //
const { t } = useI18n() //
const teamRef = ref()
@ -174,7 +178,6 @@ const HeadButttondata = [
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
@ -310,27 +313,31 @@ const changeTabs = (data) =>{
if(data.prop == 'Team'){
apiPage.value = WorkstationApi.getTeamPage
detailAllSchemas.value = Team.allSchemas
tabsDeleteApi = WorkstationApi.deleteTeamRelation
}else if(data.prop == 'Equipment'){
apiPage.value = WorkstationApi.getEquipmentPage
detailAllSchemas.value = Equipment.allSchemas
tabsDeleteApi = WorkstationApi.deleteEquipmentRelation
}else if(data.prop == 'Process'){
apiPage.value = WorkstationApi.getProcessPage
detailAllSchemas.value = Process.allSchemas
tabsDeleteApi = WorkstationApi.deleteProcessRelation
}else if(data.prop == 'Production'){
apiPage.value = WorkstationApi.getProductionPage
apiPage.value = WorkstationApi.getOperstepsPage
detailAllSchemas.value = Production.allSchemas
tabsDeleteApi = WorkstationApi.deleteOperstepsRelation
}
}
const buttondataTable = ref([{
label: '取消关联',
name: 'viewParentPickingNumber',
hide: false,
type: 'primary',
icon: '',
color: '',
hasPermi: '',
link: true, //
}])
// const buttondataTable = ref([{
// label: '',
// name: 'viewParentPickingNumber',
// hide: false,
// type: 'primary',
// icon: '',
// color: '',
// hasPermi: '',
// link: true, //
// }])
const teamListRef = ref()
const { tableObject: selectTeamListTableData, tableMethods: selectTeamListTableMethods } = useTable({
getListApi: WorkstationApi.checkTeamPageList
@ -349,11 +356,11 @@ const { tableObject: selectProcessListTableData, tableMethods: processListTableM
})
const { getList:selectProcessListList } = processListTableMethods
const productionListRef = ref()
const { tableObject: selectProductionListTableData, tableMethods: productionListTableMethods } = useTable({
getListApi: WorkstationApi.checkProductionPageList
const OperstepsListRef = ref()
const { tableObject: selectOperstepsListTableData, tableMethods: OperstepsListTableMethods } = useTable({
getListApi: WorkstationApi.checkOperstepsPageList
})
const { getList:selectProductionList } = productionListTableMethods
const { getList:selectOperstepsList } = OperstepsListTableMethods
const tableFormButton = async (val , row) => {
if(val == 'Team'){
@ -375,11 +382,11 @@ const tableFormButton = async (val , row) => {
await selectProcessListList()
processListRef.value.open('create', row, null,'viewDetail')//
}else if(val == 'Production'){
selectProductionListTableData.params = {
selectOperstepsListTableData.params = {
workstationCode:row.workstationCode
}
await selectProductionList()
productionListRef.value.open('create', row, null,'viewDetail')//
await selectOperstepsList()
OperstepsListRef.value.open('create', row, null,'viewDetail')//
}
}
</script>

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

@ -18,8 +18,8 @@ export const TabsList = [{
prop: 'Process',
},
{
label: "产品",
prop: 'Production',
label: "操作步骤",
prop: 'Opersteps',
}
]
@ -201,7 +201,7 @@ export const Process = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm:true,
}
]))
export const Production = useCrudSchemas(reactive<CrudSchema[]>([
export const Opersteps = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '代码',
field: 'code',

Loading…
Cancel
Save