Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

master_hella_20240701
chenfang 8 months ago
parent
commit
5cc018ec1f
  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. 62
      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) => { export const checkTeamPageList = async (params) => {
console.log(goalParams.workstationCode)
params.workstationCode = goalParams.workstationCode params.workstationCode = goalParams.workstationCode
if (params.isSearch) { if (params.isSearch) {
delete 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 = { const data = {
workstationCode : workstationCode, workstationCode : goalParams.workstationCode,
teamCodes : teamCodes teamCodes : teamCodes
} }
return await request.post({ url: `/mes/team/createRelation`, data }) return await request.post({ url: `/mes/team/createRelation`, data })
} }
// 删除班组关联 // 删除班组关联
export const deleteTeamRelation = async (workstationCode,teamCodes:string[]) => { export const deleteTeamRelation = async (teamCodes:string[]) => {
const data = { const data = {
workstationCode : workstationCode, workstationCode : goalParams.workstationCode,
teamCodes : teamCodes teamCodes : teamCodes
} }
return await request.post({ url: `/mes/team/deleteRelation`, data }) 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 = { const data = {
workstationCode : workstationCode, workstationCode : goalParams.workstationCode,
equipmentCodes : equipmentCodes 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 = { const data = {
workstationCode : workstationCode, workstationCode : goalParams.workstationCode,
equipmentCodes : equipmentCodes 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) => { export const getProcessPage = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}
return await request.post({ url: '/mes/production-process/senior', data }) return await request.post({ url: '/mes/workstation-process/senior', data })
} else { } 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) => { export const checkProcessPageList = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}
return await request.post({ url: '/mes/production-process/senior', data }) return await request.post({ url: '/mes/workstation-process/senior', data })
} else { } 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 = { const data = {
workstationCode : workstationCode, workstationCode : goalParams.workstationCode,
processCodes : processCodes 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 = { const data = {
workstationCode : workstationCode, workstationCode : goalParams.workstationCode,
processCodes : processCodes 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) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}
return await request.post({ url: '/mes/production-process/senior', data }) return await request.post({ url: '/mes/workstation-process/senior', data })
} else { } 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) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}
return await request.post({ url: '/mes/production-process/senior', data }) return await request.post({ url: '/mes/workstation-process/senior', data })
} else { } 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 = { const data = {
workstationCode : workstationCode, workstationCode : goalParams.workstationCode,
productionCodes : productionCodes 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 = { const data = {
workstationCode : workstationCode, workstationCode : goalParams.workstationCode,
productionCodes : productionCodes 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" @onBlur="onBlur"
@formFormDateChange="formFormDateChange" @formFormDateChange="formFormDateChange"
/> />
</div> </div>
</template> </template>
@ -150,7 +151,7 @@ import * as RemarkApi from '@/api/wms/remark'
import * as FileApi from '@/api/wms/file' import * as FileApi from '@/api/wms/file'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue' 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' import DetailTable from '@/components/DetailTable/src/DetailTable.vue'
defineOptions({ name: 'Detail' }) defineOptions({ name: 'Detail' })
@ -163,7 +164,7 @@ const routeName = ref()
routeName.value = route.name routeName.value = route.name
routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail' routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail'
const updateKey = ref(0) const updateKey = ref(0)
const addRef = ref()
const props = defineProps({ const props = defineProps({
// //
tabs: { tabs: {
@ -429,6 +430,12 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
} }
HeadButttondata.value = [...detailButtonFilter,...detailButtonAdd] HeadButttondata.value = [...detailButtonFilter,...detailButtonAdd]
//
if (routeName.value.indexOf('Job') > -1) {
HeadButttondata.value = [
defaultButtons.defaultFilterBtn(null) //
]
}
let detailButtonEdit: any = [] let detailButtonEdit: any = []
let detailButtonDelete: any = [] let detailButtonDelete: any = []
@ -506,6 +513,12 @@ const buttonBaseClick = (val, item) => {
if (val == 'add') { if (val == 'add') {
// //
openForm('create') openForm('create')
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { } else if (val == 'refresh') {
// //
getList() getList()
@ -529,7 +542,7 @@ const buttonTableClick = async (val, row) => {
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { } else if (val == 'delete') {
// //
handleDelete(row.id) handleDelete(row.code)
} else { } else {
emit('tableFormButton',val, row) emit('tableFormButton',val, row)
} }
@ -584,7 +597,7 @@ const handleDelete = async (id: number) => {
await message.delConfirm() await message.delConfirm()
tableObject.loading = true tableObject.loading = true
// //
await props.apiDelete(id) await props.apiDelete([id])
tableObject.loading = false tableObject.loading = false
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
@ -638,7 +651,7 @@ const openImage=(item)=>{
/** /**
* 监听失焦事件 * 监听失焦事件
* @param field 当前操作字段 * @param field 当前操作字段
* @param e * @param e
*/ */
const onBlur = (field, e) => { const onBlur = (field, e) => {
emit('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>

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

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

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

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

Loading…
Cancel
Save