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 {*} * @returns {*}
*/ */
export const computeQtyPerAssemblyEdit = data => createAPI(`/part/bomManagement/computeQtyPerAssemblyEdit`,'post',data) 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 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: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
eamObjectDefectDelete(row).then(({data}) => { eamObjectDefectDelete(row).then(({data}) => {
if (data && data.code == '0') { if (data && data.code == '0') {

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

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

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

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

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

@ -115,6 +115,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" :loading="alternativeLoading" @click="saveComponentModal" style="margin-left: 7px">新增</el-button> <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="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" icon="el-icon-upload" @click="bomComponentUpload">导入</el-button>
<el-button type="primary" :loading="alternativeLoading" @click="deleteComponentPart">删除</el-button> <el-button type="primary" :loading="alternativeLoading" @click="deleteComponentPart">删除</el-button>
</el-form-item> </el-form-item>
@ -202,7 +203,7 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-footer style="height:15px;margin-top:15px;text-align:center"> <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> </el-footer>
<!-- 子明细新增模态框 --> <!-- 子明细新增模态框 -->
@ -398,7 +399,7 @@
:data="batchComponentPartList" :data="batchComponentPartList"
border border
ref="batchSaveTable" ref="batchSaveTable"
@row-click="batchSaveClickRow"
@row-dblclick="batchAddPartDB"
@selection-change="selectionSaveComponent" @selection-change="selectionSaveComponent"
highlight-current-row highlight-current-row
style="width: 100%"> style="width: 100%">
@ -450,7 +451,7 @@
:data="choosePartList" :data="choosePartList"
border border
ref="batchSaveTable2" ref="batchSaveTable2"
@row-click="batchSaveClickRow2"
@row-dblclick="batchDeletePartDB"
@selection-change="selectionSaveComponent2" @selection-change="selectionSaveComponent2"
highlight-current-row highlight-current-row
style="width: 100%"> style="width: 100%">
@ -564,6 +565,23 @@
</el-footer> </el-footer>
</el-dialog> </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> <bom-component-upload ref="BomComponentUpload" @refreshPageTables="queryBomComponentTable" v-drag></bom-component-upload>
@ -595,10 +613,11 @@ import {
batchSaveBomComponent, // batchSaveBomComponent, //
computeQtyPerAssemblySave, // () computeQtyPerAssemblySave, // ()
computeQtyPerAssemblyEdit, // () computeQtyPerAssemblyEdit, // ()
batchOperationEdit, //
} from "@/api/part/bomManagement.js" } from "@/api/part/bomManagement.js"
import ChooseList from '@/views/modules/common/Chooselist_eam' 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 { export default {
components: { components: {
BomComponentUpload, BomComponentUpload,
@ -756,6 +775,11 @@ export default {
operationNo: '', operationNo: '',
operationName: '', operationName: '',
}, },
batchOperationData: {
operationId: '',
operationNo: '',
operationName: ''
},
// //
rules: { rules: {
partNo: [ partNo: [
@ -1146,13 +1170,13 @@ export default {
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 601002, functionId: 601002,
serialNumber: '601002Table2OperationDesc',
serialNumber: '601002Table2OperationNo',
tableId: '601002Table2', tableId: '601002Table2',
tableName: 'BOM子物料表', tableName: 'BOM子物料表',
columnProp: 'operationNo', columnProp: 'operationNo',
headerAlign: 'center', headerAlign: 'center',
align: 'center', align: 'center',
columnLabel: '工序',
columnLabel: '工序编码',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
@ -1161,6 +1185,24 @@ export default {
fixed: '', fixed: '',
columnWidth: 80 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, userId: this.$store.state.user.name,
functionId: 601002, functionId: 601002,
@ -1355,6 +1397,7 @@ export default {
saveDetailModalFlag :false, saveDetailModalFlag :false,
saveDetailModalDisable: false, saveDetailModalDisable: false,
operationModelFlag: false, operationModelFlag: false,
batchOperationModelFlag: false,
// ======== ======== // ======== ========
productionDataFamily: ['RFID003', 'RFID004', 'RFID005', 'RFID006', 'RFID007', 'RFID008', 'RFID009', 'RFID012', 'RFID023', 'RFID024', 'RFID025', 'RFID027'], productionDataFamily: ['RFID003', 'RFID004', 'RFID005', 'RFID006', 'RFID007', 'RFID008', 'RFID009', 'RFID012', 'RFID023', 'RFID024', 'RFID025', 'RFID027'],
materialDataFamily: ['RFID011', 'RFID020', 'RFID021', 'RFID022'], materialDataFamily: ['RFID011', 'RFID020', 'RFID021', 'RFID022'],
@ -1428,9 +1471,7 @@ export default {
this.queryBatchComponentPartList() this.queryBatchComponentPartList()
}, },
/**
* bom新增模态框
*/
// bom
addModal (row) { addModal (row) {
this.modalData = { this.modalData = {
flag: '1', flag: '1',
@ -1479,9 +1520,7 @@ export default {
this.$emit('refreshBomLoading') this.$emit('refreshBomLoading')
}, },
/**
* bom编辑模态框
*/
// bom
async updateModal (row) { async updateModal (row) {
this.modalData = { this.modalData = {
flag: '2', flag: '2',
@ -1921,9 +1960,23 @@ export default {
this.componentSaveModal = true 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 () { saveData () {
if (this.modalData.partNo === '' || this.modalData.partNo == null) { if (this.modalData.partNo === '' || this.modalData.partNo == null) {
this.$message.warning('请选择物料编码!') this.$message.warning('请选择物料编码!')
@ -2125,13 +2178,16 @@ export default {
}) })
}, },
/**
* 双击选中工序
* @param row
*/
//
getRowOperationData (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 this.operationModelFlag = false
}, },
@ -2327,26 +2383,30 @@ export default {
}) })
}, },
//
batchSaveClickRow (row) {
this.$refs.batchSaveTable.toggleRowSelection(row)
},
// //
selectionSaveComponent (val) { selectionSaveComponent (val) {
this.batchComponentSelections = val this.batchComponentSelections = val
}, },
//
batchSaveClickRow2 (row) {
this.$refs.batchSaveTable2.toggleRowSelection(row)
},
// //
selectionSaveComponent2 (val) { selectionSaveComponent2 (val) {
this.batchComponentSelections2 = 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 () { batchAddPart () {
if (this.batchComponentSelections == null || this.batchComponentSelections.length === 0) { if (this.batchComponentSelections == null || this.batchComponentSelections.length === 0) {
this.$message.warning('请选择可选物料!') this.$message.warning('请选择可选物料!')
@ -2432,9 +2492,7 @@ export default {
}) })
}, },
/**
* 新增替代方法
*/
//
detailDataSave () { detailDataSave () {
if (this.saveDetailData.partNo === '' || this.saveDetailData.partNo == null) { if (this.saveDetailData.partNo === '' || this.saveDetailData.partNo == null) {
this.$message.warning('请先选择Bom物料!') 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 // S
getBaseList (val, type) { getBaseList (val, type) {
this.tagNo = val 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-form label-position="top" style="margin-top: 2px; margin-left: 2px;">
<el-button type="primary" @click="saveComponentModal2">新增</el-button> <el-button type="primary" @click="saveComponentModal2">新增</el-button>
<el-button type="primary" @click="deleteComponentPart2">删除</el-button> <el-button type="primary" @click="deleteComponentPart2">删除</el-button>
<el-button type="primary" @click="createByStandardOperation">基于标准工序快速创建</el-button>
</el-form> </el-form>
<el-table <el-table
:data="copyTempRoutingList" :data="copyTempRoutingList"
@ -216,32 +217,86 @@
</el-dialog> </el-dialog>
<!-- BOM子明细新增模态框 --> <!-- 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 :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>
<el-form-item prop="componentPart"> <el-form-item prop="componentPart">
<span v-if="!componentDisableFlag1" slot="label" @click="queryComponentPartModal"><a herf="#">子物料编码</a></span> <span v-if="!componentDisableFlag1" slot="label" @click="queryComponentPartModal"><a herf="#">子物料编码</a></span>
<span v-if="componentDisableFlag1" slot="label">子物料编码</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>
<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-item>
</el-form> </el-form>
<el-form :inline="true" label-position="top" :model="componentData1" :rules="componentRules1" style="margin-left: 5px"> <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-input-number :controls="false" :step="0" v-model="componentData1.qtyPerAssembly" style="width: 100px"></el-input-number>
</el-form-item> </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-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-item>
</el-form> </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-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 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="componentDataSave1(false)">保存</el-button>
<el-button type="primary" @click="componentSaveModal1 = false">关闭</el-button> <el-button type="primary" @click="componentSaveModal1 = false">关闭</el-button>
@ -429,6 +484,101 @@
</el-table> </el-table>
</el-dialog> </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模态框 -->
<ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList> <ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList>
@ -459,12 +609,19 @@ import {
deleteTempRoutingComponent, // Routing deleteTempRoutingComponent, // Routing
commitTempItemValue, // commitTempItemValue, //
saveCopyResult, // saveCopyResult, //
saveStandardOperationByCopy, //
computeQtyPerAssemblySaveByCopy, // ()
computeQtyPerAssemblyEditByCopy, // ()
} from '@/api/part/bomSearch3.js' } from '@/api/part/bomSearch3.js'
import { import {
queryPartListAll, // Purchase(Raw) queryPartListAll, // Purchase(Raw)
} from '@/api/part/bomManagement.js' } from '@/api/part/bomManagement.js'
import {
getStandardOperations,
calculationTime
} from '@/api/part/routingManagement.js'
import {verifyData} from '@/api/part/partInformation.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' import ChooseList from '@/views/modules/common/Chooselist_eam'
export default { export default {
name: 'copyBomModal', name: 'copyBomModal',
@ -539,6 +696,22 @@ export default {
lineSequence: '', lineSequence: '',
consumptionItem: '', consumptionItem: '',
productFlag: '', 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: '', treeId: '',
bomId: '' bomId: ''
}, },
@ -593,6 +766,8 @@ export default {
checkedDetail1: [], checkedDetail1: [],
checkedDetail2: [], checkedDetail2: [],
copyAttributeList: [], copyAttributeList: [],
standardOperationList: [],
standardOperationSelections: [],
columnBomList: [ columnBomList: [
{ {
columnProp: 'lineSequence', columnProp: 'lineSequence',
@ -1018,6 +1193,164 @@ export default {
columnWidth: 100 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: [ columnItemList: [
{ {
columnProp: 'propertiesItemNo', columnProp: 'propertiesItemNo',
@ -1230,7 +1563,25 @@ export default {
componentDisableFlag2: false, componentDisableFlag2: false,
componentPartModelFlag: false, componentPartModelFlag: false,
attributeDialog: true, 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: { methods: {
@ -1371,8 +1722,6 @@ export default {
}) })
}, },
// Bom // Bom
saveComponentModal1 () { saveComponentModal1 () {
this.componentData1 = { this.componentData1 = {
@ -1402,6 +1751,22 @@ export default {
lineSequence: '', lineSequence: '',
consumptionItem: 'Consumed', consumptionItem: 'Consumed',
productFlag: 'component', 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, treeId: this.currentRow.id,
bomId: this.currentRow.bomId bomId: this.currentRow.bomId
} }
@ -1448,6 +1813,22 @@ export default {
lineSequence: row.lineSequence, lineSequence: row.lineSequence,
consumptionItem: row.consumptionItem, consumptionItem: row.consumptionItem,
productFlag: 'component', 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, treeId: row.treeId,
bomId: row.bomId 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) { componentSelectionChange1(selection) {
this.checkedDetail1 = selection this.checkedDetail1 = selection
@ -1552,7 +2017,6 @@ export default {
} }
}, },
// Routing // Routing
saveComponentModal2 () { saveComponentModal2 () {
this.componentData2 = { this.componentData2 = {
@ -1561,8 +2025,8 @@ export default {
site: this.currentRow.site, site: this.currentRow.site,
buNo: this.currentRow.buNo, buNo: this.currentRow.buNo,
partNo: this.currentRow.partNo, partNo: this.currentRow.partNo,
routingRevision: this.currentRow.routingRevision,
routingType: this.currentRow.routingType,
routingRevision: this.currentRow.engChgLevel,
routingType: this.currentRow.bomType,
alternativeNo: this.currentRow.alternativeNo, alternativeNo: this.currentRow.alternativeNo,
operationId: '', operationId: '',
operationNo: '', 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 () { clickSave () {
if (!this.attributeDialog) { // if (!this.attributeDialog) { //
@ -1832,7 +2412,6 @@ export default {
}) })
}, },
// //
queryComponentPartModal () { queryComponentPartModal () {
this.componentPartData.limit = this.pageSize1 this.componentPartData.limit = this.pageSize1
@ -1876,6 +2455,18 @@ export default {
this.componentData1.partDesc = row.partDesc this.componentData1.partDesc = row.partDesc
this.componentData1.printUnit = row.printUnit this.componentData1.printUnit = row.printUnit
this.componentData1.printUnitName = row.printUnitName 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 this.componentPartModelFlag = false
}, },
@ -1893,6 +2484,18 @@ export default {
this.componentData1.partDesc = data.page.list[0].partDesc this.componentData1.partDesc = data.page.list[0].partDesc
this.componentData1.printUnit = data.page.list[0].printUnit this.componentData1.printUnit = data.page.list[0].printUnit
this.componentData1.printUnitName = data.page.list[0].printUnitName 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 return
} }
} }
@ -1901,9 +2504,9 @@ export default {
this.componentData1.partDesc = '' this.componentData1.partDesc = ''
this.componentData1.printUnit = '' this.componentData1.printUnit = ''
this.componentData1.printUnitName = '' this.componentData1.printUnitName = ''
this.componentData1.familyID = ''
}, },
// BOM // BOM
handleChangeBomVersion() { handleChangeBomVersion() {
let node = this.$refs.tree.getCurrentNode() let node = this.$refs.tree.getCurrentNode()
@ -2007,7 +2610,6 @@ export default {
}) })
}, },
// Routing // Routing
handleChangeRoutingVersion () { handleChangeRoutingVersion () {
let node = this.$refs.tree.getCurrentNode() let node = this.$refs.tree.getCurrentNode()
@ -2106,7 +2708,6 @@ export default {
}) })
}, },
// //
tabClick (tab, event) { tabClick (tab, event) {
if (this.activeTable !== 'temp_item' && !this.attributeDialog) { 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-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-footer style="height:35px;margin-top:10px;text-align:center">
<el-button type="primary" @click="calculationTime">计算工时</el-button> <el-button type="primary" @click="calculationTime">计算工时</el-button>
<el-button type="primary" @click="saveStandardOperation">保存</el-button> <el-button type="primary" @click="saveStandardOperation">保存</el-button>
@ -1703,7 +1759,7 @@ export default {
{ {
columnProp: 'operationName', columnProp: 'operationName',
headerAlign: "center", headerAlign: "center",
align: "center",
align: "left",
columnLabel: '工序描述', columnLabel: '工序描述',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
@ -1725,24 +1781,24 @@ export default {
{ {
columnProp: 'setupLaborClassNo', columnProp: 'setupLaborClassNo',
headerAlign: "center", headerAlign: "center",
align: "center",
align: "left",
columnLabel: '调机时人员等级编码', columnLabel: '调机时人员等级编码',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
status: true, status: true,
fixed: '', fixed: '',
columnWidth: 120
columnWidth: 100
}, },
{ {
columnProp: 'setupLaborClassDesc', columnProp: 'setupLaborClassDesc',
headerAlign: "center", headerAlign: "center",
align: "center",
align: "left",
columnLabel: '调机时人员等级描述', columnLabel: '调机时人员等级描述',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
status: true, status: true,
fixed: '', fixed: '',
columnWidth: 120
columnWidth: 150
}, },
{ {
columnProp: 'machCycleTime', columnProp: 'machCycleTime',
@ -1766,38 +1822,29 @@ export default {
fixed: '', fixed: '',
columnWidth: 100 columnWidth: 100
}, },
{
columnProp: 'crewSize',
headerAlign: "center",
align: "right",
columnLabel: '生产过程中人数',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100
},
],
standardOperationColumnList2: [
{ {
columnProp: 'laborClassNo', columnProp: 'laborClassNo',
headerAlign: "center", headerAlign: "center",
align: "center",
align: "left",
columnLabel: '人员等级编码', columnLabel: '人员等级编码',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
status: true, status: true,
fixed: '', fixed: '',
columnWidth: 120
columnWidth: 100
}, },
{ {
columnProp: 'laborClassDesc', columnProp: 'laborClassDesc',
headerAlign: "center", headerAlign: "center",
align: "center",
align: "left",
columnLabel: '人员等级描述', columnLabel: '人员等级描述',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
status: true, status: true,
fixed: '', fixed: '',
columnWidth: 120
columnWidth: 150
}, },
{ {
columnProp: 'laborCycleTime', columnProp: 'laborCycleTime',
@ -1824,7 +1871,7 @@ export default {
{ {
columnProp: 'workCenterNo', columnProp: 'workCenterNo',
headerAlign: "center", headerAlign: "center",
align: "center",
align: "left",
columnLabel: '加工中心编码', columnLabel: '加工中心编码',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
@ -1835,7 +1882,7 @@ export default {
{ {
columnProp: 'workCenterDesc', columnProp: 'workCenterDesc',
headerAlign: "center", headerAlign: "center",
align: "center",
align: "left",
columnLabel: '加工中心描述', columnLabel: '加工中心描述',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
@ -1846,7 +1893,7 @@ export default {
{ {
columnProp: 'conditionDesc', columnProp: 'conditionDesc',
headerAlign: 'center', headerAlign: 'center',
align: 'center',
align: 'left',
columnLabel: '条件描述', columnLabel: '条件描述',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
@ -3097,7 +3144,7 @@ export default {
*/ */
focusNextInput (index, type) { focusNextInput (index, type) {
let aaa = '' let aaa = ''
if (this.subDetailList.length - 1 === index) {
if (this.standardOperationList.length - 1 === index) {
aaa = `${type}0` aaa = `${type}0`
} else { } else {
aaa = `${type}${index + 1}` aaa = `${type}${index + 1}`
@ -3662,11 +3709,6 @@ export default {
this.componentData.laborClassDesc = '' this.componentData.laborClassDesc = ''
}, },
//
standardOperationClickRow (row) {
this.$refs.standardOperationTable.toggleRowSelection(row)
},
// //
selectionStandardOperation (val) { selectionStandardOperation (val) {
this.standardOperationSelections = val this.standardOperationSelections = val

Loading…
Cancel
Save