[update] 绑定零部件

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