|
|
|
@ -685,6 +685,7 @@ |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<el-footer style="height:35px;margin-top:10px;text-align:center"> |
|
|
|
<el-button type="primary" @click="calculationTime">计算工时</el-button> |
|
|
|
<el-button type="primary" @click="saveStandardOperation">保存</el-button> |
|
|
|
<el-button type="primary" @click="standardOperationModal = false">关闭</el-button> |
|
|
|
</el-footer> |
|
|
|
@ -720,6 +721,7 @@ import { |
|
|
|
queryMaxOperationNo, // 查询最大工序号 |
|
|
|
getStandardOperations, // 根据物料的商品组1查维护的标准工序 |
|
|
|
saveStandardOperation, // 新增工序 |
|
|
|
calculationTime, // 计算工时 |
|
|
|
} from '@/api/part/routingManagement.js' |
|
|
|
import {verifyData} from '@/api/part/partInformation.js' |
|
|
|
import {getSiteAndBuByUserName, getSiteAndBuByUserName2} from "@/api/qc/qc.js" |
|
|
|
@ -2491,10 +2493,6 @@ export default { |
|
|
|
this.$message.warning('请先选择替代!') |
|
|
|
return |
|
|
|
} |
|
|
|
// if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') { |
|
|
|
// this.$message.warning('不可编辑的替代状态!') |
|
|
|
// return |
|
|
|
// } |
|
|
|
this.standardOperationSelections = [] |
|
|
|
getStandardOperations(this.modalData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
@ -2508,6 +2506,42 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 计算工时 |
|
|
|
calculationTime () { |
|
|
|
if (this.standardOperationSelections.length === 0) { |
|
|
|
this.$message.warning('请选择要计算的工序!') |
|
|
|
return |
|
|
|
} |
|
|
|
this.standardOperationList.forEach(item1 => { |
|
|
|
const matchInList2 = this.standardOperationSelections.find(item2 => item1.operationNo === item2.operationNo) |
|
|
|
if (matchInList2) { |
|
|
|
item1.flag = 'Y' |
|
|
|
} else { |
|
|
|
item1.flag = '' |
|
|
|
} |
|
|
|
}) |
|
|
|
let tempData = { |
|
|
|
site: this.modalData.site, |
|
|
|
buNo: this.modalData.buNo, |
|
|
|
partNo: this.modalData.partNo, |
|
|
|
operationList: this.standardOperationList |
|
|
|
} |
|
|
|
calculationTime(tempData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.standardOperationList = data.rows |
|
|
|
this.standardOperationList.forEach(item => { |
|
|
|
if (item.flag === 'Y') { |
|
|
|
this.$nextTick(() => this.$refs.standardOperationTable.toggleRowSelection(item,true)) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert('工时相关属性未维护属性值', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 更新 Routing 的工序 |
|
|
|
saveStandardOperation () { |
|
|
|
if (this.standardOperationSelections.length === 0) { |
|
|
|
|