|
|
|
@ -283,8 +283,23 @@ |
|
|
|
:min-width="item.columnWidth" |
|
|
|
:label="item.columnLabel"> |
|
|
|
<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> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
@ -327,8 +342,8 @@ |
|
|
|
:label="item.columnLabel"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<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-option |
|
|
|
v-for = "i in userBuList" |
|
|
|
@ -339,7 +354,7 @@ |
|
|
|
</el-select> |
|
|
|
<span v-if="scope.row.partNo&&scope.row.partNo!==''">{{scope.row[item.columnProp]}}</span> |
|
|
|
</span> |
|
|
|
<span v-show="item.columnProp==='partDesc'"> |
|
|
|
<span v-if="item.columnProp==='partDesc'"> |
|
|
|
<el-input v-model="scope.row.partDesc" clearable></el-input> |
|
|
|
</span> |
|
|
|
<span v-if="item.columnProp==='tempNo'"> |
|
|
|
@ -382,14 +397,14 @@ |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</span> |
|
|
|
<span v-show="item.columnProp==='partType2'"> |
|
|
|
<span v-if="item.columnProp==='partType2'"> |
|
|
|
<el-select v-model="scope.row.partType2" clearable> |
|
|
|
<el-option label="成品" value="Manufactured"></el-option> |
|
|
|
<el-option label="半成品" value="Manufactured Recipe"></el-option> |
|
|
|
<el-option label="原材料" value="Purchased (raw)"></el-option> |
|
|
|
</el-select> |
|
|
|
</span> |
|
|
|
<span v-show="item.columnProp==='umName'"> |
|
|
|
<span v-if="item.columnProp==='umName'"> |
|
|
|
<el-select |
|
|
|
v-model="scope.row.umId2" clearable> |
|
|
|
<el-option |
|
|
|
@ -455,7 +470,7 @@ |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</span> |
|
|
|
<span v-show="item.columnProp==='remark'"> |
|
|
|
<span v-if="item.columnProp==='remark'"> |
|
|
|
<el-input |
|
|
|
type="textarea" |
|
|
|
:autosize="{ minRows: 1}" |
|
|
|
@ -1138,6 +1153,7 @@ export default { |
|
|
|
partNo: '', |
|
|
|
partDesc: '', |
|
|
|
codeNo: '', |
|
|
|
rfqDetailId: null |
|
|
|
}, |
|
|
|
itemData: { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
@ -1160,6 +1176,7 @@ export default { |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
updateBy: this.$store.state.user.name, |
|
|
|
mainPart: '', |
|
|
|
rfqDetailId: null |
|
|
|
}, |
|
|
|
partData: { |
|
|
|
flag: '', |
|
|
|
@ -1167,6 +1184,9 @@ export default { |
|
|
|
partNo: '', |
|
|
|
partDesc: '', |
|
|
|
nodeFlag: false, |
|
|
|
mainPart: '', |
|
|
|
nodeId: '', |
|
|
|
engChgLevel: null, |
|
|
|
page: 1, |
|
|
|
limit: 10 |
|
|
|
}, |
|
|
|
@ -2459,6 +2479,7 @@ export default { |
|
|
|
this.searchData = this.$route.query.data |
|
|
|
this.searchData.partDesc = this.$route.query.data.testPartDesc |
|
|
|
this.searchData.codeNo = this.$route.query.data.partCodeNo |
|
|
|
this.searchData.rfqDetailId = this.$route.query.data.id |
|
|
|
this.getNodeTree(); |
|
|
|
this.getPartItem(); |
|
|
|
} |
|
|
|
@ -2482,6 +2503,7 @@ export default { |
|
|
|
let tempData = { |
|
|
|
site: this.searchData.site, |
|
|
|
mainPart: this.searchData.partNo, |
|
|
|
rfqDetailId: this.searchData.rfqDetailId, |
|
|
|
pId: '0' |
|
|
|
} |
|
|
|
getNodeTree(tempData).then(({data}) => { |
|
|
|
@ -2505,6 +2527,7 @@ export default { |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
updateBy: this.$store.state.user.name, |
|
|
|
mainPart: this.searchData.partNo, |
|
|
|
rfqDetailId: this.searchData.rfqDetailId, |
|
|
|
} |
|
|
|
this.treeData1 = [ |
|
|
|
{ |
|
|
|
@ -2520,20 +2543,6 @@ export default { |
|
|
|
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) { |
|
|
|
@ -2717,7 +2726,9 @@ export default { |
|
|
|
nodeFlag: true, |
|
|
|
page: 1, |
|
|
|
limit: 10, |
|
|
|
mainPart: this.searchData.partNo |
|
|
|
mainPart: this.searchData.partNo, |
|
|
|
nodeId: this.treeData[0].nodeId, |
|
|
|
engChgLevel: this.treeData[0].engChgLevel |
|
|
|
} |
|
|
|
this.currentNode = data |
|
|
|
this.queryPartList() |
|
|
|
@ -3637,48 +3648,58 @@ export default { |
|
|
|
} else { |
|
|
|
for (let i = 0; i < this.partList1.length; i++) { |
|
|
|
if (!this.partList1[i].partNo||this.partList1[i].partNo===''){ |
|
|
|
console.log('处理行数据',i+1) |
|
|
|
// 没有物料编号就新增料号 |
|
|
|
// 没有填写物料描述就认为用户暂时不在这个节点新建料号 |
|
|
|
if (this.partList1[i].partDesc === '' || this.partList1[i].partDesc == null) { |
|
|
|
console.log('没有物料描述的行数据',i+1) |
|
|
|
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) { |
|
|
|
console.log('没有BU的行数据',i+1) |
|
|
|
this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的BU!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.partList1[i].partType2 === '' || this.partList1[i].partType2 == null) { |
|
|
|
console.log('没有零件类型的行数据',i+1) |
|
|
|
this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的零件类型!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.partList1[i].umId2 === '' || this.partList1[i].umId2 == null) { |
|
|
|
console.log('没有计量单位的行数据',i+1) |
|
|
|
this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的计量单位!') |
|
|
|
return |
|
|
|
} |
|
|
|
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 +'节点的物料分类!') |
|
|
|
return |
|
|
|
} |
|
|
|
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!') |
|
|
|
return |
|
|
|
} |
|
|
|
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!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.partList1[i].codeNo === '' || this.partList1[i].codeNo == null) { |
|
|
|
console.log('没有属性模板的行数据',i+1) |
|
|
|
this.$message.warning('请选择'+ this.partList1[i].nodeName +'节点的属性模板!') |
|
|
|
return |
|
|
|
} |
|
|
|
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) => { |
|
|
|
if (data.data && data.data.code === 0) { |
|
|
|
console.log('创建物料成功',i+1) |
|
|
|
this.partList1[i].partNo = data.data.rows.partNo |
|
|
|
updatePartNoOfNode(this.partList1[i]).then((data) => { |
|
|
|
if (data.data && data.data.code === 0) { |
|
|
|
|