Parcourir la source

Merge branch 'master' of http://36.137.93.232:3000/hf/byte-sailing-new

cz il y a 2 ans
Parent
commit
43c8099b37

+ 78 - 18
src/views/EHSD/procurement/handoverSlipEHSD/index.vue

@@ -20,20 +20,39 @@
         ]"
         @get-list="getList">
         <template #claimTime="{ item }">
-          <div>
+          <div style="width: 100%">
             <span v-if="item.claimTime">{{ item.claimTime }}</span>
             <span v-else>未到账</span>
           </div>
         </template>
+        <template #contractVersion="{ item }">
+          <div style="width: 100%">
+            <span v-if="item.contractVersion">V{{ item.contractVersion }}</span>
+          </div>
+        </template>
+        <template #timeSpent="{ item }">
+          <div style="width: 100%">已耗时</div>
+        </template>
       </byTable>
     </div>
 
-    <el-dialog title="交接单" v-if="openAllFile" v-model="openAllFile" width="500">
-      <div>
-        <div v-for="(file, index) in rowData.fileList" :key="index" style="padding: 8px 0;">
-          <a style="color: #409eff; cursor: pointer" @click="openFile(file.fileUrl)">{{ file.fileName }}</a>
-        </div>
-      </div>
+    <el-dialog title="交接单" v-if="openAllFile" v-model="openAllFile" width="600">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="rowData" ref="fileState">
+        <template #file>
+          <div>
+            <div v-for="(file, index) in rowData.fileList" :key="index" style="padding: 4px 0">
+              <a style="color: #409eff; cursor: pointer" @click="openFile(file.fileUrl)">{{ file.fileName }}</a>
+            </div>
+          </div>
+        </template>
+        <template #indication>
+          <div>
+            <div v-for="(file, index) in rowData.packageFileList" :key="index" style="padding: 4px 0">
+              <a style="color: #409eff; cursor: pointer" @click="openFile(file.fileUrl)">{{ file.fileName }}</a>
+            </div>
+          </div>
+        </template>
+      </byForm>
       <template #footer>
         <el-button @click="openAllFile = false" size="large">关 闭</el-button>
       </template>
@@ -44,6 +63,7 @@
 <script setup>
 import { computed, ref } from "vue";
 import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
 
 const { proxy } = getCurrentInstance();
 const sourceList = ref({
@@ -63,14 +83,7 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "订单类型",
-        prop: "orderType",
-        width: 140,
-      },
-    },
-    {
-      attrs: {
-        label: "外销合同编码",
+        label: "外销合同编号",
         prop: "contractCode",
         width: 180,
       },
@@ -92,7 +105,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "版本号",
-        prop: "contractVersion",
+        slot: "contractVersion",
         width: 100,
       },
     },
@@ -126,6 +139,13 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "已耗时",
+        slot: "timeSpent",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
         label: "交接单",
         width: 80,
         align: "center",
