[update] 绑定零部件
This commit is contained in:
@@ -196,7 +196,8 @@ export default {
|
|||||||
},
|
},
|
||||||
disableMixinCreated: true,
|
disableMixinCreated: true,
|
||||||
isCanAdd: false, // 是否可以新增
|
isCanAdd: false, // 是否可以新增
|
||||||
isCanUseBind: false // 是否有使用绑定关系按钮
|
isCanUseBind: false, // 是否有使用绑定关系按钮
|
||||||
|
isHaveBindResult: {} // 是否有绑定结果
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
@@ -204,7 +205,9 @@ export default {
|
|||||||
const partNo = this.$route.query.partNo || ''
|
const partNo = this.$route.query.partNo || ''
|
||||||
const partName = this.$route.query.partName || ''
|
const partName = this.$route.query.partName || ''
|
||||||
const partCategoryNum = this.$route.query.partCategoryNum || ''
|
const partCategoryNum = this.$route.query.partCategoryNum || ''
|
||||||
this.judgmentTreeIsHaveBind(partNo, partName, partCategoryNum)
|
if (partNo && partName && partCategoryNum) {
|
||||||
|
this.judgmentTreeIsHaveBind(partNo, partName, partCategoryNum)
|
||||||
|
}
|
||||||
// 如果路径中有零部件号,设置查询条件零部件号默认值
|
// 如果路径中有零部件号,设置查询条件零部件号默认值
|
||||||
if (partNo) {
|
if (partNo) {
|
||||||
this.queryParam.partNo = partNo
|
this.queryParam.partNo = partNo
|
||||||
@@ -223,7 +226,9 @@ export default {
|
|||||||
this.loading = true
|
this.loading = true
|
||||||
isTreeNodeHaveBind({ partNo, partName, partCategoryNum }).then(res => {
|
isTreeNodeHaveBind({ partNo, partName, partCategoryNum }).then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
this.isHaveBindResult = res.result
|
||||||
if (res.result) {
|
if (res.result) {
|
||||||
|
this.isCanUseBind = true
|
||||||
// 已有绑定标准关联关系
|
// 已有绑定标准关联关系
|
||||||
// 在零部件分类下,弹框提示【当前零部件分类结构下已有XXXX绑定标准关联关系,是否引入对应关系?】(XXXX指第一次绑定的零部件名称+编号)
|
// 在零部件分类下,弹框提示【当前零部件分类结构下已有XXXX绑定标准关联关系,是否引入对应关系?】(XXXX指第一次绑定的零部件名称+编号)
|
||||||
this.$confirm({
|
this.$confirm({
|
||||||
@@ -231,7 +236,7 @@ export default {
|
|||||||
content: this.$t('system.bindingParts.haveBind') + res.result.partName + res.result.partNo + this.$t('system.bindingParts.isBringInRelation'),
|
content: this.$t('system.bindingParts.haveBind') + res.result.partName + res.result.partNo + this.$t('system.bindingParts.isBringInRelation'),
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
// 确定引入对应关系,调用使用绑定关系
|
// 确定引入对应关系,调用使用绑定关系
|
||||||
useBindingRelationship().then(res => {
|
useBindingRelationship({ id: res.result.id }).then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
// 重新计算分页问题
|
// 重新计算分页问题
|
||||||
this.reCalculatePage(this.selectedRowKeys.length)
|
this.reCalculatePage(this.selectedRowKeys.length)
|
||||||
@@ -245,13 +250,12 @@ export default {
|
|||||||
onCancel: () => {
|
onCancel: () => {
|
||||||
// 不引入对应关系
|
// 不引入对应关系
|
||||||
this.isCanAdd = false
|
this.isCanAdd = false
|
||||||
this.isCanUseBind = false
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// 还没有绑定标准关联关系,可以新增
|
// 可以新增
|
||||||
this.isCanAdd = true
|
this.isCanAdd = true
|
||||||
this.isCanUseBind = true
|
this.isCanUseBind = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
@@ -265,7 +269,9 @@ export default {
|
|||||||
content: this.$t('system.bindingParts.isUseBindRelationship'),
|
content: this.$t('system.bindingParts.isUseBindRelationship'),
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
useBindingRelationship().then((res) => {
|
const param = {}
|
||||||
|
param.id = this.isHaveBindResult ? this.isHaveBindResult.id : ''
|
||||||
|
useBindingRelationship(param).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
// 重新计算分页问题
|
// 重新计算分页问题
|
||||||
this.reCalculatePage(this.selectedRowKeys.length)
|
this.reCalculatePage(this.selectedRowKeys.length)
|
||||||
|
|||||||
Reference in New Issue
Block a user