|
@ -17,83 +17,78 @@ |
|
|
width="200px" |
|
|
width="200px" |
|
|
/> |
|
|
/> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
<div style="height: 480px; overflow-y: auto"> |
|
|
<ContentWrap> |
|
|
<el-tabs type="border-card" :active-name="activeName"> |
|
|
<el-container> |
|
|
<el-tab-pane label="调整工艺路线" name="process"> |
|
|
<el-aside width="400px"> |
|
|
<el-container> |
|
|
<el-card> |
|
|
<el-aside> |
|
|
<template #header> |
|
|
<el-card style="max-width: 480px"> |
|
|
<div class="card-header"> |
|
|
<template #header> |
|
|
<span>工艺路线</span> |
|
|
<div class="card-header"> |
|
|
<el-button |
|
|
<span>原有工序</span> |
|
|
type="text" |
|
|
</div> |
|
|
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> |
|
|
</template> |
|
|
<el-table :data="processData" ref="tableProcess" style="width: 100%; height: 80%"> |
|
|
</el-table-column> |
|
|
<el-table-column prop="name" label="工序名称"> |
|
|
</el-table> |
|
|
<template #default="scope"> |
|
|
</el-card> |
|
|
<el-button size="mini" text @click="userAddNode(scope.row)" style="width: 100%" |
|
|
</el-aside> |
|
|
>{{ scope.row.name }}[{{ scope.row.code }}]</el-button |
|
|
<el-main style="height: 480px;width: calc(100% - 900px);padding: 0px; margin:0px 20px"> |
|
|
> |
|
|
<div ref="graphContainer" ></div |
|
|
</template> |
|
|
></el-main> |
|
|
</el-table-column> |
|
|
<el-aside width="500px"> |
|
|
<el-table-column prop="code" label="工序编码" width="180" v-if="false" /> |
|
|
<el-tabs v-model="activeName"> |
|
|
</el-table> |
|
|
<el-tab-pane label="人员配置" name="process"> |
|
|
</el-card> |
|
|
<el-table :data="processData" ref="tableProcess" style="width: 100%; height: 80%"> |
|
|
</el-aside> |
|
|
<el-table-column prop="name" label="人员"> |
|
|
<el-main><div ref="graphContainer"></div></el-main> |
|
|
<template #default="scope"> |
|
|
<!-- <el-aside |
|
|
<el-button size="mini" text @click="userAddNode(scope.row)" style="width: 100%" |
|
|
><el-card style="max-width: 480px"> |
|
|
>{{ scope.row.name }}[{{ scope.row.code }}]</el-button |
|
|
<template #header> |
|
|
> |
|
|
<div class="card-header"> |
|
|
|
|
|
<span>可选工序</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
</template> |
|
|
</template> |
|
|
<p v-for="o in 4" :key="o" class="text item">{{ 'List item ' + o }}</p> |
|
|
</el-table-column> |
|
|
<template #footer>Footer content</template> |
|
|
<el-table-column prop="code" label="工序编码" width="180" v-if="false" /> |
|
|
</el-card></el-aside |
|
|
</el-table> |
|
|
> --> |
|
|
</el-tab-pane> |
|
|
</el-container> |
|
|
<el-tab-pane label="工作位置配置" name="ddddd"> |
|
|
</el-tab-pane> |
|
|
<el-table :data="processData" ref="tableProcess" style="width: 100%; height: 80%"> |
|
|
<el-tab-pane label="调整临时BOM" name="boms"> |
|
|
<el-table-column prop="name" label="工作位置"> |
|
|
<TableForm |
|
|
<template #default="scope"> |
|
|
ref="tableProcess" |
|
|
<el-button size="mini" text @click="userAddNode(scope.row)" style="width: 100%" |
|
|
:table-data="tableDataProcess" |
|
|
>{{ scope.row.name }}[{{ scope.row.code }}]</el-button |
|
|
:table-fields="tableColumnsProcess" |
|
|
> |
|
|
:loading="loading" |
|
|
</template> |
|
|
@handleAddTable="handleAddTable(tableDataProcess)" |
|
|
</el-table-column> |
|
|
@handle-delete-table="handleDeleteTable(item, index,tableDataProcess)" |
|
|
<el-table-column prop="code" label="工序编码" width="180" v-if="false" /> |
|
|
/> |
|
|
</el-table> |
|
|
</el-tab-pane> |
|
|
</el-tab-pane> |
|
|
|
|
|
</el-tabs> |
|
|
<el-tab-pane label="调整可用设备" name="device" |
|
|
</el-aside> |
|
|
><TableForm |
|
|
|
|
|
ref="tableProcess" |
|
|
</el-container> |
|
|
:table-data="tableDataProcess" |
|
|
</ContentWrap> |
|
|
: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> |
|
|
|
|
|
<template #footer> |
|
|
<template #footer> |
|
|
<el-button @click="dialogVisible = false">发布计划</el-button> |
|
|
<el-button @click="dialogVisible = false">发布计划</el-button> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> |
|
|
</Dialog> |
|
|
</Dialog> |
|
|
<!-- <SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> --> |
|
|
<!-- <SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> --> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script lang="ts" setup> |
|
|
<script lang="ts" setup> |
|
|
defineOptions({ name: 'sechledDetail' }) |
|
|
|
|
|
//import { dateFormatter } from '@/utils/formatTime' |
|
|
//import { dateFormatter } from '@/utils/formatTime' |
|
|
import { |
|
|
import { |
|
|
start_node, |
|
|
start_node, |
|
@ -102,6 +97,9 @@ import { |
|
|
getNewNode |
|
|
getNewNode |
|
|
} from '@/views/mes/processroute/components/graphbase.data' |
|
|
} from '@/views/mes/processroute/components/graphbase.data' |
|
|
import * as ProcessrouteApi from '@/api/mes/processroute' |
|
|
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' |
|
|
import { Graph } from '@antv/x6' |
|
|
const graphContainer = ref<HTMLElement | null>(null) |
|
|
const graphContainer = ref<HTMLElement | null>(null) |
|
|
const graph = ref<Graph>() |
|
|
const graph = ref<Graph>() |
|
@ -109,7 +107,7 @@ 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 processData=ref() |
|
|
const processData = ref([]) |
|
|
const props = defineProps({ |
|
|
const props = defineProps({ |
|
|
// 查询弹窗是否显示筛选按钮 |
|
|
// 查询弹窗是否显示筛选按钮 |
|
|
isSearchFilterButtonHide: { |
|
|
isSearchFilterButtonHide: { |
|
@ -131,54 +129,6 @@ const props = defineProps({ |
|
|
const detailData = ref(props.allSchemas) |
|
|
const detailData = ref(props.allSchemas) |
|
|
const route = useRoute() // 路由信息 |
|
|
const route = useRoute() // 路由信息 |
|
|
const routeName = ref() |
|
|
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 = route.name |
|
|
routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail' |
|
|
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 |
|
|
dialogVisible.value = true |
|
|
detailData.value = row |
|
|
detailData.value = row |
|
|
dialogWidth.value = props.basicFormWidth + '%' |
|
|
dialogWidth.value = props.basicFormWidth + '%' |
|
|
//console.log(props.allSchemas) |
|
|
//获取配置的 |
|
|
//console.log(row) |
|
|
getProcessroute('001') |
|
|
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, 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 }) => { |
|
|
// graph.value.on('node:click', ({ e, x, y, node, view }) => { |
|
|
// nodeClick(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 方法,用于打开弹窗 |
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
</script> |
|
|
</script> |
|
|
<style lang="scss"> |
|
|
<style lang="scss"> |
|
|