Browse Source

2023-11-30

master
fengyuan_yang 2 years ago
parent
commit
405199ad68
  1. 7
      src/api/part/routingManagement.js
  2. 194
      src/views/modules/part/bomManagement.vue
  3. 727
      src/views/modules/part/routingManagement.vue

7
src/api/part/routingManagement.js

@ -98,5 +98,12 @@ export const updateRoutingComponent = data => createAPI(`/plm/routingManagement/
*/
export const deleteRoutingComponent = data => createAPI(`/plm/routingManagement/deleteRoutingComponent`,'post',data)
/**
* 查询工序列表
* @param data
* @returns {*}
*/
export const queryOperationList = data => createAPI(`/plm/routingManagement/queryOperationList`,'post',data)

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

@ -9,7 +9,7 @@
<el-input v-model="searchData.partDesc" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="getDataList()">查询</el-button>
<el-button :loading="queryLoading" @click="getDataList()">查询</el-button>
<el-button type="primary" @click="addModal()">新增</el-button>
<el-button type="primary" @click="delModal()">删除</el-button>
<download-excel
@ -35,7 +35,6 @@
:data="dataList"
border
@selection-change="selectionBom"
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
type="selection"
@ -86,7 +85,7 @@
</el-pagination>
<!-- bom新增/编辑模态框 -->
<el-dialog :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="1000px">
<el-dialog :close-on-click-modal="false" :before-close="closeModalX" v-drag :visible.sync="modalFlag" width="1000px">
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 5px">
<el-form-item prop="partNo" :rules="rules.partNo">
<span v-if="!modalDisableFlag" slot="label" @click="queryPartList()"><a herf="#">物料编码</a></span>
@ -107,8 +106,8 @@
<el-option label="配方" value="F"></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="!modalDisableFlag">
<el-button type="primary" @click="saveBomHeader()" style="margin-top: 23px;width: 142px">保存</el-button>
<el-form-item :label="'净重'">
<el-input v-model="modalData.netWeight" type="number" style="width: 141px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
@ -140,8 +139,8 @@
<el-form-item :label="'工程版本号'">
<el-input v-model="modalData.engRevision" style="width: 142px"></el-input>
</el-form-item>
<el-form-item :label="'净重'">
<el-input v-model="modalData.netWeight" type="number" style="width: 141px"></el-input>
<el-form-item v-if="!modalDisableFlag">
<el-button :loading="saveHeaderLoading" type="primary" @click="saveBomHeader()" style="margin-top: 23px;width: 141px">保存</el-button>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
@ -197,7 +196,6 @@
height="256px"
border
ref="componentTable"
v-loading="dataListLoading"
@row-click="componentClickRow"
:row-class-name="rowClassName"
@selection-change="componentSelectionChange"
@ -232,7 +230,7 @@
</el-tab-pane>
</el-tabs>
<el-footer style="height:30px;margin-top:20px;text-align:center">
<el-button type="primary" @click="saveData()">保存</el-button>
<el-button :loading="saveAllLoading" type="primary" @click="saveData()">保存</el-button>
<el-button type="primary" @click="closeModal()">关闭</el-button>
</el-footer>
</el-dialog>
@ -256,7 +254,7 @@
</el-form-item>
</el-form>
<el-footer style="height:35px;margin-top:65px;text-align:center">
<el-button type="primary" @click="detailDataSave()">保存</el-button>
<el-button :loading="saveDetailLoading" type="primary" @click="detailDataSave()">保存</el-button>
<el-button type="primary" @click="saveDetailModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
@ -280,7 +278,6 @@
:data="partList"
@row-dblclick="getRowData"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
v-for="(item,index) in partColumnList" :key="index"
@ -322,7 +319,6 @@
:data="componentPartList"
@row-dblclick="getComponentRowData"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
v-for="(item,index) in componentPartColumnList" :key="index"
@ -397,7 +393,7 @@
</el-form-item>
</el-form>
<el-footer style="height:35px;margin-top:65px;text-align:center">
<el-button type="primary" @click="componentDataSave()">保存</el-button>
<el-button :loading="saveComponentLoading" type="primary" @click="componentDataSave()">保存</el-button>
<el-button type="primary" @click="componentSaveModal = false">关闭</el-button>
</el-footer>
</el-dialog>
@ -472,8 +468,12 @@ export default {
page: 1,
limit: 10
},
//
dataListLoading: false,
// loading
queryLoading: false,
saveHeaderLoading: false,
saveDetailLoading: false,
saveComponentLoading: false,
saveAllLoading: false,
//
detailTable: 'bom_detail',
subDetailTable: 'bom_sub_detail',
@ -609,6 +609,114 @@ export default {
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 104002,
serialNumber: '104002Table1BomType',
tableId: '104002Table1',
tableName: 'BOM信息表',
columnProp: 'bomType',
headerAlign: 'center',
align: 'center',
columnLabel: '制造类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 104002,
serialNumber: '104002Table1EngChgLevel',
tableId: '104002Table1',
tableName: 'BOM信息表',
columnProp: 'engChgLevel',
headerAlign: 'center',
align: 'center',
columnLabel: 'BOM版本号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 104002,
serialNumber: '104002Table1engRevision',
tableId: '104002Table1',
tableName: 'BOM信息表',
columnProp: 'engRevision',
headerAlign: 'center',
align: 'center',
columnLabel: '工程版本号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 104002,
serialNumber: '104002Table1NetWeight',
tableId: '104002Table1',
tableName: 'BOM信息表',
columnProp: 'netWeight',
headerAlign: 'center',
align: 'right',
columnLabel: '净重',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 104002,
serialNumber: '104002Table1EffPhaseInDate',
tableId: '104002Table1',
tableName: 'BOM信息表',
columnProp: 'effPhaseInDate',
headerAlign: 'center',
align: 'center',
columnLabel: '开始时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 130
},
{
userId: this.$store.state.user.name,
functionId: 104002,
serialNumber: '104002Table1EffPhaseOutDate',
tableId: '104002Table1',
tableName: 'BOM信息表',
columnProp: 'effPhaseOutDate',
headerAlign: 'center',
align: 'center',
columnLabel: '结束时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 130
},
{
userId: this.$store.state.user.name,
functionId: 104002,
@ -625,7 +733,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
columnWidth: 160
columnWidth: 130
},
{
userId: this.$store.state.user.name,
@ -661,7 +769,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
columnWidth: 160
columnWidth: 130
},
{
userId: this.$store.state.user.name,
@ -1133,6 +1241,7 @@ export default {
getDataList () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
this.queryLoading = true
bomManagementSearch(this.searchData).then(({data}) => {
if (data.code === 0) {
this.dataList = data.page.list
@ -1141,7 +1250,7 @@ export default {
this.totalPage = data.page.totalCount
this.$refs.selectDiv.setLengthAll( this.dataList.length)
}
this.dataListLoading = false
this.queryLoading = false
})
},
/**
@ -1348,6 +1457,7 @@ export default {
informationList: this.subDetailList
}
if (this.modalData.flag === '1') {
this.saveAllLoading = true
bomManagementSave(tempData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
@ -1363,8 +1473,10 @@ export default {
confirmButtonText: '确定'
})
}
this.saveAllLoading = false
})
} else {
this.saveAllLoading = true
bomManagementEdit(tempData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
@ -1380,6 +1492,7 @@ export default {
confirmButtonText: '确定'
})
}
this.saveAllLoading = false
})
}
},
@ -1420,6 +1533,43 @@ export default {
this.modalFlag = false
}
},
/**
* 新增编辑模态框关闭
*/
closeModalX (done) {
let tempArr = []
tempArr.push(this.modalData)
if (this.modalData.flag === '1') {
this.$confirm(`是否不保存且删除该条BOM记录?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let tempData = {
informationList: tempArr
}
bomManagementDelete(tempData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
done()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
} else {
done()
}
},
/**
* bom删除
*/
@ -1612,6 +1762,7 @@ export default {
return
}
if (this.componentData.flag === '1') {
this.saveComponentLoading = true
saveBomComponent(this.componentData).then(({data}) => {
if (data && data.code === 0) {
this.subDetailList = data.rows
@ -1627,8 +1778,10 @@ export default {
confirmButtonText: '确定'
})
}
this.saveComponentLoading = false
})
} else if (this.componentData.flag === '2') {
this.saveComponentLoading = true
updateBomComponent(this.componentData).then(({data}) => {
if (data && data.code === 0) {
this.subDetailList = data.rows
@ -1644,6 +1797,7 @@ export default {
confirmButtonText: '确定'
})
}
this.saveComponentLoading = false
})
}
},
@ -1681,6 +1835,7 @@ export default {
this.$message.warning('请先选择类型!')
return
}
this.saveHeaderLoading = true
//
saveBomHeader(this.modalData).then(({data}) => {
if (data && data.code === 0) {
@ -1714,6 +1869,7 @@ export default {
confirmButtonText: '确定'
})
}
this.saveHeaderLoading = false
})
},
/**
@ -1788,6 +1944,7 @@ export default {
this.$message.warning('请填写最小订单数!')
return
}
this.saveDetailLoading = true
bomDetailSave(this.saveDetailData).then(({data}) => {
if (data && data.code === 0) {
this.detailDataList = data.rows
@ -1805,6 +1962,7 @@ export default {
confirmButtonText: '确定'
})
}
this.saveDetailLoading = false
})
},
/**

727
src/views/modules/part/routingManagement.vue
File diff suppressed because it is too large
View File

Loading…
Cancel
Save