Browse Source

2025-04-17

Bom复制优化
java8
fengyuan_yang 9 months ago
parent
commit
8b19b688de
  1. 6
      src/api/part/bomManagement.js
  2. 4
      src/api/part/bomSearch3.js
  3. 1
      src/views/modules/eam/eamObjectDefect.vue
  4. 532
      src/views/modules/part/bomManagement.vue
  5. 25
      src/views/modules/part/bomSearch3.vue
  6. 167
      src/views/modules/part/bom_create.vue
  7. 645
      src/views/modules/part/copy_bom_modal.vue
  8. 160
      src/views/modules/part/routingManagement.vue

6
src/api/part/bomManagement.js

@ -198,4 +198,10 @@ export const computeQtyPerAssemblySave = data => createAPI(`/part/bomManagement/
* @returns {*}
*/
export const computeQtyPerAssemblyEdit = data => createAPI(`/part/bomManagement/computeQtyPerAssemblyEdit`,'post',data)
/**
* 批量修改工序
* @param data
* @returns {*}
*/
export const batchOperationEdit = data => createAPI(`/part/bomManagement/batchOperationEdit`,'post',data)

4
src/api/part/bomSearch3.js

@ -57,6 +57,8 @@ export const commitTempItemValue = data => createAPI(`/part/bomSearch3/commitTem
export const saveCopyResult = data => createAPI(`/part/bomSearch3/saveCopyResult`,'post',data)
export const saveStandardOperationByCopy = data => createAPI(`/part/bomSearch3/saveStandardOperationByCopy`,'post',data)
export const computeQtyPerAssemblySaveByCopy = data => createAPI(`/part/bomSearch3/computeQtyPerAssemblySaveByCopy`,'post',data)
export const computeQtyPerAssemblyEditByCopy = data => createAPI(`/part/bomSearch3/computeQtyPerAssemblyEditByCopy`,'post',data)

1
src/views/modules/eam/eamObjectDefect.vue

@ -583,7 +583,6 @@
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
eamObjectDefectDelete(row).then(({data}) => {
if (data && data.code == '0') {

532
src/views/modules/part/bomManagement.vue

@ -244,6 +244,7 @@
<el-form-item>
<el-button type="primary" :loading="alternativeLoading" @click="saveComponentModal" style="margin-left: 7px">新增</el-button>
<el-button type="primary" :loading="alternativeLoading" @click="batchSaveComponentModal" style="margin-left: 7px">批量新增</el-button>
<el-button type="primary" :loading="alternativeLoading" @click="batchUpdateOperationModal" style="margin-left: 7px">编辑工序</el-button>
<el-button type="primary" icon="el-icon-upload" @click="bomComponentUpload">导入</el-button>
<el-button type="primary" :loading="alternativeLoading" @click="deleteComponentPart">删除</el-button>
</el-form-item>
@ -331,8 +332,8 @@
</el-tab-pane>
</el-tabs>
<el-footer style="height:30px;margin-top:20px;text-align:center">
<el-button :loading="saveAllLoading" type="primary" @click="saveData(true)">应用</el-button>
<el-button :loading="saveAllLoading" type="primary" @click="saveData(false)">保存</el-button>
<el-button :loading="saveAllLoading" type="primary" @click="packageSaveData(true)">应用</el-button>
<el-button :loading="saveAllLoading" type="primary" @click="packageSaveData(false)">保存</el-button>
<el-button type="primary" @click="closeModal">关闭</el-button>
</el-footer>
</el-dialog>
@ -856,69 +857,6 @@
</el-footer>
</el-dialog>
<!-- &lt;!&ndash; 批量新增子明细物料模态框 &ndash;&gt;-->
<!-- <el-dialog title="物料清单" top="17vh" :close-on-click-modal="false" v-drag :visible.sync="batchComponentPartModelFlag" width="1060px">-->
<!-- <el-form :inline="true" label-position="top" :model="batchComponentPartData">-->
<!-- <el-form-item :label="'物料编码'">-->
<!-- <el-input v-model="batchComponentPartData.partNo" clearable style="width: 120px"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item :label="'物料名称'">-->
<!-- <el-input v-model="batchComponentPartData.partDesc" clearable style="width: 120px"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item :label="' '">-->
<!-- <el-button type="primary" @click="queryBatchComponentPartList">查询</el-button>-->
<!-- </el-form-item>-->
<!-- <el-form-item :label="'损耗率%'" style="margin-left: 545px">-->
<!-- <el-input-number :controls="false" :step="0" min="0" max="100" v-model="batchComponentPartData.shrinkageFactor" style="width: 80px"></el-input-number>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <el-table-->
<!-- :height="400"-->
<!-- :data="batchComponentPartList"-->
<!-- ref="batchSaveTable"-->
<!-- @row-click="batchSaveClickRow"-->
<!-- @selection-change="selectionSaveComponent"-->
<!-- border-->
<!-- style="width: 100%;">-->
<!-- <el-table-column-->
<!-- type="selection"-->
<!-- header-align="center"-->
<!-- align="center"-->
<!-- width="50">-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- v-for="(item,index) in componentPartColumnList" :key="index"-->
<!-- :sortable="item.columnSortable"-->
<!-- :prop="item.columnProp"-->
<!-- :header-align="item.headerAlign"-->
<!-- :show-overflow-tooltip="item.showOverflowTooltip"-->
<!-- :align="item.align"-->
<!-- :fixed="item.fixed==''?false: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>-->
<!-- &lt;!&ndash; 分页插件 &ndash;&gt;-->
<!-- <el-pagination-->
<!-- @size-change="sizeChangeHandle5"-->
<!-- @current-change="currentChangeHandle5"-->
<!-- :current-page="pageIndex5"-->
<!-- :page-sizes="[20, 50, 100, 200, 500]"-->
<!-- :page-size="pageSize5"-->
<!-- :total="totalPage5"-->
<!-- layout="total, sizes, prev, pager, next, jumper">-->
<!-- </el-pagination>-->
<!-- <el-footer style="height:35px;margin-top:10px;text-align:center">-->
<!-- <el-button type="primary" @click="batchComponentDataSave">保存</el-button>-->
<!-- <el-button type="primary" @click="batchComponentPartModelFlag = false">关闭</el-button>-->
<!-- </el-footer>-->
<!-- </el-dialog>-->
<!-- 默认库位-> 快速新增 -->
<el-dialog title="新增" :close-on-click-modal="false" v-drag :visible.sync="batchComponentPartModelFlag" width="1170px">
<div style="font-size: 12px">
@ -945,7 +883,7 @@
:data="batchComponentPartList"
border
ref="batchSaveTable"
@row-click="batchSaveClickRow"
@row-dblclick="batchAddPartDB"
@selection-change="selectionSaveComponent"
highlight-current-row
style="width: 100%">
@ -997,7 +935,7 @@
:data="choosePartList"
border
ref="batchSaveTable2"
@row-click="batchSaveClickRow2"
@row-dblclick="batchDeletePartDB"
@selection-change="selectionSaveComponent2"
highlight-current-row
style="width: 100%">
@ -1030,6 +968,23 @@
</el-footer>
</el-dialog>
<!-- 批量编辑工序 -->
<el-dialog title="工序" top="35vh" :close-on-click-modal="false" v-drag :visible.sync="batchOperationModelFlag" width="350px">
<el-form :inline="true" label-position="top" :model="batchOperationData" style="margin-left: 5px">
<el-form-item label="工序编码">
<span slot="label" @click="queryOperationList"><a>工序</a></span>
<el-input v-model="batchOperationData.operationNo" style="width: 100px"></el-input>
</el-form-item>
<el-form-item label="工序名称">
<el-input v-model="batchOperationData.operationName" disabled style="width: 200px"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:35px;margin-top:20px;text-align:center">
<el-button type="primary" @click="batchOperationEdit">保存</el-button>
<el-button type="primary" @click="batchOperationModelFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 导入 -->
<bom-component-upload ref="BomComponentUpload" @refreshPageTables="queryBomComponentTable" v-drag></bom-component-upload>
@ -1068,13 +1023,14 @@ import {
exportWordOrPdf, // word
computeQtyPerAssemblySave, // ()
computeQtyPerAssemblyEdit, // ()
batchOperationEdit, //
} from '@/api/part/bomManagement.js'
import {getSiteAndBuByUserName, getSiteAndBuByUserName2} from "@/api/qc/qc.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
import ChooseList from '@/views/modules/common/Chooselist_eam'
import BomComponentUpload from "./bom_component_upload.vue";
import {Decimal} from "decimal.js";
import {updateColumnSize} from "../../../api/table";
import BomComponentUpload from "./bom_component_upload.vue"
import {Decimal} from "decimal.js"
import {updateColumnSize} from "../../../api/table"
export default {
//
@ -1130,7 +1086,6 @@ export default {
//
data () {
return {
//
exportData: [],
exportName: 'BOM物料列表' + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ['BOM物料列表'],
@ -1138,6 +1093,11 @@ export default {
resultList: [],
userBuList: [],
buList: [],
batchOperationData: {
operationId: '',
operationNo: '',
operationName: ''
},
// ======== ========
height: 200,
// ======== ========
@ -1848,13 +1808,13 @@ export default {
{
userId: this.$store.state.user.name,
functionId: 601002,
serialNumber: '601002Table2OperationDesc',
serialNumber: '601002Table2OperationNo',
tableId: '601002Table2',
tableName: 'BOM子物料表',
columnProp: 'operationNo',
headerAlign: 'center',
align: 'center',
columnLabel: '工序',
columnLabel: '工序编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
@ -1863,6 +1823,24 @@ export default {
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 601002,
serialNumber: '601002Table2OperationName',
tableId: '601002Table2',
tableName: 'BOM子物料表',
columnProp: 'operationName',
headerAlign: 'center',
align: 'left',
columnLabel: '工序名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 601002,
@ -2164,6 +2142,7 @@ export default {
headerSaveFlag: false,
menuId: this.$route.meta.menuId,
batchComponentPartModelFlag: false,
batchOperationModelFlag: false,
// ======== ========
productionDataFamily: ['RFID003', 'RFID004', 'RFID005', 'RFID006', 'RFID007', 'RFID008', 'RFID009', 'RFID012', 'RFID023', 'RFID024', 'RFID025', 'RFID027'],
materialDataFamily: ['RFID011', 'RFID020', 'RFID021', 'RFID022'],
@ -2287,96 +2266,66 @@ export default {
},
// ======== ========
/**
* 每页数
* @param val
*/
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
/**
* 当前页
* @param val
*/
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
/**
* 每页数
* @param val
*/
//
sizeChangeHandle2 (val) {
this.pageSize2 = val
this.pageIndex2 = 1
this.queryPartList()
},
/**
* 当前页
* @param val
*/
//
currentChangeHandle2 (val) {
this.pageIndex2 = val
this.queryPartList()
},
/**
* 每页数
* @param val
*/
//
sizeChangeHandle3 (val) {
this.pageSize3 = val
this.pageIndex3 = 1
this.queryComponentPartModal()
},
/**
* 当前页
* @param val
*/
//
currentChangeHandle3 (val) {
this.pageIndex3 = val
this.queryComponentPartModal()
},
/**
* 每页数
* @param val
*/
//
sizeChangeHandle4 (val) {
this.pageSize4 = val
this.pageIndex4 = 1
this.queryCopyPartModal()
},
/**
* 当前页
* @param val
*/
//
currentChangeHandle4 (val) {
this.pageIndex4 = val
this.queryCopyPartModal()
},
/**
* 每页数
* @param val
*/
//
sizeChangeHandle5 (val) {
this.pageSize5 = val
this.pageIndex5 = 1
this.queryBatchComponentPartList()
},
/**
* 当前页
* @param val
*/
//
currentChangeHandle5 (val) {
this.pageIndex5 = val
this.queryBatchComponentPartList()
@ -2384,17 +2333,13 @@ export default {
// ======== ========
/**
* 子明细页签选择替换
*/
//
tabSubDetailClick (tab, event) {
//
this.refreshSubDetailTable()
},
/**
* 刷新子明细页签的table数据
*/
// table
refreshSubDetailTable () {
if (this.subDetailTable === 'bom_sub_detail') {
this.queryBomComponentTable()
@ -2411,9 +2356,7 @@ export default {
},
// ======== ========
/**
* 获取数据列表
*/
//
getDataList () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
@ -2428,39 +2371,24 @@ export default {
})
},
/**
* 复选列表信息
* @param val
*/
//
selectionBom (val) {
this.bomSelections = val
this.$refs.selectDiv.setLengthselected(this.bomSelections.length)
},
//
batchSaveClickRow (row) {
this.$refs.batchSaveTable.toggleRowSelection(row)
},
//
selectionSaveComponent (val) {
this.batchComponentSelections = val
},
//
batchSaveClickRow2 (row) {
this.$refs.batchSaveTable2.toggleRowSelection(row)
},
//
selectionSaveComponent2 (val) {
this.batchComponentSelections2 = val
},
// ======== / ========
/**
* bom新增模态框
*/
// bom
addModal () {
this.modalData = {
flag: '1',
@ -2510,9 +2438,7 @@ export default {
this.modalFlag = true
},
/**
* bom编辑模态框
*/
// bom
async updateModal (row) {
this.modalData = {
flag: '2',
@ -2555,9 +2481,7 @@ export default {
})
},
/**
* 替代新增模态框
*/
//
saveBomDetail () {
if (this.modalData.partNo === '' || this.modalData.partNo == null) {
this.$message.warning('请先选择Bom物料!')
@ -2604,9 +2528,7 @@ export default {
})
},
/**
* 替代编辑模态框
*/
//
updateBomDetail () {
if (this.modalData.partNo === '' || this.modalData.partNo == null) {
this.$message.warning('请先选择Bom物料!')
@ -2652,9 +2574,7 @@ export default {
})
},
/**
* 子明细新增模态框
*/
//
saveComponentModal () {
if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) {
this.$message.warning('请先选择替代!')
@ -2761,18 +2681,12 @@ export default {
})
},
/**
* 副产品新增模态框
*/
//
saveByProductModal () {
if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) {
this.$message.warning('请先选择替代!')
return
}
// if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
// this.$message.warning('!')
// return
// }
this.componentData = {
flag: '1',
site: this.$store.state.user.site,
@ -2813,9 +2727,7 @@ export default {
this.componentSaveModal = true
},
/**
* 子明细编辑模态框
*/
//
updateComponentModal (row) {
this.componentData = {
flag: '2',
@ -2865,9 +2777,24 @@ export default {
},
// ======== // ========
/**
* bom新增/编辑
*/
//
packageSaveData (isClose) {
const allAHasValue = this.subDetailList.every(item => item.operationId !== null && item.operationId !== '')
if (!allAHasValue) {
this.$confirm(`存在未选择工序的子物料,是否确认保存数据?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.saveData(isClose)
})
} else {
this.saveData(isClose)
}
},
// bom/
saveData (isClose) {
if (this.modalData.partNo === '' || this.modalData.partNo == null) {
this.$message.warning('请选择物料编码!')
@ -2925,72 +2852,45 @@ export default {
informationList: this.subDetailList,
processUnit: this.modalData.processUnit
}
// if (this.modalData.flag === '1') {
this.saveAllLoading = true
bomManagementSave(tempData).then(({data}) => {
if (data && data.code === 0) {
if (isClose) {
this.updateModal(data.rows)
} else {
this.getDataList()
this.modalFlag = false
}
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
this.saveAllLoading = true
bomManagementSave(tempData).then(({data}) => {
if (data && data.code === 0) {
if (isClose) {
this.updateModal(data.rows)
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
this.getDataList()
this.modalFlag = false
}
this.saveAllLoading = false
}).catch(() => {
this.saveAllLoading = false
})
// } else {
// this.saveAllLoading = true
// bomManagementEdit(tempData).then(({data}) => {
// if (data && data.code === 0) {
// this.getDataList()
// this.modalFlag = false
// this.$message({
// message: '',
// type: 'success',
// duration: 1500,
// onClose: () => {}
// })
// } else {
// this.$alert(data.msg, '', {
// confirmButtonText: ''
// })
// }
// this.saveAllLoading = false
// })
// }
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
this.saveAllLoading = false
}).catch(() => {
this.saveAllLoading = false
})
},
/**
* 新增编辑模态框关闭
*/
//
closeModal () {
this.getDataList()
this.modalFlag = false
},
/**
* 新增编辑模态框关闭
*/
//
closeModalX (done) {
this.getDataList()
done()
},
/**
* bom删除
*/
// bom
delModal () {
if (this.bomSelections.length === 0) {
this.$message.warning('请勾选要删除的BOM!')
@ -3023,9 +2923,7 @@ export default {
})
},
/**
* 查询物料
*/
//
queryPartList () {
this.partData.limit = this.pageSize2
this.partData.page = this.pageIndex2
@ -3087,9 +2985,7 @@ export default {
}
},
/**
* BOM类型改变
*/
// BOM
bomTypeChange () {
// Bom
getBomEngChgLevel(this.modalData).then(({data}) => {
@ -3101,10 +2997,7 @@ export default {
})
},
/**
* 双击选中物料
* @param row
*/
//
getRowData (row) {
this.modalData.partNo = row.partNo
this.modalData.partDesc = row.partDesc
@ -3124,13 +3017,16 @@ export default {
})
},
/**
* 双击选中工序
* @param row
*/
//
getRowOperationData (row) {
this.componentData.operationId = row.operationId
this.componentData.operationNo = row.operationNo
if (this.batchOperationModelFlag) {
this.batchOperationData.operationId = row.operationId
this.batchOperationData.operationNo = row.operationNo
this.batchOperationData.operationName = row.operationName
} else {
this.componentData.operationId = row.operationId
this.componentData.operationNo = row.operationNo
}
this.operationModelFlag = false
},
@ -3168,9 +3064,7 @@ export default {
this.copyPartModelFlag = false
},
/**
* 子物料列表
*/
//
queryComponentPartModal () {
this.componentPartData.limit = this.pageSize3
this.componentPartData.page = this.pageIndex3
@ -3191,9 +3085,7 @@ export default {
},
/**
* copy物料列表
*/
// copy
queryCopyPartModal () {
this.copyPartData.limit = this.pageSize4
this.copyPartData.page = this.pageIndex4
@ -3215,9 +3107,7 @@ export default {
})
},
/**
* 子物料查询列表
*/
//
queryComponentPartList () {
this.componentPartData.limit = this.pageSize3
this.componentPartData.page = this.pageIndex3
@ -3234,9 +3124,7 @@ export default {
})
},
/**
* 子物料查询列表
*/
//
queryBatchComponentPartList () {
this.batchComponentPartData.limit = this.pageSize5
this.batchComponentPartData.page = this.pageIndex5
@ -3253,9 +3141,7 @@ export default {
})
},
/**
* copy物料查询列表
*/
// copy
queryCopyPartList () {
this.copyPartData.limit = this.pageSize4
this.copyPartData.page = this.pageIndex4
@ -3358,31 +3244,18 @@ export default {
})
},
/**
* 表格的新增
* @param row
* @param rowIndex
*/
//
rowClassName({ row, rowIndex }) {
row.xh = rowIndex + 1
},
/**
* 选中数据
* @param selection
*/
//
componentSelectionChange(selection) {
this.checkedDetail = selection
},
/**
* 删除子物料
*/
//
deleteComponentPart () {
// if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') {
// this.$message.warning('!')
// return
// }
if (this.checkedDetail.length === 0) {
this.$message.warning('请选择要删除子物料!')
return
@ -3415,17 +3288,7 @@ export default {
}
},
// /**
// *
// * @param row
// */
// componentClickRow (row) {
// this.$refs.componentTable.toggleRowSelection(row)
// },
/**
* 新增子明细方法
*/
//
componentDataSave (isClose) {
if (this.componentData.lineSequence === '' || this.componentData.lineSequence == null) {
this.$message.warning('序号不能为空!')
@ -3658,6 +3521,20 @@ export default {
})
},
//
batchAddPartDB (row) {
this.batchComponentSelections = []
this.batchComponentSelections.push(row)
this.batchAddPart()
},
//
batchDeletePartDB (row) {
this.batchComponentSelections2 = []
this.batchComponentSelections2.push(row)
this.batchDeletePart()
},
batchAddPart () {
if (this.batchComponentSelections == null || this.batchComponentSelections.length === 0) {
this.$message.warning('请选择可选物料!')
@ -3685,9 +3562,7 @@ export default {
this.choosePartList = this.choosePartList.filter(item => !set.has(`${item.site}-${item.partNo}`))
},
/**
* 回车事件
*/
//
focusNextInput (index, type) {
let aaa = ''
if (this.subDetailList.length - 1 === index) {
@ -3700,9 +3575,7 @@ export default {
})
},
/**
* 保存主表信息
*/
//
saveBomHeader () {
if (this.modalData.bu === '' || this.modalData.bu == null) {
this.$message.warning('请选择BU!')
@ -3769,9 +3642,8 @@ export default {
this.saveHeaderLoading = false
})
},
/**
* 复制bom的模态框
*/
// bom
copyBomRevision () {
this.copyBomData = {
site: this.modalData.site,
@ -3796,9 +3668,8 @@ export default {
}
this.copyBomModelFlag = true
},
/**
* 复制bom的方法
*/
// bom
copyBom () {
if (this.copyBomData.partNo === '' || this.copyBomData.partNo == null) {
this.$message.warning('请选择Bom物料!')
@ -3839,9 +3710,8 @@ export default {
this.copyLoading = false
})
},
/**
* 复制alternative的模态框
*/
// alternative
copyBomAlternative () {
this.copyAlternativeData = {
site: this.detailData.site,
@ -3871,9 +3741,7 @@ export default {
this.copyAlternativeModelFlag = true
},
/**
* 复制alternative的方法
*/
// alternative
copyAlternative () {
if (this.copyAlternativeData.partNo === '' || this.copyAlternativeData.partNo == null) {
this.$message.warning('请选择Bom物料!')
@ -3914,9 +3782,7 @@ export default {
})
},
/**
* 新增替代方法
*/
//
detailDataSave () {
if (this.saveDetailData.partNo === '' || this.saveDetailData.partNo == null) {
this.$message.warning('请先选择Bom物料!')
@ -3990,9 +3856,7 @@ export default {
}
},
/**
* 删除替代
*/
//
deleteBomDetail () {
if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) {
this.$message.warning('请选择要删除的替代编码!')
@ -4027,9 +3891,7 @@ export default {
})
},
/**
* 修改替代状态为 Buildable
*/
// Buildable
updateStatusToBuildable () {
this.$confirm(`是否修改状态为Buildable?`, '提示', {
confirmButtonText: '确定',
@ -4055,9 +3917,8 @@ export default {
})
})
},
/**
* 修改替代状态为 Obsolete
*/
// Obsolete
updateStatusToObsolete () {
this.$confirm(`是否修改状态为Obsolete?`, '提示', {
confirmButtonText: '确定',
@ -4084,9 +3945,7 @@ export default {
})
},
/**
* 替代改变事件
*/
//
alternativeChange () {
this.alternativeLoading = true
queryBomComponent(this.detailData).then(({data}) => {
@ -4105,9 +3964,7 @@ export default {
})
},
/**
* 根据物料编码查询工序
*/
//
queryOperationList () {
this.operationData.site = this.modalData.site
this.operationData.buNo = this.modalData.buNo
@ -4135,12 +3992,47 @@ export default {
})
},
//
batchUpdateOperationModal () {
if (this.checkedDetail.length === 0) {
this.$message.warning('请选择要编辑子物料!')
return
}
this.batchOperationData = {
operationId: '',
operationNo: '',
operationName: ''
}
this.batchOperationModelFlag = true
},
//
batchOperationEdit () {
let tempData = {
informationList: this.checkedDetail,
operationId: this.batchOperationData.operationId,
updateBy: this.$store.state.user.name,
}
batchOperationEdit(tempData).then(({data}) => {
if (data && data.code === 0) {
this.subDetailList = data.rows.subDetailList
this.batchOperationModelFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
// ======== chooseList ========
/**
* 获取基础数据列表S
* @param val
* @param type
*/
// S
getBaseList (val, type) {
this.tagNo = val
this.$nextTick(() => {
@ -4155,10 +4047,8 @@ export default {
this.$refs.baseList.init(val, strVal, conSql)
})
},
/**
* 列表方法的回调
* @param val
*/
//
getBaseData (val) {
if (this.tagNo === 215) {
this.componentData.issueToLoc = val.location_id
@ -4171,9 +4061,7 @@ export default {
},
// ======== ========
/**
* 导出excel
*/
// excel
async createExportData () {
this.searchData.limit = -1
this.searchData.page = 1

25
src/views/modules/part/bomSearch3.vue

@ -617,7 +617,7 @@ export default {
serialNumber: '601002002Table2IssueType',
tableId: '601002002Table2',
tableName: 'BOMComponent表',
columnProp: 'issueTypeName',
columnProp: 'issueType',
headerAlign: 'center',
align: 'center',
columnLabel: '生产属性',
@ -637,8 +637,8 @@ export default {
tableName: 'BOMComponent表',
columnProp: 'operationNo',
headerAlign: 'center',
align: 'center',
columnLabel: '工序',
align: 'left',
columnLabel: '工序编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
@ -647,6 +647,24 @@ export default {
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table2OperationName',
tableId: '601002002Table2',
tableName: 'BOMComponent表',
columnProp: 'operationName',
headerAlign: 'center',
align: 'left',
columnLabel: '工序名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 601002002,
@ -808,7 +826,6 @@ export default {
}).catch(() => {
this.queryLoading = false
})
},
// ======== ========

167
src/views/modules/part/bom_create.vue

@ -115,6 +115,7 @@
<el-form-item>
<el-button type="primary" :loading="alternativeLoading" @click="saveComponentModal" style="margin-left: 7px">新增</el-button>
<el-button type="primary" :loading="alternativeLoading" @click="batchSaveComponentModal" style="margin-left: 7px">批量新增</el-button>
<el-button type="primary" :loading="alternativeLoading" @click="batchUpdateOperationModal" style="margin-left: 7px">编辑工序</el-button>
<el-button type="primary" icon="el-icon-upload" @click="bomComponentUpload">导入</el-button>
<el-button type="primary" :loading="alternativeLoading" @click="deleteComponentPart">删除</el-button>
</el-form-item>
@ -202,7 +203,7 @@
</el-tab-pane>
</el-tabs>
<el-footer style="height:15px;margin-top:15px;text-align:center">
<el-button :loading="saveAllLoading" type="primary" @click="saveData()">应用</el-button>
<el-button :loading="saveAllLoading" type="primary" @click="packageSaveData">应用</el-button>
</el-footer>
<!-- 子明细新增模态框 -->
@ -398,7 +399,7 @@
:data="batchComponentPartList"
border
ref="batchSaveTable"
@row-click="batchSaveClickRow"
@row-dblclick="batchAddPartDB"
@selection-change="selectionSaveComponent"
highlight-current-row
style="width: 100%">
@ -450,7 +451,7 @@
:data="choosePartList"
border
ref="batchSaveTable2"
@row-click="batchSaveClickRow2"
@row-dblclick="batchDeletePartDB"
@selection-change="selectionSaveComponent2"
highlight-current-row
style="width: 100%">
@ -564,6 +565,23 @@
</el-footer>
</el-dialog>
<!-- 批量编辑工序 -->
<el-dialog title="工序" top="35vh" :close-on-click-modal="false" v-drag :visible.sync="batchOperationModelFlag" width="350px">
<el-form :inline="true" label-position="top" :model="batchOperationData" style="margin-left: 5px">
<el-form-item label="工序编码">
<span slot="label" @click="queryOperationList"><a>工序</a></span>
<el-input v-model="batchOperationData.operationNo" style="width: 100px"></el-input>
</el-form-item>
<el-form-item label="工序名称">
<el-input v-model="batchOperationData.operationName" disabled style="width: 200px"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:35px;margin-top:20px;text-align:center">
<el-button type="primary" @click="batchOperationEdit">保存</el-button>
<el-button type="primary" @click="batchOperationModelFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 导入 -->
<bom-component-upload ref="BomComponentUpload" @refreshPageTables="queryBomComponentTable" v-drag></bom-component-upload>
@ -595,10 +613,11 @@ import {
batchSaveBomComponent, //
computeQtyPerAssemblySave, // ()
computeQtyPerAssemblyEdit, // ()
batchOperationEdit, //
} from "@/api/part/bomManagement.js"
import ChooseList from '@/views/modules/common/Chooselist_eam'
import {Decimal} from "decimal.js";
import BomComponentUpload from "./bom_component_upload.vue";
import {Decimal} from "decimal.js"
import BomComponentUpload from "./bom_component_upload.vue"
export default {
components: {
BomComponentUpload,
@ -756,6 +775,11 @@ export default {
operationNo: '',
operationName: '',
},
batchOperationData: {
operationId: '',
operationNo: '',
operationName: ''
},
//
rules: {
partNo: [
@ -1146,13 +1170,13 @@ export default {
{
userId: this.$store.state.user.name,
functionId: 601002,
serialNumber: '601002Table2OperationDesc',
serialNumber: '601002Table2OperationNo',
tableId: '601002Table2',
tableName: 'BOM子物料表',
columnProp: 'operationNo',
headerAlign: 'center',
align: 'center',
columnLabel: '工序',
columnLabel: '工序编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
@ -1161,6 +1185,24 @@ export default {
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 601002,
serialNumber: '601002Table2OperationName',
tableId: '601002Table2',
tableName: 'BOM子物料表',
columnProp: 'operationName',
headerAlign: 'center',
align: 'left',
columnLabel: '工序名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 601002,
@ -1355,6 +1397,7 @@ export default {
saveDetailModalFlag :false,
saveDetailModalDisable: false,
operationModelFlag: false,
batchOperationModelFlag: false,
// ======== ========
productionDataFamily: ['RFID003', 'RFID004', 'RFID005', 'RFID006', 'RFID007', 'RFID008', 'RFID009', 'RFID012', 'RFID023', 'RFID024', 'RFID025', 'RFID027'],
materialDataFamily: ['RFID011', 'RFID020', 'RFID021', 'RFID022'],
@ -1428,9 +1471,7 @@ export default {
this.queryBatchComponentPartList()
},
/**
* bom新增模态框
*/
// bom
addModal (row) {
this.modalData = {
flag: '1',
@ -1479,9 +1520,7 @@ export default {
this.$emit('refreshBomLoading')
},
/**
* bom编辑模态框
*/
// bom
async updateModal (row) {
this.modalData = {
flag: '2',
@ -1921,9 +1960,23 @@ export default {
this.componentSaveModal = true
},
/**
* bom新增/编辑
*/
//
packageSaveData () {
const allAHasValue = this.subDetailList.every(item => item.operationId !== null && item.operationId !== '')
if (!allAHasValue) {
this.$confirm(`存在未选择工序的子物料,是否确认保存数据?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.saveData()
})
} else {
this.saveData()
}
},
// bom/
saveData () {
if (this.modalData.partNo === '' || this.modalData.partNo == null) {
this.$message.warning('请选择物料编码!')
@ -2125,13 +2178,16 @@ export default {
})
},
/**
* 双击选中工序
* @param row
*/
//
getRowOperationData (row) {
this.componentData.operationId = row.operationId
this.componentData.operationNo = row.operationNo
if (this.batchOperationModelFlag) {
this.batchOperationData.operationId = row.operationId
this.batchOperationData.operationNo = row.operationNo
this.batchOperationData.operationName = row.operationName
} else {
this.componentData.operationId = row.operationId
this.componentData.operationNo = row.operationNo
}
this.operationModelFlag = false
},
@ -2327,26 +2383,30 @@ export default {
})
},
//
batchSaveClickRow (row) {
this.$refs.batchSaveTable.toggleRowSelection(row)
},
//
selectionSaveComponent (val) {
this.batchComponentSelections = val
},
//
batchSaveClickRow2 (row) {
this.$refs.batchSaveTable2.toggleRowSelection(row)
},
//
selectionSaveComponent2 (val) {
this.batchComponentSelections2 = val
},
//
batchAddPartDB (row) {
this.batchComponentSelections = []
this.batchComponentSelections.push(row)
this.batchAddPart()
},
//
batchDeletePartDB (row) {
this.batchComponentSelections2 = []
this.batchComponentSelections2.push(row)
this.batchDeletePart()
},
batchAddPart () {
if (this.batchComponentSelections == null || this.batchComponentSelections.length === 0) {
this.$message.warning('请选择可选物料!')
@ -2432,9 +2492,7 @@ export default {
})
},
/**
* 新增替代方法
*/
//
detailDataSave () {
if (this.saveDetailData.partNo === '' || this.saveDetailData.partNo == null) {
this.$message.warning('请先选择Bom物料!')
@ -2508,6 +2566,45 @@ export default {
}
},
//
batchUpdateOperationModal () {
if (this.checkedDetail.length === 0) {
this.$message.warning('请选择要编辑子物料!')
return
}
this.batchOperationData = {
operationId: '',
operationNo: '',
operationName: ''
}
this.batchOperationModelFlag = true
},
//
batchOperationEdit () {
let tempData = {
informationList: this.checkedDetail,
operationId: this.batchOperationData.operationId,
updateBy: this.$store.state.user.name,
}
batchOperationEdit(tempData).then(({data}) => {
if (data && data.code === 0) {
this.subDetailList = data.rows.subDetailList
this.batchOperationModelFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
// S
getBaseList (val, type) {
this.tagNo = val

645
src/views/modules/part/copy_bom_modal.vue

@ -75,6 +75,7 @@
<el-form label-position="top" style="margin-top: 2px; margin-left: 2px;">
<el-button type="primary" @click="saveComponentModal2">新增</el-button>
<el-button type="primary" @click="deleteComponentPart2">删除</el-button>
<el-button type="primary" @click="createByStandardOperation">基于标准工序快速创建</el-button>
</el-form>
<el-table
:data="copyTempRoutingList"
@ -216,32 +217,86 @@
</el-dialog>
<!-- BOM子明细新增模态框 -->
<el-dialog title="子物料" :close-on-click-modal="false" top="25vh" v-drag :visible.sync="componentSaveModal1" width="540px">
<el-dialog title="子物料" :close-on-click-modal="false" top="25vh" v-drag :visible.sync="componentSaveModal1" width="620px">
<el-form :inline="true" label-position="top" :model="componentData1" :rules="componentRules1" style="margin-left: 5px">
<el-form-item :label="'序号'" prop="lineSequence">
<el-input-number :controls="false" :step="0" v-model="componentData1.lineSequence" style="width: 50px"></el-input-number>
<el-form-item label="序号" prop="lineSequence">
<el-input-number :controls="false" :step="0" v-model="componentData1.lineSequence" style="width: 49px"></el-input-number>
</el-form-item>
<el-form-item prop="componentPart">
<span v-if="!componentDisableFlag1" slot="label" @click="queryComponentPartModal"><a herf="#">子物料编码</a></span>
<span v-if="componentDisableFlag1" slot="label">子物料编码</span>
<el-input v-model="componentData1.componentPart" :disabled="componentDisableFlag1" @blur="componentPartBlur" style="width: 120px"></el-input>
<el-input v-model="componentData1.componentPart" :disabled="componentDisableFlag1" @blur="componentPartBlur" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'子物料名称'">
<el-input v-model="componentData1.partDesc" disabled style="width: 300px"></el-input>
<el-form-item label="子物料名称">
<el-input v-model="componentData1.partDesc" disabled style="width: 249px"></el-input>
</el-form-item>
<el-form-item label="物料单位">
<el-input v-model="componentData1.printUnitName" disabled style="width: 110px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="componentData1" :rules="componentRules1" style="margin-left: 5px">
<el-form-item :label="'物料单位'">
<el-input v-model="componentData1.printUnitName" disabled style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'单位用量'" prop="qtyPerAssembly">
<el-form-item label="单位用量" prop="qtyPerAssembly">
<el-input-number :controls="false" :step="0" v-model="componentData1.qtyPerAssembly" style="width: 100px"></el-input-number>
</el-form-item>
<el-form-item :label="'损耗率%'" prop="shrinkageFactor">
<el-form-item label="损耗率%" prop="shrinkageFactor">
<el-input-number :controls="false" :step="0" min="0" max="100" v-model="componentData1.shrinkageFactor" style="width: 100px"></el-input-number>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="componentData1" :rules="componentRules1" style="margin-left: 5px">
<el-form-item label="实际生产数量">
<el-input-number :controls="false" :step="0" min="0" v-model="componentData1.productionData" :disabled="!productionDataFamily.includes(componentData1.familyID)" style="width: 115px"></el-input-number>
</el-form-item>
<el-form-item label="材料数量">
<el-input-number :controls="false" :step="0" min="0" v-model="componentData1.materialData" :disabled="!materialDataFamily.includes(componentData1.familyID)" style="width: 115px"></el-input-number>
</el-form-item>
<el-form-item label="成品数量">
<el-input-number :controls="false" :step="0" min="0" v-model="componentData1.finishedProductData" :disabled="!finishedProductDataFamily.includes(componentData1.familyID)" style="width: 115px"></el-input-number>
</el-form-item>
<el-form-item label="用量损耗">
<el-input-number :controls="false" :step="0" min="0" v-model="componentData1.consumptionLoss" :disabled="!consumptionLossFamily.includes(componentData1.familyID)" style="width: 115px"></el-input-number>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="componentData1" :rules="componentRules1" style="margin-left: 5px">
<el-form-item label="涂胶长度">
<el-input-number :controls="false" :step="0" min="0" v-model="componentData1.coatingLength" :disabled="!coatingLengthFamily.includes(componentData1.familyID)" style="width: 115px"></el-input-number>
</el-form-item>
<el-form-item label="胶水克重">
<el-input-number :controls="false" :step="0" min="0" v-model="componentData1.glueWeight" :disabled="!glueWeightFamily.includes(componentData1.familyID)" style="width: 115px"></el-input-number>
</el-form-item>
<el-form-item label="材料宽度">
<el-input-number :controls="false" :step="0" min="0" v-model="componentData1.materialWidth" :disabled="!materialWidthFamily.includes(componentData1.familyID)" style="width: 115px"></el-input-number>
</el-form-item>
<el-form-item label="宽度换算单位">
<el-input-number :controls="false" :step="0" min="0" v-model="componentData1.widthConversion" :disabled="!widthConversionFamily.includes(componentData1.familyID)" style="width: 115px"></el-input-number>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="componentData1" :rules="componentRules1" style="margin-left: 5px">
<el-form-item label="材料长度1">
<el-input-number :controls="false" :step="0" min="0" v-model="componentData1.materialLength" :disabled="!materialLengthFamily.includes(componentData1.familyID)" style="width: 115px"></el-input-number>
</el-form-item>
<el-form-item label="材料厚度">
<el-input-number :controls="false" :step="0" min="0" v-model="componentData1.materialThickness" :disabled="!materialThicknessFamily.includes(componentData1.familyID)" style="width: 115px"></el-input-number>
</el-form-item>
<el-form-item label="面积单位换算">
<el-input-number :controls="false" :step="0" min="0" v-model="componentData1.areaConversion" :disabled="!areaConversionFamily.includes(componentData1.familyID)" style="width: 115px"></el-input-number>
</el-form-item>
<el-form-item label="密度单位换算">
<el-input-number :controls="false" :step="0" min="0" v-model="componentData1.densityConversion" :disabled="!densityConversionFamily.includes(componentData1.familyID)" style="width: 115px"></el-input-number>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="componentData1" :rules="componentRules1" style="margin-left: 5px">
<el-form-item label="材料克重">
<el-input-number :controls="false" :step="0" min="0" v-model="componentData1.materialWeight" :disabled="!materialWeightFamily.includes(componentData1.familyID)" style="width: 115px"></el-input-number>
</el-form-item>
<el-form-item label="材料长度2">
<el-input-number :controls="false" :step="0" min="0" v-model="componentData1.materialLength2" :disabled="!materialLength2Family.includes(componentData1.familyID)" style="width: 115px"></el-input-number>
</el-form-item>
<el-form-item label="单位换算">
<el-input-number :controls="false" :step="0" min="0" v-model="componentData1.unitConversion" :disabled="!unitConversionFamily.includes(componentData1.familyID)" style="width: 115px"></el-input-number>
</el-form-item>
</el-form>
<el-footer style="height:35px;margin-top:20px;text-align:center">
<el-button :loading="computeLoading" type="primary" @click="computeQtyPerAssembly">计算</el-button>
<el-button v-if="componentData1.flag === '1'" type="primary" @click="componentDataSave1(true)">应用</el-button>
<el-button type="primary" @click="componentDataSave1(false)">保存</el-button>
<el-button type="primary" @click="componentSaveModal1 = false">关闭</el-button>
@ -429,6 +484,101 @@
</el-table>
</el-dialog>
<!-- 标准工序 -->
<el-dialog title="标准工序" top="20vh" :close-on-click-modal="false" v-drag :visible.sync="standardOperationModal" width="1000px">
<div class="rq ">
<el-table
:height="350"
:data="standardOperationList"
ref="standardOperationTable"
@selection-change="selectionStandardOperation"
border
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
v-for="(item,index) in standardOperationColumnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false: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-column
prop=""
header-align="center"
align="right"
min-width="100"
label="生产过程人数">
<template slot-scope="scope">
<el-input-number :controls="false" :step="0" :ref="`crewSize${scope.$index}`" v-model="scope.row.crewSize" @keyup.enter.native="focusNextInput(scope.$index, 'crewSize')" style="height: 11px; width: 98%"></el-input-number>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="right"
min-width="80"
label="速度">
<template slot-scope="scope">
<el-input-number :controls="false" :step="0" :ref="`refSpeed${scope.$index}`" v-model="scope.row.refSpeed" @keyup.enter.native="focusNextInput(scope.$index, 'refSpeed')" style="height: 11px; width: 98%"></el-input-number>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="right"
min-width="80"
label="时间">
<template slot-scope="scope">
<el-input-number :controls="false" :step="0" :ref="`refTime${scope.$index}`" v-model="scope.row.refTime" @keyup.enter.native="focusNextInput(scope.$index, 'refTime')" style="height: 11px; width: 98%"></el-input-number>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="right"
min-width="80"
label="效率">
<template slot-scope="scope">
<el-input-number :controls="false" :step="0" :ref="`refEfficiency${scope.$index}`" v-model="scope.row.refEfficiency" @keyup.enter.native="focusNextInput(scope.$index, 'refEfficiency')" style="height: 11px; width: 98%"></el-input-number>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in standardOperationColumnList2" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false: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>
</div>
<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>
</el-dialog>
<!-- chooseList模态框 -->
<ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList>
@ -459,12 +609,19 @@ import {
deleteTempRoutingComponent, // Routing
commitTempItemValue, //
saveCopyResult, //
saveStandardOperationByCopy, //
computeQtyPerAssemblySaveByCopy, // ()
computeQtyPerAssemblyEditByCopy, // ()
} from '@/api/part/bomSearch3.js'
import {
queryPartListAll, // Purchase(Raw)
} from '@/api/part/bomManagement.js'
import {
getStandardOperations,
calculationTime
} from '@/api/part/routingManagement.js'
import {verifyData} from '@/api/part/partInformation.js'
import {Decimal} from "decimal.js";
import {Decimal} from "decimal.js"
import ChooseList from '@/views/modules/common/Chooselist_eam'
export default {
name: 'copyBomModal',
@ -539,6 +696,22 @@ export default {
lineSequence: '',
consumptionItem: '',
productFlag: '',
familyID: '',
productionData: undefined,
materialData: undefined,
finishedProductData: undefined,
consumptionLoss: undefined,
coatingLength: undefined,
glueWeight: undefined,
materialWidth: undefined,
widthConversion: undefined,
materialLength: undefined,
materialThickness: undefined,
areaConversion: undefined,
densityConversion: undefined,
materialWeight: undefined,
materialLength2: undefined,
unitConversion: undefined,
treeId: '',
bomId: ''
},
@ -593,6 +766,8 @@ export default {
checkedDetail1: [],
checkedDetail2: [],
copyAttributeList: [],
standardOperationList: [],
standardOperationSelections: [],
columnBomList: [
{
columnProp: 'lineSequence',
@ -1018,6 +1193,164 @@ export default {
columnWidth: 100
}
],
standardOperationColumnList: [
{
columnProp: 'operationNo',
headerAlign: "center",
align: "center",
columnLabel: '工序编码',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 80
},
{
columnProp: 'operationName',
headerAlign: "center",
align: "left",
columnLabel: '工序描述',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 120
},
{
columnProp: 'setupCrewSize',
headerAlign: "center",
align: "right",
columnLabel: '调机过程中人数',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100
},
{
columnProp: 'setupLaborClassNo',
headerAlign: "center",
align: "left",
columnLabel: '调机时人员等级编码',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100
},
{
columnProp: 'setupLaborClassDesc',
headerAlign: "center",
align: "left",
columnLabel: '调机时人员等级描述',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 150
},
{
columnProp: 'machCycleTime',
headerAlign: 'center',
align: 'right',
columnLabel: '机器处理时间',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100
},
{
columnProp: 'machRunFactor',
headerAlign: 'center',
align: 'right',
columnLabel: '机器单位产出',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100
},
],
standardOperationColumnList2: [
{
columnProp: 'laborClassNo',
headerAlign: "center",
align: "left",
columnLabel: '人员等级编码',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100
},
{
columnProp: 'laborClassDesc',
headerAlign: "center",
align: "left",
columnLabel: '人员等级描述',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 150
},
{
columnProp: 'laborCycleTime',
headerAlign: 'center',
align: 'right',
columnLabel: '人工处理时间',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100
},
{
columnProp: 'laborRunFactor',
headerAlign: 'center',
align: 'right',
columnLabel: '人工单位产出',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100
},
{
columnProp: 'workCenterNo',
headerAlign: "center",
align: "left",
columnLabel: '加工中心编码',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100
},
{
columnProp: 'workCenterDesc',
headerAlign: "center",
align: "left",
columnLabel: '加工中心描述',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 120
},
{
columnProp: 'conditionDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '条件描述',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 200
},
],
columnItemList: [
{
columnProp: 'propertiesItemNo',
@ -1230,7 +1563,25 @@ export default {
componentDisableFlag2: false,
componentPartModelFlag: false,
attributeDialog: true,
saveCopyResultLoading: false
saveCopyResultLoading: false,
standardOperationModal: false,
computeLoading: false,
// ======== ========
productionDataFamily: ['RFID003', 'RFID004', 'RFID005', 'RFID006', 'RFID007', 'RFID008', 'RFID009', 'RFID012', 'RFID023', 'RFID024', 'RFID025', 'RFID027'],
materialDataFamily: ['RFID011', 'RFID020', 'RFID021', 'RFID022'],
finishedProductDataFamily: ['RFID020', 'RFID021', 'RFID022'],
consumptionLossFamily: ['RFID001', 'RFID002', 'RFID014', 'RFID015', 'RFID016', 'RFID017', 'RFID018', 'RFID019'],
coatingLengthFamily: ['RFID013'],
glueWeightFamily: ['RFID013'],
materialWidthFamily: ['RFID014', 'RFID015'],
widthConversionFamily: ['RFID014', 'RFID015'],
materialLengthFamily: ['RFID016', 'RFID017'],
materialThicknessFamily: ['RFID016', 'RFID017', 'RFID018', 'RFID019'],
areaConversionFamily: ['RFID016', 'RFID017', 'RFID018', 'RFID019'],
densityConversionFamily: ['RFID016', 'RFID017', 'RFID018', 'RFID019'],
materialWeightFamily: ['RFID018', 'RFID019'],
materialLength2Family: ['RFID018', 'RFID019'],
unitConversionFamily: ['RFID018', 'RFID019'],
}
},
methods: {
@ -1371,8 +1722,6 @@ export default {
})
},
// Bom
saveComponentModal1 () {
this.componentData1 = {
@ -1402,6 +1751,22 @@ export default {
lineSequence: '',
consumptionItem: 'Consumed',
productFlag: 'component',
familyID: '',
productionData: undefined,
materialData: undefined,
finishedProductData: undefined,
consumptionLoss: undefined,
coatingLength: undefined,
glueWeight: undefined,
materialWidth: undefined,
widthConversion: undefined,
materialLength: undefined,
materialThickness: undefined,
areaConversion: undefined,
densityConversion: undefined,
materialWeight: undefined,
materialLength2: undefined,
unitConversion: undefined,
treeId: this.currentRow.id,
bomId: this.currentRow.bomId
}
@ -1448,6 +1813,22 @@ export default {
lineSequence: row.lineSequence,
consumptionItem: row.consumptionItem,
productFlag: 'component',
familyID: row.familyID,
productionData: row.productionData == null ? undefined : row.productionData,
materialData: row.materialData == null ? undefined : row.materialData,
finishedProductData: row.finishedProductData == null ? undefined : row.finishedProductData,
consumptionLoss: row.consumptionLoss == null ? undefined : row.consumptionLoss,
coatingLength: row.coatingLength == null ? undefined : row.coatingLength,
glueWeight: row.glueWeight == null ? undefined : row.glueWeight,
materialWidth: row.materialWidth == null ? undefined : row.materialWidth,
widthConversion: row.widthConversion == null ? undefined : row.widthConversion,
materialLength: row.materialLength == null ? undefined : row.materialLength,
materialThickness: row.materialThickness == null ? undefined : row.materialThickness,
areaConversion: row.areaConversion == null ? undefined : row.areaConversion,
densityConversion: row.densityConversion == null ? undefined : row.densityConversion,
materialWeight: row.materialWeight == null ? undefined : row.materialWeight,
materialLength2: row.materialLength2 == null ? undefined : row.materialLength2,
unitConversion: row.unitConversion == null ? undefined : row.unitConversion,
treeId: row.treeId,
bomId: row.bomId
}
@ -1514,6 +1895,90 @@ export default {
}
},
//
computeQtyPerAssembly () {
if (this.componentData1.lineSequence === '' || this.componentData1.lineSequence == null) {
this.$message.warning('序号不能为空!')
return
}
if (this.componentData1.partNo === '' || this.componentData1.partNo == null) {
this.$message.warning('请选择主记录物料编码!')
return
}
if (this.componentData1.bomType === '' || this.componentData1.bomType == null) {
this.$message.warning('请选择主记录制造类型!')
return
}
if (this.componentData1.engChgLevel === '' || this.componentData1.engChgLevel == null) {
this.$message.warning('请填写主记录BOM版本号!')
return
}
if (this.componentData1.componentPart === '' || this.componentData1.componentPart == null) {
this.$message.warning('请选择子物料编码!')
return
}
if (this.componentData1.productFlag === 'component' && (this.componentData1.consumptionItem === '' || this.componentData1.consumptionItem == null)) {
this.$message.warning('请选择消耗项目!')
return
}
if (this.componentData1.componentScrap === '' || this.componentData1.componentScrap == null) {
this.$message.warning('请填写调机量!')
return
}
if (this.componentData1.shrinkageFactor === '' || this.componentData1.shrinkageFactor == null) {
this.$message.warning('请填写损耗率!')
return
}
if (this.componentData1.issueType === '' || this.componentData1.issueType == null) {
this.$message.warning('请选择生产属性!')
return
}
this.computeLoading = true
if (this.componentData1.flag === '1') {
computeQtyPerAssemblySaveByCopy(this.componentData1).then(({data}) => {
if (data && data.code === 0) {
this.queryCopyTempBom()
//
this.updateComponentModal1(data.rows.rowData)
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
this.computeLoading = false
}).catch(() => {
this.computeLoading = false
})
} else if (this.componentData1.flag === '2') {
computeQtyPerAssemblyEditByCopy(this.componentData1).then(({data}) => {
if (data && data.code === 0) {
this.queryCopyTempBom()
//
this.updateComponentModal1(data.rows.rowData)
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
this.computeLoading = false
}).catch(() => {
this.computeLoading = false
})
}
},
//
componentSelectionChange1(selection) {
this.checkedDetail1 = selection
@ -1552,7 +2017,6 @@ export default {
}
},
// Routing
saveComponentModal2 () {
this.componentData2 = {
@ -1561,8 +2025,8 @@ export default {
site: this.currentRow.site,
buNo: this.currentRow.buNo,
partNo: this.currentRow.partNo,
routingRevision: this.currentRow.routingRevision,
routingType: this.currentRow.routingType,
routingRevision: this.currentRow.engChgLevel,
routingType: this.currentRow.bomType,
alternativeNo: this.currentRow.alternativeNo,
operationId: '',
operationNo: '',
@ -1794,6 +2258,122 @@ export default {
}
},
//
focusNextInput (index, type) {
let aaa = ''
if (this.standardOperationList.length - 1 === index) {
aaa = `${type}0`
} else {
aaa = `${type}${index + 1}`
}
this.$nextTick(() => {
this.$refs[aaa].focus()
})
},
//
createByStandardOperation () {
let tempData = {
site: this.modalData.site,
buNo: this.modalData.buNo,
partNo: this.currentRow.partNo,
}
this.standardOperationSelections = []
getStandardOperations(tempData).then(({data}) => {
if (data && data.code === 0) {
this.standardOperationList = data.rows
this.standardOperationModal = true
} else {
this.$alert(data.msg, '提示', {
confirmButtonText: '确定'
})
}
})
},
//
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.currentRow.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) {
this.$message.warning('请选择标准工序!')
return
}
this.$confirm("是否确认更改替代下的工序?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
let tempData = {
treeId: this.currentRow.id,
bomId: this.currentRow.bomId,
site: this.modalData.site,
buNo: this.modalData.buNo,
partNo: this.currentRow.partNo,
routingRevision: this.currentRow.engChgLevel,
routingType: this.currentRow.bomType,
alternativeNo: this.currentRow.alternativeNo,
createBy: this.$store.state.user.name,
informationList: this.standardOperationSelections
}
saveStandardOperationByCopy(tempData).then(({data}) => {
if (data && data.code === 0) {
this.queryCopyTempRouting()
this.standardOperationModal = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '提示', {
confirmButtonText: '确定'
})
}
})
})
},
//
selectionStandardOperation (val) {
this.standardOperationSelections = val
},
//
clickSave () {
if (!this.attributeDialog) { //
@ -1832,7 +2412,6 @@ export default {
})
},
//
queryComponentPartModal () {
this.componentPartData.limit = this.pageSize1
@ -1876,6 +2455,18 @@ export default {
this.componentData1.partDesc = row.partDesc
this.componentData1.printUnit = row.printUnit
this.componentData1.printUnitName = row.printUnitName
this.componentData1.familyID = row.familyID
if (this.widthConversionFamily.includes(row.familyID)) {
this.componentData1.widthConversion = 1
} else if (this.areaConversionFamily.includes(row.familyID)) {
this.componentData1.areaConversion = 1
} else if (this.densityConversionFamily.includes(row.familyID)) {
this.componentData1.densityConversion = 1
} else if (this.unitConversionFamily.includes(row.familyID)) {
this.componentData1.unitConversion = 1
} else if (this.consumptionLossFamily.includes(row.familyID)) {
this.componentData1.consumptionLoss = 1
}
this.componentPartModelFlag = false
},
@ -1893,6 +2484,18 @@ export default {
this.componentData1.partDesc = data.page.list[0].partDesc
this.componentData1.printUnit = data.page.list[0].printUnit
this.componentData1.printUnitName = data.page.list[0].printUnitName
this.componentData1.familyID = data.page.list[0].familyID
if (this.widthConversionFamily.includes(data.page.list[0].familyID)) {
this.componentData1.widthConversion = 1
} else if (this.areaConversionFamily.includes(data.page.list[0].familyID)) {
this.componentData1.areaConversion = 1
} else if (this.densityConversionFamily.includes(data.page.list[0].familyID)) {
this.componentData1.densityConversion = 1
} else if (this.unitConversionFamily.includes(data.page.list[0].familyID)) {
this.componentData1.unitConversion = 1
} else if (this.consumptionLossFamily.includes(data.page.list[0].familyID)) {
this.componentData1.consumptionLoss = 1
}
return
}
}
@ -1901,9 +2504,9 @@ export default {
this.componentData1.partDesc = ''
this.componentData1.printUnit = ''
this.componentData1.printUnitName = ''
this.componentData1.familyID = ''
},
// BOM
handleChangeBomVersion() {
let node = this.$refs.tree.getCurrentNode()
@ -2007,7 +2610,6 @@ export default {
})
},
// Routing
handleChangeRoutingVersion () {
let node = this.$refs.tree.getCurrentNode()
@ -2106,7 +2708,6 @@ export default {
})
},
//
tabClick (tab, event) {
if (this.activeTable !== 'temp_item' && !this.attributeDialog) {

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

@ -656,36 +656,92 @@
<!-- 标准工序 -->
<el-dialog title="标准工序" top="20vh" :close-on-click-modal="false" v-drag :visible.sync="standardOperationModal" width="1000px">
<el-table
:height="350"
:data="standardOperationList"
ref="standardOperationTable"
@row-click="standardOperationClickRow"
@selection-change="selectionStandardOperation"
border
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
v-for="(item,index) in standardOperationColumnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false: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>
<div class="rq ">
<el-table
:height="350"
:data="standardOperationList"
ref="standardOperationTable"
@selection-change="selectionStandardOperation"
border
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
v-for="(item,index) in standardOperationColumnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false: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-column
prop=""
header-align="center"
align="right"
min-width="100"
label="生产过程人数">
<template slot-scope="scope">
<el-input-number :controls="false" :step="0" :ref="`crewSize${scope.$index}`" v-model="scope.row.crewSize" @keyup.enter.native="focusNextInput(scope.$index, 'crewSize')" style="height: 11px; width: 98%"></el-input-number>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="right"
min-width="80"
label="速度">
<template slot-scope="scope">
<el-input-number :controls="false" :step="0" :ref="`refSpeed${scope.$index}`" v-model="scope.row.refSpeed" @keyup.enter.native="focusNextInput(scope.$index, 'refSpeed')" style="height: 11px; width: 98%"></el-input-number>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="right"
min-width="80"
label="时间">
<template slot-scope="scope">
<el-input-number :controls="false" :step="0" :ref="`refTime${scope.$index}`" v-model="scope.row.refTime" @keyup.enter.native="focusNextInput(scope.$index, 'refTime')" style="height: 11px; width: 98%"></el-input-number>
</template>
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="right"
min-width="80"
label="效率">
<template slot-scope="scope">
<el-input-number :controls="false" :step="0" :ref="`refEfficiency${scope.$index}`" v-model="scope.row.refEfficiency" @keyup.enter.native="focusNextInput(scope.$index, 'refEfficiency')" style="height: 11px; width: 98%"></el-input-number>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in standardOperationColumnList2" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false: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>
</div>
<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>
@ -1703,7 +1759,7 @@ export default {
{
columnProp: 'operationName',
headerAlign: "center",
align: "center",
align: "left",
columnLabel: '工序描述',
columnHidden: false,
columnImage: false,
@ -1725,24 +1781,24 @@ export default {
{
columnProp: 'setupLaborClassNo',
headerAlign: "center",
align: "center",
align: "left",
columnLabel: '调机时人员等级编码',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 120
columnWidth: 100
},
{
columnProp: 'setupLaborClassDesc',
headerAlign: "center",
align: "center",
align: "left",
columnLabel: '调机时人员等级描述',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 120
columnWidth: 150
},
{
columnProp: 'machCycleTime',
@ -1766,38 +1822,29 @@ export default {
fixed: '',
columnWidth: 100
},
{
columnProp: 'crewSize',
headerAlign: "center",
align: "right",
columnLabel: '生产过程中人数',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100
},
],
standardOperationColumnList2: [
{
columnProp: 'laborClassNo',
headerAlign: "center",
align: "center",
align: "left",
columnLabel: '人员等级编码',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 120
columnWidth: 100
},
{
columnProp: 'laborClassDesc',
headerAlign: "center",
align: "center",
align: "left",
columnLabel: '人员等级描述',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 120
columnWidth: 150
},
{
columnProp: 'laborCycleTime',
@ -1824,7 +1871,7 @@ export default {
{
columnProp: 'workCenterNo',
headerAlign: "center",
align: "center",
align: "left",
columnLabel: '加工中心编码',
columnHidden: false,
columnImage: false,
@ -1835,7 +1882,7 @@ export default {
{
columnProp: 'workCenterDesc',
headerAlign: "center",
align: "center",
align: "left",
columnLabel: '加工中心描述',
columnHidden: false,
columnImage: false,
@ -1846,7 +1893,7 @@ export default {
{
columnProp: 'conditionDesc',
headerAlign: 'center',
align: 'center',
align: 'left',
columnLabel: '条件描述',
columnHidden: false,
columnImage: false,
@ -3097,7 +3144,7 @@ export default {
*/
focusNextInput (index, type) {
let aaa = ''
if (this.subDetailList.length - 1 === index) {
if (this.standardOperationList.length - 1 === index) {
aaa = `${type}0`
} else {
aaa = `${type}${index + 1}`
@ -3662,11 +3709,6 @@ export default {
this.componentData.laborClassDesc = ''
},
//
standardOperationClickRow (row) {
this.$refs.standardOperationTable.toggleRowSelection(row)
},
//
selectionStandardOperation (val) {
this.standardOperationSelections = val

Loading…
Cancel
Save