|
|
@ -17,83 +17,78 @@ |
|
|
|
width="200px" |
|
|
|
/> |
|
|
|
</ContentWrap> |
|
|
|
<div style="height: 480px; overflow-y: auto"> |
|
|
|
<el-tabs type="border-card" :active-name="activeName"> |
|
|
|
<el-tab-pane label="调整工艺路线" name="process"> |
|
|
|
<el-container> |
|
|
|
<el-aside> |
|
|
|
<el-card style="max-width: 480px"> |
|
|
|
<template #header> |
|
|
|
<div class="card-header"> |
|
|
|
<span>原有工序</span> |
|
|
|
</div> |
|
|
|
<ContentWrap> |
|
|
|
<el-container> |
|
|
|
<el-aside width="400px"> |
|
|
|
<el-card> |
|
|
|
<template #header> |
|
|
|
<div class="card-header"> |
|
|
|
<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 :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-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> |
|
|
|
</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="人员"> |
|
|
|
<template #default="scope"> |
|
|
|
<el-button size="mini" text @click="userAddNode(scope.row)" style="width: 100%" |
|
|
|
>{{ scope.row.name }}[{{ scope.row.code }}]</el-button |
|
|
|
> |
|
|
|
</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> |
|
|
|
|
|
|
|
<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-table-column> |
|
|
|
<el-table-column prop="code" label="工序编码" width="180" v-if="false" /> |
|
|
|
</el-table> |
|
|
|
</el-tab-pane> |
|
|
|
<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-tabs> |
|
|
|
</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"> |
|
|
|