Browse Source

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

master_hella_20240701
zhaoxuebing 8 months ago
parent
commit
d0283ebf0d
  1. 18
      src/api/mes/workstation/index.ts
  2. 5
      src/components/workstationBind/index.ts
  3. 200
      src/components/workstationBind/src/Detail.vue
  4. 71
      src/views/mes/workstation/index.vue

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

@ -6,7 +6,9 @@ export interface WorkstationVO {
expireTime: Date expireTime: Date
name: string name: string
} }
export const goalParams = {
workstationCode:null
}
// 查询工位列表 // 查询工位列表
export const getWorkstationPage = async (params) => { export const getWorkstationPage = async (params) => {
if (params.isSearch) { if (params.isSearch) {
@ -49,21 +51,25 @@ export const importTemplate = () => {
} }
// 查询班组列表 // 查询班组列表
export const getTeamPage = async (params) => { export const getTeamPage = async (params) => {
console.log(goalParams.workstationCode)
params.workstationCode = goalParams.workstationCode
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}
return await request.post({ url: '/wms/team/senior', data }) return await request.post({ url: '/mes/team/senior', data })
} else { } else {
return await request.get({ url: `/wms/team/page`, params }) return await request.get({ url: `/mes/team/pageListByWorkstationCode`, params })
} }
} }
export const getEquipmentPage = async (params) => { export const getEquipmentPage = async (params) => {
console.log(goalParams.workstationCode)
params.workstationCode = goalParams.workstationCode
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}
return await request.post({ url: '/mes/equipment/senior', data }) return await request.post({ url: '/mes/equipment/senior', data })
} else { } else {
return await request.get({ url: `/mes/equipment/page`, params }) return await request.get({ url: `/mes/equipment/pageListByWorkstationCode`, params })
} }
} }
export const getProcessPage = async (params) => { export const getProcessPage = async (params) => {
@ -72,7 +78,7 @@ export const getProcessPage = async (params) => {
const data = {...params} const data = {...params}
return await request.post({ url: '/wms/process/senior', data }) return await request.post({ url: '/wms/process/senior', data })
} else { } else {
return await request.get({ url: `/wms/process/page`, params }) return await request.get({ url: `/wms/process/pageListByWorkstationCode`, params })
} }
} }
export const getProductionPage = async (params) => { export const getProductionPage = async (params) => {
@ -81,6 +87,6 @@ export const getProductionPage = async (params) => {
const data = {...params} const data = {...params}
return await request.post({ url: '/wms/production/senior', data }) return await request.post({ url: '/wms/production/senior', data })
} else { } else {
return await request.get({ url: `/wms/production/page`, params }) return await request.get({ url: `/wms/production/pageListByWorkstationCode`, params })
} }
} }

5
src/components/workstationBind/index.ts

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

200
src/components/workstationBind/src/Detail.vue

