Browse Source

日计划配置功能

master_hella_20240701
TengXF 5 months ago
parent
commit
eda3c06591
  1. 20
      src/api/mes/orderDayConfig/index.ts
  2. 13
      src/api/wms/team/index.ts
  3. 433
      src/views/mes/orderDay/components/schedule.vue
  4. 49
      src/views/mes/orderDay/orderDay.data.ts
  5. 9
      src/views/wms/basicDataManage/orderManage/team/team.data.ts
  6. 122
      src/views/wms/basicDataManage/orderManage/team/teamForm.vue

20
src/api/mes/orderDayConfig/index.ts

@ -35,3 +35,23 @@ export const getConfigProcessWorker = async (params) => {
export const getConfigProcessEquipment = async (params) => { export const getConfigProcessEquipment = async (params) => {
return await request.get({ url: `/mes/orderDayequipment/getByOrder`, params }) return await request.get({ url: `/mes/orderDayequipment/getByOrder`, params })
} }
/*批量保存工序人员配置*/
export const saveWorker = async (data: any) => {
return await request.post({ url: `/mes/orderDayWorker/batchCreate`, data })
}
// 查询设备基本信息列表
export const getDeviceInfoPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/device-info/senior', data })
} else {
return await request.get({ url: `/mes/device-info/page`, params })
}
}
/*批量保存工序模具配置*/
export const saveEquipment = async (data: any) => {
return await request.post({ url: `/mes/orderDayequipment/batchCreate`, data })
}

13
src/api/wms/team/index.ts

