Browse Source

2024-12-03

计算工时
java8
fengyuan_yang 1 year ago
parent
commit
940c17cae7
  1. 7
      src/api/part/routingManagement.js
  2. 42
      src/views/modules/part/routingManagement.vue

7
src/api/part/routingManagement.js

@ -160,3 +160,10 @@ export const getStandardOperations = data => createAPI(`/part/routingManagement/
* @returns {*} * @returns {*}
*/ */
export const saveStandardOperation = data => createAPI(`/part/routingManagement/saveStandardOperation`,'post',data) export const saveStandardOperation = data => createAPI(`/part/routingManagement/saveStandardOperation`,'post',data)
/**
* 计算工时
* @param data
* @returns {*}
*/
export const calculationTime = data => createAPI(`/part/routingManagement/calculationTime`,'post',data)

42
src/views/modules/part/routingManagement.vue

@ -685,6 +685,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-footer style="height:35px;margin-top:10px;text-align:center"> <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="saveStandardOperation">保存</el-button>
<el-button type="primary" @click="standardOperationModal = false">关闭</el-button> <el-button type="primary" @click="standardOperationModal = false">关闭</el-button>
</el-footer> </el-footer>
@ -720,6 +721,7 @@ import {
queryMaxOperationNo, // queryMaxOperationNo, //
getStandardOperations, // 1 getStandardOperations, // 1
saveStandardOperation, // saveStandardOperation, //
calculationTime, //
} from '@/api/part/routingManagement.js' } from '@/api/part/routingManagement.js'
import {verifyData} from '@/api/part/partInformation.js' import {verifyData} from '@/api/part/partInformation.js'
import {getSiteAndBuByUserName, getSiteAndBuByUserName2} from "@/api/qc/qc.js" import {getSiteAndBuByUserName, getSiteAndBuByUserName2} from "@/api/qc/qc.js"
@ -2491,10 +2493,6 @@ export default {
this.$message.warning('请先选择替代!') this.$message.warning('请先选择替代!')
return return
} }
// if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
// this.$message.warning('!')
// return
// }
this.standardOperationSelections = [] this.standardOperationSelections = []
getStandardOperations(this.modalData).then(({data}) => { getStandardOperations(this.modalData).then(({data}) => {
if (data && data.code === 0) { 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 // Routing
saveStandardOperation () { saveStandardOperation () {
if (this.standardOperationSelections.length === 0) { if (this.standardOperationSelections.length === 0) {

Loading…
Cancel
Save