|
|
|
@ -1,32 +1,32 @@ |
|
|
|
|
<template> |
|
|
|
|
<a-card :bordered="false"> |
|
|
|
|
<p style="font-size: 30px;color:#333; padding-left: 30% ">{{ planInfo.productCode }}工单生产计划管理</p> |
|
|
|
|
<template> |
|
|
|
|
<div> |
|
|
|
|
<el-descriptions border :column='4'> |
|
|
|
|
<el-descriptions-item label="工单编号 ">{{ planInfo.productCode }}</el-descriptions-item> |
|
|
|
|
<el-descriptions-item label="生产企业">{{ planInfo.productOrg }}</el-descriptions-item> |
|
|
|
|
<!-- <el-descriptions-item label="企业负责人 ">admin</el-descriptions-item>--> |
|
|
|
|
<el-descriptions-item label="车间 ">{{ planInfo.workshop }}</el-descriptions-item> |
|
|
|
|
<!-- <el-descriptions-item label="车间负责人 ">admin</el-descriptions-item>--> |
|
|
|
|
<el-descriptions-item label="班组">{{ planInfo.team }}</el-descriptions-item> |
|
|
|
|
<el-descriptions-item label="班组长">{{ planInfo.teamLade }}</el-descriptions-item> |
|
|
|
|
<el-descriptions-item label="产品类型">{{ planInfo.productType }}</el-descriptions-item> |
|
|
|
|
<el-descriptions-item label="产品编号">{{ planInfo.productNo }}</el-descriptions-item> |
|
|
|
|
<el-descriptions-item label="产品名称">{{ planInfo.productName }}</el-descriptions-item> |
|
|
|
|
<el-descriptions-item label="开始时间">{{ planInfo.workTime }}</el-descriptions-item> |
|
|
|
|
<el-descriptions-item label="生产时长">{{ planInfo.duration }}</el-descriptions-item> |
|
|
|
|
<el-descriptions-item label="生产状态">{{ planInfo.status }}</el-descriptions-item> |
|
|
|
|
<el-descriptions-item label="加急">{{ planInfo.speedUp }}</el-descriptions-item> |
|
|
|
|
<el-descriptions-item label="销售企业">{{ planInfo.salesEnterprise }}</el-descriptions-item> |
|
|
|
|
<el-descriptions-item label="订货期">{{ planInfo.orderTime }}</el-descriptions-item> |
|
|
|
|
<!-- <el-descriptions-item label="制定人">100</el-descriptions-item>--> |
|
|
|
|
<!-- <el-descriptions-item label="制定时间">100</el-descriptions-item>--> |
|
|
|
|
<el-descriptions-item label="审核人">{{ planInfo.auditBy }}</el-descriptions-item> |
|
|
|
|
<el-descriptions-item label="审核时间">{{ planInfo.auditTimr }}</el-descriptions-item> |
|
|
|
|
</el-descriptions> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<p style="font-size: 30px;color:#333; padding-left: 30% ">{{ this.workshopName + this.code }}吊挂管理</p> |
|
|
|
|
<!-- <template>--> |
|
|
|
|
<!-- <div>--> |
|
|
|
|
<!-- <el-descriptions border :column='4'>--> |
|
|
|
|
<!-- <el-descriptions-item label="工单编号 ">{{ planInfo.productCode }}</el-descriptions-item>--> |
|
|
|
|
<!-- <el-descriptions-item label="生产企业">{{ planInfo.productOrg }}</el-descriptions-item>--> |
|
|
|
|
<!-- <!– <el-descriptions-item label="企业负责人 ">admin</el-descriptions-item>–>--> |
|
|
|
|
<!-- <el-descriptions-item label="车间 ">{{ planInfo.workshop }}</el-descriptions-item>--> |
|
|
|
|
<!-- <!– <el-descriptions-item label="车间负责人 ">admin</el-descriptions-item>–>--> |
|
|
|
|
<!-- <el-descriptions-item label="班组">{{ planInfo.team }}</el-descriptions-item>--> |
|
|
|
|
<!-- <el-descriptions-item label="班组长">{{ planInfo.teamLade }}</el-descriptions-item>--> |
|
|
|
|
<!-- <el-descriptions-item label="产品类型">{{ planInfo.productType }}</el-descriptions-item>--> |
|
|
|
|
<!-- <el-descriptions-item label="产品编号">{{ planInfo.productNo }}</el-descriptions-item>--> |
|
|
|
|
<!-- <el-descriptions-item label="产品名称">{{ planInfo.productName }}</el-descriptions-item>--> |
|
|
|
|
<!-- <el-descriptions-item label="开始时间">{{ planInfo.workTime }}</el-descriptions-item>--> |
|
|
|
|
<!-- <el-descriptions-item label="生产时长">{{ planInfo.duration }}</el-descriptions-item>--> |
|
|
|
|
<!-- <el-descriptions-item label="生产状态">{{ planInfo.status }}</el-descriptions-item>--> |
|
|
|
|
<!-- <el-descriptions-item label="加急">{{ planInfo.speedUp }}</el-descriptions-item>--> |
|
|
|
|
<!-- <el-descriptions-item label="销售企业">{{ planInfo.salesEnterprise }}</el-descriptions-item>--> |
|
|
|
|
<!-- <el-descriptions-item label="订货期">{{ planInfo.orderTime }}</el-descriptions-item>--> |
|
|
|
|
<!-- <!– <el-descriptions-item label="制定人">100</el-descriptions-item>–>--> |
|
|
|
|
<!-- <!– <el-descriptions-item label="制定时间">100</el-descriptions-item>–>--> |
|
|
|
|
<!-- <el-descriptions-item label="审核人">{{ planInfo.auditBy }}</el-descriptions-item>--> |
|
|
|
|
<!-- <el-descriptions-item label="审核时间">{{ planInfo.auditTimr }}</el-descriptions-item>--> |
|
|
|
|
<!-- </el-descriptions>--> |
|
|
|
|
<!-- </div>--> |
|
|
|
|
<!-- </template>--> |
|
|
|
|
|
|
|
|
|
<!-- table区域-begin --> |
|
|
|
|
<div> |
|
|
|
@ -37,37 +37,33 @@ |
|
|
|
|
row-number |
|
|
|
|
row-selection |
|
|
|
|
keep-source |
|
|
|
|
:rowSelection="clickTrue" |
|
|
|
|
:clickSelectRow="clickTrue" |
|
|
|
|
:loading="loading" |
|
|
|
|
:columns="columns" |
|
|
|
|
@selectRowChange="handleSelectRowChange" |
|
|
|
|
:dataSource="dataSource" |
|
|
|
|
@selectRowChange="handleSelectRowChange" |
|
|
|
|
@valueChange="handleValueChange" |
|
|
|
|
@save="handleTableSave" |
|
|
|
|
> |
|
|
|
|
<template v-slot:toolbarSuffix> |
|
|
|
|
<a-button type="primary" icon="plus-circle" @click="syncProductProcess()">读取工序</a-button> |
|
|
|
|
<a-button type="primary" icon="plus-circle" @click="autoFilling()">自动排位</a-button> |
|
|
|
|
<a-button type="primary" icon="plus-circle" @click="createMaterialBill()">生成物料单 |
|
|
|
|
</a-button> |
|
|
|
|
<a-button type="primary" icon="unordered-list" @click="viewMaterialBill">查看物料单 |
|
|
|
|
</a-button> |
|
|
|
|
<a-button type="primary" icon="redo" @click="sendToRepository()">发送到仓库 |
|
|
|
|
</a-button> |
|
|
|
|
<!-- <a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button>--> |
|
|
|
|
<a-button type="primary" icon="plus-circle" @click="syncHangRecord()">同步吊挂运行记录</a-button> |
|
|
|
|
<!-- <a-button type="primary" icon="plus-circle" @click="autoFilling()">自动排位</a-button>--> |
|
|
|
|
<!-- <a-button type="primary" icon="plus-circle" @click="createMaterialBill()">生成物料单--> |
|
|
|
|
<!-- </a-button>--> |
|
|
|
|
<!-- <a-button type="primary" icon="unordered-list" @click="viewMaterialBill">查看物料单--> |
|
|
|
|
<!-- </a-button>--> |
|
|
|
|
<!-- <a-button type="primary" icon="redo" @click="sendToRepository()">发送到仓库--> |
|
|
|
|
<!-- </a-button>--> |
|
|
|
|
<a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button> |
|
|
|
|
</template> |
|
|
|
|
<template v-slot:action="props"> |
|
|
|
|
<a @click="jump2MianLiao(props)">面料</a> |
|
|
|
|
<a-divider type="vertical"/> |
|
|
|
|
<a @click="jump2FuLiao(props)">辅料</a> |
|
|
|
|
<a-divider type="vertical"/> |
|
|
|
|
<a @click="viewDetail(props)">详情</a> |
|
|
|
|
</template> |
|
|
|
|
<!-- <template v-slot:action="props">--> |
|
|
|
|
<!-- <a @click="jump2MianLiao(props)">面料</a>--> |
|
|
|
|
<!-- <a-divider type="vertical"/>--> |
|
|
|
|
<!-- <a @click="jump2FuLiao(props)">辅料</a>--> |
|
|
|
|
<!-- <a-divider type="vertical"/>--> |
|
|
|
|
<!-- <a @click="viewDetail(props)">详情</a>--> |
|
|
|
|
<!-- </template>--> |
|
|
|
|
</j-vxe-table> |
|
|
|
|
</div> |
|
|
|
|
<ZyPlanProcessDataDetail ref="zyPlanProcessDataDetail"></ZyPlanProcessDataDetail> |
|
|
|
|
</a-card> |
|
|
|
|
|
|
|
|
|
</template> |
|
|
|
@ -80,195 +76,110 @@ import {JeecgListMixin} from '@/mixins/JeecgListMixin' |
|
|
|
|
import {getAction, postAction} from "@api/manage"; |
|
|
|
|
import {filterObj, pushIfNotExist, randomNumber, randomUUID} from "@/utils/util"; |
|
|
|
|
import {JVXETypes} from '@/components/jeecg/JVxeTable' |
|
|
|
|
import Area from "@comp/_util/Area"; |
|
|
|
|
import ZyPlanProcessDataDetail from '@views/productplan/ZyPlanProcessDataDetail' |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
name: 'ZyPlanProcessDataList', |
|
|
|
|
mixins: [JeecgListMixin, mixinDevice], |
|
|
|
|
components: { |
|
|
|
|
ZyPlanProcessDataDetail, |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
toolbarConfig: { |
|
|
|
|
// add 新增按钮;remove 删除按钮;clearSelection 清空选择按钮 |
|
|
|
|
btn: ['save',] |
|
|
|
|
}, |
|
|
|
|
description: '生产计划工序管理页面', |
|
|
|
|
description: '吊挂管理页面', |
|
|
|
|
loading: false, |
|
|
|
|
dataSource: [], |
|
|
|
|
columns: [ |
|
|
|
|
{ |
|
|
|
|
title: '工序名称', |
|
|
|
|
key: 'processName', |
|
|
|
|
title: '车间', |
|
|
|
|
key: 'workshopName', |
|
|
|
|
width: '180px', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '工位ID', |
|
|
|
|
key: 'stationId', |
|
|
|
|
type: JVXETypes.hidden, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '工位名称', |
|
|
|
|
key: 'stationName', |
|
|
|
|
type: JVXETypes.select, |
|
|
|
|
width: '200px', |
|
|
|
|
options: [], |
|
|
|
|
placeholder: '请选择${title}', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '工位序号', |
|
|
|
|
key: 'stationNum', |
|
|
|
|
width: '80px', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '设备名称', |
|
|
|
|
key: 'machineIds', |
|
|
|
|
type: JVXETypes.hidden |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '设备名称', |
|
|
|
|
key: 'machineNames', |
|
|
|
|
type: JVXETypes.selectMultiple, |
|
|
|
|
title: '吊挂编号', |
|
|
|
|
key: 'code', |
|
|
|
|
width: '180px', |
|
|
|
|
options: [], |
|
|
|
|
placeholder: '请选择${title}', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: 'toodsIds', |
|
|
|
|
key: 'toolsIds', |
|
|
|
|
type: JVXETypes.hidden, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '工具名称', |
|
|
|
|
key: 'toolsNames', |
|
|
|
|
type: JVXETypes.selectMultiple, |
|
|
|
|
title: '工站编号', |
|
|
|
|
key: 'point', |
|
|
|
|
type: JVXETypes.input, |
|
|
|
|
width: '180px', |
|
|
|
|
options: [], |
|
|
|
|
placeholder: '请选择${title}', |
|
|
|
|
}, |
|
|
|
|
{key: 'proProcess', type: JVXETypes.hidden, title: '前导工序ID', width: '120px'}, |
|
|
|
|
{ |
|
|
|
|
title: '前导工序', |
|
|
|
|
key: 'proProcessName', |
|
|
|
|
type: JVXETypes.popup, |
|
|
|
|
width: '180px', |
|
|
|
|
popupCode: 'zy_process', |
|
|
|
|
field: 'id,process_code,process_name,process_describe', |
|
|
|
|
// orgFields: 'id,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'}, |
|
|
|
|
{ |
|
|
|
|
title: '后导工序', |
|
|
|
|
key: 'postProcessName', |
|
|
|
|
type: JVXETypes.popup, |
|
|
|
|
width: '180px', |
|
|
|
|
popupCode: 'zy_process', |
|
|
|
|
field: 'id,process_code,process_name,process_describe', |
|
|
|
|
orgFields: 'process_name,id', |
|
|
|
|
destFields: 'postProcessName,postProcess', |
|
|
|
|
/*validateRules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, // 必填 |
|
|
|
|
message: '请输入${title}' // 显示的文本 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
// pattern: /^[P][0-9]{4}$/, // 正则 |
|
|
|
|
// pattern: /^[0-9a-zA-Z_]{1,}$/, |
|
|
|
|
pattern: /^[P]\d[0-9]{4,}$/, // 正则 |
|
|
|
|
// pattern: /^[a-z|A-Z][a-z|A-Z\d_-]{0,}$/, // 正则 |
|
|
|
|
|
|
|
|
|
message: '${title}必须以字母开头,可包含数字、下划线、横杠' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
unique: true, |
|
|
|
|
message: '${point}不能重复' |
|
|
|
|
}, |
|
|
|
|
// { |
|
|
|
|
// handler({cellValue, row, column}, callback, target) { |
|
|
|
|
// // cellValue 当前校验的值 |
|
|
|
|
// // callback(flag, message) 方法必须执行且只能执行一次 |
|
|
|
|
// // flag = 是否通过了校验,不填写或者填写 null 代表不进行任何操作 |
|
|
|
|
// // message = 提示的类型,默认使用配置的 message |
|
|
|
|
// // target 行编辑的实例对象 |
|
|
|
|
// if (cellValue === 'abc') { |
|
|
|
|
// callback(false, '${title}不能是abc') // false = 未通过校验 |
|
|
|
|
// } else { |
|
|
|
|
// callback(true) // true = 通过验证 |
|
|
|
|
// } |
|
|
|
|
// }, |
|
|
|
|
// message: '${title}默认提示' |
|
|
|
|
// } |
|
|
|
|
]*/ |
|
|
|
|
}, |
|
|
|
|
{key: 'inputProduct', title: '输入产品', width: '150', type: JVXETypes.input}, |
|
|
|
|
{key: 'semiProduct', title: '成品/半成品', width: '150', type: JVXETypes.input}, |
|
|
|
|
{ |
|
|
|
|
title: '工人id', |
|
|
|
|
key: 'userIds', |
|
|
|
|
title: '工位ID', |
|
|
|
|
key: 'stationId', |
|
|
|
|
type: JVXETypes.hidden, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '工人名称', |
|
|
|
|
key: 'userNames', |
|
|
|
|
type: JVXETypes.selectMultiple, |
|
|
|
|
width: '200px', |
|
|
|
|
title: '工位名称', |
|
|
|
|
key: 'stationName', |
|
|
|
|
type: JVXETypes.select, |
|
|
|
|
width: '220px', |
|
|
|
|
options: [], |
|
|
|
|
placeholder: '请选择${title}', |
|
|
|
|
}, |
|
|
|
|
{key: 'totalMachine', title: '机器时长', width: '80', type: JVXETypes.normal}, |
|
|
|
|
{key: 'totalMaunal', title: '人工时长', width: '80', type: JVXETypes.normal}, |
|
|
|
|
{ |
|
|
|
|
title: '管理', |
|
|
|
|
key: 'action', |
|
|
|
|
type: JVXETypes.slot, |
|
|
|
|
fixed: 'right', |
|
|
|
|
minWidth: '150px', |
|
|
|
|
align: 'center', |
|
|
|
|
slotName: 'action', |
|
|
|
|
}, |
|
|
|
|
// { |
|
|
|
|
// title: '管理', |
|
|
|
|
// key: 'action', |
|
|
|
|
// type: JVXETypes.slot, |
|
|
|
|
// fixed: 'right', |
|
|
|
|
// minWidth: '150px', |
|
|
|
|
// align: 'center', |
|
|
|
|
// slotName: 'action', |
|
|
|
|
// }, |
|
|
|
|
], |
|
|
|
|
url: { |
|
|
|
|
list: "/org.jeecg.modules.productplan/zyPlanProcess/getProcessDatalist", |
|
|
|
|
getPlanInfo: "/org.jeecg.modules.productplan/zyPlanProcess/getPlanInfo", |
|
|
|
|
syncProductProcess: "/org.jeecg.modules.productplan/zyPlanProcess/syncProductProcess", |
|
|
|
|
autoFilling: "/org.jeecg.modules.productplan/zyPlanProcess/autoFilling", |
|
|
|
|
createMaterialBill: "/org.jeecg.modules.productplan/zyPlanProcess/createMaterialBill", |
|
|
|
|
sendToRepository: "/org.jeecg.modules.productplan/zyPlanProcess/sendToRepository", |
|
|
|
|
stationToolslist: "/stationTool/list2", |
|
|
|
|
stationMachinelist: "/stationMachine/list2", |
|
|
|
|
addProcessBatch: "/org.jeecg.modules.productplan/zyPlanProcess/addProcessBatch", |
|
|
|
|
list: "/org.jeecg.modules.hanger/zyHang/getPointById", |
|
|
|
|
syncHangRecord: "/org.jeecg.modules.productplan/zyPlanProcess/syncHangRecord", |
|
|
|
|
addBatch: "/org.jeecg.modules.hanger/zyHangPoint/addBatch", |
|
|
|
|
}, |
|
|
|
|
loadRouteType: false, |
|
|
|
|
planId: "", |
|
|
|
|
id: "", |
|
|
|
|
workshopName: "", |
|
|
|
|
code: "", |
|
|
|
|
dictOptions: {}, |
|
|
|
|
planInfo: {}, |
|
|
|
|
superFieldList: [], |
|
|
|
|
stationIdList: [], |
|
|
|
|
userIdList: [], |
|
|
|
|
toolsList: [], |
|
|
|
|
machineList: [], |
|
|
|
|
clickTrue: true, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
this.loadParameter(); |
|
|
|
|
this.getPlanInfo(this.planId); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 详情 |
|
|
|
|
viewDetail(props) { |
|
|
|
|
// alert("deatil row id:"+props.row.id); |
|
|
|
|
this.$refs.zyPlanProcessDataDetail.showModal(props.row.id) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
jump2MianLiao(props) { |
|
|
|
|
console.log("mianLiao() ----props:", props) |
|
|
|
|
this.$router.push({ |
|
|
|
|
path: '/productplan/ZyPlanProcessFabricDataList', |
|
|
|
|
query: { // 路由携带参数 |
|
|
|
|
'planId': props.row.planId, |
|
|
|
|
'planProcessId': props.row.processId, |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
jump2FuLiao(props) { |
|
|
|
|
console.log("fuLiao() ----props:", props) |
|
|
|
|
this.$router.push({ |
|
|
|
|
path: '/productplan/ZyPlanProcessAccessoriesDataList', |
|
|
|
|
query: { // 路由携带参数 |
|
|
|
|
'planId': props.row.planId, |
|
|
|
|
'planProcessId': props.row.processId, |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
getPlanInfo(planId) { |
|
|
|
|
// debugger; |
|
|
|
|
getAction(this.url.getPlanInfo, {"planId": planId}).then((res) => { |
|
|
|
|
if (res.success) { |
|
|
|
|
this.planInfo = res.result.records || res.result; |
|
|
|
|
// console.log("getPlanInfo------------:" + JSON.stringify(this.planInfo)); |
|
|
|
|
} else { |
|
|
|
|
// 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) |
|
|
|
|
} |
|
|
|
|
}).finally(() => { |
|
|
|
|
this.loading = false |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 【整体保存】点击保存按钮时触发的事件 |
|
|
|
|
handleTableSave({$table, target}) { |
|
|
|
|
console.log("生产计划工序保存开始-----------------") |
|
|
|
@ -281,7 +192,7 @@ export default { |
|
|
|
|
console.log('当前保存的数据是:', tableData) |
|
|
|
|
// 【模拟保存】 |
|
|
|
|
this.loading = true |
|
|
|
|
postAction(this.url.addProcessBatch, tableData).then(res => { |
|
|
|
|
postAction(this.url.addBatch, tableData).then(res => { |
|
|
|
|
if (res.success) { |
|
|
|
|
this.$message.success(`保存成功!`) |
|
|
|
|
} else { |
|
|
|
@ -296,80 +207,17 @@ export default { |
|
|
|
|
}, |
|
|
|
|
fanHui() { |
|
|
|
|
this.$router.push({ |
|
|
|
|
path: '/productplan/ZyProductPlanList', |
|
|
|
|
path: '/src/views/hanger/ZyHangList', |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//读取工序 |
|
|
|
|
syncProductProcess() { |
|
|
|
|
this.loading = true; |
|
|
|
|
getAction(this.url.syncProductProcess, {"planId": this.planId}).then((res) => { |
|
|
|
|
if (res.success) { |
|
|
|
|
this.$message.success("操作成功"); |
|
|
|
|
this.loadData(); |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning(res.message) |
|
|
|
|
} |
|
|
|
|
}).finally(() => { |
|
|
|
|
this.loading = false |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//自动排位 |
|
|
|
|
/** |
|
|
|
|
* 根据工序id,查询工序设备表zy_process_machine,用工序设备表数据与工位设备进行匹配(工位设备包含工序设备即是匹配成功,则自动填充工位、设备字段数据,匹配不上则不自动填充,由用户自己录入) |
|
|
|
|
*/ |
|
|
|
|
autoFilling() { |
|
|
|
|
//同步生产记录到吊挂运行记录表 |
|
|
|
|
syncHangRecord() { |
|
|
|
|
this.loading = true; |
|
|
|
|
getAction(this.url.autoFilling, {"planId": this.planId}).then((res) => { |
|
|
|
|
getAction(this.url.syncHangRecord, {"code": this.code}).then((res) => { |
|
|
|
|
if (res.success) { |
|
|
|
|
this.$message.success("操作成功"); |
|
|
|
|
this.loadData(); |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning(res.message) |
|
|
|
|
} |
|
|
|
|
}).finally(() => { |
|
|
|
|
this.loading = false |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//生成物料单 |
|
|
|
|
/** |
|
|
|
|
* 根据该生产计划的工序面料、工序辅料按类统计各种面料、辅料的用量汇总到计划面料、计划辅料表 |
|
|
|
|
*/ |
|
|
|
|
createMaterialBill() { |
|
|
|
|
this.loading = true; |
|
|
|
|
getAction(this.url.createMaterialBill, {"planId": this.planId}).then((res) => { |
|
|
|
|
if (res.success) { |
|
|
|
|
this.$message.success("操作成功"); |
|
|
|
|
this.loadData(); |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning(res.message) |
|
|
|
|
} |
|
|
|
|
}).finally(() => { |
|
|
|
|
this.loading = false |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//查看物料单 |
|
|
|
|
viewMaterialBill() { |
|
|
|
|
// alert("deatil this.planId:"+this.planId); |
|
|
|
|
// this.$refs.zyPlanProcessDataDetail.showModal(this.planId) |
|
|
|
|
this.$router.push({ |
|
|
|
|
path: '/productplan/ZyPlanWuLiaoDataDetail', |
|
|
|
|
query: { // 路由携带参数 |
|
|
|
|
'planId': this.planId, |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//发送到仓库 |
|
|
|
|
sendToRepository(){ |
|
|
|
|
this.loading = true; |
|
|
|
|
getAction(this.url.sendToRepository, {"planId": this.planId}).then((res) => { |
|
|
|
|
if (res.success) { |
|
|
|
|
this.$message.success("操作成功"); |
|
|
|
|
this.loadData(); |
|
|
|
|
// this.loadData(); |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning(res.message) |
|
|
|
|
} |
|
|
|
@ -382,8 +230,10 @@ export default { |
|
|
|
|
loadParameter() { |
|
|
|
|
// debugger; |
|
|
|
|
if (this.loadRouteType === false) { |
|
|
|
|
this.planId = this.$route.query.planId; |
|
|
|
|
console.log("*******传递的planId:" + this.planId) |
|
|
|
|
this.id = this.$route.query.id; |
|
|
|
|
this.workshopName = this.$route.query.workshopName; |
|
|
|
|
this.code = this.$route.query.code; |
|
|
|
|
console.log("*******传递的id:" + this.id) |
|
|
|
|
this.loadRouteType = true; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -403,12 +253,16 @@ export default { |
|
|
|
|
if (res.success) { |
|
|
|
|
this.dataSource = res.result.records || res.result; |
|
|
|
|
this.stationIdList = this.dataSource[0].stationIdList; |
|
|
|
|
this.userIdList = this.dataSource[0].userIdList; |
|
|
|
|
|
|
|
|
|
// alert(this.stationIdList) |
|
|
|
|
} else { |
|
|
|
|
// 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) |
|
|
|
|
} |
|
|
|
|
}).finally(() => { |
|
|
|
|
this.dataSource.forEach(item => { |
|
|
|
|
item['workshopName'] = this.workshopName; |
|
|
|
|
// item['stationNum'] = this.stationNum; |
|
|
|
|
}) |
|
|
|
|
this.loading = false |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
@ -423,20 +277,18 @@ export default { |
|
|
|
|
param.field = this.getQueryField(); |
|
|
|
|
param.pageNo = this.ipagination.current; |
|
|
|
|
param.pageSize = this.ipagination.pageSize; |
|
|
|
|
param.planId = this.planId; |
|
|
|
|
param.id = this.id; |
|
|
|
|
return filterObj(param); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 当选择的行变化时触发的事件 |
|
|
|
|
handleSelectRowChange(event) { |
|
|
|
|
// console.log("handleSelectRowChange") |
|
|
|
|
console.log("handleSelectRowChange-event:", event) |
|
|
|
|
const {type, row, column, value, target, $table} = event |
|
|
|
|
console.log("stationIdList", JSON.stringify(this.stationIdList)); |
|
|
|
|
console.log("---------userIdList", JSON.stringify(this.userIdList)); |
|
|
|
|
target.$refs.vxe.columns[4].options = this.stationIdList; |
|
|
|
|
target.$refs.vxe.columns[17].options = this.userIdList; |
|
|
|
|
target.$refs.vxe.columns[6].options = this.stationIdList; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** 当选项被改变时,联动其他组件 */ |
|
|
|
|
handleValueChange(event) { |
|
|
|
|
const {type, row, column, value, target} = event |
|
|
|
@ -445,51 +297,14 @@ export default { |
|
|
|
|
// console.log("row", row) |
|
|
|
|
// 选中工位列操作 |
|
|
|
|
if (column.key === 'stationName') { |
|
|
|
|
// target.$refs.vxe.columns[6].options = this.stationIdList; |
|
|
|
|
// debugger; |
|
|
|
|
let selectedStationId = event.value; |
|
|
|
|
// 设置第二列的 options |
|
|
|
|
// console.log('选择的工位列id---------:', selectedStationId) |
|
|
|
|
row.stationId = selectedStationId; |
|
|
|
|
// 清空后两列的数据 |
|
|
|
|
target.setValues([{ |
|
|
|
|
rowKey: row.id, |
|
|
|
|
values: {machineIds: '', toolsIds: '', machineNames: '', toolsNames: ''} |
|
|
|
|
}]) |
|
|
|
|
target.$refs.vxe.columns[7].options = [] |
|
|
|
|
target.$refs.vxe.columns[9].options = [] |
|
|
|
|
|
|
|
|
|
getAction(this.url.stationMachinelist, {"stationId": selectedStationId}).then((res) => { |
|
|
|
|
if (res.success) { |
|
|
|
|
this.machineList = res.result.records || res.result; |
|
|
|
|
console.log("machineList", JSON.stringify(this.machineList)) |
|
|
|
|
target.$refs.vxe.columns[7].options = this.machineList; |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning(res.message) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
getAction(this.url.stationToolslist, {"stationId": selectedStationId}).then((res) => { |
|
|
|
|
if (res.success) { |
|
|
|
|
this.toolsList = res.result.records || res.result; |
|
|
|
|
console.log("toolsList", JSON.stringify(this.toolsList)) |
|
|
|
|
target.$refs.vxe.columns[9].options = this.toolsList; |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning(res.message) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//选中列操作 |
|
|
|
|
if (column.key === 'machineNames') { |
|
|
|
|
row.machineIds = event.value; |
|
|
|
|
} |
|
|
|
|
if (column.key === 'toolsNames') { |
|
|
|
|
row.toolsIds = event.value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (column.key === 'userNames') { |
|
|
|
|
row.userIds = event.value; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|