|
|
@ -1,10 +1,10 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<a-card :bordered="false"> |
|
|
|
<a-card :bordered="false"> |
|
|
|
<div class="table-operator"> |
|
|
|
<!-- <div class="table-operator">--> |
|
|
|
<a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button> |
|
|
|
<!-- <a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button>--> |
|
|
|
<!-- <a-button type="primary" @click="handleTableSave($event)">保存</a-button>--> |
|
|
|
<!-- <!– <a-button type="primary" @click="handleTableSave($event)">保存</a-button>–>--> |
|
|
|
<a-button type="primary" @click="fanHui()">返回</a-button> |
|
|
|
<!-- <a-button type="primary" @click="fanHui()">返回</a-button>--> |
|
|
|
</div> |
|
|
|
<!-- </div>--> |
|
|
|
|
|
|
|
|
|
|
|
<!-- table区域-begin --> |
|
|
|
<!-- table区域-begin --> |
|
|
|
<div> |
|
|
|
<div> |
|
|
@ -23,7 +23,18 @@ |
|
|
|
:dataSource="dataSource" |
|
|
|
:dataSource="dataSource" |
|
|
|
@valueChange="handleValueChange" |
|
|
|
@valueChange="handleValueChange" |
|
|
|
@save="handleTableSave" |
|
|
|
@save="handleTableSave" |
|
|
|
/> |
|
|
|
> |
|
|
|
|
|
|
|
<template v-slot:toolbarSuffix> |
|
|
|
|
|
|
|
<a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button> |
|
|
|
|
|
|
|
<a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button> |
|
|
|
|
|
|
|
<!-- <a-tooltip placement="top" title="获取值,忽略表单验证" :autoAdjustOverflow="true">--> |
|
|
|
|
|
|
|
<!-- <a-button @click="handleTableGet">获取值</a-button>--> |
|
|
|
|
|
|
|
<!-- </a-tooltip>--> |
|
|
|
|
|
|
|
<!-- <a-tooltip placement="top" title="模拟加载1000条数据" :autoAdjustOverflow="true">--> |
|
|
|
|
|
|
|
<!-- <a-button @click="handleTableSet">设置值</a-button>--> |
|
|
|
|
|
|
|
<!-- </a-tooltip>--> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</j-vxe-table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</a-card> |
|
|
|
</a-card> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -44,7 +55,7 @@ export default { |
|
|
|
return { |
|
|
|
return { |
|
|
|
toolbarConfig: { |
|
|
|
toolbarConfig: { |
|
|
|
// add 新增按钮;remove 删除按钮;clearSelection 清空选择按钮 |
|
|
|
// add 新增按钮;remove 删除按钮;clearSelection 清空选择按钮 |
|
|
|
btn: ['save'] |
|
|
|
btn: ['save',] |
|
|
|
}, |
|
|
|
}, |
|
|
|
description: '生产计划工序管理页面', |
|
|
|
description: '生产计划工序管理页面', |
|
|
|
loading: false, |
|
|
|
loading: false, |
|
|
@ -65,13 +76,20 @@ export default { |
|
|
|
dataSource: [], |
|
|
|
dataSource: [], |
|
|
|
// columns, |
|
|
|
// columns, |
|
|
|
columns: [ |
|
|
|
columns: [ |
|
|
|
{key: 'workOrderId', title: '工单编号', width: '180px'}, |
|
|
|
{key: 'workOrderId', title: '工单编号', width: '200px'}, |
|
|
|
{key: 'productName', title: '产品名称', width: '180px'}, |
|
|
|
// {key: 'productName', title: '产品名称', width: '120px'}, |
|
|
|
{key: 'departName', title: '车间名称', width: '180px'}, |
|
|
|
{key: 'departName', title: '车间名称', width: '120px'}, |
|
|
|
{key: 'processName', title: '工序名称', width: '180px'}, |
|
|
|
{key: 'processName', title: '工序名称', width: '120px'}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '工位列表', |
|
|
|
title: '工位ID', |
|
|
|
key: 'stationId', |
|
|
|
key: 'stationId', |
|
|
|
|
|
|
|
type: JVXETypes.hidden, |
|
|
|
|
|
|
|
// width: '200px', |
|
|
|
|
|
|
|
// options: [], |
|
|
|
|
|
|
|
// placeholder: '请选择${title}', |
|
|
|
|
|
|
|
},{ |
|
|
|
|
|
|
|
title: '工位名称', |
|
|
|
|
|
|
|
key: 'stationName', |
|
|
|
type: JVXETypes.select, |
|
|
|
type: JVXETypes.select, |
|
|
|
width: '200px', |
|
|
|
width: '200px', |
|
|
|
options: [], |
|
|
|
options: [], |
|
|
@ -92,42 +110,31 @@ export default { |
|
|
|
options: [], |
|
|
|
options: [], |
|
|
|
placeholder: '请选择${title}', |
|
|
|
placeholder: '请选择${title}', |
|
|
|
}, |
|
|
|
}, |
|
|
|
// { |
|
|
|
{key: 'proProcess', type: JVXETypes.hidden, title: '前导工序ID', width: '120px'}, |
|
|
|
// title: 'JPopup', |
|
|
|
|
|
|
|
// key: 'popup', |
|
|
|
|
|
|
|
// type: JVXETypes.popup, |
|
|
|
|
|
|
|
// width: '180px', |
|
|
|
|
|
|
|
// popupCode: 'demo', |
|
|
|
|
|
|
|
// field: 'name,sex,age', |
|
|
|
|
|
|
|
// orgFields: 'name,sex,age', |
|
|
|
|
|
|
|
// destFields: 'popup,popup_sex,popup_age' |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '前导工序', |
|
|
|
title: '前导工序', |
|
|
|
key: 'proProcess', |
|
|
|
key: 'proProcessName', |
|
|
|
type: JVXETypes.popup, |
|
|
|
type: JVXETypes.popup, |
|
|
|
width: '180px', |
|
|
|
width: '180px', |
|
|
|
popupCode: 'zy_process', |
|
|
|
popupCode: 'zy_process', |
|
|
|
field: 'id,process_code,process_name,process_describe', |
|
|
|
field: 'id,process_code,process_name,process_describe', |
|
|
|
orgFields: 'id,process_code,process_name,process_describe', |
|
|
|
// orgFields: 'id,process_code,process_name,process_describe', |
|
|
|
destFields: 'proProcess,process_code,process_name,process_describe', |
|
|
|
// destFields: 'proProcessName,process_code,process_name,process_describe', |
|
|
|
|
|
|
|
orgFields: 'process_name,id', |
|
|
|
|
|
|
|
destFields: 'proProcessName,proProcess', |
|
|
|
}, |
|
|
|
}, |
|
|
|
// { |
|
|
|
{key: 'postProcess', type: JVXETypes.hidden, title: '后导工序ID', width: '120px'}, |
|
|
|
// key: 'proProcess', |
|
|
|
|
|
|
|
// title: '前导工序', |
|
|
|
|
|
|
|
// dictCode: 'zy_process,process_name,id,id in(select process_id from zy_product_process where product_id="1")', |
|
|
|
|
|
|
|
// width: '150', |
|
|
|
|
|
|
|
// type: JVXETypes.select |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '后导工序', |
|
|
|
title: '后导工序', |
|
|
|
key: 'postProcess', |
|
|
|
key: 'postProcessName', |
|
|
|
type: JVXETypes.popup, |
|
|
|
type: JVXETypes.popup, |
|
|
|
width: '180px', |
|
|
|
width: '180px', |
|
|
|
popupCode: 'zy_process', |
|
|
|
popupCode: 'zy_process', |
|
|
|
field: 'id,process_code,process_name,process_describe', |
|
|
|
field: 'id,process_code,process_name,process_describe', |
|
|
|
orgFields: 'id,process_code,process_name,process_describe', |
|
|
|
// orgFields: 'id,process_code,process_name,process_describe', |
|
|
|
destFields: 'postProcess,process_code,process_name,process_describe', |
|
|
|
// destFields: 'proProcessName,process_code,process_name,process_describe', |
|
|
|
|
|
|
|
orgFields: 'process_name,id', |
|
|
|
|
|
|
|
destFields: 'postProcessName,postProcess', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{key: 'inputProduct', title: '输入产品', width: '150', type: JVXETypes.input}, |
|
|
|
{key: 'inputProduct', title: '输入产品', width: '150', type: JVXETypes.input}, |
|
|
|
{key: 'semiProduct', title: '成品/半成品', width: '150', type: JVXETypes.input}, |
|
|
|
{key: 'semiProduct', title: '成品/半成品', width: '150', type: JVXETypes.input}, |
|
|
@ -142,7 +149,8 @@ export default { |
|
|
|
planId: "", |
|
|
|
planId: "", |
|
|
|
dictOptions: {}, |
|
|
|
dictOptions: {}, |
|
|
|
superFieldList: [], |
|
|
|
superFieldList: [], |
|
|
|
stationList: [], |
|
|
|
stationId: [], |
|
|
|
|
|
|
|
stationIdList: [], |
|
|
|
toolsList: [], |
|
|
|
toolsList: [], |
|
|
|
machineList: [], |
|
|
|
machineList: [], |
|
|
|
clickTrue: true, |
|
|
|
clickTrue: true, |
|
|
@ -154,23 +162,17 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
// 【整体保存】点击保存按钮时触发的事件 |
|
|
|
// 【整体保存】点击保存按钮时触发的事件 |
|
|
|
handleTableSave({$table, target}) { |
|
|
|
handleTableSave({$table, target}) { |
|
|
|
console.log("保存开始-----") |
|
|
|
console.log("生产计划工序保存开始-----------------") |
|
|
|
// 校验整个表格 |
|
|
|
// 校验整个表格 |
|
|
|
$table.validate().then((errMap) => { |
|
|
|
$table.validate().then((errMap) => { |
|
|
|
// 校验通过 |
|
|
|
// 校验通过 |
|
|
|
if (!errMap) { |
|
|
|
if (!errMap) { |
|
|
|
// 获取所有数据 |
|
|
|
// 获取所有数据 |
|
|
|
let tableData = target.getTableData() |
|
|
|
let tableData = target.getTableData() |
|
|
|
tableData.forEach(item => { |
|
|
|
// tableData.forEach(item => { |
|
|
|
item.id = ''; |
|
|
|
// item.id = ''; |
|
|
|
}) |
|
|
|
// }) |
|
|
|
console.log('当前保存的数据是:', tableData) |
|
|
|
console.log('当前保存的数据是:', tableData) |
|
|
|
// // 获取新增的数据 |
|
|
|
|
|
|
|
// let newData = target.getNewData() |
|
|
|
|
|
|
|
// console.log('-- 新增的数据:', newData) |
|
|
|
|
|
|
|
// // 获取删除的数据 |
|
|
|
|
|
|
|
// let deleteData = target.getDeleteData() |
|
|
|
|
|
|
|
// console.log('-- 删除的数据:', deleteData) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 【模拟保存】 |
|
|
|
// 【模拟保存】 |
|
|
|
this.loading = true |
|
|
|
this.loading = true |
|
|
@ -219,7 +221,8 @@ export default { |
|
|
|
getAction(this.url.list, params).then((res) => { |
|
|
|
getAction(this.url.list, params).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
if (res.success) { |
|
|
|
this.dataSource = res.result.records || res.result; |
|
|
|
this.dataSource = res.result.records || res.result; |
|
|
|
this.stationList = this.dataSource[0].stationList; |
|
|
|
// this.stationId = this.dataSource[0].stationId; |
|
|
|
|
|
|
|
this.stationIdList = this.dataSource[0].stationIdList; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// this.stationIdCode = "station,station_name,id,depart_id in (select workshop_id from zy_product_plan where id='" + this.planId + "')"; |
|
|
|
// this.stationIdCode = "station,station_name,id,depart_id in (select workshop_id from zy_product_plan where id='" + this.planId + "')"; |
|
|
|
this.$message.warning(res.message) |
|
|
|
this.$message.warning(res.message) |
|
|
@ -248,15 +251,9 @@ export default { |
|
|
|
console.log("handleSelectRowChange") |
|
|
|
console.log("handleSelectRowChange") |
|
|
|
console.log("handleSelectRowChange-event:", event) |
|
|
|
console.log("handleSelectRowChange-event:", event) |
|
|
|
const {type, row, column, value, target, $table} = event |
|
|
|
const {type, row, column, value, target, $table} = event |
|
|
|
console.log(JSON.stringify(this.stationList)); |
|
|
|
console.log(JSON.stringify(this.stationIdList)); |
|
|
|
// target.$refs.vxe.columns[6].dictCode = this.stationIdCode; |
|
|
|
// target.$refs.vxe.columns[6].dictCode = this.stationIdCode; |
|
|
|
target.$refs.vxe.columns[6].options = this.stationList; |
|
|
|
target.$refs.vxe.columns[6].options = this.stationIdList; |
|
|
|
// 清空后两列的数据 |
|
|
|
|
|
|
|
// target.setValues([{ |
|
|
|
|
|
|
|
// rowKey: row.id, |
|
|
|
|
|
|
|
// values: {machineIds: '', toolsIds: ''} |
|
|
|
|
|
|
|
// }]) |
|
|
|
|
|
|
|
// target.$refs.vxe.columns[4].options = [] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
/** 当选项被改变时,联动其他组件 */ |
|
|
|
/** 当选项被改变时,联动其他组件 */ |
|
|
|
handleValueChange(event) { |
|
|
|
handleValueChange(event) { |
|
|
|