Browse Source

1、绑定设备

master_hella_20240701
bjang03 8 months ago
parent
commit
11fc5a4261
  1. 10
      src/api/mes/workstation/index.ts
  2. 3
      src/components/workstationBind/index.ts
  3. 81
      src/components/workstationBind/src/Detail.vue
  4. 61
      src/views/mes/workstation/index.vue
  5. 16
      src/views/mes/workstation/workstation.data.ts

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

@ -47,3 +47,13 @@ export const exportWorkstation = async (params) => {
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/mes/workstation/get-import-template' }) return request.download({ url: '/mes/workstation/get-import-template' })
} }
// 查询班组列表
export const getTeamPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/team/senior', data })
} else {
return await request.get({ url: `/wms/team/page`, params })
}
}

3
src/components/workstationBind/index.ts

@ -1,3 +1,2 @@
import workstationBind from './src/workstationBind.vue'
import detail from './src/Detail.vue' import detail from './src/Detail.vue'
export { workstationBind,detail } export {detail }

81
src/components/workstationBind/src/workstationBind.vue → src/components/workstationBind/src/Detail.vue

@ -15,7 +15,6 @@
<ContentWrap> <ContentWrap>
<!-- 默认单表展现 --> <!-- 默认单表展现 -->
<Descriptions <Descriptions
v-if="isBasic && !tabsExtend"
:data="detailData" :data="detailData"
:schema="allSchemas.detailSchema" :schema="allSchemas.detailSchema"
:columns="2" :columns="2"
@ -29,12 +28,12 @@
<!-- 单表切换tabs 展现table --> <!-- 单表切换tabs 展现table -->
<Table <Table
v-if="isBasic && tabsExtend" v-if="isBasic && tabsExtend"
:columns="detailAllSchemasRef.tableColumns" :columns="teamSchemasRef.tableColumns"
:data="tableObjectRef.tableList" :data="teamObjectRef.tableList"
:loading="tableObjectRef.loading" :loading="teamObjectRef.loading"
:pagination="{ total: tableObjectRef.total }" :pagination="{ total: teamObjectRef.total }"
v-model:pageSize="tableObjectRef.pageSize" v-model:pageSize="teamObjectRef.pageSize"
v-model:currentPage="tableObjectRef.currentPage" v-model:currentPage="teamObjectRef.currentPage"
> >
<template> <template>
<div>1</div> <div>1</div>
@ -42,12 +41,12 @@
</Table> </Table>
<Table <Table
v-if="!isBasic && fromeWhere != 'Equipment'" v-if="!isBasic && fromeWhere != 'Equipment'"
:columns="detailAllSchemasRef.tableColumns" :columns="teamSchemasRef.tableColumns"
:data="tableObjectRef.tableList" :data="teamObjectRef.tableList"
:loading="tableObjectRef.loading" :loading="teamObjectRef.loading"
:pagination="{ total: tableObjectRef.total }" :pagination="{ total: teamObjectRef.total }"
v-model:pageSize="tableObjectRef.pageSize" v-model:pageSize="teamObjectRef.pageSize"
v-model:currentPage="tableObjectRef.currentPage" v-model:currentPage="teamObjectRef.currentPage"
> >
<template> <template>
<div>1</div> <div>1</div>
@ -55,12 +54,12 @@
</Table> </Table>
<Table <Table
v-if="!isBasic && fromeWhere != 'Process'" v-if="!isBasic && fromeWhere != 'Process'"
:columns="detailAllSchemasRef.tableColumns" :columns="teamSchemasRef.tableColumns"
:data="tableObjectRef.tableList" :data="teamObjectRef.tableList"
:loading="tableObjectRef.loading" :loading="teamObjectRef.loading"
:pagination="{ total: tableObjectRef.total }" :pagination="{ total: teamObjectRef.total }"
v-model:pageSize="tableObjectRef.pageSize" v-model:pageSize="teamObjectRef.pageSize"
v-model:currentPage="tableObjectRef.currentPage" v-model:currentPage="teamObjectRef.currentPage"
> >
<template> <template>
<div>1</div> <div>1</div>
@ -68,8 +67,8 @@
</Table> </Table>
<DetailTable <DetailTable
v-if="!isBasic && fromeWhere == 'Production' && isShowDrawer" v-if="!isBasic && fromeWhere == 'Production' && isShowDrawer"
:columns="detailAllSchemasRef.tableColumns" :columns="teamSchemasRef.tableColumns"
:data="tableObjectRef.tableList" :data="teamObjectRef.tableList"
:allList="allList" :allList="allList"
:countScopeType="countScopeType" :countScopeType="countScopeType"
:key="updateKey" :key="updateKey"
@ -120,7 +119,7 @@ import TableHead from "@/components/TableHead/src/TableHead.vue";
import ChangeRecord from "@/components/ChangeRecord/src/ChangeRecord.vue"; import ChangeRecord from "@/components/ChangeRecord/src/ChangeRecord.vue";
import {Team} from "@/utils/disposition/formFields"; import {Team} from "@/utils/disposition/formFields";
defineOptions({ name: 'BindDetail' }) defineOptions({ name: 'Detail' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
@ -144,6 +143,12 @@ const props = defineProps({
required: false, required: false,
default: false default: false
}, },
//
tableAllSchemas: {
type: Array,
required: true,
default: null
},
// //
allSchemas: { allSchemas: {
type: Object, type: Object,
@ -265,6 +270,11 @@ const props = defineProps({
type: Boolean, type: Boolean,
required: false, required: false,
default: true default: true
},
teamSchemas:{
type: Boolean,
required: false,
default: true
} }
}) })
const isShowDrawer = ref(false) const isShowDrawer = ref(false)
@ -364,7 +374,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
masterParmas.value.masterId = row.id masterParmas.value.masterId = row.id
masterParmas.value.number = row.number masterParmas.value.number = row.number
masterParmas.value.status = row.status masterParmas.value.status = row.status
tableObjectRef.value.params = { teamObjectRef.value.params = {
masterId: row.id masterId: row.id
} }
await getList() await getList()
@ -452,18 +462,19 @@ const remarksSubmitScuess = async (remark) => {
const getChangeRecordList = async () => { const getChangeRecordList = async () => {
changeRecordData.changeRecordList = await RemarkApi.getChangeRecordPage(remarksData.data) changeRecordData.changeRecordList = await RemarkApi.getChangeRecordPage(remarksData.data)
} }
const tableObjectRef = ref()
const tableMethodsRef = ref()
const detailAllSchemasRef = ref() const detailAllSchemasRef = ref()
detailAllSchemasRef.value = props.detailAllSchemas
const teamObjectRef = ref()
const teamMethodsRef = ref()
const teamSchemasRef = ref()
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage // getListApi: props.apiPage //
}) })
tableObjectRef.value = tableObject teamObjectRef.value = tableObject
tableMethodsRef.value = tableMethods teamMethodsRef.value = tableMethods
detailAllSchemasRef.value = props.detailAllSchemas teamSchemasRef.value = props.teamSchemas
// //
const isShowMainButton = (row, val) => { const isShowMainButton = (row, val) => {
@ -475,7 +486,7 @@ const isShowMainButton = (row, val) => {
} }
// //
const { getList } = tableMethodsRef.value const { getList } = teamMethodsRef.value
// //
@ -565,9 +576,9 @@ const searchFormClick = async (searchData) => {
: [{ column: 'masterId', action: '==', value: masterParmas.value.masterId }] : [{ column: 'masterId', action: '==', value: masterParmas.value.masterId }]
} }
detailAllSchemasRef.value = props.detailAllSchemas detailAllSchemasRef.value = props.detailAllSchemas
tableObjectRef.value = tableObject teamObjectRef.value = tableObject
tableMethodsRef.value = tableMethods teamMethodsRef.value = tableMethods
tableObjectRef.value.tableList = [] teamObjectRef.value.tableList = []
const { getList } = tableMethods const { getList } = tableMethods
await getList() await getList()
updateKey.value += 1 updateKey.value += 1
@ -623,8 +634,8 @@ watch(
tableObject.params[item.key] = item.value tableObject.params[item.key] = item.value
}) })
} }
tableObjectRef.value = tableObject teamObjectRef.value = tableObject
tableMethodsRef.value = tableMethods teamMethodsRef.value = tableMethods
const { getList } = tableMethods const { getList } = tableMethods
getList() getList()
} }

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

