Browse Source

2024-04-10 生产日计划 模版数据,工艺路线bug修复

master_hella_20240701
zhousq 8 months ago
parent
commit
94cc78a241
  1. 38
      src/views/mes/orderDay/components/orderDetail.vue
  2. 28
      src/views/mes/orderDay/components/processSearch.data.ts
  3. 210
      src/views/mes/orderDay/components/schedule.vue
  4. 22
      src/views/mes/orderDay/index.vue
  5. 84
      src/views/mes/orderDay/orderDay.data.ts
  6. 49
      src/views/mes/processroute/components/configDialog.vue
  7. 12
      src/views/mes/processroute/processroute.data.ts

38
src/views/mes/orderDay/components/orderDetail.vue

@ -25,8 +25,8 @@
/>
</ContentWrap>
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane label="工艺路线信息" name="processRouteInfo">
<el-tabs v-model="activeName" type="card" @tab-click="handleClick" style="margin-top: 5px;height: min-height:240px;">
<el-tab-pane label="工艺信息" name="processInfo">
<div class="mt-20px">
<el-space :size="10" spacer="|">
<span>名称<el-tag v-if="processRouteInfoSchema.processrouteInfo!=null">{{ processRouteInfoSchema.processrouteInfo.processName}} </el-tag></span>
@ -44,7 +44,6 @@
>
<el-table-column prop="nodeSort" label="序号" align="center"/>
<el-table-column prop="preCode" label="前置工序" align="center">
<template #default="scope">
<div style="display: flex; align-items: center">
<el-tag
@ -88,35 +87,6 @@
<el-table-column prop="version" label="版本" align="center" />
</el-table> </div
></el-tab-pane>
<el-tab-pane label="班组人员信息" name="workTeamInfo"
><div class="mt-20px">
<el-table
ref="tableRoute"
:data="workTeamInfoSchema"
style="width: 100%"
>
<el-table-column prop="id" label="ID" align="center" />
<el-table-column prop="userName" label="人员工号" align="center" />
<el-table-column prop="nickeName" label="显示名称" align="center" />
<el-table-column prop="workGroup" label="所属班组" align="center" />
<el-table-column prop="lineCode" label="所属产线" align="center" />
<el-table-column prop="abliity" label="技能岗位" align="center" />
</el-table> </div
></el-tab-pane>
<el-tab-pane label="设备信息" name="deviceInfo"
><div class="mt-20px">
<el-table
ref="tableRoute"
:data="deviceInfoSchema"
style="width: 100%"
>
<el-table-column prop="productItemCode" label="设备编码" align="center" />
<el-table-column prop="componentItemCode" label="设备名称" align="center" />
<el-table-column prop="componentUom" label="所属车间" align="center" />
<el-table-column prop="componentQty" label="所属产线" align="center"/>
<el-table-column prop="status" label="设备状态" align="center" />
</el-table> </div
></el-tab-pane>
</el-tabs>
</el-drawer>
</div>
@ -146,13 +116,11 @@ const detailData = ref(props.allSchemas)
componentUom:'----',
componentQty:'----',
version:'----'}])
const workTeamInfoSchema = ref( [] )
const deviceInfoSchema = ref([])
const processRouteInfoSchema = ref({
processrouteInfo: { processrouteCode: '', processName: '', routeVersion: '' },
processrouteNodeDetailList: []
})
const isShowDrawer = ref(false)
const detailLoading = ref(false)
const nodeColumns = ref([

28
src/views/mes/orderDay/components/processSearch.data.ts

@ -0,0 +1,28 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
export const ProcessSearch = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '代码',
field: 'code',
sort: 'custom',
isSearch: true,
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '类型',
field: 'type',
dictType: DICT_TYPE.PROCESS_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
},
]))

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

