|
@@ -80,26 +80,23 @@
|
|
|
<template #right>
|
|
<template #right>
|
|
|
<div class="main-box flx-col">
|
|
<div class="main-box flx-col">
|
|
|
<LjVxeTable
|
|
<LjVxeTable
|
|
|
- ref="VxeTableRightRef"
|
|
|
|
|
|
|
+ ref="VxeTableBottomRef"
|
|
|
row-key="pzid"
|
|
row-key="pzid"
|
|
|
- :columns="columns_right"
|
|
|
|
|
- :request-api="getCodeMxData"
|
|
|
|
|
- :data-callback="callback_right"
|
|
|
|
|
- :dwname="dwname_right"
|
|
|
|
|
|
|
+ :columns="columns_bottom"
|
|
|
|
|
+ :request-api="getCodeMxBomData"
|
|
|
|
|
+ :data-callback="callback_bottom"
|
|
|
|
|
+ :dwname="dwname_bottom"
|
|
|
:table-props="tableProps"
|
|
:table-props="tableProps"
|
|
|
- :table-events="tableEvents_right"
|
|
|
|
|
- :init-param="initParams_right"
|
|
|
|
|
|
|
+ :table-events="tableEvents_bottom"
|
|
|
|
|
+ :init-param="initParams_bottom"
|
|
|
:auto-load-layout="false"
|
|
:auto-load-layout="false"
|
|
|
pagination
|
|
pagination
|
|
|
>
|
|
>
|
|
|
<!-- 表格 header 按钮 -->
|
|
<!-- 表格 header 按钮 -->
|
|
|
<template #tableHeader>
|
|
<template #tableHeader>
|
|
|
<el-button-group>
|
|
<el-button-group>
|
|
|
- <el-button @click="handleOpenNewRightTable">{{ $t("common.add") }}</el-button>
|
|
|
|
|
|
|
+ <el-button @click="handleOpenNewBottomTable">{{ $t("common.add") }}</el-button>
|
|
|
<el-button @click="fDelete(2)">{{ $t("common.delText") }}</el-button>
|
|
<el-button @click="fDelete(2)">{{ $t("common.delText") }}</el-button>
|
|
|
- <el-button @click="fCopy">{{ $t("common.copy") }}</el-button>
|
|
|
|
|
- <el-button @click="fPaste(0)">{{ $t("common.supplyPaste") }}</el-button>
|
|
|
|
|
- <el-button @click="fPaste(1)">{{ $t("common.coverPaste") }}</el-button>
|
|
|
|
|
</el-button-group>
|
|
</el-button-group>
|
|
|
</template>
|
|
</template>
|
|
|
</LjVxeTable>
|
|
</LjVxeTable>
|
|
@@ -128,7 +125,12 @@
|
|
|
|
|
|
|
|
<script setup lang="ts" name="baseinfo_configurelist">
|
|
<script setup lang="ts" name="baseinfo_configurelist">
|
|
|
import { ref, onMounted, provide } from "vue";
|
|
import { ref, onMounted, provide } from "vue";
|
|
|
-import { getConfigureTypeList, getConfigureCodeList, getConfigureCodeMxList } from "@/api/modules/basicinfo";
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ getConfigureTypeList,
|
|
|
|
|
+ getConfigureCodeList,
|
|
|
|
|
+ getConfigureCodeMxList,
|
|
|
|
|
+ getConfigureCodeMxBomList
|
|
|
|
|
+} from "@/api/modules/basicinfo";
|
|
|
import Detail from "./detail.vue";
|
|
import Detail from "./detail.vue";
|
|
|
import { useHooks } from "./hooks/index";
|
|
import { useHooks } from "./hooks/index";
|
|
|
import LjDialog from "@/components/LjDialog/index.vue";
|
|
import LjDialog from "@/components/LjDialog/index.vue";
|
|
@@ -148,6 +150,7 @@ const dwname_bottom = "web_configure_bomlist";
|
|
|
const mainData = ref({});
|
|
const mainData = ref({});
|
|
|
const initParams_mid = ref({ typeid: 0 as Number });
|
|
const initParams_mid = ref({ typeid: 0 as Number });
|
|
|
const initParams_right = ref({ pzid: 0 as Number, typeid: 0 as Number });
|
|
const initParams_right = ref({ pzid: 0 as Number, typeid: 0 as Number });
|
|
|
|
|
+const initParams_bottom = ref({ pzid: 0 as Number, printid: 0 as Number });
|
|
|
const detailType = ref(0);
|
|
const detailType = ref(0);
|
|
|
const tableProps = {
|
|
const tableProps = {
|
|
|
height: "auto",
|
|
height: "auto",
|
|
@@ -180,12 +183,15 @@ const {
|
|
|
VxeTableLeftRef,
|
|
VxeTableLeftRef,
|
|
|
VxeTableMidRef,
|
|
VxeTableMidRef,
|
|
|
VxeTableRightRef,
|
|
VxeTableRightRef,
|
|
|
|
|
+ VxeTableBottomRef,
|
|
|
LjDetailLeftRef,
|
|
LjDetailLeftRef,
|
|
|
LjDetailMidRef,
|
|
LjDetailMidRef,
|
|
|
LjDetailRightRef,
|
|
LjDetailRightRef,
|
|
|
|
|
+ LjDetailBottomRef,
|
|
|
columns_left,
|
|
columns_left,
|
|
|
columns_mid,
|
|
columns_mid,
|
|
|
columns_right,
|
|
columns_right,
|
|
|
|
|
+ columns_bottom,
|
|
|
fSave,
|
|
fSave,
|
|
|
fDelete,
|
|
fDelete,
|
|
|
fCopy,
|
|
fCopy,
|
|
@@ -206,23 +212,47 @@ const orderDefaultAction = [
|
|
|
label: t("common.saveText"),
|
|
label: t("common.saveText"),
|
|
|
icon: "iconsave-01",
|
|
icon: "iconsave-01",
|
|
|
clickFunc: item => {
|
|
clickFunc: item => {
|
|
|
- let save_data =
|
|
|
|
|
- detailType.value === 2
|
|
|
|
|
- ? LjDetailRightRef.value?._mainData
|
|
|
|
|
- : detailType.value === 1
|
|
|
|
|
- ? LjDetailMidRef.value?._mainData
|
|
|
|
|
- : LjDetailLeftRef.value?._mainData;
|
|
|
|
|
|
|
+ let save_data = null;
|
|
|
|
|
+ switch (detailType.value) {
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ save_data = LjDetailLeftRef.value?._mainData;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ save_data = LjDetailMidRef.value?._mainData;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 2:
|
|
|
|
|
+ save_data = LjDetailRightRef.value?._mainData;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 3:
|
|
|
|
|
+ save_data = LjDetailBottomRef.value?._mainData;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
if (orderStatus.value == "new") {
|
|
if (orderStatus.value == "new") {
|
|
|
- save_data =
|
|
|
|
|
- detailType.value === 2
|
|
|
|
|
- ? LjDetailRightRef.value?.infoParam
|
|
|
|
|
- : detailType.value === 1
|
|
|
|
|
- ? LjDetailMidRef.value?.infoParam
|
|
|
|
|
- : LjDetailLeftRef.value?.infoParam;
|
|
|
|
|
|
|
+ switch (detailType.value) {
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ save_data = LjDetailLeftRef.value?.infoParam;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ save_data = LjDetailMidRef.value?.infoParam;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 2:
|
|
|
|
|
+ save_data = LjDetailRightRef.value?.infoParam;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 3:
|
|
|
|
|
+ save_data = LjDetailBottomRef.value?.infoParam;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (detailType.value === 3) {
|
|
|
|
|
+ fSave(detailType.value, { bomList: [save_data] }).then(() => {
|
|
|
|
|
+ LjDrawerRef.value.hide();
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ fSave(detailType.value, { configure: save_data }).then(() => {
|
|
|
|
|
+ LjDrawerRef.value.hide();
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
- fSave(detailType.value, { configure: save_data }).then(() => {
|
|
|
|
|
- LjDrawerRef.value.hide();
|
|
|
|
|
- });
|
|
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
];
|
|
];
|
|
@@ -231,23 +261,31 @@ const orderEditAction = [
|
|
|
label: t("common.saveText"),
|
|
label: t("common.saveText"),
|
|
|
icon: "iconsave-01",
|
|
icon: "iconsave-01",
|
|
|
clickFunc: item => {
|
|
clickFunc: item => {
|
|
|
- let save_data =
|
|
|
|
|
- detailType.value === 2
|
|
|
|
|
- ? LjDetailRightRef.value?._mainData
|
|
|
|
|
- : detailType.value === 1
|
|
|
|
|
- ? LjDetailMidRef.value?._mainData
|
|
|
|
|
- : LjDetailLeftRef.value?._mainData;
|
|
|
|
|
- if (orderStatus.value == "new") {
|
|
|
|
|
- save_data =
|
|
|
|
|
- detailType.value === 2
|
|
|
|
|
- ? LjDetailRightRef.value?._mainData
|
|
|
|
|
- : detailType.value === 1
|
|
|
|
|
- ? LjDetailMidRef.value?._mainData
|
|
|
|
|
- : LjDetailLeftRef.value?._mainData;
|
|
|
|
|
|
|
+ let save_data = null;
|
|
|
|
|
+ switch (detailType.value) {
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ save_data = LjDetailLeftRef.value?._mainData;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ save_data = LjDetailMidRef.value?._mainData;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 2:
|
|
|
|
|
+ save_data = LjDetailRightRef.value?._mainData;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 3:
|
|
|
|
|
+ save_data = LjDetailBottomRef.value?._mainData;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (detailType.value === 3) {
|
|
|
|
|
+ fSave(detailType.value, { bomList: [Object.assign({}, mainData.value, save_data)] }).then(() => {
|
|
|
|
|
+ LjDrawerRef.value.hide();
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ fSave(detailType.value, { configure: Object.assign({}, mainData.value, save_data) }).then(() => {
|
|
|
|
|
+ LjDrawerRef.value.hide();
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
- fSave(detailType.value, { configure: Object.assign({}, mainData.value, save_data) }).then(() => {
|
|
|
|
|
- LjDrawerRef.value.hide();
|
|
|
|
|
- });
|
|
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
];
|
|
];
|
|
@@ -274,6 +312,10 @@ const getCodeMxData = (params: any) => {
|
|
|
return getConfigureCodeMxList(params);
|
|
return getConfigureCodeMxList(params);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const getCodeMxBomData = (params: any) => {
|
|
|
|
|
+ return getConfigureCodeMxBomList(params);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const callback_left = (data: any) => {
|
|
const callback_left = (data: any) => {
|
|
|
// 选中第一列
|
|
// 选中第一列
|
|
|
if (data.datatable && data.datatable.length) {
|
|
if (data.datatable && data.datatable.length) {
|
|
@@ -294,6 +336,15 @@ const callback_mid = (data: any) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const callback_right = (data: any) => {
|
|
const callback_right = (data: any) => {
|
|
|
|
|
+ if (data.datatable && data.datatable.length) {
|
|
|
|
|
+ let row = data.datatable[0];
|
|
|
|
|
+ initParams_bottom.value.pzid = Number(row.pzid);
|
|
|
|
|
+ initParams_bottom.value.printid = Number(row.printid);
|
|
|
|
|
+ }
|
|
|
|
|
+ return dataCallback(data);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const callback_bottom = (data: any) => {
|
|
|
return dataCallback(data);
|
|
return dataCallback(data);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -339,6 +390,14 @@ const handleDBlClickRightTable = ({ row, rowIndex, $rowIndex, column, columnInde
|
|
|
LjDrawerRef.value.show();
|
|
LjDrawerRef.value.show();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const handleDBlClickBottomTable = ({ row, rowIndex, $rowIndex, column, columnIndex, $columnIndex, $event }: any) => {
|
|
|
|
|
+ // 弹窗
|
|
|
|
|
+ mainData.value = cloneDeep(row);
|
|
|
|
|
+ detailType.value = 3;
|
|
|
|
|
+ orderStatus.value = "edit";
|
|
|
|
|
+ LjDrawerRef.value.show();
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const handleOpenNewLeftTable = () => {
|
|
const handleOpenNewLeftTable = () => {
|
|
|
mainData.value = {
|
|
mainData.value = {
|
|
|
contfigtypeid: 0
|
|
contfigtypeid: 0
|
|
@@ -368,6 +427,16 @@ const handleOpenNewRightTable = () => {
|
|
|
LjDrawerRef.value.show();
|
|
LjDrawerRef.value.show();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const handleOpenNewBottomTable = () => {
|
|
|
|
|
+ mainData.value = {
|
|
|
|
|
+ pzid: initParams_bottom.value.pzid,
|
|
|
|
|
+ printid: initParams_bottom.value.printid
|
|
|
|
|
+ };
|
|
|
|
|
+ detailType.value = 3;
|
|
|
|
|
+ orderStatus.value = "new";
|
|
|
|
|
+ LjDrawerRef.value.show();
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const handleClickLeftTable = ({ row, rowIndex, $rowIndex, column, columnIndex, $columnIndex, $event }: any) => {
|
|
const handleClickLeftTable = ({ row, rowIndex, $rowIndex, column, columnIndex, $columnIndex, $event }: any) => {
|
|
|
initParams_mid.value.typeid = Number(row.contfigtypeid);
|
|
initParams_mid.value.typeid = Number(row.contfigtypeid);
|
|
|
};
|
|
};
|
|
@@ -377,6 +446,11 @@ const handleClickMidTable = ({ row, rowIndex, $rowIndex, column, columnIndex, $c
|
|
|
initParams_right.value.typeid = Number(row.typeid);
|
|
initParams_right.value.typeid = Number(row.typeid);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const handleClickRightTable = ({ row, rowIndex, $rowIndex, column, columnIndex, $columnIndex, $event }: any) => {
|
|
|
|
|
+ initParams_bottom.value.pzid = Number(row.pzid);
|
|
|
|
|
+ initParams_bottom.value.printid = Number(row.printid);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const tableEvents_left = {
|
|
const tableEvents_left = {
|
|
|
"cell-dblclick": handleDBlClickLeftTable,
|
|
"cell-dblclick": handleDBlClickLeftTable,
|
|
|
"cell-click": handleClickLeftTable
|
|
"cell-click": handleClickLeftTable
|
|
@@ -387,7 +461,11 @@ const tableEvents_mid = {
|
|
|
};
|
|
};
|
|
|
// 返回绑定的事件
|
|
// 返回绑定的事件
|
|
|
const tableEvents_right = {
|
|
const tableEvents_right = {
|
|
|
- "cell-dblclick": handleDBlClickRightTable
|
|
|
|
|
|
|
+ "cell-dblclick": handleDBlClickRightTable,
|
|
|
|
|
+ "cell-click": handleClickRightTable
|
|
|
|
|
+};
|
|
|
|
|
+const tableEvents_bottom = {
|
|
|
|
|
+ "cell-dblclick": handleDBlClickBottomTable
|
|
|
// "cell-click": handleClickTable
|
|
// "cell-click": handleClickTable
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|