Browse Source

1、版本恢复

master_hella_20240701
bjang03 6 months ago
parent
commit
d9056c577f
  1. 113
      src/api/mes/workstation/index.ts
  2. 681
      src/views/mes/workstation/components/Detail.vue
  3. 160
      src/views/mes/workstation/components/TableHead.vue
  4. 113
      src/views/mes/workstation/index.vue
  5. 60
      src/views/mes/workstation/workstation.data.ts

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

@ -48,8 +48,7 @@ export const exportWorkstation = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/workstation/get-import-template' })
}
// 查询班组列表
}// 查询班组列表
export const getTeamPage = async (params) => {
console.log(goalParams.workstationCode)
params.workstationCode = goalParams.workstationCode
@ -61,6 +60,35 @@ export const getTeamPage = async (params) => {
return await request.get({ url: `/mes/team/pageListByWorkstationCode`, params })
}
}
// 查询选择班组列表
export const checkTeamPageList = async (params) => {
console.log(goalParams.workstationCode)
params.workstationCode = goalParams.workstationCode
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/team/senior', data })
} else {
return await request.get({ url: `/mes/team/pageCheckListByWorkstationCode`, params })
}
}
// 添加班组关联
export const createTeamRelation = async (workstationCode,teamCodes:string[]) => {
const data = {
workstationCode : workstationCode,
teamCodes : teamCodes
}
return await request.post({ url: `/mes/team/createRelation`, data })
}
// 删除班组关联
export const deleteTeamRelation = async (workstationCode,teamCodes:string[]) => {
const data = {
workstationCode : workstationCode,
teamCodes : teamCodes
}
return await request.post({ url: `/mes/team/deleteRelation`, data })
}
export const getEquipmentPage = async (params) => {
console.log(goalParams.workstationCode)
params.workstationCode = goalParams.workstationCode
@ -72,6 +100,35 @@ export const getEquipmentPage = async (params) => {
return await request.get({ url: `/mes/equipment/pageListByWorkstationCode`, params })
}
}
// 查询选择设备列表
export const checkEquipmentPageList = async (params) => {
console.log(goalParams.workstationCode)
params.workstationCode = goalParams.workstationCode
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/equipment/senior', data })
} else {
return await request.get({ url: `/mes/equipment/pageCheckListByWorkstationCode`, params })
}
}
// 添加设备关联
export const createEquipmentRelation = async (workstationCode,equipmentCodes:string[]) => {
const data = {
workstationCode : workstationCode,
equipmentCodes : equipmentCodes
}
return await request.post({ url: `/mes/team/createRelation`, data })
}
// 删除设备关联
export const deleteEquipmentRelation = async (workstationCode,equipmentCodes:string[]) => {
const data = {
workstationCode : workstationCode,
equipmentCodes : equipmentCodes
}
return await request.post({ url: `/mes/team/deleteRelation`, data })
}
export const getProcessPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
@ -81,6 +138,32 @@ export const getProcessPage = async (params) => {
return await request.get({ url: `/mes/production-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 })
} else {
return await request.get({ url: `/mes/production-process/pageCheckListByWorkstationCode`, params })
}
}
// 添加工序关联
export const createProcessRelation = async (workstationCode,processCodes:string[]) => {
const data = {
workstationCode : workstationCode,
processCodes : processCodes
}
return await request.post({ url: `/mes/production-process/createRelation`, data })
}
// 删除工序关联
export const deleteProcessRelation = async (workstationCode,processCodes:string[]) => {
const data = {
workstationCode : workstationCode,
processCodes : processCodes
}
return await request.post({ url: `/mes/production-process/deleteRelation`, data })
}
export const getProductionPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
@ -90,3 +173,29 @@ export const getProductionPage = async (params) => {
return await request.get({ url: `/mes/production-process/pageListByWorkstationCode`, params })
}
}
export const checkProductionPageList = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/production-process/senior', data })
} else {
return await request.get({ url: `/mes/production-process/pageCheckListByWorkstationCode`, params })
}
}
// 添加产品关联
export const createProductionRelation = async (workstationCode,productionCodes:string[]) => {
const data = {
workstationCode : workstationCode,
productionCodes : productionCodes
}
return await request.post({ url: `/mes/production-process/createRelation`, data })
}
// 删除产品关联
export const deleteProductionRelation = async (workstationCode,productionCodes:string[]) => {
const data = {
workstationCode : workstationCode,
productionCodes : productionCodes
}
return await request.post({ url: `/mes/production-process/deleteRelation`, data })
}

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

@ -0,0 +1,681 @@
<template>
<div>
<el-drawer
v-model="isShowDrawer"
title="详情"
direction="rtl"
size="80%"
v-loading="detailLoading"
>
<template #header>
<div class="font-size-18px">
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span>
</div>
</template>
<ContentWrap v-if="!isBasic">
<Descriptions
:data="detailData"
labelClassName="label-class-name"
label-align="left"
direction="vertical"
:column="8"
:schema="allSchemas.detailSchema"
:columns="2"
width="200px"
/>
</ContentWrap>
<Tabs :tabsList="tabsList" :current="current" @change="change" />
<div class="flex">
<!-- 详情 -->
<ContentWrap class="w-[73%]">
<!-- 列表头部 -->
<TableHead
v-if="!isBasic"
:HeadButttondata="HeadButttondata"
:masterId="masterParmas.masterId"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@searchFormClick="searchFormClick"
:allSchemas="detailAllSchemas"
/>
<!-- 默认单表展现 -->
<Descriptions
v-if="isBasic && !tabsExtend"
:data="detailData"
:schema="allSchemas.detailSchema"
:columns="2"
/>
<!-- 单表切换tabs 展现table -->
<Table
v-if="isBasic && tabsExtend"
:columns="detailAllSchemasRef.tableColumns"
:data="tableObjectRef.tableList"
:loading="tableObjectRef.loading"
:pagination="{ total: tableObjectRef.total }"
v-model:pageSize="tableObjectRef.pageSize"
v-model:currentPage="tableObjectRef.currentPage"
>
<!-- <template #action="{ row }">
<ButtonBase
:Butttondata="buttondata"
@button-base-click="buttonTableClick($event, row)"
/>
</template> -->
</Table>
<Table
v-if="!isBasic && fromeWhere != 'countPlan'"
:columns="detailAllSchemasRef.tableColumns"
:data="tableObjectRef.tableList"
:loading="tableObjectRef.loading"
:pagination="{ total: tableObjectRef.total }"
v-model:pageSize="tableObjectRef.pageSize"
v-model:currentPage="tableObjectRef.currentPage"
>
<template #photos="{ row }">
<div v-for="(item,index) in row.photos.split(',')" :key="index" style="color:#409eff ; cursor: pointer;" @click="openImage(item)">{{ item }}</div>
</template>
<template #action="{ row }">
<ButtonBase
:Butttondata="buttondata"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
<DetailTable
v-if="!isBasic && fromeWhere == 'countPlan' && isShowDrawer"
:columns="detailAllSchemasRef.tableColumns"
:data="tableObjectRef.tableList"
:allList="allList"
:countScopeType="countScopeType"
:key="updateKey"
>
<template #action="{ row }">
<ButtonBase
:Butttondata="buttondata"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</DetailTable>
</ContentWrap>
<ContentWrap class="w-[27%] ml-16px">
<!-- 附件组件 -->
<Annex
:annexData="annexData"
@handleAnnexSuccess="handleAnnexSuccess"
@deleteAnnexSuccess="deleteAnnexSuccess"
:upData="remarksData.data"
/>
<!-- 备注组件 -->
<Remarks
:remarksData="remarksData"
class="mt-20px"
@remarksSubmitScuess="remarksSubmitScuess"
/>
<!-- 变更记录组件 -->
<ChangeRecord :changeRecordData="changeRecordData" class="mt-20px" />
</ContentWrap>
</div>
</el-drawer>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="submitForm"
:rules="detailAllSchemasRules"
:formAllSchemas="detailAllSchemas"
:isBusiness="false"
:apiUpdate="apiUpdate"
:apiCreate="apiCreate"
:fromeWhere="fromeWhere"
:isDetail="true"
@searchTableSuccess="searchTableSuccess"
:detailData="detailData"
@submitForm="submitForm"
@selectChangeDetail="selectChangeDetail"
:formTypeDetail="formTypeDetail"
:countPlanAllList="countPlanAllList"
@onChange="detailBasicFormOnChange"
@onBlur="onBlur"
@formFormDateChange="formFormDateChange"
/>
</div>
</template>
<script lang="ts" setup>
import Annex from '@/components/Annex/src/Annex.vue'
import Remarks from '@/components/Remarks/src/Remarks.vue'
import ChangeRecord from '@/components/ChangeRecord/src/ChangeRecord.vue'
import Tabs from '@/components/Tabs/src/Tabs.vue'
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 DetailTable from '@/components/DetailTable/src/DetailTable.vue'
defineOptions({ name: 'Detail' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
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: {
type: Object,
required: true,
default: null
},
//
isBasic: {
type: Boolean,
required: false,
default: false
},
//
allSchemas: {
type: Object,
required: true,
default: null
},
//
detailAllSchemas: {
type: Object,
required: true,
default: null
},
//
detailAllSchemasRules: {
type: Object,
required: true,
default: null
},
// API
apiCreate: {
type: Function,
required: false,
default: null
},
// API
apiUpdate: {
type: Function,
required: false,
default: null
},
// API
apiPage: {
type: Function,
required: false,
default: null
},
// API
apiDelete: {
type: Function,
required: false,
default: null
},
//
detailValidate: {
type: Function,
required: false,
default: null
},
// countPlan
fromeWhere: {
type: String,
required: false,
default: ''
},
//
allList: {
type: Object,
required: true,
default: null
},
//
countScopeType: {
type: Array,
required: false,
default: null
},
//
formTypeDetail: {
type: String,
required: false,
default: 'InputString'
},
//
countPlanAllList: {
type: Array,
required: false,
default: null
},
//
buttondataTable: {
type: Array,
required: false,
default: ()=>{
return []
}
},
// tabs table false
tabsExtend: {
type: Boolean,
required: false,
default: false
},
// tableObject
tableObjectExtend: {
type: Array,
required: false,
default: null
},
//
detailButtonIsShowFilter:{
type: Boolean,
required: false,
default: true
},
//
detailButtonIsShowAdd:{
type: Boolean,
required: false,
default: true
},
//
detailButtonIsShowEdit:{
type: Boolean,
required: false,
default: true
},
//
detailButtonIsShowDelete:{
type: Boolean,
required: false,
default: true
}
})
const isShowDrawer = ref(false)
const detailLoading = ref(false)
const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : '')))
if (props.isBasic == true) {
if (tabsList.value && tabsList.value.length > 0) {
tabsList.value.unshift({
label: '详情',
prop: 'Detail'
})
}
} else {
if (tabsList.value && tabsList.value.length > 0) {
} else {
tabsList.value = [
{
label: '明细',
prop: 'Detail'
}
]
}
}
if (tabsList.value) {
}
//
const annexData = reactive({
annexList: []
})
//
const remarksData = reactive({
remarksList: [],
data: {}
})
//
const changeRecordData = reactive({
changeRecordList: []
})
const detailData = ref({}) //
//
const getFileList = async () => {
detailLoading.value = true
try {
annexData.annexList = await FileApi.getFileList(remarksData.data)
} finally {
detailLoading.value = false
}
}
/** 添加附件 */
const handleAnnexSuccess = () => {
getFileList()
getChangeRecordList()
}
//
const deleteAnnexSuccess = async () => {
getFileList()
getChangeRecordList()
}
// Tabs
const current = ref(0)
const change = (item, index) => {
current.value = index
emit('changeTabs', item)
}
//
const masterParmas = ref({
masterId: '', //id
number: '', //
status: '' //
})
//
const HeadButttondata = ref()
// -
const buttondata = ref()
/** 打开弹窗 */
const formRef = ref()
const titleNameRef = ref()
const titleValueRef = ref()
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => {
titleNameRef.value = titleName
titleValueRef.value = titleValue
remarksData.data = {
tableId: row.id,
tableName: tableName
}
//
if (!props.isBasic) {
// id
masterParmas.value.masterId = row.id
masterParmas.value.number = row.number
masterParmas.value.status = row.status
tableObjectRef.value.params = {
masterId: row.id
}
await getList()
}
isShowDrawer.value = true
if (row) {
detailLoading.value = true
try {
detailData.value = row
getRemarkList()
getFileList()
getChangeRecordList()
//
let detailButtonFilter: any = []
let detailButtonAdd: any = []
if (props.detailButtonIsShowFilter) {
//
detailButtonFilter = [
defaultButtons.defaultFilterBtn(null)
]
}
if (props.detailButtonIsShowAdd) {
//
detailButtonAdd = [
defaultButtons.defaultAddBtn({
hide: isShowMainButton(row, ['1'])
})
]
}
HeadButttondata.value = [...detailButtonFilter,...detailButtonAdd]
let detailButtonEdit: any = []
let detailButtonDelete: any = []
if (props.detailButtonIsShowEdit) {
//
detailButtonEdit = [
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['1'])
})
]
}
if (props.detailButtonIsShowDelete) {
//
detailButtonDelete = [
defaultButtons.mainListDeleteBtn({
hide: isShowMainButton(row, ['1'])
})
]
}
buttondata.value = [...detailButtonEdit,...detailButtonDelete,...props.buttondataTable]
} finally {
detailLoading.value = false
}
}
}
defineExpose({ openDetail, formRef }) // open
//
const getRemarkList = async () => {
detailLoading.value = true
try {
remarksData.remarksList = await RemarkApi.getRemarkPage(remarksData.data)
} finally {
detailLoading.value = false
}
}
//
const remarksSubmitScuess = async (remark) => {
detailLoading.value = false
getRemarkList()
getChangeRecordList()
}
//
const getChangeRecordList = async () => {
changeRecordData.changeRecordList = await RemarkApi.getChangeRecordPage(remarksData.data)
}
const tableObjectRef = ref()
const tableMethodsRef = ref()
const detailAllSchemasRef = ref()
const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage //
})
tableObjectRef.value = tableObject
tableMethodsRef.value = tableMethods
detailAllSchemasRef.value = props.detailAllSchemas
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
//
const { getList } = tableMethodsRef.value
//
const buttonBaseClick = (val, item) => {
if (val == 'add') {
//
openForm('create')
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
//
// const updataTableColumns = (val) => {
// detailAllSchemas.tableColumns.value = val
// }
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') {
//
handleDelete(row.id)
} else {
emit('tableFormButton',val, row)
}
}
/** 添加/修改操作 */
const openForm = async (type: string, row?: number) => {
formRef.value.open(type, row, masterParmas.value)
emit('detailOpenForm', type, row)
}
// form
const submitForm = async (formType, data) => {
try {
// detailValidate
const rs = (await props.detailValidate) ? await props.detailValidate(data) : true
if (!rs) return
if (formType === 'create') {
await props.apiCreate(data)
message.success(t('common.createSuccess'))
} else {
await props.apiUpdate(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
await getList()
updateKey.value += 1
} finally {
formRef.value.formLoading = false
}
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
emit('searchTableSuccessDetail', formField, searchField, val, formRef)
}
//
const emit = defineEmits([
'searchTableSuccessDetail',
'changeTabs',
'selectChangeDetail',
'detailOpenForm',
'tableFormButton',
'openImage',
'onBlur',
'detailBasicFormOnChange',
'formFormDateChange'
])
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
tableObject.loading = true
//
await props.apiDelete(id)
tableObject.loading = false
message.success(t('common.delSuccess'))
//
await getList()
updateKey.value += 1
} catch {}
}
//
const searchFormClick = async (searchData) => {
const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage //
})
tableObject.params = {
isSearch: true,
filters: searchData.filters
? searchData.filters
: [{ column: 'masterId', action: '==', value: masterParmas.value.masterId }]
}
detailAllSchemasRef.value = props.detailAllSchemas
tableObjectRef.value = tableObject
tableMethodsRef.value = tableMethods
tableObjectRef.value.tableList = []
const { getList } = tableMethods
await getList()
updateKey.value += 1
// tableObjectRef.value.params = {
// isSearch: true,
// filters: searchData.filters
// ? searchData.filters
// : [{ column: 'masterId', action: '==', value: masterParmas.value.masterId }]
// }
// getList() //
}
//
const selectChangeDetail = (field, val) => {
emit('selectChangeDetail', field, val)
}
//
const openImage=(item)=>{
emit('openImage', item)
}
/**
* 监听改变事件
* @param field 当前操作字段
* @param cur 改变后值
*/
const detailBasicFormOnChange = (field, cur) => {
emit('detailBasicFormOnChange', field, cur)
}
/**
* 监听失焦事件
* @param field 当前操作字段
* @param e
*/
const onBlur = (field, e) => {
emit('onBlur', field, e)
}
//
const formFormDateChange = (field, val,row, index) => {
emit('formFormDateChange', field, val,row, index)
}
//
watch(
() => props.apiPage,
() => {
const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage //
})
tableObject.params.masterId = masterParmas.value.masterId
detailAllSchemasRef.value = props.detailAllSchemas
if (props.tableObjectExtend) {
props.tableObjectExtend.forEach(item => {
tableObject.params[item.key] = item.value
})
}
tableObjectRef.value = tableObject
tableMethodsRef.value = tableMethods
const { getList } = tableMethods
getList()
}
)
</script>
<style lang="scss">
.el-drawer__body {
background: #f5f5f5 !important;
}
::v-deep(.label-class-name) {
color: #dedede;
}
</style>
<style scoped lang="scss"></style>

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

@ -0,0 +1,160 @@
<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>

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

@ -58,9 +58,50 @@
:detailAllSchemasRules="WorkstationRules"
:apiPage="apiPage"
:tabs="TabsList"
:detailButtonIsShowAdd = "true"
:detailButtonIsShowDelete="true"
@changeTabs="changeTabs"
:buttondataTable="buttondataTable"
@tableFormButton="tableFormButton"
/>
<!-- 记录子包装弹窗 -->
<BasicForm
ref="teamRef"
@success="getList"
:tableAllSchemas="Team.allSchemas"
:tableData="selectTeamListTableData.tableList"
:isBusiness="true"
:isShowButton="false"
:isShowReduceButton="false"
:isShowFooterButtton="false"
/>
<BasicForm
ref="equipmentListRef"
@success="getList"
:tableAllSchemas="Equipment.allSchemas"
:tableData="selectEquipmentListTableData.tableList"
:isBusiness="true"
:isShowButton="false"
:isShowReduceButton="false"
:isShowFooterButtton="false"
/>
<BasicForm
ref="processListRef"
@success="getList"
:tableAllSchemas="Process.allSchemas"
:tableData="selectProcessListTableData.tableList"
:isBusiness="true"
:isShowButton="false"
:isShowReduceButton="false"
:isShowFooterButtton="false"
/>
<BasicForm
ref="productionListRef"
@success="getList"
:tableAllSchemas="Production.allSchemas"
:tableData="selectProductionListTableData.tableList"
:isBusiness="true"
:isShowButton="false"
:isShowReduceButton="false"
:isShowFooterButtton="false"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/workstation/import" :importTemplateData="importTemplateData" @success="importSuccess" />
@ -81,18 +122,15 @@ 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 {
getEquipmentPage,
getProcessPage,
getProductionPage,
goalParams,
params
} from "@/api/mes/workstation";
defineOptions({ name: 'Workstation' })
const message = useMessage() //
const { t } = useI18n() //
const teamRef = ref()
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
@ -283,4 +321,65 @@ const changeTabs = (data) =>{
detailAllSchemas.value = Production.allSchemas
}
}
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
})
const { getList:selectTeamList } = selectTeamListTableMethods
const equipmentListRef = ref()
const { tableObject: selectEquipmentListTableData, tableMethods: selectEquipmentListTableMethods } = useTable({
getListApi: WorkstationApi.checkEquipmentPageList
})
const { getList:selectEquipmentList } = selectEquipmentListTableMethods
const processListRef = ref()
const { tableObject: selectProcessListTableData, tableMethods: processListTableMethods } = useTable({
getListApi: WorkstationApi.checkProcessPageList
})
const { getList:selectProcessListList } = processListTableMethods
const productionListRef = ref()
const { tableObject: selectProductionListTableData, tableMethods: productionListTableMethods } = useTable({
getListApi: WorkstationApi.checkProductionPageList
})
const { getList:selectProductionList } = productionListTableMethods
const tableFormButton = async (val , row) => {
if(val == 'Team'){
selectTeamListTableData.params = {
workstationCode:row.workstationCode
}
await selectTeamList()
teamListRef.value.open('create', row, null,'viewDetail')//
}else if(val == 'Equipment'){
selectEquipmentListTableData.params = {
workstationCode:row.workstationCode
}
await selectEquipmentList()
equipmentListRef.value.open('create', row, null,'viewDetail')//
}else if(val == 'Process'){
selectProcessListTableData.params = {
workstationCode:row.workstationCode
}
await selectProcessListList()
processListRef.value.open('create', row, null,'viewDetail')//
}else if(val == 'Production'){
selectProductionListTableData.params = {
workstationCode:row.workstationCode
}
await selectProductionList()
productionListRef.value.open('create', row, null,'viewDetail')//
}
}
</script>

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

@ -105,6 +105,33 @@ export const Workstation = useCrudSchemas(reactive<CrudSchema[]>([
}
]))
export const Team = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '代码',
field: 'code',
sort: 'custom',
isSearch: true,
isForm: false
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
isForm: false
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
fixed: 'right'
},
isTableForm:true,
}
]))
export const TeamSelect = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '代码',
field: 'code',
@ -134,6 +161,17 @@ export const Equipment = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: true,
isForm: false
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
fixed: 'right'
},
isTableForm:true
}
]))
export const Process = useCrudSchemas(reactive<CrudSchema[]>([
@ -150,6 +188,17 @@ export const Process = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: true,
isForm: false
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
fixed: 'right'
},
isTableForm:true,
}
]))
export const Production = useCrudSchemas(reactive<CrudSchema[]>([
@ -166,5 +215,16 @@ export const Production = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: true,
isForm: false
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
fixed: 'right'
},
isTableForm:true,
}
]))

Loading…
Cancel
Save