@ -17,19 +17,42 @@
width="200px"
/>
</ContentWrap>
<div style="height: 480px; overflow-y: auto">
<el-tabs type="border-card" :active-name="activeName">
<el-tab-pane label="调整工艺路线" name="process">
<ContentWrap>
<el-container>
<el-aside>
<el-card style="max-width: 480px">
<el-aside width="400px">
<el-card>
<template #header>
<div class="card-header">
<span>原有工序</span>
<span>工艺路线</span>
<el-button
type="text"
icon="el-icon-plus"
@click="opensearchTable"
style="float: right; padding: 3px 0"
>添加工序</el-button>
</div>
</template>
<el-table :data="processData" ref="tableProcess" style="width: 100%; height: 80%" @cell-dblclick="userAddNode">
<el-table-column prop="code" label="工序编码" />
<el-table-column prop="name" label="工序名称" />
<el-table-column prop="oper" label="" width="60">
<template #default="scope">
<el-button size="mini" text @click="deleteNode(scope.row)"
>移除</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
</el-aside>
<el-main style="height: 480px;width: calc(100% - 900px);padding: 0px; margin:0px 20px">
<div ref="graphContainer" ></div
></el-main>
<el-aside width="500px">
<el-tabs v-model="activeName">
<el-tab-pane label="人员配置" name="process">
<el-table :data="processData" ref="tableProcess" style="width: 100%; height: 80%">
<el-table-column prop="name" label="工序名称">
<el-table-column prop="name" label="人员">
<template #default="scope">
<el-button size="mini" text @click="userAddNode(scope.row)" style="width: 100%"
>{{ scope.row.name }}[{{ scope.row.code }}]</el-button
@ -38,62 +61,34 @@
</el-table-column>
<el-table-column prop="code" label="工序编码" width="180" v-if="false" />
</el-table>
</el-card>
</el-aside>
<el-main><div ref="graphContainer"></div></el-main>
<!-- <el-aside
><el-card style="max-width: 480px">
<template #header>
<div class="card-header">
<span>可选工序</span>
</div>
</template>
<p v-for="o in 4" :key="o" class="text item">{{ 'List item ' + o }}</p>
<template #footer>Footer content</template>
</el-card></el-aside
> -->
</el-container>
</el-tab-pane>
<el-tab-pane label="调整临时BOM" name="boms">
<TableForm
ref="tableProcess"
:table-data="tableDataProcess"
:table-fields="tableColumnsProcess"
:loading="loading"
@handleAddTable="handleAddTable(tableDataProcess)"
@handle-delete-table="handleDeleteTable(item, index,tableDataProcess)"
/>
<el-tab-pane label="工作位置配置" name="ddddd">
<el-table :data="processData" ref="tableProcess" style="width: 100%; height: 80%">
<el-table-column prop="name" label="工作位置">
<template #default="scope">
<el-button size="mini" text @click="userAddNode(scope.row)" style="width: 100%"
>{{ scope.row.name }}[{{ scope.row.code }}]</el-button
>
</template>
</el-table-column>
<el-table-column prop="code" label="工序编码" width="180" v-if="false" />
</el-table>
</el-tab-pane>
<el-tab-pane label="调整可用设备" name="device"
><TableForm
ref="tableProcess"
:table-data="tableDataProcess"
:table-fields="tableColumnsProcess"
:loading="loading"
@handleAddTable="handleAddTable(tableDataProcess)"
@handle-delete-table="handleDeleteTable(item, index,tableDataProcess)"
/></el-tab-pane>
<el-tab-pane label="调整班组人员" name="worker"
><TableForm
ref="tableProcess"
:table-data="tableDataProcess"
:table-fields="tableColumnsProcess"
:loading="loading"
@handleAddTable="handleAddTable(tableDataProcess)"
@handle-delete-table="handleDeleteTable(item, index,tableDataProcess)"
/></el-tab-pane>
</el-tabs>
</div>
</el-aside>
</el-container>
</ContentWrap>
<template #footer>
<el-button @click="dialogVisible = false">发布计划</el-button>
</template>
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" />
</Dialog>
<!-- <SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> -->
</template>
<script lang="ts" setup>
defineOptions({ name: 'sechledDetail' })
//import { dateFormatter } from '@/utils/formatTime'
import {
start_node,
@ -102,6 +97,9 @@ import {
getNewNode
} from '@/views/mes/processroute/components/graphbase.data'
import * as ProcessrouteApi from '@/api/mes/processroute'
import {ProcessSearch} from './processSearch.data'
import * as ProcessApi from '@/api/wms/process'
import { SearchTable } from '@/components/SearchTable'
import { Graph } from '@antv/x6'
const graphContainer = ref<HTMLElement | null>(null)
const graph = ref<Graph>()
@ -109,7 +107,7 @@ const message = useMessage() // 消息弹窗
const { t } = useI18n() //
const activeName = ref('process')
const loading = ref(true)
const processData=ref()
const processData = ref([])
const props = defineProps({
//
isSearchFilterButtonHide: {
@ -131,54 +129,6 @@ const props = defineProps({
const detailData = ref(props.allSchemas)
const route = useRoute() //
const routeName = ref()
const tableDataProcess = ref([
{
type: '',
value: ''
}
])
const tableColumnsProcess = ref([
{
label: '结束时间',
field: 'endTime',
sort: 'custom',
isReadonly: true,
form: {
component: 'TimePicker',
componentProps: {
type: 'time',
dateFormat: 'HH:mm'
}
}
},
{
label: '生产模式',
field: 'taskMode',
width: '80px',
sort: 'custom',
dictType: 'mes_task_mode',
dictClass: 'string',
form: {
component: 'Select',
value: 'ASSIGN'
}
}
])
//
const handleAddTable = (name:any) => {
message.success('添加成功')
let tableFormKeys = {
type: '',
value: ''
}
name.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index,name) => {
console.log(name)
name.splice(index, 1)
}
routeName.value = route.name
routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail'
@ -279,15 +229,15 @@ const open = async (type: string, row?: any, titleName?: any) => {
dialogVisible.value = true
detailData.value = row
dialogWidth.value = props.basicFormWidth + '%'
//console.log(props.allSchemas)
//console.log(row)
//
getProcessroute('001')
if (titleName) {
dialogTitle.value = t('action.' + titleName)
} else {
dialogTitle.value = t('action.' + type)
}
nextTick(() => {
graph.value = createGraph(graphContainer.value as HTMLElement, false, dialogWidth.value-200, 320)
graph.value = createGraph(graphContainer.value as HTMLElement, true, 240, 320)
// graph.value.on('node:click', ({ e, x, y, node, view }) => {
// nodeClick(e, x, y, node, view)
// })
@ -318,6 +268,58 @@ const userAddNode = (row) => {
}
}
}
//线
const getProcessroute = async (code: String) => {
let res = await ProcessrouteApi.getProcesInfo(code)
if (res.code == 200) {
processData.value = res.data
}
}
const searchTableRef = ref()
const opensearchTable = (
) => {
console.log("opensearchTable")
const _searchCondition = {}
const _searchTableTitle = "工序查询"
const _searchTableAllSchemas = ProcessSearch.allSchemas
const _searchTablePage = ProcessApi.getProcessPage
searchTableRef.value.open(
_searchTableTitle,
_searchTableAllSchemas,
_searchTablePage,
undefined,
undefined,
true,
undefined,
undefined,
_searchCondition,
false,
true
)
}
//
// val row
const searchTableSuccess = (formField, searchField, val, type, row) => {
//console.log("searchTableSuccess",val)
if(val.length>0){
val.forEach(item=>{
if(processData.value.find(obj=>obj.code==item.code)==undefined){
processData.value.push({code:item.code,name:item.name})}
})
}
//emit('searchTableSuccess', formField, searchField, val, undefined, type, row)
}
const deleteNode=(row)=>{
processData.value.splice(processData.value.indexOf(row),1)
graph.value.removeNode(row.code)
}
defineOptions({ name: 'sechledDetail' })
defineExpose({ open }) // open
</script>
<style lang="scss">

22
src/views/mes/orderDay/index.vue

@ -56,6 +56,7 @@
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
:isSearchFilterButtonHide="true"
@onChange="valueChange"
/>
<!-- 详情 -->
@ -80,6 +81,7 @@ import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import orderDetail from './components/orderDetail.vue'
import scheduleDetail from './components/schedule.vue'
import { disabledTimeListsProps } from 'node_modules/element-plus/es/components/time-picker/src/props/shared'
defineOptions({ name: 'MesOrderDay' })
const message = useMessage() //
@ -137,6 +139,20 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
})
}
const valueChange=(filed,cur)=>{
if(filed=='noAutoFlag'){
OrderDay.allSchemas.formSchema.forEach(item => {
if (item.field == 'planNoDay') {
item.componentProps.disabled = cur==='ENABLE'?true:false
//console.log("item",OrderDayRules)
OrderDayRules.planNoDay[0].required = cur==='ENABLE'?false:true
//item.componentProps.required = cur==='ENABLE'?false:true
}
})
}
}
//
@ -193,13 +209,13 @@ const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hide: isShowMainButton(row,['1']),hasPermi:'mes:orderDay:update'}), //
defaultButtons.mainListDeleteBtn({ hide: isShowMainButton(row,['1']),hasPermi:'mes:orderDay:delete'}), //
defaultButtons.mainListHandleBtn({label: '发布',
defaultButtons.mainListHandleBtn({label: '排产',
name: 'publish',
hide: isShowMainButton(row,['1']),
type: 'warning',
icon: '',
color: '',
hasPermi: ''}), //
hasPermi: 'mes:orderDay:update'}), //
// defaultButtons.mainListHandleBtn({label: '',
// name: 'publish',
// hide: isShowMainButton(row,['2']),
@ -224,7 +240,7 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if(val=='schedule'){ //
} else if(val=='publish'){ //
openScheduledDetail( '发布计划', row,row.planNoDay)
}
}

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

@ -4,13 +4,13 @@ import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import { on } from '@/utils/domUtils'
// 表单校验
export const OrderDayRules = reactive({
planNoDay: [
{ required: true, message: '请输入一个日计划编号', trigger: 'blur' }
],
// planNoDay: [
// { required: false, message: '请输入一个日计划编号', trigger: 'blur' }
// ],
planNoMonth: [
{ required: true, message: '请输入一个月计划编号', trigger: 'blur' }
],
@ -38,6 +38,9 @@ export const OrderDayRules = reactive({
taskMode: [
{ required: true, message: '请选择一个生产方式', trigger: 'blur' }
],
processrouteCode: [
{ required: true, message: '请选择一个工艺路线!', trigger: 'blur' }
],
})
export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
@ -53,7 +56,34 @@ export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
field: 'planNoDay',
sort: 'custom',
isSearch: true,
required: true,
required: false,
form: {
component: 'Input',
componentProps: {
disabled: true
}
},
},
{
label: '',
field: 'noAutoFlag',
sort: 'custom',
isForm: true,
isTable: false,
isDetail:false,
isSearch: false,
width: '60px',
dictType: DICT_TYPE.ITEM_STATUS,
dictClass: 'string',
form: {
component: 'Switch',
value: 'ENABLE',
componentProps: {
inactiveValue: 'DISABLE',
activeValue: 'ENABLE'
}
},
},
{
label: '月计划单号',
@ -102,7 +132,7 @@ export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
key: 'type',
action: 'in', // 查询拼接条件
isSearch: true, // 使用自定义拼接条件
value: 'FG,SEMI',//,SEMI]
value: 'CCP,BCP',//,SEMI]
isMainValue: false
},
@ -169,7 +199,7 @@ export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
}
},
{
label: '临时工艺',
label: '允许临时工艺',
field: 'tempProcessroute',
sort: 'custom',
width: '80px',
@ -185,32 +215,30 @@ export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
},
},
{
label: 'BOM编码',
label: 'BOM版本',
field: 'standardBom',
sort: 'custom',
form: {
component:'Select',
componentProps: {
options: [{lablel:'bom',value:'bom'}]
}
}
component: 'InputNumber',
value: 1
},
{
label: '替代BOM',
field: 'tempBom',
sort: 'custom',
width: '80px',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
}
}
},
// {
// label: '替代BOM',
// field: 'tempBom',
// sort: 'custom',
// width: '80px',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string',
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE',
// }
// }
// },
{
label: '工单模式',
field: 'workMode',

49
src/views/mes/processroute/components/configDialog.vue

@ -24,7 +24,7 @@
</div>
</template>
<el-row :gutter="10" style="height: calc(100vh - 300px)">
<el-row :gutter="10" style="height: 65%">
<el-col :span="6">
<el-input v-model="processListParmas.name" placeholder="工序名称">
<template #append>
@ -32,10 +32,10 @@
</template>
</el-input>
<el-table :data="processData" ref="tableProcess" style="width: 100%; height: 80%">
<el-table :data="processData" ref="tableProcess" style="width: 100%; height: 90%">
<el-table-column prop="name" label="工序名称">
<template #default="scope">
<el-button size="mini" text @click="userAddNode(scope.row)" style="width: 100%"
<el-button size="mini" text @click="userAddNode(scope.row)" style="width: 90%"
>{{ scope.row.name }}[{{ scope.row.code }}]</el-button
>
</template>
@ -43,7 +43,7 @@
<el-table-column prop="code" label="工序编码" width="180" v-if="false" />
</el-table>
</el-col>
<el-col :span="12"><div ref="graphContainer"></div>
<el-col :span="12"><div ref="graphContainer" style="width: 90%; height: 90%"></div>
</el-col>
<el-col :span="6">
@ -71,9 +71,11 @@
<el-card class="footer-card">
<template #header>
<div class="card-header">
<span>产品信息</span>
<span>工艺路线基本信息</span>
</div>
</template>
<p >工艺路线名称<span v-if="productData!=null">{{ productData.name }}</span></p>
<p >工艺路线编码<span v-if="productData!=null">{{ productData.name }}</span></p>
<p >产品名称<span v-if="productData!=null">{{ productData.name }}</span></p>
<p>产品编码<span v-if="productData!=null">{{ productData.code }}</span></p>
<p>产品描述<span v-if="productData!=null">{{ productData.desc1 }}</span></p>
@ -83,20 +85,28 @@
><el-card class="footer-card">
<template #header>
<div class="card-header">
<span>设备信息</span>
<span>物料信息</span>
</div>
</template>
<p v-for="item in deviceList" :key="item" class="text item">{{ item.name }}</p>
<el-table :data="materialData" ref="tableMaterial" style="width: 100%; height: 80%">
<el-table-column prop="name" label="物料名称"/>
=
<el-table-column prop="code" label="物料编码"/>
<el-table-column prop="desc1" label="是否替代"/>
</el-table>
</el-card></el-col
>
<el-col :span="6"
><el-card class="footer-card">
<template #header>
<div class="card-header">
<span>人员信息</span>
<span>模具信息</span>
</div>
</template>
<p v-for="item in workerList" :key="item" class="text item">{{ item.name }}</p>
<el-table :data="mouldData" ref="tableMould" style="width: 100%; height: 80%">
<el-table-column prop="name" label="模具名称"/>
<el-table-column prop="code" label="模具编码"/>
</el-table>
</el-card></el-col
>
<el-col :span="6"
@ -106,8 +116,10 @@
<span>工位信息</span>
</div>
</template>
<p>工位编码{{ workStationData.name }}</p>
<p>工位名称{{ workStationData.code }}</p>
<el-table :data="workstationData" ref="tableWorkstation" style="width: 100%; height: 80%">
<el-table-column prop="name" label="工位名称"/>
<el-table-column prop="code" label="工位编码"/>
</el-table>
</el-card></el-col
>
</el-row>
@ -142,13 +154,9 @@ const tableProcess = ref()
// const workshopCodeOptions = ref([{ code: '', name: '1' }])
// const productionLineCodeOptions = ref([{ code: '', name: '线' }])
const productData = ref({ name: '', code: '', desc1: '--' }) //
const deviceList = ref([
{ name: '设备', code: '0000' },
{ name: '设备', code: '0000' }
]) //
const workerList = ref([{ name: '--' }, { name: '--' }]) //
const workStationData = ref({ name: '工位', code: '' }) //
const materialData=ref()
const mouldData = ref()
const workstationData = ref() //
//
const annexData = reactive({
annexList: []
@ -158,6 +166,7 @@ const remarksData = reactive({
remarksList: [],
data: {}
})
const routeVersion=ref()
//
const graph = ref<Graph>()
const openDetail = async (rowData: any) => {
@ -165,6 +174,7 @@ const openDetail = async (rowData: any) => {
titleNameRef.value = rowData.value.processrouteCode
titleValueRef.value = rowData.value.processName
processRouteId.value = rowData.value.id
routeVersion.value=rowData.value.routeVersion
remarksData.data = {
tableId: rowData.value.id,
tableName: rowData.value.processrouteCode
@ -173,7 +183,7 @@ const openDetail = async (rowData: any) => {
let graphJson = JSON.parse(rowData.value.graphJson)
isShowDrawer.value = true
nextTick(() => {
graph.value = createGraph(graphContainer.value as HTMLElement,true,800,600)
graph.value = createGraph(graphContainer.value as HTMLElement,true,640,480)
graph.value.on('node:click', ({ e, x, y, node, view }) => {
nodeClick(e, x, y, node, view)
})
@ -300,6 +310,7 @@ const saveResult = async () => {
}
let gdata = {
processrouteCode: titleNameRef.value,
routeVersion:routeVersion.value,
graphJson: graph.value.toJSON(),
processrouteId: processRouteId.value
}

12
src/views/mes/processroute/processroute.data.ts

@ -93,12 +93,12 @@ export const Processroute = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '版本号',
field: 'routeVersion',
sort: 'custom',
isSearch: true,
},
// {
// label: '版本号',
// field: 'routeVersion',
// sort: 'custom',
// isSearch: true,
// },
{
label: '创建时间',
field: 'createTime',

Loading…
Cancel
Save