@ -12,72 +12,109 @@
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span> {{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span>
</div> </div>
</template> </template>
<ContentWrap> <ContentWrap v-if="!isBasic">
<!-- 默认单表展现 -->
<Descriptions <Descriptions
:data="detailData" :data="detailData"
labelClassName="label-class-name"
label-align="left"
direction="vertical"
:column="8"
:schema="allSchemas.detailSchema" :schema="allSchemas.detailSchema"
:columns="2" :columns="2"
width="200px"
/> />
</ContentWrap> </ContentWrap>
<Tabs :tabsList="TabsList" :current="current" @change="change" /> <Tabs :tabsList="tabsList" :current="current" @change="change" />
<div class="flex"> <div class="flex">
<!-- 详情 --> <!-- 详情 -->
<ContentWrap class="w-[100%]"> <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 --> <!-- 单表切换tabs 展现table -->
<Table <Table
v-if="isBasic && tabsExtend" v-if="isBasic && tabsExtend"
:columns="teamSchemasRef.tableColumns" :columns="detailAllSchemasRef.tableColumns"
:data="teamObjectRef.tableList" :data="tableObjectRef.tableList"
:loading="teamObjectRef.loading" :loading="tableObjectRef.loading"
:pagination="{ total: teamObjectRef.total }" :pagination="{ total: tableObjectRef.total }"
v-model:pageSize="teamObjectRef.pageSize" v-model:pageSize="tableObjectRef.pageSize"
v-model:currentPage="teamObjectRef.currentPage" v-model:currentPage="tableObjectRef.currentPage"
> >
<template> <!-- <template #action="{ row }">
<div>1</div> <ButtonBase
</template> :Butttondata="buttondata"
@button-base-click="buttonTableClick($event, row)"
/>
</template> -->
</Table> </Table>
<Table <Table
v-if="!isBasic && fromeWhere != 'Equipment'" v-if="!isBasic && fromeWhere != 'countPlan'"
:columns="teamSchemasRef.tableColumns" :columns="detailAllSchemasRef.tableColumns"
:data="teamObjectRef.tableList" :data="tableObjectRef.tableList"
:loading="teamObjectRef.loading" :loading="tableObjectRef.loading"
:pagination="{ total: teamObjectRef.total }" :pagination="{ total: tableObjectRef.total }"
v-model:pageSize="teamObjectRef.pageSize" v-model:pageSize="tableObjectRef.pageSize"
v-model:currentPage="teamObjectRef.currentPage" v-model:currentPage="tableObjectRef.currentPage"
> >
<template> <template #photos="{ row }">
<div>1</div> <div v-for="(item,index) in row.photos.split(',')" :key="index" style="color:#409eff ; cursor: pointer;" @click="openImage(item)">{{ item }}</div>
</template> </template>
</Table> <template #action="{ row }">
<Table <ButtonBase
v-if="!isBasic && fromeWhere != 'Process'" :Butttondata="buttondata"
:columns="teamSchemasRef.tableColumns" @button-base-click="buttonTableClick($event, row)"
:data="teamObjectRef.tableList" />
:loading="teamObjectRef.loading"
:pagination="{ total: teamObjectRef.total }"
v-model:pageSize="teamObjectRef.pageSize"
v-model:currentPage="teamObjectRef.currentPage"
>
<template>
<div>1</div>
</template> </template>
</Table> </Table>
<DetailTable <DetailTable
v-if="!isBasic && fromeWhere == 'Production' && isShowDrawer" v-if="!isBasic && fromeWhere == 'countPlan' && isShowDrawer"
:columns="teamSchemasRef.tableColumns" :columns="detailAllSchemasRef.tableColumns"
:data="teamObjectRef.tableList" :data="tableObjectRef.tableList"
:allList="allList" :allList="allList"
:countScopeType="countScopeType" :countScopeType="countScopeType"
:key="updateKey" :key="updateKey"
> >
<template> <template #action="{ row }">
<div>1</div> <ButtonBase
:Butttondata="buttondata"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</DetailTable> </DetailTable>
</ContentWrap> </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> </div>
</el-drawer> </el-drawer>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
@ -105,19 +142,16 @@
</template> </template>
<script lang="ts" setup> <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 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 Detail from "@/components/workstationBind/src/Detail.vue"; import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import {TabsList} from "@/views/mes/workstation/workstation.data"; import TableHead from '@/components/TableHead/src/TableHead.vue'
import DetailTable from "@/components/DetailTable/src/DetailTable.vue"; import DetailTable from '@/components/DetailTable/src/DetailTable.vue'
import Tabs from "@/components/Tabs/src/Tabs.vue";
import Annex from "@/components/Annex/src/Annex.vue";
import Remarks from "@/components/Remarks/src/Remarks.vue";
import BasicForm from "@/components/BasicForm/src/BasicForm.vue";
import TableHead from "@/components/TableHead/src/TableHead.vue";
import ChangeRecord from "@/components/ChangeRecord/src/ChangeRecord.vue";
import {Team} from "@/utils/disposition/formFields";
defineOptions({ name: 'Detail' }) defineOptions({ name: 'Detail' })
@ -143,12 +177,6 @@ const props = defineProps({
required: false, required: false,
default: false default: false
}, },
//
tableAllSchemas: {
type: Array,
required: true,
default: null
},
// //
allSchemas: { allSchemas: {
type: Object, type: Object,
@ -270,11 +298,6 @@ 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)
@ -374,7 +397,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
teamObjectRef.value.params = { tableObjectRef.value.params = {
masterId: row.id masterId: row.id
} }
await getList() await getList()
@ -439,10 +462,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
} }
} }
defineExpose({ openDetail, formRef }) // open defineExpose({ openDetail, formRef }) // open
// tabs
const changeTabs = (item) => {
alert(item.value)
}
// //
const getRemarkList = async () => { const getRemarkList = async () => {
detailLoading.value = true detailLoading.value = true
@ -462,19 +482,18 @@ 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 //
}) })
teamObjectRef.value = tableObject tableObjectRef.value = tableObject
teamMethodsRef.value = tableMethods tableMethodsRef.value = tableMethods
teamSchemasRef.value = props.teamSchemas detailAllSchemasRef.value = props.detailAllSchemas
// //
const isShowMainButton = (row, val) => { const isShowMainButton = (row, val) => {
@ -486,8 +505,29 @@ const isShowMainButton = (row, val) => {
} }
// //
const { getList } = teamMethodsRef.value const { getList } = tableMethodsRef.value
//
const buttonBaseClick = (val, item) => {
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
// //
// const updataTableColumns = (val) => { // const updataTableColumns = (val) => {
@ -576,9 +616,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
teamObjectRef.value = tableObject tableObjectRef.value = tableObject
teamMethodsRef.value = tableMethods tableMethodsRef.value = tableMethods
teamObjectRef.value.tableList = [] tableObjectRef.value.tableList = []
const { getList } = tableMethods const { getList } = tableMethods
await getList() await getList()
updateKey.value += 1 updateKey.value += 1
@ -603,7 +643,7 @@ const openImage=(item)=>{
* @param field 当前操作字段 * @param field 当前操作字段
* @param cur 改变后值 * @param cur 改变后值
*/ */
const detailBasicFormOnChange = (field, cur) => { const detailBasicFormOnChange = (field, cur) => {
emit('detailBasicFormOnChange', field, cur) emit('detailBasicFormOnChange', field, cur)
} }
@ -612,7 +652,7 @@ const detailBasicFormOnChange = (field, cur) => {
* @param field 当前操作字段 * @param field 当前操作字段
* @param e * @param e
*/ */
const onBlur = (field, e) => { const onBlur = (field, e) => {
emit('onBlur', field, e) emit('onBlur', field, e)
} }
@ -634,8 +674,8 @@ watch(
tableObject.params[item.key] = item.value tableObject.params[item.key] = item.value
}) })
} }
teamObjectRef.value = tableObject tableObjectRef.value = tableObject
teamMethodsRef.value = tableMethods tableMethodsRef.value = tableMethods
const { getList } = tableMethods const { getList } = tableMethods
getList() getList()
} }

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

