|
@@ -104,11 +104,14 @@ const props = defineProps({
|
|
|
|
|
|
const route = useRoute();
|
|
|
const tableConfig = getTableConfig(route.fullPath.split("/")[4]);
|
|
|
-
|
|
|
+const afterDataListToGetBomVersion = () => {
|
|
|
+ toGetBomVersion();
|
|
|
+};
|
|
|
// 传入一个url,后面不带/
|
|
|
const { url, form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
useCrud({
|
|
|
src: tableConfig[props.tableType].url,
|
|
|
+ afterDataList: afterDataListToGetBomVersion,
|
|
|
});
|
|
|
|
|
|
const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
@@ -150,9 +153,8 @@ const goToSelectMaterial = () => {
|
|
|
|
|
|
const startCreat = () => {
|
|
|
if (props.tableType === "wuliaocaiji") {
|
|
|
- if (data.value && data.value.length > 0) {
|
|
|
- bomVersion.value = data.value[0].recordVersion;
|
|
|
- selectedVersion.value = data.value[0].recordVersion;
|
|
|
+ if (bomVersion.value) {
|
|
|
+ selectedVersion.value = bomVersion.value;
|
|
|
goToSelectMaterial();
|
|
|
} else {
|
|
|
getBomVersion({ materialCode: route.fullPath.split("/")[5] }).then(
|
|
@@ -381,13 +383,7 @@ onMounted(() => {
|
|
|
column: tableConfig[props.tableType].column,
|
|
|
});
|
|
|
dataList();
|
|
|
- getRouteMaxVersion(
|
|
|
- route.fullPath.split("/")[6] ? route.fullPath.split("/")[6] : routeId.value
|
|
|
- ).then(({ data }) => {
|
|
|
- if (data) {
|
|
|
- bomVersion.value = data;
|
|
|
- }
|
|
|
- });
|
|
|
+ toGetBomVersion();
|
|
|
});
|
|
|
|
|
|
watch(
|
|
@@ -403,15 +399,15 @@ watch(
|
|
|
column: tableConfig[props.tableType].column,
|
|
|
});
|
|
|
dataList();
|
|
|
- getRouteMaxVersion(
|
|
|
- route.fullPath.split("/")[6]
|
|
|
- ? route.fullPath.split("/")[6]
|
|
|
- : routeId.value
|
|
|
- ).then(({ data }) => {
|
|
|
- if (data) {
|
|
|
- bomVersion.value = data;
|
|
|
- }
|
|
|
- });
|
|
|
+ toGetBomVersion();
|
|
|
}
|
|
|
);
|
|
|
+
|
|
|
+const toGetBomVersion = () => {
|
|
|
+ getRouteMaxVersion(
|
|
|
+ route.fullPath.split("/")[6] ? route.fullPath.split("/")[6] : routeId.value
|
|
|
+ ).then(({ data }) => {
|
|
|
+ bomVersion.value = data;
|
|
|
+ });
|
|
|
+};
|
|
|
</script>
|