@ -12,6 +12,8 @@ export interface TeamVO {
teamGroup: string teamGroup: string
workshopCode: string workshopCode: string
productionLineCode: string productionLineCode: string
teamMonitorCode: string
teamMonitorName: string
} }
// 查询班组列表 // 查询班组列表
@ -25,6 +27,17 @@ export const getTeamPage = async (params) => {
} }
} }
export const geTeamUserByCode = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/team/queryTeamUserByCode', data })
}
// else {
// return await request.get({ url: `/wms/team/queryTeamUserByCode`, params })
// }
}
// 查询班组详情 // 查询班组详情
export const getTeam = async (id: number) => { export const getTeam = async (id: number) => {
return await request.get({ url: `/wms/team/get?id=` + id }) return await request.get({ url: `/wms/team/get?id=` + id })

433
src/views/mes/orderDay/components/schedule.vue

@ -33,12 +33,15 @@
</div> </div>
</template> </template>
<el-table :data="processData" ref="tableProcess" style="width: 100%; height: 80%" @cell-dblclick="userAddNode"> <el-table :data="processData" ref="tableProcess" style="width: 100%; height: 80%" @cell-dblclick="userAddNode">
<el-table-column prop="code" label="工序编码" /> <el-table-column prop="code" label="工序编码" />
<el-table-column prop="name" label="工序名称" /> <el-table-column prop="name" label="工序名称" />
<el-table-column prop="oper" label="" width="60"> <el-table-column prop="opera" label="" width="60">
<template #header>
<span>操作</span>
</template>
<template #default="scope"> <template #default="scope">
<el-button size="mini" text @click="deleteNode(scope.row)" <el-button type="danger" size="mini" text @click="deleteNode(scope.row)"
>移除</el-button >移除</el-button
> >
</template> </template>
</el-table-column> </el-table-column>
@ -46,69 +49,144 @@
</el-card> </el-card>
</el-aside> </el-aside>
<el-main style="height: 320px;width: calc(100% - 980px);padding: 0px; margin:0px 20px"> <el-main style="height: 320px;width: calc(100% - 980px);padding: 0px; margin:0px 20px">
<div ref="graphContainer" ></div <div ref="graphContainer"></div
></el-main> ></el-main>
<el-aside width="640px"> <el-aside width="640px">
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane label="工序工位" name="workstation"> <el-tab-pane label="工序工位" name="workstation">
<el-table :data="workstationData" ref="tableWorkstations" style="width: 100%; height: 80%"> <el-table :data="workstationData" ref="tableWorkstations" style="width: 100%; height: 80%">
<el-table-column prop="name" label="工作位置"> <el-table-column prop="stationName" label="工位名称" />
<template #default="scope"> <el-table-column prop="processCode" label="工序编码" />
<el-button size="mini" text style="width: 100%" <!-- <el-table-column prop="stationName" label="工作位置">-->
>{{ scope.row.name }}[{{ scope.row.code }}]</el-button <!-- <template #default="scope">-->
> <!-- <el-button size="mini" text style="width: 100%"-->
</template> <!-- >{{ scope.row.name }}[{{ scope.row.code }}]</el-button-->
</el-table-column> <!-- >-->
<el-table-column prop="code" label="工序编码" width="180" v-if="false" /> <!-- </template>-->
</el-table> <!-- </el-table-column>-->
</el-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="工序物料" name="materials"> <el-tab-pane label="工序物料" name="materials">
<el-table :data="materialsData" ref="tableMaterials" style="width: 100%; height: 80%"> <el-table :data="materialsData" ref="tableMaterials" style="width: 100%; height: 80%">
<el-table-column prop="repMaterialCode" label="物料编码"/> <el-table-column prop="repMaterialCode" label="物料编码" />
<el-table-column prop="repMaterialCounts" label="物料数量" /> <el-table-column prop="repMaterialCounts" label="物料数量" />
<el-table-column prop="repMaterialModel" label="物料单位" /> <el-table-column prop="repMaterialModel" label="物料单位" />
<el-table-column prop="sourceMaterialCounts" label="需求物料数" > <el-table-column prop="sourceMaterialCounts" label="需求物料数">
<template #default="scope">{{ getTotalcounts(scope.row.repMaterialCounts)}}</template> <template #default="scope">{{ getTotalcounts(scope.row.repMaterialCounts) }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="replaceFlag" label="是否替换" /> <el-table-column prop="replaceFlag" label="是否替换" />
</el-table>
</el-table> </el-tab-pane>
</el-tab-pane>
<el-tab-pane label="工序人员" name="workers"> <el-tab-pane label="工序人员" name="workers">
<el-table :data="workerData" ref="tableWorker" style="width: 100%; height: 80%"> <el-button type="primary" @click="opensearchTableUser">添加人员</el-button>
<el-table-column prop="workerCode" label="人员编码"/> <el-button type="success" @click="saveUser">保存</el-button>
<el-table-column prop="workerName" label="人员昵称" /> <el-table :data="workerData" ref="tableWorker" style="width: 100%; height: 233px;overflow: auto;">
<el-table-column prop="workerWorkstation" label="所在工位" /> <el-table-column prop="groupName" label="所属班组" />
<el-table-column prop="workerTeam" label="所属班组" /> <el-table-column prop="workerMonitor" label="班长" />
<el-table-column prop="workerPost" label="岗位" /> <el-table-column prop="workerCode" label="人员编码" />
<el-table-column prop="abilityLevel" label="能力等级" /> <el-table-column prop="workerName" label="人员昵称" />
</el-table> <el-table-column prop="opera" label="" width="70" >
<template #header>
<span>操作</span>
</template>
<template #default="scope">
<el-button type="danger" size="mini" text @click="deleteUser(scope.row)" style="margin-right: 20px">移除</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="工序设备" name="equipments"> <el-tab-pane label="工序设备" name="equipments">
<el-button type="primary" @click="opensearchTableEquipment">添加设备</el-button>
<el-button type="success" @click="saveEquipment">保存</el-button>
<el-table :data="equipmentData" ref="tableEquipment" style="width: 100%; height: 80%"> <el-table :data="equipmentData" ref="tableEquipment" style="width: 100%; height: 80%">
<el-table-column prop="equipmentCode" label="设备编码"/> <el-table-column prop="equipmentCode" label="设备编码" />
<el-table-column prop="equipmentName" label="设备名称" /> <el-table-column prop="equipmentName" label="设备名称" />
<el-table-column prop="equipmentWorkstation" label="关联工位" /> <el-table-column prop="equipmentType" label="设备类型" />
<el-table-column prop="equipmentOper" label="操作说明" /> <el-table-column prop="equipmentWorkstation" label="关联工位" />
</el-table> <!-- <el-table-column prop="equipmentOper" label="操作说明" />-->
<el-table-column prop="opera" label="" width="70" >
<template #header>
<span>操作</span>
</template>
<template #default="scope">
<el-button type="danger" size="mini" text @click="deleteEquipment(scope.row)" style="margin-right: 20px">移除</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-aside> </el-aside>
</el-container> </el-container>
<el-dialog v-model="dialogFormVisibleUser" title="请选择班组" width="600" :style="{ 'padding': '15px' }">
<el-row>
<el-col :span="8">
<el-form-item label="班组类型">
<el-select v-model="filterFormTeam.teamGroup" placeholder="请选择类型">
<el-option label="生产班组" value="1" />
<el-option label="维修班组" value="2" />
<el-option label="质检班组" value="3" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="班组名称" style="margin-left: 15px">
<el-input v-model="filterFormTeam.teamName" placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<el-button type="primary" @click="searchTeamList" style="margin-left: 15px">查询</el-button>
</el-form-item>
</el-col>
</el-row>
<!-- 表格内容 -->
<content-wrap>
<el-table highlight-current-row :data="teamData" style="width: 100%">
<el-table-column prop="code" label="班组编码" />
<el-table-column prop="name" label="班组名称" />
<el-table-column prop="teamGroup" label="班组类型" >
<template #default="scope">
<el-select v-model="scope.row.teamGroup" placeholder="请选择班组类型" disabled="true">
<el-option
v-for="item in teamGroupOptions"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="name" label="操作" >
<template #default="scope">
<el-button type="text" @click="handleConfirm(scope.row)">选择成员</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
v-model:current-page="currentPage"
:page-size="5"
layout="total, prev, pager, next"
:total="totalTeam"
@current-change="handleCurrentChange"
/>
</content-wrap>
<template #footer>
<div class="dialog-footer">
<el-button @click="closeTeamUser">关闭</el-button>
</div>
</template>
</el-dialog>
</ContentWrap> </ContentWrap>
<template #footer> <template #footer>
<el-button @click="publishPlan">发布计划</el-button> <el-button @click="publishPlan">发布计划</el-button>
</template> </template>
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> <SearchTable ref="searchTableRef" @search-table-success="searchTableSuccess" />
</Dialog> </Dialog>
<!-- <SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> --> <!-- <SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> -->
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
//import { dateFormatter } from '@/utils/formatTime'
import { import {
start_node, start_node,
end_node, end_node,
@ -121,6 +199,12 @@ import {ProcessSearch} from '../../publicUtil/processSearch.data'
import * as ProcessApi from '@/api/wms/process' import * as ProcessApi from '@/api/wms/process'
import { SearchTable } from '@/components/SearchTable' import { SearchTable } from '@/components/SearchTable'
import { Graph } from '@antv/x6' import { Graph } from '@antv/x6'
import * as TeamApi from '@/api/wms/team'
import {searchUser} from "@/views/wms/basicDataManage/orderManage/team/team.data";
import {getStrDictOptions} from "@/utils/dict";
import {Equipment} from "@/views/mes/workstation/workstation.data";
import * as WorkstationApi from "@/api/mes/workstation";
import {DeviceInfo, OrderDay} from "@/views/mes/orderDay/orderDay.data";
//import {TableForm} from '@/components/TableForm/src/TableForm.vue' // TableForm.vue //import {TableForm} from '@/components/TableForm/src/TableForm.vue' // TableForm.vue
const graphContainer = ref<HTMLElement | null>(null) const graphContainer = ref<HTMLElement | null>(null)
const graph = ref<Graph>() const graph = ref<Graph>()
@ -128,7 +212,10 @@ const message = useMessage() // 消息弹窗
const { t } = useI18n() // const { t } = useI18n() //
const activeName = ref('process') const activeName = ref('process')
const loading = ref(true) const loading = ref(true)
const dialogFormVisibleUser = ref(false)
const processData = ref([]) const processData = ref([])
const processCode = ref('')
const queryParams:orderDayconfigApi.OrderDayQueryParamVo=ref() const queryParams:orderDayconfigApi.OrderDayQueryParamVo=ref()
const props = defineProps({ const props = defineProps({
// //
@ -156,15 +243,60 @@ routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'De
//const updateKey = ref(0) //const updateKey = ref(0)
const dialogWidth = ref() const dialogWidth = ref()
const materialsData = ref() const materialsData = ref()
const workerData=ref() const equipmentData=ref([])
const equipmentData=ref() const workstationData=ref([])
const workstationData=ref()
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
const graphJson =ref() const graphJson =ref()
/*班组数据*/
const teamData = ref([])
/*班组弹窗搜索条件*/
const filterFormTeam = ref({
teamGroup: '',
teamName: '',
})
/*班组信息分页参数*/
const totalTeam = ref(0);
const currentPage =ref(1)
/*关闭班组弹窗*/
const closeTeamUser = () =>{
dialogFormVisibleUser.value = false
filterFormTeam.value ={
teamGroup: '',
teamName: ''
}
}
/*通过班组选择的人员数据集*/
const workerData=ref([])
/*查询班组接口参数*/
const teamParams = ref({
teamGroup: '',
name: '',
pageNo:1,
pageSize:5
});
/*班组类型数据集*/
const teamGroupOptions = ref([])
const getOptions=()=>{
teamGroupOptions.value=getStrDictOptions(DICT_TYPE.BASIC_TEAM_TYPE)
}
/*班组分页调用的接口*/
const handleCurrentChange = (val: number) => {
currentPage.value = val
searchTeamListCommon()
}
const searchTeamList = () => {
currentPage.value = 1
searchTeamListCommon()
}
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, row?: any, titleName?: any) => { const open = async (type: string, row?: any, titleName?: any) => {
//
workerData.value = []
equipmentData.value = []
materialsData.value = []
workstationData.value = []
getOptions()
dialogVisible.value = true dialogVisible.value = true
detailData.value = row detailData.value = row
dialogWidth.value = props.basicFormWidth + '%' dialogWidth.value = props.basicFormWidth + '%'
@ -175,21 +307,18 @@ const open = async (type: string, row?: any, titleName?: any) => {
queryParams.processrouteCode=row.processrouteCode queryParams.processrouteCode=row.processrouteCode
queryParams.batchCode=row.batchCode queryParams.batchCode=row.batchCode
// //
if (titleName) { if (titleName) {
dialogTitle.value = t('action.' + titleName) dialogTitle.value = t('action.' + titleName)
} else { } else {
dialogTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
} }
nextTick(() => { nextTick?.(() => {
graph.value = createGraph(graphContainer.value as HTMLElement, true, 240, 320) graph.value = createGraph(graphContainer.value as HTMLElement, true, 240, 320)
graph.value.on('node:click', ({ e, x, y, node, view }) => { graph.value.on('node:click', ({ e, x, y, node, view }) => {
nodeClick(e, x, y, node, view) nodeClick(e, x, y, node, view)
}) })
getProcessroute() getProcessroute()
getConfigProcessRouteNode() getConfigProcessRouteNode()
}) })
} }
const getTotalcounts=(a:any)=>{ const getTotalcounts=(a:any)=>{
@ -223,7 +352,6 @@ const getProcessBom=async (code:any) => {
queryParams.processCode=code queryParams.processCode=code
let res = await orderDayconfigApi.getOrderDayBomByOrder(queryParams) let res = await orderDayconfigApi.getOrderDayBomByOrder(queryParams)
materialsData.value=res materialsData.value=res
} }
//线 //线
const getProcessroute = async () => { const getProcessroute = async () => {
@ -242,30 +370,26 @@ const getConfigProcessRouteNode= async () => {
const getConfigProcessWorkstation= async (code:any) => { const getConfigProcessWorkstation= async (code:any) => {
queryParams.processCode=code queryParams.processCode=code
workstationData.value = await orderDayconfigApi.getConfigProcessWorkstation(queryParams) workstationData.value = await orderDayconfigApi.getConfigProcessWorkstation(queryParams)
} }
// //
const getConfigProcessWorker= async (code:any) => { const getConfigProcessWorker= async (code:any) => {
queryParams.processCode=code queryParams.processCode=code
workerData.value = await orderDayconfigApi.getConfigProcessWorker(queryParams) workerData.value = await orderDayconfigApi.getConfigProcessWorker(queryParams)
} }
// //
const getConfigProcessEquipment= async (code:any) => { const getConfigProcessEquipment= async (code:any) => {
queryParams.processCode=code queryParams.processCode=code
equipmentData.value = await orderDayconfigApi.getConfigProcessEquipment(queryParams) equipmentData.value = await orderDayconfigApi.getConfigProcessEquipment(queryParams)
} }
const nodeClick = (e, x, y, node, view) => { const nodeClick = (e, x, y, node, view) => {
getProcessBom(node.id) getProcessBom(node.id)
getConfigProcessWorkstation(node.id) getConfigProcessWorkstation(node.id)
getConfigProcessWorker(node.id) getConfigProcessWorker(node.id)
getConfigProcessEquipment(node.id) getConfigProcessEquipment(node.id)
//console.log('nodeClick',detailData.value) processCode.value = node.id
} }
const searchTableRef = ref() const searchTableRef = ref()
const opensearchTable = ( const opensearchTable = (
) => { ) => {
//console.log("opensearchTable") //console.log("opensearchTable")
@ -277,8 +401,8 @@ const opensearchTable = (
_searchTableTitle, _searchTableTitle,
_searchTableAllSchemas, _searchTableAllSchemas,
_searchTablePage, _searchTablePage,
undefined, 'process',
undefined, 'process',
true, true,
undefined, undefined,
undefined, undefined,
@ -312,32 +436,199 @@ const publishPlan= async ()=>{
await OrderDayApi.publishPlan(data) await OrderDayApi.publishPlan(data)
} }
// //
// val row
const searchTableSuccess = (formField, searchField, val, type, row) => { const searchTableSuccess = (formField, searchField, val, type, row) => {
//console.log("searchTableSuccess",val) nextTick?.(() => {
if(val.length>0){ if (val.length > 0) {
val.forEach(item=>{ val.forEach(item => {
if(processData.value.find(obj=>obj.code==item.code)==undefined){ if (formField === 'team') {
processData.value.push({code:item.code,name:item.name})} const { username, nickname, groupName, workerMonitor,code} = item;
}) const existingWorker = workerData.value.find(worker => worker.workerCode === username);
} if (!existingWorker) {
//emit('searchTableSuccess', formField, searchField, val, undefined, type, row) let obj={
} workerCode: username,
workerName: nickname,
groupName: groupName,
workerMonitor: workerMonitor,
groupCode: code,
planDayCode : detailData.value.planNoDay,
productCode : detailData.value.productCode,
planBatchCode : detailData.value.batchCode,
processCode : processCode.value,
planDayId : detailData.value.id
}
workerData.value.push(obj);
}
}
else if (formField === 'equipment'){
const { deviceCode, deviceName,deviceType, workroomCode, lineCode,deviceGroup} = item;
const existingWorker = equipmentData.value.find(equipment => equipment.equipmentCode === deviceCode);
if (!existingWorker) {
let obj={
equipmentCode: deviceCode,
equipmentName: deviceName,
equipmentType: deviceType,
equipmentGroup: deviceGroup,
equipmentWorkstation: '',
planDayCode : detailData.value.planNoDay,
productCode : detailData.value.productCode,
planBatchCode : detailData.value.batchCode,
processCode : processCode.value,
planDayId : detailData.value.id
}
equipmentData.value.push(obj);
}
}
else if (formField === 'process') {
const { code, name } = item;
const existingProcess = new Set(processData.value.map(e => e.code));
if (!existingProcess.has(code)) {
processData.value.push({ code, name });
}
}
});
}
dialogFormVisibleUser.value = false;
filterFormTeam.value = {
teamGroup: '',
teamName: ''
}
});
};
const deleteNode=(row)=>{ const deleteNode=(row)=>{
processData.value.splice(processData.value.indexOf(row),1) processData.value.splice(processData.value.indexOf(row),1)
graph.value.removeNode(row.code) graph.value.removeNode(row.code)
} }
defineOptions({ name: 'sechledDetail' }) /*点击查询,筛选班组数据*/
const searchTeamListCommon = async () =>{
if (filterFormTeam.value.teamGroup != ''){
teamParams.value.teamGroup = filterFormTeam.value.teamGroup
}
if (filterFormTeam.value.teamName != ''){
teamParams.value.name = filterFormTeam.value.teamName
}
teamParams.value.pageNo = currentPage.value
var teamList = await getTeamList(teamParams.value);
teamData.value = teamList.list
totalTeam.value = teamList.total
}
/*打开班组弹窗*/
const opensearchTableUser = async (
) => {
currentPage.value = 1
filterFormTeam.value ={
teamGroup: '',
teamName: ''
}
teamParams.value.teamGroup = ''
teamParams.value.name = ''
teamParams.value.pageNo = 1
var teamList = await getTeamList(teamParams.value)
teamData.value = teamList.list
totalTeam.value = teamList.total
dialogFormVisibleUser.value = true
}
/*通过班组,打开班组下的人员信息弹窗*/
const handleConfirm = (row)=>{
const _searchCondition = {}
const filters: any[] = []
filters.push({
action: "==",
column: 'available',
value: 'TRUE'
},{
action: "==",
column: 'code',
value: row.code
})
//
_searchCondition.isSearch = true
_searchCondition.filters = filters
searchTableRef.value.open(
'添加人员',//
searchUser.allSchemas,
TeamApi.geTeamUserByCode,
'team',
'team',
true,//
undefined,
undefined,
_searchCondition
)
}
/*选择设备弹窗*/
const opensearchTableEquipment = async (
) => {
const _searchCondition = {}
const filters: any[] = []
filters.push({
action: "==",
column: 'workroomCode',
value: detailData.value.workroomCode
},{
action: "==",
column: 'lineCode',
value: detailData.value.lineCode
})
//
// _searchCondition.isSearch = true
// _searchCondition.filters = filters
searchTableRef.value.open(
'添加设备',//
DeviceInfo.allSchemas,
orderDayconfigApi.getDeviceInfoPage,
'equipment',
'equipment',
true,//
undefined,
undefined,
_searchCondition
)
}
/*设备保存接口*/
const saveEquipment = async () =>{
await orderDayconfigApi.saveEquipment(equipmentData.value)
console.log(equipmentData.value)
message.success("设备配置成功!")
}
/*删除设备标签*/
const deleteEquipment=(row)=>{
equipmentData.value.splice(equipmentData.value.indexOf(row),1)
}
/*删除选择的班组人员*/
const deleteUser=(row)=>{
workerData.value.splice(workerData.value.indexOf(row),1)
}
/*班组人员保存接口*/
const saveUser = async () =>{
await orderDayconfigApi.saveWorker(workerData.value)
message.success("人员配置成功!")
}
/*分页查询班组信息*/
const getTeamList = async (params:any) => {
return TeamApi.getTeamPage(params)
}
defineOptions({ name: 'SechledDetail' })
defineExpose({ open }) // open defineExpose({ open }) // open
</script> </script>
<style lang="scss"> <style lang="scss">
.el-drawer__body { .el-drawer__body {
background: #f5f5f5 !important; background: #f5f5f5 !important;
} }
::v-deep(.label-class-name) { ::v-deep(.label-class-name) {
color: #dedede; color: #dedede;
} }
</style> </style>
<style scoped lang="scss"></style>

49
src/views/mes/orderDay/orderDay.data.ts

@ -360,3 +360,52 @@ export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
])) ]))
export const DeviceInfo = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '设备编码',
field: 'deviceCode',
sort: 'custom',
isSearch: true,
},
{
label: '设备名称',
field: 'deviceName',
sort: 'custom',
isSearch: true,
},
// {
// label: '设备类型',
// field: 'deviceType',
// sort: 'custom',
// isSearch: true,
// form: {
// component: 'SelectV2'
// },
// },
{
label: '所属车间',
field: 'workroomCode',
sort: 'custom',
isSearch: true,
},
{
label: '所属产线',
field: 'lineCode',
sort: 'custom',
isSearch: true,
},
// {
// label: '设备分组',
// field: 'deviceGroup',
// sort: 'custom',
// isSearch: true,
// },
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
]))

9
src/views/wms/basicDataManage/orderManage/team/team.data.ts

@ -41,6 +41,15 @@ export const Team = useCrudSchemas(reactive<CrudSchema[]>([
width: 120 width: 120
} }
}, },
{
label: '班组负责人',
field: 'teamMonitorName',
sort: 'custom',
isSearch: true,
table: {
width: 120
}
},
{ {
label: '班组类型', label: '班组类型',
field: 'teamGroup', field: 'teamGroup',

122
src/views/wms/basicDataManage/orderManage/team/teamForm.vue

@ -33,8 +33,11 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="是否可用" prop="available"> <el-form-item label="负责人" prop="teamMonitorName">
<el-switch v-model="formData.available" active-value="TRUE" inactive-value="FALSE" /> <div class="input-with-button">
<el-input v-model="formData.teamMonitorName" placeholder="请选择负责人" disabled :style="{ width: '35%' }"/>
<el-button :icon="Search" @click="addMonitor"/>
</div>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -105,9 +108,14 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="12">
<el-form-item label="是否可用" prop="available">
<el-switch v-model="formData.available" active-value="TRUE" inactive-value="FALSE" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" placeholder="请输入内容" type="textarea" /> <el-input v-model="formData.remark" placeholder="请输入内容" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -166,7 +174,9 @@ const formData = ref({
workshopCode:'', workshopCode:'',
workshopName:'', workshopName:'',
productionLineCode:'', productionLineCode:'',
productionLineName:'' productionLineName:'',
teamMonitorCode:'',
teamMonitorName:''
}) })
const formRules = reactive({ const formRules = reactive({
code: [ code: [
@ -184,6 +194,7 @@ const formRules = reactive({
teamGroup: [{ required: true, message: '班组类别不能为空', trigger: 'change' }], teamGroup: [{ required: true, message: '班组类别不能为空', trigger: 'change' }],
workshopCode: [{ required: true, message: '请选择车间代码', trigger: 'blur' },], workshopCode: [{ required: true, message: '请选择车间代码', trigger: 'blur' },],
productionLineCode: [{ required: true, message: '请选择产线代码', trigger: 'blur' },], productionLineCode: [{ required: true, message: '请选择产线代码', trigger: 'blur' },],
teamMonitorName: [{ required: true, message: '请选择负责人', trigger: 'blur' },],
}) })
const basicFormRef = ref() // Ref const basicFormRef = ref() // Ref
const handleClose = (username: string) => { const handleClose = (username: string) => {
@ -203,10 +214,19 @@ const _searchField = ref();
const _multiple = ref(); const _multiple = ref();
const _type = ref(); const _type = ref();
const _row = ref(); const _row = ref();
const _searchCondition = ref({})
/** 选择班组成员弹窗 */ const addMonitor = () =>{
const addUser = () => { addUserCommon(false,'monitor')
const _searchCondition = {} }
const addUser = () =>{
addUserCommon(true,'username')
}
/** 选择人员弹窗 */
const addUserCommon = (multiple,field) => {
_searchCondition.value = {}
const filters: any[] = [] const filters: any[] = []
filters.push({ filters.push({
action: "==", action: "==",
@ -214,31 +234,20 @@ const addUser = () => {
value: 'WORKER' value: 'WORKER'
}) })
// //
_searchCondition.isSearch = true _searchCondition.value.isSearch = true
_searchCondition.filters = filters _searchCondition.value.filters = filters
_searchTableTitle.value = '选择员' _searchTableTitle.value = '选择员'
_multiple.value = true _multiple.value = multiple
_formField.value = 'username' _formField.value = field
_searchField.value = 'username' _searchField.value = field
_searchTablePage.value = UserApi.getUserPage _searchTablePage.value = UserApi.getUserPage
_searchTableAllSchemas.value = searchUser.allSchemas _searchTableAllSchemas.value = searchUser.allSchemas
openCommon()
searchTableRef.value.open(
_searchTableTitle.value,
_searchTableAllSchemas.value,
_searchTablePage.value,
_formField.value,
_searchField.value,
_multiple.value,
_type,
_row,
_searchCondition
)
} }
/** 选择车间弹窗 */ /** 选择车间弹窗 */
const addWorkShop = () => { const addWorkShop = () => {
const _searchCondition = {} _searchCondition.value = {}
const filters: any[] = [] const filters: any[] = []
filters.push({ filters.push({
action: "==", action: "==",
@ -246,26 +255,15 @@ const addWorkShop = () => {
value: 'TRUE' value: 'TRUE'
}) })
// //
_searchCondition.isSearch = true _searchCondition.value.isSearch = true
_searchCondition.filters = filters _searchCondition.value.filters = filters
_searchTableTitle.value = '选择车间' _searchTableTitle.value = '选择车间'
_multiple.value = false _multiple.value = false
_formField.value = 'workshop' _formField.value = 'workshop'
_searchField.value = 'workshop' _searchField.value = 'workshop'
_searchTablePage.value = WorkshopApi.getWorkshopPage _searchTablePage.value = WorkshopApi.getWorkshopPage
_searchTableAllSchemas.value = Workshop.allSchemas _searchTableAllSchemas.value = Workshop.allSchemas
openCommon()
searchTableRef.value.open(
_searchTableTitle.value,
_searchTableAllSchemas.value,
_searchTablePage.value,
_formField.value,
_searchField.value,
_multiple.value,
_type,
_row,
_searchCondition
)
} }
/** 选择产线弹窗 */ /** 选择产线弹窗 */
@ -274,7 +272,7 @@ const addProductionLine = () => {
message.warning('请先选择车间代码'); message.warning('请先选择车间代码');
return return
} }
const _searchCondition = {} _searchCondition.value = {}
const filters: any[] = [] const filters: any[] = []
filters.push({ filters.push({
action: "==", action: "==",
@ -286,26 +284,15 @@ const addProductionLine = () => {
value: formData.value.workshopCode value: formData.value.workshopCode
}) })
// //
_searchCondition.isSearch = true _searchCondition.value.isSearch = true
_searchCondition.filters = filters _searchCondition.value.filters = filters
_searchTableTitle.value = '选择产线' _searchTableTitle.value = '选择产线'
_multiple.value = false _multiple.value = false
_formField.value = 'productionLine' _formField.value = 'productionLine'
_searchField.value = 'productionLine' _searchField.value = 'productionLine'
_searchTablePage.value = ProductionlineApi.getProductionlinePage _searchTablePage.value = ProductionlineApi.getProductionlinePage
_searchTableAllSchemas.value = Productionline.allSchemas _searchTableAllSchemas.value = Productionline.allSchemas
openCommon()
searchTableRef.value.open(
_searchTableTitle.value,
_searchTableAllSchemas.value,
_searchTablePage.value,
_formField.value,
_searchField.value,
_multiple.value,
_type,
_row,
_searchCondition
)
} }
/** 弹窗选择之后 回调函数 */ /** 弹窗选择之后 回调函数 */
@ -323,6 +310,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
formData.value.productionLineCode = val[0].code formData.value.productionLineCode = val[0].code
formData.value.productionLineName = val[0].name formData.value.productionLineName = val[0].name
} }
else if (formField === 'monitor'){
formData.value.teamMonitorCode = val[0].username
formData.value.teamMonitorName = val[0].nickname
}
else { else {
val.forEach(item => { val.forEach(item => {
const isExist = tags.value.some(tag => tag.username === item.username); const isExist = tags.value.some(tag => tag.username === item.username);
@ -338,7 +329,20 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
} }
}) })
} }
/*打开弹窗*/
const openCommon = () => {
searchTableRef.value.open(
_searchTableTitle.value,
_searchTableAllSchemas.value,
_searchTablePage.value,
_formField.value,
_searchField.value,
_multiple.value,
_type.value,
_row.value,
_searchCondition.value
)
}
/** 初始化弹窗 */ /** 初始化弹窗 */
const open = async (type: string, row?: object) => { const open = async (type: string, row?: object) => {
dialogVisible.value = true dialogVisible.value = true
@ -409,7 +413,9 @@ const resetForm = () => {
workshopCode:'', workshopCode:'',
workshopName:'', workshopName:'',
productionLineCode:'', productionLineCode:'',
productionLineName:'' productionLineName:'',
teamMonitorCode:'',
teamMonitorName:''
} }
basicFormRef.value?.resetFields() basicFormRef.value?.resetFields()
} }

Loading…
Cancel
Save