Browse Source

1、绑定设备

master_hella_20240701
bjang03 8 months ago
parent
commit
11fc5a4261
  1. 12
      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

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

@ -46,4 +46,14 @@ export const exportWorkstation = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
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'
export { workstationBind,detail }
export {detail }

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

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

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

@ -51,22 +51,33 @@
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Workstation.allSchemas" />
<!-- 绑定 -->
<BindDetail ref="bindDetailRef" :isBasic="true" :allSchemas="Workstation.allSchemas" />
<Detail ref="detailRef"
:isBasic="false"
:allSchemas="Workstation.allSchemas"
:detailAllSchemas="detailAllSchemas"
:detailAllSchemasRules="WorkstationRules"
:apiPage="apiPage"
:tabs="TabsList"
@changeTabs="changeTabs"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/workstation/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
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 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/src/Detail.vue'
import BindDetail from '@/components/workstationBind/src/workstationBind.vue'
import {
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' })
const message = useMessage() //
@ -136,7 +147,6 @@ const buttonBaseClick = (val, item) => {
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:workstation:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:workstation:delete'}), //
defaultButtons.mainListBindBtn({hasPermi:'wms:workstation:update'}), //
]
// -
@ -145,8 +155,6 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if (val == 'delete') { //
await handleDelete(row.id)
}else if (val == 'bind') { //
openBindDetail(row,row.name,row.code)
}
}
/** 添加/修改操作 */
@ -179,16 +187,11 @@ const formsSuccess = async (formType,data) => {
getList()
}
/** 详情操作 */
/** 绑定操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
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) => {
@ -248,5 +251,31 @@ onMounted(async () => {
getList()
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>

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