|
@@ -133,7 +133,12 @@
|
|
|
提交发布
|
|
提交发布
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
|
|
|
- <el-button type="primary" size="mini" @click="handleSave" v-if="currentNodeData.status != 1">
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="handleSave"
|
|
|
|
|
+ v-if="currentNodeData.status != 1"
|
|
|
|
|
+ >
|
|
|
保存
|
|
保存
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</div>
|
|
</div>
|
|
@@ -199,7 +204,7 @@
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item in versList"
|
|
v-for="item in versList"
|
|
|
- :label="'V' +item.versions + '.0'"
|
|
|
|
|
|
|
+ :label="'V' + item.versions + '.0'"
|
|
|
:value="item.versions"
|
|
:value="item.versions"
|
|
|
:key="item.id"
|
|
:key="item.id"
|
|
|
>
|
|
>
|
|
@@ -435,7 +440,6 @@
|
|
|
|
|
|
|
|
if (Object.prototype.hasOwnProperty.call(row, 'bomType')) {
|
|
if (Object.prototype.hasOwnProperty.call(row, 'bomType')) {
|
|
|
this.currentNodeData.bomType = row.bomType;
|
|
this.currentNodeData.bomType = row.bomType;
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
this.drawer = true;
|
|
this.drawer = true;
|
|
|
this.getTreeData();
|
|
this.getTreeData();
|
|
@@ -466,11 +470,10 @@
|
|
|
this.getVersion();
|
|
this.getVersion();
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
-
|
|
|
|
|
async getTreeData() {
|
|
async getTreeData() {
|
|
|
try {
|
|
try {
|
|
|
this.treeLoading = true;
|
|
this.treeLoading = true;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
const res = await getBomTreeList({
|
|
const res = await getBomTreeList({
|
|
|
categoryId: this.searchObj.categoryId,
|
|
categoryId: this.searchObj.categoryId,
|
|
|
versions: this.searchObj.versions,
|
|
versions: this.searchObj.versions,
|
|
@@ -508,7 +511,7 @@
|
|
|
if (id) {
|
|
if (id) {
|
|
|
getBomGetById(id).then((res) => {
|
|
getBomGetById(id).then((res) => {
|
|
|
this.currentNodeData = res.data;
|
|
this.currentNodeData = res.data;
|
|
|
- this.searchObj.versions = this.currentNodeData.versions
|
|
|
|
|
|
|
+ this.searchObj.versions = this.currentNodeData.versions;
|
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
@@ -522,7 +525,8 @@
|
|
|
getVersion(type) {
|
|
getVersion(type) {
|
|
|
let param = {
|
|
let param = {
|
|
|
categoryId: this.searchObj.categoryId,
|
|
categoryId: this.searchObj.categoryId,
|
|
|
- bomType: this.currentNodeData.bomType
|
|
|
|
|
|
|
+ bomType: this.currentNodeData.bomType,
|
|
|
|
|
+ isTemp: this.searchObj.isTemp
|
|
|
};
|
|
};
|
|
|
versionList(param).then((res) => {
|
|
versionList(param).then((res) => {
|
|
|
this.versList = res || [];
|
|
this.versList = res || [];
|
|
@@ -559,10 +563,17 @@
|
|
|
.finally(() => {});
|
|
.finally(() => {});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- transformation(tt) {
|
|
|
|
|
|
|
+ async transformation(tt) {
|
|
|
if (this.currentNodeData.status != 1) {
|
|
if (this.currentNodeData.status != 1) {
|
|
|
return this.$message.warning('只有已发布版本才可以转换');
|
|
return this.$message.warning('只有已发布版本才可以转换');
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ let _type = tt == 'P' ? 1 : tt == 'M' ? 2 : tt == 'A' ? 3 : 4;
|
|
|
|
|
+ if (!this.isEdit) {
|
|
|
|
|
+ let isHas = await this.hasVersionFn(_type);
|
|
|
|
|
+ if (!isHas) return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
this.loadingInstance = this.$loading({
|
|
this.loadingInstance = this.$loading({
|
|
|
lock: true,
|
|
lock: true,
|
|
|
text: '转换中...',
|
|
text: '转换中...',
|
|
@@ -586,8 +597,6 @@
|
|
|
this.loadingInstance.close();
|
|
this.loadingInstance.close();
|
|
|
this.$message.success('转换成功');
|
|
this.$message.success('转换成功');
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- let _type = tt == 'P' ? 1 : tt == 'M' ? 2 : tt == 'A' ? 3 : 4;
|
|
|
|
|
this.currentNodeData.bomType = _type;
|
|
this.currentNodeData.bomType = _type;
|
|
|
this.getTreeData();
|
|
this.getTreeData();
|
|
|
this.getVersion();
|
|
this.getVersion();
|
|
@@ -595,7 +604,6 @@
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
-
|
|
|
|
|
handleAdd() {
|
|
handleAdd() {
|
|
|
this.baseInfoShow = true;
|
|
this.baseInfoShow = true;
|
|
|
},
|
|
},
|
|
@@ -615,12 +623,9 @@
|
|
|
handleSave() {
|
|
handleSave() {
|
|
|
this.$message.success('保存成功');
|
|
this.$message.success('保存成功');
|
|
|
this.handleClose();
|
|
this.handleClose();
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
handSubmit() {
|
|
handSubmit() {
|
|
|
-
|
|
|
|
|
if (this.clientEnvironmentId == 4) {
|
|
if (this.clientEnvironmentId == 4) {
|
|
|
this.isSubmit = true;
|
|
this.isSubmit = true;
|
|
|
} else {
|
|
} else {
|
|
@@ -631,8 +636,10 @@
|
|
|
})
|
|
})
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
bomSubmit({ businessId: this.currentNodeData.id }).then((res) => {
|
|
bomSubmit({ businessId: this.currentNodeData.id }).then((res) => {
|
|
|
- this.$message.success('发布成功');
|
|
|
|
|
- this.getTreeData();
|
|
|
|
|
|
|
+ if (res.code == 0) {
|
|
|
|
|
+ this.$message.success('发布成功');
|
|
|
|
|
+ this.getTreeData();
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
})
|
|
})
|
|
|
.catch(() => {});
|
|
.catch(() => {});
|
|
@@ -664,35 +671,31 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- async hasVersionFn() {
|
|
|
|
|
- return new Promise((resolve) => {
|
|
|
|
|
- let param = {
|
|
|
|
|
- categoryId: this.searchObj.categoryId,
|
|
|
|
|
- bomType: this.currentNodeData.bomType
|
|
|
|
|
- };
|
|
|
|
|
- hasNewVersion(param).then((res) => {
|
|
|
|
|
- if(res.data == 1) {
|
|
|
|
|
- this.$confirm('已经草稿版本存在,是否覆盖?', '提示', {
|
|
|
|
|
- confirmButtonText: '覆盖',
|
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
|
- type: 'warning'
|
|
|
|
|
|
|
+ async hasVersionFn(bomType) {
|
|
|
|
|
+ return new Promise((resolve) => {
|
|
|
|
|
+ let param = {
|
|
|
|
|
+ categoryId: this.searchObj.categoryId,
|
|
|
|
|
+ bomType: bomType
|
|
|
|
|
+ };
|
|
|
|
|
+ hasNewVersion(param).then((res) => {
|
|
|
|
|
+ if (res.data == 1) {
|
|
|
|
|
+ this.$confirm('已经草稿版本存在,是否覆盖?', '提示', {
|
|
|
|
|
+ confirmButtonText: '覆盖',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ resolve(true);
|
|
|
})
|
|
})
|
|
|
- .then(() => {
|
|
|
|
|
- resolve(false);
|
|
|
|
|
- })
|
|
|
|
|
- .catch(() => {
|
|
|
|
|
- resolve(true);
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- } else {
|
|
|
|
|
- resolve(true);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ resolve(false);
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ resolve(true);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|