|
@@ -78,9 +78,11 @@ const props = defineProps({
|
|
type: String,
|
|
type: String,
|
|
},
|
|
},
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+const id = inject("id");
|
|
|
|
+const routeId = inject("routeId");
|
|
|
|
+const prodtCode = inject("prodtCode");
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
-const tableConfig = getTableConfig(route.params.id);
|
|
|
|
|
|
+const tableConfig = getTableConfig(id);
|
|
|
|
|
|
// 传入一个url,后面不带/
|
|
// 传入一个url,后面不带/
|
|
const { url, form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
const { url, form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
@@ -102,13 +104,13 @@ const startCreat = () => {
|
|
bomVersion.value = data.value[0].recordVersion;
|
|
bomVersion.value = data.value[0].recordVersion;
|
|
}
|
|
}
|
|
|
|
|
|
- if (!route.params.prodtCode) {
|
|
|
|
|
|
+ if (!prodtCode) {
|
|
ElMessage.error("物料编号读取错误");
|
|
ElMessage.error("物料编号读取错误");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
//根据物料编码和版本号获取对应的物料BOM
|
|
//根据物料编码和版本号获取对应的物料BOM
|
|
let bomParam = {
|
|
let bomParam = {
|
|
- materialCode: route.params.prodtCode,
|
|
|
|
|
|
+ materialCode: prodtCode,
|
|
};
|
|
};
|
|
getBomVersion(bomParam).then((res) => {
|
|
getBomVersion(bomParam).then((res) => {
|
|
let resListMap = [];
|
|
let resListMap = [];
|
|
@@ -121,7 +123,7 @@ const startCreat = () => {
|
|
});
|
|
});
|
|
//查询参数
|
|
//查询参数
|
|
let configParam = {};
|
|
let configParam = {};
|
|
- configParam.materialCode = route.params.prodtCode;
|
|
|
|
|
|
+ configParam.materialCode = prodtCode;
|
|
if (bomVersion.value) {
|
|
if (bomVersion.value) {
|
|
configParam.bomVersion = bomVersion.value;
|
|
configParam.bomVersion = bomVersion.value;
|
|
}
|
|
}
|
|
@@ -154,7 +156,7 @@ const startCreat = () => {
|
|
commonTableType.value = "ESOP";
|
|
commonTableType.value = "ESOP";
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
commonTableRef.value?.startSelect({
|
|
commonTableRef.value?.startSelect({
|
|
- materialCode: route.params.prodtCode,
|
|
|
|
|
|
+ materialCode: prodtCode,
|
|
enable: 1,
|
|
enable: 1,
|
|
});
|
|
});
|
|
commonTableRef.value?.mergeOption({
|
|
commonTableRef.value?.mergeOption({
|
|
@@ -209,12 +211,12 @@ const onSelectedFinish = (itemValue) => {
|
|
recordItem.value.recordVersion = item.bomVersion;
|
|
recordItem.value.recordVersion = item.bomVersion;
|
|
recordItem.value.num = item.bomMaterialNumber;
|
|
recordItem.value.num = item.bomMaterialNumber;
|
|
recordItem.value.traceType = "S";
|
|
recordItem.value.traceType = "S";
|
|
- recordItem.value.operationId = route.params.id;
|
|
|
|
|
|
+ recordItem.value.operationId = id;
|
|
recordItem.value.unit = item.unit;
|
|
recordItem.value.unit = item.unit;
|
|
recordItem.value.isTrace = 1;
|
|
recordItem.value.isTrace = 1;
|
|
itemRecordList.value.push(recordItem.value);
|
|
itemRecordList.value.push(recordItem.value);
|
|
});
|
|
});
|
|
- itemRecord.value.operationId = route.params.id;
|
|
|
|
|
|
+ itemRecord.value.operationId = id;
|
|
itemRecord.value.itemRecordList = Array.from(itemRecordList.value);
|
|
itemRecord.value.itemRecordList = Array.from(itemRecordList.value);
|
|
addBatch(itemRecord.value).then((data) => {
|
|
addBatch(itemRecord.value).then((data) => {
|
|
if (data.code == "200") {
|
|
if (data.code == "200") {
|
|
@@ -241,7 +243,7 @@ const onSelectedFinish = (itemValue) => {
|
|
form.value.unit = itemValue.unit;*/
|
|
form.value.unit = itemValue.unit;*/
|
|
itemValue?.forEach((item, index) => {
|
|
itemValue?.forEach((item, index) => {
|
|
const recordItem = ref({});
|
|
const recordItem = ref({});
|
|
- recordItem.value.operationId = route.params.id;
|
|
|
|
|
|
+ recordItem.value.operationId = id;
|
|
recordItem.value.checkName = item.checkName;
|
|
recordItem.value.checkName = item.checkName;
|
|
recordItem.value.checkCode = item.checkCode;
|
|
recordItem.value.checkCode = item.checkCode;
|
|
recordItem.value.content = item.content;
|
|
recordItem.value.content = item.content;
|
|
@@ -251,7 +253,7 @@ const onSelectedFinish = (itemValue) => {
|
|
recordItem.value.unit = item.unit;
|
|
recordItem.value.unit = item.unit;
|
|
checkList.value.push(recordItem.value);
|
|
checkList.value.push(recordItem.value);
|
|
});
|
|
});
|
|
- checkItem.value.operationId = route.params.id;
|
|
|
|
|
|
+ checkItem.value.operationId = id;
|
|
checkItem.value.checkList = Array.from(checkList.value);
|
|
checkItem.value.checkList = Array.from(checkList.value);
|
|
addCheckBatch(checkItem.value).then((data) => {
|
|
addCheckBatch(checkItem.value).then((data) => {
|
|
if (data.code == "200") {
|
|
if (data.code == "200") {
|
|
@@ -279,7 +281,7 @@ const onSelectedFinish = (itemValue) => {
|
|
form.value.title = itemValue.drawingTitle;*/
|
|
form.value.title = itemValue.drawingTitle;*/
|
|
itemValue?.forEach((item, index) => {
|
|
itemValue?.forEach((item, index) => {
|
|
const recordItem = ref({});
|
|
const recordItem = ref({});
|
|
- recordItem.value.operationId = route.params.id;
|
|
|
|
|
|
+ recordItem.value.operationId = id;
|
|
recordItem.value.filePath = item.pdfPath;
|
|
recordItem.value.filePath = item.pdfPath;
|
|
recordItem.value.showAppointPageNum = 1;
|
|
recordItem.value.showAppointPageNum = 1;
|
|
recordItem.value.drawingCode = item.drawingCode;
|
|
recordItem.value.drawingCode = item.drawingCode;
|
|
@@ -288,7 +290,7 @@ const onSelectedFinish = (itemValue) => {
|
|
recordItem.value.title = item.drawingTitle;
|
|
recordItem.value.title = item.drawingTitle;
|
|
esopList.value.push(recordItem.value);
|
|
esopList.value.push(recordItem.value);
|
|
});
|
|
});
|
|
- esopItem.value.operationId = route.params.id;
|
|
|
|
|
|
+ esopItem.value.operationId = id;
|
|
esopItem.value.esopList = Array.from(esopList.value);
|
|
esopItem.value.esopList = Array.from(esopList.value);
|
|
addEsopBatch(esopItem.value).then((data) => {
|
|
addEsopBatch(esopItem.value).then((data) => {
|
|
if (data.code == "200") {
|
|
if (data.code == "200") {
|
|
@@ -319,7 +321,7 @@ const getSOAPpdf = (itemValue) => {
|
|
};
|
|
};
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
- search.value.operationId = route.params.id;
|
|
|
|
|
|
+ search.value.operationId = id;
|
|
url.value = tableConfig[props.tableType].url;
|
|
url.value = tableConfig[props.tableType].url;
|
|
option.value = Object.assign(option.value, {
|
|
option.value = Object.assign(option.value, {
|
|
addBtn: false,
|
|
addBtn: false,
|
|
@@ -329,7 +331,7 @@ onMounted(() => {
|
|
column: tableConfig[props.tableType].column,
|
|
column: tableConfig[props.tableType].column,
|
|
});
|
|
});
|
|
dataList();
|
|
dataList();
|
|
- getRouteMaxVersion(route.params.routeId).then(({ data }) => {
|
|
|
|
|
|
+ getRouteMaxVersion(routeId).then(({ data }) => {
|
|
if (data) {
|
|
if (data) {
|
|
bomVersion.value = data;
|
|
bomVersion.value = data;
|
|
}
|
|
}
|
|
@@ -350,7 +352,7 @@ watch(
|
|
column: tableConfig[props.tableType].column,
|
|
column: tableConfig[props.tableType].column,
|
|
});
|
|
});
|
|
dataList();
|
|
dataList();
|
|
- getRouteMaxVersion(route.params.routeId).then(({ data }) => {
|
|
|
|
|
|
+ getRouteMaxVersion(routeId).then(({ data }) => {
|
|
if (data) {
|
|
if (data) {
|
|
bomVersion.value = data;
|
|
bomVersion.value = data;
|
|
}
|
|
}
|