Преглед изворни кода

集团SKU增加批量替换, 区分集团非集团数据

lxf пре 1 година
родитељ
комит
5f56bbc64b

+ 11 - 7
src/components/makeProduct/modification/index.vue

@@ -68,6 +68,9 @@ import SelectBOM from "@/views/group/BOM/management/index";
 import { ElMessage, ElMessageBox } from "element-plus";
 
 const { proxy } = getCurrentInstance();
+const props = defineProps({
+  type: String,
+});
 const sourceList = ref({
   data: [],
   pagination: {
@@ -80,6 +83,7 @@ const sourceList = ref({
     length: "",
     width: "",
     height: "",
+    type: props.type,
   },
 });
 const loading = ref(false);
@@ -171,13 +175,13 @@ const handleReplace = () => {
       cancelButtonText: "取消",
       type: "warning",
     })
-    .then(() => {
-      proxy.post("/sku/replacePrincipalMaterial", { ...sourceList.value.pagination, replaceBomSpecId: selectData.value[0].id }).then(() => {
-        ElMessage({ message: "替换成功", type: "success" });
-        getList();
-      });
-    })
-    .catch(() => {});
+      .then(() => {
+        proxy.post("/sku/replacePrincipalMaterial", { ...sourceList.value.pagination, replaceBomSpecId: selectData.value[0].id }).then(() => {
+          ElMessage({ message: "替换成功", type: "success" });
+          getList();
+        });
+      })
+      .catch(() => {});
   } else {
     return ElMessage("请选择BOM");
   }

+ 19 - 0
src/views/group/product/groupSKU/index.vue

@@ -13,6 +13,10 @@
             text: '添加产品',
             action: () => clickModal(),
           },
+          {
+            text: '批量修改',
+            action: () => batchModification(),
+          },
           // {
           //   text: '操作日志',
           //   action: () => viewLogs(),
@@ -78,6 +82,10 @@
         <el-button @click="openLogs = false" size="large">关 闭</el-button>
       </template>
     </el-dialog>
+
+    <el-dialog title="批量修改" v-if="openModification" v-model="openModification" width="96%">
+      <Modification :type="1" @clickCancel="clickModificationCancel"></Modification>
+    </el-dialog>
   </div>
 </template>
 
@@ -85,6 +93,7 @@
 import byTable from "@/components/byTable/index";
 import MakeSKU from "@/components/makeGroupProduct/index";
 import { ElMessage, ElMessageBox } from "element-plus";
+import Modification from "@/components/makeProduct/modification/index";
 
 const { proxy } = getCurrentInstance();
 const sourceList = ref({
@@ -344,6 +353,16 @@ const getLogsList = async (req) => {
     }, 200);
   });
 };
+const openModification = ref(false);
+const batchModification = () => {
+  openModification.value = true;
+};
+const clickModificationCancel = (status) => {
+  openModification.value = false;
+  if (status) {
+    getList();
+  }
+};
 </script>
 
 <style lang="scss" scoped>

+ 1 - 1
src/views/group/product/management/index.vue

@@ -89,7 +89,7 @@
     </el-dialog>
 
     <el-dialog title="批量修改" v-if="openModification" v-model="openModification" width="96%">
-      <Modification @clickCancel="clickModificationCancel"></Modification>
+      <Modification :type="0" @clickCancel="clickModificationCancel"></Modification>
     </el-dialog>
   </div>
 </template>