Browse Source

2025/8/20

java8
Aoi_Tori 5 months ago
parent
commit
85fd7207e8
  1. 77
      src/views/modules/part/quicklyCreateBom.vue
  2. 3
      src/views/modules/part/routing_create.vue

77
src/views/modules/part/quicklyCreateBom.vue

@ -283,8 +283,23 @@
:min-width="item.columnWidth" :min-width="item.columnWidth"
:label="item.columnLabel"> :label="item.columnLabel">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-show="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
<span v-show="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
<span v-if="!item.columnHidden">
<span v-if="item.columnProp==='partType2'">
<span v-if="scope.row.partType2==='Manufactured'">
成品
</span>
<span v-if="scope.row.partType2==='Manufactured Recipe'">
半成品
</span>
<span v-if="scope.row.partType2==='Purchased (raw)'">
原材料
</span>
</span>
<span v-if="item.columnProp!=='partType2'">
{{scope.row[item.columnProp]}}
</span>
</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -327,8 +342,8 @@
:label="item.columnLabel"> :label="item.columnLabel">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-show="!item.columnHidden"> <span v-show="!item.columnHidden">
<span v-show="item.columnProp==='partNo'||item.columnProp==='nodeName'">{{scope.row[item.columnProp]}}</span>
<span v-show="item.columnProp==='buNo'">
<span v-if="item.columnProp==='partNo'||item.columnProp==='nodeName'">{{scope.row[item.columnProp]}}</span>
<span v-if="item.columnProp==='buNo'">
<el-select v-model="scope.row.buNo" v-show="!scope.row.partNo||scope.row.partNo===''" clearable @change="changeBuOfNode(scope.row)" placeholder="请选择"> <el-select v-model="scope.row.buNo" v-show="!scope.row.partNo||scope.row.partNo===''" clearable @change="changeBuOfNode(scope.row)" placeholder="请选择">
<el-option <el-option
v-for = "i in userBuList" v-for = "i in userBuList"
@ -339,7 +354,7 @@
</el-select> </el-select>
<span v-if="scope.row.partNo&&scope.row.partNo!==''">{{scope.row[item.columnProp]}}</span> <span v-if="scope.row.partNo&&scope.row.partNo!==''">{{scope.row[item.columnProp]}}</span>
</span> </span>
<span v-show="item.columnProp==='partDesc'">
<span v-if="item.columnProp==='partDesc'">
<el-input v-model="scope.row.partDesc" clearable></el-input> <el-input v-model="scope.row.partDesc" clearable></el-input>
</span> </span>
<span v-if="item.columnProp==='tempNo'"> <span v-if="item.columnProp==='tempNo'">
@ -382,14 +397,14 @@
</el-option> </el-option>
</el-select> </el-select>
</span> </span>
<span v-show="item.columnProp==='partType2'">
<span v-if="item.columnProp==='partType2'">
<el-select v-model="scope.row.partType2" clearable> <el-select v-model="scope.row.partType2" clearable>
<el-option label="成品" value="Manufactured"></el-option> <el-option label="成品" value="Manufactured"></el-option>
<el-option label="半成品" value="Manufactured Recipe"></el-option> <el-option label="半成品" value="Manufactured Recipe"></el-option>
<el-option label="原材料" value="Purchased (raw)"></el-option> <el-option label="原材料" value="Purchased (raw)"></el-option>
</el-select> </el-select>
</span> </span>
<span v-show="item.columnProp==='umName'">
<span v-if="item.columnProp==='umName'">
<el-select <el-select
v-model="scope.row.umId2" clearable> v-model="scope.row.umId2" clearable>
<el-option <el-option
@ -455,7 +470,7 @@
</el-option> </el-option>
</el-select> </el-select>
</span> </span>
<span v-show="item.columnProp==='remark'">
<span v-if="item.columnProp==='remark'">
<el-input <el-input
type="textarea" type="textarea"
:autosize="{ minRows: 1}" :autosize="{ minRows: 1}"
@ -1138,6 +1153,7 @@ export default {
partNo: '', partNo: '',
partDesc: '', partDesc: '',
codeNo: '', codeNo: '',
rfqDetailId: null
}, },
itemData: { itemData: {
site: this.$store.state.user.site, site: this.$store.state.user.site,
@ -1160,6 +1176,7 @@ export default {
createBy: this.$store.state.user.name, createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name, updateBy: this.$store.state.user.name,
mainPart: '', mainPart: '',
rfqDetailId: null
}, },
partData: { partData: {
flag: '', flag: '',
@ -1167,6 +1184,9 @@ export default {
partNo: '', partNo: '',
partDesc: '', partDesc: '',
nodeFlag: false, nodeFlag: false,
mainPart: '',
nodeId: '',
engChgLevel: null,
page: 1, page: 1,
limit: 10 limit: 10
}, },
@ -2459,6 +2479,7 @@ export default {
this.searchData = this.$route.query.data this.searchData = this.$route.query.data
this.searchData.partDesc = this.$route.query.data.testPartDesc this.searchData.partDesc = this.$route.query.data.testPartDesc
this.searchData.codeNo = this.$route.query.data.partCodeNo this.searchData.codeNo = this.$route.query.data.partCodeNo
this.searchData.rfqDetailId = this.$route.query.data.id
this.getNodeTree(); this.getNodeTree();
this.getPartItem(); this.getPartItem();
} }
@ -2482,6 +2503,7 @@ export default {
let tempData = { let tempData = {
site: this.searchData.site, site: this.searchData.site,
mainPart: this.searchData.partNo, mainPart: this.searchData.partNo,
rfqDetailId: this.searchData.rfqDetailId,
pId: '0' pId: '0'
} }
getNodeTree(tempData).then(({data}) => { getNodeTree(tempData).then(({data}) => {
@ -2505,6 +2527,7 @@ export default {
createBy: this.$store.state.user.name, createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name, updateBy: this.$store.state.user.name,
mainPart: this.searchData.partNo, mainPart: this.searchData.partNo,
rfqDetailId: this.searchData.rfqDetailId,
} }
this.treeData1 = [ this.treeData1 = [
{ {
@ -2520,20 +2543,6 @@ export default {
this.nodeModalFlag = true this.nodeModalFlag = true
}, },
//
// addTreeItem (data) {
// this.nodeData = {
// flag: '1',
// site: this.$store.state.user.site,
// nodeId: '',
// nodeName: '',
// pId: data.id,
// createBy: this.$store.state.user.name,
// updateBy: this.$store.state.user.name,
// }
// this.nodeModalDisableFlag = false
// this.nodeModalFlag = true
// },
// //
editTreeItem (data) { editTreeItem (data) {
@ -2717,7 +2726,9 @@ export default {
nodeFlag: true, nodeFlag: true,
page: 1, page: 1,
limit: 10, limit: 10,
mainPart: this.searchData.partNo
mainPart: this.searchData.partNo,
nodeId: this.treeData[0].nodeId,
engChgLevel: this.treeData[0].engChgLevel
} }
this.currentNode = data this.currentNode = data
this.queryPartList() this.queryPartList()
@ -3637,48 +3648,58 @@ export default {
} else { } else {
for (let i = 0; i < this.partList1.length; i++) { for (let i = 0; i < this.partList1.length; i++) {
if (!this.partList1[i].partNo||this.partList1[i].partNo===''){ if (!this.partList1[i].partNo||this.partList1[i].partNo===''){
console.log('处理行数据',i+1)
// //
// //
if (this.partList1[i].partDesc === '' || this.partList1[i].partDesc == null) { if (this.partList1[i].partDesc === '' || this.partList1[i].partDesc == null) {
console.log('没有物料描述的行数据',i+1)
continue continue
} }
this.partList1[i].partNo = '*'
this.partList1[i].active = 'Y'
this.partList1[i].createBy = this.$store.state.user.name
this.partList1[i].mainPart = this.searchData.partNo
if (this.partList1[i].buNo === '' || this.partList1[i].buNo == null) { if (this.partList1[i].buNo === '' || this.partList1[i].buNo == null) {
console.log('没有BU的行数据',i+1)
this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的BU!') this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的BU!')
return return
} }
if (this.partList1[i].partType2 === '' || this.partList1[i].partType2 == null) { if (this.partList1[i].partType2 === '' || this.partList1[i].partType2 == null) {
console.log('没有零件类型的行数据',i+1)
this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的零件类型!') this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的零件类型!')
return return
} }
if (this.partList1[i].umId2 === '' || this.partList1[i].umId2 == null) { if (this.partList1[i].umId2 === '' || this.partList1[i].umId2 == null) {
console.log('没有计量单位的行数据',i+1)
this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的计量单位!') this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的计量单位!')
return return
} }
if (this.partList1[i].partType2 === 'Purchased (raw)' && (this.partList1[i].familyID === '' || this.partList1[i].familyID == null)) { if (this.partList1[i].partType2 === 'Purchased (raw)' && (this.partList1[i].familyID === '' || this.partList1[i].familyID == null)) {
console.log('没有物料分类的行数据',i+1)
this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的物料分类!') this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的物料分类!')
return return
} }
if (this.partList1[i].partType2 !== 'Purchased (raw)' && (this.partList1[i].productGroupId1 === '' || this.partList1[i].productGroupId1 == null)) { if (this.partList1[i].partType2 !== 'Purchased (raw)' && (this.partList1[i].productGroupId1 === '' || this.partList1[i].productGroupId1 == null)) {
console.log('没有商品组1的行数据',i+1)
this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的商品组1!') this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的商品组1!')
return return
} }
if (this.partList1[i].partType2 !== 'Purchased (raw)' && (this.partList1[i].productGroupId2 === '' || this.partList1[i].productGroupId2 == null)) { if (this.partList1[i].partType2 !== 'Purchased (raw)' && (this.partList1[i].productGroupId2 === '' || this.partList1[i].productGroupId2 == null)) {
console.log('没有商品组2的行数据',i+1)
this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的商品组2!') this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的商品组2!')
return return
} }
if (this.partList1[i].codeNo === '' || this.partList1[i].codeNo == null) { if (this.partList1[i].codeNo === '' || this.partList1[i].codeNo == null) {
console.log('没有属性模板的行数据',i+1)
this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的属性模板!') this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的属性模板!')
return return
} }
let flag = true let flag = true
this.partList1[i].partNo = '*'
this.partList1[i].active = 'Y'
this.partList1[i].createBy = this.$store.state.user.name
this.partList1[i].mainPart = this.searchData.partNo
console.log('其他数据赋值完成',i+1)
// //
await savePartInfo(this.partList1[i]).then((data) => { await savePartInfo(this.partList1[i]).then((data) => {
if (data.data && data.data.code === 0) { if (data.data && data.data.code === 0) {
console.log('创建物料成功',i+1)
this.partList1[i].partNo = data.data.rows.partNo this.partList1[i].partNo = data.data.rows.partNo
updatePartNoOfNode(this.partList1[i]).then((data) => { updatePartNoOfNode(this.partList1[i]).then((data) => {
if (data.data && data.data.code === 0) { if (data.data && data.data.code === 0) {

3
src/views/modules/part/routing_create.vue

@ -462,6 +462,7 @@ export default {
title: '', title: '',
site: '', site: '',
buNo: '', buNo: '',
codeNo: '',
partNo: '', partNo: '',
partDesc: '', partDesc: '',
routingRevision: '', routingRevision: '',
@ -1825,6 +1826,7 @@ export default {
flag: '2', flag: '2',
site: row.site, site: row.site,
buNo: row.buNo, buNo: row.buNo,
codeNo: row.codeNo,
partNo: row.partNo, partNo: row.partNo,
partDesc: row.partDesc, partDesc: row.partDesc,
routingRevision: row.routingRevision, routingRevision: row.routingRevision,
@ -2149,6 +2151,7 @@ export default {
site: this.modalData.site, site: this.modalData.site,
buNo: this.modalData.buNo, buNo: this.modalData.buNo,
partNo: this.modalData.partNo, partNo: this.modalData.partNo,
codeNo: this.modalData.codeNo,
operationList: this.standardOperationList operationList: this.standardOperationList
} }
calculationTime(tempData).then(({data}) => { calculationTime(tempData).then(({data}) => {

Loading…
Cancel
Save