@@ -175,7 +195,7 @@ const config = computed(() => {
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/delivery/page", sourceList.value.pagination).then((res) => {
+  proxy.post("/delivery/contractHandoverPage", sourceList.value.pagination).then((res) => {
     sourceList.value.data = res.rows;
     sourceList.value.pagination.total = res.total;
     setTimeout(() => {
@@ -202,19 +222,59 @@ const selectRow = (data) => {
 };
 const rowData = ref({
   fileList: [],
+  packageFileList: [],
 });
 const openAllFile = ref(false);
 const checkTheTransferSlip = (item) => {
   rowData.value = item;
   rowData.value.fileList = [];
+  rowData.value.packageFileList = [];
   openAllFile.value = true;
-  proxy.post("/fileInfo/getList", { businessIdList: [item.contractId] }).then((fileObj) => {
+  proxy.post("/fileInfo/getList", { businessIdList: [item.contractId],fileType: 1 }).then((fileObj) => {
     rowData.value.fileList = fileObj[item.contractId] || [];
   });
+  proxy.post("/fileInfo/getList", { businessIdList: [item.contractId],fileType: 2 }).then((fileObj) => {
+    rowData.value.packageFileList = fileObj[item.contractId] || [];
+  });
 };
 const openFile = (path) => {
   window.open(path, "_blank");
 };
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const fileState = ref(null);
+const formConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "code",
+      label: "合同编号",
+      itemType: "text",
+      disabled: true,
+    },
+    {
+      type: "input",
+      prop: "buyCorporationName",
+      label: "客户名称",
+      itemType: "text",
+      disabled: true,
+    },
+    {
+      type: "slot",
+      slotName: "file",
+      label: "交接单",
+    },
+    {
+      type: "slot",
+      slotName: "indication",
+      label: "包装指示",
+    },
+  ];
+});
 </script>
 
 <style lang="scss" scoped>

+ 297 - 0
src/views/EHSD/procurement/handoverSlipSampleEHSD/index.vue

@@ -0,0 +1,297 @@
+<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 style="width: 100%">
+            <span v-if="item.claimTime">{{ item.claimTime }}</span>
+            <span v-else>未到账</span>
+          </div>
+        </template>
+        <template #contractVersion="{ item }">
+          <div style="width: 100%">
+            <span v-if="item.contractVersion">V{{ item.contractVersion }}</span>
+          </div>
+        </template>
+        <template #timeSpent="{ item }">
+          <div style="width: 100%">已耗时</div>
+        </template>
+      </byTable>
+    </div>
+
+    <el-dialog title="交接单" v-if="openAllFile" v-model="openAllFile" width="600">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="rowData" ref="fileState">
+        <template #file>
+          <div>
+            <div v-for="(file, index) in rowData.fileList" :key="index" style="padding: 4px 0">
+              <a style="color: #409eff; cursor: pointer" @click="openFile(file.fileUrl)">{{ file.fileName }}</a>
+            </div>
+          </div>
+        </template>
+        <template #indication>
+          <div>
+            <div v-for="(file, index) in rowData.packageFileList" :key="index" style="padding: 4px 0">
+              <a style="color: #409eff; cursor: pointer" @click="openFile(file.fileUrl)">{{ file.fileName }}</a>
+            </div>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="openAllFile = false" size="large">关 闭</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import { computed, ref } from "vue";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/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: "contractCode",
+        width: 180,
+      },
+    },
+    {
+      attrs: {
+        label: "合同到账时间",
+        slot: "claimTime",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "业务员",
+        prop: "userName",
+        width: 140,
+      },
+    },
+    {
+      attrs: {
+        label: "版本号",
+        slot: "contractVersion",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "产品编码",
+        prop: "productCode",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "产品名称",
+        prop: "productName",
+        "min-width": 220,
+      },
+    },
+    {
+      attrs: {
+        label: "单位",
+        prop: "productUnit",
+        width: 140,
+      },
+    },
+    {
+      attrs: {
+        label: "待采购数量",
+        prop: "expendQuantity",
+        width: 140,
+      },
+    },
+    {
+      attrs: {
+        label: "已耗时",
+        slot: "timeSpent",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "交接单",
+        width: 80,
+        align: "center",
+        fixed: "right",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "查看",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              checkTheTransferSlip(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/sampleHandoverList", 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;
+};
+const rowData = ref({
+  fileList: [],
+  packageFileList: [],
+});
+const openAllFile = ref(false);
+const checkTheTransferSlip = (item) => {
+  rowData.value = item;
+  rowData.value.fileList = [];
+  rowData.value.packageFileList = [];
+  openAllFile.value = true;
+  proxy.post("/fileInfo/getList", { businessIdList: [item.contractId],fileType: 1 }).then((fileObj) => {
+    rowData.value.fileList = fileObj[item.contractId] || [];
+  });
+  proxy.post("/fileInfo/getList", { businessIdList: [item.contractId],fileType: 2 }).then((fileObj) => {
+    rowData.value.packageFileList = fileObj[item.contractId] || [];
+  });
+};
+const openFile = (path) => {
+  window.open(path, "_blank");
+};
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const fileState = ref(null);
+const formConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "code",
+      label: "交接单编号",
+      itemType: "text",
+      disabled: true,
+    },
+    {
+      type: "input",
+      prop: "buyCorporationName",
+      label: "客户名称",
+      itemType: "text",
+      disabled: true,
+    },
+    {
+      type: "slot",
+      slotName: "file",
+      label: "交接单",
+    },
+    {
+      type: "slot",
+      slotName: "indication",
+      label: "包装指示",
+    },
+  ];
+});
+</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>

+ 2 - 2
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -317,7 +317,7 @@ const config = computed(() => {
   return [
     {
       attrs: {
-        label: "合同号",
+        label: "合同号",
         prop: "code",
         width: 180,
       },
@@ -561,7 +561,7 @@ const formConfig = computed(() => {
     {
       type: "input",
       prop: "code",
-      label: "样品单编号",
+      label: "合同编号",
       itemType: "text",
       disabled: true,
     },

+ 1 - 1
src/views/EHSD/saleContract/sampleEHSD/index.vue

@@ -132,7 +132,7 @@ const config = computed(() => {
   return [
     {
       attrs: {
-        label: "样品单号",
+        label: "样品单号",
         prop: "code",
         width: 180,
       },