浏览代码

EHSD交接单

lxf 1 年之前
父节点
当前提交
5315bdcd28

+ 204 - 0
src/views/EHSD/procurement/handoverSlipEHSD/index.vue

@@ -0,0 +1,204 @@
+<template>
+  <div class="tenant">
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :table-events="{
+          select: selectRow,
+          'select-all': selectRow,
+        }"
+        :action-list="[
+          {
+            text: '采购',
+            disabled: selectData.length === 0,
+            action: () => clickPurchase(),
+          },
+        ]"
+        @get-list="getList">
+        <template #claimTime="{ item }">
+          <div>
+            <span v-if="item.claimTime">{{ item.claimTime }}</span>
+            <span v-else>未到账</span>
+          </div>
+        </template>
+      </byTable>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { computed, ref } from "vue";
+import byTable from "@/components/byTable/index";
+
+const { proxy } = getCurrentInstance();
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+  },
+});
+const loading = ref(false);
+const config = computed(() => {
+  return [
+    {
+      type: "selection",
+    },
+    {
+      attrs: {
+        label: "订单类型",
+        prop: "orderType",
+        width: 140,
+      },
+    },
+    {
+      attrs: {
+        label: "外销合同编码",
+        prop: "contractCode",
+        width: 180,
+      },
+    },
+    {
+      attrs: {
+        label: "合同到账时间",
+        slot: "claimTime",
+      },
+    },
+    {
+      attrs: {
+        label: "业务员",
+        prop: "userName",
+      },
+    },
+    {
+      attrs: {
+        label: "版本号",
+        prop: "contractVersion",
+      },
+    },
+    {
+      attrs: {
+        label: "产品编码",
+        prop: "productCode",
+      },
+    },
+    {
+      attrs: {
+        label: "产品名称",
+        prop: "productName",
+      },
+    },
+    {
+      attrs: {
+        label: "单位",
+        prop: "productUnit",
+      },
+    },
+    {
+      attrs: {
+        label: "待采购数量",
+        prop: "expendQuantity",
+      },
+    },
+    {
+      attrs: {
+        label: "交接单",
+        width: 80,
+        align: "center",
+        fixed: "right",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "查看",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              clickPurchase(row);
+            },
+          },
+        ];
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: 80,
+        align: "center",
+        fixed: "right",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "采购",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              clickPurchase(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/delivery/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getList();
+const clickPurchase = (item) => {
+  console.log(item, selectData.value);
+  // proxy.$router.replace({
+  //   path: "/platform_manage/process/processApproval",
+  //   query: {
+  //     flowKey: "contract_flow",
+  //     flowName: "销售合同审批流程",
+  //     random: proxy.random(),
+  //     tenantType: "EHSD",
+  //   },
+  // });
+};
+const selectData = ref([]);
+const selectRow = (data) => {
+  selectData.value = data;
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+.baseRow {
+  min-height: 24px;
+  border-top: 1px solid black;
+  border-left: 1px solid black;
+}
+.contentRow {
+  border-right: 1px solid black;
+  line-height: 24px;
+  padding-left: 4px;
+}
+</style>

+ 9 - 3
src/views/purchaseManage/purchaseManage/handoverSlip/index.vue

@@ -23,6 +23,12 @@
         },
       ]"
       @get-list="getList">
+      <template #claimTime="{ item }">
+        <div>
+          <span v-if="item.claimTime">{{ item.claimTime }}</span>
+          <span v-else>未到账</span>
+        </div>
+      </template>
     </byTable>
 
     <el-dialog title="转生产" v-if="dialogVisible" v-model="dialogVisible" width="1200" v-loading="loadingDialog">
@@ -100,7 +106,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "合同到账时间",
-        prop: "subscribeCode",
+        slot: "claimTime",
       },
     },
     {
@@ -205,7 +211,7 @@ const start = () => {
       path: "/platform_manage/process/processApproval",
       query: {
         flowKey: "purchase_flow",
-        type: 'handoverSlip',
+        type: "handoverSlip",
         ids,
       },
     });
@@ -294,7 +300,7 @@ const transferToProduction = (row) => {
 const submitForm = () => {
   submit.value.handleSubmit(() => {
     if (!(formData.data.list && formData.data.list.length > 0)) {
-      return ElMessage('请至少添加一条产品明细')
+      return ElMessage("请至少添加一条产品明细");
     }
     loadingDialog.value = true;
     proxy.post("/workOrder/addBatch", formData.data.list).then(