|
|
|
@ -19,6 +19,7 @@ |
|
|
|
<el-button class="customer-bun-min" type="primary" @click="addModel" style="margin-left: 0px; margin-bottom: 0px;">新增</el-button> |
|
|
|
<el-button class="customer-bun-min" type="primary" @click="updateModel" style="margin-left: 0px; margin-bottom: 0px;">编辑</el-button> |
|
|
|
<el-button class="customer-bun-min" type="primary" @click="deleteSORoutingData" style="margin-left: 0px; margin-bottom: 0px;">删除</el-button> |
|
|
|
<el-button @click="getResourceModel()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'可用机台'}}</el-button> |
|
|
|
</el-form> |
|
|
|
<el-table |
|
|
|
:height="height" |
|
|
|
@ -76,6 +77,7 @@ |
|
|
|
<el-date-picker |
|
|
|
v-model="detailData.planStartTime" |
|
|
|
type="datetime" |
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
style="width: 150px" |
|
|
|
placeholder="选择日期时间"> |
|
|
|
</el-date-picker> |
|
|
|
@ -84,6 +86,7 @@ |
|
|
|
<el-date-picker |
|
|
|
v-model="detailData.planFinishTime" |
|
|
|
type="datetime" |
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
style="width: 150px" |
|
|
|
placeholder="选择日期时间"> |
|
|
|
</el-date-picker> |
|
|
|
@ -106,6 +109,74 @@ |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|
|
|
<el-dialog title="可用机台" :close-on-click-modal="false" v-drag :visible.sync="routingModelFlag" width="800px"> |
|
|
|
<el-container> |
|
|
|
<el-main style="width: 300px"> |
|
|
|
<span style="" >可选机台:</span> |
|
|
|
<el-table |
|
|
|
height="300px" |
|
|
|
:data="resourceList1" |
|
|
|
border |
|
|
|
@row-click="clickData2" |
|
|
|
highlight-current-row |
|
|
|
v-loading="dataListLoading" |
|
|
|
style="width: 100%"> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in columnList2" :key="index" |
|
|
|
:sortable="item.columnSortable" |
|
|
|
:prop="item.columnProp" |
|
|
|
:header-align="item.headerAlign" |
|
|
|
:show-overflow-tooltip="item.showOverflowTooltip" |
|
|
|
:align="item.align" |
|
|
|
:fixed="item.fixed" |
|
|
|
:min-width="item.columnWidth" |
|
|
|
:label="item.columnLabel"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span> |
|
|
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
|
|
|
style="width: 100px; height: 80px"/></span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-main> |
|
|
|
<el-main style="width: 100px"> |
|
|
|
<div style="margin-top: 100px"> |
|
|
|
<el-button type="primary" @click="addResource()">添加机台>></el-button> |
|
|
|
</div> |
|
|
|
<div style="margin-top: 20px"> |
|
|
|
<el-button type="primary" @click="deleteResource()">删除机台<<</el-button> |
|
|
|
</div> |
|
|
|
</el-main> |
|
|
|
<el-main style="width: 300px"> |
|
|
|
<span style="" >已选机台:</span> |
|
|
|
<el-table |
|
|
|
height="300px" |
|
|
|
:data="resourceList2" |
|
|
|
border |
|
|
|
@row-click="clickData3" |
|
|
|
highlight-current-row |
|
|
|
v-loading="dataListLoading" |
|
|
|
style="width: 100%"> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in columnList3" :key="index" |
|
|
|
:sortable="item.columnSortable" |
|
|
|
:prop="item.columnProp" |
|
|
|
:header-align="item.headerAlign" |
|
|
|
:show-overflow-tooltip="item.showOverflowTooltip" |
|
|
|
:align="item.align" |
|
|
|
:fixed="item.fixed" |
|
|
|
:min-width="item.columnWidth" |
|
|
|
:label="item.columnLabel"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span> |
|
|
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
|
|
|
style="width: 100px; height: 80px"/></span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-main> |
|
|
|
</el-container> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -113,6 +184,12 @@ |
|
|
|
import Chooselist from '@/views/modules/common/Chooselist' |
|
|
|
import { |
|
|
|
getSORoutingData, |
|
|
|
saveSORoutingData, |
|
|
|
deleteSORoutingData, |
|
|
|
searchAllResource, |
|
|
|
searchSORoutingResource, |
|
|
|
addSORoutingResource, |
|
|
|
deleteSORoutingResource |
|
|
|
}from "@/api/base/site.js" |
|
|
|
export default { |
|
|
|
name: "updateProductRouting", |
|
|
|
@ -132,8 +209,12 @@ |
|
|
|
addModelFlag:false, |
|
|
|
height:350, |
|
|
|
dataList:[], |
|
|
|
resourceList1:[], |
|
|
|
resourceList2:[], |
|
|
|
dataListLoading:false, |
|
|
|
currentRow:null, |
|
|
|
currentRow2:null, |
|
|
|
currentRow3:null, |
|
|
|
columnList:[ |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
@ -512,11 +593,123 @@ |
|
|
|
remark:'', |
|
|
|
site:'', |
|
|
|
partNo:'', |
|
|
|
revNo:'', |
|
|
|
add:'', |
|
|
|
user:'', |
|
|
|
}, |
|
|
|
detailmodelInputFlag:false, |
|
|
|
routingModelFlag:false, |
|
|
|
columnList2:[ |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 6099, |
|
|
|
serialNumber: '6099Table2ResourceID', |
|
|
|
tableId: "6099Table2", |
|
|
|
tableName: "维护工艺路线可用机台表", |
|
|
|
columnProp: "resourceID", |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: "机台编码", |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: false, |
|
|
|
columnWidth: 70 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 6099, |
|
|
|
serialNumber: '6099Table2ResourceDesc', |
|
|
|
tableId: "6099Table2", |
|
|
|
tableName: "维护工艺路线可用机台表", |
|
|
|
columnProp: "resourceDesc", |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: "机台名称", |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: false, |
|
|
|
columnWidth: 160 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 6099, |
|
|
|
serialNumber: '6099Table2Active', |
|
|
|
tableId: "6099Table2", |
|
|
|
tableName: "维护工艺路线可用机台表", |
|
|
|
columnProp: "active", |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: "在用", |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: false, |
|
|
|
columnWidth: 50 |
|
|
|
}, |
|
|
|
], |
|
|
|
columnList3:[ |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 6099, |
|
|
|
serialNumber: '6099Table3ResourceID', |
|
|
|
tableId: "6099Table3", |
|
|
|
tableName: "维护工艺路线已选机台表", |
|
|
|
columnProp: "resourceID", |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: "机台编码", |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: false, |
|
|
|
columnWidth: 70 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 6099, |
|
|
|
serialNumber: '6099Table3ResourceDesc', |
|
|
|
tableId: "6099Table3", |
|
|
|
tableName: "维护工艺路线已选机台表", |
|
|
|
columnProp: "resourceDesc", |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: "机台名称", |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: false, |
|
|
|
columnWidth: 160 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 6099, |
|
|
|
serialNumber: '6099Table3Active', |
|
|
|
tableId: "6099Table3", |
|
|
|
tableName: "维护工艺路线已选机台表", |
|
|
|
columnProp: "active", |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: "在用", |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: false, |
|
|
|
columnWidth: 50 |
|
|
|
}, |
|
|
|
], |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
@ -570,17 +763,16 @@ |
|
|
|
itemNo:'', |
|
|
|
operationDesc:'', |
|
|
|
workCenterNo:'', |
|
|
|
machSetupTime:'', |
|
|
|
machRunFactor:'', |
|
|
|
machSetupTime:0, |
|
|
|
machRunFactor:1, |
|
|
|
factorUnit:'单位/小时', |
|
|
|
planStartTime:'', |
|
|
|
planFinishTime:'', |
|
|
|
planStartTime:new Date(), |
|
|
|
planFinishTime:new Date(), |
|
|
|
efficiency:'', |
|
|
|
crewsize:'', |
|
|
|
crewsize:100, |
|
|
|
remark:'', |
|
|
|
site:'', |
|
|
|
partNo:'', |
|
|
|
revNo:'', |
|
|
|
site:this.searchData.site, |
|
|
|
partNo:this.searchData.partNo, |
|
|
|
add:0, |
|
|
|
user:this.$store.state.user.name, |
|
|
|
}; |
|
|
|
@ -619,12 +811,235 @@ |
|
|
|
remark:this.currentRow.remark, |
|
|
|
site:this.currentRow.site, |
|
|
|
partNo:this.currentRow.partNo, |
|
|
|
revNo:this.currentRow.revNo, |
|
|
|
add:1, |
|
|
|
user:this.$store.state.user.name, |
|
|
|
} |
|
|
|
this.addModelFlag=true; |
|
|
|
}, |
|
|
|
saveSORoutingData(){ |
|
|
|
if(this.detailData.itemNo==''||this.detailData.itemNo==null){ |
|
|
|
this.$alert("请输入工序号!",'错误',{ |
|
|
|
confirmButtonText:'确定' |
|
|
|
}) |
|
|
|
return false; |
|
|
|
} |
|
|
|
if(this.detailData.operationDesc==''||this.detailData.operationDesc==null){ |
|
|
|
this.$alert("请输入工序名称!",'错误',{ |
|
|
|
confirmButtonText:'确定' |
|
|
|
}) |
|
|
|
return false; |
|
|
|
} |
|
|
|
if(this.detailData.machSetupTime===''||this.detailData.machSetupTime==null){ |
|
|
|
this.$alert("请输入准备时间!",'错误',{ |
|
|
|
confirmButtonText:'确定' |
|
|
|
}) |
|
|
|
return false; |
|
|
|
} |
|
|
|
if(this.detailData.workCenterNo==''||this.detailData.workCenterNo==null){ |
|
|
|
this.$alert("请输入加工中心编码!",'错误',{ |
|
|
|
confirmButtonText:'确定' |
|
|
|
}) |
|
|
|
return false; |
|
|
|
} |
|
|
|
if(this.detailData.crewsize===''||this.detailData.crewsize==null){ |
|
|
|
this.$alert("请输入操作员人数!",'错误',{ |
|
|
|
confirmButtonText:'确定' |
|
|
|
}) |
|
|
|
return false; |
|
|
|
} |
|
|
|
if(this.detailData.efficiency===''||this.detailData.efficiency==null){ |
|
|
|
this.$alert("请输入效率!",'错误',{ |
|
|
|
confirmButtonText:'确定' |
|
|
|
}) |
|
|
|
return false; |
|
|
|
} |
|
|
|
if(this.detailData.machRunFactor===''||this.detailData.machRunFactor==null){ |
|
|
|
this.$alert("请输入单位产出量!",'错误',{ |
|
|
|
confirmButtonText:'确定' |
|
|
|
}) |
|
|
|
return false; |
|
|
|
} |
|
|
|
if(this.detailData.machRunFactor<=0){ |
|
|
|
this.$alert("单位产出量必须大于0!",'错误',{ |
|
|
|
confirmButtonText:'确定' |
|
|
|
}) |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
if(this.detailData.efficiency<=0){ |
|
|
|
this.$alert("效率必须大于0!",'错误',{ |
|
|
|
confirmButtonText:'确定' |
|
|
|
}) |
|
|
|
return false; |
|
|
|
} |
|
|
|
let inData={ |
|
|
|
itemNo:this.detailData.itemNo, |
|
|
|
operationDesc:this.detailData.operationDesc, |
|
|
|
workCenterNo:this.detailData.workCenterNo, |
|
|
|
machSetupTime:this.detailData.machSetupTime, |
|
|
|
machRunFactor:this.detailData.machRunFactor, |
|
|
|
factorUnit:this.detailData.factorUnit, |
|
|
|
planStartTime:this.detailData.planStartTime, |
|
|
|
planFinishTime:this.detailData.planFinishTime, |
|
|
|
efficiency:this.detailData.efficiency, |
|
|
|
crewsize:this.detailData.crewsize, |
|
|
|
remark:this.detailData.remark, |
|
|
|
site:this.detailData.site, |
|
|
|
partNo:this.detailData.partNo, |
|
|
|
orderNo:this.searchData.orderNo, |
|
|
|
add:this.detailData.add, |
|
|
|
user:this.$store.state.user.name, |
|
|
|
} |
|
|
|
saveSORoutingData(inData).then(({data}) => { |
|
|
|
this.currentRow=null; |
|
|
|
if (data && data.code == 200) { |
|
|
|
this.addModelFlag = false |
|
|
|
this.getData(); |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => { |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
deleteSORoutingData(){ |
|
|
|
if(this.currentRow==null){ |
|
|
|
this.$alert("请选择工序!", '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return false; |
|
|
|
} |
|
|
|
this.$confirm(`是否删除此工艺路线工序?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
|
|
|
|
}).then(() => { |
|
|
|
deleteSORoutingData(this.currentRow).then(({data}) => { |
|
|
|
this.currentRow=null; |
|
|
|
if (data && data.code == 200) { |
|
|
|
this.getData(); |
|
|
|
this.$message({ |
|
|
|
message: '删除成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => { |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
clickData3(row){ |
|
|
|
this.currentRow3 = JSON.parse(JSON.stringify(row)); |
|
|
|
}, |
|
|
|
clickData2(row){ |
|
|
|
this.currentRow2 = JSON.parse(JSON.stringify(row)); |
|
|
|
}, |
|
|
|
getResourceModel(){ |
|
|
|
if(this.currentRow==null){ |
|
|
|
this.$alert("请选择工艺路线工序!", '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return false; |
|
|
|
} |
|
|
|
let data1={ |
|
|
|
site:this.searchData.site, |
|
|
|
workCenterNo:this.currentRow.workCenterNo, |
|
|
|
} |
|
|
|
searchAllResource(data1).then(({data}) => { |
|
|
|
this.resourceList1 = data.rows |
|
|
|
}) |
|
|
|
let data2={ |
|
|
|
site:this.searchData.site, |
|
|
|
orderNo:this.searchData.orderNo, |
|
|
|
itemNo:this.currentRow.itemNo |
|
|
|
} |
|
|
|
searchSORoutingResource(data2).then(({data}) => { |
|
|
|
this.resourceList2 = data.rows |
|
|
|
}) |
|
|
|
this.routingModelFlag=true; |
|
|
|
}, |
|
|
|
addResource(){ |
|
|
|
if(this.currentRow2==null){ |
|
|
|
this.$alert("请选择可选机台!", '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return false; |
|
|
|
} |
|
|
|
let inData={ |
|
|
|
site: this.currentRow.site, |
|
|
|
orderNo:this.currentRow.orderNo, |
|
|
|
itemNo:this.currentRow.itemNo, |
|
|
|
resourceID:this.currentRow2.resourceID |
|
|
|
} |
|
|
|
addSORoutingResource(inData).then(({data}) => { |
|
|
|
|
|
|
|
if (data && data.code == 200) { |
|
|
|
let data2={ |
|
|
|
site:this.searchData.site, |
|
|
|
orderNo:this.searchData.orderNo, |
|
|
|
itemNo:this.currentRow.itemNo |
|
|
|
} |
|
|
|
searchSORoutingResource(data2).then(({data}) => { |
|
|
|
this.resourceList2 = data.rows |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
deleteResource(){ |
|
|
|
if(this.currentRow3==null){ |
|
|
|
this.$alert("请选择已选机台!", '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return false; |
|
|
|
} |
|
|
|
this.$confirm(`是否删除此机台?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
|
|
|
|
}).then(() => { |
|
|
|
let inData = { |
|
|
|
site: this.currentRow.site, |
|
|
|
orderNo:this.currentRow.orderNo, |
|
|
|
itemNo:this.currentRow.itemNo, |
|
|
|
resourceID: this.currentRow3.resourceID |
|
|
|
} |
|
|
|
deleteSORoutingResource(inData).then(({data}) => { |
|
|
|
if (data && data.code == 200) { |
|
|
|
this.currentRow3 = null; |
|
|
|
let data2={ |
|
|
|
site:this.searchData.site, |
|
|
|
orderNo:this.searchData.orderNo, |
|
|
|
itemNo:this.currentRow.itemNo |
|
|
|
} |
|
|
|
searchSORoutingResource(data2).then(({data}) => { |
|
|
|
this.resourceList2 = data.rows |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
|
|
|
|
|