@ -51,22 +51,33 @@
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Workstation.allSchemas" /> <Detail ref="detailRef"
<!-- 绑定 --> :isBasic="false"
<BindDetail ref="bindDetailRef" :isBasic="true" :allSchemas="Workstation.allSchemas" /> :allSchemas="Workstation.allSchemas"
:detailAllSchemas="detailAllSchemas"
:detailAllSchemasRules="WorkstationRules"
:apiPage="apiPage"
:tabs="TabsList"
@changeTabs="changeTabs"
/>
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/workstation/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/mes/workstation/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { Workstation,WorkstationRules } from './workstation.data' import {TabsList, Team, Workstation, WorkstationRules} from './workstation.data'
import * as WorkstationApi from '@/api/mes/workstation' 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/src/Detail.vue' import {
import BindDetail from '@/components/workstationBind/src/workstationBind.vue' PurchasereceiptRecordDetail,
PurchasereceiptRecordDetailRules,
PurchasereceiptRecordMain
} from "@/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data";
import {PurchasereceiptRequestTabsList} from "@/utils/disposition/tabsList";
import * as PurchasereceiptRecordDetailApi from "@/api/wms/purchasereceiptRecordDetail";
defineOptions({ name: 'Workstation' }) defineOptions({ name: 'Workstation' })
const message = useMessage() // const message = useMessage() //
@ -136,7 +147,6 @@ const buttonBaseClick = (val, item) => {
const butttondata = [ const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:workstation:update'}), // defaultButtons.mainListEditBtn({hasPermi:'wms:workstation:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:workstation:delete'}), // defaultButtons.mainListDeleteBtn({hasPermi:'wms:workstation:delete'}), //
defaultButtons.mainListBindBtn({hasPermi:'wms:workstation:update'}), //
] ]
// - // -
@ -145,8 +155,6 @@ const buttonTableClick = async (val, row) => {
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
await handleDelete(row.id) await handleDelete(row.id)
}else if (val == 'bind') { //
openBindDetail(row,row.name,row.code)
} }
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
@ -179,16 +187,11 @@ const formsSuccess = async (formType,data) => {
getList() getList()
} }
/** 详情操作 */ /** 绑定操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicWorkstation') detailRef.value.openDetail(row, titleName, titleValue, 'basicWorkstation')
} }
/** 绑定操作 */
const bindDetailRef = ref()
const openBindDetail = (row: any, titleName: any, titleValue: any) => {
bindDetailRef.value.openDetail(row, titleName, titleValue, 'basicWorkstation')
}
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {
@ -248,5 +251,31 @@ onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await WorkstationApi.importTemplate() importTemplateData.templateUrl = await WorkstationApi.importTemplate()
}) })
//
const teamRef = ref()
const { tableObject: teamData, tableMethods: teamMethods } = useTable({
getListApi: WorkstationApi.getTeamPage
})
const { getList:teamList } = teamMethods
const detailAllSchemas = ref(Team.allSchemas)
const apiPage = ref(WorkstationApi.getTeamPage)
const tabeKey = ref("workstationDetail");
// tabs
const changeTabs = (data) =>{
if(data.prop == 'Team'){
console.log(data)
apiPage.value = WorkstationApi.getTeamPage
detailAllSchemas.value = Team.allSchemas
}else if(data.prop == 'Equipment'){
apiPage.value = PurchasereceiptRecordDetailApi.getScarceGoodsDetailPage
detailAllSchemas.value = PurchasereceiptRecordDetail.allSchemas
}else if(data.prop == 'Process'){
apiPage.value = PurchasereceiptRecordDetailApi.getScarceGoodsDetailPage
detailAllSchemas.value = PurchasereceiptRecordDetail.allSchemas
}else if(data.prop == 'Production'){
apiPage.value = PurchasereceiptRecordDetailApi.getScarceGoodsDetailPage
detailAllSchemas.value = PurchasereceiptRecordDetail.allSchemas
}
tabeKey.value = data.prop
}
</script> </script>

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

@ -104,3 +104,19 @@ 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
}
]))

Loading…
Cancel
Save