lxf 1 anno fa
parent
commit
2a486d911e

+ 203 - 12
src/views/production/warehouse/outbound/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <el-card class="box-card">
-      <el-tabs v-model="activeName" type="card">
+      <el-tabs v-model="activeName" type="card" @tab-change="changeActiveName">
         <el-tab-pane label="出库单" name="first">
           <byTable
             :source="sourceList.data"
@@ -25,7 +25,24 @@
             </template>
           </byTable>
         </el-tab-pane>
-        <el-tab-pane label="出库明细" name="second"> </el-tab-pane>
+        <el-tab-pane label="出库明细" name="second">
+          <byTable
+            :source="sourceListTwo.data"
+            :pagination="sourceListTwo.pagination"
+            :config="configTwo"
+            :loading="loading"
+            :searchConfig="searchConfigTwo"
+            highlight-current-row
+            :action-list="[
+              {
+                text: '出库登记',
+                action: () => clickModal(),
+              },
+            ]"
+            @get-list="getListTwo"
+            @clickReset="clickResetTwo">
+          </byTable>
+        </el-tab-pane>
       </el-tabs>
     </el-card>
   </div>
@@ -33,7 +50,6 @@
 
 <script setup>
 import byTable from "@/components/byTable/index";
-// import { ElMessage } from "element-plus";
 
 const { proxy } = getCurrentInstance();
 const activeName = ref("first");
@@ -53,6 +69,24 @@ const sourceList = ref({
     endTime: "",
   },
 });
