Bladeren bron

Merge branch '合并生产工单'

lxf 1 jaar geleden
bovenliggende
commit
49874ae463

+ 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

@@ -231,7 +231,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,
@@ -264,10 +269,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

@@ -206,16 +206,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",

+ 103 - 47
src/views/production/schedule/production-work-order/index.vue

@@ -16,10 +16,14 @@
           text: '打印生产面单',
           action: () => clickSelectPrint(),
         },
+        {
+          text: '合并工单',
+          disabled: selectData.length < 2,
+          action: () => clickMerge(),
+        },
       ]"
       @get-list="getList"
-      @clickReset="clickReset"
-      @changeRadioGroup="changeRadioGroup">
+      @clickReset="clickReset">
       <template #code="{ item }">
         <div>
           <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickCode(item)">{{ item.code }}</a>
@@ -62,12 +66,37 @@
 
 <script setup>
 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();
+const statusList = ref([
+  {
+    dictKey: 0,
+    dictValue: "待投产",
+  },
+  {
+    dictKey: 1,
+    dictValue: "已扫描",
+  },
+  {
+    dictKey: 2,
+    dictValue: "生产中",
+  },
+  {
+    dictKey: 3,
+    dictValue: "生产完成",
+  },
+  {
+    dictKey: 4,
+    dictValue: "生产异常",
+  },
+  {
+    dictKey: 5,
+    dictValue: "重新排单",
+  },
+]);
 const sourceList = ref({
   data: [],
   pagination: {
@@ -81,9 +110,7 @@ const sourceList = ref({
     bomSpecCode: "",
     bomSpecName: "",
     productionWorkOrderCode: "",
-    beginTime: "",
-    endTime: "",
-    type: 3,
+    status: [0, 4],
   },
 });
 const loading = ref(false);
@@ -125,28 +152,11 @@ const searchConfig = computed(() => {
       label: "工单号",
     },
     {
-      type: "radio-group",
-      prop: "type",
-      label: "交期",
-      data: [
-        {
-          dictKey: 1,
-          dictValue: "近3天",
-        },
-        {
-          dictKey: 3,
-          dictValue: "近7天",
-        },
-        {
-          dictKey: 15,
-          dictValue: "近31天",
-        },
-      ],
-    },
-    {
-      type: "date",
-      propList: ["beginTime", "endTime"],
-      label: "日期",
+      type: "select",
+      prop: "status",
+      label: "生产状态",
+      data: statusList.value,
+      multiple: true,
     },
   ];
 });
@@ -214,9 +224,7 @@ const config = computed(() => {
         width: 80,
       },
       render(val) {
-        if (val == 0) {
-          return "待投产";
-        }
+        return proxy.dictKeyValue(val, statusList.value);
       },
     },
     {
@@ -253,14 +261,17 @@ 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,
       pageSize: sourceList.value.pagination.pageSize,
-      type: 3,
-      beginTime: getNearDays(3).beginTime,
-      endTime: getNearDays(3).endTime,
+      status: [0, 4],
     };
   } else {
     sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
@@ -269,10 +280,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 = [];
@@ -283,13 +301,10 @@ const getList = async (req, status) => {
     }, 200);
   });
 };
-getList({ beginTime: getNearDays(3).beginTime, endTime: getNearDays(3).endTime });
+getList();
 const clickReset = () => {
   getList("", true);
 };
-const changeRadioGroup = () => {
-  getList({ beginTime: getNearDays(sourceList.value.pagination.type).beginTime, endTime: getNearDays(sourceList.value.pagination.type).endTime });
-};
 const clickCode = (row) => {
   proxy.$router.replace({
     path: "/addOrder",
@@ -307,10 +322,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 +351,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 +428,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;