|
@@ -138,6 +138,9 @@
|
|
|
<el-table-column label="包材配件/单品" min-width="400">
|
|
|
<template #default="{ row }">
|
|
|
<div style="width: 100%">
|
|
|
+ <div style="margin-bottom: 10px">
|
|
|
+ <el-button type="primary" @click="clickPackingFittings(index)">选择包材配件</el-button>
|
|
|
+ </div>
|
|
|
<el-table :data="row.orderSkuBomList" :row-style="{ height: '35px' }" header-row-class-name="tableHeader">
|
|
|
<el-table-column label="单价¥" width="120">
|
|
|
<template #default="props">
|
|
@@ -242,6 +245,13 @@
|
|
|
<el-button @click="openDrawingFile = false" size="large">关 闭</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog title="选择包材配件" v-if="openPackingFittings" v-model="openPackingFittings" width="90%">
|
|
|
+ <SelectBOM :selectStatus="true" :bomClassifyIdList="[2, 3]" @selectBOM="selectPackingFittings"></SelectBOM>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="openPackingFittings = false" size="large">关 闭</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -251,6 +261,7 @@ import { ElMessage } from "element-plus";
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
import useTagsViewStore from "/src/store/modules/tagsView";
|
|
|
import SelectPicture from "/src/components/select-picture/index.vue";
|
|
|
+import SelectBOM from "/src/views/group/BOM/management/index";
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const router = useRouter();
|
|
@@ -611,6 +622,36 @@ const calculatedAmount = () => {
|
|
|
);
|
|
|
formData.data.totalAmount = totalAmount;
|
|
|
};
|
|
|
+const rowIndex = ref(null);
|
|
|
+const openPackingFittings = ref(false);
|
|
|
+const clickPackingFittings = (index) => {
|
|
|
+ rowIndex.value = index;
|
|
|
+ openPackingFittings.value = true;
|
|
|
+};
|
|
|
+const selectPackingFittings = (data) => {
|
|
|
+ if (formData.data.orderSkuList[rowIndex.value].orderSkuBomList && formData.data.orderSkuList[rowIndex.value].orderSkuBomList.length > 0) {
|
|
|
+ let list = formData.data.orderSkuList[rowIndex.value].orderSkuBomList.filter((item) => item.bomSpecId === data.id);
|
|
|
+ if (list && list.length > 0) {
|
|
|
+ return ElMessage("包材配件已添加");
|
|
|
+ }
|
|
|
+ formData.data.orderSkuList[rowIndex.value].orderSkuBomList.push({
|
|
|
+ bomSpecId: data.id,
|
|
|
+ unitPrice: data.costPrice,
|
|
|
+ quantity: undefined,
|
|
|
+ bomSpecName: data.name,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ formData.data.orderSkuList[rowIndex.value].orderSkuBomList = [
|
|
|
+ {
|
|
|
+ bomSpecId: data.id,
|
|
|
+ unitPrice: data.costPrice,
|
|
|
+ quantity: undefined,
|
|
|
+ bomSpecName: data.name,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ ElMessage({ message: "添加成功", type: "success" });
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|