lxf преди 1 година
родител
ревизия
a94754ec53
променени са 1 файла, в които са добавени 290 реда и са изтрити 0 реда
  1. 290 0
      src/views/group/purchase/contract/index.vue

+ 290 - 0
src/views/group/purchase/contract/index.vue

@@ -0,0 +1,290 @@
+<template>
+  <div>
+    <el-card class="box-card">
+      <el-tabs v-model="activeName" type="card" @tab-change="changeActiveName">
+        <el-tab-pane label="待采购列表" name="first">
+          <byTable
+            :source="sourceList.data"
+            :pagination="sourceList.pagination"
+            :config="config"
+            :loading="loading"
+            :searchConfig="searchConfig"
+            highlight-current-row
+            @get-list="getList"
+            @clickReset="clickReset">
+            <template #code="{ item }">
+              <div>
+                <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickCode(item)">{{ item.code }}</a>
+              </div>
+            </template>
+          </byTable>
+        </el-tab-pane>
+        <el-tab-pane label="采购合同" name="second">
+          <!-- <byTable
+            :source="sourceListTwo.data"
+            :pagination="sourceListTwo.pagination"
+            :config="configTwo"
+            :loading="loading"
+            :searchConfig="searchConfig"
+            highlight-current-row
+            @get-list="getListTwo"
+            @clickReset="clickResetTwo">
+          </byTable> -->
+        </el-tab-pane>
+      </el-tabs>
+    </el-card>
+  </div>
+</template>
+
+<script setup>
+import byTable from "@/components/byTable/index";
+
+const { proxy } = getCurrentInstance();
+const activeName = ref("first");
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    code: "",
+    beginTime: "",
+    endTime: "",
+    flowStatus: "2",
+  },
+});
+const sourceListTwo = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    type: "1",
+    orderCode: "",
+    orderWlnCode: "",
+    bomSpecCode: "",
+    bomSpecName: "",
+    skuSpecCode: "",
+    skuSpecName: "",
+    departmentId: "",
+    warehouseName: "",
+    width: "",
+  },
+});
+const loading = ref(false);
+const searchConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "code",
+      label: "申购单号",
+    },
+    {
+      type: "date",
+      propList: ["beginTime", "endTime"],
+      label: "申购日期",
+    },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "申购单号",
+        slot: "code",
+        width: 220,
+      },
+    },
+    {
+      attrs: {
+        label: "申购时间",
+        prop: "applyTime",
+        align: "center",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "申购人",
+        prop: "applyName",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "申购说明",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: 80,
+        align: "center",
+        fixed: "right",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "采购",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              clickPurchase(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+const configTwo = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "设计图",
+        slot: "blueprint",
+        width: 80,
+      },
+    },
+    {
+      attrs: {
+        label: "事业部",
+        prop: "departmentName",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "BOM品号",
+        prop: "bomSpecCode",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "BOM品名",
+        prop: "bomSpecName",
+        "min-width": 240,
+      },
+    },
+    {
+      attrs: {
+        label: "SKU品号",
+        prop: "skuSpecCode",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "SKU品名",
+        prop: "skuSpecName",
+        "min-width": 200,
+      },
+    },
+    {
+      attrs: {
+        label: "尺寸(长宽高,cm)",
+        slot: "size",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "数量",
+        prop: "quantity",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "投产时间",
+        prop: "createTime",
+        width: 160,
+        align: "center",
+      },
+    },
+    {
+      attrs: {
+        label: "订单号",
+        prop: "orderCode",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "万里牛单号",
+        prop: "orderWlnCode",
+        width: 160,
+      },
+    },
+  ];
+});
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/applyBuy/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getList();
+const clickReset = () => {
+  getList("");
+};
+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("/stockPreparation/completedPage", 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 clickCode = (item) => {
+  proxy.$router.replace({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: "apply_buy",
+      flowName: "申购流程",
+      processType: "20",
+      id: item.id,
+      flowId: item.flowId,
+      random: proxy.random(),
+    },
+  });
+};
+const clickPurchase = (item) => {
+  console.log(item);
+};
+</script>
+
+<style lang="scss" scoped>
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>