Sfoglia il codice sorgente

Merge branch '合并生产工单' into 测试

lxf 1 anno fa
parent
commit
3f5507a283

+ 5 - 4
src/components/makeProduct/modification/index.vue

@@ -123,7 +123,12 @@ const searchConfig = computed(() => {
 const config = computed(() => {
   return [];
 });
+const selectData = ref([]);
+const handleBOM = () => {
+  openBOM.value = true;
+};
 const getList = async (req, status) => {
+  selectData.value = [];
   if (status) {
     sourceList.value.pagination = {
       pageNum: sourceList.value.pagination.pageNum,
@@ -152,10 +157,6 @@ const handleSizeChange = (val) => {
   getList({ pageNum: 1, pageSize: val });
 };
 const openBOM = ref(false);
-const selectData = ref([]);
-const handleBOM = () => {
-  openBOM.value = true;
-};
 const selectBOM = (item) => {
   selectData.value = [item];
   ElMessage({ message: "选择完成", type: "success" });

+ 5 - 4
src/components/makeProduct/modification/subsidiary.vue

@@ -139,7 +139,12 @@ const searchConfig = computed(() => {
 const config = computed(() => {
   return [];
 });
+const selectData = ref([]);
+const handleBOM = () => {
+  openBOM.value = true;
+};
 const getList = async (req, status) => {
+  selectData.value = [];
   if (status) {
     sourceList.value.pagination = {
       pageNum: sourceList.value.pagination.pageNum,
@@ -168,10 +173,6 @@ const handleSizeChange = (val) => {
   getList({ pageNum: 1, pageSize: val });
 };
 const openBOM = ref(false);
-const selectData = ref([]);
-const handleBOM = () => {
-  openBOM.value = true;
-};
 const selectBOM = (item) => {
   selectData.value = [item];
   ElMessage({ message: "选择完成", type: "success" });

+ 5 - 4
src/views/group/data-board/material-control-purchasing/index.vue

@@ -193,7 +193,12 @@ const config = computed(() => {
     },
   ];
 });
+const selectData = ref([]);
+const selectRow = (data) => {
+  selectData.value = data;
+};
 const getList = async (req, status) => {
+  selectData.value = [];
   if (status) {
     sourceList.value.pagination = {
       pageNum: sourceList.value.pagination.pageNum,
@@ -224,10 +229,6 @@ getList();
 const clickReset = () => {
   getList("", true);
 };
-const selectData = ref([]);
-const selectRow = (data) => {
-  selectData.value = data;
-};
 const cellClassName = ({ columnIndex, row }) => {
   if (columnIndex === 3 && row.inventoryQuantity < row.safetyInventoryQuantity) {
     return "colorDim";

+ 1 - 10
src/views/group/finance/purchase-warehousing/index.vue

@@ -191,16 +191,7 @@ const getList = async (req, status) => {
   }
   loading.value = true;
   proxy.post("/purchaseWarehousing/page", sourceList.value.pagination).then((res) => {
-    if (res.rows && res.rows.length > 0) {
-      sourceList.value.data = res.rows.map((item) => {
-        return {
-          ...item,
-          isCheck: true,
-        };
-      });
-    } else {
-      sourceList.value.data = [];
-    }
+    sourceList.value.data = res.rows;
     sourceList.value.pagination.total = res.total;
     setTimeout(() => {
       loading.value = false;

+ 1 - 10
src/views/group/finance/sales-revenue-cost/index.vue

@@ -292,16 +292,7 @@ const getList = async (req, status) => {
   }
   loading.value = true;
   proxy.post("/statementOfAccountMerge/salesRevenueCostPage", sourceList.value.pagination).then((res) => {
-    if (res.rows && res.rows.length > 0) {
-      sourceList.value.data = res.rows.map((item) => {
-        return {
-          ...item,
-          isCheck: true,
-        };
-      });
-    } else {
-      sourceList.value.data = [];
-    }
+    sourceList.value.data = res.rows;
     sourceList.value.pagination.total = res.total;
     setTimeout(() => {
       loading.value = false;

+ 1 - 10
src/views/group/finance/summary/index.vue

@@ -205,16 +205,7 @@ const getList = async (req, status) => {
   }
   loading.value = true;
   proxy.post("/statementOfAccountMerge/page", sourceList.value.pagination).then((res) => {
-    if (res.rows && res.rows.length > 0) {
-      sourceList.value.data = res.rows.map((item) => {
-        return {
-          ...item,
-          isCheck: true,
-        };
-      });
-    } else {
-      sourceList.value.data = [];
-    }
+    sourceList.value.data = res.rows;
     sourceList.value.pagination.total = res.total;
     setTimeout(() => {
       loading.value = false;

+ 5 - 4
src/views/group/limits-authority/role/index.vue

@@ -144,7 +144,12 @@ const config = computed(() => {
     },
   ];
 });
+const selectData = ref([]);
+const selectRow = (data) => {
+  selectData.value = data;
+};
 const getList = async (req, status) => {
+  selectData.value = [];
   if (status) {
     sourceList.value.pagination = {
       pageNum: sourceList.value.pagination.pageNum,
@@ -233,10 +238,6 @@ const submitForm = () => {
     });
   });
 };
-const selectData = ref([]);
-const selectRow = (data) => {
-  selectData.value = data;
-};
 const treeData = ref([]);
 const getSubset = (list, data) => {
   for (let i = 0; i < list.length; i++) {

+ 5 - 4
src/views/production/schedule/production-order/index.vue

@@ -327,7 +327,12 @@ const getDemandData = () => {
   });
 };
 getDemandData();
+const selectData = ref([]);
+const selectRow = (data) => {
+  selectData.value = data;
+};
 const getList = async (req, status) => {
+  selectData.value = [];
   if (status) {
     sourceList.value.pagination = {
       pageNum: sourceList.value.pagination.pageNum,
@@ -359,10 +364,6 @@ getList();
 const clickReset = () => {
   getList({ status: 30 }, true);
 };
-const selectData = ref([]);
-const selectRow = (data) => {
-  selectData.value = data;
-};
 const clickCode = (row) => {
   proxy.$router.replace({
     path: "/addOrder",

+ 67 - 9
src/views/production/schedule/production-work-order/index.vue

@@ -16,6 +16,11 @@
           text: '打印生产面单',
           action: () => clickSelectPrint(),
         },
+        {
+          text: '合并工单',
+          disabled: selectData.length < 2,
+          action: () => clickMerge(),
+        },
       ]"
       @get-list="getList"
       @clickReset="clickReset"
@@ -64,7 +69,7 @@
 import byTable from "/src/components/byTable/index";
 import { getNearDays } from "/src/utils/util";
 import QRCode from "qrcodejs2-fix";
-import { ElMessage } from "element-plus";
+import { ElMessage, ElMessageBox } from "element-plus";
 import CycleBarcode from "/src/components/CycleBarcode";
 
 const { proxy } = getCurrentInstance();
@@ -253,7 +258,12 @@ const config = computed(() => {
     },
   ];
 });
+const selectData = ref([]);
+const selectRow = (data) => {
+  selectData.value = data;
+};
 const getList = async (req, status) => {
+  selectData.value = [];
   if (status) {
     sourceList.value.pagination = {
       pageNum: sourceList.value.pagination.pageNum,
@@ -269,10 +279,17 @@ const getList = async (req, status) => {
   proxy.post("/productionWorkOrder/page", sourceList.value.pagination).then((res) => {
     if (res.rows && res.rows.length > 0) {
       sourceList.value.data = res.rows.map((item) => {
-        return {
-          ...item,
-          isCheck: true,
-        };
+        if (item.status == 0 && !item.type) {
+          return {
+            ...item,
+            isCheck: true,
+          };
+        } else {
+          return {
+            ...item,
+            isCheck: false,
+          };
+        }
       });
     } else {
       sourceList.value.data = [];
@@ -307,10 +324,6 @@ const printObj = ref({
   extraCss: "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
   extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
 });
-const selectData = ref([]);
-const selectRow = (data) => {
-  selectData.value = data;
-};
 const QRcodeList = ref([]);
 const clickPrint = (list) => {
   QRcodeList.value = list;
@@ -340,6 +353,48 @@ const clickSelectPrint = () => {
     return ElMessage("请选择需要打印的工单");
   }
 };
+const clickMerge = () => {
+  ElMessageBox.confirm("你是否确认此操作", "提示", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  })
+    .then(() => {
+      proxy
+        .post(
+          "/productionWorkOrder/combined",
+          selectData.value.map((item) => item.id)
+        )
+        .then(() => {
+          ElMessage({ message: "操作成功", type: "success" });
+          getList();
+        });
+    })
+    .catch(() => {});
+};
+watch(selectData, (newVal) => {
+  if (newVal && newVal.length > 0) {
+    sourceList.value.data.forEach((x) => {
+      if (x.status == 0 && !x.type) {
+        if (x.bomSpecCode === newVal[0].bomSpecCode && x.skuSpecCode === newVal[0].skuSpecCode) {
+          x.isCheck = true;
+        } else {
+          x.isCheck = false;
+        }
+      } else {
+        x.isCheck = false;
+      }
+    });
+  } else {
+    sourceList.value.data.forEach((x) => {
+      if (x.status == 0 && !x.type) {
+        x.isCheck = true;
+      } else {
+        x.isCheck = false;
+      }
+    });
+  }
+});
 </script>
 
 <style lang="scss" scoped>
@@ -375,4 +430,7 @@ const clickSelectPrint = () => {
     }
   }
 }
+:deep(.el-table__header-wrapper .el-checkbox) {
+  display: none;
+}
 </style>

+ 5 - 4
src/views/production/shipment/print-order/index.vue

@@ -454,7 +454,12 @@ const getDemandData = () => {
   });
 };
 getDemandData();
+const selectData = ref([]);
+const selectRow = (data) => {
+  selectData.value = data;
+};
 const getList = async (req, status) => {
+  selectData.value = [];
   if (status) {
     sourceList.value.pagination = {
       pageNum: sourceList.value.pagination.pageNum,
@@ -485,10 +490,6 @@ getList();
 const clickReset = () => {
   getList("", true);
 };
-const selectData = ref([]);
-const selectRow = (data) => {
-  selectData.value = data;
-};
 const clickCode = (row) => {
   proxy.$router.replace({
     path: "/order-detail",

+ 1 - 10
src/views/subsidiary/finance/summary/index.vue

@@ -172,16 +172,7 @@ const getList = async (req, status) => {
   }
   loading.value = true;
   proxy.post("/statementOfAccountMerge/page", sourceList.value.pagination).then((res) => {
-    if (res.rows && res.rows.length > 0) {
-      sourceList.value.data = res.rows.map((item) => {
-        return {
-          ...item,
-          isCheck: true,
-        };
-      });
-    } else {
-      sourceList.value.data = [];
-    }
+    sourceList.value.data = res.rows;
     sourceList.value.pagination.total = res.total;
     setTimeout(() => {
       loading.value = false;