+const sourceListTwo = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    type: "0",
+    code: "",
+    purchaseCode: "",
+    bomSpecCode: "",
+    bomSpecName: "",
+    departmentId: "",
+    warehouseName: "",
+    detailType: "",
+    beginTime: "",
+    endTime: "",
+  },
+});
 const loading = ref(false);
 const searchConfig = computed(() => {
   return [
@@ -85,6 +119,52 @@ const searchConfig = computed(() => {
     },
   ];
 });
+const searchConfigTwo = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "purchaseCode",
+      label: "采购",
+    },
+    {
+      type: "input",
+      prop: "code",
+      label: "出库单号",
+    },
+    {
+      type: "input",
+      prop: "bomSpecCode",
+      label: "品号",
+    },
+    {
+      type: "input",
+      prop: "bomSpecName",
+      label: "品名",
+    },
+    {
+      type: "select",
+      prop: "departmentId",
+      data: departmentList.value,
+      label: "事业部",
+    },
+    {
+      type: "input",
+      prop: "warehouseName",
+      label: "仓库名称",
+    },
+    {
+      type: "select",
+      prop: "detailType",
+      dictKey: "put_stock_type",
+      label: "出库类型",
+    },
+    {
+      type: "date",
+      propList: ["beginTime", "endTime"],
+      label: "日期",
+    },
+  ];
+});
 const config = computed(() => {
   return [
     {
@@ -132,7 +212,96 @@ const config = computed(() => {
         width: 140,
       },
       render(val) {
-        return proxy.dictKeyValue(val, proxy.useUserStore().allDict["come_stock_type"]);
+        return proxy.dictKeyValue(val, proxy.useUserStore().allDict["put_stock_type"]);
+      },
+    },
+    {
+      attrs: {
+        label: "出库时间",
+        prop: "createTime",
+        width: 160,
+        align: "center",
+      },
+    },
+    {
+      attrs: {
+        label: "出库申请人",
+        prop: "applicant",
+        width: 160,
+        align: "center",
+      },
+    },
+  ];
+});
+const configTwo = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "出库单号",
+        prop: "code",
+        "min-width": 160,
+      },
+    },
+    {
+      attrs: {
+        label: "采购单号",
+        prop: "purchaseCode",
+        "min-width": 160,
+      },
+    },
+    {
+      attrs: {
+        label: "归属事业部",
+        prop: "departmentName",
+        "min-width": 160,
+      },
+    },
+    {
+      attrs: {
+        label: "仓库类型",
+        prop: "warehouseType",
+        width: 140,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, proxy.useUserStore().allDict["warehouse_type"]);
+      },
+    },
+    {
+      attrs: {
+        label: "仓库名称",
+        prop: "warehouseName",
+        "min-width": 160,
+      },
+    },
+    {
+      attrs: {
+        label: "出库类型",
+        prop: "detailType",
+        width: 140,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, proxy.useUserStore().allDict["put_stock_type"]);
+      },
+    },
+    {
+      attrs: {
+        label: "品号",
+        prop: "bomSpecCode",
+        "min-width": 160,
+      },
+    },
+    {
+      attrs: {
+        label: "出库时间",
+        prop: "bomSpecName",
+        "min-width": 320,
+      },
+    },
+    {
+      attrs: {
+        label: "数量",
+        prop: "quantity",
+        width: 120,
       },
     },
     {
@@ -175,6 +344,34 @@ getList();
 const clickReset = () => {
   getList("", true);
 };
+const getListTwo = async (req, status) => {
+  if (status) {
+    sourceListTwo.value.pagination = {
+      pageNum: sourceListTwo.value.pagination.pageNum,
+      pageSize: sourceListTwo.value.pagination.pageSize,
+    };
+  } else {
+    sourceListTwo.value.pagination = { ...sourceListTwo.value.pagination, ...req };
+  }
+  loading.value = true;
+  proxy.post("/inOutStorage/page", sourceListTwo.value.pagination).then((res) => {
+    sourceListTwo.value.data = res.rows;
+    sourceListTwo.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+const clickResetTwo = () => {
+  getListTwo("", true);
+};
+const changeActiveName = (val) => {
+  if (val === "first") {
+    getList();
+  } else {
+    getListTwo();
+  }
+};
 const getDemandData = () => {
   proxy.post("/department/page", { pageNum: 1, pageSize: 999 }).then((res) => {
     if (res.rows && res.rows.length > 0) {
@@ -191,14 +388,8 @@ const getDemandData = () => {
 };
 getDemandData();
 const clickCode = (row) => {
-  console.log(row);
-  // proxy.$router.replace({
-  //   path: "/production/warehouse/warehouse-inventory",
-  //   query: {
-  //     backupDate: row.backupDate,
-  //     backupDateStr: row.backupDateStr,
-  //   },
-  // });
+  activeName.val = second;
+  getListTwo({ code: row.code });
 };
 const clickModal = () => {
   proxy.$router.replace({

+ 202 - 11
src/views/production/warehouse/putInStorage/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <el-card class="box-card">
-      <el-tabs v-model="activeName" type="card">
+      <el-tabs v-model="activeName" type="card" @tab-change="changeActiveName">
         <el-tab-pane label="入库单" name="first">
           <byTable
             :source="sourceList.data"
@@ -25,7 +25,24 @@
             </template>
           </byTable>
         </el-tab-pane>
-        <el-tab-pane label="入库明细" name="second"> </el-tab-pane>
+        <el-tab-pane label="入库明细" name="second">
+          <byTable
+            :source="sourceListTwo.data"
+            :pagination="sourceListTwo.pagination"
+            :config="configTwo"
+            :loading="loading"
+            :searchConfig="searchConfigTwo"
+            highlight-current-row
+            :action-list="[
+              {
+                text: '入库登记',
+                action: () => clickModal(),
+              },
+            ]"
+            @get-list="getListTwo"
+            @clickReset="clickResetTwo">
+          </byTable>
+        </el-tab-pane>
       </el-tabs>
     </el-card>
   </div>
@@ -33,7 +50,6 @@
 
 <script setup>
 import byTable from "@/components/byTable/index";
-// import { ElMessage } from "element-plus";
 
 const { proxy } = getCurrentInstance();
 const activeName = ref("first");
@@ -53,6 +69,24 @@ const sourceList = ref({
     endTime: "",
   },
 });
+const sourceListTwo = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    type: "1",
+    code: "",
+    purchaseCode: "",
+    bomSpecCode: "",
+    bomSpecName: "",
+    departmentId: "",
+    warehouseName: "",
+    detailType: "",
+    beginTime: "",
+    endTime: "",
+  },
+});
 const loading = ref(false);
 const searchConfig = computed(() => {
   return [
@@ -85,6 +119,52 @@ const searchConfig = computed(() => {
     },
   ];
 });
+const searchConfigTwo = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "purchaseCode",
+      label: "采购",
+    },
+    {
+      type: "input",
+      prop: "code",
+      label: "入库单号",
+    },
+    {
+      type: "input",
+      prop: "bomSpecCode",
+      label: "品号",
+    },
+    {
+      type: "input",
+      prop: "bomSpecName",
+      label: "品名",
+    },
+    {
+      type: "select",
+      prop: "departmentId",
+      data: departmentList.value,
+      label: "事业部",
+    },
+    {
+      type: "input",
+      prop: "warehouseName",
+      label: "仓库名称",
+    },
+    {
+      type: "select",
+      prop: "detailType",
+      dictKey: "put_stock_type",
+      label: "入库类型",
+    },
+    {
+      type: "date",
+      propList: ["beginTime", "endTime"],
+      label: "日期",
+    },
+  ];
+});
 const config = computed(() => {
   return [
     {
@@ -153,6 +233,95 @@ const config = computed(() => {
     },
   ];
 });
+const configTwo = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "入库单号",
+        prop: "code",
+        "min-width": 160,
+      },
+    },
+    {
+      attrs: {
+        label: "采购单号",
+        prop: "purchaseCode",
+        "min-width": 160,
+      },
+    },
+    {
+      attrs: {
+        label: "归属事业部",
+        prop: "departmentName",
+        "min-width": 160,
+      },
+    },
+    {
+      attrs: {
+        label: "仓库类型",
+        prop: "warehouseType",
+        width: 140,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, proxy.useUserStore().allDict["warehouse_type"]);
+      },
+    },
+    {
+      attrs: {
+        label: "仓库名称",
+        prop: "warehouseName",
+        "min-width": 160,
+      },
+    },
+    {
+      attrs: {
+        label: "入库类型",
+        prop: "detailType",
+        width: 140,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, proxy.useUserStore().allDict["put_stock_type"]);
+      },
+    },
+    {
+      attrs: {
+        label: "品号",
+        prop: "bomSpecCode",
+        "min-width": 160,
+      },
+    },
+    {
+      attrs: {
+        label: "入库时间",
+        prop: "bomSpecName",
+        "min-width": 320,
+      },
+    },
+    {
+      attrs: {
+        label: "数量",
+        prop: "quantity",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "入库时间",
+        prop: "createTime",
+        width: 160,
+        align: "center",
+      },
+    },
+    {
+      attrs: {
+        label: "入库申请人",
+        prop: "applicant",
+        width: 160,
+        align: "center",
+      },
+    },
+  ];
+});
 const getList = async (req, status) => {
   if (status) {
     sourceList.value.pagination = {
@@ -175,6 +344,34 @@ getList();
 const clickReset = () => {
   getList("", true);
 };
+const getListTwo = async (req, status) => {
+  if (status) {
+    sourceListTwo.value.pagination = {
+      pageNum: sourceListTwo.value.pagination.pageNum,
+      pageSize: sourceListTwo.value.pagination.pageSize,
+    };
+  } else {
+    sourceListTwo.value.pagination = { ...sourceListTwo.value.pagination, ...req };
+  }
+  loading.value = true;
+  proxy.post("/inOutStorage/page", sourceListTwo.value.pagination).then((res) => {
+    sourceListTwo.value.data = res.rows;
+    sourceListTwo.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+const clickResetTwo = () => {
+  getListTwo("", true);
+};
+const changeActiveName = (val) => {
+  if (val === "first") {
+    getList();
+  } else {
+    getListTwo();
+  }
+};
 const getDemandData = () => {
   proxy.post("/department/page", { pageNum: 1, pageSize: 999 }).then((res) => {
     if (res.rows && res.rows.length > 0) {
@@ -191,14 +388,8 @@ const getDemandData = () => {
 };
 getDemandData();
 const clickCode = (row) => {
-  console.log(row);
-  // proxy.$router.replace({
-  //   path: "/production/warehouse/warehouse-inventory",
-  //   query: {
-  //     backupDate: row.backupDate,
-  //     backupDateStr: row.backupDateStr,
-  //   },
-  // });
+  activeName.val = second
+  getListTwo({ code: row.code });
 };
 const clickModal = () => {
   proxy.$router.replace({