@ -4,15 +4,15 @@
<Search :schema="Workstation.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search :schema="Workstation.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="Workstation.allSchemas" :allSchemas="Workstation.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
@ -59,26 +59,34 @@
:apiPage="apiPage" :apiPage="apiPage"
:tabs="TabsList" :tabs="TabsList"
@changeTabs="changeTabs" @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 {TabsList, Team, Workstation, WorkstationRules} from './workstation.data' import {
Equipment,
Process,
Production,
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 {
PurchasereceiptRecordDetail,
PurchasereceiptRecordDetailRules,
PurchasereceiptRecordMain
} from "@/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data";
import {PurchasereceiptRequestTabsList} from "@/utils/disposition/tabsList";
import * as PurchasereceiptRecordDetailApi from "@/api/wms/purchasereceiptRecordDetail"; import * as PurchasereceiptRecordDetailApi from "@/api/wms/purchasereceiptRecordDetail";
import {getEquipmentPage, getProcessPage, getProductionPage} from "@/api/mes/workstation"; import {
getEquipmentPage,
getProcessPage,
getProductionPage,
goalParams,
params
} from "@/api/mes/workstation";
defineOptions({ name: 'Workstation' }) defineOptions({ name: 'Workstation' })
const message = useMessage() // const message = useMessage() //
@ -188,11 +196,6 @@ const formsSuccess = async (formType,data) => {
getList() getList()
} }
/** 绑定操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicWorkstation')
}
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {
@ -252,31 +255,31 @@ onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await WorkstationApi.importTemplate() importTemplateData.templateUrl = await WorkstationApi.importTemplate()
}) })
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
goalParams.workstationCode = row.code
detailRef.value.openDetail(row, titleName, titleValue, 'basicWorkstation')
}
// //
const teamRef = ref()
const { tableObject: teamData, tableMethods: teamMethods } = useTable({
getListApi: WorkstationApi.getTeamPage
})
const { getList:teamList } = teamMethods
const detailAllSchemas = ref(Team.allSchemas) const detailAllSchemas = ref(Team.allSchemas)
const apiPage = ref(WorkstationApi.getTeamPage) const apiPage = ref(WorkstationApi.getTeamPage)
const tabeKey = ref("workstationDetail"); const tableKey = ref("workstationDetail");
// tabs // tabs
const changeTabs = (data) =>{ const changeTabs = (data) =>{
tableKey.value = data.prop
if(data.prop == 'Team'){ if(data.prop == 'Team'){
console.log(data)
apiPage.value = WorkstationApi.getTeamPage apiPage.value = WorkstationApi.getTeamPage
detailAllSchemas.value = Team.allSchemas detailAllSchemas.value = Team.allSchemas
}else if(data.prop == 'Equipment'){ }else if(data.prop == 'Equipment'){
apiPage.value = WorkstationApi.getEquipmentPage apiPage.value = WorkstationApi.getEquipmentPage
detailAllSchemas.value = PurchasereceiptRecordDetail.allSchemas detailAllSchemas.value = Equipment.allSchemas
}else if(data.prop == 'Process'){ }else if(data.prop == 'Process'){
apiPage.value = WorkstationApi.getProcessPage apiPage.value = WorkstationApi.getProcessPage
detailAllSchemas.value = PurchasereceiptRecordDetail.allSchemas detailAllSchemas.value = Process.allSchemas
}else if(data.prop == 'Production'){ }else if(data.prop == 'Production'){
apiPage.value = WorkstationApi.getProductionPage apiPage.value = WorkstationApi.getProductionPage
detailAllSchemas.value = PurchasereceiptRecordDetail.allSchemas detailAllSchemas.value = Production.allSchemas
} }
tabeKey.value = data.prop
} }
</script> </script>

Loading…
Cancel
Save